e17 does..... MENUS!


			
			
				devs/princeamd/enlightenment-0.17-elive
			
			
		
Carsten Haitzler 22 years ago
parent a83333dda1
commit d7bf736ca2
  1. BIN
      data/config/appearance/default/borders/default/selected-0.sticky-0.shaded-0.bits.db
  2. BIN
      data/config/appearance/default/borders/default/selected-1.sticky-0.shaded-0.bits.db
  3. 6
      src/actions.c
  4. 104
      src/border.c
  5. 3
      src/config.c
  6. 50
      src/desktops.c
  7. 66
      src/e.h
  8. 25
      src/icccm.c
  9. 1
      src/main.c
  10. 1068
      src/menu.c

@ -500,6 +500,7 @@ e_act_resize_start (void *o, E_Action *a, void *data, int x, int y, int rx, int
E_Border *b;
b = o;
if (b->current.shaded != 0) return;
/* 0 | 1 */
/* --+-- */
/* 2 | 3 */
@ -564,6 +565,7 @@ e_act_resize_go (void *o, E_Action *a, void *data, int x, int y, int rx, int
E_Border *b;
b = o;
if (b->current.shaded != 0) return;
if (b->mode.resize == 0)
{
b->current.requested.w -= dx;
@ -606,6 +608,7 @@ e_act_resize_h_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
E_Border *b;
b = o;
if (b->current.shaded != 0) return;
/* 4 | 5 */
if (x > (b->current.w / 2))
{
@ -653,6 +656,7 @@ e_act_resize_h_go (void *o, E_Action *a, void *data, int x, int y, int rx, in
E_Border *b;
b = o;
if (b->current.shaded != 0) return;
if (b->mode.resize == 4)
{
b->current.requested.w -= dx;
@ -681,6 +685,7 @@ e_act_resize_v_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
E_Border *b;
b = o;
if (b->current.shaded != 0) return;
/* 6 */
/* - */
/* 7 */
@ -730,6 +735,7 @@ e_act_resize_v_go (void *o, E_Action *a, void *data, int x, int y, int rx, in
E_Border *b;
b = o;
if (b->current.shaded != 0) return;
if (b->mode.resize == 6)
{
b->current.requested.h -= dy;

@ -62,12 +62,18 @@ e_idle(void *data)
b = l->data;
e_border_update(b);
}
for (l = evases; l; l = l->next)
for (l = borders; l; l = l->next)
{
Evas evas;
E_Border *b;
evas = l->data;
evas_render(evas);
b = l->data;
if (b->first_expose)
{
evas_render(b->evas.l);
evas_render(b->evas.r);
evas_render(b->evas.t);
evas_render(b->evas.b);
}
}
e_db_runtime_flush();
return;
@ -704,6 +710,7 @@ e_window_expose(Eevent * ev)
e = ev->event;
{
Evas_List l;
E_Border *b;
for (l = evases; l; l = l->next)
{
@ -713,6 +720,8 @@ e_window_expose(Eevent * ev)
if (evas_get_window(evas) == e->win)
evas_update_rect(evas, e->x, e->y, e->w, e->h);
}
b = e_border_find_by_window(e->win);
if (b) b->first_expose = 1;
}
current_ev = NULL;
}
@ -1146,6 +1155,7 @@ e_border_adopt(Window win, int use_client_pos)
e_icccm_get_size_info(win, b);
e_icccm_get_mwm_hints(win, b);
e_icccm_get_layer(win, b);
e_icccm_get_title(win, b);
b->current.shaped_client = e_icccm_is_shaped(win);
/* we have now placed the bugger */
b->placed = 1;
@ -1220,7 +1230,10 @@ e_border_new(void)
b->win.main = e_window_override_new(desk->win.container, 0, 0, 1, 1);
b->win.input = e_window_input_new(b->win.main, 0, 0, 1, 1);
b->win.container = e_window_override_new(b->win.main, 0, 0, 1, 1);
e_window_set_events(b->win.input, XEV_MOUSE_MOVE | XEV_BUTTON | XEV_IN_OUT);
e_window_set_events_propagate(b->win.input, 1);
e_window_set_events(b->win.input, XEV_MOUSE_MOVE | XEV_BUTTON);
e_window_set_events(b->win.main, XEV_IN_OUT);
e_window_set_events(b->win.container, XEV_IN_OUT);
e_window_show(b->win.input);
e_window_show(b->win.container);
@ -1264,7 +1277,47 @@ e_border_new(void)
font_dir);
b->win.b = evas_get_window(b->evas.b);
e_add_child(b->win.main, b->win.b);
b->obj.title.l = evas_add_text(b->evas.l, "borzoib", 8, "");
b->obj.title.r = evas_add_text(b->evas.r, "borzoib", 8, "");
b->obj.title.t = evas_add_text(b->evas.t, "borzoib", 8, "");
b->obj.title.b = evas_add_text(b->evas.b, "borzoib", 8, "");
b->obj.title_clip.l = evas_add_rectangle(b->evas.l);
b->obj.title_clip.r = evas_add_rectangle(b->evas.r);
b->obj.title_clip.t = evas_add_rectangle(b->evas.t);
b->obj.title_clip.b = evas_add_rectangle(b->evas.b);
evas_set_color(b->evas.l, b->obj.title_clip.l, 255, 255, 255, 255);
evas_set_color(b->evas.r, b->obj.title_clip.r, 255, 255, 255, 255);
evas_set_color(b->evas.t, b->obj.title_clip.t, 255, 255, 255, 255);
evas_set_color(b->evas.b, b->obj.title_clip.b, 255, 255, 255, 255);
evas_set_pass_events(b->evas.l, b->obj.title.l, 1);
evas_set_pass_events(b->evas.r, b->obj.title.r, 1);
evas_set_pass_events(b->evas.t, b->obj.title.t, 1);
evas_set_pass_events(b->evas.b, b->obj.title.b, 1);
evas_set_color(b->evas.l, b->obj.title.l, 0, 0, 0, 255);
evas_set_color(b->evas.r, b->obj.title.r, 0, 0, 0, 255);
evas_set_color(b->evas.t, b->obj.title.t, 0, 0, 0, 255);
evas_set_color(b->evas.b, b->obj.title.b, 0, 0, 0, 255);
evas_show(b->evas.l, b->obj.title.l);
evas_show(b->evas.r, b->obj.title.r);
evas_show(b->evas.t, b->obj.title.t);
evas_show(b->evas.b, b->obj.title.b);
evas_show(b->evas.l, b->obj.title_clip.l);
evas_show(b->evas.r, b->obj.title_clip.r);
evas_show(b->evas.t, b->obj.title_clip.t);
evas_show(b->evas.b, b->obj.title_clip.b);
evas_set_clip(b->evas.l, b->obj.title.l, b->obj.title_clip.l);
evas_set_clip(b->evas.l, b->obj.title.r, b->obj.title_clip.r);
evas_set_clip(b->evas.l, b->obj.title.t, b->obj.title_clip.t);
evas_set_clip(b->evas.l, b->obj.title.b, b->obj.title_clip.b);
e_window_raise(b->win.input);
e_window_raise(b->win.container);
@ -1516,11 +1569,11 @@ e_border_set_bits(E_Border *b, char *file)
b->bits.r = ebits_load(file);
b->bits.t = ebits_load(file);
b->bits.b = ebits_load(file);
b->bits.new = 1;
b->changed = 1;
if (b->bits.t) ebits_get_insets(b->bits.l, &ppl, &ppr, &ppt, &ppb);
if (b->bits.t) ebits_get_insets(b->bits.t, &ppl, &ppr, &ppt, &ppb);
b->current.requested.w -= (pl + pr) - (ppl + ppr);
b->current.requested.h -= (pt + pb) - (ppt + ppb);
b->current.requested.x += (pl - ppl);
@ -1825,12 +1878,45 @@ e_border_update(E_Border *b)
if (b->bits.r) ebits_resize(b->bits.r, b->current.w, b->current.h);
if (b->bits.t) ebits_resize(b->bits.t, b->current.w, b->current.h);
if (b->bits.b) ebits_resize(b->bits.b, b->current.w, b->current.h);
e_icccm_move_resize(b->win.client,
b->current.x + pl, b->current.y + pt - b->current.shaded,
b->client.w, b->client.h);
e_cb_border_move_resize(b);
}
if ((b->client.title) && (b->bits.t))
{
double tx, ty, tw, th;
ebits_get_bit_geometry(b->bits.l, "Title_Area", &tx, &ty, &tw, &th);
evas_set_text(b->evas.l, b->obj.title.l, b->client.title);
evas_move(b->evas.l, b->obj.title.l, tx, ty);
evas_move(b->evas.l, b->obj.title_clip.l, tx, ty);
evas_resize(b->evas.l, b->obj.title_clip.l, tw, th);
ebits_get_bit_geometry(b->bits.r, "Title_Area", &tx, &ty, &tw, &th);
evas_set_text(b->evas.r, b->obj.title.r, b->client.title);
evas_move(b->evas.r, b->obj.title.r, tx, ty);
evas_move(b->evas.r, b->obj.title_clip.r, tx, ty);
evas_resize(b->evas.r, b->obj.title_clip.r, tw, th);
ebits_get_bit_geometry(b->bits.t, "Title_Area", &tx, &ty, &tw, &th);
evas_set_text(b->evas.t, b->obj.title.t, b->client.title);
evas_move(b->evas.t, b->obj.title.t, tx, ty);
evas_move(b->evas.t, b->obj.title_clip.t, tx, ty);
evas_resize(b->evas.t, b->obj.title_clip.t, tw, th);
ebits_get_bit_geometry(b->bits.b, "Title_Area", &tx, &ty, &tw, &th);
evas_set_text(b->evas.b, b->obj.title.b, b->client.title);
evas_move(b->evas.b, b->obj.title.b, tx, ty);
evas_move(b->evas.b, b->obj.title_clip.b, tx, ty);
evas_resize(b->evas.b, b->obj.title_clip.b, tw, th);
evas_set_layer(b->evas.l, b->obj.title.l, 1);
evas_set_layer(b->evas.r, b->obj.title.r, 1);
evas_set_layer(b->evas.t, b->obj.title.t, 1);
evas_set_layer(b->evas.b, b->obj.title.b, 1);
}
e_border_reshape(b);
if (visibility_changed)
{

@ -16,6 +16,7 @@ static char cfg_grabs_db[4096] = "";
static char cfg_settings_db[4096] = "";
static char cfg_actions_db[4096] = "";
static char cfg_borders_db[4096] = "";
static char cfg_menus_db[4096] = "";
static char cfg_user_dir[4096] = "";
static char cfg_images_dir[4096] = "";
static char cfg_fonts_dir[4096] = "";
@ -46,6 +47,8 @@ e_config_get(char *type)
PACKAGE_DATA_DIR"/data/config/behavior/default/actions.db");
E_CONF("borders", cfg_borders_db,
PACKAGE_DATA_DIR"/data/config/appearance/default/borders/");
E_CONF("menus", cfg_menus_db,
PACKAGE_DATA_DIR"/data/config/appearance/default/menus/");
E_CONF("images", cfg_images_dir,
PACKAGE_DATA_DIR"/data/images/");
E_CONF("fonts", cfg_fonts_dir,

@ -130,6 +130,56 @@ e_mouse_down(Eevent * ev)
x = e->rx - x;
y = e->ry - y;
evas_event_button_down(evas, x, y, e->button);
if (e->button == 1)
{
int count;
static E_Menu *menu = NULL;
char buf[4096];
if (!menu)
{
menu = e_menu_new();
for (count = 1; count <= 16; count++)
{
int count2;
E_Menu *menu2;
E_Menu_Item *menuitem;
sprintf(buf, "Menu item %i", count);
menuitem = e_menu_item_new(buf);
if (count < 10)
{
menu2 = e_menu_new();
menuitem->submenu = menu2;
}
e_menu_add_item(menu, menuitem);
if (count < 10)
{
for (count2 = 1; count2 <= 14; count2++)
{
E_Menu_Item *menuitem2;
E_Menu *menu3;
int count3;
sprintf(buf, "Submenu item %i", count2);
menuitem2 = e_menu_item_new(buf);
menu3 = e_menu_new();
menuitem2->submenu = menu3;
e_menu_add_item(menu2, menuitem2);
for (count3 = 1; count3 <= 12; count3++)
{
E_Menu_Item *menuitem3;
sprintf(buf, "Submenu item %i", count3);
menuitem3 = e_menu_item_new(buf);
e_menu_add_item(menu3, menuitem3);
}
}
}
}
}
e_menu_show_at_mouse(menu, e->rx, e->ry, e->time);
}
if (e->button == 3)
e_exec_restart();
return;

@ -152,6 +152,14 @@ struct _E_Border
struct {
Evas l, r, t, b;
} evas;
struct {
struct {
Evas_Object l, r, t, b;
} title;
struct {
Evas_Object l, r, t, b;
} title_clip;
} obj;
struct {
Pixmap l, r, t, b;
} pixmap;
@ -212,6 +220,8 @@ struct _E_Border
E_Desktop *desk;
char *border_file;
int first_expose;
int changed;
};
@ -295,12 +305,65 @@ struct _E_Menu
{
OBJ_PROPERTIES;
Window win;
struct {
int x, y, w, h;
int visible;
} current, previous;
struct {
int l, r, t, b;
} border, sel_border;
struct {
Window main, evas;
} win;
Evas evas;
Ebits_Object bg;
Evas_List entries;
char *bg_file;
int first_expose;
int recalc_entries;
int redo_sel;
int changed;
E_Menu_Item *selected;
Time time;
};
struct _E_Menu_Item
{
OBJ_PROPERTIES;
int x, y;
struct {
struct {
int w, h;
} min;
int w, h;
} size;
Ebits_Object bg;
char *bg_file;
int selected;
Evas_Object obj_entry;
char *str;
Evas_Object obj_text;
char *icon;
Evas_Object obj_icon;
int radio_group;
int check;
int on;
E_Menu *menu;
E_Menu *submenu;
void (*func_select) (E_Menu *m, E_Menu_Item *mi, void *data);
void *func_select_data;
};
void e_action_add_proto(char *action,
@ -349,6 +412,7 @@ void e_icccm_release(Window win);
void e_icccm_get_size_info(Window win, E_Border *b);
void e_icccm_get_mwm_hints(Window win, E_Border *b);
void e_icccm_get_layer(Window win, E_Border *b);
void e_icccm_get_title(Window win, E_Border *b);
void e_icccm_set_frame_size(Window win, int l, int r, int t, int b);
void e_icccm_set_desk_area(Window win, int ax, int ay);
void e_icccm_set_desk_area_size(Window win, int ax, int ay);

@ -296,6 +296,7 @@ e_icccm_get_mwm_hints(Window win, E_Border *b)
if (mwmhints->decorations & MWM_DECOR_BORDER) b->client.border = 1;
if (mwmhints->decorations & MWM_DECOR_RESIZEH) b->client.handles = 1;
if (mwmhints->decorations & MWM_DECOR_TITLE) b->client.titlebar = 1;
e_border_apply_border(b);
}
FREE(mwmhints);
}
@ -321,6 +322,24 @@ e_icccm_get_layer(Window win, E_Border *b)
}
}
void
e_icccm_get_title(Window win, E_Border *b)
{
char *title;
title = e_window_get_title(win);
if (b->client.title)
{
if ((title) && (!strcmp(title, b->client.title))) return;
b->changed = 1;
FREE(b->client.title);
}
b->client.title = NULL;
if (title) b->client.title = title;
else b->client.title = strdup("No Title");
}
void
e_icccm_set_frame_size(Window win, int l, int r, int t, int b)
{
@ -392,10 +411,16 @@ void
e_icccm_handle_property_change(Atom a, E_Border *b)
{
static Atom a_wm_normal_hints = 0;
static Atom a_motif_wm_hints = 0;
static Atom a_wm_name = 0;
E_ATOM(a_wm_normal_hints, "WM_NORMAL_HINTS");
E_ATOM(a_motif_wm_hints, "_MOTIF_WM_HINTS");
E_ATOM(a_wm_name, "WM_NAME");
if (a == a_wm_normal_hints) e_icccm_get_size_info(b->win.client, b);
else if (a == a_motif_wm_hints) e_icccm_get_mwm_hints(b->win.client, b);
else if (a == a_wm_name) e_icccm_get_title(b->win.client, b);
}
void

@ -50,6 +50,7 @@ main(int argc, char **argv)
e_desktops_init();
e_border_init();
e_actions_init();
e_menu_init();
setup();

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save