1 /* $Id: misc.h,v 1.21 2004/01/16 09:18:28 edg Exp $ */
3 #ifndef NEDIT_MISC_H_INCLUDED
4 #define NEDIT_MISC_H_INCLUDED
6 #include <X11/Intrinsic.h>
10 #define TEXT_IS_BLANK 1
11 #define TEXT_NOT_NUMBER 2
13 /* maximum length for a window geometry string */
14 #define MAX_GEOM_STRING_LEN 24
16 /* Maximum length for a menu accelerator string.
17 Which e.g. can be parsed by misc.c:parseAccelString()
18 (how many modifier keys can you hold down at once?) */
19 #define MAX_ACCEL_LEN 100
22 void AddMotifCloseCallback(Widget shell
, XtCallbackProc closeCB
, void *arg
);
23 void SuppressPassiveGrabWarnings(void);
24 void PopDownBugPatch(Widget w
);
25 void RemapDeleteKey(Widget w
);
26 void SetDeleteRemap(int state
);
27 void RealizeWithoutForcingPosition(Widget shell
);
28 void ManageDialogCenteredOnPointer(Widget dialogChild
);
29 void SetPointerCenteredDialogs(int state
);
30 void RaiseShellWindow(Widget shell
);
31 void RaiseWindow(Display
*display
, Window w
);
32 void AddDialogMnemonicHandler(Widget dialog
, int unmodifiedToo
);
33 void RemoveDialogMnemonicHandler(Widget dialog
);
34 void AccelLockBugPatch(Widget topWidget
, Widget topMenuContainer
);
35 void UpdateAccelLockPatch(Widget topWidget
, Widget newButton
);
36 char *GetXmStringText(XmString fromString
);
37 XFontStruct
*GetDefaultFontStruct(XmFontList font
);
38 XmString
* StringTable(int count
, ...);
39 void FreeStringTable(XmString
*table
);
40 void SimulateButtonPress(Widget widget
);
41 Widget
AddMenuItem(Widget parent
, char *name
, char *label
, char mnemonic
,
42 char *acc
, char *accText
, XtCallbackProc callback
, void *cbArg
);
43 Widget
AddMenuToggle(Widget parent
, char *name
, char *label
, char mnemonic
,
44 char *acc
, char *accText
, XtCallbackProc callback
, void *cbArg
,int set
);
45 Widget
AddMenuSeparator(Widget parent
, char *name
);
46 Widget
AddSubMenu(Widget parent
, char *name
, char *label
, char mnemonic
);
47 void SetIntLabel(Widget label
, int value
);
48 void SetFloatLabel(Widget label
, double value
);
49 void SetIntText(Widget text
, int value
);
50 void SetFloatText(Widget text
, double value
);
51 int GetFloatText(Widget text
, double *value
);
52 int GetIntText(Widget text
, int *value
);
53 int GetFloatTextWarn(Widget text
, double *value
, const char *fieldName
, int warnBlank
);
54 int GetIntTextWarn(Widget text
, int *value
, const char *fieldName
, int warnBlank
);
55 int TextWidgetIsBlank(Widget textW
);
56 void MakeSingleLineTextW(Widget textW
);
57 void BeginWait(Widget topCursorWidget
);
58 void BusyWait(Widget anyWidget
);
59 void EndWait(Widget topCursorWidget
);
60 void PasswordText(Widget w
, char *passTxt
);
61 void AddHistoryToTextWidget(Widget textW
, char ***historyList
, int *nItems
);
62 void AddToHistoryList(char *newItem
, char ***historyList
, int *nItems
);
63 void CreateGeometryString(char *string
, int x
, int y
,
64 int width
, int height
, int bitmask
);
65 Boolean
FindBestVisual(Display
*display
, const char *appName
, const char *appClass
,
66 Visual
**visual
, int *depth
, Colormap
*colormap
);
67 Widget
CreateDialogShell(Widget parent
, char *name
, ArgList arglist
,
69 Widget
CreatePopupMenu(Widget parent
, char *name
, ArgList arglist
,
71 Widget
CreatePulldownMenu(Widget parent
, char *name
, ArgList arglist
,
73 Widget
CreatePromptDialog(Widget parent
, char *name
, ArgList arglist
,
75 Widget
CreateSelectionDialog(Widget parent
, char *name
, ArgList arglist
,
77 Widget
CreateFormDialog(Widget parent
, char *name
, ArgList arglist
,
79 Widget
CreateFileSelectionDialog(Widget parent
, char *name
, ArgList arglist
,
81 Widget
CreateQuestionDialog(Widget parent
, char *name
, ArgList arglist
,
83 Widget
CreateMessageDialog(Widget parent
, char *name
, ArgList arglist
,
85 Widget
CreateErrorDialog(Widget parent
, char *name
, ArgList arglist
,
87 Widget
CreateShellWithBestVis(String appName
, String appClass
,
88 WidgetClass
class, Display
*display
, ArgList args
, Cardinal nArgs
);
89 Widget
CreatePopupShellWithBestVis(String shellName
, WidgetClass
class,
90 Widget parent
, ArgList arglist
, Cardinal argcount
);
91 Widget
CreateWidget(Widget parent
, const char *name
, WidgetClass
class,
92 ArgList arglist
, Cardinal argcount
);
93 Modifiers
GetNumLockModMask(Display
*display
);
94 void InstallMouseWheelActions(XtAppContext context
);
95 void AddMouseWheelSupport(Widget w
);
96 void RadioButtonChangeState(Widget widget
, Boolean state
, Boolean notify
);
98 #endif /* NEDIT_MISC_H_INCLUDED */