Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : apps/ebony

Dir     : e17/apps/ebony/src


Modified Files:
        callbacks.c ebony.h gtk_util.c interface.c main.c util.c 
        util.h 


Log Message:
More SPLIT merging goodness.

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/ebony/src/callbacks.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- callbacks.c 4 Sep 2002 21:20:32 -0000       1.21
+++ callbacks.c 15 Jan 2003 16:33:43 -0000      1.22
@@ -78,10 +78,7 @@
 
    if (bg)
    {
-      fill_background_images(bg);
-      clear_bg_db_keys(bg);
       e_bg_save(bg, bg->file);
-
       if ((filesize = filesize_as_string(bg->file)))
       {
          g_snprintf(errstr, 1024, "Saved background: %s(%s)",
@@ -95,10 +92,8 @@
          ebony_status_message(errstr, EBONY_STATUS_TO);
    }
    return;
-
 }
 
-
 void
 on_save_bg_as_activate(GtkMenuItem * menuitem, gpointer user_data)
 {
@@ -116,10 +111,8 @@
                       (gpointer) fs);
    gtk_widget_show(fs);
    return;
-
 }
 
-
 void
 on_quit_ebony_activate(GtkMenuItem * menuitem, gpointer user_data)
 {
@@ -131,15 +124,14 @@
 on_bg_evas_configure_event(GtkWidget * widget, GdkEventConfigure * event,
                            gpointer user_data)
 {
-   evas_set_output_viewport(evas, 0, 0, event->width, event->height);
-   evas_set_output_size(evas, event->width, event->height);
-   e_bg_set_scale(bg, export_info.screen.w * export_info.xinerama.h,
-                  export_info.screen.h * export_info.xinerama.v);
-   e_bg_resize(ebony_base_bg, event->width, event->height);
-   if (bl)
-      outline_evas_object(bl->obj);
+   if (evas)
+   {
+      evas_output_viewport_set(evas, 0, 0, event->width, event->height);
+      evas_output_size_set(evas, event->width, event->height);
+      e_bg_resize(ebony_base_bg, event->width, event->height);
 
-   DRAW();
+      update_background(bg);
+   }
 
    return FALSE;
 }
@@ -179,7 +171,7 @@
 on_layer_add_clicked(GtkButton * button, gpointer user_data)
 {
    E_Background_Layer _bl;
-   Evas_List l;
+   Evas_List *l;
    int size = 0;
 
    if (!bl)
@@ -192,9 +184,10 @@
    _bl->size.w = _bl->size.h = 1.0;
    _bl->fg.r = _bl->fg.g = _bl->fg.b = 255;
    _bl->fg.a = 80;
-   _bl->obj = evas_add_rectangle(evas);
-   evas_set_color(evas, _bl->obj, _bl->fg.r, _bl->fg.g, _bl->fg.b, _bl->fg.a);
-   evas_show(evas, _bl->obj);
+   _bl->obj = evas_object_rectangle_add(evas);
+   evas_object_color_set(_bl->obj, _bl->fg.r, _bl->fg.g, _bl->fg.b,
+                         _bl->fg.a);
+   evas_object_show(_bl->obj);
    bg->layers = evas_list_append(bg->layers, _bl);
    for (l = bg->layers; l; l = l->next)
       size++;
@@ -230,10 +223,10 @@
          _bl->type = E_BACKGROUND_TYPE_SOLID;
          _bl->fg.a = _bl->fg.r = _bl->fg.g = _bl->fg.b = 255;
          _bl->size.w = _bl->size.h = 1.0;
-         _bl->obj = evas_add_rectangle(evas);
-         evas_set_color(evas, _bl->obj, _bl->fg.r, _bl->fg.g, _bl->fg.b,
-                        _bl->fg.a);
-         evas_show(evas, _bl->obj);
+         _bl->obj = evas_object_rectangle_add(evas);
+         evas_object_color_set(_bl->obj, _bl->fg.r, _bl->fg.g, _bl->fg.b,
+                               _bl->fg.a);
+         evas_object_show(_bl->obj);
          bg->layers = evas_list_append(bg->layers, _bl);
       }
       /* return the front */
@@ -288,23 +281,18 @@
       if (bl->file)
          free(bl->file);
       bl->file = strdup(filename);
-      if (bl->image)
-      {
-         imlib_context_set_image(bl->image);
-         imlib_free_image_and_decache();
-         bl->image = imlib_load_image(bl->file);
-      }
       if (bl->obj)
-         evas_del_object(evas, bl->obj);
-      bl->obj = evas_add_image_from_file(evas, bl->file);
-      evas_show(evas, bl->obj);
+         evas_object_del(bl->obj);
+      bl->obj = evas_object_image_add(evas);
+      evas_object_image_file_set(bl->obj, bl->file, NULL);
+      evas_object_show(bl->obj);
       bl->size.w = bl->size.h = 1.0;
       bl->fill.w = bl->fill.h = 1.0;
-      bl->inlined = 1;
+      bl->size.orig.w = bl->size.orig.h = 1;
+      bl->fill.orig.w = bl->fill.orig.h = 1.0;
       update_background(bg);
    }
    return;
