Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
      Tag: branch-exp
        E.h actions.c config.c globals.c grabs.c groups.c handlers.c 
        ipc.c main.c screen.c session.c settings.c setup.c snaps.c 
        startup.c 


Log Message:
Move some globals into Mode struct. Remove startup file editing.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.314.2.21
retrieving revision 1.314.2.22
diff -u -3 -r1.314.2.21 -r1.314.2.22
--- E.h 18 Aug 2004 21:10:45 -0000      1.314.2.21
+++ E.h 21 Aug 2004 09:09:03 -0000      1.314.2.22
@@ -1123,15 +1123,29 @@
 {
    struct
    {
+      char               *name;
       int                 screens;
+#ifdef HAS_XINERAMA
+      char                xinerama_active;
+#endif
    } display;
    struct
    {
+      Group              *current;
+   } groups;
+   struct
+   {
       char                pointer_grab_active;
       Window              pointer_grab_window;
    } grabs;
    struct
    {
+      unsigned int        numlock;
+      unsigned int        scrollock;
+      unsigned int        mod_combos[8];
+   } masks;
+   struct
+   {
       int                 current_depth;
       Menu               *list[256];
       char                clicked;
@@ -1140,6 +1154,21 @@
    } menus;
    struct
    {
+      char                check;       /* Avoid losing windows offscreen */
+      char                swap;
+      int                 swapcoord_x, swapcoord_y;
+   } move;
+   struct
+   {
+      char                utf8_int;    /* Use UTF-8 internally */
+      char                utf8_loc;    /* Locale is UTF-8 */
+   } text;
+   struct
+   {
+      char               *path;
+   } theme;
+   struct
+   {
       char                master;      /* We are the master E */
       char                single;      /* No slaves */
       char                window;      /* Running in virtual root window */
@@ -1150,18 +1179,10 @@
       char                exiting;
       char                save_ok;
       char                coredump;
+      int                 child_count;
+      pid_t              *children;
+      char               *machine_name;
    } wm;
-   struct
-   {
-      char                check;       /* Avoid losing windows offscreen */
-      char                swap;
-      int                 swapcoord_x, swapcoord_y;
-   } move;
-   struct
-   {
-      char                utf8_int;    /* Use UTF-8 internally */
-      char                utf8_loc;    /* Locale is UTF-8 */
-   } text;
    int                 debug;
    int                 mode;
    char                place;
@@ -2278,7 +2299,7 @@
 
 /* setup.c */
 void                MapUnmap(int start);
-void                SetupX(void);
+void                SetupX(const char *dstr);
 void                SetupDirs(void);
 void                SetupEnv(void);
 Window              MakeExtInitWin(void);
@@ -2357,7 +2378,6 @@
 int                 EwinListFocusRaise(EWin * ewin);
 
 /* startup.c */
-void                AddE(void);
 void                CreateStartupDisplay(char start);
 
 /* tclass.c */
@@ -2592,20 +2612,5 @@
 extern Window       init_win_ext;
 
 #define FILEPATH_LEN_MAX 4096
-extern char         themepath[FILEPATH_LEN_MAX];
-
-extern char         no_overwrite;
-extern int          child_count;
-extern pid_t       *e_children;
-extern int          numlock_mask;
-extern int          scrollock_mask;
-extern int          mask_mod_combos[8];
-extern Group       *current_group;
-extern const char  *dstr;
-extern char        *e_machine_name;
-
-#ifdef HAS_XINERAMA
-extern char         xinerama_active;
-#endif
 
 #include "emodule.h"
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/actions.c,v
retrieving revision 1.174.2.7
retrieving revision 1.174.2.8
diff -u -3 -r1.174.2.7 -r1.174.2.8
--- actions.c   18 Aug 2004 21:10:46 -0000      1.174.2.7
+++ actions.c   21 Aug 2004 09:09:04 -0000      1.174.2.8
@@ -121,8 +121,8 @@
 
             for (i = 0; i < 8; i++)
               {
-                 GrabButtonSet(button, mod | mask_mod_combos[i], ewin->win,
-                               mask, ECSR_PGRAB, 1);
+                 GrabButtonSet(button, mod | Mode.masks.mod_combos[i],
+                               ewin->win, mask, ECSR_PGRAB, 1);
               }
          }
      }
@@ -173,7 +173,7 @@
 
             for (i = 0; i < 8; i++)
               {
-                 GrabButtonRelease(button, mod | mask_mod_combos[i],
+                 GrabButtonRelease(button, mod | Mode.masks.mod_combos[i],
                                    ewin->win);
               }
          }
@@ -429,7 +429,7 @@
 
    mask =
       (ShiftMask | ControlMask | Mod1Mask | Mod2Mask | Mod3Mask | Mod4Mask |
-       Mod5Mask) & (~(numlock_mask | scrollock_mask | LockMask));
+       Mod5Mask) & (~(Mode.masks.numlock | Mode.masks.scrollock | LockMask));
 
    switch (ev->type)
      {
@@ -3103,7 +3103,7 @@
 doAddToGroup(EWin * ewin, const char *params)
 {
    EDBUG(6, "doAddToGroup");
-   if (!current_group)
+   if (!Mode.groups.current)
      {
        ChooseGroupDialog(ewin,
                          _("\n  There's no current group at the moment.  \n"
@@ -3115,7 +3115,7 @@
        EDBUG_RETURN(0);
      }
    else
-      AddEwinToGroup(ewin, current_group);
+      AddEwinToGroup(ewin, Mode.groups.current);
    SaveGroups();
    EDBUG_RETURN(0);
    params = NULL;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/config.c,v
retrieving revision 1.111.2.10
retrieving revision 1.111.2.11
diff -u -3 -r1.111.2.10 -r1.111.2.11
--- config.c    18 Aug 2004 21:10:47 -0000      1.111.2.10
+++ config.c    21 Aug 2004 09:09:18 -0000      1.111.2.11
@@ -2348,11 +2348,11 @@
                  "-D SCREEN_DEPTH_%i=1 " "-D USER_NAME=%s " "-D HOME_DIR=%s "
                  "-D USER_SHELL=%s " "-D ENLIGHTENMENT_VERSION_015=1 "
                  "%s %s/cached/cfg/%s.preparsed",
-                 epp_path, EDirRoot(), themepath, EDirRoot(),
+                 epp_path, EDirRoot(), Mode.theme.path, EDirRoot(),
                  ENLIGHTENMENT_VERSION, EDirRoot(), EDirBin(),
-                 themepath, EDirUser(), EDirUserCache(), VRoot.w, VRoot.h,
-                 VRoot.w, VRoot.h, VRoot.depth, def_user, def_home, def_shell,
-                 path, EDirUserCache(), s);
+                 Mode.theme.path, EDirUser(), EDirUserCache(), VRoot.w,
+                 VRoot.h, VRoot.w, VRoot.h, VRoot.depth, def_user, def_home,
+                 def_shell, path, EDirUserCache(), s);
        system(execline);
        Esnprintf(execline, sizeof(execline), "%s/cached/cfg/%s.preparsed",
                  EDirUserCache(), s);
@@ -2586,7 +2586,7 @@
       EDBUG_RETURN(Estrdup(s));
 
    /* look in theme dir */
-   Esnprintf(s, sizeof(s), "%s/%s", themepath, file);
+   Esnprintf(s, sizeof(s), "%s/%s", Mode.theme.path, file);
    if (findLocalizedFile(s) || isfile(s))
       EDBUG_RETURN(Estrdup(s));
 
@@ -2729,7 +2729,7 @@
        EDBUG_RETURN(0);
      }
 
-   strcpy(themepath, theme);
+   Mode.theme.path = Estrdup(theme);
    Esnprintf(s, sizeof(s), "%s/", theme);
 
    {
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/globals.c,v
retrieving revision 1.39.2.1
retrieving revision 1.39.2.2
diff -u -3 -r1.39.2.1 -r1.39.2.2
--- globals.c   8 Aug 2004 00:02:18 -0000       1.39.2.1
+++ globals.c   21 Aug 2004 09:09:19 -0000      1.39.2.2
@@ -39,17 +39,6 @@
 Window              init_win1 = 0;
 Window              init_win2 = 0;
 Window              init_win_ext = 0;
-char                themepath[FILEPATH_LEN_MAX];
-
-char                no_overwrite = 0;
-int                 child_count = 0;
-pid_t              *e_children = NULL;
-int                 numlock_mask = 0;
-int                 scrollock_mask = 0;
-int                 mask_mod_combos[8];
-Group              *current_group;
-const char         *dstr = NULL;
-char               *e_machine_name = NULL;
 
 #ifdef DEBUG
 int                 call_level = 0;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/grabs.c,v
retrieving revision 1.17.2.2
retrieving revision 1.17.2.3
diff -u -3 -r1.17.2.2 -r1.17.2.3
--- grabs.c     15 Aug 2004 07:28:28 -0000      1.17.2.2
+++ grabs.c     21 Aug 2004 09:09:20 -0000      1.17.2.3
@@ -43,8 +43,8 @@
 
        /* grab the key even if locks are on or not */
        for (i = 0; i < 8; i++)
-          XGrabKey(disp, a->key, mod | mask_mod_combos[i], VRoot.win, False,
-                   GrabModeAsync, GrabModeAsync);
+          XGrabKey(disp, a->key, mod | Mode.masks.mod_combos[i], VRoot.win,
+                   False, GrabModeAsync, GrabModeAsync);
      }
    EDBUG_RETURN_;
 }
@@ -69,7 +69,7 @@
 
        /* ungrab the key even if locks are on or not */
        for (i = 0; i < 8; i++)
-          XUngrabKey(disp, a->key, mod | mask_mod_combos[i], VRoot.win);
+          XUngrabKey(disp, a->key, mod | Mode.masks.mod_combos[i], VRoot.win);
      }
    EDBUG_RETURN_;
 }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/groups.c,v
retrieving revision 1.57.2.2
retrieving revision 1.57.2.3
diff -u -3 -r1.57.2.2 -r1.57.2.3
--- groups.c    15 Aug 2004 15:49:04 -0000      1.57.2.2
+++ groups.c    21 Aug 2004 09:09:20 -0000      1.57.2.3
@@ -59,8 +59,8 @@
    if (!g)
       return;
 
-   if (g == current_group)
-      current_group = NULL;
+   if (g == Mode.groups.current)
+      Mode.groups.current = NULL;
    if (g->members)
       Efree(g->members);
    Efree(g);
@@ -107,7 +107,7 @@
    int                 i;
    Group              *g;
 
-   current_group = g = GroupCreate();
+   Mode.groups.current = g = GroupCreate();
    AddItem(g, NULL, g->index, LIST_TYPE_GROUP);
 
    for (i = 0; i < num; i++)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/handlers.c,v
retrieving revision 1.40
retrieving revision 1.40.2.1
diff -u -3 -r1.40 -r1.40.2.1
--- handlers.c  31 May 2004 19:47:34 -0000      1.40
+++ handlers.c  21 Aug 2004 09:09:20 -0000      1.40.2.1
@@ -205,7 +205,7 @@
 }
 
 void
-EHandleXError(Display * d, XErrorEvent * ev)
+EHandleXError(Display * d __UNUSED__, XErrorEvent * ev)
 {
 /*  char                buf[64]; */
 
@@ -213,34 +213,22 @@
    if ((ev->request_code == X_ChangeWindowAttributes)
        && (ev->error_code == BadAccess))
      {
-       if ((!no_overwrite) && (Mode.wm.xselect))
+       if (Mode.wm.xselect)
          {
             AlertX(_("Another Window Manager is already running"),
-                   _("OK (edit file)"), "", _("Cancel (do NOT edit)"),
+                   _("OK"), NULL, NULL,
                    _("Another Window Manager is already running.\n" "\n"
                      "You will have to quit your current Window Manager first 
before\n"
-                     "you can successfully run Enlightenment.\n" "\n"
-                     "If you haven't edited your user start-up files, Enlightenment\n"
-                     "can do that now for you, so when you log in again after\n"
-                     "quitting your current window manager, you will have\n"
-                     "Enlightenment running.\n" "\n"
-                     "If you want to do this, click OK, otherwise hit cancel\n"
-                     "to abort this operation and edit the files by hand.\n"
-                     "\n" "WARNING WARNING WARNING WARNING!\n" "\n"
-                     "It is possible that this MAY not properly edit your files.\n"));
-            AlertX(_("Are you sure?"), _("YES (edit file)"), "",
-                   _("NO (do not edit)"),
-                   _("Are you absolutely sure you want to have Enlightenment\n"
-                     "edit your start-up files for you?\n" "\n"
-                     "If your start-up files are highly customised this may not\n"
-                     "work.\n" "\n" "Are you ABSOLUTELY sure?\n"));
-            AddE();
+                     "you can successfully run Enlightenment.\n"));
             EExit(1);
          }
      }
-/*  XGetErrorText (disp, ev->error_code, buf, 63);
- * fprintf(stderr, "Whee %i: %s : %i\n", time(NULL), buf, ev->request_code); */
-   d = NULL;
+
+#if 0
+   XGetErrorText(disp, ev->error_code, buf, 63);
+   fprintf(stderr, "Whee %i: %s : %i\n", time(NULL), buf, ev->request_code);
+#endif
+
    EDBUG_RETURN_;
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ipc.c,v
retrieving revision 1.174.2.10
retrieving revision 1.174.2.11
diff -u -3 -r1.174.2.10 -r1.174.2.11
--- ipc.c       17 Aug 2004 22:47:07 -0000      1.174.2.10
+++ ipc.c       21 Aug 2004 09:09:20 -0000      1.174.2.11
@@ -181,7 +181,7 @@
 {
    params = NULL;
 #ifdef HAS_XINERAMA
-   if (xinerama_active)
+   if (Mode.display.xinerama_active)
      {
        XineramaScreenInfo *screens;
        int                 num, i;
@@ -3493,18 +3493,9 @@
 }
 
 static void
-IPC_CurrentTheme(const char *params, Client * c)
+IPC_CurrentTheme(const char *params __UNUSED__, Client * c __UNUSED__)
 {
-   char                buf[FILEPATH_LEN_MAX];
-
-   buf[0] = 0;
-
-   Esnprintf(buf, sizeof(buf), themepath);
-
-   if (buf[0])
-      CommsSend(c, buf);
-
-   params = NULL;
+   IpcPrintf("%s\n", Mode.theme.path);
 }
 
 static void
@@ -3717,7 +3708,7 @@
 IPC_GroupOps(const char *params, Client * c)
 {
    char                buf[FILEPATH_LEN_MAX];
-   Group              *group = current_group;
+   Group              *group = Mode.groups.current;
    char                groupid[FILEPATH_LEN_MAX];
    int                 gix;
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/main.c,v
retrieving revision 1.99.2.8
retrieving revision 1.99.2.9
diff -u -3 -r1.99.2.8 -r1.99.2.9
--- main.c      17 Aug 2004 22:47:08 -0000      1.99.2.8
+++ main.c      21 Aug 2004 09:09:21 -0000      1.99.2.9
@@ -54,7 +54,7 @@
 {
    int                 i;
    struct utsname      ubuf;
-   char               *str;
+   char               *str, *dstr;
 
    /* This function runs all the setup for startup, and then 
     * proceeds into the primary event loop at the end.
@@ -86,111 +86,105 @@
    srand(time(NULL));
 
    if (!uname(&ubuf))
-      e_machine_name = Estrdup(ubuf.nodename);
-   if (!e_machine_name)
-      e_machine_name = Estrdup("localhost");
+      Mode.wm.machine_name = Estrdup(ubuf.nodename);
+   if (!Mode.wm.machine_name)
+      Mode.wm.machine_name = Estrdup("localhost");
 
    /* Initialise internationalisation */
    LangInit();
 
    SetSMProgName(argv[0]);
 
-   themepath[0] = 0;
-   {
-      int                 j = 0;
-
-      /* Now we're going to interpret any of the commandline parameters
-       * that are passed to it -- Well, at least the ones that we
-       * understand.
-       */
-
-      for (j = 1; j < argc; j++)
-       {
-          if ((!strcmp("-theme", argv[j])) && (argc - j > 1))
-            {
-               Esnprintf(themepath, sizeof(themepath), "%s", argv[++j]);
-            }
-          else if ((!strcmp("-econfdir", argv[j])) && (argc - j > 1))
-            {
-               EDirUserSet(argv[++j]);
-            }
-          else if ((!strcmp("-ecachedir", argv[j])) && (argc - j > 1))
-            {
-               EDirUserCacheSet(argv[++j]);
-            }
-          else if ((!strcmp("-display", argv[j])) && (argc - j > 1))
-            {
-               dstr = argv[++j];
-            }
-          else if (!strcmp("-single", argv[j]))
-            {
-               Mode.wm.single = 1;
-            }
-          else if ((!strcmp("-smid", argv[j])) && (argc - j > 1))
-            {
-               SetSMID(argv[++j]);
-            }
-          else if ((!strcmp("-clientId", argv[j])) && (argc - j > 1))
-            {
-               SetSMID(argv[++j]);
-            }
-          else if ((!strcmp("--sm-client-id", argv[j])) && (argc - j > 1))
-            {
-               SetSMID(argv[++j]);
-            }
-          else if ((!strcmp("-smfile", argv[j])) && (argc - j > 1))
-            {
-               SetSMFile(argv[++j]);
-            }
-          else if ((!strcmp("-ext_init_win", argv[j])) && (argc - j > 1))
-            {
-               init_win_ext = atoi(argv[++j]);
-            }
-          else if (!strcmp("-no_overwrite", argv[j]))
-            {
-               no_overwrite = 1;
-            }
-          else if ((!strcmp("-window", argv[j])) && (argc - j > 1))
-            {
-               sscanf(argv[++j], "%dx%d", &VRoot.w, &VRoot.h);
-               Mode.wm.window = 1;
-               Mode.wm.single = 1;
-            }
-          else if ((!strcmp("-h", argv[j])) || (!strcmp("-help", argv[j])) ||
-                   (!strcmp("-?", argv[j])) || (!strcmp("--help", argv[j])))
-            {
-               printf("enlightenment options:\n"
-                      "\t-display display_name\n"
-                      "\t-ecachedir /path/to/cached/dir\n"
-                      "\t-econfdir /path/to/.enlightenment/conf/dir\n"
-                      "\t-ext_init_win window_id\n"
-                      "\t-no_overwrite\n"
-                      "\t-smfile file\n"
-                      "\t[-smid | -clientId | --sm-client-id] id\n"
-                      "\t-theme /path/to/theme\n"
-                      "\t[-v | -verbose]\n" "\t[-V | -version | --version]\n");
-               exit(0);
-            }
-          else if ((!strcmp("-V", argv[j])) ||
-                   (!strcmp("-version", argv[j])) ||
-                   (!strcmp("--version", argv[j])))
-            {
-               printf(_("Enlightenment Version: %s\nLast updated on: %s\n"),
-                      ENLIGHTENMENT_VERSION, E_CHECKOUT_DATE);
-               exit(0);
-            }
-          else if ((!strcmp("-v", argv[j])) || (!strcmp("-verbose", argv[j])))
-            {
-               Mode.debug++;
-            }
-       }
-
-      /* Set a default location for the "previous session" data when
-       * we do not actually have a previous session. */
-      SetSMFile(NULL);
-   }
+   /* Now we're going to interpret any of the commandline parameters
+    * that are passed to it -- Well, at least the ones that we
+    * understand.
+    */
+
+   Mode.theme.path = NULL;
+   dstr = NULL;
 
-   if (themepath[0] == 0)
+   for (i = 1; i < argc; i++)
+     {
+       if ((!strcmp("-theme", argv[i])) && (argc - i > 1))
+         {
+            i++;
+            Mode.theme.path = Estrdup(argv[i]);
+         }
+       else if ((!strcmp("-econfdir", argv[i])) && (argc - i > 1))
+         {
+            EDirUserSet(argv[++i]);
+         }
+       else if ((!strcmp("-ecachedir", argv[i])) && (argc - i > 1))
+         {
+            EDirUserCacheSet(argv[++i]);
+         }
+       else if ((!strcmp("-display", argv[i])) && (argc - i > 1))
+         {
+            dstr = argv[++i];
+         }
+       else if (!strcmp("-single", argv[i]))
+         {
+            Mode.wm.single = 1;
+         }
+       else if ((!strcmp("-smid", argv[i])) && (argc - i > 1))
+         {
+            SetSMID(argv[++i]);
+         }
+       else if ((!strcmp("-clientId", argv[i])) && (argc - i > 1))
+         {
+            SetSMID(argv[++i]);
+         }
+       else if ((!strcmp("--sm-client-id", argv[i])) && (argc - i > 1))
+         {
+            SetSMID(argv[++i]);
+         }
+       else if ((!strcmp("-smfile", argv[i])) && (argc - i > 1))
+         {
+            SetSMFile(argv[++i]);
+         }
+       else if ((!strcmp("-ext_init_win", argv[i])) && (argc - i > 1))
+         {
+            init_win_ext = atoi(argv[++i]);
+         }
+       else if ((!strcmp("-window", argv[i])) && (argc - i > 1))
+         {
+            sscanf(argv[++i], "%dx%d", &VRoot.w, &VRoot.h);
+            Mode.wm.window = 1;
+            Mode.wm.single = 1;
+         }
+       else if ((!strcmp("-h", argv[i])) || (!strcmp("-help", argv[i])) ||
+                (!strcmp("-?", argv[i])) || (!strcmp("--help", argv[i])))
+         {
+            printf("enlightenment options:\n"
+                   "\t-display display_name\n"
+                   "\t-ecachedir /path/to/cached/dir\n"
+                   "\t-econfdir /path/to/.enlightenment/conf/dir\n"
+                   "\t-ext_init_win window_id\n"
+                   "\t-smfile file\n"
+                   "\t[-smid | -clientId | --sm-client-id] id\n"
+                   "\t-theme /path/to/theme\n"
+                   "\t[-v | -verbose]\n" "\t[-V | -version | --version]\n");
+            exit(0);
+         }
+       else if ((!strcmp("-V", argv[i])) ||
+                (!strcmp("-version", argv[i])) ||
+                (!strcmp("--version", argv[i])))
+         {
+            printf(_("Enlightenment Version: %s\nLast updated on: %s\n"),
+                   ENLIGHTENMENT_VERSION, E_CHECKOUT_DATE);
+            exit(0);
+         }
+       else if ((!strcmp("-v", argv[i])) || (!strcmp("-verbose", argv[i])))
+         {
+            Mode.debug++;
+         }
+
+       /* Set a default location for the "previous session" data when
+        * we do not actually have a previous session. */
+       SetSMFile(NULL);
+     }
+
+   if (!Mode.theme.path)
      {
        FILE               *f;
        char                s[FILEPATH_LEN_MAX];
@@ -207,29 +201,20 @@
                     s[0] = 0;
                  fclose(f);
                  if (s[0])
-                    Esnprintf(themepath, sizeof(themepath), "%s", s);
+                    Mode.theme.path = Estrdup(s);
               }
             Efree(file);
          }
 
-       if (themepath[0] == 0)
-         {
-            char               *def;
-
-            def = ThemeGetDefault();
-            if (def)
-              {
-                 Esnprintf(themepath, sizeof(themepath), "%s", def);
-                 Efree(def);
-              }
-         }
+       if (!Mode.theme.path)
+          Mode.theme.path = ThemeGetDefault();
      }
-   SetSMUserThemePath(themepath);
+   SetSMUserThemePath(Mode.theme.path);
 
    /* run most of the setup */
    AlertInit();                        /* Set up all the text bits that belong on the 
GSOD */
    SignalsSetup();
-   SetupX();                   /* This is where the we fork per screen */
+   SetupX(dstr);               /* This is where the we fork per screen */
    BlumFlimFrub();
    ZoomInit();
    SetupDirs();
@@ -249,7 +234,7 @@
    desks.desk[0].viewable = 0;
    /* now we're going to load the configuration/theme */
    ConfigurationLoad();                /* Load settings */
-   LoadEConfig(themepath);
+   LoadEConfig(Mode.theme.path);
    ConfigurationLoad();                /* FIXME - Override private settings set 
elsewhere */
    SetAreaSize(Conf.areas.nx, Conf.areas.ny);
    TransparencySet(Conf.trans.alpha);
@@ -354,8 +339,8 @@
    BackgroundDestroyByName("STARTUP_BACKGROUND");
 
 #ifdef SIGCONT
-   for (i = 0; i < child_count; i++)
-      kill(e_children[i], SIGCONT);
+   for (i = 0; i < Mode.wm.child_count; i++)
+      kill(Mode.wm.children[i], SIGCONT);
 #endif
 
    SetupUserInitialization();
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/screen.c,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -3 -r1.8 -r1.8.2.1
--- screen.c    3 Jul 2004 00:58:19 -0000       1.8
+++ screen.c    21 Aug 2004 09:09:21 -0000      1.8.2.1
@@ -24,7 +24,6 @@
 #include "E.h"
 
 #ifdef HAS_XINERAMA
-char                xinerama_active = 0;
 static XineramaScreenInfo *screens = NULL;
 static int          num_screens = 0;
 #endif
@@ -35,9 +34,9 @@
    if (Mode.wm.window)
       return;
 #ifdef HAS_XINERAMA
-   xinerama_active = XineramaIsActive(disp);
+   Mode.display.xinerama_active = XineramaIsActive(disp);
    Conf.extra_head = 0;
-   if (xinerama_active)
+   if (Mode.display.xinerama_active)
       screens = XineramaQueryScreens(disp, &num_screens);
 #endif
 }
