Enlightenment CVS committal

Author  : rephorm
Project : e17
Module  : apps/elicit

Dir     : e17/apps/elicit/src


Modified Files:
        Elicit.h callbacks.c callbacks.h conf.c conf.h elicit.c util.c 
        util.h 


Log Message:


for tokyo:
middle click on the shot to load it up in the gimp (requires gimp-remote)


===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/elicit/src/Elicit.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- Elicit.h    12 Aug 2004 22:26:30 -0000      1.13
+++ Elicit.h    8 Mar 2005 05:02:13 -0000       1.14
@@ -71,6 +71,8 @@
 
   Ecore_Timer *change_timer;
   char *change_sig;
+
+  char *tmpdir;
 };
 
 struct _Elicit_Swatch
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/elicit/src/callbacks.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- callbacks.c 7 Mar 2005 00:51:25 -0000       1.17
+++ callbacks.c 8 Mar 2005 05:02:13 -0000       1.18
@@ -298,6 +298,43 @@
   elicit_config_colorclass_set(el->color.r, el->color.g, el->color.b);
 }
 
+void
+elicit_cb_edit(void *data, Evas_Object *o, const char *sig, const char *src)
+{
+  Elicit *el = data;
+  char buf[PATH_MAX];
+  char tmp[PATH_MAX];
+  char plate[18] ="/tmp/elicit-XXXXXX";
+
+  if (el && el->swatch)
+  {
+    char *ed = elicit_config_editor_get();
+
+    if (!ed) return;
+
+    if (!el->tmpdir)
+    {
+      if (mkdtemp(plate))
+      {
+        el->tmpdir = strdup(plate);
+      }
+    }
+
+    if (el->tmpdir)
+    {
+      snprintf(tmp, PATH_MAX, "%s/elicit_%f.png", el->tmpdir, ecore_time_get() 
);
+      elicit_util_shot_save(el, tmp);
+      snprintf(buf, PATH_MAX, "%s %s", ed, tmp);
+
+      free(ed);
+
+      ecore_exe_run(buf, NULL);
+    }
+  }
+  
+  
+}
+
 
 void
 elicit_cb_freeze(void *data, Evas_Object *o, const char *sig, const char *src)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/elicit/src/callbacks.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- callbacks.h 7 Mar 2005 00:51:25 -0000       1.8
+++ callbacks.h 8 Mar 2005 05:02:13 -0000       1.9
@@ -21,5 +21,6 @@
 void elicit_cb_thaw(void *data, Evas_Object *o, const char *sig, const char 
*src);
 void elicit_cb_size_min(void *data, Evas_Object *o, const char *sig, const 
char *src);
 void elicit_cb_colorclass(void *data, Evas_Object *o, const char *sig, const 
char *src);
+void elicit_cb_edit(void *data, Evas_Object *o, const char *sig, const char 
*src);
 
 #endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/elicit/src/conf.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- conf.c      7 Mar 2005 00:51:25 -0000       1.11
+++ conf.c      8 Mar 2005 05:02:13 -0000       1.12
@@ -27,6 +27,7 @@
   ecore_config_int_default("/colorclass/r", 229);
   ecore_config_int_default("/colorclass/g", 239);
   ecore_config_int_default("/colorclass/b", 255);
+  ecore_config_string_default("/editor", "gimp-remote");
   ecore_config_load();
 }
 
@@ -118,6 +119,18 @@
   ecore_config_int_set("/colorclass/b", b);
 }
 
+char *
+elicit_config_editor_get(void)
+{
+   return ecore_config_string_get("/editor");
+}
+
+void
+elicit_config_editor_set(char *ed)
+{
+   ecore_config_string_set("/editor", ed);
+}
+
 static int
 elicit_config_listener(const char *key, const Ecore_Config_Type type, const 
int tag, void *data)
 {
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/elicit/src/conf.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- conf.h      7 Mar 2005 00:51:25 -0000       1.4
+++ conf.h      8 Mar 2005 05:02:13 -0000       1.5
@@ -29,5 +29,8 @@
 void elicit_config_colorclass_get(int *r, int *g, int *b);
 void elicit_config_colorclass_set(int r, int g, int b);
 
+char *elicit_config_editor_get(void);
+void elicit_config_editor_set(char *ed);
+
 #endif
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/elicit/src/elicit.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- elicit.c    8 Mar 2005 02:54:25 -0000       1.21
+++ elicit.c    8 Mar 2005 05:02:13 -0000       1.22
@@ -77,6 +77,13 @@
   ecore_main_loop_begin();
 
   /* shutdown the subsystems (when event loop exits, app is done) */
+  
+  if (el->tmpdir)
+  {
+    char buf[PATH_MAX];
+    snprintf(buf, PATH_MAX, "rm -rf %s", el->tmpdir);
+    ecore_exe_run(buf, NULL);
+  }
   elicit_config_zoom_set(el->zoom);
   elicit_config_zoom_max_set(el->zoom_max);
   elicit_config_color_set(el->color.r, el->color.g, el->color.b);
@@ -190,6 +197,7 @@
   edje_object_signal_callback_add(el->gui, "elicit,thaw", "*", elicit_cb_thaw, 
el);
   edje_object_signal_callback_add(el->gui, "elicit,size,min,*", "*", 
elicit_cb_size_min, el);
   edje_object_signal_callback_add(el->gui, "elicit,colorclass", "*", 
elicit_cb_colorclass, el);
+  edje_object_signal_callback_add(el->gui, "elicit,shot,edit", "*", 
elicit_cb_edit, el);
 
   edje_object_signal_callback_add(el->gui, "elicit,swatch,save", "*", 
elicit_swatch_save_cb, el);
   edje_object_signal_callback_add(el->gui, "elicit,shot,save", "*", 
elicit_shot_save_cb, el);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/elicit/src/util.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- util.c      29 Apr 2004 04:46:29 -0000      1.6
+++ util.c      8 Mar 2005 05:02:13 -0000       1.7
@@ -261,3 +261,21 @@
   snprintf(eet, sizeof(eet), DATADIR"/themes/%s.eet", name);
   return stat(eet, &st) ? NULL : eet;
 }
+
+void
+elicit_util_shot_save(Elicit *el, const char *filename)
+{
+  Imlib_Image *im;
+  int iw, ih;
+  DATA32 *data;
+
+  evas_object_image_size_get(el->shot, &iw, &ih);
+  data = evas_object_image_data_get(el->shot, TRUE);
+
+  im = imlib_create_image_using_copied_data(iw, ih, data);
+  imlib_context_set_image(im);
+  imlib_save_image(filename);
+  imlib_free_image();
+
+}
+
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/elicit/src/util.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- util.h      8 Feb 2004 04:02:09 -0000       1.3
+++ util.h      8 Mar 2005 05:02:13 -0000       1.4
@@ -11,4 +11,6 @@
 
 char *elicit_theme_find(const char *name);
 
+void elicit_util_shot_save(Elicit *el, const char *filename);
+
 #endif




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to