summaryrefslogtreecommitdiff
path: root/iup/src/mot/iupmot_drv.h
blob: 8a536efb44f06139086bf8d1746e6b1e91341692 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/** \file
 * \brief Motif Driver 
 *
 * See Copyright Notice in "iup.h"
 */
 
#ifndef __IUPMOT_DRV_H 
#define __IUPMOT_DRV_H

#ifdef __cplusplus
extern "C" {
#endif


/* global variables, declared in iupmot_open.c */
extern Widget         iupmot_appshell;         
extern Display*       iupmot_display;          
extern int            iupmot_screen;           
extern XtAppContext   iupmot_appcontext;       
extern Visual*        iupmot_visual;
extern Atom           iupmot_wm_deletewindow;

/* dialog */
void iupmotDialogSetVisual(Ihandle* ih, void* visual);
void iupmotDialogResetVisual(Ihandle* ih);

/* focus */
void iupmotFocusChangeEvent(Widget w, Ihandle *ih, XEvent *evt, Boolean *cont);

/* key */
void iupmotCanvasKeyReleaseEvent(Widget w, Ihandle *ih, XEvent *evt, Boolean *cont);
void iupmotKeyPressEvent(Widget w, Ihandle *ih, XEvent *evt, Boolean *cont);
KeySym iupmotKeyCharToKeySym(char c);
void iupmotButtonKeySetStatus(unsigned int state, unsigned int but, char* status, int doubleclick);
void iupmotKeyEncode(int key, unsigned int *keyval, unsigned int *state);

/* font */
char* iupmotGetFontListAttrib(Ihandle *ih);
XmFontList iupmotGetFontList(const char* foundry, const char* value);
char* iupmotFindFontList(XmFontList fontlist);
char* iupmotGetFontStructAttrib(Ihandle *ih);
char* iupmotGetFontIdAttrib(Ihandle *ih);

/* tips */
/* called from Enter/Leave events to check if a TIP is present. */
void iupmotTipEnterNotify(Ihandle* ih);
void iupmotTipLeaveNotify(void);
void iupmotTipsFinish(void);

/* common */
void iupmotPointerMotionEvent(Widget w, Ihandle *ih, XEvent *evt, Boolean *cont);
void iupmotButtonPressReleaseEvent(Widget w, Ihandle* ih, XEvent* evt, Boolean* cont);
void iupmotEnterLeaveWindowEvent(Widget w, Ihandle *ih, XEvent *evt, Boolean *cont);
void iupmotHelpCallback(Widget w, Ihandle *ih, XtPointer call_data);
void iupmotSetString(Widget w, const char *resource, const char* value);
char* iupmotConvertString(XmString str);
void iupmotSetMnemonicTitle(Ihandle *ih, const char* value);
void iupmotDisableDragSource(Widget w);
void iupmotSetPixmap(Ihandle* ih, const char* name, const char* prop, int make_inactive);
void iupmotSetGlobalColorAttrib(Widget w, const char* xmname, const char* name);
void iupmotSetBgColor(Widget w, Pixel color);
char* iupmotGetBgColorAttrib(Ihandle* ih);

void iupmotGetWindowSize(Ihandle *ih, int *width, int *height);

char* iupmotGetXWindowAttrib(Ihandle *ih);

#define iupmotSetArg(_a, _i, _n, _d) ((_a)[(_i)].name = (_n), (_a)[(_i)].value = (XtArgVal)(_d), (_i)++)


#ifdef __cplusplus
}
#endif

#endif