FVWM: Titlebar Pixmap hack

From: Seth Burgess <root_at_cate0-44.reshall.uoknor.edu>
Date: Wed, 24 Apr 1996 23:56:43 -0500 (CDT)

Hi All!

I'm not much of a C programmer (I had an intro course last year), but I was
intrigued by the pixmap titlebar patch. I applied it and it worked without
much event, but I found that I wanted a small pixmap tiled instead of a really
big pixmap across the whole thing. So knowing that I should know better, I
hacked Andrew's otherwise nice source and came up with this. I seem to
recall somebody requesting this...

Its only a modification of borders.c where you actually put the pixmap
onto the titlebar.

I'm not too familiar with the layout of the sources, so I didn't attempt
to #ifdef or change anything in the TitleStyle. Its really a dirty hack
and I apologize in advance for it...


Seth Burgess
root_at_cate0-44.reshall.uoknor.edu
sjburges_at_mailhost.ecn.uoknor.edu

(sorry, no diff experience either =[ )

{Change this in borders.c AFTER you've applied the PIXMAP_TITLEBARS patch}

#ifdef XPM
#ifdef PIXMAP_TITLEBARS
      /* draw pixmaps before text */
      {
          Picture *p;

          if (Scr.Hilite==t)
          {
              if (PressedW==t->title_w)
                  p = Scr.pixmap_title.active_down;
              else
                  p = Scr.pixmap_title.active_up;
          }
          else
              p = Scr.pixmap_title.inactive_up; /* we only have inactive UP */
      
          if (p != NULL)
          {
              int a = t->title_height - 2, b = t->title_width - 2;
              int width = p->width, height = p->height;
              int x = 1, y = 1;
              if (width >= b) width = b - 1;
              if (height >= a) height = a - 1;

              XClearArea(dpy, t->title_w, 1, 1, b - 1, a - 1, False);
          
/* Repeat the perty pixmap into a pattern */
              while((x+width) < b)
              {
                   XSetClipMask(dpy, Scr.ButtonMaskGC, p->mask);
                   XSetClipOrigin(dpy, Scr.ButtonMaskGC, x, y);
                   XCopyArea(dpy, p->picture, t->title_w, Scr.ButtonMaskGC,
                        0, 0, width, height, x, y);
                   x = x + width;
              }
/* Simply put the remainder - 1 pixel on the bar */
               width = b - x - 1 ;
              XSetClipMask(dpy, Scr.ButtonMaskGC, p->mask);
              XSetClipOrigin(dpy, Scr.ButtonMaskGC, x, y);
              XCopyArea(dpy, p->picture, t->title_w, Scr.ButtonMaskGC,
                        0, 0, width, height, x, y);
          }
      }
#endif /* PIXMAP_TITLEBARS */
#endif /* XPM */
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Wed Apr 24 1996 - 23:46:04 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:58 BST