Some support for multiple containers -- map new windows to the currently visible...
authorxcomputerman <xcomputerman>
Wed, 5 Jan 2005 08:30:25 +0000 (08:30 +0000)
committerxcomputerman <xcomputerman@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 5 Jan 2005 08:30:25 +0000 (08:30 +0000)
SVN revision: 12773

AUTHORS
src/bin/e_container.c
src/bin/e_container.h
src/bin/e_int_menus.c
src/bin/e_manager.c
src/bin/e_manager.h

diff --git a/AUTHORS b/AUTHORS
index 7bf31c1..65cf7c2 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,2 +1,3 @@
 The Rasterman (Carsten Haitzler) <raster@rasterman.com>
+Ibukun Olumuyiwa <ibukun@computer.org>
 
index 065638f..8e17db7 100644 (file)
@@ -1,3 +1,6 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
 #include "e.h"
 
 /* TODO List:
@@ -38,6 +41,7 @@ e_container_new(E_Manager *man)
    E_Container *con;
    E_Zone *zone;
    Evas_Object *o;
+   char name[40];
    
    con = E_OBJECT_ALLOC(E_Container, _e_container_free);
    if (!con) return NULL;
@@ -72,6 +76,10 @@ e_container_new(E_Manager *man)
    
    e_pointer_container_set(con);
 
+   con->num = evas_list_count(con->manager->containers);
+   snprintf(name, sizeof(name), "Container %d", con->num);
+   con->name = strdup(name);
+
    /* FIXME: Add ecore code to fetch xinerama screens for zones */
    zone = e_zone_new(con, 0, 0, con->w, con->h);
    
@@ -97,6 +105,21 @@ e_container_hide(E_Container *con)
    con->visible = 0;
 }
 
+E_Container *
+e_container_current_get(E_Manager *man)
+{
+   Evas_List *l;
+   E_OBJECT_CHECK_RETURN(man, NULL);
+
+   for (l = man->containers; l; l = l->next)
+     {
+       E_Container *con = l->data;
+       if (con->visible)
+         return con;
+     }
+   return NULL;
+}
+
 void
 e_container_move(E_Container *con, int x, int y)
 {
index d7d2d95..dd9d2a6 100644 (file)
@@ -26,6 +26,9 @@ struct _E_Container
    char                 visible : 1;
    E_Manager           *manager;
    
+   int                  num;
+   char                *name;
+   
    Ecore_Evas          *bg_ecore_evas;
    Evas                *bg_evas;
    Evas_Object         *bg_blank_object;
@@ -64,6 +67,7 @@ EAPI int          e_container_shutdown(void);
 EAPI E_Container *e_container_new(E_Manager *man);
 EAPI void         e_container_show(E_Container *con);
 EAPI void         e_container_hide(E_Container *con);
+EAPI E_Container *e_container_current_get(E_Manager *man);
 EAPI void         e_container_move(E_Container *con, int x, int y);
 EAPI void         e_container_resize(E_Container *con, int w, int h);
 EAPI void         e_container_move_resize(E_Container *con, int x, int y, int w, int h);
index 1199b9b..f5372ff 100644 (file)
@@ -304,7 +304,7 @@ _e_int_menus_desktops_pre_cb(void *data, E_Menu *m)
    m->items = NULL;
 
    mi = e_menu_item_new(m);
-   e_menu_item_label_set(mi, "Add New Desktop");
+   e_menu_item_label_set(mi, "New Desktop");
    e_menu_item_callback_set(mi, _e_int_menus_desktops_add_cb, NULL);
    
    mi = e_menu_item_new(m);
index 98f23ed..880486a 100644 (file)
@@ -1,3 +1,6 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
 #include "e.h"
 
 /* local subsystem functions */
@@ -185,7 +188,7 @@ _e_manager_cb_window_show_request(void *data, int ev_type, void *ev)
        E_Container *con;
        E_Border *bd;
        
-       con = man->containers->data;
+       con = e_container_current_get(man);
        if (!e_border_find_by_client_window(e->win))
          {
             bd = e_border_new(con, e->win, 0);
index 48f652f..20599ea 100644 (file)
@@ -19,13 +19,13 @@ EAPI int        e_manager_init(void);
 EAPI int        e_manager_shutdown(void);
 EAPI Evas_List *e_manager_list(void);
     
-EAPI E_Manager *e_manager_new(Ecore_X_Window root);
-EAPI void       e_manager_show(E_Manager *man);
-EAPI void       e_manager_hide(E_Manager *man);
-EAPI void       e_manager_move(E_Manager *man, int x, int y);
-EAPI void       e_manager_resize(E_Manager *man, int w, int h);
-EAPI void       e_manager_move_resize(E_Manager *man, int x, int y, int w, int h);
-EAPI void       e_manager_raise(E_Manager *man);
-EAPI void       e_manager_lower(E_Manager *man);
+EAPI E_Manager      *e_manager_new(Ecore_X_Window root);
+EAPI void            e_manager_show(E_Manager *man);
+EAPI void            e_manager_hide(E_Manager *man);
+EAPI void            e_manager_move(E_Manager *man, int x, int y);
+EAPI void            e_manager_resize(E_Manager *man, int w, int h);
+EAPI void            e_manager_move_resize(E_Manager *man, int x, int y, int w, int h);
+EAPI void            e_manager_raise(E_Manager *man);
+EAPI void            e_manager_lower(E_Manager *man);
 
 #endif