Enlightenment CVS committal Author : pfritz Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_window.c ewl_window.h Log Message: add ewl_window_urgent_set/get() =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_window.c,v retrieving revision 1.80 retrieving revision 1.81 diff -u -3 -r1.80 -r1.81 --- ewl_window.c 18 May 2007 21:24:35 -0000 1.80 +++ ewl_window.c 20 May 2007 19:13:43 -0000 1.81 @@ -498,7 +498,11 @@ * @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. + * Demand attention for the window @a win if it is realized. + * The window manager will then try to draw attention to the + * window, e.g. a blinking taskbar entry. When the window + * got the wanted attention the window manager will stop + * this action itself. */ void ewl_window_attention_demand(Ewl_Window *win) @@ -507,9 +511,54 @@ DCHECK_PARAM_PTR("win", win); DCHECK_TYPE("win", win, EWL_WINDOW_TYPE); + win->flags |= EWL_WINDOW_DEMANDS_ATTENTION; ewl_engine_window_states_set(win); DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param win: the window to work with. + * @param urgent: if the window should have the urgent hint + * @return Returns no value. + * @brief Set the window to be urgent + * + * This is similar to a attention demand with the difference, that + * it is more urgent and the window manager might even raise the window + * and/or let title bar blink. Different from attention demand the + * window manager will not reset it to normal state, so it is up + * to the application to do this, after it got the needed attention. + */ +void +ewl_window_urgent_set(Ewl_Window *win, unsigned int urgent) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("win", win); + DCHECK_TYPE("win", win, EWL_WINDOW_TYPE); + + if (urgent) + win->flags |= EWL_WINDOW_URGENT; + else + win->flags &= ~EWL_WINDOW_URGENT; + + ewl_engine_window_hints_set(win); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param win: the window to work with. + * @return the urgent state + * @brief Get the window urgent state + */ +unsigned int +ewl_window_urgent_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_URGENT), DLEVEL_STABLE); } /** =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_window.h,v retrieving revision 1.35 retrieving revision 1.36 diff -u -3 -r1.35 -r1.36 --- ewl_window.h 18 May 2007 21:24:35 -0000 1.35 +++ ewl_window.h 20 May 2007 19:13:43 -0000 1.36 @@ -93,6 +93,8 @@ unsigned int skip); unsigned int ewl_window_skip_pager_get(Ewl_Window *win); void ewl_window_attention_demand(Ewl_Window *win); +void ewl_window_urgent_set(Ewl_Window *win, unsigned int urgent); +unsigned int ewl_window_urgent_get(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); ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs