Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h borders.c desktops.c events.c ewmh.c focus.c iclass.c 
        memory.c misc.c stacking.c warp.c x.c 


Log Message:
Introduce debug print function.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.240
retrieving revision 1.241
diff -u -3 -r1.240 -r1.241
--- E.h 7 Apr 2004 21:50:12 -0000       1.240
+++ E.h 8 Apr 2004 12:54:43 -0000       1.241
@@ -36,7 +36,6 @@
 #define USE_LIBC_SETENV  1     /* Use libc setenv  if present */
 #endif
 #define USE_LIBC_MALLOC  1     /* Use unwrapped libc malloc/realloc/free */
-#define DEBUG_EWMH  0
 
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
@@ -2372,11 +2371,7 @@
 void                EdgeHandleMotion(XEvent * ev);
 void                Quicksort(void **a, int l, int r,
                              int (*CompareFunc) (void *d1, void *d2));
-#if USE_LIBC_SETENV
-#define Esetenv setenv
-#else
-int                 Esetenv(const char *name, const char *value, int overwrite);
-#endif
+void                Eprintf(const char *fmt, ...);
 
 /* moveresize.c */
 int                 ActionMoveStart(EWin * ewin, const void *params,
@@ -2757,6 +2752,11 @@
 #else
 char               *Estrndup(const char *s, int n);
 #endif
+#if USE_LIBC_SETENV
+#define Esetenv setenv
+#else
+int                 Esetenv(const char *name, const char *value, int overwrite);
+#endif
 
 /*
  * Global vars
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -3 -r1.160 -r1.161
--- borders.c   7 Apr 2004 21:50:14 -0000       1.160
+++ borders.c   8 Apr 2004 12:54:44 -0000       1.161
@@ -1715,8 +1715,8 @@
    call_depth++;
 
    if (EventDebug(EDBUG_TYPE_MOVERESIZE))
-      printf("doMoveResizeEwin %#lx %d+%d %d*%d %d %s\n",
-            ewin->client.win, x, y, w, h, flags, EwinGetTitle(ewin));
+      Eprintf("doMoveResizeEwin %#lx %d+%d %d*%d %d %s\n",
+             ewin->client.win, x, y, w, h, flags, EwinGetTitle(ewin));
 
    if (Mode.mode == MODE_NONE)
      {
@@ -1924,7 +1924,7 @@
    EDBUG(3, "RestackEwin");
 
    if (EventDebug(EDBUG_TYPE_STACKING))
-      printf("RestackEwin %#lx %s\n", ewin->client.win, EwinGetTitle(ewin));
+      Eprintf("RestackEwin %#lx %s\n", ewin->client.win, EwinGetTitle(ewin));
 
    if (ewin->floating)
      {
@@ -1951,8 +1951,8 @@
      }
    value_mask = CWSibling | CWStackMode;
    if (EventDebug(EDBUG_TYPE_STACKING))
-      printf("RestackEwin %#10lx %s %#10lx\n", ewin->win,
-            (xwc.stack_mode == Above) ? "Above" : "Below", xwc.sibling);
+      Eprintf("RestackEwin %#10lx %s %#10lx\n", ewin->win,
+             (xwc.stack_mode == Above) ? "Above" : "Below", xwc.sibling);
    XConfigureWindow(disp, ewin->win, value_mask, &xwc);
 
    if (Mode.mode == MODE_NONE)
@@ -1978,8 +1978,8 @@
    call_depth++;
 
    if (EventDebug(EDBUG_TYPE_RAISELOWER))
-      printf("RaiseEwin(%d) %#lx %s\n", call_depth, ewin->client.win,
-            EwinGetTitle(ewin));
+      Eprintf("RaiseEwin(%d) %#lx %s\n", call_depth, ewin->client.win,
+             EwinGetTitle(ewin));
 
    if (ewin->win)
      {
@@ -2029,8 +2029,8 @@
    call_depth++;
 
    if (EventDebug(EDBUG_TYPE_RAISELOWER))
-      printf("LowerEwin(%d) %#lx %s\n", call_depth, ewin->client.win,
-            EwinGetTitle(ewin));
+      Eprintf("LowerEwin(%d) %#lx %s\n", call_depth, ewin->client.win,
+             EwinGetTitle(ewin));
 
    if ((ewin->win) && (!ewin->floating))
      {
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -3 -r1.79 -r1.80
--- desktops.c  4 Apr 2004 21:44:45 -0000       1.79
+++ desktops.c  8 Apr 2004 12:54:44 -0000       1.80
@@ -1663,9 +1663,9 @@
 
    if (EventDebug(EDBUG_TYPE_STACKING))
      {
-       printf("StackDesktop %d:\n", desk);
+       Eprintf("StackDesktop %d:\n", desk);
        for (i = 0; i < tot; i++)
-          printf(" win=%#10lx parent=%#10lx\n", wl[i], GetWinParent(wl[i]));
+          Eprintf(" win=%#10lx parent=%#10lx\n", wl[i], GetWinParent(wl[i]));
      }
    XRestackWindows(disp, wl, tot);
    ShowEdgeWindows();
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/events.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -3 -r1.61 -r1.62
--- events.c    7 Apr 2004 21:39:58 -0000       1.61
+++ events.c    8 Apr 2004 12:54:45 -0000       1.62
@@ -67,9 +67,9 @@
      {
        XShapeQueryVersion(disp, &major, &minor);
        if (Mode.debug)
-          printf("Found extension Shape version %d.%d\n"
-                 " Event/error base = %d/%d\n",
-                 major, minor, event_base_shape, error_base_shape);
+          Eprintf("Found extension Shape version %d.%d\n"
+                  " Event/error base = %d/%d\n",
+                  major, minor, event_base_shape, error_base_shape);
      }
    else
      {
@@ -88,9 +88,9 @@
      {
        XRRQueryVersion(disp, &major, &minor);
        if (Mode.debug)
-          printf("Found extension RandR version %d.%d\n"
-                 " Event/error base = %d/%d\n",
-                 major, minor, event_base_randr, error_base_randr);
+          Eprintf("Found extension RandR version %d.%d\n"
+                  " Event/error base = %d/%d\n",
+                  major, minor, event_base_randr, error_base_randr);
 
        /* Listen for RandR events */
        XRRSelectInput(disp, root.win, RRScreenChangeNotifyMask);
@@ -281,8 +281,8 @@
    /* Debug - should be taken out */
    if (EventDebug(EDBUG_TYPE_COMPRESSION))
       for (i = 0; i < count; i++)
-        printf("EventsCompress-1 %3d t=%s w=%#lx\n", i, EventName(evq[i].type),
-               evq[i].xany.window);
+        Eprintf("EventsCompress-1 %3d t=%s w=%#lx\n", i,
+                EventName(evq[i].type), evq[i].xany.window);
 
    /* Loop through event list, starting with latest */
    for (i = count - 1; i > 0; i--)
@@ -311,8 +311,8 @@
                    }
               }
             if (n && EventDebug(EDBUG_TYPE_COMPRESSION))
-               printf("EventsCompress MotionNotify %#lx n=%4d x,y = %d,%d\n",
-                      ev->xmotion.window, n, ev->xmotion.x, ev->xmotion.y);
+               Eprintf("EventsCompress MotionNotify %#lx n=%4d x,y = %d,%d\n",
+                       ev->xmotion.window, n, ev->xmotion.x, ev->xmotion.y);
             break;
 
          case Expose:
@@ -347,8 +347,9 @@
                  ev->xexpose.height = yb - ya;
               }
             if (EventDebug(EDBUG_TYPE_COMPRESSION))
-               printf("EventsCompress Expose %#lx n=%4d x=%4d-%4d y=%4d-%4d\n",
-                      ev->xexpose.window, n, xa, xb, ya, yb);
+               Eprintf
+                  ("EventsCompress Expose %#lx n=%4d x=%4d-%4d y=%4d-%4d\n",
+                   ev->xexpose.window, n, xa, xb, ya, yb);
             break;
 
          default:
@@ -366,8 +367,8 @@
                         }
                    }
                  if (n && EventDebug(EDBUG_TYPE_COMPRESSION))
-                    printf("EventsCompress ShapeNotify %#lx n=%4d\n",
-                           ev->xmotion.window, n);
+                    Eprintf("EventsCompress ShapeNotify %#lx n=%4d\n",
+                            ev->xmotion.window, n);
               }
             break;
          }
@@ -376,8 +377,8 @@
    /* Debug - should be taken out */
    if (EventDebug(EDBUG_TYPE_COMPRESSION))
       for (i = 0; i < count; i++)
-        printf("EventsCompress-2 %3d t=%s w=%#lx\n", i, EventName(evq[i].type),
-               evq[i].xany.window);
+        Eprintf("EventsCompress-2 %3d t=%s w=%#lx\n", i,
+                EventName(evq[i].type), evq[i].xany.window);
 }
 
 static int
@@ -653,22 +654,22 @@
        goto case_common;
      case ButtonPress:
      case ButtonRelease:
-       printf("EV-%s win=%#lx state=%#x button=%#x\n", name, win,
-              ev->xbutton.state, ev->xbutton.button);
+       Eprintf("EV-%s win=%#lx state=%#x button=%#x\n", name, win,
+               ev->xbutton.state, ev->xbutton.button);
        break;
      case MotionNotify:
        goto case_common;
      case EnterNotify:
      case LeaveNotify:
-       printf("EV-%s win=%#lx m=%s d=%s\n", name, win,
-              EventNotifyModeName(ev->xcrossing.mode),
-              EventNotifyDetailName(ev->xcrossing.detail));
+       Eprintf("EV-%s win=%#lx m=%s d=%s\n", name, win,
+               EventNotifyModeName(ev->xcrossing.mode),
+               EventNotifyDetailName(ev->xcrossing.detail));
        break;
      case FocusIn:
      case FocusOut:
-       printf("EV-%s win=%#lx m=%s d=%s\n", name, win,
-              EventNotifyModeName(ev->xfocus.mode),
-              EventNotifyDetailName(ev->xfocus.detail));
+       Eprintf("EV-%s win=%#lx m=%s d=%s\n", name, win,
+               EventNotifyModeName(ev->xfocus.mode),
+               EventNotifyDetailName(ev->xfocus.detail));
        break;
      case KeymapNotify:
      case Expose:
@@ -681,19 +682,20 @@
      case UnmapNotify:
      case MapNotify:
      case MapRequest:
-       printf("EV-%s ev=%#lx win=%#lx\n", name, win, ev->xcreatewindow.window);
+       Eprintf("EV-%s ev=%#lx win=%#lx\n", name, win,
+               ev->xcreatewindow.window);
        break;
      case ReparentNotify:
        goto case_common;
      case ConfigureNotify:
-       printf("EV-%s: win=%#lx event=%#lx %d+%d %dx%d bw=%d above=%#lx\n",
-              name, ev->xconfigure.window, win,
-              ev->xconfigure.x, ev->xconfigure.y,
-              ev->xconfigure.width, ev->xconfigure.height,
-              ev->xconfigure.border_width, ev->xconfigure.above);
+       Eprintf("EV-%s: win=%#lx event=%#lx %d+%d %dx%d bw=%d above=%#lx\n",
+               name, ev->xconfigure.window, win,
+               ev->xconfigure.x, ev->xconfigure.y,
+               ev->xconfigure.width, ev->xconfigure.height,
+               ev->xconfigure.border_width, ev->xconfigure.above);
        break;
      case ConfigureRequest:
-       printf
+       Eprintf
           ("EV-%s: win=%#lx parent=%#lx m=%#lx %d+%d %dx%d bw=%d above=%#lx stk=%d\n",
            name, ev->xconfigurerequest.window, win,
            ev->xconfigurerequest.value_mask, ev->xconfigurerequest.x,
@@ -704,16 +706,16 @@
      case GravityNotify:
        goto case_common;
      case ResizeRequest:
-       printf("EV-%s: win=%#lx %dx%d\n",
-              name, win, ev->xresizerequest.width, ev->xresizerequest.height);
+       Eprintf("EV-%s: win=%#lx %dx%d\n",
+               name, win, ev->xresizerequest.width, ev->xresizerequest.height);
        break;
      case CirculateNotify:
      case CirculateRequest:
        goto case_common;
      case PropertyNotify:
        txt = XGetAtomName(disp, ev->xproperty.atom);
-       printf("EV-%s: win=%#lx Atom=%s(%ld)\n",
-              name, win, txt, ev->xproperty.atom);
+       Eprintf("EV-%s: win=%#lx Atom=%s(%ld)\n",
+               name, win, txt, ev->xproperty.atom);
        XFree(txt);
        break;
      case SelectionClear:
@@ -723,7 +725,7 @@
        goto case_common;
      case ClientMessage:
        txt = XGetAtomName(disp, ev->xclient.message_type);
-       printf
+       Eprintf
           ("EV-%s win=%#lx ev_type=%s(%ld) data[0-3]= %08lx %08lx %08lx %08lx\n",
            name, win, txt, ev->xclient.message_type, ev->xclient.data.l[0],
            ev->xclient.data.l[1], ev->xclient.data.l[2],
@@ -732,17 +734,17 @@
        break;
      case MappingNotify:
       case_common:
-       printf("EV-%s win=%#lx\n", name, win);
+       Eprintf("EV-%s win=%#lx\n", name, win);
        break;
      default:
        if (ev->type == event_base_shape + ShapeNotify)
-          printf("EV-ShapeNotify win=%#lx\n", win);
+          Eprintf("EV-ShapeNotify win=%#lx\n", win);
 #ifdef USE_XRANDR
        else if (ev->type == event_base_randr + RRScreenChangeNotify)
-          printf("EV-RRScreenChangeNotify win=%#lx\n", win);
+          Eprintf("EV-RRScreenChangeNotify win=%#lx\n", win);
 #endif
        else
-          printf("EV-??? Type=%d win=%#lx\n", ev->type, win);
+          Eprintf("EV-??? Type=%d win=%#lx\n", ev->type, win);
        break;
      }
 }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewmh.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -3 -r1.42 -r1.43
--- ewmh.c      4 Apr 2004 21:34:16 -0000       1.42
+++ ewmh.c      8 Apr 2004 12:54:45 -0000       1.43
@@ -25,11 +25,6 @@
  */
 #include "E.h"
 
-#if DEBUG_EWMH
-#undef EDBUG
-#define EDBUG(a,b) printf(b "\n")
-#endif
-
 #define _ATOM_INIT(atom) atom = XInternAtom(disp, #atom, False); \
     atom_list[atom_count++] = atom
 
@@ -389,7 +384,7 @@
    lst = (EWin **) EwinListGetStacking(&num);
    /* FIXME: num must be unchanged here! Check! */
    if (num != nwin)
-      printf("*** ERROR: no=%d nn=%d\n", nwin, num);
+      Eprintf("*** ERROR: no=%d nn=%d\n", nwin, num);
    if (num > nwin)
       wl = Erealloc(wl, num * sizeof(Window));
    nwin = 0;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/focus.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -3 -r1.62 -r1.63
--- focus.c     4 Apr 2004 21:32:37 -0000       1.62
+++ focus.c     8 Apr 2004 12:54:45 -0000       1.63
@@ -165,12 +165,12 @@
        XGrabButton(disp, AnyButton, AnyModifier, ewin->win_container,
                    False, ButtonPressMask, GrabModeSync, GrabModeAsync,
                    None, None);
-/*     printf("FocusEwinSetGrabs: %#lx grab\n", ewin->client.win); */
+/*     Eprintf("FocusEwinSetGrabs: %#lx grab\n", ewin->client.win); */
      }
    else
      {
        XUngrabButton(disp, AnyButton, AnyModifier, ewin->win_container);
-/*     printf("FocusEwinSetGrabs: %#lx ungrab\n", ewin->client.win); */
+/*     Eprintf("FocusEwinSetGrabs: %#lx ungrab\n", ewin->client.win); */
      }
 }
 
@@ -212,10 +212,10 @@
    if (EventDebug(EDBUG_TYPE_FOCUS))
      {
        if (ewin)
-          printf("FocusToEWin %#lx %s why=%d\n", ewin->client.win,
-                 ewin->icccm.wm_res_name, why);
+          Eprintf("FocusToEWin %#lx %s why=%d\n", ewin->client.win,
+                  ewin->icccm.wm_res_name, why);
        else
-          printf("FocusToEWin None why=%d\n", why);
+          Eprintf("FocusToEWin None why=%d\n", why);
      }
 
    switch (why)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/iclass.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- iclass.c    6 Apr 2004 23:23:21 -0000       1.32
+++ iclass.c    8 Apr 2004 12:54:45 -0000       1.33
@@ -429,7 +429,7 @@
        int                 xx, yy;
 
        XTranslateCoordinates(disp, win, root.win, 0, 0, &xx, &yy, &cr);
-/*     printf("ImageStateMakePmapMask %#lx %d %d %d %d\n", win, xx, yy, w, h); */
+/*     Eprintf("ImageStateMakePmapMask %#lx %d %d %d %d\n", win, xx, yy, w, h); */
        if (xx < root.w && yy < root.h && xx + w >= 0 && yy + h >= 0)
          {
             /* Create the background base image */
@@ -446,7 +446,7 @@
      }
    else
      {
-/*     printf("ImageStateMakePmapMask %#lx %d %d\n", win, w, h); */
+/*     Eprintf("ImageStateMakePmapMask %#lx %d %d\n", win, w, h); */
      }
 #endif
 
@@ -849,7 +849,7 @@
        Pixmap              pmap;
 
        if (pmm->pmap)
