Enlightenment CVS committal Author : pfritz Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_enums.h ewl_window.c ewl_window.h Log Message: add ewl_window_dialog_set/get =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_enums.h,v retrieving revision 1.46 retrieving revision 1.47 diff -u -3 -r1.46 -r1.47 --- ewl_enums.h 5 Jun 2006 04:12:30 -0000 1.46 +++ ewl_enums.h 5 Jun 2006 05:05:31 -0000 1.47 @@ -257,7 +257,8 @@ EWL_WINDOW_GRAB_POINTER = 0x4, /**< Window grabs pointer */ EWL_WINDOW_GRAB_KEYBOARD = 0x8, /**< Window grabs keyboard */ EWL_WINDOW_OVERRIDE = 0x10, /**< Window override setting */ - EWL_WINDOW_FULLSCREEN = 0x20 /**< Window is fullscreen */ + EWL_WINDOW_FULLSCREEN = 0x20, /**< Window is fullscreen */ + EWL_WINDOW_DIALOG = 0x40 /**< Window has no max and min buttons */ }; /** =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_window.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -3 -r1.46 -r1.47 --- ewl_window.c 5 Jun 2006 04:12:30 -0000 1.46 +++ ewl_window.c 5 Jun 2006 05:05:31 -0000 1.47 @@ -283,6 +283,62 @@ } /** + * @param win: the window + * @param override: TRUE or FALSE to indicate dialog state. + * @return Returns no value. + * @brief Changes the dialog state on the specified window. + * + * A dialog window has not a iconify and/or maximize button. + */ +void +ewl_window_dialog_set(Ewl_Window *win, int dialog) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("win", win); + DCHECK_TYPE("win", win, EWL_WINDOW_TYPE); + + /* do nothing if already set */ + if (dialog == ewl_window_dialog_get(win)) + DRETURN(DLEVEL_STABLE); + + if (dialog) + win->flags |= EWL_WINDOW_DIALOG; + else + win->flags &= ~EWL_WINDOW_DIALOG; + +#ifdef ENABLE_EWL_SOFTWARE_X11 + if (REALIZED(win) && strstr(win->render, "x11")) { + if (dialog) + ecore_x_netwm_window_type_set( + (Ecore_X_Window)win->window, + ECORE_X_WINDOW_TYPE_DIALOG); + else + ecore_x_netwm_window_type_set( + (Ecore_X_Window)win->window, + ECORE_X_WINDOW_TYPE_NORMAL); +#endif + } + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param win: window to retrieve dialog state + * @return Returns TRUE if window is an dialog window, FALSE otherwise. + * @brief Retrieves the current dialog state on a window. + */ +int +ewl_window_dialog_get(Ewl_Window *win) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR_RET("win", win, FALSE); + DCHECK_TYPE_RET("win", win, EWL_WINDOW_TYPE, FALSE); + + DRETURN_INT((!!(win->flags & EWL_WINDOW_DIALOG)), DLEVEL_STABLE); +} + + +/** * @param win: The window to work with * @param fullscreen: The fullscreen setting to use * @return Returns no value @@ -744,6 +800,12 @@ if (window->flags & EWL_WINDOW_BORDERLESS) ecore_x_mwm_borderless_set(xwin, 1); + if (window->flags & EWL_WINDOW_DIALOG) + ecore_x_netwm_window_type_set(xwin, + ECORE_X_WINDOW_TYPE_DIALOG); + else + ecore_x_netwm_window_type_set(xwin, + ECORE_X_WINDOW_TYPE_NORMAL); if (window->flags & EWL_WINDOW_FULLSCREEN) { =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_window.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- ewl_window.h 5 Jun 2006 04:12:30 -0000 1.16 +++ ewl_window.h 5 Jun 2006 05:05:31 -0000 1.17 @@ -66,6 +66,8 @@ void ewl_window_class_set(Ewl_Window *win, const char *classname); char *ewl_window_class_get(Ewl_Window *win); void ewl_window_borderless_set(Ewl_Window *win); +void ewl_window_dialog_set(Ewl_Window *win, int dialog); +int ewl_window_dialog_get(Ewl_Window *win); void ewl_window_fullscreen_set(Ewl_Window *win, unsigned int fullscreen); unsigned int ewl_window_fullscreen_get(Ewl_Window *win); _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs