summaryrefslogtreecommitdiff
path: root/legacy/evas
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-09-24 03:58:47 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-09-24 03:58:47 +0000
commite52e76fbb358823b37557d07557f0bebce1b69df (patch)
treee3316938e10d7bf959abef7e9c5b831acbd40abe /legacy/evas
parentcde875d4381f75433eeb41bf8ca83d868cfe850a (diff)
remove commented out xrdb code in evas engines.
SVN revision: 77029
Diffstat (limited to 'legacy/evas')
-rw-r--r--legacy/evas/src/modules/engines/gl_x11/evas_engine.c120
-rw-r--r--legacy/evas/src/modules/engines/software_16_x11/evas_engine.c120
-rw-r--r--legacy/evas/src/modules/engines/software_x11/evas_engine.c145
3 files changed, 2 insertions, 383 deletions
diff --git a/legacy/evas/src/modules/engines/gl_x11/evas_engine.c b/legacy/evas/src/modules/engines/gl_x11/evas_engine.c
index 829a29e03e..633ba43579 100644
--- a/legacy/evas/src/modules/engines/gl_x11/evas_engine.c
+++ b/legacy/evas/src/modules/engines/gl_x11/evas_engine.c
@@ -23,12 +23,6 @@ struct _Render_Engine
23 Evas *evas; 23 Evas *evas;
24 Tilebuf *tb; 24 Tilebuf *tb;
25 int end; 25 int end;
26/*
27 XrmDatabase xrdb; // xres - dpi
28 struct { // xres - dpi
29 int dpi; // xres - dpi
30 } xr; // xres - dpi
31 */
32 int w, h; 26 int w, h;
33 int vsync; 27 int vsync;
34 28
@@ -688,52 +682,6 @@ static Evas_Func func, pfunc;
688 682
689/* Function table for GL APIs */ 683/* Function table for GL APIs */
690static Evas_GL_API gl_funcs; 684static Evas_GL_API gl_funcs;
691/*
692struct xrdb_user
693{
694 time_t last_stat;
695 time_t last_mtime;
696 XrmDatabase db;
697};
698static struct xrdb_user xrdb_user = {0, 0, NULL};
699
700static Eina_Bool
701xrdb_user_query(const char *name, const char *cls, char **type, XrmValue *val)
702{
703 time_t last = xrdb_user.last_stat, now = time(NULL);
704
705 xrdb_user.last_stat = now;
706 if (last != now) // don't stat() more than once every second
707 {
708 struct stat st;
709 const char *home = getenv("HOME");
710 char tmp[PATH_MAX];
711
712 if (!home) goto failed;
713 snprintf(tmp, sizeof(tmp), "%s/.Xdefaults", home);
714 if (stat(tmp, &st) != 0) goto failed;
715 if (xrdb_user.last_mtime != st.st_mtime)
716 {
717 if (xrdb_user.db) XrmDestroyDatabase(xrdb_user.db);
718 xrdb_user.db = XrmGetFileDatabase(tmp);
719 if (!xrdb_user.db) goto failed;
720 xrdb_user.last_mtime = st.st_mtime;
721 }
722 }
723
724 if (!xrdb_user.db) return EINA_FALSE;
725 return XrmGetResource(xrdb_user.db, name, cls, type, val);
726
727 failed:
728 if (xrdb_user.db)
729 {
730 XrmDestroyDatabase(xrdb_user.db);
731 xrdb_user.db = NULL;
732 }
733 xrdb_user.last_mtime = 0;
734 return EINA_FALSE;
735}
736*/
737 685
738static void * 686static void *
739eng_info(Evas *e) 687eng_info(Evas *e)
@@ -1006,61 +954,7 @@ eng_setup(Evas *e, void *in)
1006 } 954 }
1007 e->engine.data.output = re; 955 e->engine.data.output = re;
1008 gl_wins++; 956 gl_wins++;
1009/* 957
1010 {
1011 int status;
1012 char *type = NULL;
1013 XrmValue val;
1014
1015 re->xr.dpi = 75000; // dpy * 1000
1016
1017 status = xrdb_user_query("Xft.dpi", "Xft.Dpi", &type, &val);
1018 if ((!status) || (!type))
1019 {
1020 if (!re->xrdb) re->xrdb = XrmGetDatabase(re->info->info.display);
1021 if (re->xrdb)
1022 status = XrmGetResource(re->xrdb,
1023 "Xft.dpi", "Xft.Dpi", &type, &val);
1024 }
1025
1026 if ((status) && (type))
1027 {
1028 if (!strcmp(type, "String"))
1029 {
1030 const char *str, *dp;
1031
1032 str = val.addr;
1033 dp = strchr(str, '.');
1034 if (!dp) dp = strchr(str, ',');
1035
1036 if (dp)
1037 {
1038 int subdpi, len, i;
1039 char *buf;
1040
1041 buf = alloca(dp - str + 1);
1042 strncpy(buf, str, dp - str);
1043 buf[dp - str] = 0;
1044 len = strlen(dp + 1);
1045 subdpi = atoi(dp + 1);
1046
1047 if (len < 3)
1048 {
1049 for (i = len; i < 3; i++) subdpi *= 10;
1050 }
1051 else if (len > 3)
1052 {
1053 for (i = len; i > 3; i--) subdpi /= 10;
1054 }
1055 re->xr.dpi = atoi(buf) * 1000;
1056 }
1057 else
1058 re->xr.dpi = atoi(str) * 1000;
1059 evas_common_font_dpi_set(re->xr.dpi / 1000);
1060 }
1061 }
1062 }
1063 */
1064 if (!initted) 958 if (!initted)
1065 { 959 {
1066 evas_common_cpu_init(); 960 evas_common_cpu_init();
@@ -1192,9 +1086,6 @@ eng_output_free(void *data)
1192 1086
1193 if (re) 1087 if (re)
1194 { 1088 {
1195// NOTE: XrmGetDatabase() result is shared per connection, do not free it.
1196// if (re->xrdb) XrmDestroyDatabase(re->xrdb);
1197
1198#if 0 1089#if 0
1199#ifdef GL_GLES 1090#ifdef GL_GLES
1200 // Destroy the resource surface 1091 // Destroy the resource surface
@@ -4988,15 +4879,6 @@ static void
4988module_close(Evas_Module *em __UNUSED__) 4879module_close(Evas_Module *em __UNUSED__)
4989{ 4880{
4990 eina_log_domain_unregister(_evas_engine_GL_X11_log_dom); 4881 eina_log_domain_unregister(_evas_engine_GL_X11_log_dom);
4991/*
4992 if (xrdb_user.db)
4993 {
4994 XrmDestroyDatabase(xrdb_user.db);
4995 xrdb_user.last_stat = 0;
4996 xrdb_user.last_mtime = 0;
4997 xrdb_user.db = NULL;
4998 }
4999 */
5000 evas_gl_common_module_close(); 4882 evas_gl_common_module_close();
5001} 4883}
5002 4884
diff --git a/legacy/evas/src/modules/engines/software_16_x11/evas_engine.c b/legacy/evas/src/modules/engines/software_16_x11/evas_engine.c
index 5378972fe0..a52fec7099 100644
--- a/legacy/evas/src/modules/engines/software_16_x11/evas_engine.c
+++ b/legacy/evas/src/modules/engines/software_16_x11/evas_engine.c
@@ -7,52 +7,6 @@
7int _evas_engine_soft16_x11_log_dom = -1; 7int _evas_engine_soft16_x11_log_dom = -1;
8/* function tables - filled in later (func and parent func) */ 8/* function tables - filled in later (func and parent func) */
9static Evas_Func func, pfunc; 9static Evas_Func func, pfunc;
10/*
11struct xrdb_user
12{
13 time_t last_stat;
14 time_t last_mtime;
15 XrmDatabase db;
16};
17static struct xrdb_user xrdb_user = {0, 0, NULL};
18
19static Eina_Bool
20xrdb_user_query(const char *name, const char *cls, char **type, XrmValue *val)
21{
22 time_t last = xrdb_user.last_stat, now = time(NULL);
23
24 xrdb_user.last_stat = now;
25 if (last != now) // don't stat() more than once every second
26 {
27 struct stat st;
28 const char *home = getenv("HOME");
29 char tmp[PATH_MAX];
30
31 if (!home) goto failed;
32 snprintf(tmp, sizeof(tmp), "%s/.Xdefaults", home);
33 if (stat(tmp, &st) != 0) goto failed;
34 if (xrdb_user.last_mtime != st.st_mtime)
35 {
36 if (xrdb_user.db) XrmDestroyDatabase(xrdb_user.db);
37 xrdb_user.db = XrmGetFileDatabase(tmp);
38 if (!xrdb_user.db) goto failed;
39 xrdb_user.last_mtime = st.st_mtime;
40 }
41 }
42
43 if (!xrdb_user.db) return EINA_FALSE;
44 return XrmGetResource(xrdb_user.db, name, cls, type, val);
45
46 failed:
47 if (xrdb_user.db)
48 {
49 XrmDestroyDatabase(xrdb_user.db);
50 xrdb_user.db = NULL;
51 }
52 xrdb_user.last_mtime = 0;
53 return EINA_FALSE;
54}
55*/
56 10
57/* engine struct data */ 11/* engine struct data */
58typedef struct _Render_Engine Render_Engine; 12typedef struct _Render_Engine Render_Engine;
@@ -66,12 +20,6 @@ struct _Render_Engine
66 Tilebuf *tb; 20 Tilebuf *tb;
67 Tilebuf_Rect *rects; 21 Tilebuf_Rect *rects;
68 Tilebuf_Rect *cur_rect; 22 Tilebuf_Rect *cur_rect;
69/*
70 XrmDatabase xrdb; // xres - dpi
71 struct { // xres - dpi
72 int dpi; // xres - dpi
73 } xr; // xres - dpi
74 */
75 X_Output_Buffer *shbuf; 23 X_Output_Buffer *shbuf;
76 Soft16_Image *tmp_out; /* used by indirect render, like rotation */ 24 Soft16_Image *tmp_out; /* used by indirect render, like rotation */
77 Region clip_rects; 25 Region clip_rects;
@@ -228,62 +176,6 @@ eng_setup(Evas *e, void *in)
228 } 176 }
229 if (!e->engine.data.output) return 0; 177 if (!e->engine.data.output) return 0;
230 178
231/*
232 {
233 int status;
234 char *type = NULL;
235 XrmValue val;
236
237 re->xr.dpi = 75000; // dpy * 1000
238
239 status = xrdb_user_query("Xft.dpi", "Xft.Dpi", &type, &val);
240 if ((!status) || (!type))
241 {
242 if (!re->xrdb) re->xrdb = XrmGetDatabase(re->disp);
243 if (re->xrdb)
244 status = XrmGetResource(re->xrdb,
245 "Xft.dpi", "Xft.Dpi", &type, &val);
246 }
247
248 if ((status) && (type))
249 {
250 if (!strcmp(type, "String"))
251 {
252 const char *str, *dp;
253
254 str = val.addr;
255 dp = strchr(str, '.');
256 if (!dp) dp = strchr(str, ',');
257
258 if (dp)
259 {
260 int subdpi, len, i;
261 char *buf;
262
263 buf = alloca(dp - str + 1);
264 strncpy(buf, str, dp - str);
265 buf[dp - str] = 0;
266 len = strlen(dp + 1);
267 subdpi = atoi(dp + 1);
268
269 if (len < 3)
270 {
271 for (i = len; i < 3; i++) subdpi *= 10;
272 }
273 else if (len > 3)
274 {
275 for (i = len; i > 3; i--) subdpi /= 10;
276 }
277 re->xr.dpi = atoi(buf) * 1000;
278 }
279 else
280 re->xr.dpi = atoi(str) * 1000;
281 }
282 }
283 evas_common_font_dpi_set(re->xr.dpi / 1000);
284 }
285 */
286
287 /* add a draw context if we dont have one */ 179 /* add a draw context if we dont have one */
288 if (!e->engine.data.context) 180 if (!e->engine.data.context)
289 e->engine.data.context = 181 e->engine.data.context =
@@ -301,9 +193,6 @@ eng_output_free(void *data)
301 193
302 re = (Render_Engine *)data; 194 re = (Render_Engine *)data;
303 195
304// NOTE: XrmGetDatabase() result is shared per connection, do not free it.
305// if (re->xrdb) XrmDestroyDatabase(re->xrdb);
306
307 if (re->shbuf) evas_software_16_x11_x_output_buffer_free(re->shbuf, 0); 196 if (re->shbuf) evas_software_16_x11_x_output_buffer_free(re->shbuf, 0);
308 if (re->clip_rects) XDestroyRegion(re->clip_rects); 197 if (re->clip_rects) XDestroyRegion(re->clip_rects);
309 if (re->gc) XFreeGC(re->disp, re->gc); 198 if (re->gc) XFreeGC(re->disp, re->gc);
@@ -711,15 +600,6 @@ static void
711module_close(Evas_Module *em __UNUSED__) 600module_close(Evas_Module *em __UNUSED__)
712{ 601{
713 eina_log_domain_unregister(_evas_engine_soft16_x11_log_dom); 602 eina_log_domain_unregister(_evas_engine_soft16_x11_log_dom);
714/*
715 if (xrdb_user.db)
716 {
717 XrmDestroyDatabase(xrdb_user.db);
718 xrdb_user.last_stat = 0;
719 xrdb_user.last_mtime = 0;
720 xrdb_user.db = NULL;
721 }
722 */
723} 603}
724 604
725static Evas_Module_Api evas_modapi = 605static Evas_Module_Api evas_modapi =
diff --git a/legacy/evas/src/modules/engines/software_x11/evas_engine.c b/legacy/evas/src/modules/engines/software_x11/evas_engine.c
index 94e78ac004..d9d1bf6b8a 100644
--- a/legacy/evas/src/modules/engines/software_x11/evas_engine.c
+++ b/legacy/evas/src/modules/engines/software_x11/evas_engine.c
@@ -20,60 +20,6 @@ int _evas_engine_soft_x11_log_dom = -1;
20/* function tables - filled in later (func and parent func) */ 20/* function tables - filled in later (func and parent func) */
21static Evas_Func func, pfunc; 21static Evas_Func func, pfunc;
22 22
23#ifdef BUILD_ENGINE_SOFTWARE_XLIB
24/*
25struct xrdb_user
26{
27 time_t last_stat;
28 time_t last_mtime;
29 XrmDatabase db;
30};
31static struct xrdb_user xrdb_user = {0, 0, NULL};
32
33static Eina_Bool
34xrdb_user_query(const char *name, const char *cls, char **type, XrmValue *val)
35{
36 time_t last, now;
37
38 last = xrdb_user.last_stat;
39 now = time(NULL);
40
41 xrdb_user.last_stat = now;
42 if (last != now) // don't stat() more than once every second
43 {
44 struct stat st;
45 const char *home;
46 char tmp[PATH_MAX];
47
48 if (!(home = getenv("HOME")))
49 goto failed;
50
51 snprintf(tmp, sizeof(tmp), "%s/.Xdefaults", home);
52 if (stat(tmp, &st) != 0) goto failed;
53 if (xrdb_user.last_mtime != st.st_mtime)
54 {
55 if (xrdb_user.db) XrmDestroyDatabase(xrdb_user.db);
56 xrdb_user.db = XrmGetFileDatabase(tmp);
57 if (!xrdb_user.db) goto failed;
58 xrdb_user.last_mtime = st.st_mtime;
59 }
60 }
61
62 if (!xrdb_user.db) return EINA_FALSE;
63 return XrmGetResource(xrdb_user.db, name, cls, type, val);
64
65 failed:
66 if (xrdb_user.db)
67 {
68 XrmDestroyDatabase(xrdb_user.db);
69 xrdb_user.db = NULL;
70 }
71 xrdb_user.last_mtime = 0;
72 return EINA_FALSE;
73}
74*/
75#endif
76
77/* engine struct data */ 23/* engine struct data */
78typedef struct _Render_Engine Render_Engine; 24typedef struct _Render_Engine Render_Engine;
79 25
@@ -84,15 +30,6 @@ struct _Render_Engine
84 Tilebuf_Rect *rects; 30 Tilebuf_Rect *rects;
85 Eina_Inlist *cur_rect; 31 Eina_Inlist *cur_rect;
86 unsigned char end : 1; 32 unsigned char end : 1;
87/*
88#ifdef BUILD_ENGINE_SOFTWARE_XLIB
89 XrmDatabase xrdb;
90#endif
91 struct
92 {
93 int dpi;
94 } xr;
95 */
96 void (*outbuf_free)(Outbuf *ob); 33 void (*outbuf_free)(Outbuf *ob);
97 void (*outbuf_reconfigure)(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth); 34 void (*outbuf_reconfigure)(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth);
98 int (*outbuf_get_rot)(Outbuf *ob); 35 int (*outbuf_get_rot)(Outbuf *ob);
@@ -133,66 +70,13 @@ _output_xlib_setup(int w, int h, int rot, Display *disp, Drawable draw,
133 int shape_dither, int destination_alpha) 70 int shape_dither, int destination_alpha)
134{ 71{
135 Render_Engine *re; 72 Render_Engine *re;
136// int status;
137// char *type = NULL;
138// XrmValue val;
139 73
140 if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL; 74 if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL;
141 75
142 evas_software_xlib_x_init(); 76 evas_software_xlib_x_init();
143 evas_software_xlib_x_color_init(); 77 evas_software_xlib_x_color_init();
144 evas_software_xlib_outbuf_init(); 78 evas_software_xlib_outbuf_init();
145/* 79
146 re->xr.dpi = 75000; // dpy * 1000
147
148 status = xrdb_user_query("Xft.dpi", "Xft.Dpi", &type, &val);
149 if ((!status) || (!type))
150 {
151 if (!re->xrdb) re->xrdb = XrmGetDatabase(disp);
152 if (re->xrdb)
153 status = XrmGetResource(re->xrdb,
154 "Xft.dpi", "Xft.Dpi", &type, &val);
155 }
156
157 if ((status) && (type))
158 {
159 if (!strcmp(type, "String"))
160 {
161 const char *str, *dp;
162
163 str = val.addr;
164 dp = strchr(str, '.');
165 if (!dp) dp = strchr(str, ',');
166
167 if (dp)
168 {
169 int subdpi, len, i;
170 char *buf;
171
172 buf = alloca(dp - str + 1);
173 strncpy(buf, str, dp - str);
174 buf[dp - str] = 0;
175 len = strlen(dp + 1);
176 subdpi = atoi(dp + 1);
177
178 if (len < 3)
179 {
180 for (i = len; i < 3; i++)
181 subdpi *= 10;
182 }
183 else if (len > 3)
184 {
185 for (i = len; i > 3; i--)
186 subdpi /= 10;
187 }
188 re->xr.dpi = atoi(buf) * 1000;
189 }
190 else
191 re->xr.dpi = atoi(str) * 1000;
192 evas_common_font_dpi_set(re->xr.dpi / 1000);
193 }
194 }
195 */
196 re->ob = 80 re->ob =
197 evas_software_xlib_outbuf_setup_x(w, h, rot, OUTBUF_DEPTH_INHERIT, disp, 81 evas_software_xlib_outbuf_setup_x(w, h, rot, OUTBUF_DEPTH_INHERIT, disp,
198 draw, vis, cmap, depth, grayscale, 82 draw, vis, cmap, depth, grayscale,
@@ -238,23 +122,12 @@ _output_xcb_setup(int w, int h, int rot, xcb_connection_t *conn,
238 int shape_dither, int destination_alpha) 122 int shape_dither, int destination_alpha)
239{ 123{
240 Render_Engine *re; 124 Render_Engine *re;
241// int v = 0;
242 125
243 if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL; 126 if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL;
244 127
245 evas_software_xcb_init(); 128 evas_software_xcb_init();
246 evas_software_xcb_color_init(); 129 evas_software_xcb_color_init();
247 evas_software_xcb_outbuf_init(); 130 evas_software_xcb_outbuf_init();
248/*
249 // FIXME: re->xrdb
250 _evas_xcb_xdefaults_init();
251 v = _evas_xcb_xdefaults_int_get("Xft", "dpi");
252 _evas_xcb_xdefaults_shutdown();
253 if (v) re->xr.dpi = (v * 1000);
254 else re->xr.dpi = 75000; // dpy * 1000
255
256 evas_common_font_dpi_set(re->xr.dpi / 1000);
257 */
258 re->ob = 131 re->ob =
259 evas_software_xcb_outbuf_setup(w, h, rot, OUTBUF_DEPTH_INHERIT, conn, 132 evas_software_xcb_outbuf_setup(w, h, rot, OUTBUF_DEPTH_INHERIT, conn,
260 screen, draw, vis, cmap, depth, 133 screen, draw, vis, cmap, depth,
@@ -581,11 +454,6 @@ eng_output_free(void *data)
581{ 454{
582 Render_Engine *re; 455 Render_Engine *re;
583 456
584#ifdef BUILD_ENGINE_SOFTWARE_XLIB
585// NOTE: XrmGetDatabase() result is shared per connection, do not free it.
586// if (re->xrdb) XrmDestroyDatabase(re->xrdb);
587#endif
588
589 if ((re = (Render_Engine *)data)) 457 if ((re = (Render_Engine *)data))
590 { 458 {
591 re->outbuf_free(re->ob); 459 re->outbuf_free(re->ob);
@@ -785,17 +653,6 @@ static void
785module_close(Evas_Module *em __UNUSED__) 653module_close(Evas_Module *em __UNUSED__)
786{ 654{
787 eina_log_domain_unregister(_evas_engine_soft_x11_log_dom); 655 eina_log_domain_unregister(_evas_engine_soft_x11_log_dom);
788#ifdef BUILD_ENGINE_SOFTWARE_XLIB
789/*
790 if (xrdb_user.db)
791 {
792 XrmDestroyDatabase(xrdb_user.db);
793 xrdb_user.last_stat = 0;
794 xrdb_user.last_mtime = 0;
795 xrdb_user.db = NULL;
796 }
797 */
798#endif
799} 656}
800 657
801static Evas_Module_Api evas_modapi = 658static Evas_Module_Api evas_modapi =