2019-12-18 11:01:40 -08:00
|
|
|
#include "e_mod_main.h"
|
|
|
|
|
shot tmp.
shot - add shot editor with arbitrary cropping and drawing tools
We don't need padded vs other shot of window now as u can remove the
padding with a single click in the editor now, so remove that (comment
it out).
The editor allows you to click on each screen, on a window (and click
again on a window to remove the padding area for the crop so its
snugly around the window).
You can zoom in and out and scroll around.
You can add lines with an arrow, double-arrowed lines, plain lines
with no arrows, some clipart (e-logo, mallocs, pointing finger... just
having some fun) and some fun "text boxes" like though bubbles,
speecvh bubbles, just plain text with a darking outline, a plain
entry-styled text box and you can select the colors for the text and
background area as well.
It's inksape-like in that the items you draw are objects that can then
be modified or deleted. modifying them raises them and places some
controls on/over/around the object.
And you can still save and share the results.
Fun times!
@feat
2019-12-28 14:02:39 -08:00
|
|
|
static Evas_Object *o_img = NULL;
|
2020-01-03 14:03:57 -08:00
|
|
|
|
|
|
|
Evas_Object *win = NULL;
|
shot tmp.
shot - add shot editor with arbitrary cropping and drawing tools
We don't need padded vs other shot of window now as u can remove the
padding with a single click in the editor now, so remove that (comment
it out).
The editor allows you to click on each screen, on a window (and click
again on a window to remove the padding area for the crop so its
snugly around the window).
You can zoom in and out and scroll around.
You can add lines with an arrow, double-arrowed lines, plain lines
with no arrows, some clipart (e-logo, mallocs, pointing finger... just
having some fun) and some fun "text boxes" like though bubbles,
speecvh bubbles, just plain text with a darking outline, a plain
entry-styled text box and you can select the colors for the text and
background area as well.
It's inksape-like in that the items you draw are objects that can then
be modified or deleted. modifying them raises them and places some
controls on/over/around the object.
And you can still save and share the results.
Fun times!
@feat
2019-12-28 14:02:39 -08:00
|
|
|
int quality = 90;
|
|
|
|
Eina_Rectangle crop = { 0, 0, 0, 0 };
|
2019-12-18 11:01:40 -08:00
|
|
|
|
|
|
|
static void
|
|
|
|
_win_save_cb(void *data EINA_UNUSED, void *data2 EINA_UNUSED)
|
|
|
|
{
|
2020-09-05 07:51:47 -07:00
|
|
|
save_show(EINA_FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_win_copy_cb(void *data EINA_UNUSED, void *data2 EINA_UNUSED)
|
|
|
|
{
|
|
|
|
save_show(EINA_TRUE);
|
2019-12-18 11:01:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_win_share_cb(void *d EINA_UNUSED, void *d2 EINA_UNUSED)
|
|
|
|
{
|
|
|
|
share_confirm();
|
|
|
|
}
|
|
|
|
|
2020-01-03 14:03:57 -08:00
|
|
|
static void
|
|
|
|
_win_delay_cb(void *d EINA_UNUSED, void *d2 EINA_UNUSED)
|
|
|
|
{
|
|
|
|
E_FREE_FUNC(win, evas_object_del);
|
|
|
|
win_delay();
|
|
|
|
}
|
|
|
|
|
2019-12-18 11:01:40 -08:00
|
|
|
static void
|
|
|
|
_win_cancel_cb(void *data EINA_UNUSED, void *data2 EINA_UNUSED)
|
|
|
|
{
|
|
|
|
E_FREE_FUNC(win, evas_object_del);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_win_delete_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
|
|
|
|
{
|
|
|
|
win = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
shot tmp.
shot - add shot editor with arbitrary cropping and drawing tools
We don't need padded vs other shot of window now as u can remove the
padding with a single click in the editor now, so remove that (comment
it out).
The editor allows you to click on each screen, on a window (and click
again on a window to remove the padding area for the crop so its
snugly around the window).
You can zoom in and out and scroll around.
You can add lines with an arrow, double-arrowed lines, plain lines
with no arrows, some clipart (e-logo, mallocs, pointing finger... just
having some fun) and some fun "text boxes" like though bubbles,
speecvh bubbles, just plain text with a darking outline, a plain
entry-styled text box and you can select the colors for the text and
background area as well.
It's inksape-like in that the items you draw are objects that can then
be modified or deleted. modifying them raises them and places some
controls on/over/around the object.
And you can still save and share the results.
Fun times!
@feat
2019-12-28 14:02:39 -08:00
|
|
|
_quality_change_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
2019-12-18 11:01:40 -08:00
|
|
|
{
|
shot tmp.
shot - add shot editor with arbitrary cropping and drawing tools
We don't need padded vs other shot of window now as u can remove the
padding with a single click in the editor now, so remove that (comment
it out).
The editor allows you to click on each screen, on a window (and click
again on a window to remove the padding area for the crop so its
snugly around the window).
You can zoom in and out and scroll around.
You can add lines with an arrow, double-arrowed lines, plain lines
with no arrows, some clipart (e-logo, mallocs, pointing finger... just
having some fun) and some fun "text boxes" like though bubbles,
speecvh bubbles, just plain text with a darking outline, a plain
entry-styled text box and you can select the colors for the text and
background area as well.
It's inksape-like in that the items you draw are objects that can then
be modified or deleted. modifying them raises them and places some
controls on/over/around the object.
And you can still save and share the results.
Fun times!
@feat
2019-12-28 14:02:39 -08:00
|
|
|
quality = elm_slider_value_get(obj);
|
2019-12-18 11:01:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
preview_dialog_show(E_Zone *zone, E_Client *ec, const char *params, void *dst,
|
shot tmp.
shot - add shot editor with arbitrary cropping and drawing tools
We don't need padded vs other shot of window now as u can remove the
padding with a single click in the editor now, so remove that (comment
it out).
The editor allows you to click on each screen, on a window (and click
again on a window to remove the padding area for the crop so its
snugly around the window).
You can zoom in and out and scroll around.
You can add lines with an arrow, double-arrowed lines, plain lines
with no arrows, some clipart (e-logo, mallocs, pointing finger... just
having some fun) and some fun "text boxes" like though bubbles,
speecvh bubbles, just plain text with a darking outline, a plain
entry-styled text box and you can select the colors for the text and
background area as well.
It's inksape-like in that the items you draw are objects that can then
be modified or deleted. modifying them raises them and places some
controls on/over/around the object.
And you can still save and share the results.
Fun times!
@feat
2019-12-28 14:02:39 -08:00
|
|
|
int sx, int sy, int sw, int sh)
|
2019-12-18 11:01:40 -08:00
|
|
|
{
|
shot tmp.
shot - add shot editor with arbitrary cropping and drawing tools
We don't need padded vs other shot of window now as u can remove the
padding with a single click in the editor now, so remove that (comment
it out).
The editor allows you to click on each screen, on a window (and click
again on a window to remove the padding area for the crop so its
snugly around the window).
You can zoom in and out and scroll around.
You can add lines with an arrow, double-arrowed lines, plain lines
with no arrows, some clipart (e-logo, mallocs, pointing finger... just
having some fun) and some fun "text boxes" like though bubbles,
speecvh bubbles, just plain text with a darking outline, a plain
entry-styled text box and you can select the colors for the text and
background area as well.
It's inksape-like in that the items you draw are objects that can then
be modified or deleted. modifying them raises them and places some
controls on/over/around the object.
And you can still save and share the results.
Fun times!
@feat
2019-12-28 14:02:39 -08:00
|
|
|
Evas *evas;
|
|
|
|
Evas_Object *o, *o_bg, *o_box, *o_sl;
|
|
|
|
Evas_Object *o_bx;
|
2019-12-18 11:01:40 -08:00
|
|
|
int w, h;
|
|
|
|
char smode[128], squal[128], sscreen[128];
|
|
|
|
|
2020-01-03 14:03:57 -08:00
|
|
|
win = o = elm_win_add(NULL, NULL, ELM_WIN_BASIC);
|
|
|
|
evas = evas_object_evas_get(o);
|
|
|
|
elm_win_title_set(o, _("Select action to take with screenshot"));
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_DEL, _win_delete_cb, NULL);
|
|
|
|
ecore_evas_name_class_set(e_win_ee_get(o), "E", "_shot_dialog");
|
2019-12-18 11:01:40 -08:00
|
|
|
|
2019-12-20 09:44:58 -08:00
|
|
|
o_bg = o = elm_layout_add(e_win_evas_win_get(evas));
|
|
|
|
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
2019-12-18 11:01:40 -08:00
|
|
|
elm_win_resize_object_add(win, o);
|
|
|
|
e_theme_edje_object_set(o, "base/theme/dialog", "e/widgets/dialog/main");
|
|
|
|
evas_object_show(o);
|
|
|
|
|
shot tmp.
shot - add shot editor with arbitrary cropping and drawing tools
We don't need padded vs other shot of window now as u can remove the
padding with a single click in the editor now, so remove that (comment
it out).
The editor allows you to click on each screen, on a window (and click
again on a window to remove the padding area for the crop so its
snugly around the window).
You can zoom in and out and scroll around.
You can add lines with an arrow, double-arrowed lines, plain lines
with no arrows, some clipart (e-logo, mallocs, pointing finger... just
having some fun) and some fun "text boxes" like though bubbles,
speecvh bubbles, just plain text with a darking outline, a plain
entry-styled text box and you can select the colors for the text and
background area as well.
It's inksape-like in that the items you draw are objects that can then
be modified or deleted. modifying them raises them and places some
controls on/over/around the object.
And you can still save and share the results.
Fun times!
@feat
2019-12-28 14:02:39 -08:00
|
|
|
o_bx = o = ui_edit(win, o_bg, zone, ec, dst, sx, sy, sw, sh, &o_img);
|
2019-12-18 11:01:40 -08:00
|
|
|
|
shot tmp.
shot - add shot editor with arbitrary cropping and drawing tools
We don't need padded vs other shot of window now as u can remove the
padding with a single click in the editor now, so remove that (comment
it out).
The editor allows you to click on each screen, on a window (and click
again on a window to remove the padding area for the crop so its
snugly around the window).
You can zoom in and out and scroll around.
You can add lines with an arrow, double-arrowed lines, plain lines
with no arrows, some clipart (e-logo, mallocs, pointing finger... just
having some fun) and some fun "text boxes" like though bubbles,
speecvh bubbles, just plain text with a darking outline, a plain
entry-styled text box and you can select the colors for the text and
background area as well.
It's inksape-like in that the items you draw are objects that can then
be modified or deleted. modifying them raises them and places some
controls on/over/around the object.
And you can still save and share the results.
Fun times!
@feat
2019-12-28 14:02:39 -08:00
|
|
|
o_sl = o = elm_slider_add(win);
|
|
|
|
elm_object_text_set(o, _("Quality"));
|
|
|
|
elm_slider_indicator_show_set(o, EINA_FALSE);
|
|
|
|
elm_slider_unit_format_set(o, "%1.0f%%");
|
|
|
|
elm_slider_min_max_set(o, 10, 100);
|
|
|
|
elm_slider_step_set(o, 5);
|
|
|
|
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 1.0);
|
|
|
|
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
elm_box_pack_end(o_bx, o);
|
2019-12-18 11:01:40 -08:00
|
|
|
evas_object_show(o);
|
shot tmp.
shot - add shot editor with arbitrary cropping and drawing tools
We don't need padded vs other shot of window now as u can remove the
padding with a single click in the editor now, so remove that (comment
it out).
The editor allows you to click on each screen, on a window (and click
again on a window to remove the padding area for the crop so its
snugly around the window).
You can zoom in and out and scroll around.
You can add lines with an arrow, double-arrowed lines, plain lines
with no arrows, some clipart (e-logo, mallocs, pointing finger... just
having some fun) and some fun "text boxes" like though bubbles,
speecvh bubbles, just plain text with a darking outline, a plain
entry-styled text box and you can select the colors for the text and
background area as well.
It's inksape-like in that the items you draw are objects that can then
be modified or deleted. modifying them raises them and places some
controls on/over/around the object.
And you can still save and share the results.
Fun times!
@feat
2019-12-28 14:02:39 -08:00
|
|
|
evas_object_smart_callback_add(o, "delay,changed", _quality_change_cb, NULL);
|
2019-12-18 11:01:40 -08:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
|
2019-12-20 09:44:58 -08:00
|
|
|
o_box = o = e_widget_list_add(evas, 1, 1);
|
2019-12-18 11:01:40 -08:00
|
|
|
elm_object_part_content_set(o_bg, "e.swallow.buttons", o);
|
|
|
|
|
|
|
|
o = e_widget_button_add(evas, _("Save"), NULL, _win_save_cb, win, NULL);
|
|
|
|
e_widget_list_object_append(o_box, o, 1, 0, 0.5);
|
|
|
|
o = e_widget_button_add(evas, _("Share"), NULL, _win_share_cb, win, NULL);
|
|
|
|
e_widget_list_object_append(o_box, o, 1, 0, 0.5);
|
2020-09-05 07:51:47 -07:00
|
|
|
o = e_widget_button_add(evas, _("Copy"), NULL, _win_copy_cb, win, NULL);
|
|
|
|
e_widget_list_object_append(o_box, o, 1, 0, 0.5);
|
2020-01-03 14:03:57 -08:00
|
|
|
if (!ec)
|
|
|
|
{
|
|
|
|
o = e_widget_button_add(evas, _("Delay"), NULL, _win_delay_cb, win, NULL);
|
|
|
|
e_widget_list_object_append(o_box, o, 1, 0, 0.5);
|
|
|
|
}
|
2019-12-18 11:01:40 -08:00
|
|
|
o = e_widget_button_add(evas, _("Cancel"), NULL, _win_cancel_cb, win, NULL);
|
|
|
|
e_widget_list_object_append(o_box, o, 1, 0, 0.5);
|
|
|
|
|
|
|
|
o = o_box;
|
|
|
|
e_widget_size_min_get(o, &w, &h);
|
|
|
|
evas_object_size_hint_min_set(o, w, h);
|
|
|
|
elm_object_part_content_set(o_bg, "e.swallow.buttons", o);
|
|
|
|
evas_object_size_hint_min_get(o_bg, &w, &h);
|
|
|
|
evas_object_resize(win, w, h);
|
|
|
|
evas_object_size_hint_min_set(win, w, h);
|
|
|
|
evas_object_size_hint_max_set(win, 99999, 99999);
|
|
|
|
|
shot tmp.
shot - add shot editor with arbitrary cropping and drawing tools
We don't need padded vs other shot of window now as u can remove the
padding with a single click in the editor now, so remove that (comment
it out).
The editor allows you to click on each screen, on a window (and click
again on a window to remove the padding area for the crop so its
snugly around the window).
You can zoom in and out and scroll around.
You can add lines with an arrow, double-arrowed lines, plain lines
with no arrows, some clipart (e-logo, mallocs, pointing finger... just
having some fun) and some fun "text boxes" like though bubbles,
speecvh bubbles, just plain text with a darking outline, a plain
entry-styled text box and you can select the colors for the text and
background area as well.
It's inksape-like in that the items you draw are objects that can then
be modified or deleted. modifying them raises them and places some
controls on/over/around the object.
And you can still save and share the results.
Fun times!
@feat
2019-12-28 14:02:39 -08:00
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
|
2020-04-25 16:34:38 -07:00
|
|
|
crop.x = crop.y = crop.w = crop.h = 0;
|
|
|
|
|
2019-12-18 11:01:40 -08:00
|
|
|
if ((params) &&
|
|
|
|
(sscanf(params, "%100s %100s %100s", smode, squal, sscreen) == 3))
|
|
|
|
{
|
shot tmp.
shot - add shot editor with arbitrary cropping and drawing tools
We don't need padded vs other shot of window now as u can remove the
padding with a single click in the editor now, so remove that (comment
it out).
The editor allows you to click on each screen, on a window (and click
again on a window to remove the padding area for the crop so its
snugly around the window).
You can zoom in and out and scroll around.
You can add lines with an arrow, double-arrowed lines, plain lines
with no arrows, some clipart (e-logo, mallocs, pointing finger... just
having some fun) and some fun "text boxes" like though bubbles,
speecvh bubbles, just plain text with a darking outline, a plain
entry-styled text box and you can select the colors for the text and
background area as well.
It's inksape-like in that the items you draw are objects that can then
be modified or deleted. modifying them raises them and places some
controls on/over/around the object.
And you can still save and share the results.
Fun times!
@feat
2019-12-28 14:02:39 -08:00
|
|
|
if ((zone) && (!strcmp(sscreen, "current")))
|
|
|
|
{
|
|
|
|
E_Zone *z = e_zone_current_get();
|
|
|
|
ui_edit_crop_screen_set(z->x, z->y, z->w, z->h);
|
|
|
|
}
|
|
|
|
else if (!strcmp(sscreen, "all"))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
E_Zone *z = eina_list_nth(e_comp->zones, atoi(sscreen));
|
|
|
|
if (z) ui_edit_crop_screen_set(z->x, z->y, z->w, z->h);
|
|
|
|
}
|
2019-12-18 11:01:40 -08:00
|
|
|
quality = 90;
|
|
|
|
if (!strcmp(squal, "perfect")) quality = 100;
|
|
|
|
else if (!strcmp(squal, "high")) quality = 90;
|
|
|
|
else if (!strcmp(squal, "medium")) quality = 70;
|
|
|
|
else if (!strcmp(squal, "low")) quality = 50;
|
|
|
|
else quality = atoi(squal);
|
|
|
|
|
shot tmp.
shot - add shot editor with arbitrary cropping and drawing tools
We don't need padded vs other shot of window now as u can remove the
padding with a single click in the editor now, so remove that (comment
it out).
The editor allows you to click on each screen, on a window (and click
again on a window to remove the padding area for the crop so its
snugly around the window).
You can zoom in and out and scroll around.
You can add lines with an arrow, double-arrowed lines, plain lines
with no arrows, some clipart (e-logo, mallocs, pointing finger... just
having some fun) and some fun "text boxes" like though bubbles,
speecvh bubbles, just plain text with a darking outline, a plain
entry-styled text box and you can select the colors for the text and
background area as well.
It's inksape-like in that the items you draw are objects that can then
be modified or deleted. modifying them raises them and places some
controls on/over/around the object.
And you can still save and share the results.
Fun times!
@feat
2019-12-28 14:02:39 -08:00
|
|
|
elm_slider_value_set(o_sl, quality);
|
2019-12-18 11:01:40 -08:00
|
|
|
if (!strcmp(smode, "save")) _win_save_cb(NULL, NULL);
|
2019-12-20 09:44:58 -08:00
|
|
|
else if (!strcmp(smode, "share")) _win_share_cb(NULL, NULL);
|
2019-12-18 11:01:40 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-06 05:37:41 -08:00
|
|
|
Evas_Coord maxw, maxh, minw, minh;
|
|
|
|
Evas_Object *sc_main, *sc_tool;
|
|
|
|
|
shot tmp.
shot - add shot editor with arbitrary cropping and drawing tools
We don't need padded vs other shot of window now as u can remove the
padding with a single click in the editor now, so remove that (comment
it out).
The editor allows you to click on each screen, on a window (and click
again on a window to remove the padding area for the crop so its
snugly around the window).
You can zoom in and out and scroll around.
You can add lines with an arrow, double-arrowed lines, plain lines
with no arrows, some clipart (e-logo, mallocs, pointing finger... just
having some fun) and some fun "text boxes" like though bubbles,
speecvh bubbles, just plain text with a darking outline, a plain
entry-styled text box and you can select the colors for the text and
background area as well.
It's inksape-like in that the items you draw are objects that can then
be modified or deleted. modifying them raises them and places some
controls on/over/around the object.
And you can still save and share the results.
Fun times!
@feat
2019-12-28 14:02:39 -08:00
|
|
|
elm_slider_value_set(o_sl, quality);
|
2021-12-06 05:37:41 -08:00
|
|
|
|
|
|
|
if (!zone) zone = e_zone_current_get();
|
|
|
|
maxw = (zone->w - (40 * 2 * e_scale)) * 0.9;
|
|
|
|
maxh = (zone->h - (40 * 2 * e_scale)) * 0.9;
|
|
|
|
|
|
|
|
sc_main = evas_object_data_get(win, "scroll/main");
|
|
|
|
sc_tool = evas_object_data_get(win, "scroll/tools");
|
|
|
|
elm_scroller_content_min_limit(sc_main, EINA_TRUE, EINA_TRUE);
|
|
|
|
elm_scroller_content_min_limit(sc_tool, EINA_TRUE, EINA_TRUE);
|
|
|
|
evas_smart_objects_calculate(evas_object_evas_get(win));
|
|
|
|
evas_object_size_hint_min_get(o_bg, &minw, &minh);
|
|
|
|
if (minw > maxw) minw = maxw;
|
|
|
|
if (minh > maxh) minh = maxh;
|
|
|
|
elm_scroller_content_min_limit(sc_main, EINA_FALSE, EINA_FALSE);
|
|
|
|
elm_scroller_content_min_limit(sc_tool, EINA_TRUE, EINA_FALSE);
|
|
|
|
evas_smart_objects_calculate(evas_object_evas_get(win));
|
|
|
|
evas_object_resize(win, minw, minh);
|
shot tmp.
shot - add shot editor with arbitrary cropping and drawing tools
We don't need padded vs other shot of window now as u can remove the
padding with a single click in the editor now, so remove that (comment
it out).
The editor allows you to click on each screen, on a window (and click
again on a window to remove the padding area for the crop so its
snugly around the window).
You can zoom in and out and scroll around.
You can add lines with an arrow, double-arrowed lines, plain lines
with no arrows, some clipart (e-logo, mallocs, pointing finger... just
having some fun) and some fun "text boxes" like though bubbles,
speecvh bubbles, just plain text with a darking outline, a plain
entry-styled text box and you can select the colors for the text and
background area as well.
It's inksape-like in that the items you draw are objects that can then
be modified or deleted. modifying them raises them and places some
controls on/over/around the object.
And you can still save and share the results.
Fun times!
@feat
2019-12-28 14:02:39 -08:00
|
|
|
elm_win_center(win, 1, 1);
|
2019-12-18 11:01:40 -08:00
|
|
|
evas_object_show(win);
|
|
|
|
e_win_client_icon_set(win, "screenshot");
|
|
|
|
if (!e_widget_focus_get(o_bg)) e_widget_focus_set(o_box, 1);
|
|
|
|
if (ec)
|
|
|
|
{
|
|
|
|
E_Client *c = e_win_client_get(win);
|
|
|
|
if (c) evas_object_layer_set(c->frame, ec->layer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Eina_Bool
|
|
|
|
preview_have(void)
|
|
|
|
{
|
|
|
|
if (win) return EINA_TRUE;
|
|
|
|
else return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
preview_abort(void)
|
|
|
|
{
|
|
|
|
E_FREE_FUNC(win, evas_object_del);
|
|
|
|
}
|
|
|
|
|
|
|
|
Evas_Object *
|
|
|
|
preview_image_get(void)
|
|
|
|
{
|
|
|
|
return o_img;
|
|
|
|
}
|