From 5c37df521e515e21529894b254aaef7462340113 Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 16 Apr 2001 00:37:34 +0000 Subject: [PATCH] Moved color panel testing to wtest.c and removed testcolorpanel.c --- WINGs/Tests/Makefile.am | 2 +- WINGs/Tests/testcolorpanel.c | 81 -------------------------------------------- WINGs/Tests/wtest.c | 20 ++++++++++- 3 files changed, 20 insertions(+), 83 deletions(-) delete mode 100644 WINGs/Tests/testcolorpanel.c diff --git a/WINGs/Tests/Makefile.am b/WINGs/Tests/Makefile.am index 1d9baf88..a31dd8f6 100644 --- a/WINGs/Tests/Makefile.am +++ b/WINGs/Tests/Makefile.am @@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = no-dependencies -noinst_PROGRAMS = wtest wmquery wmfile testmywidget testcolorpanel +noinst_PROGRAMS = wtest wmquery wmfile testmywidget LDADD= $(top_builddir)/WINGs/libWINGs.a $(top_builddir)/wrlib/libwraster.la \ @LIBPL@ diff --git a/WINGs/Tests/testcolorpanel.c b/WINGs/Tests/testcolorpanel.c deleted file mode 100644 index 87083730..00000000 --- a/WINGs/Tests/testcolorpanel.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Author: Pascal Hofstee - */ - - -#include - -#include -#include - -#include "logo.xpm" - -void -wAbort() -{ - exit(1); -} - -char *ProgName; - - -int main(int argc, char **argv) -{ - Display *dpy = XOpenDisplay(""); - WMScreen *scr; - WMPixmap *pixmap; - WMColorPanel *panel; - WMColor *startcolor; - char *colorname = NULL; - int i; - -#if 0 - XSynchronize(dpy, True); - fprintf(stderr, "...Running Synchronous...\n"); -#endif - - WMInitializeApplication("WMColorPicker", &argc, argv); - - ProgName = argv[0]; - - if (!dpy) { - puts("could not open display"); - exit(1); - } - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-h")==0 || strcmp(argv[i], "--help")==0) { - printf("testcolorpanel [-h] [--help] [-c ]" - "[--color ]\n"); - exit(0); - } - if (strcmp(argv[i], "-c")==0 || strcmp(argv[i], "--color")==0) { - i++; - if (i >= argc) { - printf("%s: missing argument for option '%s'\n", - argv[0], argv[i-1]); - exit(1); - } - colorname = argv[i]; - } - } - - scr = WMCreateSimpleApplicationScreen(dpy); - - pixmap = WMCreatePixmapFromXPMData(scr, GNUSTEP_XPM); - WMSetApplicationIconImage(scr, pixmap); - WMReleasePixmap(pixmap); - - panel = WMGetColorPanel(scr); - - if (colorname) { - startcolor = WMCreateNamedColor(scr, colorname, False); - WMSetColorPanelColor(panel, startcolor); - WMReleaseColor(startcolor); - } - - WMShowColorPanel(panel); - - WMScreenMainLoop(scr); - return 0; -} diff --git a/WINGs/Tests/wtest.c b/WINGs/Tests/wtest.c index d5624f3a..afedd649 100644 --- a/WINGs/Tests/wtest.c +++ b/WINGs/Tests/wtest.c @@ -115,7 +115,8 @@ testFrame(WMScreen *scr) } -static void resizedWindow(void *self, WMNotification *notif) +static void +resizedWindow(void *self, WMNotification *notif) { WMView *view = (WMView*)WMGetNotificationObject(notif); WMSize size = WMGetViewSize(view); @@ -507,6 +508,21 @@ testColorWell(WMScreen *scr) WMMapWidget(win); } + +void +testColorPanel(WMScreen *scr) +{ + WMColorPanel *panel = WMGetColorPanel(scr); + + /*if (colorname) { + startcolor = WMCreateNamedColor(scr, colorname, False); + WMSetColorPanelColor(panel, startcolor); + WMReleaseColor(startcolor); + }*/ + + WMShowColorPanel(panel); +} + void sliderCallback(WMWidget *w, void *data) { @@ -545,6 +561,7 @@ testSlider(WMScreen *scr) WMMapWidget(win); } + void testTextField(WMScreen *scr) { @@ -1282,6 +1299,7 @@ main(int argc, char **argv) testDragAndDrop(scr); #if 0 + testColorPanel(scr); testScrollView(scr); testTabView(scr); testBox(scr); -- 2.11.4.GIT