Enlightenment CVS committal
Author : devilhorns
Project : e_modules
Module : screenshot
Dir : e_modules/screenshot
Modified Files:
screenshot.edc e_mod_main.c
Log Message:
Provide notification to the user when the shot will be taken
===================================================================
RCS file: /cvsroot/enlightenment/e_modules/screenshot/screenshot.edc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- screenshot.edc 16 Dec 2005 01:07:33 -0000 1.1
+++ screenshot.edc 23 Dec 2005 21:41:14 -0000 1.2
@@ -1,576 +1,100 @@
+fonts {
+ font: "VeraBd.ttf" "Edje-Vera-Bold";
+}
images {
image: "module_icon.png" COMP;
- image: "e17_titlebar.png" COMP;
- image: "e17_titlebar_glint1.png" COMP;
- image: "e17_titlebar_glint2.png" COMP;
- image: "e17_titlebar_glint3.png" COMP;
- image: "e17_titlebar_shadow1.png" COMP;
- image: "e17_titlebar_shadow2.png" COMP;
}
collections {
group {
name: "modules/screenshot/main";
max: 128 128;
- script {
- public is_active;
- public is_hilited;
- }
+ script {
+ public it;
+ public global_int;
+
+ public timer_cb(val) {
+ new str[100];
+ new i;
+
+ i = get_int(global_int);
+ snprintf(str, sizeof(str), "%i", i);
+ set_text(PART:"text", str);
+ if (i == 0) {
+ snprintf(str, sizeof(str), "%s", "");
+ set_text(PART:"text", str);
+ cancel_timer(it);
+ set_state(PART:"text", "default",0.0);
+ } else {
+ set_int(global_int, (i - 1));
+ it = timer(1.0, "timer_cb", global_int);
+ }
+ }
+
+ public message(Msg_Type:type, id, ...) {
+ if (type == MSG_INT_SET) {
+ new tmp;
+ tmp = getarg(2);
+ set_int(global_int, tmp);
+ set_state(PART:"text", "visible", 0.0);
+ it = timer(1.0, "timer_cb", global_int);
+ }
+ }
+ }
+
parts {
part {
- name: "title_shadow2";
- mouse_events: 0;
- description {
- state: "default" 0.0;
- visible: 0;
- image {
- normal: "e17_titlebar_shadow2.png";
- border: 8 8 8 8;
- }
- fill {
- smooth: 0;
- }
- color: 255 255 255 0;
- }
- description {
- state: "active" 0.0;
- visible: 1;
- image {
- normal: "e17_titlebar_shadow2.png";
- border: 8 8 8 8;
- }
- fill {
- smooth: 0;
- }
- color: 255 255 255 255;
- }
- }
- part {
- name: "title_shadow1";
- mouse_events: 0;
- description {
- state: "default" 0.0;
- visible: 0;
- image {
- normal: "e17_titlebar_shadow1.png";
- border: 8 8 8 8;
- }
- fill {
- smooth: 0;
- }
- color: 255 255 255 0;
- }
- description {
- state: "active" 0.0;
- visible: 1;
- image {
- normal: "e17_titlebar_shadow1.png";
- border: 8 8 8 8;
- }
- fill {
- smooth: 0;
- }
- color: 255 255 255 255;
- }
- }
- part {
- name: "title_bar";
- mouse_events: 0;
- description {
- state: "default" 0.0;
- visible: 0;
- image {
- normal: "e17_titlebar.png";
- border: 8 8 8 8;
- }
- color: 255 255 255 0;
- }
- description {
- state: "active" 0.0;
- visible: 1;
- image {
- normal: "e17_titlebar.png";
- border: 8 8 8 8;
- }
- color: 255 255 255 255;
- }
- }
-
- part {
name: "logo";
description {
state: "default" 0.0;
aspect: 1.0 1.0;
rel1 {
- to: "title_bar";
+ relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
- to: "title_bar";
+ relative: 1.0 1.0;
offset: -1 -1;
}
image {
normal: "module_icon.png";
}
- color:255 255 255 128;
- }
- description {
- state: "active" 0.0;
- inherit: "default" 0.0;
- rel1 {
- to: "title_bar";
- offset: 0 0;
- }
- rel2 {
- to: "title_bar";
- offset: -1 -1;
- }
color:255 255 255 255;
}
}
-
- part {
- name: "title_glint_clip";
- type: RECT;
- mouse_events: 0;
- description {
- state: "default" 0.0;
- rel1 {
- offset: 3 3;
- to: "title_bar";
- }
- rel2 {
- offset: -4 -4;
- to: "title_bar";
- }
- color: 255 255 255 255;
- }
- }
- part {
- name: "title_glint_1";
- mouse_events: 0;
- description {
- state: "default" 0.0;
- visible: 0;
- color: 255 255 255 0;
- align: 0.0 0.0;
- max: 34 13;
- rel1 {
- relative: 0.0 0.0;
- offset: 2 2;
- to: "title_bar";
- }
- rel2 {
- relative: 1.0 1.0;
- offset: -3 -3;
- to: "title_bar";
- }
- image {
- normal: "e17_titlebar_glint1.png";
- border: 5 0 5 0;
- }
- fill {
- smooth: 0;
- }
- }
- description {
- state: "active" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- color: 255 255 255 255;
- }
- }
- part {
- name: "title_glint_2";
- mouse_events: 0;
- clip_to: "title_glint_clip";
- description {
- state: "default" 0.0;
- visible: 0;
- color: 255 255 255 0;
- max: 0 0;
- align: 1.0 0.5;
- rel1 {
- relative: 0.0 0.0;
- offset: 3 3;
- to: "title_bar";
- }
- rel2 {
- relative: 0.0 1.0;
- offset: 0 -4;
- to: "title_bar";
- }
- image {
- normal: "e17_titlebar_glint2.png";
- border: 0 0 5 5;
- }
- fill {
- smooth: 0;
- }
- }
- description {
- state: "active" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- color: 255 255 255 255;
- max: 169 9999;
- min: 169 8;
- align: 0.5 0.5;
- rel1 {
- relative: 0.0 0.0;
- offset: 3 3;
- }
- rel2 {
- relative: 0.0 1.0;
- offset: 3 -4;
- }
- }
- description {
- state: "active2" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- color: 255 255 255 128;
- max: 169 9999;
- min: 169 8;
- align: 0.5 0.5;
- rel1 {
- relative: 1.0 0.0;
- offset: -4 3;
- }
- rel2 {
- relative: 1.0 1.0;
- offset: -4 -4;
- }
- }
- description {
- state: "active3" 0.0;
- inherit: "default" 0.0;
- visible: 0;
- color: 255 255 255 0;
- max: 169 9999;
- min: 169 8;
- align: 0.0 0.5;
- rel1 {
- relative: 1.0 0.0;
- offset: -4 3;
- }
- rel2 {
- relative: 1.0 1.0;
- offset: -4 -4;
- }
- }
- }
- part {
- name: "title_glint_3";
- mouse_events: 0;
- description {
- state: "default" 0.0;
- visible: 0;
- color: 255 255 255 0;
- align: 1.0 1.0;
- max: 34 13;
- rel1 {
- relative: 0.0 0.0;
- offset: 2 2;
- to: "title_bar";
- }
- rel2 {
- relative: 1.0 1.0;
- offset: -3 -3;
- to: "title_bar";
- }
- image {
- normal: "e17_titlebar_glint3.png";
- border: 0 5 0 5;
- }
- fill {
- smooth: 0;
- }
- }
- description {
- state: "active" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- color: 255 255 255 255;
- }
- }
-
- part {
- name: "logo2";
- mouse_events: 0;
- description {
- state: "default" 0.0;
- visible: 0;
- rel1 {
- to: "logo";
- relative: 0.0 0.0;
- offset: 0 0;
- }
- rel2 {
- to: "logo";
- relative: 1.0 1.0;
- offset: -1 -1;
- }
- image {
- normal: "module_icon.png";
- }
- color: 255 255 255 0;
- }
- description {
- state: "visible" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- color: 255 255 255 255;
- }
- description {
- state: "hidden" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- rel1 {
- relative: -0.2 -0.2;
- offset: 0 0;
- }
- rel2 {
- relative: 1.5 1.5;
- offset: -1.2 -1.2;
- }
- color: 255 255 255 0;
- }
- }
-
part {
- name: "inout";
- type: RECT;
- mouse_events: 1;
- description {
- state: "default" 0.0;
- color: 255 255 255 0;
- }
- }
- }
- programs {
- program {
- name: "init";
- signal: "load";
- source: "";
- script {
- set_int(is_active, 0);
- set_int(is_hilited, 0);
- }
- }
- program {
- name: "mouse_in";
- signal: "mouse,in";
- source: "inout";
- script {
- new val;
-
- val = get_int(is_active);
- if (val == 0)
- {
- run_program(PROGRAM:"go_active_pre");
- set_int(is_hilited, 1);
- }
- }
- }
- program {
- name: "mouse_out";
- signal: "mouse,out";
- source: "inout";
- script {
- new val;
-
- val = get_int(is_active);
- if (val == 0)
- {
- run_program(PROGRAM:"go_passive_pre");
- set_int(is_hilited, 0);
- }
- }
- }
- program {
- name: "handle_active";
- signal: "active";
- source: "";
- script {
- new val;
-
- set_int(is_active, 1);
- val = get_int(is_hilited);
- if (val == 0)
- run_program(PROGRAM:"go_active_pre");
- run_program(PROGRAM:"logo_go_active");
- }
- }
- program {
- name: "handle_passive";
- signal: "passive";
- source: "";
- script {
- new val;
-
- set_int(is_active, 0);
- val = get_int(is_hilited);
- if (val == 1)
- {
- run_program(PROGRAM:"go_passive_pre");
- set_int(is_hilited, 0);
- }
- run_program(PROGRAM:"logo_go_passive");
- }
- }
-
- program {
- name: "go_active_pre";
- signal: "";
- source: "";
- after: "go_active";
- }
- program {
- name: "go_active";
- action: STATE_SET "active" 0.0;
- // target: "title_bar";
- target: "logo";
- transition: LINEAR 0.2;
- // after: "go_active2";
- }
- program {
- name: "go_active2";
- action: STATE_SET "active" 0.0;
- target: "title_shadow1";
- transition: LINEAR 0.05;
- after: "go_active3";
- after: "go_active3b";
- }
- program {
- name: "go_active3";
- action: STATE_SET "active" 0.0;
- target: "title_shadow2";
- transition: LINEAR 0.05;
- }
- program {
- name: "go_active3b";
- action: STATE_SET "active" 0.0;
- target: "title_glint_1";
- target: "title_glint_2";
- transition: LINEAR 0.05;
- after: "go_active4";
- after: "go_active4b";
- }
- program {
- name: "go_active4";
- action: STATE_SET "active2" 0.0;
- target: "title_glint_2";
- transition: LINEAR 0.2;
- after: "go_active5";
- after: "go_active5b";
- }
- program {
- name: "go_active4b";
- action: STATE_SET "active" 0.0;
- target: "title_glint_3";
- transition: LINEAR 0.2;
- }
- program {
- name: "go_active5";
- action: STATE_SET "active3" 0.0;
- target: "title_glint_2";
- transition: LINEAR 0.05;
- }
- program {
- name: "go_active5b";
- action: STATE_SET "default" 0.0;
- target: "title_glint_3";
- transition: LINEAR 0.1;
- after: "go_active6";
- }
- program {
- name: "go_active6";
- action: STATE_SET "default" 0.0;
- target: "title_glint_1";
- target: "title_glint_2";
- target: "title_glint_3";
- }
-
- program {
- name: "logo_go_active";
- signal: "";
- source: "";
- after: "hover_go_active";
- }
- program {
- name: "hover_go_active";
- signal: "";
- source: "";
- action: STATE_SET "visible" 0.0;
- target: "logo2";
- after: "hover_go_active2";
- }
- program {
- name: "hover_go_active2";
- signal: "";
- source: "";
- action: STATE_SET "hidden" 0.0;
- transition: LINEAR 0.5;
- target: "logo2";
- after: "hover_go_active";
- }
-
- program {
- name: "go_passive_pre";
- signal: "";
- source: "";
- // action: STATE_SET "active" 0.0;
- // target: "title_bar";
- // target: "title_shadow1";
- // target: "title_shadow2";
- after: "go_passive";
- }
- program {
- name: "go_passive";
- action: STATE_SET "default" 0.0;
- // target: "title_shadow2";
- target: "logo";
- transition: LINEAR 0.2;
- // after: "go_passive2";
- }
- program {
- name: "go_passive2";
- action: STATE_SET "default" 0.0;
- target: "title_shadow1";
- transition: LINEAR 0.1;
- after: "go_passive3";
- }
- program {
- name: "go_passive3";
- action: STATE_SET "default" 0.0;
- target: "title_bar";
- transition: LINEAR 0.1;
- }
-
- program {
- name: "logo_go_passive";
- signal: "";
- source: "";
- after: "hover_go_passive";
- }
-
- program {
- name: "hover_go_passive";
- signal: "";
- source: "";
- action: ACTION_STOP;
- target: "hover_go_active";
- target: "hover_go_active2";
- after: "hover_go_passive2";
- }
- program {
- name: "hover_go_passive2";
- signal: "";
- source: "";
- action: STATE_SET "default" 0.0;
- target: "logo2";
+ name: "text";
+ mouse_events: 0;
+ type: TEXT;
+ effect: SOFT_SHADOW;
+ description {
+ state: "default" 0.0;
+ color: 0 0 0 255;
+ color3: 255 255 255 255;
+ visible: 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "logo";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "logo";
+ }
+ text {
+ text: "";
+ font: "Edje-Vera-Bold";
+ size: 18;
+ min: 1 1;
+ align: 0.5 0.5;
+ }
+ }
+ description {
+ state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
}
}
}
-
}
===================================================================
RCS file: /cvsroot/enlightenment/e_modules/screenshot/e_mod_main.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e_mod_main.c 21 Dec 2005 20:21:05 -0000 1.6
+++ e_mod_main.c 23 Dec 2005 21:41:14 -0000 1.7
@@ -390,6 +390,7 @@
{
Ecore_Exe *x;
Evas_Event_Mouse_Down *ev;
+ Edje_Message_Int_Set *msg;
Screen_Face *ef;
char buff[1024];
char *opts[8] = {'\0','\0','\0','\0','\0','\0','\0','\0'};
@@ -405,7 +406,7 @@
}
else if (ev->button == 1)
{
- /* Take Shot */
+ /* Take Shot */
if (ef->screen->conf->use_import == 1)
{
if (ef->screen->conf->import.use_img_border == 1)
@@ -431,7 +432,12 @@
f = get_filename(ef->screen->conf);
snprintf(buff, sizeof(buff), "import %s %s", opt, f);
- edje_object_signal_emit(ef->screen_object, "active", "");
+ msg = malloc(sizeof(Edje_Message_Int_Set) + 1 * sizeof(int));
+ msg->count = 1;
+ msg->val[0] = ef->screen->conf->delay_time - 1;
+ edje_object_message_send(ef->screen_object, EDJE_MESSAGE_INT_SET,
1, msg);
+ free(msg);
+
_screen_exe_exit_handler =
ecore_event_handler_add(ECORE_EVENT_EXE_EXIT, _screen_exe_cb_exit, NULL);
x = ecore_exe_run(buff, ef);
}
@@ -449,7 +455,12 @@
opt = get_options(opts);
f = get_filename(ef->screen->conf);
snprintf(buff, sizeof(buff), "scrot %s %s", opt, f);
- edje_object_signal_emit(ef->screen_object, "active", "");
+ msg = malloc(sizeof(Edje_Message_Int_Set) + 1 * sizeof(int));
+ msg->count = 1;
+ msg->val[0] = ef->screen->conf->delay_time - 1;
+ edje_object_message_send(ef->screen_object, EDJE_MESSAGE_INT_SET,
1, msg);
+ free(msg);
+
_screen_exe_exit_handler =
ecore_event_handler_add(ECORE_EVENT_EXE_EXIT, _screen_exe_cb_exit, NULL);
x = ecore_exe_run(buff, ef);
}
@@ -523,7 +534,6 @@
}
else
{
- printf("File: %s\n", strdup(conf->filename));
/* Parse File Name For %d */
if (strstr(conf->filename, "%d"))
{
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs