forked from enlightenment/efl
parent
23d121c6e7
commit
27a1fc9a9c
|
@ -69,14 +69,6 @@ _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
|
|||
_sizing_eval(data);
|
||||
}
|
||||
|
||||
static void
|
||||
_hover_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(data);
|
||||
if (!wd) return;
|
||||
wd->hover = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_hover_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
|
|
|
@ -342,7 +342,7 @@ static void _item_unrealize(Elm_Genlist_Item *it);
|
|||
static void _item_block_unrealize(Item_Block *itb);
|
||||
static void _calc_job(void *data);
|
||||
|
||||
static Evas_Smart_Class _pan_sc = {NULL};
|
||||
static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_VERSION;
|
||||
|
||||
static void
|
||||
_del_hook(Evas_Object *obj)
|
||||
|
|
|
@ -511,7 +511,6 @@ _fix_items(Evas_Object *obj)
|
|||
|
||||
EINA_LIST_FOREACH(wd->items, l, it)
|
||||
{
|
||||
Evas_Coord mw, mh;
|
||||
if (it->deleted) continue;
|
||||
if (it->icon)
|
||||
{
|
||||
|
@ -794,7 +793,7 @@ elm_list_clear(Evas_Object *obj)
|
|||
if (wd->walking > 0)
|
||||
{
|
||||
Eina_List *n;
|
||||
Elm_List_Item *it;
|
||||
|
||||
EINA_LIST_FOREACH(wd->items, n, it)
|
||||
{
|
||||
if (it->deleted) continue;
|
||||
|
|
|
@ -464,6 +464,119 @@ _elm_unneed_efreet(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
_config_init(void)
|
||||
{
|
||||
Eet_Data_Descriptor_Class eddc;
|
||||
Eet_Data_Descriptor *edd = NULL;
|
||||
Eet_File *ef = NULL;
|
||||
int len = 0;
|
||||
char buf[PATH_MAX], *p, *s;
|
||||
const char *home = NULL;
|
||||
char *profile = strdup("default");
|
||||
|
||||
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Elm_Config);
|
||||
|
||||
eddc.func.str_direct_alloc = NULL;
|
||||
eddc.func.str_direct_free = NULL;
|
||||
|
||||
edd = eet_data_descriptor_file_new(&eddc);
|
||||
if (edd)
|
||||
{
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "engine", engine, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "thumbscroll_enable", thumbscroll_enable, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "thumbscroll_threshhold", thumbscroll_threshhold, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "thumbscroll_momentum_threshhold", thumbscroll_momentum_threshhold, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "thumbscroll_friction", thumbscroll_friction, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "thumbscroll_bounce_friction", thumbscroll_bounce_friction, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "page_scroll_friction", page_scroll_friction, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "bring_in_scroll_friction", bring_in_scroll_friction, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "zoom_friction", zoom_friction, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "thumbscroll_bounce_enable", thumbscroll_bounce_enable, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "scale", scale, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "bgpixmap", bgpixmap, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "compositing", compositing, EET_T_INT);
|
||||
// EET_DATA_DESCRIPTOR_ADD_LIST(edd, Elm_Config, "font_dirs", font_dirs, sub_edd);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "font_hinting", font_hinting, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "image_cache", image_cache, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "font_cache", font_cache, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "finger_size", finger_size, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "fps", fps, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "theme", theme, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "modules", modules, EET_T_STRING);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("EEEK! eet_data_descriptor_file_new() failed\n");
|
||||
}
|
||||
|
||||
home = getenv("HOME");
|
||||
if (!home) home = "/";
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/.elementary/config/profile.cfg", home);
|
||||
ef = eet_open(buf, EET_FILE_MODE_READ);
|
||||
if (ef)
|
||||
{
|
||||
p = eet_read(ef, "config", &len);
|
||||
if (p)
|
||||
{
|
||||
free(profile);
|
||||
profile = malloc(len + 1);
|
||||
memcpy(profile, p, len);
|
||||
profile[len] = 0;
|
||||
free(p);
|
||||
}
|
||||
eet_close(ef);
|
||||
if (!p) ef = NULL;
|
||||
}
|
||||
if (!ef)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/config/profile.cfg", _elm_data_dir);
|
||||
ef = eet_open(buf, EET_FILE_MODE_READ);
|
||||
if (ef)
|
||||
{
|
||||
p = eet_read(ef, "config", &len);
|
||||
if (p)
|
||||
{
|
||||
free(profile);
|
||||
profile = malloc(len + 1);
|
||||
memcpy(profile, p, len);
|
||||
profile[len] = 0;
|
||||
free(p);
|
||||
}
|
||||
eet_close(ef);
|
||||
}
|
||||
}
|
||||
|
||||
s = getenv("ELM_PROFILE");
|
||||
if (s)
|
||||
{
|
||||
free(profile);
|
||||
profile = strdup(s);
|
||||
}
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/.elementary/config/%s/base.cfg", home, profile);
|
||||
ef = eet_open(buf, EET_FILE_MODE_READ);
|
||||
if (ef)
|
||||
{
|
||||
_elm_config = eet_data_read(ef, edd, "config");
|
||||
eet_close(ef);
|
||||
}
|
||||
if (!_elm_config)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/config/%s/base.cfg", _elm_data_dir, profile);
|
||||
ef = eet_open(buf, EET_FILE_MODE_READ);
|
||||
if (ef)
|
||||
{
|
||||
_elm_config = eet_data_read(ef, edd, "config");
|
||||
eet_close(ef);
|
||||
}
|
||||
}
|
||||
|
||||
if (edd) eet_data_descriptor_free(edd);
|
||||
if (profile) free(profile);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_quicklaunch_init(int argc, char **argv)
|
||||
{
|
||||
|
@ -565,119 +678,8 @@ elm_quicklaunch_init(int argc, char **argv)
|
|||
if (!_elm_lib_dir)
|
||||
_elm_lib_dir = eina_stringshare_add("/");
|
||||
|
||||
|
||||
// yes - this should be a function. do it later
|
||||
{
|
||||
Eet_Data_Descriptor_Class eddc;
|
||||
Eet_Data_Descriptor *edd = NULL;
|
||||
Eet_File *ef = NULL;
|
||||
int len = 0;
|
||||
char buf[PATH_MAX], *p;
|
||||
const char *home = NULL;
|
||||
char *profile = strdup("default");
|
||||
|
||||
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Elm_Config);
|
||||
|
||||
eddc.func.str_direct_alloc = NULL;
|
||||
eddc.func.str_direct_free = NULL;
|
||||
|
||||
edd = eet_data_descriptor_file_new(&eddc);
|
||||
if (edd)
|
||||
{
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "engine", engine, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "thumbscroll_enable", thumbscroll_enable, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "thumbscroll_threshhold", thumbscroll_threshhold, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "thumbscroll_momentum_threshhold", thumbscroll_momentum_threshhold, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "thumbscroll_friction", thumbscroll_friction, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "thumbscroll_bounce_friction", thumbscroll_bounce_friction, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "page_scroll_friction", page_scroll_friction, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "bring_in_scroll_friction", bring_in_scroll_friction, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "zoom_friction", zoom_friction, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "thumbscroll_bounce_enable", thumbscroll_bounce_enable, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "scale", scale, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "bgpixmap", bgpixmap, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "compositing", compositing, EET_T_INT);
|
||||
// EET_DATA_DESCRIPTOR_ADD_LIST(edd, Elm_Config, "font_dirs", font_dirs, sub_edd);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "font_hinting", font_hinting, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "image_cache", image_cache, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "font_cache", font_cache, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "finger_size", finger_size, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "fps", fps, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "theme", theme, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Elm_Config, "modules", modules, EET_T_STRING);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("EEEK! eet_data_descriptor_file_new() failed\n");
|
||||
}
|
||||
|
||||
home = getenv("HOME");
|
||||
if (!home) home = "/";
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/.elementary/config/profile.cfg", home);
|
||||
ef = eet_open(buf, EET_FILE_MODE_READ);
|
||||
if (ef)
|
||||
{
|
||||
p = eet_read(ef, "config", &len);
|
||||
if (p)
|
||||
{
|
||||
free(profile);
|
||||
profile = malloc(len + 1);
|
||||
memcpy(profile, p, len);
|
||||
profile[len] = 0;
|
||||
free(p);
|
||||
}
|
||||
eet_close(ef);
|
||||
if (!p) ef = NULL;
|
||||
}
|
||||
if (!ef)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/config/profile.cfg", _elm_data_dir);
|
||||
ef = eet_open(buf, EET_FILE_MODE_READ);
|
||||
if (ef)
|
||||
{
|
||||
p = eet_read(ef, "config", &len);
|
||||
if (p)
|
||||
{
|
||||
free(profile);
|
||||
profile = malloc(len + 1);
|
||||
memcpy(profile, p, len);
|
||||
profile[len] = 0;
|
||||
free(p);
|
||||
}
|
||||
eet_close(ef);
|
||||
}
|
||||
}
|
||||
|
||||
s = getenv("ELM_PROFILE");
|
||||
if (s)
|
||||
{
|
||||
free(profile);
|
||||
profile = strdup(s);
|
||||
}
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/.elementary/config/%s/base.cfg", home, profile);
|
||||
ef = eet_open(buf, EET_FILE_MODE_READ);
|
||||
if (ef)
|
||||
{
|
||||
_elm_config = eet_data_read(ef, edd, "config");
|
||||
eet_close(ef);
|
||||
}
|
||||
if (!_elm_config)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/config/%s/base.cfg", _elm_data_dir, profile);
|
||||
ef = eet_open(buf, EET_FILE_MODE_READ);
|
||||
if (ef)
|
||||
{
|
||||
_elm_config = eet_data_read(ef, edd, "config");
|
||||
eet_close(ef);
|
||||
}
|
||||
}
|
||||
|
||||
if (edd) eet_data_descriptor_free(edd);
|
||||
if (profile) free(profile);
|
||||
}
|
||||
|
||||
_config_init();
|
||||
|
||||
if (!_elm_config)
|
||||
{
|
||||
_elm_config = ELM_NEW(Elm_Config);
|
||||
|
@ -799,14 +801,14 @@ elm_quicklaunch_init(int argc, char **argv)
|
|||
if (s)
|
||||
{
|
||||
const char *p, *pp;
|
||||
char *buf;
|
||||
char *buf2;
|
||||
|
||||
EINA_LIST_FREE(_elm_config->font_dirs, p)
|
||||
{
|
||||
eina_stringshare_del(p);
|
||||
}
|
||||
|
||||
buf = alloca(strlen(s) + 1);
|
||||
buf2 = alloca(strlen(s) + 1);
|
||||
p = s;
|
||||
pp = p;
|
||||
for (;;)
|
||||
|
@ -816,11 +818,11 @@ elm_quicklaunch_init(int argc, char **argv)
|
|||
int len;
|
||||
|
||||
len = p - pp;
|
||||
strncpy(buf, pp, len);
|
||||
buf[len] = 0;
|
||||
strncpy(buf2, pp, len);
|
||||
buf2[len] = 0;
|
||||
_elm_config->font_dirs =
|
||||
eina_list_append(_elm_config->font_dirs,
|
||||
eina_stringshare_add(buf));
|
||||
eina_stringshare_add(buf2));
|
||||
if (*p == 0) break;
|
||||
p++;
|
||||
pp = p;
|
||||
|
@ -1230,9 +1232,9 @@ elm_quicklaunch_exe_path_get(const char *exe)
|
|||
if (!path)
|
||||
{
|
||||
const char *p, *pp;
|
||||
char *buf;
|
||||
char *buf2;
|
||||
path = getenv("PATH");
|
||||
buf = alloca(strlen(path) + 1);
|
||||
buf2 = alloca(strlen(path) + 1);
|
||||
p = path;
|
||||
pp = p;
|
||||
for (;;)
|
||||
|
@ -1242,9 +1244,9 @@ elm_quicklaunch_exe_path_get(const char *exe)
|
|||
int len;
|
||||
|
||||
len = p - pp;
|
||||
strncpy(buf, pp, len);
|
||||
buf[len] = 0;
|
||||
pathlist = eina_list_append(pathlist, eina_stringshare_add(buf));
|
||||
strncpy(buf2, pp, len);
|
||||
buf2[len] = 0;
|
||||
pathlist = eina_list_append(pathlist, eina_stringshare_add(buf2));
|
||||
if (*p == 0) break;
|
||||
p++;
|
||||
pp = p;
|
||||
|
|
|
@ -661,7 +661,7 @@ grid_load(Evas_Object *obj, Grid *g)
|
|||
|
||||
EINA_ITERATOR_FOREACH(it, cell)
|
||||
{
|
||||
Grid_Item *gi = eina_matrixsparse_cell_data_get(cell);
|
||||
gi = eina_matrixsparse_cell_data_get(cell);
|
||||
|
||||
xx = gi->out.x;
|
||||
yy = gi->out.y;
|
||||
|
@ -2291,7 +2291,7 @@ elm_map_marker_add(Evas_Object *obj, double lon, double lat, Elm_Map_Marker_Clas
|
|||
clas->priv.set = EINA_TRUE;
|
||||
}
|
||||
|
||||
for (i=clas_group->zoom_displayed; i<=ZOOM_MAX; i++)
|
||||
for (i = clas_group->zoom_displayed; i <= ZOOM_MAX; i++)
|
||||
{
|
||||
elm_map_utils_convert_geo_into_coord(lon, lat, pow(2.0, i)*wd->tsize,
|
||||
&(marker->x[i]), &(marker->y[i]));
|
||||
|
@ -2368,13 +2368,13 @@ elm_map_marker_add(Evas_Object *obj, double lon, double lat, Elm_Map_Marker_Clas
|
|||
|
||||
if (!group->cell)
|
||||
{
|
||||
Eina_List *l = eina_list_append(NULL, group);
|
||||
l = eina_list_append(NULL, group);
|
||||
eina_matrixsparse_data_idx_set(wd->markers[i], mpj, mpi, l);
|
||||
eina_matrixsparse_cell_idx_get(wd->markers[i], mpj, mpi, &(group->cell));
|
||||
}
|
||||
else
|
||||
{
|
||||
Eina_List *l = eina_matrixsparse_cell_data_get(group->cell);
|
||||
l = eina_matrixsparse_cell_data_get(group->cell);
|
||||
l = eina_list_append(l, group);
|
||||
eina_matrixsparse_cell_data_set(group->cell, l);
|
||||
}
|
||||
|
|
|
@ -143,24 +143,6 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_val_fetch(Evas_Object *obj)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
double posx = MIN_RATIO_LVL, posy = MIN_RATIO_LVL, pos = MIN_RATIO_LVL;
|
||||
if (!wd) return;
|
||||
edje_object_part_drag_value_get(wd->progressbar, "elm.cur.progressbar",
|
||||
&posx, &posy);
|
||||
if (wd->horizontal) pos = posx;
|
||||
else pos = posy;
|
||||
if (wd->inverted) pos = MAX_RATIO_LVL - pos;
|
||||
if (pos != wd->val)
|
||||
{
|
||||
wd->val = pos;
|
||||
evas_object_smart_callback_call(obj, "changed", NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_val_set(Evas_Object *obj)
|
||||
{
|
||||
|
|
|
@ -59,7 +59,6 @@ static void _sizing_eval(Evas_Object *obj);
|
|||
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _sub_del(void *data, Evas_Object *obj, void *event_info);
|
||||
static void _signal_radio_on(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||
static void _signal_radio_toggle(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||
|
||||
static void
|
||||
_del_hook(Evas_Object *obj)
|
||||
|
|
|
@ -399,8 +399,7 @@ elm_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scro
|
|||
ELM_SMART_SCROLLER_POLICY_OFF
|
||||
};
|
||||
if (!wd) return;
|
||||
if ((policy_h < 0) || (policy_h >= 3) || (policy_v < 0) || (policy_v >= 3))
|
||||
return;
|
||||
if ((policy_h >= 3) || (policy_v >= 3)) return;
|
||||
elm_smart_scroller_policy_set(wd->scr, map[policy_h], map[policy_v]);
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,6 @@ static void _sizing_eval(Evas_Object *obj);
|
|||
static void _resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _menu_move_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _menu_hide(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _menu_item_select(void *data, Evas_Object *obj, void *event_info);
|
||||
static void _layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data);
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue