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.c ecore_x_icccm.c ecore_x_private.h Log Message: moe work on iccccccccccccccccccm not much =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Ecore_X.h,v retrieving revision 1.66 retrieving revision 1.67 diff -u -3 -r1.66 -r1.67 --- Ecore_X.h 22 Oct 2004 03:41:49 -0000 1.66 +++ Ecore_X.h 23 Oct 2004 02:19:19 -0000 1.67 @@ -47,6 +47,8 @@ #define ECORE_X_DND_VERSION 5 +#define ECORE_X_CURRENT_TIME 0 + extern Ecore_X_Atom ECORE_X_DND_ACTION_COPY; extern Ecore_X_Atom ECORE_X_DND_ACTION_MOVE; extern Ecore_X_Atom ECORE_X_DND_ACTION_LINK; @@ -870,22 +872,32 @@ void ecore_x_icccm_state_set(Ecore_X_Window win, Ecore_X_Window_State_Hint state); void - ecore_x_icccm_delete_window_send(Ecore_X_Window win); + ecore_x_icccm_delete_window_send(Ecore_X_Window win, Ecore_X_Time t); void - ecore_x_icccm_take_focus_send(Ecore_X_Window win); + ecore_x_icccm_take_focus_send(Ecore_X_Window win, Ecore_X_Time t); void - ecore_x_icccm_save_yourself_send(Ecore_X_Window win); + ecore_x_icccm_save_yourself_send(Ecore_X_Window win, Ecore_X_Time t); void ecore_x_icccm_move_resize_send(Ecore_X_Window win, int x, int y, int w, int h); + void + ecore_x_icccm_hints_set(Ecore_X_Window win, + int accepts_focus, + Ecore_X_Window_State_Hint initial_state, + Ecore_X_Pixmap icon_pixmap, + Ecore_X_Pixmap icon_mask, + Ecore_X_Window icon_window, + Ecore_X_Window window_group, + int is_urgent); int - ecore_x_icccm_basic_hints_get(Ecore_X_Window win, - int *accepts_focus, - Ecore_X_Window_State_Hint *initial_state, - Ecore_X_Pixmap *icon_pixmap, - Ecore_X_Pixmap *icon_mask, - Ecore_X_Window *icon_window, - Ecore_X_Window *window_group); + ecore_x_icccm_hints_get(Ecore_X_Window win, + int *accepts_focus, + Ecore_X_Window_State_Hint *initial_state, + Ecore_X_Pixmap *icon_pixmap, + Ecore_X_Pixmap *icon_mask, + Ecore_X_Window *icon_window, + Ecore_X_Window *window_group, + int *is_urgent); /* FIXME: these funcs need categorising */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -3 -r1.45 -r1.46 --- ecore_x.c 22 Oct 2004 03:41:49 -0000 1.45 +++ ecore_x.c 23 Oct 2004 02:19:19 -0000 1.46 @@ -38,6 +38,12 @@ Atom _ecore_x_atom_wm_icon_name = 0; Atom _ecore_x_atom_wm_client_machine = 0; Atom _ecore_x_atom_wm_change_state = 0; +Atom _ecore_x_atom_wm_colormap_windows = 0; +Atom _ecore_x_atom_wm_window_role = 0; +Atom _ecore_x_atom_wm_hints = 0; +Atom _ecore_x_atom_wm_client_leader = 0; +Atom _ecore_x_atom_wm_transient_for = 0; +Atom _ecore_x_atom_wm_save_yourself = 0; Atom _ecore_x_atom_motif_wm_hints = 0; @@ -376,6 +382,12 @@ _ecore_x_atom_wm_icon_name = XInternAtom(_ecore_x_disp, "WM_ICON_NAME", False); _ecore_x_atom_wm_client_machine = XInternAtom(_ecore_x_disp, "WM_CLIENT_MACHINE", False); _ecore_x_atom_wm_change_state = XInternAtom(_ecore_x_disp, "WM_CHANGE_STATE", False); + _ecore_x_atom_wm_colormap_windows = XInternAtom(_ecore_x_disp, "WM_COLORMAP_WINDOWS", False); + _ecore_x_atom_wm_window_role = XInternAtom(_ecore_x_disp, "WM_WINDOW_ROLE", False); + _ecore_x_atom_wm_hints = XInternAtom(_ecore_x_disp, "WM_HINTS", False); + _ecore_x_atom_wm_client_leader = XInternAtom(_ecore_x_disp, "WM_CLIENT_LEADER", False); + _ecore_x_atom_wm_transient_for = XInternAtom(_ecore_x_disp, "WM_TRANSIENT_FOR", False); + _ecore_x_atom_wm_save_yourself = XInternAtom(_ecore_x_disp, "WM_SAVE_YOURSELF", False); _ecore_x_atom_motif_wm_hints = XInternAtom(_ecore_x_disp, "_MOTIF_WM_HINTS", False); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_icccm.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ecore_x_icccm.c 22 Oct 2004 03:41:49 -0000 1.2 +++ ecore_x_icccm.c 23 Oct 2004 02:19:19 -0000 1.3 @@ -1,6 +1,8 @@ /* * Various ICCCM related functions. - * These are normally called only by window managers. + * + * This is ALL the code involving anything ICCCM related. for both WM and + * client. */ #include "Ecore.h" #include "ecore_x_private.h" @@ -24,7 +26,7 @@ } void -ecore_x_icccm_delete_window_send(Ecore_X_Window win) +ecore_x_icccm_delete_window_send(Ecore_X_Window win, Ecore_X_Time t) { ecore_x_client_message32_send(win, _ecore_x_atom_wm_protocols, _ecore_x_atom_wm_delete_window, @@ -32,22 +34,20 @@ } void -ecore_x_icccm_take_focus_send(Ecore_X_Window win) +ecore_x_icccm_take_focus_send(Ecore_X_Window win, Ecore_X_Time t) { ecore_x_client_message32_send(win, _ecore_x_atom_wm_protocols, _ecore_x_atom_wm_take_focus, CurrentTime, 0, 0, 0); } -#if 0 void -ecore_x_icccm_save_yourself_send(Ecore_X_Window win) +ecore_x_icccm_save_yourself_send(Ecore_X_Window win, Ecore_X_Time t) { ecore_x_client_message32_send(win, _ecore_x_atom_wm_protocols, _ecore_x_atom_wm_save_yourself, CurrentTime, 0, 0, 0); } -#endif void ecore_x_icccm_move_resize_send(Ecore_X_Window win, @@ -69,17 +69,74 @@ XSendEvent(_ecore_x_disp, win, False, StructureNotifyMask, &ev); } +void +ecore_x_icccm_hints_set(Ecore_X_Window win, + int accepts_focus, + Ecore_X_Window_State_Hint initial_state, + Ecore_X_Pixmap icon_pixmap, + Ecore_X_Pixmap icon_mask, + Ecore_X_Window icon_window, + Ecore_X_Window window_group, + int is_urgent) +{ + XWMHints *hints; + + hints = XAllocWMHints(); + if (!hints) return; + + hints->flags = InputHint | StateHint; + hints->input = accepts_focus; + if (initial_state == ECORE_X_WINDOW_STATE_HINT_WITHDRAWN) + hints->initial_state = WithdrawnState; + else if (initial_state == ECORE_X_WINDOW_STATE_HINT_NORMAL) + hints->initial_state = NormalState; + else if (initial_state == ECORE_X_WINDOW_STATE_HINT_ICONIC) + hints->initial_state = IconicState; + if (icon_pixmap != 0) + { + hints->icon_pixmap = icon_pixmap; + hints->flags |= IconPixmapHint; + } + if (icon_mask != 0) + { + hints->icon_mask = icon_mask; + hints->flags |= IconMaskHint; + } + if (icon_window != 0) + { + hints->icon_window = icon_window; + hints->flags |= IconWindowHint; + } + if (window_group != 0) + { + hints->window_group = window_group; + hints->flags |= WindowGroupHint; + } + if (is_urgent) + hints->flags |= XUrgencyHint; + XSetWMHints(_ecore_x_disp, win, hints); + XFree(hints); +} + int -ecore_x_icccm_basic_hints_get(Ecore_X_Window win, - int *accepts_focus, - Ecore_X_Window_State_Hint *initial_state, - Ecore_X_Pixmap *icon_pixmap, - Ecore_X_Pixmap *icon_mask, - Ecore_X_Window *icon_window, - Ecore_X_Window *window_group) +ecore_x_icccm_hints_get(Ecore_X_Window win, + int *accepts_focus, + Ecore_X_Window_State_Hint *initial_state, + Ecore_X_Pixmap *icon_pixmap, + Ecore_X_Pixmap *icon_mask, + Ecore_X_Window *icon_window, + Ecore_X_Window *window_group, + int *is_urgent) { XWMHints *hints; - + + if (accepts_focus) *accepts_focus = 0; + if (initial_state) *initial_state = ECORE_X_WINDOW_STATE_HINT_NORMAL; + if (icon_pixmap) *icon_pixmap = 0; + if (icon_mask) *icon_mask = 0; + if (icon_window) *icon_window = 0; + if (window_group) *window_group = 0; + if (is_urgent) *is_urgent = 0; hints = XGetWMHints(_ecore_x_disp, win); if (hints) { @@ -115,6 +172,10 @@ { *window_group = hints->window_group; } + if ((hints->flags & XUrgencyHint) && (is_urgent)) + { + *is_urgent = 1; + } XFree(hints); return 1; } @@ -198,11 +259,18 @@ } /* FIXME: move these things in here as they are icccm related */ +/* get/set min.max etc. size */ /* get/set title */ /* get/set name/class */ /* get/set machine */ /* get/set command */ /* get/set icon name */ +/* get/set wm protocols */ +/* get/set colormap windows */ +/* get/set window role */ +/* get/set client leader */ +/* get/set transient for */ +/* send iconify request */ /* FIXME: there are older E hints, gnome hitns and mwm hints and new netwm */ /* hints. each should go in their own file/section so we know which */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_private.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -3 -r1.27 -r1.28 --- ecore_x_private.h 21 Sep 2004 19:18:45 -0000 1.27 +++ ecore_x_private.h 23 Oct 2004 02:19:19 -0000 1.28 @@ -130,6 +130,12 @@ extern Atom _ecore_x_atom_wm_icon_name; extern Atom _ecore_x_atom_wm_client_machine; extern Atom _ecore_x_atom_wm_change_state; +extern Atom _ecore_x_atom_wm_colormap_windows; +extern Atom _ecore_x_atom_wm_window_role; +extern Atom _ecore_x_atom_wm_hints; +extern Atom _ecore_x_atom_wm_client_leader; +extern Atom _ecore_x_atom_wm_transient_for; +extern Atom _ecore_x_atom_wm_save_yourself; extern Atom _ecore_x_atom_motif_wm_hints; ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs