Enlightenment CVS committal

Author  : codewarrior
Project : e17
Module  : apps/e_utils

Dir     : e17/apps/e_utils/src/bin/e17setroot


Modified Files:
        e17setroot.c 


Log Message:
If you use pseudo-trans, then now when you use e17setroot to set a .edj 
background which uses edje_thumb to create a static version of it rendered to 
your screen size. This will still not look very good on highly animated edjes 
but its the closest you can ever get to using pseudo-trans with e17 and .edj 
backgrounds.
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/apps/e_utils/src/bin/e17setroot/e17setroot.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- e17setroot.c        17 Jul 2005 19:41:27 -0000      1.22
+++ e17setroot.c        19 Jul 2005 11:01:49 -0000      1.23
@@ -10,6 +10,7 @@
 #include <E_Lib.h>
 #include <Engrave.h>
 #include <Ecore.h>
+#include <Ecore_X.h>
 #include <Ecore_File.h>
 
 #include "config.h"
@@ -166,19 +167,38 @@
 
    /* make sure we got a file name */
    if (!filename) return;
-
-   if (strcmp(filename + strlen(filename) - 4, ".edj") == 0) {
-      _e_bg_bg_set(filename);
-      ecore_main_loop_quit();
-      return;
-   }
    
    file = ecore_file_get_file(filename);
    dir = ecore_file_get_dir(filename);
 
    filenoext = _e_bg_bg_file_stripext(filename);
    filenoext = ecore_file_get_file(filenoext);
+                       
+   if (strcmp(filename + strlen(filename) - 4, ".edj") == 0) {
+      int w, h, num;
+      char static_bg[PATH_MAX];
+      char esetroot_s[PATH_MAX];          
+      char filename_s[PATH_MAX];
+      Ecore_X_Window *roots = NULL;
+          
+      if (!ecore_x_init(NULL))
+            return;
+      num = 0;
+      roots = ecore_x_window_root_list(&num);
+      ecore_x_window_size_get(roots[0], &w, &h);
+      snprintf(filename_s, PATH_MAX, "/tmp/%s.png", filenoext);
+      snprintf(static_bg, PATH_MAX, "edje_thumb %s desktop/background %s -g 
%dx%d -og %dx%d", filename, filename_s, w, h, w, h);
+      system(static_bg);
+      _e_bg_bg_set(filename);
 
+      strcpy(esetroot_s, "Esetroot ");
+      strcat(esetroot_s, esetroot_opt);
+      strcat(esetroot_s, filename_s);
+      system(esetroot_s);
+      ecore_main_loop_quit();
+      return;
+   }
+   
    /* Set up edj path */
    edj_file = malloc(strlen(getenv("HOME")) +  strlen("/.e/e/backgrounds/") 
                + strlen(filenoext) + strlen(".edj") + 1);




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to