-
 }
 
 
@@ -325,8 +313,6 @@
    gtk_widget_show(fs);
 
    return;
-
-
 }
 
 
@@ -337,7 +323,6 @@
       return;
    bl->inlined = get_toggled_state("inline_image");
    return;
-
 }
 
 
@@ -356,7 +341,6 @@
    bl->scroll.x = (float) get_spin_value("scroll_x");
    update_background(bg);
    return;
-
 }
 
 
@@ -368,7 +352,6 @@
    bl->scroll.y = (float) get_spin_value("scroll_y");
    update_background(bg);
    return;
-
 }
 
 
@@ -380,7 +363,6 @@
    bl->pos.x = (float) get_spin_value("pos_x");
    update_background(bg);
    return;
-
 }
 
 
@@ -808,8 +790,8 @@
 on_evas_expose_event(GtkWidget * widget, GdkEventExpose * event,
                      gpointer user_data)
 {
-   evas_update_rect(evas, event->area.x, event->area.y, event->area.width,
-                    event->area.height);
+   evas_damage_rectangle_add(evas, event->area.x, event->area.y,
+                             event->area.width, event->area.height);
    DRAW();
    return FALSE;
 }
@@ -855,12 +837,17 @@
 void
 on_gradient_angle_changed(GtkEditable * editable, gpointer user_data)
 {
+   char *type;
+
    if (!bl)
       return;
 
    bl->gradient.angle = get_spin_value("gradient_angle");
-   evas_set_angle(evas, bl->obj, bl->gradient.angle);
-   update_background(bg);
+   if ((type = evas_object_type_get(bl->obj)) && (!strcmp(type, "gradient")))
+   {
+      evas_object_gradient_angle_set(bl->obj, bl->gradient.angle);
+      update_background(bg);
+   }
    return;
 
 }
@@ -955,8 +942,6 @@
       fprintf(stderr, "Unable to find screen_size_frame widget\n");
    if (gtk_toggle_button_get_active(togglebutton))
    {
-      export_info.screen.w = 800;
-      export_info.screen.h = 600;
       gtk_widget_set_sensitive(GTK_WIDGET(w), TRUE);
 
       w = gtk_object_get_data(GTK_OBJECT(win_ref), "export_xinerama_h");
@@ -979,6 +964,21 @@
       {
          fprintf(stderr, "Unable to find export_xinerama_v\n");
       }
+      if ((export_info.screen.w == 0) || (export_info.screen.h == 0))
+      {
+         if ((w =
+              gtk_object_get_data(GTK_OBJECT(win_ref), "export_screen_w")))
+         {
+            export_info.screen.w =
+               gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(w));
+         }
+         if ((w =
+              gtk_object_get_data(GTK_OBJECT(win_ref), "export_screen_h")))
+         {
+            export_info.screen.h =
+               gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(w));
+         }
+      }
    }
    else
    {
@@ -987,9 +987,7 @@
       export_info.xinerama.v = export_info.xinerama.h = 1;
       gtk_widget_set_sensitive(GTK_WIDGET(w), FALSE);
    }
-   e_bg_set_scale(bg, export_info.screen.w * export_info.xinerama.h,
-                  export_info.screen.h * export_info.xinerama.v);
-   DRAW();
+   update_background(bg);
 }
 
 
@@ -1083,9 +1081,7 @@
         default:
            break;
       }
-      e_bg_set_scale(bg, export_info.screen.w * export_info.xinerama.h,
-                     export_info.screen.h * export_info.xinerama.v);
-      DRAW();
+      update_background(bg);
    }
 
 }
@@ -1100,15 +1096,12 @@
    {
       export_info.screen.h =
          gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(w));
-
    }
    else
    {
       fprintf(stderr, "Unable to find export_screen_h\n");
    }
