antiright-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Antiright-devel] antiright/xshell Makefile button.c decoration.c...


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright/xshell Makefile button.c decoration.c...
Date: Sun, 25 Nov 2007 00:01:01 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 07/11/25 00:01:00

Modified files:
        xshell         : Makefile button.c decoration.c decoration.h 
                         layout.c text.c 

Log message:
        Fix boolean store for layout processing end flag.
        Fixed CVS merge conflicts.  

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/xshell/Makefile?cvsroot=antiright&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/antiright/xshell/button.c?cvsroot=antiright&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/antiright/xshell/decoration.c?cvsroot=antiright&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/antiright/xshell/decoration.h?cvsroot=antiright&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/antiright/xshell/layout.c?cvsroot=antiright&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/antiright/xshell/text.c?cvsroot=antiright&r1=1.8&r2=1.9

Patches:
Index: Makefile
===================================================================
RCS file: /sources/antiright/antiright/xshell/Makefile,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- Makefile    23 Nov 2007 23:15:31 -0000      1.6
+++ Makefile    25 Nov 2007 00:01:00 -0000      1.7
@@ -35,6 +35,7 @@
 # For use with patched version of evilwm
 # CFLAGS+=-DEVILWM_HACK_HACK
 #CFLAGS+=-DXSH_USE_GRADIENT
+CFLAGS+=-DXSH_USE_INDICATORS
 #CFLAGS+=-DDEBUG -g3 -Wall -W
 #CFLAGS+=-DDEBUG_EVENTS
 # This is for a button status indicator, currently just a decoration.  

Index: button.c
===================================================================
RCS file: /sources/antiright/antiright/xshell/button.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- button.c    8 Nov 2007 06:41:54 -0000       1.12
+++ button.c    25 Nov 2007 00:01:00 -0000      1.13
@@ -68,7 +68,7 @@
 #ifdef XSH_DECORATE
        if(button->events.button_press)
                xsh_decorate(button, XSH_DECOR_OUT);
-       else
+       else /* for label  */
                xsh_decorate(button, XSH_DECOR_FLAT);
 #endif /* XSH_DECORATE */
        draw_label((XShell *)(button->xsh), button);

Index: decoration.c
===================================================================
RCS file: /sources/antiright/antiright/xshell/decoration.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- decoration.c        23 Nov 2007 23:15:31 -0000      1.9
+++ decoration.c        25 Nov 2007 00:01:00 -0000      1.10
@@ -23,9 +23,16 @@
 #ifdef XSH_DECORATE
 #include "xshell.h"
 
+#ifdef GRADIENT_DELTA
+#undef GRADIENT_DELTA
+#endif /* GRADIENT_DELTA */
 #define GRADIENT_DELTA 16
 
-
+GC
+xsh_setup_gc(Display * display, Window window)
+{
+       return XCreateGC(display, window, 0, NULL);
+}
 
 static void
 cleanup(Display * display, GC gc)
@@ -33,6 +40,25 @@
        XFreeGC(display, gc);
 }
 
+#ifdef XSH_USE_INDICATORS
+
+#define SET_GC_FOR_INDICATOR_TYPE(dpy, gc, indicator)\
+       XSH_SET_COLOR(dpy, gc, 255/(indicator+1), 0xb2, 0xc3);
+
+static void
+draw_indicator(Display * dpy, Window win, GC gc, XWindowAttributes geometry,
+       int indicator_type)
+{
+       SET_GC_FOR_INDICATOR_TYPE(dpy, gc, indicator_type);
+#define INDICATOR_GEOMETRY geometry.width-8, geometry.height/5, 4, 8, 0, 23040
+       XFillArc(dpy, win, gc, INDICATOR_GEOMETRY);
+       XSH_SET_COLOR(dpy, gc, (0xae)/2, (0xb2)/2, (0xc3)/2);
+       XDrawArc(dpy, win, gc, INDICATOR_GEOMETRY);
+       XSH_SET_COLOR(dpy, gc, (0xae)/3, (0xb2)/3, (0xc3)/3);
+       XDrawArc(dpy, win, gc, INDICATOR_GEOMETRY);
+}
+#endif /* XSH_USE_INDICATORS */
+
 #define SET_COLOR XSH_SET_COLOR
 
 static void
@@ -42,14 +68,14 @@
        short val;
 
        val=outset?255:0;
-       SET_COLOR(dpy, gc, val, val, val);
+       XSH_SET_COLOR(dpy, gc, val, val, val);
        /* top */
        XDrawLine(dpy, win, gc, 0, 0, geometry.width, 0);
        /* left */
        XDrawLine(dpy, win, gc, 0, 0, 0, geometry.height);
 
        val=!outset?255:0;
-       SET_COLOR(dpy, gc, val, val, val);
+       XSH_SET_COLOR(dpy, gc, val, val, val);
        /* bottom */
        XDrawLine(dpy, win, gc, 0, geometry.height-1, 
                geometry.width, geometry.height-1);
@@ -57,17 +83,9 @@
        XDrawLine(dpy, win, gc, geometry.width-1, 0, 
                geometry.width-1, geometry.height);
 
-#ifdef XSH_USE_INDICATOR
-       SET_COLOR(dpy, gc, 0xae, 0xff, 0xc3);
-       XFillArc(dpy, win, gc, geometry.width-8,
-               geometry.height/5, 4, 8, 0, 360*64);
-       SET_COLOR(dpy, gc, (0xae)/2, (0xb2)/2, (0xc3)/2);
-       XDrawArc(dpy, win, gc, geometry.width-8,
-               geometry.height/5, 4, 8, 0, 360*64);
-       SET_COLOR(dpy, gc, (0xae)/3, (0xb2)/3, (0xc3)/3);
-       XDrawArc(dpy, win, gc, geometry.width-8,
-               geometry.height/5, 5, 9, 0, 360*64);
-#endif /* XSH_USE_INDICATOR */
+#ifdef XSH_USE_INDICATORS
+       draw_indicator(dpy, win, gc, geometry, XSH_INDICATE_NORMAL);
+#endif /* XSH_USE_INDICATORS */
 }
 
 #ifdef XSH_USE_GRADIENT
@@ -83,7 +101,7 @@
                int y;
                
                delta=-order*counter*4;
-               SET_COLOR(display, gc,
+               XSH_SET_COLOR(display, gc,
                        (0xae)+delta*(order),
                        (0xb2)+delta*(order),
                        (0xc3)+delta*(order));
@@ -95,11 +113,6 @@
        }
 }
 
-void
-xsh_setup_gradients(XShell * xsh)
-{
-}
-
 #endif /* XSH_USE_GRADIENT */
 
 void
@@ -111,7 +124,7 @@
        Window window;
 
        xsh=xsh_get_XShell_for_widget(widget);
-       gc=XSH_SETUP_GC(display=xsh->gui.display, window=widget->window);
+       gc=xsh_setup_gc(display=xsh->gui.display, window=widget->window);
 
        /* Draw decoration */
        {
@@ -121,11 +134,12 @@
 #ifdef XSH_USE_GRADIENT
                draw_gradient(display, window, gc, &geometry, -order);
 #else /* not XSH_USE_GRADIENT */
-               SET_COLOR(display, gc, (0xae)+4*-order, (0xb2)+4*-order, 
(0xc3)+4*-order);
+               XSH_SET_COLOR(display, gc, 
+                       (0xae)+4*-order, (0xb2)+4*-order, (0xc3)+4*-order);
                XFillRectangle(display, window, gc, 
                        0, 0, geometry.width, geometry.height);
 #endif /* XSH_USE_GRADIENT */
-               if(order != 0)
+               if(order != 0) /* for non-flat */
                        draw_frame(display, window, gc, order!=1, geometry);
        }
        /* Free GC data.  */

Index: decoration.h
===================================================================
RCS file: /sources/antiright/antiright/xshell/decoration.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- decoration.h        20 Aug 2007 16:12:09 -0000      1.7
+++ decoration.h        25 Nov 2007 00:01:00 -0000      1.8
@@ -20,11 +20,12 @@
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
 */
 
-#ifdef XSH_DECORATE
 
 #ifndef XSH_DECOR_H
 #define XSH_DECOR_H
 
+#ifdef XSH_DECORATE
+
 #define XSH_DECOR_IN 1
 #define XSH_DECOR_FLAT 0
 #define XSH_DECOR_OUT -1
@@ -38,8 +39,34 @@
 void
 xsh_setup_gradients(XShell * xsh);
 
+#ifdef XSH_USE_INDICATORS
+#define XSH_INDICATE_ERROR     0
+#define XSH_INDICATE_WARN      1
+#define XSH_INDICATE_INFO      2
+#define XSH_INDICATE_DEBUG     3
+#define XSH_INDICATE_NORMAL    4
+#define XSH_INDICATE_NONE      6
+#define XSH_INDICATE_DISABLED  10
+#endif /* XSH_USE_INDICATORS */
+
+#endif /* XSH_DECORATE */
+
+/* These functions are used elsewhere regardless of decorated widgets.  */
+
+GC
+xsh_setup_gc(Display * display, Window window);
+
+unsigned long 
+xsh_get_color(Display * display, 
+       unsigned short r, unsigned short g, unsigned short b);
+
+void
+xsh_set_foreground(Display * display, GC gc, unsigned long color);
+
+#define XSH_SET_COLOR(dpy, gc, r, g, b)\
+       xsh_set_foreground(dpy, gc, xsh_get_color(dpy, r, g, b))
 
 #endif /* XSH_DECOR_H */
 
-#endif /* XSH_DECORATE */
+
 

Index: layout.c
===================================================================
RCS file: /sources/antiright/antiright/xshell/layout.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- layout.c    20 Aug 2007 19:55:24 -0000      1.7
+++ layout.c    25 Nov 2007 00:01:00 -0000      1.8
@@ -30,12 +30,12 @@
        XShellGUILayout *layout=&(gui->layout);
        unsigned int column_count = layout->column_count;
 
-       if(!(column_count & XSH_STOP_LAYOUT))
+       if(!(xsh->options & XSH_STOP_LAYOUT))
                XResizeWindow(gui->display, gui->widgets->window,
                        layout->widget_width*(column_count+1),
                        XSH_WIDGET_HEIGHT*(column_count>0 
                        ? layout->max_row_count : layout->row_count));
-       layout->column_count|=XSH_STOP_LAYOUT;
+       xsh->options|=XSH_STOP_LAYOUT;
 }
 
 

Index: text.c
===================================================================
RCS file: /sources/antiright/antiright/xshell/text.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- text.c      28 Aug 2007 19:39:12 -0000      1.8
+++ text.c      25 Nov 2007 00:01:00 -0000      1.9
@@ -36,12 +36,12 @@
        for(i=0; i<length; i+=columns)
        {
                char * end;
+               unsigned int line_length;
 
                end=strchr(text, '\n');
                *end='\0';
        
-               unsigned int line_length
-                       =(length=strlen(text)) < columns ? length : columns;
+               line_length=(length=strlen(text)) < columns ? length : columns;
                XDrawString(gui->display, text_widget->window, gui->gc,
                        0, (++line)*font_height, text, line_length);
                text+=line_length;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]