summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsleuth <sleuth>2003-03-08 12:51:06 +0000
committersleuth <sleuth@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2003-03-08 12:51:06 +0000
commit813f640d0679dd8c44b2f0ed13bb2c04705e7dc7 (patch)
tree289f868b97a6a989a19aa8ed57dcf3f0cbc5baa3
parent7a390816d3e3c2a0fc4ad189133030e982f96891 (diff)
XFree86 XCursor sample support. No change with a default install, but if you grab the new behaviour.db and change /desktops/cursors/e_native to 0, then E will use your local XCursor setup. Check out the edevel mailing list for a theme I've tried. XCursor support is only available in XFree86 4.3.0.
Also allow different fonts for borders vs. menus. This adds links in /usr/local/share/enlightenment/fonts (default install) for a menu.ttf and a text.ttf file. text.tff is the font used for border text/window titles. menu.ttf will be used for menus. No change by default, but you'll need to re-run autogen.sh & make install for the links to be created automatically. Update AUTHORS Kevin Brosius <cobra@compuserve.com> SVN revision: 6751
-rw-r--r--AUTHORS1
-rwxr-xr-xautogen.sh4
-rw-r--r--data/config/behavior/default/behavior.dbbin155646 -> 155646 bytes
-rw-r--r--data/cursors/Close.dbbin16384 -> 16384 bytes
-rw-r--r--data/cursors/Default.dbbin16384 -> 16384 bytes
-rw-r--r--data/cursors/Iconify.dbbin16384 -> 16384 bytes
-rw-r--r--data/cursors/Max_Size.dbbin16384 -> 16384 bytes
-rw-r--r--data/cursors/Menu.dbbin16384 -> 16384 bytes
-rw-r--r--data/cursors/Resize.dbbin16384 -> 16384 bytes
-rw-r--r--data/cursors/Resize_Horizontal.dbbin16384 -> 16384 bytes
-rw-r--r--data/cursors/Resize_Vertical.dbbin16384 -> 16384 bytes
-rw-r--r--data/cursors/Title_Bar.dbbin16384 -> 16384 bytes
-rw-r--r--src/config.c2
-rw-r--r--src/config.h1
-rw-r--r--src/cursors.c83
-rw-r--r--src/menu.c2
-rw-r--r--src/text.c10
17 files changed, 96 insertions, 7 deletions
diff --git a/AUTHORS b/AUTHORS
index b54297b7c..1f5301dda 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -3,3 +3,4 @@ Christian Kreibich <cK@whoop.org>
3Burra <burra@colorado.edu> 3Burra <burra@colorado.edu>
4Graham MacDonald <macdonag@lineone.net> 4Graham MacDonald <macdonag@lineone.net>
5Alan Schmitt <alan.schmitt@inria.fr> 5Alan Schmitt <alan.schmitt@inria.fr>
6Kevin Brosius <cobra@compuserve.com>
diff --git a/autogen.sh b/autogen.sh
index 6dbed5080..40363f3a9 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -130,3 +130,7 @@ ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-0.shaded-1.bits.db
130ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-1.shaded-1.bits.db 130ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-1.shaded-1.bits.db
131ln -sf selected-0.sticky-0.shaded-0.bits.db selected-0.sticky-1.shaded-1.bits.db 131ln -sf selected-0.sticky-0.shaded-0.bits.db selected-0.sticky-1.shaded-1.bits.db
132cd .. 132cd ..
133
134cd fonts
135ln -sf borzoib.ttf menu.ttf
136ln -sf borzoib.ttf text.ttf
diff --git a/data/config/behavior/default/behavior.db b/data/config/behavior/default/behavior.db
index aeb15ca46..6775c1424 100644
--- a/data/config/behavior/default/behavior.db
+++ b/data/config/behavior/default/behavior.db
Binary files differ
diff --git a/data/cursors/Close.db b/data/cursors/Close.db
index 3a061f7e9..74d03f81c 100644
--- a/data/cursors/Close.db
+++ b/data/cursors/Close.db
Binary files differ
diff --git a/data/cursors/Default.db b/data/cursors/Default.db
index 19c66eeaa..57ff1a4c0 100644
--- a/data/cursors/Default.db
+++ b/data/cursors/Default.db
Binary files differ
diff --git a/data/cursors/Iconify.db b/data/cursors/Iconify.db
index 633c66ed5..71d80d221 100644
--- a/data/cursors/Iconify.db
+++ b/data/cursors/Iconify.db
Binary files differ
diff --git a/data/cursors/Max_Size.db b/data/cursors/Max_Size.db
index beffdd1ae..9d1c2142f 100644
--- a/data/cursors/Max_Size.db
+++ b/data/cursors/Max_Size.db
Binary files differ
diff --git a/data/cursors/Menu.db b/data/cursors/Menu.db
index 73889468e..b84f74217 100644
--- a/data/cursors/Menu.db
+++ b/data/cursors/Menu.db
Binary files differ
diff --git a/data/cursors/Resize.db b/data/cursors/Resize.db
index 4316e225e..20a6fcc29 100644
--- a/data/cursors/Resize.db
+++ b/data/cursors/Resize.db
Binary files differ
diff --git a/data/cursors/Resize_Horizontal.db b/data/cursors/Resize_Horizontal.db
index 62be05ff2..573ac1732 100644
--- a/data/cursors/Resize_Horizontal.db
+++ b/data/cursors/Resize_Horizontal.db
Binary files differ
diff --git a/data/cursors/Resize_Vertical.db b/data/cursors/Resize_Vertical.db
index f2ad2f167..b13faa3ce 100644
--- a/data/cursors/Resize_Vertical.db
+++ b/data/cursors/Resize_Vertical.db
Binary files differ
diff --git a/data/cursors/Title_Bar.db b/data/cursors/Title_Bar.db
index 11775f94c..9bde4d4a7 100644
--- a/data/cursors/Title_Bar.db
+++ b/data/cursors/Title_Bar.db
Binary files differ
diff --git a/src/config.c b/src/config.c
index 92488ad5a..16a0e63d2 100644
--- a/src/config.c
+++ b/src/config.c
@@ -151,6 +151,8 @@ e_config_desktops_init()
151 width, (E_Data_Value) 1); 151 width, (E_Data_Value) 1);
152 E_DATA_NODE(cfg_desktops, "height", E_DATA_TYPE_INT, NULL, E_Config_Desktops, 152 E_DATA_NODE(cfg_desktops, "height", E_DATA_TYPE_INT, NULL, E_Config_Desktops,
153 height, (E_Data_Value) 1); 153 height, (E_Data_Value) 1);
154 E_DATA_NODE(cfg_desktops, "cursors/e_native", E_DATA_TYPE_INT,
155 NULL, E_Config_Desktops, e_native_cursors, (E_Data_Value) 1);
154} 156}
155 157
156void 158void
diff --git a/src/config.h b/src/config.h
index 519e2d56b..f5d5bda08 100644
--- a/src/config.h
+++ b/src/config.h
@@ -17,6 +17,7 @@ struct _E_Config_Desktops
17 int speed; 17 int speed;
18 int width; 18 int width;
19 int height; 19 int height;
20 int e_native_cursors;
20}; 21};
21 22
22typedef struct _E_Config_Guides E_Config_Guides; 23typedef struct _E_Config_Guides E_Config_Guides;
diff --git a/src/cursors.c b/src/cursors.c
index 6266e27b0..690652f75 100644
--- a/src/cursors.c
+++ b/src/cursors.c
@@ -3,6 +3,11 @@
3#include "config.h" 3#include "config.h"
4#include "util.h" 4#include "util.h"
5#include "file.h" 5#include "file.h"
6#include <X11/cursorfont.h>
7#if 0
8/* XCursor */
9#include <X11/Xcursor/Xcursor.h>
10#endif
6 11
7typedef struct _e_cursor E_Cursor; 12typedef struct _e_cursor E_Cursor;
8 13
@@ -11,6 +16,7 @@ struct _e_cursor
11 char *type; 16 char *type;
12 Cursor cursor; 17 Cursor cursor;
13 time_t mod; 18 time_t mod;
19 int x_cursor_id;
14}; 20};
15 21
16static int cursor_change = 0; 22static int cursor_change = 0;
@@ -120,8 +126,62 @@ e_cursors_display_in_window(Window win, char *type)
120 c->mod = e_file_mod_time(buf); 126 c->mod = e_file_mod_time(buf);
121 E_DB_INT_GET(buf, "/cursor/x", hx, ok); 127 E_DB_INT_GET(buf, "/cursor/x", hx, ok);
122 E_DB_INT_GET(buf, "/cursor/y", hy, ok); 128 E_DB_INT_GET(buf, "/cursor/y", hy, ok);
129 /* Handle x_cursor if available */
130 E_DB_INT_GET(buf, "/cursor/x_id", c->x_cursor_id, ok);
131 if(!ok)
132 c->x_cursor_id = XC_arrow;
133
134 /* Some sample code to load XCursor data directly. */
135 /* This works, but shading and colorization is different */
136 /* than native XFree86 XCursors. It appears the xcursorgen */
137 /* program does some preprocessing. We could do the same. */
138#if 0
139 /* XCursor */
140 if(0)
141 {
142 Evas *ic_e;
143 Evas_Object *e_im;
144 int *idata;
145 int wid, hei;
146 XcursorImage * xcur;
147
148 snprintf(buf, PATH_MAX, "%s/%s.db",
149 e_config_get("cursors"), type);
150
151 ic_e = e_evas_new_all(ecore_display_get(), 0,
152 0, 0, 200, 200, "");
153 e_im = evas_object_image_add(ic_e);
154 evas_object_image_file_set(e_im, buf, "/cursor/image");
155 idata = evas_object_image_data_get(e_im, 1);
156 evas_object_image_size_get(e_im, &wid, &hei);
157
158 /* Make sure width and height are sane, protect ourselves.*/
159 if(wid > 128) wid=128;
160 if(hei > 128) hei=128;
161
162 xcur = XcursorImageCreate( wid, hei);
163 xcur->pixels = /*Xmalloc ? */(int *) malloc(wid * hei * 4);
164 if(!xcur->pixels)
165 D("Failed alloc!!!!!!!!!!\n");
166 memcpy(xcur->pixels, idata, wid*hei*4);
167 xcur->xhot = hx;
168 xcur->yhot = hy;
169
170 c->cursor = XcursorImageLoadCursor(ecore_display_get(), xcur);
171
172 evas_object_del(e_im);
173 }
174 else
175 {
176#endif
177
178 /* Only load images for native cursors */
179 if(config_data->desktops->e_native_cursors)
180 {
181
123 snprintf(buf, PATH_MAX, "%s/%s.db:/cursor/image", 182 snprintf(buf, PATH_MAX, "%s/%s.db:/cursor/image",
124 e_config_get("cursors"), type); 183 e_config_get("cursors"), type);
184
125 im = imlib_load_image(buf); 185 im = imlib_load_image(buf);
126 if (im) 186 if (im)
127 { 187 {
@@ -228,6 +288,12 @@ e_cursors_display_in_window(Window win, char *type)
228 FREE(c); 288 FREE(c);
229 c = NULL; 289 c = NULL;
230 } 290 }
291
292
293 }
294 /* end native cursors */
295
296
231 if (c) 297 if (c)
232 { 298 {
233 c->cursor = 299 c->cursor =
@@ -236,9 +302,24 @@ e_cursors_display_in_window(Window win, char *type)
236 ecore_pixmap_free(mask); 302 ecore_pixmap_free(mask);
237 cursors = evas_list_append(cursors, c); 303 cursors = evas_list_append(cursors, c);
238 } 304 }
305#if 0
306 } /* XCursor */
307#endif
239 } 308 }
240 if (c) 309 if (c)
241 ecore_cursor_set(win, c->cursor); 310 {
311 /* If behavior.db has /desktops/cursors/native == 1, then use */
312 /* images installed */
313 /* by E, else use X cursors by cursorfont id. */
314 if(config_data->desktops->e_native_cursors)
315 ecore_cursor_set(win, c->cursor);
316 else
317 {
318 Cursor x_cursor;
319 x_cursor = XCreateFontCursor(ecore_display_get(), c->x_cursor_id);
320 ecore_cursor_set(win, x_cursor);
321 }
322 }
242 else 323 else
243 { 324 {
244 if (!strcmp(type, "Default")) 325 if (!strcmp(type, "Default"))
diff --git a/src/menu.c b/src/menu.c
index 0df4ddf02..1d7993716 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1531,7 +1531,7 @@ e_menu_item_realize(E_Menu * m, E_Menu_Item * mi)
1531 if (mi->str) 1531 if (mi->str)
1532 { 1532 {
1533 mi->obj_text = evas_object_text_add(m->evas); 1533 mi->obj_text = evas_object_text_add(m->evas);
1534 evas_object_text_font_set(mi->obj_text, "borzoib", 8); 1534 evas_object_text_font_set(mi->obj_text, "menu", 8);
1535 evas_object_text_text_set(mi->obj_text, mi->str); 1535 evas_object_text_text_set(mi->obj_text, mi->str);
1536 evas_object_color_set(mi->obj_text, 0, 0, 0, 255); 1536 evas_object_color_set(mi->obj_text, 0, 0, 0, 255);
1537 evas_object_show(mi->obj_text); 1537 evas_object_show(mi->obj_text);
diff --git a/src/text.c b/src/text.c
index df737cb8c..d8ae4599b 100644
--- a/src/text.c
+++ b/src/text.c
@@ -22,23 +22,23 @@ e_text_new(Evas * evas, char *text, char *class)
22 t->text = strdup(""); 22 t->text = strdup("");
23 t->evas = evas; 23 t->evas = evas;
24 t->obj.o1 = evas_object_text_add(t->evas); 24 t->obj.o1 = evas_object_text_add(t->evas);
25 evas_object_text_font_set(t->obj.o1, "borzoib", 8); 25 evas_object_text_font_set(t->obj.o1, "text", 8);
26 evas_object_text_text_set(t->obj.o1, t->text); 26 evas_object_text_text_set(t->obj.o1, t->text);
27 27
28 t->obj.o2 = evas_object_text_add(t->evas); 28 t->obj.o2 = evas_object_text_add(t->evas);
29 evas_object_text_font_set(t->obj.o2, "borzoib", 8); 29 evas_object_text_font_set(t->obj.o2, "text", 8);
30 evas_object_text_text_set(t->obj.o2, t->text); 30 evas_object_text_text_set(t->obj.o2, t->text);
31 31
32 t->obj.o3 = evas_object_text_add(t->evas); 32 t->obj.o3 = evas_object_text_add(t->evas);
33 evas_object_text_font_set(t->obj.o3, "borzoib", 8); 33 evas_object_text_font_set(t->obj.o3, "text", 8);
34 evas_object_text_text_set(t->obj.o3, t->text); 34 evas_object_text_text_set(t->obj.o3, t->text);
35 35
36 t->obj.o4 = evas_object_text_add(t->evas); 36 t->obj.o4 = evas_object_text_add(t->evas);
37 evas_object_text_font_set(t->obj.o4, "borzoib", 8); 37 evas_object_text_font_set(t->obj.o4, "text", 8);
38 evas_object_text_text_set(t->obj.o4, t->text); 38 evas_object_text_text_set(t->obj.o4, t->text);
39 39
40 t->obj.text = evas_object_text_add(t->evas); 40 t->obj.text = evas_object_text_add(t->evas);
41 evas_object_text_font_set(t->obj.text, "borzoib", 8); 41 evas_object_text_font_set(t->obj.text, "text", 8);
42 evas_object_text_text_set(t->obj.text, t->text); 42 evas_object_text_text_set(t->obj.text, t->text);
43 43
44 evas_object_pass_events_set(t->obj.o1, 1); 44 evas_object_pass_events_set(t->obj.o1, 1);