EWMH raise support
[nedit.git] / util / misc.h
blobda1b891d3e7967cfaf3039f3d5bb68ea6d8b7e76
1 /* $Id: misc.h,v 1.31 2010/07/05 06:23:59 lebert Exp $ */
2 /*******************************************************************************
3 * *
4 * misc.h -- Nirvana Editor Miscellaneous Header File *
5 * *
6 * Copyright 2004 The NEdit Developers *
7 * *
8 * This is free software; you can redistribute it and/or modify it under the *
9 * terms of the GNU General Public License as published by the Free Software *
10 * Foundation; either version 2 of the License, or (at your option) any later *
11 * version. In addition, you may distribute versions of this program linked to *
12 * Motif or Open Motif. See README for details. *
13 * *
14 * This software is distributed in the hope that it will be useful, but WITHOUT *
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
17 * more details. *
18 * *
19 * You should have received a copy of the GNU General Public License along with *
20 * software; if not, write to the Free Software Foundation, Inc., 59 Temple *
21 * Place, Suite 330, Boston, MA 02111-1307 USA *
22 * *
23 * Nirvana Text Editor *
24 * July 31, 2001 *
25 * *
26 *******************************************************************************/
28 #ifndef NEDIT_MISC_H_INCLUDED
29 #define NEDIT_MISC_H_INCLUDED
31 #include <X11/Intrinsic.h>
32 #include <Xm/Xm.h>
33 #include <Xm/CutPaste.h>
35 #define TEXT_READ_OK 0
36 #define TEXT_IS_BLANK 1
37 #define TEXT_NOT_NUMBER 2
39 /* maximum length for a window geometry string */
40 #define MAX_GEOM_STRING_LEN 24
42 /* Maximum length for a menu accelerator string.
43 Which e.g. can be parsed by misc.c:parseAccelString()
44 (how many modifier keys can you hold down at once?) */
45 #define MAX_ACCEL_LEN 100
47 /* button margin width to avoid cramped buttons */
48 #define BUTTON_WIDTH_MARGIN 12
51 void AddMotifCloseCallback(Widget shell, XtCallbackProc closeCB, void *arg);
52 void SuppressPassiveGrabWarnings(void);
53 void PopDownBugPatch(Widget w);
54 void RemapDeleteKey(Widget w);
55 void SetDeleteRemap(int state);
56 void RealizeWithoutForcingPosition(Widget shell);
57 void RemovePPositionHint(Widget shell);
58 void ManageDialogCenteredOnPointer(Widget dialogChild);
59 void SetPointerCenteredDialogs(int state);
60 void RaiseDialogWindow(Widget shell);
61 void RaiseShellWindow(Widget shell, Boolean focus);
62 void RaiseWindow(Display *display, Window w, Boolean focus);
63 void AddDialogMnemonicHandler(Widget dialog, int unmodifiedToo);
64 void RemoveDialogMnemonicHandler(Widget dialog);
65 void AccelLockBugPatch(Widget topWidget, Widget topMenuContainer);
66 void UpdateAccelLockPatch(Widget topWidget, Widget newButton);
67 char *GetXmStringText(XmString fromString);
68 XFontStruct *GetDefaultFontStruct(XmFontList font);
69 XmString* StringTable(int count, ...);
70 void FreeStringTable(XmString *table);
71 void SimulateButtonPress(Widget widget);
72 Widget AddMenuItem(Widget parent, char *name, char *label, char mnemonic,
73 char *acc, char *accText, XtCallbackProc callback, void *cbArg);
74 Widget AddMenuToggle(Widget parent, char *name, char *label, char mnemonic,
75 char *acc, char *accText, XtCallbackProc callback, void *cbArg,int set);
76 Widget AddSubMenu(Widget parent, char *name, char *label, char mnemonic);
77 void SetIntText(Widget text, int value);
78 int GetFloatText(Widget text, double *value);
79 int GetIntText(Widget text, int *value);
80 int GetFloatTextWarn(Widget text, double *value, const char *fieldName, int warnBlank);
81 int GetIntTextWarn(Widget text, int *value, const char *fieldName, int warnBlank);
82 int TextWidgetIsBlank(Widget textW);
83 void MakeSingleLineTextW(Widget textW);
84 void BeginWait(Widget topCursorWidget);
85 void BusyWait(Widget anyWidget);
86 void EndWait(Widget topCursorWidget);
87 void PasswordText(Widget w, char *passTxt);
88 void AddHistoryToTextWidget(Widget textW, char ***historyList, int *nItems);
89 void AddToHistoryList(char *newItem, char ***historyList, int *nItems);
90 void CreateGeometryString(char *string, int x, int y,
91 int width, int height, int bitmask);
92 Boolean FindBestVisual(Display *display, const char *appName, const char *appClass,
93 Visual **visual, int *depth, Colormap *colormap);
94 Widget CreateDialogShell(Widget parent, char *name, ArgList arglist,
95 Cardinal argcount);
96 Widget CreatePopupMenu(Widget parent, char *name, ArgList arglist,
97 Cardinal argcount);
98 Widget CreatePulldownMenu(Widget parent, char *name, ArgList arglist,
99 Cardinal argcount);
100 Widget CreatePromptDialog(Widget parent, char *name, ArgList arglist,
101 Cardinal argcount);
102 Widget CreateSelectionDialog(Widget parent, char *name, ArgList arglist,
103 Cardinal argcount);
104 Widget CreateFormDialog(Widget parent, char *name, ArgList arglist,
105 Cardinal argcount);
106 Widget CreateFileSelectionDialog(Widget parent, char *name, ArgList arglist,
107 Cardinal argcount);
108 Widget CreateQuestionDialog(Widget parent, char *name, ArgList arglist,
109 Cardinal argcount);
110 Widget CreateMessageDialog(Widget parent, char *name, ArgList arglist,
111 Cardinal argcount);
112 Widget CreateErrorDialog(Widget parent, char *name, ArgList arglist,
113 Cardinal argcount);
114 Widget CreateShellWithBestVis(String appName, String appClass,
115 WidgetClass class, Display *display, ArgList args, Cardinal nArgs);
116 Widget CreatePopupShellWithBestVis(String shellName, WidgetClass class,
117 Widget parent, ArgList arglist, Cardinal argcount);
118 Widget CreateWidget(Widget parent, const char *name, WidgetClass class,
119 ArgList arglist, Cardinal argcount);
120 Modifiers GetNumLockModMask(Display *display);
121 void InstallMouseWheelActions(XtAppContext context);
122 void AddMouseWheelSupport(Widget w);
123 void RadioButtonChangeState(Widget widget, Boolean state, Boolean notify);
124 void CloseAllPopupsFor(Widget shell);
125 long QueryCurrentDesktop(Display *display, Window rootWindow);
126 long QueryDesktop(Display *display, Widget shell);
127 int SpinClipboardStartCopy(Display *display, Window window,
128 XmString clip_label, Time timestamp, Widget widget,
129 XmCutPasteProc callback, long *item_id);
130 int SpinClipboardCopy(Display *display, Window window, long item_id,
131 char *format_name, XtPointer buffer, unsigned long length,
132 long private_id, long *data_id);
133 int SpinClipboardEndCopy(Display *display, Window window, long item_id);
134 int SpinClipboardInquireLength(Display *display, Window window,
135 char *format_name, unsigned long *length);
136 int SpinClipboardRetrieve(Display *display, Window window, char *format_name,
137 XtPointer buffer, unsigned long length, unsigned long *num_bytes,
138 long *private_id);
139 int SpinClipboardLock(Display *display, Window window);
140 int SpinClipboardUnlock(Display *display, Window window);
141 void WmClientMsg(Display *disp, Window win, const char *msg,
142 unsigned long data0, unsigned long data1,
143 unsigned long data2, unsigned long data3,
144 unsigned long data4);
146 #endif /* NEDIT_MISC_H_INCLUDED */