LAST: Programming Details 3Contents

Library description: List of Widgets and Sample Code

This section lists the prototypes of all the WINGs and a few libwraster functions, some of them with a coding example.

General widgets
A frame can be used to group widgets. When moving widgets, their position will be calculated with respect to the upper left corner of their parent frame. A frame has a WMView. Title position definitions are here. WMReliefType WMFlat will make the frame's border invisible.
WMButton * WMCreateButton (WMWidget *parent, WMButtonType type)
  • WMButton * WMCreateCustomButton (WMWidget *parent, int behaviourMask)
  • void WMGroupButtons (WMButton *bPtr, WMButton *newMember)
  • void WMSetButtonAction (WMButton *bPtr, WMAction *action, void *clientData)
  • void WMSetButtonImage (WMButton *bPtr, WMPixmap *image)
  • void WMSetButtonImageDefault (WMButton *bPtr)
  • void WMSetButtonImageDimsWhenDisabled (WMButton *bPtr, Bool flag)
  • void WMSetButtonImagePosition (WMButton *bPtr, WMImagePosition position)
  • void WMSetButtonText (WMButton *bPtr, char *text)
  • void WMSetButtonTextAlignment (WMButton *bPtr, WMAlignment alignment)
  • void WMSetButtonTextColor (WMButton *bPtr, WMColor *color)
  • void WMSetButtonAltImage (WMButton *bPtr, WMPixmap *image)
  • void WMSetButtonAltText (WMButton *bPtr, char *text)
  • void WMSetButtonAltTextColor (WMButton *bPtr, WMColor *color)
  • void WMSetButtonBordered (WMButton *bPtr, int isBordered)
  • void WMSetButtonContinuous (WMButton *bPtr, Bool flag)
  • void WMSetButtonDisabledTextColor (WMButton *bPtr, WMColor *color)
  • void WMSetButtonFont (WMButton *bPtr, WMFont *font)
  • void WMSetButtonPeriodicDelay (WMButton *bPtr, float delay, float interval)
  • void WMSetButtonEnabled (WMButton *bPtr, Bool flag)
  • void WMSetButtonSelected (WMButton *bPtr, int isSelected)
  • void WMSetButtonTag (WMButton *bPtr, int tag)
  • void WMPerformButtonClick (WMButton *bPtr)
  • int WMGetButtonEnabled (WMButton *bPtr)
  • int WMGetButtonSelected (WMButton *bPtr)

    WMButtonType: WBTMomentaryPush, WBTMomentaryChange,WBTMomentaryLight WBTPushOnPushOff, WBTOnOff, WBToggle, WBTSwitch, WBTRadio

    Button boxes
    Expanding and pull-down buttons
    A pop-up button shows a list of buttons when it is clicked. Use the WMSetPopUpButtonPullsDown function with boolean true to make it pull down like a menu. When false, the list will shift, and the current item will be under the mouse pointer.WMAction has been described above. To make the list, you create the first Button, and just use WMAddPopUpButtonItem for the next ones. The numbering starts at 0. You do not need to keep pointers to your labels, as there are functions to get the item number, and,with the item number, the label. The action called is the same for the whole menu list.
    Text Fields
    A text field is a widget in which the user can type text. Setting it to secure will show asterisks instead of the typed in characters.
    A label displays text in its parent. WRFlat is the relief type which shows the label without a border. WRSunken and WRSimple are other relief types.

    The slider's orientation is set by WMResizeWidgeting it. A continuous slider will pass all the values along the way when it is being changed.
    Scrollable views
    This widget can have two scrollbars to navigate the widget inside of it.
    Message pop-up windows

    A message pop-up window is shown by calling: int WMRunAlertPanel (WMScreen *scrPtr, WMWindow *owner, char *messagetophalf, char *messagebottomhalf, char *defaultButton, char *alternateButton, char *otherButton) The first argument should be the widget's screen, the second the window we are working in. The last three are labels for three buttons. The default button will return WAPRDefault (0) from the function, if clicked, and is the option selected if the user presses 'enter'. The middle and left button return 1 and -1. Only those buttons are shown whose labels are not NULL.

    Input dialogs
    A pop up which asks for input, with a cancel and OK button, is provided through the self explanatory function: char * WMRunInputPanel (WMScreen *screen, WMWindow *owner, char *dialogtitle, char *message,char *defaultText, char *okButtontext, char *cancelButtontext). Cancel returns a null pointer. The defaultText is presented in the text field in the pop-up, and can be changed by the user.
    File selection dialogs
    File selector and file saving dialogs can be called from the WINGs library rightaway. The file selector window allows the user to browse the file system, open a file, and to delete or create a file or directory. To use it, there are three functions:

    To open files there is a struct WMOpenPanel, to close them WMSavePanel. As for the WMView, we take the nature of the Panel as given for now. We just open a pointer to one on the screen we have opened. To open files, the WMOpenPanel pointer is passed to the function WMRunModalFilePanelForDirectory, which makes the file selector pop up. The owner can be set to NULL. initialpath is a string containing the starting directory name. The title is the dialog's title. The dialog has cancel and OK buttons, which make the function return False and True respectively. If True, the selected file name can be retrieved with WMGetFilePanelFileName (WMFilePanel *panel). To save files, exactly the same functions are used, with the only difference that you pass a pointer to a WMSavePanel.

    Text Areas
    FreezeText and thaw before and after appending will make the appended text appear immediately.
    Split windows/views
    lists and Property Lists

    WMListItem has a member .text, which contains the string added to the list with WMAddListItem. When making a (multiple) selection in the view, the items are added in a WMArray in the order they have been clicked. The WMArray is a dynamic array with functions to retrieve its elements, or the number of elements. WMList provides a WMListSelectionDidChangeNotification event. Sample code using WMAddNotificationObserver to add a function which handles all the selection events:

    /* global*/
    static void listSelectionObserver(void *observer, WMNotification *notification){
    WMList *lPtr = (WMList*)WMGetNotificationObject(notification);
    WMListItem *item;
    int i;
     item =  WMGetFromArray(WMGetListSelectedItems(lPtr),0);  /* 1st selected item */
     i= WMGetArrayItemCount(WMGetListSelectedItems(lPtr)));   /* number of items   */
         /* do something */
         /* in main :    */
    WMList *list;
    int i;
    char text[100];
     list = WMCreateList(window);
     WMSetListAllowMultipleSelection(list, True);
     for (i=0; i<20; i++) {
         sprintf(text, "20 times same item");
         WMAddListItem(list, text);
     WMAddNotificationObserver(listSelectionObserver, NULL/*(observer)*/,
                                  WMListSelectionDidChangeNotification, list);
    WMSetList[Double]Action specifies a WMAction to do, when a list item is [double]clicked, e.g.
    static void doubleClick(WMWidget *self, void *data){


    Colour Panels

    Font Panel

    Tabbed views

    The label on the tab itself should not be empty, or the tab won't be clickable. The view in the tab takes the view of the inserted widget. A frame expands to the tabbed view it is in. The widgets which go into the tabbed views should have the same parent as the whole TabView widget. Sample code for a TabView containing two tabs, the first with a frame, the second with a label:

    /* WMWindow *window created */
    int x,y, Width, Height;
    WMFrame *frame;
    WMLabel *label;
    WMTabView *tabview;
    WMTabViewItem *tab;
     tabview = WMCreateTabView(window);
     WMMoveWidget(tabview, x, y);
     WMResizeWidget(tabview, Width, Height);
     frame = WMCreateFrame(window);
     tab = WMCreateTabViewItemWithIdentifier(0);
     WMSetTabViewItemView(tab, WMWidgetView(frame));
     WMAddItemInTabView(tabview, tab);
     WMSetTabViewItemLabel(tab, "1");
     label = WMCreateLabel(window);
     WMSetLabelText(label, "Text in View");
     tab = WMCreateTabViewItemWithIdentifier(0);
     WMSetTabViewItemView(tab, WMWidgetView(label));
     WMAddItemInTabView(tabview, tab);
     WMSetTabViewItemLabel(tab, "tab 2"); 
    Progress Indicators
    Event handlers
    is a function in libXlib. It returns the number of events in the queue, if needed, after flushing the events buffer. If there are any, WMNextEvent can be called, and next WMHandleEvent.
    Image functions
    Application wide functions
    • void WMInitializeApplication (char *applicationName, int *argc, char **argv)
    • char * WMGetApplicationName ()
    • void WMSetApplicationHasAppIcon (WMScreen *scr, Bool flag)
    • void WMSetApplicationIconImage (WMScreen *scr, RImage *image)
    • void WMSetApplicationIconPixmap (WMScreen *scr, WMPixmap *icon)
    • void WMSetApplicationIconWindow (WMScreen *scr, Window window)
    • WMPixmap * WMCreateApplicationIconBlendedPixmap (WMScreen *scr, RColor *color)
    • RImage * WMGetApplicationIconImage (WMScreen *scr)
    • WMPixmap * WMGetApplicationIconPixmap (WMScreen *scr)


    A typical sequence to have a window handle messages which come from some widget, is:
    (global) const char *WMRequestName="AnyName";
    At the point (in some widget function) where another window (widget) should act on the notification, put:
    WMPostNotificationName(WMRequestName, self, NULL);
    This call will put the notification in a queue.

    In the WMNotificationObserverAction(void *self,WMNotification notif), with name "notificationHandler", put
    if(!strcmp(WMRequestName,WMGetNotificationName(notif))){do something}
    This will do something if the incoming notification is one with the right name. To put it to work by a widget "window", do:
    WMAddNotificationObserver(notificationHandler, window, WMRequestName, object)
    Arguments "window" and "object", and also the notification name, can be NULL. The last argument (object) to the WMAddNotificationObserver function selects an object where the notification is allowed to come from. To handle all incoming notifications with the right name, set this to NULL

    • void WMAddNotificationObserver (WMNotificationObserverAction *observerAction, void *observer, const char *name, void *object)
    • WMNotification * WMCreateNotification (const char *name, void *object, void *clientData)
    • WMNotificationQueue * WMCreateNotificationQueue (void )
    • void WMPostNotification (WMNotification *notification)
    • void WMPostNotificationName (const char *name, void *object, void *clientData)
    • void * WMGetNotificationClientData (WMNotification *notification)
    • const char * WMGetNotificationName (WMNotification *notification)
    • void * WMGetNotificationObject (WMNotification *notification)
    • void WMEnqueueNotification (WMNotificationQueue *queue, WMNotification *notification, WMPostingStyle postingStyle)
    • void WMDequeueNotificationMatching (WMNotificationQueue *queue, WMNotification *notification, unsigned mask)
    • void WMEnqueueCoalesceNotification (WMNotificationQueue *queue, WMNotification *notification, WMPostingStyle postingStyle, unsigned coalesceMask)
    • WMNotificationQueue * WMGetDefaultNotificationQueue (void )
    • void WMReleaseNotification (WMNotification *notification)
    • void WMRemoveNotificationObserver (void *observer)
    • void WMRemoveNotificationObserverWithName (void *observer, const char *name, void *object)
    • WMNotification * WMRetainNotification (WMNotification *notification)
    • void WMSetViewNotifySizeChanges (WMView *view, Bool flag)
    Text balloons
    • void WMSetBalloonEnabled (WMScreen *scr, Bool flag)
    • void WMSetBalloonDelay (WMScreen *scr, int delay)
    • void WMSetBalloonFont (WMScreen *scr, WMFont *font)
    • void WMSetBalloonTextAlignment (WMScreen *scr, WMAlignment alignment)
    • void WMSetBalloonTextColor (WMScreen *scr, WMColor *color)
    • void WMSetBalloonTextForView (char *text, WMView *view)
    • W_Balloon * W_CreateBalloon (WMScreen *scr)
    • void W_BalloonHandle[Enter|Leave]View (WMView *view)
    Drag/drop functions

    • void WMDragImageFromView (WMView *view, WMPixmap *image, char *dataTypes, WMPoint atLocation, WMSize mouseOffset, XEvent *event, Bool slideBack)
    • WMPoint WMGetDraggingInfoImageLocation (WMDraggingInfo *info)
    • void WMRegisterViewForDraggedTypes (WMView *view, char *acceptedTypes)
    • void WMSetViewDragDestinationProcs (WMView *view, WMDragDestinationProcs *procs)
    • void WMSetViewDragSourceProcs (WMView *view, WMDragSourceProcs *procs)
    • void WMUnregisterViewDraggedTypes (WMView *view)
    • Bool WMRequestDroppedData (WMView *view, WMDraggingInfo *info, char *type, WMDropDataCallback *callback)
    Network connection
    • WMConnection * WMCreateConnectionAsServerAtAddress (char *host, char *service, char *protocol)
    • WMConnection * WMCreateConnectionToAddress (char *host, char *service, char *protocol)
    • WMConnection * WMCreateConnectionToAddressAndNotify (char *host, char *service, char *protocol)
    • WMConnection * WMAcceptConnection (WMConnection *listener)
    • void WMCloseConnection (WMConnection *cPtr)
    • void WMDestroyConnection (WMConnection *cPtr)
    • void WMSetConnectionClientData (WMConnection *cPtr, void *data)
    • Bool WMSetConnectionCloseOnExec (WMConnection *cPtr, Bool flag)
    • void WMSetConnectionDefaultTimeout (unsigned int timeout)
    • void WMSetConnectionDelegate (WMConnection *cPtr, ConnectionDelegate *delegate)
    • void WMSetConnectionFlags (WMConnection *cPtr, unsigned int flags)
    • Bool WMSetConnectionNonBlocking (WMConnection *cPtr, Bool flag)
    • void WMSetConnectionOpenTimeout (unsigned int timeout)
    • void WMSetConnectionSendTimeout (WMConnection *cPtr, unsigned int timeout)
    • void WMSetConnectionShutdownOnClose (WMConnection *cPtr, Bool flag)
    • Bool WMEnqueueConnectionData (WMConnection *cPtr, WMData *data)
    • char * WMGetConnectionAddress (WMConnection *cPtr)
    • WMData * WMGetConnectionAvailableData (WMConnection *cPtr)
    • void * WMGetConnectionClientData (WMConnection *cPtr)
    • unsigned int WMGetConnectionFlags (WMConnection *cPtr)
    • char * WMGetConnectionProtocol (WMConnection *cPtr)
    • char * WMGetConnectionService (WMConnection *cPtr)
    • int WMGetConnectionSocket (WMConnection *cPtr)
    • WMConnectionState WMGetConnectionState (WMConnection *cPtr)
    • WMConnectionTimeoutState WMGetConnectionTimeoutState (WMConnection *cPtr)
    • WMArray * WMGetConnectionUnsentData (WMConnection *cPtr)
    • int WMSendConnectionData (WMConnection *cPtr, WMData *data)
    Draw functions
    • RContext * RCreateContext (Display *dpy, int screen_number, RContextAttributes *attribs)
    • GC WMColorGC (WMColor *color)
    • RImage * RCreateImage (unsigned width, unsigned height, int alpha)
    • RImage * RCreateImageFromDrawable (RContext *context, Drawable drawable, Pixmap mask)
    • RImage * RCreateImageFromXImage (RContext *context, XImage *image, XImage *mask)
    • RXImage * RCreateXImage (RContext *context, int depth, unsigned width, unsigned height)
    • void RDestroyXImage (RContext *context, RXImage *rximage)
    • void RBevelImage (RImage *image, int bevel_type)
    • int RBlurImage (RImage *image)
    • void RClearImage (RImage *image, RColor *color)
    • RImage * RCloneImage (RImage *image)
    • int RDrawLine (RImage *image, int x0, int y0, int x1, int y1, RColor *color)
    • void RDrawLines (RImage *image, RPoint *points, int npoints, int mode, RColor *color)
    • void RDrawSegments (RImage *image, RSegment *segs, int nsegs, RColor *color)
    • void RFillImage (RImage *image, RColor *color)
    • void RCombineArea (RImage *image, RImage *src, int sx, int sy, unsigned width, unsigned height, int dx, int dy)
    • void RCombineAreaWithOpaqueness (RImage *image, RImage *src, int sx, int sy, unsigned width, unsigned height, int dx, int dy, int opaqueness)
    • void RCombineImageWithColor (RImage *image, RColor *color)
    • void RCombineImages (RImage *image, RImage *src)
    • void RCombineImagesWithOpaqueness (RImage *image, RImage *src, int opaqueness)
    • int RConvertImage (RContext *context, RImage *image, Pixmap *pixmap)
    • int RConvertImageMask (RContext *context, RImage *image, Pixmap *pixmap, Pixmap *mask, int threshold)
    • Bool RGetClosestXColor (RContext *context, RColor *color, XColor *retColor)
    • char * RGetImageFileFormat (char *file)
    • RImage * RGetImageFromXPMData (RContext *context, char **data)
    • Bool RGetPixel (RImage *image, int x, int y, RColor *color)
    • RImage * RGetSubImage (RImage *image, int x, int y, unsigned width, unsigned height)
    • RXImage * RGetXImage (RContext *context, Drawable d, int x, int y, unsigned width, unsigned height)
    • void RHSVtoRGB (RHSVColor *hsv, RColor *rgb)
    • RImage * RLoadImage (RContext *context, char *file, int index)
    • RImage * RLoadPPM (RContext *context, char *file_name, int index)
    • RImage * RLoadXPM (RContext *context, char *file, int index)
    • RImage * RMakeCenteredImage (RImage *image, unsigned width, unsigned height, RColor *color)
    • RImage * RMakeTiledImage (RImage *tile, unsigned width, unsigned height)
    • const char * RMessageForError (int errorCode)
    • int ROperateLine (RImage *image, int operation, int x0, int y0, int x1, int y1, RColor *color)
    • void ROperateLines (RImage *image, int operation, RPoint *points, int npoints, int mode, RColor *color)
    • void ROperatePixel (RImage *image, int operation, int x, int y, RColor *color)
    • void ROperatePixels (RImage *image, int operation, RPoint *points, int npoints, int mode, RColor *color)
    • void ROperateSegments (RImage *image, int operation, RSegment *segs, int nsegs, RColor *color)
    • void RPutPixel (RImage *image, int x, int y, RColor *color)
    • void RPutPixels (RImage *image, RPoint *points, int npoints, int mode, RColor *color)
    • void RPutXImage (RContext *context, Drawable d, GC gc, RXImage *ximage, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height)
    • void RRGBtoHSV (RColor *rgb, RHSVColor *hsv)
    • void RReleaseImage (RImage *image)
    • RImage * RRenderGradient (unsigned width, unsigned height, RColor *from, RColor *to, int style)
    • RImage * RRenderInterwovenGradient (unsigned width, unsigned height, RColor colors1, int thickness1, RColor colors2, int thickness2)
    • RImage * RRenderMultiGradient (unsigned width, unsigned height, RColor **colors, int style)
    • RImage * RRetainImage (RImage *image)
    • RImage * RRotateImage (RImage *image, float angle)
    • Bool RSaveImage (RImage *image, char *filename, char *format)
    • Bool RSaveXPM (RImage *image, char *filename)
    • RImage * RScaleImage (RImage *image, unsigned new_width, unsigned new_height)
    • RImage * RSmoothScaleImage (RImage *src, unsigned new_width, unsigned new_height)
    • char ** RSupportedFileFormats (void )
    • RColor ulongToRColor (WMScreen *scr, unsigned long value)
    • RColor WMGetRColorFromColor(WMColor *color)
    • RColor col = {0xae,0xaa,0xae,0xff}
      Other used graphics functions which are not libWINGs/libwraster:
    • Status XmuCreateColormap (dpy , colormap )
    • void XmuDeleteStandardColormap (dpy , screen , property )
    • Status XmuGetColormapAllocation (vinfo , property , red_max , green_max , blue_max )
    • Status XmuLookupStandardColormap (dpy , screen , visualid , depth , property , replace , retain )
    • XStandardColormap * XmuStandardColormap (dpy , screen , visualid , depth , property , cmap , red_max , green_max , blue_max )
    • int XDrawRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)
    • int XDrawLines(Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode)
    • int XDrawSegments(Display *display, Drawable d, GC gc, XSegment *segments, int nsegments)
    • int XDrawArc(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height, int angle1, int angle2)
    • int XDrawArcs(Display *display, Drawable d, GC gc, XArc *arcs, int narcs)
    • int XDrawPoint(Display *display, Drawable d, GC gc, int x, int y)
    • int XDrawPoints(Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode)
    • GC XCreateGC(Display *display, Drawable d, unsigned long valuemask, XGCValues *values)
    • int XFillArc(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height, int angle1, int angle2)
    • int XFillPolygon(Display *display, Drawable d, GC gc, XPoint *points, int npoints, int shape, int mode)
    • typedef struct { short x1, y1, x2, y2; } XSegment
    • typedef struct { short x, y; } XPoint
    • typedef struct { short x, y; unsigned short width, height; short angle1, angle2; /* Degrees * 64 */ } XArc
    Browser functions
    • WMBrowser * WMCreateBrowser (WMWidget *parent)
    • int WMAddBrowserColumn (WMBrowser *bPtr)
    • Bool WMBrowserAllowsEmptySelection (WMBrowser *bPtr)
    • Bool WMBrowserAllowsMultipleSelection (WMBrowser *bPtr)
    • void WMSetBrowserAction (WMBrowser *bPtr, WMAction *action, void *clientData)
    • void WMSetBrowserAllowEmptySelection (WMBrowser *bPtr, Bool flag)
    • void WMSetBrowserAllowMultipleSelection (WMBrowser *bPtr, Bool flag)
    • void WMSetBrowserColumnTitle (WMBrowser *bPtr, int column, char *title)
    • void WMSetBrowserDelegate (WMBrowser *bPtr, WMBrowserDelegate *delegate)
    • void WMSetBrowserDoubleAction (WMBrowser *bPtr, WMAction *action, void *clientData)
    • void WMSetBrowserHasScroller (WMBrowser *bPtr, int hasScroller)
    • void WMSetBrowserMaxVisibleColumns (WMBrowser *bPtr, int columns)
    • char * WMSetBrowserPath (WMBrowser *bPtr, char *path)
    • void WMSetBrowserPathSeparator (WMBrowser *bPtr, char *separator)
    • void WMSetBrowserTitled (WMBrowser *bPtr, Bool flag)
    • void WMSortBrowserColumn (WMBrowser *bPtr, int column)
    • void WMSortBrowserColumnWithComparer (WMBrowser *bPtr, int column, WMCompareDataProc *func)
    • int WMGetBrowserFirstVisibleColumn (WMBrowser *bPtr)
    • WMList * WMGetBrowserListInColumn (WMBrowser *bPtr, int column)
    • int WMGetBrowserMaxVisibleColumns (WMBrowser *bPtr)
    • int WMGetBrowserNumberOfColumns (WMBrowser *bPtr)
    • char * WMGetBrowserPath (WMBrowser *bPtr)
    • char * WMGetBrowserPathToColumn (WMBrowser *bPtr, int column)
    • WMArray * WMGetBrowserPaths (WMBrowser *bPtr)
    • int WMGetBrowserSelectedColumn (WMBrowser *bPtr)
    • WMListItem * WMGetBrowserSelectedItemInColumn (WMBrowser *bPtr, int column)
    • int WMGetBrowserSelectedRowInColumn (WMBrowser *bPtr, int column)
    • WMListItem * WMInsertBrowserItem (WMBrowser *bPtr, int column, int row, char *text, Bool isBranch)
    • void WMLoadBrowserColumnZero (WMBrowser *bPtr)
    • void WMRemoveBrowserItem (WMBrowser *bPtr, int column, int row)
    Menu items
    • WMMenuItem * WMCreateMenuItem (void )
    • void WMDestroyMenuItem (WMMenuItem *item)
    • void WMSetMenuItemAction (WMMenuItem *item, WMAction *action, void *data)
    • void WMSetMenuItemEnabled (WMMenuItem *item, Bool flag)
    • void WMSetMenuItemMixedStatePixmap (WMMenuItem *item, WMPixmap *pixmap)
    • void WMSetMenuItemOffStatePixmap (WMMenuItem *item, WMPixmap *pixmap)
    • void WMSetMenuItemOnStatePixmap (WMMenuItem *item, WMPixmap *pixmap)
    • void WMSetMenuItemPixmap (WMMenuItem *item, WMPixmap *pixmap)
    • void WMSetMenuItemRepresentedObject (WMMenuItem *item, void *object)
    • void WMSetMenuItemShortcut (WMMenuItem *item, char *shortcut)
    • void WMSetMenuItemShortcutModifierMask (WMMenuItem *item, unsigned mask)
    • void WMSetMenuItemState (WMMenuItem *item, int state)
    • void WMSetMenuItemTitle (WMMenuItem *item, char *title)
    • Bool WMMenuItemIsSeparator (WMMenuItem *item)
    • WMAction * WMGetMenuItemAction (WMMenuItem *item)
    • void * WMGetMenuItemData (WMMenuItem *item)
    • Bool WMGetMenuItemEnabled (WMMenuItem *item)
    • WMPixmap * WMGetMenuItemMixedStatePixmap (WMMenuItem *item)
    • WMPixmap * WMGetMenuItemOffStatePixmap (WMMenuItem *item)
    • WMPixmap * WMGetMenuItemOnStatePixmap (WMMenuItem *item)
    • WMPixmap * WMGetMenuItemPixmap (WMMenuItem *item)
    • void * WMGetMenuItemRepresentedObject (WMMenuItem *item)
    • char * WMGetMenuItemShortcut (WMMenuItem *item)
    • unsigned WMGetMenuItemShortcutModifierMask (WMMenuItem *item)
    • int WMGetMenuItemState (WMMenuItem *item)
    • char * WMGetMenuItemTitle (WMMenuItem *item)
    • WMMenuItem * WMGetSeparatorMenuItem (void )
    Utility/redefined functions
    • char * wdefaultspathfordomain (char *domain)
    • char * wexpandpath (char *path)
    • void wfatal (const char *msg, ... )
    • char * wfindfile (char *paths, char *file)
    • char * wfindfileinarray (WMPropList *array, char *file)
    • char * wfindfileinlist (char **path_list, char *file)
    • void wfree (void *ptr)
    • char * wgethomedir ()
    • void * wmalloc (size_t size)
    • void wmessage (const char *msg, ... )
    • WMPoint wmkpoint (int x, int y)
    • WMRange wmkrange (int start, int count)
    • WMSize wmksize (unsigned int width, unsigned int height)
    • void * wrealloc (void *ptr, size_t newsize)
    • void wrelease (void *ptr)
    • void * wretain (void *ptr)
    • waborthandler * wsetabort (waborthandler *handler)
    • char * wstrappend (char *dst, char *src)
    • char * wstrconcat (char *str1, char *str2)
    • char * wstrdup (char *str)
    • char * wstrerror (int errnum)
    • char * wstrndup (char *str, size_t len)
    • void wsyserror (const char *msg, ... )
    • void wsyserrorwithcode (int error, const char *msg, ... )
    • void wtokenfree (char **tokens, int count)
    • char * wtokenjoin (char **list, int count)
    • char * wtokennext (char *word, char **next)
    • void wtokensplit (char *command, char ***argv, int *argc)
    • char * wtrimspace (char *s)
    • char * wusergnusteppath ()
    • void wwarning (const char *msg, ... )
    Other used functions:
    • int calculateCombineArea (RImage *des, RImage *src, int *sx, int *sy, int *swidth, int *sheight, int *dx, int *dy)
    • void convertCPColor (CPColor *color)
    • void destroyNode (void *data)
    • void drawClip ()
    • char * generateNewFilename (char *curName)
    • unsigned char getShift (unsigned char value)
    • char * getStream (WMText *tPtr, int sel, int array)
    • WMArray * getStreamObjects (WMText *tPtr, int sel)
    • Pixmap makeMenuPixmap (PopUpButton *bPtr)
    • Bool requestDroppedData (WMView *view, WMDraggingInfo *info, char *type)
    • WMData * requestHandler (WMView *view, Atom selection, Atom target, void *cdata, Atom *type)
    • RColor ulongToRColor (WMScreen *scr, unsigned long value)

    Data types

    • WMColor * WMCreateNamedColor (WMScreen *scr, char *name, Bool exact)
    • WMColor * WMCreateRGBAColor (WMScreen *scr, unsigned short red, unsigned short green, unsigned short blue, unsigned short alpha, Bool exact)
    • WMColor * WMCreateRGBColor (WMScreen *scr, unsigned short red, unsigned short green, unsigned short blue, Bool exact)
    • void WMReleaseColor (WMColor *color)
    • WMColor * WMRetainColor (WMColor *color)
    • char * WMGetColorRGBDescription (WMColor *color)
    • WMColor * WMBlackColor (WMScreen *scr)
    • WMColor * WMWhiteColor (WMScreen *scr)
    • WMColor * WMGrayColor (WMScreen *scr)
    • WMColor * WMDarkGrayColor (WMScreen *scr)
    • unsigned short WMBlueComponentOfColor (WMColor *color)
    • unsigned short WMRedComponentOfColor (WMColor *color)
    • unsigned short WMGreenComponentOfColor (WMColor *color)
    • void WMSetColorInGC (WMColor *color, GC gc)
    • WMPixel WMColorPixel (WMColor *color)
    • void WMSetColorAlpha (WMColor *color, unsigned short alpha)
    • unsigned short WMGetColorAlpha (WMColor *color)
    • void WMPaintColorSwatch (WMColor *color, Drawable d, int x, int y, unsigned int width, unsigned int height)
    • void WMSetColorWellColor (WMColorWell *cPtr, WMColor *color)
    • WMColorWell * WMCreateColorWell (WMWidget *parent)
    • WMColor * WMGetColorWellColor (WMColorWell *cPtr)
    • WMFont * WMCreateFont (WMScreen *scrPtr, char *fontName)
    • WMFont * WMCreateFontSet (WMScreen *scrPtr, char *fontName)
    • WMFont * WMCreateFontWithFlags (WMScreen *scrPtr, char *fontName, WMFontFlags flags)
    • WMFont * WMCreateNormalFont (WMScreen *scrPtr, char *fontName)
    • WMFont * WMCreateAntialiasedFont (WMScreen *scrPtr, char *fontName)
    • WMFont * WMCreateAntialiasedFontSet (WMScreen *scrPtr, char *fontName)
    • WMFont * WMCopyFontWithChanges (WMScreen *scrPtr, WMFont *font, const WMFontAttributes *changes)
    • void WMReleaseFont (WMFont *font)
    • WMFont * WMRetainFont (WMFont *font)
    • WMFont * WMDefaultBoldSystemFont (WMScreen *scrPtr)
    • WMFont * WMDefaultSystemFont (WMScreen *scrPtr)
    • WMFont * WMSystemFontOfSize (WMScreen *scrPtr, int size)
    • WMFont * WMBoldSystemFontOfSize (WMScreen *scrPtr, int size)
    • unsigned int WMFontHeight (WMFont *font)
    • XFontSet WMGetFontFontSet (WMFont *font)
    • char * WMGetFontName (WMFont *font)
    • Bool WMIsAntialiasedFont (WMFont *font)
    • void WMSetWidgetDefaultBoldFont (WMScreen *scr, WMFont *font)
    • void WMSetWidgetDefaultFont (WMScreen *scr, WMFont *font)
    • WMArray * WMCreateArray (int initialSize)
    • WMArray * WMCreateArrayWithArray (WMArray *array)
    • WMArray * WMCreateArrayWithDestructor (int initialSize, WMFreeDataProc *destructor)
    • void WMAddToArray (WMArray *array, void *item)
    • void WMAppendArray (WMArray *array, WMArray *other)
    • void * WMArrayFirst (WMArray *array, WMArrayIterator *iter)
    • void * WMArrayLast (WMArray *array, WMArrayIterator *iter)
    • void * WMArrayNext (WMArray *array, WMArrayIterator *iter)
    • void * WMArrayPrevious (WMArray *array, WMArrayIterator *iter)
    • int WMCountInArray (WMArray *array, void *item)
    • int WMDeleteFromArray (WMArray *array, int index)
    • void WMEmptyArray (WMArray *array)
    • int WMFindInArray (WMArray *array, WMMatchDataProc *match, void *cdata)
    • void WMFreeArray (WMArray *array)
    • int WMGetArrayItemCount (WMArray *array)
    • void * WMGetFromArray (WMArray *array, int index)
    • void WMInsertInArray (WMArray *array, int index, void *item)
    • void WMMapArray (WMArray *array, void (*function)(void *, void *), void *data)
    • void * WMPopFromArray (WMArray *array)
    • int WMRemoveFromArrayMatching (WMArray *array, WMMatchDataProc *match, void *cdata)
    • void * WMReplaceInArray (WMArray *array, int index, void *item)
    • void WMSortArray (WMArray *array, WMCompareDataProc *comparer)
    • WMPropList * WMCreatePLArray (WMPropList *elem, ... )
    • void WMAddToPLArray (WMPropList *plist, WMPropList *item)
    • void WMDeleteFromPLArray (WMPropList *plist, int index)
    • WMPropList * WMGetFromPLArray (WMPropList *plist, int index)
    • void WMInsertInPLArray (WMPropList *plist, int index, WMPropList *item)
    • Bool WMIsPLArray (WMPropList *plist)
    • void WMRemoveFromPLArray (WMPropList *plist, WMPropList *item)
    • WM_ITERATE_ARRAY(WMArray *,itemtype *,WMArrayIterator *iter)
    • WMTreeNode * WMCreateTreeNode (void *data)
    • WMTreeNode * WMCreateTreeNodeWithDestructor (void *data, WMFreeDataProc *destructor)
    • void WMDeleteLeafForTreeNode (WMTreeNode *aNode, int index)
    • void WMDestroyTreeNode (WMTreeNode *aNode)
    • void * WMGetDataForTreeNode (WMTreeNode *aNode)
    • void * WMReplaceDataForTreeNode (WMTreeNode *aNode, void *newData)
    • WMTreeNode * WMGetParentForTreeNode (WMTreeNode *aNode)
    • int WMGetTreeNodeDepth (WMTreeNode *aNode)
    • WMTreeNode * WMFindInTree (WMTreeNode *aTree, WMMatchDataProc *match, void *cdata)
    • WMTreeNode * WMInsertItemInTree (WMTreeNode *parent, int index, void *item)
    • WMTreeNode * WMInsertNodeInTree (WMTreeNode *parent, int index, WMTreeNode *aNode)
    • void WMRemoveLeafForTreeNode (WMTreeNode *aNode, void *leaf)
    • void WMSortLeavesForTreeNode (WMTreeNode *aNode, WMCompareDataProc *comparer)
    • void WMSortTree (WMTreeNode *aNode, WMCompareDataProc *comparer)

    ENUMS and #defines

    List of event masks and corresponding events
    Event maskEvent
    KeyPressMask KeyPress
    KeyReleaseMask KeyRelease
    ButtonPressMask ButtonPress
    ButtonReleaseMask ButtonRelease
    EnterWindowMask EnterNotify
    LeaveWindowMask LeaveNotify
    FocusChangeMask FocusIn
    FocusChangeMask FocusOut
    KeymapStateMask KeymapNotify
    ExposureMask Expose
    ExposureMask GraphicsExpose
    ExposureMask NoExpose
    VisibilityChangeMask VisibilityNotify
    SubstructureNotifyMask CreateNotify
    StructureNotifyMask DestroyNotify
    StructureNotifyMask UnmapNotify
    StructureNotifyMask MapNotify
    SubstructureRedirectMask MapRequest
    StructureNotifyMask ReparentNotify
    StructureNotifyMask ConfigureNotify
    SubstructureRedirectMask ConfigureRequest
    StructureNotifyMask GravityNotify
    ResizeRedirectMask ResizeRequest
    StructureNotifyMask CirculateNotify
    SubstructureRedirectMask CirculateRequest
    PropertyChangeMask PropertyNotify
    ColormapChangeMask ColormapNotify
    ClientMessageMask ClientMessage
    Frame Title Positions
    • WTPAboveTop
    • WTPAtTop
    • WTPBelowTop
    • WTPAboveBottom
    • WTPAtBottom
    • WTPBelowBottom
    WM Image Positions WMImagePosition
    • WIPNoImage,
    • WIPImageOnly,
    • WIPLeft,
    • WIPRight,
    • WIPBelow,
    • WIPAbove,
    • WIPOverlaps
    • WALeft
    • WACenter
    • WARight
    • WAJustified
    Reliefs WMReliefType
    • WRFlat
    • WRSimple
    • WRRaised
    • WRSunken
    • WRGroove
    • WRRidge
    • WRPushed

    typedef struct RColor { unsigned char red; unsigned char green; unsigned char blue; unsigned char alpha; } RColor;

    typedef struct RSegment { int x1, y1, x2, y2; } RSegment;

    LAST: Programming Details 3Contents