diff options
author | Tavis Ormandy <taviso@gentoo.org> | 2004-07-10 11:11:17 +0000 |
---|---|---|
committer | Tavis Ormandy <taviso@gentoo.org> | 2004-07-10 11:11:17 +0000 |
commit | a84153b09c6dd9fb16f57d5ceed6fc016aabf115 (patch) | |
tree | fe03afd87e31326d8d0e0fb68682e2e69eade969 | |
parent | Marked ~amd64. (Manifest recommit) (diff) | |
download | gentoo-2-a84153b09c6dd9fb16f57d5ceed6fc016aabf115.tar.gz gentoo-2-a84153b09c6dd9fb16f57d5ceed6fc016aabf115.tar.bz2 gentoo-2-a84153b09c6dd9fb16f57d5ceed6fc016aabf115.zip |
fvwmbuttons patch
-rw-r--r-- | x11-wm/fvwm/ChangeLog | 8 | ||||
-rw-r--r-- | x11-wm/fvwm/Manifest | 4 | ||||
-rw-r--r-- | x11-wm/fvwm/files/digest-fvwm-2.5.10-r6 | 2 | ||||
-rw-r--r-- | x11-wm/fvwm/files/fvwm-2.5.10-fvwmbuttonshover.diff | 1242 | ||||
-rw-r--r-- | x11-wm/fvwm/fvwm-2.5.10-r6.ebuild | 319 |
5 files changed, 1574 insertions, 1 deletions
diff --git a/x11-wm/fvwm/ChangeLog b/x11-wm/fvwm/ChangeLog index 9b20e5b2191a..2620b6152939 100644 --- a/x11-wm/fvwm/ChangeLog +++ b/x11-wm/fvwm/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for x11-wm/fvwm # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/x11-wm/fvwm/ChangeLog,v 1.76 2004/07/07 02:08:02 kloeri Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-wm/fvwm/ChangeLog,v 1.77 2004/07/10 11:11:17 taviso Exp $ + +*fvwm-2.5.10-r6 (10 Jul 2004) + + 10 Jul 2004; Tavis Ormandy <taviso@gentoo.org> + +files/fvwm-2.5.10-fvwmbuttonshover.diff, +fvwm-2.5.10-r6.ebuild: + adding fvwmbuttons patch from cvs 07 Jul 2004; Bryan Østergaard <kloeri@gentoo.org> fvwm-2.5.10-r3.ebuild: Stable on alpha. diff --git a/x11-wm/fvwm/Manifest b/x11-wm/fvwm/Manifest index d886d322df3b..9e70226637d0 100644 --- a/x11-wm/fvwm/Manifest +++ b/x11-wm/fvwm/Manifest @@ -2,6 +2,7 @@ MD5 fee6ff9d3bda846c84a2650aff370283 fvwm-2.5.7-r5.ebuild 8765 MD5 f7be9fe31d4c7311d643486221a530a3 fvwm-2.5.10-r5.ebuild 9855 MD5 9dea6a4c4802ee4b7fadd0b74e176899 fvwm-2.5.8-r6.ebuild 10705 MD5 5b04edc59a5abc45ff89473f9039d6e8 fvwm-2.5.10-r4.ebuild 9486 +MD5 2fa51a92988be50f4b4ced18c3b65d79 fvwm-2.5.10-r6.ebuild 9948 MD5 bf8326cb19f07f1381f9821550ad720b ChangeLog 14125 MD5 4833e4d0685ef48988c0c5c4f9c6b377 metadata.xml 527 MD5 a747110a9b94991131c858edd26e677f fvwm-2.4.18.ebuild 3163 @@ -20,12 +21,14 @@ MD5 8ebd7b398d3c580ca5067c78f8642ae1 files/fvwm-2.5.8-taskbar-margins.diff 1384 MD5 0fcb3587e80a443304b2e6878b6eab0a files/fvwmtabs-2.8-insecure-tmp-handling.diff 2349 MD5 d15c4e05878e8e2b8a9d5edcf30abdc2 files/fvwm-2.5.9-translucent-menus.diff.gz 58529 MD5 977c11b7ca7c17cff7a14d1d4a0136f4 files/fvwm-2.5.8-perllib-disconnect.diff 1179 +MD5 99f051eaf568574640fbf5b83acdeb98 files/fvwm-buttons-aterm.diff 1617 MD5 5bda5a33cdd7fc8517aa413550ad4e1e files/iconfile-2.5.10.diff 745 MD5 0a39299dd7ca570060f545e659c77604 files/fvwm-2.5.10-FvwmCommand.diff 1013 MD5 5dc401c9f6a50da0bfa85a025749652a files/fvwm-2.5.8-fvwm-menu-directory-security.diff 382 MD5 0c1b906138bf4e2977e7be1631f949d9 files/digest-fvwm-2.5.10-r3 128 MD5 0c1b906138bf4e2977e7be1631f949d9 files/digest-fvwm-2.5.10-r4 128 MD5 856bdf34d1530e03fc3aa2c6b3630ccc files/digest-fvwm-2.5.10-r5 129 +MD5 856bdf34d1530e03fc3aa2c6b3630ccc files/digest-fvwm-2.5.10-r6 129 MD5 e9263b93f666293d0a1220ea3457efcd files/mini.happy.xpm 425 MD5 2bdb17132f9d7f352002a1fbace7fca1 files/acinclude.m4 61423 MD5 4f044a8a47c9f8ea61d54dfa4bd79b70 files/fvwm-2.5.8-fvwm-bug-security.diff 327 @@ -34,5 +37,6 @@ MD5 efd2297324dd0241c2a879beadfabdb7 files/fvwm-2.5.10-mips-compat.diff 2306 MD5 e52e1c9212c856d5de29c603678dc52e files/digest-fvwm-2.5.7-r5 127 MD5 c3ea3b9a8c5d7700913a795096e0b51a files/digest-fvwm-2.5.8-r6 127 MD5 97373a30210df0b93c59e2aac76d17e0 files/fvwm-2.5.8-undermouse.diff 2534 +MD5 ebf71494aad8261811bdca083d90c71c files/fvwm-2.5.10-fvwmbuttonshover.diff 31463 MD5 933ebc841a6eafebaf9d57b7a99c3b10 files/fvwm-2.5.8-flickeringmoveworkaround.diff 726 MD5 b20e3c8c23286531b549852ecbed4b74 files/fvwm-2.5.10-post-release.diff 2923 diff --git a/x11-wm/fvwm/files/digest-fvwm-2.5.10-r6 b/x11-wm/fvwm/files/digest-fvwm-2.5.10-r6 new file mode 100644 index 000000000000..8badcdb941fd --- /dev/null +++ b/x11-wm/fvwm/files/digest-fvwm-2.5.10-r6 @@ -0,0 +1,2 @@ +MD5 b3c86e2af2a4eabe692c9c849ff4b243 fvwm-2.5.10.tar.bz2 1788873 +MD5 17313f940d0110e37f996aae3ead282e FvwmTabs-v3.1.tar.gz 28934 diff --git a/x11-wm/fvwm/files/fvwm-2.5.10-fvwmbuttonshover.diff b/x11-wm/fvwm/files/fvwm-2.5.10-fvwmbuttonshover.diff new file mode 100644 index 000000000000..9f6da79c8aa5 --- /dev/null +++ b/x11-wm/fvwm/files/fvwm-2.5.10-fvwmbuttonshover.diff @@ -0,0 +1,1242 @@ +diff -u fvwm-2.5.10/modules/FvwmButtons/button.c fvwm/modules/FvwmButtons/button.c +--- fvwm-2.5.10/modules/FvwmButtons/button.c 2003-06-29 20:53:24.000000000 +0100 ++++ fvwm/modules/FvwmButtons/button.c 2004-07-10 10:13:25.000000000 +0100 +@@ -298,6 +298,11 @@ + + int buttonColorset(button_info *b) + { ++ if (b == HoverButton && UberButton->c->flags & b_HoverColorset) ++ { ++ return UberButton->c->hoverColorset; ++ } ++ + if (b->flags & b_Colorset) + return b->colorset; + else if (b->flags & b_Container && b->c->flags & b_Colorset) +Only in fvwm/modules/FvwmButtons: CVS +Only in fvwm/modules/FvwmButtons: .cvsignore +diff -u fvwm-2.5.10/modules/FvwmButtons/draw.c fvwm/modules/FvwmButtons/draw.c +--- fvwm-2.5.10/modules/FvwmButtons/draw.c 2003-06-29 20:53:24.000000000 +0100 ++++ fvwm/modules/FvwmButtons/draw.c 2004-07-10 10:13:25.000000000 +0100 +@@ -139,11 +139,6 @@ + /* At this point iw,ih,ix and iy should be correct. Now all we have to do is + place title and iconwin in their proper positions */ + +- /* For now, use the old routine in icons.h for buttons with icons */ +- if(b->flags&b_Icon && !(b->flags&b_IconAlpha)) +- { +- ConfigureIconWindow(b, NULL); +- } + /* For now, hardcoded window centered, title bottom centered, below window */ + if(buttonSwallowCount(b)==3 && (b->flags & b_Swallow)) + { +@@ -188,13 +183,13 @@ + *** draw can be: + *** DRAW_RELIEF: draw only the relief + *** DRAW_CLEAN: draw the relief, the foreground bg if any and if this +-*** the case draw the title and the icon if b_IconAlpha. This is safe ++*** the case draw the title and the icon if b_Icon. This is safe + *** but the button background may be not repaint (if the bg of the button + *** come from a parent button). +-*** DRAW_ALL: as above but draw the title and the icon if b_IconAlpha in +-*** any case. WARRNING: the title and the icon (b_IconAlpha) must be cleaned: ++*** DRAW_ALL: as above but draw the title and the icon if b_Icon in ++*** any case. WARRNING: the title and the icon (b_Icon) must be cleaned: + *** if the button has a bg this is the case, but if the bg of the button +-*** come from a parent button this is not the case and xft title and alpha ++*** come from a parent button this is not the case and xft title and + *** icons will be not draw correctly. + *** So DRAW_ALL is ok only when you draw buttons recursively. + *** DRAW_FORCE: draw the button and its parent fg bg. Use this only if +@@ -222,6 +217,9 @@ + Bool clean = False; + Bool cleaned = False; + Bool clear_bg = False; ++ unsigned long iconFlag, otherIconFlag; ++ Bool has_title; ++ FvwmPicture *pic; + + cset = buttonColorset(b); + if (cset >= 0) +@@ -246,8 +244,8 @@ + + /* This probably isn't the place for this, but it seems to work here + * and not elsewhere, so... */ +- if((b->flags & b_Swallow) && (buttonSwallowCount(b)==3) && +- b->IconWin!=None) ++ if ((b->flags & b_Swallow) && (buttonSwallowCount(b) == 3) && ++ b->IconWin != None) + { + XSetWindowBorderWidth(Dpy,b->IconWin,0); + } +@@ -357,6 +355,28 @@ + of = f; + f=abs(f); + ++ iconFlag = b_Icon; ++ otherIconFlag = b_HoverIcon; ++ has_title = (b->flags & b_Title ? True : False); ++ pic = b->icon; ++ if (b == HoverButton) ++ { ++ /* If no HoverIcon is specified, we use Icon (if there is ++ one). */ ++ if (b->flags & b_HoverIcon) ++ { ++ iconFlag = b_HoverIcon; ++ otherIconFlag = b_Icon; ++ pic = b->hovericon; ++ } ++ /* If no HoverTitle is specified, we use Title (if there is ++ one). */ ++ if (b->flags & b_HoverTitle) ++ { ++ has_title = True; ++ } ++ } ++ + if (draw == DRAW_CLEAN) + { + clean = True; +@@ -498,39 +518,60 @@ + if (do_draw) + { + cleaned = True; +- XFillRectangle( +- Dpy,MyWindow,NormalGC, +- clip.x,clip.y,clip.width,clip.height); ++ if (b == HoverButton && ++ UberButton->c->flags & b_HoverColorset) ++ { ++ SetRectangleBackground(Dpy, MyWindow, ++ clip.x, clip.y, clip.width, ++ clip.height, ++ &Colorset[UberButton->c->hoverColorset], ++ Pdepth, NormalGC); ++ } ++ else ++ { ++ XFillRectangle(Dpy, MyWindow, NormalGC, ++ clip.x, clip.y, clip.width, ++ clip.height); ++ } + } + } + else if (clear_bg || + (pev && !buttonBackgroundButton(b,NULL) && + ((b->flags&b_Title && Ffont && Ffont->fftf.fftfont) || +- (b->flags&b_Icon && b->flags&b_IconAlpha)))) ++ (b->flags&b_Icon)))) + { + /* some times we need to clear the real bg. + * The pev expose rectangle can be bigger than the real + * exposed part (as we rectangle flush and pev can + * be a fake event) so we need to clear with xft font +- * and icons with alpha */ ++ * and icons. */ + if (do_draw) + { + cleaned = True; +- XClearArea( +- Dpy, MyWindow, clip.x, clip.y, +- clip.width, clip.height, False); ++ XClearArea(Dpy, MyWindow, clip.x, ++ clip.y, clip.width, clip.height, ++ False); ++ if (b == HoverButton && ++ UberButton->c->flags & b_HoverColorset) ++ { ++ SetRectangleBackground(Dpy, MyWindow, ++ clip.x, clip.y, clip.width, ++ clip.height, ++ &Colorset[UberButton->c->hoverColorset], ++ Pdepth, NormalGC); ++ } + } + } + } + + /* ------------------------------------------------------------------ */ + +- if(cleaned && (b->flags&b_Title)) ++ if (cleaned && (b->flags & (b_Title|b_HoverTitle))) + { + DrawTitle(b,MyWindow,NormalGC,pev,False); + } + +- if (!(b->flags&b_Title) && (b->flags & b_Panel) && ++ if (!has_title && (b->flags & b_Panel) && + (b->panel_flags.panel_indicator)) + { + XGCValues gcv; +@@ -612,10 +653,13 @@ + } + } /* panel indicator */ + +- /* redraw icons with alpha because there are drawn on the foreground */ +- if(cleaned && (b->flags&b_Icon) && (b->flags & b_IconAlpha)) ++ if (cleaned) + { +- DrawForegroundIcon(b, pev); ++ if (b->flags & iconFlag) ++ { ++ /* draw icon */ ++ DrawForegroundIcon(b, pev); ++ } + } + + /* relief */ +@@ -633,13 +677,26 @@ + FlocaleFont *Ffont=buttonFont(b); + int justify=buttonJustify(b); + int l,i,xpos; +- char *s; ++ char *s = NULL; + int just=justify&b_TitleHoriz; /* Left, center, right */ + XGCValues gcv; + unsigned long gcm; + int cset; + XRectangle clip; + Region region = None; ++ FvwmPicture *pic = b->icon; ++ unsigned long iconFlag = b_Icon; ++ ++ if (b == HoverButton) ++ { ++ /* If no HoverIcon is specified, we use Icon (if there is ++ one). */ ++ if (b->flags & b_HoverIcon) ++ { ++ pic = b->hovericon; ++ iconFlag = b_HoverIcon; ++ } ++ } + + BH = buttonHeight(b); + +@@ -647,7 +704,18 @@ + + /* ------------------------------------------------------------------ */ + +- if(!(b->flags&b_Title) || !Ffont) ++ /* If this is the current hover button but no explicit HoverTitle was ++ specified, use the Title (if there is one). */ ++ if (b == HoverButton && b->flags & b_HoverTitle) ++ { ++ s = b->hoverTitle; ++ } ++ else if (b->flags & b_Title) ++ { ++ s = b->title; ++ } ++ ++ if (!s || !Ffont) + { + return; + } +@@ -676,10 +744,10 @@ + /* If a title is to be shown, truncate it until it fits */ + if(justify&b_Horizontal && !(b->flags & b_Right)) + { +- if(b->flags&b_Icon) ++ if (b->flags & iconFlag) + { +- ix+=b->icon->width+buttonXPad(b); +- iw-=b->icon->width+buttonXPad(b); ++ ix += pic->width+buttonXPad(b); ++ iw -= pic->width+buttonXPad(b); + } + else if ((b->flags & b_Swallow) && buttonSwallowCount(b)==3) + { +@@ -688,7 +756,6 @@ + } + } + +- s = b->title; + l = strlen(s); + i = FlocaleTextWidth(Ffont,s,l); + +@@ -740,7 +807,7 @@ + FwinString.x = xpos; + /* If there is more than the title, put it at the bottom */ + /* Unless stack flag is set, put it to the right of icon */ +- if((b->flags&b_Icon || ++ if ((b->flags & iconFlag || + ((buttonSwallowCount(b)==3) && (b->flags&b_Swallow))) && + !(justify&b_Horizontal)) + { +diff -u fvwm-2.5.10/modules/FvwmButtons/dynamic.c fvwm/modules/FvwmButtons/dynamic.c +--- fvwm-2.5.10/modules/FvwmButtons/dynamic.c 2002-11-05 12:30:29.000000000 +0000 ++++ fvwm/modules/FvwmButtons/dynamic.c 2004-07-10 10:13:25.000000000 +0100 +@@ -73,16 +73,12 @@ + + static void change_button_title(button_info *b, const char *text) + { +- if (!(b->flags & b_Title)) +- { +- show_error("Cannot create a title, only change one\n"); +- return; +- } + if (text == NULL) + { + show_error("No title to change specified, unsupported\n"); + return; + } ++ b->flags |= b_Title; + free(b->title); + CopyString(&b->title, text); + return; +@@ -92,11 +88,6 @@ + { + FvwmPicture *new_icon; + +- if (!(b->flags & b_Icon)) +- { +- show_error("Cannot create an icon, only change one\n"); +- return; +- } + if (file == NULL) + { + show_error("No icon to change specified, unsupported\n"); +@@ -107,22 +98,12 @@ + show_error("Cannot load icon %s\n", file); + return; + } ++ b->flags |= b_Icon; + free(b->icon_file); + PDestroyFvwmPicture(Dpy, b->icon); +- DestroyIconWindow(b); + b->icon = new_icon; + CopyString(&b->icon_file, file); +- CreateIconWindow(b); +- if (b->flags&b_IconAlpha) +- { +- RedrawButton(b, DRAW_FORCE, NULL); +- } +- else +- { +- ConfigureIconWindow(b, NULL); +- XMapWindow(Dpy, b->IconWin); +- } +- return; ++ RedrawButton(b, DRAW_FORCE, NULL); + } + + #if 0 +@@ -250,6 +231,8 @@ + { + "Silent", "ChangeButton", "ExpandButtonVars", NULL + }; ++ ++/* TODO: Should probably allow the HoverIcon & HoverTitle to change one day. */ + static char *button_options[] = + { + "Title", "Icon", NULL +diff -u fvwm-2.5.10/modules/FvwmButtons/FvwmButtons.c fvwm/modules/FvwmButtons/FvwmButtons.c +--- fvwm-2.5.10/modules/FvwmButtons/FvwmButtons.c 2004-02-16 10:18:30.000000000 +0000 ++++ fvwm/modules/FvwmButtons/FvwmButtons.c 2004-07-10 10:13:25.000000000 +0100 +@@ -67,7 +67,6 @@ + #include "FvwmButtons.h" + #include "misc.h" /* ConstrainSize() */ + #include "parse.h" /* ParseConfiguration(), parse_window_geometry() */ +-#include "icons.h" /* CreateIconWindow(), ConfigureIconWindow() */ + #include "draw.h" + #include "dynamic.h" + +@@ -75,6 +74,7 @@ + #define MW_EVENTS (ExposureMask |\ + StructureNotifyMask |\ + ButtonReleaseMask | ButtonPressMask |\ ++ LeaveWindowMask | PointerMotionMask |\ + KeyReleaseMask | KeyPressMask | ButtonMotionMask) + /* SW_EVENTS are for swallowed windows... */ + #define SW_EVENTS (PropertyChangeMask | StructureNotifyMask |\ +@@ -96,7 +96,7 @@ + void SetButtonSize(button_info*,int,int); + /* main */ + void Loop(void); +-void RedrawWindow(); ++void RedrawWindow(void); + void RecursiveLoadData(button_info*,int*,int*); + void CreateUberButtonWindow(button_info*,int,int); + int My_FNextEvent(Display *dpy, XEvent *event); +@@ -162,7 +162,9 @@ + Bool is_transient = 0; + Bool is_transient_panel = 0; + +-button_info *CurrentButton = NULL; ++/* $CurrentButton is set on ButtonPress, $HoverButton is set whenever the ++ mouse is over a button that is redrawn specially. */ ++button_info *CurrentButton = NULL, *HoverButton = NULL; + Bool is_pointer_in_current_button = False; + int fd[2]; + +@@ -842,27 +844,6 @@ + + CreateUberButtonWindow(UberButton,maxx,maxy); + +-#ifdef DEBUG_INIT +- fprintf(stderr,"OK\n%s: Creating icon windows...",MyName); +-#endif +- +- i=-1; +- ub=UberButton; +- while(NextButton(&ub,&b,&i,0)) +- { +- if(b->flags&b_Icon) +- { +-#ifdef DEBUG_INIT +- fprintf(stderr,"0x%06x...",(ushort)b); +-#endif +- CreateIconWindow(b); +- } +- } +- +-#ifdef DEBUG_INIT +- fprintf(stderr,"OK\n%s: Configuring windows...",MyName); +-#endif +- + if (!XGetGeometry( + Dpy, MyWindow, &root, &x, &y, (unsigned int *)&Width, + (unsigned int *)&Height, (unsigned int *)&border_width, &depth)) +@@ -873,8 +854,6 @@ + SetButtonSize(UberButton,Width,Height); + i=-1; + ub=UberButton; +- while(NextButton(&ub,&b,&i,0)) +- ConfigureIconWindow(b, NULL); + + if (FShapesSupported) + { +@@ -922,6 +901,30 @@ + return 0; + } + ++/* We get LeaveNotify events when the mouse enters a swallowed window of ++ FvwmButtons, but we're not interested in these situations. */ ++static Bool reallyLeaveWindow (const int x, const int y, ++ const Window win, const button_info *b) ++{ ++ if (x < 0 || x >= Width || y < 0 || y >= Height) ++ { ++ return True; ++ } ++ ++ if (b == NULL) ++ { ++ b = select_button(UberButton, x, y); ++ } ++ ++ /* TODO: fix situation when mouse enters window overlapping ++ with a b_Swallow button. */ ++ if (b->flags & b_Swallow) ++ { ++ return False; ++ } ++ return True; ++} ++ + /* -------------------------------- Main Loop -------------------------------*/ + + /** +@@ -1075,20 +1078,68 @@ + } + break; + +- case MotionNotify: ++ case MotionNotify: + { +- Bool f = is_pointer_in_current_button; ++ Bool f = is_pointer_in_current_button, redraw_relief = False; ++ if (Event.xmotion.x < 0 || Event.xmotion.x >= Width || ++ Event.xmotion.y < 0 || Event.xmotion.y >= Height) ++ { ++ /* cursor is outside of FvwmButtons window. */ ++ break; ++ } + +- is_pointer_in_current_button = +- (CurrentButton && CurrentButton == +- select_button(UberButton, Event.xmotion.x, Event.xmotion.y)); +- if (CurrentButton && is_pointer_in_current_button != f) +- { +- RedrawButton(b, DRAW_RELIEF, NULL); +- } ++ /* find out which button the cursor is in now. */ ++ b = select_button(UberButton, Event.xmotion.x, Event.xmotion.y); ++ ++ is_pointer_in_current_button = ++ (CurrentButton && CurrentButton == b); ++ if (CurrentButton && is_pointer_in_current_button != f) ++ { ++ redraw_relief = True; ++ } ++ ++ if (b != HoverButton) ++ { ++ if (HoverButton) ++ { ++ button_info *tmp = HoverButton; ++ HoverButton = b; ++ RedrawButton(tmp, DRAW_FORCE, NULL); ++ } ++ if (b->flags & (b_HoverIcon | b_HoverTitle) || ++ UberButton->c->flags & b_HoverColorset) ++ { ++ HoverButton = b; ++ RedrawButton(b, DRAW_FORCE, NULL); ++ redraw_relief = False; ++ } ++ } ++ ++ if (redraw_relief) ++ { ++ RedrawButton(b, DRAW_RELIEF, NULL); ++ } + } + break; + ++ case LeaveNotify: ++ { ++ if (reallyLeaveWindow(Event.xcrossing.x, Event.xcrossing.y, ++ Event.xcrossing.window, NULL)) ++ { ++ if (HoverButton) ++ { ++ b = HoverButton; ++ HoverButton = NULL; ++ RedrawButton(b, DRAW_FORCE, NULL); ++ } ++ if (CurrentButton) ++ { ++ RedrawButton(b, DRAW_RELIEF, NULL); ++ } ++ } ++ break; ++ } + case KeyPress: + XLookupString(&Event.xkey,buffer,10,&keysym,0); + if(keysym!=XK_Return && keysym!=XK_KP_Enter && keysym!=XK_Linefeed) +@@ -1159,8 +1210,11 @@ + case ButtonRelease: + if (CurrentButton == NULL || !is_pointer_in_current_button) + { +- CurrentButton = NULL; +- break; ++ if (CurrentButton) ++ RedrawButton(CurrentButton, DRAW_RELIEF, NULL); ++ ++ CurrentButton = NULL; ++ break; + } + if (Event.xbutton.window == MyWindow) + { +@@ -1502,7 +1556,7 @@ + **/ + void RecursiveLoadData(button_info *b,int *maxx,int *maxy) + { +- int i,j,x=0,y=0; ++ int i, x=0, y=0, ix, iy, tx, ty, hix, hiy, htx, hty; + FlocaleFont *Ffont; + + if (!b) +@@ -1665,9 +1719,14 @@ + b->c->height=y; + } + +- +- i=0; +- j=0; ++ /* $ix & $iy are dimensions of Icon ++ $tx & $ty are dimensions of Title ++ $hix & $hiy are dimensions of HoverIcon ++ $htx & $hty are dimensions of HoverTitle ++ ++ Note that if No HoverIcon is specified, Icon is displayed during hover. ++ Similarly for HoverTitle. */ ++ ix = iy = tx = ty = hix = hiy = htx = hty = 0; + + /* Load the icon */ + if(b->flags&b_Icon && LoadIconFile(b->icon_file,&b->icon, buttonColorset(b))) +@@ -1675,12 +1734,31 @@ + #ifdef DEBUG_LOADDATA + fprintf(stderr,", icon \"%s\"",b->icon_file); + #endif +- i=b->icon->width; +- j=b->icon->height; ++ ix = b->icon->width; ++ iy = b->icon->height; + } + else + b->flags&=~b_Icon; + ++ /* load the hover icon. */ ++ if (b->flags & b_HoverIcon && ++ LoadIconFile(b->hover_icon_file, &b->hovericon, buttonColorset(b))) ++ { ++#ifdef DEBUG_LOADDATA ++ fprintf(stderr,", hover icon \"%s\"", b->hover_icon_file); ++#endif ++ ++ hix = b->hovericon->width; ++ hiy = b->hovericon->height; ++ } ++ else ++ { ++ hix = ix; ++ hiy = iy; ++ b->flags&=~b_HoverIcon; ++ } ++ ++ + if(b->flags&b_Title && (Ffont = buttonFont(b))) + { + #ifdef DEBUG_LOADDATA +@@ -1688,18 +1766,41 @@ + #endif + if(buttonJustify(b)&b_Horizontal) + { +- i+=buttonXPad(b)+FlocaleTextWidth(Ffont,b->title,strlen(b->title)); +- j=max(j,Ffont->height); ++ tx = buttonXPad(b) + FlocaleTextWidth(Ffont, b->title, strlen(b->title)); ++ ty = Ffont->height; ++ } ++ else ++ { ++ tx = FlocaleTextWidth(Ffont,b->title,strlen(b->title)); ++ ty = Ffont->height; ++ } ++ } ++ ++ if (b->flags & b_HoverTitle && (Ffont = buttonFont(b))) ++ { ++#ifdef DEBUG_LOADDATA ++ fprintf(stderr,", title \"%s\"",b->title); ++#endif ++ if (buttonJustify(b) & b_Horizontal) ++ { ++ htx = buttonXPad(b) + FlocaleTextWidth(Ffont, b->hoverTitle, ++ strlen(b->hoverTitle)); ++ hty = Ffont->height; + } + else + { +- i=max(i,FlocaleTextWidth(Ffont,b->title,strlen(b->title))); +- j+=Ffont->height; ++ htx = FlocaleTextWidth(Ffont,b->hoverTitle,strlen(b->hoverTitle)); ++ hty = Ffont->height; + } + } ++ else ++ { ++ htx = tx; ++ hty = ty; ++ } + +- x+=i; +- y+=j; ++ x += max(max(ix, tx), max(hix, htx)); ++ y += max(iy + ty, hiy + hty); + + if(b->flags&b_Size) + { +@@ -2405,21 +2506,6 @@ + } + else + { +- if (Event == NULL && b->flags&b_Icon) +- { +- /* FIXME do that only if we have an icon +- * colorset */ +- DestroyIconWindow(b); +- CreateIconWindow(b); +- if (b->flags&b_Icon) +- { +- if (!(b->flags&b_IconAlpha)) +- { +- ConfigureIconWindow(b, NULL); +- XMapWindow(Dpy,b->IconWin); +- } +- } +- } + RedrawButton(b, DRAW_ALL, NULL); + } + } +@@ -2463,32 +2549,12 @@ + b, True); + } + } +- else if (Event == NULL && b->flags&b_Icon && +- buttonColorset(b) == colorset) +- { +- /* FIXME do that only if we have an icon +- * colorset */ +- DestroyIconWindow(b); +- CreateIconWindow(b); +- if (b->flags&b_Icon) +- { +- if (!(b->flags&b_IconAlpha)) +- { +- ConfigureIconWindow(b, NULL); +- XMapWindow(Dpy,b->IconWin); +- } +- } +- } + } +- + return; + } + + recursive_change_colorset( + UberButton->c, colorset, Event); +- +- +- return; + } + + static void handle_config_info_packet(unsigned long *body) +diff -u fvwm-2.5.10/modules/FvwmButtons/FvwmButtons.h fvwm/modules/FvwmButtons/FvwmButtons.h +--- fvwm-2.5.10/modules/FvwmButtons/FvwmButtons.h 2003-08-07 10:34:27.000000000 +0100 ++++ fvwm/modules/FvwmButtons/FvwmButtons.h 2004-07-10 10:13:25.000000000 +0100 +@@ -74,7 +74,9 @@ + #define b_ActionOnPress \ + 0x02000000 /* By default this only done on Popup */ + #define b_Id 0x04000000 /* Has a user defined id for referencing */ +-#define b_IconAlpha 0x08000000 /* Icon has an alpha chanel */ ++#define b_HoverIcon 0x08000000 /* Contains HoverIcon */ ++#define b_HoverColorset 0x10000000 /* Use alternate colorset for button on hover*/ ++#define b_HoverTitle 0x20000000 /* Use alternate Title text on hover*/ + + /* Flags for b->swallow */ + #define b_Count 0x0003 /* Init counter for swallowing */ +@@ -121,6 +123,7 @@ + char *back_file; /* b_Back && b_IconBack */ + char *fore; /* b_Fore */ + int colorset; /* b_Colorset */ ++ int hoverColorset; /* b_HoverColorset */ + Pixel fc; /* b_Fore */ + Pixel bc,hc,sc; /* b_Back && !b_IconBack */ + FvwmPicture *backicon; /* b_Back && b_IconBack */ +@@ -161,15 +164,18 @@ + byte justify_mask; /* b_Justify */ + container_info *c; /* b_Container */ + char *title; /* b_Title */ ++ char *hoverTitle; /* b_HoverTitle */ + char **action; /* b_Action */ + char *icon_file; /* b_Icon */ ++ char *hover_icon_file; /* b_HoverIcon */ + char *hangon; /* b_Hangon || b_Swallow */ + Pixel fc; /* b_Fore */ + Pixel bc,hc,sc; /* b_Back && !b_IconBack */ + ushort minx,miny; /* b_Size */ + FvwmPicture *icon; /* b_Icon */ + FvwmPicture *backicon; /* b_Back && b_IconBack */ +- Window IconWin; /* b_Icon || b_Swallow */ ++ FvwmPicture *hovericon; /* b_HoverIcon */ ++ Window IconWin; /* b_Swallow */ + Window PanelWin; /* b_Panel */ + Window BackIconWin; /* b_Back && b_IconBack */ + +@@ -233,7 +239,7 @@ + extern Window Root; + extern Window MyWindow; + extern char *MyName; +-extern button_info *UberButton,*CurrentButton; ++extern button_info *UberButton, *CurrentButton, *HoverButton; + extern Bool is_pointer_in_current_button; + + extern char *imagePath; +diff -u fvwm-2.5.10/modules/FvwmButtons/icons.c fvwm/modules/FvwmButtons/icons.c +--- fvwm-2.5.10/modules/FvwmButtons/icons.c 2003-06-29 20:53:24.000000000 +0100 ++++ fvwm/modules/FvwmButtons/icons.c 2004-07-10 10:13:25.000000000 +0100 +@@ -58,193 +58,64 @@ + #include "libs/Colorset.h" + #include "libs/Rectangles.h" + +-/* +- * +- * Creates an Icon Window +- * +- */ +-void CreateIconWindow(button_info *b) +-{ +-#ifndef NO_ICONS +- unsigned long valuemask; /* mask for create windows */ +- XSetWindowAttributes attributes; /* attributes for create windows */ +- Pixel bc,fc; +- int cset; +- FvwmRenderAttributes fra; +- Pixmap temp; +- +- if(!(b->flags&b_Icon)) +- { +- return; +- } +- +- if(b->IconWin != None) +- { +- fprintf(stderr,"%s: BUG: Icon window already created " +- "for 0x%lx!\n", MyName,(unsigned long)b); +- return; +- } +- if(b->icon->width<1 || b->icon->height<1) +- { +- fprintf(stderr,"%s: BUG: Illegal iconwindow " +- "tried created\n",MyName); +- exit(2); +- } +- +- cset = buttonColorset(b); +- if (b->icon->alpha != None || +- (cset >= 0 && Colorset[cset].icon_alpha_percent < 100 && +- !(UberButton->c->flags&b_TransBack))) +- { +- /* in this case we drawn on the button, with a shaped +- * Buttons we do not load the alpha channel */ +- b->flags |= b_IconAlpha; +- return; +- } +- +- cset = buttonColorset(b); +- fra.mask = FRAM_DEST_IS_A_WINDOW; +- if (cset >= 0) +- { +- bc = Colorset[cset].bg; +- fc = Colorset[cset].fg; +- fra.mask |= FRAM_HAVE_ICON_CSET; +- fra.colorset = &Colorset[cset]; +- if (Colorset[cset].icon_alpha_percent < 100) +- { +- fra.added_alpha_percent = 100; +- fra.mask |= FRAM_HAVE_ADDED_ALPHA; +- } +- } +- else +- { +- bc = buttonBack(b); +- fc = buttonFore(b); +- fra.mask = 0; +- } +- +- valuemask = CWColormap | CWBorderPixel | CWBackPixel | +- CWEventMask | CWBackPixmap; +- attributes.colormap = Pcmap; +- attributes.border_pixel = 0; +- attributes.background_pixel = bc; +- attributes.background_pixmap = None; +- attributes.event_mask = ExposureMask; +- +- b->IconWin=XCreateWindow( +- Dpy, MyWindow, 0, 0, b->icon->width, b->icon->height, 0, +- Pdepth, InputOutput, Pvisual, valuemask, &attributes); +- if (attributes.background_pixel != None) +- { +- XSetWindowBackground( +- Dpy, b->IconWin, attributes.background_pixel); +- } +- +- if (FShapesSupported) +- { +- if (b->icon->mask!=None) +- { +- FShapeCombineMask(Dpy, b->IconWin, FShapeBounding, +- 0, 0, b->icon->mask, FShapeSet); +- } +- } +- +- if(b->icon->depth != Pdepth) +- { +- /* bitmap icon */ +- XGCValues gcv; +- +- gcv.background= bc; +- gcv.foreground= fc; +- XChangeGC(Dpy,NormalGC,GCForeground | GCBackground,&gcv); +- +- if (FShapesSupported) +- { +- FShapeCombineMask(Dpy, b->IconWin, FShapeBounding, +- 0, 0, b->icon->picture, FShapeSet); +- } +- } +- +- if (cset >= 0 && Colorset[cset].icon_tint_percent > 0) +- { +- temp = XCreatePixmap( +- Dpy, MyWindow, b->icon->width, b->icon->height, Pdepth); +- PGraphicsRenderPicture( +- Dpy, MyWindow, b->icon, &fra, temp, +- NormalGC, None, None, +- 0, 0, b->icon->width, b->icon->height, +- 0, 0, 0, 0, False); +- XSetWindowBackgroundPixmap(Dpy, b->IconWin, temp); +- XFreePixmap(Dpy,temp); +- } +- else +- { +- /* pixmap icon */ +- XSetWindowBackgroundPixmap(Dpy, b->IconWin, b->icon->picture); +- } +- +- return; +-#endif +-} +- +-void DestroyIconWindow(button_info *b) +-{ +-#ifndef NO_ICONS +- if(!(b->flags&b_Icon) || (b->flags&b_IconAlpha)) +- { +- b->flags &= ~b_IconAlpha; +- return; +- } +- XDestroyWindow(Dpy, b->IconWin); +- b->IconWin = None; +-#endif +-} + + /* + * + * Combines icon shape masks after a resize + * + */ +-Bool GetIconWindowPosition( +- button_info *b, int *r_x, int *r_y, int *r_w, int *r_h) ++Bool GetIconPosition(button_info *b, unsigned long iconFlag, int *r_x, ++ int *r_y, int *r_w, int *r_h) + { + #ifdef NO_ICONS +- return 0; ++ return False; + #else +- int x,y,w,h; ++ int x,y,width,height; + int xoff,yoff; + int framew,xpad,ypad; + FlocaleFont *Ffont; + int BW,BH; ++ FvwmPicture *pic = b->icon; ++ Bool has_title = (b->flags & b_Title ? True : False); + +- if(!b || !(b->flags&b_Icon)) +- return 0; +- +- if(!b->IconWin && !(b->flags&b_IconAlpha)) ++ if (iconFlag & b_HoverIcon) + { +- fprintf(stderr,"%s: DEBUG: Tried to configure erroneous " +- "iconwindow\n", MyName); +- exit(2); ++ /* If no HoverIcon is specified, we use Icon (if there is ++ one). */ ++ if (b->flags & b_HoverIcon) ++ { ++ pic = b->hovericon; ++ } ++ /* If no HoverTitle is specified, we use Title (if there is ++ one). */ ++ if (b->flags & b_HoverTitle) ++ { ++ has_title = True; ++ } + } + + buttonInfo(b,&x,&y,&xpad,&ypad,&framew); + framew=abs(framew); + Ffont = buttonFont(b); + +- w = b->icon->width; +- h = b->icon->height; ++ width = pic->width; ++ height = pic->height; + BW = buttonWidth(b); + BH = buttonHeight(b); + +- w=min(w,BW-2*(xpad+framew)); ++ width=min(width,BW-2*(xpad+framew)); + +- if(b->flags&b_Title && Ffont && !(buttonJustify(b)&b_Horizontal)) +- h = min(h,BH-2*(ypad+framew)-Ffont->ascent-Ffont->descent); ++ if (has_title == True && Ffont && !(buttonJustify(b)&b_Horizontal)) ++ { ++ height = min(height,BH-2*(ypad+framew)-Ffont->ascent-Ffont->descent); ++ } + else +- h = min(h,BH-2*(ypad+framew)); ++ { ++ height = min(height,BH-2*(ypad+framew)); ++ } + + if (b->flags & b_Right) +- xoff = BW-framew-xpad-w; ++ xoff = BW-framew-xpad-width; + else if (b->flags & b_Left) + xoff = framew+xpad; + else +@@ -252,15 +123,15 @@ + if(buttonJustify(b)&b_Horizontal) + xoff=0; + else +- xoff=(BW-w)>>1; ++ xoff=(BW-width)>>1; + if(xoff < framew+xpad) + xoff = framew+xpad; + } + +- if(b->flags&b_Title && Ffont && !(buttonJustify(b)&b_Horizontal)) +- yoff=(BH-(h+Ffont->height))>>1; ++ if (has_title == True && Ffont && !(buttonJustify(b)&b_Horizontal)) ++ yoff=(BH-(height+Ffont->height))>>1; + else +- yoff=(BH-h)>>1; ++ yoff=(BH-height)>>1; + + if(yoff < framew+ypad) + yoff = framew+ypad; +@@ -270,10 +141,10 @@ + + *r_x = x; + *r_y = y; +- *r_w = w; +- *r_h = h; ++ *r_w = width; ++ *r_h = height; + +- return 1; ++ return True; + #endif + } + +@@ -284,20 +155,24 @@ + int cset; + XRectangle clip; + FvwmRenderAttributes fra; ++ unsigned long iconFlag = b_Icon; ++ unsigned long flag = (b == HoverButton ? b_HoverIcon : b_Icon); + +- if (!GetIconWindowPosition(b,&x,&y,&w,&h)) ++ FvwmPicture *pic = b->icon; ++ if (b == HoverButton && b->flags & b_HoverIcon) + { +- return; ++ iconFlag = b_HoverIcon; ++ pic = b->hovericon; + } + +- if(w < 1 || h < 1) ++ if (!GetIconPosition(b, flag, &x,&y,&w,&h)) + { +- return; /* No need drawing to this */ ++ return; + } + +- if (!(b->flags & b_IconAlpha)) ++ if(w < 1 || h < 1) + { +- return; ++ return; /* No need drawing to this */ + } + + clip.x = x; +@@ -331,50 +206,11 @@ + fra.mask |= FRAM_HAVE_ICON_CSET; + fra.colorset = &Colorset[cset]; + } ++ + PGraphicsRenderPicture( +- Dpy, MyWindow, b->icon, &fra, MyWindow, ++ Dpy, MyWindow, pic, &fra, MyWindow, + NormalGC, None, None, + clip.x - x, clip.y - y, clip.width, clip.height, + clip.x, clip.y, clip.width, clip.height, False); + #endif + } +- +-void ConfigureIconWindow(button_info *b, XEvent *pev) +-{ +-#ifndef NO_ICONS +- int x,y,w,h; +- +- if (!b->IconWin) +- { +- return; +- } +- if (!GetIconWindowPosition(b,&x,&y,&w,&h)) +- { +- return; +- } +- if (!b->IconWin) +- { +- return; +- } +- +- if(w < 1 || h < 1) +- { +- if (b->IconWin) +- XMoveResizeWindow(Dpy, b->IconWin, 2000,2000,1,1); +- return; /* No need drawing to this */ +- } +- +- if (!pev && b->IconWin) +- { +- XMoveResizeWindow(Dpy, b->IconWin, x,y,w,h); +- } +- +- return; +- +- if (!(b->flags & b_IconAlpha)) +- { +- return; +- } +- +-#endif +-} +diff -u fvwm-2.5.10/modules/FvwmButtons/icons.h fvwm/modules/FvwmButtons/icons.h +--- fvwm-2.5.10/modules/FvwmButtons/icons.h 2003-06-29 20:53:24.000000000 +0100 ++++ fvwm/modules/FvwmButtons/icons.h 2004-07-10 10:13:25.000000000 +0100 +@@ -13,7 +13,4 @@ + * + */ + +-void CreateIconWindow(button_info*); +-void DestroyIconWindow(button_info *b); + void DrawForegroundIcon(button_info *b, XEvent *pev); +-void ConfigureIconWindow(button_info*, XEvent *pev); +Only in fvwm-2.5.10/modules/FvwmButtons: Makefile.in +diff -u fvwm-2.5.10/modules/FvwmButtons/parse.c fvwm/modules/FvwmButtons/parse.c +--- fvwm-2.5.10/modules/FvwmButtons/parse.c 2003-08-25 07:47:08.000000000 +0100 ++++ fvwm/modules/FvwmButtons/parse.c 2004-07-10 10:13:25.000000000 +0100 +@@ -751,8 +751,7 @@ + + default: + t=seekright(&s); +- fprintf(stderr,"%s: Illegal container option \"%s\"\n",MyName, +- (t)?t:""); ++ fprintf(stderr,"%s: Illegal container option \"%s\"\n",MyName, (t)?t:""); + if (t) + free(t); + } +@@ -803,6 +802,8 @@ + "colorset", + "action", + "id", ++ "hovericon", ++ "hovertitle", + NULL + }; + s = trimleft(s); +@@ -937,7 +938,6 @@ + if (b->icon_file) + free(b->icon_file); + b->icon_file=t; +- b->IconWin=None; + b->flags|=b_Icon; + } + } +@@ -1251,6 +1251,69 @@ + } + break; + ++ /* ---------------------------- HoverIcon ------------------------- */ ++ case 21: /* HoverIcon */ ++ t=seekright(&s); ++ if(t && *t && (t[0] != '-' || t[1] != 0)) ++ { ++ if (b->flags & b_Swallow) ++ { ++ fprintf(stderr,"%s: a button can not have a " ++ "hover icon and a swallowed window at " ++ "the same time. Ignoring hover icon.", ++ MyName); ++ } ++ else ++ { ++ if (b->hover_icon_file) ++ free(b->hover_icon_file); ++ b->hover_icon_file = t; ++ b->flags |= b_HoverIcon; ++ } ++ } ++ else ++ { ++ fprintf(stderr,"%s: Missing hover icon argument\n", ++ MyName); ++ if(t) ++ { ++ free(t); ++ } ++ } ++ break; ++ ++ /* ------------------------- HoverTitle ------------------------- */ ++ case 22: /* HoverTitle */ ++ s = trimleft(s); ++ if (*s=='(') ++ { ++ fprintf(stderr,"%s: justification not allowed for " ++ "HoverTitle.\n", MyName); ++ } ++ t = seekright(&s); ++ if(t && *t && (t[0] != '-' || t[1] != 0)) ++ { ++ if (b->hoverTitle) ++ { ++ free(b->hoverTitle); ++ } ++ b->hoverTitle = t; ++#ifdef DEBUG_PARSER ++ fprintf(stderr,"PARSE: HoverTitle \"%s\"\n", b->hoverTitle); ++#endif ++ b->flags |= b_HoverTitle; ++ } ++ else ++ { ++ fprintf(stderr,"%s: Missing HoverTitle argument\n",MyName); ++ if (t) ++ { ++ free(t); ++ } ++ } ++ break; ++ ++ /* ------------------------- ------------------------- */ + default: + t=seekright(&s); + fprintf(stderr,"%s: Illegal button option \"%s\"\n",MyName, +@@ -1292,7 +1355,6 @@ + ((b->icon_file)[0]!='-'||(b->icon_file)[1]!=0)) + { + b->flags|=b_Icon; +- b->IconWin=None; + } + else + if(b->icon_file)free(b->icon_file); +@@ -1370,6 +1432,7 @@ + "pixmap", + "boxsize", + "colorset", ++ "hovercolorset", + NULL + }; + int i,j,k; +@@ -1468,6 +1531,20 @@ + ub->c->flags &= ~b_Colorset; + } + break; ++ case 13: /* HoverColorset */ ++ i = sscanf(s, "%d", &j); ++ if (i > 0) ++ { ++ ub->c->hoverColorset = j; ++ ub->c->flags |= b_HoverColorset; ++ AllocColorset(j); ++ } ++ else ++ { ++ ub->c->flags &= ~b_HoverColorset; ++ } ++ break; ++ + default: + s = trimleft(s); + ParseButton(ubb,s); diff --git a/x11-wm/fvwm/fvwm-2.5.10-r6.ebuild b/x11-wm/fvwm/fvwm-2.5.10-r6.ebuild new file mode 100644 index 000000000000..1343a1d26bd2 --- /dev/null +++ b/x11-wm/fvwm/fvwm-2.5.10-r6.ebuild @@ -0,0 +1,319 @@ +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-wm/fvwm/fvwm-2.5.10-r6.ebuild,v 1.1 2004/07/10 11:11:17 taviso Exp $ + +inherit eutils flag-o-matic + +IUSE="bidi debug gnome gtk gtk2 imlib ncurses nls nosm noxpm perl png readline rplay stroke tcltk truetype xinerama" + +DESCRIPTION="An extremely powerful ICCCM-compliant multiple virtual desktop window manager" +SRC_URI="ftp://ftp.fvwm.org/pub/fvwm/version-2/${P}.tar.bz2 + perl? ( http://users.tpg.com.au/users/scottie7/FvwmTabs-v3.1.tar.gz )" +HOMEPAGE="http://www.fvwm.org/" + +SLOT="0" +KEYWORDS="~x86 ~alpha ~sparc ~ppc ~amd64" +LICENSE="GPL-2 FVWM" + +RDEPEND="readline? ( >=sys-libs/readline-4.1 + ncurses? ( >=sys-libs/ncurses-5.3-r1 ) + !ncurses? ( >=sys-libs/libtermcap-compat-1.2.3 ) ) + gtk? ( =x11-libs/gtk+-1.2* + imlib? ( >=media-libs/gdk-pixbuf-0.21.0 + >=media-libs/imlib-1.9.14-r1 ) + gnome? ( >=gnome-base/gnome-libs-1.4.1.2-r1 ) ) + rplay? ( >=media-sound/rplay-3.3.2 ) + bidi? ( >=dev-libs/fribidi-0.10.4 ) + png? ( >=media-libs/libpng-1.0.12-r2 ) + stroke? ( >=dev-libs/libstroke-0.4 ) + perl? ( tcltk? ( >=dev-lang/tk-8.3.4 + >=dev-perl/perl-tk-800.024-r2 + >=dev-perl/X11-Protocol-0.52 ) ) + truetype? ( virtual/xft >=media-libs/fontconfig-2.1-r1 ) + >=dev-lang/perl-5.6.1-r10 + >=sys-libs/zlib-1.1.4-r1 + sys-apps/debianutils + virtual/x11" +# XXX: gtk2 perl bindings require dev-perl/gtk2-perl, worth a dependency? +# XXX: gtk perl bindings require dev-perl/gtk-perl, worth a dependency? +# XXX: netpbm is used by FvwmScript-ScreenDump, worth a dependency? +DEPEND="${RDEPEND} dev-util/pkgconfig" + +S=${WORKDIR}/${P} +SFT=${WORKDIR}/FvwmTabs-v3.1 + +src_unpack() { + unpack ${A} + + # this patch enables fast translucent menus in fvwm..yummy! this is a + # minor tweak of a patch posted to fvwm-user mailing list by Olivier + # Chapuis in <20030827135125.GA6370@snoopy.folie>. + cd ${S}; epatch ${FILESDIR}/fvwm-2.5.9-translucent-menus.diff.gz + + # according to a post to fvwm-workers mailing list, Mikhael Goikhman + # planned on disabling these debug statements before the release, but + # never got around to it. + cd ${S}; epatch ${FILESDIR}/disable-debug-statements.diff + + if use perl; then + # I'll supply a default icon for FvwmTabs, this removes the need for + # installing an iconset, this one comes from the fvwm_icons package. + cd ${SFT} + ebegin " Setting default icon for FvwmTabs" + sed -i 's#happyMini.xpm#/usr/share/fvwm/mini-happy.xpm#g' \ + FvwmTabs FvwmTabs.1 fvwmtabrc + eend $? + fi + + # this patch adds an 'ShowOnlyIcons Never' option to FvwmIconMan. + # XXX: ShowNoIcons ever option added to official FvwmIconMan on 24 Jun 2004 + # XXX: Remove this patch, and add ewarn about new Syntax. + cd ${S}; epatch ${FILESDIR}/fvwm-iconman.diff + + # fix some issues reported since the 2.5.10 release. + cd ${S}; epatch ${FILESDIR}/fvwm-2.5.10-post-release.diff + + # build fails on alpha with certain options without this. + use alpha && append-flags -fPIC + + # just in case anyone on mips want to test. + use mips && epatch ${FILESDIR}/fvwm-2.5.10-mips-compat.diff + + # fixing #51287, the fvwm-menu-xlock script is not compatible + # with the xlockmore implementation in portage. + epatch ${FILESDIR}/fvwm-menu-xlock-xlockmore-compat.diff + + # fix hang when restarting + cd ${S}; epatch ${FILESDIR}/fvwm-2.5.10-FvwmCommand.diff + + # some useful improvements to Test () Syntax. + cd ${S}; epatch ${FILESDIR}/fvwm-2.5.10-Test-update.diff + + # two updates from cvs + cd ${S}; epatch ${FILESDIR}/centerplacement-2.5.10.diff + cd ${S}; epatch ${FILESDIR}/iconfile-2.5.10.diff + + # fvwmbuttons hover patch + cd ${S}; epatch ${FILESDIR}/fvwm-2.5.10-fvwmbuttonshover.diff +} + +src_compile() { + local myconf="--libexecdir=/usr/lib --with-imagepath=/usr/include/X11/bitmaps:/usr/include/X11/pixmaps:/usr/share/icons/fvwm --enable-package-subdirs" + + # ImagePath should include /usr/share/icons/fvwm (x11-themes/fvwm_icons) + # + # Another iconset for fvwm, wm-icons, includes configurations and user + # configuration utilities to make them easy to use with fvwm, no need + # to put them in the default ImagePath. + + # use readline in FvwmConsole. + if ! use readline; then + myconf="${myconf} --without-readline-library" + else + myconf="${myconf} --with-readline-library" + + # choose ncurses or termcap. + if use ncurses; then + myconf="${myconf} --without-termcap-library" + else + myconf="${myconf} --without-ncurses-library" + fi + fi + + # since fvwm-2.5.8 GTK support can be diabled with --disable-gtk, previously + # we had to hide the includes/libs during configure. this is still the case + # for GDK image suport _with_ gtk, unfortunately. + # FvwmGtk can be built as a gnome application, or a Gtk+ application. + if ! use gtk; then + myconf="${myconf} --disable-gtk --without-gnome" + else + if ! use imlib; then + einfo "ATTN: You can safely ignore any imlib related configure errors." + myconf="${myconf} --with-imlib-prefix=${T}" + fi + if ! use gnome; then + myconf="${myconf} --without-gnome" + else + myconf="${myconf} --with-gnome" + fi + fi + + # rplay is a cool, but little used way of playing sounds over a network + # Fvwm support is pretty good. + if ! use rplay; then + myconf="${myconf} --without-rplay-library" + fi + + # Install perl bindings. + if use perl; then + myconf="${myconf} --enable-perllib" + else + myconf="${myconf} --disable-perllib" + fi + + # xinerama support for those who have multi-headed machines. + if use xinerama; then + myconf="${myconf} --enable-xinerama" + else + myconf="${myconf} --disable-xinerama" + fi + + # bidirectional writing support, eg hebrew + if use bidi; then + myconf="${myconf} --enable-bidi" + else + myconf="${myconf} --disable-bidi" + fi + + # png image support (very nice in fvwm) + if ! use png; then + myconf="${myconf} --without-png-library" + fi + + # native language support + if use nls; then + myconf="${myconf} --enable-nls --enable-iconv" + else + myconf="${myconf} --disable-nls --disable-iconv" + fi + + # support for mouse gestures using libstroke (very very cool) + if ! use stroke; then + myconf="${myconf} --without-stroke-library" + fi + + # more verbosity for module developers/hackers/etc. + if use debug; then + myconf="${myconf} --enable-debug-msgs --enable-command-log" + append-flags -DCR_DETECT_MOTION_METHOD_DEBUG + fi + + # Xft Anti Aliased text support + if use truetype; then + myconf="${myconf} --enable-xft" + else + myconf="${myconf} --disable-xft" + fi + + # disable xsm protocol (session management) support? + if use nosm; then + myconf="${myconf} --disable-sm" + else + myconf="${myconf} --enable-sm" + fi + + # disable xpm support? + if use noxpm; then + myconf="${myconf} --without-xpm-library" + fi + + # set the local maintainer for fvwm-bug. + export FVWM_BUGADDR="taviso@gentoo.org" + + econf ${myconf} || die + emake || die +} + +src_install() { + + make DESTDIR=${D} install || die + + if use perl; then + + local toolkits="gtk2 gtk tcltk" + + if use tcltk; then + # Install the very cool FvwmTabs module + # http://users.tpg.com.au/users/scottie7/FvwmTabs + einfo "Installing FvwmTabs module..." + + exeinto /usr/lib/fvwm/${PV}/ + doexe ${SFT}/FvwmTabs + + dodoc ${SFT}/fvwmtabrc ${SFT}/tab.zsh + doman ${SFT}FvwmTabs.1 + dohtml ${SFT}/FvwmTabs.man.html + + newdoc ${SFT}/README README.fvwmtabs + + # install default drag and drop icon. + insinto /usr/share/fvwm + newins ${FILESDIR}/mini.happy.xpm mini-happy.xpm + else + # Remove the Tk bindings (requires perl-tk) + rm -f ${D}/usr/share/fvwm/perllib/FVWM/Module/Tk.pm + toolkits=${toolkits/tcltk/} + fi + if ! use gtk; then + # Remove gtk bindings (requires gtk-perl/gtk2-perl) + rm -f ${D}/usr/share/fvwm/perllib/FVWM/Module/Gtk.pm \ + ${D}/usr/share/fvwm/perllib/FVWM/Module/Gtk2.pm + toolkits=${toolkits/gtk2/} + toolkits=${toolkits/gtk/} + else + if ! use gtk2; then + # Just remove the gtk2 bindings (requires gtk2-perl) + rm -f ${D}/usr/share/fvwm/perllib/FVWM/Module/Gtk2.pm + toolkits=${toolkits/gtk2/} + fi + fi + toolkits=${toolkits// /} + if ! test "${toolkits}"; then + # No perl toolkit bindings wanted, remove the unneeded files + # and empty directories. + rm -f ${D}/usr/share/fvwm/perllib/FVWM/Module/Toolkit.pm + find ${D}/usr/share/fvwm/perllib -depth -type d -exec rmdir {} \; 2>/dev/null + fi + else + # Remove useless script if perllib isnt required. + rm -rf ${D}/usr/bin/fvwm-perllib ${D}/usr/share/man/man1/fvwm-perllib.1 + fi + + # neat utility for testing fvwm behaviour on applications setting various + # hints, creates a simple black window with configurable hints set. + if use debug; then + dobin ${S}/tests/hints/hints_test + newdoc ${S}/tests/hints/README README.hints + fi + + # fvwm-convert-2.6 is just a stub, contains no code - remove it for now. + # fvwm-convert-2.2 has a man page, but the script is no longer distributed. + rm -f ${D}/usr/bin/fvwm-convert-2.6 ${D}/usr/share/man/man1/fvwm-convert-2.6.1 + rm -f ${D}/usr/share/man/man1/fvwm-convert-2.2.1 + + # ive included `exec` to save a few bytes of memory. + echo "#!/bin/bash" > fvwm2 + echo "exec /usr/bin/fvwm2" >> fvwm2 + + exeinto /etc/X11/Sessions + doexe fvwm2 + + dodoc AUTHORS ChangeLog COPYING README NEWS docs/ANNOUNCE docs/BUGS \ + docs/COMMANDS docs/DEVELOPERS docs/FAQ docs/error_codes docs/TODO \ + docs/fvwm.lsm + + dodoc utils/fvwm_make_directory_menu.sh utils/fvwm_make_browse_menu.sh \ + utils/quantize_pixmaps utils/xselection.c + + dodoc ${FILESDIR}/README.transluceny.gz + + # make sure FvwmGtk man page is installed + # XXX: Fixed in cvs + use gtk && doman ${S}/modules/FvwmGtk/FvwmGtk.1 + + # fix a couple of symlinks. + prepallman +} + +pkg_postinst() { + if use perl; then + if use tcltk; then + einfo "By setting the perl and tcltk USE flags, you have elected to" + einfo "install the FvwmTabs module, a configurable tabbing system" + einfo "for FVWM. You can read more about FvwmTabs here:" + einfo + einfo " http://users.tpg.com.au/users/scottie7/fvwmtabs.html" + einfo + fi + fi +} |