1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-04 12:54:20 +01:00

WINGs: Make the test examples to compile

Those examples are optional but currently cannot compile properly.
The compiler is reporting some unused variables and missing header file.
This commit is contained in:
David Maciejak
2023-03-07 17:24:41 +00:00
committed by Carlos R. Mafra
parent 3b1c00ad06
commit 6c69dc32a0
6 changed files with 24 additions and 16 deletions

View File

@@ -17,4 +17,5 @@ wtest_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
EXTRA_DIST = logo.xpm upbtn.xpm wm.html wm.png EXTRA_DIST = logo.xpm upbtn.xpm wm.html wm.png
AM_CPPFLAGS = -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \ AM_CPPFLAGS = -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @XFT_CFLAGS@ @HEADER_SEARCH_PATH@ -DRESOURCE_PATH=\"$(datadir)/WINGs\" @XFT_CFLAGS@ @HEADER_SEARCH_PATH@ \
@PANGO_CFLAGS@

View File

@@ -64,6 +64,7 @@ static W_Class myWidgetClass = 0;
*/ */
W_Class InitMyWidget(WMScreen * scr) W_Class InitMyWidget(WMScreen * scr)
{ {
(void)scr;
/* register our widget with WINGs and get our widget class ID */ /* register our widget with WINGs and get our widget class ID */
if (!myWidgetClass) { if (!myWidgetClass) {
myWidgetClass = W_RegisterUserWidget(); myWidgetClass = W_RegisterUserWidget();

View File

@@ -4,7 +4,7 @@
#include "mywidget.h" #include "mywidget.h"
void wAbort() _Noreturn void wAbort(void)
{ {
exit(1); exit(1);
} }

View File

@@ -19,14 +19,14 @@
#include "logo.xpm" #include "logo.xpm"
void wAbort() _Noreturn void wAbort(void)
{ {
exit(1); exit(1);
} }
char *ProgName; char *ProgName;
void usage(void) _Noreturn void usage(void)
{ {
fprintf(stderr, fprintf(stderr,
"usage:\n" "usage:\n"
@@ -53,13 +53,10 @@ int main(int argc, char **argv)
WMPixmap *pixmap; WMPixmap *pixmap;
WMOpenPanel *oPanel; WMOpenPanel *oPanel;
WMSavePanel *sPanel; WMSavePanel *sPanel;
/* RImage *image; */
char *title = NULL; char *title = NULL;
char *initial = "/"; char *initial = "/";
int ch; int ch;
int panelType = OPEN_PANEL_TYPE; int panelType = OPEN_PANEL_TYPE;
extern char *optarg;
extern int optind;
if (!dpy) { if (!dpy) {
puts("could not open display"); puts("could not open display");
@@ -96,14 +93,14 @@ int main(int argc, char **argv)
if (panelType == SAVE_PANEL_TYPE) { if (panelType == SAVE_PANEL_TYPE) {
sPanel = WMGetSavePanel(scr); sPanel = WMGetSavePanel(scr);
if (WMRunModalFilePanelForDirectory(sPanel, NULL, initial, if (WMRunModalFilePanelForDirectory(sPanel, NULL, initial,
/*title */ NULL, NULL) == True) title, NULL) == True)
printf("%s\n", WMGetFilePanelFileName(sPanel)); printf("%s\n", WMGetFilePanelFileName(sPanel));
else else
printf("\n"); printf("\n");
} else { } else {
oPanel = WMGetOpenPanel(scr); oPanel = WMGetOpenPanel(scr);
if (WMRunModalFilePanelForDirectory(oPanel, NULL, initial, if (WMRunModalFilePanelForDirectory(oPanel, NULL, initial,
/*title */ NULL, NULL) == True) title, NULL) == True)
printf("%s\n", WMGetFilePanelFileName(oPanel)); printf("%s\n", WMGetFilePanelFileName(oPanel));
else else
printf("\n"); printf("\n");

View File

@@ -11,14 +11,14 @@
#include "logo.xpm" #include "logo.xpm"
void wAbort() _Noreturn void wAbort(void)
{ {
exit(1); exit(1);
} }
char *ProgName; char *ProgName;
void usage(void) _Noreturn void usage(void)
{ {
fprintf(stderr, fprintf(stderr,
"usage:\n" "usage:\n"
@@ -45,8 +45,6 @@ int main(int argc, char **argv)
char *initial = NULL; char *initial = NULL;
char *result = NULL; char *result = NULL;
int ch; int ch;
extern char *optarg;
extern int optind;
WMInitializeApplication("WMQuery", &argc, argv); WMInitializeApplication("WMQuery", &argc, argv);

View File

@@ -14,7 +14,7 @@
* This will be called when the application will be terminated because * This will be called when the application will be terminated because
* of a fatal error (only for memory allocation failures ATM). * of a fatal error (only for memory allocation failures ATM).
*/ */
void wAbort() _Noreturn void wAbort(void)
{ {
exit(1); exit(1);
} }
@@ -25,6 +25,7 @@ int windowCount = 0;
void closeAction(WMWidget * self, void *data) void closeAction(WMWidget * self, void *data)
{ {
(void)data;
WMDestroyWidget(self); WMDestroyWidget(self);
windowCount--; windowCount--;
printf("window closed, window count = %d\n", windowCount); printf("window closed, window count = %d\n", windowCount);
@@ -165,10 +166,13 @@ void testBox(WMScreen * scr)
static void singleClick(WMWidget * self, void *data) static void singleClick(WMWidget * self, void *data)
{ {
(void)self;
(void)data;
} }
static void doubleClick(WMWidget * self, void *data) static void doubleClick(WMWidget * self, void *data)
{ {
(void)data;
WMSelectAllListItems((WMList *) self); WMSelectAllListItems((WMList *) self);
} }
@@ -480,6 +484,7 @@ void testColorPanel(WMScreen * scr)
void sliderCallback(WMWidget * w, void *data) void sliderCallback(WMWidget * w, void *data)
{ {
(void)data;
printf("SLIDER == %i\n", WMGetSliderValue(w)); printf("SLIDER == %i\n", WMGetSliderValue(w));
} }
@@ -749,6 +754,8 @@ void testTabView(WMScreen * scr)
void splitViewConstrainProc(WMSplitView * sPtr, int indView, int *minSize, int *maxSize) void splitViewConstrainProc(WMSplitView * sPtr, int indView, int *minSize, int *maxSize)
{ {
(void)sPtr;
switch (indView) { switch (indView) {
case 0: case 0:
*minSize = 20; *minSize = 20;
@@ -782,6 +789,7 @@ static void resizeSplitView(XEvent * event, void *data)
void appendSubviewButtonAction(WMWidget * self, void *data) void appendSubviewButtonAction(WMWidget * self, void *data)
{ {
(void)self;
WMSplitView *sPtr = (WMSplitView *) data; WMSplitView *sPtr = (WMSplitView *) data;
char buf[64]; char buf[64];
WMLabel *label = WMCreateLabel(sPtr); WMLabel *label = WMCreateLabel(sPtr);
@@ -796,6 +804,7 @@ void appendSubviewButtonAction(WMWidget * self, void *data)
void removeSubviewButtonAction(WMWidget * self, void *data) void removeSubviewButtonAction(WMWidget * self, void *data)
{ {
(void)self;
WMSplitView *sPtr = (WMSplitView *) data; WMSplitView *sPtr = (WMSplitView *) data;
int count = WMGetSplitViewSubviewsCount(sPtr); int count = WMGetSplitViewSubviewsCount(sPtr);
@@ -808,12 +817,14 @@ void removeSubviewButtonAction(WMWidget * self, void *data)
void orientationButtonAction(WMWidget * self, void *data) void orientationButtonAction(WMWidget * self, void *data)
{ {
(void)self;
WMSplitView *sPtr = (WMSplitView *) data; WMSplitView *sPtr = (WMSplitView *) data;
WMSetSplitViewVertical(sPtr, !WMGetSplitViewVertical(sPtr)); WMSetSplitViewVertical(sPtr, !WMGetSplitViewVertical(sPtr));
} }
void adjustSubviewsButtonAction(WMWidget * self, void *data) void adjustSubviewsButtonAction(WMWidget * self, void *data)
{ {
(void)self;
WMAdjustSplitViewSubviews((WMSplitView *) data); WMAdjustSplitViewSubviews((WMSplitView *) data);
} }
@@ -902,7 +913,7 @@ void testSplitView(WMScreen * scr)
WMMapWidget(win); WMMapWidget(win);
} }
void testUD() void testUD(void)
{ {
WMUserDefaults *defs; WMUserDefaults *defs;
char str[32]; char str[32];