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_events.c ecore_x_window.c 


Log Message:


more work on ecore_x and ecore_evas... coming along nicely. handles override
mode (switching to and form) managed) and full screen mode happily.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/Ecore_X.h,v
retrieving revision 1.1.2.17
retrieving revision 1.1.2.18
diff -u -3 -r1.1.2.17 -r1.1.2.18
--- Ecore_X.h   8 Feb 2003 01:30:57 -0000       1.1.2.17
+++ Ecore_X.h   8 Feb 2003 05:05:04 -0000       1.1.2.18
@@ -399,12 +399,19 @@
 int  ecore_x_error_code_get(void);
 
 Window ecore_x_window_new(Window parent, int x, int y, int w, int h);
+Window ecore_x_window_override_new(Window parent, int x, int y, int w, int h);
 void ecore_x_window_del(Window win);
 void ecore_x_window_show(Window win);
 void ecore_x_window_hide(Window win);
 void ecore_x_window_move(Window win, int x, int y);
 void ecore_x_window_resize(Window win, int w, int h);
 void ecore_x_window_move_resize(Window win, int x, int y, int w, int h);
+void ecore_x_window_focus(Window win);
+void ecore_x_window_focus_at_time(Window win, Time t);
+void ecore_x_window_raise(Window win);
+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_prop_title_set(Window win, const char *t);
 char *ecore_x_window_prop_title_get(Window win);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/ecore_x.c,v
retrieving revision 1.1.2.13
retrieving revision 1.1.2.14
diff -u -3 -r1.1.2.13 -r1.1.2.14
--- ecore_x.c   7 Feb 2003 00:24:02 -0000       1.1.2.13
+++ ecore_x.c   8 Feb 2003 05:05:06 -0000       1.1.2.14
@@ -237,6 +237,7 @@
    _ecore_x_filter_handler = NULL;
    _ecore_x_disp = NULL;
    _ecore_x_event_handlers = NULL;
+   if (_ecore_x_init_count < 0) _ecore_x_init_count = 0;
    return _ecore_x_init_count;
 }
 
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/ecore_x_events.c,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -u -3 -r1.1.2.10 -r1.1.2.11
--- ecore_x_events.c    7 Feb 2003 00:24:02 -0000       1.1.2.10
+++ ecore_x_events.c    8 Feb 2003 05:05:06 -0000       1.1.2.11
@@ -519,13 +519,23 @@
 void
 _ecore_x_event_handle_unmap_notify(XEvent *xevent)
 {
-   /* FIXME: handle this event type */
+   Ecore_X_Event_Window_Hide *e;
+   
+   e = calloc(1, sizeof(Ecore_X_Event_Window_Hide));
+   if (!e) return;
+   e->win = xevent->xunmap.window;
+   ecore_event_add(ECORE_X_EVENT_WINDOW_HIDE, e, _ecore_x_event_free_generic, NULL);
 }
 
 void
 _ecore_x_event_handle_map_notify(XEvent *xevent)
 {
-   /* FIXME: handle this event type */
+   Ecore_X_Event_Window_Show *e;
+   
+   e = calloc(1, sizeof(Ecore_X_Event_Window_Show));
+   if (!e) return;
+   e->win = xevent->xmap.window;
+   ecore_event_add(ECORE_X_EVENT_WINDOW_SHOW, e, _ecore_x_event_free_generic, NULL);
 }
 
 void
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/ecore_x_window.c,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -3 -r1.1.2.2 -r1.1.2.3
--- ecore_x_window.c    8 Feb 2003 01:30:57 -0000       1.1.2.2
+++ ecore_x_window.c    8 Feb 2003 05:05:08 -0000       1.1.2.3
@@ -58,6 +58,61 @@
 }
 
 /**
+ * Create a window
+ * @param parent
+ * @param x
+ * @param y
+ * @param w
+ * @param h
+ * @return The new window handle
+ * 
+ * Create a new window
+ */
+Window
+ecore_x_window_override_new(Window parent, int x, int y, int w, int h)
+{
+   Window               win;
+   XSetWindowAttributes attr;
+   
+   if (parent == 0) parent = DefaultRootWindow(_ecore_x_disp);
+   attr.backing_store         = NotUseful;
+   attr.override_redirect     = True;
+   attr.colormap              = DefaultColormap(_ecore_x_disp, 
+DefaultScreen(_ecore_x_disp));
+   attr.border_pixel          = 0;
+   attr.background_pixmap     = None;
+   attr.save_under            = False;
+   attr.do_not_propagate_mask = True;
+   attr.event_mask            = KeyPressMask |
+                                KeyReleaseMask |
+                                ButtonPressMask |
+                                ButtonReleaseMask |
+                                EnterWindowMask |
+                                LeaveWindowMask |
+                                PointerMotionMask |
+                                ExposureMask |
+                                VisibilityChangeMask |
+                                StructureNotifyMask |
+                                FocusChangeMask |
+                                PropertyChangeMask |
+                                ColormapChangeMask;
+   win = XCreateWindow(_ecore_x_disp, parent,
+                      x, y, w, h, 0,
+                      DefaultDepth(_ecore_x_disp, DefaultScreen(_ecore_x_disp)),
+                      InputOutput, 
+                      DefaultVisual(_ecore_x_disp, DefaultScreen(_ecore_x_disp)),
+                      CWBackingStore |
+                      CWOverrideRedirect | 
+                      CWColormap | 
+                      CWBorderPixel |
+                      CWBackPixmap | 
+                      CWSaveUnder | 
+                      CWDontPropagate | 
+                      CWEventMask,
+                      &attr);
+   return win;
+}
+
+/**
  * Delete a window
  * @param win
  * 
@@ -99,7 +154,7 @@
  * @param x
  * @param y
  * 
- * Move a window to x, y
+ * Move a window to @p x, @p y
  */
 void
 ecore_x_window_move(Window win, int x, int y)
