forked from enlightenment/enlightenment
add slider widget wrapper - NOT COMPLETe YET. DO NOT USE. i have just put it
there as a plceholder to work on over the next day or so. also i fixed the edit icon. it RELIED on e_utile_ap_edit to be installed. also it didnt produce a good template either etc. it can be better though... SVN revision: 18525
This commit is contained in:
parent
cd7cd2d870
commit
4698fd4656
|
@ -1,23 +1,10 @@
|
|||
images {
|
||||
image: "e17_ibar_bg_v.png" COMP;
|
||||
image: "e17_ibar_over_v.png" COMP;
|
||||
image: "e17_sb_btd1.png" COMP;
|
||||
image: "e17_sb_btd2.png" COMP;
|
||||
image: "e17_sb_btu1.png" COMP;
|
||||
image: "e17_sb_btu2.png" COMP;
|
||||
image: "e17_sb_btl1.png" COMP;
|
||||
image: "e17_sb_btl2.png" COMP;
|
||||
image: "e17_sb_btr1.png" COMP;
|
||||
image: "e17_sb_btr2.png" COMP;
|
||||
image: "e17_sb_btu1.png" COMP;
|
||||
image: "e17_sb_barh1.png" COMP;
|
||||
image: "e17_sb_barh2.png" COMP;
|
||||
image: "e17_sb_barv1.png" COMP;
|
||||
image: "e17_sb_barv2.png" COMP;
|
||||
image: "e17_sb_runnerh.png" COMP;
|
||||
image: "e17_sb_runnerv.png" COMP;
|
||||
image: "e17_scrollbar_hdrag_thumb.png" COMP;
|
||||
image: "e17_scrollbar_vdrag_thumb.png" COMP;
|
||||
image: "focus.png" COMP;
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,8 @@ e_ilist.h \
|
|||
e_livethumb.h \
|
||||
e_int_border_border.h \
|
||||
e_widget_ilist.h \
|
||||
e_slider.h
|
||||
e_slider.h \
|
||||
e_widget_slider.h
|
||||
|
||||
enlightenment_src = \
|
||||
e_user.c \
|
||||
|
@ -208,6 +209,7 @@ e_livethumb.c \
|
|||
e_int_border_border.c \
|
||||
e_widget_ilist.c \
|
||||
e_slider.c \
|
||||
e_widget_slider.c \
|
||||
$(ENLIGHTENMENTHEADERS)
|
||||
|
||||
enlightenment_SOURCES = \
|
||||
|
|
|
@ -94,3 +94,4 @@
|
|||
#include "e_int_border_border.h"
|
||||
#include "e_widget_ilist.h"
|
||||
#include "e_slider.h"
|
||||
#include "e_widget_slider.h"
|
||||
|
|
|
@ -196,50 +196,21 @@ e_int_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y, int key, Ecore_
|
|||
"widgets/border/default/skip_winlist");
|
||||
}
|
||||
|
||||
if (ecore_file_app_installed("e_util_eapp_edit"))
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_separator_set(mi, 1);
|
||||
|
||||
if (bd->app)
|
||||
{
|
||||
char *title = "";
|
||||
|
||||
if (bd->client.netwm.name) title = bd->client.netwm.name;
|
||||
else title = bd->client.icccm.title;
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_separator_set(mi, 1);
|
||||
if (bd->app)
|
||||
{
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, _("Edit Icon"));
|
||||
e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, bd->app->path);
|
||||
e_menu_item_icon_edje_set(mi, bd->app->path, "icon");
|
||||
}
|
||||
else if (bd->client.icccm.class) /* icons with no class useless to borders */
|
||||
{
|
||||
#if 0
|
||||
static char buf[PATH_MAX + 50];
|
||||
char *name, *homedir;
|
||||
int i, l;
|
||||
|
||||
buf[0] = '\0';
|
||||
/* generate a reasonable file name from the window class */
|
||||
/* FIXME - I think there could be duplicates - how better to do this? */
|
||||
name = strdup(bd->client.icccm.class);
|
||||
l = strlen(name);
|
||||
for (i = 0; i < l; i++)
|
||||
{
|
||||
if (name[i] == ' ') name[i] = '_';
|
||||
}
|
||||
/* previously this could be null, but it will exist now */
|
||||
homedir = e_user_homedir_get();
|
||||
|
||||
snprintf(buf, sizeof(buf),
|
||||
"--win-class \"%s\" %s/.e/e/applications/all/%s.eap",
|
||||
bd->client.icccm.class, homedir, name);
|
||||
free(homedir);
|
||||
free(name);
|
||||
#endif
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, _("Create Icon"));
|
||||
e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, strdup(bd->client.icccm.class));
|
||||
}
|
||||
e_menu_item_label_set(mi, _("Edit Icon"));
|
||||
e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, bd);
|
||||
e_menu_item_icon_edje_set(mi, bd->app->path, "icon");
|
||||
}
|
||||
else if (bd->client.icccm.class) /* icons with no class useless to borders */
|
||||
{
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, _("Create Icon"));
|
||||
e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, bd);
|
||||
}
|
||||
|
||||
mi = e_menu_item_new(m);
|
||||
|
@ -415,57 +386,48 @@ _e_border_menu_cb_shade(void *data, E_Menu *m, E_Menu_Item *mi)
|
|||
static void
|
||||
_e_border_menu_cb_icon_edit(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||
{
|
||||
E_App *a;
|
||||
|
||||
if(ecore_file_exists(data))
|
||||
E_App *a;
|
||||
E_Border *bd;
|
||||
|
||||
bd = data;
|
||||
a = bd->app;
|
||||
if (!a)
|
||||
{
|
||||
a = e_app_new(data, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
static char buf[PATH_MAX + 50];
|
||||
char *name, *homedir;
|
||||
int i, l;
|
||||
static char buf[PATH_MAX];
|
||||
char *name, *homedir, *p;
|
||||
int instance;
|
||||
|
||||
buf[0] = '\0';
|
||||
/* generate a reasonable file name from the window class */
|
||||
/* FIXME - I think there could be duplicates - how better to do this? */
|
||||
name = strdup(data);
|
||||
l = strlen(name);
|
||||
for (i = 0; i < l; i++)
|
||||
name = strdup(bd->client.icccm.class);
|
||||
p = name;
|
||||
while (*p)
|
||||
{
|
||||
if (name[i] == ' ') name[i] = '_';
|
||||
}
|
||||
/* previously this could be null, but it will exist now */
|
||||
if (*p == ' ') *p = '_';
|
||||
else if (*p == '/') *p = '_';
|
||||
else if (*p == '.') *p = '_';
|
||||
p++;
|
||||
}
|
||||
homedir = e_user_homedir_get();
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/.e/e/applications/all/%s.eap",
|
||||
homedir, name);
|
||||
snprintf(buf, sizeof(buf), "%s/.e/e/applications/all/%s.eap", homedir, name);
|
||||
instance = 0;
|
||||
while (ecore_file_exists(buf))
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/.e/e/applications/all/%s-%i.eap", homedir, name, instance);
|
||||
instance++;
|
||||
}
|
||||
free(homedir);
|
||||
free(name);
|
||||
a = e_app_empty_new(buf);
|
||||
a->win_class = strdup(data);
|
||||
free(data);
|
||||
if (a)
|
||||
{
|
||||
a->win_name = strdup(bd->client.icccm.name);
|
||||
a->win_class = strdup(bd->client.icccm.class);
|
||||
if (bd->client.icccm.window_role)
|
||||
a->win_role = strdup(bd->client.icccm.window_role);
|
||||
a->icon_class = strdup(bd->client.icccm.class);
|
||||
}
|
||||
}
|
||||
if (!a) return;
|
||||
e_eap_edit_show(m->zone->container, a);
|
||||
#if 0
|
||||
char *file;
|
||||
char *command;
|
||||
char *full;
|
||||
Ecore_Exe *process;
|
||||
|
||||
file = data;
|
||||
command = "e_util_eapp_edit ";
|
||||
full = malloc(strlen(file) + strlen(command) + 1);
|
||||
strcpy(full, command);
|
||||
strcat(full, file);
|
||||
process = ecore_exe_run(full, NULL);
|
||||
if (!process || !ecore_exe_pid_get(process))
|
||||
e_error_dialog_show(_("Icon Edit Error"),
|
||||
_("Error starting icon editor\n\n"
|
||||
"please install e_util_eapp_edit\n"
|
||||
"or make sure it is in your PATH\n"));
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
#include "e.h"
|
||||
|
||||
typedef struct _E_Widget_Data E_Widget_Data;
|
||||
struct _E_Widget_Data
|
||||
{
|
||||
Evas_Object *o_slider;
|
||||
};
|
||||
|
||||
static void _e_wid_del_hook(Evas_Object *obj);
|
||||
static void _e_wid_focus_hook(Evas_Object *obj);
|
||||
static void _e_wid_focus_steal(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
|
||||
/* externally accessible functions */
|
||||
Evas_Object *
|
||||
e_widget_slider_add(Evas *evas)
|
||||
{
|
||||
Evas_Object *obj, *o;
|
||||
E_Widget_Data *wd;
|
||||
Evas_Coord mw, mh;
|
||||
|
||||
obj = e_widget_add(evas);
|
||||
|
||||
e_widget_del_hook_set(obj, _e_wid_del_hook);
|
||||
e_widget_focus_hook_set(obj, _e_wid_focus_hook);
|
||||
wd = calloc(1, sizeof(E_Widget_Data));
|
||||
e_widget_data_set(obj, wd);
|
||||
|
||||
o = e_slider_add(evas);
|
||||
wd->o_slider = o;
|
||||
evas_object_show(o);
|
||||
e_widget_sub_object_add(obj, o);
|
||||
e_widget_resize_object_set(obj, o);
|
||||
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _e_wid_focus_steal, obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wid_del_hook(Evas_Object *obj)
|
||||
{
|
||||
E_Widget_Data *wd;
|
||||
|
||||
wd = e_widget_data_get(obj);
|
||||
free(wd);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wid_focus_hook(Evas_Object *obj)
|
||||
{
|
||||
E_Widget_Data *wd;
|
||||
|
||||
wd = e_widget_data_get(obj);
|
||||
if (e_widget_focus_get(obj))
|
||||
{
|
||||
// edje_object_signal_emit(e_scrollframe_edje_object_get(wd->o_scrollframe), "focus_in", "");
|
||||
evas_object_focus_set(wd->o_slider, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// edje_object_signal_emit(e_scrollframe_edje_object_get(wd->o_scrollframe), "focus_out", "");
|
||||
evas_object_focus_set(wd->o_slider, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wid_focus_steal(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
e_widget_focus_steal(data);
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
#ifdef E_TYPEDEFS
|
||||
#else
|
||||
#ifndef E_WIDGET_SLIDER_H
|
||||
#define E_WIDGET_SLIDER_H
|
||||
|
||||
EAPI Evas_Object *e_widget_slider_add(Evas *evas);
|
||||
|
||||
#endif
|
||||
#endif
|
Loading…
Reference in New Issue