Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_engines.c ewl_engines.h ewl_enums.h ewl_window.c 
        ewl_window.h 


Log Message:
- add the modal stuff in
- This dosen't work right at the moment

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_engines.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ewl_engines.c       9 Jun 2006 19:33:14 -0000       1.1
+++ ewl_engines.c       10 Jun 2006 00:35:06 -0000      1.2
@@ -677,6 +677,45 @@
 /**
  * @param win: the window to work with
  * @return Returns no value
+ * @brief Sets the window modal
+ */
+void
+ewl_engine_window_modal_set(Ewl_Window *win)
+{
+       Ewl_Engine *caller;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("win", win);
+       DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
+       
+       if (!REALIZED(win))
+               DRETURN(DLEVEL_STABLE);
+
+       caller = EWL_ENGINE(win->engine);
+       if (!caller->functions->window_modal_set && caller->dependancies)
+       {
+               Ecore_List *deps;
+
+               deps = caller->dependancies;
+               ecore_list_goto_last(deps);
+               while ((caller = ecore_dlist_previous(deps)))
+               {
+                       if (caller->functions->window_modal_set)
+                               break;
+               }
+       }
+
+       if (!caller || !caller->functions->window_modal_set)
+               DRETURN(DLEVEL_STABLE);
+
+       caller->functions->window_modal_set(win);
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @param win: the window to work with
+ * @return Returns no value
  * @brief Raises the window
  */
 void
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_engines.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ewl_engines.h       10 Jun 2006 00:10:14 -0000      1.2
+++ ewl_engines.h       10 Jun 2006 00:35:06 -0000      1.3
@@ -35,6 +35,7 @@
                                                        setting of the window */
        void (*window_transient_for)(Ewl_Window *win);  /**< Set the window 
                                                                transient */
+       void (*window_modal_set)(Ewl_Window *win); /**< Set the window modal */
 
        void (*window_raise)(Ewl_Window *win);  /**< Raise the window */
        void (*window_lower)(Ewl_Window *win);  /**< Lower the window */
@@ -97,6 +98,7 @@
 void            ewl_engine_window_dialog_set(Ewl_Window *win);
 void            ewl_engine_window_fullscreen_set(Ewl_Window *win);
 void            ewl_engine_window_transient_for(Ewl_Window *win);
+void            ewl_engine_window_modal_set(Ewl_Window *win);
 
 void            ewl_engine_window_raise(Ewl_Window *win);
 void            ewl_engine_window_lower(Ewl_Window *win);
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_enums.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -3 -r1.48 -r1.49
--- ewl_enums.h 9 Jun 2006 19:33:14 -0000       1.48
+++ ewl_enums.h 10 Jun 2006 00:35:06 -0000      1.49
@@ -258,7 +258,8 @@
        EWL_WINDOW_GRAB_KEYBOARD = 0x8,         /**< Window grabs keyboard */
        EWL_WINDOW_OVERRIDE = 0x10,             /**< Window override setting */
        EWL_WINDOW_FULLSCREEN = 0x20,           /**< Window is fullscreen */
-       EWL_WINDOW_DIALOG = 0x40                /**< Window has no max and min 
buttons */
+       EWL_WINDOW_DIALOG = 0x40,               /**< Window has no max and min 
buttons */
+       EWL_WINDOW_MODAL = 0x80                 /**< Window is modal */
 };
 
 /**
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_window.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -3 -r1.54 -r1.55
--- ewl_window.c        9 Jun 2006 19:33:14 -0000       1.54
+++ ewl_window.c        10 Jun 2006 00:35:06 -0000      1.55
@@ -437,6 +437,32 @@
 }
 
 /**
+ * @param win: The window to work with
+ * @param modal: The main window
+ * @return Returns no value
+ * @brief Sets the window to modal for @a forwin
+ */
+void
+ewl_window_modal_for(Ewl_Window *win, Ewl_Window *forwin)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("win", win);
+       DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
+
+       /* make sure the modal window is transient */
+       ewl_window_transient_for(win, forwin);
+
+       if (forwin)
+               win->flags |= EWL_WINDOW_MODAL;
+       else
+               win->flags &= ~EWL_WINDOW_MODAL;
+
+       ewl_engine_window_modal_set(win);
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
  * @param win: the window to change keyboard grab settings.
  * @param grab: TRUE or FALSE to indicate grab state.
  * @return Returns no value.
@@ -644,6 +670,7 @@
        ewl_engine_window_borderless_set(window);
        ewl_engine_window_dialog_set(window);
        ewl_engine_window_fullscreen_set(window);
+       ewl_engine_window_modal_set(window);
 
        width = ewl_object_maximum_w_get(EWL_OBJECT(window));
        height = ewl_object_maximum_h_get(EWL_OBJECT(window));
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_window.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- ewl_window.h        9 Jun 2006 19:33:14 -0000       1.18
+++ ewl_window.h        10 Jun 2006 00:35:06 -0000      1.19
@@ -73,7 +73,8 @@
 void            ewl_window_move(Ewl_Window *win, int x, int y);
 void            ewl_window_raise(Ewl_Window *win);
 void            ewl_window_lower(Ewl_Window *win);
-void            ewl_window_transient_for(Ewl_Window *win, Ewl_Window * forwin);
+void            ewl_window_transient_for(Ewl_Window *win, Ewl_Window *forwin);
+void           ewl_window_modal_for(Ewl_Window *win, Ewl_Window *forwin);
 void            ewl_window_keyboard_grab_set(Ewl_Window *win, int grab);
 int             ewl_window_keyboard_grab_get(Ewl_Window *win);
 void            ewl_window_pointer_grab_set(Ewl_Window *win, int grab);




_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to