diff --git a/AUTHORS b/AUTHORS index b54297b7c..1f5301dda 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3,3 +3,4 @@ Christian Kreibich Burra Graham MacDonald Alan Schmitt +Kevin Brosius 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 ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-1.shaded-1.bits.db ln -sf selected-0.sticky-0.shaded-0.bits.db selected-0.sticky-1.shaded-1.bits.db cd .. + +cd fonts +ln -sf borzoib.ttf menu.ttf +ln -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 Binary files a/data/config/behavior/default/behavior.db and b/data/config/behavior/default/behavior.db differ diff --git a/data/cursors/Close.db b/data/cursors/Close.db index 3a061f7e9..74d03f81c 100644 Binary files a/data/cursors/Close.db and b/data/cursors/Close.db differ diff --git a/data/cursors/Default.db b/data/cursors/Default.db index 19c66eeaa..57ff1a4c0 100644 Binary files a/data/cursors/Default.db and b/data/cursors/Default.db differ diff --git a/data/cursors/Iconify.db b/data/cursors/Iconify.db index 633c66ed5..71d80d221 100644 Binary files a/data/cursors/Iconify.db and b/data/cursors/Iconify.db differ diff --git a/data/cursors/Max_Size.db b/data/cursors/Max_Size.db index beffdd1ae..9d1c2142f 100644 Binary files a/data/cursors/Max_Size.db and b/data/cursors/Max_Size.db differ diff --git a/data/cursors/Menu.db b/data/cursors/Menu.db index 73889468e..b84f74217 100644 Binary files a/data/cursors/Menu.db and b/data/cursors/Menu.db differ diff --git a/data/cursors/Resize.db b/data/cursors/Resize.db index 4316e225e..20a6fcc29 100644 Binary files a/data/cursors/Resize.db and b/data/cursors/Resize.db differ diff --git a/data/cursors/Resize_Horizontal.db b/data/cursors/Resize_Horizontal.db index 62be05ff2..573ac1732 100644 Binary files a/data/cursors/Resize_Horizontal.db and b/data/cursors/Resize_Horizontal.db differ diff --git a/data/cursors/Resize_Vertical.db b/data/cursors/Resize_Vertical.db index f2ad2f167..b13faa3ce 100644 Binary files a/data/cursors/Resize_Vertical.db and b/data/cursors/Resize_Vertical.db differ diff --git a/data/cursors/Title_Bar.db b/data/cursors/Title_Bar.db index 11775f94c..9bde4d4a7 100644 Binary files a/data/cursors/Title_Bar.db and b/data/cursors/Title_Bar.db 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() width, (E_Data_Value) 1); E_DATA_NODE(cfg_desktops, "height", E_DATA_TYPE_INT, NULL, E_Config_Desktops, height, (E_Data_Value) 1); + E_DATA_NODE(cfg_desktops, "cursors/e_native", E_DATA_TYPE_INT, + NULL, E_Config_Desktops, e_native_cursors, (E_Data_Value) 1); } void 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 int speed; int width; int height; + int e_native_cursors; }; typedef 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 @@ #include "config.h" #include "util.h" #include "file.h" +#include +#if 0 +/* XCursor */ +#include +#endif typedef struct _e_cursor E_Cursor; @@ -11,6 +16,7 @@ struct _e_cursor char *type; Cursor cursor; time_t mod; + int x_cursor_id; }; static int cursor_change = 0; @@ -120,8 +126,62 @@ e_cursors_display_in_window(Window win, char *type) c->mod = e_file_mod_time(buf); E_DB_INT_GET(buf, "/cursor/x", hx, ok); E_DB_INT_GET(buf, "/cursor/y", hy, ok); + /* Handle x_cursor if available */ + E_DB_INT_GET(buf, "/cursor/x_id", c->x_cursor_id, ok); + if(!ok) + c->x_cursor_id = XC_arrow; + + /* Some sample code to load XCursor data directly. */ + /* This works, but shading and colorization is different */ + /* than native XFree86 XCursors. It appears the xcursorgen */ + /* program does some preprocessing. We could do the same. */ +#if 0 + /* XCursor */ + if(0) + { + Evas *ic_e; + Evas_Object *e_im; + int *idata; + int wid, hei; + XcursorImage * xcur; + + snprintf(buf, PATH_MAX, "%s/%s.db", + e_config_get("cursors"), type); + + ic_e = e_evas_new_all(ecore_display_get(), 0, + 0, 0, 200, 200, ""); + e_im = evas_object_image_add(ic_e); + evas_object_image_file_set(e_im, buf, "/cursor/image"); + idata = evas_object_image_data_get(e_im, 1); + evas_object_image_size_get(e_im, &wid, &hei); + + /* Make sure width and height are sane, protect ourselves.*/ + if(wid > 128) wid=128; + if(hei > 128) hei=128; + + xcur = XcursorImageCreate( wid, hei); + xcur->pixels = /*Xmalloc ? */(int *) malloc(wid * hei * 4); + if(!xcur->pixels) + D("Failed alloc!!!!!!!!!!\n"); + memcpy(xcur->pixels, idata, wid*hei*4); + xcur->xhot = hx; + xcur->yhot = hy; + + c->cursor = XcursorImageLoadCursor(ecore_display_get(), xcur); + + evas_object_del(e_im); + } + else + { +#endif + + /* Only load images for native cursors */ + if(config_data->desktops->e_native_cursors) + { + snprintf(buf, PATH_MAX, "%s/%s.db:/cursor/image", e_config_get("cursors"), type); + im = imlib_load_image(buf); if (im) { @@ -228,6 +288,12 @@ e_cursors_display_in_window(Window win, char *type) FREE(c); c = NULL; } + + + } + /* end native cursors */ + + if (c) { c->cursor = @@ -236,9 +302,24 @@ e_cursors_display_in_window(Window win, char *type) ecore_pixmap_free(mask); cursors = evas_list_append(cursors, c); } +#if 0 + } /* XCursor */ +#endif } if (c) - ecore_cursor_set(win, c->cursor); + { + /* If behavior.db has /desktops/cursors/native == 1, then use */ + /* images installed */ + /* by E, else use X cursors by cursorfont id. */ + if(config_data->desktops->e_native_cursors) + ecore_cursor_set(win, c->cursor); + else + { + Cursor x_cursor; + x_cursor = XCreateFontCursor(ecore_display_get(), c->x_cursor_id); + ecore_cursor_set(win, x_cursor); + } + } else { 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) if (mi->str) { mi->obj_text = evas_object_text_add(m->evas); - evas_object_text_font_set(mi->obj_text, "borzoib", 8); + evas_object_text_font_set(mi->obj_text, "menu", 8); evas_object_text_text_set(mi->obj_text, mi->str); evas_object_color_set(mi->obj_text, 0, 0, 0, 255); 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) t->text = strdup(""); t->evas = evas; t->obj.o1 = evas_object_text_add(t->evas); - evas_object_text_font_set(t->obj.o1, "borzoib", 8); + evas_object_text_font_set(t->obj.o1, "text", 8); evas_object_text_text_set(t->obj.o1, t->text); t->obj.o2 = evas_object_text_add(t->evas); - evas_object_text_font_set(t->obj.o2, "borzoib", 8); + evas_object_text_font_set(t->obj.o2, "text", 8); evas_object_text_text_set(t->obj.o2, t->text); t->obj.o3 = evas_object_text_add(t->evas); - evas_object_text_font_set(t->obj.o3, "borzoib", 8); + evas_object_text_font_set(t->obj.o3, "text", 8); evas_object_text_text_set(t->obj.o3, t->text); t->obj.o4 = evas_object_text_add(t->evas); - evas_object_text_font_set(t->obj.o4, "borzoib", 8); + evas_object_text_font_set(t->obj.o4, "text", 8); evas_object_text_text_set(t->obj.o4, t->text); t->obj.text = evas_object_text_add(t->evas); - evas_object_text_font_set(t->obj.text, "borzoib", 8); + evas_object_text_font_set(t->obj.text, "text", 8); evas_object_text_text_set(t->obj.text, t->text); evas_object_pass_events_set(t->obj.o1, 1);