mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-30 02:12:30 +01:00
updated code to use new bags
arbitrary window levels
This commit is contained in:
@@ -148,7 +148,7 @@ DIST_COMMON = README Makefile.am Makefile.in
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
TAR = gtar
|
||||
GZIP_ENV = --best
|
||||
SOURCES = $(WPrefs_SOURCES)
|
||||
OBJECTS = $(WPrefs_OBJECTS)
|
||||
@@ -157,7 +157,7 @@ all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .lo .o .s
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WPrefs.app/Makefile
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu WPrefs.app/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
@@ -347,7 +347,7 @@ distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
cp -pr $$/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|
||||
@@ -59,6 +59,11 @@ extern Panel *InitAppearance(WMScreen *scr, WMWindow *win);
|
||||
|
||||
|
||||
|
||||
|
||||
#define ICON_TITLE_FONT "-adobe-helvetica-bold-r-*-*-10-*"
|
||||
#define ICON_TITLE_VFONT "-adobe-helvetica-bold-r-*-*-10-[]-*"
|
||||
|
||||
|
||||
#define MAX_SECTIONS 16
|
||||
|
||||
|
||||
@@ -441,10 +446,90 @@ LocateImage(char *name)
|
||||
}
|
||||
|
||||
|
||||
|
||||
static WMPixmap*
|
||||
makeTitledIcon(WMScreen *scr, WMPixmap *icon, char *title1, char *title2)
|
||||
{
|
||||
return WMRetainPixmap(icon);
|
||||
|
||||
#if 0
|
||||
static GC gc = NULL;
|
||||
static XFontStruct *hfont = NULL;
|
||||
static XFontStruct *vfont = NULL;
|
||||
WMPixmap *tmp;
|
||||
Pixmap pix, mask;
|
||||
Display *dpy = WMScreenDisplay(scr);
|
||||
WMColor *black = WMBlackColor(scr);
|
||||
GC fgc;
|
||||
WMSize size = WMGetPixmapSize(icon);
|
||||
|
||||
|
||||
tmp = WMCreatePixmap(scr, 60, 60, WMScreenDepth(scr), True);
|
||||
|
||||
pix = WMGetPixmapXID(tmp);
|
||||
mask = WMGetPixmapMaskXID(tmp);
|
||||
|
||||
if (gc == NULL) {
|
||||
gc = XCreateGC(dpy, mask, 0, NULL);
|
||||
|
||||
hfont = XLoadQueryFont(dpy, ICON_TITLE_FONT);
|
||||
vfont = XLoadQueryFont(dpy, ICON_TITLE_VFONT);
|
||||
}
|
||||
|
||||
if (hfont == NULL) {
|
||||
return WMRetainPixmap(icon);
|
||||
}
|
||||
|
||||
XSetForeground(dpy, gc, 0);
|
||||
XFillRectangle(dpy, mask, gc, 0, 0, 60, 60);
|
||||
|
||||
fgc = WMColorGC(black);
|
||||
|
||||
XSetForeground(dpy, gc, 1);
|
||||
|
||||
XCopyArea(dpy, WMGetPixmapXID(icon), pix, fgc, 0, 0,
|
||||
size.width, size.height, 12, 12);
|
||||
|
||||
if (WMGetPixmapMaskXID(icon) != None)
|
||||
XCopyPlane(dpy, WMGetPixmapMaskXID(icon), mask, gc, 0, 0,
|
||||
size.width, size.height, 12, 12, 1);
|
||||
else
|
||||
XFillRectangle(dpy, mask, gc, 12, 12, 48, 48);
|
||||
|
||||
|
||||
if (title1) {
|
||||
XSetFont(dpy, fgc, vfont->fid);
|
||||
XSetFont(dpy, gc, vfont->fid);
|
||||
|
||||
XDrawString(dpy, pix, fgc, 0, vfont->ascent,
|
||||
title1, strlen(title1));
|
||||
|
||||
XDrawString(dpy, mask, gc, 0, vfont->ascent,
|
||||
title1, strlen(title1));
|
||||
}
|
||||
|
||||
if (title2) {
|
||||
XSetFont(dpy, fgc, hfont->fid);
|
||||
XSetFont(dpy, gc, hfont->fid);
|
||||
|
||||
XDrawString(dpy, pix, fgc, (title1 ? 12 : 0), hfont->ascent,
|
||||
title2, strlen(title2));
|
||||
|
||||
XDrawString(dpy, mask, gc, (title1 ? 12 : 0), hfont->ascent,
|
||||
title2, strlen(title2));
|
||||
}
|
||||
|
||||
return tmp;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SetButtonAlphaImage(WMScreen *scr, WMButton *bPtr, char *file)
|
||||
SetButtonAlphaImage(WMScreen *scr, WMButton *bPtr, char *file,
|
||||
char *title1, char *title2)
|
||||
{
|
||||
WMPixmap *icon;
|
||||
WMPixmap *icon2;
|
||||
RColor color;
|
||||
char *iconPath;
|
||||
|
||||
@@ -461,11 +546,19 @@ SetButtonAlphaImage(WMScreen *scr, WMButton *bPtr, char *file)
|
||||
} else {
|
||||
icon = NULL;
|
||||
}
|
||||
|
||||
if (icon) {
|
||||
icon2 = makeTitledIcon(scr, icon, title1, title2);
|
||||
if (icon)
|
||||
WMReleasePixmap(icon);
|
||||
} else {
|
||||
icon2 = NULL;
|
||||
}
|
||||
|
||||
WMSetButtonImage(bPtr, icon2);
|
||||
|
||||
WMSetButtonImage(bPtr, icon);
|
||||
|
||||
if (icon)
|
||||
WMReleasePixmap(icon);
|
||||
if (icon2)
|
||||
WMReleasePixmap(icon2);
|
||||
|
||||
color.red = 0xff;
|
||||
color.green = 0xff;
|
||||
@@ -508,8 +601,19 @@ AddSection(Panel *panel, char *iconFile)
|
||||
WMSetBalloonTextForView(((PanelRec*)panel)->description,
|
||||
WMWidgetView(bPtr));
|
||||
|
||||
SetButtonAlphaImage(WMWidgetScreen(bPtr), bPtr, iconFile);
|
||||
|
||||
{
|
||||
char *t1, *t2;
|
||||
|
||||
t1 = wstrdup(((PanelRec*)panel)->sectionName);
|
||||
t2 = strchr(t1, ' ');
|
||||
if (t2) {
|
||||
*t2 = 0;
|
||||
t2++;
|
||||
}
|
||||
SetButtonAlphaImage(WMWidgetScreen(bPtr), bPtr, iconFile,
|
||||
t1, t2);
|
||||
free(t1);
|
||||
}
|
||||
WMMapWidget(bPtr);
|
||||
|
||||
WPrefs.sectionB[WPrefs.sectionCount] = bPtr;
|
||||
|
||||
@@ -78,8 +78,6 @@ void AddSection(Panel *panel, char *iconFile);
|
||||
|
||||
char *LocateImage(char *name);
|
||||
|
||||
void SetButtonAlphaImage(WMScreen *scr, WMButton *bPtr, char *file);
|
||||
|
||||
WMWindow *GetWindow(Panel *panel);
|
||||
|
||||
/* manipulate the dictionary for the WindowMaker domain */
|
||||
|
||||
@@ -118,15 +118,15 @@ DIST_COMMON = README Makefile.am Makefile.in
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
TAR = gtar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .mo .po
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WPrefs.app/po/Makefile
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu WPrefs.app/po/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
@@ -139,10 +139,15 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
subdir = WPrefs.app/po
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
here=`cd $(top_builddir) && pwd`; \
|
||||
top_distdir=`cd $(top_distdir) && pwd`; \
|
||||
distdir=`cd $(distdir) && pwd`; \
|
||||
cd $(top_srcdir) \
|
||||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu WPrefs.app/po/Makefile
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
cp -pr $$/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|
||||
@@ -108,14 +108,14 @@ DIST_COMMON = README Makefile.am Makefile.in
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
TAR = gtar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WPrefs.app/tiff/Makefile
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu WPrefs.app/tiff/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
@@ -147,10 +147,15 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
subdir = WPrefs.app/tiff
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
here=`cd $(top_builddir) && pwd`; \
|
||||
top_distdir=`cd $(top_distdir) && pwd`; \
|
||||
distdir=`cd $(distdir) && pwd`; \
|
||||
cd $(top_srcdir) \
|
||||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu WPrefs.app/tiff/Makefile
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
cp -pr $$/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|
||||
@@ -108,14 +108,14 @@ DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
TAR = gtar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WPrefs.app/xpm/Makefile
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu WPrefs.app/xpm/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
@@ -147,10 +147,15 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
subdir = WPrefs.app/xpm
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
here=`cd $(top_builddir) && pwd`; \
|
||||
top_distdir=`cd $(top_distdir) && pwd`; \
|
||||
distdir=`cd $(distdir) && pwd`; \
|
||||
cd $(top_srcdir) \
|
||||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu WPrefs.app/xpm/Makefile
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
cp -pr $$/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|
||||
Reference in New Issue
Block a user