Enlightenment CVS committal Author : raster Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_x Modified Files: Tag: SPLIT Ecore_X.h ecore_x.c ecore_x_private.h ecore_x_window.c ecore_x_window_prop.c Log Message: more work on ecore =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/Ecore_X.h,v retrieving revision 1.1.2.18 retrieving revision 1.1.2.19 diff -u -3 -r1.1.2.18 -r1.1.2.19 --- Ecore_X.h 8 Feb 2003 05:05:04 -0000 1.1.2.18 +++ Ecore_X.h 8 Feb 2003 07:03:41 -0000 1.1.2.19 @@ -412,12 +412,21 @@ void ecore_x_window_lower(Window win); void ecore_x_window_reparent(Window win, Window new_parent, int x, int y); void ecore_x_window_size_get(Window win, int *w, int *h); +void ecore_x_window_cursor_show(Window win, int show); +void ecore_x_window_prop_property_set(Window win, Atom type, Atom format, int size, +void *data, int number); void ecore_x_window_prop_title_set(Window win, const char *t); char *ecore_x_window_prop_title_get(Window win); void ecore_x_window_prop_name_class_set(Window win, const char *n, const char *c); void ecore_x_window_prop_name_class_get(Window win, char **n, char **c); void ecore_x_window_prop_delete_request_set(Window win, int on); +void ecore_x_window_prop_min_size_set(Window win, int w, int h); +void ecore_x_window_prop_max_size_set(Window win, int w, int h); +void ecore_x_window_prop_base_size_set(Window win, int w, int h); +void ecore_x_window_prop_step_size_set(Window win, int x, int y); +void ecore_x_window_prop_xy_set(Window win, int x, int y); +void ecore_x_window_prop_borderless_set(Window win, int borderless); +void ecore_x_window_prop_layer_set(Window win, int layer); #ifdef __cplusplus } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/ecore_x.c,v retrieving revision 1.1.2.14 retrieving revision 1.1.2.15 diff -u -3 -r1.1.2.14 -r1.1.2.15 --- ecore_x.c 8 Feb 2003 05:05:06 -0000 1.1.2.14 +++ ecore_x.c 8 Feb 2003 07:03:41 -0000 1.1.2.15 @@ -28,6 +28,8 @@ Atom _ecore_x_atom_wm_protocols = 0; Atom _ecore_x_atom_wm_class = 0; Atom _ecore_x_atom_wm_name = 0; +Atom _ecore_x_atom_motif_wm_hints = 0; +Atom _ecore_x_atom_win_layer = 0; int ECORE_X_EVENT_KEY_DOWN = 0; int ECORE_X_EVENT_KEY_UP = 0; @@ -213,6 +215,8 @@ _ecore_x_atom_wm_protocols = XInternAtom(_ecore_x_disp, "WM_PROTOCOLS", False); _ecore_x_atom_wm_class = XInternAtom(_ecore_x_disp, "WM_CLASS", False); _ecore_x_atom_wm_name = XInternAtom(_ecore_x_disp, "WM_NAME", False); + _ecore_x_atom_motif_wm_hints = XInternAtom(_ecore_x_disp, "_MOTIF_WM_HINTS", +False); + _ecore_x_atom_win_layer = XInternAtom(_ecore_x_disp, "_WIN_LAYER", False); _ecore_x_init_count++; return _ecore_x_init_count; } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/ecore_x_private.h,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -3 -r1.1.2.6 -r1.1.2.7 --- ecore_x_private.h 5 Feb 2003 06:51:57 -0000 1.1.2.6 +++ ecore_x_private.h 8 Feb 2003 07:03:41 -0000 1.1.2.7 @@ -21,6 +21,8 @@ extern Atom _ecore_x_atom_wm_protocols; extern Atom _ecore_x_atom_wm_class; extern Atom _ecore_x_atom_wm_name; +extern Atom _ecore_x_atom_motif_wm_hints; +extern Atom _ecore_x_atom_win_layer; void _ecore_x_error_handler_init(void); void _ecore_x_event_handle_key_press(XEvent *xevent); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/ecore_x_window.c,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -3 -r1.1.2.3 -r1.1.2.4 --- ecore_x_window.c 8 Feb 2003 05:05:08 -0000 1.1.2.3 +++ ecore_x_window.c 8 Feb 2003 07:03:41 -0000 1.1.2.4 @@ -281,3 +281,32 @@ if (w) *w = (int)ret_w; if (h) *h = (int)ret_h; } + +void +ecore_x_window_cursor_show(Window win, int show) +{ + if (!show) + { + Cursor c; + XColor cl; + Pixmap p, m; + GC gc; + XGCValues gcv; + + p = XCreatePixmap(_ecore_x_disp, win, 1, 1, 1); + m = XCreatePixmap(_ecore_x_disp, win, 1, 1, 1); + gc = XCreateGC(_ecore_x_disp, m, 0, &gcv); + XSetForeground(_ecore_x_disp, gc, 0); + XDrawPoint(_ecore_x_disp, m, gc, 0, 0); + XFreeGC(_ecore_x_disp, gc); + c = XCreatePixmapCursor(_ecore_x_disp, p, m, &cl, &cl, 0, 0); + XDefineCursor(_ecore_x_disp, win, c); + XFreeCursor(_ecore_x_disp, c); + XFreePixmap(_ecore_x_disp, p); + XFreePixmap(_ecore_x_disp, m); + } + else + { + XDefineCursor(_ecore_x_disp, win, 0); + } +} =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/ecore_x_window_prop.c,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -3 -r1.1.2.3 -r1.1.2.4 --- ecore_x_window_prop.c 5 Feb 2003 06:51:57 -0000 1.1.2.3 +++ ecore_x_window_prop.c 8 Feb 2003 07:03:41 -0000 1.1.2.4 @@ -2,6 +2,29 @@ #include "ecore_x_private.h" #include "Ecore_X.h" +void +ecore_x_window_prop_property_set(Window win, Atom type, Atom format, int size, void +*data, int number) +{ + if (win == 0) win = DefaultRootWindow(_ecore_x_disp); + if (size != 32) + XChangeProperty(_ecore_x_disp, win, type, format, size, PropModeReplace, + (unsigned char *)data, number); + else + { + unsigned long *dat; + int i, *ptr; + + dat = malloc(sizeof(unsigned long) * number); + if (dat) + { + for (ptr = (int *)data, i = 0; i < number; i++) dat[i] = ptr[i]; + XChangeProperty(_ecore_x_disp, win, type, format, size, + PropModeReplace, (unsigned char *)dat, number); + free(dat); + } + } +} + /** * Set a window title * @param win @@ -170,4 +193,98 @@ } leave: if (protos) XFree(protos); +} + +void +ecore_x_window_prop_min_size_set(Window win, int w, int h) +{ + XSizeHints hints; + long ret; + + memset(&hints, 0, sizeof(XSizeHints)); + XGetWMNormalHints(_ecore_x_disp, win, &hints, &ret); + hints.flags |= PMinSize | PSize | USSize; + hints.min_width = w; + hints.min_height = h; + XSetWMNormalHints(_ecore_x_disp, win, &hints); +} + +void +ecore_x_window_prop_max_size_set(Window win, int w, int h) +{ + XSizeHints hints; + long ret; + + memset(&hints, 0, sizeof(XSizeHints)); + XGetWMNormalHints(_ecore_x_disp, win, &hints, &ret); + hints.flags |= PMaxSize | PSize | USSize; + hints.max_width = w; + hints.max_height = h; + XSetWMNormalHints(_ecore_x_disp, win, &hints); +} + +void +ecore_x_window_prop_base_size_set(Window win, int w, int h) +{ + XSizeHints hints; + long ret; + + memset(&hints, 0, sizeof(XSizeHints)); + XGetWMNormalHints(_ecore_x_disp, win, &hints, &ret); + hints.flags |= PBaseSize | PSize | USSize; + hints.base_width = w; + hints.base_height = h; + XSetWMNormalHints(_ecore_x_disp, win, &hints); +} + +void +ecore_x_window_prop_step_size_set(Window win, int x, int y) +{ + XSizeHints hints; + long ret; + + memset(&hints, 0, sizeof(XSizeHints)); + XGetWMNormalHints(_ecore_x_disp, win, &hints, &ret); + hints.flags |= PMaxSize | PSize | USSize; + hints.width_inc = x; + hints.height_inc = y; + XSetWMNormalHints(_ecore_x_disp, win, &hints); +} + +void +ecore_x_window_prop_xy_set(Window win, int x, int y) +{ + XSizeHints hints; + long ret; + + memset(&hints, 0, sizeof(XSizeHints)); + XGetWMNormalHints(_ecore_x_disp, win, &hints, &ret); + hints.flags |= PPosition | USPosition | PSize | USSize; + hints.x = x; + hints.y = y; + XSetWMNormalHints(_ecore_x_disp, win, &hints); +} + +void +ecore_x_window_prop_borderless_set(Window win, int borderless) +{ + if (!borderless) + XDeleteProperty(_ecore_x_disp, win, _ecore_x_atom_motif_wm_hints); + else + { + const unsigned int data[5] = + { 0x3, 0x0, 0x0, 0x2ada27b0, 0x2aabd6b0}; + + ecore_x_window_prop_property_set(win, + _ecore_x_atom_motif_wm_hints, + _ecore_x_atom_motif_wm_hints, + 32, (void *)data, 5); + } +} + +void +ecore_x_window_prop_layer_set(Window win, int layer) +{ + ecore_x_window_prop_property_set(win, _ecore_x_atom_win_layer, + XA_CARDINAL, 32, &layer, 1); } ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs