formatting
This commit is contained in:
parent
0e1c8f9a0c
commit
8cc6a868f6
|
@ -37,18 +37,18 @@
|
|||
|
||||
#define CONFIG_KEY "config"
|
||||
|
||||
#define ENTICE_CONFIG_EDD_KEY_ADD(_s, _m, _t) \
|
||||
#define ENTICE_CONFIG_EDD_KEY_ADD(_s, _m, _t) \
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_keys, Entice_Config_Keys, _s, _m, _t)
|
||||
|
||||
#define ADD_KEYS(Name, Ctrl, Alt, Shift, Win, Cb) \
|
||||
kb = calloc(1, sizeof(Entice_Config_Keys)); \
|
||||
if (!kb) return; \
|
||||
kb->keyname = eina_stringshare_add_length(Name, strlen(Name)); \
|
||||
kb->ctrl = Ctrl; \
|
||||
kb->alt = Alt; \
|
||||
kb->shift = Shift; \
|
||||
kb->win = Win; \
|
||||
kb->cb = eina_stringshare_add_length(Cb, strlen(Cb)); \
|
||||
#define ADD_KEYS(Name, Ctrl, Alt, Shift, Win, Cb) \
|
||||
kb = calloc(1, sizeof(Entice_Config_Keys)); \
|
||||
if (!kb) return; \
|
||||
kb->keyname = eina_stringshare_add_length(Name, strlen(Name)); \
|
||||
kb->ctrl = Ctrl; \
|
||||
kb->alt = Alt; \
|
||||
kb->shift = Shift; \
|
||||
kb->win = Win; \
|
||||
kb->cb = eina_stringshare_add_length(Cb, strlen(Cb)); \
|
||||
config->keys = eina_list_append(config->keys, kb)
|
||||
|
||||
static Eet_Data_Descriptor *edd_base = NULL;
|
||||
|
@ -196,7 +196,7 @@ entice_config_del(Entice_Config *config)
|
|||
eina_stringshare_del(key->keyname);
|
||||
eina_stringshare_del(key->cb);
|
||||
free(key);
|
||||
}
|
||||
}
|
||||
|
||||
free(config);
|
||||
}
|
||||
|
@ -237,7 +237,7 @@ entice_config_theme_path_get(const Entice_Config *config)
|
|||
if (strchr(config->theme, '/'))
|
||||
return config->theme;
|
||||
|
||||
return _entice_config_theme_path_get(config->theme);
|
||||
return _entice_config_theme_path_get(config->theme);
|
||||
}
|
||||
|
||||
const char *
|
||||
|
@ -245,16 +245,16 @@ entice_config_theme_path_default_get(const Entice_Config *config)
|
|||
{
|
||||
static char path[PATH_MAX];
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(config, NULL);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(config->theme, NULL);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(config, NULL);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(config->theme, NULL);
|
||||
|
||||
*path = '\0';
|
||||
if (path[0]) return path;
|
||||
*path = '\0';
|
||||
if (path[0]) return path;
|
||||
|
||||
snprintf(path, sizeof(path), "%s/config/entice/themes/default.edj",
|
||||
elm_app_data_dir_get());
|
||||
snprintf(path, sizeof(path), "%s/config/entice/themes/default.edj",
|
||||
elm_app_data_dir_get());
|
||||
|
||||
return path;
|
||||
return path;
|
||||
}
|
||||
|
||||
/*============================================================================*
|
||||
|
|
|
@ -39,29 +39,29 @@
|
|||
* Local *
|
||||
*============================================================================*/
|
||||
|
||||
#define CONTROLS(_icon, _action) \
|
||||
o = elm_icon_add(win); \
|
||||
elm_icon_standard_set(o, _icon); \
|
||||
evas_object_show(o); \
|
||||
entice->_action = o; \
|
||||
\
|
||||
o = elm_button_add(win); \
|
||||
elm_object_content_set(o, entice->_action); \
|
||||
elm_object_focus_allow_set(o, EINA_FALSE); \
|
||||
elm_object_style_set(o, "overlay"); \
|
||||
evas_object_show(o); \
|
||||
elm_object_part_content_set(entice->layout, "entice." #_action, o); \
|
||||
\
|
||||
elm_layout_signal_callback_add(entice->layout, \
|
||||
"image,action," #_action, "entice", \
|
||||
_cb_image_##_action, win); \
|
||||
\
|
||||
elm_layout_signal_callback_add(entice->layout, \
|
||||
"image,startfade," #_action, "entice", \
|
||||
_cb_image_startfade, win); \
|
||||
\
|
||||
elm_layout_signal_callback_add(entice->layout, \
|
||||
"image,stopfade," #_action, "entice", \
|
||||
#define CONTROLS(_icon, _action) \
|
||||
o = elm_icon_add(win); \
|
||||
elm_icon_standard_set(o, _icon); \
|
||||
evas_object_show(o); \
|
||||
entice->_action = o; \
|
||||
\
|
||||
o = elm_button_add(win); \
|
||||
elm_object_content_set(o, entice->_action); \
|
||||
elm_object_focus_allow_set(o, EINA_FALSE); \
|
||||
elm_object_style_set(o, "overlay"); \
|
||||
evas_object_show(o); \
|
||||
elm_object_part_content_set(entice->layout, "entice." #_action, o); \
|
||||
\
|
||||
elm_layout_signal_callback_add(entice->layout, \
|
||||
"image,action," #_action, "entice", \
|
||||
_cb_image_##_action, win); \
|
||||
\
|
||||
elm_layout_signal_callback_add(entice->layout, \
|
||||
"image,startfade," #_action, "entice", \
|
||||
_cb_image_startfade, win); \
|
||||
\
|
||||
elm_layout_signal_callback_add(entice->layout, \
|
||||
"image,stopfade," #_action, "entice", \
|
||||
_cb_image_stopfade, win)
|
||||
|
||||
static void
|
||||
|
@ -207,7 +207,7 @@ _cb_image_zoomval(void *win, Evas_Object *obj, void *event_info EINA_UNUSED)
|
|||
{
|
||||
size_t j = l - 1 - i;
|
||||
if ((t2[j] < '0') || (t2[j] > '9'))
|
||||
goto free_t2;
|
||||
goto free_t2;
|
||||
|
||||
z += (t2[j] - '0') * p;
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ _cb_image_fullscreen(void *win, Evas_Object *obj EINA_UNUSED, const char *emissi
|
|||
static void
|
||||
_cb_image_ctxpopup_dismissed(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
evas_object_del(obj);
|
||||
evas_object_del(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -490,7 +490,7 @@ entice_controls_timer_start(Evas_Object *win)
|
|||
|
||||
if ((!entice->controls_timer) && (!entice->controls_over))
|
||||
entice->controls_timer = ecore_timer_add(entice->config->duration_controls,
|
||||
_cb_controls_hide, win);
|
||||
_cb_controls_hide, win);
|
||||
|
||||
/* display controls */
|
||||
if (eina_list_prev(entice->image_current))
|
||||
|
|
|
@ -72,8 +72,8 @@ static Entice_Exif_Entry entice_exif_gps_entries[] =
|
|||
|
||||
static void
|
||||
_cb_op_exif_close(void *win,
|
||||
Evas_Object *obj,
|
||||
void *_event EINA_UNUSED)
|
||||
Evas_Object *obj,
|
||||
void *_event EINA_UNUSED)
|
||||
{
|
||||
Entice *entice;
|
||||
|
||||
|
@ -245,8 +245,8 @@ entice_exif_fill(Evas_Object *win)
|
|||
ed = exif_data_new_from_file(eina_list_data_get(entice->image_current));
|
||||
if (!ed)
|
||||
{
|
||||
printf("can not get exif data from %s\n",
|
||||
(char *)eina_list_data_get(entice->image_current));
|
||||
printf("can not get exif data from %s\n",
|
||||
(char *)eina_list_data_get(entice->image_current));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -261,19 +261,19 @@ _dir_parse(Eina_List *list, const char *path)
|
|||
static char *
|
||||
_path_uri_decode(const char *arg)
|
||||
{
|
||||
char *path = NULL;
|
||||
char *path = NULL;
|
||||
|
||||
if (!strncasecmp(arg, "file://", strlen("file://")))
|
||||
{
|
||||
if (!strncasecmp(arg, "file://", strlen("file://")))
|
||||
{
|
||||
Efreet_Uri *uri = efreet_uri_decode(arg);
|
||||
if (uri)
|
||||
{
|
||||
path = strdup(uri->path);
|
||||
efreet_uri_free(uri);
|
||||
}
|
||||
}
|
||||
else path = strdup(arg);
|
||||
return path;
|
||||
{
|
||||
path = strdup(uri->path);
|
||||
efreet_uri_free(uri);
|
||||
}
|
||||
}
|
||||
else path = strdup(arg);
|
||||
return path;
|
||||
}
|
||||
|
||||
EAPI_MAIN int
|
||||
|
@ -331,9 +331,9 @@ elm_main(int argc, char **argv)
|
|||
}
|
||||
else
|
||||
{
|
||||
// only 1 file passed, so scan dir as list and jump to file in that dir
|
||||
if (args == (argc - 1))
|
||||
{
|
||||
// only 1 file passed, so scan dir as list and jump to file in that dir
|
||||
if (args == (argc - 1))
|
||||
{
|
||||
char *dir = NULL, *path;
|
||||
Eina_List *l;
|
||||
const char *s;
|
||||
|
@ -343,30 +343,30 @@ elm_main(int argc, char **argv)
|
|||
else dir = ecore_file_dir_get(path);
|
||||
list = _dir_parse(list, dir);
|
||||
EINA_LIST_FOREACH(list, l, s)
|
||||
{
|
||||
if (!strcmp(ecore_file_file_get(s),
|
||||
ecore_file_file_get(path)))
|
||||
{
|
||||
first = l;
|
||||
break;
|
||||
}
|
||||
}
|
||||
{
|
||||
if (!strcmp(ecore_file_file_get(s),
|
||||
ecore_file_file_get(path)))
|
||||
{
|
||||
first = l;
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(path);
|
||||
free(dir);
|
||||
}
|
||||
// multiple files passed - just append them in order as given
|
||||
else
|
||||
{
|
||||
}
|
||||
// multiple files passed - just append them in order as given
|
||||
else
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = args; i < argc; i++)
|
||||
{
|
||||
char *path = _path_uri_decode(argv[i]);
|
||||
list = _file_list_append(list, path);
|
||||
free(path);
|
||||
}
|
||||
}
|
||||
if (!first) first = list;
|
||||
{
|
||||
char *path = _path_uri_decode(argv[i]);
|
||||
list = _file_list_append(list, path);
|
||||
free(path);
|
||||
}
|
||||
}
|
||||
if (!first) first = list;
|
||||
}
|
||||
|
||||
/* FIXME key binding */
|
||||
|
@ -426,7 +426,7 @@ elm_main(int argc, char **argv)
|
|||
|
||||
return 0;
|
||||
|
||||
shutdown_config:
|
||||
shutdown_config:
|
||||
entice_config_shutdown();
|
||||
eina_log_domain_unregister(entice_app_log_dom_global);
|
||||
entice_app_log_dom_global = -1;
|
||||
|
|
|
@ -48,11 +48,11 @@ _entice_theme_reload_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *em
|
|||
const char *file;
|
||||
const char *group;
|
||||
|
||||
edje_object_file_get(obj, &file, &group);
|
||||
edje_object_file_set(obj, file, group);
|
||||
func = evas_object_data_get(obj, "theme_reload_func");
|
||||
func_data = evas_object_data_get(obj, "theme_reload_func_data");
|
||||
if (func) func(func_data);
|
||||
edje_object_file_get(obj, &file, &group);
|
||||
edje_object_file_set(obj, file, group);
|
||||
func = evas_object_data_get(obj, "theme_reload_func");
|
||||
func_data = evas_object_data_get(obj, "theme_reload_func_data");
|
||||
if (func) func(func_data);
|
||||
}
|
||||
|
||||
static char *
|
||||
|
|
|
@ -87,9 +87,9 @@ _cb_win_del(void *data EINA_UNUSED,
|
|||
|
||||
static void
|
||||
_cb_win_resize(void *data EINA_UNUSED,
|
||||
Evas *_e EINA_UNUSED,
|
||||
Evas_Object *win,
|
||||
void *_event EINA_UNUSED)
|
||||
Evas *_e EINA_UNUSED,
|
||||
Evas_Object *win,
|
||||
void *_event EINA_UNUSED)
|
||||
{
|
||||
Entice *entice;
|
||||
|
||||
|
@ -120,7 +120,7 @@ _cb_unfullscreen(void *data EINA_UNUSED, Evas_Object *win, void *event EINA_UNUS
|
|||
{
|
||||
elm_layout_signal_emit(entice->layout, "state,win,normal", "entice");
|
||||
elm_win_noblank_set(win, EINA_FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue