Enlightenment CVS committal

Author  : dj2
Project : misc
Module  : eke

Dir     : misc/eke/src


Modified Files:
        eke_gui_edje.c eke_gui_edje_item.c 


Log Message:
- highlight menu items when feeds change
- slow the scrolling of menu items down a bit
- add scrollbars to the text entrys. Don't work right yet, and seem to get
  text overflowing on top of them at the moment

===================================================================
RCS file: /cvsroot/enlightenment/misc/eke/src/eke_gui_edje.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- eke_gui_edje.c      30 Dec 2004 20:31:01 -0000      1.9
+++ eke_gui_edje.c      30 Dec 2004 21:21:45 -0000      1.10
@@ -149,6 +149,7 @@
         evas_object_show(disp->body);
     }
     edje_object_part_text_set(disp->menu_item, "label", feed->title);
+    edje_object_signal_emit(disp->menu_item, "feed,list,item,updated", "");
 
     /* if there is no current feed displayed, then show this one */
     if ((!edje_object_part_swallow_get(eke->gui.edje.edje, "feed.body"))) 
@@ -187,6 +188,7 @@
     }
 
     disp = ecore_hash_get(eke->feeds, feed);
+    edje_object_signal_emit(disp->menu_item, "feed,list,item,default", "");
     edje_object_part_swallow(eke->gui.edje.edje, "feed.body", disp->body);
     evas_object_show(disp->body);
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/eke/src/eke_gui_edje_item.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- eke_gui_edje_item.c 30 Dec 2004 05:03:09 -0000      1.5
+++ eke_gui_edje_item.c 30 Dec 2004 21:21:45 -0000      1.6
@@ -10,6 +10,7 @@
 #include <Edje.h>
 #include <Etox.h>
 #include <Ecore.h>
+#include <Esmart/Esmart_Container.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -17,8 +18,9 @@
 
 #include "eke_gui_edje_item.h"
 
-Evas_Object*
-eke_gui_edje_item_new(Evas *e, const char *file, const char *group);
+static void eke_gui_edje_item_feed_container_scroll_cb(void *data, Evas_Object 
*o, 
+                                    const char *em, const char *src);
+
 /* smart object handlers */
 static Evas_Smart * _eke_gui_edje_item_object_smart_get();
 static Evas_Object * eke_gui_edje_item_object_new(Evas *evas);
@@ -104,14 +106,18 @@
     if(edje_object_part_exists(data->obj, "body"))
     {
         if(body) {
-            Evas_Object *desc;
+            Evas_Object *desc, *container;
             Etox_Context *ctx;
-            
+            Evas_Coord w, h;
+            Evas *evas;
+           
+            evas = evas_object_evas_get(o);
+
             if((desc = edje_object_part_swallow_get(data->obj, "body"))) 
             {
                 evas_object_del(desc);
             }
-            desc = etox_new(evas_object_evas_get(o));
+            desc = etox_new(evas);
             ctx = etox_get_context(desc);
             etox_context_set_color(ctx, 0, 0, 0, 255);
             etox_context_set_font(ctx, "Vera", 10);
@@ -122,8 +128,28 @@
             etox_set_word_wrap(desc, 1);
             etox_set_text(desc, (char *)body);
             evas_object_show(desc);
-            edje_object_part_swallow(data->obj, "body", desc);
-        } else {
+
+            container = esmart_container_new(evas);
+            esmart_container_padding_set(container, 0, 0, 0, 0);
+            esmart_container_spacing_set(container, 0);
+            esmart_container_move_button_set(container, 2);
+            esmart_container_fill_policy_set(container,
+                                        CONTAINER_FILL_POLICY_FILL_X);
+            esmart_container_alignment_set(container, CONTAINER_ALIGN_TOP);
+            esmart_container_direction_set(container,
+                                        CONTAINER_DIRECTION_VERTICAL);
+            evas_object_show(container);
+
+            edje_object_part_geometry_get(data->obj, "body", NULL, NULL, &w, 
&h);
+            evas_object_resize(desc, w, h);
+
+            esmart_container_element_append(container, desc);
+            edje_object_part_swallow(data->obj, "body", container);
+
+            edje_object_signal_callback_add(data->obj, "drag",
+                                    "feed.body.item.scroll",
+                                    eke_gui_edje_item_feed_container_scroll_cb,
+                                    container);
         }
     }
 
@@ -162,6 +188,56 @@
   return(result);
 }
 
+static void
+eke_gui_edje_item_feed_container_scroll_cb(void *data, Evas_Object *o, 
+                                    const char *em, const char *src)
+{
+    double sx = 0.0, sy = 0.0;
+    Evas_Coord container_length = 0.0;
+    Evas_Object *container = NULL;
+    Evas_Coord cw = (Evas_Coord)0.0, ch = (Evas_Coord)0.0;
+    Evas_List *list;
+
+    if ((container = (Evas_Object*)data)) {
+        Evas_Object *etox;
+
+        edje_object_part_geometry_get(o, "body", NULL, NULL, &cw, &ch);
+
+        /* container_length dosen't seem be be right if i do
+         * esmart_container_elements_length_get(container) so i'm doing this
+         * the hard way... */
+        list = esmart_container_elements_get(container);
+        etox = evas_list_nth(list, 0);
+        etox_text_geometry_get(etox, NULL, &container_length);
+        edje_object_part_drag_value_get(o, src, &sx, &sy);
+
+        switch (esmart_container_direction_get(container)) {
+            case CONTAINER_DIRECTION_HORIZONTAL:
+                if(container_length > cw) {
+                    container_length -= cw;
+                    esmart_container_scroll_offset_set(container,
+                                              - (int) (sx * container_length));
+                }
+                break;
+
+            case CONTAINER_DIRECTION_VERTICAL:
+                if(container_length > ch) {
+                    container_length -= ch;
+                    esmart_container_scroll_offset_set(container,
+                                              - (int) (sy * container_length));
+                }
+                break;
+
+            default:
+                fprintf(stderr, "Unknown Container Orientation\n");
+                break;
+        }
+    }
+
+    return;
+    em = NULL;
+}
+
 /*==========================================================================
  * Smart Object Code, Go Away
  *========================================================================*/




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to