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