1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-03 04:14: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
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)
{
(void)scr;
/* register our widget with WINGs and get our widget class ID */
if (!myWidgetClass) {
myWidgetClass = W_RegisterUserWidget();

View File

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

View File

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

View File

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

View File

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