Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_gadcon.c e_gadcon.h e_menu.c e_shelf.c 


Log Message:


more gadcon work... oooh getting close.

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_gadcon.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- e_gadcon.c  10 Feb 2006 09:26:12 -0000      1.7
+++ e_gadcon.c  10 Feb 2006 12:21:22 -0000      1.8
@@ -43,6 +43,7 @@
 static void e_gadcon_layout_pack_request_set(Evas_Object *obj, int pos, int 
size);
 static void e_gadcon_layout_pack_options_set(Evas_Object *obj, int pos, int 
size, int res);
 static void e_gadcon_layout_pack_min_size_set(Evas_Object *obj, int w, int h);
+static void e_gadcon_layout_pack_aspect_set(Evas_Object *obj, int w, int h);
 static void e_gadcon_layout_unpack(Evas_Object *obj);
 
 static Evas_Hash *providers = NULL;
@@ -161,8 +162,8 @@
    E_Config_Gadcon *cf_gc;
    E_Config_Gadcon_Client *cf_gcc;
    
-   E_OBJECT_CHECK_RETURN(gc, NULL);
-   E_OBJECT_TYPE_CHECK_RETURN(gc, E_GADCON_TYPE, NULL);
+   E_OBJECT_CHECK(gc);
+   E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
    ok = 0;
    e_gadcon_layout_freeze(gc->o_container);
    printf("e_config->gadcons = %p\n", e_config->gadcons);
@@ -184,7 +185,6 @@
             E_Gadcon_Client_Class *cc;
             
             cf_gcc = l->data;
-            printf("cf_gcc->name = %s\n", cf_gcc->name);
             cc = evas_hash_find(providers, cf_gcc->name);
             if (cc)
               {
@@ -295,6 +295,40 @@
      }
 }
 
+EAPI void
+e_gadcon_zone_set(E_Gadcon *gc, E_Zone *zone)
+{
+   E_OBJECT_CHECK(gc);
+   E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
+   gc->zone = zone;
+}
+
+EAPI E_Zone *
+e_gadcon_zone_get(E_Gadcon *gc)
+{
+   E_OBJECT_CHECK_RETURN(gc, NULL);
+   E_OBJECT_TYPE_CHECK_RETURN(gc, E_GADCON_TYPE, NULL);
+   return gc->zone;
+}
+
+EAPI void
+e_gadcon_ecore_evas_set(E_Gadcon *gc, Ecore_Evas *ee)
+{
+   E_OBJECT_CHECK(gc);
+   E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
+   gc->ecore_evas = ee;
+}
+
+EAPI int
+e_gadcon_canvas_zone_geometry_get(E_Gadcon *gc, int *x, int *y, int *w, int *h)
+{
+   E_OBJECT_CHECK_RETURN(gc, 0);
+   E_OBJECT_TYPE_CHECK_RETURN(gc, E_GADCON_TYPE, 0);
+   if (!gc->ecore_evas) return 0;
+   ecore_evas_geometry_get(gc->ecore_evas, x, y, w, h);
+   return 1;
+}
+
 EAPI E_Gadcon_Client *
 e_gadcon_client_new(E_Gadcon *gc, char *name, char *id, Evas_Object *base_obj)
 {
@@ -432,6 +466,14 @@
    e_gadcon_layout_pack_min_size_set(gcc->o_base, w, h);
 }
 
+EAPI void
+e_gadcon_client_aspect_set(E_Gadcon_Client *gcc, int w, int h)
+{
+   E_OBJECT_CHECK(gcc);
+   E_OBJECT_TYPE_CHECK(gcc, E_GADCON_CLIENT_TYPE);
+   e_gadcon_layout_pack_aspect_set(gcc->o_base, w, h);
+}
+
 /* local subsystem functions */
 static void
 _e_gadcon_free(E_Gadcon *gc)
@@ -759,8 +801,8 @@
    } ask;
    int              hookp;
    struct {
-      Evas_Coord    w, h;
-   } min, max;
+      int           w, h;
+   } min, aspect;
    Evas_Coord       x, y, w, h;
    Evas_Object     *obj;
    unsigned char    can_move : 1;
@@ -1008,6 +1050,18 @@
 }
 
 static void
+e_gadcon_layout_pack_aspect_set(Evas_Object *obj, int w, int h)
+{
+   E_Gadcon_Layout_Item *bi;
+   
+   bi = evas_object_data_get(obj, "e_gadcon_layout_data");
+   if (!bi) return;
+   bi->aspect.w = w;
+   bi->aspect.h = h;
+   _e_gadcon_layout_smart_reconfigure(bi->sd);
+}
+
+static void
 e_gadcon_layout_unpack(Evas_Object *obj)
 {
    E_Gadcon_Layout_Item *bi;
@@ -1137,6 +1191,17 @@
        else
          min += bi->min.h;
        bi->ask.size2 = bi->ask.size;
+       if ((bi->aspect.w > 0) && (bi->aspect.h > 0))
+         {
+            if (sd->horizontal)
+              {
+                 bi->ask.size2 = (h * bi->aspect.w) / bi->aspect.h;
+              }
+            else 
+              {
+                 bi->ask.size2 = (w * bi->aspect.h) / bi->aspect.w;
+              }
+         }
      }
    if (sd->horizontal)
      {
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_gadcon.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e_gadcon.h  10 Feb 2006 08:14:57 -0000      1.6
+++ e_gadcon.h  10 Feb 2006 12:21:22 -0000      1.7
@@ -45,6 +45,8 @@
       Evas_Object      *o_parent;
       char             *swallow_name;
    } edje;
+   Ecore_Evas          *ecore_evas;
+   E_Zone              *zone;
    
    E_Gadcon_Orient      orient;
    
@@ -96,10 +98,15 @@
 EAPI void             e_gadcon_edit_end(E_Gadcon *gc);
 EAPI void             e_gadcon_all_edit_begin(void);
 EAPI void             e_gadcon_all_edit_end(void);
+EAPI void             e_gadcon_zone_set(E_Gadcon *gc, E_Zone *zone);
+EAPI E_Zone          *e_gadcon_zone_get(E_Gadcon *gc);
+EAPI void             e_gadcon_ecore_evas_set(E_Gadcon *gc, Ecore_Evas *ee);
+EAPI int              e_gadcon_canvas_zone_geometry_get(E_Gadcon *gc, int *x, 
int *y, int *w, int *h);
     
 EAPI E_Gadcon_Client *e_gadcon_client_new(E_Gadcon *gc, char *name, char *id, 
Evas_Object *base_obj);
 EAPI void             e_gadcon_client_size_request(E_Gadcon_Client *gcc, 
Evas_Coord w, Evas_Coord h);
 EAPI void             e_gadcon_client_min_size_set(E_Gadcon_Client *gcc, 
Evas_Coord w, Evas_Coord h);
+EAPI void             e_gadcon_client_aspect_set(E_Gadcon_Client *gcc, int w, 
int h);
 EAPI void             e_gadcon_client_edit_begin(E_Gadcon_Client *gcc);
 EAPI void             e_gadcon_client_edit_end(E_Gadcon_Client *gcc);
     
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_menu.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -3 -r1.48 -r1.49
--- e_menu.c    3 Feb 2006 06:16:25 -0000       1.48
+++ e_menu.c    10 Feb 2006 12:21:22 -0000      1.49
@@ -182,7 +182,9 @@
       case E_MENU_POP_DIRECTION_LEFT:
        _e_menu_realize(m);
        m->cur.x = x - m->cur.w;
-       m->cur.y = y ;
+       m->cur.y = y;
+       if ((m->cur.y + m->cur.h) > (m->zone->y + m->zone->h))
+         m->cur.y = y + h - m->cur.h;
        _e_menu_activate_first();
        break;
       case E_MENU_POP_DIRECTION_RIGHT:
@@ -192,14 +194,20 @@
        break;
       case E_MENU_POP_DIRECTION_UP:
        _e_menu_realize(m);
-       m->cur.x = x + w;
+       m->cur.x = x;
+       if ((m->cur.x + m->cur.w) > (m->zone->x + m->zone->w))
+         m->cur.x = x + w - m->cur.w;
        m->cur.y = y - m->cur.h;
        _e_menu_activate_last();
        break;
       case E_MENU_POP_DIRECTION_DOWN:
        _e_menu_realize(m);
-       m->cur.x = x + w;
+       m->cur.x = x;
+       if ((m->cur.x + m->cur.w) > (m->zone->x + m->zone->w))
+         m->cur.x = x + w - m->cur.w;
        m->cur.y = y + h;
