From a83333dda1d61d7544bea7864d51079322975a34 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Fri, 29 Dec 2000 20:49:17 +0000 Subject: [PATCH] adding stuff :) SVN revision: 4053 --- src/Makefile.am | 1 + src/border.c | 2 +- src/desktops.c | 80 ++++++++++++++++++++++++++++++++++++++- src/e.h | 16 +++++++- src/menu.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 209 insertions(+), 3 deletions(-) create mode 100644 src/menu.c diff --git a/src/Makefile.am b/src/Makefile.am index c53cc1b..12532fc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -14,6 +14,7 @@ desktops.c \ exec.c \ icccm.c \ main.c \ +menu.c \ resist.c \ util.c \ view.c \ diff --git a/src/border.c b/src/border.c index 494d415..2f9dec9 100644 --- a/src/border.c +++ b/src/border.c @@ -866,7 +866,7 @@ e_cb_border_mouse_out(E_Border *b, Eevent *e) if (border_mouse_buttons) return; /* pointer focus stuff */ - e_focus_to_window(0); +/* e_focus_to_window(0);*/ x = mouse_x; y = mouse_y; diff --git a/src/desktops.c b/src/desktops.c index ad59c29..2cb8788 100644 --- a/src/desktops.c +++ b/src/desktops.c @@ -6,6 +6,8 @@ static int screen_w, screen_h; static int current_desk = 0; static void e_idle(void *data); +static void e_key_down(Eevent * ev); +static void e_key_up(Eevent * ev); static void e_mouse_down(Eevent * ev); static void e_mouse_up(Eevent * ev); static void e_mouse_in(Eevent * ev); @@ -29,6 +31,78 @@ e_idle(void *data) UN(data); } +/* handling key down events */ +static void +e_key_down(Eevent * ev) +{ + Ev_Key_Down *e; + + e = ev->event; + { + Evas_List l; + + for (l = desktops; l; l = l->next) + { + E_Desktop *desk; + + desk = l->data; + + if (desk->win.desk == e->win) + { + if (!strcmp(e->key, "Up")) + { + } + else if (!strcmp(e->key, "Down")) + { + } + else if (!strcmp(e->key, "Left")) + { + } + else if (!strcmp(e->key, "Right")) + { + } + else if (!strcmp(e->key, "Escape")) + { + } + else + { + /* infact we should pass this onto the view handling */ + /* this desktop here */ + char *type; + + type = e_key_press_translate_into_typeable(e); + if (type) + { + } + } + } + } + } +} + +/* handling key up events */ +static void +e_key_up(Eevent * ev) +{ + Ev_Key_Up *e; + + e = ev->event; + { + Evas_List l; + + for (l = desktops; l; l = l->next) + { + E_Desktop *desk; + + desk = l->data; + + if (desk->win.desk == e->win) + { + } + } + } +} + /* handling mouse down events */ static void e_mouse_down(Eevent * ev) @@ -151,6 +225,8 @@ e_mouse_in(Eevent * ev) Evas evas; int x, y; + /* focus handling for desktop */ + e_focus_to_window(e->win); evas = desk->evas.desk; e_window_get_root_relative_location(evas_get_window(evas), &x, &y); @@ -238,6 +314,8 @@ e_desktops_init(void) e_event_filter_handler_add(EV_MOUSE_IN, e_mouse_in); e_event_filter_handler_add(EV_MOUSE_OUT, e_mouse_out); e_event_filter_handler_add(EV_WINDOW_EXPOSE, e_window_expose); + e_event_filter_handler_add(EV_KEY_DOWN, e_key_down); + e_event_filter_handler_add(EV_KEY_UP, e_key_up); e_event_filter_idle_handler_add(e_idle, NULL); e_icccm_advertise_e_compat(); @@ -396,7 +474,7 @@ e_desktops_init_file_display(E_Desktop *desk) evas_get_visual(desk->evas.desk), evas_get_colormap(desk->evas.desk)); e_window_set_background_pixmap(desk->win.desk, desk->evas.pmap); /* normal stuff */ - e_window_set_events(desk->win.desk, XEV_EXPOSE | XEV_MOUSE_MOVE | XEV_BUTTON | XEV_IN_OUT); + e_window_set_events(desk->win.desk, XEV_EXPOSE | XEV_MOUSE_MOVE | XEV_BUTTON | XEV_IN_OUT | XEV_KEY); e_window_show(desk->win.desk); { Evas_Object o; diff --git a/src/e.h b/src/e.h index e783367..90c100e 100644 --- a/src/e.h +++ b/src/e.h @@ -130,7 +130,9 @@ typedef struct _E_Desktop E_Desktop; typedef struct _E_Rect E_Rect; typedef struct _E_Active_Action_Timer E_Active_Action_Timer; typedef struct _E_View E_View; - +typedef struct _E_Menu E_Menu; +typedef struct _E_Menu_Item E_Menu_Item; + struct _E_Object { OBJ_PROPERTIES; @@ -289,6 +291,18 @@ struct _E_View OBJ_PROPERTIES; }; +struct _E_Menu +{ + OBJ_PROPERTIES; + + Window win; +}; + +struct _E_Menu_Item +{ + OBJ_PROPERTIES; +}; + void e_action_add_proto(char *action, void (*func_start) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry), void (*func_stop) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry), diff --git a/src/menu.c b/src/menu.c new file mode 100644 index 0000000..fbdbc17 --- /dev/null +++ b/src/menu.c @@ -0,0 +1,113 @@ +#include "e.h" + +static Evas_List open_menus = NULL; +static Evas_list menus = NULL; + +static void e_idle(void *data); +static void e_key_down(Eevent * ev); +static void e_key_up(Eevent * ev); +static void e_mouse_down(Eevent * ev); +static void e_mouse_up(Eevent * ev); +static void e_mouse_in(Eevent * ev); +static void e_mouse_out(Eevent * ev); +static void e_window_expose(Eevent * ev); + +static void +e_idle(void *data) +{ + Evas_List l; + + for (l = menus; l; l = l->next) + { + E_Menu *m; + + m = l->data; + e_menu_update(m); + } + e_db_runtime_flush(); + return; + UN(data); +} + +static void +e_key_down(Eevent * ev) +{ + Ev_Key_Down *e; + + e = ev->event; + { + if (!strcmp(e->key, "Up")) + { + } + else if (!strcmp(e->key, "Down")) + { + } + else if (!strcmp(e->key, "Left")) + { + } + else if (!strcmp(e->key, "Right")) + { + } + else if (!strcmp(e->key, "Escape")) + { + } + else + { + } + } +} + +static void +e_key_up(Eevent * ev) +{ + Ev_Key_Up *e; + + e = ev->event; + { + } +} + +E_Menu * +e_menu_new(void) +{ +} + +void +e_menu_free(E_Menu *m) +{ +} + +void +e_menu_hide(E_Menu *m) +{ +} + +void +e_menu_show(E_Menu *m) +{ +} + +void +e_menu_move_to(E_Menu *m, int x, int y) +{ +} + +void +e_menu_show_at_mouse(E_Menu *m, int x, int y) +{ +} + +void +e_menu_add_item(E_Menu *m, E_Menu_Item *mi) +{ +} + +void +e_menu_del_item(E_Menu *m, E_Menu_Item *mi) +{ +} + +void +e_menu_update(E_Menu *m) +{ +} -- 2.7.4