mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-13 12:25:53 +01:00
Moved color panel testing to wtest.c and removed testcolorpanel.c
This commit is contained in:
@@ -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@
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* Author: Pascal Hofstee <daeron@shadowmere.student.utwente.nl>
|
||||
*/
|
||||
|
||||
|
||||
#include <WINGs/WINGs.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#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>]"
|
||||
"[--color <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;
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user