-          printf("IclassApplyCopy: Hmm... pmm->pmap already set\n");
+          Eprintf("IclassApplyCopy: Hmm... pmm->pmap already set\n");
 
        pmap = ECreatePixmap(disp, win, w, h, root.depth);
        pmm->type = 0;
@@ -884,7 +884,7 @@
    is->im = ELoadImage(is->real_file);
    imlib_context_set_image(is->im);
    if (is->im == NULL)
-      printf
+      Eprintf
         ("ImageStateRealize: Hmmm... is->im is NULL (im_file=%s real_file=%s\n",
          is->im_file, is->real_file);
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/memory.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- memory.c    26 Mar 2004 21:42:03 -0000      1.36
+++ memory.c    8 Apr 2004 12:54:45 -0000       1.37
@@ -428,3 +428,14 @@
    EDBUG_RETURN(ss);
 }
 #endif
+
+#if !USE_LIBC_SETENV
+int
+Esetenv(const char *name, const char *value, int overwrite __UNUSED__)
+{
+   char                envvar[FILEPATH_LEN_MAX];
+
+   Esnprintf(envvar, FILEPATH_LEN_MAX, "%s=%s", name, value);
+   return putenv(Estrdup(envvar));
+}
+#endif
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/misc.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- misc.c      7 Apr 2004 14:32:35 -0000       1.52
+++ misc.c      8 Apr 2004 12:54:45 -0000       1.53
@@ -438,13 +438,13 @@
      }
 }
 
-#if !USE_LIBC_SETENV
-int
-Esetenv(const char *name, const char *value, int overwrite __UNUSED__)
+void
+Eprintf(const char *fmt, ...)
 {
-   char                envvar[FILEPATH_LEN_MAX];
+   va_list             args;
 
-   Esnprintf(envvar, FILEPATH_LEN_MAX, "%s=%s", name, value);
-   return putenv(Estrdup(envvar));
+   fprintf(stdout, "[%d] ", getpid());
+   va_start(args, fmt);
+   vfprintf(stdout, fmt, args);
+   va_end(args);
 }
-#endif
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/stacking.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- stacking.c  4 Apr 2004 21:44:45 -0000       1.8
+++ stacking.c  8 Apr 2004 12:54:46 -0000       1.9
@@ -42,13 +42,13 @@
    if (!EventDebug(EDBUG_TYPE_STACKING))
       return;
 
-   printf("%s-%s:\n", ewl->name, txt);
+   Eprintf("%s-%s:\n", ewl->name, txt);
    for (i = 0; i < ewl->nwins; i++)
      {
        ewin = ewl->list[i];
-       printf(" %2d: %#10lx %#10lx %d %d %s\n", i, ewin->win, ewin->client.win,
-              ewin->desktop, (ewin->floating) ? 999 : ewin->layer,
-              EwinGetTitle(ewin));
+       Eprintf(" %2d: %#10lx %#10lx %d %d %s\n", i, ewin->win,
+               ewin->client.win, ewin->desktop,
+               (ewin->floating) ? 999 : ewin->layer, EwinGetTitle(ewin));
      }
 }
 #else
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/warp.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- warp.c      1 Apr 2004 22:41:22 -0000       1.40
+++ warp.c      8 Apr 2004 12:54:46 -0000       1.41
@@ -61,9 +61,9 @@
       EDBUG_RETURN(0);
 
 #if 0                          /* Debug */
-   printf("WarpFocusHandleEvent win=%#x key=%#x(%#x) %d\n",
-         (unsigned)ev->xkey.window, ev->xkey.keycode,
-         warpFocusKey, warpFocusTitleShowing);
+   Eprintf("WarpFocusHandleEvent win=%#x key=%#x(%#x) %d\n",
+          (unsigned)ev->xkey.window, ev->xkey.keycode,
+          warpFocusKey, warpFocusTitleShowing);
 #endif
    if (warpFocusTitleShowing)
      {
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/x.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -3 -r1.67 -r1.68
--- x.c 4 Apr 2004 21:30:59 -0000       1.67
+++ x.c 8 Apr 2004 12:54:46 -0000       1.68
@@ -571,7 +571,7 @@
      }
 #if 0                          /* Debug */
    if (!ok)
-      printf("EGetGeometry win=%#x, error %d\n", (unsigned)win, ok);
+      Eprintf("EGetGeometry win=%#x, error %d\n", (unsigned)win, ok);
 #endif
    return ok;
 }




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to