forked from enlightenment/enlightenment
parent
b8f17d258c
commit
7ea19245d7
1
TODO
1
TODO
|
@ -60,7 +60,6 @@ Some of the things (in very short form) that need to be done to E17...
|
||||||
real problems are where to find the icons for the .desktop files.
|
real problems are where to find the icons for the .desktop files.
|
||||||
* shelf config dialog needs to have basic modce be simple recipies like "on
|
* shelf config dialog needs to have basic modce be simple recipies like "on
|
||||||
desktop", "at the top" "panel" etc.
|
desktop", "at the top" "panel" etc.
|
||||||
* right click menu on gadgets needs to include gadcon and shelf menu
|
|
||||||
* middle mouse on gadgets as a quick move/resize thing?
|
* middle mouse on gadgets as a quick move/resize thing?
|
||||||
* on xrandr screen res change e moves and resizes windows to fit in the new
|
* on xrandr screen res change e moves and resizes windows to fit in the new
|
||||||
resolution. this is good and bad. if some other app temporarily changes
|
resolution. this is good and bad. if some other app temporarily changes
|
||||||
|
|
|
@ -490,6 +490,17 @@ e_gadcon_canvas_zone_geometry_get(E_Gadcon *gc, int *x, int *y, int *w, int *h)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
e_gadcon_util_menu_attach_func_set(E_Gadcon *gc,
|
||||||
|
void (*func) (void *data, E_Menu *menu),
|
||||||
|
void *data)
|
||||||
|
{
|
||||||
|
E_OBJECT_CHECK(gc);
|
||||||
|
E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
|
||||||
|
gc->menu_attach.func = func;
|
||||||
|
gc->menu_attach.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
EAPI E_Gadcon_Client *
|
EAPI E_Gadcon_Client *
|
||||||
e_gadcon_client_new(E_Gadcon *gc, const char *name, const char *id, const char *style, Evas_Object *base_obj)
|
e_gadcon_client_new(E_Gadcon *gc, const char *name, const char *id, const char *style, Evas_Object *base_obj)
|
||||||
{
|
{
|
||||||
|
@ -1001,14 +1012,6 @@ e_gadcon_client_util_menu_items_append(E_Gadcon_Client *gcc, E_Menu *menu, int f
|
||||||
if (gcc->resizable) e_menu_item_toggle_set(mi, 1);
|
if (gcc->resizable) e_menu_item_toggle_set(mi, 1);
|
||||||
e_menu_item_callback_set(mi, _e_gadcon_client_cb_menu_resizable, gcc);
|
e_menu_item_callback_set(mi, _e_gadcon_client_cb_menu_resizable, gcc);
|
||||||
|
|
||||||
mi = e_menu_item_new(menu);
|
|
||||||
if (gcc->o_control)
|
|
||||||
e_menu_item_label_set(mi, _("Stop editing"));
|
|
||||||
else
|
|
||||||
e_menu_item_label_set(mi, _("Begin editing"));
|
|
||||||
e_util_menu_item_edje_icon_set(mi, "enlightenment/edit");
|
|
||||||
e_menu_item_callback_set(mi, _e_gadcon_client_cb_menu_edit, gcc);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(menu);
|
mi = e_menu_item_new(menu);
|
||||||
e_menu_item_separator_set(mi, 1);
|
e_menu_item_separator_set(mi, 1);
|
||||||
|
|
||||||
|
@ -1016,6 +1019,14 @@ e_gadcon_client_util_menu_items_append(E_Gadcon_Client *gcc, E_Menu *menu, int f
|
||||||
e_menu_item_label_set(mi, _("Remove this gadget"));
|
e_menu_item_label_set(mi, _("Remove this gadget"));
|
||||||
e_util_menu_item_edje_icon_set(mi, "enlightenment/remove");
|
e_util_menu_item_edje_icon_set(mi, "enlightenment/remove");
|
||||||
e_menu_item_callback_set(mi, _e_gadcon_client_cb_menu_remove, gcc);
|
e_menu_item_callback_set(mi, _e_gadcon_client_cb_menu_remove, gcc);
|
||||||
|
|
||||||
|
if (gcc->gadcon->menu_attach.func)
|
||||||
|
{
|
||||||
|
mi = e_menu_item_new(menu);
|
||||||
|
e_menu_item_separator_set(mi, 1);
|
||||||
|
|
||||||
|
gcc->gadcon->menu_attach.func(gcc->gadcon->menu_attach.data, menu);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -70,6 +70,10 @@ struct _E_Gadcon
|
||||||
Evas_Object *(*func) (void *data, E_Gadcon_Client *gcc, const char *style);
|
Evas_Object *(*func) (void *data, E_Gadcon_Client *gcc, const char *style);
|
||||||
void *data;
|
void *data;
|
||||||
} frame_request;
|
} frame_request;
|
||||||
|
struct {
|
||||||
|
void (*func) (void *data, E_Menu *menu);
|
||||||
|
void *data;
|
||||||
|
} menu_attach;
|
||||||
|
|
||||||
E_Config_Dialog *config_dialog;
|
E_Config_Dialog *config_dialog;
|
||||||
unsigned char editing : 1;
|
unsigned char editing : 1;
|
||||||
|
@ -147,7 +151,8 @@ EAPI void e_gadcon_zone_set(E_Gadcon *gc, E_Zone *zone);
|
||||||
EAPI E_Zone *e_gadcon_zone_get(E_Gadcon *gc);
|
EAPI E_Zone *e_gadcon_zone_get(E_Gadcon *gc);
|
||||||
EAPI void e_gadcon_ecore_evas_set(E_Gadcon *gc, Ecore_Evas *ee);
|
EAPI void e_gadcon_ecore_evas_set(E_Gadcon *gc, Ecore_Evas *ee);
|
||||||
EAPI int e_gadcon_canvas_zone_geometry_get(E_Gadcon *gc, int *x, int *y, int *w, int *h);
|
EAPI int e_gadcon_canvas_zone_geometry_get(E_Gadcon *gc, int *x, int *y, int *w, int *h);
|
||||||
|
EAPI void e_gadcon_util_menu_attach_func_set(E_Gadcon *gc, void (*func) (void *data, E_Menu *menu), void *data);
|
||||||
|
|
||||||
EAPI E_Gadcon_Client *e_gadcon_client_new(E_Gadcon *gc, const char *name, const char *id, const char *style, Evas_Object *base_obj);
|
EAPI E_Gadcon_Client *e_gadcon_client_new(E_Gadcon *gc, const char *name, const char *id, const char *style, Evas_Object *base_obj);
|
||||||
EAPI void e_gadcon_client_edit_begin(E_Gadcon_Client *gcc);
|
EAPI void e_gadcon_client_edit_begin(E_Gadcon_Client *gcc);
|
||||||
EAPI void e_gadcon_client_edit_end(E_Gadcon_Client *gcc);
|
EAPI void e_gadcon_client_edit_end(E_Gadcon_Client *gcc);
|
||||||
|
|
|
@ -8,6 +8,13 @@ static const char *_e_shelf_orient_string_get(E_Shelf *es);
|
||||||
static void _e_shelf_gadcon_min_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h);
|
static void _e_shelf_gadcon_min_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h);
|
||||||
static void _e_shelf_gadcon_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h);
|
static void _e_shelf_gadcon_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h);
|
||||||
static Evas_Object *_e_shelf_gadcon_frame_request(void *data, E_Gadcon_Client *gcc, const char *style);
|
static Evas_Object *_e_shelf_gadcon_frame_request(void *data, E_Gadcon_Client *gcc, const char *style);
|
||||||
|
static void _e_shelf_cb_menu_config(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_shelf_cb_menu_edit(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_shelf_cb_menu_contents(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_shelf_cb_confirm_dialog_yes(void *data);
|
||||||
|
static void _e_shelf_cb_menu_delete(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_shelf_menu_append(E_Shelf *es, E_Menu *mn);
|
||||||
|
static void _e_shelf_cb_menu_items_append(void *data, E_Menu *mn);
|
||||||
static void _e_shelf_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info);
|
static void _e_shelf_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info);
|
||||||
static void _e_shelf_cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info);
|
static void _e_shelf_cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info);
|
||||||
static void _e_shelf_cb_mouse_in(void *data, Evas *evas, Evas_Object *obj, void *event_info);
|
static void _e_shelf_cb_mouse_in(void *data, Evas *evas, Evas_Object *obj, void *event_info);
|
||||||
|
@ -149,6 +156,9 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, i
|
||||||
edje_object_message_signal_process(es->o_base);
|
edje_object_message_signal_process(es->o_base);
|
||||||
e_gadcon_zone_set(es->gadcon, zone);
|
e_gadcon_zone_set(es->gadcon, zone);
|
||||||
e_gadcon_ecore_evas_set(es->gadcon, es->ee);
|
e_gadcon_ecore_evas_set(es->gadcon, es->ee);
|
||||||
|
e_gadcon_util_menu_attach_func_set(es->gadcon,
|
||||||
|
_e_shelf_cb_menu_items_append,
|
||||||
|
es);
|
||||||
|
|
||||||
shelves = evas_list_append(shelves, es);
|
shelves = evas_list_append(shelves, es);
|
||||||
return es;
|
return es;
|
||||||
|
@ -703,6 +713,44 @@ _e_shelf_gadcon_frame_request(void *data, E_Gadcon_Client *gcc, const char *styl
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_shelf_menu_append(E_Shelf *es, E_Menu *mn)
|
||||||
|
{
|
||||||
|
E_Menu_Item *mi;
|
||||||
|
|
||||||
|
mi = e_menu_item_new(mn);
|
||||||
|
e_menu_item_label_set(mi, _("Shelf Location and Appearance Settings"));
|
||||||
|
e_util_menu_item_edje_icon_set(mi, "enlightenment/config");
|
||||||
|
e_menu_item_callback_set(mi, _e_shelf_cb_menu_config, es);
|
||||||
|
|
||||||
|
mi = e_menu_item_new(mn);
|
||||||
|
if (es->gadcon->editing)
|
||||||
|
e_menu_item_label_set(mi, _("Stop Moving/Resizing Items"));
|
||||||
|
else
|
||||||
|
e_menu_item_label_set(mi, _("Begin Moving/Resizing Items"));
|
||||||
|
e_util_menu_item_edje_icon_set(mi, "enlightenment/edit");
|
||||||
|
e_menu_item_callback_set(mi, _e_shelf_cb_menu_edit, es);
|
||||||
|
|
||||||
|
mi = e_menu_item_new(mn);
|
||||||
|
e_menu_item_label_set(mi, _("Configure Shelf Contents"));
|
||||||
|
e_util_menu_item_edje_icon_set(mi, "enlightenment/config");
|
||||||
|
e_menu_item_callback_set(mi, _e_shelf_cb_menu_contents, es);
|
||||||
|
|
||||||
|
mi = e_menu_item_new(mn);
|
||||||
|
e_menu_item_label_set(mi, _("Delete this Shelf"));
|
||||||
|
e_util_menu_item_edje_icon_set(mi, "enlightenment/delete");
|
||||||
|
e_menu_item_callback_set(mi, _e_shelf_cb_menu_delete, es);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_shelf_cb_menu_items_append(void *data, E_Menu *mn)
|
||||||
|
{
|
||||||
|
E_Shelf *es;
|
||||||
|
|
||||||
|
es = data;
|
||||||
|
_e_shelf_menu_append(es, mn);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_shelf_cb_menu_config(void *data, E_Menu *m, E_Menu_Item *mi)
|
_e_shelf_cb_menu_config(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
{
|
{
|
||||||
|
@ -784,36 +832,14 @@ _e_shelf_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_inf
|
||||||
if (ev->button == 3)
|
if (ev->button == 3)
|
||||||
{
|
{
|
||||||
E_Menu *mn;
|
E_Menu *mn;
|
||||||
E_Menu_Item *mi;
|
|
||||||
int cx, cy, cw, ch;
|
int cx, cy, cw, ch;
|
||||||
|
|
||||||
mn = e_menu_new();
|
mn = e_menu_new();
|
||||||
e_menu_post_deactivate_callback_set(mn, _e_shelf_cb_menu_post, es);
|
e_menu_post_deactivate_callback_set(mn, _e_shelf_cb_menu_post, es);
|
||||||
es->menu = mn;
|
es->menu = mn;
|
||||||
|
|
||||||
|
_e_shelf_menu_append(es, mn);
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("Shelf Location and Appearance Settings"));
|
|
||||||
e_util_menu_item_edje_icon_set(mi, "enlightenment/config");
|
|
||||||
e_menu_item_callback_set(mi, _e_shelf_cb_menu_config, es);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
if (es->gadcon->editing)
|
|
||||||
e_menu_item_label_set(mi, _("Stop Moving/Resizing Items"));
|
|
||||||
else
|
|
||||||
e_menu_item_label_set(mi, _("Begin Moving/Resizing Items"));
|
|
||||||
e_util_menu_item_edje_icon_set(mi, "enlightenment/edit");
|
|
||||||
e_menu_item_callback_set(mi, _e_shelf_cb_menu_edit, es);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("Configure Shelf Contents"));
|
|
||||||
e_util_menu_item_edje_icon_set(mi, "enlightenment/config");
|
|
||||||
e_menu_item_callback_set(mi, _e_shelf_cb_menu_contents, es);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("Delete this Shelf"));
|
|
||||||
e_util_menu_item_edje_icon_set(mi, "enlightenment/delete");
|
|
||||||
e_menu_item_callback_set(mi, _e_shelf_cb_menu_delete, es);
|
|
||||||
|
|
||||||
e_gadcon_canvas_zone_geometry_get(es->gadcon, &cx, &cy, &cw, &ch);
|
e_gadcon_canvas_zone_geometry_get(es->gadcon, &cx, &cy, &cw, &ch);
|
||||||
e_menu_activate_mouse(mn,
|
e_menu_activate_mouse(mn,
|
||||||
e_util_zone_current_get(e_manager_current_get()),
|
e_util_zone_current_get(e_manager_current_get()),
|
||||||
|
|
Loading…
Reference in New Issue