1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 #ifndef XNE_TEXTFIELD_H
24 #define XNE_TEXTFIELD_H
25
26
27 #ifndef DISABLE_XNE_TEXTFIELD
28 #define XNEtextfieldWidgetClass textfieldWidgetClass
29
30 #define XNECreateText(parent,name,args,count) XNECreateTextField(parent,name,args,count)
31 #define XNETextSetString(widget,value) XNETextFieldSetString(widget,value)
32 #define XNETextGetString(widget) XNETextFieldGetString(widget)
33 #define XNETextGetLastPosition(widget) XNETextFieldGetLastPosition(widget)
34 #define XNETextSetInsertionPosition(widget, i) XNETextFieldSetInsertionPosition(widget, i)
35 #define XNETextGetLastPosition(widget) XNETextFieldGetLastPosition(widget)
36 #define XNETextSetSelection(w, f, l, t) XNETextFieldSetSelection(w, f, l, t)
37 #else
38 #define XNEtextfieldWidgetClass xmTextFieldWidgetClass
39
40 #define XNECreateText(parent,name,args,count) XmCreateTextField(parent,name,args,count)
41 #define XNETextSetString(widget,value) XmTextFieldSetString(widget,value)
42 #define XNETextGetString(widget) TextGetStringUtf8(widget)
43 #define XNETextGetLastPosition(widget) XmTextFieldGetLastPosition(widget)
44 #define XNETextSetInsertionPosition(widget, i) XmTextFieldSetInsertionPosition(widget, i)
45 #define XNETextSetSelection(w, f, l, t) XmTextFieldSetSelection(w, f, l, t)
46 #endif
47
48 #include <X11/Intrinsic.h>
49 #include <Xm/TextF.h>
50 #include "../source/text.h"
51
52 extern WidgetClass textfieldWidgetClass;
53
54 struct TextFieldClassRec;
55 struct TextFieldRec;
56
57 typedef struct TextFieldRec *TextFieldWidget;
58
59
60 void textfield_init(Widget request, Widget neww, ArgList args, Cardinal *num_args);
61 void textfield_realize(Widget widget, XtValueMask *mask, XSetWindowAttributes *attributes);
62 void textfield_destroy(Widget widget);
63 void textfield_resize(Widget widget);
64 void textfield_expose(Widget widget, XEvent* event, Region region);
65 Boolean textfield_set_values(Widget old, Widget request, Widget neww, ArgList args, Cardinal *num_args);
66 Boolean textfield_acceptfocus(Widget widget, Time *time);
67
68 void textfield_recalc_size(TextFieldWidget w);
69
70 void XNETextFieldSetString(Widget widget,
char *value);
71 char* XNETextFieldGetString(Widget widget);
72 XmTextPosition XNETextFieldGetLastPosition(Widget widget);
73 void XNETextFieldSetInsertionPosition(Widget widget, XmTextPosition i);
74 void XNETextFieldSetSelection(Widget w, XmTextPosition first, XmTextPosition last, Time sel_time);
75
76
77 #endif
78
79