summaryrefslogtreecommitdiff
path: root/iup/src/iup_drv.h
blob: 1071347eabcf7bbb257d39c0749c2ecbd1116a97 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/** \file
 * \brief Driver Interface. Each driver must export the symbols defined here.
 *
 * See Copyright Notice in "iup.h"
 */
 
#ifndef __IUP_DRV_H 
#define __IUP_DRV_H

#ifdef __cplusplus
extern "C" {
#endif

  
/** \defgroup drv Driver Interface 
 * \par
 * Each driver must export the symbols defined here.
 * \par
 * See \ref iup_drv.h 
 */


/** Sets a global environment attribute. Called from IupSetGlobal and IupStoreGlobal.
 * Must return 1 is process the atribute, or 0 is not. 
 * \ingroup drv */
int iupdrvSetGlobal(const char* name, const char* value);

/** Returns a global environment attribute. Called from IupGetGlobal.
 * \ingroup drv */
char* iupdrvGetGlobal(const char* name);

/** Changes the idle callback. Called from IupSetFunction.
 * \ingroup drv */
void iupdrvSetIdleFunction(Icallback func);

/** Convert the coordinates from screen relative to client area releative.
 * \ingroup drv */
void iupdrvScreenToClient(Ihandle* ih, int *x, int *y);

/** Returns true if the element is visible.
 * \ingroup drv */
int iupdrvIsVisible(Ihandle* ih);

/** Returns true if the element is active.
 * \ingroup drv */
int iupdrvIsActive(Ihandle* ih);

/** Actually changes the focus to the given element.
 * \ingroup drv */
void iupdrvSetFocus(Ihandle* ih);

/** Changes the visible state of an element. 
 * Not used for dialogs. 
 * \ingroup drv */
void iupdrvSetVisible(Ihandle* ih, int enable);

/** Changes the active state of an element. 
 * \ingroup drv */
void iupdrvSetActive(Ihandle* ih, int enable);

/** Post a redraw of a control.
 * \ingroup drv */
void iupdrvPostRedraw(Ihandle *ih);

/** Force a redraw of a control.
 * \ingroup drv */
void iupdrvRedrawNow(Ihandle *ih);

/** Reparent the native control.
 * \ingroup drv */
void iupdrvReparent(Ihandle* ih);

/** Draws a focus rectangle
 * \ingroup drv */
void iupdrvDrawFocusRect(Ihandle* ih, void* gc, int x, int y, int w, int h);

/** Size of the scroolbar.
 * \ingroup drv */
int iupdrvGetScrollbarSize(void);

/** Activates a control.
 * \ingroup drv */
void iupdrvActivate(Ihandle* ih);

/** Returns the height of a menu bar.
 * \ingroup drv */
int iupdrvMenuGetMenuBarSize(Ihandle* ih);


/* Called only from IupOpen/IupClose. */
int iupdrvOpen(int *argc, char ***argv);
void iupdrvClose(void);


#ifdef __cplusplus
}
#endif

#endif