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 makeChildrenAutomap(W_View
*view
, int flag
)
886 view
= view
->childrenList
;
889 view
->flags
.mapWhenRealized
= flag
;
890 makeChildrenAutomap(view
, flag
);
892 view
= view
->nextSister
;
898 WMMapSubwidgets(WMWidget
*w
)
900 /* make sure that subwidgets created after the parent was realized
902 if (!W_VIEW(w
)->flags
.realized
) {
903 makeChildrenAutomap(W_VIEW(w
), True
);
905 W_MapSubviews(W_VIEW(w
));
911 WMUnmapSubwidgets(WMWidget
*w
)
913 if (!W_VIEW(w
)->flags
.realized
) {
914 makeChildrenAutomap(W_VIEW(w
), False
);
916 W_UnmapSubviews(W_VIEW(w
));
923 WMUnmapWidget(WMWidget
*w
)
925 W_UnmapView(W_VIEW(w
));
930 WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
)
932 W_SetViewBackgroundColor(W_VIEW(w
), color
);
937 WMMoveWidget(WMWidget
*w
, int x
, int y
)
939 W_MoveView(W_VIEW(w
), x
, y
);
944 WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
)
946 W_ResizeView(W_VIEW(w
), width
, height
);
952 W_RegisterUserWidget(void)
956 return userWidgetCount
+ WC_UserWidget
- 1;
962 WMScreenRContext(WMScreen
*scr
)
964 return scr
->rcontext
;
970 WMWidgetWidth(WMWidget
*w
)
972 return W_VIEW(w
)->size
.width
;
977 WMWidgetHeight(WMWidget
*w
)
979 return W_VIEW(w
)->size
.height
;
984 WMWidgetXID(WMWidget
*w
)
986 return W_VIEW(w
)->window
;
991 WMWidgetScreen(WMWidget
*w
)
993 return W_VIEW(w
)->screen
;
999 WMScreenMainLoop(WMScreen
*scr
)
1004 WMNextEvent(scr
->display
, &event
);
1005 WMHandleEvent(&event
);
1012 WMScreenDisplay(WMScreen
*scr
)
1014 return scr
->display
;
1019 WMScreenDepth(WMScreen
*scr
)
1026 WMScreenWidth(WMScreen
*scr
)
1028 return scr
->rootView
->size
.width
;
1033 WMScreenHeight(WMScreen
*scr
)
1035 return scr
->rootView
->size
.height
;
1040 WMRedisplayWidget(WMWidget
*w
)
1042 W_RedisplayView(W_VIEW(w
));