diff options
author | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
commit | dd7595a3475407a7fa96a97393bae8c5220e8762 (patch) | |
tree | e341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/ecore/src/lib/ecore_x/xlib/ecore_x_mwm.c | |
parent | Add the skeleton. (diff) | |
download | SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2 SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz |
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to '')
-rw-r--r-- | libraries/ecore/src/lib/ecore_x/xlib/ecore_x_mwm.c | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_mwm.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_mwm.c new file mode 100644 index 0000000..7459a8b --- /dev/null +++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_mwm.c | |||
@@ -0,0 +1,106 @@ | |||
1 | /* | ||
2 | * Various MWM related functions. | ||
3 | * | ||
4 | * This is ALL the code involving anything MWM related. for both WM and | ||
5 | * client. | ||
6 | */ | ||
7 | |||
8 | #ifdef HAVE_CONFIG_H | ||
9 | # include <config.h> | ||
10 | #endif /* ifdef HAVE_CONFIG_H */ | ||
11 | |||
12 | #include <stdlib.h> | ||
13 | |||
14 | #include "Ecore.h" | ||
15 | #include "ecore_x_private.h" | ||
16 | #include "Ecore_X.h" | ||
17 | #include "Ecore_X_Atoms.h" | ||
18 | |||
19 | #define ECORE_X_MWM_HINTS_FUNCTIONS (1 << 0) | ||
20 | #define ECORE_X_MWM_HINTS_DECORATIONS (1 << 1) | ||
21 | #define ECORE_X_MWM_HINTS_INPUT_MODE (1 << 2) | ||
22 | #define ECORE_X_MWM_HINTS_STATUS (1 << 3) | ||
23 | |||
24 | typedef struct _mwmhints | ||
25 | { | ||
26 | CARD32 flags; | ||
27 | CARD32 functions; | ||
28 | CARD32 decorations; | ||
29 | INT32 inputmode; | ||
30 | CARD32 status; | ||
31 | } | ||
32 | MWMHints; | ||
33 | |||
34 | EAPI Eina_Bool | ||
35 | ecore_x_mwm_hints_get(Ecore_X_Window win, | ||
36 | Ecore_X_MWM_Hint_Func *fhint, | ||
37 | Ecore_X_MWM_Hint_Decor *dhint, | ||
38 | Ecore_X_MWM_Hint_Input *ihint) | ||
39 | { | ||
40 | unsigned char *p = NULL; | ||
41 | MWMHints *mwmhints = NULL; | ||
42 | int num; | ||
43 | Eina_Bool ret; | ||
44 | |||
45 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
46 | ret = EINA_FALSE; | ||
47 | if (!ecore_x_window_prop_property_get(win, | ||
48 | ECORE_X_ATOM_MOTIF_WM_HINTS, | ||
49 | ECORE_X_ATOM_MOTIF_WM_HINTS, | ||
50 | 32, &p, &num)) | ||
51 | return EINA_FALSE; | ||
52 | |||
53 | mwmhints = (MWMHints *)p; | ||
54 | if (mwmhints) | ||
55 | { | ||
56 | if (num >= 4) | ||
57 | { | ||
58 | if (dhint) | ||
59 | { | ||
60 | if (mwmhints->flags & ECORE_X_MWM_HINTS_DECORATIONS) | ||
61 | *dhint = mwmhints->decorations; | ||
62 | else | ||
63 | *dhint = ECORE_X_MWM_HINT_DECOR_ALL; | ||
64 | } | ||
65 | |||
66 | if (fhint) | ||
67 | { | ||
68 | if (mwmhints->flags & ECORE_X_MWM_HINTS_FUNCTIONS) | ||
69 | *fhint = mwmhints->functions; | ||
70 | else | ||
71 | *fhint = ECORE_X_MWM_HINT_FUNC_ALL; | ||
72 | } | ||
73 | |||
74 | if (ihint) | ||
75 | { | ||
76 | if (mwmhints->flags & ECORE_X_MWM_HINTS_INPUT_MODE) | ||
77 | *ihint = mwmhints->inputmode; | ||
78 | else | ||
79 | *ihint = ECORE_X_MWM_HINT_INPUT_MODELESS; | ||
80 | } | ||
81 | |||
82 | ret = EINA_TRUE; | ||
83 | } | ||
84 | |||
85 | free(mwmhints); | ||
86 | } | ||
87 | |||
88 | return ret; | ||
89 | } /* ecore_x_mwm_hints_get */ | ||
90 | |||
91 | EAPI void | ||
92 | ecore_x_mwm_borderless_set(Ecore_X_Window win, | ||
93 | Eina_Bool borderless) | ||
94 | { | ||
95 | unsigned int data[5] = {0, 0, 0, 0, 0}; | ||
96 | |||
97 | data[0] = 2; /* just set the decorations hint! */ | ||
98 | data[2] = !borderless; | ||
99 | |||
100 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
101 | ecore_x_window_prop_property_set(win, | ||
102 | ECORE_X_ATOM_MOTIF_WM_HINTS, | ||
103 | ECORE_X_ATOM_MOTIF_WM_HINTS, | ||
104 | 32, (void *)data, 5); | ||
105 | } /* ecore_x_mwm_borderless_set */ | ||
106 | |||