@@ -113,7 +168,7 @@
  * @param w
  * @param h
  * 
- * Resize a window to w x h
+ * Resize a window to @p w x @p h
  */
 void
 ecore_x_window_resize(Window win, int w, int h)
@@ -131,7 +186,7 @@
  * @param w
  * @param h
  * 
- * Move a window to x, y and resize it to w x h
+ * Move a window to @p x, @p y and resize it to @p w x @p h
  */
 void
 ecore_x_window_move_resize(Window win, int x, int y, int w, int h)
@@ -139,4 +194,90 @@
    if (w < 1) w = 1;
    if (h < 1) h = 1;
    XMoveResizeWindow(_ecore_x_disp, win, x, y, w, h);
+}
+
+/**
+ * Set the focus to the window
+ * @param win
+ * 
+ * Set the focus to the window @p win
+ */
+void
+ecore_x_window_focus(Window win)
+{
+   if (win == 0) win = DefaultRootWindow(_ecore_x_disp);   
+   XSetInputFocus(_ecore_x_disp, win, RevertToNone, CurrentTime);
+}
+
+/**
+ * Set the focus to the window at a specific time
+ * @param win
+ * @param t
+ * 
+ * Set the focus to the window @p win at time @p t
+ */
+void
+ecore_x_window_focus_at_time(Window win, Time t)
+{
+   if (win == 0) win = DefaultRootWindow(_ecore_x_disp);   
+   XSetInputFocus(_ecore_x_disp, win, RevertToNone, t);
+}
+
+/**
+ * Raise window
+ * @param win
+ * 
+ * Raise window @p win
+ */
+void
+ecore_x_window_raise(Window win)
+{
+   XRaiseWindow(_ecore_x_disp, win);
+}
+
+/**
+ * Lower window
+ * @param win
+ * 
+ * Lower window @p win
+ */
+void
+ecore_x_window_lower(Window win)
+{
+   XLowerWindow(_ecore_x_disp, win);
+}
+
+/**
+ * Reparent a window
+ * @param win
+ * @param new_parent
+ * @param x
+ * @param y
+ * 
+ * Reparent @p win to the parent @p new_parent at @p x, @py
+ */
+void
+ecore_x_window_reparent(Window win, Window new_parent, int x, int y)
+{
+   if (new_parent == 0) new_parent = DefaultRootWindow(_ecore_x_disp);   
+   XReparentWindow(_ecore_x_disp, win, new_parent, x, y);
+}
+
+void
+ecore_x_window_size_get(Window win, int *w, int *h)
+{
+   Window dummy_win;
+   int dummy_x, dummy_y;
+   unsigned int ret_w, ret_h, dummy_border, dummy_depth;
+   if (win == 0) win = DefaultRootWindow(_ecore_x_disp);
+   ret_w = 0;
+   ret_h = 0;
+   if (!XGetGeometry(_ecore_x_disp, win, &dummy_win, &dummy_x, &dummy_y,
+                    &ret_w, &ret_h, &dummy_border, &dummy_depth))
+     {
+       ret_w = 0;
+       ret_h = 0;      
+     }
+   if (w) *w = (int)ret_w;
+   if (h) *h = (int)ret_h;
 }




-------------------------------------------------------
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

Reply via email to