+       if ((m->cur.y + m->cur.h) > (m->zone->y + m->zone->h))
+         m->cur.y = y + h - m->cur.h;
        _e_menu_activate_first();
        break;
       case E_MENU_POP_DIRECTION_AUTO:
@@ -238,20 +246,33 @@
       case E_MENU_POP_DIRECTION_LEFT:
        _e_menu_realize(m);
        m->cur.x = x - m->cur.w;
-       m->cur.y = y ;
+       m->cur.y = y;
+       if ((m->cur.y + m->cur.h) > (m->zone->y + m->zone->h))
+         m->cur.y = y + h - m->cur.h;
+       _e_menu_activate_first();
        break;
       case E_MENU_POP_DIRECTION_RIGHT:
        m->cur.x = x + w;
        m->cur.y = y ;
+       _e_menu_activate_first();
        break;
       case E_MENU_POP_DIRECTION_UP:
        _e_menu_realize(m);
-       m->cur.x = x + w;
+       m->cur.x = x;
+       if ((m->cur.x + m->cur.w) > (m->zone->x + m->zone->w))
+         m->cur.x = x + w - m->cur.w;
        m->cur.y = y - m->cur.h;
+       _e_menu_activate_last();
        break;
       case E_MENU_POP_DIRECTION_DOWN:
-       m->cur.x = x + w;
+       _e_menu_realize(m);
+       m->cur.x = x;
+       if ((m->cur.x + m->cur.w) > (m->zone->x + m->zone->w))
+         m->cur.x = x + w - m->cur.w;
        m->cur.y = y + h;
+       if ((m->cur.y + m->cur.h) > (m->zone->y + m->zone->h))
+         m->cur.y = y + h - m->cur.h;
+       _e_menu_activate_first();
        break;
       case E_MENU_POP_DIRECTION_AUTO:
        _e_menu_auto_place(m, x, y, w, h);
@@ -282,20 +303,33 @@
       case E_MENU_POP_DIRECTION_LEFT:
        _e_menu_realize(m);
        m->cur.x = x - m->cur.w;
-       m->cur.y = y ;
+       m->cur.y = y;
+       if ((m->cur.y + m->cur.h) > (m->zone->y + m->zone->h))
+         m->cur.y = y + h - m->cur.h;
+       _e_menu_activate_first();
        break;
       case E_MENU_POP_DIRECTION_RIGHT:
        m->cur.x = x + w;
        m->cur.y = y ;
+       _e_menu_activate_first();
        break;
       case E_MENU_POP_DIRECTION_UP:
        _e_menu_realize(m);
-       m->cur.x = x + w;
+       m->cur.x = x;
+       if ((m->cur.x + m->cur.w) > (m->zone->x + m->zone->w))
+         m->cur.x = x + w - m->cur.w;
        m->cur.y = y - m->cur.h;
+       _e_menu_activate_last();
        break;
       case E_MENU_POP_DIRECTION_DOWN:
-       m->cur.x = x + w;
+       _e_menu_realize(m);
+       m->cur.x = x;
+       if ((m->cur.x + m->cur.w) > (m->zone->x + m->zone->w))
+         m->cur.x = x + w - m->cur.w;
        m->cur.y = y + h;
+       if ((m->cur.y + m->cur.h) > (m->zone->y + m->zone->h))
+         m->cur.y = y + h - m->cur.h;
+       _e_menu_activate_first();
        break;
       case E_MENU_POP_DIRECTION_AUTO:
        _e_menu_auto_place(m, x, y, w, h);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_shelf.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_shelf.c   5 Feb 2006 08:17:40 -0000       1.2
+++ e_shelf.c   10 Feb 2006 12:21:22 -0000      1.3
@@ -51,10 +51,11 @@
    snprintf(buf, sizeof(buf), "%i", shelf_id);
    shelf_id++;
    es->gadcon = e_gadcon_swallowed_new(es->name, buf, es->o_base, "items");
-   e_gadcon_orient(es->gadcon, E_GADCON_ORIENT_HORIZ);
+   e_gadcon_orient(es->gadcon, E_GADCON_ORIENT_TOP);
+   e_gadcon_zone_set(es->gadcon, zone);
+   e_gadcon_ecore_evas_set(es->gadcon, es->ee);
    
    shelves = evas_list_append(shelves, es);
-   
    return es;
 }
 




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to