Suggesting a minor change to ecore_x_window_prop_window_type_set().
authorKim Woelders <kim@woelders.dk>
Wed, 28 Jan 2004 21:48:27 +0000 (21:48 +0000)
committerKim Woelders <kim@woelders.dk>
Wed, 28 Jan 2004 21:48:27 +0000 (21:48 +0000)
SVN revision: 8707

legacy/ecore/src/lib/ecore_x/Ecore_X.h
legacy/ecore/src/lib/ecore_x/ecore_x_window_prop.c

index 440f6ab2affb84ecc5cd7b90549aac4902b95c49..be48c0aef0bbcb32c19c3d79123d489456eb2559 100644 (file)
@@ -577,6 +577,18 @@ typedef enum _Ecore_X_Window_State {
 
 } Ecore_X_Window_State;
 
+typedef enum _Ecore_X_Window_Type {
+    ECORE_X_WINDOW_TYPE_DESKTOP,
+    ECORE_X_WINDOW_TYPE_DOCK,
+    ECORE_X_WINDOW_TYPE_TOOLBAR,
+    ECORE_X_WINDOW_TYPE_MENU,
+    ECORE_X_WINDOW_TYPE_UTILITY,
+    ECORE_X_WINDOW_TYPE_SPLASH,
+    ECORE_X_WINDOW_TYPE_DIALOG,
+    ECORE_X_WINDOW_TYPE_NORMAL
+} Ecore_X_Window_Type;
+
+
 int              ecore_x_init(const char *name);
 int              ecore_x_shutdown(void);       
 Ecore_X_Display *ecore_x_display_get(void);
index 3410531746b918a08ecebcd625843bdd844d8b5d..c86a1d85c87a8293120c2818771b79c5561f172b 100644 (file)
@@ -836,6 +836,65 @@ ecore_x_window_prop_desktop_get(Ecore_X_Window win)
    return desktop;
 }
 
+
+#if 0
+/*
+ * Suggesting a slight change of API.
+ * The ECORE_X_WINDOW_TYPE_...'s I think we want in Ecore_X.h anyway.
+ * It makes things more similar to ecore_x_window_prop_state_set().
+ * It also avoids having to define all the different
+ * ecore_x_window_prop_window_type_..._set()'s.
+ * Setting a window to type desktop would then become
+ * ecore_x_window_prop_window_type_set(win, ECORE_X_WINDOW_TYPE_DESKTOP);
+ * /Kim
+ */
+
+static Ecore_X_Atom 
+_ecore_x_window_prop_type_atom_get(Ecore_X_Window_Type type)
+{
+   switch (type)
+   {
+      case ECORE_X_WINDOW_TYPE_DESKTOP:
+         return _ecore_x_atom_net_wm_window_type_desktop;
+      case ECORE_X_WINDOW_TYPE_DOCK:
+         return _ecore_x_atom_net_wm_window_type_dock;
+      case ECORE_X_WINDOW_TYPE_TOOLBAR:
+         return _ecore_x_atom_net_wm_window_type_toolbar;
+      case ECORE_X_WINDOW_TYPE_MENU:
+         return _ecore_x_atom_net_wm_window_type_menu;
+      case ECORE_X_WINDOW_TYPE_UTILITY:
+         return _ecore_x_atom_net_wm_window_type_utility;
+      case ECORE_X_WINDOW_TYPE_SPLASH:
+         return _ecore_x_atom_net_wm_window_type_splash;
+      case ECORE_X_WINDOW_TYPE_DIALOG:
+         return _ecore_x_atom_net_wm_window_type_dialog;
+      case ECORE_X_WINDOW_TYPE_NORMAL:
+         return _ecore_x_atom_net_wm_window_type_normal;
+      default:
+         return 0;
+   }
+}
+
+/**
+ * Set a window's type.
+ * @param win The Window
+ * @param type The Type
+ *
+ * Set a windows type.
+ * <hr><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
+ */
+void
+ecore_x_window_prop_window_type_set(Ecore_X_Window win, Ecore_X_Window_Type type)
+{
+   Atom a;
+
+   a = _ecore_x_window_prop_type_atom_get(type);
+   if (a)
+      ecore_x_window_prop_property_set(win, _ecore_x_atom_net_wm_window_type,
+                                      XA_ATOM, 32, (unsigned char*)&a, 1);
+}
+#endif
+
 /**
  * Change a window's type.
  * @param win The Window