-   e_bg_set_scale(bg, export_info.screen.w * export_info.xinerama.h,
-                  export_info.screen.h * export_info.xinerama.v);
-   DRAW();
+   update_background(bg);
 }
 
 
@@ -1127,9 +1120,7 @@
    {
       fprintf(stderr, "Unable to find export_screen_w\n");
    }
-   e_bg_set_scale(bg, export_info.screen.w * export_info.xinerama.h,
-                  export_info.screen.h * export_info.xinerama.v);
-   DRAW();
+   update_background(bg);
 }
 
 
@@ -1149,9 +1140,7 @@
    {
       fprintf(stderr, "Unable to find export_xinerama_v\n");
    }
-   e_bg_set_scale(bg, export_info.screen.w * export_info.xinerama.h,
-                  export_info.screen.h * export_info.xinerama.v);
-   DRAW();
+   update_background(bg);
 }
 
 
@@ -1170,9 +1159,7 @@
    {
       fprintf(stderr, "Unable to find export_xinerama_h\n");
    }
-   e_bg_set_scale(bg, export_info.screen.w * export_info.xinerama.h,
-                  export_info.screen.h * export_info.xinerama.v);
-   DRAW();
+   update_background(bg);
 }
 
 void
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/ebony/src/ebony.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ebony.h     4 Sep 2002 21:20:32 -0000       1.8
+++ ebony.h     15 Jan 2003 16:33:43 -0000      1.9
@@ -7,13 +7,15 @@
 #include <stdlib.h>
 #include <gtk/gtk.h>
 #include <limits.h>
+#include <Evas_Engine_Software_X11.h>
+#include "../config.h"
 
 GtkWidget *ebony_status;
 GtkWidget *win_ref, *bg_ref;
 
 GList *recent_bgs;
 
-Evas evas;
+Evas *evas;
 E_Background bg;                /* the bg we're manipulating */
 E_Background ebony_base_bg;     /* the canvases background */
 E_Background_Layer bl;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/ebony/src/gtk_util.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- gtk_util.c  4 Sep 2002 21:20:32 -0000       1.11
+++ gtk_util.c  15 Jan 2003 16:33:43 -0000      1.12
@@ -288,7 +288,7 @@
       bl->fg.b = 255 * color[2];
       bl->fg.a = 255 * color[3];
 
-      evas_set_color(evas, bl->obj, bl->fg.r, bl->fg.g, bl->fg.b, bl->fg.a);
+      evas_object_color_set(bl->obj, bl->fg.r, bl->fg.g, bl->fg.b, bl->fg.a);
       update_background(bg);
    }
 
@@ -347,7 +347,6 @@
    gchar *file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(data));
 
    dirpath = get_dirpath_from_filename((char *) file);
-
    snprintf(bg_fileselection_dir, PATH_MAX, "%s/", dirpath);
    free(dirpath);
 
@@ -373,18 +372,18 @@
    int size;
 
    /* clear the evas cache */
-   size = evas_get_image_cache(evas);
-   evas_set_image_cache(evas, 0);
-   evas_set_image_cache(evas, size);
+   size = evas_object_image_cache_get(evas);
+   evas_object_image_cache_set(evas, 0);
+   evas_object_image_cache_set(evas, size);
 
    e_bg_add_to_evas(_bg, evas);
    e_bg_set_layer(_bg, 0);
    e_bg_show(_bg);
+   bg = _bg;
    _bl = e_bg_get_layer_number(_bg, 0);
    display_layer_values(_bl);
    set_spin_value("layer_num", 0);
    update_background(_bg);
-   bg = _bg;
 }
 
 /**
@@ -395,7 +394,6 @@
 void
 save_as_ok_clicked(GtkWidget * w, gpointer data)
 {
-   E_Background _bg;
    gchar *file;
    gchar errstr[1024];
    char *dirpath, *filesize = NULL;
@@ -403,26 +401,13 @@
    file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(data));
 
    dirpath = get_dirpath_from_filename((char *) file);
-
    snprintf(save_as_fileselection_dir, PATH_MAX, "%s/", dirpath);
    free(dirpath);
 
    if (!file)
       return;
 
-
-   /* Save as over another file, load images before nuking it */
-   fill_background_images(bg);
-
-   _bg = e_bg_load((char *) file);
-   if (_bg)
-   {
-      clear_bg_db_keys(_bg);
-      e_bg_free(_bg);
-   }
-
    e_bg_save(bg, (char *) file);
