Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
      Tag: branch-exp
        E.h desktops.c dock.c draw.c ecore-e16.h ewin-ops.c ewins.c 
        handlers.c icccm.c iconify.c main.c memory.c moveresize.c 
        session.c setup.c slideout.c ttfont.c x.c 


Log Message:
Use some more ecore-x.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.314.2.34
retrieving revision 1.314.2.35
diff -u -3 -r1.314.2.34 -r1.314.2.35
--- E.h 31 Aug 2004 18:42:49 -0000      1.314.2.34
+++ E.h 31 Aug 2004 21:58:34 -0000      1.314.2.35
@@ -2332,6 +2332,8 @@
                                                                 *));
 
 /* x.c */
+Display            *EDisplayOpen(const char *dstr);
+void                EDisplayClose(void);
 typedef void        (EventCallbackFunc) (XEvent * ev, void *prm);
 void                EventCallbackRegister(Window win, int type,
                                          EventCallbackFunc * func, void *prm);
@@ -2382,8 +2384,6 @@
                                       int h);
 void                ESetColor(XColor * pxc, int r, int g, int b);
 void                EGetColor(const XColor * pxc, int *pr, int *pg, int *pb);
-void                GrabX(void);
-void                UngrabX(void);
 void                GetWinXY(Window win, int *x, int *y);
 void                GetWinWH(Window win, unsigned int *w, unsigned int *h);
 int                 GetWinDepth(Window win);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.95.2.13
retrieving revision 1.95.2.14
diff -u -3 -r1.95.2.13 -r1.95.2.14
--- desktops.c  29 Aug 2004 14:06:46 -0000      1.95.2.13
+++ desktops.c  31 Aug 2004 21:58:35 -0000      1.95.2.14
@@ -241,7 +241,7 @@
    EDBUG(5, "SlideWindowTo");
    spd = 16;
    min = 2;
-   GrabX();
+   ecore_x_grab();
    for (k = 0; k <= 1024; k += spd)
      {
        gettimeofday(&timev1, NULL);
@@ -263,7 +263,7 @@
           spd = min;
      }
    EMoveWindow(disp, win, tx, ty);
-   UngrabX();
+   ecore_x_ungrab();
    EDBUG_RETURN_;
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/dock.c,v
retrieving revision 1.18.2.3
retrieving revision 1.18.2.4
diff -u -3 -r1.18.2.3 -r1.18.2.4
--- dock.c      31 Aug 2004 18:42:56 -0000      1.18.2.3
+++ dock.c      31 Aug 2004 21:58:35 -0000      1.18.2.4
@@ -129,7 +129,7 @@
    Esnprintf(id, sizeof(id), "%i", (unsigned)ewin->client.win);
    ic = FindItem("DEFAULT_DOCK_BUTTON", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
 
-   UngrabX();
+   ecore_x_ungrab();
 
    DockappFindEmptySpotFor(ewin);
    ewin->client.already_placed = 1;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/draw.c,v
retrieving revision 1.51.2.4
retrieving revision 1.51.2.5
diff -u -3 -r1.51.2.4 -r1.51.2.5
--- draw.c      29 Aug 2004 14:06:46 -0000      1.51.2.4
+++ draw.c      31 Aug 2004 21:58:35 -0000      1.51.2.5
@@ -1603,7 +1603,7 @@
                  if ((!root_pi) || (!ewin_pi) || (!draw_pi))
                    {
                       Conf.movemode = 0;
-                      UngrabX();
+                      ecore_x_ungrab();
                       DrawEwinShape(ewin, Conf.movemode, x, y, w, h,
                                     firstlast);
                       goto done;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ecore-e16.h,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -3 -r1.1.2.2 -r1.1.2.3
--- ecore-e16.h 26 Aug 2004 22:06:38 -0000      1.1.2.2
+++ ecore-e16.h 31 Aug 2004 21:58:35 -0000      1.1.2.3
@@ -29,6 +29,9 @@
 #define ecore_x_gc_del(gc) \
        XFreeGC(disp, gc)
 
+void                ecore_x_grab(void);
+void                ecore_x_ungrab(void);
+
 #endif
 
 extern Atom         _ecore_x_atom_wm_state;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ewin-ops.c,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -3 -r1.1.2.5 -r1.1.2.6
--- ewin-ops.c  31 Aug 2004 18:42:56 -0000      1.1.2.5
+++ ewin-ops.c  31 Aug 2004 21:58:35 -0000      1.1.2.6
@@ -40,7 +40,7 @@
    SoundPlay("SOUND_WINDOW_SLIDE");
 
    if (Conf.slidemode > 0)
-      GrabX();
+      ecore_x_grab();
 
    for (k = 0; k <= 1024; k += spd)
      {
@@ -76,7 +76,7 @@
    MoveEwin(ewin, tx, ty);
    Mode.doingslide = 0;
    if (Conf.slidemode > 0)
-      UngrabX();
+      ecore_x_ungrab();
    SoundPlay("SOUND_WINDOW_SLIDE_END");
    EDBUG_RETURN_;
 }
@@ -103,9 +103,12 @@
    min = 2;
    firstlast = 0;
    Mode.doingslide = 1;
+
    SoundPlay("SOUND_WINDOW_SLIDE");
+
    if (Conf.slidemode > 0)
-      GrabX();
+      ecore_x_grab();
+
    for (k = 0; k <= 1024; k += spd)
      {
        for (i = 0; i < num_wins; i++)
@@ -155,7 +158,7 @@
 
    Mode.doingslide = 0;
    if (Conf.slidemode > 0)
-      UngrabX();
+      ecore_x_ungrab();
    SoundPlay("SOUND_WINDOW_SLIDE_END");
    if (x)
       Efree(x);
@@ -710,7 +713,7 @@
    spd = 32;
    min = 2;
 
-   GrabX();
+   ecore_x_grab();
 
    switch (ewin->border->shadedir)
      {
@@ -929,7 +932,7 @@
        break;
      }
 
-   UngrabX();
+   ecore_x_ungrab();
 
    if (ewin->client.shaped)
       EShapeCombineShape(disp, ewin->win_container, ShapeBounding, 0, 0,
@@ -968,7 +971,7 @@
    spd = 32;
    min = 2;
 
-   GrabX();
+   ecore_x_grab();
 
    switch (ewin->border->shadedir)
      {
@@ -1196,7 +1199,7 @@
        break;
      }
 
-   UngrabX();
+   ecore_x_ungrab();
 
    if (ewin->client.shaped)
       EShapeCombineShape(disp, ewin->win_container, ShapeBounding, 0, 0,
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ewins.c,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -u -3 -r1.1.2.10 -r1.1.2.11
--- ewins.c     31 Aug 2004 18:42:59 -0000      1.1.2.10
+++ ewins.c     31 Aug 2004 21:58:35 -0000      1.1.2.11
@@ -469,7 +469,7 @@
 
    EDBUG(4, "Adopt");
 
-   GrabX();
+   ecore_x_grab();
    ewin = EwinCreate(win);
 
    ICCCM_AdoptStart(ewin);
@@ -496,7 +496,7 @@
    EwinGetGeometry(ewin);
    EwinEventsConfigure(ewin, 0);
 
-   UngrabX();
+   ecore_x_ungrab();
 
    if (ewin->shaded)
       EwinInstantShade(ewin, 1);
@@ -514,7 +514,7 @@
 
    EDBUG(4, "AdoptInternal");
 
-   GrabX();
+   ecore_x_grab();
    ewin = EwinCreate(win);
 
    ewin->border = border;
@@ -577,7 +577,7 @@
    EwinGetGeometry(ewin);
    EwinEventsConfigure(ewin, 0);
 
-   UngrabX();
+   ecore_x_ungrab();
 
    if (ewin->shaded)
       EwinInstantShade(ewin, 1);
@@ -624,7 +624,7 @@
      }
 
    /* grab that server */
-   GrabX();
+   ecore_x_grab();
    speed = Conf.slidespeedmap;
    doslide = Conf.mapslide;
    manplace = 0;
@@ -808,7 +808,7 @@
      {
        EwinBorderDraw(ewin, 1, 0);
        MoveEwinToDesktopAt(ewin, ewin->desktop, x, y);
-       UngrabX();
+       ecore_x_ungrab();
        EwinIconify(ewin);
        ewin->state = EWIN_STATE_ICONIC;
        EDBUG_RETURN_;
@@ -844,7 +844,7 @@
        Mode.have_place_grab = 1;
        Mode.place = 1;
        ICCCM_Configure(ewin);
-       UngrabX();
+       ecore_x_ungrab();
        ewin->floating = 1;     /* Causes reparenting to root */
        ActionsCall(ACTION_MOVE, ewin, NULL);
        EDBUG_RETURN_;
@@ -893,7 +893,7 @@
    ICCCM_Configure(ewin);
 
    EwinDetermineArea(ewin);
-   UngrabX();
+   ecore_x_ungrab();
 
    EDBUG_RETURN_;
 }
@@ -929,7 +929,7 @@
    EwinBorderDraw(ewin, 1, 1);
 
    EwinDetermineArea(ewin);
-   UngrabX();
+   ecore_x_ungrab();
 
    EDBUG_RETURN(ewin);
 }
@@ -1210,7 +1210,7 @@
 static void
 EwinEventPropertyNotify(EWin * ewin, XEvent * ev)
 {
-   GrabX();
+   ecore_x_grab();
    EwinChangesStart(ewin);
 
    HintsProcessPropertyChange(ewin, ev->xproperty.atom);
@@ -1218,7 +1218,7 @@
    SyncBorderToEwin(ewin);
 
    EwinChangesProcess(ewin);
-   UngrabX();
+   ecore_x_ungrab();
 }
 
 static void
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/handlers.c,v
retrieving revision 1.40.2.1
retrieving revision 1.40.2.2
diff -u -3 -r1.40.2.1 -r1.40.2.2
--- handlers.c  21 Aug 2004 09:09:20 -0000      1.40.2.1
+++ handlers.c  31 Aug 2004 21:58:35 -0000      1.40.2.2
@@ -57,7 +57,7 @@
 
      case SIGILL:
        if (disp)
-          UngrabX();
+          ecore_x_ungrab();
        DialogAlert(_
                    ("Enlightenment performed an Illegal Instruction.\n" "\n"
                     "This most likely is due to you having installed an run a\n"
@@ -71,7 +71,7 @@
 
      case SIGFPE:
        if (disp)
-          UngrabX();
+          ecore_x_ungrab();
        DialogAlert(_
                    ("Enlightenment caused a Floating Point Exception.\n" "\n"
                     "This means that Enlightenment or support library routines it 
calls\n"
@@ -90,7 +90,7 @@
           abort();
        loop_count++;
        if (disp)
-          UngrabX();
+          ecore_x_ungrab();
        DialogAlert(_
                    ("Enlightenment caused Segment Violation (Segfault)\n" "\n"
                     "This means that Enlightenment or support library routines it 
calls\n"
@@ -106,7 +106,7 @@
 
      case SIGBUS:
        if (disp)
-          UngrabX();
+          ecore_x_ungrab();
        DialogAlert(_
                    ("Enlightenment caused Bus Error.\n" "\n"
                     "It is suggested you check your hardware and OS installation.\n"
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/icccm.c,v
retrieving revision 1.76.2.4
retrieving revision 1.76.2.5
diff -u -3 -r1.76.2.4 -r1.76.2.5
--- icccm.c     27 Aug 2004 23:27:43 -0000      1.76.2.4
+++ icccm.c     31 Aug 2004 21:58:35 -0000      1.76.2.5
@@ -950,10 +950,10 @@
 
    EDBUG(6, "ICCCM_GetShapeInfo");
 
-   GrabX();
+   ecore_x_grab();
    EGetGeometry(disp, ewin->client.win, &rt, &x, &y, &w, &h, &d, &d);
    rl = EShapeGetRectangles(disp, ewin->client.win, ShapeBounding, &rn, &ord);
-   UngrabX();
+   ecore_x_ungrab();
 
    if (rn < 1)
      {
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/iconify.c,v
retrieving revision 1.116.2.14
retrieving revision 1.116.2.15
diff -u -3 -r1.116.2.14 -r1.116.2.15
--- iconify.c   31 Aug 2004 18:42:59 -0000      1.116.2.14
+++ iconify.c   31 Aug 2004 21:58:35 -0000      1.116.2.15
@@ -117,7 +117,7 @@
    if (Mode.wm.startup)
       return;
 
-   GrabX();
+   ecore_x_grab();
    spd = 0.00001;
    gcv.subwindow_mode = IncludeInferiors;
    gcv.function = GXxor;
@@ -270,7 +270,7 @@
          }
      }
    XFreeGC(disp, gc);
-   UngrabX();
+   ecore_x_ungrab();
 }
 
 #if 0                          /* Unused */
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/main.c,v
retrieving revision 1.99.2.15
retrieving revision 1.99.2.16
diff -u -3 -r1.99.2.15 -r1.99.2.16
--- main.c      29 Aug 2004 14:06:49 -0000      1.99.2.15
+++ main.c      31 Aug 2004 21:58:35 -0000      1.99.2.16
@@ -198,9 +198,9 @@
    LoadGroups();
    LoadSnapInfo();
 
-   GrabX();
+   ecore_x_grab();
    MapUnmap(0);
-   UngrabX();
+   ecore_x_ungrab();
 
    EwinsInit();
    ModulesSignal(ESIGNAL_INIT, NULL);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/memory.c,v
retrieving revision 1.38
retrieving revision 1.38.2.1
diff -u -3 -r1.38 -r1.38.2.1
--- memory.c    29 May 2004 19:01:58 -0000      1.38
+++ memory.c    31 Aug 2004 21:58:35 -0000      1.38.2.1
@@ -206,7 +206,7 @@
    if (!p)
      {
        if (disp)
-          UngrabX();
+          ecore_x_ungrab();
        AlertX(_("Cannot allocate enough memory"), _("Ignore this"),
               _("Restart Enlightenment"), _("Quit Enlightenment"),
               _("WARNING!!!!!!\n" "\n"
@@ -281,7 +281,7 @@
    if (bad)
      {
        if (disp)
-          UngrabX();
+          ecore_x_ungrab();
        AlertX(_("Error in reallocating memory that hasn't been allocated"),
               _("Ignore this"), _("Restart Enlightenment"),
               _("Quit Enlightenment"),
@@ -300,7 +300,7 @@
    if ((!p) && (size != 0))
      {
        if (disp)
-          UngrabX();
+          ecore_x_ungrab();
        AlertX(_("Cannot allocate enough memory"), _("Ignore this"),
               _("Restart Enlightenment"), _("Quit Enlightenment"),
               _("WARNING!!!!!!\n" "\n"
@@ -375,7 +375,7 @@
    if (bad)
      {
        if (disp)
-          UngrabX();
+          ecore_x_ungrab();
        AlertX(_("Error in freeing memory that hasn't been allocated"),
               _("Ignore this"), _("Restart Enlightenment"),
               _("Quit Enlightenment"),
@@ -390,7 +390,7 @@
    if (!ptr)
      {
        if (disp)
-          UngrabX();
+          ecore_x_ungrab();
        AlertX(_("Error in attempting to free NULL pointer"),
               _("Ignore this (safe)"), _("Restart Enlightenment"),
               _("Quit Enlightenment"),
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/moveresize.c,v
retrieving revision 1.22.2.5
retrieving revision 1.22.2.6
diff -u -3 -r1.22.2.5 -r1.22.2.6
--- moveresize.c        29 Aug 2004 14:06:51 -0000      1.22.2.5
+++ moveresize.c        31 Aug 2004 21:58:35 -0000      1.22.2.6
@@ -49,7 +49,7 @@
    ModulesSignal(ESIGNAL_MOVE_START, NULL);
 
    if (Conf.movemode > 0)
-      GrabX();
+      ecore_x_grab();
 
    GrabPointerRelease();
    GrabPointerSet(VRoot.win, ECSR_ACT_MOVE, 1);
@@ -105,7 +105,7 @@
    if (!ewin)
      {
        if (Conf.movemode > 0)
-          UngrabX();
+          ecore_x_ungrab();
        if (Mode.mode == MODE_MOVE)
           Conf.movemode = move_mode_real;
        EDBUG_RETURN(0);
@@ -157,7 +157,7 @@
 
    XSync(disp, False);
    if (Conf.movemode > 0)
-      UngrabX();
+      ecore_x_ungrab();
 
    Efree(gwins);
    Conf.movemode = move_mode_real;
@@ -268,7 +268,7 @@
    ModulesSignal(ESIGNAL_RESIZE_START, NULL);
 
    if (Conf.resizemode > 0)
-      GrabX();
+      ecore_x_grab();
 
    Mode.queue_up = 0;
 
@@ -368,7 +368,7 @@
    if (!ewin)
      {
        if (Conf.resizemode > 0)
-          UngrabX();
+          ecore_x_ungrab();
        EDBUG_RETURN(0);
      }
    Mode.queue_up = DRAW_QUEUE_ENABLE;
@@ -381,7 +381,7 @@
 
    XSync(disp, False);
    if (Conf.resizemode > 0)
-      UngrabX();
+      ecore_x_ungrab();
 
    ModulesSignal(ESIGNAL_RESIZE_DONE, NULL);
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/session.c,v
retrieving revision 1.75.2.7
retrieving revision 1.75.2.8
diff -u -3 -r1.75.2.7 -r1.75.2.8
--- session.c   26 Aug 2004 23:21:01 -0000      1.75.2.7
+++ session.c   31 Aug 2004 21:58:35 -0000      1.75.2.8
@@ -1005,8 +1005,8 @@
    else if (!strcmp(s, "restart_wm"))
      {
        SoundPlay("SOUND_WAIT");
-       XCloseDisplay(disp);
-       disp = NULL;
+       EDisplayClose();
+
        Esnprintf(s, sizeof(s), "exec %s", atword(params, 2));
        execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
      }
@@ -1017,10 +1017,8 @@
           win = MakeExtInitWin();
 
        if (disp)
-         {
-            XCloseDisplay(disp);
-            disp = NULL;
-         }
+          EDisplayClose();
+
        if (Conf.theme.name)
          {
             if (sm_client_id)
@@ -1067,10 +1065,8 @@
             SetSMUserThemePath(s);
          }
        if (disp)
-         {
-            XCloseDisplay(disp);
-            disp = NULL;
-         }
+          EDisplayClose();
+
        if (sm_client_id)
           Esnprintf(s, sizeof(s),
                     "exec %s -single -ext_init_win %li -theme %s "
@@ -1122,8 +1118,7 @@
          {
             SoundPlay("SOUND_WAIT");
             win = MakeExtInitWin();
-            XCloseDisplay(disp);
-            disp = NULL;
+            EDisplayClose();
 
             if (Mode.theme.path)
               {
@@ -1146,8 +1141,8 @@
          {
             SoundPlay("SOUND_WAIT");
             win = MakeExtInitWin();
-            XCloseDisplay(disp);
-            disp = NULL;
+            EDisplayClose();
+
             sscanf(params, "%*s %1000s", s);
             Esnprintf(sss, sizeof(sss),
                       "exec %s -single -ext_init_win %li -theme %s "
@@ -1158,8 +1153,8 @@
        else if (!strcmp(s, "restart_wm"))
          {
             SoundPlay("SOUND_EXIT");
-            XCloseDisplay(disp);
-            disp = NULL;
+            EDisplayClose();
+
             if (atword(params, 2))
                strncpy(s, atword(params, 2), 1000);
             real_exec = (char *)Emalloc(strlen(s) + 6);
@@ -1240,7 +1235,7 @@
 
    if (disp)
      {
-       UngrabX();
+       ecore_x_ungrab();
        GrabPointerRelease();
        XAllowEvents(disp, AsyncBoth, CurrentTime);
 
@@ -1251,11 +1246,7 @@
        /* I think this is a better way to release the grabs: (felix) */
        XSetInputFocus(disp, PointerRoot, RevertToPointerRoot, CurrentTime);
        XSelectInput(disp, VRoot.win, 0);
-#ifdef USE_ECORE_X
-       ecore_x_shutdown();
-#else
-       XCloseDisplay(disp);
-#endif
+       EDisplayClose();
      }
 
    XSetErrorHandler((XErrorHandler) NULL);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/setup.c,v
retrieving revision 1.139.2.7
retrieving revision 1.139.2.8
diff -u -3 -r1.139.2.7 -r1.139.2.8
--- setup.c     29 Aug 2004 14:06:52 -0000      1.139.2.7
+++ setup.c     31 Aug 2004 21:58:35 -0000      1.139.2.8
@@ -125,18 +125,7 @@
    Mode.wm.master_pid = getpid();
 
    /* Open a connection to the diplay nominated by the DISPLAY variable */
-   if (!dstr)
-      dstr = getenv("DISPLAY");
-   if (!dstr)
-      dstr = ":0";
-
-#ifdef USE_ECORE_X
-   ecore_x_init(dstr);
-   disp = ecore_x_display_get();
-#else
-   disp = XOpenDisplay(dstr);
-#endif
-   /* if cannot connect to display */
+   disp = EDisplayOpen(dstr);
    if (!disp)
      {
        Alert(_("Enlightenment cannot connect to the display nominated by\n"
@@ -504,7 +493,7 @@
    XSync(disp, False);
    if (fork())
      {
-       UngrabX();
+       ecore_x_ungrab();
 
        if (EventDebug(EDBUG_TYPE_SESSION))
           Eprintf("MakeExtInitWin - parent\n");
@@ -572,13 +561,13 @@
                       CWOverrideRedirect | CWSaveUnder | CWBackingStore |
                       CWColormap | CWBackPixel | CWBorderPixel, &attr);
 
-   pmap = ecore_x_pixmap_new(win, VRoot.w, VRoot.h, VRoot.depth);
+   pmap = XCreatePixmap(disp, win, VRoot.w, VRoot.h, VRoot.depth);
    gcv.subwindow_mode = IncludeInferiors;
    gc = XCreateGC(disp, win, GCSubwindowMode, &gcv);
    XCopyArea(disp, VRoot.win, pmap, gc, 0, 0, VRoot.w, VRoot.h, 0, 0);
-   ESetWindowBackgroundPixmap(disp, win, pmap);
-   EMapRaised(disp, win);
-   ecore_x_pixmap_del(pmap);
+   XSetWindowBackgroundPixmap(disp, win, pmap);
+   XMapRaised(disp, win);
+   XFreePixmap(disp, pmap);
    XFreeGC(disp, gc);
    val = win;
    a = XInternAtom(disp, "ENLIGHTENMENT_RESTART_SCREEN", False);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/slideout.c,v
retrieving revision 1.22.2.4
retrieving revision 1.22.2.5
diff -u -3 -r1.22.2.4 -r1.22.2.5
--- slideout.c  27 Aug 2004 21:31:54 -0000      1.22.2.4
+++ slideout.c  31 Aug 2004 21:58:35 -0000      1.22.2.5
@@ -47,9 +47,12 @@
    double              tm;
 
    EDBUG(5, "SlideWindowTo");
+
    spd = 16;
    min = 2;
-   GrabX();
+
+   ecore_x_grab();
+
    for (k = 0; k <= 1024; k += spd)
      {
        gettimeofday(&timev1, NULL);
@@ -73,7 +76,7 @@
           spd = min;
      }
    EMoveResizeWindow(disp, win, tx, ty, tw, th);
-   UngrabX();
+   ecore_x_ungrab();
    EDBUG_RETURN_;
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ttfont.c,v
retrieving revision 1.39
retrieving revision 1.39.2.1
diff -u -3 -r1.39 -r1.39.2.1
--- ttfont.c    25 Jul 2004 09:34:43 -0000      1.39
+++ ttfont.c    31 Aug 2004 21:58:35 -0000      1.39.2.1
@@ -165,16 +165,18 @@
    return 0;
 }
 
+#ifndef USE_ECORE_X
 void
-GrabX()
+ecore_x_grab(void)
 {
    XGrabServer(disp);
 }
 
 void
-UngrabX()
+ecore_x_ungrab(void)
 {
    XUngrabServer(disp);
    XFlush(disp);
 }
 #endif
+#endif
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/x.c,v
retrieving revision 1.71.2.8
retrieving revision 1.71.2.9
diff -u -3 -r1.71.2.8 -r1.71.2.9
--- x.c 29 Aug 2004 14:06:52 -0000      1.71.2.8
+++ x.c 31 Aug 2004 21:58:35 -0000      1.71.2.9
@@ -834,20 +834,18 @@
    *pb = pxc->blue >> 8;
 }
 
+#ifndef USE_ECORE_X
 void
-GrabX(void)
+ecore_x_grab(void)
 {
-   EDBUG(6, "GrabX");
    if (Mode.server_grabbed <= 0)
       XGrabServer(disp);
    Mode.server_grabbed++;
-   EDBUG_RETURN_;
 }
 
 void
-UngrabX(void)
+ecore_x_ungrab(void)
 {
-   EDBUG(6, "UngrabX");
    if (Mode.server_grabbed == 1)
      {
        XUngrabServer(disp);
@@ -856,8 +854,8 @@
    Mode.server_grabbed--;
    if (Mode.server_grabbed < 0)
       Mode.server_grabbed = 0;
-   EDBUG_RETURN_;
 }
+#endif
 
 void
 GetWinXY(Window win, int *x, int *y)
@@ -979,10 +977,10 @@
    int                 i;
 
    EDBUG(7, "WindowAtXY");
-   GrabX();
+   ecore_x_grab();
    if (!XQueryTree(disp, VRoot.win, &root_win, &parent_win, &list, &num))
      {
-       UngrabX();
+       ecore_x_ungrab();
        EDBUG_RETURN(VRoot.win);
      }
    if (list)
@@ -1000,13 +998,13 @@
                continue;
 
             XFree(list);
-            UngrabX();
+            ecore_x_ungrab();
             EDBUG_RETURN(child);
          }
        while (--i > 0);
        XFree(list);
      }
-   UngrabX();
+   ecore_x_ungrab();
    EDBUG_RETURN(VRoot.win);
 }
 
@@ -1055,3 +1053,34 @@
      }
    ecore_x_gc_del(gc);
 }
+
+Display            *
+EDisplayOpen(const char *dstr)
+{
+   Display            *dpy;
+
+   if (!dstr)
+      dstr = getenv("DISPLAY");
+   if (!dstr)
+      dstr = ":0";
+
+#ifdef USE_ECORE_X
+   ecore_x_init(dstr);
+   dpy = ecore_x_display_get();
+#else
+   dpy = XOpenDisplay(dstr);
+#endif
+
+   return dpy;
+}
+
+void
+EDisplayClose(void)
+{
+#ifdef USE_ECORE_X
+   ecore_x_shutdown();
+#else
+   XCloseDisplay(disp);
+#endif
+   disp = NULL;
+}




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to