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 2
301 #define STIPPLE_HEIGHT 2
302 static unsigned char STIPPLE_BITS
[] = {0x01, 0x02};
305 extern void W_ReadConfigurations(void);
308 extern W_ViewProcedureTable _WindowViewProcedures
;
309 extern W_ViewProcedureTable _FrameViewProcedures
;
310 extern W_ViewProcedureTable _LabelViewProcedures
;
311 extern W_ViewProcedureTable _ButtonViewProcedures
;
312 extern W_ViewProcedureTable _TextFieldViewProcedures
;
313 extern W_ViewProcedureTable _ScrollerViewProcedures
;
314 extern W_ViewProcedureTable _ScrollViewProcedures
;
315 extern W_ViewProcedureTable _ListViewProcedures
;
316 extern W_ViewProcedureTable _BrowserViewProcedures
;
317 extern W_ViewProcedureTable _PopUpButtonViewProcedures
;
318 extern W_ViewProcedureTable _ColorWellViewProcedures
;
319 extern W_ViewProcedureTable _ScrollViewViewProcedures
;
320 extern W_ViewProcedureTable _SliderViewProcedures
;
321 extern W_ViewProcedureTable _SplitViewViewProcedures
;
324 * All widget classes defined must have an entry here.
326 static W_ViewProcedureTable
*procedureTables
[16];
328 static W_ViewProcedureTable
**userProcedureTable
= NULL
;
329 static int userWidgetCount
=0;
332 /***** end data ******/
339 procedureTables
[WC_Window
] = &_WindowViewProcedures
;
340 procedureTables
[WC_Frame
] = &_FrameViewProcedures
;
341 procedureTables
[WC_Label
] = &_LabelViewProcedures
;
342 procedureTables
[WC_Button
] = &_ButtonViewProcedures
;
343 procedureTables
[WC_TextField
] = &_TextFieldViewProcedures
;
344 procedureTables
[WC_Scroller
] = &_ScrollerViewProcedures
;
345 procedureTables
[WC_List
] = &_ListViewProcedures
;
346 procedureTables
[WC_Browser
] = &_BrowserViewProcedures
;
347 procedureTables
[WC_PopUpButton
] = &_PopUpButtonViewProcedures
;
348 procedureTables
[WC_ColorWell
] = &_ColorWellViewProcedures
;
349 procedureTables
[WC_ScrollView
] = &_ScrollViewViewProcedures
;
350 procedureTables
[WC_Slider
] = &_SliderViewProcedures
;
351 procedureTables
[WC_SplitView
] = &_SplitViewViewProcedures
;
356 renderPixmap(W_Screen
*screen
, Pixmap d
, Pixmap mask
, char **data
,
357 int width
, int height
)
360 GC whiteGC
= WMColorGC(screen
->white
);
361 GC blackGC
= WMColorGC(screen
->black
);
362 GC lightGC
= WMColorGC(screen
->gray
);
363 GC darkGC
= WMColorGC(screen
->darkGray
);
367 XSetForeground(screen
->display
, screen
->monoGC
, 0);
369 for (y
= 0; y
< height
; y
++) {
370 for (x
= 0; x
< width
; x
++) {
371 switch (data
[y
][x
]) {
374 XDrawPoint(screen
->display
, d
, whiteGC
, x
, y
);
379 XDrawPoint(screen
->display
, mask
, screen
->monoGC
, x
, y
);
383 XDrawPoint(screen
->display
, d
, lightGC
, x
, y
);
388 XDrawPoint(screen
->display
, d
, darkGC
, x
, y
);
394 XDrawPoint(screen
->display
, d
, blackGC
, x
, y
);
404 makePixmap(W_Screen
*sPtr
, char **data
, int width
, int height
, int masked
)
406 Pixmap pixmap
, mask
= None
;
408 pixmap
= XCreatePixmap(sPtr
->display
, W_DRAWABLE(sPtr
), width
, height
,
412 mask
= XCreatePixmap(sPtr
->display
, W_DRAWABLE(sPtr
), width
, height
, 1);
413 XSetForeground(sPtr
->display
, sPtr
->monoGC
, 1);
414 XFillRectangle(sPtr
->display
, mask
, sPtr
->monoGC
, 0, 0, width
, height
);
417 renderPixmap(sPtr
, pixmap
, mask
, data
, width
, height
);
419 return WMCreatePixmapFromXPixmaps(sPtr
, pixmap
, mask
, width
, height
,
424 #define T_WINGS_IMAGES_FILE RESOURCE_PATH"/Images.tiff"
425 #define T_DEFAULT_OBJECT_ICON_FILE RESOURCE_PATH"/defaultIcon.tiff"
427 #define X_WINGS_IMAGES_FILE RESOURCE_PATH"/Images.xpm"
428 #define X_DEFAULT_OBJECT_ICON_FILE RESOURCE_PATH"/defaultIcon.xpm"
432 loadPixmaps(WMScreen
*scr
)
446 image
= RLoadImage(scr
->rcontext
, T_WINGS_IMAGES_FILE
, 0);
448 image
= RLoadImage(scr
->rcontext
, X_WINGS_IMAGES_FILE
, 0);
450 wwarning("WINGs: could not load widget images file: %s",
451 RMessageForError(RErrorCode
));
455 /* make it have a gray background */
456 tmp
= RGetSubImage(image
, 0, 0, 24, 24);
457 RCombineImageWithColor(tmp
, &gray
);
458 scr
->homeIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
460 /* make it have a white background */
461 tmp
= RGetSubImage(image
, 0, 0, 24, 24);
462 RCombineImageWithColor(tmp
, &white
);
463 scr
->altHomeIcon
= 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 tmp
= RGetSubImage(image
, 24, 0, 40, 32);
472 RCombineImageWithColor(tmp
, &white
);
473 scr
->altMagnifyIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
475 /* ColorWheel Icon for ColorPanel */
476 tmp
= RGetSubImage(image
, 0, 25, 24, 24);
477 scr
->wheelIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
479 /* GrayScale Icon for ColorPanel */
480 tmp
= RGetSubImage(image
, 65, 0, 40, 24);
481 scr
->grayIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
483 /* RGB Icon for ColorPanel */
484 tmp
= RGetSubImage(image
, 25, 33, 40, 24);
485 scr
->rgbIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
487 /* CMYK Icon for ColorPanel */
488 tmp
= RGetSubImage(image
, 65, 25, 40, 24);
489 scr
->cmykIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
491 /* HSB Icon for ColorPanel */
492 tmp
= RGetSubImage(image
, 0, 57, 40, 24);
493 scr
->hsbIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
495 /* CustomColorPalette Icon for ColorPanel */
496 tmp
= RGetSubImage(image
, 81, 57, 40, 24);
497 scr
->customPaletteIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
499 /* ColorList Icon for ColorPanel */
500 tmp
= RGetSubImage(image
, 41, 57, 40, 24);
501 scr
->colorListIcon
= WMCreatePixmapFromRImage(scr
, tmp
, 128);
504 RDestroyImage(image
);
507 scr
->defaultObjectIcon
=
508 WMCreatePixmapFromFile(scr
, T_DEFAULT_OBJECT_ICON_FILE
);
509 if (!scr
->defaultObjectIcon
) {
510 scr
->defaultObjectIcon
=
511 WMCreatePixmapFromFile(scr
, X_DEFAULT_OBJECT_ICON_FILE
);
513 if (!scr
->defaultObjectIcon
) {
514 wwarning("WINGs: could not load default icon file");
524 WMCreateSimpleApplicationScreen(Display
*display
)
528 scr
= WMCreateScreen(display
, DefaultScreen(display
));
530 scr
->aflags
.hasAppIcon
= 0;
531 scr
->aflags
.simpleApplication
= 1;
539 WMCreateScreen(Display
*display
, int screen
)
541 return WMCreateScreenWithRContext(display
, screen
,
542 RCreateContext(display
, screen
, NULL
));
547 WMCreateScreenWithRContext(Display
*display
, int screen
, RContext
*context
)
552 static int initialized
= 0;
558 initProcedureTable();
560 W_ReadConfigurations();
562 assert(W_ApplicationInitialized());
565 scrPtr
= malloc(sizeof(W_Screen
));
568 memset(scrPtr
, 0, sizeof(W_Screen
));
570 scrPtr
->aflags
.hasAppIcon
= 1;
572 scrPtr
->display
= display
;
573 scrPtr
->screen
= screen
;
574 scrPtr
->rcontext
= context
;
576 scrPtr
->depth
= context
->depth
;
578 scrPtr
->visual
= context
->visual
;
579 scrPtr
->lastEventTime
= 0;
581 scrPtr
->colormap
= context
->cmap
;
583 scrPtr
->rootWin
= RootWindow(display
, screen
);
585 scrPtr
->fontCache
= WMCreateHashTable(WMStringPointerHashCallbacks
);
587 /* initially allocate some colors */
588 WMWhiteColor(scrPtr
);
589 WMBlackColor(scrPtr
);
591 WMDarkGrayColor(scrPtr
);
593 gcv
.graphics_exposures
= False
;
595 gcv
.function
= GXxor
;
596 gcv
.foreground
= W_PIXEL(scrPtr
->white
);
597 if (gcv
.foreground
== 0) gcv
.foreground
= 1;
598 scrPtr
->xorGC
= XCreateGC(display
, W_DRAWABLE(scrPtr
), GCFunction
599 |GCGraphicsExposures
|GCForeground
, &gcv
);
601 gcv
.function
= GXxor
;
602 gcv
.foreground
= W_PIXEL(scrPtr
->gray
);
603 gcv
.subwindow_mode
= IncludeInferiors
;
604 scrPtr
->ixorGC
= XCreateGC(display
, W_DRAWABLE(scrPtr
), GCFunction
605 |GCGraphicsExposures
|GCForeground
606 |GCSubwindowMode
, &gcv
);
608 gcv
.function
= GXcopy
;
609 scrPtr
->copyGC
= XCreateGC(display
, W_DRAWABLE(scrPtr
), GCFunction
610 |GCGraphicsExposures
, &gcv
);
612 scrPtr
->clipGC
= XCreateGC(display
, W_DRAWABLE(scrPtr
), GCFunction
613 |GCGraphicsExposures
, &gcv
);
616 stipple
= XCreateBitmapFromData(display
, W_DRAWABLE(scrPtr
),
617 STIPPLE_BITS
, STIPPLE_WIDTH
, STIPPLE_HEIGHT
);
618 gcv
.foreground
= W_PIXEL(scrPtr
->darkGray
);
619 gcv
.background
= W_PIXEL(scrPtr
->gray
);
620 gcv
.fill_style
= FillStippled
;
621 gcv
.stipple
= stipple
;
622 scrPtr
->stippleGC
= XCreateGC(display
, W_DRAWABLE(scrPtr
),
623 GCForeground
|GCBackground
|GCStipple
624 |GCFillStyle
|GCGraphicsExposures
, &gcv
);
626 gcv
.foreground
= W_PIXEL(scrPtr
->black
);
627 gcv
.background
= W_PIXEL(scrPtr
->white
);
628 scrPtr
->textFieldGC
= XCreateGC(display
, W_DRAWABLE(scrPtr
),
629 GCForeground
|GCBackground
, &gcv
);
631 /* we need a 1bpp drawable for the monoGC, so borrow this one */
632 scrPtr
->monoGC
= XCreateGC(display
, stipple
, 0, NULL
);
634 scrPtr
->stipple
= stipple
;
636 scrPtr
->normalFont
= WMSystemFontOfSize(scrPtr
, 12);
638 scrPtr
->boldFont
= WMBoldSystemFontOfSize(scrPtr
, 12);
640 if (!scrPtr
->boldFont
)
641 scrPtr
->boldFont
= scrPtr
->normalFont
;
643 if (!scrPtr
->normalFont
) {
644 wwarning("could not load any fonts. Make sure your font installation"
645 "and locale settings are correct.");
650 scrPtr
->checkButtonImageOn
= makePixmap(scrPtr
, CHECK_BUTTON_ON
,
651 CHECK_BUTTON_ON_WIDTH
,
652 CHECK_BUTTON_ON_HEIGHT
, False
);
654 scrPtr
->checkButtonImageOff
= makePixmap(scrPtr
, CHECK_BUTTON_OFF
,
655 CHECK_BUTTON_OFF_WIDTH
,
656 CHECK_BUTTON_OFF_HEIGHT
, False
);
658 scrPtr
->radioButtonImageOn
= makePixmap(scrPtr
, RADIO_BUTTON_ON
,
659 RADIO_BUTTON_ON_WIDTH
,
660 RADIO_BUTTON_ON_HEIGHT
, False
);
662 scrPtr
->radioButtonImageOff
= makePixmap(scrPtr
, RADIO_BUTTON_OFF
,
663 RADIO_BUTTON_OFF_WIDTH
,
664 RADIO_BUTTON_OFF_HEIGHT
, False
);
666 scrPtr
->buttonArrow
= makePixmap(scrPtr
, BUTTON_ARROW
,
667 BUTTON_ARROW_WIDTH
, BUTTON_ARROW_HEIGHT
,
670 scrPtr
->pushedButtonArrow
= makePixmap(scrPtr
, BUTTON_ARROW2
,
671 BUTTON_ARROW2_WIDTH
, BUTTON_ARROW2_HEIGHT
,
675 scrPtr
->scrollerDimple
= makePixmap(scrPtr
, SCROLLER_DIMPLE
,
676 SCROLLER_DIMPLE_WIDTH
,
677 SCROLLER_DIMPLE_HEIGHT
, False
);
680 scrPtr
->upArrow
= makePixmap(scrPtr
, SCROLLER_ARROW_UP
,
681 SCROLLER_ARROW_UP_WIDTH
,
682 SCROLLER_ARROW_UP_HEIGHT
, True
);
684 scrPtr
->downArrow
= makePixmap(scrPtr
, SCROLLER_ARROW_DOWN
,
685 SCROLLER_ARROW_DOWN_WIDTH
,
686 SCROLLER_ARROW_DOWN_HEIGHT
, True
);
688 scrPtr
->leftArrow
= makePixmap(scrPtr
, SCROLLER_ARROW_LEFT
,
689 SCROLLER_ARROW_LEFT_WIDTH
,
690 SCROLLER_ARROW_LEFT_HEIGHT
, True
);
692 scrPtr
->rightArrow
= makePixmap(scrPtr
, SCROLLER_ARROW_RIGHT
,
693 SCROLLER_ARROW_RIGHT_WIDTH
,
694 SCROLLER_ARROW_RIGHT_HEIGHT
, True
);
696 scrPtr
->hiUpArrow
= makePixmap(scrPtr
, HI_SCROLLER_ARROW_UP
,
697 SCROLLER_ARROW_UP_WIDTH
,
698 SCROLLER_ARROW_UP_HEIGHT
, True
);
700 scrPtr
->hiDownArrow
= makePixmap(scrPtr
, HI_SCROLLER_ARROW_DOWN
,
701 SCROLLER_ARROW_DOWN_WIDTH
,
702 SCROLLER_ARROW_DOWN_HEIGHT
, True
);
704 scrPtr
->hiLeftArrow
= makePixmap(scrPtr
, HI_SCROLLER_ARROW_LEFT
,
705 SCROLLER_ARROW_LEFT_WIDTH
,
706 SCROLLER_ARROW_LEFT_HEIGHT
, True
);
708 scrPtr
->hiRightArrow
= makePixmap(scrPtr
, HI_SCROLLER_ARROW_RIGHT
,
709 SCROLLER_ARROW_RIGHT_WIDTH
,
710 SCROLLER_ARROW_RIGHT_HEIGHT
, True
);
712 scrPtr
->popUpIndicator
= makePixmap(scrPtr
, POPUP_INDICATOR
,
713 POPUP_INDICATOR_WIDTH
,
714 POPUP_INDICATOR_HEIGHT
, True
);
716 scrPtr
->pullDownIndicator
= makePixmap(scrPtr
, PULLDOWN_INDICATOR
,
717 PULLDOWN_INDICATOR_WIDTH
,
718 PULLDOWN_INDICATOR_HEIGHT
, True
);
720 scrPtr
->checkMark
= makePixmap(scrPtr
, CHECK_MARK
,
722 CHECK_MARK_HEIGHT
, True
);
726 scrPtr
->defaultCursor
= XCreateFontCursor(display
, XC_left_ptr
);
728 scrPtr
->textCursor
= XCreateFontCursor(display
, XC_xterm
);
730 scrPtr
->internalMessage
= XInternAtom(display
, "_WINGS_MESSAGE", False
);
732 scrPtr
->attribsAtom
= XInternAtom(display
, "_GNUSTEP_WM_ATTR", False
);
734 scrPtr
->deleteWindowAtom
= XInternAtom(display
, "WM_DELETE_WINDOW", False
);
736 scrPtr
->protocolsAtom
= XInternAtom(display
, "WM_PROTOCOLS", False
);
738 scrPtr
->clipboardAtom
= XInternAtom(display
, "CLIPBOARD", False
);
740 scrPtr
->rootView
= W_CreateRootView(scrPtr
);
743 scrPtr
->balloon
= W_CreateBalloon(scrPtr
);
746 W_InitApplication(scrPtr
);
753 WMHangData(WMWidget
*widget
, void *data
)
755 W_VIEW(widget
)->hangedData
= data
;
760 WMGetHangedData(WMWidget
*widget
)
762 return W_VIEW(widget
)->hangedData
;
768 WMDestroyWidget(WMWidget
*widget
)
770 W_DestroyView(W_VIEW(widget
));
775 WMSetFocusToWidget(WMWidget
*widget
)
777 W_SetFocusOfTopLevel(W_TopLevelOfView(W_VIEW(widget
)), W_VIEW(widget
));
783 * Realizes the widget and all it's children.
787 WMRealizeWidget(WMWidget
*w
)
789 W_RealizeView(W_VIEW(w
));
793 WMMapWidget(WMWidget
*w
)
795 W_MapView(W_VIEW(w
));
800 makeChildrenAutomap(W_View
*view
, int flag
)
802 view
= view
->childrenList
;
805 view
->flags
.mapWhenRealized
= flag
;
806 makeChildrenAutomap(view
, flag
);
808 view
= view
->nextSister
;
814 WMMapSubwidgets(WMWidget
*w
)
816 /* make sure that subwidgets created after the parent was realized
818 if (!W_VIEW(w
)->flags
.realized
) {
819 makeChildrenAutomap(W_VIEW(w
), True
);
821 W_MapSubviews(W_VIEW(w
));
827 WMUnmapSubwidgets(WMWidget
*w
)
829 if (!W_VIEW(w
)->flags
.realized
) {
830 makeChildrenAutomap(W_VIEW(w
), False
);
832 W_UnmapSubviews(W_VIEW(w
));
839 WMUnmapWidget(WMWidget
*w
)
841 W_UnmapView(W_VIEW(w
));
846 WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
)
848 if (W_CLASS(w
) < WC_UserWidget
849 && procedureTables
[W_CLASS(w
)]->setBackgroundColor
) {
851 (*procedureTables
[W_CLASS(w
)]->setBackgroundColor
)(w
, color
);
853 } else if (W_CLASS(w
) >= WC_UserWidget
854 && userProcedureTable
[W_CLASS(w
)-WC_UserWidget
]->setBackgroundColor
) {
856 (*userProcedureTable
[W_CLASS(w
)-WC_UserWidget
]->setBackgroundColor
)(w
, color
);
859 W_SetViewBackgroundColor(W_VIEW(w
), color
);
865 WMMoveWidget(WMWidget
*w
, int x
, int y
)
867 if (W_CLASS(w
) < WC_UserWidget
868 && procedureTables
[W_CLASS(w
)]->move
) {
870 (*procedureTables
[W_CLASS(w
)]->move
)(w
, x
, y
);
872 } else if (W_CLASS(w
) >= WC_UserWidget
873 && userProcedureTable
[W_CLASS(w
)-WC_UserWidget
]->move
) {
875 (*userProcedureTable
[W_CLASS(w
)-WC_UserWidget
]->move
)(w
, x
, y
);
878 W_MoveView(W_VIEW(w
), x
, y
);
884 WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
)
886 if (W_CLASS(w
) < WC_UserWidget
887 && procedureTables
[W_CLASS(w
)]->resize
) {
889 (*procedureTables
[W_CLASS(w
)]->resize
)(w
, width
, height
);
891 } else if (W_CLASS(w
) >= WC_UserWidget
892 && userProcedureTable
[W_CLASS(w
)-WC_UserWidget
]->resize
) {
894 (*userProcedureTable
[W_CLASS(w
)-WC_UserWidget
]->resize
)(w
, width
, height
);
897 W_ResizeView(W_VIEW(w
), width
, height
);
904 W_RegisterUserWidget(W_ViewProcedureTable
*procTable
)
906 W_ViewProcedureTable
**newTable
;
909 newTable
= wmalloc(sizeof(W_ViewProcedureTable
*)*userWidgetCount
);
910 memcpy(newTable
, userProcedureTable
,
911 sizeof(W_ViewProcedureTable
*)*(userWidgetCount
-1));
913 newTable
[userWidgetCount
-1] = procTable
;
915 free(userProcedureTable
);
917 userProcedureTable
= newTable
;
919 return userWidgetCount
+ WC_UserWidget
- 1;
925 WMScreenRContext(WMScreen
*scr
)
927 return scr
->rcontext
;
933 WMWidgetWidth(WMWidget
*w
)
935 return W_VIEW(w
)->size
.width
;
940 WMWidgetHeight(WMWidget
*w
)
942 return W_VIEW(w
)->size
.height
;
947 WMWidgetXID(WMWidget
*w
)
949 return W_VIEW(w
)->window
;
954 WMWidgetScreen(WMWidget
*w
)
956 return W_VIEW(w
)->screen
;
962 WMScreenMainLoop(WMScreen
*scr
)
967 WMNextEvent(scr
->display
, &event
);
968 WMHandleEvent(&event
);
975 WMScreenDisplay(WMScreen
*scr
)
982 WMScreenDepth(WMScreen
*scr
)
989 WMRedisplayWidget(WMWidget
*w
)
991 W_RedisplayView(W_VIEW(w
));