Enlightenment CVS committal
Author : kwo
Project : e17
Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_x
Modified Files:
.cvsignore Ecore_X.h Makefile.am ecore_x.c ecore_x_private.h
Added Files:
ecore_x_icccm.c
Log Message:
Some client message and ICCCM related functions.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/.cvsignore,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- .cvsignore 5 Feb 2004 07:14:55 -0000 1.3
+++ .cvsignore 21 Sep 2004 19:18:44 -0000 1.4
@@ -2,14 +2,5 @@
.libs
Makefile
Makefile.in
-ecore_x.lo
-ecore_x_dnd.lo
-ecore_x_error.lo
-ecore_x_events.lo
-ecore_x_gc.lo
-ecore_x_pixmap.lo
-ecore_x_window.lo
-ecore_x_window_prop.lo
-ecore_x_window_shape.lo
-ecore_x_selection.lo
+*.lo
libecore_x.la
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Ecore_X.h,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -3 -r1.58 -r1.59
--- Ecore_X.h 21 Sep 2004 13:19:16 -0000 1.58
+++ Ecore_X.h 21 Sep 2004 19:18:45 -0000 1.59
@@ -860,6 +860,15 @@
Ecore_X_GC ecore_x_gc_new(Ecore_X_Drawable draw);
void ecore_x_gc_del(Ecore_X_GC gc);
+int ecore_x_client_message32_send(Ecore_X_Window win, Ecore_X_Atom type,
long d0, long d1, long d2, long d3, long d4);
+int ecore_x_client_message8_send(Ecore_X_Window win, Ecore_X_Atom type,
const void *data, int len);
+
+void ecore_x_icccm_window_state_set_iconic(Ecore_X_Window win);
+void ecore_x_icccm_window_state_set_normal(Ecore_X_Window win);
+void ecore_x_icccm_window_state_set_withdrawn(Ecore_X_Window win);
+void ecore_x_icccm_send_delete_window(Ecore_X_Window win);
+void ecore_x_icccm_send_take_focus(Ecore_X_Window win);
+
/* FIXME: these funcs need categorising */
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Makefile.am,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- Makefile.am 1 Mar 2004 23:08:45 -0000 1.9
+++ Makefile.am 21 Sep 2004 19:18:45 -0000 1.10
@@ -23,6 +23,7 @@
ecore_x_dnd.c \
ecore_x_error.c \
ecore_x_events.c \
+ecore_x_icccm.c \
ecore_x_selection.c \
ecore_x_window.c \
ecore_x_window_prop.c \
@@ -52,6 +53,7 @@
ecore_x_dnd.c \
ecore_x_error.c \
ecore_x_events.c \
+ecore_x_icccm.c \
ecore_x_selection.c \
ecore_x_window.c \
ecore_x_window_prop.c \
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -3 -r1.38 -r1.39
--- ecore_x.c 7 Sep 2004 19:47:46 -0000 1.38
+++ ecore_x.c 21 Sep 2004 19:18:45 -0000 1.39
@@ -28,6 +28,7 @@
/*
* ICCCM and Motif hints.
*/
+Atom _ecore_x_atom_wm_state = 0;
Atom _ecore_x_atom_wm_delete_window = 0;
Atom _ecore_x_atom_wm_take_focus = 0;
Atom _ecore_x_atom_wm_protocols = 0;
@@ -365,6 +366,7 @@
return 0;
}
_ecore_x_filter_handler = ecore_event_filter_add(_ecore_x_event_filter_start,
_ecore_x_event_filter_filter, _ecore_x_event_filter_end, NULL);
+ _ecore_x_atom_wm_state = XInternAtom(_ecore_x_disp, "WM_STATE",
False);
_ecore_x_atom_wm_delete_window = XInternAtom(_ecore_x_disp,
"WM_DELETE_WINDOW", False);
_ecore_x_atom_wm_take_focus = XInternAtom(_ecore_x_disp,
"WM_TAKE_FOCUS", False);
_ecore_x_atom_wm_protocols = XInternAtom(_ecore_x_disp,
"WM_PROTOCOLS", False);
@@ -1270,6 +1272,64 @@
}
}
+
+/**
+ * Send client message with given type and format 32.
+ *
+ * @param win The window the message is sent to.
+ * @param type The client message type.
+ * @param d0...d4 The client message data items.
+ *
+ * @return !0 on success.
+ */
+int
+ecore_x_client_message32_send(Ecore_X_Window win, Ecore_X_Atom type,
+ long d0, long d1, long d2, long d3, long d4)
+{
+ XEvent xev;
+
+ xev.xclient.window = win;
+ xev.xclient.type = ClientMessage;
+ xev.xclient.message_type = type;
+ xev.xclient.format = 32;
+ xev.xclient.data.l[0] = d0;
+ xev.xclient.data.l[1] = d1;
+ xev.xclient.data.l[2] = d2;
+ xev.xclient.data.l[3] = d3;
+ xev.xclient.data.l[4] = d4;
+
+ return XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev);
+}
+
+/**
+ * Send client message with given type and format 8.
+ *
+ * @param win The window the message is sent to.
+ * @param type The client message type.
+ * @param data Data to be sent.
+ * @param len Number of data bytes, max 20.
+ *
+ * @return !0 on success.
+ */
+int
+ecore_x_client_message8_send(Ecore_X_Window win, Ecore_X_Atom type,
+ const void *data, int len)
+{
+ XEvent xev;
+
+ xev.xclient.window = win;
+ xev.xclient.type = ClientMessage;
+ xev.xclient.message_type = type;
+ xev.xclient.format = 8;
+ if (len > 20)
+ len = 20;
+ memcpy(xev.xclient.data.b, data, len);
+ memset(xev.xclient.data.b + len, 0, 20 - len);
+
+ return XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev);
+}
+
+
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_private.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- ecore_x_private.h 23 Apr 2004 22:17:01 -0000 1.26
+++ ecore_x_private.h 21 Sep 2004 19:18:45 -0000 1.27
@@ -120,6 +120,7 @@
extern int _ecore_x_event_last_root_x;
extern int _ecore_x_event_last_root_y;
+extern Atom _ecore_x_atom_wm_state;
extern Atom _ecore_x_atom_wm_delete_window;
extern Atom _ecore_x_atom_wm_take_focus;
extern Atom _ecore_x_atom_wm_protocols;
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs