🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.epoch.misc
Article #1887

UNOFFICIAL style patch

#1887
From: Alan M. Carroll
Date: Thu, 20 Jun 1991 13:36
102 lines
4382 bytes
Here is a diff file that will patch ./src/button.c. What it does is
allow a style color to be set to t in addition to an X-pixel resource
or nil. A value of t indicates the the current screen value should be
used, instead of a fixed color. So, to get an underline in the
foreground color on all screens (even if they have different colors),
just (set-style-underline s t).

Now, I give you fair warning - this is not official, which means that
support for it may be lacking even more than for official patches.
This will probably be included in the next official patch, due out
Real Soon Now :-)

*** button.c.orig	Tue Jun 11 13:16:54 1991
--- button.c	Tue Jun 18 08:27:03 1991
***************
*** 789,795 ****
       (style,value) Lisp_Object style,value;\
  {\
    CHECK_STYLE(style,0);\
!   XSTYLE(style)->field = EQ(Qnil,value) ? value : conversion(value);\
    return style;\
  }
  #define STYLE_GET_FUNCTION(field) \
--- 789,797 ----
       (style,value) Lisp_Object style,value;\
  {\
    CHECK_STYLE(style,0);\
!   if (EQ(Qnil, value)) XSTYLE(style)->field = Qnil;\
!   else if (EQ(Qt, value)) XSTYLE(style)->field = Qt;\
!   else XSTYLE(style)->field = conversion(value);\
    return style;\
  }
  #define STYLE_GET_FUNCTION(field) \
***************
*** 922,929 ****
--- 924,935 ----
  	case 0 :		/* text */
  	  if (XRESOURCEP(s->foreground))
  	    gcv.foreground = XXRESOURCE(s->foreground)->id;
+ 	  else if (EQ(Qt, s->foreground)) gcv.foreground = xs->foreground;
+ 
  	  if (XRESOURCEP(s->background))
  	    gcv.background = XXRESOURCE(s->background)->id;
+ 	  else if (EQ(Qt, s->background)) gcv.background = xs->background;
+ 
  	  break;
  	
  	case 1 :		/* cursor */
***************
*** 930,935 ****
--- 936,943 ----
  	  /* cursor foreground */
  	  if (XRESOURCEP(s->cursor_foreground))
  	    gcv.foreground = XXRESOURCE(s->cursor_foreground)->id;
+ 	  else if (EQ(Qt, s->cursor_foreground))
+ 	    gcv.foreground = xs->cursor_color;
  	  else if (XRESOURCEP(s->background))
  	    gcv.foreground = XXRESOURCE(s->background)->id;
  	
***************
*** 936,941 ****
--- 944,951 ----
  	  /* cursor background */
  	  if (XRESOURCEP(s->cursor_background))
  	    gcv.background = XXRESOURCE(s->cursor_background)->id;
+ 	  else if (EQ(Qt, s->cursor_background))
+ 	    gcv.background = xs->foreground;
  	  else if (XRESOURCEP(s->foreground))
  	    gcv.background = XXRESOURCE(s->foreground)->id;
  	  break;
***************
*** 1015,1025 ****
  		     count*xs->font_width,xs->font_height);
        XDrawString(xs->display,xs->xid,theGC,x,y,str,count);
  
!       if (XRESOURCEP(s->underline))
  	{
  	  int uy = (y - xs->font_base) + xs->font_height - 1;
  
! 	  gcv.foreground = XXRESOURCE(s->underline)->id;
  	  gcv.line_style = LineSolid; gcv.line_width = 0;
  	  gcv.fill_style = FillSolid;
  	  gcmask = GCForeground + GCLineStyle + GCLineWidth + GCFillStyle;
--- 1025,1036 ----
  		     count*xs->font_width,xs->font_height);
        XDrawString(xs->display,xs->xid,theGC,x,y,str,count);
  
!       if (XRESOURCEP(s->underline) || EQ(Qt, s->underline))
  	{
  	  int uy = (y - xs->font_base) + xs->font_height - 1;
  
! 	  gcv.foreground = EQ(Qt, s->underline)
! 	    ? xs->foreground : XXRESOURCE(s->underline)->id;
  	  gcv.line_style = LineSolid; gcv.line_width = 0;
  	  gcv.fill_style = FillSolid;
  	  gcmask = GCForeground + GCLineStyle + GCLineWidth + GCFillStyle;


-- 
Alan M. Carroll          <-- Another casualty of applied metaphysics
Epoch Development Team   
Urbana Il.               "I hate shopping with the reality-impaired" - Susan
Technical Details
Message-ID: <1991Jun20.133615.14994@m.cs.uiuc.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!news.cs.indiana.edu!ux1.cso.uiuc.edu!m.cs.uiuc.edu!uiucdcs!carroll

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc7ee,c0d41389adc57288,start
X-Google-Attributes: gidfc7ee,public
X-Google-ArrivalTime: 1991-06-21 00:47:26 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!news.cs.indiana.edu!ux1.cso.uiuc.edu!m.cs.uiuc.edu!uiucdcs!carroll
From: carroll@cs.uiuc.edu (Alan M. Carroll)
Newsgroups: gnu.epoch.misc
Subject: UNOFFICIAL style patch
Message-ID: <1991Jun20.133615.14994@m.cs.uiuc.edu>
Date: 20 Jun 91 13:36:15 GMT
Sender: news@m.cs.uiuc.edu (News Database (admin-Mike Schwager))
Organization: Technophiles Inc. - Engineers with Attitude
Lines: 102
Nntp-Posting-Host: ash.cs.uiuc.edu