Enlightenment CVS committal

Author  : doursse
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_wince


Modified Files:
        Ecore_WinCE.h ecore_wince_event.c ecore_wince_private.h 
        ecore_wince_window.c 


Log Message:
 * add _size_get() and _geometry_get() methods
 * fix use of resume() and suspend() functions when dealing with GAPI

===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_wince/Ecore_WinCE.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- Ecore_WinCE.h       5 Jun 2008 05:27:29 -0000       1.3
+++ Ecore_WinCE.h       5 Jun 2008 07:23:41 -0000       1.4
@@ -213,9 +213,19 @@
 
 EAPI void ecore_wince_window_hide(Ecore_WinCE_Window *window);
 
-EAPI void ecore_wince_window_suspend_set(Ecore_WinCE_Window *window, int 
(*suspend)(void));
+  EAPI void ecore_wince_window_suspend_set(Ecore_WinCE_Window *window, int 
(*suspend)(int), int backend);
 
-EAPI void ecore_wince_window_resume_set(Ecore_WinCE_Window *window, int 
(*resume)(void));
+EAPI void ecore_wince_window_resume_set(Ecore_WinCE_Window *window, int 
(*resume)(int), int backend);
+
+EAPI void ecore_wince_window_geometry_get(Ecore_WinCE_Window *window,
+                                          int                *x,
+                                          int                *y,
+                                          int                *width,
+                                          int                *height);
+
+EAPI void ecore_wince_window_size_get(Ecore_WinCE_Window *window,
+                                      int                *width,
+                                      int                *height);
 
 EAPI void *ecore_wince_window_window_get(Ecore_WinCE_Window *window);
 
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_wince/ecore_wince_event.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ecore_wince_event.c 3 Jun 2008 17:09:44 -0000       1.2
+++ ecore_wince_event.c 5 Jun 2008 07:23:41 -0000       1.3
@@ -355,7 +355,7 @@
      }
 
    if (window->resume)
-     window->resume();
+     window->resume(window->backend);
 
    e->window = window;
 
@@ -381,7 +381,7 @@
         return;
      }
    if (window->suspend)
-     window->suspend();
+     window->suspend(window->backend);
 
    e->window = window;
 
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_wince/ecore_wince_private.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ecore_wince_private.h       3 Jun 2008 17:09:44 -0000       1.2
+++ ecore_wince_private.h       5 Jun 2008 07:23:41 -0000       1.3
@@ -24,14 +24,15 @@
 };
 
 
-typedef int (*ecore_wince_suspend) (void);
-typedef int (*ecore_wince_resume)  (void);
+typedef int (*ecore_wince_suspend) (int);
+typedef int (*ecore_wince_resume)  (int);
 
 
 struct _Ecore_WinCE_Window
 {
    HWND                window;
 
+   int                 backend;
    ecore_wince_suspend suspend;
    ecore_wince_resume  resume;
 
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_wince/ecore_wince_window.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ecore_wince_window.c        5 Jun 2008 05:27:29 -0000       1.4
+++ ecore_wince_window.c        5 Jun 2008 07:23:41 -0000       1.5
@@ -138,7 +138,7 @@
 }
 
 void
-ecore_wince_window_suspend_set(Ecore_WinCE_Window *window, int 
(*suspend)(void))
+ecore_wince_window_suspend_set(Ecore_WinCE_Window *window, int 
(*suspend)(int), int backend)
 {
    struct _Ecore_WinCE_Window *w;
 
@@ -146,11 +146,12 @@
      return;
 
    w = (struct _Ecore_WinCE_Window *)window;
+   w->backend = backend;
    w->suspend = suspend;
 }
 
 void
-ecore_wince_window_resume_set(Ecore_WinCE_Window *window, int (*resume)(void))
+ecore_wince_window_resume_set(Ecore_WinCE_Window *window, int (*resume)(int), 
int backend)
 {
    struct _Ecore_WinCE_Window *w;
 
@@ -158,7 +159,88 @@
      return;
 
    w = (struct _Ecore_WinCE_Window *)window;
+   w->backend = backend;
    w->resume = resume;
+}
+
+void
+ecore_wince_window_geometry_get(Ecore_WinCE_Window *window,
+                                int                *x,
+                                int                *y,
+                                int                *width,
+                                int                *height)
+{
+   RECT rect;
+   int  w;
+   int  h;
+
+   printf ("ecore_wince_window_geometry_get %p\n", window);
+   if (!window)
+     {
+        if (x) *x = 0;
+        if (y) *y = 0;
+        if (width) *width = GetSystemMetrics(SM_CXSCREEN);
+        if (height) *height = GetSystemMetrics(SM_CYSCREEN);
+
+        return;
+     }
+
+   if (!GetClientRect(((struct _Ecore_WinCE_Window *)window)->window,
+                      &rect))
+     {
+        if (x) *x = 0;
+        if (y) *y = 0;
+        if (width) *width = 0;
+        if (height) *height = 0;
+
+        return;
+     }
+
+   w = rect.right - rect.left;
+   h = rect.bottom - rect.top;
+
+   if (!GetWindowRect(((struct _Ecore_WinCE_Window *)window)->window,
+                      &rect))
+     {
+        if (x) *x = 0;
+        if (y) *y = 0;
+        if (width) *width = 0;
+        if (height) *height = 0;
+
+        return;
+     }
+
+   if (x) *x = rect.left;
+   if (y) *y = rect.top;
+   if (width) *width = w;
+   if (height) *height = h;
+}
+
+void
+ecore_wince_window_size_get(Ecore_WinCE_Window *window,
+                            int                *width,
+                            int                *height)
+{
+   RECT rect;
+
+   printf ("ecore_wince_window_size_get %p\n", window);
+   if (!window)
+     {
+        if (width) *width = GetSystemMetrics(SM_CXSCREEN);
+        if (height) *height = GetSystemMetrics(SM_CYSCREEN);
+
+        return;
+     }
+
+   if (!GetClientRect(((struct _Ecore_WinCE_Window *)window)->window,
+                      &rect))
+     {
+        if (width) *width = 0;
+        if (height) *height = 0;
+     }
+
+   if (width) *width = rect.right - rect.left;
+   if (height) *height = rect.bottom - rect.top;
 }
 
 void *



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to