/* ** planemask.c ** ** How to make a widget to choose a planemask. ** ** NOTE: This file uses static variables. Therefore, trying to use these ** functions to create more than one of these planemask choice things ** will fail in a big way. */ /* $XFree86$ */ #include #include #include #include #include #include #include #include #include "xgc.h" static void choose_plane(Widget, caddr_t, caddr_t); static unsigned long planemask; static Widget *pm; /* create_planemask_choice(w) ** ------------------------- ** Inside w (a form widget), creates a bunch of little toggle buttons ** in a row, representing the planemask. There's also a label so ** the user knows what it is. */ void create_planemask_choice(Widget w) { /* callback list for the toggle widgets */ static XtCallbackRec callbacklist[] = { {(XtCallbackProc) choose_plane, NULL}, {NULL, NULL} }; /* ArgList for the label */ static Arg labelargs[] = { {XtNborderWidth, (XtArgVal) 0}, {XtNjustify, (XtArgVal) XtJustifyRight}, {XtNvertDistance, (XtArgVal) 4} }; /* ArgList for the toggles */ static Arg pmargs[] = { {XtNcallback, (XtArgVal) NULL}, {XtNhorizDistance, (XtArgVal) NULL}, {XtNfromHoriz, (XtArgVal) NULL}, {XtNwidth, (XtArgVal) 10}, {XtNheight, (XtArgVal) 10}, {XtNhighlightThickness,(XtArgVal) 1}, {XtNstate, (XtArgVal) True}, {XtNlabel, (XtArgVal) ""} }; static Widget label; /* the label, of course */ static int *pminfo; /* contains integers saying which bit a particular button is; sent to choose_plane to tell it which bit got changed */ int i, num_planes; char buf[40]; char name[12]; num_planes = PlanesOfScreen(X.scr); planemask = (1<