forked from enlightenment/enlightenment
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
This commit is contained in:
parent
7a390816d3
commit
813f640d06
1
AUTHORS
1
AUTHORS
|
@ -3,3 +3,4 @@ Christian Kreibich <cK@whoop.org>
|
||||||
Burra <burra@colorado.edu>
|
Burra <burra@colorado.edu>
|
||||||
Graham MacDonald <macdonag@lineone.net>
|
Graham MacDonald <macdonag@lineone.net>
|
||||||
Alan Schmitt <alan.schmitt@inria.fr>
|
Alan Schmitt <alan.schmitt@inria.fr>
|
||||||
|
Kevin Brosius <cobra@compuserve.com>
|
||||||
|
|
|
@ -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-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
|
ln -sf selected-0.sticky-0.shaded-0.bits.db selected-0.sticky-1.shaded-1.bits.db
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
cd fonts
|
||||||
|
ln -sf borzoib.ttf menu.ttf
|
||||||
|
ln -sf borzoib.ttf text.ttf
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -151,6 +151,8 @@ e_config_desktops_init()
|
||||||
width, (E_Data_Value) 1);
|
width, (E_Data_Value) 1);
|
||||||
E_DATA_NODE(cfg_desktops, "height", E_DATA_TYPE_INT, NULL, E_Config_Desktops,
|
E_DATA_NODE(cfg_desktops, "height", E_DATA_TYPE_INT, NULL, E_Config_Desktops,
|
||||||
height, (E_Data_Value) 1);
|
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
|
void
|
||||||
|
|
|
@ -17,6 +17,7 @@ struct _E_Config_Desktops
|
||||||
int speed;
|
int speed;
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
|
int e_native_cursors;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _E_Config_Guides E_Config_Guides;
|
typedef struct _E_Config_Guides E_Config_Guides;
|
||||||
|
|
|
@ -3,6 +3,11 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
|
#include <X11/cursorfont.h>
|
||||||
|
#if 0
|
||||||
|
/* XCursor */
|
||||||
|
#include <X11/Xcursor/Xcursor.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct _e_cursor E_Cursor;
|
typedef struct _e_cursor E_Cursor;
|
||||||
|
|
||||||
|
@ -11,6 +16,7 @@ struct _e_cursor
|
||||||
char *type;
|
char *type;
|
||||||
Cursor cursor;
|
Cursor cursor;
|
||||||
time_t mod;
|
time_t mod;
|
||||||
|
int x_cursor_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int cursor_change = 0;
|
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);
|
c->mod = e_file_mod_time(buf);
|
||||||
E_DB_INT_GET(buf, "/cursor/x", hx, ok);
|
E_DB_INT_GET(buf, "/cursor/x", hx, ok);
|
||||||
E_DB_INT_GET(buf, "/cursor/y", hy, 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",
|
snprintf(buf, PATH_MAX, "%s/%s.db:/cursor/image",
|
||||||
e_config_get("cursors"), type);
|
e_config_get("cursors"), type);
|
||||||
|
|
||||||
im = imlib_load_image(buf);
|
im = imlib_load_image(buf);
|
||||||
if (im)
|
if (im)
|
||||||
{
|
{
|
||||||
|
@ -228,6 +288,12 @@ e_cursors_display_in_window(Window win, char *type)
|
||||||
FREE(c);
|
FREE(c);
|
||||||
c = NULL;
|
c = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/* end native cursors */
|
||||||
|
|
||||||
|
|
||||||
if (c)
|
if (c)
|
||||||
{
|
{
|
||||||
c->cursor =
|
c->cursor =
|
||||||
|
@ -236,9 +302,24 @@ e_cursors_display_in_window(Window win, char *type)
|
||||||
ecore_pixmap_free(mask);
|
ecore_pixmap_free(mask);
|
||||||
cursors = evas_list_append(cursors, c);
|
cursors = evas_list_append(cursors, c);
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
|
} /* XCursor */
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (c)
|
if (c)
|
||||||
|
{
|
||||||
|
/* 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);
|
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
|
else
|
||||||
{
|
{
|
||||||
if (!strcmp(type, "Default"))
|
if (!strcmp(type, "Default"))
|
||||||
|
|
|
@ -1531,7 +1531,7 @@ e_menu_item_realize(E_Menu * m, E_Menu_Item * mi)
|
||||||
if (mi->str)
|
if (mi->str)
|
||||||
{
|
{
|
||||||
mi->obj_text = evas_object_text_add(m->evas);
|
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_text_text_set(mi->obj_text, mi->str);
|
||||||
evas_object_color_set(mi->obj_text, 0, 0, 0, 255);
|
evas_object_color_set(mi->obj_text, 0, 0, 0, 255);
|
||||||
evas_object_show(mi->obj_text);
|
evas_object_show(mi->obj_text);
|
||||||
|
|
10
src/text.c
10
src/text.c
|
@ -22,23 +22,23 @@ e_text_new(Evas * evas, char *text, char *class)
|
||||||
t->text = strdup("");
|
t->text = strdup("");
|
||||||
t->evas = evas;
|
t->evas = evas;
|
||||||
t->obj.o1 = evas_object_text_add(t->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);
|
evas_object_text_text_set(t->obj.o1, t->text);
|
||||||
|
|
||||||
t->obj.o2 = evas_object_text_add(t->evas);
|
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);
|
evas_object_text_text_set(t->obj.o2, t->text);
|
||||||
|
|
||||||
t->obj.o3 = evas_object_text_add(t->evas);
|
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);
|
evas_object_text_text_set(t->obj.o3, t->text);
|
||||||
|
|
||||||
t->obj.o4 = evas_object_text_add(t->evas);
|
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);
|
evas_object_text_text_set(t->obj.o4, t->text);
|
||||||
|
|
||||||
t->obj.text = evas_object_text_add(t->evas);
|
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_text_text_set(t->obj.text, t->text);
|
||||||
|
|
||||||
evas_object_pass_events_set(t->obj.o1, 1);
|
evas_object_pass_events_set(t->obj.o1, 1);
|
||||||
|
|
Loading…
Reference in New Issue