-
    open_bg_named((char *) file);
    if ((filesize = filesize_as_string(bg->file)))
    {
@@ -608,6 +593,7 @@
       g->g = 255 * color[1];
       g->b = 255 * color[2];
       g->a = 255 * color[3];
+      g->dist = 1;
    }
    da = gtk_object_get_data(GTK_OBJECT(win_ref), "gradient_one_color_box");
    gtk_widget_set_sensitive(da, TRUE);
@@ -652,6 +638,7 @@
       g->g = 255 * color[1];
       g->b = 255 * color[2];
       g->a = 255 * color[3];
+      g->dist = 1;
    }
    da = gtk_object_get_data(GTK_OBJECT(win_ref), "gradient_two_color_box");
    gtk_widget_set_sensitive(da, TRUE);
@@ -742,7 +729,15 @@
    w = gtk_object_get_data(GTK_OBJECT(win_ref), "image_file");
    if (w)
    {
-      if (_bl->file)
+      if (_bl->file && _bl->inlined)
+      {
+         char buf[PATH_MAX];
+
+         snprintf(buf, PATH_MAX, "%s:%s", bg->file, (gchar *) _bl->file);
+         gtk_entry_set_text(GTK_ENTRY(w), buf);
+      }
+
+      else if (_bl->file)
          gtk_entry_set_text(GTK_ENTRY(w), (gchar *) _bl->file);
       else
          gtk_entry_set_text(GTK_ENTRY(w), "");
@@ -952,6 +947,10 @@
    snprintf(image_fileselection_dir, PATH_MAX, "%s/", dirpath);
    free(dirpath);
 
+   dirpath = get_dirpath_from_filename((char *) file);
+   snprintf(image_fileselection_dir, PATH_MAX, "%s/", dirpath);
+   free(dirpath);
+
    if (file)
       set_entry_text("image_file", file);
 
@@ -1082,8 +1081,9 @@
 void
 export_ok_clicked(GtkWidget * w, gpointer data)
 {
+#if 0
    E_Background export_bg;
-   Evas export_evas;
+   Evas *export_evas;
    Imlib_Image image;
    gchar *file;
    gchar errstr[1024];
@@ -1110,7 +1110,7 @@
 
    /* Setup Evas and render */
    export_evas = evas_new();
-   evas_set_output_method(export_evas, RENDER_METHOD_IMAGE);
+   evas_output_method_set(export_evas, RENDER_METHOD_IMAGE);
    evas_set_output_image(export_evas, image);
    evas_set_output_viewport(export_evas, 0, 0, width, height);
    evas_set_output_size(export_evas, width, height);
@@ -1136,4 +1136,5 @@
    return;
    UN(w);
    UN(data);
+#endif
 }
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/ebony/src/interface.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- interface.c 9 Jun 2002 12:33:48 -0000       1.13
+++ interface.c 15 Jan 2003 16:33:43 -0000      1.14
@@ -1236,7 +1236,6 @@
    gtk_table_attach(GTK_TABLE(table3), radiobutton3, 0, 1, 1, 2,
                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                     (GtkAttachOptions) (0), 0, 0);
-   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radiobutton3), TRUE);
 
    radiobutton4 =
       gtk_radio_button_new_with_label(export_size_group_group,
@@ -1281,6 +1280,7 @@
    gtk_table_attach(GTK_TABLE(table3), radiobutton6, 1, 2, 2, 3,
                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                     (GtkAttachOptions) (0), 0, 0);
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radiobutton6), TRUE);
 
    table5 = gtk_table_new(2, 2, FALSE);
    gtk_widget_set_name(table5, "table5");
@@ -1302,7 +1302,6 @@
    gtk_table_attach(GTK_TABLE(table5), export_screen_h, 1, 2, 1, 2,
                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                     (GtkAttachOptions) (0), 0, 0);
-   gtk_widget_set_sensitive(export_screen_h, FALSE);
 
    label26 = gtk_label_new(_("Screen Height"));
    gtk_widget_set_name(label26, "label26");
@@ -1328,7 +1327,6 @@
    gtk_table_attach(GTK_TABLE(table5), export_screen_w, 1, 2, 0, 1,
                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                     (GtkAttachOptions) (0), 0, 0);
-   gtk_widget_set_sensitive(export_screen_w, FALSE);
 
    label25 = gtk_label_new(_("Screen Width"));
    gtk_widget_set_name(label25, "label25");
@@ -1564,9 +1562,7 @@
    win_bg = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_widget_set_name(win_bg, "win_bg");
    gtk_object_set_data(GTK_OBJECT(win_bg), "win_bg", win_bg);
-   gtk_widget_set_uposition(win_bg, 30, -2);
    gtk_window_set_title(GTK_WINDOW(win_bg), _("Filename: "));
-   gtk_window_set_default_size(GTK_WINDOW(win_bg), 400, 250);
    gtk_window_set_policy(GTK_WINDOW(win_bg), TRUE, TRUE, FALSE);
    gtk_window_set_wmclass(GTK_WINDOW(win_bg), "Ebony", "Background");
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/ebony/src/main.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- main.c      4 Sep 2002 21:20:32 -0000       1.16
+++ main.c      15 Jan 2003 16:33:43 -0000      1.17
@@ -37,9 +37,10 @@
    ebony_base_bg = NULL;
    bl = NULL;
    idle = 0;
+   ebony_base_bg = NULL;
    export_info.screen.w = export_info.screen.h = 0;
    export_info.xinerama.h = export_info.xinerama.v = 1;
-   snprintf(image_fileselection_dir, PATH_MAX, "%s", getenv("HOME"));
+   snprintf(image_fileselection_dir, PATH_MAX, "%s/*", getenv("HOME"));
    snprintf(bg_fileselection_dir, PATH_MAX, "%s", getenv("HOME"));
    snprintf(save_as_fileselection_dir, PATH_MAX, "%s", getenv("HOME"));
    snprintf(export_fileselection_dir, PATH_MAX, "%s", getenv("HOME"));
@@ -55,8 +56,6 @@
 
    bgfile[0] = '\0';
 
-
-
 #ifdef ENABLE_NLS
    bindtextdomain(PACKAGE, PACKAGE_LOCALE_DIR);
    textdomain(PACKAGE);
@@ -78,10 +77,19 @@
    gtk_widget_show(main_win);
    win_ref = main_win;
 
-   rebuild_bg_ref();
-
    gdk_window_get_geometry(GDK_ROOT_PARENT(), &rx, &ry, &rw, &rh, &rd);
    gtk_widget_realize(GTK_WIDGET(main_win));
+
+   export_info.screen.w = rw;
+   export_info.screen.h = rh;
+   if ((w = gtk_object_get_data(GTK_OBJECT(win_ref), "scale_preview")))
+      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
+   if ((w = gtk_object_get_data(GTK_OBJECT(win_ref), "export_screen_w")))
+      gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), export_info.screen.w);
+   if ((w = gtk_object_get_data(GTK_OBJECT(win_ref), "export_screen_h")))
+      gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), export_info.screen.h);
+
+   rebuild_bg_ref();
 
    /* drawing area requests initialization */
    gdk_rgb_init();
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/ebony/src/util.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- util.c      4 Sep 2002 21:20:32 -0000       1.12
+++ util.c      15 Jan 2003 16:33:43 -0000      1.13
@@ -2,13 +2,15 @@
 #include "callbacks.h"
 #include "gtk_util.h"
 #include <gdk/gdkx.h>
-#include <config.h>
 #include "interface.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
 
+#define EBONY_IMAGE_CACHE 4
+#define EBONY_FONT_CACHE 0
+
 /** Parse the ebony previously modified bg dbs 
  * Return a GList 
  */
@@ -91,24 +93,28 @@
 }
 
 char *
-get_dirpath_from_filename(const char *filename)
+get_dirpath_from_filename(const char *file)
 {
-   char *result, *str;
-   int i;
+   char *result, *tok, *buf, dump[PATH_MAX], filename[PATH_MAX];
 
-   result = strdup(filename);
-   i = strlen(filename);
-   while (i--)
-   {
-      if (result[i] == '/')
-         break;
-   }
-   result[i] = '\0';
-   str = strdup(result);
-   result[i] = 'e';
+   snprintf(filename, PATH_MAX, "%s", file);
+   buf = (char *) malloc((sizeof(char) * PATH_MAX) + 1);
 
-   free(result);
-   return (str);
+   memset(buf, 0, sizeof(buf));
+   memset(dump, 0, PATH_MAX);
+
+   if ((tok = strtok(filename, "/")))
+   {
+      do
+      {
+         buf = strncat(buf, dump, PATH_MAX);
+         snprintf(dump, PATH_MAX, "/%s", tok);
+      }
+      while ((tok = strtok(NULL, "/")));
+   }
+   result = strdup(buf);
+   free(buf);
+   return (result);
 }
 
 /**
@@ -167,7 +173,7 @@
 int
 move_layer_up(E_Background_Layer _bl)
 {
-   Evas_List l, ll;
+   Evas_List *l, *ll;
 
    if (!bg)
       return (0);
@@ -194,7 +200,7 @@
 int
 move_layer_down(E_Background_Layer _bl)
 {
-   Evas_List l, ll;
+   Evas_List *l, *ll;
 
    if (!bg)
       return (0);
@@ -218,163 +224,97 @@
  * @_o - the object to outline
  */
 void
-outline_evas_object(Evas_Object _o)
+outline_evas_object(Evas_Object * _o)
 {
    double x, y, w, h;
 
    /* int colors[] = { 255, 255, 255, 255 }; */
    /* int colors[] = { 0, 0, 0, 90 }; */
-   Evas_Object o;
+
+   Evas_Object *o;
 
    if (!_o)
       return;
-   evas_get_geometry(evas, _o, &x, &y, &w, &h);
-   o = evas_object_get_named(evas, "top_line");
+
+   evas_object_geometry_get(_o, &x, &y, &w, &h);
+   o = evas_object_name_find(evas, "top_line");
    if (o)
    {
-      evas_set_line_xy(evas, o, x, y, x + w, y);
-      evas_set_layer(evas, o, 100);
+      evas_object_line_xy_set(o, x, y, x + w, y);
+      evas_object_layer_set(o, 100);
    }
-   o = evas_object_get_named(evas, "bottom_line");
+   o = evas_object_name_find(evas, "bottom_line");
    if (o)
    {
-      evas_set_line_xy(evas, o, x, y + h, x + w, y + h);
-      evas_set_layer(evas, o, 100);
+      evas_object_line_xy_set(o, x, y + h, x + w, y + h);
+      evas_object_layer_set(o, 100);
    }
-   o = evas_object_get_named(evas, "right_line");
+   o = evas_object_name_find(evas, "right_line");
    if (o)
    {
-      evas_set_line_xy(evas, o, x + w, y, x + w, y + h);
-      evas_set_layer(evas, o, 100);
+      evas_object_line_xy_set(o, x + w, y, x + w, y + h);
+      evas_object_layer_set(o, 100);
    }
-   o = evas_object_get_named(evas, "left_line");
+   o = evas_object_name_find(evas, "left_line");
    if (o)
    {
-      evas_set_line_xy(evas, o, x, y, x, y + h);
-      evas_set_layer(evas, o, 100);
-   }
-}
-
-/**
- * fill_background_images - load Imlib2 Image into memory for saving
- * @_bg - the E_Background to be "filled"
- */
-void
-fill_background_images(E_Background _bg)
-{
-   Evas_List l;
-   E_Background_Layer _bl;
-
-   if (!_bg)
-      return;
-   for (l = _bg->layers; l; l = l->next)
-   {
-      _bl = (E_Background_Layer) l->data;
-      if (_bl->type == E_BACKGROUND_TYPE_IMAGE)
-      {
-         if (!_bl->image)
-            _bl->image = imlib_load_image(_bl->file);
-      }
-   }
-}
-
-/**
- * clear_bg_db_keys - clears out all the keys and data in the E_Background
- * @_bg - the bg requesting all of its data to be deleted
- */
-void
-clear_bg_db_keys(E_Background _bg)
-{
-   E_DB_File *db;
-   char **keys;
-   int i, key_count;
-
-   if (!_bg)
-      return;
-   if (!_bg->file)
-      return;
-   db = e_db_open(_bg->file);
-   if (db)
-   {
-      keys = e_db_dump_key_list(_bg->file, &key_count);
-      if (keys)
-      {
-         for (i = 0; i < key_count; i++)
-         {
-            e_db_data_del(db, keys[i]);
-            free(keys[i]);
-         }
-         free(keys);
-      }
-      e_db_close(db);
-      e_db_flush();
+      evas_object_line_xy_set(o, x, y, x, y + h);
+      evas_object_layer_set(o, 100);
    }
 }
 
 void
 redraw_gradient_object(void)
 {
-   Evas_List l;
-   Evas_Gradient og;
+   Evas_List *l;
    E_Background_Gradient g;
 
    if (!bl)
       return;
    if (bl->obj)
-      evas_del_object(evas, bl->obj);
+      evas_object_del(bl->obj);
 
-   bl->obj = evas_add_gradient_box(evas);
-   og = evas_gradient_new();
+   bl->obj = evas_object_gradient_add(evas);
    for (l = bl->gradient.colors; l; l = l->next)
    {
       g = (E_Background_Gradient) l->data;
-      evas_gradient_add_color(og, g->r, g->g, g->b, g->a, 1);
+      evas_object_gradient_color_add(bl->obj, g->r, g->g, g->b, g->a,
+                                     g->dist);
    }
-   evas_set_gradient(evas, bl->obj, og);
-   evas_set_angle(evas, bl->obj, bl->gradient.angle);
-   evas_gradient_free(og);
-
-   evas_show(evas, bl->obj);
+   evas_object_gradient_angle_set(bl->obj, bl->gradient.angle);
+   evas_object_show(bl->obj);
    return;
    UN(g);
+   UN(l);
 }
 
 void
 setup_evas(Display * disp, Window win, Visual * vis, Colormap cm, int w,
            int h)
 {
-   Evas_Object o;
+   Evas_Object *o;
+   Evas_Engine_Info_Software_X11 *einfo;
 
    int colors[] = { 255, 255, 255, 255 };
 
    evas = evas_new();
-   evas_set_output_method(evas, RENDER_METHOD_ALPHA_SOFTWARE);
-   evas_set_output(evas, disp, win, vis, cm);
-   evas_set_output_size(evas, w, h);
-   evas_set_output_viewport(evas, 0, 0, w, h);
-   evas_set_font_cache(evas, ((1024 * 1024) * 1));
-   evas_set_image_cache(evas, ((1024 * 1024) * 4));
-   evas_font_add_path(evas, PACKAGE_DATA_DIR "/fnt/");
-
-   o = evas_add_line(evas);
-   evas_object_set_name(evas, o, "top_line");
-   evas_set_color(evas, o, colors[0], colors[1], colors[2], colors[3]);
-   evas_show(evas, o);
-
-   o = evas_add_line(evas);
-   evas_object_set_name(evas, o, "bottom_line");
-   evas_set_color(evas, o, colors[0], colors[1], colors[2], colors[3]);
-   evas_show(evas, o);
-
-   o = evas_add_line(evas);
-   evas_object_set_name(evas, o, "left_line");
-   evas_set_color(evas, o, colors[0], colors[1], colors[2], colors[3]);
-   evas_show(evas, o);
-
-   o = evas_add_line(evas);
-   evas_object_set_name(evas, o, "right_line");
-   evas_set_color(evas, o, colors[0], colors[1], colors[2], colors[3]);
-   evas_show(evas, o);
+   evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
+   evas_output_size_set(evas, w, h);
+   evas_output_viewport_set(evas, 0, 0, w, h);
+
+   einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(evas);
+   einfo->info.display = disp;
+   einfo->info.visual = vis;
+   einfo->info.colormap = cm;
+   einfo->info.drawable = win;
+   einfo->info.depth = DefaultDepth(disp, DefaultScreen(disp));
+   einfo->info.rotation = 0;
+   einfo->info.debug = 0;
+   evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
+
+   evas_object_image_cache_set(evas, (1024 * 1024) * EBONY_IMAGE_CACHE);
+   evas_object_font_cache_set(evas, (1024 * 1024) * EBONY_FONT_CACHE);
+   evas_object_font_path_append(evas, PACKAGE_DATA_DIR "/fnt");
 
    ebony_base_bg = e_bg_load(PACKAGE_DATA_DIR "/pixmaps/base.bg.db");
    if (ebony_base_bg)
@@ -390,6 +330,25 @@
               PACKAGE_DATA_DIR "/pixmaps/base.bg.db");
    }
 
+   o = evas_object_line_add(evas);
+   evas_object_name_set(o, "top_line");
+   evas_object_color_set(o, colors[0], colors[1], colors[2], colors[3]);
+   evas_object_show(o);
+
+   o = evas_object_line_add(evas);
+   evas_object_name_set(o, "bottom_line");
+   evas_object_color_set(o, colors[0], colors[1], colors[2], colors[3]);
+   evas_object_show(o);
+
+   o = evas_object_line_add(evas);
+   evas_object_name_set(o, "left_line");
+   evas_object_color_set(o, colors[0], colors[1], colors[2], colors[3]);
+   evas_object_show(o);
+
+   o = evas_object_line_add(evas);
+   evas_object_name_set(o, "right_line");
+   evas_object_color_set(o, colors[0], colors[1], colors[2], colors[3]);
+   evas_object_show(o);
 }
 
 void
@@ -424,6 +383,10 @@
                             (gtk_range_get_adjustment(GTK_RANGE(w))),
                             "value_changed",
                             GTK_SIGNAL_FUNC(on_scale_scroll_request), NULL);
+      gtk_widget_set_usize(bg_ref, export_info.screen.w / 3,
+                           export_info.screen.h / 3);
+      /* gtk_widget_set_uposition(bg_ref, export_info.screen.x,
+         export_info.screen.y); */
    }
    w = gtk_object_get_data(GTK_OBJECT(bg_ref), "_ebony_statusbar");
    if (w)
