Fix for SF #705495: Crash while Copying Pattern.
[nedit.git] / util / misc.h
blobc110d0c33932e70f3338d1123dafd7c569e64c14
1 /* $Id: misc.h,v 1.16 2002/09/23 12:06:06 edg Exp $ */
3 #ifndef NEDIT_MISC_H_INCLUDED
4 #define NEDIT_MISC_H_INCLUDED
6 #include <X11/Intrinsic.h>
7 #include <Xm/Xm.h>
9 #define TEXT_READ_OK 0
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,
68 Cardinal argcount);
69 Widget CreatePopupMenu(Widget parent, char *name, ArgList arglist,
70 Cardinal argcount);
71 Widget CreatePulldownMenu(Widget parent, char *name, ArgList arglist,
72 Cardinal argcount);
73 Widget CreatePromptDialog(Widget parent, char *name, ArgList arglist,
74 Cardinal argcount);
75 Widget CreateSelectionDialog(Widget parent, char *name, ArgList arglist,
76 Cardinal argcount);
77 Widget CreateFormDialog(Widget parent, char *name, ArgList arglist,
78 Cardinal argcount);
79 Widget CreateFileSelectionDialog(Widget parent, char *name, ArgList arglist,
80 Cardinal argcount);
81 Widget CreateQuestionDialog(Widget parent, char *name, ArgList arglist,
82 Cardinal argcount);
83 Widget CreateMessageDialog(Widget parent, char *name, ArgList arglist,
84 Cardinal argcount);
85 Widget CreateErrorDialog(Widget parent, char *name, ArgList arglist,
86 Cardinal argcount);
87 Widget CreateShellWithBestVis(String appName, String appClass,
88 WidgetClass class, Display *display, ArgList args, Cardinal nArgs);
89 Modifiers GetNumLockModMask(Display *display);
91 #endif /* NEDIT_MISC_H_INCLUDED */