Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h config.c globals.c setup.c tclass.c text.c 


Log Message:
Added possibility to configure not to use fnlib (configure --without-fnlib).
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -3 -r1.128 -r1.129
--- E.h 12 Jul 2003 14:06:37 -0000      1.128
+++ E.h 12 Jul 2003 14:34:14 -0000      1.129
@@ -35,7 +35,9 @@
 /*#include <X11/extensions/XTest.h> */
 #include <X11/extensions/XShm.h>
 #include <Imlib.h>
+#if USE_FNLIB
 #include <Fnlib.h>
+#endif
 
 #define DEBUG_EWMH  0
 
@@ -675,11 +677,30 @@
 }
 Efont;
 
+#if !USE_FNLIB
+#define MODE_VERBATIM  0
+#define MODE_WRAP_CHAR 1
+#define MODE_WRAP_WORD 2
+
+#define FONT_TO_RIGHT 0
+#define FONT_TO_DOWN  1
+#define FONT_TO_UP    2
+#define FONT_TO_LEFT  3
+#endif
+
 typedef struct _textstate
 {
    char               *fontname;
+#if USE_FNLIB
    FnlibStyle          style;
    FnlibFont          *font;
+#else
+   struct
+   {
+      char                mode;
+      char                orientation;
+   } style;
+#endif
    ImlibColor          fg_col;
    ImlibColor          bg_col;
    int                 effect;
@@ -3011,7 +3032,10 @@
 extern Display     *disp;
 extern ImlibData   *id;
 extern ImlibData   *ird;
-extern FnlibData   *fd;
+
+#if USE_FNLIB
+extern FnlibData   *pFnlibData;
+#endif
 extern List        *lists;
 extern int          event_base_shape;
 extern Window       comms_win;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/config.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -3 -r1.62 -r1.63
--- config.c    11 Jul 2003 18:36:52 -0000      1.62
+++ config.c    12 Jul 2003 14:34:14 -0000      1.63
@@ -3665,13 +3665,17 @@
    mustdel = 0;
 
    Esnprintf(s, sizeof(s), "%s/", UserEDir());
-   Fnlib_add_dir(fd, s);
+#if USE_FNLIB
+   Fnlib_add_dir(pFnlibData, s);
+#endif
 #ifndef __EMX__
    Esnprintf(s, sizeof(s), "%s/config/", ENLIGHTENMENT_ROOT);
 #else
    Esnprintf(s, sizeof(s), "%s/config/", __XOS2RedirRoot(ENLIGHTENMENT_ROOT));
 #endif
-   Fnlib_add_dir(fd, s);
+#if USE_FNLIB
+   Fnlib_add_dir(pFnlibData, s);
+#endif
    /* save the current theme */
    if ((themelocation) && (themelocation[0] != 0))
      {
@@ -3723,7 +3727,9 @@
      }
    strcpy(themepath, theme);
    Esnprintf(s, sizeof(s), "%s/", theme);
-   Fnlib_add_dir(fd, s);
+#if USE_FNLIB
+   Fnlib_add_dir(pFnlibData, s);
+#endif
    {
       Progressbar        *p = NULL;
       int                 i;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/globals.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- globals.c   12 Jul 2003 14:06:37 -0000      1.14
+++ globals.c   12 Jul 2003 14:34:14 -0000      1.15
@@ -36,7 +36,10 @@
 Display            *disp;
 ImlibData          *id;
 ImlibData          *ird;
-FnlibData          *fd;
+
+#if USE_FNLIB
+FnlibData          *pFnlibData;
+#endif
 List               *lists;
 int                 event_base_shape;
 Window              comms_win;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/setup.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -3 -r1.87 -r1.88
--- setup.c     11 Jul 2003 17:58:19 -0000      1.87
+++ setup.c     12 Jul 2003 14:34:14 -0000      1.88
@@ -331,8 +331,9 @@
        RESET_ALERT;
        EExit((void *)1);
      }
-   fd = Fnlib_init(id);
-   if (!fd)
+#if USE_FNLIB
+   pFnlibData = Fnlib_init(id);
+   if (!pFnlibData)
      {
        ASSIGN_ALERT(_("X server setup error"), "", "",
                     _("Quit Enlightenment"));
@@ -343,6 +344,7 @@
        RESET_ALERT;
        EExit((void *)1);
      }
+#endif
    root.win = id->x.root;
    root.vis = Imlib_get_visual(id);
    root.depth = id->x.depth;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/tclass.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- tclass.c    22 May 2003 19:15:03 -0000      1.14
+++ tclass.c    12 Jul 2003 14:34:14 -0000      1.15
@@ -53,8 +53,10 @@
 
    if (ts->fontname)
       Efree(ts->fontname);
+#if USE_FNLIB
    if (ts->font)
-      Fnlib_free_font(fd, ts->font);
+      Fnlib_free_font(pFnlibData, ts->font);
+#endif
    if (ts->xfont)
       XFreeFont(disp, ts->xfont);
    if (ts->efont)
@@ -141,9 +143,11 @@
    ts->fontname = NULL;
    ts->style.mode = MODE_WRAP_CHAR;
    ts->style.orientation = FONT_TO_RIGHT;
+#if USE_FNLIB
    ts->style.justification = 0;
    ts->style.spacing = 0;
    ts->font = NULL;
+#endif
    ts->efont = NULL;
    ts->xfont = NULL;
    ts->xfontset = 0;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/text.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- text.c      22 May 2003 19:15:03 -0000      1.20
+++ text.c      12 Jul 2003 14:34:14 -0000      1.21
@@ -139,13 +139,23 @@
 TextStateLoadFont(TextState * ts)
 {
    EDBUG(5, "TextStateLoadFont");
+#if USE_FNLIB
    if ((ts->font) || (ts->efont) || (ts->xfont) || (ts->xfontset))
+#else
+   if ((ts->efont) || (ts->xfont) || (ts->xfontset))
+#endif
       EDBUG_RETURN_;
    if (!ts->fontname)
       EDBUG_RETURN_;
+#if USE_FNLIB
    if ((!ts->font) && (!ts->efont))
-      ts->font = Fnlib_load_font(fd, ts->fontname);
+      ts->font = Fnlib_load_font(pFnlibData, ts->fontname);
+#endif
+#if USE_FNLIB
    if ((!ts->font) && (!ts->efont))
+#else
+   if (!ts->efont)
+#endif
      {
        char                s[4096], w[4046], *dup, *ss;
 
@@ -168,7 +178,11 @@
        if (dup)
           Efree(dup);
      }
+#if USE_FNLIB
    if ((!ts->font) && (!ts->efont))
+#else
+   if (!ts->efont)
+#endif
      {
        if ((!ts->xfont) && (strchr(ts->fontname, ',') == NULL))
          {
@@ -218,21 +232,25 @@
    if (!ts)
       EDBUG_RETURN_;
    TextStateLoadFont(ts);
+#if USE_FNLIB
    if (ts->font)
      {
        for (i = 0; i < num_lines; i++)
          {
             int                 high, wid, dummy;
 
-            Fnlib_measure(fd, ts->font, 0, 0, 999999, 999999, 0, 0, fsize,
-                          &ts->style, (unsigned char *)lines[i], 0, 0, &dummy,
-                          &dummy, &wid, &high, &dummy, &dummy, &dummy, &dummy);
+            Fnlib_measure(pFnlibData, ts->font, 0, 0, 999999, 999999, 0, 0,
+                          fsize, &ts->style, (unsigned char *)lines[i], 0, 0,
+                          &dummy, &dummy, &wid, &high, &dummy, &dummy, &dummy,
+                          &dummy);
             *height += high;
             if (wid > *width)
                *width = wid;
          }
      }
-   else if (ts->efont)
+   else
+#endif
+   if (ts->efont)
      {
        for (i = 0; i < num_lines; i++)
          {
@@ -323,25 +341,29 @@
    else
       textwidth_limit = h;
 
+#if USE_FNLIB
    if (ts->font)
      {
        for (i = 0; i < num_lines; i++)
          {
             int                 high, wid, dummy;
 
-            Fnlib_measure(fd, ts->font, 0, 0, 999999, 999999, 0, 0, fsize,
-                          &ts->style, (unsigned char *)lines[i], 0, 0, &dummy,
-                          &dummy, &wid, &high, &dummy, &dummy, &dummy, &dummy);
+            Fnlib_measure(pFnlibData, ts->font, 0, 0, 999999, 999999, 0, 0,
+                          fsize, &ts->style, (unsigned char *)lines[i], 0, 0,
+                          &dummy, &dummy, &wid, &high, &dummy, &dummy, &dummy,
+                          &dummy);
             if ((ts->style.orientation == FONT_TO_UP)
                 || (ts->style.orientation == FONT_TO_DOWN))
                fsize = w;
             xx = x + (((w - wid) * justification) >> 10);
-            Fnlib_draw(fd, ts->font, win, 0, xx, yy, w, h, 0, 0, fsize,
+            Fnlib_draw(pFnlibData, ts->font, win, 0, xx, yy, w, h, 0, 0, fsize,
                        &ts->style, (unsigned char *)lines[i]);
             yy += high;
          }
      }
-   else if (ts->efont)
+   else
+#endif
+   if (ts->efont)
      {
        for (i = 0; i < num_lines; i++)
          {




-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to