mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-18 20:10:29 +01:00
Fix some bugs, DisableMiniwindows, _KWM_WIN_ICON_GEOMETRY..
This commit is contained in:
@@ -15,7 +15,9 @@ Changes since version 0.51.2:
|
||||
- show kbd mode for modelock (id@windowmaker.org)
|
||||
- enhanced positioning of transient windows
|
||||
- added dynamically loadable texture renderer code (from ?)
|
||||
|
||||
- added DisableMiniwindows option
|
||||
- kde: miniaturize animation will match the taskbar icon (KWM_WIN_ICON_GEOMETRY)
|
||||
- miniwindows show the title of the window if there is none set for it
|
||||
|
||||
Changes since version 0.51.1:
|
||||
.............................
|
||||
|
||||
2
INSTALL
2
INSTALL
@@ -273,7 +273,7 @@ PLATFORM SPECIFIC NOTES:
|
||||
* make sure you have /lib/cpp pointing to the cpp program
|
||||
|
||||
If you have any doubts in doing any of the stuff above, please
|
||||
don't exitate to contact the RedHat user support. They will
|
||||
don't hesitate to contact the RedHat user support. They will
|
||||
kindly answer to all your questions regarding their system.
|
||||
They also know much more about their own system than us
|
||||
(we don't use RedHat).
|
||||
|
||||
11
Makefile.in
11
Makefile.in
@@ -104,14 +104,14 @@ mkinstalldirs src/config.h.in src/stamp-h.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 Makefile
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
@@ -278,6 +278,11 @@ distdir: $(DISTFILES)
|
||||
-rm -rf $(distdir)
|
||||
mkdir $(distdir)
|
||||
-chmod 777 $(distdir)
|
||||
here=`cd $(top_builddir) && pwd`; \
|
||||
top_distdir=`cd $(distdir) && pwd`; \
|
||||
distdir=`cd $(distdir) && pwd`; \
|
||||
cd $(top_srcdir) \
|
||||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
|
||||
26
NEWS
26
NEWS
@@ -4,6 +4,14 @@ NEWS for veteran Window Maker users
|
||||
|
||||
--- 0.51.2
|
||||
|
||||
|
||||
Appearance Editing in WPrefs
|
||||
----------------------------
|
||||
|
||||
Added Appearance/Texture editing capability in WPrefs. Workspace background
|
||||
selection is not yet finished.
|
||||
|
||||
|
||||
New Themes
|
||||
----------
|
||||
|
||||
@@ -53,6 +61,24 @@ or $(sysconfdir)/WindowMaker
|
||||
|
||||
Window Maker has become a GNU program (part of the GNU Project).
|
||||
|
||||
Title text drop shadow
|
||||
----------------------
|
||||
|
||||
drop shadow option added for titlebar text. The is a compile time
|
||||
option which needs to be defined in src/wconfig.h after you run
|
||||
configure and before you run make.
|
||||
|
||||
New options and syntax for your WindowMaker domain file are:
|
||||
|
||||
Shadow = yes/no;
|
||||
FShadowColor = <color>;
|
||||
PShadowColor = <color>;
|
||||
UShadowColor = <color>;
|
||||
MShadowColor = <color>;
|
||||
|
||||
The shadow option is dynamic (no need for a restart).
|
||||
MShadowColor is for the menu title text.
|
||||
|
||||
libPropList
|
||||
-----------
|
||||
|
||||
|
||||
@@ -251,6 +251,8 @@ void WMEnqueueCoalesceNotification(WMNotificationQueue *queue,
|
||||
|
||||
WMUserDefaults *WMGetStandardUserDefaults(void);
|
||||
|
||||
void WMSynchronizeUserDefaults(WMUserDefaults *database);
|
||||
|
||||
proplist_t WMGetUDObjectForKey(WMUserDefaults *database, char *defaultName);
|
||||
|
||||
void WMSetUDObjectForKey(WMUserDefaults *database, proplist_t object,
|
||||
|
||||
@@ -89,6 +89,15 @@ saveDefaultsChanges(void)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
WMSynchronizeUserDefaults(WMUserDefaults *database)
|
||||
{
|
||||
/* TODO: check what it should really do */
|
||||
PLSave(database->appDomain, YES);
|
||||
}
|
||||
|
||||
|
||||
WMUserDefaults*
|
||||
WMGetStandardUserDefaults(void)
|
||||
{
|
||||
|
||||
@@ -95,6 +95,9 @@ WMCreateAlertPanel(WMScreen *scrPtr, WMWindow *owner,
|
||||
panel->win = WMCreateWindowWithStyle(scrPtr, "alertPanel",
|
||||
WMTitledWindowMask);
|
||||
|
||||
WMSetWindowUPosition(panel->win,
|
||||
(scrPtr->rootView->size.width - WMWidgetWidth(panel->win))/2,
|
||||
(scrPtr->rootView->size.height - WMWidgetHeight(panel->win))/2);
|
||||
WMSetWindowTitle(panel->win, "");
|
||||
|
||||
if (scrPtr->applicationIcon) {
|
||||
@@ -106,7 +109,7 @@ WMCreateAlertPanel(WMScreen *scrPtr, WMWindow *owner,
|
||||
WMSetLabelImage(panel->iLbl, scrPtr->applicationIcon);
|
||||
WMSetLabelImagePosition(panel->iLbl, WIPImageOnly);
|
||||
}
|
||||
|
||||
|
||||
if (title) {
|
||||
WMFont *largeFont;
|
||||
|
||||
|
||||
@@ -25,6 +25,13 @@
|
||||
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -79,6 +86,7 @@ typedef struct {
|
||||
|
||||
char selectedFor;
|
||||
unsigned current:1;
|
||||
unsigned ispixmap:1;
|
||||
} TextureListItem;
|
||||
|
||||
|
||||
@@ -199,13 +207,13 @@ static void
|
||||
dumpRImage(char *path, RImage *image)
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
|
||||
f = fopen(path, "w");
|
||||
if (!f) {
|
||||
wsyserror(path);
|
||||
return;
|
||||
}
|
||||
fprintf(f, "%02x%02x%1x", image->width, image->height,
|
||||
fprintf(f, "%02x%02x%1x", image->width, image->height,
|
||||
image->data[3]!=NULL ? 4 : 3);
|
||||
|
||||
fwrite(image->data[0], 1, image->width * image->height, f);
|
||||
@@ -221,6 +229,22 @@ dumpRImage(char *path, RImage *image)
|
||||
|
||||
|
||||
|
||||
static int
|
||||
isPixmap(proplist_t prop)
|
||||
{
|
||||
proplist_t p;
|
||||
char *s;
|
||||
|
||||
p = PLGetArrayElement(prop, 0);
|
||||
s = PLGetString(p);
|
||||
if (strcasecmp(&s[1], "pixmap")==0)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static Pixmap
|
||||
renderTexture(WMScreen *scr, proplist_t texture, int width, int height,
|
||||
char *path, int border)
|
||||
@@ -255,6 +279,7 @@ renderTexture(WMScreen *scr, proplist_t texture, int width, int height,
|
||||
case 'H':
|
||||
style = RHorizontalGradient;
|
||||
break;
|
||||
default:
|
||||
case 'D':
|
||||
style = RDiagonalGradient;
|
||||
break;
|
||||
@@ -264,9 +289,53 @@ renderTexture(WMScreen *scr, proplist_t texture, int width, int height,
|
||||
str2rcolor(rc, str, &rcolor);
|
||||
str = PLGetString(PLGetArrayElement(texture, 2));
|
||||
str2rcolor(rc, str, &rcolor2);
|
||||
|
||||
|
||||
image = RRenderGradient(width, height, &rcolor, &rcolor2, style);
|
||||
} else if (strcasecmp(&type[2], "gradient")==0) {
|
||||
} else if (strcasecmp(&type[2], "gradient")==0 && toupper(type[0])=='T') {
|
||||
int style;
|
||||
RColor rcolor2;
|
||||
int i;
|
||||
RImage *grad, *timage;
|
||||
char *path;
|
||||
|
||||
switch (toupper(type[1])) {
|
||||
case 'V':
|
||||
style = RVerticalGradient;
|
||||
break;
|
||||
case 'H':
|
||||
style = RHorizontalGradient;
|
||||
break;
|
||||
default:
|
||||
case 'D':
|
||||
style = RDiagonalGradient;
|
||||
break;
|
||||
}
|
||||
|
||||
str = PLGetString(PLGetArrayElement(texture, 3));
|
||||
str2rcolor(rc, str, &rcolor);
|
||||
str = PLGetString(PLGetArrayElement(texture, 4));
|
||||
str2rcolor(rc, str, &rcolor2);
|
||||
|
||||
str = PLGetString(PLGetArrayElement(texture, 1));
|
||||
|
||||
path = wfindfileinarray(GetObjectForKey("PixmapPath"), str);
|
||||
timage = RLoadImage(rc, path, 0);
|
||||
|
||||
if (!timage) {
|
||||
wwarning("could not load file '%s': %s", path,
|
||||
RMessageForError(RErrorCode));
|
||||
} else {
|
||||
grad = RRenderGradient(width, height, &rcolor, &rcolor2, style);
|
||||
|
||||
image = RMakeTiledImage(timage, width, height);
|
||||
RDestroyImage(timage);
|
||||
|
||||
i = atoi(PLGetString(PLGetArrayElement(texture, 2)));
|
||||
|
||||
RCombineImagesWithOpaqueness(image, grad, i);
|
||||
RDestroyImage(grad);
|
||||
}
|
||||
} else if (strcasecmp(&type[2], "gradient")==0 && toupper(type[0])=='M') {
|
||||
int style;
|
||||
RColor **colors;
|
||||
int i, j;
|
||||
@@ -278,6 +347,7 @@ renderTexture(WMScreen *scr, proplist_t texture, int width, int height,
|
||||
case 'H':
|
||||
style = RHorizontalGradient;
|
||||
break;
|
||||
default:
|
||||
case 'D':
|
||||
style = RDiagonalGradient;
|
||||
break;
|
||||
@@ -302,40 +372,49 @@ renderTexture(WMScreen *scr, proplist_t texture, int width, int height,
|
||||
free(colors);
|
||||
}
|
||||
} else if (strcasecmp(&type[1], "pixmap")==0) {
|
||||
int style;
|
||||
RImage *timage;
|
||||
int w, h;
|
||||
char *path;
|
||||
RColor color;
|
||||
|
||||
str = PLGetString(PLGetArrayElement(texture, 1));
|
||||
|
||||
path = wfindfileinarray(GetObjectForKey("PixmapPath"), str);
|
||||
timage = RLoadImage(rc, path, 0);
|
||||
free(path);
|
||||
|
||||
if (toupper(type[0]) == 'T') {
|
||||
if (timage->width < TEXPREV_WIDTH
|
||||
|| timage->height < TEXPREV_HEIGHT) {
|
||||
image = RMakeTiledImage(timage, TEXPREV_WIDTH, TEXPREV_HEIGHT);
|
||||
|
||||
if (!timage) {
|
||||
wwarning("could not load file '%s': %s", path,
|
||||
RMessageForError(RErrorCode));
|
||||
} else {
|
||||
str = PLGetString(PLGetArrayElement(texture, 2));
|
||||
str2rcolor(rc, str, &color);
|
||||
|
||||
switch (toupper(type[0])) {
|
||||
case 'T':
|
||||
image = RMakeTiledImage(timage, width, height);
|
||||
RDestroyImage(timage);
|
||||
timage = image;
|
||||
}
|
||||
} else if (timage) {
|
||||
w = timage->width;
|
||||
h = timage->height;
|
||||
|
||||
if (w - TEXPREV_WIDTH > h - TEXPREV_HEIGHT) {
|
||||
h = (w * TEXPREV_HEIGHT)/TEXPREV_WIDTH;
|
||||
} else {
|
||||
w = (h * TEXPREV_WIDTH)/TEXPREV_HEIGHT;
|
||||
break;
|
||||
case 'C':
|
||||
image = RMakeCenteredImage(timage, width, height, &color);
|
||||
RDestroyImage(timage);
|
||||
timage = image;
|
||||
break;
|
||||
case 'S':
|
||||
case 'M':
|
||||
image = RScaleImage(timage, width, height);
|
||||
RDestroyImage(timage);
|
||||
timage = image;
|
||||
break;
|
||||
}
|
||||
|
||||
image = RScaleImage(timage, w, h);
|
||||
RDestroyImage(timage);
|
||||
timage = image;
|
||||
}
|
||||
free(path);
|
||||
}
|
||||
|
||||
if (!image)
|
||||
return None;
|
||||
|
||||
if (path) {
|
||||
dumpRImage(path, image);
|
||||
}
|
||||
@@ -372,48 +451,48 @@ updatePreviewBox(_Panel *panel, int elements)
|
||||
WMColor *color;
|
||||
|
||||
panel->preview = XCreatePixmap(dpy, WMWidgetXID(panel->win),
|
||||
220-4, 185-4, WMScreenDepth(scr));
|
||||
260-4, 165-4, WMScreenDepth(scr));
|
||||
|
||||
color = WMGrayColor(scr);
|
||||
XFillRectangle(dpy, panel->preview, WMColorGC(color),
|
||||
0, 0, 220-4, 185-4);
|
||||
0, 0, 260-4, 165-4);
|
||||
WMReleaseColor(color);
|
||||
|
||||
refresh = -1;
|
||||
}
|
||||
|
||||
if (elements & FTITLE) {
|
||||
item = WMGetListItem(panel->texLs, 0);
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[0]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
|
||||
pix = renderTexture(scr, titem->prop, 180, 20, NULL, RBEV_RAISED2);
|
||||
pix = renderTexture(scr, titem->prop, 220, 20, NULL, RBEV_RAISED2);
|
||||
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 180, 20, 5, 10);
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 220, 20, 5, 10);
|
||||
|
||||
XFreePixmap(dpy, pix);
|
||||
}
|
||||
if (elements & UTITLE) {
|
||||
item = WMGetListItem(panel->texLs, 1);
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[1]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
|
||||
pix = renderTexture(scr, titem->prop, 180, 20, NULL, RBEV_RAISED2);
|
||||
pix = renderTexture(scr, titem->prop, 220, 20, NULL, RBEV_RAISED2);
|
||||
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 180, 20, 10, 35);
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 220, 20, 15, 35);
|
||||
|
||||
XFreePixmap(dpy, pix);
|
||||
}
|
||||
if (elements & OTITLE) {
|
||||
item = WMGetListItem(panel->texLs, 2);
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[2]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
|
||||
pix = renderTexture(scr, titem->prop, 180, 20, NULL, RBEV_RAISED2);
|
||||
pix = renderTexture(scr, titem->prop, 220, 20, NULL, RBEV_RAISED2);
|
||||
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 180, 20, 15, 60);
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 220, 20, 25, 60);
|
||||
|
||||
XFreePixmap(dpy, pix);
|
||||
}
|
||||
if (elements & MTITLE) {
|
||||
item = WMGetListItem(panel->texLs, 3);
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[3]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
|
||||
pix = renderTexture(scr, titem->prop, 100, 20, NULL, RBEV_RAISED2);
|
||||
@@ -423,24 +502,30 @@ updatePreviewBox(_Panel *panel, int elements)
|
||||
XFreePixmap(dpy, pix);
|
||||
}
|
||||
if (elements & MITEM) {
|
||||
item = WMGetListItem(panel->texLs, 4);
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[4]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
|
||||
pix = renderTexture(scr, titem->prop, 100, 18, NULL, RBEV_RAISED2);
|
||||
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 100, 20, 20, 115);
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 100, 20, 20, 115+18);
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 100, 20, 20, 115+36);
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 100, 18, 20, 115);
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 100, 18, 20, 115 + 18);
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 100, 18, 20, 115 + 36);
|
||||
|
||||
XFreePixmap(dpy, pix);
|
||||
}
|
||||
if (elements & (MITEM|MTITLE)) {
|
||||
XDrawLine(dpy, panel->preview, gc, 19, 95, 19, 115+36+20);
|
||||
XDrawLine(dpy, panel->preview, gc, 19, 94, 119, 94);
|
||||
}
|
||||
|
||||
if (elements & ICON) {
|
||||
item = WMGetListItem(panel->texLs, 5);
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[5]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
|
||||
pix = renderTexture(scr, titem->prop, 64, 64, NULL, RBEV_RAISED3);
|
||||
pix = renderTexture(scr, titem->prop, 64, 64, NULL,
|
||||
titem->ispixmap ? 0 : RBEV_RAISED3);
|
||||
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 64, 64, 130, 100);
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 64, 64, 150, 90);
|
||||
|
||||
XFreePixmap(dpy, pix);
|
||||
}
|
||||
@@ -449,7 +534,7 @@ updatePreviewBox(_Panel *panel, int elements)
|
||||
if (refresh < 0) {
|
||||
WMPixmap *p;
|
||||
p = WMCreatePixmapFromXPixmaps(scr, panel->preview, None,
|
||||
220-4, 185-4, WMScreenDepth(scr));
|
||||
260-4, 165-4, WMScreenDepth(scr));
|
||||
|
||||
WMSetLabelImage(panel->prevL, p);
|
||||
WMReleasePixmap(p);
|
||||
@@ -475,23 +560,19 @@ cancelNewTexture(void *data)
|
||||
|
||||
|
||||
static char*
|
||||
makeFileName(char *prefix, char *name)
|
||||
makeFileName(char *prefix)
|
||||
{
|
||||
char *fname, *str;
|
||||
int i;
|
||||
char *fname;
|
||||
|
||||
str = wstrappend(prefix, name);
|
||||
fname = wstrdup(str);
|
||||
fname = wstrdup(prefix);
|
||||
|
||||
i = 1;
|
||||
while (access(fname, F_OK)==0) {
|
||||
char buf[16];
|
||||
char buf[30];
|
||||
|
||||
free(fname);
|
||||
sprintf(buf, "%i", i++);
|
||||
fname = wstrappend(str, buf);
|
||||
sprintf(buf, "%08lx.cache", time(NULL));
|
||||
fname = wstrappend(prefix, buf);
|
||||
}
|
||||
free(str);
|
||||
|
||||
return fname;
|
||||
}
|
||||
@@ -526,7 +607,9 @@ okNewTexture(void *data)
|
||||
titem->texture = str;
|
||||
titem->selectedFor = 0;
|
||||
|
||||
titem->path = makeFileName(panel->fprefix, name);
|
||||
titem->ispixmap = isPixmap(prop);
|
||||
|
||||
titem->path = makeFileName(panel->fprefix);
|
||||
titem->preview = renderTexture(scr, prop, TEXPREV_WIDTH, TEXPREV_HEIGHT,
|
||||
titem->path, 0);
|
||||
|
||||
@@ -537,7 +620,6 @@ okNewTexture(void *data)
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
okEditTexture(void *data)
|
||||
{
|
||||
@@ -567,12 +649,14 @@ okEditTexture(void *data)
|
||||
PLRelease(titem->prop);
|
||||
titem->prop = prop;
|
||||
|
||||
titem->ispixmap = isPixmap(prop);
|
||||
|
||||
free(titem->texture);
|
||||
titem->texture = str;
|
||||
|
||||
XFreePixmap(WMScreenDisplay(WMWidgetScreen(panel->texLs)), titem->preview);
|
||||
titem->preview = renderTexture(WMWidgetScreen(panel->texLs), titem->prop,
|
||||
TEXPREV_WIDTH, TEXPREV_HEIGHT,
|
||||
TEXPREV_WIDTH, TEXPREV_HEIGHT,
|
||||
titem->path, 0);
|
||||
|
||||
WMRedisplayWidget(panel->texLs);
|
||||
@@ -593,13 +677,14 @@ editTexture(WMWidget *w, void *data)
|
||||
item = WMGetListItem(panel->texLs, WMGetListSelectedItemRow(panel->texLs));
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
|
||||
SetTexturePanelPixmapPath(panel->texturePanel,
|
||||
GetObjectForKey("PixmapPath"));
|
||||
|
||||
SetTexturePanelTexture(panel->texturePanel, titem->title, titem->prop);
|
||||
|
||||
SetTexturePanelCancelAction(panel->texturePanel, cancelNewTexture, panel);
|
||||
SetTexturePanelOkAction(panel->texturePanel, okEditTexture, panel);
|
||||
|
||||
SetTexturePanelPixmapPath(panel->texturePanel,
|
||||
GetObjectForKey("PixmapPath"));
|
||||
ShowTexturePanel(panel->texturePanel);
|
||||
}
|
||||
|
||||
@@ -610,14 +695,15 @@ newTexture(WMWidget *w, void *data)
|
||||
{
|
||||
_Panel *panel = (_Panel*)data;
|
||||
|
||||
SetTexturePanelPixmapPath(panel->texturePanel,
|
||||
GetObjectForKey("PixmapPath"));
|
||||
|
||||
SetTexturePanelTexture(panel->texturePanel, "New Texture", NULL);
|
||||
|
||||
SetTexturePanelCancelAction(panel->texturePanel, cancelNewTexture, panel);
|
||||
|
||||
SetTexturePanelOkAction(panel->texturePanel, okNewTexture, panel);
|
||||
|
||||
SetTexturePanelPixmapPath(panel->texturePanel,
|
||||
GetObjectForKey("PixmapPath"));
|
||||
ShowTexturePanel(panel->texturePanel);
|
||||
}
|
||||
|
||||
@@ -681,7 +767,6 @@ extractTexture(WMWidget *w, void *data)
|
||||
_("Select File"), NULL)) {
|
||||
path = WMGetFilePanelFileName(opanel);
|
||||
|
||||
puts(path);
|
||||
OpenExtractPanelFor(panel, path);
|
||||
|
||||
free(path);
|
||||
@@ -775,6 +860,8 @@ textureDoubleClick(WMWidget *w, void *data)
|
||||
sprintf(str, "%s: %s", titem->title, titem->texture);
|
||||
WMSetLabelText(panel->texsL, str);
|
||||
free(str);
|
||||
|
||||
updatePreviewBox(panel, 1<<section);
|
||||
}
|
||||
|
||||
|
||||
@@ -887,7 +974,6 @@ fillTextureList(WMList *lPtr)
|
||||
titem->selectedFor = 0;
|
||||
titem->path = wstrdup(PLGetString(PLGetArrayElement(texture, 2)));
|
||||
|
||||
puts(titem->path);
|
||||
titem->preview = loadRImage(scr, titem->path);
|
||||
if (!titem->preview) {
|
||||
titem->preview = renderTexture(scr, titem->prop, TEXPREV_WIDTH,
|
||||
@@ -944,6 +1030,7 @@ createPanel(Panel *p)
|
||||
panel->prevL = WMCreateLabel(panel->frame);
|
||||
WMResizeWidget(panel->prevL, 260, 165);
|
||||
WMMoveWidget(panel->prevL, 15, 10);
|
||||
WMSetLabelRelief(panel->prevL, WRSunken);
|
||||
WMSetLabelImagePosition(panel->prevL, WIPImageOnly);
|
||||
|
||||
panel->secP = WMCreatePopUpButton(panel->frame);
|
||||
@@ -1078,6 +1165,8 @@ setupTextureFor(WMList *list, char *key, char *defValue, char *title,
|
||||
titem->texture = PLGetDescription((proplist_t)titem->prop);
|
||||
titem->current = 1;
|
||||
titem->selectedFor = 1<<index;
|
||||
|
||||
titem->ispixmap = isPixmap(titem->prop);
|
||||
|
||||
titem->preview = renderTexture(WMWidgetScreen(list), titem->prop,
|
||||
TEXPREV_WIDTH, TEXPREV_HEIGHT, NULL, 0);
|
||||
@@ -1128,6 +1217,38 @@ showData(_Panel *panel)
|
||||
|
||||
static void
|
||||
storeData(_Panel *panel)
|
||||
{
|
||||
TextureListItem *titem;
|
||||
WMListItem *item;
|
||||
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[0]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
SetObjectForKey(titem->prop, "FTitleBack");
|
||||
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[1]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
SetObjectForKey(titem->prop, "UTitleBack");
|
||||
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[2]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
SetObjectForKey(titem->prop, "PTitleBack");
|
||||
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[3]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
SetObjectForKey(titem->prop, "MenuTitleBack");
|
||||
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[4]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
SetObjectForKey(titem->prop, "MenuTextBack");
|
||||
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[5]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
SetObjectForKey(titem->prop, "IconBack");
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
prepareForClose(_Panel *panel)
|
||||
{
|
||||
proplist_t textureList;
|
||||
proplist_t texture;
|
||||
@@ -1154,30 +1275,7 @@ storeData(_Panel *panel)
|
||||
WMSetUDObjectForKey(udb, textureList, "TextureList");
|
||||
PLRelease(textureList);
|
||||
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[0]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
SetObjectForKey(titem->prop, "FTitleBack");
|
||||
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[1]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
SetObjectForKey(titem->prop, "UTitleBack");
|
||||
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[2]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
SetObjectForKey(titem->prop, "PTitleBack");
|
||||
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[3]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
SetObjectForKey(titem->prop, "MenuTitleBack");
|
||||
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[4]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
SetObjectForKey(titem->prop, "MenuTextBack");
|
||||
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[5]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
SetObjectForKey(titem->prop, "IconBack");
|
||||
|
||||
WMSynchronizeUserDefaults(udb);
|
||||
}
|
||||
|
||||
|
||||
@@ -1196,6 +1294,7 @@ InitAppearance(WMScreen *scr, WMWindow *win)
|
||||
|
||||
panel->callbacks.createWidgets = createPanel;
|
||||
panel->callbacks.updateDomain = storeData;
|
||||
panel->callbacks.prepareForClose = prepareForClose;
|
||||
|
||||
AddSection(panel, ICON_FILE);
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ typedef struct _Panel {
|
||||
|
||||
WMWindow *win;
|
||||
|
||||
WMButton *swi[4];
|
||||
WMButton *swi[5];
|
||||
|
||||
} _Panel;
|
||||
|
||||
@@ -45,10 +45,11 @@ showData(_Panel *panel)
|
||||
{
|
||||
WMUserDefaults *udb = WMGetStandardUserDefaults();
|
||||
|
||||
WMSetButtonSelected(panel->swi[0], WMGetUDBoolForKey(udb, "NoXSetStuff"));
|
||||
WMSetButtonSelected(panel->swi[1], GetBoolForKey("SaveSessionOnExit"));
|
||||
WMSetButtonSelected(panel->swi[2], GetBoolForKey("UseSaveUnders"));
|
||||
WMSetButtonSelected(panel->swi[3], GetBoolForKey("DisableBlinking"));
|
||||
WMSetButtonSelected(panel->swi[0], GetBoolForKey("DisableMiniwindows"));
|
||||
WMSetButtonSelected(panel->swi[1], WMGetUDBoolForKey(udb, "NoXSetStuff"));
|
||||
WMSetButtonSelected(panel->swi[2], GetBoolForKey("SaveSessionOnExit"));
|
||||
WMSetButtonSelected(panel->swi[3], GetBoolForKey("UseSaveUnders"));
|
||||
WMSetButtonSelected(panel->swi[4], GetBoolForKey("DisableBlinking"));
|
||||
}
|
||||
|
||||
|
||||
@@ -62,15 +63,17 @@ createPanel(Panel *p)
|
||||
WMResizeWidget(panel->frame, FRAME_WIDTH, FRAME_HEIGHT);
|
||||
WMMoveWidget(panel->frame, FRAME_LEFT, FRAME_TOP);
|
||||
|
||||
for (i=0; i<4; i++) {
|
||||
for (i=0; i<5; i++) {
|
||||
panel->swi[i] = WMCreateSwitchButton(panel->frame);
|
||||
WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
|
||||
WMMoveWidget(panel->swi[i], 20, 20+i*25);
|
||||
}
|
||||
WMSetButtonText(panel->swi[0], _("Do not set non-WindowMaker specific parameters (do not use xset)"));
|
||||
WMSetButtonText(panel->swi[1], _("Automatically save session when exiting WindowMaker"));
|
||||
WMSetButtonText(panel->swi[2], _("Use SaveUnder in window frames, icons, menus and other objects"));
|
||||
WMSetButtonText(panel->swi[3], _("Disable cycling color highlighting of icons."));
|
||||
|
||||
WMSetButtonText(panel->swi[0], _("Disable miniwindows (icons for miniaturized windows). For use with KDE/GNOME."));
|
||||
WMSetButtonText(panel->swi[1], _("Do not set non-WindowMaker specific parameters (do not use xset)"));
|
||||
WMSetButtonText(panel->swi[2], _("Automatically save session when exiting WindowMaker"));
|
||||
WMSetButtonText(panel->swi[3], _("Use SaveUnder in window frames, icons, menus and other objects"));
|
||||
WMSetButtonText(panel->swi[4], _("Disable cycling color highlighting of icons."));
|
||||
|
||||
WMRealizeWidget(panel->frame);
|
||||
WMMapSubwidgets(panel->frame);
|
||||
@@ -84,11 +87,13 @@ storeDefaults(_Panel *panel)
|
||||
{
|
||||
WMUserDefaults *udb = WMGetStandardUserDefaults();
|
||||
|
||||
WMSetUDBoolForKey(udb, WMGetButtonSelected(panel->swi[0]), "NoXSetStuff");
|
||||
SetBoolForKey(WMGetButtonSelected(panel->swi[0]), "DisableMiniwindows");
|
||||
|
||||
SetBoolForKey(WMGetButtonSelected(panel->swi[1]), "SaveSessionOnExit");
|
||||
SetBoolForKey(WMGetButtonSelected(panel->swi[2]), "UseSaveUnders");
|
||||
SetBoolForKey(WMGetButtonSelected(panel->swi[3]), "DisableBlinking");
|
||||
WMSetUDBoolForKey(udb, WMGetButtonSelected(panel->swi[1]), "NoXSetStuff");
|
||||
|
||||
SetBoolForKey(WMGetButtonSelected(panel->swi[2]), "SaveSessionOnExit");
|
||||
SetBoolForKey(WMGetButtonSelected(panel->swi[3]), "UseSaveUnders");
|
||||
SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "DisableBlinking");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -208,6 +208,9 @@ updateTGradImage(TexturePanel *panel)
|
||||
RColor to;
|
||||
WMColor *color;
|
||||
|
||||
if (!panel->image)
|
||||
return;
|
||||
|
||||
color = WMGetColorWellColor(panel->tcol1W);
|
||||
from.red = WMRedComponentOfColor(color)>>8;
|
||||
from.green = WMGreenComponentOfColor(color)>>8;
|
||||
@@ -218,13 +221,32 @@ updateTGradImage(TexturePanel *panel)
|
||||
to.green = WMGreenComponentOfColor(color)>>8;
|
||||
to.blue = WMBlueComponentOfColor(color)>>8;
|
||||
|
||||
if (WMGetButtonSelected(panel->dirhB)) {
|
||||
gradient = RRenderGradient(80, 30, &from, &to, RHorizontalGradient);
|
||||
} else if (WMGetButtonSelected(panel->dirvB)) {
|
||||
gradient = RRenderGradient(80, 30, &from, &to, RVerticalGradient);
|
||||
if (panel->image->width < 141 || panel->image->height < 91) {
|
||||
image = RMakeTiledImage(panel->image, 141, 91);
|
||||
} else {
|
||||
gradient = RRenderGradient(80, 30, &from, &to, RDiagonalGradient);
|
||||
image = RCloneImage(panel->image);
|
||||
}
|
||||
|
||||
if (WMGetButtonSelected(panel->dirhB)) {
|
||||
gradient = RRenderGradient(image->width, image->height, &from, &to,
|
||||
RHorizontalGradient);
|
||||
} else if (WMGetButtonSelected(panel->dirvB)) {
|
||||
gradient = RRenderGradient(image->width, image->height, &from, &to,
|
||||
RVerticalGradient);
|
||||
} else {
|
||||
gradient = RRenderGradient(image->width, image->height, &from, &to,
|
||||
RDiagonalGradient);
|
||||
}
|
||||
|
||||
RCombineImagesWithOpaqueness(image, gradient,
|
||||
WMGetSliderValue(panel->topaS));
|
||||
RDestroyImage(gradient);
|
||||
pixmap = WMCreatePixmapFromRImage(WMWidgetScreen(panel->win),
|
||||
image, 128);
|
||||
|
||||
WMSetLabelImage(panel->imageL, pixmap);
|
||||
WMResizeWidget(panel->imageL, image->width, image->height);
|
||||
RDestroyImage(image);
|
||||
}
|
||||
|
||||
|
||||
@@ -270,43 +292,6 @@ updateSGradButtons(TexturePanel *panel)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
changeTypeCallback(WMWidget *w, void *data)
|
||||
{
|
||||
TexturePanel *panel = (TexturePanel*)data;
|
||||
int newType;
|
||||
int i;
|
||||
|
||||
newType = WMGetPopUpButtonSelectedItem(w);
|
||||
if (newType == panel->currentType)
|
||||
return;
|
||||
|
||||
if (panel->currentType >= 0) {
|
||||
for (i = 0; i < MAX_SECTION_PARTS; i++) {
|
||||
if (panel->sectionParts[panel->currentType][i] == NULL)
|
||||
break;
|
||||
WMUnmapWidget(panel->sectionParts[panel->currentType][i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_SECTION_PARTS; i++) {
|
||||
if (panel->sectionParts[newType][i] == NULL)
|
||||
break;
|
||||
WMMapWidget(panel->sectionParts[newType][i]);
|
||||
}
|
||||
panel->currentType = newType;
|
||||
|
||||
switch (newType) {
|
||||
case TYPE_SGRADIENT:
|
||||
updateSGradButtons(panel);
|
||||
break;
|
||||
case TYPE_GRADIENT:
|
||||
updateGradButtons(panel);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*********** Gradient ************/
|
||||
|
||||
static void
|
||||
@@ -587,27 +572,88 @@ colorWellObserver(void *self, WMNotification *n)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static void
|
||||
opaqChangeCallback(WMWidget *w, void *data)
|
||||
{
|
||||
TexturePanel *panel = (TexturePanel*)data;
|
||||
|
||||
updateTGradImage(panel);
|
||||
}
|
||||
|
||||
/****************** Image ******************/
|
||||
|
||||
static void
|
||||
updateImage(TexturePanel *panel, char *path)
|
||||
{
|
||||
WMScreen *scr = WMWidgetScreen(panel->win);
|
||||
RImage *image, *scaled;
|
||||
WMPixmap *pixmap;
|
||||
WMSize size;
|
||||
|
||||
if (path) {
|
||||
image = RLoadImage(WMScreenRContext(scr), path, 0);
|
||||
if (!image) {
|
||||
char *message;
|
||||
|
||||
message = wstrappend(_("Could not load the selected file: "),
|
||||
(char*)RMessageForError(RErrorCode));
|
||||
|
||||
WMRunAlertPanel(scr, panel->win, _("Error"), message,
|
||||
_("OK"), NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (panel->image)
|
||||
RDestroyImage(panel->image);
|
||||
panel->image = image;
|
||||
} else {
|
||||
image = panel->image;
|
||||
}
|
||||
|
||||
if (WMGetPopUpButtonSelectedItem(panel->typeP) == TYPE_PIXMAP) {
|
||||
pixmap = WMCreatePixmapFromRImage(scr, image, 128);
|
||||
|
||||
size = WMGetPixmapSize(pixmap);
|
||||
WMSetLabelImage(panel->imageL, pixmap);
|
||||
WMResizeWidget(panel->imageL, size.width, size.height);
|
||||
|
||||
WMReleasePixmap(pixmap);
|
||||
} else {
|
||||
updateTGradImage(panel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
browseImageCallback(WMWidget *w, void *data)
|
||||
{
|
||||
TexturePanel *panel = (TexturePanel*)data;
|
||||
WMOpenPanel *opanel;
|
||||
WMScreen *scr = WMWidgetScreen(w);
|
||||
static char *ipath = NULL;
|
||||
|
||||
opanel = WMGetOpenPanel(scr);
|
||||
WMSetFilePanelCanChooseDirectories(opanel, False);
|
||||
WMSetFilePanelCanChooseFiles(opanel, True);
|
||||
|
||||
if (WMRunModalFilePanelForDirectory(opanel, panel->win, wgethomedir(),
|
||||
if (!ipath)
|
||||
ipath = wstrdup(wgethomedir());
|
||||
|
||||
if (WMRunModalFilePanelForDirectory(opanel, panel->win, ipath,
|
||||
"Open Image", NULL)) {
|
||||
char *path, *fullpath;
|
||||
char *tmp, *tmp2;
|
||||
|
||||
fullpath = WMGetFilePanelFileName(opanel);
|
||||
if (!fullpath)
|
||||
tmp = WMGetFilePanelFileName(opanel);
|
||||
if (!tmp)
|
||||
return;
|
||||
fullpath = tmp;
|
||||
|
||||
free(ipath);
|
||||
ipath = fullpath;
|
||||
|
||||
path = wstrdup(fullpath);
|
||||
|
||||
tmp2 = strrchr(fullpath, '/');
|
||||
@@ -629,47 +675,12 @@ browseImageCallback(WMWidget *w, void *data)
|
||||
_("The selected file does not contain a supported image."),
|
||||
_("OK"), NULL, NULL);
|
||||
free(path);
|
||||
free(fullpath);
|
||||
} else {
|
||||
RImage *image, *scaled;
|
||||
WMPixmap *pixmap;
|
||||
WMSize size;
|
||||
|
||||
image = RLoadImage(WMScreenRContext(scr), fullpath, 0);
|
||||
if (!image) {
|
||||
char *message;
|
||||
|
||||
message = wstrappend(_("Could not load the selected file: "),
|
||||
(char*)RMessageForError(RErrorCode));
|
||||
|
||||
WMRunAlertPanel(scr, panel->win, _("Error"), message,
|
||||
_("OK"), NULL, NULL);
|
||||
free(message);
|
||||
free(path);
|
||||
free(fullpath);
|
||||
return;
|
||||
}
|
||||
|
||||
if (panel->image)
|
||||
RDestroyImage(panel->image);
|
||||
panel->image = image;
|
||||
|
||||
if (WMGetPopUpButtonSelectedItem(panel->typeP) == TYPE_PIXMAP) {
|
||||
pixmap = WMCreatePixmapFromRImage(scr, image, 128);
|
||||
|
||||
size = WMGetPixmapSize(pixmap);
|
||||
WMSetLabelImage(panel->imageL, pixmap);
|
||||
WMResizeWidget(panel->imageL, size.width, size.height);
|
||||
|
||||
WMReleasePixmap(pixmap);
|
||||
} else {
|
||||
updateTGradImage(panel);
|
||||
}
|
||||
updateImage(panel, fullpath);
|
||||
free(panel->imageFile);
|
||||
panel->imageFile = path;
|
||||
|
||||
WMSetTextFieldText(panel->imageT, path);
|
||||
|
||||
free(fullpath);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -689,6 +700,48 @@ buttonCallback(WMWidget *w, void *data)
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
changeTypeCallback(WMWidget *w, void *data)
|
||||
{
|
||||
TexturePanel *panel = (TexturePanel*)data;
|
||||
int newType;
|
||||
int i;
|
||||
|
||||
newType = WMGetPopUpButtonSelectedItem(w);
|
||||
if (newType == panel->currentType)
|
||||
return;
|
||||
|
||||
if (panel->currentType >= 0) {
|
||||
for (i = 0; i < MAX_SECTION_PARTS; i++) {
|
||||
if (panel->sectionParts[panel->currentType][i] == NULL)
|
||||
break;
|
||||
WMUnmapWidget(panel->sectionParts[panel->currentType][i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_SECTION_PARTS; i++) {
|
||||
if (panel->sectionParts[newType][i] == NULL)
|
||||
break;
|
||||
WMMapWidget(panel->sectionParts[newType][i]);
|
||||
}
|
||||
panel->currentType = newType;
|
||||
|
||||
switch (newType) {
|
||||
case TYPE_SGRADIENT:
|
||||
updateSGradButtons(panel);
|
||||
break;
|
||||
case TYPE_GRADIENT:
|
||||
updateGradButtons(panel);
|
||||
break;
|
||||
case TYPE_TGRADIENT:
|
||||
case TYPE_PIXMAP:
|
||||
updateImage(panel, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------------------
|
||||
* Public functions
|
||||
@@ -705,10 +758,11 @@ void
|
||||
ShowTexturePanel(TexturePanel *panel)
|
||||
{
|
||||
Display *dpy = WMScreenDisplay(WMWidgetScreen(panel->win));
|
||||
Screen *scr = DefaultScreenOfDisplay(dpy);
|
||||
|
||||
WMSetWindowUPosition(panel->win,
|
||||
WidthOfScreen(DefaultScreenOfDisplay(dpy))/2,
|
||||
HeightOfScreen(DefaultScreenOfDisplay(dpy))/2);
|
||||
(WidthOfScreen(scr)-WMWidgetWidth(panel->win))/2,
|
||||
(HeightOfScreen(scr)-WMWidgetHeight(panel->win))/2);
|
||||
WMMapWidget(panel->win);
|
||||
}
|
||||
|
||||
@@ -818,6 +872,10 @@ SetTexturePanelTexture(TexturePanel *panel, char *name, proplist_t texture)
|
||||
|
||||
WMSetTextFieldText(panel->imageT,
|
||||
PLGetString(PLGetArrayElement(texture, 1)));
|
||||
if (panel->imageFile)
|
||||
free(panel->imageFile);
|
||||
panel->imageFile = wstrdup(PLGetString(PLGetArrayElement(texture, 1)));
|
||||
|
||||
|
||||
i = 180;
|
||||
sscanf(PLGetString(PLGetArrayElement(texture, 2)), "%i", &i);
|
||||
@@ -847,6 +905,19 @@ SetTexturePanelTexture(TexturePanel *panel, char *name, proplist_t texture)
|
||||
|
||||
WMReleaseColor(color);
|
||||
|
||||
WMSetTextFieldText(panel->imageT,
|
||||
PLGetString(PLGetArrayElement(texture, 1)));
|
||||
|
||||
if (panel->imageFile)
|
||||
free(panel->imageFile);
|
||||
panel->imageFile = wfindfileinarray(panel->pathList,
|
||||
PLGetString(PLGetArrayElement(texture, 1)));
|
||||
|
||||
panel->image = RLoadImage(WMScreenRContext(scr), panel->imageFile, 0);
|
||||
updateTGradImage(panel);
|
||||
|
||||
updateSGradButtons(panel);
|
||||
|
||||
/*...............................................*/
|
||||
} else if (strcasecmp(type, "mhgradient")==0
|
||||
|| strcasecmp(type, "mvgradient")==0
|
||||
@@ -926,6 +997,18 @@ SetTexturePanelTexture(TexturePanel *panel, char *name, proplist_t texture)
|
||||
|
||||
WMSetTextFieldText(panel->imageT,
|
||||
PLGetString(PLGetArrayElement(texture, 1)));
|
||||
|
||||
if (panel->imageFile)
|
||||
free(panel->imageFile);
|
||||
panel->imageFile = wfindfileinarray(panel->pathList,
|
||||
PLGetString(PLGetArrayElement(texture, 1)));
|
||||
|
||||
color = WMCreateNamedColor(scr,
|
||||
PLGetString(PLGetArrayElement(texture, 2)), False);
|
||||
WMSetColorWellColor(panel->defcW, color);
|
||||
WMReleaseColor(color);
|
||||
|
||||
updateImage(panel, panel->imageFile);
|
||||
}
|
||||
|
||||
changeTypeCallback(panel->typeP, panel);
|
||||
@@ -1009,7 +1092,7 @@ GetTexturePanelTexture(TexturePanel *panel)
|
||||
PLMakeString(str), NULL);
|
||||
break;
|
||||
case PTYPE_TILE:
|
||||
prop = PLMakeArrayFromElements(PLMakeString("tpixmap"),
|
||||
prop = PLMakeArrayFromElements(PLMakeString("tpixmap"),
|
||||
PLMakeString(panel->imageFile),
|
||||
PLMakeString(str), NULL);
|
||||
break;
|
||||
@@ -1017,6 +1100,39 @@ GetTexturePanelTexture(TexturePanel *panel)
|
||||
free(str);
|
||||
break;
|
||||
|
||||
case TYPE_TGRADIENT:
|
||||
color = WMGetColorWellColor(panel->tcol1W);
|
||||
str = WMGetColorRGBDescription(color);
|
||||
|
||||
color = WMGetColorWellColor(panel->tcol2W);
|
||||
str2 = WMGetColorRGBDescription(color);
|
||||
|
||||
sprintf(buff, "%i", WMGetSliderValue(panel->topaS));
|
||||
|
||||
if (WMGetButtonSelected(panel->dirdB)) {
|
||||
prop = PLMakeArrayFromElements(PLMakeString("tdgradient"),
|
||||
PLMakeString(panel->imageFile),
|
||||
PLMakeString(buff),
|
||||
PLMakeString(str),
|
||||
PLMakeString(str2), NULL);
|
||||
} else if (WMGetButtonSelected(panel->dirvB)) {
|
||||
prop = PLMakeArrayFromElements(PLMakeString("tvgradient"),
|
||||
PLMakeString(panel->imageFile),
|
||||
PLMakeString(buff),
|
||||
PLMakeString(str),
|
||||
PLMakeString(str2), NULL);
|
||||
} else {
|
||||
prop = PLMakeArrayFromElements(PLMakeString("thgradient"),
|
||||
PLMakeString(panel->imageFile),
|
||||
PLMakeString(buff),
|
||||
PLMakeString(str),
|
||||
PLMakeString(str2), NULL);
|
||||
}
|
||||
free(str);
|
||||
free(str2);
|
||||
break;
|
||||
|
||||
|
||||
case TYPE_SGRADIENT:
|
||||
color = WMGetColorWellColor(panel->tcol1W);
|
||||
str = WMGetColorRGBDescription(color);
|
||||
@@ -1110,6 +1226,7 @@ CreateTexturePanel(WMWindow *keyWindow)
|
||||
|
||||
WMResizeWidget(panel->win, 325, 423);
|
||||
WMSetWindowTitle(panel->win, _("Texture Panel"));
|
||||
WMSetWindowCloseAction(panel->win, buttonCallback, panel);
|
||||
|
||||
|
||||
/* texture name */
|
||||
@@ -1301,6 +1418,9 @@ CreateTexturePanel(WMWindow *keyWindow)
|
||||
WMMoveWidget(panel->topaS, 15, 20);
|
||||
WMSetSliderMaxValue(panel->topaS, 255);
|
||||
WMSetSliderValue(panel->topaS, 200);
|
||||
WMSetSliderContinuous(panel->topaS, False);
|
||||
WMSetSliderAction(panel->topaS, opaqChangeCallback, panel);
|
||||
|
||||
WMMapSubwidgets(panel->topaF);
|
||||
|
||||
{
|
||||
@@ -1357,10 +1477,11 @@ CreateTexturePanel(WMWindow *keyWindow)
|
||||
WMSetButtonText(panel->browB, _("Browse..."));
|
||||
WMSetButtonAction(panel->browB, browseImageCallback, panel);
|
||||
|
||||
panel->dispB = WMCreateCommandButton(panel->imageF);
|
||||
/* panel->dispB = WMCreateCommandButton(panel->imageF);
|
||||
WMResizeWidget(panel->dispB, 90, 24);
|
||||
WMMoveWidget(panel->dispB, 190, 80);
|
||||
WMSetButtonText(panel->dispB, _("Show"));
|
||||
*/
|
||||
|
||||
panel->arrP = WMCreatePopUpButton(panel->imageF);
|
||||
WMResizeWidget(panel->arrP, 90, 20);
|
||||
|
||||
@@ -106,10 +106,13 @@ static void loadConfigurations(WMScreen *scr, WMWindow *mainw);
|
||||
|
||||
static void savePanelData(Panel *panel);
|
||||
|
||||
static void prepareForClose();
|
||||
|
||||
void
|
||||
quit(WMWidget *w, void *data)
|
||||
{
|
||||
prepareForClose();
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@@ -157,6 +160,7 @@ save(WMWidget *w, void *data)
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
undo(WMWidget *w, void *data)
|
||||
{
|
||||
@@ -187,6 +191,23 @@ undoAll(WMWidget *w, void *data)
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
prepareForClose()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i<WPrefs.sectionCount; i++) {
|
||||
PanelRec *rec = WMGetHangedData(WPrefs.sectionB[i]);
|
||||
|
||||
if (rec->callbacks.prepareForClose
|
||||
&& (rec->callbacks.flags & INITIALIZED_PANEL))
|
||||
(*rec->callbacks.prepareForClose)((Panel*)rec);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
createMainWindow(WMScreen *scr)
|
||||
{
|
||||
|
||||
@@ -55,6 +55,7 @@ typedef struct {
|
||||
void (*updateDomain)(Panel*); /* save the changes to the dictionary */
|
||||
Bool (*requiresRestart)(Panel*); /* return True if some static option was changed */
|
||||
void (*undoChanges)(Panel*); /* reset values to those in the dictionary */
|
||||
void (*prepareForClose)(Panel*); /* called when exiting WPrefs */
|
||||
} CallbackRec;
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
Position = "0,1";
|
||||
},
|
||||
{
|
||||
Command = "/usr/local/GNUstep/Apps/WPrefs.app/WPrefs";
|
||||
Command = "/usr/local/GNUstep/Local/Apps/WPrefs.app/WPrefs";
|
||||
Name = groupLeader.WPrefs;
|
||||
AutoLaunch = No;
|
||||
Forced = No;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
DisableMiniwindows = NO;
|
||||
OpenTransientOnOwnerWorkspace = NO;
|
||||
EdgeResistance = 30;
|
||||
IconificationStyle = Zoom;
|
||||
@@ -54,9 +55,9 @@
|
||||
IconPosition = "blh";
|
||||
WrapMenus = NO;
|
||||
ScrollableMenus = YES;
|
||||
MenuScrollSpeed = medium;
|
||||
IconSlideSpeed = medium;
|
||||
ShadeSpeed = medium;
|
||||
MenuScrollSpeed = fast;
|
||||
IconSlideSpeed = fast;
|
||||
ShadeSpeed = fast;
|
||||
DoubleClickTime = 250;
|
||||
AlignSubmenus = NO;
|
||||
NoWindowOverIcons = NO;
|
||||
|
||||
@@ -12,11 +12,15 @@ Window Maker 0.20.4 or newer.
|
||||
How To Install a Theme Pack
|
||||
===========================
|
||||
|
||||
To install a theme, unpack your theme into your theme directory,
|
||||
usually ~/GNUstep/Library/WindowMaker/Themes
|
||||
To install a theme, unpack your theme into your WindowMaker directory
|
||||
(the same as old-style themes), usually ~/GNUstep/Library/WindowMaker
|
||||
|
||||
cd ~/GNUstep/Library/WindowMaker/Themes
|
||||
gunzip -c xyztheme.tar.gz | tar xf -
|
||||
cd ~/GNUstep/Library/WindowMaker
|
||||
gzip -dc "xyztheme.tar.gz" | tar xvf -
|
||||
|
||||
You can also do this in your system-wide WindowMaker directory (usually
|
||||
/usr/local/share/WindowMaker) to have the themes be available to all
|
||||
your users. This will probably need to be done with root access.
|
||||
|
||||
|
||||
How To Load a Theme
|
||||
@@ -37,19 +41,25 @@ How To Make a Theme Pack
|
||||
To create a theme pack from your current configuration, use the getstyle
|
||||
utility with the -p flag. Example:
|
||||
|
||||
getstyle -p MyTheme
|
||||
getstyle -p ~/GNUstep/Library/WindowMaker/Themes/MyTheme
|
||||
|
||||
This will create a theme pack named MyTheme.themed, containing everything
|
||||
it requires, including all pixmap files.
|
||||
This will create a theme pack (a new directory in either the current
|
||||
directory or a directory you specify) named MyTheme.themed, containing
|
||||
everything it requires, including all pixmap files. In this example,
|
||||
the new theme pack would be made in your themes directory and be
|
||||
immediately available in your Themes menu.
|
||||
|
||||
Additionally, you can put a text file named MyTheme.lsm in the MyTheme.themed
|
||||
directory. This file can contain info like copyrights, credits or whatever.
|
||||
|
||||
To distribute your theme, just make a .tar.gz of the .themed directory.
|
||||
This is preferably done from the same directory that you unpack the themes
|
||||
from to maintain consistancy with the old theme format.
|
||||
|
||||
Example:
|
||||
|
||||
tar cf MyTheme.tar MyTheme.themed
|
||||
cd ~/GNUstep/Library/WindowMaker
|
||||
tar cvf MyTheme.tar Themes/MyTheme.themed
|
||||
gzip MyTheme.tar
|
||||
|
||||
|
||||
|
||||
60
configure
vendored
60
configure
vendored
@@ -2358,13 +2358,15 @@ done
|
||||
|
||||
|
||||
|
||||
DLLIBS=""
|
||||
|
||||
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
|
||||
echo "configure:2363: checking for dlopen" >&5
|
||||
echo "configure:2365: checking for dlopen" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2368 "configure"
|
||||
#line 2370 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char dlopen(); below. */
|
||||
@@ -2387,7 +2389,7 @@ dlopen();
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:2393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_dlopen=yes"
|
||||
else
|
||||
@@ -2405,7 +2407,7 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
|
||||
echo "configure:2409: checking for dlopen in -ldl" >&5
|
||||
echo "configure:2411: checking for dlopen in -ldl" >&5
|
||||
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@@ -2413,7 +2415,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-ldl $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2417 "configure"
|
||||
#line 2419 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@@ -2424,7 +2426,7 @@ int main() {
|
||||
dlopen()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:2430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@@ -2453,17 +2455,17 @@ if test "x$HAVEDL" = xyes; then
|
||||
do
|
||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||
echo "configure:2457: checking for $ac_hdr" >&5
|
||||
echo "configure:2459: checking for $ac_hdr" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2462 "configure"
|
||||
#line 2464 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <$ac_hdr>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:2467: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:2469: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
@@ -2497,7 +2499,7 @@ if test "x$CPP_PATH" = x; then
|
||||
# Extract the first word of "cpp", so it can be a program name with args.
|
||||
set dummy cpp; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2501: checking for $ac_word" >&5
|
||||
echo "configure:2503: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_CPP_PATH'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -2553,12 +2555,12 @@ EOF
|
||||
|
||||
|
||||
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
|
||||
echo "configure:2557: checking for sys/wait.h that is POSIX.1 compatible" >&5
|
||||
echo "configure:2559: checking for sys/wait.h that is POSIX.1 compatible" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2562 "configure"
|
||||
#line 2564 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
@@ -2574,7 +2576,7 @@ wait (&s);
|
||||
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:2580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_header_sys_wait_h=yes
|
||||
else
|
||||
@@ -2595,12 +2597,12 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
|
||||
echo "configure:2599: checking whether time.h and sys/time.h may both be included" >&5
|
||||
echo "configure:2601: checking whether time.h and sys/time.h may both be included" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2604 "configure"
|
||||
#line 2606 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
@@ -2609,7 +2611,7 @@ int main() {
|
||||
struct tm *tp;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:2615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_header_time=yes
|
||||
else
|
||||
@@ -2634,17 +2636,17 @@ for ac_hdr in fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h\
|
||||
do
|
||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||
echo "configure:2638: checking for $ac_hdr" >&5
|
||||
echo "configure:2640: checking for $ac_hdr" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2643 "configure"
|
||||
#line 2645 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <$ac_hdr>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:2648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:2650: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
@@ -2674,12 +2676,12 @@ done
|
||||
|
||||
|
||||
echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
|
||||
echo "configure:2678: checking for sys_siglist declaration in signal.h or unistd.h" >&5
|
||||
echo "configure:2680: checking for sys_siglist declaration in signal.h or unistd.h" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2683 "configure"
|
||||
#line 2685 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
@@ -2691,7 +2693,7 @@ int main() {
|
||||
char *msg = *(sys_siglist + 1);
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2695: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:2697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_decl_sys_siglist=yes
|
||||
else
|
||||
@@ -2712,12 +2714,12 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for working const""... $ac_c" 1>&6
|
||||
echo "configure:2716: checking for working const" >&5
|
||||
echo "configure:2718: checking for working const" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2721 "configure"
|
||||
#line 2723 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
@@ -2766,7 +2768,7 @@ ccp = (char const *const *) p;
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:2772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_c_const=yes
|
||||
else
|
||||
@@ -2789,12 +2791,12 @@ fi
|
||||
#AC_TYPE_SIZE_T
|
||||
#AC_TYPE_PID_T
|
||||
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
|
||||
echo "configure:2793: checking return type of signal handlers" >&5
|
||||
echo "configure:2795: checking return type of signal handlers" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2798 "configure"
|
||||
#line 2800 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
@@ -2811,7 +2813,7 @@ int main() {
|
||||
int i;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:2817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_type_signal=void
|
||||
else
|
||||
@@ -2837,8 +2839,6 @@ EOF
|
||||
|
||||
|
||||
INTLIBS=""
|
||||
DLLIBS=""
|
||||
|
||||
|
||||
echo $ac_n "checking for gettext""... $ac_c" 1>&6
|
||||
echo "configure:2845: checking for gettext" >&5
|
||||
|
||||
@@ -313,7 +313,9 @@ typedef struct WPreferences {
|
||||
|
||||
char dont_confirm_kill; /* do not confirm Kill application */
|
||||
|
||||
char dont_blink;
|
||||
char disable_miniwindows;
|
||||
|
||||
char dont_blink; /* do not blink icon selection */
|
||||
|
||||
/* Appearance options */
|
||||
char new_style; /* Use newstyle buttons */
|
||||
|
||||
113
src/actions.c
113
src/actions.c
@@ -916,11 +916,13 @@ wIconifyWindow(WWindow *wwin)
|
||||
ButtonMotionMask|ButtonReleaseMask, GrabModeAsync,
|
||||
GrabModeAsync, None, None, CurrentTime);
|
||||
}
|
||||
|
||||
if (!wwin->flags.icon_moved) {
|
||||
PlaceIcon(wwin->screen_ptr, &wwin->icon_x, &wwin->icon_y);
|
||||
|
||||
if (!wPreferences.disable_miniwindows) {
|
||||
if (!wwin->flags.icon_moved) {
|
||||
PlaceIcon(wwin->screen_ptr, &wwin->icon_x, &wwin->icon_y);
|
||||
}
|
||||
wwin->icon = wIconCreate(wwin);
|
||||
}
|
||||
wwin->icon = wIconCreate(wwin);
|
||||
|
||||
wwin->flags.miniaturized = 1;
|
||||
wwin->flags.mapped = 0;
|
||||
@@ -939,28 +941,58 @@ wIconifyWindow(WWindow *wwin)
|
||||
/* let all Expose events arrive so that we can repaint
|
||||
* something before the animation starts (and the server is grabbed) */
|
||||
XSync(dpy, 0);
|
||||
wClientSetState(wwin, IconicState, wwin->icon->icon_win);
|
||||
|
||||
if (wPreferences.disable_miniwindows)
|
||||
wClientSetState(wwin, IconicState, None);
|
||||
else
|
||||
wClientSetState(wwin, IconicState, wwin->icon->icon_win);
|
||||
|
||||
flushExpose();
|
||||
#ifdef ANIMATIONS
|
||||
if (!wwin->screen_ptr->flags.startup && !wwin->flags.skip_next_animation
|
||||
&& !wPreferences.no_animations) {
|
||||
int ix, iy, iw, ih;
|
||||
|
||||
if (!wPreferences.disable_miniwindows) {
|
||||
ix = wwin->icon_x;
|
||||
iy = wwin->icon_y;
|
||||
iw = wwin->icon->core->width;
|
||||
ih = wwin->icon->core->height;
|
||||
} else {
|
||||
WArea area;
|
||||
|
||||
if (wKWMGetIconGeometry(wwin, &area)) {
|
||||
ix = area.x1;
|
||||
iy = area.y1;
|
||||
iw = area.x2 - ix;
|
||||
ih = area.y2 - iy;
|
||||
} else {
|
||||
ix = 0;
|
||||
iy = 0;
|
||||
iw = wwin->screen_ptr->scr_width;
|
||||
ih = wwin->screen_ptr->scr_height;
|
||||
}
|
||||
}
|
||||
animateResize(wwin->screen_ptr, wwin->frame_x, wwin->frame_y,
|
||||
wwin->frame->core->width, wwin->frame->core->height,
|
||||
wwin->icon_x, wwin->icon_y,
|
||||
wwin->icon->core->width, wwin->icon->core->height,
|
||||
False);
|
||||
ix, iy, iw, ih, False);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
wwin->flags.skip_next_animation = 0;
|
||||
if (wwin->screen_ptr->current_workspace==wwin->frame->workspace ||
|
||||
IS_OMNIPRESENT(wwin) || wPreferences.sticky_icons)
|
||||
|
||||
XMapWindow(dpy, wwin->icon->core->window);
|
||||
AddToStackList(wwin->icon->core);
|
||||
if (!wPreferences.disable_miniwindows) {
|
||||
|
||||
wLowerFrame(wwin->icon->core);
|
||||
if (wwin->screen_ptr->current_workspace==wwin->frame->workspace ||
|
||||
IS_OMNIPRESENT(wwin) || wPreferences.sticky_icons)
|
||||
|
||||
XMapWindow(dpy, wwin->icon->core->window);
|
||||
|
||||
AddToStackList(wwin->icon->core);
|
||||
|
||||
wLowerFrame(wwin->icon->core);
|
||||
}
|
||||
|
||||
if (present) {
|
||||
WWindow *owner = recursiveTransientFor(wwin->screen_ptr->focused_window);
|
||||
@@ -1001,8 +1033,8 @@ wIconifyWindow(WWindow *wwin)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
if (wwin->flags.selected)
|
||||
|
||||
if (wwin->flags.selected && !wPreferences.disable_miniwindows)
|
||||
wIconSelect(wwin->icon);
|
||||
|
||||
#ifdef GNOME_STUFF
|
||||
@@ -1014,10 +1046,11 @@ wIconifyWindow(WWindow *wwin)
|
||||
#endif
|
||||
|
||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void
|
||||
wDeiconifyWindow(WWindow *wwin)
|
||||
{
|
||||
@@ -1042,10 +1075,12 @@ wDeiconifyWindow(WWindow *wwin)
|
||||
if (!wwin->flags.shaded)
|
||||
wwin->flags.mapped = 1;
|
||||
|
||||
if (wwin->icon->selected)
|
||||
wIconSelect(wwin->icon);
|
||||
if (!wPreferences.disable_miniwindows) {
|
||||
if (wwin->icon->selected)
|
||||
wIconSelect(wwin->icon);
|
||||
|
||||
XUnmapWindow(dpy, wwin->icon->core->window);
|
||||
XUnmapWindow(dpy, wwin->icon->core->window);
|
||||
}
|
||||
|
||||
#ifdef WMSOUND
|
||||
wSoundPlay(WMSOUND_DEICONIFY);
|
||||
@@ -1053,11 +1088,32 @@ wDeiconifyWindow(WWindow *wwin)
|
||||
|
||||
/* if the window is in another workspace, do it silently */
|
||||
#ifdef ANIMATIONS
|
||||
if (!wwin->screen_ptr->flags.startup && !wPreferences.no_animations
|
||||
if (!wwin->screen_ptr->flags.startup && !wPreferences.no_animations
|
||||
&& !wwin->flags.skip_next_animation) {
|
||||
animateResize(wwin->screen_ptr, wwin->icon_x, wwin->icon_y,
|
||||
wwin->icon->core->width, wwin->icon->core->height,
|
||||
wwin->frame_x, wwin->frame_y,
|
||||
int ix, iy, iw, ih;
|
||||
|
||||
if (!wPreferences.disable_miniwindows) {
|
||||
ix = wwin->icon_x;
|
||||
iy = wwin->icon_y;
|
||||
iw = wwin->icon->core->width;
|
||||
ih = wwin->icon->core->height;
|
||||
} else {
|
||||
WArea area;
|
||||
|
||||
if (wKWMGetIconGeometry(wwin, &area)) {
|
||||
ix = area.x1;
|
||||
iy = area.y1;
|
||||
iw = area.x2 - ix;
|
||||
ih = area.y2 - iy;
|
||||
} else {
|
||||
ix = 0;
|
||||
iy = 0;
|
||||
iw = wwin->screen_ptr->scr_width;
|
||||
ih = wwin->screen_ptr->scr_height;
|
||||
}
|
||||
}
|
||||
animateResize(wwin->screen_ptr, ix, iy, iw, ih,
|
||||
wwin->frame_x, wwin->frame_y,
|
||||
wwin->frame->core->width, wwin->frame->core->height,
|
||||
False);
|
||||
}
|
||||
@@ -1073,11 +1129,13 @@ wDeiconifyWindow(WWindow *wwin)
|
||||
wClientSetState(wwin, NormalState, None);
|
||||
}
|
||||
mapTransientsFor(wwin);
|
||||
RemoveFromStackList(wwin->icon->core);
|
||||
/* removeIconGrabs(wwin->icon);*/
|
||||
wIconDestroy(wwin->icon);
|
||||
wwin->icon = NULL;
|
||||
|
||||
if (!wPreferences.disable_miniwindows) {
|
||||
RemoveFromStackList(wwin->icon->core);
|
||||
/* removeIconGrabs(wwin->icon);*/
|
||||
wIconDestroy(wwin->icon);
|
||||
wwin->icon = NULL;
|
||||
}
|
||||
XUngrabServer(dpy);
|
||||
if (wPreferences.focus_mode==WKF_CLICK
|
||||
|| wPreferences.focus_mode==WKF_SLOPPY)
|
||||
@@ -1116,7 +1174,6 @@ static void
|
||||
hideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int animate)
|
||||
{
|
||||
if (wwin->flags.miniaturized) {
|
||||
/* XXX wrong fix, can cause side effects, must remove 'if' */
|
||||
if (wwin->icon) {
|
||||
XUnmapWindow(dpy, wwin->icon->core->window);
|
||||
wwin->icon->mapped = 0;
|
||||
|
||||
@@ -714,7 +714,7 @@ wClientGetNormalHints(WWindow *wwin, XWindowAttributes *wattribs, Bool geometry,
|
||||
wwin->normal_hints->min_width = wwin->normal_hints->max_width;
|
||||
}
|
||||
|
||||
if (/*pre_icccm && */!wwin->screen_ptr->flags.startup && geometry) {
|
||||
if (pre_icccm && !wwin->screen_ptr->flags.startup && geometry) {
|
||||
#ifdef DEBUG
|
||||
printf("PRE ICCCM\n");
|
||||
#endif
|
||||
|
||||
@@ -268,32 +268,35 @@ static WOptionEnumeration seIconPositions[] = {
|
||||
WDefaultEntry staticOptionList[] = {
|
||||
|
||||
{"DisableDithering", "NO", NULL,
|
||||
&wPreferences.no_dithering, getBool, NULL
|
||||
&wPreferences.no_dithering, getBool, NULL
|
||||
},
|
||||
{"ColormapSize", "4", NULL,
|
||||
&wPreferences.cmap_size, getInt, NULL
|
||||
&wPreferences.cmap_size, getInt, NULL
|
||||
},
|
||||
/* static by laziness */
|
||||
{"IconSize", "64", NULL,
|
||||
&wPreferences.icon_size, getInt, NULL
|
||||
&wPreferences.icon_size, getInt, NULL
|
||||
},
|
||||
{"ModifierKey", "Mod1", NULL,
|
||||
&wPreferences.modifier_mask, getModMask, NULL
|
||||
&wPreferences.modifier_mask, getModMask, NULL
|
||||
},
|
||||
{"DisableWSMouseActions", "NO", NULL,
|
||||
&wPreferences.disable_root_mouse, getBool, NULL
|
||||
&wPreferences.disable_root_mouse, getBool, NULL
|
||||
},
|
||||
{"FocusMode", "manual", seFocusModes,
|
||||
&wPreferences.focus_mode, getEnum, NULL
|
||||
&wPreferences.focus_mode, getEnum, NULL
|
||||
}, /* have a problem when switching from manual to sloppy without restart */
|
||||
{"NewStyle", "NO", NULL,
|
||||
&wPreferences.new_style, getBool, NULL
|
||||
&wPreferences.new_style, getBool, NULL
|
||||
},
|
||||
{"DisableDock", "NO", (void*) WM_DOCK,
|
||||
NULL, getBool, setIfDockPresent
|
||||
NULL, getBool, setIfDockPresent
|
||||
},
|
||||
{"DisableClip", "NO", (void*) WM_CLIP,
|
||||
NULL, getBool, setIfDockPresent
|
||||
NULL, getBool, setIfDockPresent
|
||||
},
|
||||
{"DisableMiniwindows", "NO", NULL,
|
||||
&wPreferences.disable_miniwindows, getBool, NULL
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -759,7 +759,7 @@ wIconPaint(WIcon *icon)
|
||||
int l;
|
||||
int w;
|
||||
|
||||
tmp = ShrinkString(scr->icon_title_font, icon->icon_name,
|
||||
tmp = ShrinkString(scr->icon_title_font, icon->icon_name,
|
||||
wPreferences.icon_size-4);
|
||||
w = wTextWidth(scr->icon_title_font->font, tmp, l=strlen(tmp));
|
||||
|
||||
|
||||
14
src/kwm.c
14
src/kwm.c
@@ -178,6 +178,8 @@ static Atom _XA_KWM_WIN_ICONIFIED = 0;
|
||||
static Atom _XA_KWM_WIN_MAXIMIZED = 0;
|
||||
static Atom _XA_KWM_WIN_STICKY = 0;
|
||||
|
||||
static Atom _XA_KWM_WIN_ICON_GEOMETRY = 0;
|
||||
|
||||
static Atom _XA_KWM_CURRENT_DESKTOP = 0;
|
||||
static Atom _XA_KWM_NUMBER_OF_DESKTOPS = 0;
|
||||
static Atom _XA_KWM_DESKTOP_NAME_[MAX_WORKSPACES];
|
||||
@@ -558,6 +560,9 @@ wKWMInitStuff(WScreen *scr)
|
||||
|
||||
_XA_KWM_WIN_MAXIMIZED = XInternAtom(dpy, "KWM_WIN_MAXIMIZED", False);
|
||||
|
||||
_XA_KWM_WIN_ICON_GEOMETRY = XInternAtom(dpy, "KWM_WIN_ICON_GEOMETRY",
|
||||
False);
|
||||
|
||||
_XA_KWM_COMMAND = XInternAtom(dpy, "KWM_COMMAND", False);
|
||||
|
||||
_XA_KWM_ACTIVE_WINDOW = XInternAtom(dpy, "KWM_ACTIVE_WINDOW", False);
|
||||
@@ -1517,6 +1522,15 @@ wKWMGetUsableArea(WScreen *scr, WArea *area)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Bool
|
||||
wKWMGetIconGeometry(WWindow *wwin, WArea *area)
|
||||
{
|
||||
return getAreaHint(wwin->client_win, _XA_KWM_WIN_ICON_GEOMETRY, area);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef not_used
|
||||
void
|
||||
wKWMSetUsableAreaHint(WScreen *scr, int workspace)
|
||||
|
||||
@@ -93,5 +93,7 @@ void wKWMBroadcastStacking(WScreen *scr);
|
||||
|
||||
char *wKWMGetWorkspaceName(WScreen *scr, int workspace);
|
||||
|
||||
Bool wKWMGetIconGeometry(WWindow *wwin, WArea *area);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ static char *options[] = {
|
||||
"FShadowColor",
|
||||
"PShadowColor",
|
||||
"UShadowColor",
|
||||
"MShadowColor",
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user