@@ -55,7 +54,7 @@
    h = VRoot.h;
 
 #ifdef HAS_XINERAMA
-   if (xinerama_active)
+   if (Mode.display.xinerama_active)
      {
        int                 i;
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/session.c,v
retrieving revision 1.75.2.3
retrieving revision 1.75.2.4
diff -u -3 -r1.75.2.3 -r1.75.2.4
--- session.c   17 Aug 2004 22:47:08 -0000      1.75.2.3
+++ session.c   21 Aug 2004 09:09:21 -0000      1.75.2.4
@@ -141,7 +141,7 @@
    if (Mode.wm.window)
       Esnprintf(s, sizeof(s), "%s/...e_session-window", EDirUser());
    else
-      Esnprintf(s, sizeof(s), "%s/...e_session-XXXXXX", EDirUser());
+      Esnprintf(s, sizeof(s), "%s/e_config-%s", EDirUser(), Mode.display.name);
    def_prefix = Estrdup(s);
 
    return def_prefix;
@@ -1021,7 +1021,7 @@
             XCloseDisplay(disp);
             disp = NULL;
          }
-       if (themepath[0] != 0)
+       if (Mode.theme.path)
          {
             if (sm_client_id)
                Esnprintf(s, sizeof(s),
@@ -1126,7 +1126,7 @@
             XCloseDisplay(disp);
             disp = NULL;
 
-            if (themepath[0] != 0)
+            if (Mode.theme.path)
               {
                  Esnprintf(sss, sizeof(sss),
                            "exec %s -single -ext_init_win %li -theme %s "
@@ -1264,8 +1264,8 @@
      {
        SoundExit();
        ThemeCleanup();
-       for (i = 0; i < child_count; i++)
-          kill(e_children[i], SIGINT);
+       for (i = 0; i < Mode.wm.child_count; i++)
+          kill(Mode.wm.children[i], SIGINT);
      }
    else
      {
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/settings.c,v
retrieving revision 1.120.2.6
retrieving revision 1.120.2.7
diff -u -3 -r1.120.2.6 -r1.120.2.7
--- settings.c  18 Aug 2004 21:10:50 -0000      1.120.2.6
+++ settings.c  21 Aug 2004 09:09:21 -0000      1.120.2.7
@@ -1023,7 +1023,7 @@
        Conf.place.manual_mouse_pointer = tmp_manual_placement_mouse_pointer;
        Conf.place.ignore_struts = tmp_place_ignore_struts;
 #ifdef HAS_XINERAMA
-       if (xinerama_active)
+       if (Mode.display.xinerama_active)
           Conf.extra_head = tmp_extra_head;
 #endif
      }
@@ -1125,7 +1125,7 @@
    DialogItemCheckButtonSetPtr(di, &tmp_place_ignore_struts);
 
 #ifdef HAS_XINERAMA
-   if (xinerama_active)
+   if (Mode.display.xinerama_active)
      {
        di = DialogAddItem(table, DITEM_CHECKBUTTON);
        DialogItemSetPadding(di, 2, 2, 2, 2);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/setup.c,v
retrieving revision 1.139.2.4
retrieving revision 1.139.2.5
diff -u -3 -r1.139.2.4 -r1.139.2.5
--- setup.c     18 Aug 2004 21:10:51 -0000      1.139.2.4
+++ setup.c     21 Aug 2004 09:09:21 -0000      1.139.2.5
@@ -114,7 +114,7 @@
  * This function sets up all of our connections to X
  */
 void
-SetupX(void)
+SetupX(const char *dstr)
 {
    char                buf[128];
 
@@ -173,10 +173,11 @@
             if (pid)
               {
                  /* We are the master */
-                 child_count++;
-                 e_children =
-                    Erealloc(e_children, sizeof(pid_t) * child_count);
-                 e_children[child_count - 1] = pid;
+                 Mode.wm.child_count++;
+                 Mode.wm.children =
+                    Erealloc(Mode.wm.children,
+                             sizeof(pid_t) * Mode.wm.child_count);
+                 Mode.wm.children[Mode.wm.child_count - 1] = pid;
               }
             else
               {
@@ -203,7 +204,8 @@
          }
      }
 
-   Esetenv("DISPLAY", DisplayString(disp), 1);
+   Mode.display.name = Estrdup(DisplayString(disp));
+   Esetenv("DISPLAY", Mode.display.name, 1);
 
    /* set up an error handler for then E would normally have fatal X errors */
    XSetErrorHandler((XErrorHandler) EHandleXError);
@@ -337,19 +339,20 @@
           for (i = 0; i < (8 * mod->max_keypermod); i++)
             {
                if ((nl) && (mod->modifiermap[i] == nl))
-                  numlock_mask = masks[i / mod->max_keypermod];
+                  Mode.masks.numlock = masks[i / mod->max_keypermod];
                else if ((sl) && (mod->modifiermap[i] == sl))
-                  scrollock_mask = masks[i / mod->max_keypermod];
+                  Mode.masks.scrollock = masks[i / mod->max_keypermod];
             }
        }
-      mask_mod_combos[0] = 0;
-      mask_mod_combos[1] = LockMask;
-      mask_mod_combos[2] = numlock_mask;
-      mask_mod_combos[3] = scrollock_mask;
-      mask_mod_combos[4] = numlock_mask | scrollock_mask;
-      mask_mod_combos[5] = LockMask | numlock_mask;
-      mask_mod_combos[6] = LockMask | scrollock_mask;
-      mask_mod_combos[7] = LockMask | numlock_mask | scrollock_mask;
+      Mode.masks.mod_combos[0] = 0;
+      Mode.masks.mod_combos[1] = LockMask;
+      Mode.masks.mod_combos[2] = Mode.masks.numlock;
+      Mode.masks.mod_combos[3] = Mode.masks.scrollock;
+      Mode.masks.mod_combos[4] = Mode.masks.numlock | Mode.masks.scrollock;
+      Mode.masks.mod_combos[5] = LockMask | Mode.masks.numlock;
+      Mode.masks.mod_combos[6] = LockMask | Mode.masks.scrollock;
+      Mode.masks.mod_combos[7] = LockMask |
+        Mode.masks.numlock | Mode.masks.scrollock;
 
       if (mod)
         XFreeModifiermap(mod);
@@ -470,7 +473,7 @@
    Esetenv("EBIN", EDirBin(), 1);
    Esnprintf(s, sizeof(s), "%i", getpid());
    Esetenv("EPID", s, 1);
-   Esetenv("ETHEME", themepath, 1);
+   Esetenv("ETHEME", Mode.theme.path, 1);
    Esetenv("ECONFDIR", EDirUser(), 1);
    Esetenv("ECACHEDIR", EDirUserCache(), 1);
 }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/snaps.c,v
retrieving revision 1.72
retrieving revision 1.72.2.1
diff -u -3 -r1.72 -r1.72.2.1
--- snaps.c     3 Jul 2004 09:57:13 -0000       1.72
+++ snaps.c     21 Aug 2004 09:09:21 -0000      1.72.2.1
@@ -524,7 +524,7 @@
 
        if (ewin->icccm.wm_machine)
          {
-            if (strcmp(ewin->icccm.wm_machine, e_machine_name))
+            if (strcmp(ewin->icccm.wm_machine, Mode.wm.machine_name))
                ok = 0;
          }
        if (ok)
@@ -730,7 +730,7 @@
 
    if (ewin->icccm.wm_machine)
      {
-       if (strcmp(ewin->icccm.wm_machine, e_machine_name))
+       if (strcmp(ewin->icccm.wm_machine, Mode.wm.machine_name))
           ok = 0;
      }
    if (ok)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/startup.c,v
retrieving revision 1.44
retrieving revision 1.44.2.1
diff -u -3 -r1.44 -r1.44.2.1
--- startup.c   3 Jun 2004 18:04:46 -0000       1.44
+++ startup.c   21 Aug 2004 09:09:22 -0000      1.44.2.1
@@ -24,142 +24,6 @@
 #include <sys/time.h>
 #include <time.h>
 
-static int
-AddEToFile(char *file)
-{
-   FILE               *f1, *f2;
-   char                tmp[2048], s[2048];
-   char               *s1, *s2;
-   char                hase = 0;
-   char                foundwm = 0;
-   const char         *wms[] = {
-      "wmaker", "afterstep", "fvwm", "fvwm2", "twm", "mwm", "vtwm", "ctwm",
-      "gwm",
-      "mlvwm", "kwm", "olwm", "wm2", "wmx", "olvwm", "9wm", "blackbox", "awm",
-      "uwm",
-      "amiwm", "dtwm", "4dwm", "scwm", "fvwm95", "fvwm95-2", "tvtwm",
-      "bowman",
-      "qwm", "icewm", "qvwm", "gnome-session", "xsm", "startkde"
-   };
-   int                 wmnum = 33;
-   int                 i;
-
-   EDBUG(8, "AddEToFile");
-   if (!exists(file))
-      EDBUG_RETURN(0);
-
-   Esnprintf(tmp, 2048, "%s/estrt_%i",
-            (getenv("TMPDIR") == NULL) ? "/tmp" : getenv("TMPDIR"),
-            (unsigned)time(NULL));
-   f1 = fopen(file, "r");
-   if (!f1)
-      EDBUG_RETURN(0);
-   f2 = fopen(tmp, "w");
-   if (!f2)
-     {
-       fclose(f1);
-       EDBUG_RETURN(0);
-     }
-   while (fgets(s, 2048, f1))
-     {
-       s1 = strstr(s, "enlightenment");
-       if (s1)
-         {
-            s2 = strstr(s, "#");
-            if (((!s2) || (s1 < s2)) && (!foundwm))
-               hase = 1;
-         }
-       for (i = 0; i < wmnum; i++)
-         {
-            s1 = strstr(s, wms[i]);
-            if (s1)
-              {
-                 s2 = strstr(s, "#");
-                 if ((!s2) || (s1 < s2))
-                   {
-                      fprintf(f2, "#%s", s);
-                      fprintf(f2,
-                              "\n# Enlightenment inserted Execution string here\n");
-                      fprintf(f2, "exec %s/enlightenment\n\n", EDirBin());
-                      foundwm = 1;
-                      i = wmnum + 1;
-                   }
-              }
-         }
-       if (i <= wmnum)
-          fprintf(f2, "%s", s);
-     }
-   fclose(f1);
-   fclose(f2);
-   if (!foundwm)
-     {
-       f1 = fopen(file, "r");
-       if (!f1)
-          EDBUG_RETURN(0);
-       f2 = fopen(tmp, "w");
-       if (!f2)
-         {
-            fclose(f1);
-            EDBUG_RETURN(0);
-         }
-       fprintf(f2, "\n# Enlightenment inserted Execution string here\n");
-       fprintf(f2, "exec %s/enlightenment\n\n", EDirBin());
-       while (fgets(s, 2048, f1))
-          fprintf(f2, "%s", s);
-       fclose(f1);
-       fclose(f2);
-     }
-   if (!hase)
-      E_cp(tmp, file);
-   E_rm(tmp);
-   EDBUG_RETURN(1);
-}
-
-static int
-CreateEFile(char *file)
-{
-   FILE               *f;
-
-   EDBUG(8, "CreateEFile");
-   f = fopen(file, "w");
-   if (!f)
-      EDBUG_RETURN(0);
-   fprintf(f, "# Enlightenment inserted Execution string here\n");
-   fprintf(f, "exec %s/enlightenment\n", EDirBin());
-   fclose(f);
-   EDBUG_RETURN(1);
-}
-
-void
-AddE()
-{
-   char               *h;
-   char                s[1024];
-   int                 val;
-
-   EDBUG(6, "AddE");
-   val = 0;
-   h = homedir(getuid());
-   Esnprintf(s, 1024, "%s/.xsession", h);
-   val |= AddEToFile(s);
-   Esnprintf(s, 1024, "%s/.xinitrc", h);
-   val |= AddEToFile(s);
-   Esnprintf(s, 1024, "%s/.Xclients", h);
-   val |= AddEToFile(s);
-   if (!val)
-     {
-       Esnprintf(s, 1024, "%s/.xsession", h);
-       CreateEFile(s);
-       Esnprintf(s, 1024, "%s/.xinitrc", h);
-       CreateEFile(s);
-       Esnprintf(s, 1024, "%s/.Xclients", h);
-       CreateEFile(s);
-     }
-   if (h)
-      Efree(h);
-   EDBUG_RETURN_;
-}
-
 void
 CreateStartupDisplay(char start)
 {




-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to