]> andersk Git - moira.git/blob - clients/mmoira/data.h
*** empty log message ***
[moira.git] / clients / mmoira / data.h
1 /*
2 ** Buttons & Pulldown menus across the top of the application.
3 ** When selected, it will continue to the submenu if non-null,
4 ** otherwise call the general callback.
5 */
6
7 typedef struct MenuItemS {
8         char            *label;         /* the displayed label */
9         struct MenuItemS **submenu;     /* if non-null, a submenu to display */
10         char            *accel;         /* accelerator */
11         int             operation;      /* op identifer */
12         char            *form;          /* name of form to popup */
13         char            *query;
14         int             argc;
15 } MenuItem;
16
17
18 typedef struct {
19         char    *prompt;                /* text displayed to left of input */
20         int     type;                   /* what sort of input expected */
21         Boolean choice;                 /* is this field the next choice */
22         union {                         /* default value / return value */
23                 char    *stringvalue;
24                 Boolean booleanvalue;
25                 int     integervalue;
26         } returnvalue;
27         Boolean insensitive;            /* grayed-out or not... */
28         Boolean changed;                /* true when prog changes config */
29         int     (*valuechanged)();      /* if non-NULL, call */
30         char    **keywords;             /* list of possible values */
31         char    *keyword_name;          /* name of keyword */
32         Widget  mywidget;
33         caddr_t parent;                 /* parent form */
34 } UserPrompt;
35
36 /* field types */
37 #define FT_STRING       1
38 #define FT_BOOLEAN      2
39 #define FT_KEYWORD      3
40 #define FT_NUMBER       4
41
42 /* max length of character fields */
43 #define MAXFIELDSIZE    256
44
45 #define stringval(f, n) ((f)->inputlines[n]->returnvalue.stringvalue)
46 #define boolval(f, n) ((f)->inputlines[n]->returnvalue.booleanvalue)
47
48 /*
49 ** All (foo **) entries are assumed to be null-terminated lists of foos.
50 */
51
52 typedef struct {
53         char    *label;                 /* text displayed on button */
54         int     (*returnfunction) ();   /* function called when button hit */
55 } BottomButton;
56
57 /*
58 ** Pass a pointer to the filled-in EntryForm structure back to the
59 ** returnfunction when the button is hit.
60 */
61
62 typedef struct {
63         char            *formname;      /* name of form (duh!) */
64         char            *instructions;  /* text at top of form */
65         UserPrompt      **inputlines;   /* list of input lines */
66         BottomButton    **buttons;      /* list of buttons on the bottom */
67         Widget          formpointer;    /* already exists? */
68         MenuItem        *menu;
69         caddr_t         extrastuff;     /* for future expansion */
70 } EntryForm;
71
72 /*
73 ** When you're coming up, check to see if formpointer is initialized.
74 ** If so, map it.  Otherwise, create the form and set formpointer to
75 ** the new toplevel widget id.  Then map it.
76 */
77
This page took 0.04216 seconds and 5 git commands to generate.