7 #include <X11/cursorfont.h>
9 /********** data ************/
12 #define CHECK_BUTTON_ON_WIDTH 16
13 #define CHECK_BUTTON_ON_HEIGHT 16
15 static char *CHECK_BUTTON_ON
[] = {
33 #define CHECK_BUTTON_OFF_WIDTH 16
34 #define CHECK_BUTTON_OFF_HEIGHT 16
36 static char *CHECK_BUTTON_OFF
[] = {
54 #define RADIO_BUTTON_ON_WIDTH 15
55 #define RADIO_BUTTON_ON_HEIGHT 15
56 static char *RADIO_BUTTON_ON
[] = {
74 #define RADIO_BUTTON_OFF_WIDTH 15
75 #define RADIO_BUTTON_OFF_HEIGHT 15
76 static char *RADIO_BUTTON_OFF
[] = {
95 static char *BUTTON_ARROW
[] = {
100 ".#............ ...",
101 "#............. ...",
102 ".#............ ...",
104 "...#. ............",
108 #define BUTTON_ARROW_WIDTH 18
109 #define BUTTON_ARROW_HEIGHT 10
112 static char *BUTTON_ARROW2
[] = {
125 #define BUTTON_ARROW2_WIDTH 18
126 #define BUTTON_ARROW2_HEIGHT 10
129 static char *SCROLLER_DIMPLE
[] = {
138 #define SCROLLER_DIMPLE_WIDTH 6
139 #define SCROLLER_DIMPLE_HEIGHT 6
142 static char *SCROLLER_ARROW_UP
[] = {
154 static char *HI_SCROLLER_ARROW_UP
[] = {
166 #define SCROLLER_ARROW_UP_WIDTH 9
167 #define SCROLLER_ARROW_UP_HEIGHT 9
170 static char *SCROLLER_ARROW_DOWN
[] = {
182 static char *HI_SCROLLER_ARROW_DOWN
[] = {
194 #define SCROLLER_ARROW_DOWN_WIDTH 9
195 #define SCROLLER_ARROW_DOWN_HEIGHT 9
199 static char *SCROLLER_ARROW_LEFT
[] = {
211 static char *HI_SCROLLER_ARROW_LEFT
[] = {
223 #define SCROLLER_ARROW_LEFT_WIDTH 9
224 #define SCROLLER_ARROW_LEFT_HEIGHT 9
227 static char *SCROLLER_ARROW_RIGHT
[] = {
239 static char *HI_SCROLLER_ARROW_RIGHT
[] = {
251 #define SCROLLER_ARROW_RIGHT_WIDTH 9
252 #define SCROLLER_ARROW_RIGHT_HEIGHT 9
255 static char *POPUP_INDICATOR
[] = {
266 #define POPUP_INDICATOR_WIDTH 11
267 #define POPUP_INDICATOR_HEIGHT 8
271 static char *PULLDOWN_INDICATOR
[] = {
280 #define PULLDOWN_INDICATOR_WIDTH 9
281 #define PULLDOWN_INDICATOR_HEIGHT 7
284 #define CHECK_MARK_WIDTH 8
285 #define CHECK_MARK_HEIGHT 10
287 static char *CHECK_MARK
[] = {
300 #define STIPPLE_WIDTH 8
301 #define STIPPLE_HEIGHT 8
302 static unsigned char STIPPLE_BITS
[] = {
303 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa
309 extern void W_ReadConfigurations(void);
312 static int userWidgetCount
=0;
315 /***** end data ******/
319 renderPixmap(W_Screen
*screen
, Pixmap d
, Pixmap mask
, char **data
,
320 int width
, int height
)
323 GC whiteGC
= WMColorGC(screen
->white
);
324 GC blackGC
= WMColorGC(screen
->black
);
325 GC lightGC
= WMColorGC(screen
->gray
);
326 GC darkGC
= WMColorGC(screen
->darkGray
);
330 XSetForeground(screen
->display
, screen
->monoGC
, 0);
332 for (y
= 0; y
< height
; y
++) {
333 for (x
= 0; x
< width
; x
++) {
334 switch (data
[y
][x
]) {
337 XDrawPoint(screen
->display
, d
, whiteGC
, x
, y
);
342 XDrawPoint(screen
->display
, mask
, screen
->monoGC
, x
, y
);
346 XDrawPoint(screen
->display
, d
, lightGC
, x
, y
);
351 XDrawPoint(screen
->display
, d
, darkGC
, x
, y
);
357 XDrawPoint(screen
->display
, d
, blackGC
, x
, y
);
367 makePixmap(W_Screen
*sPtr
, char **data
, int width
, int height
, int masked
)
369 Pixmap pixmap
, mask
= None
;
371 pixmap
= XCreatePixmap(sPtr
->display
, W_DRAWABLE(sPtr
), width
, height
,
375 mask
= XCreatePixmap(sPtr
->display
, W_DRAWABLE(sPtr
), width
, height
, 1);
376 XSetForeground(sPtr
->display
, sPtr
->monoGC
, 1);
377 XFillRectangle(sPtr
->display
, mask
, sPtr
->monoGC
, 0, 0, width
, height
);
380 renderPixmap(sPtr
, pixmap
, mask
, data
, width
, height
);
382 return WMCreatePixmapFromXPixmaps(sPtr
, pixmap
, mask
, width
, height
,
387 #define T_WINGS_IMAGES_FILE RESOURCE_PATH"/Images.tiff"
388 #define T_DEFAULT_OBJECT_ICON_FILE RESOURCE_PATH"/defaultIcon.tiff"
390 #define X_WINGS_IMAGES_FILE RESOURCE_PATH"/Images.xpm"
391 #define X_DEFAULT_OBJECT_ICON_FILE RESOURCE_PATH"/defaultIcon.xpm"
395 loadPixmaps(WMScreen
*scr
)
409 image
= RLoadImage(scr
->rcontext
, T_WINGS_IMAGES_FILE
, 0);
411 image
= RLoadImage(scr
->rcontext
, X_WINGS_IMAGES_FILE
, 0);
413 wwarning("WINGs: could not load widget images file: %s",
414 RMessageForError(RErrorCode
));
418 /* make it have a gray background */
419 tmp
= RGetSubImage(image
, 0, 0, 24, 24);
420 RCombineImageWithColor(tmp
, &gray
);
421 scr
->homeIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
423 /* make it have a white background */
424 tmp
= RGetSubImage(image
, 0, 0, 24, 24);
425 RCombineImageWithColor(tmp
, &white
);
426 scr
->altHomeIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
430 tmp
= RGetSubImage(image
, 104, 0, 24, 24);
431 RCombineImageWithColor(tmp
, &white
);
432 scr
->trashcanIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
434 tmp
= RGetSubImage(image
, 104, 0, 24, 24);
435 RCombineImageWithColor(tmp
, &white
);
436 scr
->altTrashcanIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
439 tmp
= RGetSubImage(image
, 104, 24, 24, 24);
440 RCombineImageWithColor(tmp
, &white
);
441 scr
->createDirIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
443 tmp
= RGetSubImage(image
, 104, 24, 24, 24);
444 RCombineImageWithColor(tmp
, &white
);
445 scr
->altCreateDirIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
448 tmp
= RGetSubImage(image
, 24, 80, 24, 24);
449 RCombineImageWithColor(tmp
, &white
);
450 scr
->disketteIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
452 tmp
= RGetSubImage(image
, 24, 80, 24, 24);
453 RCombineImageWithColor(tmp
, &white
);
454 scr
->altDisketteIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
457 tmp
= RGetSubImage(image
, 0, 80, 24, 24);
458 RCombineImageWithColor(tmp
, &white
);
459 scr
->unmountIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
461 tmp
= RGetSubImage(image
, 0, 80, 24, 24);
462 RCombineImageWithColor(tmp
, &white
);
463 scr
->altUnmountIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
466 /* Magnifying Glass Icon for ColorPanel */
467 tmp
= RGetSubImage(image
, 24, 0, 40, 32);
468 RCombineImageWithColor(tmp
, &gray
);
469 scr
->magnifyIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
471 /* ColorWheel Icon for ColorPanel */
472 tmp
= RGetSubImage(image
, 0, 25, 24, 24);
473 scr
->wheelIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
475 /* GrayScale Icon for ColorPanel */
476 tmp
= RGetSubImage(image
, 65, 0, 40, 24);
477 scr
->grayIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
479 /* RGB Icon for ColorPanel */
480 tmp
= RGetSubImage(image
, 25, 33, 40, 24);
481 scr
->rgbIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
483 /* CMYK Icon for ColorPanel */
484 tmp
= RGetSubImage(image
, 65, 25, 40, 24);
485 scr
->cmykIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
487 /* HSB Icon for ColorPanel */
488 tmp
= RGetSubImage(image
, 0, 57, 40, 24);
489 scr
->hsbIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
491 /* CustomColorPalette Icon for ColorPanel */
492 tmp
= RGetSubImage(image
, 81, 57, 40, 24);
493 scr
->customPaletteIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
495 /* ColorList Icon for ColorPanel */
496 tmp
= RGetSubImage(image
, 41, 57, 40, 24);
497 scr
->colorListIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
500 RDestroyImage(image
);
503 scr
->defaultObjectIcon
=
504 WMCreatePixmapFromFile(scr
, T_DEFAULT_OBJECT_ICON_FILE
);
505 if (!scr
->defaultObjectIcon
) {
506 scr
->defaultObjectIcon
=
507 WMCreatePixmapFromFile(scr
, X_DEFAULT_OBJECT_ICON_FILE
);
509 if (!scr
->defaultObjectIcon
) {
510 wwarning("WINGs: could not load default icon file");
520 WMCreateSimpleApplicationScreen(Display
*display
)
524 scr
= WMCreateScreen(display
, DefaultScreen(display
));
526 scr
->aflags
.hasAppIcon
= 0;
527 scr
->aflags
.simpleApplication
= 1;
535 WMCreateScreen(Display
*display
, int screen
)
537 return WMCreateScreenWithRContext(display
, screen
,
538 RCreateContext(display
, screen
, NULL
));
543 WMCreateScreenWithRContext(Display
*display
, int screen
, RContext
*context
)
548 static int initialized
= 0;
549 static char *atomNames
[] = {
568 "_WINGS_DND_MOUSE_OFFSET",
571 Atom atoms
[sizeof(atomNames
)/sizeof(char*)];
578 W_ReadConfigurations();
580 assert(W_ApplicationInitialized());
583 scrPtr
= malloc(sizeof(W_Screen
));
586 memset(scrPtr
, 0, sizeof(W_Screen
));
588 scrPtr
->aflags
.hasAppIcon
= 1;
590 scrPtr
->display
= display
;
591 scrPtr
->screen
= screen
;
592 scrPtr
->rcontext
= context
;
594 scrPtr
->depth
= context
->depth
;
596 scrPtr
->visual
= context
->visual
;
597 scrPtr
->lastEventTime
= 0;
599 scrPtr
->colormap
= context
->cmap
;
601 scrPtr
->rootWin
= RootWindow(display
, screen
);
603 scrPtr
->fontCache
= WMCreateHashTable(WMStringPointerHashCallbacks
);
605 /* initially allocate some colors */
606 WMWhiteColor(scrPtr
);
607 WMBlackColor(scrPtr
);
609 WMDarkGrayColor(scrPtr
);
611 gcv
.graphics_exposures
= False
;
613 gcv
.function
= GXxor
;
614 gcv
.foreground
= W_PIXEL(scrPtr
->white
);
615 if (gcv
.foreground
== 0) gcv
.foreground
= 1;
616 scrPtr
->xorGC
= XCreateGC(display
, W_DRAWABLE(scrPtr
), GCFunction
617 |GCGraphicsExposures
|GCForeground
, &gcv
);
619 gcv
.function
= GXxor
;
620 gcv
.foreground
= W_PIXEL(scrPtr
->gray
);
621 gcv
.subwindow_mode
= IncludeInferiors
;
622 scrPtr
->ixorGC
= XCreateGC(display
, W_DRAWABLE(scrPtr
), GCFunction
623 |GCGraphicsExposures
|GCForeground
624 |GCSubwindowMode
, &gcv
);
626 gcv
.function
= GXcopy
;
627 scrPtr
->copyGC
= XCreateGC(display
, W_DRAWABLE(scrPtr
), GCFunction
628 |GCGraphicsExposures
, &gcv
);
630 scrPtr
->clipGC
= XCreateGC(display
, W_DRAWABLE(scrPtr
), GCFunction
631 |GCGraphicsExposures
, &gcv
);
634 stipple
= XCreateBitmapFromData(display
, W_DRAWABLE(scrPtr
),
635 STIPPLE_BITS
, STIPPLE_WIDTH
, STIPPLE_HEIGHT
);
636 gcv
.foreground
= W_PIXEL(scrPtr
->darkGray
);
637 gcv
.background
= W_PIXEL(scrPtr
->gray
);
638 gcv
.fill_style
= FillStippled
;
639 gcv
.stipple
= stipple
;
640 scrPtr
->stippleGC
= XCreateGC(display
, W_DRAWABLE(scrPtr
),
641 GCForeground
|GCBackground
|GCStipple
642 |GCFillStyle
|GCGraphicsExposures
, &gcv
);
644 gcv
.foreground
= W_PIXEL(scrPtr
->black
);
645 gcv
.background
= W_PIXEL(scrPtr
->white
);
646 scrPtr
->textFieldGC
= XCreateGC(display
, W_DRAWABLE(scrPtr
),
647 GCForeground
|GCBackground
, &gcv
);
649 /* we need a 1bpp drawable for the monoGC, so borrow this one */
650 scrPtr
->monoGC
= XCreateGC(display
, stipple
, 0, NULL
);
652 scrPtr
->stipple
= stipple
;
654 scrPtr
->useMultiByte
= WINGsConfiguration
.useMultiByte
;
656 scrPtr
->normalFont
= WMSystemFontOfSize(scrPtr
,
657 WINGsConfiguration
.defaultFontSize
);
659 scrPtr
->boldFont
= WMBoldSystemFontOfSize(scrPtr
,
660 WINGsConfiguration
.defaultFontSize
);
662 if (!scrPtr
->boldFont
)
663 scrPtr
->boldFont
= scrPtr
->normalFont
;
665 if (!scrPtr
->normalFont
) {
666 wwarning("could not load any fonts. Make sure your font installation"
667 "and locale settings are correct.");
672 scrPtr
->checkButtonImageOn
= makePixmap(scrPtr
, CHECK_BUTTON_ON
,
673 CHECK_BUTTON_ON_WIDTH
,
674 CHECK_BUTTON_ON_HEIGHT
, False
);
676 scrPtr
->checkButtonImageOff
= makePixmap(scrPtr
, CHECK_BUTTON_OFF
,
677 CHECK_BUTTON_OFF_WIDTH
,
678 CHECK_BUTTON_OFF_HEIGHT
, False
);
680 scrPtr
->radioButtonImageOn
= makePixmap(scrPtr
, RADIO_BUTTON_ON
,
681 RADIO_BUTTON_ON_WIDTH
,
682 RADIO_BUTTON_ON_HEIGHT
, False
);
684 scrPtr
->radioButtonImageOff
= makePixmap(scrPtr
, RADIO_BUTTON_OFF
,
685 RADIO_BUTTON_OFF_WIDTH
,
686 RADIO_BUTTON_OFF_HEIGHT
, False
);
688 scrPtr
->buttonArrow
= makePixmap(scrPtr
, BUTTON_ARROW
,
689 BUTTON_ARROW_WIDTH
, BUTTON_ARROW_HEIGHT
,
692 scrPtr
->pushedButtonArrow
= makePixmap(scrPtr
, BUTTON_ARROW2
,
693 BUTTON_ARROW2_WIDTH
, BUTTON_ARROW2_HEIGHT
,
697 scrPtr
->scrollerDimple
= makePixmap(scrPtr
, SCROLLER_DIMPLE
,
698 SCROLLER_DIMPLE_WIDTH
,
699 SCROLLER_DIMPLE_HEIGHT
, False
);
702 scrPtr
->upArrow
= makePixmap(scrPtr
, SCROLLER_ARROW_UP
,
703 SCROLLER_ARROW_UP_WIDTH
,
704 SCROLLER_ARROW_UP_HEIGHT
, True
);
706 scrPtr
->downArrow
= makePixmap(scrPtr
, SCROLLER_ARROW_DOWN
,
707 SCROLLER_ARROW_DOWN_WIDTH
,
708 SCROLLER_ARROW_DOWN_HEIGHT
, True
);
710 scrPtr
->leftArrow
= makePixmap(scrPtr
, SCROLLER_ARROW_LEFT
,
711 SCROLLER_ARROW_LEFT_WIDTH
,
712 SCROLLER_ARROW_LEFT_HEIGHT
, True
);
714 scrPtr
->rightArrow
= makePixmap(scrPtr
, SCROLLER_ARROW_RIGHT
,
715 SCROLLER_ARROW_RIGHT_WIDTH
,
716 SCROLLER_ARROW_RIGHT_HEIGHT
, True
);
718 scrPtr
->hiUpArrow
= makePixmap(scrPtr
, HI_SCROLLER_ARROW_UP
,
719 SCROLLER_ARROW_UP_WIDTH
,
720 SCROLLER_ARROW_UP_HEIGHT
, True
);
722 scrPtr
->hiDownArrow
= makePixmap(scrPtr
, HI_SCROLLER_ARROW_DOWN
,
723 SCROLLER_ARROW_DOWN_WIDTH
,
724 SCROLLER_ARROW_DOWN_HEIGHT
, True
);
726 scrPtr
->hiLeftArrow
= makePixmap(scrPtr
, HI_SCROLLER_ARROW_LEFT
,
727 SCROLLER_ARROW_LEFT_WIDTH
,
728 SCROLLER_ARROW_LEFT_HEIGHT
, True
);
730 scrPtr
->hiRightArrow
= makePixmap(scrPtr
, HI_SCROLLER_ARROW_RIGHT
,
731 SCROLLER_ARROW_RIGHT_WIDTH
,
732 SCROLLER_ARROW_RIGHT_HEIGHT
, True
);
734 scrPtr
->popUpIndicator
= makePixmap(scrPtr
, POPUP_INDICATOR
,
735 POPUP_INDICATOR_WIDTH
,
736 POPUP_INDICATOR_HEIGHT
, True
);
738 scrPtr
->pullDownIndicator
= makePixmap(scrPtr
, PULLDOWN_INDICATOR
,
739 PULLDOWN_INDICATOR_WIDTH
,
740 PULLDOWN_INDICATOR_HEIGHT
, True
);
742 scrPtr
->checkMark
= makePixmap(scrPtr
, CHECK_MARK
,
744 CHECK_MARK_HEIGHT
, True
);
748 scrPtr
->defaultCursor
= XCreateFontCursor(display
, XC_left_ptr
);
750 scrPtr
->textCursor
= XCreateFontCursor(display
, XC_xterm
);
756 blank
= XCreatePixmap(display
, scrPtr
->stipple
, 1, 1, 1);
757 XSetForeground(display
, scrPtr
->monoGC
, 0);
758 XFillRectangle(display
, blank
, scrPtr
->monoGC
, 0, 0, 1, 1);
760 scrPtr
->invisibleCursor
= XCreatePixmapCursor(display
, blank
, blank
,
762 XFreePixmap(display
, blank
);
765 #ifdef HAVE_XINTERNATOMS
766 XInternAtoms(display
, atomNames
, sizeof(atomNames
)/sizeof(char*), False
,
771 for (i
= 0; i
< sizeof(atomNames
)/sizeof(char*); i
++) {
772 atoms
[i
] = XInternAtom(display
, atomNames
[i
], False
);
778 scrPtr
->attribsAtom
= atoms
[i
++];
780 scrPtr
->deleteWindowAtom
= atoms
[i
++];
782 scrPtr
->protocolsAtom
= atoms
[i
++];
784 scrPtr
->clipboardAtom
= atoms
[i
++];
786 scrPtr
->xdndAwareAtom
= atoms
[i
++];
787 scrPtr
->xdndSelectionAtom
= atoms
[i
++];
788 scrPtr
->xdndEnterAtom
= atoms
[i
++];
789 scrPtr
->xdndLeaveAtom
= atoms
[i
++];
790 scrPtr
->xdndPositionAtom
= atoms
[i
++];
791 scrPtr
->xdndDropAtom
= atoms
[i
++];
792 scrPtr
->xdndFinishedAtom
= atoms
[i
++];
793 scrPtr
->xdndTypeListAtom
= atoms
[i
++];
794 scrPtr
->xdndStatusAtom
= atoms
[i
++];
796 scrPtr
->xdndActionCopy
= atoms
[i
++];
797 scrPtr
->xdndActionMove
= atoms
[i
++];
798 scrPtr
->xdndActionLink
= atoms
[i
++];
799 scrPtr
->xdndActionAsk
= atoms
[i
++];
800 scrPtr
->xdndActionPrivate
= atoms
[i
++];
802 scrPtr
->wmIconDragOffsetAtom
= atoms
[i
++];
804 scrPtr
->wmStateAtom
= atoms
[i
++];
806 scrPtr
->rootView
= W_CreateRootView(scrPtr
);
809 scrPtr
->balloon
= W_CreateBalloon(scrPtr
);
812 W_InitApplication(scrPtr
);
820 WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
)
822 WMReleaseFont(scr
->normalFont
);
823 scr
->normalFont
= WMRetainFont(font
);
828 WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
)
830 WMReleaseFont(scr
->boldFont
);
831 scr
->boldFont
= WMRetainFont(font
);
837 WMHangData(WMWidget
*widget
, void *data
)
839 W_VIEW(widget
)->hangedData
= data
;
844 WMGetHangedData(WMWidget
*widget
)
846 return W_VIEW(widget
)->hangedData
;
852 WMDestroyWidget(WMWidget
*widget
)
854 W_DestroyView(W_VIEW(widget
));
859 WMSetFocusToWidget(WMWidget
*widget
)
861 W_SetFocusOfTopLevel(W_TopLevelOfView(W_VIEW(widget
)), W_VIEW(widget
));
867 * Realizes the widget and all it's children.
871 WMRealizeWidget(WMWidget
*w
)
873 W_RealizeView(W_VIEW(w
));
877 WMMapWidget(WMWidget
*w
)
879 W_MapView(W_VIEW(w
));
884 WMReparentWidget(WMWidget
*w
, WMWidget
*newParent
, int x
, int y
)
886 W_ReparentView(W_VIEW(w
), newParent
, x
, y
);
891 makeChildrenAutomap(W_View
*view
, int flag
)
893 view
= view
->childrenList
;
896 view
->flags
.mapWhenRealized
= flag
;
897 makeChildrenAutomap(view
, flag
);
899 view
= view
->nextSister
;
905 WMMapSubwidgets(WMWidget
*w
)
907 /* make sure that subwidgets created after the parent was realized
909 if (!W_VIEW(w
)->flags
.realized
) {
910 makeChildrenAutomap(W_VIEW(w
), True
);
912 W_MapSubviews(W_VIEW(w
));
918 WMUnmapSubwidgets(WMWidget
*w
)
920 if (!W_VIEW(w
)->flags
.realized
) {
921 makeChildrenAutomap(W_VIEW(w
), False
);
923 W_UnmapSubviews(W_VIEW(w
));
930 WMUnmapWidget(WMWidget
*w
)
932 W_UnmapView(W_VIEW(w
));
937 WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
)
939 W_SetViewBackgroundColor(W_VIEW(w
), color
);
940 if (W_VIEW(w
)->flags
.mapped
)
941 WMRedisplayWidget(w
);
946 WMRaiseWidget(WMWidget
*w
)
948 W_RaiseView(W_VIEW(w
));
953 WMLowerWidget(WMWidget
*w
)
955 W_LowerView(W_VIEW(w
));
960 WMMoveWidget(WMWidget
*w
, int x
, int y
)
962 W_MoveView(W_VIEW(w
), x
, y
);
967 WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
)
969 W_ResizeView(W_VIEW(w
), width
, height
);
975 W_RegisterUserWidget(void)
979 return userWidgetCount
+ WC_UserWidget
- 1;
985 WMScreenRContext(WMScreen
*scr
)
987 return scr
->rcontext
;
993 WMWidgetWidth(WMWidget
*w
)
995 return W_VIEW(w
)->size
.width
;
1000 WMWidgetHeight(WMWidget
*w
)
1002 return W_VIEW(w
)->size
.height
;
1007 WMWidgetXID(WMWidget
*w
)
1009 return W_VIEW(w
)->window
;
1014 WMWidgetScreen(WMWidget
*w
)
1016 return W_VIEW(w
)->screen
;
1022 WMScreenMainLoop(WMScreen
*scr
)
1027 WMNextEvent(scr
->display
, &event
);
1028 WMHandleEvent(&event
);
1035 WMScreenDisplay(WMScreen
*scr
)
1037 return scr
->display
;
1042 WMScreenDepth(WMScreen
*scr
)
1049 WMScreenWidth(WMScreen
*scr
)
1051 return scr
->rootView
->size
.width
;
1056 WMScreenHeight(WMScreen
*scr
)
1058 return scr
->rootView
->size
.height
;
1063 WMRedisplayWidget(WMWidget
*w
)
1065 W_RedisplayView(W_VIEW(w
));