forked from enlightenment/enlightenment
whitespace/formatting cleanups in shot module
This commit is contained in:
parent
fc7d300e62
commit
784813ad4d
|
@ -123,9 +123,9 @@ _key_down_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSE
|
||||||
Evas_Object *o = NULL;
|
Evas_Object *o = NULL;
|
||||||
|
|
||||||
if ((o_content) && (e_widget_focus_get(o_content)))
|
if ((o_content) && (e_widget_focus_get(o_content)))
|
||||||
o = e_widget_focused_object_get(o_content);
|
o = e_widget_focused_object_get(o_content);
|
||||||
else
|
else
|
||||||
o = e_widget_focused_object_get(o_box);
|
o = e_widget_focused_object_get(o_box);
|
||||||
if (o) e_widget_activate(o);
|
if (o) e_widget_activate(o);
|
||||||
}
|
}
|
||||||
else if (!strcmp(ev->key, "Escape"))
|
else if (!strcmp(ev->key, "Escape"))
|
||||||
|
@ -151,11 +151,11 @@ _screen_change_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *even
|
||||||
EINA_LIST_FOREACH(scomp->zones, l, z)
|
EINA_LIST_FOREACH(scomp->zones, l, z)
|
||||||
{
|
{
|
||||||
if (screen == -1)
|
if (screen == -1)
|
||||||
evas_object_color_set(o_rectdim[z->num], 0, 0, 0, 0);
|
evas_object_color_set(o_rectdim[z->num], 0, 0, 0, 0);
|
||||||
else if (screen == (int)z->num)
|
else if (screen == (int)z->num)
|
||||||
evas_object_color_set(o_rectdim[z->num], 0, 0, 0, 0);
|
evas_object_color_set(o_rectdim[z->num], 0, 0, 0, 0);
|
||||||
else
|
else
|
||||||
evas_object_color_set(o_rectdim[z->num], 0, 0, 0, 200);
|
evas_object_color_set(o_rectdim[z->num], 0, 0, 0, 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,16 +165,16 @@ _save_to(const char *file)
|
||||||
char opts[256];
|
char opts[256];
|
||||||
|
|
||||||
if (eina_str_has_extension(file, ".png"))
|
if (eina_str_has_extension(file, ".png"))
|
||||||
snprintf(opts, sizeof(opts), "compress=%i", 9);
|
snprintf(opts, sizeof(opts), "compress=%i", 9);
|
||||||
else
|
else
|
||||||
snprintf(opts, sizeof(opts), "quality=%i", quality);
|
snprintf(opts, sizeof(opts), "quality=%i", quality);
|
||||||
if (screen == -1)
|
if (screen == -1)
|
||||||
{
|
{
|
||||||
if (o_img)
|
if (o_img)
|
||||||
{
|
{
|
||||||
if (!evas_object_image_save(o_img, file, NULL, opts))
|
if (!evas_object_image_save(o_img, file, NULL, opts))
|
||||||
e_util_dialog_show(_("Error saving screenshot file"),
|
e_util_dialog_show(_("Error saving screenshot file"),
|
||||||
_("Path: %s"), file);
|
_("Path: %s"), file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -211,8 +211,8 @@ _save_to(const char *file)
|
||||||
d += dstd;
|
d += dstd;
|
||||||
}
|
}
|
||||||
if (!evas_object_image_save(o, file, NULL, opts))
|
if (!evas_object_image_save(o, file, NULL, opts))
|
||||||
e_util_dialog_show(_("Error saving screenshot file"),
|
e_util_dialog_show(_("Error saving screenshot file"),
|
||||||
_("Path: %s"), file);
|
_("Path: %s"), file);
|
||||||
}
|
}
|
||||||
|
|
||||||
evas_object_del(o);
|
evas_object_del(o);
|
||||||
|
@ -230,11 +230,11 @@ _file_select_ok_cb(void *data __UNUSED__, E_Dialog *dia)
|
||||||
if ((!file) || (!file[0]) || ((!eina_str_has_extension(file, ".jpg")) && (!eina_str_has_extension(file, ".png"))))
|
if ((!file) || (!file[0]) || ((!eina_str_has_extension(file, ".jpg")) && (!eina_str_has_extension(file, ".png"))))
|
||||||
{
|
{
|
||||||
e_util_dialog_show
|
e_util_dialog_show
|
||||||
(_("Error - Unknown format"),
|
(_("Error - Unknown format"),
|
||||||
_("File has an unspecified extension.<br>"
|
_("File has an unspecified extension.<br>"
|
||||||
"Please use '.jpg' or '.png' extensions<br>"
|
"Please use '.jpg' or '.png' extensions<br>"
|
||||||
"only as other formats are not<br>"
|
"only as other formats are not<br>"
|
||||||
"supported currently."));
|
"supported currently."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_save_to(file);
|
_save_to(file);
|
||||||
|
@ -411,8 +411,8 @@ _upload_complete_cb(void *data, int ev_type __UNUSED__, void *event)
|
||||||
if (status != 200)
|
if (status != 200)
|
||||||
{
|
{
|
||||||
e_util_dialog_show(_("Error - Upload Failed"),
|
e_util_dialog_show(_("Error - Upload Failed"),
|
||||||
_("Upload failed with status code:<br>"
|
_("Upload failed with status code:<br>"
|
||||||
"%i"), status);
|
"%i"), status);
|
||||||
_share_done();
|
_share_done();
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -566,10 +566,10 @@ _win_share_confirm_cb(void *d EINA_UNUSED, void *d2 EINA_UNUSED)
|
||||||
{
|
{
|
||||||
if (cd) return;
|
if (cd) return;
|
||||||
cd = e_confirm_dialog_show(_("Confirm Share"), NULL,
|
cd = e_confirm_dialog_show(_("Confirm Share"), NULL,
|
||||||
_("This image will be uploaded<br>"
|
_("This image will be uploaded<br>"
|
||||||
"to enlightenment.org. It will be publicly visible."),
|
"to enlightenment.org. It will be publicly visible."),
|
||||||
_("Confirm"), _("Cancel"), _win_share_confirm_yes, NULL,
|
_("Confirm"), _("Cancel"), _win_share_confirm_yes, NULL,
|
||||||
NULL, NULL, _win_share_confirm_del, NULL);
|
NULL, NULL, _win_share_confirm_del, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -667,9 +667,9 @@ _shot_now(E_Zone *zone, E_Client *ec, const char *params)
|
||||||
if ((n > 0) && (max) && (max < (w * h * sizeof(int))))
|
if ((n > 0) && (max) && (max < (w * h * sizeof(int))))
|
||||||
{
|
{
|
||||||
e_util_dialog_show(_("Screenshot Error"),
|
e_util_dialog_show(_("Screenshot Error"),
|
||||||
_("SHMMAX is too small to take screenshot.<br>"
|
_("SHMMAX is too small to take screenshot.<br>"
|
||||||
"Consider increasing /proc/sys/kernel/shmmax to a value larger than %llu"),
|
"Consider increasing /proc/sys/kernel/shmmax to a value larger than %llu"),
|
||||||
(long long unsigned int)(w * h * sizeof(int)));
|
(long long unsigned int)(w * h * sizeof(int)));
|
||||||
dialog = EINA_TRUE;
|
dialog = EINA_TRUE;
|
||||||
}
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
@ -683,9 +683,9 @@ _shot_now(E_Zone *zone, E_Client *ec, const char *params)
|
||||||
if (max && (max < (w * h * sizeof(int))))
|
if (max && (max < (w * h * sizeof(int))))
|
||||||
{
|
{
|
||||||
e_util_dialog_show(_("Screenshot Error"),
|
e_util_dialog_show(_("Screenshot Error"),
|
||||||
_("SHMMAX is too small to take screenshot.<br>"
|
_("SHMMAX is too small to take screenshot.<br>"
|
||||||
"Consider increasing kern.ipc.shmmax to a value larger than %llu"),
|
"Consider increasing kern.ipc.shmmax to a value larger than %llu"),
|
||||||
(long long unsigned int)(w * h * sizeof(int)));
|
(long long unsigned int)(w * h * sizeof(int)));
|
||||||
dialog = EINA_TRUE;
|
dialog = EINA_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -955,10 +955,10 @@ _e_mod_action_border_cb(E_Object *obj __UNUSED__, const char *params __UNUSED__)
|
||||||
ec = e_client_focused_get();
|
ec = e_client_focused_get();
|
||||||
if (!ec) return;
|
if (!ec) return;
|
||||||
if (border_timer)
|
if (border_timer)
|
||||||
{
|
{
|
||||||
ecore_timer_del(border_timer);
|
ecore_timer_del(border_timer);
|
||||||
border_timer = NULL;
|
border_timer = NULL;
|
||||||
}
|
}
|
||||||
_shot_now(NULL, ec, NULL);
|
_shot_now(NULL, ec, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -970,13 +970,13 @@ _e_mod_action_cb(E_Object *obj, const char *params)
|
||||||
if (obj)
|
if (obj)
|
||||||
{
|
{
|
||||||
if (obj->type == E_MANAGER_TYPE)
|
if (obj->type == E_MANAGER_TYPE)
|
||||||
zone = e_util_zone_current_get((E_Manager *)obj);
|
zone = e_util_zone_current_get((E_Manager *)obj);
|
||||||
else if (obj->type == E_COMP_TYPE)
|
else if (obj->type == E_COMP_TYPE)
|
||||||
zone = e_zone_current_get((E_Comp *)obj);
|
zone = e_zone_current_get((E_Comp *)obj);
|
||||||
else if (obj->type == E_ZONE_TYPE)
|
else if (obj->type == E_ZONE_TYPE)
|
||||||
zone = ((E_Zone *)obj);
|
zone = ((E_Zone *)obj);
|
||||||
else
|
else
|
||||||
zone = e_util_zone_current_get(e_manager_current_get());
|
zone = e_util_zone_current_get(e_manager_current_get());
|
||||||
}
|
}
|
||||||
if (!zone) zone = e_util_zone_current_get(e_manager_current_get());
|
if (!zone) zone = e_util_zone_current_get(e_manager_current_get());
|
||||||
if (!zone) return;
|
if (!zone) return;
|
||||||
|
@ -1056,7 +1056,7 @@ e_modapi_init(E_Module *m)
|
||||||
"syntax: [share|save] [perfect|high|medium|low|QUALITY] all", 1);
|
"syntax: [share|save] [perfect|high|medium|low|QUALITY] all", 1);
|
||||||
}
|
}
|
||||||
maug = e_int_menus_menu_augmentation_add_sorted
|
maug = e_int_menus_menu_augmentation_add_sorted
|
||||||
("main/2", _("Take Screenshot"), _e_mod_menu_add, NULL, NULL, NULL);
|
("main/2", _("Take Screenshot"), _e_mod_menu_add, NULL, NULL, NULL);
|
||||||
border_hook = e_int_client_menu_hook_add(_bd_hook, NULL);
|
border_hook = e_int_client_menu_hook_add(_bd_hook, NULL);
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue