1 /* dialog.c - dialog windows for internal use
3 * Window Maker window manager
5 * Copyright (c) 1997, 1998 Alfredo K. Kojima
6 * Copyright (c) 1999 Dan Pascu
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
27 #include <X11/Xutil.h>
28 #include <X11/keysym.h>
34 #include <sys/types.h>
41 #include <sys/signal.h>
46 #define PATH_MAX DEFAULT_PATH_MAX
49 #include "WindowMaker.h"
61 extern WPreferences wPreferences
;
66 wMessageDialog(WScreen
*scr
, char *title
, char *message
,
67 char *defBtn
, char *altBtn
, char *othBtn
)
74 panel
= WMCreateAlertPanel(scr
->wmscreen
, NULL
, title
, message
,
75 defBtn
, altBtn
, othBtn
);
77 parent
= XCreateSimpleWindow(dpy
, scr
->root_win
, 0, 0, 400, 180, 0, 0, 0);
79 XReparentWindow(dpy
, WMWidgetXID(panel
->win
), parent
, 0, 0);
81 wwin
= wManageInternalWindow(scr
, parent
, None
, NULL
,
82 (scr
->scr_width
- 400)/2,
83 (scr
->scr_height
- 180)/2, 400, 180);
84 wwin
->client_leader
= WMWidgetXID(panel
->win
);
86 WMMapWidget(panel
->win
);
90 while (!panel
->done
) {
93 WMNextEvent(dpy
, &event
);
94 WMHandleEvent(&event
);
97 result
= panel
->result
;
99 WMUnmapWidget(panel
->win
);
101 wUnmanageWindow(wwin
, False
, False
);
103 WMDestroyAlertPanel(panel
);
105 XDestroyWindow(dpy
, parent
);
113 wInputDialog(WScreen
*scr
, char *title
, char *message
, char **text
)
121 panel
= WMCreateInputPanel(scr
->wmscreen
, NULL
, title
, message
, *text
,
122 _("OK"), _("Cancel"));
125 parent
= XCreateSimpleWindow(dpy
, scr
->root_win
, 0, 0, 320, 160, 0, 0, 0);
126 XSelectInput(dpy
, parent
, KeyPressMask
|KeyReleaseMask
);
128 XReparentWindow(dpy
, WMWidgetXID(panel
->win
), parent
, 0, 0);
130 wwin
= wManageInternalWindow(scr
, parent
, None
, NULL
,
131 (scr
->scr_width
- 320)/2,
132 (scr
->scr_height
- 160)/2, 320, 160);
134 wwin
->client_leader
= WMWidgetXID(panel
->win
);
136 WMMapWidget(panel
->win
);
140 while (!panel
->done
) {
143 WMNextEvent(dpy
, &event
);
144 WMHandleEvent(&event
);
147 if (panel
->result
== WAPRDefault
)
148 result
= WMGetTextFieldText(panel
->text
);
152 wUnmanageWindow(wwin
, False
, False
);
154 WMDestroyInputPanel(panel
);
156 XDestroyWindow(dpy
, parent
);
171 *****************************************************************
172 * Icon Selection Panel
173 *****************************************************************
176 typedef struct IconPanel
{
189 WMButton
*previewButton
;
194 WMTextField
*fileField
;
197 WMButton
*cancelButton
;
199 WMButton
*chooseButton
;
209 listPixmaps(WScreen
*scr
, WMList
*lPtr
, char *path
)
211 struct dirent
*dentry
;
213 char pbuf
[PATH_MAX
+16];
215 IconPanel
*panel
= WMGetHangedData(lPtr
);
217 panel
->preview
= False
;
219 apath
= wexpandpath(path
);
220 dir
= opendir(apath
);
225 tmp
= _("Could not open directory ");
226 msg
= wmalloc(strlen(tmp
)+strlen(path
)+6);
230 wMessageDialog(scr
, _("Error"), msg
, _("OK"), NULL
, NULL
);
236 /* list contents in the column */
237 while ((dentry
= readdir(dir
))) {
240 if (strcmp(dentry
->d_name
, ".")==0 ||
241 strcmp(dentry
->d_name
, "..")==0)
246 strcat(pbuf
, dentry
->d_name
);
248 if (stat(pbuf
, &statb
)<0)
251 if (statb
.st_mode
& (S_IRUSR
|S_IRGRP
|S_IROTH
)
252 && statb
.st_mode
& (S_IFREG
|S_IFLNK
)) {
253 WMAddSortedListItem(lPtr
, dentry
->d_name
);
259 panel
->preview
= True
;
265 setViewedImage(IconPanel
*panel
, char *file
)
274 pixmap
= WMCreateBlendedPixmapFromFile(WMWidgetScreen(panel
->win
),
277 WMSetButtonEnabled(panel
->okButton
, False
);
279 WMSetLabelText(panel
->iconView
, _("Could not load image file "));
281 WMSetLabelImage(panel
->iconView
, NULL
);
283 WMSetButtonEnabled(panel
->okButton
, True
);
285 WMSetLabelText(panel
->iconView
, NULL
);
286 WMSetLabelImage(panel
->iconView
, pixmap
);
287 WMReleasePixmap(pixmap
);
293 listCallback(void *self
, void *data
)
295 WMList
*lPtr
= (WMList
*)self
;
296 IconPanel
*panel
= (IconPanel
*)data
;
299 if (lPtr
==panel
->dirList
) {
300 path
= WMGetListSelectedItem(lPtr
)->text
;
302 WMSetTextFieldText(panel
->fileField
, path
);
304 WMSetLabelImage(panel
->iconView
, NULL
);
306 WMSetButtonEnabled(panel
->okButton
, False
);
308 WMClearList(panel
->iconList
);
309 listPixmaps(panel
->scr
, panel
->iconList
, path
);
311 char *tmp
, *iconFile
;
313 path
= WMGetListSelectedItem(panel
->dirList
)->text
;
314 tmp
= wexpandpath(path
);
316 iconFile
= WMGetListSelectedItem(panel
->iconList
)->text
;
318 path
= wmalloc(strlen(tmp
)+strlen(iconFile
)+4);
321 strcat(path
, iconFile
);
323 WMSetTextFieldText(panel
->fileField
, path
);
324 setViewedImage(panel
, path
);
331 listIconPaths(WMList
*lPtr
)
336 paths
= wstrdup(wPreferences
.icon_path
);
338 path
= strtok(paths
, ":");
343 tmp
= wexpandpath(path
);
344 /* do not sort, because the order implies the order of
345 * directories searched */
346 if (access(tmp
, X_OK
)==0)
347 WMAddListItem(lPtr
, path
);
349 } while ((path
=strtok(NULL
, ":"))!=NULL
);
355 void drawIconProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
356 int state
, WMRect
*rect
) {
357 IconPanel
*panel
= WMGetHangedData(lPtr
);
358 GC gc
= panel
->scr
->draw_gc
;
359 GC copygc
= panel
->scr
->copy_gc
;
360 char *buffer
, *dirfile
, *iconfile
;
365 WMScreen
*wmscr
=WMWidgetScreen(panel
->win
);
368 if(!panel
->preview
) return;
370 width
= rect
->size
.width
;
372 blackcolor
= WMBlackColor(wmscr
);
373 whitecolor
= WMWhiteColor(wmscr
);
375 dirfile
= WMGetListSelectedItem(panel
->dirList
)->text
;
376 buffer
= wmalloc(strlen(dirfile
)+strlen(text
)+4);
377 sprintf(buffer
,"%s/%s" ,dirfile
,text
);
379 pixmap
= WMCreatePixmapFromFile(WMWidgetScreen(panel
->win
), buffer
);
382 WMRemoveListItem(lPtr
, index
);
386 XClearArea(dpy
, d
, rect
->pos
.x
,rect
->pos
.y
, width
, 64, False
);
387 XSetClipMask(dpy
, gc
, None
);
388 XDrawRectangle(dpy
, d
, WMColorGC(whitecolor
), rect
->pos
.x
+ 5,rect
->pos
.y
+5, width
- 10, 54);
389 if (state
&WLDSSelected
) {
390 XFillRectangle(dpy
, d
, WMColorGC(whitecolor
), rect
->pos
.x
+ 5,rect
->pos
.y
+5, width
- 10, 54);
394 XSetClipMask(dpy
, copygc
, WMGetPixmapMaskXID(pixmap
));
395 XSetClipOrigin(dpy
, copygc
, rect
->pos
.x
, rect
->pos
.y
);
396 size
= WMGetPixmapSize(pixmap
);
397 XCopyArea(dpy
, WMGetPixmapXID(pixmap
), d
, copygc
, 0, 0,
398 size
.width
>100?100:size
.width
, size
.height
>64?64:size
.height
, rect
->pos
.x
,rect
->pos
.y
);
404 WMDrawString(wmscr
, d
, WMColorGC(whitecolor
), panel
->normalfont
, rect
->pos
.x
+i
+7, rect
->pos
.y
+62+j
-WMFontHeight(panel
->normalfont
), text
, strlen(text
));
406 WMDrawString(wmscr
, d
, WMColorGC(blackcolor
), panel
->normalfont
, rect
->pos
.x
+7, rect
->pos
.y
+62-WMFontHeight(panel
->normalfont
), text
, strlen(text
));
408 WMReleasePixmap(pixmap
);
409 /* I hope it is better to do not use cache / on my box it is fast nuff */
412 WMReleaseColor(blackcolor
);
413 WMReleaseColor(whitecolor
);
417 buttonCallback(void *self
, void *clientData
)
419 WMButton
*bPtr
= (WMButton
*)self
;
420 IconPanel
*panel
= (IconPanel
*)clientData
;
423 if (bPtr
==panel
->okButton
) {
425 panel
->result
= True
;
426 } else if (bPtr
==panel
->cancelButton
) {
428 panel
->result
= False
;
429 } else if (bPtr
==panel
->previewButton
) {
430 /**** Previewer ****/
431 WMSetButtonEnabled(bPtr
, False
);
432 WMSetListUserDrawItemHeight(panel
->iconList
, 64);
433 WMSetListUserDrawProc(panel
->iconList
, drawIconProc
);
434 WMRedisplayWidget(panel
->iconList
);
435 /* for draw proc to access screen/gc */
436 /*** end preview ***/
439 else if (bPtr
==panel
->chooseButton
) {
442 op
= WMCreateOpenPanel(WMWidgetScreen(bPtr
));
444 if (WMRunModalFilePanelForDirectory(op
, NULL
, "/usr/local", NULL
, NULL
)) {
446 path
= WMGetFilePanelFile(op
);
447 WMSetTextFieldText(panel
->fileField
, path
);
448 setViewedImage(panel
, path
);
451 WMDestroyFilePanel(op
);
458 wIconChooserDialog(WScreen
*scr
, char **file
, char *instance
, char *class)
466 panel
= wmalloc(sizeof(IconPanel
));
467 memset(panel
, 0, sizeof(IconPanel
));
471 panel
->win
= WMCreateWindow(scr
->wmscreen
, "iconChooser");
472 WMResizeWidget(panel
->win
, 450, 280);
474 boldFont
= WMBoldSystemFontOfSize(scr
->wmscreen
, 12);
475 panel
->normalfont
= WMSystemFontOfSize(WMWidgetScreen(panel
->win
), 12);
477 panel
->dirLabel
= WMCreateLabel(panel
->win
);
478 WMResizeWidget(panel
->dirLabel
, 200, 20);
479 WMMoveWidget(panel
->dirLabel
, 10, 7);
480 WMSetLabelText(panel
->dirLabel
, _("Directories"));
481 WMSetLabelFont(panel
->dirLabel
, boldFont
);
482 WMSetLabelTextAlignment(panel
->dirLabel
, WACenter
);
484 WMSetLabelRelief(panel
->dirLabel
, WRSunken
);
486 panel
->iconLabel
= WMCreateLabel(panel
->win
);
487 WMResizeWidget(panel
->iconLabel
, 140, 20);
488 WMMoveWidget(panel
->iconLabel
, 215, 7);
489 WMSetLabelText(panel
->iconLabel
, _("Icons"));
490 WMSetLabelFont(panel
->iconLabel
, boldFont
);
491 WMSetLabelTextAlignment(panel
->iconLabel
, WACenter
);
493 WMReleaseFont(boldFont
);
495 color
= WMWhiteColor(scr
->wmscreen
);
496 WMSetLabelTextColor(panel
->dirLabel
, color
);
497 WMSetLabelTextColor(panel
->iconLabel
, color
);
498 WMReleaseColor(color
);
500 color
= WMDarkGrayColor(scr
->wmscreen
);
501 WMSetWidgetBackgroundColor(panel
->iconLabel
, color
);
502 WMSetWidgetBackgroundColor(panel
->dirLabel
, color
);
503 WMReleaseColor(color
);
505 WMSetLabelRelief(panel
->iconLabel
, WRSunken
);
507 panel
->dirList
= WMCreateList(panel
->win
);
508 WMResizeWidget(panel
->dirList
, 200, 170);
509 WMMoveWidget(panel
->dirList
, 10, 30);
510 WMSetListAction(panel
->dirList
, listCallback
, panel
);
512 panel
->iconList
= WMCreateList(panel
->win
);
513 WMResizeWidget(panel
->iconList
, 140, 170);
514 WMMoveWidget(panel
->iconList
, 215, 30);
515 WMSetListAction(panel
->iconList
, listCallback
, panel
);
517 WMHangData(panel
->iconList
,panel
);
519 panel
->previewButton
= WMCreateCommandButton(panel
->win
);
520 WMResizeWidget(panel
->previewButton
, 75, 26);
521 WMMoveWidget(panel
->previewButton
, 365, 130);
522 WMSetButtonText(panel
->previewButton
, _("Preview"));
523 WMSetButtonAction(panel
->previewButton
, buttonCallback
, panel
);
525 panel
->iconView
= WMCreateLabel(panel
->win
);
526 WMResizeWidget(panel
->iconView
, 75, 75);
527 WMMoveWidget(panel
->iconView
, 365, 40);
528 WMSetLabelImagePosition(panel
->iconView
, WIPOverlaps
);
529 WMSetLabelRelief(panel
->iconView
, WRSunken
);
530 WMSetLabelTextAlignment(panel
->iconView
, WACenter
);
532 panel
->fileLabel
= WMCreateLabel(panel
->win
);
533 WMResizeWidget(panel
->fileLabel
, 80, 20);
534 WMMoveWidget(panel
->fileLabel
, 10, 210);
535 WMSetLabelText(panel
->fileLabel
, _("File Name:"));
537 panel
->fileField
= WMCreateTextField(panel
->win
);
538 WMResizeWidget(panel
->fileField
, 345, 20);
539 WMMoveWidget(panel
->fileField
, 95, 210);
540 WMSetTextFieldEditable(panel
->fileField
, False
);
542 panel
->okButton
= WMCreateCommandButton(panel
->win
);
543 WMResizeWidget(panel
->okButton
, 80, 26);
544 WMMoveWidget(panel
->okButton
, 360, 240);
545 WMSetButtonText(panel
->okButton
, _("OK"));
546 WMSetButtonEnabled(panel
->okButton
, False
);
547 WMSetButtonAction(panel
->okButton
, buttonCallback
, panel
);
549 panel
->cancelButton
= WMCreateCommandButton(panel
->win
);
550 WMResizeWidget(panel
->cancelButton
, 80, 26);
551 WMMoveWidget(panel
->cancelButton
, 270, 240);
552 WMSetButtonText(panel
->cancelButton
, _("Cancel"));
553 WMSetButtonAction(panel
->cancelButton
, buttonCallback
, panel
);
555 panel
->chooseButton
= WMCreateCommandButton(panel
->win
);
556 WMResizeWidget(panel
->chooseButton
, 110, 26);
557 WMMoveWidget(panel
->chooseButton
, 150, 240);
558 WMSetButtonText(panel
->chooseButton
, _("Choose File"));
559 WMSetButtonAction(panel
->chooseButton
, buttonCallback
, panel
);
561 WMRealizeWidget(panel
->win
);
562 WMMapSubwidgets(panel
->win
);
564 parent
= XCreateSimpleWindow(dpy
, scr
->root_win
, 0, 0, 450, 280, 0, 0, 0);
566 XReparentWindow(dpy
, WMWidgetXID(panel
->win
), parent
, 0, 0);
571 tmp
= wmalloc((instance
? strlen(instance
) : 0)
572 + (class ? strlen(class) : 0) + 32);
574 if (tmp
&& (instance
|| class))
575 sprintf(tmp
, "%s [%s.%s]", _("Icon Chooser"), instance
, class);
577 strcpy(tmp
, _("Icon Chooser"));
579 wwin
= wManageInternalWindow(scr
, parent
, None
, tmp
,
580 (scr
->scr_width
- 450)/2,
581 (scr
->scr_height
- 280)/2, 450, 280);
585 /* put icon paths in the list */
586 listIconPaths(panel
->dirList
);
588 WMMapWidget(panel
->win
);
592 while (!panel
->done
) {
595 WMNextEvent(dpy
, &event
);
596 WMHandleEvent(&event
);
600 char *defaultPath
, *wantedPath
;
602 /* check if the file the user selected is not the one that
603 * would be loaded by default with the current search path */
604 *file
= WMGetListSelectedItem(panel
->iconList
)->text
;
609 defaultPath
= FindImage(wPreferences
.icon_path
, *file
);
610 wantedPath
= WMGetTextFieldText(panel
->fileField
);
611 /* if the file is not the default, use full path */
612 if (strcmp(wantedPath
, defaultPath
)!=0) {
615 *file
= wstrdup(*file
);
624 WMReleaseFont(panel
->normalfont
);
626 WMUnmapWidget(panel
->win
);
628 WMDestroyWidget(panel
->win
);
630 wUnmanageWindow(wwin
, False
, False
);
634 XDestroyWindow(dpy
, parent
);
636 return panel
->result
;
641 ***********************************************************************
643 ***********************************************************************
677 #define COPYRIGHT_TEXT \
678 "Copyright \xa9 1997~1999 Alfredo K. Kojima <kojima@windowmaker.org>\n"\
679 "Copyright \xa9 1998,1999 Dan Pascu <dan@windowmaker.org>"
683 static InfoPanel
*thePanel
= NULL
;
686 destroyInfoPanel(WCoreWindow
*foo
, void *data
, XEvent
*event
)
689 if (thePanel
->timer
) {
690 WMDeleteTimerHandler(thePanel
->timer
);
692 if (thePanel
->oldPix
) {
693 WMReleasePixmap(thePanel
->oldPix
);
695 if (thePanel
->icon
) {
696 RDestroyImage(thePanel
->icon
);
699 RDestroyImage(thePanel
->pic
);
701 #endif /* SILLYNESS */
702 WMUnmapWidget(thePanel
);
704 wUnmanageWindow(thePanel
->wwin
, False
, False
);
706 WMDestroyWidget(thePanel
->win
);
715 renderText(WMScreen
*scr
, char *text
, char *font
, RColor
*from
, RColor
*to
)
717 WMPixmap
*wpix
= NULL
;
720 RContext
*rc
= WMScreenRContext(scr
);
721 XFontStruct
*f
= NULL
;
725 f
= XLoadQueryFont(dpy
, font
);
729 w
= XTextWidth(f
, text
, strlen(text
));
730 h
= f
->ascent
+f
->descent
;
732 mask
= XCreatePixmap(dpy
, rc
->drawable
, w
, h
, 1);
733 gc
= XCreateGC(dpy
, mask
, 0, NULL
);
734 XSetForeground(dpy
, gc
, 0);
735 XSetFont(dpy
, gc
, f
->fid
);
736 XFillRectangle(dpy
, mask
, gc
, 0, 0, w
, h
);
738 XSetForeground(dpy
, gc
, 1);
739 XDrawString(dpy
, mask
, gc
, 0, f
->ascent
, text
, strlen(text
));
740 XSetLineAttributes(dpy
, gc
, 3, LineSolid
, CapRound
, JoinMiter
);
741 XDrawLine(dpy
, mask
, gc
, 0, h
-2, w
, h
-2);
743 grad
= XCreatePixmap(dpy
, rc
->drawable
, w
, h
, rc
->depth
);
747 color
= WMBlackColor(scr
);
748 XFillRectangle(dpy
, grad
, WMColorGC(color
), 0, 0, w
, h
);
749 WMReleaseColor(color
);
752 wpix
= WMCreatePixmapFromXPixmaps(scr
, grad
, mask
, w
, h
, rc
->depth
);
763 extern WMPixmap
*DoXThing();
764 extern Bool
InitXThing();
767 logoPushCallback(void *data
)
769 InfoPanel
*panel
= (InfoPanel
*)data
;
773 static int jingobeu
[] = {
774 329, 150, -1, 100, 329, 150, -1, 100, 329, 300, -1, 250,
775 329, 150, -1, 100, 329, 150, -1, 100, 329, 300, -1, 250,
776 329, 150, 392, 150, 261, 150, 293, 150, 329, 400, -1, 400, 0
784 if(jingobeu
[panel
->x
-1]==0){panel
->x
=-1;}else if(jingobeu
[panel
->x
785 -1]<0){panel
->x
++;c
=jingobeu
[panel
->x
-1]/50;panel
->x
++;}else if(c
==0){
786 kc
.bell_pitch
=jingobeu
[panel
->x
-1];panel
->x
++;kc
.bell_percent
=50;c
=
787 jingobeu
[panel
->x
-1]/50;kc
.bell_duration
=jingobeu
[panel
->x
-1];panel
->x
++;
788 XChangeKeyboardControl(dpy
,KBBellPitch
|KBBellDuration
|KBBellPercent
,&kc
);
789 XBell(dpy
,50);XFlush(dpy
);}else{c
--;}}
790 if (!(panel
->cycle
% 4)) {
793 p
= DoXThing(panel
->wwin
);
794 WMSetLabelImage(panel
->logoL
, p
);
796 } else if (panel
->cycle
< 30) {
800 image
= RCloneImage(panel
->icon
);
801 RCombineImagesWithOpaqueness(image
, panel
->pic
, panel
->cycle
*255/30);
802 pix
= WMCreatePixmapFromRImage(panel
->scr
->wmscreen
, image
, 128);
803 RDestroyImage(image
);
804 WMSetLabelImage(panel
->logoL
, pix
);
805 WMReleasePixmap(pix
);
808 i
= panel
->cycle
%200;
810 len
= strlen(panel
->str
);
812 strncpy(buffer
, panel
->str
, i
<len
? i
: len
);
814 memset(&buffer
[len
], ' ', i
-len
);
816 strncpy(buffer
, panel
->str
, i
<len
? i
: len
);
818 memset(&buffer
[len
], ' ', i
-len
);
820 WMSetLabelText(panel
->versionL
, buffer
);
822 panel
->timer
= WMAddTimerHandler(50, logoPushCallback
, panel
);
828 handleLogoPush(XEvent
*event
, void *data
)
830 InfoPanel
*panel
= (InfoPanel
*)data
;
831 static int broken
= 0;
832 static int clicks
= 0;
833 static char *pic_data
[] = {
893 " ....XoO+@##+O$%.... ",
894 " ...%X&*========-;;:o... ",
895 " ...>.>,<122222222222134@... ",
896 " ..>5678912222222222222220q%.. ",
897 " ..$.&-w2222222222222222222er>.. ",
898 " ..O.t31222222222222222222222y4>.. ",
899 " ...O5u3222222222222222222222222yri... ",
900 " ..>p&a22222222222222222222222222wso.. ",
901 " ..ids91222222222222222222222222222wfi.. ",
902 " ..X.7w222222wgs-w2222222213=g0222222<hi.. ",
903 " ..Xuj2222222<@X5=222222229k@l:022222y4i.. ",
904 " .Xdz22222222*X%.s22222222axo%$-222222<c>.. ",
905 " ..o7y22222222v...r222222223hX.i82222221si.. ",
906 "..io*222222222&...u22222222yt..%*22222220:%. ",
907 "..>k02222222227...f222222222v..X=222222229t. ",
908 "..dz12222222220ui:y2222222223d%qw222222221g. ",
909 ".%vw222222222221y2222222222219*y2222222222wd.",
910 ".X;2222222222222222222222222222222222222222b.",
911 ".i*2222222222222222222222222222222222222222v.",
912 ".i*2222222222222222222222222222222222222222;.",
913 ".i*22222222222222222222222222222222222222228.",
914 ".>*2222222222222222222222222222222222222222=.",
915 ".i*22222222222222222222222222222222222222228.",
916 ".i*2222222222222222222222222222222222222222;.",
917 ".X*222222222222222222222222222222we12222222r.",
918 ".Xs12222222w3aw22222222222222222y8s0222222wk.",
919 ".Xq02222222a,na22222222222222222zm6zwy2222gi.",
920 "..>*22222y<:Xcj22222222222222222-o$k;;02228..",
921 "..i7y2220rhX.:y22222222222222222jtiXd,a220,..",
922 " .X@z222a,do%kj2222222222222222wMX5q;gw228%..",
923 " ..58222wagsh6ry222222222222221;>Of0w222y:...",
924 " ...:e2222218mdz22222222222222a&$vw222220@...",
925 " ...O-122222y:.u02222222222229q$uj222221r... ",
926 " ..%&a1222223&573w2222222219NOxz122221z>... ",
927 " ...t3222221-l$nr8ay1222yzbo,=12222w-5... ",
928 " ..X:022222w-k+>o,7s**s7xOn=12221<f5... ",
929 " ..o:9222221j8:&Bl>>>>ihv<12221=dX... ",
930 " ..Xb9122222109g-****;<y22221zn%... ",
931 " ..X&801222222222222222222w-h.... ",
932 " ...o:=022222222222222221=lX... ",
933 " ..X@:;3w2222222222210fO... ",
934 " ...XX&v8<30000003-N@... ",
935 " .....XmnbN:q&Bo.... ",
937 static char *msgs
[] = {
938 "Sloppy focus is a *?#@",
939 "Repent! Sloppy focus users will burn in hell!!!",
945 if (!panel
->timer
&& !broken
&& clicks
> 0) {
952 file
= wDefaultGetIconFile(panel
->scr
, "Logo", "WMPanel", False
);
958 path
= FindImage(wPreferences
.icon_path
, file
);
964 panel
->icon
= RLoadImage(panel
->scr
->rcontext
, path
, 0);
972 panel
->pic
= RGetImageFromXPMData(panel
->scr
->rcontext
, pic_data
);
973 if (!panel
->pic
|| panel
->icon
->width
!=panel
->pic
->width
974 || panel
->icon
->height
!=panel
->pic
->height
) {
976 RDestroyImage(panel
->icon
);
979 RDestroyImage(panel
->pic
);
991 RCombineImageWithColor(panel
->icon
, &color
);
992 RCombineImageWithColor(panel
->pic
, &color
);
996 panel
->str
= msgs
[rand()%(sizeof(msgs
)/sizeof(char*))];
998 panel
->timer
= WMAddTimerHandler(50, logoPushCallback
, panel
);
1000 panel
->oldPix
= WMRetainPixmap(WMGetLabelImage(panel
->logoL
));
1001 } else if (panel
->timer
) {
1006 WMSetLabelImage(panel
->logoL
, panel
->oldPix
);
1007 WMReleasePixmap(panel
->oldPix
);
1008 panel
->oldPix
= NULL
;
1010 WMDeleteTimerHandler(panel
->timer
);
1011 panel
->timer
= NULL
;
1013 sprintf(version
, "Version %s", VERSION
);
1014 WMSetLabelText(panel
->versionL
, version
);
1019 while (XCheckTypedWindowEvent(dpy
, WMWidgetXID(panel
->versionL
),
1023 #endif /* SILLYNESS */
1027 wShowInfoPanel(WScreen
*scr
)
1037 RColor color1
, color2
;
1051 if (thePanel
->scr
== scr
) {
1052 wRaiseFrame(thePanel
->wwin
->frame
->core
);
1053 wSetFocusTo(scr
, thePanel
->wwin
);
1058 panel
= wmalloc(sizeof(InfoPanel
));
1059 memset(panel
, 0, sizeof(InfoPanel
));
1063 panel
->win
= WMCreateWindow(scr
->wmscreen
, "info");
1064 WMResizeWidget(panel
->win
, 382, 230);
1066 logo
= WMGetApplicationIconImage(scr
->wmscreen
);
1068 size
= WMGetPixmapSize(logo
);
1069 panel
->logoL
= WMCreateLabel(panel
->win
);
1070 WMResizeWidget(panel
->logoL
, 64, 64);
1071 WMMoveWidget(panel
->logoL
, 30, 20);
1072 WMSetLabelImagePosition(panel
->logoL
, WIPImageOnly
);
1073 WMSetLabelImage(panel
->logoL
, logo
);
1075 WMCreateEventHandler(WMWidgetView(panel
->logoL
), ButtonPressMask
,
1076 handleLogoPush
, panel
);
1080 panel
->name1L
= WMCreateLabel(panel
->win
);
1081 WMResizeWidget(panel
->name1L
, 240, 30);
1082 WMMoveWidget(panel
->name1L
, 100, 30);
1087 color2
.green
= 0x50;
1089 logo
= renderText(scr
->wmscreen
, "GNU Window Maker",
1090 "-*-utopia-*-r-*-*-25-*", &color1
, &color2
);
1092 WMSetLabelImagePosition(panel
->name1L
, WIPImageOnly
);
1093 WMSetLabelImage(panel
->name1L
, logo
);
1094 WMReleasePixmap(logo
);
1096 font
= WMBoldSystemFontOfSize(scr
->wmscreen
, 20);
1098 WMSetLabelFont(panel
->name1L
, font
);
1099 WMReleaseFont(font
);
1101 WMSetLabelTextAlignment(panel
->name1L
, WACenter
);
1102 WMSetLabelText(panel
->name1L
, "GNU Window Maker");
1105 panel
->name2L
= WMCreateLabel(panel
->win
);
1106 WMResizeWidget(panel
->name2L
, 240, 24);
1107 WMMoveWidget(panel
->name2L
, 100, 60);
1108 font
= WMBoldSystemFontOfSize(scr
->wmscreen
, 18);
1110 WMSetLabelFont(panel
->name2L
, font
);
1111 WMReleaseFont(font
);
1114 WMSetLabelTextAlignment(panel
->name2L
, WACenter
);
1115 WMSetLabelText(panel
->name2L
, "Window Manager for X");
1118 sprintf(version
, "Version %s", VERSION
);
1119 panel
->versionL
= WMCreateLabel(panel
->win
);
1120 WMResizeWidget(panel
->versionL
, 310, 16);
1121 WMMoveWidget(panel
->versionL
, 30, 95);
1122 WMSetLabelTextAlignment(panel
->versionL
, WARight
);
1123 WMSetLabelText(panel
->versionL
, version
);
1124 WMSetLabelWraps(panel
->versionL
, False
);
1126 panel
->copyrL
= WMCreateLabel(panel
->win
);
1127 WMResizeWidget(panel
->copyrL
, 340, 40);
1128 WMMoveWidget(panel
->copyrL
, 15, 185);
1129 WMSetLabelTextAlignment(panel
->copyrL
, WALeft
);
1130 WMSetLabelText(panel
->copyrL
, COPYRIGHT_TEXT
);
1131 /* we want the (c) character in the helvetica font */
1132 font
= WMCreateNormalFont(scr
->wmscreen
, HELVETICA10_FONT
);
1134 WMSetLabelFont(panel
->copyrL
, font
);
1137 switch (scr
->w_depth
) {
1139 strcpy(version
, "32 thousand");
1142 strcpy(version
, "64 thousand");
1146 strcpy(version
, "16 million");
1149 sprintf(version
, "%d", 1<<scr
->w_depth
);
1153 sprintf(buffer
, "Using visual 0x%x: %s %ibpp (%s colors)\n",
1154 (unsigned)scr
->w_visual
->visualid
,
1155 visuals
[scr
->w_visual
->class], scr
->w_depth
, version
);
1157 strcat(buffer
, "Supported image formats: ");
1158 strl
= RSupportedFileFormats();
1159 for (i
=0; strl
[i
]!=NULL
; i
++) {
1160 strcat(buffer
, strl
[i
]);
1161 strcat(buffer
, " ");
1164 strcat(buffer
, "\nAdditional Support For: ");
1177 list
[j
++] = "GNOME";
1183 list
[j
++] = "Sound";
1187 for (i
= 0; i
< j
; i
++) {
1190 strcat(buf
, " and ");
1194 strcat(buf
, list
[i
]);
1196 strcat(buffer
, buf
);
1200 panel
->infoL
= WMCreateLabel(panel
->win
);
1201 WMResizeWidget(panel
->infoL
, 350, 75);
1202 WMMoveWidget(panel
->infoL
, 15, 115);
1203 WMSetLabelText(panel
->infoL
, buffer
);
1205 WMSetLabelFont(panel
->infoL
, font
);
1206 WMReleaseFont(font
);
1210 WMRealizeWidget(panel
->win
);
1211 WMMapSubwidgets(panel
->win
);
1213 parent
= XCreateSimpleWindow(dpy
, scr
->root_win
, 0, 0, 382, 230, 0, 0, 0);
1215 XReparentWindow(dpy
, WMWidgetXID(panel
->win
), parent
, 0, 0);
1217 WMMapWidget(panel
->win
);
1219 wwin
= wManageInternalWindow(scr
, parent
, None
, "Info",
1220 (scr
->scr_width
- 382)/2,
1221 (scr
->scr_height
- 230)/2, 382, 230);
1223 WSETUFLAG(wwin
, no_closable
, 0);
1224 WSETUFLAG(wwin
, no_close_button
, 0);
1225 #ifdef XKB_BUTTON_HINT
1226 wFrameWindowHideButton(wwin
->frame
, WFF_LANGUAGE_BUTTON
);
1228 wWindowUpdateButtonImages(wwin
);
1229 wFrameWindowShowButton(wwin
->frame
, WFF_RIGHT_BUTTON
);
1230 wwin
->frame
->on_click_right
= destroyInfoPanel
;
1238 if (InitXThing(panel
->scr
)) {
1239 panel
->timer
= WMAddTimerHandler(100, logoPushCallback
, panel
);
1242 panel
->str
= "Merry Christmas!";
1243 panel
->oldPix
= WMRetainPixmap(WMGetLabelImage(panel
->logoL
));
1250 ***********************************************************************
1252 ***********************************************************************
1267 #define LICENSE_TEXT \
1268 " Window Maker is free software; you can redistribute it and/or modify "\
1269 "it under the terms of the GNU General Public License as published "\
1270 "by the Free Software Foundation; either version 2 of the License, "\
1271 "or (at your option) any later version.\n\n\n"\
1272 " Window Maker is distributed in the hope that it will be useful, but "\
1273 "WITHOUT ANY WARRANTY; without even the implied warranty of "\
1274 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU "\
1275 "General Public License for more details.\n\n\n"\
1276 " You should have received a copy of the GNU General Public License "\
1277 "along with this program; if not, write to the Free Software "\
1278 "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA "\
1282 static LegalPanel
*legalPanel
= NULL
;
1285 destroyLegalPanel(WCoreWindow
*foo
, void *data
, XEvent
*event
)
1287 WMUnmapWidget(legalPanel
->win
);
1289 WMDestroyWidget(legalPanel
->win
);
1291 wUnmanageWindow(legalPanel
->wwin
, False
, False
);
1300 wShowLegalPanel(WScreen
*scr
)
1307 if (legalPanel
->scr
== scr
) {
1308 wRaiseFrame(legalPanel
->wwin
->frame
->core
);
1309 wSetFocusTo(scr
, legalPanel
->wwin
);
1314 panel
= wmalloc(sizeof(LegalPanel
));
1318 panel
->win
= WMCreateWindow(scr
->wmscreen
, "legal");
1319 WMResizeWidget(panel
->win
, 420, 250);
1322 panel
->licenseL
= WMCreateLabel(panel
->win
);
1323 WMResizeWidget(panel
->licenseL
, 400, 230);
1324 WMMoveWidget(panel
->licenseL
, 10, 10);
1325 WMSetLabelTextAlignment(panel
->licenseL
, WALeft
);
1326 WMSetLabelText(panel
->licenseL
, LICENSE_TEXT
);
1327 WMSetLabelRelief(panel
->licenseL
, WRGroove
);
1329 WMRealizeWidget(panel
->win
);
1330 WMMapSubwidgets(panel
->win
);
1332 parent
= XCreateSimpleWindow(dpy
, scr
->root_win
, 0, 0, 420, 250, 0, 0, 0);
1334 XReparentWindow(dpy
, WMWidgetXID(panel
->win
), parent
, 0, 0);
1336 wwin
= wManageInternalWindow(scr
, parent
, None
, "Legal",
1337 (scr
->scr_width
- 420)/2,
1338 (scr
->scr_height
- 250)/2, 420, 250);
1340 WSETUFLAG(wwin
, no_closable
, 0);
1341 WSETUFLAG(wwin
, no_close_button
, 0);
1342 wWindowUpdateButtonImages(wwin
);
1343 wFrameWindowShowButton(wwin
->frame
, WFF_RIGHT_BUTTON
);
1344 #ifdef XKB_BUTTON_HINT
1345 wFrameWindowHideButton(wwin
->frame
, WFF_LANGUAGE_BUTTON
);
1347 wwin
->frame
->on_click_right
= destroyLegalPanel
;
1351 WMMapWidget(panel
->win
);
1360 ***********************************************************************
1361 * Crashing Dialog Panel
1362 ***********************************************************************
1365 extern WDDomain
*WDWindowAttributes
;
1368 typedef struct _CrashPanel
{
1369 WMWindow
*win
; /* main window */
1371 WMLabel
*iconL
; /* application icon */
1372 WMLabel
*nameL
; /* title of panel */
1374 WMFrame
*sepF
; /* separator frame */
1376 WMLabel
*noteL
; /* Title of note */
1377 WMLabel
*note2L
; /* body of note with what happened */
1379 WMFrame
*whatF
; /* "what to do next" frame */
1380 WMPopUpButton
*whatP
; /* action selection popup button */
1382 WMButton
*okB
; /* ok button */
1384 Bool done
; /* if finished with this dialog */
1385 int action
; /* what to do after */
1393 handleKeyPress(XEvent
*event
, void *clientData
)
1395 CrashPanel
*panel
= (CrashPanel
*)clientData
;
1397 if (event
->xkey
.keycode
== panel
->retKey
) {
1398 WMPerformButtonClick(panel
->okB
);
1404 okButtonCallback(void *self
, void *clientData
)
1406 CrashPanel
*panel
= (CrashPanel
*)clientData
;
1413 setCrashAction(void *self
, void *clientData
)
1415 WMPopUpButton
*pop
= (WMPopUpButton
*)self
;
1416 CrashPanel
*panel
= (CrashPanel
*)clientData
;
1418 panel
->action
= WMGetPopUpButtonSelectedItem(pop
);
1423 getWindowMakerIconImage(WMScreen
*scr
)
1425 proplist_t dict
, key
, option
, value
=NULL
;
1429 PLSetStringCmpHook(NULL
);
1431 key
= PLMakeString("Logo.WMPanel");
1432 option
= PLMakeString("Icon");
1434 dict
= PLGetDictionaryEntry(WDWindowAttributes
->dictionary
, key
);
1437 value
= PLGetDictionaryEntry(dict
, option
);
1443 PLSetStringCmpHook(StringCompareHook
);
1445 if (value
&& PLIsString(value
)) {
1446 path
= FindImage(wPreferences
.icon_path
, PLGetString(value
));
1451 image
= RLoadImage(WMScreenRContext(scr
), path
, 0);
1453 pix
= WMCreatePixmapFromRImage(scr
, image
, 0);
1454 RDestroyImage(image
);
1469 wShowCrashingDialogPanel(int whatSig
)
1475 int screen_no
, scr_width
, scr_height
;
1479 panel
= wmalloc(sizeof(CrashPanel
));
1480 memset(panel
, 0, sizeof(CrashPanel
));
1482 screen_no
= DefaultScreen(dpy
);
1483 scr_width
= WidthOfScreen(ScreenOfDisplay(dpy
, screen_no
));
1484 scr_height
= HeightOfScreen(ScreenOfDisplay(dpy
, screen_no
));
1486 scr
= WMCreateScreen(dpy
, screen_no
);
1488 wsyserror(_("cannot open connection for crashing dialog panel. Aborting."));
1492 panel
->retKey
= XKeysymToKeycode(dpy
, XK_Return
);
1494 panel
->win
= WMCreateWindow(scr
, "crashingDialog");
1495 WMResizeWidget(panel
->win
, PWIDTH
, PHEIGHT
);
1496 WMMoveWidget(panel
->win
, (scr_width
- PWIDTH
)/2, (scr_height
- PHEIGHT
)/2);
1498 logo
= getWindowMakerIconImage(scr
);
1500 panel
->iconL
= WMCreateLabel(panel
->win
);
1501 WMResizeWidget(panel
->iconL
, 64, 64);
1502 WMMoveWidget(panel
->iconL
, 10, 10);
1503 WMSetLabelImagePosition(panel
->iconL
, WIPImageOnly
);
1504 WMSetLabelImage(panel
->iconL
, logo
);
1507 panel
->nameL
= WMCreateLabel(panel
->win
);
1508 WMResizeWidget(panel
->nameL
, 190, 18);
1509 WMMoveWidget(panel
->nameL
, 80, 35);
1510 WMSetLabelTextAlignment(panel
->nameL
, WALeft
);
1511 font
= WMBoldSystemFontOfSize(scr
, 18);
1512 WMSetLabelFont(panel
->nameL
, font
);
1513 WMReleaseFont(font
);
1514 WMSetLabelText(panel
->nameL
, _("Fatal error"));
1516 panel
->sepF
= WMCreateFrame(panel
->win
);
1517 WMResizeWidget(panel
->sepF
, PWIDTH
+4, 2);
1518 WMMoveWidget(panel
->sepF
, -2, 80);
1520 panel
->noteL
= WMCreateLabel(panel
->win
);
1521 WMResizeWidget(panel
->noteL
, PWIDTH
-20, 40);
1522 WMMoveWidget(panel
->noteL
, 10, 90);
1523 WMSetLabelTextAlignment(panel
->noteL
, WAJustified
);
1524 #ifdef SYS_SIGLIST_DECLARED
1525 sprintf(buf
, _("Window Maker received signal %i\n(%s)."),
1526 whatSig
, sys_siglist
[whatSig
]);
1528 sprintf(buf
, _("Window Maker received signal %i."), whatSig
);
1530 WMSetLabelText(panel
->noteL
, buf
);
1532 panel
->note2L
= WMCreateLabel(panel
->win
);
1533 WMResizeWidget(panel
->note2L
, PWIDTH
-20, 100);
1534 WMMoveWidget(panel
->note2L
, 10, 130);
1535 WMSetLabelTextAlignment(panel
->note2L
, WALeft
);
1536 WMSetLabelText(panel
->note2L
,
1537 _(" This fatal error occured probably due to a bug."
1538 " Please fill the included BUGFORM and "
1539 "report it to bugs@windowmaker.org."));
1542 panel
->whatF
= WMCreateFrame(panel
->win
);
1543 WMResizeWidget(panel
->whatF
, PWIDTH
-20, 50);
1544 WMMoveWidget(panel
->whatF
, 10, 240);
1545 WMSetFrameTitle(panel
->whatF
, _("What do you want to do now?"));
1547 panel
->whatP
= WMCreatePopUpButton(panel
->whatF
);
1548 WMResizeWidget(panel
->whatP
, PWIDTH
-20-70, 20);
1549 WMMoveWidget(panel
->whatP
, 35, 20);
1550 WMSetPopUpButtonPullsDown(panel
->whatP
, False
);
1551 WMSetPopUpButtonText(panel
->whatP
, _("Select action"));
1552 WMAddPopUpButtonItem(panel
->whatP
, _("Abort and leave a core file"));
1553 WMAddPopUpButtonItem(panel
->whatP
, _("Restart Window Maker"));
1554 WMAddPopUpButtonItem(panel
->whatP
, _("Start alternate window manager"));
1555 WMSetPopUpButtonAction(panel
->whatP
, setCrashAction
, panel
);
1556 WMSetPopUpButtonSelectedItem(panel
->whatP
, WMRestart
);
1557 panel
->action
= WMRestart
;
1559 WMMapSubwidgets(panel
->whatF
);
1561 panel
->okB
= WMCreateCommandButton(panel
->win
);
1562 WMResizeWidget(panel
->okB
, 80, 26);
1563 WMMoveWidget(panel
->okB
, 205, 309);
1564 WMSetButtonText(panel
->okB
, _("OK"));
1565 WMSetButtonImage(panel
->okB
, WMGetSystemPixmap(scr
, WSIReturnArrow
));
1566 WMSetButtonAltImage(panel
->okB
, WMGetSystemPixmap(scr
, WSIHighlightedReturnArrow
));
1567 WMSetButtonImagePosition(panel
->okB
, WIPRight
);
1568 WMSetButtonAction(panel
->okB
, okButtonCallback
, panel
);
1572 WMCreateEventHandler(WMWidgetView(panel
->win
), KeyPressMask
,
1573 handleKeyPress
, panel
);
1575 WMRealizeWidget(panel
->win
);
1576 WMMapSubwidgets(panel
->win
);
1578 WMMapWidget(panel
->win
);
1580 XSetInputFocus(dpy
, WMWidgetXID(panel
->win
), RevertToParent
, CurrentTime
);
1582 while (!panel
->done
) {
1585 WMNextEvent(dpy
, &event
);
1586 WMHandleEvent(&event
);
1589 action
= panel
->action
;
1591 WMUnmapWidget(panel
->win
);
1592 WMDestroyWidget(panel
->win
);
1601 /*****************************************************************************
1602 * About GNUstep Panel
1603 *****************************************************************************/
1607 drawGNUstepLogo(Display
*dpy
, Drawable d
, int width
, int height
,
1608 unsigned long blackPixel
, unsigned long whitePixel
)
1612 XRectangle rects
[3];
1614 gcv
.foreground
= blackPixel
;
1615 gc
= XCreateGC(dpy
, d
, GCForeground
, &gcv
);
1617 XFillArc(dpy
, d
, gc
, width
/45, height
/45,
1618 width
- 2*width
/45, height
- 2*height
/45, 0, 360*64);
1621 rects
[0].y
= 37*height
/45;
1622 rects
[0].width
= width
/3;
1623 rects
[0].height
= height
- rects
[0].y
;
1625 rects
[1].x
= rects
[0].width
;
1626 rects
[1].y
= height
/2;
1627 rects
[1].width
= width
- 2*width
/3;
1628 rects
[1].height
= height
- rects
[1].y
;
1630 rects
[2].x
= 2*width
/3;
1631 rects
[2].y
= height
- 37*height
/45;
1632 rects
[2].width
= width
/3;
1633 rects
[2].height
= height
- rects
[2].y
;
1635 XSetClipRectangles(dpy
, gc
, 0, 0, rects
, 3, Unsorted
);
1636 XFillRectangle(dpy
, d
, gc
, 0, 0, width
, height
);
1638 XSetForeground(dpy
, gc
, whitePixel
);
1639 XFillArc(dpy
, d
, gc
, width
/45, height
/45,
1640 width
- 2*width
/45, height
- 2*height
/45, 0, 360*64);
1647 #define GNUSTEP_TEXT \
1648 "Window Maker is part of the GNUstep project.\n"\
1649 "The GNUstep project aims to create a free\n"\
1650 "implementation of the OpenStep(tm) specification\n"\
1651 "which is a object-oriented framework for\n"\
1652 "creating advanced graphical, multi-platform\n"\
1653 "applications. Aditionally, a development and\n"\
1654 "user desktop enviroment will be created on top\n"\
1655 "of the framework. For more information about\n"\
1656 "GNUstep, please visit: www.gnustep.org"
1671 static GNUstepPanel
*gnustepPanel
= NULL
;
1674 destroyGNUstepPanel(WCoreWindow
*foo
, void *data
, XEvent
*event
)
1676 WMUnmapWidget(gnustepPanel
->win
);
1678 WMDestroyWidget(gnustepPanel
->win
);
1680 wUnmanageWindow(gnustepPanel
->wwin
, False
, False
);
1684 gnustepPanel
= NULL
;
1689 wShowGNUstepPanel(WScreen
*scr
)
1691 GNUstepPanel
*panel
;
1698 if (gnustepPanel
->scr
== scr
) {
1699 wRaiseFrame(gnustepPanel
->wwin
->frame
->core
);
1700 wSetFocusTo(scr
, gnustepPanel
->wwin
);
1705 panel
= wmalloc(sizeof(GNUstepPanel
));
1709 panel
->win
= WMCreateWindow(scr
->wmscreen
, "About GNUstep");
1710 WMResizeWidget(panel
->win
, 325, 200);
1712 pixmap
= WMCreatePixmap(scr
->wmscreen
, 130, 130,
1713 WMScreenDepth(scr
->wmscreen
), True
);
1715 color
= WMCreateNamedColor(scr
->wmscreen
, "gray50", True
);
1717 drawGNUstepLogo(dpy
, WMGetPixmapXID(pixmap
), 130, 130,
1718 WMColorPixel(color
), scr
->white_pixel
);
1720 WMReleaseColor(color
);
1722 XSetForeground(dpy
, scr
->mono_gc
, 0);
1723 XFillRectangle(dpy
, WMGetPixmapMaskXID(pixmap
), scr
->mono_gc
, 0, 0,
1725 drawGNUstepLogo(dpy
, WMGetPixmapMaskXID(pixmap
), 130, 130, 1, 1);
1727 panel
->gstepL
= WMCreateLabel(panel
->win
);
1728 WMResizeWidget(panel
->gstepL
, 285, 64);
1729 WMMoveWidget(panel
->gstepL
, 20, 0);
1730 WMSetLabelTextAlignment(panel
->gstepL
, WARight
);
1731 WMSetLabelText(panel
->gstepL
, "GNUstep");
1733 WMFont
*font
= WMBoldSystemFontOfSize(scr
->wmscreen
, 24);
1735 WMSetLabelFont(panel
->gstepL
, font
);
1736 WMReleaseFont(font
);
1739 panel
->textL
= WMCreateLabel(panel
->win
);
1740 WMResizeWidget(panel
->textL
, 275, 130);
1741 WMMoveWidget(panel
->textL
, 30, 50);
1742 WMSetLabelTextAlignment(panel
->textL
, WARight
);
1743 WMSetLabelImagePosition(panel
->textL
, WIPOverlaps
);
1744 WMSetLabelText(panel
->textL
, GNUSTEP_TEXT
);
1745 WMSetLabelImage(panel
->textL
, pixmap
);
1747 WMReleasePixmap(pixmap
);
1749 WMRealizeWidget(panel
->win
);
1750 WMMapSubwidgets(panel
->win
);
1752 parent
= XCreateSimpleWindow(dpy
, scr
->root_win
, 0, 0, 325, 200, 0, 0, 0);
1754 XReparentWindow(dpy
, WMWidgetXID(panel
->win
), parent
, 0, 0);
1756 wwin
= wManageInternalWindow(scr
, parent
, None
, "About GNUstep",
1757 (scr
->scr_width
- 325)/2,
1758 (scr
->scr_height
- 200)/2, 325, 200);
1760 WSETUFLAG(wwin
, no_closable
, 0);
1761 WSETUFLAG(wwin
, no_close_button
, 0);
1762 wWindowUpdateButtonImages(wwin
);
1763 wFrameWindowShowButton(wwin
->frame
, WFF_RIGHT_BUTTON
);
1764 #ifdef XKB_BUTTON_HINT
1765 wFrameWindowHideButton(wwin
->frame
, WFF_LANGUAGE_BUTTON
);
1767 wwin
->frame
->on_click_right
= destroyGNUstepPanel
;
1771 WMMapWidget(panel
->win
);
1775 gnustepPanel
= panel
;