Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e.h e_apps.c e_apps.h e_border.c e_eapp_main.c e_int_menus.c 
        e_utils.c e_utils.h 


Log Message:


todo--

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- e.h 29 Jun 2005 14:28:45 -0000      1.24
+++ e.h 1 Jul 2005 04:09:28 -0000       1.25
@@ -16,6 +16,7 @@
 #include <sys/param.h>
 #include <dlfcn.h>
 #include <math.h>
+#include <fnmatch.h>
 
 #include <Evas.h>
 #include <Ecore.h>
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_apps.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -3 -r1.53 -r1.54
--- e_apps.c    29 Jun 2005 07:29:10 -0000      1.53
+++ e_apps.c    1 Jul 2005 04:09:28 -0000       1.54
@@ -516,7 +516,7 @@
 }
 
 E_App *
-e_app_window_name_class_find(char *name, char *class)
+e_app_window_name_class_title_find(char *name, char *class, char *title)
 {
    Evas_List *l;
    
@@ -526,24 +526,27 @@
    for (l = _e_apps_list; l; l = l->next)
      {
        E_App *a;
+       int ok;
        
        a = l->data;
-       if ((a->win_name) || (a->win_class))
+       ok = 0;
+       if ((a->win_name) || (a->win_class) || (a->win_title))
          {
-            int ok = 0;
-            
             if ((!a->win_name) ||
-                ((a->win_name) && name && (!strcmp(a->win_name, name))))
+                ((a->win_name) && (name) && (!strcmp(a->win_name, name))))
               ok++;
             if ((!a->win_class) ||
-                ((a->win_class) && class && (!strcmp(a->win_class, class))))
+                ((a->win_class) && (class) && (!strcmp(a->win_class, class))))
               ok++;
-            if (ok >= 2)
-              {
-                 _e_apps_list = evas_list_remove_list(_e_apps_list, l);
-                 _e_apps_list = evas_list_prepend(_e_apps_list, a);
-                 return a;
-              }
+            if ((!a->win_title) ||
+                ((a->win_title) && (title) && (e_util_glob_match(title, 
a->win_title))))
+              ok++;
+         }
+       if (ok >= 3)
+         {
+            _e_apps_list = evas_list_remove_list(_e_apps_list, l);
+            _e_apps_list = evas_list_prepend(_e_apps_list, a);
+            return a;
          }
      }
    return NULL;
@@ -819,6 +822,15 @@
        a->win_class = str;
        free(v);
      }
+   v = eet_read(ef, "app/window/title", &size);
+   if (v)
+     {
+       str = malloc(size + 1);
+       memcpy(str, v, size);
+       str[size] = 0;
+       a->win_title = str;
+       free(v);
+     }
    v = eet_read(ef, "app/info/startup_notify", &size);
    if (v)
      {
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_apps.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- e_apps.h    10 Jun 2005 21:26:50 -0000      1.14
+++ e_apps.h    1 Jul 2005 04:09:29 -0000       1.15
@@ -37,6 +37,7 @@
 
    char               *win_name; /* window name */
    char               *win_class; /* window class */
+   char               *win_title; /* window title */
    
    Evas_List          *subapps; /* if this a directory, a list of more E_App's 
*/
    
@@ -74,7 +75,7 @@
 EAPI void   e_app_change_callback_add(void (*func) (void *data, E_App *a, 
E_App_Change ch), void *data);
 EAPI void   e_app_change_callback_del(void (*func) (void *data, E_App *a, 
E_App_Change ch), void *data);
 
-EAPI E_App *e_app_window_name_class_find(char *name, char *class);
+EAPI E_App *e_app_window_name_class_title_find(char *name, char *class, char 
*title);
 EAPI E_App *e_app_file_find(char *file);
 EAPI E_App *e_app_name_find(char *name);
 EAPI E_App *e_app_generic_find(char *generic);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v
retrieving revision 1.296
retrieving revision 1.297
diff -u -3 -r1.296 -r1.297
--- e_border.c  1 Jul 2005 02:50:55 -0000       1.296
+++ e_border.c  1 Jul 2005 04:09:29 -0000       1.297
@@ -1719,9 +1719,13 @@
    if ((bd->client.icccm.name) && (bd->client.icccm.class))
      {
        E_App *a;
-
-       a = e_app_window_name_class_find(bd->client.icccm.name,
-                                        bd->client.icccm.class);
+       char *title = "";
+       
+       if (bd->client.netwm.name) title = bd->client.netwm.name;
+       else title = bd->client.icccm.title;
+       a = e_app_window_name_class_title_find(bd->client.icccm.name,
+                                              bd->client.icccm.class,
+                                              title);
        if (a)
          {
             o = edje_object_add(evas);
@@ -4891,12 +4895,15 @@
 
    if (ecore_file_app_installed("e_util_eapp_edit"))
      {
+       char *title = "";
+       
+       if (bd->client.netwm.name) title = bd->client.netwm.name;
+       else title = bd->client.icccm.title;
        mi = e_menu_item_new(m);
        e_menu_item_separator_set(mi, 1);
-
-       a = e_app_window_name_class_find(bd->client.icccm.name,
-                                        bd->client.icccm.class);
-
+       a = e_app_window_name_class_title_find(bd->client.icccm.name,
+                                              bd->client.icccm.class,
+                                              title);
        if (a)
          {
             mi = e_menu_item_new(m);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_eapp_main.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e_eapp_main.c       18 Jun 2005 01:35:30 -0000      1.6
+++ e_eapp_main.c       1 Jul 2005 04:09:30 -0000       1.7
@@ -23,6 +23,7 @@
    int del_exe = 0;
    int del_win_name = 0;
    int del_win_class = 0;
+   int del_win_title = 0;
    int del_startup_notify = 0;
    int del_wait_exit = 0;
    char *file = NULL;
@@ -32,6 +33,7 @@
    char *set_exe = NULL;
    char *set_win_name = NULL;
    char *set_win_class = NULL;
+   char *set_win_title = NULL;
    int   set_startup_notify = -1;
    int   set_wait_exit = -1;
    
@@ -80,6 +82,12 @@
             set_win_class = argv[i];
              valid_args++;
          }
+       else if ((!strcmp(argv[i], "-set-win-title")) && (i < (argc - 1)))
+         {
+            i++;
+            set_win_title = argv[i];
+             valid_args++;
+         }
        else if ((!strcmp(argv[i], "-set-startup-notify")) && (i < (argc - 1)))
          {
             i++;
@@ -100,6 +108,7 @@
             del_exe = 1;
             del_win_name = 1;
             del_win_class = 1;
+            del_win_title = 1;
             del_startup_notify = 1;
             del_wait_exit = 1;
              valid_args++;
@@ -134,6 +143,11 @@
             del_win_class = 1;
              valid_args++;
          }
+       else if ((!strcmp(argv[i], "-del-win-title")))
+         {
+            del_win_title = 1;
+             valid_args++;
+         }
        else if ((!strcmp(argv[i], "-del-startup-notify")))
          {
             del_startup_notify = 1;
@@ -199,6 +213,8 @@
      eet_write(ef, "app/window/name", set_win_name, strlen(set_win_name), 0);
    if (set_win_class)
      eet_write(ef, "app/window/class", set_win_class, strlen(set_win_class), 
0);
+   if (set_win_title)
+     eet_write(ef, "app/window/title", set_win_title, strlen(set_win_title), 
0);
    if (set_startup_notify >= 0)
      {
        unsigned char tmp[1];
@@ -261,6 +277,8 @@
      eet_delete(ef, "app/window/name");
    if (del_win_class)
      eet_delete(ef, "app/window/class");
+   if (del_win_title)
+     eet_delete(ef, "app/window/title");
    if (del_startup_notify)
      eet_delete(ef, "app/info/startup_notify");
    if (del_wait_exit)
@@ -283,14 +301,16 @@
          "  -set-exe EXE               Set the application execute line\n"
          "  -set-win-name WIN_NAME     Set the application window name\n"
          "  -set-win-class WIN_CLASS   Set the application window class\n"
-         "  -set-startup-notify [1/0]  Set the application startup notify flag 
to on/off\n"
-         "  -set-wait-exit [1/0]       Set the application wait exit flag to 
on/off\n"
+         "  -set-win-title WIN_TITLE   Set the application window title glob\n"
+         "  -set-startup-notify [1/0]  Set the application startup notify 
flag\n"
+         "  -set-wait-exit [1/0]       Set the application wait exit flag\n"
          "  -del-name                  Delete the application name\n"
          "  -del-generic               Delete the application generic name\n"
          "  -del-comment               Delete the application comment\n"
          "  -del-exe                   Delete the application execute line\n"
          "  -del-win-name              Delete the application window name\n"
          "  -del-win-class             Delete the application window class\n"
+         "  -del-win-title             Delete the application window title 
glob\n"
          "  -del-startup-notify        Delete the application startup notify 
flag\n"
          "  -del-wait-exit             Delete the application wait exit flag\n"
          );
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_int_menus.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -3 -r1.74 -r1.75
--- e_int_menus.c       30 Jun 2005 11:34:36 -0000      1.74
+++ e_int_menus.c       1 Jul 2005 04:09:30 -0000       1.75
@@ -553,7 +553,10 @@
      {
        E_Border *bd = l->data;
        E_App *a;
-
+       char *title = "";
+       
+       if (bd->client.netwm.name) title = bd->client.netwm.name;
+       else title = bd->client.icccm.title;
        mi = e_menu_item_new(m);
        e_menu_item_check_set(mi, 1);
        if (bd->client.netwm.name)
@@ -567,8 +570,9 @@
        e_object_breadcrumb_add(E_OBJECT(bd), "clients_menu");
        e_menu_item_callback_set(mi, _e_int_menus_clients_item_cb, bd);
        if (!bd->iconic) e_menu_item_toggle_set(mi, 1);
-       a = e_app_window_name_class_find(bd->client.icccm.name,
-                                        bd->client.icccm.class);
+       a = e_app_window_name_class_title_find(bd->client.icccm.name,
+                                              bd->client.icccm.class,
+                                              title);
        if (a) e_menu_item_icon_edje_set(mi, a->path, "icon");
      }
    mi = e_menu_item_new(m);
@@ -807,7 +811,10 @@
      {
        E_Border *bd = l->data;
        E_App *a;
-
+       char *title = "";
+       
+       if (bd->client.netwm.name) title = bd->client.netwm.name;
+       else title = bd->client.icccm.title;
        mi = e_menu_item_new(m);
        if (bd->client.netwm.name)
          e_menu_item_label_set(mi, bd->client.netwm.name);
@@ -819,8 +826,9 @@
        e_object_ref(E_OBJECT(bd));
        e_object_breadcrumb_add(E_OBJECT(bd), "lost_clients_menu");
        e_menu_item_callback_set(mi, _e_int_menus_lost_clients_item_cb, bd);
-       a = e_app_window_name_class_find(bd->client.icccm.name,
-                                        bd->client.icccm.class);
+       a = e_app_window_name_class_title_find(bd->client.icccm.name,
+                                              bd->client.icccm.class,
+                                              title);
        if (a) e_menu_item_icon_edje_set(mi, a->path, "icon");
      }
    e_object_free_attach_func_set(E_OBJECT(m), 
_e_int_menus_lost_clients_free_hook);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_utils.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- e_utils.c   11 Jun 2005 13:32:29 -0000      1.10
+++ e_utils.c   1 Jul 2005 04:09:30 -0000       1.11
@@ -120,3 +120,15 @@
    return ecore_file_app_installed("emblem");
 }
 
+int
+e_util_glob_match(char *str, char *glob)
+{
+   if (glob[0] == 0)
+     {
+       if (str[0] == 0) return 1;
+       return 0;
+     }
+   if (!strcmp(glob, "*")) return 1;
+   if (!fnmatch(glob, str, 0)) return 1;
+   return 0;
+}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_utils.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- e_utils.h   5 Jun 2005 15:02:42 -0000       1.7
+++ e_utils.h   1 Jul 2005 04:09:30 -0000       1.8
@@ -6,13 +6,14 @@
 #ifndef E_UTILS_H
 #define E_UTILS_H
 
-EAPI void e_util_container_fake_mouse_up_later(E_Container *con, int button);
-EAPI void e_util_container_fake_mouse_up_all_later(E_Container *con);
-EAPI void e_util_wakeup(void);
-EAPI void e_util_env_set(const char *var, const char *val);
+EAPI void    e_util_container_fake_mouse_up_later(E_Container *con, int 
button);
+EAPI void    e_util_container_fake_mouse_up_all_later(E_Container *con);
+EAPI void    e_util_wakeup(void);
+EAPI void    e_util_env_set(const char *var, const char *val);
 EAPI E_Zone *e_util_zone_current_get(E_Manager *man);
-EAPI int  e_util_utils_installed(void);
-EAPI int  e_util_app_installed(char *app);
-
+EAPI int     e_util_utils_installed(void);
+EAPI int     e_util_app_installed(char *app);
+EAPI int     e_util_glob_match(char *str, char *glob);
+    
 #endif
 #endif




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to