summaryrefslogtreecommitdiff
path: root/legacy/ecore
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2004-10-22 03:41:49 +0000
committerCarsten Haitzler <raster@rasterman.com>2004-10-22 03:41:49 +0000
commitacfe99556391c320a887150cf028e7cc0c0eb1fd (patch)
treea4e9c273174a03b43d69602b5bd08032ea2f0363 /legacy/ecore
parent0e38160623944e26f396a18cf7cf6c1e2f684e1e (diff)
ok fix some things with SSL and ecore_evas. you ALWYAs have at least the api
to do ssl and al fo ecorE_evas stuff BUt ecore_* may not be BUILT with that support so the api stub exists but it may just return NULL. theres calls to query for support here. SVN revision: 11957
Diffstat (limited to '')
-rw-r--r--legacy/ecore/configure.in3
-rw-r--r--legacy/ecore/src/bin/Makefile.am4
-rw-r--r--legacy/ecore/src/lib/ecore/Makefile.am2
-rw-r--r--legacy/ecore/src/lib/ecore_con/Ecore_Con.h (renamed from legacy/ecore/src/lib/ecore_con/Ecore_Con.h.in)15
-rw-r--r--legacy/ecore/src/lib/ecore_con/Makefile.am7
-rw-r--r--legacy/ecore/src/lib/ecore_con/ecore_con.c15
-rw-r--r--legacy/ecore/src/lib/ecore_config/Makefile.am4
-rw-r--r--legacy/ecore/src/lib/ecore_evas/Ecore_Evas.h136
-rw-r--r--legacy/ecore/src/lib/ecore_evas/Makefile.am3
-rw-r--r--legacy/ecore/src/lib/ecore_evas/ecore_evas.c47
-rw-r--r--legacy/ecore/src/lib/ecore_evas/ecore_evas_x.c22
-rw-r--r--legacy/ecore/src/lib/ecore_fb/Makefile.am2
-rw-r--r--legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h (renamed from legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h.in)14
-rw-r--r--legacy/ecore/src/lib/ecore_ipc/Makefile.am9
-rw-r--r--legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c14
-rw-r--r--legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h4
-rw-r--r--legacy/ecore/src/lib/ecore_job/Makefile.am2
-rw-r--r--legacy/ecore/src/lib/ecore_txt/Makefile.am2
-rw-r--r--legacy/ecore/src/lib/ecore_x/Ecore_X.h35
-rw-r--r--legacy/ecore/src/lib/ecore_x/Makefile.am2
-rw-r--r--legacy/ecore/src/lib/ecore_x/ecore_x.c69
-rw-r--r--legacy/ecore/src/lib/ecore_x/ecore_x_icccm.c204
22 files changed, 444 insertions, 171 deletions
diff --git a/legacy/ecore/configure.in b/legacy/ecore/configure.in
index f51b9bbc52..b56f6ef075 100644
--- a/legacy/ecore/configure.in
+++ b/legacy/ecore/configure.in
@@ -648,11 +648,8 @@ src/lib/ecore/Makefile
648src/lib/ecore_job/Makefile 648src/lib/ecore_job/Makefile
649src/lib/ecore_x/Makefile 649src/lib/ecore_x/Makefile
650src/lib/ecore_fb/Makefile 650src/lib/ecore_fb/Makefile
651src/lib/ecore_evas/Ecore_Evas.h
652src/lib/ecore_evas/Makefile 651src/lib/ecore_evas/Makefile
653src/lib/ecore_con/Ecore_Con.h
654src/lib/ecore_con/Makefile 652src/lib/ecore_con/Makefile
655src/lib/ecore_ipc/Ecore_Ipc.h
656src/lib/ecore_ipc/Makefile 653src/lib/ecore_ipc/Makefile
657src/lib/ecore_txt/Makefile 654src/lib/ecore_txt/Makefile
658src/lib/ecore_config/Makefile 655src/lib/ecore_config/Makefile
diff --git a/legacy/ecore/src/bin/Makefile.am b/legacy/ecore/src/bin/Makefile.am
index 9f32cab6d3..71640577f8 100644
--- a/legacy/ecore/src/bin/Makefile.am
+++ b/legacy/ecore/src/bin/Makefile.am
@@ -89,8 +89,6 @@ $(ECORE_IPC_LIB) \
89$(ECORE_TXT_LIB) \ 89$(ECORE_TXT_LIB) \
90-lm @iconv_libs@ 90-lm @iconv_libs@
91 91
92#ecore_test_LDFLAGS =
93
94ecore_test_CFLAGS = \ 92ecore_test_CFLAGS = \
95$(CFLAGS) \ 93$(CFLAGS) \
96$(INCLUDES) 94$(INCLUDES)
@@ -123,8 +121,6 @@ $(ECORE_IPC_LIB) \
123$(ECORE_TXT_LIB) \ 121$(ECORE_TXT_LIB) \
124-lm @iconv_libs@ 122-lm @iconv_libs@
125 123
126#ecore_evas_test_LDFLAGS =
127
128ecore_evas_test_CFLAGS = \ 124ecore_evas_test_CFLAGS = \
129$(CFLAGS) \ 125$(CFLAGS) \
130$(INCLUDES) 126$(INCLUDES)
diff --git a/legacy/ecore/src/lib/ecore/Makefile.am b/legacy/ecore/src/lib/ecore/Makefile.am
index 63ac52e128..6a7a6ead94 100644
--- a/legacy/ecore/src/lib/ecore/Makefile.am
+++ b/legacy/ecore/src/lib/ecore/Makefile.am
@@ -31,4 +31,4 @@ ecore_value.c \
31ecore_private.h 31ecore_private.h
32 32
33libecore_la_LIBADD = -lm @dlopen_libs@ @winsock_libs@ 33libecore_la_LIBADD = -lm @dlopen_libs@ @winsock_libs@
34libecore_la_LDFLAGS = -version-info 1:0:0 34libecore_la_LDFLAGS = $(LDFLAGS) -version-info 1:0:0
diff --git a/legacy/ecore/src/lib/ecore_con/Ecore_Con.h.in b/legacy/ecore/src/lib/ecore_con/Ecore_Con.h
index e391473b2b..401e16417b 100644
--- a/legacy/ecore/src/lib/ecore_con/Ecore_Con.h.in
+++ b/legacy/ecore/src/lib/ecore_con/Ecore_Con.h
@@ -33,12 +33,6 @@
33 * @li @ref Ecore_Con_Client_Group 33 * @li @ref Ecore_Con_Client_Group
34 */ 34 */
35 35
36#define HAVE_ECORE_CON_OPENSSL @USE_OPENSSL@
37
38#if HAVE_ECORE_CON_OPENSSL
39#include <openssl/ssl.h>
40#endif
41
42#ifdef __cplusplus 36#ifdef __cplusplus
43extern "C" { 37extern "C" {
44#endif 38#endif
@@ -51,10 +45,8 @@ extern "C" {
51 { 45 {
52 ECORE_CON_LOCAL_USER, 46 ECORE_CON_LOCAL_USER,
53 ECORE_CON_LOCAL_SYSTEM, 47 ECORE_CON_LOCAL_SYSTEM,
54 ECORE_CON_REMOTE_SYSTEM 48 ECORE_CON_REMOTE_SYSTEM,
55#if HAVE_ECORE_CON_OPENSSL 49 ECORE_CON_USE_SSL = 16
56 ,ECORE_CON_USE_SSL = 16
57#endif
58 } Ecore_Con_Type; 50 } Ecore_Con_Type;
59 51
60#endif 52#endif
@@ -124,6 +116,9 @@ extern "C" {
124 void ecore_con_client_data_set(Ecore_Con_Client *cl, const void *data); 116 void ecore_con_client_data_set(Ecore_Con_Client *cl, const void *data);
125 void *ecore_con_client_data_get(Ecore_Con_Client *cl); 117 void *ecore_con_client_data_get(Ecore_Con_Client *cl);
126 118
119 int ecore_con_ssl_available_get(void);
120
121
127#ifdef __cplusplus 122#ifdef __cplusplus
128} 123}
129#endif 124#endif
diff --git a/legacy/ecore/src/lib/ecore_con/Makefile.am b/legacy/ecore/src/lib/ecore_con/Makefile.am
index 318e07a966..0b84b71a00 100644
--- a/legacy/ecore/src/lib/ecore_con/Makefile.am
+++ b/legacy/ecore/src/lib/ecore_con/Makefile.am
@@ -1,13 +1,13 @@
1## Process this file with automake to produce Makefile.in 1## Process this file with automake to produce Makefile.in
2 2
3INCLUDES = \ 3INCLUDES = \
4-I$(top_srcdir)/src/lib/ecore \
5-I$(top_srcdir)/src/lib/ecore_con \
6-I$(top_builddir)/src/lib/ecore \ 4-I$(top_builddir)/src/lib/ecore \
7-I$(top_builddir)/src/lib/ecore_con \ 5-I$(top_builddir)/src/lib/ecore_con \
6-I$(top_srcdir)/src/lib/ecore \
7-I$(top_srcdir)/src/lib/ecore_con \
8@SSL_CFLAGS@ 8@SSL_CFLAGS@
9 9
10libecore_con_la_LDFLAGS = -version-info 1:0:0 \ 10libecore_con_la_LDFLAGS = $(LDFLAGS) -version-info 1:0:0 \
11-L$(top_builddir)/src/lib/ecore/.libs 11-L$(top_builddir)/src/lib/ecore/.libs
12 12
13if BUILD_ECORE_CON 13if BUILD_ECORE_CON
@@ -30,6 +30,5 @@ $(top_builddir)/src/lib/ecore/libecore.la
30endif 30endif
31 31
32EXTRA_DIST = \ 32EXTRA_DIST = \
33Ecore_Con.h.in \
34ecore_con.c \ 33ecore_con.c \
35ecore_con_private.h 34ecore_con_private.h
diff --git a/legacy/ecore/src/lib/ecore_con/ecore_con.c b/legacy/ecore/src/lib/ecore_con/ecore_con.c
index 8f1df98d0f..409a0ffb4d 100644
--- a/legacy/ecore/src/lib/ecore_con/ecore_con.c
+++ b/legacy/ecore/src/lib/ecore_con/ecore_con.c
@@ -725,6 +725,21 @@ ecore_con_client_data_get(Ecore_Con_Client *cl)
725 return cl->data; 725 return cl->data;
726} 726}
727 727
728/**
729 * Returns if SSL support is available
730 * @return 1 if SSL is available, 0 if it is not.
731 * @ingroup Ecore_Con_Client_Group
732 */
733int
734ecore_con_ssl_available_get(void)
735{
736#if USE_OPENSSL
737 return 1;
738#else
739 return 0;
740#endif
741}
742
728static void 743static void
729_ecore_con_server_free(Ecore_Con_Server *svr) 744_ecore_con_server_free(Ecore_Con_Server *svr)
730{ 745{
diff --git a/legacy/ecore/src/lib/ecore_config/Makefile.am b/legacy/ecore/src/lib/ecore_config/Makefile.am
index 82790b12ba..e7ffd3f7e2 100644
--- a/legacy/ecore/src/lib/ecore_config/Makefile.am
+++ b/legacy/ecore/src/lib/ecore_config/Makefile.am
@@ -11,10 +11,10 @@ INCLUDES = \
11 11
12CLEANFILES = $(DB) 12CLEANFILES = $(DB)
13 13
14libecore_config_la_LDFLAGS = -version-info 1:0:0 \ 14libecore_config_la_LDFLAGS = $(LDFLAGS) -version-info 1:0:0 \
15-L$(top_builddir)/src/lib/ecore/.libs 15-L$(top_builddir)/src/lib/ecore/.libs
16 16
17ecore_config_ipc_ecore_la_LDFLAGS = -no-undefined -module \ 17ecore_config_ipc_ecore_la_LDFLAGS = $(LDFLAGS) -no-undefined -module \
18-avoid-version -rdynamic -shared 18-avoid-version -rdynamic -shared
19 19
20if BUILD_ECORE_CONFIG 20if BUILD_ECORE_CONFIG
diff --git a/legacy/ecore/src/lib/ecore_evas/Ecore_Evas.h b/legacy/ecore/src/lib/ecore_evas/Ecore_Evas.h
new file mode 100644
index 0000000000..bd38f46bdf
--- /dev/null
+++ b/legacy/ecore/src/lib/ecore_evas/Ecore_Evas.h
@@ -0,0 +1,136 @@
1#ifndef _ECORE_EVAS_H
2#define _ECORE_EVAS_H
3
4/**
5 * @file Ecore_Evas.h
6 * @brief Evas wrapper functions
7 */
8
9/* FIXME:
10 * to do soon:
11 * - iconfication api needs to work
12 * - maximization api nees to work
13 * - document all calls
14 *
15 * later:
16 * - buffer back-end that renders to an evas_image_object ???
17 * - qt back-end ???
18 * - dfb back-end ??? (dfb's threads make this REALLY HARD)
19 */
20
21#include <Evas.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/* these are dummy and just tell u what API levels ecore_evas supports - not if
28 * the actual support is compiled in. you need to query for that separately.
29 */
30#define HAVE_ECORE_EVAS_X 1
31#define HAVE_ECORE_EVAS_FB 1
32#define HAVE_ECORE_EVAS_GL 1
33
34typedef enum
35{
36 ECORE_EVAS_ENGINE_SOFTWARE_X11,
37 ECORE_EVAS_ENGINE_SOFTWARE_FB,
38 ECORE_EVAS_ENGINE_GL_X11
39} Ecore_Evas_Engine_Type;
40
41#ifndef _ECORE_X_H
42#define _ECORE_X_WINDOW_PREDEF
43typedef unsigned int Ecore_X_Window;
44#endif
45
46#ifndef _ECORE_EVAS_PRIVATE_H
47/* basic data types */
48typedef void Ecore_Evas;
49#endif
50
51/* module setup/shutdown calls */
52
53int ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine);
54
55int ecore_evas_init(void);
56int ecore_evas_shutdown(void);
57
58/* engine/target specific init calls */
59Ecore_Evas *ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
60Ecore_X_Window ecore_evas_software_x11_window_get(Ecore_Evas *ee);
61
62Ecore_Evas *ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h);
63Ecore_X_Window ecore_evas_gl_x11_window_get(Ecore_Evas *ee);
64
65Ecore_Evas *ecore_evas_fb_new(char *disp_name, int rotation, int w, int h);
66
67/* generic manipulation calls */
68void ecore_evas_free(Ecore_Evas *ee);
69void *ecore_evas_data_get(Ecore_Evas *ee, const char *key);
70void ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data);
71void ecore_evas_callback_resize_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
72void ecore_evas_callback_move_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
73void ecore_evas_callback_show_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
74void ecore_evas_callback_hide_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
75void ecore_evas_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
76void ecore_evas_callback_destroy_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
77void ecore_evas_callback_focus_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
78void ecore_evas_callback_focus_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
79void ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
80void ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
81void ecore_evas_callback_pre_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
82void ecore_evas_callback_post_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
83Evas *ecore_evas_get(Ecore_Evas *ee);
84void ecore_evas_move(Ecore_Evas *ee, int x, int y);
85void ecore_evas_resize(Ecore_Evas *ee, int w, int h);
86void ecore_evas_move_resize(Ecore_Evas *ee, int x, int y, int w, int h);
87void ecore_evas_geometry_get(Ecore_Evas *ee, int *x, int *y, int *w, int *h);
88void ecore_evas_rotation_set(Ecore_Evas *ee, int rot);
89int ecore_evas_rotation_get(Ecore_Evas *ee);
90void ecore_evas_shaped_set(Ecore_Evas *ee, int shaped);
91int ecore_evas_shaped_get(Ecore_Evas *ee);
92void ecore_evas_show(Ecore_Evas *ee);
93void ecore_evas_hide(Ecore_Evas *ee);
94int ecore_evas_visibility_get(Ecore_Evas *ee);
95void ecore_evas_raise(Ecore_Evas *ee);
96void ecore_evas_lower(Ecore_Evas *ee);
97void ecore_evas_title_set(Ecore_Evas *ee, const char *t);
98const char *ecore_evas_title_get(Ecore_Evas *ee);
99void ecore_evas_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
100void ecore_evas_name_class_get(Ecore_Evas *ee, const char **n, const char **c);
101void ecore_evas_size_min_set(Ecore_Evas *ee, int w, int h);
102void ecore_evas_size_min_get(Ecore_Evas *ee, int *w, int *h);
103void ecore_evas_size_max_set(Ecore_Evas *ee, int w, int h);
104void ecore_evas_size_max_get(Ecore_Evas *ee, int *w, int *h);
105void ecore_evas_size_base_set(Ecore_Evas *ee, int w, int h);
106void ecore_evas_size_base_get(Ecore_Evas *ee, int *w, int *h);
107void ecore_evas_size_step_set(Ecore_Evas *ee, int w, int h);
108void ecore_evas_size_step_get(Ecore_Evas *ee, int *w, int *h);
109void ecore_evas_cursor_set(Ecore_Evas *ee, const char *file, int layer, int hot_x, int hot_y);
110void ecore_evas_cursor_get(Ecore_Evas *ee, char **file, int *layer, int *hot_x, int *hot_y);
111void ecore_evas_layer_set(Ecore_Evas *ee, int layer);
112int ecore_evas_layer_get(Ecore_Evas *ee);
113void ecore_evas_focus_set(Ecore_Evas *ee, int on);
114int ecore_evas_focus_get(Ecore_Evas *ee);
115void ecore_evas_iconified_set(Ecore_Evas *ee, int on);
116int ecore_evas_iconified_get(Ecore_Evas *ee);
117void ecore_evas_borderless_set(Ecore_Evas *ee, int on);
118int ecore_evas_borderless_get(Ecore_Evas *ee);
119void ecore_evas_override_set(Ecore_Evas *ee, int on);
120int ecore_evas_override_get(Ecore_Evas *ee);
121void ecore_evas_maximized_set(Ecore_Evas *ee, int on);
122int ecore_evas_maximized_get(Ecore_Evas *ee);
123void ecore_evas_fullscreen_set(Ecore_Evas *ee, int on);
124int ecore_evas_fullscreen_get(Ecore_Evas *ee);
125void ecore_evas_avoid_damage_set(Ecore_Evas *ee, int on);
126int ecore_evas_avoid_damage_get(Ecore_Evas *ee);
127void ecore_evas_withdrawn_set(Ecore_Evas *ee, int withdrawn);
128int ecore_evas_withdrawn_get(Ecore_Evas *ee);
129void ecore_evas_sticky_set(Ecore_Evas *ee, int sticky);
130int ecore_evas_sticky_get(Ecore_Evas *ee);
131
132#ifdef __cplusplus
133}
134#endif
135
136#endif
diff --git a/legacy/ecore/src/lib/ecore_evas/Makefile.am b/legacy/ecore/src/lib/ecore_evas/Makefile.am
index d7ee48bcbe..4ceabde2e0 100644
--- a/legacy/ecore/src/lib/ecore_evas/Makefile.am
+++ b/legacy/ecore/src/lib/ecore_evas/Makefile.am
@@ -29,7 +29,7 @@ $(ECORE_X_INC) \
29$(ECORE_FB_INC) \ 29$(ECORE_FB_INC) \
30@evas_cflags@ 30@evas_cflags@
31 31
32libecore_evas_la_LDFLAGS = -version-info 1:0:0 \ 32libecore_evas_la_LDFLAGS = $(LDFLAGS) -version-info 1:0:0 \
33$(ECORE_X_LDF) \ 33$(ECORE_X_LDF) \
34$(ECORE_FB_LDF) \ 34$(ECORE_FB_LDF) \
35-L$(top_builddir)/src/lib/ecore/.libs 35-L$(top_builddir)/src/lib/ecore/.libs
@@ -60,7 +60,6 @@ $(top_builddir)/src/lib/ecore/libecore.la
60endif 60endif
61 61
62EXTRA_DIST = \ 62EXTRA_DIST = \
63Ecore_Evas.h.in \
64ecore_evas.c \ 63ecore_evas.c \
65ecore_evas_x.c \ 64ecore_evas_x.c \
66ecore_evas_fb.c \ 65ecore_evas_fb.c \
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas.c b/legacy/ecore/src/lib/ecore_evas/ecore_evas.c
index ae9fb36fc9..b543bf91a5 100644
--- a/legacy/ecore/src/lib/ecore_evas/ecore_evas.c
+++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas.c
@@ -7,6 +7,47 @@
7static int _ecore_evas_init_count = 0; 7static int _ecore_evas_init_count = 0;
8 8
9/** 9/**
10 * Query if a particular renginering engine target has support
11 * @param engine The engine to check support for
12 * @return 1 if the particualr engine is supported, 0 if it is not
13 *
14 * Query if engine @param engine is supported by ecore_evas. 1 is returned if
15 * it is, and 0 is returned if it is not supported.
16 */
17int
18ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
19{
20 switch (engine)
21 {
22 case ECORE_EVAS_ENGINE_SOFTWARE_X11:
23#ifdef BUILD_ECORE_X
24 return 1;
25#else
26 return 0;
27#endif
28 break;
29 case ECORE_EVAS_ENGINE_SOFTWARE_FB:
30#ifdef BUILD_ECORE_EVAS_FB
31 return 1;
32#else
33 return 0;
34#endif
35 break;
36 case ECORE_EVAS_ENGINE_GL_X11:
37#ifdef BUILD_ECORE_EVAS_GL
38 return 1;
39#else
40 return 0;
41#endif
42 break;
43 default:
44 return 0;
45 break;
46 };
47 return 0;
48}
49
50/**
10 * Init the Evas system. 51 * Init the Evas system.
11 * @return greater than 0 on success, 0 on failure 52 * @return greater than 0 on success, 0 on failure
12 * 53 *
@@ -16,8 +57,7 @@ int
16ecore_evas_init(void) 57ecore_evas_init(void)
17{ 58{
18 if (_ecore_evas_init_count == 0) 59 if (_ecore_evas_init_count == 0)
19 evas_init (); 60 evas_init ();
20
21 return ++_ecore_evas_init_count; 61 return ++_ecore_evas_init_count;
22} 62}
23 63
@@ -39,8 +79,7 @@ ecore_evas_shutdown(void)
39#ifdef BUILD_ECORE_EVAS_FB 79#ifdef BUILD_ECORE_EVAS_FB
40 while (_ecore_evas_fb_shutdown()); 80 while (_ecore_evas_fb_shutdown());
41#endif 81#endif
42 82 evas_shutdown();
43 evas_shutdown();
44 } 83 }
45 if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0; 84 if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
46 return _ecore_evas_init_count; 85 return _ecore_evas_init_count;
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas_x.c b/legacy/ecore/src/lib/ecore_evas/ecore_evas_x.c
index 9697ef7160..d295f6c59d 100644
--- a/legacy/ecore/src/lib/ecore_evas/ecore_evas_x.c
+++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas_x.c
@@ -3,8 +3,11 @@
3#include "ecore_private.h" 3#include "ecore_private.h"
4#include "ecore_evas_private.h" 4#include "ecore_evas_private.h"
5#include "Ecore_Evas.h" 5#include "Ecore_Evas.h"
6#ifdef BUILD_ECORE_X
6#include "Ecore_X.h" 7#include "Ecore_X.h"
8#endif
7 9
10#ifdef BUILD_ECORE_X
8static int _ecore_evas_init_count = 0; 11static int _ecore_evas_init_count = 0;
9 12
10static int _ecore_evas_fps_debug = 0; 13static int _ecore_evas_fps_debug = 0;
@@ -1114,6 +1117,7 @@ static const Ecore_Evas_Engine_Func _ecore_x_engine_func =
1114 _ecore_evas_withdrawn_set, 1117 _ecore_evas_withdrawn_set,
1115 _ecore_evas_sticky_set 1118 _ecore_evas_sticky_set
1116}; 1119};
1120#endif
1117 1121
1118/** 1122/**
1119 * To be documented. 1123 * To be documented.
@@ -1124,6 +1128,7 @@ Ecore_Evas *
1124ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent, 1128ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent,
1125 int x, int y, int w, int h) 1129 int x, int y, int w, int h)
1126{ 1130{
1131#ifdef BUILD_ECORE_X
1127 Evas_Engine_Info_Software_X11 *einfo; 1132 Evas_Engine_Info_Software_X11 *einfo;
1128 Ecore_Evas *ee; 1133 Ecore_Evas *ee;
1129 int rmethod; 1134 int rmethod;
@@ -1187,6 +1192,9 @@ ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent,
1187 1192
1188 ecore_evases = _ecore_list_prepend(ecore_evases, ee); 1193 ecore_evases = _ecore_list_prepend(ecore_evases, ee);
1189 return ee; 1194 return ee;
1195#else
1196 return NULL;
1197#endif
1190} 1198}
1191 1199
1192/** 1200/**
@@ -1197,14 +1205,18 @@ ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent,
1197Ecore_X_Window 1205Ecore_X_Window
1198ecore_evas_software_x11_window_get(Ecore_Evas *ee) 1206ecore_evas_software_x11_window_get(Ecore_Evas *ee)
1199{ 1207{
1208#ifdef BUILD_ECORE_X
1200 return ee->engine.x.win_container; 1209 return ee->engine.x.win_container;
1210#else
1211 return 0;
1212#endif
1201} 1213}
1202 1214
1203#ifdef BUILD_ECORE_EVAS_GL
1204Ecore_Evas * 1215Ecore_Evas *
1205ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent, 1216ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent,
1206 int x, int y, int w, int h) 1217 int x, int y, int w, int h)
1207{ 1218{
1219#ifdef BUILD_ECORE_EVAS_GL
1208 Evas_Engine_Info_GL_X11 *einfo; 1220 Evas_Engine_Info_GL_X11 *einfo;
1209 Ecore_Evas *ee; 1221 Ecore_Evas *ee;
1210 int rmethod; 1222 int rmethod;
@@ -1292,6 +1304,9 @@ ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent,
1292 1304
1293 ecore_evases = _ecore_list_prepend(ecore_evases, ee); 1305 ecore_evases = _ecore_list_prepend(ecore_evases, ee);
1294 return ee; 1306 return ee;
1307#else
1308 return NULL;
1309#endif
1295} 1310}
1296 1311
1297/** 1312/**
@@ -1302,6 +1317,9 @@ ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent,
1302Ecore_X_Window 1317Ecore_X_Window
1303ecore_evas_gl_x11_window_get(Ecore_Evas *ee) 1318ecore_evas_gl_x11_window_get(Ecore_Evas *ee)
1304{ 1319{
1320#ifdef BUILD_ECORE_EVAS_GL
1305 return ee->engine.x.win_container; 1321 return ee->engine.x.win_container;
1306} 1322#else
1323 return 0;
1307#endif 1324#endif
1325}
diff --git a/legacy/ecore/src/lib/ecore_fb/Makefile.am b/legacy/ecore/src/lib/ecore_fb/Makefile.am
index f4f3d45103..456d00762d 100644
--- a/legacy/ecore/src/lib/ecore_fb/Makefile.am
+++ b/legacy/ecore/src/lib/ecore_fb/Makefile.am
@@ -4,7 +4,7 @@ INCLUDES = \
4-I$(top_srcdir)/src/lib/ecore \ 4-I$(top_srcdir)/src/lib/ecore \
5-I$(top_builddir)/src/lib/ecore 5-I$(top_builddir)/src/lib/ecore
6 6
7libecore_fb_la_LDFLAGS = -version-info 1:0:0 \ 7libecore_fb_la_LDFLAGS = $(LDFLAGS) -version-info 1:0:0 \
8-L$(top_builddir)/src/lib/ecore/.libs 8-L$(top_builddir)/src/lib/ecore/.libs
9 9
10if BUILD_ECORE_FB 10if BUILD_ECORE_FB
diff --git a/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h.in b/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h
index c322a90e3d..407c6a3575 100644
--- a/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h.in
+++ b/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h
@@ -6,12 +6,6 @@
6 * @brief Ecore inter-process communication functions. 6 * @brief Ecore inter-process communication functions.
7 */ 7 */
8 8
9#define HAVE_ECORE_IPC_OPENSSL @USE_OPENSSL@
10
11#if HAVE_ECORE_IPC_OPENSSL
12#include <openssl/ssl.h>
13#endif
14
15#ifdef __cplusplus 9#ifdef __cplusplus
16extern "C" { 10extern "C" {
17#endif 11#endif
@@ -25,10 +19,8 @@ extern "C" {
25 { 19 {
26 ECORE_IPC_LOCAL_USER, 20 ECORE_IPC_LOCAL_USER,
27 ECORE_IPC_LOCAL_SYSTEM, 21 ECORE_IPC_LOCAL_SYSTEM,
28 ECORE_IPC_REMOTE_SYSTEM 22 ECORE_IPC_REMOTE_SYSTEM,
29#if HAVE_ECORE_IPC_OPENSSL 23 ECORE_IPC_USE_SSL = 16
30 ,ECORE_IPC_USE_SSL = 16
31#endif
32 } Ecore_Ipc_Type; 24 } Ecore_Ipc_Type;
33 25
34 typedef struct _Ecore_Ipc_Event_Client_Add Ecore_Ipc_Event_Client_Add; 26 typedef struct _Ecore_Ipc_Event_Client_Add Ecore_Ipc_Event_Client_Add;
@@ -111,6 +103,8 @@ extern "C" {
111 void *ecore_ipc_client_del(Ecore_Ipc_Client *cl); 103 void *ecore_ipc_client_del(Ecore_Ipc_Client *cl);
112 void ecore_ipc_client_data_set(Ecore_Ipc_Client *cl, const void *data); 104 void ecore_ipc_client_data_set(Ecore_Ipc_Client *cl, const void *data);
113 void *ecore_ipc_client_data_get(Ecore_Ipc_Client *cl); 105 void *ecore_ipc_client_data_get(Ecore_Ipc_Client *cl);
106
107 int ecore_ipc_ssl_available_get(void);
114 108
115#ifdef __cplusplus 109#ifdef __cplusplus
116} 110}
diff --git a/legacy/ecore/src/lib/ecore_ipc/Makefile.am b/legacy/ecore/src/lib/ecore_ipc/Makefile.am
index a3e349c904..d3236115f6 100644
--- a/legacy/ecore/src/lib/ecore_ipc/Makefile.am
+++ b/legacy/ecore/src/lib/ecore_ipc/Makefile.am
@@ -1,15 +1,15 @@
1## Process this file with automake to produce Makefile.in 1## Process this file with automake to produce Makefile.in
2 2
3INCLUDES = \ 3INCLUDES = \
4-I$(top_srcdir)/src/lib/ecore \
5-I$(top_srcdir)/src/lib/ecore_con \
6-I$(top_srcdir)/src/lib/ecore_ipc \
7-I$(top_builddir)/src/lib/ecore \ 4-I$(top_builddir)/src/lib/ecore \
8-I$(top_builddir)/src/lib/ecore_con \ 5-I$(top_builddir)/src/lib/ecore_con \
9-I$(top_builddir)/src/lib/ecore_ipc \ 6-I$(top_builddir)/src/lib/ecore_ipc \
7-I$(top_srcdir)/src/lib/ecore \
8-I$(top_srcdir)/src/lib/ecore_con \
9-I$(top_srcdir)/src/lib/ecore_ipc \
10@SSL_CFLAGS@ 10@SSL_CFLAGS@
11 11
12libecore_ipc_la_LDFLAGS = -version-info 1:0:0 \ 12libecore_ipc_la_LDFLAGS = $(LDFLAGS) -version-info 1:0:0 \
13-L$(top_builddir)/src/lib/ecore/.libs \ 13-L$(top_builddir)/src/lib/ecore/.libs \
14-L$(top_builddir)/src/lib/ecore_con/.libs 14-L$(top_builddir)/src/lib/ecore_con/.libs
15 15
@@ -35,6 +35,5 @@ $(top_builddir)/src/lib/ecore_con/libecore_con.la
35endif 35endif
36 36
37EXTRA_DIST = \ 37EXTRA_DIST = \
38Ecore_Ipc.h.in \
39ecore_ipc.c \ 38ecore_ipc.c \
40ecore_ipc_private.h 39ecore_ipc_private.h
diff --git a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c
index 87859348d6..d027e35324 100644
--- a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c
+++ b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c
@@ -280,10 +280,8 @@ ecore_ipc_server_add(Ecore_Ipc_Type compl_type, char *name, int port, const void
280 svr = calloc(1, sizeof(Ecore_Ipc_Server)); 280 svr = calloc(1, sizeof(Ecore_Ipc_Server));
281 if (!svr) return NULL; 281 if (!svr) return NULL;
282 type = compl_type; 282 type = compl_type;
283#if USE_OPENSSL
284 type &= ~ECORE_IPC_USE_SSL; 283 type &= ~ECORE_IPC_USE_SSL;
285 if (compl_type & ECORE_IPC_USE_SSL) extra = ECORE_CON_USE_SSL; 284 if (compl_type & ECORE_IPC_USE_SSL) extra = ECORE_CON_USE_SSL;
286#endif
287 switch (type) 285 switch (type)
288 { 286 {
289 case ECORE_IPC_LOCAL_USER: 287 case ECORE_IPC_LOCAL_USER:
@@ -337,10 +335,8 @@ ecore_ipc_server_connect(Ecore_Ipc_Type compl_type, char *name, int port, const
337 svr = calloc(1, sizeof(Ecore_Ipc_Server)); 335 svr = calloc(1, sizeof(Ecore_Ipc_Server));
338 if (!svr) return NULL; 336 if (!svr) return NULL;
339 type = compl_type; 337 type = compl_type;
340#if USE_OPENSSL
341 type &= ~ECORE_IPC_USE_SSL; 338 type &= ~ECORE_IPC_USE_SSL;
342 if (compl_type & ECORE_IPC_USE_SSL) extra = ECORE_CON_USE_SSL; 339 if (compl_type & ECORE_IPC_USE_SSL) extra = ECORE_CON_USE_SSL;
343#endif
344 switch (type) 340 switch (type)
345 { 341 {
346 case ECORE_IPC_LOCAL_USER: 342 case ECORE_IPC_LOCAL_USER:
@@ -702,6 +698,16 @@ ecore_ipc_client_data_get(Ecore_Ipc_Client *cl)
702 return cl->data; 698 return cl->data;
703} 699}
704 700
701/**
702 * * Returns if SSL support is available
703 * * @return 1 if SSL is available, 0 if it is not.
704 * * @ingroup Ecore_Con_Client_Group
705 * */
706int
707ecore_ipc_ssl_available_get(void)
708{
709 return ecore_con_ssl_available_get();
710}
705 711
706 712
707static int 713static int
diff --git a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h
index 2e7e58c4ad..b46ee52eb8 100644
--- a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h
+++ b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h
@@ -1,6 +1,10 @@
1#ifndef _ECORE_IPC_PRIVATE_H 1#ifndef _ECORE_IPC_PRIVATE_H
2#define _ECORE_IPC_PRIVATE_H 2#define _ECORE_IPC_PRIVATE_H
3 3
4#if USE_OPENSSL
5#include <openssl/ssl.h>
6#endif
7
4#define ECORE_MAGIC_IPC_SERVER 0x87786556 8#define ECORE_MAGIC_IPC_SERVER 0x87786556
5#define ECORE_MAGIC_IPC_CLIENT 0x78875665 9#define ECORE_MAGIC_IPC_CLIENT 0x78875665
6 10
diff --git a/legacy/ecore/src/lib/ecore_job/Makefile.am b/legacy/ecore/src/lib/ecore_job/Makefile.am
index 233608a462..d48982f027 100644
--- a/legacy/ecore/src/lib/ecore_job/Makefile.am
+++ b/legacy/ecore/src/lib/ecore_job/Makefile.am
@@ -4,7 +4,7 @@ INCLUDES = \
4-I$(top_srcdir)/src/lib/ecore \ 4-I$(top_srcdir)/src/lib/ecore \
5-I$(top_builddir)/src/lib/ecore 5-I$(top_builddir)/src/lib/ecore
6 6
7libecore_job_la_LDFLAGS = -version-info 1:0:0 \ 7libecore_job_la_LDFLAGS = $(LDFLAGS) -version-info 1:0:0 \
8-L$(top_builddir)/src/lib/ecore/.libs 8-L$(top_builddir)/src/lib/ecore/.libs
9 9
10if BUILD_ECORE_JOB 10if BUILD_ECORE_JOB
diff --git a/legacy/ecore/src/lib/ecore_txt/Makefile.am b/legacy/ecore/src/lib/ecore_txt/Makefile.am
index 278e053be2..469c257a8c 100644
--- a/legacy/ecore/src/lib/ecore_txt/Makefile.am
+++ b/legacy/ecore/src/lib/ecore_txt/Makefile.am
@@ -5,7 +5,7 @@ INCLUDES = \
5-I$(top_builddir)/src/lib/ecore \ 5-I$(top_builddir)/src/lib/ecore \
6@iconv_cflags@ 6@iconv_cflags@
7 7
8libecore_txt_la_LDFLAGS = -version-info 1:0:0 \ 8libecore_txt_la_LDFLAGS = $(LDFLAGS) -version-info 1:0:0 \
9-L$(top_builddir)/src/lib/ecore/.libs 9-L$(top_builddir)/src/lib/ecore/.libs
10 10
11if BUILD_ECORE_TXT 11if BUILD_ECORE_TXT
diff --git a/legacy/ecore/src/lib/ecore_x/Ecore_X.h b/legacy/ecore/src/lib/ecore_x/Ecore_X.h
index 50b5fbd21e..81aac932c7 100644
--- a/legacy/ecore/src/lib/ecore_x/Ecore_X.h
+++ b/legacy/ecore/src/lib/ecore_x/Ecore_X.h
@@ -867,12 +867,25 @@ void ecore_x_gc_del(Ecore_X_GC gc);
867int ecore_x_client_message32_send(Ecore_X_Window win, Ecore_X_Atom type, long d0, long d1, long d2, long d3, long d4); 867int ecore_x_client_message32_send(Ecore_X_Window win, Ecore_X_Atom type, long d0, long d1, long d2, long d3, long d4);
868int ecore_x_client_message8_send(Ecore_X_Window win, Ecore_X_Atom type, const void *data, int len); 868int ecore_x_client_message8_send(Ecore_X_Window win, Ecore_X_Atom type, const void *data, int len);
869 869
870void ecore_x_icccm_window_state_set_iconic(Ecore_X_Window win); 870 void
871void ecore_x_icccm_window_state_set_normal(Ecore_X_Window win); 871 ecore_x_icccm_state_set(Ecore_X_Window win, Ecore_X_Window_State_Hint state);
872void ecore_x_icccm_window_state_set_withdrawn(Ecore_X_Window win); 872 void
873void ecore_x_icccm_send_delete_window(Ecore_X_Window win); 873 ecore_x_icccm_delete_window_send(Ecore_X_Window win);
874void ecore_x_icccm_send_take_focus(Ecore_X_Window win); 874 void
875 875 ecore_x_icccm_take_focus_send(Ecore_X_Window win);
876 void
877 ecore_x_icccm_save_yourself_send(Ecore_X_Window win);
878 void
879 ecore_x_icccm_move_resize_send(Ecore_X_Window win,
880 int x, int y, int w, int h);
881 int
882 ecore_x_icccm_basic_hints_get(Ecore_X_Window win,
883 int *accepts_focus,
884 Ecore_X_Window_State_Hint *initial_state,
885 Ecore_X_Pixmap *icon_pixmap,
886 Ecore_X_Pixmap *icon_mask,
887 Ecore_X_Window *icon_window,
888 Ecore_X_Window *window_group);
876 889
877 890
878 /* FIXME: these funcs need categorising */ 891 /* FIXME: these funcs need categorising */
@@ -922,16 +935,6 @@ void ecore_x_icccm_send_take_focus(Ecore_X_Window win);
922 ecore_x_window_save_set_del(Ecore_X_Window win); 935 ecore_x_window_save_set_del(Ecore_X_Window win);
923 Ecore_X_Window * 936 Ecore_X_Window *
924 ecore_x_window_children_get(Ecore_X_Window win, int *num); 937 ecore_x_window_children_get(Ecore_X_Window win, int *num);
925 void
926 ecore_x_window_synthetic_move_resize_send(Ecore_X_Window win, int x, int y, int w, int h);
927 void
928 ecore_x_window_basic_hints_get(Ecore_X_Window win,
929 int *accepts_focus,
930 Ecore_X_Window_State_Hint *initial_state,
931 Ecore_X_Pixmap *icon_pixmap,
932 Ecore_X_Pixmap *icon_mask,
933 Ecore_X_Window *icon_window,
934 Ecore_X_Window *window_group);
935 938
936 Ecore_X_Cursor 939 Ecore_X_Cursor
937 ecore_x_cursor_new(Ecore_X_Window win, int *pixels, int w, int h, int hot_x, int hot_y); 940 ecore_x_cursor_new(Ecore_X_Window win, int *pixels, int w, int h, int hot_x, int hot_y);
diff --git a/legacy/ecore/src/lib/ecore_x/Makefile.am b/legacy/ecore/src/lib/ecore_x/Makefile.am
index 821a798273..9e6628a394 100644
--- a/legacy/ecore/src/lib/ecore_x/Makefile.am
+++ b/legacy/ecore/src/lib/ecore_x/Makefile.am
@@ -9,7 +9,7 @@ INCLUDES = \
9-I$(top_builddir)/src/lib/ecore_job \ 9-I$(top_builddir)/src/lib/ecore_job \
10@x_cflags@ 10@x_cflags@
11 11
12libecore_x_la_LDFLAGS = -version-info 1:0:0 \ 12libecore_x_la_LDFLAGS = $(LDFLAGS) -version-info 1:0:0 \
13-L$(top_builddir)/src/lib/ecore/.libs \ 13-L$(top_builddir)/src/lib/ecore/.libs \
14-L$(top_builddir)/src/lib/ecore_txt/.libs \ 14-L$(top_builddir)/src/lib/ecore_txt/.libs \
15-L$(top_builddir)/src/lib/ecore_job/.libs 15-L$(top_builddir)/src/lib/ecore_job/.libs
diff --git a/legacy/ecore/src/lib/ecore_x/ecore_x.c b/legacy/ecore/src/lib/ecore_x/ecore_x.c
index f3dbe6705d..ed9a6d4039 100644
--- a/legacy/ecore/src/lib/ecore_x/ecore_x.c
+++ b/legacy/ecore/src/lib/ecore_x/ecore_x.c
@@ -1060,75 +1060,6 @@ ecore_x_window_children_get(Ecore_X_Window win, int *num)
1060 return windows; 1060 return windows;
1061} 1061}
1062 1062
1063void
1064ecore_x_window_synthetic_move_resize_send(Ecore_X_Window win, int x, int y, int w, int h)
1065{
1066 XEvent ev;
1067
1068 ev.type = ConfigureNotify;
1069 ev.xconfigure.display = _ecore_x_disp;
1070 ev.xconfigure.event = win;
1071 ev.xconfigure.window = win;
1072 ev.xconfigure.x = x;
1073 ev.xconfigure.y = y;
1074 ev.xconfigure.width = w;
1075 ev.xconfigure.height = h;
1076 ev.xconfigure.border_width = 0;
1077 ev.xconfigure.above = win;
1078 ev.xconfigure.override_redirect = False;
1079 XSendEvent(_ecore_x_disp, win, False, StructureNotifyMask, &ev);
1080}
1081
1082void
1083ecore_x_window_basic_hints_get(Ecore_X_Window win,
1084 int *accepts_focus,
1085 Ecore_X_Window_State_Hint *initial_state,
1086 Ecore_X_Pixmap *icon_pixmap,
1087 Ecore_X_Pixmap *icon_mask,
1088 Ecore_X_Window *icon_window,
1089 Ecore_X_Window *window_group)
1090{
1091 XWMHints *hints;
1092
1093 hints = XGetWMHints(_ecore_x_disp, win);
1094 if (hints)
1095 {
1096 if ((hints->flags & InputHint) && (accepts_focus))
1097 {
1098 if (hints->input)
1099 *accepts_focus = 1;
1100 else
1101 *accepts_focus = 0;
1102 }
1103 if ((hints->flags & StateHint) && (initial_state))
1104 {
1105 if (hints->initial_state == WithdrawnState)
1106 *initial_state = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN;
1107 else if (hints->initial_state == NormalState)
1108 *initial_state = ECORE_X_WINDOW_STATE_HINT_NORMAL;
1109 else if (hints->initial_state == IconicState)
1110 *initial_state = ECORE_X_WINDOW_STATE_HINT_ICONIC;
1111 }
1112 if ((hints->flags & IconPixmapHint) && (icon_pixmap))
1113 {
1114 *icon_pixmap = hints->icon_pixmap;
1115 }
1116 if ((hints->flags & IconMaskHint) && (icon_mask))
1117 {
1118 *icon_mask = hints->icon_pixmap;
1119 }
1120 if ((hints->flags & IconWindowHint) && (icon_window))
1121 {
1122 *icon_window = hints->icon_window;
1123 }
1124 if ((hints->flags & WindowGroupHint) && (window_group))
1125 {
1126 *window_group = hints->window_group;
1127 }
1128 XFree(hints);
1129 }
1130}
1131
1132 1063
1133 1064
1134 1065
diff --git a/legacy/ecore/src/lib/ecore_x/ecore_x_icccm.c b/legacy/ecore/src/lib/ecore_x/ecore_x_icccm.c
index 0061f73016..3ea70d2ea3 100644
--- a/legacy/ecore/src/lib/ecore_x/ecore_x_icccm.c
+++ b/legacy/ecore/src/lib/ecore_x/ecore_x_icccm.c
@@ -6,12 +6,17 @@
6#include "ecore_x_private.h" 6#include "ecore_x_private.h"
7#include "Ecore_X.h" 7#include "Ecore_X.h"
8 8
9static void 9void
10_ecore_x_icccm_window_state_set(Ecore_X_Window win, unsigned int state) 10ecore_x_icccm_state_set(Ecore_X_Window win, Ecore_X_Window_State_Hint state)
11{ 11{
12 unsigned long c[2]; 12 unsigned long c[2];
13 13
14 c[0] = state; 14 if (state == ECORE_X_WINDOW_STATE_HINT_WITHDRAWN)
15 c[0] = WithdrawnState;
16 else if (state == ECORE_X_WINDOW_STATE_HINT_NORMAL)
17 c[0] = NormalState;
18 else if (state == ECORE_X_WINDOW_STATE_HINT_ICONIC)
19 c[0] = IconicState;
15 c[1] = 0; 20 c[1] = 0;
16 XChangeProperty(_ecore_x_disp, win, _ecore_x_atom_wm_state, 21 XChangeProperty(_ecore_x_disp, win, _ecore_x_atom_wm_state,
17 _ecore_x_atom_wm_state, 32, PropModeReplace, 22 _ecore_x_atom_wm_state, 32, PropModeReplace,
@@ -19,50 +24,187 @@ _ecore_x_icccm_window_state_set(Ecore_X_Window win, unsigned int state)
19} 24}
20 25
21void 26void
22ecore_x_icccm_window_state_set_iconic(Ecore_X_Window win) 27ecore_x_icccm_delete_window_send(Ecore_X_Window win)
23{ 28{
24 _ecore_x_icccm_window_state_set(win, IconicState); 29 ecore_x_client_message32_send(win, _ecore_x_atom_wm_protocols,
30 _ecore_x_atom_wm_delete_window,
31 CurrentTime, 0, 0, 0);
25} 32}
26 33
27void 34void
28ecore_x_icccm_window_state_set_normal(Ecore_X_Window win) 35ecore_x_icccm_take_focus_send(Ecore_X_Window win)
29{ 36{
30 _ecore_x_icccm_window_state_set(win, NormalState); 37 ecore_x_client_message32_send(win, _ecore_x_atom_wm_protocols,
38 _ecore_x_atom_wm_take_focus,
39 CurrentTime, 0, 0, 0);
31} 40}
32 41
42#if 0
33void 43void
34ecore_x_icccm_window_state_set_withdrawn(Ecore_X_Window win) 44ecore_x_icccm_save_yourself_send(Ecore_X_Window win)
35{ 45{
36 _ecore_x_icccm_window_state_set(win, WithdrawnState); 46 ecore_x_client_message32_send(win, _ecore_x_atom_wm_protocols,
37} 47 _ecore_x_atom_wm_save_yourself,
38 48 CurrentTime, 0, 0, 0);
39static void
40_ecore_x_icccm_client_message_send(Ecore_X_Window win,
41 Ecore_X_Atom atom, Ecore_X_Time ts)
42{
43 ecore_x_client_message32_send(win, _ecore_x_atom_wm_protocols, atom, ts,
44 0, 0, 0);
45} 49}
50#endif
46 51
47void 52void
48ecore_x_icccm_send_delete_window(Ecore_X_Window win) 53ecore_x_icccm_move_resize_send(Ecore_X_Window win,
54 int x, int y, int w, int h)
49{ 55{
50 _ecore_x_icccm_client_message_send(win, _ecore_x_atom_wm_delete_window, 56 XEvent ev;
51 CurrentTime); 57
52} 58 ev.type = ConfigureNotify;
59 ev.xconfigure.display = _ecore_x_disp;
60 ev.xconfigure.event = win;
61 ev.xconfigure.window = win;
62 ev.xconfigure.x = x;
63 ev.xconfigure.y = y;
64 ev.xconfigure.width = w;
65 ev.xconfigure.height = h;
66 ev.xconfigure.border_width = 0;
67 ev.xconfigure.above = win;
68 ev.xconfigure.override_redirect = False;
69 XSendEvent(_ecore_x_disp, win, False, StructureNotifyMask, &ev);
70}
53 71
54void 72int
55ecore_x_icccm_send_take_focus(Ecore_X_Window win) 73ecore_x_icccm_basic_hints_get(Ecore_X_Window win,
74 int *accepts_focus,
75 Ecore_X_Window_State_Hint *initial_state,
76 Ecore_X_Pixmap *icon_pixmap,
77 Ecore_X_Pixmap *icon_mask,
78 Ecore_X_Window *icon_window,
79 Ecore_X_Window *window_group)
56{ 80{
57 _ecore_x_icccm_client_message_send(win, _ecore_x_atom_wm_take_focus, 81 XWMHints *hints;
58 CurrentTime); 82
83 hints = XGetWMHints(_ecore_x_disp, win);
84 if (hints)
85 {
86 if ((hints->flags & InputHint) && (accepts_focus))
87 {
88 if (hints->input)
89 *accepts_focus = 1;
90 else
91 *accepts_focus = 0;
92 }
93 if ((hints->flags & StateHint) && (initial_state))
94 {
95 if (hints->initial_state == WithdrawnState)
96 *initial_state = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN;
97 else if (hints->initial_state == NormalState)
98 *initial_state = ECORE_X_WINDOW_STATE_HINT_NORMAL;
99 else if (hints->initial_state == IconicState)
100 *initial_state = ECORE_X_WINDOW_STATE_HINT_ICONIC;
101 }
102 if ((hints->flags & IconPixmapHint) && (icon_pixmap))
103 {
104 *icon_pixmap = hints->icon_pixmap;
105 }
106 if ((hints->flags & IconMaskHint) && (icon_mask))
107 {
108 *icon_mask = hints->icon_pixmap;
109 }
110 if ((hints->flags & IconWindowHint) && (icon_window))
111 {
112 *icon_window = hints->icon_window;
113 }
114 if ((hints->flags & WindowGroupHint) && (window_group))
115 {
116 *window_group = hints->window_group;
117 }
118 XFree(hints);
119 return 1;
120 }
121 return 0;
59} 122}
60 123
61#if 0 124/* FIXME: working here */
62void 125int
63ecore_x_icccm_send_save_yourself(Ecore_X_Window win) 126ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win)
64{ 127{
65 _ecore_x_icccm_client_message_send(win, _ecore_x_atom_wm_save_yourself, 128 XSizeHints hint;
66 CurrentTime); 129 long mask;
130
131 if (!XGetWMNormalHints(_ecore_x_disp, win, &hint, &mask)) return 0;
132 if ((hint.flags & USPosition) || ((hint.flags & PPosition)))
133 {
134 int x, y, w, h;
135
136// D("%li %li\n", hint.flags & USPosition, hint.flags & PPosition);
137// b->client.pos.requested = 1;
138// b->client.pos.gravity = NorthWestGravity;
139// if (hint.flags & PWinGravity)
140// b->client.pos.gravity = hint.win_gravity;
141// x = y = w = h = 0;
142// ecore_window_get_geometry(win, &x, &y, &w, &h);
143// b->client.pos.x = x;
144// b->client.pos.y = y;
145 }
146 else
147 {
148// b->client.pos.requested = 0;
149 }
150 if (hint.flags & PMinSize)
151 {
152// min_w = hint.min_width;
153// min_h = hint.min_height;
154 }
155 if (hint.flags & PMaxSize)
156 {
157// max_w = hint.max_width;
158// max_h = hint.max_height;
159// if (max_w < min_w)
160// max_w = min_w;
161// if (max_h < min_h)
162// max_h = min_h;
163 }
164 if (hint.flags & PResizeInc)
165 {
166// step_w = hint.width_inc;
167// step_h = hint.height_inc;
168// if (step_w < 1)
169// step_w = 1;
170// if (step_h < 1)
171// step_h = 1;
172 }
173 if (hint.flags & PBaseSize)
174 {
175// base_w = hint.base_width;
176// base_h = hint.base_height;
177// if (base_w > max_w)
178// max_w = base_w;
179// if (base_h > max_h)
180// max_h = base_h;
181 }
182 else
183 {
184// base_w = min_w;
185// base_h = min_h;
186 }
187 if (hint.flags & PAspect)
188 {
189// if (hint.min_aspect.y > 0)
190// aspect_min =
191// ((double)hint.min_aspect.x) / ((double)hint.min_aspect.y);
192// if (hint.max_aspect.y > 0)
193// aspect_max =
194// ((double)hint.max_aspect.x) / ((double)hint.max_aspect.y);
195 }
196
197 return 1;
67} 198}
68#endif 199
200/* FIXME: move these things in here as they are icccm related */
201/* get/set title */
202/* get/set name/class */
203/* get/set machine */
204/* get/set command */
205/* get/set icon name */
206
207/* FIXME: there are older E hints, gnome hitns and mwm hints and new netwm */
208/* hints. each should go in their own file/section so we know which */
209/* is which. also older kde hints too. we shoudl try support as much */
210/* as makese sense to support */