Enlightenment CVS committal

Author  : handyande
Project : misc
Module  : engage

Dir     : misc/engage/src


Modified Files:
        Makefile.am config.c engage.h icon.c window.c 


Log Message:
Added move/resize callbacks for background transparency fixes and saving window size
started basis of edje theme by creating the icon eet.
note that now teh bubbled icons should be changed, as they are 'double bubbled'
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- Makefile.am 11 Apr 2004 21:11:44 -0000      1.3
+++ Makefile.am 14 Apr 2004 22:59:15 -0000      1.4
@@ -5,6 +5,7 @@
 -I/usr/local/include \
 -I$(top_srcdir)/lib \
 @evas_cflags@ \
[EMAIL PROTECTED]@ \
 @ecore_cflags@ \
 @esmart_cflags@ \
 @imlib_cflags@
@@ -21,5 +22,5 @@
 userconfig.c
 
 
-engage_LDADD = @evas_libs@ @ecore_libs@ @esmart_libs@ @imlib_libs@
+engage_LDADD = @evas_libs@ @edje_libs@ @ecore_libs@ @esmart_libs@ @imlib_libs@
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/config.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- config.c    13 Apr 2004 12:34:26 -0000      1.4
+++ config.c    14 Apr 2004 22:59:15 -0000      1.5
@@ -11,6 +11,7 @@
 {
   ecore_config_default_int("engage.options.width", 1024);
   ecore_config_default_int("engage.options.height", 100);
+  ecore_config_default_string("engage.options.theme", "gentoo");
   options.icon_path = PACKAGE_DATA_DIR "/icons/";
   ecore_config_default_int_bound("engage.options.mode", OM_ONTOP, 0, 1, 1);
   ecore_config_default_int_bound("engage.options.grab_min_icons", 1, 0, 1, 1);
@@ -33,6 +34,7 @@
   ecore_config_load();
   options.width = ecore_config_get_int("engage.options.width");
   options.height = ecore_config_get_int("engage.options.height");
+  options.theme = ecore_config_get_string("engage.options.theme");
   options.mode = ecore_config_get_int("engage.options.mode");
   options.grab_min_icons =
     ecore_config_get_int("engage.options.grab_min_icons");
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/engage.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- engage.h    13 Apr 2004 14:25:37 -0000      1.6
+++ engage.h    14 Apr 2004 22:59:15 -0000      1.7
@@ -5,6 +5,7 @@
 #include <Ecore_X.h>
 #include <Ecore_Evas.h>
 #include <Ecore_Config.h>
+#include <Edje.h>
 #include <stdlib.h>
 #include <stdio.h>
 
@@ -70,7 +71,7 @@
 
 struct _OD_Options {
   int             width, height;
-  char           *icon_path;
+  char           *icon_path, *theme;
   OD_Mode         mode;
   int             grab_min_icons, grab_app_icons;
 
@@ -109,7 +110,7 @@
 #define OD_ICON_STATE_BOUNCING                 0x00000008
 
 struct _OD_Icon {
-  Evas_Object    *icon, *tt_txt, *tt_shd, *arrow;
+  Evas_Object    *icon, *pic, *tt_txt, *tt_shd, *arrow;
   unsigned        state;        // see above
   char           *name;
   double          x, y;         // relative to evas
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/icon.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- icon.c      13 Apr 2004 12:34:26 -0000      1.6
+++ icon.c      14 Apr 2004 22:59:15 -0000      1.7
@@ -114,9 +114,11 @@
   img = imlib_create_image_from_drawable(mask, x, y, w, h, 0);
   imlib_context_set_image(img);
 
-  evas_object_image_size_set(icon->icon, w, h);
-  evas_object_image_data_copy_set(icon->icon,
+  evas_object_image_size_set(icon->pic, w, h);
+  evas_object_image_data_copy_set(icon->pic,
                                   imlib_image_get_data_for_reading_only());
+  edje_object_part_unswallow(icon->icon, "EquateIcon");
+  edje_object_part_swallow(icon->icon, "EquateIcon", icon->pic);
 
   imlib_free_image();
 
@@ -124,27 +126,62 @@
 }
 #endif
 
+void
+od_object_resize_intercept_cb(void *data, Evas_Object * o,
+                              Evas_Coord w, Evas_Coord h)
+{
+  if (o)
+  {
+    if (!strcmp("edje", evas_object_type_get(o)))
+    {
+      evas_object_resize(o, w, h);
+      o=edje_object_part_swallow_get(o, "EngageIcon");
+      evas_object_image_fill_set(o, 0.5, 0.5, w * 0.5, h * 0.5);
+      evas_object_resize(o, w * 0.5, h * 0.5);
+    }
+  }
+}
+
+
 OD_Icon        *
 od_icon_new(const char *name, const char *icon_file)
 {
   OD_Icon        *ret = (OD_Icon *) malloc(sizeof(OD_Icon));
+  char           *path[PATH_MAX];
 
   ret->name = strdup(name);
   ret->scale = 0.0;
-  Evas_Object    *icon = ret->icon = evas_object_image_add(evas);
+  Evas_Object    *icon = ret->icon = edje_object_add(evas);
   Evas_Object    *tt_txt = ret->tt_txt = evas_object_text_add(evas);
   Evas_Object    *tt_shd = ret->tt_shd = evas_object_text_add(evas);
-
+  Evas_Object    *pic = ret->pic = evas_object_image_add(evas);
+  evas_object_image_file_set(pic, icon_file, NULL);
+  evas_object_image_alpha_set(pic, 1);
+  evas_object_image_smooth_scale_set(pic, 1);
+  evas_object_layer_set(pic, 200);
+  evas_object_name_set(pic, "icon");
+          
+  evas_object_show(pic);
+  
   ret->arrow = NULL;
   ret->state = 0;
   ret->appear_timer = NULL;
+  
 
-  evas_object_image_file_set(icon, icon_file, NULL);
+  if ((strstr(options.theme, "/")))
+    snprintf(path, PATH_MAX, options.theme);
+  else
+    snprintf(path, PATH_MAX, PACKAGE_DATA_DIR "/themes/%s.eet", options.theme);
+
+  edje_object_file_set(icon, path, "Main");
+  edje_object_part_swallow(icon, "EngageIcon", pic);
   evas_object_image_alpha_set(icon, 1);
   evas_object_image_smooth_scale_set(icon, 1);
   evas_object_layer_set(icon, 100);
-  evas_object_name_set(icon, "icon");
   evas_object_show(icon);
+  evas_object_intercept_resize_callback_add(icon,
+                                            od_object_resize_intercept_cb,NULL);
+  
 
   evas_object_text_font_set(tt_txt, options.tt_fa, options.tt_fs);
   evas_object_text_text_set(tt_txt, name);
@@ -161,7 +198,6 @@
                         (options.tt_shd_color >> 8) & 0xff,
                         (options.tt_shd_color >> 0) & 0xff, 127);
   evas_object_layer_set(tt_shd, 199);
-
   return ret;
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/window.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- window.c    13 Apr 2004 12:34:26 -0000      1.5
+++ window.c    14 Apr 2004 22:59:15 -0000      1.6
@@ -21,6 +21,41 @@
                                   void *event);
 
 void
+od_window_move()
+{ 
+  int x, y, w, h;
+  Evas_Object *o = NULL;
+  
+  ecore_evas_geometry_get (ee, &x, &y, &w, &h);
+  
+#ifdef HAVE_TRANS_BG
+  if((o = evas_object_name_find(ecore_evas_get(ee), "trans")))
+    esmart_trans_x11_freshen(o, x, y, w, h);
+#endif
+}
+
+void
+od_window_resize()
+{
+  int x, y, w, h;
+  Evas_Object *o = NULL;
+  
+  ecore_evas_geometry_get(ee, &x, &y, &w, &h);
+
+#ifdef HAVE_TRANS_BG
+  if((o = evas_object_name_find(ecore_evas_get(ee), "trans")))
+  {
+    evas_object_resize(o, w, h);
+    esmart_trans_x11_freshen(o, x, y, w, h);
+  }
+#endif
+  options.width = w;
+  options.height = h;
+  ecore_config_set_int("engage.options.width", w);
+  ecore_config_set_int("engage.options.height", h);
+}
+
+void
 od_window_init()
 {
   Ecore_X_Display *dsp;
@@ -47,8 +82,6 @@
     ecore_evas_shaped_set(ee, 1);
   else
     ecore_evas_shaped_set(ee, 0);
-  ecore_evas_size_min_set(ee, options.width, options.height);
-  ecore_evas_size_max_set(ee, options.width, options.height);
   ecore_evas_callback_pre_render_set(ee, od_dock_redraw);
   ecore_evas_callback_focus_out_set(ee, handle_mouse_out);
 
@@ -77,6 +110,8 @@
     ecore_x_window_prop_layer_set(od_window, ECORE_X_WINDOW_LAYER_BELOW);
 
   ecore_evas_show(ee);
+  ecore_evas_callback_move_set(ee, od_window_move);
+  ecore_evas_callback_resize_set(ee, od_window_resize);
 
   if (options.mode == OM_BELOW) {
 #ifdef HAVE_TRANS_BG
@@ -130,7 +165,7 @@
         Evas_List      *i2 = dock.icons;
 
         while (i2 && !done) {
-          if (((OD_Icon *) (i2->data))->icon == (Evas_Object *) item->data) {
+          if (((OD_Icon *) (i2->data))->pic == (Evas_Object *) item->data) {
             icon = (OD_Icon *) i2->data;
             done = true;
           }




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to