Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_x
Modified Files:
Ecore_X.h ecore_x_dnd.c ecore_x_events.c ecore_x_icccm.c
ecore_x_private.h ecore_x_selection.c ecore_x_window.c
Log Message:
extra ecore_x and ecore_evas features for e17.. :)
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Ecore_X.h,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -3 -r1.72 -r1.73
--- Ecore_X.h 19 Nov 2004 05:49:15 -0000 1.72
+++ Ecore_X.h 23 Nov 2004 15:17:54 -0000 1.73
@@ -105,7 +105,22 @@
ECORE_X_EVENT_MASK_WINDOW_FOCUS_IN = (1L << 30),
ECORE_X_EVENT_MASK_WINDOW_FOCUS_OUT = (1L << 31)
} Ecore_X_Event_Mask;
-
+
+ typedef enum _Ecore_X_Gravity {
+ ECORE_X_GRAVITY_FORGET = 0,
+ ECORE_X_GRAVITY_UNMAP = 0,
+ ECORE_X_GRAVITY_NW = 1,
+ ECORE_X_GRAVITY_N = 2,
+ ECORE_X_GRAVITY_NE = 3,
+ ECORE_X_GRAVITY_W = 4,
+ ECORE_X_GRAVITY_CENTER = 5,
+ ECORE_X_GRAVITY_E = 6,
+ ECORE_X_GRAVITY_SW = 7,
+ ECORE_X_GRAVITY_S = 8,
+ ECORE_X_GRAVITY_SE = 9,
+ ECORE_X_GRAVITY_STATIC = 10
+ } Ecore_X_Gravity;
+
typedef struct _Ecore_X_Event_Key_Down Ecore_X_Event_Key_Down;
typedef struct _Ecore_X_Event_Key_Up Ecore_X_Event_Key_Up;
typedef struct _Ecore_X_Event_Mouse_Button_Down
Ecore_X_Event_Mouse_Button_Down;
@@ -806,7 +821,11 @@
void ecore_x_window_background_color_set(Ecore_X_Window win,
unsigned long color);
-
+void ecore_x_window_gravity_set(Ecore_X_Window win,
+ Ecore_X_Gravity grav);
+void ecore_x_window_pixel_gravity_set(Ecore_X_Window win,
+ Ecore_X_Gravity grav);
+
Ecore_X_Atom ecore_x_window_prop_any_type(void);
void ecore_x_window_prop_property_set(Ecore_X_Window win,
Ecore_X_Atom type, Ecore_X_Atom format, int size, void *data, int number);
int ecore_x_window_prop_property_get(Ecore_X_Window win,
Ecore_X_Atom property, Ecore_X_Atom type, int size, unsigned char **data, int
*num);
@@ -905,20 +924,6 @@
void ecore_x_window_client_sniff(Ecore_X_Window win);
Ecore_X_Atom ecore_x_atom_get(char *name);
- typedef enum _Ecore_X_Gravity {
- ECORE_X_GRAVITY_FORGET = 0,
- ECORE_X_GRAVITY_UNMAP = 0,
- ECORE_X_GRAVITY_NW = 1,
- ECORE_X_GRAVITY_N = 2,
- ECORE_X_GRAVITY_NE = 3,
- ECORE_X_GRAVITY_W = 4,
- ECORE_X_GRAVITY_CENTER = 5,
- ECORE_X_GRAVITY_E = 6,
- ECORE_X_GRAVITY_SW = 7,
- ECORE_X_GRAVITY_S = 8,
- ECORE_X_GRAVITY_SE = 9,
- ECORE_X_GRAVITY_STATIC = 10
- } Ecore_X_Gravity;
void
ecore_x_icccm_state_set(Ecore_X_Window win, Ecore_X_Window_State_Hint
state);
void
@@ -969,6 +974,10 @@
int *step_x, int *step_y,
double *min_aspect,
double *max_aspect);
+ void
+ ecore_x_icccm_title_set(Ecore_X_Window win, const char *t);
+ char *
+ ecore_x_icccm_title_get(Ecore_X_Window win);
void ecore_x_netwm_init(void);
void ecore_x_netwm_wm_identify(Ecore_X_Window root,
Ecore_X_Window check, const char *wm_name);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_dnd.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ecore_x_dnd.c 24 Oct 2004 05:52:07 -0000 1.9
+++ ecore_x_dnd.c 23 Nov 2004 15:17:55 -0000 1.10
@@ -1,6 +1,6 @@
-#include <Ecore.h>
+#include "Ecore.h"
#include "ecore_x_private.h"
-#include <Ecore_X.h>
+#include "Ecore_X.h"
static Ecore_X_Selection_Data _xdnd_selection;
static Ecore_X_DND_Protocol *_xdnd;
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_events.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- ecore_x_events.c 19 Nov 2004 05:49:15 -0000 1.36
+++ ecore_x_events.c 23 Nov 2004 15:17:55 -0000 1.37
@@ -5,7 +5,6 @@
#include "Ecore.h"
#include "ecore_x_private.h"
#include "Ecore_X.h"
-#include "Ecore_Txt.h"
static void _ecore_x_event_free_window_prop_name_class_change(void *data, void
*ev);
static void _ecore_x_event_free_window_prop_title_change(void *data, void *ev);
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_icccm.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- ecore_x_icccm.c 8 Nov 2004 00:08:26 -0000 1.5
+++ ecore_x_icccm.c 23 Nov 2004 15:17:56 -0000 1.6
@@ -324,9 +324,93 @@
return 1;
}
+void
+ecore_x_icccm_title_set(Ecore_X_Window win, const char *t)
+{
+ char *list[1];
+ XTextProperty xprop;
+ int ret;
+
+#ifdef X_HAVE_UTF8_STRING
+ list[0] = strdup(t);
+ ret = Xutf8TextListToTextProperty(_ecore_x_disp, list, 1, XUTF8StringStyle,
&xprop);
+#else
+ list[0] = strdup(t);
+ ret = XmbTextListToTextProperty(_ecore_x_disp, list, 1, XStdICCTextStyle,
&xprop);
+#endif
+ if (ret >= Success)
+ {
+ XSetWMName(_ecore_x_disp, win, &xprop);
+ XFree(xprop.value);
+ }
+ else
+ {
+ if (XStringListToTextProperty(list, 1, &xprop) >= Success)
+ {
+ XSetWMName(_ecore_x_disp, win, &xprop);
+ XFree(xprop.value);
+ }
+ }
+ free(list[0]);
+}
+
+char *
+ecore_x_icccm_title_get(Ecore_X_Window win)
+{
+ XTextProperty xprop;
+
+ if (XGetWMName(_ecore_x_disp, win, &xprop))
+ {
+ if (xprop.value)
+ {
+ char **list = NULL;
+ char *t = NULL;
+ int num = 0;
+
+ if (xprop.encoding == _ecore_x_atom_string)
+ {
+ t = strdup(xprop.value);
+ }
+ else if (xprop.encoding == _ecore_x_atom_utf8_string)
+ {
+ t = strdup(xprop.value);
+ }
+ else
+ {
+ int ret;
+
+#ifdef X_HAVE_UTF8_STRING
+ ret = Xutf8TextPropertyToTextList(_ecore_x_disp, &xprop,
+ &list, &num);
+#else
+ ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop,
+ &list, &num);
+#endif
+ if ((ret == XLocaleNotSupported) ||
+ (ret == XNoMemory) ||
+ (ret == XConverterNotFound))
+ {
+ t = strdup(xprop.value);
+ }
+ else if (ret >= Success)
+ {
+ if ((num >= 1) && (list))
+ {
+ /* FIXME: convert to utf8 */
+ t = strdup(list[0]);
+ }
+ if (list) XFreeStringList(list);
+ }
+ }
+ XFree(xprop.value);
+ return t;
+ }
+ }
+ return NULL;
+}
+
/* FIXME: move these things in here as they are icccm related */
/* get/set wm protocols */
-/* get/set title */
/* get/set name/class */
/* get/set machine */
/* get/set command */
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_private.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -3 -r1.30 -r1.31
--- ecore_x_private.h 24 Oct 2004 05:52:07 -0000 1.30
+++ ecore_x_private.h 23 Nov 2004 15:17:56 -0000 1.31
@@ -19,6 +19,7 @@
/* FIXME: this is for simulation only */
#include "Ecore_Job.h"
+#include "Ecore_Txt.h"
typedef struct _Ecore_X_Reply Ecore_X_Reply;
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_selection.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- ecore_x_selection.c 24 Oct 2004 03:58:11 -0000 1.15
+++ ecore_x_selection.c 23 Nov 2004 15:17:56 -0000 1.16
@@ -1,7 +1,6 @@
-#include <Ecore.h>
+#include "Ecore.h"
#include "ecore_x_private.h"
-#include <Ecore_X.h>
-#include <Ecore_Txt.h>
+#include "Ecore_X.h"
static Ecore_X_Selection_Data selections[3] = {{0}};
static Ecore_X_Selection_Data request_data[3] = {{0}};
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_window.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- ecore_x_window.c 19 Nov 2004 08:16:49 -0000 1.33
+++ ecore_x_window.c 23 Nov 2004 15:17:56 -0000 1.34
@@ -719,3 +719,21 @@
attr.background_pixel = color;
XChangeWindowAttributes(_ecore_x_disp, win, CWBackPixel, &attr);
}
+
+void
+ecore_x_window_gravity_set(Ecore_X_Window win, Ecore_X_Gravity grav)
+{
+ XSetWindowAttributes att;
+
+ att.win_gravity = grav;
+ XChangeWindowAttributes(_ecore_x_disp, win, CWWinGravity, &att);
+}
+
+void
+ecore_x_window_pixel_gravity_set(Ecore_X_Window win, Ecore_X_Gravity grav)
+{
+ XSetWindowAttributes att;
+
+ att.bit_gravity = grav;
+ XChangeWindowAttributes(_ecore_x_disp, win, CWBitGravity, &att);
+}
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs