mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-18 20:10:29 +01:00
started Appearance update in WPrefs
added tabbed view changed some callbacks to delegate like stuff (textfield and browser)
This commit is contained in:
@@ -31,6 +31,7 @@ Changes since version 0.53.0:
|
||||
seb_bauer@bigfoot.com)
|
||||
- added GNUstep info panel (still needs beautification..)
|
||||
- made the paths selector in WPrefs.app use the open file panel
|
||||
- fixed crash bug with hiding apps without dock/clip
|
||||
- fixed a mem leak in superfluous mode caused by the ghost icon.
|
||||
- added possibility to set omnipresent icons in Clip. See NEWS.
|
||||
|
||||
|
||||
@@ -59,10 +59,12 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
DLLIBS = @DLLIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
@@ -77,6 +79,7 @@ MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
7
NEWS
7
NEWS
@@ -5,6 +5,13 @@ NEWS for veteran Window Maker users
|
||||
--- 0.54.0
|
||||
|
||||
|
||||
User Menu
|
||||
---------
|
||||
|
||||
The user menu is now a compile time option disabled by default.
|
||||
Supply --enable-usermenu to configure to enable it.
|
||||
|
||||
|
||||
root menu INCOMPATIBLE changes
|
||||
------------------------------
|
||||
|
||||
|
||||
@@ -3,6 +3,24 @@ changes since wmaker 0.53.0:
|
||||
|
||||
- added balloon help
|
||||
- fixed a bug with setting initial path in browsers.
|
||||
- added WMSetButtonImageDimsWhenDisabled()
|
||||
- changed simple callback/notifications to delegate-like stuff. Affected
|
||||
widgets are:
|
||||
WMBrowser
|
||||
- WMSetBrowserFillProc() was replaced with WMSetBrowserDelegate
|
||||
- WMBrowserDidScrollNotification was replaced with a delegate callback
|
||||
|
||||
WMTextField (not completed yet)
|
||||
The notifications will still work, but using the delegate is preferable
|
||||
|
||||
How to convert old code to delegate callbacks:
|
||||
Create a variable (static or dynamic) of the type of the delegate for
|
||||
the widget type. Replace the notification observers with the
|
||||
equivalent delegate callbacks. Put pointers to the callbacks
|
||||
in the delegate variable.
|
||||
Take a look in wfilepanel.c to see how it is used there.
|
||||
|
||||
- added WMTabView
|
||||
|
||||
changes since wmaker 0.52.0:
|
||||
............................
|
||||
|
||||
@@ -89,6 +89,7 @@ libWINGs_a_SOURCES = \
|
||||
wscrollview.c \
|
||||
wslider.c \
|
||||
wsplitview.c \
|
||||
wtabview.c \
|
||||
wtextfield.c \
|
||||
wwindow.c \
|
||||
wview.c \
|
||||
|
||||
@@ -139,7 +139,7 @@ wmquery_LDADD = libWINGs.a $(LIBLIST)
|
||||
EXTRA_DIST = logo.xpm
|
||||
|
||||
# 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 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
|
||||
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 wtabview.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
|
||||
@@ -163,8 +163,8 @@ notification.o selection.o userdefaults.o wapplication.o wballoon.o \
|
||||
wbrowser.o wbutton.o wcolor.o wcolorpanel.o wcolorwell.o wevent.o \
|
||||
wfilepanel.o wframe.o wfont.o wfontpanel.o widgets.o wlabel.o wlist.o \
|
||||
wmisc.o wpanel.o wpixmap.o wpopupbutton.o wscroller.o wscrollview.o \
|
||||
wslider.o wsplitview.o wtextfield.o wwindow.o wview.o error.o \
|
||||
findfile.o hashtable.o memory.o usleep.o
|
||||
wslider.o wsplitview.o wtabview.o wtextfield.o wwindow.o wview.o \
|
||||
error.o findfile.o hashtable.o memory.o usleep.o
|
||||
AR = ar
|
||||
PROGRAMS = $(noinst_PROGRAMS)
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ Widgets provided by WINGs:
|
||||
- scrollable view
|
||||
- color well
|
||||
- split view (only 2 subviews)
|
||||
- tabbed view
|
||||
|
||||
- input box
|
||||
- file panel
|
||||
@@ -86,7 +87,6 @@ Wish list: (I don't have the know-how or time to do them)
|
||||
- matrix (like NSMatrix)
|
||||
- splitviews with more than 2 subviews
|
||||
- font manager (like NSFontManager)
|
||||
- finish file panel, open/save
|
||||
- finish other wigets
|
||||
- optimize list scrolling (XCopyArea() the area that's already drawn)
|
||||
- InterfaceMaker?
|
||||
|
||||
112
WINGs/WINGs.h
112
WINGs/WINGs.h
@@ -160,13 +160,21 @@ typedef enum {
|
||||
|
||||
/* matrix types */
|
||||
typedef enum {
|
||||
WMMRadioMode,
|
||||
WMMHighlightMode,
|
||||
WMMListMode,
|
||||
WMMTrackMode
|
||||
WMRadioMode,
|
||||
WMHighlightMode,
|
||||
WMListMode,
|
||||
WMTrackMode
|
||||
} WMMatrixTypes;
|
||||
|
||||
|
||||
typedef enum {
|
||||
WTTopTabsBevelBorder,
|
||||
WTNoTabsBevelBorder,
|
||||
WTNoTabsLineBorder,
|
||||
WTNoTabsNoBorder
|
||||
} WMTabViewTypes;
|
||||
|
||||
|
||||
/* text movement types */
|
||||
enum {
|
||||
WMIllegalTextMovement,
|
||||
@@ -255,7 +263,8 @@ enum {
|
||||
WC_ColorWell = 10,
|
||||
WC_Slider = 11,
|
||||
WC_Matrix = 12, /* not ready */
|
||||
WC_SplitView = 13
|
||||
WC_SplitView = 13,
|
||||
WC_TabView = 14
|
||||
};
|
||||
|
||||
/* All widgets must start with the following structure
|
||||
@@ -297,8 +306,12 @@ typedef struct W_ColorWell WMColorWell;
|
||||
typedef struct W_Slider WMSlider;
|
||||
typedef struct W_Matrix WMMatrix; /* not ready */
|
||||
typedef struct W_SplitView WMSplitView;
|
||||
typedef struct W_TabView WMTabView;
|
||||
|
||||
/* not widgets */
|
||||
typedef struct W_TabViewItem WMTabViewItem;
|
||||
|
||||
|
||||
typedef struct W_FilePanel WMFilePanel;
|
||||
typedef WMFilePanel WMOpenPanel;
|
||||
typedef WMFilePanel WMSavePanel;
|
||||
@@ -392,9 +405,6 @@ typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
|
||||
typedef WMWidget *WMMatrixCreateCellProc(WMMatrix *mPtr);
|
||||
|
||||
|
||||
typedef void WMBrowserFillColumnProc(WMBrowser *bPtr, int column);
|
||||
|
||||
|
||||
typedef Bool WMConvertSelectionProc(WMWidget *w, Atom selection, Atom target,
|
||||
Atom *type, void **value, unsigned *length,
|
||||
int *format);
|
||||
@@ -403,6 +413,45 @@ typedef void WMLoseSelectionProc(WMWidget *w, Atom selection);
|
||||
|
||||
typedef void WMSelectionDoneProc(WMWidget *w, Atom selection, Atom target);
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct WMBrowserDelegate {
|
||||
void *data;
|
||||
|
||||
void (*createRowsForColumn)(struct WMBrowserDelegate *self,
|
||||
WMBrowser *sender, int column, WMList *list);
|
||||
|
||||
char* (*titleOfColumn)(struct WMBrowserDelegate *self, WMBrowser *sender,
|
||||
int column);
|
||||
|
||||
void (*didScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
|
||||
|
||||
void (*willScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
|
||||
} WMBrowserDelegate;
|
||||
|
||||
|
||||
typedef struct WMTextFieldDelegate {
|
||||
void *data;
|
||||
|
||||
void (*didBeginEditing)(struct WMTextFieldDelegate *self,
|
||||
WMNotification *notif);
|
||||
|
||||
void (*didChange)(struct WMTextFieldDelegate *self,
|
||||
WMNotification *notif);
|
||||
|
||||
void (*didEndEditing)(struct WMTextFieldDelegate *self,
|
||||
WMNotification *notif);
|
||||
|
||||
Bool (*shouldBeginEditing)(struct WMTextFieldDelegate *self,
|
||||
WMTextField *tPtr);
|
||||
|
||||
Bool (*shouldEndEditing)(struct WMTextFieldDelegate *self,
|
||||
WMTextField *tPtr);
|
||||
} WMTextFieldDelegate;
|
||||
|
||||
|
||||
|
||||
/* ....................................................................... */
|
||||
|
||||
|
||||
@@ -736,6 +785,8 @@ void WMSetButtonBordered(WMButton *bPtr, int isBordered);
|
||||
|
||||
void WMSetButtonEnabled(WMButton *bPtr, Bool flag);
|
||||
|
||||
void WMSetButtonImageDimsWhenDisabled(WMButton *bPtr, Bool flag);
|
||||
|
||||
void WMSetButtonTag(WMButton *bPtr, int tag);
|
||||
|
||||
void WMGroupButtons(WMButton *bPtr, WMButton *newMember);
|
||||
@@ -910,8 +961,6 @@ char *WMGetBrowserPath(WMBrowser *bPtr);
|
||||
/* you can free the returned string */
|
||||
char *WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
|
||||
|
||||
void WMSetBrowserFillColumnProc(WMBrowser *bPtr,WMBrowserFillColumnProc *proc);
|
||||
|
||||
void WMSetBrowserAction(WMBrowser *bPtr, WMAction *action, void *clientData);
|
||||
|
||||
void WMSetBrowserDoubleAction(WMBrowser *bPtr, WMAction *action,
|
||||
@@ -931,7 +980,7 @@ int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
|
||||
|
||||
WMList *WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
|
||||
|
||||
extern char *WMBrowserDidScrollNotification;
|
||||
void WMSetBrowserDelegate(WMBrowser *bPtr, WMBrowserDelegate *delegate);
|
||||
|
||||
/* ....................................................................... */
|
||||
|
||||
@@ -1066,6 +1115,47 @@ void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
|
||||
int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
|
||||
|
||||
|
||||
/* ....................................................................... */
|
||||
|
||||
|
||||
WMTabView *WMCreateTabView(WMWidget *parent);
|
||||
|
||||
void WMAddItemInTabView(WMTabView *tPtr, WMTabViewItem *item);
|
||||
|
||||
void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
|
||||
|
||||
void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
|
||||
|
||||
WMTabViewItem *WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
|
||||
|
||||
void WMSelectFirstTabViewItem(WMTabView *tPtr);
|
||||
|
||||
void WMSelectLastTabViewItem(WMTabView *tPtr);
|
||||
|
||||
void WMSelectNextTabViewItem(WMTabView *tPtr);
|
||||
|
||||
void WMSelectPreviousTabViewItem(WMTabView *tPtr);
|
||||
|
||||
WMTabViewItem *WMGetSelectedTabViewItem(WMTabView *tPtr);
|
||||
|
||||
void WMSelectTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
|
||||
|
||||
void WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index);
|
||||
|
||||
|
||||
|
||||
WMTabViewItem *WMCreateTabViewItemWithIdentifier(int identifier);
|
||||
|
||||
void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
|
||||
|
||||
char *WMGetTabViewItemLabel(WMTabViewItem *item);
|
||||
|
||||
void WMSetTabViewItemView(WMTabViewItem *item, WMView *view);
|
||||
|
||||
WMView *WMGetTabViewItemView(WMTabViewItem *item);
|
||||
|
||||
void WMDestroyTabViewItem(WMTabViewItem *item);
|
||||
|
||||
/* ....................................................................... */
|
||||
|
||||
int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
|
||||
|
||||
@@ -262,6 +262,9 @@ typedef struct W_View {
|
||||
XSetWindowAttributes attribs;
|
||||
|
||||
void *hangedData; /* data holder for user program */
|
||||
|
||||
WMColor *backColor;
|
||||
|
||||
#if 0
|
||||
struct W_DragSourceProcs *dragSourceProcs;
|
||||
struct W_DragDestinationProcs *dragDestinationProcs;
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
#include <math.h> /* for : double rint (double) */
|
||||
|
||||
|
||||
char *WMBrowserDidScrollNotification = "WMBrowserDidScrollNotification";
|
||||
|
||||
|
||||
typedef struct W_Browser {
|
||||
W_Class widgetClass;
|
||||
@@ -35,7 +33,7 @@ typedef struct W_Browser {
|
||||
void *doubleClientData;
|
||||
WMAction *doubleAction;
|
||||
|
||||
WMBrowserFillColumnProc *fillColumn;
|
||||
WMBrowserDelegate *delegate;
|
||||
|
||||
WMScroller *scroller;
|
||||
|
||||
@@ -265,23 +263,6 @@ drawTitleOfColumn(WMBrowser *bPtr, int column)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title)
|
||||
{
|
||||
assert(column >= 0);
|
||||
assert(column < bPtr->usedColumnCount);
|
||||
|
||||
if (bPtr->titles[column])
|
||||
free(bPtr->titles[column]);
|
||||
|
||||
bPtr->titles[column] = wstrdup(title);
|
||||
|
||||
if (COLUMN_IS_VISIBLE(bPtr, column) && bPtr->flags.isTitled) {
|
||||
drawTitleOfColumn(bPtr, column);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
WMList*
|
||||
WMGetBrowserListInColumn(WMBrowser *bPtr, int column)
|
||||
{
|
||||
@@ -293,9 +274,9 @@ WMGetBrowserListInColumn(WMBrowser *bPtr, int column)
|
||||
|
||||
|
||||
void
|
||||
WMSetBrowserFillColumnProc(WMBrowser *bPtr, WMBrowserFillColumnProc *proc)
|
||||
WMSetBrowserDelegate(WMBrowser *bPtr, WMBrowserDelegate *delegate)
|
||||
{
|
||||
bPtr->fillColumn = proc;
|
||||
bPtr->delegate = delegate;
|
||||
}
|
||||
|
||||
|
||||
@@ -389,6 +370,23 @@ WMGetBrowserSelectedRowInColumn(WMBrowser *bPtr, int column)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title)
|
||||
{
|
||||
assert(column >= 0);
|
||||
assert(column < bPtr->usedColumnCount);
|
||||
|
||||
if (bPtr->titles[column])
|
||||
free(bPtr->titles[column]);
|
||||
|
||||
bPtr->titles[column] = wstrdup(title);
|
||||
|
||||
if (COLUMN_IS_VISIBLE(bPtr, column) && bPtr->flags.isTitled) {
|
||||
drawTitleOfColumn(bPtr, column);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetBrowserTitled(WMBrowser *bPtr, Bool flag)
|
||||
{
|
||||
@@ -750,6 +748,7 @@ WMGetBrowserPath(WMBrowser *bPtr)
|
||||
}
|
||||
|
||||
|
||||
|
||||
char*
|
||||
WMGetBrowserPathToColumn(WMBrowser *bPtr, int column)
|
||||
{
|
||||
@@ -792,11 +791,24 @@ WMGetBrowserPathToColumn(WMBrowser *bPtr, int column)
|
||||
static void
|
||||
loadColumn(WMBrowser *bPtr, int column)
|
||||
{
|
||||
assert(bPtr->fillColumn);
|
||||
|
||||
assert(bPtr->delegate);
|
||||
assert(bPtr->delegate->createRowsForColumn);
|
||||
|
||||
bPtr->flags.loadingColumn = 1;
|
||||
(*bPtr->fillColumn)(bPtr, column);
|
||||
(*bPtr->delegate->createRowsForColumn)(bPtr->delegate, bPtr, column,
|
||||
bPtr->columns[column]);
|
||||
bPtr->flags.loadingColumn = 0;
|
||||
|
||||
if (bPtr->delegate->titleOfColumn) {
|
||||
char *title;
|
||||
|
||||
title = (*bPtr->delegate->titleOfColumn)(bPtr->delegate, bPtr, column);
|
||||
|
||||
if (bPtr->titles[column])
|
||||
free(bPtr->titles[column]);
|
||||
|
||||
bPtr->titles[column] = title;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -850,12 +862,17 @@ scrollToColumn(WMBrowser *bPtr, int column, Bool updateScroller)
|
||||
int notify = 0;
|
||||
|
||||
|
||||
if (column != bPtr->firstVisibleColumn)
|
||||
if (column != bPtr->firstVisibleColumn) {
|
||||
notify = 1;
|
||||
}
|
||||
|
||||
if (column < 0)
|
||||
column = 0;
|
||||
|
||||
if (notify && bPtr->delegate && bPtr->delegate->willScroll) {
|
||||
(*bPtr->delegate->willScroll)(bPtr->delegate, bPtr);
|
||||
}
|
||||
|
||||
x = 0;
|
||||
bPtr->firstVisibleColumn = column;
|
||||
for (i = 0; i < bPtr->columnCount; i++) {
|
||||
@@ -888,8 +905,9 @@ scrollToColumn(WMBrowser *bPtr, int column, Bool updateScroller)
|
||||
if (bPtr->view->flags.mapped)
|
||||
paintBrowser(bPtr);
|
||||
|
||||
if (notify)
|
||||
WMPostNotificationName(WMBrowserDidScrollNotification, bPtr, NULL);
|
||||
if (notify && bPtr->delegate && bPtr->delegate->didScroll) {
|
||||
(*bPtr->delegate->didScroll)(bPtr->delegate, bPtr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1007,7 +1025,7 @@ listSelectionObserver(void *observerData, WMNotification *notification)
|
||||
int column, item = (int)WMGetNotificationClientData(notification);
|
||||
WMList *lPtr = (WMList*)WMGetNotificationObject(notification);
|
||||
|
||||
for (column=0; column<bPtr->usedColumnCount; column++)
|
||||
for (column = 0; column < bPtr->usedColumnCount; column++)
|
||||
if (bPtr->columns[column] == lPtr)
|
||||
break;
|
||||
|
||||
@@ -1095,7 +1113,7 @@ destroyBrowser(WMBrowser *bPtr)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i<bPtr->columnCount; i++) {
|
||||
for (i = 0; i < bPtr->columnCount; i++) {
|
||||
if (bPtr->titles[i])
|
||||
free(bPtr->titles[i]);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,8 @@ static void listDirectoryOnColumn(WMFilePanel *panel, int column, char *path);
|
||||
static void browserClick();
|
||||
static void browserDClick();
|
||||
|
||||
static void fillColumn(WMBrowser *bPtr, int column);
|
||||
static void fillColumn(WMBrowserDelegate *self, WMBrowser *bPtr, int column,
|
||||
WMList *list);
|
||||
|
||||
static void goHome();
|
||||
|
||||
@@ -74,6 +75,16 @@ static char *getCurrentFileName(WMFilePanel *panel);
|
||||
static void handleEvents(XEvent *event, void *data);
|
||||
|
||||
|
||||
|
||||
static WMBrowserDelegate browserDelegate = {
|
||||
NULL, /* data */
|
||||
fillColumn, /* createRowsForColumn */
|
||||
NULL, /* titleOfColumn */
|
||||
NULL, /* didScroll */
|
||||
NULL /* willScroll */
|
||||
};
|
||||
|
||||
|
||||
static int
|
||||
closestListItem(WMList *list, char *text, Bool exact)
|
||||
{
|
||||
@@ -198,7 +209,7 @@ makeFilePanel(WMScreen *scrPtr, char *name, char *title)
|
||||
WMSetFrameRelief(fPtr->line, WRGroove);
|
||||
|
||||
fPtr->browser = WMCreateBrowser(fPtr->win);
|
||||
WMSetBrowserFillColumnProc(fPtr->browser, fillColumn);
|
||||
WMSetBrowserDelegate(fPtr->browser, &browserDelegate);
|
||||
WMSetBrowserAction(fPtr->browser, browserClick, fPtr);
|
||||
WMSetBrowserDoubleAction(fPtr->browser, browserDClick, fPtr);
|
||||
WMMoveWidget(fPtr->browser, 7, 72);
|
||||
@@ -531,7 +542,7 @@ listDirectoryOnColumn(WMFilePanel *panel, int column, char *path)
|
||||
|
||||
|
||||
static void
|
||||
fillColumn(WMBrowser *bPtr, int column)
|
||||
fillColumn(WMBrowserDelegate *self, WMBrowser *bPtr, int column, WMList *list)
|
||||
{
|
||||
char *path;
|
||||
WMFilePanel *panel;
|
||||
|
||||
@@ -323,6 +323,7 @@ extern W_ViewProcedureTable _ColorWellViewProcedures;
|
||||
extern W_ViewProcedureTable _ScrollViewViewProcedures;
|
||||
extern W_ViewProcedureTable _SliderViewProcedures;
|
||||
extern W_ViewProcedureTable _SplitViewViewProcedures;
|
||||
extern W_ViewProcedureTable _TabViewViewProcedures;
|
||||
|
||||
/*
|
||||
* All widget classes defined must have an entry here.
|
||||
@@ -353,6 +354,7 @@ initProcedureTable()
|
||||
procedureTables[WC_ScrollView] = &_ScrollViewViewProcedures;
|
||||
procedureTables[WC_Slider] = &_SliderViewProcedures;
|
||||
procedureTables[WC_SplitView] = &_SplitViewViewProcedures;
|
||||
procedureTables[WC_TabView] = &_TabViewViewProcedures;
|
||||
}
|
||||
|
||||
|
||||
|
||||
646
WINGs/wtabview.c
Normal file
646
WINGs/wtabview.c
Normal file
@@ -0,0 +1,646 @@
|
||||
|
||||
#include "WINGsP.h"
|
||||
|
||||
|
||||
typedef struct W_TabView {
|
||||
W_Class widgetClass;
|
||||
W_View *view;
|
||||
|
||||
struct W_TabViewItem **items;
|
||||
int itemCount;
|
||||
int maxItems; /* size of items array */
|
||||
|
||||
int selectedItem;
|
||||
|
||||
WMFont *font;
|
||||
|
||||
WMColor *lightGray;
|
||||
WMColor *tabColor;
|
||||
|
||||
short tabWidth;
|
||||
short tabHeight;
|
||||
|
||||
struct {
|
||||
WMReliefType relief:4;
|
||||
WMTitlePosition titlePosition:4;
|
||||
WMTabViewTypes type:2;
|
||||
|
||||
unsigned tabbed:1;
|
||||
unsigned allowsTruncatedLabels:1;
|
||||
} flags;
|
||||
} TabView;
|
||||
|
||||
|
||||
|
||||
struct W_ViewProcedureTable _TabViewViewProcedures = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
#define DEFAULT_WIDTH 40
|
||||
#define DEFAULT_HEIGHT 40
|
||||
|
||||
|
||||
static void destroyTabView(TabView *tPtr);
|
||||
static void paintTabView(TabView *tPtr);
|
||||
|
||||
|
||||
static void W_SetTabViewItemParent(WMTabViewItem *item, WMTabView *parent);
|
||||
|
||||
static void W_DrawLabel(WMTabViewItem *item, Drawable d, WMRect rect);
|
||||
|
||||
static void W_UnmapTabViewItem(WMTabViewItem *item);
|
||||
|
||||
static void W_MapTabViewItem(WMTabViewItem *item);
|
||||
|
||||
static WMView *W_TabViewItemView(WMTabViewItem *item);
|
||||
|
||||
static void recalcTabWidth(TabView *tPtr);
|
||||
|
||||
|
||||
static void
|
||||
handleEvents(XEvent *event, void *data)
|
||||
{
|
||||
TabView *tPtr = (TabView*)data;
|
||||
|
||||
CHECK_CLASS(data, WC_TabView);
|
||||
|
||||
switch (event->type) {
|
||||
case Expose:
|
||||
if (event->xexpose.count!=0)
|
||||
break;
|
||||
paintTabView(tPtr);
|
||||
break;
|
||||
|
||||
case ButtonPress:
|
||||
{
|
||||
WMTabViewItem *item = WMTabViewItemAtPoint(tPtr,
|
||||
event->xbutton.x,
|
||||
event->xbutton.y);
|
||||
if (item) {
|
||||
WMSelectTabViewItem(tPtr, item);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case DestroyNotify:
|
||||
destroyTabView(tPtr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
WMTabView*
|
||||
WMCreateTabView(WMWidget *parent)
|
||||
{
|
||||
TabView *tPtr;
|
||||
WMScreen *scr = WMWidgetScreen(parent);
|
||||
|
||||
tPtr = wmalloc(sizeof(TabView));
|
||||
memset(tPtr, 0, sizeof(TabView));
|
||||
|
||||
tPtr->widgetClass = WC_TabView;
|
||||
|
||||
tPtr->view = W_CreateView(W_VIEW(parent));
|
||||
if (!tPtr->view) {
|
||||
free(tPtr);
|
||||
return NULL;
|
||||
}
|
||||
tPtr->view->self = tPtr;
|
||||
|
||||
tPtr->lightGray = WMCreateRGBColor(scr, 0xd9d9, 0xd9d9, 0xd9d9, False);
|
||||
tPtr->tabColor = WMCreateRGBColor(scr, 0x8420, 0x8420, 0x8420, False);
|
||||
|
||||
tPtr->font = WMRetainFont(scr->normalFont);
|
||||
|
||||
WMCreateEventHandler(tPtr->view, ExposureMask|StructureNotifyMask
|
||||
|ButtonPressMask, handleEvents, tPtr);
|
||||
|
||||
WMResizeWidget(tPtr, DEFAULT_WIDTH, DEFAULT_HEIGHT);
|
||||
|
||||
tPtr->tabHeight = WMFontHeight(tPtr->font) + 3;
|
||||
|
||||
return tPtr;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMAddItemInTabView(WMTabView *tPtr, WMTabViewItem *item)
|
||||
{
|
||||
WMInsertItemInTabView(tPtr, tPtr->itemCount, item);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item)
|
||||
{
|
||||
wassertr(W_TabViewItemView(item) != NULL);
|
||||
|
||||
if (tPtr->maxItems == tPtr->itemCount) {
|
||||
WMTabViewItem **items;
|
||||
|
||||
items = wrealloc(tPtr->items, tPtr->maxItems + 10);
|
||||
if (!items) {
|
||||
wwarning("out of memory allocating memory for tabview");
|
||||
return;
|
||||
}
|
||||
tPtr->items = items;
|
||||
tPtr->maxItems += 10;
|
||||
}
|
||||
|
||||
if (index > tPtr->itemCount)
|
||||
index = tPtr->itemCount;
|
||||
|
||||
if (index == 0) {
|
||||
W_UnmapTabViewItem(tPtr->items[0]);
|
||||
}
|
||||
|
||||
if (index < tPtr->itemCount) {
|
||||
memmove(&tPtr->items[index + 1], &tPtr->items[index],
|
||||
tPtr->itemCount - index);
|
||||
}
|
||||
|
||||
tPtr->items[index] = item;
|
||||
|
||||
tPtr->itemCount++;
|
||||
|
||||
recalcTabWidth(tPtr);
|
||||
|
||||
W_SetTabViewItemParent(item, tPtr);
|
||||
|
||||
W_UnmapTabViewItem(item);
|
||||
|
||||
W_ReparentView(W_TabViewItemView(item), tPtr->view, 1,
|
||||
tPtr->tabHeight + 1);
|
||||
|
||||
W_ResizeView(W_TabViewItemView(item), tPtr->view->size.width - 3,
|
||||
tPtr->view->size.height - tPtr->tabHeight - 3);
|
||||
|
||||
if (index == 0) {
|
||||
W_MapTabViewItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < tPtr->itemCount; i++) {
|
||||
if (tPtr->items[i] == item) {
|
||||
if (i < tPtr->itemCount - 1)
|
||||
memmove(&tPtr->items[i], &tPtr->items[i + 1],
|
||||
tPtr->itemCount - i - 1);
|
||||
else
|
||||
tPtr->items[i] = NULL;
|
||||
|
||||
W_SetTabViewItemParent(item, NULL);
|
||||
|
||||
tPtr->itemCount--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static Bool
|
||||
isInside(int x, int y, int width, int height, int px, int py)
|
||||
{
|
||||
if (py >= y + height - 3 && py <= y + height
|
||||
&& px >= x + py - (y + height - 3)
|
||||
&& px <= x + width - (py - (y + height - 3))) {
|
||||
|
||||
return True;
|
||||
}
|
||||
if (py >= y + 3 && py < y + height - 3
|
||||
&& px >= x + 3 + ((y + 3) - py)*3/7
|
||||
&& px <= x + width - 3 - ((y + 3) - py)*3/7) {
|
||||
|
||||
return True;
|
||||
}
|
||||
if (py >= y && py < y + 3
|
||||
&& px >= x + 7 + py - y
|
||||
&& px <= x + width - 7 - (py - y)) {
|
||||
|
||||
return True;
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
|
||||
WMTabViewItem*
|
||||
WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = tPtr->selectedItem;
|
||||
if (isInside(8 + (tPtr->tabWidth-10)*i, 0, tPtr->tabWidth,
|
||||
tPtr->tabHeight, x, y)) {
|
||||
return tPtr->items[i];
|
||||
}
|
||||
|
||||
for (i = 0; i < tPtr->itemCount; i++) {
|
||||
if (isInside(8 + (tPtr->tabWidth-10)*i, 0, tPtr->tabWidth,
|
||||
tPtr->tabHeight, x, y)) {
|
||||
return tPtr->items[i];
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSelectFirstTabViewItem(WMTabView *tPtr)
|
||||
{
|
||||
WMSelectTabViewItemAtIndex(tPtr, 0);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSelectLastTabViewItem(WMTabView *tPtr)
|
||||
{
|
||||
WMSelectTabViewItemAtIndex(tPtr, tPtr->itemCount);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSelectNextTabViewItem(WMTabView *tPtr)
|
||||
{
|
||||
WMSelectTabViewItemAtIndex(tPtr, tPtr->selectedItem + 1);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSelectPreviousTabViewItem(WMTabView *tPtr)
|
||||
{
|
||||
WMSelectTabViewItemAtIndex(tPtr, tPtr->selectedItem - 1);
|
||||
}
|
||||
|
||||
|
||||
WMTabViewItem*
|
||||
WMGetSelectedTabViewItem(WMTabView *tPtr)
|
||||
{
|
||||
return tPtr->items[tPtr->selectedItem];
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSelectTabViewItem(WMTabView *tPtr, WMTabViewItem *item)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < tPtr->itemCount; i++) {
|
||||
if (tPtr->items[i] == item) {
|
||||
WMSelectTabViewItemAtIndex(tPtr, i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index)
|
||||
{
|
||||
WMTabViewItem *item;
|
||||
|
||||
if (index == tPtr->selectedItem)
|
||||
return;
|
||||
|
||||
if (index < 0)
|
||||
index = 0;
|
||||
else if (index >= tPtr->itemCount)
|
||||
index = tPtr->itemCount - 1;
|
||||
|
||||
|
||||
item = tPtr->items[tPtr->selectedItem];
|
||||
|
||||
W_UnmapTabViewItem(item);
|
||||
|
||||
|
||||
item = tPtr->items[index];
|
||||
|
||||
W_MapTabViewItem(item);
|
||||
|
||||
tPtr->selectedItem = index;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
recalcTabWidth(TabView *tPtr)
|
||||
{
|
||||
int i;
|
||||
int twidth = W_VIEW(tPtr)->size.width;
|
||||
int width;
|
||||
|
||||
tPtr->tabWidth = 0;
|
||||
for (i = 0; i < tPtr->itemCount; i++) {
|
||||
char *str = WMGetTabViewItemLabel(tPtr->items[i]);
|
||||
|
||||
if (str) {
|
||||
width = WMWidthOfString(tPtr->font, str, strlen(str));
|
||||
if (width > tPtr->tabWidth)
|
||||
tPtr->tabWidth = width;
|
||||
}
|
||||
}
|
||||
tPtr->tabWidth += 30;
|
||||
if (tPtr->tabWidth > twidth - 10 * tPtr->itemCount
|
||||
&& tPtr->tabWidth < twidth - 16)
|
||||
tPtr->tabWidth = (twidth - 16) / tPtr->itemCount;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
drawRelief(W_Screen *scr, Drawable d, int x, int y, unsigned int width,
|
||||
unsigned int height)
|
||||
{
|
||||
Display *dpy = scr->display;
|
||||
GC bgc = WMColorGC(scr->black);
|
||||
GC wgc = WMColorGC(scr->white);
|
||||
GC dgc = WMColorGC(scr->darkGray);
|
||||
|
||||
XDrawLine(dpy, d, wgc, x, y, x, y+height-1);
|
||||
|
||||
XDrawLine(dpy, d, bgc, x, y+height-1, x+width-1, y+height-1);
|
||||
XDrawLine(dpy, d, dgc, x+1, y+height-2, x+width-2, y+height-2);
|
||||
|
||||
XDrawLine(dpy, d, bgc, x+width-1, y, x+width-1, y+height-1);
|
||||
XDrawLine(dpy, d, dgc, x+width-2, y+1, x+width-2, y+height-2);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
drawTab(TabView *tPtr, Drawable d, int x, int y,
|
||||
unsigned width, unsigned height, Bool selected)
|
||||
{
|
||||
WMScreen *scr = W_VIEW(tPtr)->screen;
|
||||
Display *dpy = scr->display;
|
||||
GC white = WMColorGC(selected ? scr->white : tPtr->lightGray);
|
||||
GC black = WMColorGC(scr->black);
|
||||
GC dark = WMColorGC(scr->darkGray);
|
||||
GC light = WMColorGC(scr->gray);
|
||||
XPoint trap[8];
|
||||
|
||||
trap[0].x = x + (selected ? 0 : 1);
|
||||
trap[0].y = y + height - (selected ? 0 : 1);
|
||||
|
||||
trap[1].x = x + 3;
|
||||
trap[1].y = y + height - 3;
|
||||
|
||||
trap[2].x = x + 10 - 3;
|
||||
trap[2].y = y + 3;
|
||||
|
||||
trap[3].x = x + 10;
|
||||
trap[3].y = y;
|
||||
|
||||
trap[4].x = x + width - 10;
|
||||
trap[4].y = y;
|
||||
|
||||
trap[5].x = x + width - 10 + 3;
|
||||
trap[5].y = y + 3;
|
||||
|
||||
trap[6].x = x + width - 3;
|
||||
trap[6].y = y + height - 3;
|
||||
|
||||
trap[7].x = x + width - (selected ? 0 : 1);
|
||||
trap[7].y = y + height - (selected ? 0 : 1);
|
||||
|
||||
XFillPolygon(dpy, d, selected ? light : WMColorGC(tPtr->tabColor), trap, 8,
|
||||
Convex, CoordModeOrigin);
|
||||
|
||||
XDrawLine(dpy, d, white, trap[0].x, trap[0].y, trap[1].x, trap[1].y);
|
||||
XDrawLine(dpy, d, white, trap[1].x, trap[1].y, trap[2].x, trap[2].y);
|
||||
XDrawLine(dpy, d, white, trap[2].x, trap[2].y, trap[3].x, trap[3].y);
|
||||
XDrawLine(dpy, d, white, trap[3].x, trap[3].y, trap[4].x, trap[4].y);
|
||||
XDrawLine(dpy, d, dark, trap[4].x, trap[4].y, trap[5].x, trap[5].y);
|
||||
XDrawLine(dpy, d, black, trap[5].x, trap[5].y, trap[6].x, trap[6].y);
|
||||
XDrawLine(dpy, d, black, trap[6].x, trap[6].y, trap[7].x, trap[7].y);
|
||||
|
||||
XDrawLine(dpy, d, selected ? light : WMColorGC(scr->white),
|
||||
trap[0].x, trap[0].y, trap[7].x, trap[7].y);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
paintTabView(TabView *tPtr)
|
||||
{
|
||||
Pixmap buffer;
|
||||
WMScreen *scr = W_VIEW(tPtr)->screen;
|
||||
Display *dpy = scr->display;
|
||||
GC white = WMColorGC(scr->white);
|
||||
int i;
|
||||
WMRect rect;
|
||||
|
||||
switch (tPtr->flags.type) {
|
||||
case WTTopTabsBevelBorder:
|
||||
drawRelief(scr, W_VIEW(tPtr)->window, 0, tPtr->tabHeight - 1,
|
||||
W_VIEW(tPtr)->size.width,
|
||||
W_VIEW(tPtr)->size.height - tPtr->tabHeight + 1);
|
||||
break;
|
||||
|
||||
case WTNoTabsBevelBorder:
|
||||
W_DrawRelief(scr, W_VIEW(tPtr)->window, 0, 0, W_VIEW(tPtr)->size.width,
|
||||
W_VIEW(tPtr)->size.height, WRRaised);
|
||||
break;
|
||||
|
||||
case WTNoTabsLineBorder:
|
||||
W_DrawRelief(scr, W_VIEW(tPtr)->window, 0, 0, W_VIEW(tPtr)->size.width,
|
||||
W_VIEW(tPtr)->size.height, WRSimple);
|
||||
break;
|
||||
|
||||
case WTNoTabsNoBorder:
|
||||
break;
|
||||
}
|
||||
|
||||
if (tPtr->flags.type == WTTopTabsBevelBorder) {
|
||||
buffer = XCreatePixmap(dpy, W_VIEW(tPtr)->window,
|
||||
W_VIEW(tPtr)->size.width, tPtr->tabHeight,
|
||||
W_VIEW(tPtr)->screen->depth);
|
||||
|
||||
XFillRectangle(dpy, buffer, WMColorGC(W_VIEW(tPtr)->backColor),
|
||||
0, 0, W_VIEW(tPtr)->size.width, tPtr->tabHeight);
|
||||
|
||||
rect.pos.x = 8 + 15;
|
||||
rect.pos.y = 2;
|
||||
rect.size.width = tPtr->tabWidth;
|
||||
rect.size.height = tPtr->tabHeight;
|
||||
|
||||
for (i = tPtr->itemCount - 1; i >= 0; i--) {
|
||||
if (i != tPtr->selectedItem) {
|
||||
drawTab(tPtr, buffer, 8 + (rect.size.width-10)*i, 0,
|
||||
rect.size.width, rect.size.height, False);
|
||||
}
|
||||
}
|
||||
drawTab(tPtr, buffer, 8 + (rect.size.width-10) * tPtr->selectedItem,
|
||||
0, rect.size.width, rect.size.height, True);
|
||||
|
||||
XDrawLine(dpy, buffer, white, 0, tPtr->tabHeight - 1,
|
||||
8, tPtr->tabHeight - 1);
|
||||
|
||||
XDrawLine(dpy, buffer, white,
|
||||
8 + 10 + (rect.size.width-10) * tPtr->itemCount,
|
||||
tPtr->tabHeight - 1, W_VIEW(tPtr)->size.width,
|
||||
tPtr->tabHeight - 1);
|
||||
|
||||
|
||||
for (i = 0; i < tPtr->itemCount; i++) {
|
||||
W_DrawLabel(tPtr->items[i], buffer, rect);
|
||||
|
||||
rect.pos.x += rect.size.width - 10;
|
||||
}
|
||||
|
||||
XCopyArea(dpy, buffer, W_VIEW(tPtr)->window, scr->copyGC, 0, 0,
|
||||
W_VIEW(tPtr)->size.width, tPtr->tabHeight, 0, 0);
|
||||
|
||||
XFreePixmap(dpy, buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
destroyTabView(TabView *tPtr)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < tPtr->itemCount; i++) {
|
||||
WMDestroyTabViewItem(tPtr->items[i]);
|
||||
}
|
||||
free(tPtr->items);
|
||||
|
||||
WMReleaseColor(tPtr->lightGray);
|
||||
WMReleaseColor(tPtr->tabColor);
|
||||
WMReleaseFont(tPtr->font);
|
||||
|
||||
free(tPtr);
|
||||
}
|
||||
|
||||
/******************************************************************/
|
||||
|
||||
|
||||
typedef struct W_TabViewItem {
|
||||
WMTabView *tabView;
|
||||
|
||||
W_View *view;
|
||||
|
||||
char *label;
|
||||
|
||||
int identifier;
|
||||
|
||||
struct {
|
||||
unsigned visible:1;
|
||||
} flags;
|
||||
} TabViewItem;
|
||||
|
||||
|
||||
static void
|
||||
W_SetTabViewItemParent(WMTabViewItem *item, WMTabView *parent)
|
||||
{
|
||||
item->tabView = parent;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
W_DrawLabel(WMTabViewItem *item, Drawable d, WMRect rect)
|
||||
{
|
||||
WMScreen *scr = W_VIEW(item->tabView)->screen;
|
||||
|
||||
if (!item->label)
|
||||
return;
|
||||
|
||||
WMDrawString(scr, d, WMColorGC(scr->black), item->tabView->font,
|
||||
rect.pos.x, rect.pos.y, item->label, strlen(item->label));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
W_UnmapTabViewItem(WMTabViewItem *item)
|
||||
{
|
||||
wassertr(item->view);
|
||||
|
||||
W_UnmapView(item->view);
|
||||
|
||||
item->flags.visible = 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
W_MapTabViewItem(WMTabViewItem *item)
|
||||
{
|
||||
wassertr(item->view);
|
||||
|
||||
W_MapView(item->view);
|
||||
|
||||
item->flags.visible = 1;
|
||||
}
|
||||
|
||||
|
||||
static WMView*
|
||||
W_TabViewItemView(WMTabViewItem *item)
|
||||
{
|
||||
return item->view;
|
||||
}
|
||||
|
||||
|
||||
WMTabViewItem*
|
||||
WMCreateTabViewItemWithIdentifier(int identifier)
|
||||
{
|
||||
WMTabViewItem *item;
|
||||
|
||||
item = wmalloc(sizeof(WMTabViewItem));
|
||||
memset(item, 0, sizeof(WMTabViewItem));
|
||||
|
||||
item->identifier = identifier;
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetTabViewItemLabel(WMTabViewItem *item, char *label)
|
||||
{
|
||||
if (item->label)
|
||||
free(item->label);
|
||||
|
||||
item->label = wstrdup(label);
|
||||
|
||||
if (item->tabView)
|
||||
recalcTabWidth(item->tabView);
|
||||
}
|
||||
|
||||
|
||||
char*
|
||||
WMGetTabViewItemLabel(WMTabViewItem *item)
|
||||
{
|
||||
return item->label;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetTabViewItemView(WMTabViewItem *item, WMView *view)
|
||||
{
|
||||
item->view = view;
|
||||
}
|
||||
|
||||
|
||||
WMView*
|
||||
WMGetTabViewItemView(WMTabViewItem *item)
|
||||
{
|
||||
return item->view;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMDestroyTabViewItem(WMTabViewItem *item)
|
||||
{
|
||||
if (item->label)
|
||||
free(item->label);
|
||||
|
||||
if (item->view)
|
||||
W_DestroyView(item->view);
|
||||
|
||||
free(item);
|
||||
}
|
||||
@@ -300,6 +300,7 @@ testSlider(WMScreen *scr)
|
||||
WMMapWidget(win);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
testTextField(WMScreen *scr)
|
||||
{
|
||||
@@ -369,13 +370,67 @@ testPullDown(WMScreen *scr)
|
||||
|
||||
|
||||
|
||||
void
|
||||
testTabView(WMScreen *scr)
|
||||
{
|
||||
WMWindow *win;
|
||||
WMTabView *tabv;
|
||||
WMTabViewItem *tab;
|
||||
WMFrame *frame;
|
||||
WMLabel *label;
|
||||
|
||||
windowCount++;
|
||||
|
||||
win = WMCreateWindow(scr, "testTabs");
|
||||
WMResizeWidget(win, 400, 300);
|
||||
|
||||
WMSetWindowCloseAction(win, closeAction, NULL);
|
||||
|
||||
tabv = WMCreateTabView(win);
|
||||
WMMoveWidget(tabv, 50, 50);
|
||||
WMResizeWidget(tabv, 300, 200);
|
||||
|
||||
frame = WMCreateFrame(win);
|
||||
WMSetFrameRelief(frame, WRFlat);
|
||||
label = WMCreateLabel(frame);
|
||||
WMResizeWidget(label, 100, 100);
|
||||
WMSetLabelText(label, "Label 1");
|
||||
WMMapWidget(label);
|
||||
|
||||
|
||||
tab = WMCreateTabViewItemWithIdentifier(0);
|
||||
WMSetTabViewItemView(tab, WMWidgetView(frame));
|
||||
WMAddItemInTabView(tabv, tab);
|
||||
WMSetTabViewItemLabel(tab, "Instances");
|
||||
|
||||
|
||||
frame = WMCreateFrame(win);
|
||||
WMSetFrameRelief(frame, WRFlat);
|
||||
label = WMCreateLabel(frame);
|
||||
WMResizeWidget(label, 100, 100);
|
||||
WMMoveWidget(label, 40, 40);
|
||||
WMSetLabelText(label, "Label 2");
|
||||
WMMapWidget(label);
|
||||
|
||||
tab = WMCreateTabViewItemWithIdentifier(0);
|
||||
WMSetTabViewItemView(tab, WMWidgetView(frame));
|
||||
WMAddItemInTabView(tabv, tab);
|
||||
WMSetTabViewItemLabel(tab, "Classes");
|
||||
|
||||
WMRealizeWidget(win);
|
||||
WMMapSubwidgets(win);
|
||||
WMMapWidget(win);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "WUtil.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
WMScreen *scr;
|
||||
WMPixmap *pixmap;
|
||||
|
||||
WMPixmap *pixmap;
|
||||
|
||||
/* Initialize the application */
|
||||
WMInitializeApplication("Test", &argc, argv);
|
||||
|
||||
@@ -416,10 +471,14 @@ int main(int argc, char **argv)
|
||||
*
|
||||
* Put the testSomething() function you want to test here.
|
||||
*/
|
||||
testGradientButtons(scr);
|
||||
|
||||
testTextField(scr);
|
||||
|
||||
testTabView(scr);
|
||||
|
||||
#if 0
|
||||
testGradientButtons(scr);
|
||||
|
||||
testOpenFilePanel(scr);
|
||||
testFontPanel(scr);
|
||||
testList(scr);
|
||||
|
||||
@@ -13,6 +13,27 @@
|
||||
#define CURSOR_BLINK_OFF_DELAY 300
|
||||
|
||||
|
||||
typedef struct WMTextFieldDelegate {
|
||||
void *data;
|
||||
|
||||
void (*didBeginEditing)(struct WMTextFieldDelegate *self,
|
||||
WMNotification *notif);
|
||||
|
||||
void (*didChange)(struct WMTextFieldDelegate *self,
|
||||
WMNotification *notif);
|
||||
|
||||
void (*didEndEditing)(struct WMTextFieldDelegate *self,
|
||||
WMNotification *notif);
|
||||
|
||||
Bool (*shouldBeginEditing)(struct WMTextFieldDelegate *self,
|
||||
WMTextField *tPtr);
|
||||
|
||||
Bool (*shouldEndEditing)(struct WMTextFieldDelegate *self,
|
||||
WMTextField *tPtr);
|
||||
} WMTextFieldDelegate;
|
||||
|
||||
|
||||
|
||||
char *WMTextDidChangeNotification = "WMTextDidChangeNotification";
|
||||
char *WMTextDidBeginEditingNotification = "WMTextDidBeginEditingNotification";
|
||||
char *WMTextDidEndEditingNotification = "WMTextDidEndEditingNotification";
|
||||
@@ -43,6 +64,8 @@ typedef struct W_TextField {
|
||||
|
||||
WMFont *font;
|
||||
|
||||
WMTextFieldDelegate *delegate;
|
||||
|
||||
#if 0
|
||||
WMHandlerID timerID; /* for cursor blinking */
|
||||
#endif
|
||||
@@ -69,6 +92,13 @@ typedef struct W_TextField {
|
||||
} TextField;
|
||||
|
||||
|
||||
#define NOTIFY(T,C,N,A) { WMNotification *notif = WMCreateNotification(N,T,A);\
|
||||
if ((T)->delegate && (T)->delegate->C)\
|
||||
(*(T)->delegate->C)((T)->delegate,notif);\
|
||||
WMPostNotification(notif);\
|
||||
WMReleaseNotification(notif);}
|
||||
|
||||
|
||||
#define MIN_TEXT_BUFFER 2
|
||||
#define TEXT_BUFFER_INCR 8
|
||||
|
||||
@@ -218,6 +248,13 @@ WMCreateTextField(WMWidget *parent)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetTextFieldDelegate(WMTextField *tPtr, WMTextFieldDelegate *delegate)
|
||||
{
|
||||
tPtr->delegate = delegate;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMInsertTextFieldText(WMTextField *tPtr, char *text, int position)
|
||||
{
|
||||
@@ -248,9 +285,9 @@ WMInsertTextFieldText(WMTextField *tPtr, char *text, int position)
|
||||
/* insert text at position */
|
||||
memmv(&(tPtr->text[position+len]), &(tPtr->text[position]),
|
||||
tPtr->textLen-position+1);
|
||||
|
||||
|
||||
memcpy(&(tPtr->text[position]), text, len);
|
||||
|
||||
|
||||
tPtr->textLen += len;
|
||||
if (position >= tPtr->cursorPosition) {
|
||||
tPtr->cursorPosition += len;
|
||||
@@ -259,11 +296,11 @@ WMInsertTextFieldText(WMTextField *tPtr, char *text, int position)
|
||||
incrToFit(tPtr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
paintTextField(tPtr);
|
||||
|
||||
WMPostNotificationName(WMTextDidChangeNotification, tPtr,
|
||||
(void*)WMInsertTextEvent);
|
||||
NOTIFY(tPtr, didChange, WMTextDidChangeNotification,
|
||||
(void*)WMInsertTextEvent);
|
||||
}
|
||||
|
||||
|
||||
@@ -304,8 +341,8 @@ void
|
||||
WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range)
|
||||
{
|
||||
deleteTextFieldRange(tPtr, range);
|
||||
WMPostNotificationName(WMTextDidChangeNotification, tPtr,
|
||||
(void*)WMDeleteTextEvent);
|
||||
NOTIFY(tPtr, didChange, WMTextDidChangeNotification,
|
||||
(void*)WMDeleteTextEvent);
|
||||
}
|
||||
|
||||
|
||||
@@ -349,8 +386,8 @@ WMSetTextFieldText(WMTextField *tPtr, char *text)
|
||||
if (tPtr->view->flags.realized)
|
||||
paintTextField(tPtr);
|
||||
|
||||
WMPostNotificationName(WMTextDidChangeNotification, tPtr,
|
||||
(void*)WMSetTextEvent);
|
||||
NOTIFY(tPtr, didChange, WMTextDidChangeNotification,
|
||||
(void*)WMSetTextEvent);
|
||||
}
|
||||
|
||||
|
||||
@@ -362,6 +399,7 @@ WMSetTextFieldFont(WMTextField *tPtr, WMFont *font)
|
||||
tPtr->font = WMRetainFont(font);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment)
|
||||
{
|
||||
@@ -679,12 +717,12 @@ paintTextField(TextField *tPtr)
|
||||
|
||||
ty = tPtr->offsetWidth;
|
||||
switch (tPtr->flags.alignment) {
|
||||
case WALeft:
|
||||
case WALeft:
|
||||
tx = tPtr->offsetWidth + 1;
|
||||
if (tw < tPtr->usableWidth)
|
||||
XFillRectangle(screen->display, drawbuffer,
|
||||
WMColorGC(screen->white),
|
||||
bd+tw,bd, totalWidth-tw,view->size.height-2*bd);
|
||||
XFillRectangle(screen->display, drawbuffer,
|
||||
WMColorGC(screen->white),
|
||||
bd+tw,bd, totalWidth-tw,view->size.height-2*bd);
|
||||
break;
|
||||
|
||||
case WACenter:
|
||||
@@ -742,8 +780,8 @@ paintTextField(TextField *tPtr)
|
||||
WMSetColorInGC(screen->black, screen->textFieldGC);
|
||||
} else {
|
||||
XFillRectangle(screen->display, drawbuffer,
|
||||
WMColorGC(screen->white),
|
||||
bd,bd, totalWidth,view->size.height-2*bd);
|
||||
WMColorGC(screen->white),
|
||||
bd,bd, totalWidth,view->size.height-2*bd);
|
||||
}
|
||||
|
||||
/* draw relief */
|
||||
@@ -754,8 +792,8 @@ paintTextField(TextField *tPtr)
|
||||
if (tPtr->flags.secure)
|
||||
free(text);
|
||||
XCopyArea(screen->display, drawbuffer, view->window,
|
||||
screen->copyGC, 0,0, view->size.width,
|
||||
view->size.height,0,0);
|
||||
screen->copyGC, 0,0, view->size.width,
|
||||
view->size.height,0,0);
|
||||
XFreePixmap(screen->display, drawbuffer);
|
||||
|
||||
/* draw cursor */
|
||||
@@ -805,11 +843,11 @@ handleEvents(XEvent *event, void *data)
|
||||
#endif
|
||||
paintTextField(tPtr);
|
||||
|
||||
WMPostNotificationName(WMTextDidBeginEditingNotification, tPtr, NULL);
|
||||
NOTIFY(tPtr, didBeginEditing, WMTextDidBeginEditingNotification, NULL);
|
||||
|
||||
tPtr->flags.notIllegalMovement = 0;
|
||||
break;
|
||||
|
||||
|
||||
case FocusOut:
|
||||
tPtr->flags.focused = 0;
|
||||
#if 0
|
||||
@@ -820,8 +858,8 @@ handleEvents(XEvent *event, void *data)
|
||||
|
||||
paintTextField(tPtr);
|
||||
if (!tPtr->flags.notIllegalMovement) {
|
||||
WMPostNotificationName(WMTextDidEndEditingNotification, tPtr,
|
||||
(void*)WMIllegalTextMovement);
|
||||
NOTIFY(tPtr, didEndEditing, WMTextDidEndEditingNotification,
|
||||
(void*)WMIllegalTextMovement);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -878,22 +916,22 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
|
||||
tPtr->view->prevFocusChain);
|
||||
tPtr->flags.notIllegalMovement = 1;
|
||||
}
|
||||
WMPostNotificationName(WMTextDidEndEditingNotification, tPtr,
|
||||
(void*)WMBacktabTextMovement);
|
||||
NOTIFY(tPtr, didEndEditing, WMTextDidEndEditingNotification,
|
||||
(void*)WMBacktabTextMovement);
|
||||
} else {
|
||||
if (tPtr->view->nextFocusChain) {
|
||||
W_SetFocusOfTopLevel(W_TopLevelOfView(tPtr->view),
|
||||
tPtr->view->nextFocusChain);
|
||||
tPtr->view->nextFocusChain);
|
||||
tPtr->flags.notIllegalMovement = 1;
|
||||
}
|
||||
WMPostNotificationName(WMTextDidEndEditingNotification,
|
||||
tPtr, (void*)WMTabTextMovement);
|
||||
NOTIFY(tPtr, didEndEditing, WMTextDidEndEditingNotification,
|
||||
(void*)WMTabTextMovement);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case XK_Return:
|
||||
WMPostNotificationName(WMTextDidEndEditingNotification, tPtr,
|
||||
(void*)WMReturnTextMovement);
|
||||
NOTIFY(tPtr, didEndEditing, WMTextDidEndEditingNotification,
|
||||
(void*)WMReturnTextMovement);
|
||||
break;
|
||||
|
||||
case WM_EMACSKEY_LEFT:
|
||||
@@ -1196,7 +1234,7 @@ handleTextFieldActionEvents(XEvent *event, void *data)
|
||||
}
|
||||
if(textWidth < tPtr->usableWidth){
|
||||
tPtr->cursorPosition = pointToCursorPosition(tPtr,
|
||||
event->xbutton.x - tPtr->usableWidth
|
||||
event->xbutton.x - tPtr->usableWidth
|
||||
+ textWidth);
|
||||
}
|
||||
else tPtr->cursorPosition = pointToCursorPosition(tPtr,
|
||||
@@ -1231,12 +1269,13 @@ handleTextFieldActionEvents(XEvent *event, void *data)
|
||||
text = W_GetTextSelection(tPtr->view->screen,
|
||||
tPtr->view->screen->clipboardAtom);
|
||||
if (!text) {
|
||||
text = W_GetTextSelection(tPtr->view->screen, XA_CUT_BUFFER0);
|
||||
text = W_GetTextSelection(tPtr->view->screen,
|
||||
XA_CUT_BUFFER0);
|
||||
}
|
||||
if (text) {
|
||||
WMInsertTextFieldText(tPtr, text, tPtr->cursorPosition);
|
||||
XFree(text);
|
||||
WMPostNotificationName(WMTextDidChangeNotification, tPtr, NULL);
|
||||
WMInsertTextFieldText(tPtr, text, tPtr->cursorPosition);
|
||||
XFree(text);
|
||||
NOTIFY(tPtr, didChange, WMTextDidChangeNotification, NULL);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -127,6 +127,8 @@ createView(W_Screen *screen, W_View *parent)
|
||||
view->attribs.border_pixel = W_PIXEL(screen->black);
|
||||
view->attribs.colormap = screen->colormap;
|
||||
|
||||
view->backColor = WMRetainColor(screen->gray);
|
||||
|
||||
adoptChildView(parent, view);
|
||||
}
|
||||
|
||||
@@ -492,6 +494,10 @@ W_RedisplayView(W_View *view)
|
||||
void
|
||||
W_SetViewBackgroundColor(W_View *view, WMColor *color)
|
||||
{
|
||||
if (view->backColor)
|
||||
WMReleaseColor(view->backColor);
|
||||
view->backColor = WMRetainColor(color);
|
||||
|
||||
view->attribFlags |= CWBackPixel;
|
||||
view->attribs.background_pixel = color->color.pixel;
|
||||
if (view->flags.realized) {
|
||||
|
||||
@@ -51,16 +51,22 @@ typedef struct _Panel {
|
||||
|
||||
WMPopUpButton *secP;
|
||||
|
||||
WMTabView *tabv;
|
||||
|
||||
/* texture list */
|
||||
WMLabel *texL;
|
||||
WMFrame *texF;
|
||||
WMList *texLs;
|
||||
WMLabel *texsL;
|
||||
|
||||
WMButton *newB;
|
||||
WMButton *editB;
|
||||
WMButton *ripB;
|
||||
WMButton *delB;
|
||||
|
||||
/* text color */
|
||||
WMFrame *colF;
|
||||
|
||||
/* */
|
||||
|
||||
int textureIndex[8];
|
||||
|
||||
WMFont *smallFont;
|
||||
@@ -605,11 +611,11 @@ updatePreviewBox(_Panel *panel, int elements)
|
||||
WMColor *color;
|
||||
|
||||
panel->preview = XCreatePixmap(dpy, WMWidgetXID(panel->win),
|
||||
260-4, 165-4, WMScreenDepth(scr));
|
||||
240-4, 165-4, WMScreenDepth(scr));
|
||||
|
||||
color = WMGrayColor(scr);
|
||||
XFillRectangle(dpy, panel->preview, WMColorGC(color),
|
||||
0, 0, 260-4, 165-4);
|
||||
0, 0, 240-4, 165-4);
|
||||
WMReleaseColor(color);
|
||||
|
||||
refresh = -1;
|
||||
@@ -619,7 +625,7 @@ updatePreviewBox(_Panel *panel, int elements)
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[0]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
|
||||
pix = renderTexture(scr, titem->prop, 210, 20, NULL, RBEV_RAISED2);
|
||||
pix = renderTexture(scr, titem->prop, 190, 20, NULL, RBEV_RAISED2);
|
||||
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 210, 20, 30, 5);
|
||||
|
||||
@@ -629,7 +635,7 @@ updatePreviewBox(_Panel *panel, int elements)
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[1]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
|
||||
pix = renderTexture(scr, titem->prop, 210, 20, NULL, RBEV_RAISED2);
|
||||
pix = renderTexture(scr, titem->prop, 190, 20, NULL, RBEV_RAISED2);
|
||||
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 210, 20, 30, 30);
|
||||
|
||||
@@ -639,7 +645,7 @@ updatePreviewBox(_Panel *panel, int elements)
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[2]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
|
||||
pix = renderTexture(scr, titem->prop, 210, 20, NULL, RBEV_RAISED2);
|
||||
pix = renderTexture(scr, titem->prop, 190, 20, NULL, RBEV_RAISED2);
|
||||
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 210, 20, 30, 55);
|
||||
|
||||
@@ -649,7 +655,7 @@ updatePreviewBox(_Panel *panel, int elements)
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[3]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
|
||||
pix = renderTexture(scr, titem->prop, 210, 9, NULL, RESIZEBAR_BEVEL);
|
||||
pix = renderTexture(scr, titem->prop, 190, 9, NULL, RESIZEBAR_BEVEL);
|
||||
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 210, 20, 30, 80);
|
||||
|
||||
@@ -659,9 +665,9 @@ updatePreviewBox(_Panel *panel, int elements)
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[4]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
|
||||
pix = renderTexture(scr, titem->prop, 100, 20, NULL, RBEV_RAISED2);
|
||||
pix = renderTexture(scr, titem->prop, 90, 20, NULL, RBEV_RAISED2);
|
||||
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 100, 20, 30, 95);
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 90, 20, 30, 95);
|
||||
|
||||
XFreePixmap(dpy, pix);
|
||||
}
|
||||
@@ -669,15 +675,15 @@ updatePreviewBox(_Panel *panel, int elements)
|
||||
item = WMGetListItem(panel->texLs, panel->textureIndex[5]);
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
|
||||
pix = renderMenu(panel, titem->prop, 100, 18);
|
||||
pix = renderMenu(panel, titem->prop, 90, 18);
|
||||
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 100, 18*3, 30, 115);
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 90, 18*3, 30, 115);
|
||||
|
||||
XFreePixmap(dpy, pix);
|
||||
}
|
||||
if (elements & (MITEM|MTITLE)) {
|
||||
XDrawLine(dpy, panel->preview, gc, 29, 95, 29, 115+36+20);
|
||||
XDrawLine(dpy, panel->preview, gc, 29, 94, 129, 94);
|
||||
XDrawLine(dpy, panel->preview, gc, 29, 94, 119, 94);
|
||||
}
|
||||
|
||||
if (elements & ICON) {
|
||||
@@ -687,7 +693,7 @@ updatePreviewBox(_Panel *panel, int elements)
|
||||
pix = renderTexture(scr, titem->prop, 64, 64, NULL,
|
||||
titem->ispixmap ? 0 : RBEV_RAISED3);
|
||||
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 64, 64, 170, 95);
|
||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 64, 64, 155, 95);
|
||||
|
||||
XFreePixmap(dpy, pix);
|
||||
}
|
||||
@@ -696,7 +702,7 @@ updatePreviewBox(_Panel *panel, int elements)
|
||||
if (refresh < 0) {
|
||||
WMPixmap *p;
|
||||
p = WMCreatePixmapFromXPixmaps(scr, panel->preview, None,
|
||||
260-4, 165-4, WMScreenDepth(scr));
|
||||
240-4, 165-4, WMScreenDepth(scr));
|
||||
|
||||
WMSetLabelImage(panel->prevL, p);
|
||||
WMReleasePixmap(p);
|
||||
@@ -945,7 +951,6 @@ changePage(WMWidget *w, void *data)
|
||||
int section;
|
||||
WMListItem *item;
|
||||
TextureListItem *titem;
|
||||
char *str;
|
||||
WMScreen *scr = WMWidgetScreen(w);
|
||||
RContext *rc = WMScreenRContext(scr);
|
||||
static WMPoint positions[] = {
|
||||
@@ -955,7 +960,7 @@ changePage(WMWidget *w, void *data)
|
||||
{5, 80},
|
||||
{5, 95},
|
||||
{5, 130},
|
||||
{145, 110}
|
||||
{130, 110}
|
||||
};
|
||||
|
||||
section = WMGetPopUpButtonSelectedItem(panel->secP);
|
||||
@@ -968,11 +973,6 @@ changePage(WMWidget *w, void *data)
|
||||
|
||||
titem = (TextureListItem*)item->clientData;
|
||||
|
||||
str = wmalloc(strlen(titem->title) + strlen(titem->texture) + 4);
|
||||
sprintf(str, "%s: %s", titem->title, titem->texture);
|
||||
WMSetLabelText(panel->texsL, str);
|
||||
free(str);
|
||||
|
||||
{
|
||||
WMColor *color;
|
||||
|
||||
@@ -997,13 +997,13 @@ previewClick(XEvent *event, void *clientData)
|
||||
_Panel *panel = (_Panel*)clientData;
|
||||
int i;
|
||||
static WMRect parts[] = {
|
||||
{{30, 5},{210, 20}},
|
||||
{{30,30},{210,20}},
|
||||
{{30,55},{210,20}},
|
||||
{{30,80},{210,9}},
|
||||
{{30,95},{100,20}},
|
||||
{{30,115},{100,60}},
|
||||
{{170,90},{64,64}}
|
||||
{{30, 5},{190, 20}},
|
||||
{{30,30},{190,20}},
|
||||
{{30,55},{190,20}},
|
||||
{{30,80},{190,9}},
|
||||
{{30,95},{90,20}},
|
||||
{{30,115},{90,60}},
|
||||
{{155,90},{64,64}}
|
||||
};
|
||||
|
||||
for (i = 0; i < 7; i++) {
|
||||
@@ -1050,7 +1050,6 @@ textureDoubleClick(WMWidget *w, void *data)
|
||||
int i, section;
|
||||
WMListItem *item;
|
||||
TextureListItem *titem;
|
||||
char *str;
|
||||
|
||||
/* unselect old texture */
|
||||
section = WMGetPopUpButtonSelectedItem(panel->secP);
|
||||
@@ -1072,11 +1071,6 @@ textureDoubleClick(WMWidget *w, void *data)
|
||||
|
||||
WMRedisplayWidget(panel->texLs);
|
||||
|
||||
str = wmalloc(strlen(titem->title) + strlen(titem->texture) + 4);
|
||||
sprintf(str, "%s: %s", titem->title, titem->texture);
|
||||
WMSetLabelText(panel->texsL, str);
|
||||
free(str);
|
||||
|
||||
updatePreviewBox(panel, 1<<section);
|
||||
}
|
||||
|
||||
@@ -1205,9 +1199,9 @@ static void
|
||||
createPanel(Panel *p)
|
||||
{
|
||||
_Panel *panel = (_Panel*)p;
|
||||
WMColor *color;
|
||||
WMFont *font;
|
||||
WMScreen *scr = WMWidgetScreen(panel->win);
|
||||
WMTabViewItem *item;
|
||||
|
||||
char *tmp;
|
||||
Bool ok = True;
|
||||
@@ -1245,7 +1239,7 @@ createPanel(Panel *p)
|
||||
|
||||
/* preview box */
|
||||
panel->prevL = WMCreateLabel(panel->frame);
|
||||
WMResizeWidget(panel->prevL, 260, 165);
|
||||
WMResizeWidget(panel->prevL, 240, 165);
|
||||
WMMoveWidget(panel->prevL, 15, 10);
|
||||
WMSetLabelRelief(panel->prevL, WRSunken);
|
||||
WMSetLabelImagePosition(panel->prevL, WIPImageOnly);
|
||||
@@ -1255,7 +1249,7 @@ createPanel(Panel *p)
|
||||
|
||||
|
||||
panel->secP = WMCreatePopUpButton(panel->frame);
|
||||
WMResizeWidget(panel->secP, 260, 20);
|
||||
WMResizeWidget(panel->secP, 240, 20);
|
||||
WMMoveWidget(panel->secP, 15, 180);
|
||||
WMSetPopUpButtonSelectedItem(panel->secP, 0);
|
||||
WMAddPopUpButtonItem(panel->secP, _("Titlebar of Focused Window"));
|
||||
@@ -1269,34 +1263,27 @@ createPanel(Panel *p)
|
||||
*/
|
||||
WMSetPopUpButtonAction(panel->secP, changePage, panel);
|
||||
|
||||
|
||||
panel->texsL = WMCreateLabel(panel->frame);
|
||||
WMResizeWidget(panel->texsL, 260, 20);
|
||||
WMMoveWidget(panel->texsL, 15, 205);
|
||||
WMSetLabelWraps(panel->texsL, False);
|
||||
|
||||
/* texture list */
|
||||
font = WMBoldSystemFontOfSize(scr, 12);
|
||||
/* tabview */
|
||||
|
||||
panel->texL = WMCreateLabel(panel->frame);
|
||||
WMResizeWidget(panel->texL, 225, 18);
|
||||
WMMoveWidget(panel->texL, 285, 10);
|
||||
WMSetLabelFont(panel->texL, font);
|
||||
WMSetLabelText(panel->texL, _("Textures"));
|
||||
WMSetLabelRelief(panel->texL, WRSunken);
|
||||
WMSetLabelTextAlignment(panel->texL, WACenter);
|
||||
color = WMDarkGrayColor(scr);
|
||||
WMSetWidgetBackgroundColor(panel->texL, color);
|
||||
WMReleaseColor(color);
|
||||
color = WMWhiteColor(scr);
|
||||
WMSetLabelTextColor(panel->texL, color);
|
||||
WMReleaseColor(color);
|
||||
panel->tabv = WMCreateTabView(panel->frame);
|
||||
WMResizeWidget(panel->tabv, 245, FRAME_HEIGHT - 20);
|
||||
WMMoveWidget(panel->tabv, 265, 10);
|
||||
|
||||
WMReleaseFont(font);
|
||||
/*** texture list ***/
|
||||
|
||||
panel->texLs = WMCreateList(panel->frame);
|
||||
WMResizeWidget(panel->texLs, 225, 144);
|
||||
WMMoveWidget(panel->texLs, 285, 30);
|
||||
panel->texF = WMCreateFrame(panel->frame);
|
||||
WMSetFrameRelief(panel->texF, WRFlat);
|
||||
|
||||
item = WMCreateTabViewItemWithIdentifier(0);
|
||||
WMSetTabViewItemView(item, WMWidgetView(panel->texF));
|
||||
WMSetTabViewItemLabel(item, _("Texture"));
|
||||
|
||||
WMAddItemInTabView(panel->tabv, item);
|
||||
|
||||
panel->texLs = WMCreateList(panel->texF);
|
||||
WMResizeWidget(panel->texLs, 232, 130);
|
||||
WMMoveWidget(panel->texLs, 5, 5);
|
||||
WMSetListUserDrawItemHeight(panel->texLs, 35);
|
||||
WMSetListUserDrawProc(panel->texLs, paintListItem);
|
||||
WMHangData(panel->texLs, panel);
|
||||
@@ -1312,9 +1299,9 @@ createPanel(Panel *p)
|
||||
font = WMSystemFontOfSize(scr, 10);
|
||||
|
||||
|
||||
panel->newB = WMCreateCommandButton(panel->frame);
|
||||
WMResizeWidget(panel->newB, 56, 48);
|
||||
WMMoveWidget(panel->newB, 285, 180);
|
||||
panel->newB = WMCreateCommandButton(panel->texF);
|
||||
WMResizeWidget(panel->newB, 57, 48);
|
||||
WMMoveWidget(panel->newB, 5, 142);
|
||||
WMSetButtonFont(panel->newB, font);
|
||||
WMSetButtonImagePosition(panel->newB, WIPAbove);
|
||||
WMSetButtonText(panel->newB, _("New"));
|
||||
@@ -1324,9 +1311,9 @@ createPanel(Panel *p)
|
||||
WMSetBalloonTextForView(_("Create a new texture."),
|
||||
WMWidgetView(panel->newB));
|
||||
|
||||
panel->ripB = WMCreateCommandButton(panel->frame);
|
||||
WMResizeWidget(panel->ripB, 56, 48);
|
||||
WMMoveWidget(panel->ripB, 341, 180);
|
||||
panel->ripB = WMCreateCommandButton(panel->texF);
|
||||
WMResizeWidget(panel->ripB, 57, 48);
|
||||
WMMoveWidget(panel->ripB, 63, 142);
|
||||
WMSetButtonFont(panel->ripB, font);
|
||||
WMSetButtonImagePosition(panel->ripB, WIPAbove);
|
||||
WMSetButtonText(panel->ripB, _("Extract..."));
|
||||
@@ -1338,9 +1325,9 @@ createPanel(Panel *p)
|
||||
|
||||
WMSetButtonEnabled(panel->ripB, False);
|
||||
|
||||
panel->editB = WMCreateCommandButton(panel->frame);
|
||||
WMResizeWidget(panel->editB, 56, 48);
|
||||
WMMoveWidget(panel->editB, 397, 180);
|
||||
panel->editB = WMCreateCommandButton(panel->texF);
|
||||
WMResizeWidget(panel->editB, 57, 48);
|
||||
WMMoveWidget(panel->editB, 121, 142);
|
||||
WMSetButtonFont(panel->editB, font);
|
||||
WMSetButtonImagePosition(panel->editB, WIPAbove);
|
||||
WMSetButtonText(panel->editB, _("Edit"));
|
||||
@@ -1349,9 +1336,9 @@ createPanel(Panel *p)
|
||||
WMSetBalloonTextForView(_("Edit the highlighted texture."),
|
||||
WMWidgetView(panel->editB));
|
||||
|
||||
panel->delB = WMCreateCommandButton(panel->frame);
|
||||
WMResizeWidget(panel->delB, 56, 48);
|
||||
WMMoveWidget(panel->delB, 453, 180);
|
||||
panel->delB = WMCreateCommandButton(panel->texF);
|
||||
WMResizeWidget(panel->delB, 57, 48);
|
||||
WMMoveWidget(panel->delB, 179, 142);
|
||||
WMSetButtonFont(panel->delB, font);
|
||||
WMSetButtonImagePosition(panel->delB, WIPAbove);
|
||||
WMSetButtonText(panel->delB, _("Delete"));
|
||||
@@ -1363,6 +1350,19 @@ createPanel(Panel *p)
|
||||
|
||||
WMReleaseFont(font);
|
||||
|
||||
WMMapSubwidgets(panel->texF);
|
||||
|
||||
/*** colors ***/
|
||||
panel->colF = WMCreateFrame(panel->frame);
|
||||
WMSetFrameRelief(panel->colF, WRFlat);
|
||||
|
||||
item = WMCreateTabViewItemWithIdentifier(1);
|
||||
WMSetTabViewItemView(item, WMWidgetView(panel->colF));
|
||||
WMSetTabViewItemLabel(item, _("Color"));
|
||||
|
||||
WMAddItemInTabView(panel->tabv, item);
|
||||
|
||||
|
||||
/**/
|
||||
|
||||
WMRealizeWidget(panel->frame);
|
||||
|
||||
@@ -134,6 +134,18 @@ enum {
|
||||
|
||||
static void showData(_Panel *panel);
|
||||
|
||||
static void fillBrowser(WMBrowserDelegate *self, WMBrowser *bPtr, int column,
|
||||
WMList *list);
|
||||
|
||||
static void scrolledBrowser(WMBrowserDelegate *self, WMBrowser *sender);
|
||||
|
||||
static WMBrowserDelegate browserDelegate = {
|
||||
NULL, /* data */
|
||||
fillBrowser, /* createRowsForColumn */
|
||||
NULL, /* titleOfColumn */
|
||||
scrolledBrowser, /* didScroll */
|
||||
NULL /* willScroll */
|
||||
};
|
||||
|
||||
|
||||
static Bool
|
||||
@@ -674,7 +686,7 @@ browserClick(WMWidget *w, void *data)
|
||||
|
||||
|
||||
static void
|
||||
fillBrowserColumn(WMBrowser *bPtr, int column)
|
||||
fillBrowser(WMBrowserDelegate *self, WMBrowser *bPtr, int column, WMList *list)
|
||||
{
|
||||
_Panel *panel = (_Panel*)WMGetHangedData(bPtr);
|
||||
proplist_t menuItem;
|
||||
@@ -1010,13 +1022,13 @@ captureClick(WMWidget *w, void *data)
|
||||
|
||||
|
||||
static void
|
||||
scrolledBrowser(void *observerData, WMNotification *notification)
|
||||
scrolledBrowser(WMBrowserDelegate *self, WMBrowser *sender)
|
||||
{
|
||||
_Panel *panel = (_Panel*)observerData;
|
||||
_Panel *panel = (_Panel*)self->data;
|
||||
int column;
|
||||
proplist_t item;
|
||||
|
||||
column = WMGetBrowserFirstVisibleColumn(panel->browser);
|
||||
column = WMGetBrowserFirstVisibleColumn(sender);
|
||||
|
||||
item = getSubmenuInColumn(panel, column);
|
||||
WMSetTextFieldText(panel->tit1T, getItemTitle(item));
|
||||
@@ -1122,12 +1134,11 @@ createPanel(_Panel *p)
|
||||
WMSetBrowserTitled(panel->browser, False);
|
||||
WMResizeWidget(panel->browser, 295, 160);
|
||||
WMMoveWidget(panel->browser, 15, 65);
|
||||
WMSetBrowserFillColumnProc(panel->browser, fillBrowserColumn);
|
||||
WMSetBrowserDelegate(panel->browser, &browserDelegate);
|
||||
WMHangData(panel->browser, panel);
|
||||
WMSetBrowserPathSeparator(panel->browser, "\r");
|
||||
WMSetBrowserAction(panel->browser, browserClick, panel);
|
||||
WMAddNotificationObserver(scrolledBrowser, panel,
|
||||
WMBrowserDidScrollNotification, panel->browser);
|
||||
|
||||
/**/
|
||||
|
||||
panel->labF = WMCreateFrame(panel->frame);
|
||||
|
||||
@@ -263,14 +263,14 @@ createPanel(Panel *p)
|
||||
WMHangData(panel->icoL, panel);
|
||||
|
||||
panel->icoaB = WMCreateCommandButton(panel->icoF);
|
||||
WMResizeWidget(panel->icoaB, 90, 24);
|
||||
WMMoveWidget(panel->icoaB, 125, 176);
|
||||
WMResizeWidget(panel->icoaB, 95, 24);
|
||||
WMMoveWidget(panel->icoaB, 120, 176);
|
||||
WMSetButtonText(panel->icoaB, _("Add"));
|
||||
WMSetButtonAction(panel->icoaB, browseForFile, panel);
|
||||
WMSetButtonImagePosition(panel->icoaB, WIPRight);
|
||||
|
||||
panel->icorB = WMCreateCommandButton(panel->icoF);
|
||||
WMResizeWidget(panel->icorB, 90, 24);
|
||||
WMResizeWidget(panel->icorB, 95, 24);
|
||||
WMMoveWidget(panel->icorB, 15, 176);
|
||||
WMSetButtonText(panel->icorB, _("Remove"));
|
||||
WMSetButtonAction(panel->icorB, pushButton, panel);
|
||||
@@ -290,14 +290,14 @@ createPanel(Panel *p)
|
||||
WMHangData(panel->pixL, panel);
|
||||
|
||||
panel->pixaB = WMCreateCommandButton(panel->pixF);
|
||||
WMResizeWidget(panel->pixaB, 90, 24);
|
||||
WMMoveWidget(panel->pixaB, 125, 176);
|
||||
WMResizeWidget(panel->pixaB, 95, 24);
|
||||
WMMoveWidget(panel->pixaB, 120, 176);
|
||||
WMSetButtonText(panel->pixaB, _("Add"));
|
||||
WMSetButtonAction(panel->pixaB, browseForFile, panel);
|
||||
WMSetButtonImagePosition(panel->pixaB, WIPRight);
|
||||
|
||||
panel->pixrB = WMCreateCommandButton(panel->pixF);
|
||||
WMResizeWidget(panel->pixrB, 90, 24);
|
||||
WMResizeWidget(panel->pixrB, 95, 24);
|
||||
WMMoveWidget(panel->pixrB, 15, 176);
|
||||
WMSetButtonText(panel->pixrB, _("Remove"));
|
||||
WMSetButtonAction(panel->pixrB, pushButton, panel);
|
||||
|
||||
@@ -59,10 +59,12 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
DLLIBS = @DLLIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
@@ -77,6 +79,7 @@ MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
@@ -59,10 +59,12 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
DLLIBS = @DLLIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
@@ -77,6 +79,7 @@ MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
@@ -59,10 +59,12 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
DLLIBS = @DLLIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
@@ -77,6 +79,7 @@ MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
@@ -59,10 +59,12 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
DLLIBS = @DLLIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
@@ -77,6 +79,7 @@ MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
@@ -59,10 +59,12 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
DLLIBS = @DLLIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
@@ -77,6 +79,7 @@ MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
@@ -59,10 +59,12 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
DLLIBS = @DLLIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
@@ -77,6 +79,7 @@ MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
@@ -59,10 +59,12 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
DLLIBS = @DLLIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
@@ -77,6 +79,7 @@ MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
@@ -59,10 +59,12 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
DLLIBS = @DLLIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
@@ -77,6 +79,7 @@ MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
# either set SaveSessionOnExit=YES or select "Save Session" in the Workspace
|
||||
# submenu of the root menu when all applications you want started are
|
||||
# running.
|
||||
#
|
||||
# WindowMaker will wait until this script finishes, so if you run any
|
||||
# commands that take long to execute (like a xterm), put a ``&'' in the
|
||||
# end of the command line.
|
||||
#
|
||||
# This file must be executable.
|
||||
#
|
||||
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Place commands to be executed when WindowMaker is exited here.
|
||||
#
|
||||
# WindowMaker will wait until this script finishes, so if you run any
|
||||
# commands that take long to execute (like a xterm), put a ``&'' in the
|
||||
# end of the command line.
|
||||
#
|
||||
# This file must be executable.
|
||||
#
|
||||
|
||||
|
||||
@@ -81,3 +81,6 @@
|
||||
|
||||
/* whether XKB language MODELOCK should be enabled */
|
||||
#undef XKB_MODELOCK
|
||||
|
||||
/* define if you want user defined menus for applications */
|
||||
#undef USER_MENU
|
||||
|
||||
307
aclocal.m4
vendored
307
aclocal.m4
vendored
@@ -330,28 +330,66 @@ fi
|
||||
AC_SUBST($1)])
|
||||
|
||||
|
||||
# serial 24 AM_PROG_LIBTOOL
|
||||
AC_DEFUN(AM_PROG_LIBTOOL,
|
||||
[AC_REQUIRE([AM_ENABLE_SHARED])dnl
|
||||
AC_REQUIRE([AM_ENABLE_STATIC])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AM_PROG_LD])dnl
|
||||
AC_REQUIRE([AM_PROG_NM])dnl
|
||||
AC_REQUIRE([AC_PROG_LN_S])dnl
|
||||
dnl
|
||||
# serial 39 AC_PROG_LIBTOOL
|
||||
AC_DEFUN(AC_PROG_LIBTOOL,
|
||||
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
|
||||
|
||||
# Save cache, so that ltconfig can load it
|
||||
AC_CACHE_SAVE
|
||||
|
||||
# Actually configure libtool. ac_aux_dir is where install-sh is found.
|
||||
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
|
||||
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
|
||||
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
|
||||
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
|
||||
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
|
||||
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|
||||
|| AC_MSG_ERROR([libtool configure failed])
|
||||
|
||||
# Reload cache, that may have been modified by ltconfig
|
||||
AC_CACHE_LOAD
|
||||
|
||||
# This can be used to rebuild libtool when needed
|
||||
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
|
||||
|
||||
# Always use our own libtool.
|
||||
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
|
||||
AC_SUBST(LIBTOOL)dnl
|
||||
|
||||
# Redirect the config.log output again, so that the ltconfig log is not
|
||||
# clobbered by the next message.
|
||||
exec 5>>./config.log
|
||||
])
|
||||
|
||||
AC_DEFUN(AC_LIBTOOL_SETUP,
|
||||
[AC_PREREQ(2.13)dnl
|
||||
AC_REQUIRE([AC_ENABLE_SHARED])dnl
|
||||
AC_REQUIRE([AC_ENABLE_STATIC])dnl
|
||||
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
||||
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_PROG_LD])dnl
|
||||
AC_REQUIRE([AC_PROG_NM])dnl
|
||||
AC_REQUIRE([AC_PROG_LN_S])dnl
|
||||
dnl
|
||||
|
||||
# Check for any special flags to pass to ltconfig.
|
||||
libtool_flags=
|
||||
libtool_flags="--cache-file=$cache_file"
|
||||
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
|
||||
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
|
||||
test "$silent" = yes && libtool_flags="$libtool_flags --silent"
|
||||
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
|
||||
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
|
||||
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
|
||||
[libtool_flags="$libtool_flags --enable-dlopen"])
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
||||
[libtool_flags="$libtool_flags --enable-win32-dll"])
|
||||
AC_ARG_ENABLE(libtool-lock,
|
||||
[ --disable-libtool-lock avoid locking (might break parallel builds)])
|
||||
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
|
||||
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
|
||||
|
||||
# Some flags need to be propagated to the compiler or linker for good
|
||||
# libtool support.
|
||||
@@ -377,30 +415,42 @@ case "$host" in
|
||||
|
||||
*-*-sco3.2v5*)
|
||||
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
|
||||
SAVE_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -belf"
|
||||
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
|
||||
[AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
|
||||
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
|
||||
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
|
||||
CFLAGS="$SAVE_CFLAGS"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# Actually configure libtool. ac_aux_dir is where install-sh is found.
|
||||
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
|
||||
LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
|
||||
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
|
||||
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|
||||
|| AC_MSG_ERROR([libtool configure failed])
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
||||
[*-*-cygwin* | *-*-mingw*)
|
||||
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(AS, as, false)
|
||||
AC_CHECK_TOOL(OBJDUMP, objdump, false)
|
||||
;;
|
||||
])
|
||||
esac
|
||||
])
|
||||
|
||||
# AM_ENABLE_SHARED - implement the --enable-shared flag
|
||||
# Usage: AM_ENABLE_SHARED[(DEFAULT)]
|
||||
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
|
||||
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
|
||||
|
||||
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
|
||||
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
|
||||
|
||||
# AC_ENABLE_SHARED - implement the --enable-shared flag
|
||||
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AM_ENABLE_SHARED,
|
||||
[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_DEFUN(AC_ENABLE_SHARED, [dnl
|
||||
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(shared,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
|
||||
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[ --enable-shared=PKGS only build shared libraries if the current package
|
||||
appears as an element in the PKGS list],
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_shared=yes ;;
|
||||
@@ -417,29 +467,23 @@ no) enable_shared=no ;;
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
|
||||
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
|
||||
AC_DEFUN(AM_DISABLE_SHARED,
|
||||
[AM_ENABLE_SHARED(no)])
|
||||
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
|
||||
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_SHARED(no)])
|
||||
|
||||
# AM_DISABLE_STATIC - set the default static flag to --disable-static
|
||||
AC_DEFUN(AM_DISABLE_STATIC,
|
||||
[AM_ENABLE_STATIC(no)])
|
||||
|
||||
# AM_ENABLE_STATIC - implement the --enable-static flag
|
||||
# Usage: AM_ENABLE_STATIC[(DEFAULT)]
|
||||
# AC_ENABLE_STATIC - implement the --enable-static flag
|
||||
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AM_ENABLE_STATIC,
|
||||
[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_DEFUN(AC_ENABLE_STATIC, [dnl
|
||||
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(static,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
|
||||
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[ --enable-static=PKGS only build shared libraries if the current package
|
||||
appears as an element in the PKGS list],
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_static=yes ;;
|
||||
@@ -456,26 +500,73 @@ no) enable_static=no ;;
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
|
||||
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AC_DISABLE_STATIC - set the default static flag to --disable-static
|
||||
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_STATIC(no)])
|
||||
|
||||
# AM_PROG_LD - find the path to the GNU or non-GNU linker
|
||||
AC_DEFUN(AM_PROG_LD,
|
||||
|
||||
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
|
||||
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
|
||||
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(fast-install,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_fast_install=yes ;;
|
||||
no) enable_fast_install=no ;;
|
||||
*)
|
||||
enable_fast_install=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
||||
for pkg in $enableval; do
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_fast_install=yes
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
|
||||
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_FAST_INSTALL(no)])
|
||||
|
||||
# AC_PROG_LD - find the path to the GNU or non-GNU linker
|
||||
AC_DEFUN(AC_PROG_LD,
|
||||
[AC_ARG_WITH(gnu-ld,
|
||||
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
||||
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
||||
ac_prog=ld
|
||||
if test "$ac_cv_prog_gcc" = yes; then
|
||||
# Check if gcc -print-prog-name=ld gives a path.
|
||||
AC_MSG_CHECKING([for ld used by GCC])
|
||||
ac_prog=`($CC -print-prog-name=ld) 2>&5`
|
||||
case "$ac_prog" in
|
||||
# Accept absolute paths.
|
||||
/* | [A-Za-z]:\\*)
|
||||
test -z "$LD" && LD="$ac_prog"
|
||||
;;
|
||||
# Accept absolute paths.
|
||||
changequote(,)dnl
|
||||
[\\/]* | [A-Za-z]:[\\/]*)
|
||||
re_direlt='/[^/][^/]*/\.\./'
|
||||
changequote([,])dnl
|
||||
# Canonicalize the path of ld
|
||||
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
|
||||
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
||||
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
||||
done
|
||||
test -z "$LD" && LD="$ac_prog"
|
||||
;;
|
||||
"")
|
||||
# If it fails, then pretend we aren't using GCC.
|
||||
ac_prog=ld
|
||||
@@ -492,10 +583,10 @@ else
|
||||
fi
|
||||
AC_CACHE_VAL(ac_cv_path_LD,
|
||||
[if test -z "$LD"; then
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
||||
for ac_dir in $PATH; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f "$ac_dir/$ac_prog"; then
|
||||
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
|
||||
ac_cv_path_LD="$ac_dir/$ac_prog"
|
||||
# Check to see if the program is GNU ld. I'd rather use --version,
|
||||
# but apparently some GNU ld's only accept -v.
|
||||
@@ -503,7 +594,7 @@ AC_CACHE_VAL(ac_cv_path_LD,
|
||||
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
|
||||
test "$with_gnu_ld" != no && break
|
||||
else
|
||||
test "$with_gnu_ld" != yes && break
|
||||
test "$with_gnu_ld" != yes && break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@@ -519,10 +610,10 @@ else
|
||||
fi
|
||||
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
||||
AC_SUBST(LD)
|
||||
AM_PROG_LD_GNU
|
||||
AC_PROG_LD_GNU
|
||||
])
|
||||
|
||||
AC_DEFUN(AM_PROG_LD_GNU,
|
||||
AC_DEFUN(AC_PROG_LD_GNU,
|
||||
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
|
||||
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
||||
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
|
||||
@@ -532,41 +623,115 @@ else
|
||||
fi])
|
||||
])
|
||||
|
||||
# AM_PROG_NM - find the path to a BSD-compatible name lister
|
||||
AC_DEFUN(AM_PROG_NM,
|
||||
# AC_PROG_NM - find the path to a BSD-compatible name lister
|
||||
AC_DEFUN(AC_PROG_NM,
|
||||
[AC_MSG_CHECKING([for BSD-compatible nm])
|
||||
AC_CACHE_VAL(ac_cv_path_NM,
|
||||
[case "$NM" in
|
||||
/* | [A-Za-z]:\\*)
|
||||
ac_cv_path_NM="$NM" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
|
||||
[if test -n "$NM"; then
|
||||
# Let the user override the test.
|
||||
ac_cv_path_NM="$NM"
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
||||
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/nm; then
|
||||
if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
|
||||
# Check to see if the nm accepts a BSD-compat flag.
|
||||
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
|
||||
# nm: unknown option "B" ignored
|
||||
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
||||
ac_cv_path_NM="$ac_dir/nm -B"
|
||||
ac_cv_path_NM="$ac_dir/nm -B"
|
||||
break
|
||||
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
||||
ac_cv_path_NM="$ac_dir/nm -p"
|
||||
ac_cv_path_NM="$ac_dir/nm -p"
|
||||
break
|
||||
else
|
||||
ac_cv_path_NM="$ac_dir/nm"
|
||||
ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
|
||||
continue # so that we can try to find one that supports BSD flags
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
|
||||
;;
|
||||
esac])
|
||||
fi])
|
||||
NM="$ac_cv_path_NM"
|
||||
AC_MSG_RESULT([$NM])
|
||||
AC_SUBST(NM)
|
||||
])
|
||||
|
||||
# AC_CHECK_LIBM - check for math library
|
||||
AC_DEFUN(AC_CHECK_LIBM,
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
LIBM=
|
||||
case "$host" in
|
||||
*-*-beos* | *-*-cygwin*)
|
||||
# These system don't have libm
|
||||
;;
|
||||
*-ncr-sysv4.3*)
|
||||
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
|
||||
AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
|
||||
;;
|
||||
*)
|
||||
AC_CHECK_LIB(m, main, LIBM="-lm")
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
|
||||
# the libltdl convenience library, adds --enable-ltdl-convenience to
|
||||
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
|
||||
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
|
||||
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
|
||||
# '${top_builddir}/' (note the single quotes!) if your package is not
|
||||
# flat, and, if you're not using automake, define top_builddir as
|
||||
# appropriate in the Makefiles.
|
||||
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
case "$enable_ltdl_convenience" in
|
||||
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
|
||||
"") enable_ltdl_convenience=yes
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
|
||||
esac
|
||||
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
|
||||
])
|
||||
|
||||
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
|
||||
# the libltdl installable library, and adds --enable-ltdl-install to
|
||||
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
|
||||
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
|
||||
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
|
||||
# '${top_builddir}/' (note the single quotes!) if your package is not
|
||||
# flat, and, if you're not using automake, define top_builddir as
|
||||
# appropriate in the Makefiles.
|
||||
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
|
||||
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_CHECK_LIB(ltdl, main,
|
||||
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
|
||||
[if test x"$enable_ltdl_install" = xno; then
|
||||
AC_MSG_WARN([libltdl not installed, but installation disabled])
|
||||
else
|
||||
enable_ltdl_install=yes
|
||||
fi
|
||||
])
|
||||
if test x"$enable_ltdl_install" = x"yes"; then
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-install"
|
||||
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
|
||||
else
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
|
||||
LIBLTDL="-lltdl"
|
||||
fi
|
||||
])
|
||||
|
||||
dnl old names
|
||||
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
|
||||
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
|
||||
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
|
||||
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
|
||||
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
|
||||
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
|
||||
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
|
||||
|
||||
dnl This is just to quiet aclocal about the macro not being used
|
||||
if(a,b,[AC_DISABLE_FAST_INSTALL])dnl
|
||||
|
||||
# Like AC_CONFIG_HEADER, but automatically create stamp file.
|
||||
|
||||
AC_DEFUN(AM_CONFIG_HEADER,
|
||||
|
||||
10
configure.in
10
configure.in
@@ -723,6 +723,16 @@ if test "$enableval" = yes; then
|
||||
fi
|
||||
)
|
||||
|
||||
dnl Enable User Defined Menu thing
|
||||
==================================
|
||||
AC_ARG_ENABLE(usermenu,
|
||||
[ --enable-usermenu user defined menus for applications
|
||||
],
|
||||
if test "$enableval" = yes; then
|
||||
AC_DEFINE(USER_MENU)
|
||||
fi
|
||||
)
|
||||
|
||||
|
||||
dnl
|
||||
dnl Nicolai: Program tests for Documentation Section
|
||||
|
||||
@@ -59,10 +59,12 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
DLLIBS = @DLLIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
@@ -77,6 +79,7 @@ MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
@@ -59,10 +59,12 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
DLLIBS = @DLLIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
@@ -77,6 +79,7 @@ MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
@@ -59,10 +59,12 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
DLLIBS = @DLLIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
@@ -77,6 +79,7 @@ MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
@@ -127,6 +127,9 @@
|
||||
/* whether XKB language MODELOCK should be enabled */
|
||||
#undef XKB_MODELOCK
|
||||
|
||||
/* define if you want user defined menus for applications */
|
||||
#undef USER_MENU
|
||||
|
||||
/* Define if you have the atexit function. */
|
||||
#undef HAVE_ATEXIT
|
||||
|
||||
|
||||
@@ -1087,7 +1087,7 @@ wScreenSaveState(WScreen *scr)
|
||||
free(str);
|
||||
PLSetFilename(scr->session_state, path);
|
||||
if (!PLSave(scr->session_state, YES)) {
|
||||
wwarning(_("could not save session state in %s"), PLGetString(path));
|
||||
wsyserror(_("could not save session state in %s"), PLGetString(path));
|
||||
}
|
||||
PLRelease(path);
|
||||
PLRelease(old_state);
|
||||
|
||||
@@ -59,10 +59,12 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
DLLIBS = @DLLIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
@@ -77,6 +79,7 @@ MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
@@ -57,10 +57,12 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
DLLIBS = @DLLIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
@@ -75,6 +77,7 @@ MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
@@ -999,10 +999,9 @@ updateDomain(char *domain, char *key, char *texture)
|
||||
{
|
||||
char *program = "wdwrite";
|
||||
|
||||
if (smooth)
|
||||
system("wdwrite SmoothWorkspaceBack YES");
|
||||
else
|
||||
system("wdwrite SmoothWorkspaceBack NO");
|
||||
system(wstrappend("wdwrite ",
|
||||
wstrappend(domain, smooth ? " SmoothWorkspaceBack YES"
|
||||
: " SmoothWorkspaceBack NO")));
|
||||
|
||||
execlp(program, program, domain, key, texture, NULL);
|
||||
wwarning("warning could not run \"%s\"", program);
|
||||
|
||||
@@ -59,10 +59,12 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
DLLIBS = @DLLIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
@@ -77,6 +79,7 @@ MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
@@ -59,10 +59,12 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
DLLIBS = @DLLIBS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
@@ -77,6 +79,7 @@ MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
Reference in New Issue
Block a user