forked from enlightenment/enlightenment
Add some functions to e_ilist and e_widget_ilist.c . Fix commented
unused variables (just removed them). Added Cursor Settings and Startup Settings dialogue. Removed General Settings dialog. SVN revision: 20020
This commit is contained in:
parent
02bfb82b01
commit
36aa7e2d70
|
@ -65,11 +65,12 @@ e_configure_show(E_Container *con)
|
||||||
e_configure_standard_item_add(eco, "enlightenment/desktops", _("Background Settings"), e_int_config_background);
|
e_configure_standard_item_add(eco, "enlightenment/desktops", _("Background Settings"), e_int_config_background);
|
||||||
e_configure_standard_item_add(eco, "enlightenment/themes", _("Theme Selector"), e_int_config_theme);
|
e_configure_standard_item_add(eco, "enlightenment/themes", _("Theme Selector"), e_int_config_theme);
|
||||||
e_configure_standard_item_add(eco, "enlightenment/modules", _("Module Settings"), e_int_config_modules);
|
e_configure_standard_item_add(eco, "enlightenment/modules", _("Module Settings"), e_int_config_modules);
|
||||||
e_configure_standard_item_add(eco, "enlightenment/e", _("General Settings"), e_int_config_general);
|
e_configure_standard_item_add(eco, "enlightenment/mouse", _("Cursor Settings"), e_int_config_cursor);
|
||||||
e_configure_standard_item_add(eco, "enlightenment/desktops", _("Desktop Settings"), e_int_config_desks);
|
e_configure_standard_item_add(eco, "enlightenment/desktops", _("Desktop Settings"), e_int_config_desks);
|
||||||
e_configure_standard_item_add(eco, "enlightenment/e", _("Focus Settings"), e_int_config_focus);
|
e_configure_standard_item_add(eco, "enlightenment/e", _("Focus Settings"), e_int_config_focus);
|
||||||
e_configure_standard_item_add(eco, "enlightenment/favorites", _("Menu Settings"), e_int_config_menus);
|
e_configure_standard_item_add(eco, "enlightenment/favorites", _("Menu Settings"), e_int_config_menus);
|
||||||
e_configure_standard_item_add(eco, "enlightenment/configuration", _("Performance Settings"), e_int_config_performance);
|
e_configure_standard_item_add(eco, "enlightenment/configuration", _("Performance Settings"), e_int_config_performance);
|
||||||
|
e_configure_standard_item_add(eco, "enlightenment/run", _("Startup Settings"), e_int_config_startup);
|
||||||
e_configure_standard_item_add(eco, "enlightenment/windows", _("Window List Settings"), e_int_config_winlist);
|
e_configure_standard_item_add(eco, "enlightenment/windows", _("Window List Settings"), e_int_config_winlist);
|
||||||
e_configure_standard_item_add(eco, "enlightenment/windows", _("Window Display Settings"), e_int_config_window_display);
|
e_configure_standard_item_add(eco, "enlightenment/windows", _("Window Display Settings"), e_int_config_window_display);
|
||||||
e_configure_standard_item_add(eco, "enlightenment/windows", _("Window Manipulation Settings"), e_int_config_window_manipulation);
|
e_configure_standard_item_add(eco, "enlightenment/windows", _("Window Manipulation Settings"), e_int_config_window_manipulation);
|
||||||
|
|
|
@ -296,6 +296,21 @@ e_ilist_count(Evas_Object *obj)
|
||||||
return evas_list_count(sd->items);
|
return evas_list_count(sd->items);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
e_ilist_clear(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
INTERNAL_ENTRY;
|
||||||
|
while (sd->items)
|
||||||
|
{
|
||||||
|
E_Smart_Item *si;
|
||||||
|
|
||||||
|
si = sd->items->data;
|
||||||
|
sd->items = evas_list_remove_list(sd->items, sd->items);
|
||||||
|
if (si->icon_obj) evas_object_del(si->icon_obj);
|
||||||
|
evas_object_del(si->base_obj);
|
||||||
|
free(si);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* local subsystem functions */
|
/* local subsystem functions */
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -21,6 +21,7 @@ EAPI int e_ilist_selector_get (Evas_Object *obj);
|
||||||
EAPI void e_ilist_remove_num (Evas_Object *obj, int n);
|
EAPI void e_ilist_remove_num (Evas_Object *obj, int n);
|
||||||
EAPI void e_ilist_remove_label (Evas_Object *obj, char *label);
|
EAPI void e_ilist_remove_label (Evas_Object *obj, char *label);
|
||||||
EAPI int e_ilist_count (Evas_Object *obj);
|
EAPI int e_ilist_count (Evas_Object *obj);
|
||||||
|
EAPI void e_ilist_clear (Evas_Object *obj);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,165 +0,0 @@
|
||||||
#include "e.h"
|
|
||||||
|
|
||||||
static void *_create_data(E_Config_Dialog *cfd);
|
|
||||||
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
|
||||||
static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
|
||||||
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
|
||||||
static int _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
|
||||||
static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
|
||||||
|
|
||||||
struct _E_Config_Dialog_Data
|
|
||||||
{
|
|
||||||
int show_splash;
|
|
||||||
int use_e_cursor;
|
|
||||||
|
|
||||||
/* Advanced */
|
|
||||||
int cursor_size;
|
|
||||||
};
|
|
||||||
|
|
||||||
EAPI E_Config_Dialog *
|
|
||||||
e_int_config_general(E_Container *con)
|
|
||||||
{
|
|
||||||
E_Config_Dialog *cfd;
|
|
||||||
E_Config_Dialog_View *v;
|
|
||||||
|
|
||||||
v = E_NEW(E_Config_Dialog_View, 1);
|
|
||||||
|
|
||||||
v->create_cfdata = _create_data;
|
|
||||||
v->free_cfdata = _free_data;
|
|
||||||
v->basic.apply_cfdata = _basic_apply_data;
|
|
||||||
v->basic.create_widgets = _basic_create_widgets;
|
|
||||||
v->advanced.apply_cfdata = _advanced_apply_data;
|
|
||||||
v->advanced.create_widgets = _advanced_create_widgets;
|
|
||||||
|
|
||||||
cfd = e_config_dialog_new(con, _("General Settings"), NULL, 0, v, NULL);
|
|
||||||
return cfd;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_fill_data(E_Config_Dialog_Data *cfdata)
|
|
||||||
{
|
|
||||||
cfdata->show_splash = e_config->show_splash;
|
|
||||||
cfdata->use_e_cursor = e_config->use_e_cursor;
|
|
||||||
cfdata->cursor_size = e_config->cursor_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void *
|
|
||||||
_create_data(E_Config_Dialog *cfd)
|
|
||||||
{
|
|
||||||
E_Config_Dialog_Data *cfdata;
|
|
||||||
|
|
||||||
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
|
||||||
return cfdata;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|
||||||
{
|
|
||||||
free(cfdata);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|
||||||
{
|
|
||||||
int changed = 0;
|
|
||||||
|
|
||||||
if (e_config->use_e_cursor != cfdata->use_e_cursor) changed = 1;
|
|
||||||
|
|
||||||
e_border_button_bindings_ungrab_all();
|
|
||||||
e_config->show_splash = cfdata->show_splash;
|
|
||||||
e_config->use_e_cursor = cfdata->use_e_cursor;
|
|
||||||
e_border_button_bindings_grab_all();
|
|
||||||
e_config_save_queue();
|
|
||||||
|
|
||||||
if (changed)
|
|
||||||
{
|
|
||||||
Evas_List *l;
|
|
||||||
|
|
||||||
for (l = e_manager_list(); l; l = l->next)
|
|
||||||
{
|
|
||||||
E_Manager *man;
|
|
||||||
man = l->data;
|
|
||||||
if (man->pointer) e_object_del(E_OBJECT(man->pointer));
|
|
||||||
man->pointer = e_pointer_window_new(man->root);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Evas_Object *
|
|
||||||
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
|
||||||
{
|
|
||||||
Evas_Object *o, *of, *ob;
|
|
||||||
|
|
||||||
_fill_data(cfdata);
|
|
||||||
|
|
||||||
o = e_widget_list_add(evas, 0, 0);
|
|
||||||
|
|
||||||
of = e_widget_framelist_add(evas, _("General Settings"), 0);
|
|
||||||
ob = e_widget_check_add(evas, _("Show Splash Screen At Boot"), &(cfdata->show_splash));
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
|
||||||
|
|
||||||
of = e_widget_framelist_add(evas, _("Mouse Pointer Settings"), 0);
|
|
||||||
ob = e_widget_check_add(evas, _("Use E Mouse Pointer"), &(cfdata->use_e_cursor));
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
_advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|
||||||
{
|
|
||||||
int changed = 0;
|
|
||||||
|
|
||||||
if (e_config->use_e_cursor != cfdata->use_e_cursor) changed = 1;
|
|
||||||
if (e_config->cursor_size != cfdata->cursor_size) changed = 1;
|
|
||||||
|
|
||||||
e_border_button_bindings_ungrab_all();
|
|
||||||
e_config->show_splash = cfdata->show_splash;
|
|
||||||
e_config->use_e_cursor = cfdata->use_e_cursor;
|
|
||||||
if (cfdata->cursor_size <= 0) cfdata->cursor_size = 1;
|
|
||||||
e_config->cursor_size = cfdata->cursor_size;
|
|
||||||
|
|
||||||
e_border_button_bindings_grab_all();
|
|
||||||
e_config_save_queue();
|
|
||||||
if (changed)
|
|
||||||
{
|
|
||||||
Evas_List *l;
|
|
||||||
|
|
||||||
e_pointers_size_set(e_config->cursor_size);
|
|
||||||
for (l = e_manager_list(); l; l = l->next)
|
|
||||||
{
|
|
||||||
E_Manager *man;
|
|
||||||
man = l->data;
|
|
||||||
if (man->pointer) e_object_del(E_OBJECT(man->pointer));
|
|
||||||
man->pointer = e_pointer_window_new(man->root);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Evas_Object *
|
|
||||||
_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
|
||||||
{
|
|
||||||
Evas_Object *o, *ob, *of;
|
|
||||||
|
|
||||||
_fill_data(cfdata);
|
|
||||||
|
|
||||||
o = e_widget_list_add(evas, 0, 0);
|
|
||||||
of = e_widget_framelist_add(evas, _("General Settings"), 0);
|
|
||||||
ob = e_widget_check_add(evas, _("Show Splash Screen At Boot"), &(cfdata->show_splash));
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
|
||||||
|
|
||||||
of = e_widget_framelist_add(evas, _("Mouse Pointer Settings"), 0);
|
|
||||||
ob = e_widget_check_add(evas, _("Use E Mouse Pointer"), &(cfdata->use_e_cursor));
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
ob = e_widget_label_add(evas, _("Mouse Pointer Size"));
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f pixels"), 0, 1024, 1, 0, NULL, &(cfdata->cursor_size), 150);
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
|
||||||
return o;
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
#ifdef E_TYPEDEFS
|
|
||||||
#else
|
|
||||||
#ifndef E_INT_CONFIG_GENERAL_H
|
|
||||||
#define E_INT_CONFIG_GENERAL_H
|
|
||||||
|
|
||||||
EAPI E_Config_Dialog *e_int_config_general(E_Container *con);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif
|
|
|
@ -37,14 +37,12 @@ int _e_mzone_cb_height_reverse_sort(void *e1, void *e2); // not used yet
|
||||||
EAPI void
|
EAPI void
|
||||||
e_maximize_border_gadman_fit(E_Border *bd, int *x1, int *y1, int *x2, int *y2)
|
e_maximize_border_gadman_fit(E_Border *bd, int *x1, int *y1, int *x2, int *y2)
|
||||||
{
|
{
|
||||||
/* Unused variables int ii, jj; */
|
|
||||||
Evas_List *l, *ll;
|
Evas_List *l, *ll;
|
||||||
|
|
||||||
Evas_List *mzones = NULL;
|
Evas_List *mzones = NULL;
|
||||||
Evas_List *tmp_mzones = NULL;
|
Evas_List *tmp_mzones = NULL;
|
||||||
|
|
||||||
struct _m_zone *mzone = NULL;
|
struct _m_zone *mzone = NULL;
|
||||||
/* Unused variable: struct _m_zone *mzone_split; */
|
|
||||||
|
|
||||||
mzone = (struct _m_zone *)malloc(sizeof(struct _m_zone));
|
mzone = (struct _m_zone *)malloc(sizeof(struct _m_zone));
|
||||||
if (mzone == NULL)
|
if (mzone == NULL)
|
||||||
|
@ -136,7 +134,6 @@ e_maximize_border_gadman_fit(E_Border *bd, int *x1, int *y1, int *x2, int *y2)
|
||||||
else if (mzones != NULL && mzones->next != NULL)
|
else if (mzones != NULL && mzones->next != NULL)
|
||||||
{
|
{
|
||||||
Evas_List *wl = NULL;
|
Evas_List *wl = NULL;
|
||||||
/* Unused var *hl = NULL; */
|
|
||||||
|
|
||||||
/* The use of *_width_reverse_sort or *_height_reverse_sort depends
|
/* The use of *_width_reverse_sort or *_height_reverse_sort depends
|
||||||
* on the preferences of the user - what window he/she would like to
|
* on the preferences of the user - what window he/she would like to
|
||||||
|
@ -144,7 +141,6 @@ e_maximize_border_gadman_fit(E_Border *bd, int *x1, int *y1, int *x2, int *y2)
|
||||||
*/
|
*/
|
||||||
wl = evas_list_sort(mzones, evas_list_count(mzones), _e_mzone_cb_width_reverse_sort);
|
wl = evas_list_sort(mzones, evas_list_count(mzones), _e_mzone_cb_width_reverse_sort);
|
||||||
mzones = NULL;
|
mzones = NULL;
|
||||||
/* hl = evas_list_sort(mzones, -1, _e_mzone_cb_height_reverse_sort); */
|
|
||||||
|
|
||||||
mzone = wl->data;
|
mzone = wl->data;
|
||||||
/* mzone = hl->data; */
|
/* mzone = hl->data; */
|
||||||
|
|
|
@ -161,6 +161,29 @@ e_widget_ilist_count(Evas_Object *obj)
|
||||||
return e_ilist_count(wd->o_ilist);
|
return e_ilist_count(wd->o_ilist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
e_widget_ilist_clear(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
E_Widget_Data *wd;
|
||||||
|
int mw, mh, vw, vh, w, h;
|
||||||
|
|
||||||
|
wd = e_widget_data_get(obj);
|
||||||
|
e_ilist_clear(wd->o_ilist);
|
||||||
|
|
||||||
|
e_ilist_min_size_get(wd->o_ilist, &mw, &mh);
|
||||||
|
evas_object_resize(wd->o_ilist, mw, mh);
|
||||||
|
e_scrollframe_child_viewport_size_get(wd->o_scrollframe, &vw, &vh);
|
||||||
|
evas_object_geometry_get(wd->o_scrollframe, NULL, NULL, &w, &h);
|
||||||
|
if (mw > vw)
|
||||||
|
{
|
||||||
|
Evas_Coord wmw, wmh;
|
||||||
|
|
||||||
|
e_widget_min_size_get(obj, &wmw, &wmh);
|
||||||
|
e_widget_min_size_set(obj, mw + (w - vw), wmh);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_wid_del_hook(Evas_Object *obj)
|
_e_wid_del_hook(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,6 +16,7 @@ EAPI const char *e_widget_ilist_selected_label_get(Evas_Object *obj);
|
||||||
EAPI void e_widget_ilist_remove_num(Evas_Object *obj, int n);
|
EAPI void e_widget_ilist_remove_num(Evas_Object *obj, int n);
|
||||||
EAPI void e_widget_ilist_remove_label(Evas_Object *obj, char *label);
|
EAPI void e_widget_ilist_remove_label(Evas_Object *obj, char *label);
|
||||||
EAPI int e_widget_ilist_count(Evas_Object *obj);
|
EAPI int e_widget_ilist_count(Evas_Object *obj);
|
||||||
|
EAPI void e_widget_ilist_clear(Evas_Object *obj);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue