Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_window.c ewl_window.h 


Log Message:
- API BREAK -- ewl_window_borderless_set now takes a flag so you can remove the 
borderless setting

- add ewl_window_borderless_get

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_window.c,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -3 -r1.89 -r1.90
--- ewl_window.c        14 Jan 2008 13:10:49 -0000      1.89
+++ ewl_window.c        20 Mar 2008 02:45:47 -0000      1.90
@@ -237,25 +237,47 @@
 }
 
 /**
- * @param win: the window to remove the border
+ * @param win: the window to change the border flag on
+ * @param border: the borderless flag to set, either TRUe or FALSE
  * @return Returns no value.
- * @brief Remove the border from the specified window
+ * @brief Changes the border from the specified window
  *
- * Remove the border from the specified widget and call the
- * necessary X lib functions to update the appearance.
+ * Changes the border from the specified window
  */
 void
-ewl_window_borderless_set(Ewl_Window *win)
+ewl_window_borderless_set(Ewl_Window *win, unsigned int border)
 {
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR(win);
        DCHECK_TYPE(win, EWL_WINDOW_TYPE);
 
-       win->flags |= EWL_WINDOW_BORDERLESS;
+       border = !!border;
+
+       /* do nothing if already set */
+       if (border == ewl_window_borderless_get(win))
+               DRETURN(DLEVEL_STABLE);
+
+       if (border) win->flags |= EWL_WINDOW_BORDERLESS;
+       else win->flags &= ~EWL_WINDOW_BORDERLESS;
 
        ewl_engine_window_borderless_set(win);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @param win: The window to get the border settings from
+ * @return Returns TRUE if the window is borderless, FALSE otherwise
+ * @brief Retrieves the borderless flag for the window
+ */
+unsigned int
+ewl_window_borderless_get(Ewl_Window *win)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR_RET(win, FALSE);
+       DCHECK_TYPE_RET(win, EWL_WINDOW_TYPE, FALSE);
+
+       DRETURN_INT(!!(win->flags & EWL_WINDOW_BORDERLESS), DLEVEL_STABLE);
 }
 
 /**
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_window.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -3 -r1.41 -r1.42
--- ewl_window.h        19 Dec 2007 16:15:31 -0000      1.41
+++ ewl_window.h        20 Mar 2008 02:45:47 -0000      1.42
@@ -82,7 +82,8 @@
 const char     *ewl_window_name_get(Ewl_Window *win);
 void            ewl_window_class_set(Ewl_Window *win, const char *classname);
 const char     *ewl_window_class_get(Ewl_Window *win);
-void            ewl_window_borderless_set(Ewl_Window *win);
+void            ewl_window_borderless_set(Ewl_Window *win, unsigned int 
border);
+unsigned int    ewl_window_borderless_get(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,



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to