@@ -442,7 +405,7 @@
 static void
 e_bg_resize_scaled(E_Background _bg, int width, int height, double scale)
 {
-   Evas_List l;
+   Evas_List *l;
    int i;
 
    if (!_bg)
@@ -450,9 +413,9 @@
    if (!_bg->evas)
       return;
 
-   evas_move(_bg->evas, _bg->base_obj, _bg->x, _bg->y);
-   evas_resize(_bg->evas, _bg->base_obj, (double) width * scale,
-               (double) height * scale);
+   evas_object_move(_bg->base_obj, _bg->x, _bg->y);
+   evas_object_resize(_bg->base_obj, (double) width * scale,
+                      (double) height * scale);
    for (i = 0, l = _bg->layers; l; l = l->next, i++)
    {
       E_Background_Layer bl;
@@ -478,7 +441,7 @@
       /* object is an image, resize and calculate fill */
       if (bl->type == E_BACKGROUND_TYPE_IMAGE)
       {
-         evas_get_image_size(_bg->evas, bl->obj, &iw, &ih);
+         evas_object_image_size_get(bl->obj, &iw, &ih);
          if (bl->size.orig.w)
             w = (double) iw *bl->size.w;
 
@@ -520,23 +483,25 @@
       x += (scale * (double) bl->abs.x);
       y += (scale * (double) bl->abs.y);
 
-      evas_move(_bg->evas, bl->obj, x, y);
-      evas_resize(_bg->evas, bl->obj, w, h);
+      evas_object_move(bl->obj, x, y);
+      evas_object_resize(bl->obj, w, h);
 
       switch (bl->type)
       {
         case E_BACKGROUND_TYPE_IMAGE:
-           evas_set_image_fill(_bg->evas, bl->obj,
-                               (double) _bg->geom.sx * bl->scroll.x,
-                               (double) _bg->geom.sy * bl->scroll.y, fw, fh);
+           evas_object_image_fill_set(bl->obj,
+                                      (double) _bg->geom.sx * bl->scroll.x,
+                                      (double) _bg->geom.sy * bl->scroll.y,
+                                      fw, fh);
            break;
         case E_BACKGROUND_TYPE_GRADIENT:
            /* FIXME Necessary to call again ? */
-           evas_set_angle(_bg->evas, bl->obj, bl->gradient.angle);
+           evas_object_gradient_angle_set(bl->obj, bl->gradient.angle);
            break;
         case E_BACKGROUND_TYPE_SOLID:
            break;
         default:
+          break;
       }
    }
 }
@@ -560,7 +525,7 @@
 
    if (!_bg)
       return;
-   evas_get_drawable_size(evas, &ww, &wh);
+   evas_output_size_get(evas, &ww, &wh);
 
    /* fill the evas */
    if (height <= 0 || width <= 0)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/ebony/src/util.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- util.h      4 Sep 2002 21:20:32 -0000       1.9
+++ util.h      15 Jan 2003 16:33:43 -0000      1.10
@@ -9,7 +9,7 @@
 /* strip .bg.db off the end strip prefixing directory paths */
 char *get_shortname_for(const char *s);
 void update_background(E_Background _bg);
-void outline_evas_object(Evas_Object _o);
+void outline_evas_object(Evas_Object * _o);
 int move_layer_up(E_Background_Layer _bl);
 int move_layer_down(E_Background_Layer _bl);
 void clear_bg_db_keys(E_Background _bg);




-------------------------------------------------------
This SF.NET email is sponsored by: Take your first step towards giving 
your online business a competitive advantage. Test-drive a Thawte SSL 
certificate - our easy online guide will show you how. Click here to get 
started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to