mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
- made deiconification not automatically focus window in sloppy focus
- fixed crash with DisableMiniwindows and icon pixmap changes - fixed crash when changing icon of window without WM_CLASS - added IAmAnnoyingAndDontWantWorkspaceNameDisplay - added hysteresys for offscreen menu scrollback - fixed bug with IgnoreFocusClick - fixed crash with windows with width == 1 (Alban Hertroys <dalroi@wit401310.student.utwente.nl>) - added SHEXEC command - fixed resizebarback for SHADOW_RESIZEBAR ( jim knoble jmknoble@pobox.com)
This commit is contained in:
10
ChangeLog
10
ChangeLog
@@ -3,6 +3,16 @@ Changes since version 0.53.0:
|
|||||||
|
|
||||||
- fixed a bug that caused icon overlaping in Clip, when icon was moved around.
|
- fixed a bug that caused icon overlaping in Clip, when icon was moved around.
|
||||||
- this time really added libwmfun to distribution.
|
- this time really added libwmfun to distribution.
|
||||||
|
- made deiconification not automatically focus window in sloppy focus
|
||||||
|
- fixed crash with DisableMiniwindows and icon pixmap changes
|
||||||
|
- fixed crash when changing icon of window without WM_CLASS
|
||||||
|
- added IAmAnnoyingAndDontWantWorkspaceNameDisplay
|
||||||
|
- added hysteresys for offscreen menu scrollback
|
||||||
|
- fixed bug with IgnoreFocusClick
|
||||||
|
- fixed crash with windows with width == 1 (Alban Hertroys
|
||||||
|
<dalroi@wit401310.student.utwente.nl>)
|
||||||
|
- added SHEXEC command
|
||||||
|
- fixed resizebarback for SHADOW_RESIZEBAR ( jim knoble jmknoble@pobox.com)
|
||||||
|
|
||||||
|
|
||||||
Changes since version 0.52.0:
|
Changes since version 0.52.0:
|
||||||
|
|||||||
34
NEWS
34
NEWS
@@ -2,15 +2,35 @@
|
|||||||
NEWS for veteran Window Maker users
|
NEWS for veteran Window Maker users
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
|
--- 0.53.1
|
||||||
|
|
||||||
|
New Option For setstyle
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
The --ignore flag will tell setstyle to not change the option that is
|
||||||
|
specified, when modifying the Window Maker configurations. For example:
|
||||||
|
|
||||||
|
setstyle --ignore MenuStyle sometheme.themed will cause the MenuStyle
|
||||||
|
option to not be changed.
|
||||||
|
|
||||||
|
setstyle --ignore FTitleBack --ignore UTitleBack --ignore PTitleBack bla.themed
|
||||||
|
will load the theme, but keep the titlebar background related options as
|
||||||
|
before.
|
||||||
|
|
||||||
|
|
||||||
|
root menu
|
||||||
|
---------
|
||||||
|
|
||||||
|
EXEC <program> will execute the named program
|
||||||
|
|
||||||
|
SHEXEC <command> will execute the shell command.
|
||||||
|
|
||||||
|
If you want to execute something like blabla > /dev/null, then use SHEXEC
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- 0.53.0
|
--- 0.53.0
|
||||||
|
|
||||||
|
|
||||||
KDE 1.1 compatibility
|
|
||||||
---------------------
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
New Options
|
New Options
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
changes since wmaker 0.53.0:
|
||||||
|
............................
|
||||||
|
|
||||||
|
- added balloon help
|
||||||
|
|
||||||
|
|
||||||
changes since wmaker 0.52.0:
|
changes since wmaker 0.52.0:
|
||||||
............................
|
............................
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ libWINGs_a_SOURCES = \
|
|||||||
selection.c \
|
selection.c \
|
||||||
userdefaults.c \
|
userdefaults.c \
|
||||||
wapplication.c \
|
wapplication.c \
|
||||||
|
wballoon.c \
|
||||||
wbrowser.c \
|
wbrowser.c \
|
||||||
wbutton.c \
|
wbutton.c \
|
||||||
wcolor.c \
|
wcolor.c \
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ wmquery_LDADD = libWINGs.a $(LIBLIST)
|
|||||||
EXTRA_DIST = logo.xpm
|
EXTRA_DIST = logo.xpm
|
||||||
|
|
||||||
# wbutton.c
|
# wbutton.c
|
||||||
libWINGs_a_SOURCES = WINGs.h WINGsP.h configuration.c llist.h llist.c international.c notification.c selection.c userdefaults.c wapplication.c wbrowser.c wbutton.c wcolor.c wcolorpanel.c wcolorwell.c wevent.c wfilepanel.c wframe.c wfont.c wfontpanel.c widgets.c wlabel.c wlist.c wmisc.c wpanel.c wpixmap.c wpopupbutton.c wscroller.c wscrollview.c wslider.c wsplitview.c wtextfield.c wwindow.c wview.c error.c findfile.c hashtable.c memory.c usleep.c
|
libWINGs_a_SOURCES = WINGs.h WINGsP.h configuration.c llist.h llist.c international.c notification.c selection.c userdefaults.c wapplication.c wballoon.c wbrowser.c wbutton.c wcolor.c wcolorpanel.c wcolorwell.c wevent.c wfilepanel.c wframe.c wfont.c wfontpanel.c widgets.c wlabel.c wlist.c wmisc.c wpanel.c wpixmap.c wpopupbutton.c wscroller.c wscrollview.c wslider.c wsplitview.c wtextfield.c wwindow.c wview.c error.c findfile.c hashtable.c memory.c usleep.c
|
||||||
|
|
||||||
|
|
||||||
INCLUDES = -I$(top_srcdir)/wrlib -I$(top_srcdir)/src -DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@ -DDEBUG
|
INCLUDES = -I$(top_srcdir)/wrlib -I$(top_srcdir)/src -DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@ -DDEBUG
|
||||||
@@ -159,12 +159,12 @@ X_LIBS = @X_LIBS@
|
|||||||
X_PRE_LIBS = @X_PRE_LIBS@
|
X_PRE_LIBS = @X_PRE_LIBS@
|
||||||
libWINGs_a_LIBADD =
|
libWINGs_a_LIBADD =
|
||||||
libWINGs_a_OBJECTS = configuration.o llist.o international.o \
|
libWINGs_a_OBJECTS = configuration.o llist.o international.o \
|
||||||
notification.o selection.o userdefaults.o wapplication.o wbrowser.o \
|
notification.o selection.o userdefaults.o wapplication.o wballoon.o \
|
||||||
wbutton.o wcolor.o wcolorpanel.o wcolorwell.o wevent.o wfilepanel.o \
|
wbrowser.o wbutton.o wcolor.o wcolorpanel.o wcolorwell.o wevent.o \
|
||||||
wframe.o wfont.o wfontpanel.o widgets.o wlabel.o wlist.o wmisc.o \
|
wfilepanel.o wframe.o wfont.o wfontpanel.o widgets.o wlabel.o wlist.o \
|
||||||
wpanel.o wpixmap.o wpopupbutton.o wscroller.o wscrollview.o wslider.o \
|
wmisc.o wpanel.o wpixmap.o wpopupbutton.o wscroller.o wscrollview.o \
|
||||||
wsplitview.o wtextfield.o wwindow.o wview.o error.o findfile.o \
|
wslider.o wsplitview.o wtextfield.o wwindow.o wview.o error.o \
|
||||||
hashtable.o memory.o usleep.o
|
findfile.o hashtable.o memory.o usleep.o
|
||||||
AR = ar
|
AR = ar
|
||||||
PROGRAMS = $(noinst_PROGRAMS)
|
PROGRAMS = $(noinst_PROGRAMS)
|
||||||
|
|
||||||
|
|||||||
@@ -108,9 +108,9 @@ GZIP_ENV = --best
|
|||||||
all: all-redirect
|
all: all-redirect
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WINGs/Resources/Makefile
|
cd $(top_srcdir) && $(AUTOMAKE) --gnu WINGs/Resources/Makefile
|
||||||
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||||
cd $(top_builddir) \
|
cd $(top_builddir) \
|
||||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||||
|
|
||||||
@@ -142,6 +142,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
|||||||
subdir = WINGs/Resources
|
subdir = WINGs/Resources
|
||||||
|
|
||||||
distdir: $(DISTFILES)
|
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 WINGs/Resources/Makefile
|
||||||
@for file in $(DISTFILES); do \
|
@for file in $(DISTFILES); do \
|
||||||
d=$(srcdir); \
|
d=$(srcdir); \
|
||||||
if test -d $$d/$$file; then \
|
if test -d $$d/$$file; then \
|
||||||
|
|||||||
@@ -639,6 +639,22 @@ extern char *WMViewSizeDidChangeNotification;
|
|||||||
|
|
||||||
extern char *WMViewRealizedNotification;
|
extern char *WMViewRealizedNotification;
|
||||||
|
|
||||||
|
|
||||||
|
/* ....................................................................... */
|
||||||
|
|
||||||
|
void WMSetBalloonTextForView(char *text, WMView *view);
|
||||||
|
|
||||||
|
void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
|
||||||
|
|
||||||
|
void WMSetBalloonFont(WMScreen *scr, WMFont *font);
|
||||||
|
|
||||||
|
void WMSetBalloonTextColor(WMScreen *scr, WMColor *color);
|
||||||
|
|
||||||
|
void WMSetBalloonDelay(WMScreen *scr, int delay);
|
||||||
|
|
||||||
|
void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
|
||||||
|
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ....................................................................... */
|
||||||
|
|
||||||
WMWindow *WMCreateWindow(WMScreen *screen, char *name);
|
WMWindow *WMCreateWindow(WMScreen *screen, char *name);
|
||||||
|
|||||||
@@ -134,7 +134,9 @@ typedef struct W_Screen {
|
|||||||
struct W_FontPanel *sharedFontPanel;
|
struct W_FontPanel *sharedFontPanel;
|
||||||
|
|
||||||
struct W_ColorPanel *sharedColorPanel;
|
struct W_ColorPanel *sharedColorPanel;
|
||||||
|
|
||||||
|
Pixmap stipple;
|
||||||
|
|
||||||
/* colors */
|
/* colors */
|
||||||
W_Color *white;
|
W_Color *white;
|
||||||
W_Color *black;
|
W_Color *black;
|
||||||
@@ -432,3 +434,8 @@ void W_FlushASAPNotificationQueue();
|
|||||||
|
|
||||||
void W_FlushIdleNotificationQueue();
|
void W_FlushIdleNotificationQueue();
|
||||||
|
|
||||||
|
struct W_Balloon *W_CreateBalloon(WMScreen *scr);
|
||||||
|
|
||||||
|
void W_BalloonHandleEnterView(WMView *view);
|
||||||
|
|
||||||
|
void W_BalloonHandleLeaveView(WMView *view);
|
||||||
|
|||||||
473
WINGs/wballoon.c
Normal file
473
WINGs/wballoon.c
Normal file
@@ -0,0 +1,473 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "WINGsP.h"
|
||||||
|
|
||||||
|
#include <X11/extensions/shape.h>
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct W_Balloon {
|
||||||
|
W_View *view;
|
||||||
|
|
||||||
|
WMHashTable *table; /* Table from view ptr to text */
|
||||||
|
|
||||||
|
WMColor *backColor;
|
||||||
|
WMColor *textColor;
|
||||||
|
WMFont *font;
|
||||||
|
|
||||||
|
WMHandlerID timer; /* timer for showing balloon */
|
||||||
|
|
||||||
|
WMHandlerID noDelayTimer;
|
||||||
|
|
||||||
|
int delay;
|
||||||
|
|
||||||
|
Window forWindow; /* window for which the balloon
|
||||||
|
* is being show in the moment */
|
||||||
|
|
||||||
|
struct {
|
||||||
|
WMAlignment alignment:2;
|
||||||
|
unsigned enabled:1;
|
||||||
|
unsigned noDelay:1;
|
||||||
|
} flags;
|
||||||
|
} Balloon;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define DEFAULT_WIDTH 60
|
||||||
|
#define DEFAULT_HEIGHT 14
|
||||||
|
#define DEFAULT_ALIGNMENT WALeft
|
||||||
|
#define DEFAULT_DELAY 500
|
||||||
|
|
||||||
|
#define NO_DELAY_DELAY 150
|
||||||
|
|
||||||
|
|
||||||
|
static void destroyBalloon(Balloon *bPtr);
|
||||||
|
|
||||||
|
|
||||||
|
static void handleEvents(XEvent *event, void *data);
|
||||||
|
|
||||||
|
static void showText(Balloon *bPtr, int x, int y, int w, int h, char *text);
|
||||||
|
|
||||||
|
|
||||||
|
struct W_Balloon*
|
||||||
|
W_CreateBalloon(WMScreen *scr)
|
||||||
|
{
|
||||||
|
Balloon *bPtr;
|
||||||
|
|
||||||
|
bPtr = wmalloc(sizeof(Balloon));
|
||||||
|
memset(bPtr, 0, sizeof(Balloon));
|
||||||
|
|
||||||
|
bPtr->view = W_CreateTopView(scr);
|
||||||
|
if (!bPtr->view) {
|
||||||
|
free(bPtr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
bPtr->view->self = bPtr;
|
||||||
|
|
||||||
|
bPtr->view->attribFlags |= CWOverrideRedirect;
|
||||||
|
bPtr->view->attribs.override_redirect = True;
|
||||||
|
|
||||||
|
bPtr->textColor = WMRetainColor(bPtr->view->screen->black);
|
||||||
|
|
||||||
|
WMCreateEventHandler(bPtr->view, StructureNotifyMask, handleEvents, bPtr);
|
||||||
|
|
||||||
|
W_ResizeView(bPtr->view, DEFAULT_WIDTH, DEFAULT_HEIGHT);
|
||||||
|
bPtr->flags.alignment = DEFAULT_ALIGNMENT;
|
||||||
|
|
||||||
|
bPtr->table = WMCreateHashTable(WMIntHashCallbacks);
|
||||||
|
|
||||||
|
bPtr->delay = DEFAULT_DELAY;
|
||||||
|
|
||||||
|
bPtr->flags.enabled = 1;
|
||||||
|
|
||||||
|
return bPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment)
|
||||||
|
{
|
||||||
|
scr->balloon->flags.alignment = alignment;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
WMSetBalloonTextForView(char *text, WMView *view)
|
||||||
|
{
|
||||||
|
char *oldText = NULL;
|
||||||
|
WMScreen *scr = view->screen;
|
||||||
|
|
||||||
|
if (text) {
|
||||||
|
oldText = WMHashInsert(scr->balloon->table, view, wstrdup(text));
|
||||||
|
} else {
|
||||||
|
oldText = WMHashGet(scr->balloon->table, view);
|
||||||
|
|
||||||
|
WMHashRemove(scr->balloon->table, view);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (oldText) {
|
||||||
|
free(oldText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
WMSetBalloonFont(WMScreen *scr, WMFont *font)
|
||||||
|
{
|
||||||
|
Balloon *bPtr = scr->balloon;
|
||||||
|
|
||||||
|
if (bPtr->font!=NULL)
|
||||||
|
WMReleaseFont(bPtr->font);
|
||||||
|
|
||||||
|
if (font)
|
||||||
|
bPtr->font = WMRetainFont(font);
|
||||||
|
else
|
||||||
|
bPtr->font = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
WMSetBalloonTextColor(WMScreen *scr, WMColor *color)
|
||||||
|
{
|
||||||
|
Balloon *bPtr = scr->balloon;
|
||||||
|
|
||||||
|
if (bPtr->textColor)
|
||||||
|
WMReleaseColor(bPtr->textColor);
|
||||||
|
|
||||||
|
bPtr->textColor = WMRetainColor(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
WMSetBalloonDelay(WMScreen *scr, int delay)
|
||||||
|
{
|
||||||
|
scr->balloon->delay = delay;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
WMSetBalloonEnabled(WMScreen *scr, Bool flag)
|
||||||
|
{
|
||||||
|
scr->balloon->flags.enabled = flag;
|
||||||
|
|
||||||
|
W_UnmapView(scr->balloon->view);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
clearNoDelay(void *data)
|
||||||
|
{
|
||||||
|
Balloon *bPtr = (Balloon*)data;
|
||||||
|
|
||||||
|
bPtr->flags.noDelay = 0;
|
||||||
|
bPtr->noDelayTimer = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
W_BalloonHandleLeaveView(WMView *view)
|
||||||
|
{
|
||||||
|
Balloon *bPtr = view->screen->balloon;
|
||||||
|
|
||||||
|
if (bPtr->view->flags.mapped && bPtr->forWindow == view->window) {
|
||||||
|
W_UnmapView(bPtr->view);
|
||||||
|
|
||||||
|
if (bPtr->timer)
|
||||||
|
WMDeleteTimerHandler(bPtr->timer);
|
||||||
|
|
||||||
|
bPtr->timer = NULL;
|
||||||
|
|
||||||
|
bPtr->noDelayTimer = WMAddTimerHandler(NO_DELAY_DELAY, clearNoDelay,
|
||||||
|
bPtr);
|
||||||
|
}
|
||||||
|
bPtr->forWindow = None;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
showBalloon(void *data)
|
||||||
|
{
|
||||||
|
char *text;
|
||||||
|
WMView *view = (WMView*)data;
|
||||||
|
Balloon *bPtr = view->screen->balloon;
|
||||||
|
int x, y;
|
||||||
|
Window foo;
|
||||||
|
|
||||||
|
bPtr->timer = NULL;
|
||||||
|
|
||||||
|
text = WMHashGet(bPtr->table, view);
|
||||||
|
if (!text)
|
||||||
|
return;
|
||||||
|
|
||||||
|
XTranslateCoordinates(view->screen->display, view->window,
|
||||||
|
view->screen->rootWin, 0, 0, &x, &y, &foo);
|
||||||
|
|
||||||
|
if (!bPtr->view->flags.realized)
|
||||||
|
W_RealizeView(bPtr->view);
|
||||||
|
|
||||||
|
showText(bPtr, x, y, view->size.width, view->size.height, text);
|
||||||
|
|
||||||
|
bPtr->forWindow = view->window;
|
||||||
|
|
||||||
|
bPtr->flags.noDelay = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
W_BalloonHandleEnterView(WMView *view)
|
||||||
|
{
|
||||||
|
Balloon *bPtr = view->screen->balloon;
|
||||||
|
char *text;
|
||||||
|
|
||||||
|
if (!bPtr->flags.enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
text = WMHashGet(bPtr->table, view);
|
||||||
|
if (!text) {
|
||||||
|
bPtr->forWindow = None;
|
||||||
|
|
||||||
|
if (bPtr->view->flags.realized)
|
||||||
|
W_UnmapView(bPtr->view);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bPtr->timer)
|
||||||
|
WMDeleteTimerHandler(bPtr->timer);
|
||||||
|
|
||||||
|
if (bPtr->noDelayTimer)
|
||||||
|
WMDeleteTimerHandler(bPtr->noDelayTimer);
|
||||||
|
bPtr->noDelayTimer = NULL;
|
||||||
|
|
||||||
|
if (bPtr->flags.noDelay) {
|
||||||
|
bPtr->timer = NULL;
|
||||||
|
|
||||||
|
showBalloon(view);
|
||||||
|
} else {
|
||||||
|
bPtr->timer = WMAddTimerHandler(bPtr->delay, showBalloon, view);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#define TOP 0
|
||||||
|
#define BOTTOM 1
|
||||||
|
#define LEFT 0
|
||||||
|
#define RIGHT 2
|
||||||
|
|
||||||
|
#define TLEFT (TOP|LEFT)
|
||||||
|
#define TRIGHT (TOP|RIGHT)
|
||||||
|
#define BLEFT (BOTTOM|LEFT)
|
||||||
|
#define BRIGHT (BOTTOM|RIGHT)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define SPACE 12
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
drawBalloon(Display *dpy, Pixmap pix, GC gc, int x, int y, int w, int h,
|
||||||
|
int side)
|
||||||
|
{
|
||||||
|
int rad = h*3/10;
|
||||||
|
XPoint pt[3];
|
||||||
|
|
||||||
|
XFillArc(dpy, pix, gc, x, y, rad, rad, 90*64, 90*64);
|
||||||
|
XFillArc(dpy, pix, gc, x, y+h-1-rad, rad, rad, 180*64, 90*64);
|
||||||
|
|
||||||
|
XFillArc(dpy, pix, gc, x+w-1-rad, y, rad, rad, 0*64, 90*64);
|
||||||
|
XFillArc(dpy, pix, gc, x+w-1-rad, y+h-1-rad, rad, rad, 270*64, 90*64);
|
||||||
|
|
||||||
|
XFillRectangle(dpy, pix, gc, x, y+rad/2, w, h-rad);
|
||||||
|
XFillRectangle(dpy, pix, gc, x+rad/2, y, w-rad, h);
|
||||||
|
|
||||||
|
if (side & BOTTOM) {
|
||||||
|
pt[0].y = y+h-1;
|
||||||
|
pt[1].y = y+h-1+SPACE;
|
||||||
|
pt[2].y = y+h-1;
|
||||||
|
} else {
|
||||||
|
pt[0].y = y;
|
||||||
|
pt[1].y = y-SPACE;
|
||||||
|
pt[2].y = y;
|
||||||
|
}
|
||||||
|
if (side & RIGHT) {
|
||||||
|
pt[0].x = x+w-h+2*h/16;
|
||||||
|
pt[1].x = x+w-h+11*h/16;
|
||||||
|
pt[2].x = x+w-h+7*h/16;
|
||||||
|
} else {
|
||||||
|
pt[0].x = x+h-2*h/16;
|
||||||
|
pt[1].x = x+h-11*h/16;
|
||||||
|
pt[2].x = x+h-7*h/16;
|
||||||
|
}
|
||||||
|
XFillPolygon(dpy, pix, gc, pt, 3, Convex, CoordModeOrigin);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static Pixmap
|
||||||
|
makePixmap(WMScreen *scr, int width, int height, int side, Pixmap *mask)
|
||||||
|
{
|
||||||
|
Display *dpy = WMScreenDisplay(scr);
|
||||||
|
Pixmap bitmap;
|
||||||
|
Pixmap pixmap;
|
||||||
|
int x, y;
|
||||||
|
WMColor *black = WMBlackColor(scr);
|
||||||
|
WMColor *white = WMWhiteColor(scr);
|
||||||
|
|
||||||
|
bitmap = XCreatePixmap(dpy, scr->rootWin, width+SPACE, height+SPACE, 1);
|
||||||
|
|
||||||
|
XSetForeground(dpy, scr->monoGC, 0);
|
||||||
|
XFillRectangle(dpy, bitmap, scr->monoGC, 0, 0, width+SPACE, height+SPACE);
|
||||||
|
|
||||||
|
pixmap = XCreatePixmap(dpy, scr->rootWin, width+SPACE, height+SPACE,
|
||||||
|
scr->depth);
|
||||||
|
|
||||||
|
XFillRectangle(dpy, pixmap, WMColorGC(black), 0, 0,
|
||||||
|
width+SPACE, height+SPACE);
|
||||||
|
|
||||||
|
if (side & BOTTOM) {
|
||||||
|
y = 0;
|
||||||
|
} else {
|
||||||
|
y = SPACE;
|
||||||
|
}
|
||||||
|
x = 0;
|
||||||
|
|
||||||
|
XSetForeground(dpy, scr->monoGC, 1);
|
||||||
|
drawBalloon(dpy, bitmap, scr->monoGC, x, y, width, height, side);
|
||||||
|
drawBalloon(dpy, pixmap, WMColorGC(white), x+1, y+1, width-2, height-2,
|
||||||
|
side);
|
||||||
|
|
||||||
|
*mask = bitmap;
|
||||||
|
|
||||||
|
WMReleaseColor(black);
|
||||||
|
WMReleaseColor(white);
|
||||||
|
|
||||||
|
return pixmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
showText(Balloon *bPtr, int x, int y, int h, int w, char *text)
|
||||||
|
{
|
||||||
|
WMScreen *scr = bPtr->view->screen;
|
||||||
|
Display *dpy = WMScreenDisplay(scr);
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
Pixmap pixmap;
|
||||||
|
Pixmap mask;
|
||||||
|
WMFont *font = bPtr->font ? bPtr->font : scr->normalFont;
|
||||||
|
int textHeight;
|
||||||
|
int side = 0;
|
||||||
|
int ty;
|
||||||
|
int bx, by;
|
||||||
|
|
||||||
|
{
|
||||||
|
int w;
|
||||||
|
char *ptr, *ptr2;
|
||||||
|
|
||||||
|
ptr = text;
|
||||||
|
width = 0;
|
||||||
|
while (ptr && ptr2) {
|
||||||
|
ptr2 = strchr(ptr, '\n');
|
||||||
|
if (ptr2) {
|
||||||
|
w = WMWidthOfString(font, ptr, ptr2 - ptr);
|
||||||
|
} else {
|
||||||
|
w = WMWidthOfString(font, ptr, strlen(ptr));
|
||||||
|
}
|
||||||
|
if (w > width)
|
||||||
|
width = w;
|
||||||
|
ptr = ptr2 + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
width += 16;
|
||||||
|
|
||||||
|
textHeight = W_GetTextHeight(font, text, width, False);
|
||||||
|
|
||||||
|
height = textHeight + 4;
|
||||||
|
|
||||||
|
if (height < 16)
|
||||||
|
height = 16;
|
||||||
|
if (width < height)
|
||||||
|
width = height;
|
||||||
|
|
||||||
|
if (x + width > scr->rootView->size.width) {
|
||||||
|
side = RIGHT;
|
||||||
|
bx = x - width + w/2;
|
||||||
|
if (bx < 0)
|
||||||
|
bx = 0;
|
||||||
|
} else {
|
||||||
|
side = LEFT;
|
||||||
|
bx = x + w/2;
|
||||||
|
}
|
||||||
|
if (bx + width > scr->rootView->size.width)
|
||||||
|
bx = scr->rootView->size.width - width;
|
||||||
|
|
||||||
|
if (y - (height + SPACE) < 0) {
|
||||||
|
side |= TOP;
|
||||||
|
by = y+h-1;
|
||||||
|
ty = SPACE;
|
||||||
|
} else {
|
||||||
|
side |= BOTTOM;
|
||||||
|
by = y - (height + SPACE);
|
||||||
|
ty = 0;
|
||||||
|
}
|
||||||
|
pixmap = makePixmap(scr, width, height, side, &mask);
|
||||||
|
|
||||||
|
W_PaintText(bPtr->view, pixmap, font, 8, ty + (height - textHeight)/2,
|
||||||
|
width, bPtr->flags.alignment,
|
||||||
|
WMColorGC(bPtr->textColor ? bPtr->textColor : scr->black),
|
||||||
|
False, text, strlen(text));
|
||||||
|
|
||||||
|
XSetWindowBackgroundPixmap(dpy, bPtr->view->window, pixmap);
|
||||||
|
|
||||||
|
W_ResizeView(bPtr->view, width, height+SPACE);
|
||||||
|
|
||||||
|
XFreePixmap(dpy, pixmap);
|
||||||
|
|
||||||
|
XShapeCombineMask(dpy, bPtr->view->window, ShapeBounding, 0, 0, mask,
|
||||||
|
ShapeSet);
|
||||||
|
XFreePixmap(dpy, mask);
|
||||||
|
|
||||||
|
W_MoveView(bPtr->view, bx, by);
|
||||||
|
|
||||||
|
W_MapView(bPtr->view);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
handleEvents(XEvent *event, void *data)
|
||||||
|
{
|
||||||
|
Balloon *bPtr = (Balloon*)data;
|
||||||
|
|
||||||
|
switch (event->type) {
|
||||||
|
case DestroyNotify:
|
||||||
|
destroyBalloon(bPtr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
destroyBalloon(Balloon *bPtr)
|
||||||
|
{
|
||||||
|
WMHashEnumerator e;
|
||||||
|
char *str;
|
||||||
|
|
||||||
|
e = WMEnumerateHashTable(bPtr->table);
|
||||||
|
|
||||||
|
while ((str = WMNextHashEnumeratorItem(&e))) {
|
||||||
|
free(str);
|
||||||
|
}
|
||||||
|
WMFreeHashTable(bPtr->table);
|
||||||
|
|
||||||
|
if (bPtr->textColor)
|
||||||
|
WMReleaseColor(bPtr->textColor);
|
||||||
|
|
||||||
|
if (bPtr->font)
|
||||||
|
WMReleaseFont(bPtr->font);
|
||||||
|
|
||||||
|
free(bPtr);
|
||||||
|
}
|
||||||
@@ -13,10 +13,12 @@ typedef struct W_Button {
|
|||||||
char *altCaption;
|
char *altCaption;
|
||||||
|
|
||||||
WMFont *font;
|
WMFont *font;
|
||||||
|
|
||||||
W_Pixmap *image;
|
W_Pixmap *image;
|
||||||
W_Pixmap *altImage;
|
W_Pixmap *altImage;
|
||||||
|
|
||||||
|
W_Pixmap *dimage;
|
||||||
|
|
||||||
void *clientData;
|
void *clientData;
|
||||||
WMAction *action;
|
WMAction *action;
|
||||||
|
|
||||||
@@ -231,14 +233,62 @@ WMCreateButton(WMWidget *parent, WMButtonType type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
updateDisabledMask(WMButton *bPtr)
|
||||||
|
{
|
||||||
|
WMScreen *scr = WMWidgetScreen(bPtr);
|
||||||
|
Display *dpy = scr->display;
|
||||||
|
|
||||||
|
if (bPtr->image) {
|
||||||
|
XGCValues gcv;
|
||||||
|
|
||||||
|
bPtr->dimage->mask = XCreatePixmap(dpy, scr->stipple,
|
||||||
|
bPtr->dimage->width,
|
||||||
|
bPtr->dimage->height, 1);
|
||||||
|
|
||||||
|
XSetForeground(dpy, scr->monoGC, 0);
|
||||||
|
XFillRectangle(dpy, bPtr->dimage->mask, scr->monoGC, 0, 0,
|
||||||
|
bPtr->dimage->width, bPtr->dimage->height);
|
||||||
|
|
||||||
|
gcv.foreground = 1;
|
||||||
|
gcv.background = 0;
|
||||||
|
gcv.stipple = scr->stipple;
|
||||||
|
gcv.fill_style = FillStippled;
|
||||||
|
gcv.clip_mask = bPtr->image->mask;
|
||||||
|
gcv.clip_x_origin = 0;
|
||||||
|
gcv.clip_y_origin = 0;
|
||||||
|
|
||||||
|
XChangeGC(dpy, scr->monoGC, GCForeground|GCBackground|GCStipple
|
||||||
|
|GCFillStyle|GCClipMask|GCClipXOrigin|GCClipYOrigin, &gcv);
|
||||||
|
|
||||||
|
XFillRectangle(dpy, bPtr->dimage->mask, scr->monoGC, 0, 0,
|
||||||
|
bPtr->dimage->width, bPtr->dimage->height);
|
||||||
|
|
||||||
|
gcv.fill_style = FillSolid;
|
||||||
|
gcv.clip_mask = None;
|
||||||
|
XChangeGC(dpy, scr->monoGC, GCFillStyle|GCClipMask, &gcv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMSetButtonImage(WMButton *bPtr, WMPixmap *image)
|
WMSetButtonImage(WMButton *bPtr, WMPixmap *image)
|
||||||
{
|
{
|
||||||
if (bPtr->image!=NULL)
|
if (bPtr->image!=NULL)
|
||||||
WMReleasePixmap(bPtr->image);
|
WMReleasePixmap(bPtr->image);
|
||||||
bPtr->image = WMRetainPixmap(image);
|
bPtr->image = WMRetainPixmap(image);
|
||||||
|
|
||||||
|
if (bPtr->dimage) {
|
||||||
|
bPtr->dimage->pixmap = None;
|
||||||
|
WMReleasePixmap(bPtr->dimage);
|
||||||
|
}
|
||||||
|
|
||||||
|
bPtr->dimage = WMCreatePixmapFromXPixmaps(WMWidgetScreen(bPtr),
|
||||||
|
image->pixmap, None,
|
||||||
|
image->width, image->height,
|
||||||
|
image->depth);
|
||||||
|
updateDisabledMask(bPtr);
|
||||||
|
|
||||||
if (bPtr->view->flags.realized) {
|
if (bPtr->view->flags.realized) {
|
||||||
paintButton(bPtr);
|
paintButton(bPtr);
|
||||||
}
|
}
|
||||||
@@ -502,7 +552,10 @@ paintButton(Button *bPtr)
|
|||||||
|
|
||||||
gc = NULL;
|
gc = NULL;
|
||||||
caption = bPtr->caption;
|
caption = bPtr->caption;
|
||||||
image = bPtr->image;
|
if (bPtr->flags.enabled)
|
||||||
|
image = bPtr->image;
|
||||||
|
else
|
||||||
|
image = bPtr->dimage;
|
||||||
offset = 0;
|
offset = 0;
|
||||||
if (bPtr->flags.bordered)
|
if (bPtr->flags.bordered)
|
||||||
relief = WRRaised;
|
relief = WRRaised;
|
||||||
@@ -689,7 +742,7 @@ destroyButton(Button *bPtr)
|
|||||||
if (bPtr->flags.addedObserver) {
|
if (bPtr->flags.addedObserver) {
|
||||||
WMRemoveNotificationObserver(bPtr);
|
WMRemoveNotificationObserver(bPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bPtr->timer)
|
if (bPtr->timer)
|
||||||
WMDeleteTimerHandler(bPtr->timer);
|
WMDeleteTimerHandler(bPtr->timer);
|
||||||
|
|
||||||
@@ -704,7 +757,13 @@ destroyButton(Button *bPtr)
|
|||||||
|
|
||||||
if (bPtr->image)
|
if (bPtr->image)
|
||||||
WMReleasePixmap(bPtr->image);
|
WMReleasePixmap(bPtr->image);
|
||||||
|
|
||||||
|
if (bPtr->dimage) {
|
||||||
|
/* yuck.. kluge */
|
||||||
|
bPtr->dimage->pixmap = None;
|
||||||
|
|
||||||
|
WMReleasePixmap(bPtr->dimage);
|
||||||
|
}
|
||||||
if (bPtr->altImage)
|
if (bPtr->altImage)
|
||||||
WMReleasePixmap(bPtr->altImage);
|
WMReleasePixmap(bPtr->altImage);
|
||||||
|
|
||||||
|
|||||||
@@ -586,7 +586,7 @@ WMHandleEvent(XEvent *event)
|
|||||||
|
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
view->screen->lastEventTime = getEventTime(view->screen, event);
|
view->screen->lastEventTime = getEventTime(view->screen, event);
|
||||||
|
|
||||||
toplevel = W_TopLevelOfView(view);
|
toplevel = W_TopLevelOfView(view);
|
||||||
@@ -637,6 +637,12 @@ WMHandleEvent(XEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* do balloon stuffs */
|
||||||
|
if (event->type == EnterNotify)
|
||||||
|
W_BalloonHandleEnterView(view);
|
||||||
|
else if (event->type == LeaveNotify)
|
||||||
|
W_BalloonHandleLeaveView(view);
|
||||||
|
|
||||||
/* This is a hack. It will make the panel be secure while
|
/* This is a hack. It will make the panel be secure while
|
||||||
* the event handlers are handled, as some event handler
|
* the event handlers are handled, as some event handler
|
||||||
* might destroy the widget. */
|
* might destroy the widget. */
|
||||||
|
|||||||
@@ -297,10 +297,9 @@ static char *CHECK_MARK[] = {
|
|||||||
"#%======="};
|
"#%======="};
|
||||||
|
|
||||||
|
|
||||||
#define STIPPLE_WIDTH 8
|
#define STIPPLE_WIDTH 2
|
||||||
#define STIPPLE_HEIGHT 8
|
#define STIPPLE_HEIGHT 2
|
||||||
static unsigned char STIPPLE_BITS[] = {
|
static unsigned char STIPPLE_BITS[] = {0x01, 0x02};
|
||||||
0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa};
|
|
||||||
|
|
||||||
|
|
||||||
extern void W_ReadConfigurations(void);
|
extern void W_ReadConfigurations(void);
|
||||||
@@ -632,9 +631,8 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
|
|||||||
/* we need a 1bpp drawable for the monoGC, so borrow this one */
|
/* we need a 1bpp drawable for the monoGC, so borrow this one */
|
||||||
scrPtr->monoGC = XCreateGC(display, stipple, 0, NULL);
|
scrPtr->monoGC = XCreateGC(display, stipple, 0, NULL);
|
||||||
|
|
||||||
XFreePixmap(display, stipple);
|
scrPtr->stipple = stipple;
|
||||||
|
|
||||||
|
|
||||||
scrPtr->normalFont = WMSystemFontOfSize(scrPtr, 12);
|
scrPtr->normalFont = WMSystemFontOfSize(scrPtr, 12);
|
||||||
|
|
||||||
scrPtr->boldFont = WMBoldSystemFontOfSize(scrPtr, 12);
|
scrPtr->boldFont = WMBoldSystemFontOfSize(scrPtr, 12);
|
||||||
@@ -741,6 +739,10 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
|
|||||||
|
|
||||||
scrPtr->rootView = W_CreateRootView(scrPtr);
|
scrPtr->rootView = W_CreateRootView(scrPtr);
|
||||||
|
|
||||||
|
|
||||||
|
scrPtr->balloon = W_CreateBalloon(scrPtr);
|
||||||
|
|
||||||
|
|
||||||
W_InitApplication(scrPtr);
|
W_InitApplication(scrPtr);
|
||||||
|
|
||||||
return scrPtr;
|
return scrPtr;
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y,
|
|||||||
void
|
void
|
||||||
W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font,
|
W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font,
|
||||||
WMReliefType relief, char *text,
|
WMReliefType relief, char *text,
|
||||||
WMAlignment alignment, W_Pixmap *image,
|
WMAlignment alignment, W_Pixmap *image,
|
||||||
WMImagePosition position, GC backGC, int ofs)
|
WMImagePosition position, GC backGC, int ofs)
|
||||||
{
|
{
|
||||||
W_Screen *screen = view->screen;
|
W_Screen *screen = view->screen;
|
||||||
@@ -264,7 +264,7 @@ W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font,
|
|||||||
|
|
||||||
ix += ofs;
|
ix += ofs;
|
||||||
iy += ofs;
|
iy += ofs;
|
||||||
|
|
||||||
XSetClipOrigin(screen->display, screen->clipGC, ix, iy);
|
XSetClipOrigin(screen->display, screen->clipGC, ix, iy);
|
||||||
XSetClipMask(screen->display, screen->clipGC, image->mask);
|
XSetClipMask(screen->display, screen->clipGC, image->mask);
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ WMReleasePixmap(WMPixmap *pixmap)
|
|||||||
pixmap->refCount--;
|
pixmap->refCount--;
|
||||||
|
|
||||||
if (pixmap->refCount<1) {
|
if (pixmap->refCount<1) {
|
||||||
XFreePixmap(pixmap->screen->display, pixmap->pixmap);
|
if (pixmap->pixmap)
|
||||||
|
XFreePixmap(pixmap->screen->display, pixmap->pixmap);
|
||||||
if (pixmap->mask)
|
if (pixmap->mask)
|
||||||
XFreePixmap(pixmap->screen->display, pixmap->mask);
|
XFreePixmap(pixmap->screen->display, pixmap->mask);
|
||||||
free(pixmap);
|
free(pixmap);
|
||||||
|
|||||||
@@ -143,6 +143,8 @@ testGradientButtons(WMScreen *scr)
|
|||||||
WMSetButtonAltImage(btn, pix2);
|
WMSetButtonAltImage(btn, pix2);
|
||||||
WMSetButtonText(btn, "Cool");
|
WMSetButtonText(btn, "Cool");
|
||||||
|
|
||||||
|
WMSetBalloonTextForView("This is a button", WMWidgetView(btn));
|
||||||
|
|
||||||
btn = WMCreateButton(win, WBTMomentaryChange);
|
btn = WMCreateButton(win, WBTMomentaryChange);
|
||||||
WMResizeWidget(btn, 60, 24);
|
WMResizeWidget(btn, 60, 24);
|
||||||
WMMoveWidget(btn, 90, 100);
|
WMMoveWidget(btn, 90, 100);
|
||||||
@@ -152,6 +154,8 @@ testGradientButtons(WMScreen *scr)
|
|||||||
WMSetButtonAltImage(btn, pix2);
|
WMSetButtonAltImage(btn, pix2);
|
||||||
WMSetButtonText(btn, "Button");
|
WMSetButtonText(btn, "Button");
|
||||||
|
|
||||||
|
WMSetBalloonTextForView("This is another button", WMWidgetView(btn));
|
||||||
|
|
||||||
btn = WMCreateButton(win, WBTMomentaryChange);
|
btn = WMCreateButton(win, WBTMomentaryChange);
|
||||||
WMResizeWidget(btn, 60, 24);
|
WMResizeWidget(btn, 60, 24);
|
||||||
WMMoveWidget(btn, 160, 100);
|
WMMoveWidget(btn, 160, 100);
|
||||||
@@ -160,7 +164,10 @@ testGradientButtons(WMScreen *scr)
|
|||||||
WMSetButtonImage(btn, pix1);
|
WMSetButtonImage(btn, pix1);
|
||||||
WMSetButtonAltImage(btn, pix2);
|
WMSetButtonAltImage(btn, pix2);
|
||||||
WMSetButtonText(btn, "Test");
|
WMSetButtonText(btn, "Test");
|
||||||
|
|
||||||
|
WMSetBalloonTextForView("This is yet another button.\nBut the balloon has 3 lines.\nYay!",
|
||||||
|
WMWidgetView(btn));
|
||||||
|
|
||||||
WMRealizeWidget(win);
|
WMRealizeWidget(win);
|
||||||
WMMapSubwidgets(win);
|
WMMapSubwidgets(win);
|
||||||
WMMapWidget(win);
|
WMMapWidget(win);
|
||||||
@@ -409,15 +416,17 @@ int main(int argc, char **argv)
|
|||||||
*
|
*
|
||||||
* Put the testSomething() function you want to test here.
|
* Put the testSomething() function you want to test here.
|
||||||
*/
|
*/
|
||||||
|
testGradientButtons(scr);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
testOpenFilePanel(scr);
|
testOpenFilePanel(scr);
|
||||||
testFontPanel(scr);
|
testFontPanel(scr);
|
||||||
testList(scr);
|
testList(scr);
|
||||||
testGradientButtons(scr);
|
testGradientButtons(scr);
|
||||||
testScrollView(scr);
|
testScrollView(scr);
|
||||||
#endif
|
|
||||||
testColorWell(scr);
|
testColorWell(scr);
|
||||||
#if 1
|
|
||||||
testSlider(scr);
|
testSlider(scr);
|
||||||
testTextField(scr);
|
testTextField(scr);
|
||||||
testPullDown(scr);
|
testPullDown(scr);
|
||||||
|
|||||||
@@ -102,43 +102,6 @@ adoptChildView(W_View *view, W_View *child)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
handleEvents(XEvent *event, void *data)
|
|
||||||
{
|
|
||||||
W_View *view = (W_View*)data;
|
|
||||||
|
|
||||||
if (event->type == ConfigureNotify) {
|
|
||||||
|
|
||||||
if (event->xconfigure.width != view->size.width
|
|
||||||
|| event->xconfigure.height != view->size.height) {
|
|
||||||
|
|
||||||
view->size.width = event->xconfigure.width;
|
|
||||||
view->size.height = event->xconfigure.height;
|
|
||||||
|
|
||||||
if (view->flags.notifySizeChanged) {
|
|
||||||
WMPostNotificationName(WMViewSizeDidChangeNotification,
|
|
||||||
view, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (event->xconfigure.x != view->pos.x
|
|
||||||
|| event->xconfigure.y != view->pos.y) {
|
|
||||||
|
|
||||||
if (event->xconfigure.send_event) {
|
|
||||||
view->pos.x = event->xconfigure.x;
|
|
||||||
view->pos.y = event->xconfigure.y;
|
|
||||||
} else {
|
|
||||||
Window foo;
|
|
||||||
|
|
||||||
XTranslateCoordinates(view->screen->display,
|
|
||||||
view->window, view->screen->rootWin,
|
|
||||||
event->xconfigure.x, event->xconfigure.y,
|
|
||||||
&view->pos.x, &view->pos.y, &foo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static W_View*
|
static W_View*
|
||||||
createView(W_Screen *screen, W_View *parent)
|
createView(W_Screen *screen, W_View *parent)
|
||||||
{
|
{
|
||||||
@@ -213,9 +176,6 @@ W_CreateTopView(W_Screen *screen)
|
|||||||
view->flags.topLevel = 1;
|
view->flags.topLevel = 1;
|
||||||
view->attribs.event_mask |= StructureNotifyMask;
|
view->attribs.event_mask |= StructureNotifyMask;
|
||||||
|
|
||||||
/* catch changes in the toplevel window (resize from user etc.) */
|
|
||||||
WMCreateEventHandler(view, StructureNotifyMask, handleEvents, view);
|
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -172,8 +172,8 @@ WMCreateWindowWithStyle(WMScreen *screen, char *name, int style)
|
|||||||
screen->windowList = win;
|
screen->windowList = win;
|
||||||
|
|
||||||
WMCreateEventHandler(win->view, ExposureMask|StructureNotifyMask
|
WMCreateEventHandler(win->view, ExposureMask|StructureNotifyMask
|
||||||
|ClientMessageMask|FocusChangeMask, handleEvents,
|
|ClientMessageMask|FocusChangeMask,
|
||||||
win);
|
handleEvents, win);
|
||||||
|
|
||||||
W_ResizeView(win->view, DEFAULT_WIDTH, DEFAULT_HEIGHT);
|
W_ResizeView(win->view, DEFAULT_WIDTH, DEFAULT_HEIGHT);
|
||||||
|
|
||||||
@@ -616,6 +616,7 @@ static void
|
|||||||
handleEvents(XEvent *event, void *clientData)
|
handleEvents(XEvent *event, void *clientData)
|
||||||
{
|
{
|
||||||
_Window *win = (_Window*)clientData;
|
_Window *win = (_Window*)clientData;
|
||||||
|
W_View *view = win->view;
|
||||||
|
|
||||||
|
|
||||||
switch (event->type) {
|
switch (event->type) {
|
||||||
@@ -629,12 +630,43 @@ handleEvents(XEvent *event, void *clientData)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UnmapNotify:
|
case UnmapNotify:
|
||||||
WMUnmapWidget(win);
|
WMUnmapWidget(win);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DestroyNotify:
|
case DestroyNotify:
|
||||||
destroyWindow(win);
|
destroyWindow(win);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ConfigureNotify:
|
||||||
|
if (event->xconfigure.width != view->size.width
|
||||||
|
|| event->xconfigure.height != view->size.height) {
|
||||||
|
|
||||||
|
view->size.width = event->xconfigure.width;
|
||||||
|
view->size.height = event->xconfigure.height;
|
||||||
|
|
||||||
|
if (view->flags.notifySizeChanged) {
|
||||||
|
WMPostNotificationName(WMViewSizeDidChangeNotification,
|
||||||
|
view, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (event->xconfigure.x != view->pos.x
|
||||||
|
|| event->xconfigure.y != view->pos.y) {
|
||||||
|
|
||||||
|
if (event->xconfigure.send_event) {
|
||||||
|
view->pos.x = event->xconfigure.x;
|
||||||
|
view->pos.y = event->xconfigure.y;
|
||||||
|
} else {
|
||||||
|
Window foo;
|
||||||
|
|
||||||
|
XTranslateCoordinates(view->screen->display,
|
||||||
|
view->window, view->screen->rootWin,
|
||||||
|
event->xconfigure.x, event->xconfigure.y,
|
||||||
|
&view->pos.x, &view->pos.y, &foo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -101,23 +101,25 @@ enum {
|
|||||||
|
|
||||||
enum {
|
enum {
|
||||||
CpExec = 0,
|
CpExec = 0,
|
||||||
CpArrange = 1,
|
CpShExec = 1,
|
||||||
CpHide = 2,
|
CpArrange = 2,
|
||||||
CpShow = 3,
|
CpHide = 3,
|
||||||
CpExit = 4,
|
CpShow = 4,
|
||||||
CpShutdown = 5,
|
CpExit = 5,
|
||||||
CpRestart = 6,
|
CpShutdown = 6,
|
||||||
CpRestartWM = 7,
|
CpRestart = 7,
|
||||||
CpSaveSession = 8,
|
CpRestartWM = 8,
|
||||||
CpClearSession = 9,
|
CpSaveSession = 9,
|
||||||
CpRefresh = 10,
|
CpClearSession = 10,
|
||||||
CpInfo = 11,
|
CpRefresh = 11,
|
||||||
CpLegal = 12
|
CpInfo = 12,
|
||||||
|
CpLegal = 13
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
TNothing,
|
TNothing,
|
||||||
TExec,
|
TExec,
|
||||||
|
TShExec,
|
||||||
TSimpleCommand,
|
TSimpleCommand,
|
||||||
TRestart,
|
TRestart,
|
||||||
TRestartWM,
|
TRestartWM,
|
||||||
@@ -375,7 +377,8 @@ updateForItemType(_Panel *panel, int type)
|
|||||||
} else {
|
} else {
|
||||||
WMMapWidget(panel->shoF);
|
WMMapWidget(panel->shoF);
|
||||||
}
|
}
|
||||||
if (type==TExec || type==TRestart || type==TExternalMenu) {
|
if (type==TExec || type == TShExec || type==TRestart
|
||||||
|
|| type==TExternalMenu) {
|
||||||
WMMapWidget(panel->proF);
|
WMMapWidget(panel->proF);
|
||||||
} else {
|
} else {
|
||||||
WMUnmapWidget(panel->proF);
|
WMUnmapWidget(panel->proF);
|
||||||
@@ -403,7 +406,9 @@ updateForItemType(_Panel *panel, int type)
|
|||||||
if (type == TRestart) {
|
if (type == TRestart) {
|
||||||
WMSetFrameTitle(panel->proF, _("Window Manager"));
|
WMSetFrameTitle(panel->proF, _("Window Manager"));
|
||||||
} else if (type == TExternalMenu) {
|
} else if (type == TExternalMenu) {
|
||||||
WMSetFrameTitle(panel->proF, _("Program to open files"));
|
WMSetFrameTitle(panel->proF, _("Program to Open Files"));
|
||||||
|
} else if (type == TShExec) {
|
||||||
|
WMSetFrameTitle(panel->proF, _("Command to Execute"));
|
||||||
} else {
|
} else {
|
||||||
WMSetFrameTitle(panel->proF, _("Program to Run"));
|
WMSetFrameTitle(panel->proF, _("Program to Run"));
|
||||||
}
|
}
|
||||||
@@ -623,6 +628,10 @@ browserClick(WMWidget *w, void *data)
|
|||||||
WMSetTextFieldText(panel->proT, getItemParameter(item));
|
WMSetTextFieldText(panel->proT, getItemParameter(item));
|
||||||
WMSetPopUpButtonSelectedItem(panel->cmdP, CpExec);
|
WMSetPopUpButtonSelectedItem(panel->cmdP, CpExec);
|
||||||
updateForItemType(panel, TExec);
|
updateForItemType(panel, TExec);
|
||||||
|
} else if (strcmp(command, "SHEXEC")==0) {
|
||||||
|
WMSetTextFieldText(panel->proT, getItemParameter(item));
|
||||||
|
WMSetPopUpButtonSelectedItem(panel->cmdP, CpShExec);
|
||||||
|
updateForItemType(panel, TShExec);
|
||||||
} else if (strcmp(command, "WORKSPACE_MENU")==0) {
|
} else if (strcmp(command, "WORKSPACE_MENU")==0) {
|
||||||
updateForItemType(panel, TWSMenu);
|
updateForItemType(panel, TWSMenu);
|
||||||
} else if (strcmp(command, "EXIT")==0) {
|
} else if (strcmp(command, "EXIT")==0) {
|
||||||
@@ -733,7 +742,8 @@ changedItem(void *observerData, WMNotification *notification)
|
|||||||
litem->text = str;
|
litem->text = str;
|
||||||
|
|
||||||
WMRedisplayWidget(list);
|
WMRedisplayWidget(list);
|
||||||
} else if (strcmp(command, "EXEC")==0
|
} else if (strcmp(command, "EXEC")==0
|
||||||
|
|| strcmp(command, "SHEXEC")==0
|
||||||
|| strcmp(command, "RESTART")==0) {
|
|| strcmp(command, "RESTART")==0) {
|
||||||
if (t == panel->proT) {
|
if (t == panel->proT) {
|
||||||
str = WMGetTextFieldText(t);
|
str = WMGetTextFieldText(t);
|
||||||
@@ -821,6 +831,15 @@ changedCommand(WMWidget *w, void *data)
|
|||||||
updateForItemType(panel, TExec);
|
updateForItemType(panel, TExec);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case CpShExec:
|
||||||
|
if (strcmp(getItemCommand(panel->editedItem), "SHEXEC")!=0) {
|
||||||
|
changeItemCommand(panel->editedItem, "SHEXEC");
|
||||||
|
tmp = WMGetTextFieldText(panel->proT);
|
||||||
|
changeItemParameter(panel->editedItem, tmp);
|
||||||
|
free(tmp);
|
||||||
|
updateForItemType(panel, TShExec);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case CpArrange:
|
case CpArrange:
|
||||||
if (strcmp(getItemCommand(panel->editedItem), "ARRANGE_ICONS")!=0) {
|
if (strcmp(getItemCommand(panel->editedItem), "ARRANGE_ICONS")!=0) {
|
||||||
changeItemCommand(panel->editedItem, "ARRANGE_ICONS");
|
changeItemCommand(panel->editedItem, "ARRANGE_ICONS");
|
||||||
@@ -993,7 +1012,6 @@ scrolledBrowser(void *observerData, WMNotification *notification)
|
|||||||
{
|
{
|
||||||
_Panel *panel = (_Panel*)observerData;
|
_Panel *panel = (_Panel*)observerData;
|
||||||
int column;
|
int column;
|
||||||
WMList *list;
|
|
||||||
proplist_t item;
|
proplist_t item;
|
||||||
|
|
||||||
column = WMGetBrowserFirstVisibleColumn(panel->browser);
|
column = WMGetBrowserFirstVisibleColumn(panel->browser);
|
||||||
@@ -1132,12 +1150,13 @@ createPanel(_Panel *p)
|
|||||||
WMResizeWidget(panel->cmdP, 170, 20);
|
WMResizeWidget(panel->cmdP, 170, 20);
|
||||||
WMMoveWidget(panel->cmdP, 10, 20);
|
WMMoveWidget(panel->cmdP, 10, 20);
|
||||||
WMAddPopUpButtonItem(panel->cmdP, _("Run Program"));
|
WMAddPopUpButtonItem(panel->cmdP, _("Run Program"));
|
||||||
|
WMAddPopUpButtonItem(panel->cmdP, _("Execute Shell Command"));
|
||||||
WMAddPopUpButtonItem(panel->cmdP, _("Arrange Icons"));
|
WMAddPopUpButtonItem(panel->cmdP, _("Arrange Icons"));
|
||||||
WMAddPopUpButtonItem(panel->cmdP, _("Hide Others"));
|
WMAddPopUpButtonItem(panel->cmdP, _("Hide Others"));
|
||||||
WMAddPopUpButtonItem(panel->cmdP, _("Show All Windows"));
|
WMAddPopUpButtonItem(panel->cmdP, _("Show All Windows"));
|
||||||
WMAddPopUpButtonItem(panel->cmdP, _("Exit WindowMaker"));
|
WMAddPopUpButtonItem(panel->cmdP, _("Exit WindowMaker"));
|
||||||
WMAddPopUpButtonItem(panel->cmdP, _("Exit X Session"));
|
WMAddPopUpButtonItem(panel->cmdP, _("Exit X Session"));
|
||||||
WMAddPopUpButtonItem(panel->cmdP, _("Start window manager"));
|
WMAddPopUpButtonItem(panel->cmdP, _("Start Window Manager"));
|
||||||
WMAddPopUpButtonItem(panel->cmdP, _("Restart WindowMaker"));
|
WMAddPopUpButtonItem(panel->cmdP, _("Restart WindowMaker"));
|
||||||
WMAddPopUpButtonItem(panel->cmdP, _("Save Session"));
|
WMAddPopUpButtonItem(panel->cmdP, _("Save Session"));
|
||||||
WMAddPopUpButtonItem(panel->cmdP, _("Clear Session"));
|
WMAddPopUpButtonItem(panel->cmdP, _("Clear Session"));
|
||||||
|
|||||||
@@ -303,7 +303,8 @@ createMainWindow(WMScreen *scr)
|
|||||||
WMResizeWidget(WPrefs.versionL, FRAME_WIDTH-20, 20);
|
WMResizeWidget(WPrefs.versionL, FRAME_WIDTH-20, 20);
|
||||||
WMMoveWidget(WPrefs.versionL, 10, 65);
|
WMMoveWidget(WPrefs.versionL, 10, 65);
|
||||||
WMSetLabelTextAlignment(WPrefs.versionL, WACenter);
|
WMSetLabelTextAlignment(WPrefs.versionL, WACenter);
|
||||||
sprintf(buffer, _("Version %s for Window Maker %s"), WVERSION, WMVERSION);
|
sprintf(buffer, _("Version %s for Window Maker %s or newer"), WVERSION,
|
||||||
|
WMVERSION);
|
||||||
WMSetLabelText(WPrefs.versionL, buffer);
|
WMSetLabelText(WPrefs.versionL, buffer);
|
||||||
|
|
||||||
WPrefs.statusL = WMCreateLabel(WPrefs.banner);
|
WPrefs.statusL = WMCreateLabel(WPrefs.banner);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
/****/
|
/****/
|
||||||
|
|
||||||
#define WVERSION "0.31"
|
#define WVERSION "0.31"
|
||||||
#define WMVERSION "0.52.x"
|
#define WMVERSION "0.53.x"
|
||||||
|
|
||||||
|
|
||||||
extern char *NOptionValueChanged;
|
extern char *NOptionValueChanged;
|
||||||
|
|||||||
@@ -120,9 +120,9 @@ all: all-redirect
|
|||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
.SUFFIXES: .mo .po
|
.SUFFIXES: .mo .po
|
||||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
$(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) \
|
cd $(top_builddir) \
|
||||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||||
|
|
||||||
@@ -135,6 +135,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
|||||||
subdir = WPrefs.app/po
|
subdir = WPrefs.app/po
|
||||||
|
|
||||||
distdir: $(DISTFILES)
|
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 \
|
@for file in $(DISTFILES); do \
|
||||||
d=$(srcdir); \
|
d=$(srcdir); \
|
||||||
if test -d $$d/$$file; then \
|
if test -d $$d/$$file; then \
|
||||||
|
|||||||
@@ -109,9 +109,9 @@ GZIP_ENV = --best
|
|||||||
all: all-redirect
|
all: all-redirect
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
$(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) \
|
cd $(top_builddir) \
|
||||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||||
|
|
||||||
@@ -143,6 +143,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
|||||||
subdir = WPrefs.app/xpm
|
subdir = WPrefs.app/xpm
|
||||||
|
|
||||||
distdir: $(DISTFILES)
|
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 \
|
@for file in $(DISTFILES); do \
|
||||||
d=$(srcdir); \
|
d=$(srcdir); \
|
||||||
if test -d $$d/$$file; then \
|
if test -d $$d/$$file; then \
|
||||||
|
|||||||
@@ -100,6 +100,6 @@
|
|||||||
("Start BlackBox", RESTART, blackbox),
|
("Start BlackBox", RESTART, blackbox),
|
||||||
("Start kwm", RESTART, kwm),
|
("Start kwm", RESTART, kwm),
|
||||||
("Start IceWM", RESTART, icewm),
|
("Start IceWM", RESTART, icewm),
|
||||||
("Exit...", EXIT),
|
("Exit...", EXIT)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ AC_INIT(src/WindowMaker.h)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE(WindowMaker, 0.53.0)
|
AM_INIT_AUTOMAKE(WindowMaker, 0.53.1)
|
||||||
|
|
||||||
AM_PROG_LIBTOOL
|
AM_PROG_LIBTOOL
|
||||||
|
|
||||||
@@ -319,7 +319,7 @@ dnl
|
|||||||
dnl Disable some stuff that are duplicated in kde
|
dnl Disable some stuff that are duplicated in kde
|
||||||
dnl ---------------------------------------------
|
dnl ---------------------------------------------
|
||||||
AC_ARG_ENABLE(lite,
|
AC_ARG_ENABLE(lite,
|
||||||
[ --enable-lite disable stuff duplicated in KDE/GNOME ],
|
[ --enable-lite disable some stuff (dont use it) ],
|
||||||
[if test x$enableval = xyes; then
|
[if test x$enableval = xyes; then
|
||||||
LITE=yes
|
LITE=yes
|
||||||
AC_DEFINE(LITE)
|
AC_DEFINE(LITE)
|
||||||
|
|||||||
@@ -369,6 +369,9 @@ typedef struct WPreferences {
|
|||||||
char window_balloon;
|
char window_balloon;
|
||||||
char miniwin_balloon;
|
char miniwin_balloon;
|
||||||
char appicon_balloon;
|
char appicon_balloon;
|
||||||
|
|
||||||
|
char no_workspace_name_display;
|
||||||
|
|
||||||
#ifdef WEENDOZE_CYCLE
|
#ifdef WEENDOZE_CYCLE
|
||||||
char windoze_cycling; /* Windoze 95 style Alt+Tabbing */
|
char windoze_cycling; /* Windoze 95 style Alt+Tabbing */
|
||||||
char popup_switchmenu; /* Popup the switchmenu when Alt+Tabbing */
|
char popup_switchmenu; /* Popup the switchmenu when Alt+Tabbing */
|
||||||
|
|||||||
@@ -1150,9 +1150,9 @@ wDeiconifyWindow(WWindow *wwin)
|
|||||||
wwin->icon = NULL;
|
wwin->icon = NULL;
|
||||||
}
|
}
|
||||||
XUngrabServer(dpy);
|
XUngrabServer(dpy);
|
||||||
if (wPreferences.focus_mode==WKF_CLICK
|
|
||||||
|| wPreferences.focus_mode==WKF_SLOPPY)
|
if (wPreferences.focus_mode==WKF_CLICK)
|
||||||
wSetFocusTo(wwin->screen_ptr, wwin);
|
wSetFocusTo(wwin->screen_ptr, wwin);
|
||||||
|
|
||||||
#ifdef ANIMATIONS
|
#ifdef ANIMATIONS
|
||||||
if (!wwin->screen_ptr->flags.startup) {
|
if (!wwin->screen_ptr->flags.startup) {
|
||||||
|
|||||||
@@ -492,7 +492,7 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event)
|
|||||||
|| (wwin->wm_hints->flags & IconWindowHint)) {
|
|| (wwin->wm_hints->flags & IconWindowHint)) {
|
||||||
WApplication *wapp;
|
WApplication *wapp;
|
||||||
|
|
||||||
if (wwin->flags.miniaturized) {
|
if (wwin->flags.miniaturized && wwin->icon) {
|
||||||
wIconUpdate(wwin->icon);
|
wIconUpdate(wwin->icon);
|
||||||
}
|
}
|
||||||
wapp = wApplicationOf(wwin->main_window);
|
wapp = wApplicationOf(wwin->main_window);
|
||||||
|
|||||||
@@ -387,6 +387,9 @@ WDefaultEntry optionList[] = {
|
|||||||
{"CycleWorkspaces", "NO", NULL,
|
{"CycleWorkspaces", "NO", NULL,
|
||||||
&wPreferences.ws_cycle, getBool, NULL
|
&wPreferences.ws_cycle, getBool, NULL
|
||||||
},
|
},
|
||||||
|
{"IAmAnnoyingAndDontWantWorkspaceNameDisplay", "NO",NULL,
|
||||||
|
&wPreferences.no_workspace_name_display, getBool, NULL
|
||||||
|
},
|
||||||
{"StickyIcons", "NO", NULL,
|
{"StickyIcons", "NO", NULL,
|
||||||
&wPreferences.sticky_icons, getBool, setStickyIcons
|
&wPreferences.sticky_icons, getBool, setStickyIcons
|
||||||
},
|
},
|
||||||
@@ -522,7 +525,7 @@ WDefaultEntry optionList[] = {
|
|||||||
{"DisplayFont", DEF_INFO_TEXT_FONT, NULL,
|
{"DisplayFont", DEF_INFO_TEXT_FONT, NULL,
|
||||||
NULL, getFont, setDisplayFont
|
NULL, getFont, setDisplayFont
|
||||||
},
|
},
|
||||||
{"LargeDisplayFont" DEF_WORKSPACE_NAME_FONT, NULL,
|
{"LargeDisplayFont",DEF_WORKSPACE_NAME_FONT, NULL,
|
||||||
NULL, getFont, setLargeDisplayFont
|
NULL, getFont, setLargeDisplayFont
|
||||||
},
|
},
|
||||||
{"HighlightColor", "white", NULL,
|
{"HighlightColor", "white", NULL,
|
||||||
|
|||||||
@@ -496,7 +496,7 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
|
|||||||
if (tmp && (instance || class))
|
if (tmp && (instance || class))
|
||||||
sprintf(tmp, "%s [%s.%s]", _("Icon Chooser"), instance, class);
|
sprintf(tmp, "%s [%s.%s]", _("Icon Chooser"), instance, class);
|
||||||
else
|
else
|
||||||
tmp = _("Icon Chooser");
|
strcpy(tmp, _("Icon Chooser"));
|
||||||
|
|
||||||
wwin = wManageInternalWindow(scr, parent, None, tmp,
|
wwin = wManageInternalWindow(scr, parent, None, tmp,
|
||||||
(scr->scr_width - 450)/2,
|
(scr->scr_width - 450)/2,
|
||||||
|
|||||||
@@ -579,11 +579,21 @@ renderResizebarTexture(WScreen *scr, WTexture *texture, int width, int height,
|
|||||||
ROperateLine(img, RSubtractOperation, cwidth, 2, cwidth, height-1, &dark);
|
ROperateLine(img, RSubtractOperation, cwidth, 2, cwidth, height-1, &dark);
|
||||||
ROperateLine(img, RAddOperation, cwidth+1, 2, cwidth+1, height-1, &light);
|
ROperateLine(img, RAddOperation, cwidth+1, 2, cwidth+1, height-1, &light);
|
||||||
|
|
||||||
ROperateLine(img, RSubtractOperation, width-cwidth-2, 2, width-cwidth-2,
|
if (width > 1)
|
||||||
height-1, &dark);
|
ROperateLine(img, RSubtractOperation, width-cwidth-2, 2,
|
||||||
|
width-cwidth-2, height-1, &dark);
|
||||||
ROperateLine(img, RAddOperation, width-cwidth-1, 2, width-cwidth-1,
|
ROperateLine(img, RAddOperation, width-cwidth-1, 2, width-cwidth-1,
|
||||||
height-1, &light);
|
height-1, &light);
|
||||||
|
|
||||||
|
#ifdef SHADOW_RESIZEBAR
|
||||||
|
ROperateLine(img, RAddOperation, 0, 1, 0, height-1, &light);
|
||||||
|
ROperateLine(img, RSubtractOperation, width-1, 1, width-1, height-1,
|
||||||
|
&dark);
|
||||||
|
ROperateLine(img, RSubtractOperation, 0, height-1, width-1, height-1,
|
||||||
|
&dark);
|
||||||
|
#endif /* SHADOW_RESIZEBAR */
|
||||||
|
|
||||||
|
|
||||||
if (!RConvertImage(scr->rcontext, img, pmap)) {
|
if (!RConvertImage(scr->rcontext, img, pmap)) {
|
||||||
wwarning(_("error rendering image: %s"), RMessageForError(RErrorCode));
|
wwarning(_("error rendering image: %s"), RMessageForError(RErrorCode));
|
||||||
}
|
}
|
||||||
|
|||||||
10
src/menu.c
10
src/menu.c
@@ -1796,9 +1796,9 @@ wMenuScroll(WMenu *menu, XEvent *event)
|
|||||||
|
|
||||||
WMNextEvent(dpy, &ev);
|
WMNextEvent(dpy, &ev);
|
||||||
switch (ev.type) {
|
switch (ev.type) {
|
||||||
case EnterNotify:
|
case EnterNotify:
|
||||||
WMHandleEvent(&ev);
|
WMHandleEvent(&ev);
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
x = (ev.type==MotionNotify) ? ev.xmotion.x_root : ev.xcrossing.x_root;
|
x = (ev.type==MotionNotify) ? ev.xmotion.x_root : ev.xcrossing.x_root;
|
||||||
y = (ev.type==MotionNotify) ? ev.xmotion.y_root : ev.xcrossing.y_root;
|
y = (ev.type==MotionNotify) ? ev.xmotion.y_root : ev.xcrossing.y_root;
|
||||||
|
|
||||||
@@ -1938,8 +1938,7 @@ menuMouseDown(WObjDescriptor *desc, XEvent *event)
|
|||||||
smenu = parentMenu(menu);
|
smenu = parentMenu(menu);
|
||||||
old_frame_x = smenu->frame_x;
|
old_frame_x = smenu->frame_x;
|
||||||
old_frame_y = smenu->frame_y;
|
old_frame_y = smenu->frame_y;
|
||||||
}
|
} else if (event->xbutton.window == menu->frame->core->window) {
|
||||||
else if (event->xbutton.window == menu->frame->core->window) {
|
|
||||||
/* This is true if the menu was launched with right click on root window */
|
/* This is true if the menu was launched with right click on root window */
|
||||||
delayed_select = 1;
|
delayed_select = 1;
|
||||||
d_data.delayed_select = &delayed_select;
|
d_data.delayed_select = &delayed_select;
|
||||||
@@ -2195,8 +2194,7 @@ menuMouseDown(WObjDescriptor *desc, XEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((WMenu*)desc->parent)->flags.brother || close_on_exit
|
if (((WMenu*)desc->parent)->flags.brother || close_on_exit || !smenu)
|
||||||
|| !smenu)
|
|
||||||
closeCascade(desc->parent);
|
closeCascade(desc->parent);
|
||||||
|
|
||||||
/* close the cascade windows that should not remain opened */
|
/* close the cascade windows that should not remain opened */
|
||||||
|
|||||||
@@ -1436,7 +1436,7 @@ ExecuteShellCommand(WScreen *scr, char *command)
|
|||||||
#ifdef HAVE_SETPGID
|
#ifdef HAVE_SETPGID
|
||||||
setpgid(0, 0);
|
setpgid(0, 0);
|
||||||
#endif
|
#endif
|
||||||
execl(shell, shell, "-c", wstrappend("exec ", command), NULL);
|
execl(shell, shell, "-c", command, NULL);
|
||||||
wsyserror("could not execute %s -c %s", shell, command);
|
wsyserror("could not execute %s -c %s", shell, command);
|
||||||
Exit(-1);
|
Exit(-1);
|
||||||
} else if (pid < 0) {
|
} else if (pid < 0) {
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ static Shortcut *shortcutList = NULL;
|
|||||||
* REFRESH - forces the desktop to be repainted
|
* REFRESH - forces the desktop to be repainted
|
||||||
* EXIT [QUICK] - exit the window manager [without confirmation]
|
* EXIT [QUICK] - exit the window manager [without confirmation]
|
||||||
* EXEC <program> - execute an external program
|
* EXEC <program> - execute an external program
|
||||||
|
* SHEXEC <command> - execute a shell command
|
||||||
* WORKSPACE_MENU - places the workspace submenu
|
* WORKSPACE_MENU - places the workspace submenu
|
||||||
* ARRANGE_ICONS
|
* ARRANGE_ICONS
|
||||||
* RESTART [<window manager>] - restarts the window manager
|
* RESTART [<window manager>] - restarts the window manager
|
||||||
@@ -807,7 +808,18 @@ addMenuEntry(WMenu *menu, char *title, char *shortcut, char *command,
|
|||||||
wwarning(_("%s:missing parameter for menu command \"%s\""),
|
wwarning(_("%s:missing parameter for menu command \"%s\""),
|
||||||
file_name, command);
|
file_name, command);
|
||||||
else {
|
else {
|
||||||
entry = wMenuAddCallback(menu, title, execCommand, wstrdup(params));
|
entry = wMenuAddCallback(menu, title, execCommand,
|
||||||
|
wstrappend("exec ", params));
|
||||||
|
entry->free_cdata = free;
|
||||||
|
shortcutOk = True;
|
||||||
|
}
|
||||||
|
} else if (strcmp(command, "SHEXEC")==0) {
|
||||||
|
if (!params)
|
||||||
|
wwarning(_("%s:missing parameter for menu command \"%s\""),
|
||||||
|
file_name, command);
|
||||||
|
else {
|
||||||
|
entry = wMenuAddCallback(menu, title, execCommand,
|
||||||
|
wstrdup(params));
|
||||||
entry->free_cdata = free;
|
entry->free_cdata = free;
|
||||||
shortcutOk = True;
|
shortcutOk = True;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -776,7 +776,7 @@ wSessionGetStateFor(WWindow *wwin, WSessionData *state)
|
|||||||
&state->width, &state->height,
|
&state->width, &state->height,
|
||||||
&state->user_changed_width, &state->user_changed_height);
|
&state->user_changed_width, &state->user_changed_height);
|
||||||
|
|
||||||
|
|
||||||
/* state */
|
/* state */
|
||||||
value = PLGetArrayElement(slist, index++);
|
value = PLGetArrayElement(slist, index++);
|
||||||
str = PLGetString(value);
|
str = PLGetString(value);
|
||||||
@@ -784,18 +784,18 @@ wSessionGetStateFor(WWindow *wwin, WSessionData *state)
|
|||||||
sscanf(str, "%i %i %i", &state->miniaturized, &state->shaded,
|
sscanf(str, "%i %i %i", &state->miniaturized, &state->shaded,
|
||||||
&state->maximized);
|
&state->maximized);
|
||||||
|
|
||||||
|
|
||||||
/* attributes */
|
/* attributes */
|
||||||
value = PLGetArrayElement(slist, index++);
|
value = PLGetArrayElement(slist, index++);
|
||||||
str = PLGetString(value);
|
str = PLGetString(value);
|
||||||
|
|
||||||
getAttributeState(str, &state->mflags, &state->flags);
|
getAttributeState(str, &state->mflags, &state->flags);
|
||||||
|
|
||||||
|
|
||||||
/* workspace */
|
/* workspace */
|
||||||
value = PLGetArrayElement(slist, index++);
|
value = PLGetArrayElement(slist, index++);
|
||||||
str = PLGetString(value);
|
str = PLGetString(value);
|
||||||
|
|
||||||
sscanf(str, "%i", &state->workspace);
|
sscanf(str, "%i", &state->workspace);
|
||||||
|
|
||||||
|
|
||||||
@@ -808,7 +808,7 @@ wSessionGetStateFor(WWindow *wwin, WSessionData *state)
|
|||||||
/* shortcuts */
|
/* shortcuts */
|
||||||
value = PLGetArrayElement(slist, index++);
|
value = PLGetArrayElement(slist, index++);
|
||||||
str = PLGetString(value);
|
str = PLGetString(value);
|
||||||
|
|
||||||
sscanf(str, "%i", &state->shortcuts);
|
sscanf(str, "%i", &state->shortcuts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* session.h
|
/* session.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 1998 Dan Pascu
|
* Copyright (c) 1999 Alfredo K. Kojima
|
||||||
*
|
*
|
||||||
* Window Maker window manager
|
* Window Maker window manager
|
||||||
*
|
*
|
||||||
@@ -68,4 +68,6 @@ Bool wSessionIsManaged(void);
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Bool wSessionGetStateFor(WWindow *wwin, WSessionData *state);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -362,7 +362,10 @@
|
|||||||
/* delay for menu item selection hysteresis */
|
/* delay for menu item selection hysteresis */
|
||||||
#define MENU_SELECT_DELAY 200
|
#define MENU_SELECT_DELAY 200
|
||||||
|
|
||||||
/* animation speed constants */
|
/* delay for jumpback of scrolled menus */
|
||||||
|
#define MENU_JUMP_BACK_DELAY 200
|
||||||
|
|
||||||
|
/* *** animation speed constants *** */
|
||||||
|
|
||||||
/* icon slide */
|
/* icon slide */
|
||||||
#define ICON_SLIDE_SLOWDOWN_UF 20
|
#define ICON_SLIDE_SLOWDOWN_UF 20
|
||||||
@@ -400,7 +403,7 @@
|
|||||||
|
|
||||||
#define MENU_SCROLL_STEPS_U 1
|
#define MENU_SCROLL_STEPS_U 1
|
||||||
#define MENU_SCROLL_DELAY_U 8
|
#define MENU_SCROLL_DELAY_U 8
|
||||||
#define MENU_JUMP_BACK_DELAY 0
|
0
|
||||||
|
|
||||||
/* shade animation */
|
/* shade animation */
|
||||||
#define SHADE_STEPS_UF 5
|
#define SHADE_STEPS_UF 5
|
||||||
@@ -418,6 +421,12 @@
|
|||||||
#define SHADE_STEPS_U 20
|
#define SHADE_STEPS_U 20
|
||||||
#define SHADE_DELAY_U 10
|
#define SHADE_DELAY_U 10
|
||||||
|
|
||||||
|
|
||||||
|
/* workspace name on switch display */
|
||||||
|
#define WORKSPACE_NAME_FADE_DELAY 30
|
||||||
|
|
||||||
|
#define WORKSPACE_NAME_DELAY 500
|
||||||
|
|
||||||
/* window birth animation steps (DO NOT MAKE IT RUN-TIME) */
|
/* window birth animation steps (DO NOT MAKE IT RUN-TIME) */
|
||||||
#define WINDOW_BIRTH_STEPS 20
|
#define WINDOW_BIRTH_STEPS 20
|
||||||
|
|
||||||
|
|||||||
@@ -1552,10 +1552,10 @@ wWindowFocus(WWindow *wwin, WWindow *owin)
|
|||||||
|
|
||||||
wFrameWindowChangeState(wwin->frame, WS_FOCUSED);
|
wFrameWindowChangeState(wwin->frame, WS_FOCUSED);
|
||||||
|
|
||||||
wWindowResetMouseGrabs(wwin);
|
|
||||||
|
|
||||||
wwin->flags.focused = 1;
|
wwin->flags.focused = 1;
|
||||||
|
|
||||||
|
wWindowResetMouseGrabs(wwin);
|
||||||
|
|
||||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
|
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
|
||||||
|
|
||||||
if (owin == wwin || !owin)
|
if (owin == wwin || !owin)
|
||||||
@@ -1621,6 +1621,7 @@ wWindowUnfocus(WWindow *wwin)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
wwin->flags.focused = 0;
|
wwin->flags.focused = 0;
|
||||||
|
|
||||||
wWindowResetMouseGrabs(wwin);
|
wWindowResetMouseGrabs(wwin);
|
||||||
|
|
||||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
|
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
|
||||||
@@ -2334,7 +2335,7 @@ wWindowResetMouseGrabs(WWindow *wwin)
|
|||||||
GrabModeAsync, None, None);
|
GrabModeAsync, None, None);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wwin->flags.focused) {
|
if (!wwin->flags.focused && !WFLAGP(wwin, no_focusable)) {
|
||||||
/* the passive grabs to focus the window */
|
/* the passive grabs to focus the window */
|
||||||
if (wPreferences.focus_mode == WKF_CLICK)
|
if (wPreferences.focus_mode == WKF_CLICK)
|
||||||
XGrabButton(dpy, AnyButton, AnyModifier, wwin->client_win,
|
XGrabButton(dpy, AnyButton, AnyModifier, wwin->client_win,
|
||||||
|
|||||||
@@ -141,7 +141,6 @@ typedef struct {
|
|||||||
unsigned int olwm_transient:1;
|
unsigned int olwm_transient:1;
|
||||||
unsigned int olwm_warp_to_pin:1;
|
unsigned int olwm_warp_to_pin:1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} WWindowAttributes;
|
} WWindowAttributes;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -252,8 +252,9 @@ hideWorkpaceName(void *data)
|
|||||||
RImage *img = RCloneImage(scr->workspace_name_data->back);
|
RImage *img = RCloneImage(scr->workspace_name_data->back);
|
||||||
Pixmap pix;
|
Pixmap pix;
|
||||||
|
|
||||||
scr->workspace_name_timer = WMAddTimerHandler(30, hideWorkpaceName,
|
scr->workspace_name_timer =
|
||||||
scr);
|
WMAddTimerHandler(WORKSPACE_NAME_FADE_DELAY, hideWorkpaceName,
|
||||||
|
scr);
|
||||||
|
|
||||||
RCombineImagesWithOpaqueness(img, scr->workspace_name_data->text,
|
RCombineImagesWithOpaqueness(img, scr->workspace_name_data->text,
|
||||||
scr->workspace_name_data->count*255/10);
|
scr->workspace_name_data->count*255/10);
|
||||||
@@ -289,6 +290,8 @@ showWorkspaceName(WScreen *scr, int workspace)
|
|||||||
XUnmapWindow(dpy, scr->workspace_name);
|
XUnmapWindow(dpy, scr->workspace_name);
|
||||||
XFlush(dpy);
|
XFlush(dpy);
|
||||||
}
|
}
|
||||||
|
scr->workspace_name_timer = WMAddTimerHandler(WORKSPACE_NAME_DELAY,
|
||||||
|
hideWorkpaceName, scr);
|
||||||
|
|
||||||
if (scr->workspace_name_data) {
|
if (scr->workspace_name_data) {
|
||||||
RDestroyImage(scr->workspace_name_data->back);
|
RDestroyImage(scr->workspace_name_data->back);
|
||||||
@@ -307,8 +310,10 @@ showWorkspaceName(WScreen *scr, int workspace)
|
|||||||
h = scr->workspace_name_font->height;
|
h = scr->workspace_name_font->height;
|
||||||
|
|
||||||
XResizeWindow(dpy, scr->workspace_name, w+4, h+4);
|
XResizeWindow(dpy, scr->workspace_name, w+4, h+4);
|
||||||
XMoveWindow(dpy, scr->workspace_name, (scr->scr_width - (w+4))/2,
|
XMoveWindow(dpy, scr->workspace_name, (scr->scr_width - (w+4))/2, 0);
|
||||||
|
/*
|
||||||
(scr->scr_height - (h+4))/2);
|
(scr->scr_height - (h+4))/2);
|
||||||
|
*/
|
||||||
|
|
||||||
text = XCreatePixmap(dpy, scr->w_win, w+4, h+4, scr->w_depth);
|
text = XCreatePixmap(dpy, scr->w_win, w+4, h+4, scr->w_depth);
|
||||||
mask = XCreatePixmap(dpy, scr->w_win, w+4, h+4, 1);
|
mask = XCreatePixmap(dpy, scr->w_win, w+4, h+4, 1);
|
||||||
@@ -374,11 +379,12 @@ showWorkspaceName(WScreen *scr, int workspace)
|
|||||||
|
|
||||||
scr->workspace_name_data = data;
|
scr->workspace_name_data = data;
|
||||||
|
|
||||||
scr->workspace_name_timer = WMAddTimerHandler(300, hideWorkpaceName, scr);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
erro:
|
erro:
|
||||||
|
if (scr->workspace_name_timer)
|
||||||
|
WMDeleteTimerHandler(scr->workspace_name_timer);
|
||||||
|
|
||||||
if (data->text)
|
if (data->text)
|
||||||
RDestroyImage(data->text);
|
RDestroyImage(data->text);
|
||||||
if (data->back)
|
if (data->back)
|
||||||
@@ -387,7 +393,9 @@ erro:
|
|||||||
|
|
||||||
scr->workspace_name_data = NULL;
|
scr->workspace_name_data = NULL;
|
||||||
|
|
||||||
scr->workspace_name_timer = WMAddTimerHandler(600, hideWorkpaceName, scr);
|
scr->workspace_name_timer = WMAddTimerHandler(WORKSPACE_NAME_DELAY +
|
||||||
|
10*WORKSPACE_NAME_FADE_DELAY,
|
||||||
|
hideWorkpaceName, scr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -401,7 +409,8 @@ wWorkspaceChange(WScreen *scr, int workspace)
|
|||||||
if (workspace != scr->current_workspace) {
|
if (workspace != scr->current_workspace) {
|
||||||
wWorkspaceForceChange(scr, workspace);
|
wWorkspaceForceChange(scr, workspace);
|
||||||
} else {
|
} else {
|
||||||
showWorkspaceName(scr, workspace);
|
if (!wPreferences.no_workspace_name_display)
|
||||||
|
showWorkspaceName(scr, workspace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -568,7 +577,8 @@ wWorkspaceForceChange(WScreen *scr, int workspace)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
showWorkspaceName(scr, workspace);
|
if (!wPreferences.no_workspace_name_display)
|
||||||
|
showWorkspaceName(scr, workspace);
|
||||||
|
|
||||||
#ifdef GNOME_STUFF
|
#ifdef GNOME_STUFF
|
||||||
wGNOMEUpdateCurrentWorkspaceHint(scr);
|
wGNOMEUpdateCurrentWorkspaceHint(scr);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define PROG_VERSION "setstyle (Window Maker) 0.4"
|
#define PROG_VERSION "setstyle (Window Maker) 0.5"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
#include "../src/wconfig.h"
|
#include "../src/wconfig.h"
|
||||||
|
|
||||||
|
#define MAX_OPTIONS 128
|
||||||
|
|
||||||
char *FontOptions[] = {
|
char *FontOptions[] = {
|
||||||
"IconTitleFont",
|
"IconTitleFont",
|
||||||
@@ -344,13 +345,13 @@ print_help()
|
|||||||
printf("Usage: %s [OPTIONS] FILE\n", ProgName);
|
printf("Usage: %s [OPTIONS] FILE\n", ProgName);
|
||||||
puts("Reads style/theme configuration from FILE and updates Window Maker.");
|
puts("Reads style/theme configuration from FILE and updates Window Maker.");
|
||||||
puts("");
|
puts("");
|
||||||
puts(" --no-fonts ignore font related options");
|
puts(" --no-fonts ignore font related options");
|
||||||
puts(" --help display this help and exit");
|
puts(" --ignore <option> ignore changes in the specified option");
|
||||||
puts(" --version output version information and exit");
|
puts(" --help display this help and exit");
|
||||||
|
puts(" --version output version information and exit");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
@@ -359,6 +360,8 @@ main(int argc, char **argv)
|
|||||||
char *file = NULL;
|
char *file = NULL;
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
int i;
|
int i;
|
||||||
|
int ignoreCount = 0;
|
||||||
|
char *ignoreList[MAX_OPTIONS];
|
||||||
|
|
||||||
dpy = XOpenDisplay("");
|
dpy = XOpenDisplay("");
|
||||||
|
|
||||||
@@ -371,7 +374,15 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
if (strcmp("--no-fonts", argv[i])==0) {
|
if (strcmp("--ignore", argv[i])==0) {
|
||||||
|
i++;
|
||||||
|
if (i == argc) {
|
||||||
|
printf("%s: missing argument for option --ignore", ProgName);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
ignoreList[ignoreCount++] = argv[i];
|
||||||
|
|
||||||
|
} else if (strcmp("--no-fonts", argv[i])==0) {
|
||||||
ignoreFonts = 1;
|
ignoreFonts = 1;
|
||||||
} else if (strcmp("--version", argv[i])==0) {
|
} else if (strcmp("--version", argv[i])==0) {
|
||||||
puts(PROG_VERSION);
|
puts(PROG_VERSION);
|
||||||
@@ -461,6 +472,12 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
hackStyle(style);
|
hackStyle(style);
|
||||||
|
|
||||||
|
if (ignoreCount > 0) {
|
||||||
|
for (i = 0; i < ignoreCount; i++) {
|
||||||
|
PLRemoveDictionaryEntry(style, PLMakeString(ignoreList[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
PLMergeDictionaries(prop, style);
|
PLMergeDictionaries(prop, style);
|
||||||
|
|
||||||
PLSave(prop, YES);
|
PLSave(prop, YES);
|
||||||
|
|||||||
@@ -610,20 +610,20 @@ parseTexture(RContext *rc, char *text)
|
|||||||
|
|
||||||
handle = dlopen(lib, RTLD_LAZY);
|
handle = dlopen(lib, RTLD_LAZY);
|
||||||
if (!handle) {
|
if (!handle) {
|
||||||
wwarning(_("could not find library %s"), lib);
|
wwarning("could not find library %s", lib);
|
||||||
goto function_cleanup;
|
goto function_cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
initFunc = dlsym(handle, "initWindowMaker");
|
initFunc = dlsym(handle, "initWindowMaker");
|
||||||
if (!initFunc) {
|
if (!initFunc) {
|
||||||
wwarning(_("could not initialize library %s"), lib);
|
wwarning("could not initialize library %s", lib);
|
||||||
goto function_cleanup;
|
goto function_cleanup;
|
||||||
}
|
}
|
||||||
initFunc(dpy, DefaultColormap(dpy, scr));
|
initFunc(dpy, DefaultColormap(dpy, scr));
|
||||||
|
|
||||||
mainFunc = dlsym(handle, func);
|
mainFunc = dlsym(handle, func);
|
||||||
if (!mainFunc) {
|
if (!mainFunc) {
|
||||||
wwarning(_("could not find function %s::%s"), lib, func);
|
wwarning("could not find function %s::%s", lib, func);
|
||||||
goto function_cleanup;
|
goto function_cleanup;
|
||||||
}
|
}
|
||||||
image = mainFunc(argc, argv, scrWidth, scrHeight, 0);
|
image = mainFunc(argc, argv, scrWidth, scrHeight, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user