aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/ecore/src/lib/ecore_x/ecore_x_mwm.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2004-11-25 14:09:24 +0000
committerCarsten Haitzler <raster@rasterman.com>2004-11-25 14:09:24 +0000
commit80875741e7ed89700e966be653348841bc8ebf01 (patch)
treea963ab6ad5fa04462f5a4d792f0f3cdfe5d776da /legacy/ecore/src/lib/ecore_x/ecore_x_mwm.c
parenthidden symbol support (diff)
downloadefl-80875741e7ed89700e966be653348841bc8ebf01.tar.gz
borderless hint mwm stuff PROPERLY done...
SVN revision: 12256
Diffstat (limited to 'legacy/ecore/src/lib/ecore_x/ecore_x_mwm.c')
-rw-r--r--legacy/ecore/src/lib/ecore_x/ecore_x_mwm.c74
1 files changed, 74 insertions, 0 deletions
diff --git a/legacy/ecore/src/lib/ecore_x/ecore_x_mwm.c b/legacy/ecore/src/lib/ecore_x/ecore_x_mwm.c
new file mode 100644
index 0000000000..f9d3f4f1f9
--- /dev/null
+++ b/legacy/ecore/src/lib/ecore_x/ecore_x_mwm.c
@@ -0,0 +1,74 @@
+/*
+ * Various ICCCM related functions.
+ *
+ * This is ALL the code involving anything ICCCM related. for both WM and
+ * client.
+ */
+#include "Ecore.h"
+#include "ecore_x_private.h"
+#include "Ecore_X.h"
+
+#define ECORE_X_MWM_HINTS_FUNCTIONS (1 << 0)
+#define ECORE_X_MWM_HINTS_DECORATIONS (1 << 1)
+#define ECORE_X_MWM_HINTS_INPUT_MODE (1 << 2)
+#define ECORE_X_MWM_HINTS_STATUS (1 << 3)
+
+typedef struct _mwmhints
+{
+ CARD32 flags;
+ CARD32 functions;
+ CARD32 decorations;
+ INT32 inputmode;
+ CARD32 status;
+}
+MWMHints;
+
+int
+ecore_x_mwm_hints_get(Ecore_X_Window win,
+ Ecore_X_MWM_Hint_Func *fhint,
+ Ecore_X_MWM_Hint_Decor *dhint,
+ Ecore_X_MWM_Hint_Input *ihint)
+{
+ unsigned char *p = NULL;
+ MWMHints *mwmhints = NULL;
+ int num;
+ int ret;
+
+ ret = 0;
+ if (!ecore_x_window_prop_property_get(win,
+ _ecore_x_atom_motif_wm_hints,
+ _ecore_x_atom_motif_wm_hints,
+ 32, &p, &num))
+ return 0;
+ mwmhints = (MWMHints *)p;
+ if (mwmhints)
+ {
+ if (num >= 4)
+ {
+ if (dhint)
+ {
+ if (mwmhints->flags & ECORE_X_MWM_HINTS_DECORATIONS)
+ *dhint = mwmhints->decorations;
+ else
+ *dhint = ECORE_X_MWM_HINT_DECOR_ALL;
+ }
+ if (fhint)
+ {
+ if (mwmhints->flags & ECORE_X_MWM_HINTS_FUNCTIONS)
+ *fhint = mwmhints->functions;
+ else
+ *fhint = ECORE_X_MWM_HINT_FUNC_ALL;
+ }
+ if (ihint)
+ {
+ if (mwmhints->flags & ECORE_X_MWM_HINTS_INPUT_MODE)
+ *ihint = mwmhints->inputmode;
+ else
+ *ihint = ECORE_X_MWM_HINT_INPUT_MODELESS;
+ }
+ ret = 1;
+ }
+ free(mwmhints);
+ }
+ return ret;
+}