From: Enlightenment C. <no...@cv...> - 2007-03-15 16:49:06
|
Enlightenment CVS committal Author : pfritz 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 window_skip_[pager/taskbar]_[set/get] (i know they are probably useless for all (most) EWL apps - add window_attention_demand() (doesn't work atm) =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_engines.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -3 -r1.40 -r1.41 --- ewl_engines.c 5 Mar 2007 11:52:54 -0000 1.40 +++ ewl_engines.c 15 Mar 2007 22:49:03 -0000 1.41 @@ -514,6 +514,58 @@ /** * @param win: the window to work with * @return Returns no value + * @brief Skips the taskbar + */ +void +ewl_engine_window_skip_taskbar_set(Ewl_Window *win) +{ + Ewl_Engine_Cb_Window_Skip_Taskbar_Set window_skip_taskbar_set; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("win", win); + DCHECK_TYPE("win", win, EWL_WINDOW_TYPE); + + if (!(win->window)) + DRETURN(DLEVEL_STABLE); + + window_skip_taskbar_set = ewl_engine_hook_get(EWL_EMBED(win), + EWL_ENGINE_HOOK_TYPE_WINDOW, + EWL_ENGINE_WINDOW_SKIP_TASKBAR_SET); + if (window_skip_taskbar_set) + window_skip_taskbar_set(win); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param win: the window to work with + * @return Returns no value + * @brief Skips the pager + */ +void +ewl_engine_window_skip_pager_set(Ewl_Window *win) +{ + Ewl_Engine_Cb_Window_Skip_Pager_Set window_skip_pager_set; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("win", win); + DCHECK_TYPE("win", win, EWL_WINDOW_TYPE); + + if (!(win->window)) + DRETURN(DLEVEL_STABLE); + + window_skip_pager_set = ewl_engine_hook_get(EWL_EMBED(win), + EWL_ENGINE_HOOK_TYPE_WINDOW, + EWL_ENGINE_WINDOW_SKIP_PAGER_SET); + if (window_skip_pager_set) + window_skip_pager_set(win); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param win: the window to work with + * @return Returns no value * @brief Sets the window transient */ void @@ -559,6 +611,32 @@ EWL_ENGINE_WINDOW_MODAL_SET); if (window_modal_set) window_modal_set(win); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param win: the window to work with + * @return Returns no value + * @brief Sets the window transient + */ +void +ewl_engine_window_attention_demand(Ewl_Window *win) +{ + Ewl_Engine_Cb_Window_Attention_Demand window_attention_demand; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("win", win); + DCHECK_TYPE("win", win, EWL_WINDOW_TYPE); + + if (!(win->window)) + DRETURN(DLEVEL_STABLE); + + window_attention_demand = ewl_engine_hook_get(EWL_EMBED(win), + EWL_ENGINE_HOOK_TYPE_WINDOW, + EWL_ENGINE_WINDOW_ATTENTION_DEMAND); + if (window_attention_demand) + window_attention_demand(win); DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_engines.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- ewl_engines.h 4 Mar 2007 00:52:01 -0000 1.24 +++ ewl_engines.h 15 Mar 2007 22:49:03 -0000 1.25 @@ -22,9 +22,14 @@ EWL_ENGINE_WINDOW_DIALOG_SET, /**< Set the dialog setting of the window */ EWL_ENGINE_WINDOW_FULLSCREEN_SET, /**< Set the fullscreen setting of the window */ + EWL_ENGINE_WINDOW_SKIP_TASKBAR_SET, /**< Set the skip taskbar + setting of the window */ + EWL_ENGINE_WINDOW_SKIP_PAGER_SET, /**< Set the skip pager + setting of the window */ EWL_ENGINE_WINDOW_TRANSIENT_FOR, /**< Set the window transient */ EWL_ENGINE_WINDOW_MODAL_SET, /**< Set the window modal */ - + EWL_ENGINE_WINDOW_ATTENTION_DEMAND, /**< Demand attention + for the window */ EWL_ENGINE_WINDOW_RAISE, /**< Raise the window */ EWL_ENGINE_WINDOW_LOWER, /**< Lower the window */ @@ -179,8 +184,11 @@ void ewl_engine_window_borderless_set(Ewl_Window *win); void ewl_engine_window_dialog_set(Ewl_Window *win); void ewl_engine_window_fullscreen_set(Ewl_Window *win); +void ewl_engine_window_skip_taskbar_set(Ewl_Window *win); +void ewl_engine_window_skip_pager_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_attention_demand(Ewl_Window *win); void ewl_engine_window_raise(Ewl_Window *win); void ewl_engine_window_lower(Ewl_Window *win); @@ -244,9 +252,14 @@ setting of the window */ typedef void (*Ewl_Engine_Cb_Window_Fullscreen_Set)(Ewl_Window *win); /**< Set the fullscreen setting of the window */ +typedef void (*Ewl_Engine_Cb_Window_Skip_Taskbar_Set)(Ewl_Window *win); /**< Set the fullscreen + setting of the window */ +typedef void (*Ewl_Engine_Cb_Window_Skip_Pager_Set)(Ewl_Window *win); /**< Set the fullscreen + setting of the window */ typedef void (*Ewl_Engine_Cb_Window_Transient_For)(Ewl_Window *win); /**< Set the window transient */ typedef void (*Ewl_Engine_Cb_Window_Modal_Set)(Ewl_Window *win); /**< Set the window modal */ +typedef void (*Ewl_Engine_Cb_Window_Attention_Demand)(Ewl_Window *win); /**< Set the window modal */ typedef void (*Ewl_Engine_Cb_Window_Raise)(Ewl_Window *win); /**< Raise the window */ typedef void (*Ewl_Engine_Cb_Window_Lower)(Ewl_Window *win); /**< Lower the window */ typedef int (*Ewl_Engine_Cb_Keyboard_Grab)(Ewl_Window *win); /**< Set the keyboard grab */ =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_enums.h,v retrieving revision 1.73 retrieving revision 1.74 diff -u -3 -r1.73 -r1.74 --- ewl_enums.h 4 Mar 2007 01:06:48 -0000 1.73 +++ ewl_enums.h 15 Mar 2007 22:49:03 -0000 1.74 @@ -256,7 +256,9 @@ EWL_WINDOW_DIALOG = 0x40, /**< Window has no max and min buttons */ EWL_WINDOW_MODAL = 0x80, /**< Window is modal */ EWL_WINDOW_TRANSIENT = 0x100, /**< Window is transient for */ - EWL_WINDOW_TRANSIENT_FOREIGN = 0x200 /**< Window is transient for */ + EWL_WINDOW_TRANSIENT_FOREIGN = 0x200, /**< Window is transient for */ + EWL_WINDOW_SKIP_TASKBAR = 0x400, /**< Window skips taskbar */ + EWL_WINDOW_SKIP_PAGER = 0x800 /**< Window skips pager */ }; /** =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_window.c,v retrieving revision 1.74 retrieving revision 1.75 diff -u -3 -r1.74 -r1.75 --- ewl_window.c 7 Mar 2007 09:13:51 -0000 1.74 +++ ewl_window.c 15 Mar 2007 22:49:03 -0000 1.75 @@ -343,6 +343,92 @@ } /** + * @param win: The window to work with + * @param skip: If the @p win should not be in the taskbar + * @return Returns no value + * @brief Sets the skip taskbar setting for the window + */ +void +ewl_window_skip_taskbar_set(Ewl_Window *win, unsigned int skip) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("win", win); + DCHECK_TYPE("win", win, EWL_WINDOW_TYPE); + + /* do nothing if already set */ + if (skip == ewl_window_skip_taskbar_get(win)) + DRETURN(DLEVEL_STABLE); + + if (skip) + win->flags |= EWL_WINDOW_SKIP_TASKBAR; + else + win->flags &= ~EWL_WINDOW_SKIP_TASKBAR; + + ewl_engine_window_skip_taskbar_set(win); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param win: The window to work with + * @return Returns TRUE if the window is to be skipped for the taskbar, + * FALSE otherwise + * @brief Retrieve the skip taskbar setting for the window + */ +unsigned int +ewl_window_skip_taskbar_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_SKIP_TASKBAR)), DLEVEL_STABLE); +} + +/** + * @param win: The window to work with + * @param skip: If the @p win should be visible in the pager + * @return Returns no value + * @brief Sets the skip pager setting for the window + */ +void +ewl_window_skip_pager_set(Ewl_Window *win, unsigned int skip) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("win", win); + DCHECK_TYPE("win", win, EWL_WINDOW_TYPE); + + /* do nothing if already set */ + if (skip == ewl_window_skip_pager_get(win)) + DRETURN(DLEVEL_STABLE); + + if (skip) + win->flags |= EWL_WINDOW_SKIP_PAGER; + else + win->flags &= ~EWL_WINDOW_SKIP_PAGER; + + ewl_engine_window_skip_pager_set(win); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param win: The window to work with + * @return Returns TRUE if the window is to be skipped for the pager, + * FALSE otherwise + * @brief Retrieve the skip pager setting for the window + */ +unsigned int +ewl_window_skip_pager_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_SKIP_PAGER)), DLEVEL_STABLE); +} + +/** * @param win: the window to move * @param x: the x coordinate of the new position * @param y: the y coordinate of the new position @@ -406,6 +492,24 @@ } /** + * @param win: the window to work with. + * @return Returns no value. + * @brief Request the WM to pay attention to the window + * + * Demand attention for the window @a win if it is realized. + */ +void +ewl_window_attention_demand(Ewl_Window *win) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("win", win); + DCHECK_TYPE("win", win, EWL_WINDOW_TYPE); + + ewl_engine_window_attention_demand(win); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} +/** * @param win: window to set transient * @param forwin: the window to be transient for * @return Returns no value. @@ -689,6 +793,8 @@ ewl_engine_window_borderless_set(window); ewl_engine_window_dialog_set(window); ewl_engine_window_fullscreen_set(window); + ewl_engine_window_skip_taskbar_set(window); + ewl_engine_window_skip_pager_set(window); ewl_engine_window_modal_set(window); width = ewl_object_maximum_w_get(EWL_OBJECT(window)); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_window.h,v retrieving revision 1.31 retrieving revision 1.32 diff -u -3 -r1.31 -r1.32 --- ewl_window.h 4 Mar 2007 00:52:01 -0000 1.31 +++ ewl_window.h 15 Mar 2007 22:49:03 -0000 1.32 @@ -78,6 +78,13 @@ void ewl_window_fullscreen_set(Ewl_Window *win, unsigned int fullscreen); unsigned int ewl_window_fullscreen_get(Ewl_Window *win); +void ewl_window_skip_taskbar_set(Ewl_Window *win, + unsigned int skip); +unsigned int ewl_window_skip_taskbar_get(Ewl_Window *win); +void ewl_window_skip_pager_set(Ewl_Window *win, + unsigned int skip); +unsigned int ewl_window_skip_pager_get(Ewl_Window *win); +void ewl_window_attention_demand(Ewl_Window *win); 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); |