1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 20:10:29 +01:00

multiview and vertical splitview

some bug fixes
configurable default font size
etc
This commit is contained in:
kojima
1999-10-27 22:32:12 +00:00
parent 4e65111750
commit 94f4483dbd
34 changed files with 2756 additions and 1399 deletions

View File

@@ -6,10 +6,15 @@ changes since wmaker 0.61.1:
- rewrote WMPopUpButton to use WMMenuItem
- added WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index)
- WMSortListItemsWithComparer(WMList *lPtr, (int)(f)(const void*, const void*))
- WMSortBrowserColumnWithComparer()
- fixed bug with sorting list items.
- fixed bug in handling keyboard input associated with selection and
notification sending.
- filepanel puts dirs on top of list (Wolff <wolff@cybercable.fr>)
- added WMReplaceInBag (Wolff <wolff@cybercable.fr>)
- added vertical views and multiple views in WMSplitView (Wolff <wolff@cybercable.fr>)
- changed values of parameter values of WMSplitViewConstrainProc()
- configurable default fontsize patch (Igor P. Roboul <igor@mordor.myip.org>)
changes since wmaker 0.61.0:
............................

View File

@@ -107,14 +107,14 @@ DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps 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) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -146,6 +146,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = WINGs/Resources
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 \
d=$(srcdir); \
if test -d $$d/$$file; then \

View File

@@ -407,7 +407,7 @@ typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
*/
typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
int *minCoordinate, int *maxCoordinate);
int *minSize, int *maxSize);
typedef WMWidget *WMMatrixCreateCellProc(WMMatrix *mPtr);
@@ -1016,6 +1016,9 @@ WMListItem *WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text
void WMSortBrowserColumn(WMBrowser *bPtr, int column);
void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
int (f)(const void*, const void*));
/* Don't free the returned string. */
char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
@@ -1248,8 +1251,20 @@ void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
/* ....................................................................... */
/* only supports 2 subviews */
WMSplitView *WMCreateSplitView(WMWidget *parent);
Bool WMGetSplitViewVertical(WMSplitView *sPtr);
void WMSetSplitViewVertical(WMSplitView *sPtr, Bool flag);
int WMGetSplitViewSubViewsCount(WMSplitView *sPtr); /* ??? remove ??? */
WMView *WMGetSplitViewSubViewAt(WMSplitView *sPtr, int index);
/* remove the first subview == view */
void WMRemoveSplitViewSubview(WMSplitView *sPtr, WMView *view);
void WMRemoveSplitViewSubviewAt(WMSplitView *sPtr, int index);
void WMAddSplitViewSubview(WMSplitView *sPtr, WMView *subview);
@@ -1297,7 +1312,6 @@ void WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index);
void WMSetTabViewDelegate(WMTabView *tPtr, WMTabViewDelegate *delegate);
/* ....................................................................... */
WMTabViewItem *WMCreateTabViewItemWithIdentifier(int identifier);

View File

@@ -351,6 +351,7 @@ typedef struct W_EventHandler {
typedef struct _WINGsConfiguration {
char *systemFont;
char *boldSystemFont;
int defaultFontSize;
Bool useMultiByte;
unsigned doubleClickDelay;
} _WINGsConfiguration;

View File

@@ -253,6 +253,7 @@ void *WMGetFromBag(WMBag *bag, int index);
int WMCountInBag(WMBag *bag, void *item);
void *WMReplaceInBag(WMBag *bag, int index, void *item);
/* comparer must return:
* < 0 if a < b

View File

@@ -130,8 +130,7 @@ WMRemoveFromBag(WMBag *bag, void *item)
void
WMDeleteFromBag(WMBag *bag, int index)
{
if (index < 0 || index >= bag->count)
return;
wassertr(index >= 0 && index < bag->count);
if (index < bag->count-1) {
memmove(&bag->items[index], &bag->items[index + 1],
@@ -144,9 +143,7 @@ WMDeleteFromBag(WMBag *bag, int index)
void*
WMGetFromBag(WMBag *bag, int index)
{
if (index < 0 || index >= bag->count) {
return NULL;
}
wassertrv(index >= 0 && index < bag->count, NULL);
return bag->items[index];
}
@@ -203,3 +200,17 @@ WMMapBag(WMBag *bag, void *(*function)(void *))
return new;
}
void*
WMReplaceInBag(WMBag *bag, int index, void *item)
{
void *old;
wassertrv(index >= 0 && index < bag->count, NULL);
old = bag->items[index];
bag->items[index] = item;
return old;
}

View File

@@ -38,7 +38,11 @@ W_ReadConfigurations(void)
WINGsConfiguration.doubleClickDelay =
WMGetUDIntegerForKey(defaults, "DoubleClickTime");
WINGsConfiguration.defaultFontSize =
WMGetUDIntegerForKey(defaults, "DefaultFontSize");
}
if (!WINGsConfiguration.systemFont) {
WINGsConfiguration.systemFont = SYSTEM_FONT;
@@ -49,5 +53,9 @@ W_ReadConfigurations(void)
if (WINGsConfiguration.doubleClickDelay == 0) {
WINGsConfiguration.doubleClickDelay = 250;
}
if (WINGsConfiguration.defaultFontSize == 0) {
WINGsConfiguration.defaultFontSize = 12;
}
}

View File

@@ -440,6 +440,14 @@ WMSortBrowserColumn(WMBrowser *bPtr, int column)
}
void
WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
int (f)(const void*, const void*))
{
WMSortListItemsWithComparer(bPtr->columns[column], f);
}
WMListItem*
WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text,

View File

@@ -532,6 +532,19 @@ filterFileName(WMFilePanel *panel, char *file, Bool isDirectory)
}
#define CAST(item) (*((WMListItem**)item))
static int
comparer(const void *a, const void *b)
{
if (CAST(a)->isBranch == CAST(b)->isBranch)
return (strcmp(CAST(a)->text, CAST(b)->text));
if (CAST(a)->isBranch)
return (-1);
return (1);
}
#undef CAST
static void
listDirectoryOnColumn(WMFilePanel *panel, int column, char *path)
{
@@ -581,7 +594,7 @@ listDirectoryOnColumn(WMFilePanel *panel, int column, char *path)
WMInsertBrowserItem(bPtr, column, -1, dentry->d_name, isDirectory);
}
}
WMSortBrowserColumn(bPtr, column);
WMSortBrowserColumnWithComparer(bPtr, column, comparer);
closedir(dir);
}

View File

@@ -82,13 +82,15 @@ static void sizeClick(WMWidget *, void *);
static void listFamilies(WMScreen *scr, WMFontPanel *panel);
static void
splitViewConstrainCallback(WMSplitView *sPtr, int divIndex, int *min, int *max)
{
*min = MIN_UPPER_HEIGHT;
*max = WMWidgetHeight(sPtr)-BUTTON_SPACE_HEIGHT-MIN_LOWER_HEIGHT;
}
static void
splitViewConstrainCallback(WMSplitView *sPtr, int indView, int *min, int *max)
{
if (indView == 0)
*min = MIN_UPPER_HEIGHT;
else
*min = MIN_LOWER_HEIGHT;
}
static void
notificationObserver(void *self, WMNotification *notif)

View File

@@ -635,9 +635,11 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
scrPtr->useMultiByte = WINGsConfiguration.useMultiByte;
scrPtr->normalFont = WMSystemFontOfSize(scrPtr, 12);
scrPtr->normalFont = WMSystemFontOfSize(scrPtr,
WINGsConfiguration.defaultFontSize);
scrPtr->boldFont = WMBoldSystemFontOfSize(scrPtr, 12);
scrPtr->boldFont = WMBoldSystemFontOfSize(scrPtr,
WINGsConfiguration.defaultFontSize);
if (!scrPtr->boldFont)
scrPtr->boldFont = scrPtr->normalFont;

View File

@@ -130,15 +130,7 @@ WMCreateList(WMWidget *parent)
static int
comparator(const void *a, const void *b)
{
WMListItem *item1 = *(WMListItem**)a;
WMListItem *item2 = *(WMListItem**)b;
if (strcmp(item1->text, item2->text) < 0)
return -1;
else if (strcmp(item1->text, item2->text) > 0)
return 1;
else
return 0;
return (strcmp((*(WMListItem**)a)->text, (*(WMListItem**)b)->text));
}

File diff suppressed because it is too large Load Diff

View File

@@ -393,7 +393,6 @@ testPullDown(WMScreen *scr)
}
void
testTabView(WMScreen *scr)
{
@@ -461,6 +460,172 @@ testTabView(WMScreen *scr)
}
void
splitViewConstrainProc(WMSplitView *sPtr, int indView,
int *minSize, int *maxSize)
{
switch (indView) {
case 0:
*minSize = 20;
break;
case 1:
*minSize = 40;
*maxSize = 80;
break;
case 2:
*maxSize = 60;
break;
default:
break;
}
}
static void
resizeSplitView(XEvent *event, void *data)
{
WMSplitView *sPtr = (WMSplitView*)data;
if (event->type == ConfigureNotify) {
int width = event->xconfigure.width - 10;
if (width < WMGetSplitViewDividerThickness(sPtr))
width = WMGetSplitViewDividerThickness(sPtr);
if (width != WMWidgetWidth(sPtr) ||
event->xconfigure.height != WMWidgetHeight(sPtr))
WMResizeWidget(sPtr, width, event->xconfigure.height - 55);
}
}
void
appendSubviewButtonAction(WMWidget *self, void *data)
{
WMSplitView *sPtr = (WMSplitView*)data;
char buf[64];
WMLabel *label = WMCreateLabel(sPtr);
sprintf(buf, "Subview %d", WMGetSplitViewSubViewsCount(sPtr) + 1);
WMSetLabelText(label, buf);
WMSetLabelRelief(label, WRSunken);
WMAddSplitViewSubview(sPtr, WMWidgetView(label));
WMRealizeWidget(label);
WMMapWidget(label);
}
void
removeSubviewButtonAction(WMWidget *self, void *data)
{
WMSplitView *sPtr = (WMSplitView*)data;
int count = WMGetSplitViewSubViewsCount(sPtr);
if (count > 2) {
WMView *view = WMGetSplitViewSubViewAt(sPtr, count-1);
WMDestroyWidget(WMWidgetOfView(view));
WMRemoveSplitViewSubviewAt(sPtr, count-1);
}
}
void
orientationButtonAction(WMWidget *self, void *data)
{
WMSplitView *sPtr = (WMSplitView*)data;
WMSetSplitViewVertical(sPtr, !WMGetSplitViewVertical(sPtr));
}
void
adjustSubviewsButtonAction(WMWidget *self, void *data)
{
WMAdjustSplitViewSubViews((WMSplitView*)data);
}
void
testSplitView(WMScreen *scr)
{
WMWindow *win;
WMSplitView *splitv1, *splitv2;
WMFrame *frame;
WMLabel *label;
WMButton *button;
windowCount++;
win = WMCreateWindow(scr, "testTabs");
WMResizeWidget(win, 300, 400);
WMSetWindowCloseAction(win, closeAction, NULL);
frame = WMCreateFrame(win);
WMSetFrameRelief(frame, WRSunken);
WMMoveWidget(frame, 5, 5);
WMResizeWidget(frame, 290, 40);
splitv1 = WMCreateSplitView(win);
WMMoveWidget(splitv1, 5, 50);
WMResizeWidget(splitv1, 290, 345);
WMSetSplitViewConstrainProc(splitv1, splitViewConstrainProc);
WMCreateEventHandler(WMWidgetView(win), StructureNotifyMask,
resizeSplitView, splitv1);
button = WMCreateCommandButton(frame);
WMSetButtonText(button, "+");
WMSetButtonAction(button, appendSubviewButtonAction, splitv1);
WMMoveWidget(button, 10, 8);
WMMapWidget(button);
button = WMCreateCommandButton(frame);
WMSetButtonText(button, "-");
WMSetButtonAction(button, removeSubviewButtonAction, splitv1);
WMMoveWidget(button, 80, 8);
WMMapWidget(button);
button = WMCreateCommandButton(frame);
WMSetButtonText(button, "=");
WMMoveWidget(button, 150, 8);
WMSetButtonAction(button, adjustSubviewsButtonAction, splitv1);
WMMapWidget(button);
button = WMCreateCommandButton(frame);
WMSetButtonText(button, "#");
WMMoveWidget(button, 220, 8);
WMSetButtonAction(button, orientationButtonAction, splitv1);
WMMapWidget(button);
label = WMCreateLabel(splitv1);
WMSetLabelText(label, "Subview 1");
WMSetLabelRelief(label, WRSunken);
WMMapWidget(label);
WMAddSplitViewSubview(splitv1, WMWidgetView(label));
splitv2 = WMCreateSplitView(splitv1);
WMResizeWidget(splitv2, 150, 150);
WMSetSplitViewVertical(splitv2, True);
label = WMCreateLabel(splitv2);
WMSetLabelText(label, "Subview 2.1");
WMSetLabelRelief(label, WRSunken);
WMMapWidget(label);
WMAddSplitViewSubview(splitv2, WMWidgetView(label));
label = WMCreateLabel(splitv2);
WMSetLabelText(label, "Subview 2.2");
WMSetLabelRelief(label, WRSunken);
WMMapWidget(label);
WMAddSplitViewSubview(splitv2, WMWidgetView(label));
label = WMCreateLabel(splitv2);
WMSetLabelText(label, "Subview 2.3");
WMSetLabelRelief(label, WRSunken);
WMMapWidget(label);
WMAddSplitViewSubview(splitv2, WMWidgetView(label));
WMMapWidget(splitv2);
WMAddSplitViewSubview(splitv1, WMWidgetView(splitv2));
WMRealizeWidget(win);
WMMapSubwidgets(win);
WMMapWidget(win);
}
#include "WUtil.h"
@@ -513,8 +678,7 @@ int main(int argc, char **argv)
*/
testPullDown(scr);
testSplitView(scr);
testFontPanel(scr);
#if 0
@@ -527,11 +691,11 @@ int main(int argc, char **argv)
testOpenFilePanel(scr);
testList(scr);
testGradientButtons(scr);
testScrollView(scr);
testSlider(scr);
testPullDown(scr);
#endif
/*
* The main event loop.

File diff suppressed because it is too large Load Diff

View File

@@ -107,14 +107,14 @@ DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WindowMaker/Backgrounds/Makefile
cd $(top_srcdir) && $(AUTOMAKE) --gnu WindowMaker/Backgrounds/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -146,6 +146,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = WindowMaker/Backgrounds
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 WindowMaker/Backgrounds/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \

View File

@@ -109,14 +109,14 @@ DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WindowMaker/Defaults/Makefile
cd $(top_srcdir) && $(AUTOMAKE) --gnu WindowMaker/Defaults/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -148,6 +148,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = WindowMaker/Defaults
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 WindowMaker/Defaults/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \

View File

@@ -109,14 +109,14 @@ DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WindowMaker/IconSets/Makefile
cd $(top_srcdir) && $(AUTOMAKE) --gnu WindowMaker/IconSets/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -148,6 +148,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = WindowMaker/IconSets
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 WindowMaker/IconSets/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \

View File

@@ -108,14 +108,14 @@ DIST_COMMON = README Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WindowMaker/Icons/Makefile
cd $(top_srcdir) && $(AUTOMAKE) --gnu WindowMaker/Icons/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -147,6 +147,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = WindowMaker/Icons
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 WindowMaker/Icons/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \

View File

@@ -110,14 +110,14 @@ DIST_COMMON = README Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WindowMaker/Makefile
cd $(top_srcdir) && $(AUTOMAKE) --gnu WindowMaker/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -235,6 +235,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = WindowMaker
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 WindowMaker/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \

View File

@@ -108,14 +108,14 @@ DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WindowMaker/Pixmaps/Makefile
cd $(top_srcdir) && $(AUTOMAKE) --gnu WindowMaker/Pixmaps/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -147,6 +147,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = WindowMaker/Pixmaps
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 WindowMaker/Pixmaps/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \

View File

@@ -108,14 +108,14 @@ DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WindowMaker/Styles/Makefile
cd $(top_srcdir) && $(AUTOMAKE) --gnu WindowMaker/Styles/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -147,6 +147,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = WindowMaker/Styles
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 WindowMaker/Styles/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \

View File

@@ -107,14 +107,14 @@ DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WindowMaker/Themes/Makefile
cd $(top_srcdir) && $(AUTOMAKE) --gnu WindowMaker/Themes/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -146,6 +146,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = WindowMaker/Themes
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 WindowMaker/Themes/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \

View File

@@ -101,14 +101,14 @@ DIST_COMMON = README Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps contrib/Makefile
cd $(top_srcdir) && $(AUTOMAKE) --gnu contrib/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -121,6 +121,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = contrib
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 contrib/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \

View File

@@ -108,14 +108,14 @@ DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps doc/Makefile
cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -167,6 +167,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = doc
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 doc/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \

View File

@@ -118,15 +118,15 @@ DIST_COMMON = README Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
.SUFFIXES: .mo .po
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps po/Makefile
cd $(top_srcdir) && $(AUTOMAKE) --gnu po/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -139,6 +139,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = po
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu po/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \

View File

@@ -456,7 +456,7 @@ wGNOMEProcessClientMessage(XClientMessageEvent *event)
WWindow *wwin;
Bool done = True;
scr = wScreenForRootWindow(event->window);
scr = wScreenForWindow(event->window);
if (scr) {
/* generic client messages */
if (event->message_type == _XA_WIN_WORKSPACE) {

View File

@@ -151,6 +151,8 @@ static int ArgCount;
extern void EventLoop();
extern void StartUp();
static Bool multiHead = True;
/* stdi/o for log shell */
static int LogStdIn = -1, LogStdOut = -1, LogStdErr = -1;
@@ -210,7 +212,7 @@ SetupEnvironment(WScreen *scr)
char *tmp, *ptr;
char buf[16];
if (wScreenCount > 1) {
if (multiHead) {
tmp = wmalloc(strlen(DisplayName)+64);
sprintf(tmp, "DISPLAY=%s", XDisplayName(DisplayName));
ptr = strchr(strchr(tmp, ':'), '.');
@@ -540,7 +542,6 @@ int
main(int argc, char **argv)
{
int i, restart=0;
Bool multiHead = True;
char *str;
int d, s;
#ifdef DEBUG
@@ -744,6 +745,9 @@ main(int argc, char **argv)
#endif
StartUp(!multiHead);
if (wScreenCount==1)
multiHead = False;
execInitScript();

View File

@@ -67,6 +67,9 @@ extern Atom _XA_WM_PROTOCOLS;
void
wGetGeometryWindowSize(WScreen *scr, unsigned int *width,
unsigned int *height)
@@ -77,6 +80,32 @@ wGetGeometryWindowSize(WScreen *scr, unsigned int *width,
}
/*
*----------------------------------------------------------------------
* checkMouseSamplingRate-
* For lowering the mouse motion sampling rate for machines where
* it's too high (SGIs). If it returns False then the event should be
* ignored.
*----------------------------------------------------------------------
*/
static Bool
checkMouseSamplingRate(XEvent *ev)
{
static Time previousMotion = 0;
if (ev->type == MotionNotify) {
if (ev->xmotion.time - previousMotion < DELAY_BETWEEN_MOUSE_SAMPLING) {
return False;
} else {
previousMotion = ev->xmotion.time;
}
}
return True;
}
/*
*----------------------------------------------------------------------
* moveGeometryDisplayCentered
@@ -1592,6 +1621,8 @@ wMouseMoveWindow(WWindow *wwin, XEvent *ev)
if (event.type == MotionNotify) {
/* compress MotionNotify events */
while (XCheckMaskEvent(dpy, ButtonMotionMask, &event)) ;
if (!checkMouseSamplingRate(&event))
continue;
}
}
switch (event.type) {
@@ -1876,6 +1907,10 @@ wMouseResizeWindow(WWindow *wwin, XEvent *ev)
while (1) {
WMMaskEvent(dpy, KeyPressMask | ButtonMotionMask | ButtonReleaseMask
| ButtonPressMask | ExposureMask, &event);
if (!checkMouseSamplingRate(&event))
continue;
switch (event.type) {
case KeyPress:
showGeometry(wwin, fx, fy, fx + fw, fy + fh, res);
@@ -2080,13 +2115,19 @@ wSelectWindows(WScreen *scr, XEvent *ev)
int xp = ev->xbutton.x_root;
int yp = ev->xbutton.y_root;
int w = 0, h = 0;
int x = xp, y = yp;
int nx = xp, ny = yp, ox = xp, oy = yp, update_selection = 0;
XSegment segments[8]; /* 8 segments is the most possible */
/* it may be beneficial to use */
/* XDrawRectangle for 8 segment case */
int nsegs = 0;
#ifdef DEBUG
puts("Selecting windows");
#endif
if (XGrabPointer(dpy, scr->root_win, False, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask, GrabModeAsync,
if (XGrabPointer(dpy, scr->root_win, True, PointerMotionMask
| ButtonMotionMask | ButtonReleaseMask | ButtonPressMask
| EnterWindowMask | LeaveWindowMask , GrabModeAsync,
GrabModeAsync, None, wCursor[WCUR_DEFAULT],
CurrentTime) != Success) {
return;
@@ -2095,29 +2136,36 @@ wSelectWindows(WScreen *scr, XEvent *ev)
wUnselectWindows(scr);
XDrawRectangle(dpy, root, gc, xp, yp, w, h);
while (1) {
WMMaskEvent(dpy, ButtonReleaseMask | PointerMotionMask
| ButtonPressMask, &event);
update_selection = 0;
WMMaskEvent(dpy, ButtonReleaseMask | PointerMotionMask | LeaveWindowMask
| EnterWindowMask | ButtonPressMask,
&event);
if (!checkMouseSamplingRate(&event))
continue;
nsegs = 0;
switch (event.type) {
case LeaveNotify:
case EnterNotify:
#ifdef DEBUG
dbputs("got Enter/LeaveNotify in selection");
#endif
nx = event.xcrossing.x_root;
ny = event.xcrossing.y_root;
update_selection = 1;
break;
case MotionNotify:
XDrawRectangle(dpy, root, gc, x, y, w, h);
x = event.xmotion.x_root;
if (x < xp) {
w = xp - x;
} else {
w = x - xp;
x = xp;
}
y = event.xmotion.y_root;
if (y < yp) {
h = yp - y;
} else {
h = y - yp;
y = yp;
}
XDrawRectangle(dpy, root, gc, x, y, w, h);
#ifdef DEBUG
dbputs("got motionevent in selection");
#endif
nx = event.xmotion.x_root;
ny = event.xmotion.y_root;
update_selection = 1;
break;
case ButtonPress:
@@ -2127,10 +2175,22 @@ wSelectWindows(WScreen *scr, XEvent *ev)
if (event.xbutton.button != ev->xbutton.button)
break;
XDrawRectangle(dpy, root, gc, x, y, w, h);
if(nx > xp) w = nx - xp;
else if(nx < xp) {
w = xp - nx;
xp = nx;
} else w = 0;
if(ny > yp) h = ny - yp;
else if(ny < yp) {
h = yp - ny;
yp = ny;
} else h = 0;
XDrawRectangle(dpy, root, gc, xp, yp, w, h);
XUngrabServer(dpy);
XUngrabPointer(dpy, CurrentTime);
selectWindowsInside(scr, x, y, x + w, y + h);
selectWindowsInside(scr, xp, yp, w + xp, h + yp);
#ifdef KWM_HINTS
wKWMSelectRootRegion(scr, x, y, w, h,
@@ -2138,14 +2198,113 @@ wSelectWindows(WScreen *scr, XEvent *ev)
#endif /* KWM_HINTS */
#ifdef DEBUG
puts("End window selection");
dbputs("End window selection");
#endif
return;
default:
#ifdef DEBUG
dbputs("unknown event");
dbprintf("type: %u\n", event.type);
#endif
WMHandleEvent(&event);
break;
}
if(update_selection) {
/* stuff to change for movement along X axis */
if(nx != ox) {
/* erase old vertical line */
/* only if old vertical line exists */
/* and only if its different from other vertical line */
if(yp != oy && ox != xp) {
segments[nsegs].x1 = ox;
segments[nsegs].y1 = yp;
segments[nsegs].x2 = ox;
segments[nsegs].y2 = oy;
nsegs++;
}
/* draw new vertical line */
/* only if new vertical line exists */
/* and only if its different from the other vertical line */
if(yp != ny && nx != xp) {
segments[nsegs].x1 = nx;
segments[nsegs].y1 = yp;
segments[nsegs].x2 = nx;
segments[nsegs].y2 = ny;
nsegs++;
}
/* difference along x axis from old to new on ny horizontal */
/* only if our mouse doesnt move along Y, otherwise this gets */
/* done elsewhere */
if(ny == oy && nx != xp) {
segments[nsegs].x1 = ox;
segments[nsegs].y1 = ny;
segments[nsegs].x2 = nx;
segments[nsegs].y2 = ny;
nsegs++;
}
/* difference along x axis from old to new on yp horizontal */
segments[nsegs].x1 = nx;
segments[nsegs].y1 = yp;
segments[nsegs].x2 = ox;
segments[nsegs].y2 = yp;
nsegs++;
}
/* now for stuff to change for movement along Y axis */
if(ny != oy) {
/* erase old horizontal line */
/* only if old horizontal line exists */
/* and only if its different from other horizontal line */
if(xp != ox && oy != yp) {
segments[nsegs].x1 = ox;
segments[nsegs].y1 = oy;
segments[nsegs].x2 = xp;
segments[nsegs].y2 = oy;
nsegs++;
}
/* draw new horizontal line */
/* only if horizontal line exists, and if its different from other */
if(xp != nx && ny != yp) {
segments[nsegs].x1 = nx;
segments[nsegs].y1 = ny;
segments[nsegs].x2 = xp;
segments[nsegs].y2 = ny;
nsegs++;
}
/* difference along y axis from old to new on nx vertical */
/* only if no movement along x axis */
/* and only if we dont have duplicate lines */
if(nx == ox && nx != xp) {
segments[nsegs].x1 = nx;
segments[nsegs].y1 = oy;
segments[nsegs].x2 = nx;
segments[nsegs].y2 = ny;
nsegs++;
}
/* difference along y axis from old to new on xp vertical */
segments[nsegs].x1 = xp;
segments[nsegs].y1 = oy;
segments[nsegs].x2 = xp;
segments[nsegs].y2 = ny;
nsegs++;
}
ox = nx;
oy = ny;
XDrawSegments(dpy, root, gc, segments, nsegs);
}
}
}
#endif /* !LITE */
@@ -2188,6 +2347,10 @@ InteractivePlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
while (1) {
WMMaskEvent(dpy, PointerMotionMask|ButtonPressMask|ExposureMask|KeyPressMask,
&event);
if (!checkMouseSamplingRate(&event))
continue;
switch (event.type) {
case KeyPress:
if ((event.xkey.keycode == shiftl)

View File

@@ -1407,6 +1407,8 @@ readMenuDirectory(WScreen *scr, char *title, char **path, char *command)
dir_data *d = (dir_data*)WMGetFromBag(dirs, i);
length = strlen(path[d->index])+strlen(d->name)+6;
if (stripExtension)
length += 7;
if (command)
length += strlen(command) + 6;
buffer = malloc(length);
@@ -1415,16 +1417,18 @@ readMenuDirectory(WScreen *scr, char *title, char **path, char *command)
path[d->index]);
break;
}
buffer[0] = '\0';
if (stripExtension)
strcat(buffer, "-noext ");
have_space = strchr(path[d->index], ' ')!=NULL ||
strchr(d->name, ' ')!=NULL;
if (have_space) {
buffer[0] = '"';
buffer[1] = 0;
strcat(buffer, path[d->index]);
} else {
strcpy(buffer, path[d->index]);
}
if (have_space)
strcat(buffer, "\"");
strcat(buffer, path[d->index]);
strcat(buffer, "/");
strcat(buffer, d->name);
if (have_space)
@@ -1450,7 +1454,7 @@ readMenuDirectory(WScreen *scr, char *title, char **path, char *command)
if (command)
length += strlen(command);
buffer = wmalloc(length);
buffer = malloc(length);
if (!buffer) {
wsyserror(_("out of memory while constructing directory menu %s"),
path[f->index]);

View File

@@ -506,6 +506,9 @@
#define FRAME_BORDER_COLOR "black"
/* for boxes with high mouse sampling rates (SGI) */
#define DELAY_BETWEEN_MOUSE_SAMPLING 10
/*
*----------------------------------------------------------------------

View File

@@ -129,7 +129,7 @@ DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
SOURCES = $(wtest_SOURCES)
OBJECTS = $(wtest_OBJECTS)

View File

@@ -191,7 +191,7 @@ DIST_COMMON = README Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
SOURCES = $(wxcopy_SOURCES) $(wxpaste_SOURCES) $(wdwrite_SOURCES) $(getstyle_SOURCES) $(setstyle_SOURCES) $(seticons_SOURCES) $(geticonset_SOURCES) $(wmsetbg_SOURCES)
OBJECTS = $(wxcopy_OBJECTS) $(wxpaste_OBJECTS) $(wdwrite_OBJECTS) $(getstyle_OBJECTS) $(setstyle_OBJECTS) $(seticons_OBJECTS) $(geticonset_OBJECTS) $(wmsetbg_OBJECTS)

View File

@@ -130,7 +130,7 @@ DIST_COMMON = COPYING.LIB Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
SOURCES = $(libWMaker_a_SOURCES)
OBJECTS = $(libWMaker_a_OBJECTS)