summaryrefslogtreecommitdiff
path: root/iup/src/gtk/iupgtk_drv.h
blob: ade2a4ac89705627b9587193eeccc1d37156e64b (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
/** \file
 * \brief GTK Driver 
 *
 * See Copyright Notice in "iup.h"
 */
 
#ifndef __IUPGTK_DRV_H 
#define __IUPGTK_DRV_H

#ifdef __cplusplus
extern "C" {
#endif


/* global variables, declared in iupgtk_globalattrib.c */
extern int iupgtk_utf8autoconvert;         


/* common */
gboolean iupgtkEnterLeaveEvent(GtkWidget *widget, GdkEventCrossing *evt, Ihandle* ih);
gboolean iupgtkShowHelp(GtkWidget *widget, GtkWidgetHelpType *arg1, Ihandle* ih);
GtkFixed* iupgtkBaseGetFixed(Ihandle* ih);
void iupgtkBaseAddToParent(Ihandle* ih);
void iupgdkColorSet(GdkColor* color, unsigned char r, unsigned char g, unsigned char b);
int iupgtkSetDragDropAttrib(Ihandle* ih, const char* value);
int iupgtkSetMnemonicTitle(Ihandle* ih, GtkLabel* label, const char* value);
char* iupgtkStrConvertToUTF8(const char* str);
char* iupgtkStrConvertFromUTF8(const char* str);
void iupgtkReleaseConvertUTF8(void);
char* iupgtkStrConvertFromFilename(const char* str);
char* iupgtkStrConvertToFilename(const char* str);
void iupgtkUpdateMnemonic(Ihandle* ih);
gboolean iupgtkMotionNotifyEvent(GtkWidget *widget, GdkEventMotion *evt, Ihandle *ih);
gboolean iupgtkButtonEvent(GtkWidget *widget, GdkEventButton *evt, Ihandle *ih);
void iupgtkBaseSetBgColor(InativeHandle* handle, unsigned char r, unsigned char g, unsigned char b);
void iupgtkBaseSetFgColor(InativeHandle* handle, unsigned char r, unsigned char g, unsigned char b);
void iupgtkBaseSetFgGdkColor(InativeHandle* handle, GdkColor *color);


/* focus */
gboolean iupgtkFocusInOutEvent(GtkWidget *widget, GdkEventFocus *evt, Ihandle* ih);


/* key */
gboolean iupgtkKeyPressEvent(GtkWidget *widget, GdkEventKey *evt, Ihandle* ih);
gboolean iupgtkKeyReleaseEvent(GtkWidget *widget, GdkEventKey *evt, Ihandle* ih);
void iupgtkButtonKeySetStatus(guint state, unsigned int but, char* status, int doubleclick);
void iupgtkKeyEncode(int key, guint *keyval, guint *state);


/* font */
char* iupgtkGetPangoFontDescAttrib(Ihandle *ih);
char* iupgtkGetFontIdAttrib(Ihandle *ih);
PangoFontDescription* iupgtkGetPangoFontDesc(const char* value);
char* iupgtkFindPangoFontDesc(PangoFontDescription* fontdesc);
void iupgtkFontUpdatePangoLayout(Ihandle* ih, PangoLayout* layout);
void iupgtkFontUpdateObjectPangoLayout(Ihandle* ih, gpointer object);

/* There are PANGO_SCALE Pango units in one device unit. 
  For an output backend where a device unit is a pixel, 
  a size value of 10 * PANGO_SCALE gives 10 pixels. */
#define IUPGTK_PANGOUNITS2PIXELS(_x) (((_x) + PANGO_SCALE/2) / PANGO_SCALE)
#define IUPGTK_PIXELS2PANGOUNITS(_x) ((_x) * PANGO_SCALE)


/* open */
char* iupgtkGetNativeWindowHandle(Ihandle* ih);
void iupgtkPushVisualAndColormap(void* visual, void* colormap);
void* iupgtkGetNativeGraphicsContext(GtkWidget* widget);
void iupgtkReleaseNativeGraphicsContext(GtkWidget* widget, void* gc);
void iupgtkUpdateGlobalColors(GtkStyle* style);


/* dialog */
gboolean iupgtkDialogDeleteEvent(GtkWidget *widget, GdkEvent *evt, Ihandle *ih);


#ifdef __cplusplus
}
#endif

#endif