From bdbb33233c8e79f9fd78f75311f38a2a953fc137 Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 12 Sep 2013 10:59:19 +0900 Subject: [PATCH 01/23] add GtkScrollable, GtkLayout, GtkViewport (mostly complete) --- gtk/gtk.go | 328 +++++++++++++++++++++++++++++++++++++++++++++------ gtk/gtk.go.h | 18 +++ 2 files changed, 311 insertions(+), 35 deletions(-) diff --git a/gtk/gtk.go b/gtk/gtk.go index 21310c9..01a8829 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -477,7 +477,7 @@ func (v *Adjustment) Native() *C.GtkAdjustment { return C.toGtkAdjustment(p) } -func wrapAdjustment(obj *glib.Object) (*Adjustment) { +func wrapAdjustment(obj *glib.Object) *Adjustment { return &Adjustment{glib.InitiallyUnowned{obj}} } @@ -499,7 +499,7 @@ func (v *Bin) Native() *C.GtkBin { return C.toGtkBin(p) } -func wrapBin(obj *glib.Object) (*Bin) { +func wrapBin(obj *glib.Object) *Bin { return &Bin{Container{Widget{glib.InitiallyUnowned{obj}}}} } @@ -634,7 +634,7 @@ func (v *Button) Native() *C.GtkButton { return C.toGtkButton(p) } -func wrapButton(obj *glib.Object) (*Button) { +func wrapButton(obj *glib.Object) *Button { return &Button{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} } @@ -845,7 +845,7 @@ func (v *Box) Native() *C.GtkBox { return C.toGtkBox(p) } -func wrapBox(obj *glib.Object) (*Box) { +func wrapBox(obj *glib.Object) *Box { return &Box{Container{Widget{glib.InitiallyUnowned{obj}}}} } @@ -918,6 +918,258 @@ func (v *Box) SetChildPacking(child IWidget, expand, fill bool, padding uint, pa gbool(fill), C.guint(padding), C.GtkPackType(packType)) } +/* + * GtkScrollable + */ + +// IScrollable is an interface type implemented by all structs +// embedding a Scrollable. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkScrollable. +type IScrollable interface { + toScrollable() *C.GtkScrollable +} + +// Scrollable is a representation of GTK's GtkScrollable GInterface. +type Scrollable struct { + *glib.Object +} + +// Native() returns a pointer to the underlying GObject as a GtkScrollable. +func (v *Scrollable) Native() *C.GtkScrollable { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkScrollable(p) +} + +func wrapScrollable(obj *glib.Object) *Scrollable { + return &Scrollable{obj} +} + +func (v *Scrollable) toScrollable() *C.GtkScrollable { + if v == nil { + return nil + } + return v.Native() +} + +// SetHAdjustment() is a wrapper around gtk_scrollable_set_hadjustment(). +func (v *Scrollable) SetHAdjustment(adjustment *Adjustment) { + C.gtk_scrollable_set_hadjustment(v.Native(), adjustment.Native()) +} + +// GetHAdjustment() is a wrapper around gtk_scrollable_get_hadjustment(). +func (v *Scrollable) GetHAdjustment() (*Adjustment, error) { + c := C.gtk_scrollable_get_hadjustment(v.Native()) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + a := &Adjustment{glib.InitiallyUnowned{obj}} + obj.RefSink() + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return a, nil +} + +// SetVAdjustment() is a wrapper around gtk_scrollable_set_vadjustment(). +func (v *Scrollable) SetVAdjustment(adjustment *Adjustment) { + C.gtk_scrollable_set_vadjustment(v.Native(), adjustment.Native()) +} + +// GetVAdjustment() is a wrapper around gtk_scrollable_get_vadjustment(). +func (v *Scrollable) GetVAdjustment() (*Adjustment, error) { + c := C.gtk_scrollable_get_vadjustment(v.Native()) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + a := &Adjustment{glib.InitiallyUnowned{obj}} + obj.RefSink() + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return a, nil +} + +// TODO: GtkScrollable's get/set h/v policy functions. + +/* + * GtkLayout + */ + +// LayoutNew() is a wrapper around gtk_layout_new(). +func LayoutNew(hadjustment, vadjustment *Adjustment) (*Layout, error) { + c := C.gtk_layout_new(hadjustment.Native(), vadjustment.Native()) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + b := wrapLayout(obj) + obj.RefSink() + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return b, nil +} + +// Layout is a representation of GTK's GtkLayout GInterface. +type Layout struct { + *glib.Object +} + +// ILayout is an interface type implemented by all structs +// embedding a Layout. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkLayout. +type ILayout interface { + toLayout() *C.GtkLayout +} + +// Native() returns a pointer to the underlying GObject as a GtkLayout. +func (v *Layout) Native() *C.GtkLayout { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkLayout(p) +} + +func wrapLayout(obj *glib.Object) *Layout { + return &Layout{obj} +} + +func (v *Layout) toLayout() *C.GtkLayout { + if v == nil { + return nil + } + return v.Native() +} + +func (v *Layout) toScrollable() *C.GtkScrollable { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkScrollable(p) +} + +// Put() is a wrapper around gtk_layout_put(). +func (v *Layout) Put(child IWidget, x, y int) { + C.gtk_layout_put(v.Native(), child.toWidget(), + C.gint(x), C.gint(y)) +} + +// Move() is a wrapper around gtk_layout_put(). +func (v *Layout) Move(child IWidget, x, y int) { + C.gtk_layout_move(v.Native(), child.toWidget(), + C.gint(x), C.gint(y)) +} + +// GetSize() is a wrapper around gtk_layout_get_size(). +func (v *Layout) GetSize() (width, height uint) { + var w, h C.guint + C.gtk_layout_get_size(v.Native(), &w, &h) + return uint(w), uint(h) +} + +// SetSize() is a wrapper around gtk_layout_set_size(). +func (v *Layout) SetSize(width, height uint) { + C.gtk_layout_set_size(v.Native(), C.guint(width), C.guint(height)) +} + +func (v *Layout) SetHAdjustment(adjustment *Adjustment) { + wrapScrollable(v.Object).SetHAdjustment(adjustment) +} + +func (v *Layout) GetHAdjustment() (*Adjustment, error) { + return wrapScrollable(v.Object).GetHAdjustment() +} + +func (v *Layout) SetVAdjustment(adjustment *Adjustment) { + wrapScrollable(v.Object).SetVAdjustment(adjustment) +} + +func (v *Layout) GetVAdjustment() (*Adjustment, error) { + return wrapScrollable(v.Object).GetVAdjustment() +} + +// TODO gtk_layout_get_bin_window + +/* + * GtkViewport + */ + +// ViewportNew() is a wrapper around gtk_viewport_new(). +func ViewportNew(hadjustment, vadjustment *Adjustment) (*Viewport, error) { + c := C.gtk_viewport_new(hadjustment.Native(), vadjustment.Native()) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + b := wrapViewport(obj) + obj.RefSink() + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return b, nil +} + +// Viewport is a representation of GTK's GtkViewport GInterface. +type Viewport struct { + *glib.Object +} + +// IViewport is an interface type implemented by all structs +// embedding a Viewport. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkViewport. +type IViewport interface { + toViewport() *C.GtkViewport +} + +// Native() returns a pointer to the underlying GObject as a GtkViewport. +func (v *Viewport) Native() *C.GtkViewport { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkViewport(p) +} + +func wrapViewport(obj *glib.Object) *Viewport { + return &Viewport{obj} +} + +func (v *Viewport) toViewport() *C.GtkViewport { + if v == nil { + return nil + } + return v.Native() +} + +func (v *Viewport) toScrollable() *C.GtkScrollable { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkScrollable(p) +} + +func (v *Viewport) SetHAdjustment(adjustment *Adjustment) { + wrapScrollable(v.Object).SetHAdjustment(adjustment) +} + +func (v *Viewport) GetHAdjustment() (*Adjustment, error) { + return wrapScrollable(v.Object).GetHAdjustment() +} + +func (v *Viewport) SetVAdjustment(adjustment *Adjustment) { + wrapScrollable(v.Object).SetVAdjustment(adjustment) +} + +func (v *Viewport) GetVAdjustment() (*Adjustment, error) { + return wrapScrollable(v.Object).GetVAdjustment() +} + +// TODO gtk_viewport_get_bin_window, gtk_viewport_get_view_window, +// gtk_viewport_set_shadow_type, gtk_viewport_get_shadow_type + /* * GtkCellLayout */ @@ -944,7 +1196,7 @@ func (v *CellLayout) Native() *C.GtkCellLayout { return C.toGtkCellLayout(p) } -func wrapCellLayout(obj *glib.Object) (*CellLayout) { +func wrapCellLayout(obj *glib.Object) *CellLayout { return &CellLayout{obj} } @@ -1002,7 +1254,7 @@ func (v *CellRenderer) toCellRenderer() *C.GtkCellRenderer { return v.Native() } -func wrapCellRenderer(obj *glib.Object) (*CellRenderer) { +func wrapCellRenderer(obj *glib.Object) *CellRenderer { return &CellRenderer{glib.InitiallyUnowned{obj}} } @@ -1031,7 +1283,7 @@ func (v *CellRendererText) toCellRenderer() *C.GtkCellRenderer { return v.CellRenderer.Native() } -func wrapCellRendererText(obj *glib.Object) (*CellRendererText) { +func wrapCellRendererText(obj *glib.Object) *CellRendererText { return &CellRendererText{CellRenderer{glib.InitiallyUnowned{obj}}} } @@ -1066,7 +1318,7 @@ func (v *Clipboard) Native() *C.GtkClipboard { return C.toGtkClipboard(p) } -func wrapClipboard(obj *glib.Object) (*Clipboard) { +func wrapClipboard(obj *glib.Object) *Clipboard { return &Clipboard{obj} } @@ -1132,7 +1384,7 @@ func (v *ComboBox) toCellLayout() *C.GtkCellLayout { return C.toGtkCellLayout(unsafe.Pointer(v.GObject)) } -func wrapComboBox(obj *glib.Object) (*ComboBox) { +func wrapComboBox(obj *glib.Object) *ComboBox { cl := wrapCellLayout(obj) return &ComboBox{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}, *cl} } @@ -1205,7 +1457,7 @@ func (v *Container) Native() *C.GtkContainer { return C.toGtkContainer(p) } -func wrapContainer(obj *glib.Object) (*Container) { +func wrapContainer(obj *glib.Object) *Container { return &Container{Widget{glib.InitiallyUnowned{obj}}} } @@ -1237,7 +1489,7 @@ func (v *Dialog) Native() *C.GtkDialog { return C.toGtkDialog(p) } -func wrapDialog(obj *glib.Object) (*Dialog) { +func wrapDialog(obj *glib.Object) *Dialog { return &Dialog{Window{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}} } @@ -1378,7 +1630,7 @@ func (v *Entry) Native() *C.GtkEntry { return C.toGtkEntry(p) } -func wrapEntry(obj *glib.Object) (*Entry) { +func wrapEntry(obj *glib.Object) *Entry { return &Entry{Widget{glib.InitiallyUnowned{obj}}} } @@ -1879,7 +2131,7 @@ func (v *EntryBuffer) Native() *C.GtkEntryBuffer { return C.toGtkEntryBuffer(p) } -func wrapEntryBuffer(obj *glib.Object) (*EntryBuffer) { +func wrapEntryBuffer(obj *glib.Object) *EntryBuffer { return &EntryBuffer{obj} } @@ -1988,7 +2240,7 @@ func (v *EntryCompletion) Native() *C.GtkEntryCompletion { return C.toGtkEntryCompletion(p) } -func wrapEntryCompletion(obj *glib.Object) (*EntryCompletion) { +func wrapEntryCompletion(obj *glib.Object) *EntryCompletion { return &EntryCompletion{obj} } @@ -2020,7 +2272,7 @@ func (v *Grid) toOrientable() *C.GtkOrientable { return C.toGtkOrientable(unsafe.Pointer(v.GObject)) } -func wrapGrid(obj *glib.Object) (*Grid) { +func wrapGrid(obj *glib.Object) *Grid { o := wrapOrientable(obj) return &Grid{Container{Widget{glib.InitiallyUnowned{obj}}}, *o} } @@ -2142,7 +2394,7 @@ func (v *Image) Native() *C.GtkImage { return C.toGtkImage(p) } -func wrapImage(obj *glib.Object) (*Image) { +func wrapImage(obj *glib.Object) *Image { return &Image{Misc{Widget{glib.InitiallyUnowned{obj}}}} } @@ -2370,7 +2622,7 @@ func (v *Label) Native() *C.GtkLabel { return C.toGtkLabel(p) } -func wrapLabel(obj *glib.Object) (*Label) { +func wrapLabel(obj *glib.Object) *Label { return &Label{Misc{Widget{glib.InitiallyUnowned{obj}}}} } @@ -2496,7 +2748,7 @@ func (v *ListStore) Native() *C.GtkListStore { return C.toGtkListStore(p) } -func wrapListStore(obj *glib.Object) (*ListStore) { +func wrapListStore(obj *glib.Object) *ListStore { tm := wrapTreeModel(obj) return &ListStore{obj, *tm} } @@ -2630,7 +2882,7 @@ func (v *Menu) Native() *C.GtkMenu { return C.toGtkMenu(p) } -func wrapMenu(obj *glib.Object) (*Menu) { +func wrapMenu(obj *glib.Object) *Menu { return &Menu{MenuShell{Container{Widget{glib.InitiallyUnowned{obj}}}}} } @@ -2665,7 +2917,7 @@ func (v *MenuBar) Native() *C.GtkMenuBar { return C.toGtkMenuBar(p) } -func wrapMenuBar(obj *glib.Object) (*MenuBar) { +func wrapMenuBar(obj *glib.Object) *MenuBar { return &MenuBar{MenuShell{Container{Widget{glib.InitiallyUnowned{obj}}}}} } @@ -2700,7 +2952,7 @@ func (v *MenuItem) Native() *C.GtkMenuItem { return C.toGtkMenuItem(p) } -func wrapMenuItem(obj *glib.Object) (*MenuItem) { +func wrapMenuItem(obj *glib.Object) *MenuItem { return &MenuItem{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} } @@ -2771,7 +3023,7 @@ func (v *MenuShell) Native() *C.GtkMenuShell { return C.toGtkMenuShell(p) } -func wrapMenuShell(obj *glib.Object) (*MenuShell) { +func wrapMenuShell(obj *glib.Object) *MenuShell { return &MenuShell{Container{Widget{glib.InitiallyUnowned{obj}}}} } @@ -2798,7 +3050,7 @@ func (v *MessageDialog) Native() *C.GtkMessageDialog { return C.toGtkMessageDialog(p) } -func wrapMessageDialog(obj *glib.Object) (*MessageDialog) { +func wrapMessageDialog(obj *glib.Object) *MessageDialog { return &MessageDialog{Dialog{Window{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}}} } @@ -2841,7 +3093,7 @@ func (v *Misc) Native() *C.GtkMisc { return C.toGtkMisc(p) } -func wrapMisc(obj *glib.Object) (*Misc) { +func wrapMisc(obj *glib.Object) *Misc { return &Misc{Widget{glib.InitiallyUnowned{obj}}} } @@ -2863,7 +3115,7 @@ func (v *Notebook) Native() *C.GtkNotebook { return C.toGtkNotebook(p) } -func wrapNotebook(obj *glib.Object) (*Notebook) { +func wrapNotebook(obj *glib.Object) *Notebook { return &Notebook{Container{Widget{glib.InitiallyUnowned{obj}}}} } @@ -3191,7 +3443,7 @@ func (v *Orientable) Native() *C.GtkOrientable { return C.toGtkOrientable(p) } -func wrapOrientable(obj *glib.Object) (*Orientable) { +func wrapOrientable(obj *glib.Object) *Orientable { return &Orientable{obj} } @@ -3225,7 +3477,7 @@ func (v *ProgressBar) Native() *C.GtkProgressBar { return C.toGtkProgressBar(p) } -func wrapProgressBar(obj *glib.Object) (*ProgressBar) { +func wrapProgressBar(obj *glib.Object) *ProgressBar { return &ProgressBar{Widget{glib.InitiallyUnowned{obj}}} } @@ -3278,7 +3530,7 @@ func (v *ScrolledWindow) Native() *C.GtkScrolledWindow { return C.toGtkScrolledWindow(p) } -func wrapScrolledWindow(obj *glib.Object) (*ScrolledWindow) { +func wrapScrolledWindow(obj *glib.Object) *ScrolledWindow { return &ScrolledWindow{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} } @@ -3321,7 +3573,7 @@ func (v *SpinButton) Native() *C.GtkSpinButton { return C.toGtkSpinButton(p) } -func wrapSpinButton(obj *glib.Object) (*SpinButton) { +func wrapSpinButton(obj *glib.Object) *SpinButton { return &SpinButton{Entry{Widget{glib.InitiallyUnowned{obj}}}} } @@ -3395,7 +3647,7 @@ func (v *Statusbar) Native() *C.GtkStatusbar { return C.toGtkStatusbar(p) } -func wrapStatusbar(obj *glib.Object) (*Statusbar) { +func wrapStatusbar(obj *glib.Object) *Statusbar { return &Statusbar{Box{Container{Widget{glib.InitiallyUnowned{obj}}}}} } @@ -3506,7 +3758,7 @@ func (v *TreeModel) toTreeModel() *C.GtkTreeModel { return v.Native() } -func wrapTreeModel(obj *glib.Object) (*TreeModel) { +func wrapTreeModel(obj *glib.Object) *TreeModel { return &TreeModel{obj} } @@ -3632,7 +3884,7 @@ func (v *TreeSelection) Native() *C.GtkTreeSelection { return C.toGtkTreeSelection(p) } -func wrapTreeSelection(obj *glib.Object) (*TreeSelection) { +func wrapTreeSelection(obj *glib.Object) *TreeSelection { return &TreeSelection{obj} } @@ -3668,7 +3920,7 @@ func (v *TreeView) Native() *C.GtkTreeView { return C.toGtkTreeView(p) } -func wrapTreeView(obj *glib.Object) (*TreeView) { +func wrapTreeView(obj *glib.Object) *TreeView { return &TreeView{Container{Widget{glib.InitiallyUnowned{obj}}}} } @@ -3753,7 +4005,7 @@ func (v *TreeViewColumn) Native() *C.GtkTreeViewColumn { return C.toGtkTreeViewColumn(p) } -func wrapTreeViewColumn(obj *glib.Object) (*TreeViewColumn) { +func wrapTreeViewColumn(obj *glib.Object) *TreeViewColumn { return &TreeViewColumn{glib.InitiallyUnowned{obj}} } @@ -3853,7 +4105,7 @@ func (v *Widget) toWidget() *C.GtkWidget { return v.Native() } -func wrapWidget(obj *glib.Object) (*Widget) { +func wrapWidget(obj *glib.Object) *Widget { return &Widget{glib.InitiallyUnowned{obj}} } @@ -4324,6 +4576,12 @@ func cast(c *C.GObject) (glib.IObject, error) { g = wrapBox(obj) case "GtkButton": g = wrapButton(obj) + case "GtkScrollable": + g = wrapScrollable(obj) + case "GtkLayout": + g = wrapLayout(obj) + case "GtkViewport": + g = wrapViewport(obj) case "GtkCellLayout": g = wrapCellLayout(obj) case "GtkCellRenderer": diff --git a/gtk/gtk.go.h b/gtk/gtk.go.h index 367cf1f..0f0e4e4 100644 --- a/gtk/gtk.go.h +++ b/gtk/gtk.go.h @@ -194,6 +194,24 @@ toGtkCellLayout(void *p) return (GTK_CELL_LAYOUT(p)); } +static GtkScrollable * +toGtkScrollable(void *p) +{ + return (GTK_SCROLLABLE(p)); +} + +static GtkLayout * +toGtkLayout(void *p) +{ + return (GTK_LAYOUT(p)); +} + +static GtkViewport * +toGtkViewport(void *p) +{ + return (GTK_VIEWPORT(p)); +} + static GtkOrientable * toGtkOrientable(void *p) { From a6d5828a87f2940ed1c70b241423ec38bc965fb9 Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 12 Sep 2013 12:25:01 +0900 Subject: [PATCH 02/23] initial support for GtkPixbuf, GtkPixbuf loader --- gdk/gdk.go | 76 +++++++++++++++++++++ gdk/gdk.go.h | 12 ++++ gdkpixbuf/gdkpixbuf.go | 142 +++++++++++++++++++++++++++++++++++++++ gdkpixbuf/gdkpixbuf.go.h | 32 +++++++++ 4 files changed, 262 insertions(+) create mode 100644 gdkpixbuf/gdkpixbuf.go create mode 100644 gdkpixbuf/gdkpixbuf.go.h diff --git a/gdk/gdk.go b/gdk/gdk.go index daa0460..f71c4cb 100644 --- a/gdk/gdk.go +++ b/gdk/gdk.go @@ -23,6 +23,7 @@ package gdk // #cgo pkg-config: gdk-3.0 // #include +// #include // #include "gdk.go.h" import "C" import ( @@ -451,3 +452,78 @@ func (v *Window) Native() *C.GdkWindow { p := unsafe.Pointer(v.GObject) return C.toGdkWindow(p) } + +/* + * GdkPixbuf + */ + +// Pixbuf is a representation of GDK's GdkPixbuf. +type Pixbuf struct { + *glib.Object +} + +func wrapPixbuf(obj *glib.Object) *Pixbuf { + return &Pixbuf{obj} +} + +// Native() returns a pointer to the underlying GdkWindow. +func (v *Pixbuf) Native() *C.GdkPixbuf { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkPixbuf(p) +} + +// PixbufNewFromFile() is a wrapper around gdk_pixbuf_new_from_file(). +func PixbufNewFromFile(fileName string) (*Pixbuf, error) { + var cerr *C.GError + cstr := C.CString(fileName) + defer C.free(unsafe.Pointer(cstr)) + c := C.gdk_pixbuf_new_from_file(cstr, &cerr) + if c == nil { + defer C.g_error_free(cerr) + return nil, errors.New(C.GoString((*C.char)(C.error_get_message(cerr)))) + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := wrapPixbuf(obj) + obj.Ref() + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return p, nil +} + +// PixbufNewFromFileAtSize() is a wrapper around gdk_pixbuf_new_from_file_at_size(). +func PixbufNewFromFileAtSize(fileName string, width, height int) (*Pixbuf, error) { + var cerr *C.GError + cstr := C.CString(fileName) + defer C.free(unsafe.Pointer(cstr)) + c := C.gdk_pixbuf_new_from_file_at_size(cstr, C.int(width), C.int(height), &cerr) + if c == nil { + defer C.g_error_free(cerr) + return nil, errors.New(C.GoString((*C.char)(C.error_get_message(cerr)))) + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := wrapPixbuf(obj) + obj.RefSink() + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return p, nil +} + +// PixbufNewFromFileAtScale() is a wrapper around gdk_pixbuf_new_from_file_at_scale(). +func PixbufNewFromFileAtScale(fileName string, width, height int, preserveAspectRatio bool) (*Pixbuf, error) { + var cerr *C.GError + cstr := C.CString(fileName) + defer C.free(unsafe.Pointer(cstr)) + c := C.gdk_pixbuf_new_from_file_at_scale(cstr, C.int(width), C.int(height), gbool(preserveAspectRatio), &cerr) + if c == nil { + defer C.g_error_free(cerr) + return nil, errors.New(C.GoString((*C.char)(C.error_get_message(cerr)))) + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := wrapPixbuf(obj) + obj.RefSink() + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return p, nil +} + +// TODO gdk_pixbuf_get_file_info, resource and stream related functions. diff --git a/gdk/gdk.go.h b/gdk/gdk.go.h index 86ff549..eec56e2 100644 --- a/gdk/gdk.go.h +++ b/gdk/gdk.go.h @@ -54,3 +54,15 @@ toGdkWindow(void *p) { return (GDK_WINDOW(p)); } + +static GdkPixbuf * +toGdkPixbuf(void *p) +{ + return (GDK_PIXBUF(p)); +} + +static gchar * +error_get_message(GError *error) +{ + return error->message; +} diff --git a/gdkpixbuf/gdkpixbuf.go b/gdkpixbuf/gdkpixbuf.go new file mode 100644 index 0000000..c7525eb --- /dev/null +++ b/gdkpixbuf/gdkpixbuf.go @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2013 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* +Go bindings for GDK-PixBuf 3. Supports version 2.0 and later. +*/ +package gdkpixbuf + +// #cgo pkg-config: gdk-pixbuf-2.0 +// #include +// #include "gdkpixbuf.go.h" +import "C" +import ( + "errors" + "github.com/conformal/gotk3/gdk" + "github.com/conformal/gotk3/glib" + "runtime" + "unsafe" +) + +/* + * Unexported vars + */ + +var nilPtrErr = errors.New("cgo returned unexpected nil pointer") + +/* + * Type conversions + */ + +func gbool(b bool) C.gboolean { + if b { + return C.gboolean(1) + } + return C.gboolean(0) +} +func gobool(b C.gboolean) bool { + if b != 0 { + return true + } + return false +} + +/* + * GdkPixbufLoader + */ + +// PixbufLoader is a representation of GDK's GdkPixbufLoader. +type PixbufLoader struct { + *glib.Object +} + +// Native() returns a pointer to the underlying GdkWindow. +func (v *PixbufLoader) Native() *C.GdkPixbufLoader { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkPixbufLoader(p) +} + +// PixbufLoaderNew() is a wrapper around gdk_pixbuf_loader_new(). +func PixbufLoaderNew() (*PixbufLoader, error) { + c := C.gdk_pixbuf_loader_new() + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + l := &PixbufLoader{obj} + obj.Ref() + runtime.SetFinalizer(obj, (*glib.Object).Unref) + + return l, nil +} + +// Write() is a wrapper around gdk_pixbuf_loader_write(). +func (v *PixbufLoader) Write(data []byte) (n int, err error) { + // n is set to 0 on error, and set to len(data) otherwise. + // This is a tiny hacky to satisfy io.Writer and io.WriteCloser, + // which would allow access to all io and ioutil goodies, + // and play along nice with go environment. + + if len(data) == 0 { + return 0, nil + } + + var cerr *C.GError + ok := gobool(C.gdk_pixbuf_loader_write(v.Native(), (*C.guchar)(unsafe.Pointer(&data[0])), C.gsize(len(data)), &cerr)) + if !ok { + defer C.g_error_free(cerr) + return 0, errors.New(C.GoString((*C.char)(C.error_get_message(cerr)))) + } + + return len(data), nil +} + +// Close() is a wrapper around gdk_pixbuf_loader_close(). +func (v *PixbufLoader) Close() error { + var cerr *C.GError + + if ok := gobool(C.gdk_pixbuf_loader_close(v.Native(), &cerr)); !ok { + defer C.g_error_free(cerr) + return errors.New(C.GoString((*C.char)(C.error_get_message(cerr)))) + } + return nil +} + +// SetSize() is a wrapper around gdk_pixbuf_loader_set_size(). +func (v *PixbufLoader) SetSize(width, height int) { + C.gdk_pixbuf_loader_set_size(v.Native(), C.int(width), C.int(height)) +} + +// GetPixbuf() is a wrapper around gdk_pixbuf_loader_get_pixbuf(). +func (v *PixbufLoader) GetPixbuf() (*gdk.Pixbuf, error) { + c := C.gdk_pixbuf_loader_get_pixbuf(v.Native()) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &gdk.Pixbuf{obj} + obj.Ref() + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return p, nil +} + +// TODO GdkPixbufFormat, GdkPixbufAnimation, +// gdk_pixbuf_loader_new_with_type, gdk_pixbuf_loader_new_with_mime_type diff --git a/gdkpixbuf/gdkpixbuf.go.h b/gdkpixbuf/gdkpixbuf.go.h new file mode 100644 index 0000000..7b42335 --- /dev/null +++ b/gdkpixbuf/gdkpixbuf.go.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2013 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +// Type Casting +static GdkPixbufLoader * +toGdkPixbufLoader(void *p) +{ + return (GDK_PIXBUF_LOADER(p)); +} + +static gchar * +error_get_message(GError *error) +{ + return error->message; +} From 1973e79fef84dc8ecd7a87f6c989146a99a5d391 Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 12 Sep 2013 13:31:24 +0900 Subject: [PATCH 03/23] gdk.Pixbuf functions for Image --- gtk/gtk.go | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/gtk/gtk.go b/gtk/gtk.go index 01a8829..8044dc2 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -2441,11 +2441,18 @@ func ImageNewFromResource(resourcePath string) (*Image, error) { return i, nil } -// TODO(jrick) GdkPixbuf -/* -func ImageNewFromPixbuf() { +// ImageNewFromStock() is a wrapper around gtk_image_new_from_pixbuf(). +func ImageNewFromPixbuf(pixbuf *gdk.Pixbuf) (*Image, error) { + c := C.gtk_image_new_from_pixbuf(v.Native(), pixbuf) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + i := wrapImage(obj) + obj.RefSink() + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return i, nil } -*/ // ImageNewFromStock() is a wrapper around gtk_image_new_from_stock(). func ImageNewFromStock(stock Stock, size IconSize) (*Image, error) { @@ -2515,11 +2522,10 @@ func (v *Image) SetFromResource(resourcePath string) { C.gtk_image_set_from_resource(v.Native(), (*C.gchar)(cstr)) } -// TODO(jrick) GdkPixbuf -/* -func (v *Image) SetFromPixbuf() { +// SetFromResource() is a wrapper around gtk_image_set_from_pixbuf(). +func (v *Image) SetFromPixbuf(pixbuf *gdk.Pixbuf) { + C.gtk_image_set_from_pixbuf(v.Native(), pixbuf.Native()) } -*/ // SetFromStock() is a wrapper around gtk_image_set_from_stock(). func (v *Image) SetFromStock(stock Stock, size IconSize) { From 13c7bf8bfaa611be87115cf8f89258c4a0e205b5 Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 12 Sep 2013 13:43:41 +0900 Subject: [PATCH 04/23] fix build --- gdk/gdk.go | 1 - gtk/gtk.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/gdk/gdk.go b/gdk/gdk.go index f71c4cb..d075f4a 100644 --- a/gdk/gdk.go +++ b/gdk/gdk.go @@ -23,7 +23,6 @@ package gdk // #cgo pkg-config: gdk-3.0 // #include -// #include // #include "gdk.go.h" import "C" import ( diff --git a/gtk/gtk.go b/gtk/gtk.go index 8044dc2..ef3143a 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -2443,7 +2443,7 @@ func ImageNewFromResource(resourcePath string) (*Image, error) { // ImageNewFromStock() is a wrapper around gtk_image_new_from_pixbuf(). func ImageNewFromPixbuf(pixbuf *gdk.Pixbuf) (*Image, error) { - c := C.gtk_image_new_from_pixbuf(v.Native(), pixbuf) + c := C.gtk_image_new_from_pixbuf(pixbuf.Native()) if c == nil { return nil, nilPtrErr } From bbc2e1f83452a2ed82428670892033e4290db6e5 Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 12 Sep 2013 15:00:30 +0900 Subject: [PATCH 05/23] fix referencing in pixbuf and pixbuf loader, add (questionable) gdk.Rectangle implementation, gtk.Allocation and some related functions --- gdk/gdk.go | 19 ++++++++++++++++--- gdkpixbuf/gdkpixbuf.go | 1 - gtk/gtk.go | 24 ++++++++++++++++++++---- 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/gdk/gdk.go b/gdk/gdk.go index d075f4a..0ebf32c 100644 --- a/gdk/gdk.go +++ b/gdk/gdk.go @@ -486,7 +486,6 @@ func PixbufNewFromFile(fileName string) (*Pixbuf, error) { } obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} p := wrapPixbuf(obj) - obj.Ref() runtime.SetFinalizer(obj, (*glib.Object).Unref) return p, nil } @@ -503,7 +502,6 @@ func PixbufNewFromFileAtSize(fileName string, width, height int) (*Pixbuf, error } obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} p := wrapPixbuf(obj) - obj.RefSink() runtime.SetFinalizer(obj, (*glib.Object).Unref) return p, nil } @@ -520,9 +518,24 @@ func PixbufNewFromFileAtScale(fileName string, width, height int, preserveAspect } obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} p := wrapPixbuf(obj) - obj.RefSink() runtime.SetFinalizer(obj, (*glib.Object).Unref) return p, nil } // TODO gdk_pixbuf_get_file_info, resource and stream related functions. + +/* + * GdkRectangle + */ + +// Rectangle is a representation of GDK's GdkRectangle type. +type Rectangle struct { + // TODO Rectangle is a fairly simple struct, but maybe it's not a good practise + // to manually define it here? + X, Y int32 + Width, Height int32 +} + +func (r *Rectangle) Native() *C.GdkRectangle { + return (*C.GdkRectangle)(unsafe.Pointer(r)) +} diff --git a/gdkpixbuf/gdkpixbuf.go b/gdkpixbuf/gdkpixbuf.go index c7525eb..3f744bf 100644 --- a/gdkpixbuf/gdkpixbuf.go +++ b/gdkpixbuf/gdkpixbuf.go @@ -82,7 +82,6 @@ func PixbufLoaderNew() (*PixbufLoader, error) { } obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} l := &PixbufLoader{obj} - obj.Ref() runtime.SetFinalizer(obj, (*glib.Object).Unref) return l, nil diff --git a/gtk/gtk.go b/gtk/gtk.go index ef3143a..19b27b0 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -413,6 +413,13 @@ const ( WINDOW_POPUP = C.GTK_WINDOW_POPUP ) +// Allocation is a representation of GTK's GtkAllocation type. +type Allocation gdk.Rectangle + +func (r *Allocation) Native() *C.GtkAllocation { + return (*C.GtkAllocation)(unsafe.Pointer(r)) +} + /* * Init and main event loop */ @@ -4194,11 +4201,20 @@ func (v *Widget) Unmap() { // GDestroyNotify notify); //void gtk_widget_remove_tick_callback(GtkWidget *widget, guint id); -// TODO(jrick) GtkAllocation -/* -func (v *Widget) SizeAllocate() { +func (v *Widget) GetAllocation() *Allocation { + // TODO Should we avoid new here an expect a pointer as an argument? + allocation := new(Allocation) + C.gtk_widget_get_allocation(v.Native(), allocation.Native()) + return allocation +} + +func (v *Widget) SetAllocation(allocation *Allocation) { + C.gtk_widget_set_allocation(v.Native(), allocation.Native()) +} + +func (v *Widget) SizeAllocate(allocation *Allocation) { + C.gtk_widget_size_allocate(v.Native(), allocation.Native()) } -*/ // TODO(jrick) GtkAccelGroup GdkModifierType GtkAccelFlags /* From d99e318e37ddeb17e2b028c511ec8eb2a05efa8d Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 12 Sep 2013 15:29:47 +0900 Subject: [PATCH 06/23] pixbuf scale, rotation and flipping functions --- gdkpixbuf/gdkpixbuf.go | 64 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/gdkpixbuf/gdkpixbuf.go b/gdkpixbuf/gdkpixbuf.go index 3f744bf..ab4ac1a 100644 --- a/gdkpixbuf/gdkpixbuf.go +++ b/gdkpixbuf/gdkpixbuf.go @@ -39,6 +39,28 @@ import ( var nilPtrErr = errors.New("cgo returned unexpected nil pointer") +/* + * Constants + */ + +type InterpType C.GdkInterpType + +const ( + INTERP_NEAREST InterpType = iota + INTERP_TILES + INTERP_BILINEAR + INTERP_HYPER +) + +type PixbufRotation C.GdkPixbufRotation + +const ( + PIXBUF_ROTATE_NONE PixbufRotation = 0 + PIXBUF_ROTATE_COUNTERCLOCKWISE = 90 + PIXBUF_ROTATE_UPSIDEDOWN = 180 + PIXBUF_ROTATE_CLOCKWISE = 270 +) + /* * Type conversions */ @@ -61,6 +83,7 @@ func gobool(b C.gboolean) bool { */ // PixbufLoader is a representation of GDK's GdkPixbufLoader. +// Users of PixbufLoader are expected to call Close() when they are finished. type PixbufLoader struct { *glib.Object } @@ -139,3 +162,44 @@ func (v *PixbufLoader) GetPixbuf() (*gdk.Pixbuf, error) { // TODO GdkPixbufFormat, GdkPixbufAnimation, // gdk_pixbuf_loader_new_with_type, gdk_pixbuf_loader_new_with_mime_type + +// PixbufScaleSimple is a wrapper around gdk_pixbuf_scale_simple(). +func PixbufScaleSimple(src *gdk.Pixbuf, width, height int, interp InterpType) (*gdk.Pixbuf, error) { + c := C.gdk_pixbuf_scale_simple(src.Native(), C.int(width), C.int(height), C.GdkInterpType(interp)) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &gdk.Pixbuf{obj} + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return p, nil +} + +// PixbufScale is a wrapper around gdk_pixbuf_scale(). +func PixbufScale(src, dst *gdk.Pixbuf, x, y, width, height int, offsetX, offsetY, scaleX, scaleY float64, interp InterpType) { + C.gdk_pixbuf_scale(src.Native(), dst.Native(), C.int(x), C.int(y), C.int(width), C.int(height), C.double(offsetX), C.double(offsetY), C.double(scaleX), C.double(scaleY), C.GdkInterpType(interp)) +} + +// PixbufRotateSimple is a wrapper around gdk_pixbuf_rotate_simple(). +func PixbufRotateSimple(src *gdk.Pixbuf, angle PixbufRotation) (*gdk.Pixbuf, error) { + c := C.gdk_pixbuf_rotate_simple(src.Native(), C.GdkPixbufRotation(angle)) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &gdk.Pixbuf{obj} + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return p, nil +} + +// PixbufFlip is a wrapper around gdk_pixbuf_flip(). +func PixbufFlip(src *gdk.Pixbuf, horizontal bool) (*gdk.Pixbuf, error) { + c := C.gdk_pixbuf_flip(src.Native(), gbool(horizontal)) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &gdk.Pixbuf{obj} + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return p, nil +} From 49d1a12ac736813fc5654681b0cf01e1f6d7b7a4 Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 12 Sep 2013 16:13:07 +0900 Subject: [PATCH 07/23] move Pixbuf entriely to gdkpixbuf, add methods GetWidth and GetHeight --- gdk/gdk.go | 72 ----------------- gdk/gdk.go.h | 12 --- gdkpixbuf/gdkpixbuf.go | 169 +++++++++++++++++++++++++++++---------- gdkpixbuf/gdkpixbuf.go.h | 6 ++ gtk/gtk.go | 5 +- 5 files changed, 134 insertions(+), 130 deletions(-) diff --git a/gdk/gdk.go b/gdk/gdk.go index 0ebf32c..4a7f4d4 100644 --- a/gdk/gdk.go +++ b/gdk/gdk.go @@ -452,78 +452,6 @@ func (v *Window) Native() *C.GdkWindow { return C.toGdkWindow(p) } -/* - * GdkPixbuf - */ - -// Pixbuf is a representation of GDK's GdkPixbuf. -type Pixbuf struct { - *glib.Object -} - -func wrapPixbuf(obj *glib.Object) *Pixbuf { - return &Pixbuf{obj} -} - -// Native() returns a pointer to the underlying GdkWindow. -func (v *Pixbuf) Native() *C.GdkPixbuf { - if v == nil || v.GObject == nil { - return nil - } - p := unsafe.Pointer(v.GObject) - return C.toGdkPixbuf(p) -} - -// PixbufNewFromFile() is a wrapper around gdk_pixbuf_new_from_file(). -func PixbufNewFromFile(fileName string) (*Pixbuf, error) { - var cerr *C.GError - cstr := C.CString(fileName) - defer C.free(unsafe.Pointer(cstr)) - c := C.gdk_pixbuf_new_from_file(cstr, &cerr) - if c == nil { - defer C.g_error_free(cerr) - return nil, errors.New(C.GoString((*C.char)(C.error_get_message(cerr)))) - } - obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} - p := wrapPixbuf(obj) - runtime.SetFinalizer(obj, (*glib.Object).Unref) - return p, nil -} - -// PixbufNewFromFileAtSize() is a wrapper around gdk_pixbuf_new_from_file_at_size(). -func PixbufNewFromFileAtSize(fileName string, width, height int) (*Pixbuf, error) { - var cerr *C.GError - cstr := C.CString(fileName) - defer C.free(unsafe.Pointer(cstr)) - c := C.gdk_pixbuf_new_from_file_at_size(cstr, C.int(width), C.int(height), &cerr) - if c == nil { - defer C.g_error_free(cerr) - return nil, errors.New(C.GoString((*C.char)(C.error_get_message(cerr)))) - } - obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} - p := wrapPixbuf(obj) - runtime.SetFinalizer(obj, (*glib.Object).Unref) - return p, nil -} - -// PixbufNewFromFileAtScale() is a wrapper around gdk_pixbuf_new_from_file_at_scale(). -func PixbufNewFromFileAtScale(fileName string, width, height int, preserveAspectRatio bool) (*Pixbuf, error) { - var cerr *C.GError - cstr := C.CString(fileName) - defer C.free(unsafe.Pointer(cstr)) - c := C.gdk_pixbuf_new_from_file_at_scale(cstr, C.int(width), C.int(height), gbool(preserveAspectRatio), &cerr) - if c == nil { - defer C.g_error_free(cerr) - return nil, errors.New(C.GoString((*C.char)(C.error_get_message(cerr)))) - } - obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} - p := wrapPixbuf(obj) - runtime.SetFinalizer(obj, (*glib.Object).Unref) - return p, nil -} - -// TODO gdk_pixbuf_get_file_info, resource and stream related functions. - /* * GdkRectangle */ diff --git a/gdk/gdk.go.h b/gdk/gdk.go.h index eec56e2..86ff549 100644 --- a/gdk/gdk.go.h +++ b/gdk/gdk.go.h @@ -54,15 +54,3 @@ toGdkWindow(void *p) { return (GDK_WINDOW(p)); } - -static GdkPixbuf * -toGdkPixbuf(void *p) -{ - return (GDK_PIXBUF(p)); -} - -static gchar * -error_get_message(GError *error) -{ - return error->message; -} diff --git a/gdkpixbuf/gdkpixbuf.go b/gdkpixbuf/gdkpixbuf.go index ab4ac1a..1498d54 100644 --- a/gdkpixbuf/gdkpixbuf.go +++ b/gdkpixbuf/gdkpixbuf.go @@ -27,7 +27,6 @@ package gdkpixbuf import "C" import ( "errors" - "github.com/conformal/gotk3/gdk" "github.com/conformal/gotk3/glib" "runtime" "unsafe" @@ -78,6 +77,129 @@ func gobool(b C.gboolean) bool { return false } +/* + * GdkPixbuf + */ + +// Pixbuf is a representation of GDK's GdkPixbuf. +type Pixbuf struct { + *glib.Object +} + +func wrapPixbuf(obj *glib.Object) *Pixbuf { + return &Pixbuf{obj} +} + +// Native() returns a pointer to the underlying GdkWindow. +func (v *Pixbuf) Native() *C.GdkPixbuf { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkPixbuf(p) +} + +// PixbufNewFromFile() is a wrapper around gdk_pixbuf_new_from_file(). +func PixbufNewFromFile(fileName string) (*Pixbuf, error) { + var cerr *C.GError + cstr := C.CString(fileName) + defer C.free(unsafe.Pointer(cstr)) + c := C.gdk_pixbuf_new_from_file(cstr, &cerr) + if c == nil { + defer C.g_error_free(cerr) + return nil, errors.New(C.GoString((*C.char)(C.error_get_message(cerr)))) + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := wrapPixbuf(obj) + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return p, nil +} + +// PixbufNewFromFileAtSize() is a wrapper around gdk_pixbuf_new_from_file_at_size(). +func PixbufNewFromFileAtSize(fileName string, width, height int) (*Pixbuf, error) { + var cerr *C.GError + cstr := C.CString(fileName) + defer C.free(unsafe.Pointer(cstr)) + c := C.gdk_pixbuf_new_from_file_at_size(cstr, C.int(width), C.int(height), &cerr) + if c == nil { + defer C.g_error_free(cerr) + return nil, errors.New(C.GoString((*C.char)(C.error_get_message(cerr)))) + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := wrapPixbuf(obj) + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return p, nil +} + +// PixbufNewFromFileAtScale() is a wrapper around gdk_pixbuf_new_from_file_at_scale(). +func PixbufNewFromFileAtScale(fileName string, width, height int, preserveAspectRatio bool) (*Pixbuf, error) { + var cerr *C.GError + cstr := C.CString(fileName) + defer C.free(unsafe.Pointer(cstr)) + c := C.gdk_pixbuf_new_from_file_at_scale(cstr, C.int(width), C.int(height), gbool(preserveAspectRatio), &cerr) + if c == nil { + defer C.g_error_free(cerr) + return nil, errors.New(C.GoString((*C.char)(C.error_get_message(cerr)))) + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := wrapPixbuf(obj) + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return p, nil +} + +// ScaleSimple is a wrapper around gdk_pixbuf_scale_simple(). +func (v *Pixbuf) ScaleSimple(width, height int, interp InterpType) (*Pixbuf, error) { + c := C.gdk_pixbuf_scale_simple(v.Native(), C.int(width), C.int(height), C.GdkInterpType(interp)) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return p, nil +} + +// Scale is a wrapper around gdk_pixbuf_scale(). +func (v *Pixbuf) Scale(dst *Pixbuf, x, y, width, height int, offsetX, offsetY, scaleX, scaleY float64, interp InterpType) { + C.gdk_pixbuf_scale(v.Native(), dst.Native(), C.int(x), C.int(y), C.int(width), C.int(height), C.double(offsetX), C.double(offsetY), C.double(scaleX), C.double(scaleY), C.GdkInterpType(interp)) +} + +// RotateSimple is a wrapper around gdk_pixbuf_rotate_simple(). +func (v *Pixbuf) RotateSimple(angle PixbufRotation) (*Pixbuf, error) { + c := C.gdk_pixbuf_rotate_simple(v.Native(), C.GdkPixbufRotation(angle)) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return p, nil +} + +// Flip is a wrapper around gdk_pixbuf_flip(). +func (v *Pixbuf) Flip(horizontal bool) (*Pixbuf, error) { + c := C.gdk_pixbuf_flip(v.Native(), gbool(horizontal)) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return p, nil +} + +// GetWidth is a wrapper around gdk_pixbuf_get_width(). +func (v *Pixbuf) GetWidth() int { + return int(C.gdk_pixbuf_get_width(v.Native())) +} + +// GetHeight is a wrapper around gdk_pixbuf_get_height(). +func (v *Pixbuf) GetHeight() int { + return int(C.gdk_pixbuf_get_height(v.Native())) +} + +// TODO gdk_pixbuf_get_file_info, resource and stream related functions. + /* * GdkPixbufLoader */ @@ -148,13 +270,13 @@ func (v *PixbufLoader) SetSize(width, height int) { } // GetPixbuf() is a wrapper around gdk_pixbuf_loader_get_pixbuf(). -func (v *PixbufLoader) GetPixbuf() (*gdk.Pixbuf, error) { +func (v *PixbufLoader) GetPixbuf() (*Pixbuf, error) { c := C.gdk_pixbuf_loader_get_pixbuf(v.Native()) if c == nil { return nil, nilPtrErr } obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} - p := &gdk.Pixbuf{obj} + p := &Pixbuf{obj} obj.Ref() runtime.SetFinalizer(obj, (*glib.Object).Unref) return p, nil @@ -162,44 +284,3 @@ func (v *PixbufLoader) GetPixbuf() (*gdk.Pixbuf, error) { // TODO GdkPixbufFormat, GdkPixbufAnimation, // gdk_pixbuf_loader_new_with_type, gdk_pixbuf_loader_new_with_mime_type - -// PixbufScaleSimple is a wrapper around gdk_pixbuf_scale_simple(). -func PixbufScaleSimple(src *gdk.Pixbuf, width, height int, interp InterpType) (*gdk.Pixbuf, error) { - c := C.gdk_pixbuf_scale_simple(src.Native(), C.int(width), C.int(height), C.GdkInterpType(interp)) - if c == nil { - return nil, nilPtrErr - } - obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} - p := &gdk.Pixbuf{obj} - runtime.SetFinalizer(obj, (*glib.Object).Unref) - return p, nil -} - -// PixbufScale is a wrapper around gdk_pixbuf_scale(). -func PixbufScale(src, dst *gdk.Pixbuf, x, y, width, height int, offsetX, offsetY, scaleX, scaleY float64, interp InterpType) { - C.gdk_pixbuf_scale(src.Native(), dst.Native(), C.int(x), C.int(y), C.int(width), C.int(height), C.double(offsetX), C.double(offsetY), C.double(scaleX), C.double(scaleY), C.GdkInterpType(interp)) -} - -// PixbufRotateSimple is a wrapper around gdk_pixbuf_rotate_simple(). -func PixbufRotateSimple(src *gdk.Pixbuf, angle PixbufRotation) (*gdk.Pixbuf, error) { - c := C.gdk_pixbuf_rotate_simple(src.Native(), C.GdkPixbufRotation(angle)) - if c == nil { - return nil, nilPtrErr - } - obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} - p := &gdk.Pixbuf{obj} - runtime.SetFinalizer(obj, (*glib.Object).Unref) - return p, nil -} - -// PixbufFlip is a wrapper around gdk_pixbuf_flip(). -func PixbufFlip(src *gdk.Pixbuf, horizontal bool) (*gdk.Pixbuf, error) { - c := C.gdk_pixbuf_flip(src.Native(), gbool(horizontal)) - if c == nil { - return nil, nilPtrErr - } - obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} - p := &gdk.Pixbuf{obj} - runtime.SetFinalizer(obj, (*glib.Object).Unref) - return p, nil -} diff --git a/gdkpixbuf/gdkpixbuf.go.h b/gdkpixbuf/gdkpixbuf.go.h index 7b42335..6260ed5 100644 --- a/gdkpixbuf/gdkpixbuf.go.h +++ b/gdkpixbuf/gdkpixbuf.go.h @@ -19,6 +19,12 @@ #include // Type Casting +static GdkPixbuf * +toGdkPixbuf(void *p) +{ + return (GDK_PIXBUF(p)); +} + static GdkPixbufLoader * toGdkPixbufLoader(void *p) { diff --git a/gtk/gtk.go b/gtk/gtk.go index 19b27b0..fe22959 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -56,6 +56,7 @@ import ( "errors" "fmt" "github.com/conformal/gotk3/gdk" + "github.com/conformal/gotk3/gdkpixbuf" "github.com/conformal/gotk3/glib" "runtime" "unsafe" @@ -2449,7 +2450,7 @@ func ImageNewFromResource(resourcePath string) (*Image, error) { } // ImageNewFromStock() is a wrapper around gtk_image_new_from_pixbuf(). -func ImageNewFromPixbuf(pixbuf *gdk.Pixbuf) (*Image, error) { +func ImageNewFromPixbuf(pixbuf *gdkpixbuf.Pixbuf) (*Image, error) { c := C.gtk_image_new_from_pixbuf(pixbuf.Native()) if c == nil { return nil, nilPtrErr @@ -2530,7 +2531,7 @@ func (v *Image) SetFromResource(resourcePath string) { } // SetFromResource() is a wrapper around gtk_image_set_from_pixbuf(). -func (v *Image) SetFromPixbuf(pixbuf *gdk.Pixbuf) { +func (v *Image) SetFromPixbuf(pixbuf *gdkpixbuf.Pixbuf) { C.gtk_image_set_from_pixbuf(v.Native(), pixbuf.Native()) } From b9d6dc948a94599a23607a23cee40df55423de67 Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 12 Sep 2013 16:47:21 +0900 Subject: [PATCH 08/23] add Image.SetFromPixbuf, fix Layout and Viewport structs, fix doc --- gtk/gtk.go | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/gtk/gtk.go b/gtk/gtk.go index fe22959..e4bc65d 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -1020,7 +1020,7 @@ func LayoutNew(hadjustment, vadjustment *Adjustment) (*Layout, error) { // Layout is a representation of GTK's GtkLayout GInterface. type Layout struct { - *glib.Object + Bin } // ILayout is an interface type implemented by all structs @@ -1041,7 +1041,7 @@ func (v *Layout) Native() *C.GtkLayout { } func wrapLayout(obj *glib.Object) *Layout { - return &Layout{obj} + return &Layout{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} } func (v *Layout) toLayout() *C.GtkLayout { @@ -1120,7 +1120,7 @@ func ViewportNew(hadjustment, vadjustment *Adjustment) (*Viewport, error) { // Viewport is a representation of GTK's GtkViewport GInterface. type Viewport struct { - *glib.Object + Bin } // IViewport is an interface type implemented by all structs @@ -1141,7 +1141,7 @@ func (v *Viewport) Native() *C.GtkViewport { } func wrapViewport(obj *glib.Object) *Viewport { - return &Viewport{obj} + return &Viewport{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} } func (v *Viewport) toViewport() *C.GtkViewport { @@ -2530,11 +2530,24 @@ func (v *Image) SetFromResource(resourcePath string) { C.gtk_image_set_from_resource(v.Native(), (*C.gchar)(cstr)) } -// SetFromResource() is a wrapper around gtk_image_set_from_pixbuf(). +// SetFromPixbuf() is a wrapper around gtk_image_set_from_pixbuf(). func (v *Image) SetFromPixbuf(pixbuf *gdkpixbuf.Pixbuf) { C.gtk_image_set_from_pixbuf(v.Native(), pixbuf.Native()) } +// GetPixbuf() is a wrapper around gtk_image_get_pixbuf(). +func (v *Image) GetPixbuf() (*gdkpixbuf.Pixbuf, error) { + c := C.gtk_image_get_pixbuf(v.Native()) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &gdkpixbuf.Pixbuf{obj} + obj.Ref() + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return p, nil +} + // SetFromStock() is a wrapper around gtk_image_set_from_stock(). func (v *Image) SetFromStock(stock Stock, size IconSize) { cstr := C.CString(string(stock)) From d038d0e8a4eeceb7c4c24dad35fca8d51e1c7962 Mon Sep 17 00:00:00 2001 From: raichu Date: Sun, 15 Sep 2013 13:57:15 +0900 Subject: [PATCH 09/23] added ImageMenuItem, AboutDialog, FileChooserDialog --- gtk/gtk.go | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++ gtk/gtk.go.h | 28 +++++++++++ 2 files changed, 167 insertions(+) diff --git a/gtk/gtk.go b/gtk/gtk.go index e4bc65d..cab9702 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -406,6 +406,16 @@ const ( WIN_POS_CENTER_ON_PARENT = C.GTK_WIN_POS_CENTER_ON_PARENT ) +// FileChooserAction is a representation of GTK's GtkFileChooserAction. +type FileChooserAction int + +const ( + FILE_CHOOSER_ACTION_OPEN FileChooserAction = C.GTK_FILE_CHOOSER_ACTION_OPEN + FILE_CHOOSER_ACTION_SAVE = C.GTK_FILE_CHOOSER_ACTION_SAVE + FILE_CHOOSER_ACTION_SELECT_FOLDER = C.GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER + FILE_CHOOSER_ACTION_CREATE_FOLDER = C.GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER +) + // WindowType is a representation of GTK's GtkWindowType. type WindowType int @@ -3032,6 +3042,30 @@ func (v *MenuItem) SetSubmenu(submenu IWidget) { C.gtk_menu_item_set_submenu(v.Native(), submenu.toWidget()) } +/* + * GtkImageMenuItem + */ + +// ImageMenuItem is a representation of GTK's GtkImageMenuItem. +type ImageMenuItem struct { + MenuItem +} + +// Native() returns a pointer to the underlying GtkImageMenuItem. +func (v *ImageMenuItem) Native() *C.GtkImageMenuItem { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkImageMenuItem(p) +} + +func wrapImageMenuItem(obj *glib.Object) *ImageMenuItem { + return &ImageMenuItem{MenuItem{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}} +} + +// TODO: ImageMenuItem functions. + /* * GtkMenuShell */ @@ -3102,6 +3136,105 @@ func MessageDialogNew(parent IWindow, flags DialogFlags, mType MessageType, butt return m } +/* + * GtkAboutDialog + */ + +// AboutDialog is a representation of GTK's GtkAboutDialog. +type AboutDialog struct { + Dialog +} + +// Native() returns a pointer to the underlying GtkAboutDialog. +func (v *AboutDialog) Native() *C.GtkAboutDialog { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkAboutDialog(p) +} + +func wrapAboutDialog(obj *glib.Object) *AboutDialog { + return &AboutDialog{Dialog{Window{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}}} +} + +/* + * GtkFileChooserDialog + */ + +// FileChooserDialog is a representation of GTK's GtkFileChooserDialog. +type FileChooserDialog struct { + Dialog +} + +// Native() returns a pointer to the underlying GtkFileChooserDialog. +func (v *FileChooserDialog) Native() *C.GtkFileChooserDialog { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkFileChooserDialog(p) +} + +func wrapFileChooserDialog(obj *glib.Object) *FileChooserDialog { + return &FileChooserDialog{Dialog{Window{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}}} +} + +// Borrowed from github.com/mattn/go-gtk +func variadicButtonsToArrays(buttons []interface{}) ([]string, []ResponseType) { + if len(buttons)%2 != 0 { + panic("variadic parameter must be even (couples of string-ResponseType (button label - button response)") + } + text := make([]string, len(buttons)/2) + res := make([]ResponseType, len(buttons)/2) + for i := 0; i < len(text); i++ { + btext, ok := buttons[2*i].(string) + if !ok { + panic("button text must be a string") + } + bresponse, ok := buttons[2*i+1].(ResponseType) + if !ok { + panic("button response must be an ResponseType") + } + text[i] = btext + res[i] = bresponse + } + return text, res +} + +// FileChooserDialogNew() is a wrapper around gtk_file_chooser_dialog_new(). +// Variable argument should be (button string, id ResponseType) pairs if not omitted, +// or just the label for the first button. +func FileChooserDialogNew(title string, parent IWindow, fileChooserAction FileChooserAction, b ...interface{}) *FileChooserDialog { + ctitle := C.CString(title) + defer C.free(unsafe.Pointer(ctitle)) + var w *C.GtkWindow = nil + if parent != nil { + w = parent.toWindow() + } + var cfirstButton *C.char + if len(b) == 1 { + cfirstButton = C.CString(b[0].(string)) + defer C.free(unsafe.Pointer(ctitle)) + } + c := C._gtk_file_chooser_dialog_new(ctitle, w, C.GtkFileChooserAction(fileChooserAction), cfirstButton) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + m := wrapFileChooserDialog(obj) + obj.RefSink() + runtime.SetFinalizer(obj, (*glib.Object).Unref) + + if len(b) == 1 { + return m + } + + text, response := variadicButtonsToArrays(b) + for i := range text { + m.AddButton(text[i], response[i]) + } + + return m +} + /* * GtkMisc */ @@ -4652,10 +4785,16 @@ func cast(c *C.GObject) (glib.IObject, error) { g = wrapMenuBar(obj) case "GtkMenuItem": g = wrapMenuItem(obj) + case "GtkImageMenuItem": + g = wrapImageMenuItem(obj) case "GtkMenuShell": g = wrapMenuShell(obj) case "GtkMessageDialog": g = wrapMessageDialog(obj) + case "GtkAboutDialog": + g = wrapAboutDialog(obj) + case "GtkFileChooserDialog": + g = wrapFileChooserDialog(obj) case "GtkMisc": g = wrapMisc(obj) case "GtkNotebook": diff --git a/gtk/gtk.go.h b/gtk/gtk.go.h index 0f0e4e4..209fa6f 100644 --- a/gtk/gtk.go.h +++ b/gtk/gtk.go.h @@ -134,6 +134,12 @@ toGtkMenuItem(void *p) return (GTK_MENU_ITEM(p)); } +static GtkImageMenuItem * +toGtkImageMenuItem(void *p) +{ + return (GTK_IMAGE_MENU_ITEM(p)); +} + static GtkMenu * toGtkMenu(void *p) { @@ -254,6 +260,18 @@ toGtkMessageDialog(void *p) return (GTK_MESSAGE_DIALOG(p)); } +static GtkAboutDialog * +toGtkAboutDialog(void *p) +{ + return (GTK_ABOUT_DIALOG(p)); +} + +static GtkFileChooserDialog * +toGtkFileChooserDialog(void *p) +{ + return (GTK_FILE_CHOOSER_DIALOG(p)); +} + static GtkBuilder * toGtkBuilder(void *p) { @@ -303,3 +321,13 @@ object_get_class_name(GObject *object) { return G_OBJECT_CLASS_NAME(G_OBJECT_GET_CLASS(object)); } + +static GtkWidget* +_gtk_file_chooser_dialog_new(const char* title, + GtkWindow* parent, GtkFileChooserAction file_chooser_action, const char *firstButton) { + return gtk_file_chooser_dialog_new( + title, + parent, + file_chooser_action, + firstButton, NULL); +} From 236d427f75041aa0a23fd18f6a8710d3a9c51846 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Tue, 17 Sep 2013 13:30:12 -0400 Subject: [PATCH 10/23] fixups --- gdk/gdk.go | 8 +- gdkpixbuf/gdkpixbuf.go | 78 +++++++++------ gtk/gtk.go | 211 +++++++++++++++++++---------------------- gtk/gtk.go.h | 23 +++-- 4 files changed, 164 insertions(+), 156 deletions(-) diff --git a/gdk/gdk.go b/gdk/gdk.go index 4a7f4d4..d09110d 100644 --- a/gdk/gdk.go +++ b/gdk/gdk.go @@ -458,12 +458,10 @@ func (v *Window) Native() *C.GdkWindow { // Rectangle is a representation of GDK's GdkRectangle type. type Rectangle struct { - // TODO Rectangle is a fairly simple struct, but maybe it's not a good practise - // to manually define it here? - X, Y int32 - Width, Height int32 + GdkRectangle C.GdkRectangle } +// Native() returns a pointer to the underlying GdkRectangle. func (r *Rectangle) Native() *C.GdkRectangle { - return (*C.GdkRectangle)(unsafe.Pointer(r)) + return &r.GdkRectangle } diff --git a/gdkpixbuf/gdkpixbuf.go b/gdkpixbuf/gdkpixbuf.go index 1498d54..cbf1ad5 100644 --- a/gdkpixbuf/gdkpixbuf.go +++ b/gdkpixbuf/gdkpixbuf.go @@ -55,9 +55,9 @@ type PixbufRotation C.GdkPixbufRotation const ( PIXBUF_ROTATE_NONE PixbufRotation = 0 - PIXBUF_ROTATE_COUNTERCLOCKWISE = 90 - PIXBUF_ROTATE_UPSIDEDOWN = 180 - PIXBUF_ROTATE_CLOCKWISE = 270 + PIXBUF_ROTATE_COUNTERCLOCKWISE PixbufRotation = 90 + PIXBUF_ROTATE_UPSIDEDOWN PixbufRotation = 180 + PIXBUF_ROTATE_CLOCKWISE PixbufRotation = 270 ) /* @@ -90,7 +90,7 @@ func wrapPixbuf(obj *glib.Object) *Pixbuf { return &Pixbuf{obj} } -// Native() returns a pointer to the underlying GdkWindow. +// Native() returns a pointer to the underlying GdkPixbuf. func (v *Pixbuf) Native() *C.GdkPixbuf { if v == nil || v.GObject == nil { return nil @@ -107,7 +107,8 @@ func PixbufNewFromFile(fileName string) (*Pixbuf, error) { c := C.gdk_pixbuf_new_from_file(cstr, &cerr) if c == nil { defer C.g_error_free(cerr) - return nil, errors.New(C.GoString((*C.char)(C.error_get_message(cerr)))) + errstr := C.GoString((*C.char)(C.error_get_message(cerr))) + return nil, errors.New(errstr) } obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} p := wrapPixbuf(obj) @@ -115,15 +116,18 @@ func PixbufNewFromFile(fileName string) (*Pixbuf, error) { return p, nil } -// PixbufNewFromFileAtSize() is a wrapper around gdk_pixbuf_new_from_file_at_size(). +// PixbufNewFromFileAtSize() is a wrapper around +// gdk_pixbuf_new_from_file_at_size(). func PixbufNewFromFileAtSize(fileName string, width, height int) (*Pixbuf, error) { var cerr *C.GError cstr := C.CString(fileName) defer C.free(unsafe.Pointer(cstr)) - c := C.gdk_pixbuf_new_from_file_at_size(cstr, C.int(width), C.int(height), &cerr) + c := C.gdk_pixbuf_new_from_file_at_size(cstr, C.int(width), + C.int(height), &cerr) if c == nil { defer C.g_error_free(cerr) - return nil, errors.New(C.GoString((*C.char)(C.error_get_message(cerr)))) + errstr := C.GoString((*C.char)(C.error_get_message(cerr))) + return nil, errors.New(errstr) } obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} p := wrapPixbuf(obj) @@ -131,15 +135,18 @@ func PixbufNewFromFileAtSize(fileName string, width, height int) (*Pixbuf, error return p, nil } -// PixbufNewFromFileAtScale() is a wrapper around gdk_pixbuf_new_from_file_at_scale(). +// PixbufNewFromFileAtScale() is a wrapper around +// gdk_pixbuf_new_from_file_at_scale(). func PixbufNewFromFileAtScale(fileName string, width, height int, preserveAspectRatio bool) (*Pixbuf, error) { var cerr *C.GError cstr := C.CString(fileName) defer C.free(unsafe.Pointer(cstr)) - c := C.gdk_pixbuf_new_from_file_at_scale(cstr, C.int(width), C.int(height), gbool(preserveAspectRatio), &cerr) + c := C.gdk_pixbuf_new_from_file_at_scale(cstr, C.int(width), + C.int(height), gbool(preserveAspectRatio), &cerr) if c == nil { defer C.g_error_free(cerr) - return nil, errors.New(C.GoString((*C.char)(C.error_get_message(cerr)))) + errstr := C.GoString((*C.char)(C.error_get_message(cerr))) + return nil, errors.New(errstr) } obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} p := wrapPixbuf(obj) @@ -149,19 +156,23 @@ func PixbufNewFromFileAtScale(fileName string, width, height int, preserveAspect // ScaleSimple is a wrapper around gdk_pixbuf_scale_simple(). func (v *Pixbuf) ScaleSimple(width, height int, interp InterpType) (*Pixbuf, error) { - c := C.gdk_pixbuf_scale_simple(v.Native(), C.int(width), C.int(height), C.GdkInterpType(interp)) + c := C.gdk_pixbuf_scale_simple(v.Native(), C.int(width), C.int(height), + C.GdkInterpType(interp)) if c == nil { return nil, nilPtrErr } obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} - p := &Pixbuf{obj} + p := wrapPixbuf(obj) runtime.SetFinalizer(obj, (*glib.Object).Unref) return p, nil } // Scale is a wrapper around gdk_pixbuf_scale(). func (v *Pixbuf) Scale(dst *Pixbuf, x, y, width, height int, offsetX, offsetY, scaleX, scaleY float64, interp InterpType) { - C.gdk_pixbuf_scale(v.Native(), dst.Native(), C.int(x), C.int(y), C.int(width), C.int(height), C.double(offsetX), C.double(offsetY), C.double(scaleX), C.double(scaleY), C.GdkInterpType(interp)) + C.gdk_pixbuf_scale(v.Native(), dst.Native(), C.int(x), C.int(y), + C.int(width), C.int(height), C.double(offsetX), + C.double(offsetY), C.double(scaleX), C.double(scaleY), + C.GdkInterpType(interp)) } // RotateSimple is a wrapper around gdk_pixbuf_rotate_simple(). @@ -171,7 +182,7 @@ func (v *Pixbuf) RotateSimple(angle PixbufRotation) (*Pixbuf, error) { return nil, nilPtrErr } obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} - p := &Pixbuf{obj} + p := wrapPixbuf(obj) runtime.SetFinalizer(obj, (*glib.Object).Unref) return p, nil } @@ -183,7 +194,7 @@ func (v *Pixbuf) Flip(horizontal bool) (*Pixbuf, error) { return nil, nilPtrErr } obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} - p := &Pixbuf{obj} + p := wrapPixbuf(obj) runtime.SetFinalizer(obj, (*glib.Object).Unref) return p, nil } @@ -210,7 +221,7 @@ type PixbufLoader struct { *glib.Object } -// Native() returns a pointer to the underlying GdkWindow. +// Native() returns a pointer to the underlying GdkPixbufLoader. func (v *PixbufLoader) Native() *C.GdkPixbufLoader { if v == nil || v.GObject == nil { return nil @@ -219,6 +230,10 @@ func (v *PixbufLoader) Native() *C.GdkPixbufLoader { return C.toGdkPixbufLoader(p) } +func wrapPixbufLoader(obj *glib.Object) *PixbufLoader { + return &PixbufLoader{obj} +} + // PixbufLoaderNew() is a wrapper around gdk_pixbuf_loader_new(). func PixbufLoaderNew() (*PixbufLoader, error) { c := C.gdk_pixbuf_loader_new() @@ -226,13 +241,14 @@ func PixbufLoaderNew() (*PixbufLoader, error) { return nil, nilPtrErr } obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} - l := &PixbufLoader{obj} + l := wrapPixbufLoader(obj) runtime.SetFinalizer(obj, (*glib.Object).Unref) - return l, nil } -// Write() is a wrapper around gdk_pixbuf_loader_write(). +// Write() is a wrapper around gdk_pixbuf_loader_write(). The +// function signature differs from the C equivalent to satisify the +// io.Writer interface. func (v *PixbufLoader) Write(data []byte) (n int, err error) { // n is set to 0 on error, and set to len(data) otherwise. // This is a tiny hacky to satisfy io.Writer and io.WriteCloser, @@ -244,39 +260,45 @@ func (v *PixbufLoader) Write(data []byte) (n int, err error) { } var cerr *C.GError - ok := gobool(C.gdk_pixbuf_loader_write(v.Native(), (*C.guchar)(unsafe.Pointer(&data[0])), C.gsize(len(data)), &cerr)) - if !ok { + c := C.gdk_pixbuf_loader_write(v.Native(), + (*C.guchar)(unsafe.Pointer(&data[0])), C.gsize(len(data)), + &cerr) + if !gobool(c) { defer C.g_error_free(cerr) - return 0, errors.New(C.GoString((*C.char)(C.error_get_message(cerr)))) + errstr := C.GoString((*C.char)(C.error_get_message(cerr))) + return 0, errors.New(errstr) } return len(data), nil } -// Close() is a wrapper around gdk_pixbuf_loader_close(). +// Close is a wrapper around gdk_pixbuf_loader_close(). An error is +// returned instead of a bool like the native C function to support the +// io.Closer interface. func (v *PixbufLoader) Close() error { var cerr *C.GError if ok := gobool(C.gdk_pixbuf_loader_close(v.Native(), &cerr)); !ok { defer C.g_error_free(cerr) - return errors.New(C.GoString((*C.char)(C.error_get_message(cerr)))) + errstr := C.GoString((*C.char)(C.error_get_message(cerr))) + return errors.New(errstr) } return nil } -// SetSize() is a wrapper around gdk_pixbuf_loader_set_size(). +// SetSize is a wrapper around gdk_pixbuf_loader_set_size(). func (v *PixbufLoader) SetSize(width, height int) { C.gdk_pixbuf_loader_set_size(v.Native(), C.int(width), C.int(height)) } -// GetPixbuf() is a wrapper around gdk_pixbuf_loader_get_pixbuf(). +// GetPixbuf is a wrapper around gdk_pixbuf_loader_get_pixbuf(). func (v *PixbufLoader) GetPixbuf() (*Pixbuf, error) { c := C.gdk_pixbuf_loader_get_pixbuf(v.Native()) if c == nil { return nil, nilPtrErr } obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} - p := &Pixbuf{obj} + p := wrapPixbuf(obj) obj.Ref() runtime.SetFinalizer(obj, (*glib.Object).Unref) return p, nil diff --git a/gtk/gtk.go b/gtk/gtk.go index cab9702..43f9cc0 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -411,9 +411,9 @@ type FileChooserAction int const ( FILE_CHOOSER_ACTION_OPEN FileChooserAction = C.GTK_FILE_CHOOSER_ACTION_OPEN - FILE_CHOOSER_ACTION_SAVE = C.GTK_FILE_CHOOSER_ACTION_SAVE - FILE_CHOOSER_ACTION_SELECT_FOLDER = C.GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER - FILE_CHOOSER_ACTION_CREATE_FOLDER = C.GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER + FILE_CHOOSER_ACTION_SAVE FileChooserAction = C.GTK_FILE_CHOOSER_ACTION_SAVE + FILE_CHOOSER_ACTION_SELECT_FOLDER FileChooserAction = C.GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER + FILE_CHOOSER_ACTION_CREATE_FOLDER FileChooserAction = C.GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER ) // WindowType is a representation of GTK's GtkWindowType. @@ -427,8 +427,9 @@ const ( // Allocation is a representation of GTK's GtkAllocation type. type Allocation gdk.Rectangle -func (r *Allocation) Native() *C.GtkAllocation { - return (*C.GtkAllocation)(unsafe.Pointer(r)) +// Native returns a pointer to the underlying GtkAllocation. +func (v *Allocation) Native() *C.GtkAllocation { + return (*C.GtkAllocation)(unsafe.Pointer(&v.GdkRectangle)) } /* @@ -973,37 +974,37 @@ func (v *Scrollable) toScrollable() *C.GtkScrollable { return v.Native() } -// SetHAdjustment() is a wrapper around gtk_scrollable_set_hadjustment(). +// SetHAdjustment is a wrapper around gtk_scrollable_set_hadjustment(). func (v *Scrollable) SetHAdjustment(adjustment *Adjustment) { C.gtk_scrollable_set_hadjustment(v.Native(), adjustment.Native()) } -// GetHAdjustment() is a wrapper around gtk_scrollable_get_hadjustment(). +// GetHAdjustment is a wrapper around gtk_scrollable_get_hadjustment(). func (v *Scrollable) GetHAdjustment() (*Adjustment, error) { c := C.gtk_scrollable_get_hadjustment(v.Native()) if c == nil { return nil, nilPtrErr } obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} - a := &Adjustment{glib.InitiallyUnowned{obj}} + a := wrapAdjustment(obj) obj.RefSink() runtime.SetFinalizer(obj, (*glib.Object).Unref) return a, nil } -// SetVAdjustment() is a wrapper around gtk_scrollable_set_vadjustment(). +// SetVAdjustment is a wrapper around gtk_scrollable_set_vadjustment(). func (v *Scrollable) SetVAdjustment(adjustment *Adjustment) { C.gtk_scrollable_set_vadjustment(v.Native(), adjustment.Native()) } -// GetVAdjustment() is a wrapper around gtk_scrollable_get_vadjustment(). +// GetVAdjustment is a wrapper around gtk_scrollable_get_vadjustment(). func (v *Scrollable) GetVAdjustment() (*Adjustment, error) { c := C.gtk_scrollable_get_vadjustment(v.Native()) if c == nil { return nil, nilPtrErr } obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} - a := &Adjustment{glib.InitiallyUnowned{obj}} + a := wrapAdjustment(obj) obj.RefSink() runtime.SetFinalizer(obj, (*glib.Object).Unref) return a, nil @@ -1015,22 +1016,12 @@ func (v *Scrollable) GetVAdjustment() (*Adjustment, error) { * GtkLayout */ -// LayoutNew() is a wrapper around gtk_layout_new(). -func LayoutNew(hadjustment, vadjustment *Adjustment) (*Layout, error) { - c := C.gtk_layout_new(hadjustment.Native(), vadjustment.Native()) - if c == nil { - return nil, nilPtrErr - } - obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} - b := wrapLayout(obj) - obj.RefSink() - runtime.SetFinalizer(obj, (*glib.Object).Unref) - return b, nil -} - // Layout is a representation of GTK's GtkLayout GInterface. type Layout struct { - Bin + Container + + // Interfaces + Scrollable } // ILayout is an interface type implemented by all structs @@ -1051,7 +1042,12 @@ func (v *Layout) Native() *C.GtkLayout { } func wrapLayout(obj *glib.Object) *Layout { - return &Layout{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} + c := wrapContainer(obj) + s := wrapScrollable(obj) + return &Layout{ + Container: *c, + Scrollable: *s, + } } func (v *Layout) toLayout() *C.GtkLayout { @@ -1061,76 +1057,55 @@ func (v *Layout) toLayout() *C.GtkLayout { return v.Native() } -func (v *Layout) toScrollable() *C.GtkScrollable { - if v == nil || v.GObject == nil { - return nil +// LayoutNew() is a wrapper around gtk_layout_new(). +func LayoutNew(hadjustment, vadjustment *Adjustment) (*Layout, error) { + c := C.gtk_layout_new(hadjustment.Native(), vadjustment.Native()) + if c == nil { + return nil, nilPtrErr } - p := unsafe.Pointer(v.GObject) - return C.toGtkScrollable(p) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + b := wrapLayout(obj) + obj.RefSink() + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return b, nil } -// Put() is a wrapper around gtk_layout_put(). +// Put is a wrapper around gtk_layout_put(). func (v *Layout) Put(child IWidget, x, y int) { C.gtk_layout_put(v.Native(), child.toWidget(), C.gint(x), C.gint(y)) } -// Move() is a wrapper around gtk_layout_put(). +// Move is a wrapper around gtk_layout_put(). func (v *Layout) Move(child IWidget, x, y int) { C.gtk_layout_move(v.Native(), child.toWidget(), C.gint(x), C.gint(y)) } -// GetSize() is a wrapper around gtk_layout_get_size(). +// GetSize is a wrapper around gtk_layout_get_size(). func (v *Layout) GetSize() (width, height uint) { var w, h C.guint C.gtk_layout_get_size(v.Native(), &w, &h) return uint(w), uint(h) } -// SetSize() is a wrapper around gtk_layout_set_size(). +// SetSize is a wrapper around gtk_layout_set_size(). func (v *Layout) SetSize(width, height uint) { C.gtk_layout_set_size(v.Native(), C.guint(width), C.guint(height)) } -func (v *Layout) SetHAdjustment(adjustment *Adjustment) { - wrapScrollable(v.Object).SetHAdjustment(adjustment) -} - -func (v *Layout) GetHAdjustment() (*Adjustment, error) { - return wrapScrollable(v.Object).GetHAdjustment() -} - -func (v *Layout) SetVAdjustment(adjustment *Adjustment) { - wrapScrollable(v.Object).SetVAdjustment(adjustment) -} - -func (v *Layout) GetVAdjustment() (*Adjustment, error) { - return wrapScrollable(v.Object).GetVAdjustment() -} - // TODO gtk_layout_get_bin_window /* * GtkViewport */ -// ViewportNew() is a wrapper around gtk_viewport_new(). -func ViewportNew(hadjustment, vadjustment *Adjustment) (*Viewport, error) { - c := C.gtk_viewport_new(hadjustment.Native(), vadjustment.Native()) - if c == nil { - return nil, nilPtrErr - } - obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} - b := wrapViewport(obj) - obj.RefSink() - runtime.SetFinalizer(obj, (*glib.Object).Unref) - return b, nil -} - // Viewport is a representation of GTK's GtkViewport GInterface. type Viewport struct { Bin + + // Interfaces + Scrollable } // IViewport is an interface type implemented by all structs @@ -1151,7 +1126,12 @@ func (v *Viewport) Native() *C.GtkViewport { } func wrapViewport(obj *glib.Object) *Viewport { - return &Viewport{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} + b := wrapBin(obj) + s := wrapScrollable(obj) + return &Viewport{ + Bin: *b, + Scrollable: *s, + } } func (v *Viewport) toViewport() *C.GtkViewport { @@ -1161,12 +1141,17 @@ func (v *Viewport) toViewport() *C.GtkViewport { return v.Native() } -func (v *Viewport) toScrollable() *C.GtkScrollable { - if v == nil || v.GObject == nil { - return nil +// ViewportNew() is a wrapper around gtk_viewport_new(). +func ViewportNew(hadjustment, vadjustment *Adjustment) (*Viewport, error) { + c := C.gtk_viewport_new(hadjustment.Native(), vadjustment.Native()) + if c == nil { + return nil, nilPtrErr } - p := unsafe.Pointer(v.GObject) - return C.toGtkScrollable(p) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + b := wrapViewport(obj) + obj.RefSink() + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return b, nil } func (v *Viewport) SetHAdjustment(adjustment *Adjustment) { @@ -3051,7 +3036,7 @@ type ImageMenuItem struct { MenuItem } -// Native() returns a pointer to the underlying GtkImageMenuItem. +// Native returns a pointer to the underlying GtkImageMenuItem. func (v *ImageMenuItem) Native() *C.GtkImageMenuItem { if v == nil || v.GObject == nil { return nil @@ -3061,7 +3046,8 @@ func (v *ImageMenuItem) Native() *C.GtkImageMenuItem { } func wrapImageMenuItem(obj *glib.Object) *ImageMenuItem { - return &ImageMenuItem{MenuItem{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}} + return &ImageMenuItem{MenuItem{Bin{Container{Widget{ + glib.InitiallyUnowned{obj}}}}}} } // TODO: ImageMenuItem functions. @@ -3155,7 +3141,8 @@ func (v *AboutDialog) Native() *C.GtkAboutDialog { } func wrapAboutDialog(obj *glib.Object) *AboutDialog { - return &AboutDialog{Dialog{Window{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}}} + return &AboutDialog{Dialog{Window{Bin{Container{Widget{ + glib.InitiallyUnowned{obj}}}}}}} } /* @@ -3177,62 +3164,55 @@ func (v *FileChooserDialog) Native() *C.GtkFileChooserDialog { } func wrapFileChooserDialog(obj *glib.Object) *FileChooserDialog { - return &FileChooserDialog{Dialog{Window{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}}} + return &FileChooserDialog{Dialog{Window{Bin{Container{Widget{ + glib.InitiallyUnowned{obj}}}}}}} } -// Borrowed from github.com/mattn/go-gtk -func variadicButtonsToArrays(buttons []interface{}) ([]string, []ResponseType) { - if len(buttons)%2 != 0 { - panic("variadic parameter must be even (couples of string-ResponseType (button label - button response)") - } - text := make([]string, len(buttons)/2) - res := make([]ResponseType, len(buttons)/2) - for i := 0; i < len(text); i++ { - btext, ok := buttons[2*i].(string) - if !ok { - panic("button text must be a string") - } - bresponse, ok := buttons[2*i+1].(ResponseType) - if !ok { - panic("button response must be an ResponseType") - } - text[i] = btext - res[i] = bresponse +// FileChooserDialogNew() is a wrapper around gtk_file_chooser_dialog_new(). +// The length of the texts and responses slices must be equal. If +// both are equal, it is the equivalent to passing NULL as the first +// button text, otherwise each text/id pair is added to the dialog. +func FileChooserDialogNew(title string, parent IWindow, + fileChooserAction FileChooserAction, texts []string, + responses []ResponseType) (*FileChooserDialog, error) { + + if len(texts) != len(responses) { + return nil, fmt.Errorf("Inequal lengths of button text and response slices.") } - return text, res -} -// FileChooserDialogNew() is a wrapper around gtk_file_chooser_dialog_new(). -// Variable argument should be (button string, id ResponseType) pairs if not omitted, -// or just the label for the first button. -func FileChooserDialogNew(title string, parent IWindow, fileChooserAction FileChooserAction, b ...interface{}) *FileChooserDialog { ctitle := C.CString(title) defer C.free(unsafe.Pointer(ctitle)) var w *C.GtkWindow = nil if parent != nil { w = parent.toWindow() } - var cfirstButton *C.char - if len(b) == 1 { - cfirstButton = C.CString(b[0].(string)) - defer C.free(unsafe.Pointer(ctitle)) + + var c *C.GtkWidget + if len(texts) == 0 { + c = C._gtk_file_chooser_dialog_new_zero(ctitle, w, + C.GtkFileChooserAction(fileChooserAction)) + } else { + cfirstText := C.CString(texts[0]) + defer C.free(unsafe.Pointer(cfirstText)) + c = C._gtk_file_chooser_dialog_new_one(ctitle, w, + C.GtkFileChooserAction(fileChooserAction), cfirstText, + C.GtkResponseType(responses[0])) } - c := C._gtk_file_chooser_dialog_new(ctitle, w, C.GtkFileChooserAction(fileChooserAction), cfirstButton) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} - m := wrapFileChooserDialog(obj) + f := wrapFileChooserDialog(obj) obj.RefSink() runtime.SetFinalizer(obj, (*glib.Object).Unref) - if len(b) == 1 { - return m + // Add additional buttons + for i := 1; i < len(texts); i++ { + f.AddButton(texts[i], responses[i]) } - text, response := variadicButtonsToArrays(b) - for i := range text { - m.AddButton(text[i], response[i]) - } - - return m + return f, nil } /* @@ -4349,10 +4329,9 @@ func (v *Widget) Unmap() { //void gtk_widget_remove_tick_callback(GtkWidget *widget, guint id); func (v *Widget) GetAllocation() *Allocation { - // TODO Should we avoid new here an expect a pointer as an argument? - allocation := new(Allocation) - C.gtk_widget_get_allocation(v.Native(), allocation.Native()) - return allocation + var a Allocation + C.gtk_widget_get_allocation(v.Native(), a.Native()) + return &a } func (v *Widget) SetAllocation(allocation *Allocation) { diff --git a/gtk/gtk.go.h b/gtk/gtk.go.h index 209fa6f..e1b5c7d 100644 --- a/gtk/gtk.go.h +++ b/gtk/gtk.go.h @@ -323,11 +323,20 @@ object_get_class_name(GObject *object) } static GtkWidget* -_gtk_file_chooser_dialog_new(const char* title, - GtkWindow* parent, GtkFileChooserAction file_chooser_action, const char *firstButton) { - return gtk_file_chooser_dialog_new( - title, - parent, - file_chooser_action, - firstButton, NULL); +_gtk_file_chooser_dialog_new_zero(const char* title, GtkWindow* parent, + GtkFileChooserAction action) { + GtkWidget *fcd; + + fcd = gtk_file_chooser_dialog_new(title, parent, action, NULL, NULL); + return (fcd); +} + +static GtkWidget* +_gtk_file_chooser_dialog_new_one(const char* title, GtkWindow* parent, + GtkFileChooserAction action, const char *firstButton, GtkResponseType res) { + GtkWidget *fcd; + + fcd = gtk_file_chooser_dialog_new(title, parent, action, firstButton, + res, NULL); + return (fcd); } From 26d5dbce51d4193ad4ac3f81432b856610edc173 Mon Sep 17 00:00:00 2001 From: raichu Date: Wed, 18 Sep 2013 13:24:57 +0900 Subject: [PATCH 11/23] FileChooser (also embed into FileChooserDialog), getters for gtk.Allocation and gdk.Rectangle --- gdk/gdk.go | 20 ++++++++++++ gtk/gtk.go | 89 +++++++++++++++++++++++++++++++++++++++++++++++++--- gtk/gtk.go.h | 6 ++++ 3 files changed, 110 insertions(+), 5 deletions(-) diff --git a/gdk/gdk.go b/gdk/gdk.go index d09110d..2254fd5 100644 --- a/gdk/gdk.go +++ b/gdk/gdk.go @@ -465,3 +465,23 @@ type Rectangle struct { func (r *Rectangle) Native() *C.GdkRectangle { return &r.GdkRectangle } + +// GetX returns x field of the underlying GdkRectangle. +func (r *Rectangle) GetX() int { + return int(r.Native().x) +} + +// GetY returns y field of the underlying GdkRectangle. +func (r *Rectangle) GetY() int { + return int(r.Native().y) +} + +// GetWidth returns width field of the underlying GdkRectangle. +func (r *Rectangle) GetWidth() int { + return int(r.Native().width) +} + +// GetHeight returns height field of the underlying GdkRectangle. +func (r *Rectangle) GetHeight() int { + return int(r.Native().height) +} diff --git a/gtk/gtk.go b/gtk/gtk.go index 43f9cc0..dbc4cf9 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -425,7 +425,9 @@ const ( ) // Allocation is a representation of GTK's GtkAllocation type. -type Allocation gdk.Rectangle +type Allocation struct { + gdk.Rectangle +} // Native returns a pointer to the underlying GtkAllocation. func (v *Allocation) Native() *C.GtkAllocation { @@ -1045,7 +1047,7 @@ func wrapLayout(obj *glib.Object) *Layout { c := wrapContainer(obj) s := wrapScrollable(obj) return &Layout{ - Container: *c, + Container: *c, Scrollable: *s, } } @@ -1129,7 +1131,7 @@ func wrapViewport(obj *glib.Object) *Viewport { b := wrapBin(obj) s := wrapScrollable(obj) return &Viewport{ - Bin: *b, + Bin: *b, Scrollable: *s, } } @@ -3145,6 +3147,75 @@ func wrapAboutDialog(obj *glib.Object) *AboutDialog { glib.InitiallyUnowned{obj}}}}}}} } +/* + * GtkFileChooser + */ + +// IFileChooser is an interface type implemented by all structs +// embedding a FileChooser. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkFileChooser. +type IFileChooser interface { + toFileChooser() *C.GtkFileChooser +} + +// FileChooser is a representation of GTK's GtkFileChooser GInterface. +type FileChooser struct { + *glib.Object +} + +// Native() returns a pointer to the underlying GObject as a GtkScrollable. +func (v *FileChooser) Native() *C.GtkFileChooser { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkFileChooser(p) +} + +func wrapFileChooser(obj *glib.Object) *FileChooser { + return &FileChooser{obj} +} + +func (v *FileChooser) toFileChooser() *C.GtkFileChooser { + if v == nil { + return nil + } + return v.Native() +} + +// GetFilename is a wrapper around gtk_file_chooser_get_filename(). +func (v *FileChooser) GetFilename() (string, error) { + c := C.gtk_file_chooser_get_filename(v.Native()) + if c == nil { + return "", nilPtrErr + } + return C.GoString((*C.char)(c)), nil +} + +// SetFilename is a wrapper around gtk_file_chooser_set_filename(). +func (v *FileChooser) SetFilename(filename string) { + cfilename := C.CString(filename) + defer C.free(unsafe.Pointer(cfilename)) + C.gtk_file_chooser_set_filename(v.Native(), cfilename) +} + +// GetCurrentFolder is a wrapper around gtk_file_chooser_get_filename(). +func (v *FileChooser) GetCurrentFolder() (string, error) { + c := C.gtk_file_chooser_get_current_folder(v.Native()) + if c == nil { + return "", nilPtrErr + } + return C.GoString((*C.char)(c)), nil +} + +// SetCurrentFolder is a wrapper around gtk_file_chooser_set_filename(). +func (v *FileChooser) SetCurrentFolder(folder string) { + cfolder := C.CString(folder) + defer C.free(unsafe.Pointer(cfolder)) + C.gtk_file_chooser_set_current_folder(v.Native(), (*C.gchar)(cfolder)) +} + /* * GtkFileChooserDialog */ @@ -3152,6 +3223,8 @@ func wrapAboutDialog(obj *glib.Object) *AboutDialog { // FileChooserDialog is a representation of GTK's GtkFileChooserDialog. type FileChooserDialog struct { Dialog + // Interfaces + FileChooser } // Native() returns a pointer to the underlying GtkFileChooserDialog. @@ -3164,8 +3237,12 @@ func (v *FileChooserDialog) Native() *C.GtkFileChooserDialog { } func wrapFileChooserDialog(obj *glib.Object) *FileChooserDialog { - return &FileChooserDialog{Dialog{Window{Bin{Container{Widget{ - glib.InitiallyUnowned{obj}}}}}}} + d := wrapDialog(obj) + f := wrapFileChooser(obj) + return &FileChooserDialog{ + Dialog: *d, + FileChooser: *f, + } } // FileChooserDialogNew() is a wrapper around gtk_file_chooser_dialog_new(). @@ -4772,6 +4849,8 @@ func cast(c *C.GObject) (glib.IObject, error) { g = wrapMessageDialog(obj) case "GtkAboutDialog": g = wrapAboutDialog(obj) + case "GtkFileChooser": + g = wrapFileChooser(obj) case "GtkFileChooserDialog": g = wrapFileChooserDialog(obj) case "GtkMisc": diff --git a/gtk/gtk.go.h b/gtk/gtk.go.h index e1b5c7d..bb720b7 100644 --- a/gtk/gtk.go.h +++ b/gtk/gtk.go.h @@ -266,6 +266,12 @@ toGtkAboutDialog(void *p) return (GTK_ABOUT_DIALOG(p)); } +static GtkFileChooser * +toGtkFileChooser(void *p) +{ + return (GTK_FILE_CHOOSER(p)); +} + static GtkFileChooserDialog * toGtkFileChooserDialog(void *p) { From eae320fc5394546c70ab8496e77d838838abd2d6 Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 19 Sep 2013 13:58:14 +0900 Subject: [PATCH 12/23] GtkToolbar, add some missing functions, doc fix --- gtk/gtk.go | 39 +++++++++++++++++++++++++++++++++++++++ gtk/gtk.go.h | 6 ++++++ 2 files changed, 45 insertions(+) diff --git a/gtk/gtk.go b/gtk/gtk.go index dbc4cf9..e9131b9 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -502,6 +502,10 @@ func wrapAdjustment(obj *glib.Object) *Adjustment { return &Adjustment{glib.InitiallyUnowned{obj}} } +func (v *Adjustment) GetPageSize() float64 { + return float64(C.gtk_adjustment_get_page_size(v.Native())) +} + /* * GtkBin */ @@ -848,6 +852,28 @@ func (v *Button) GetEventWindow() (*gdk.Window, error) { return w, nil } +/* + * GtkToolbar + */ + +// Toolbar is a representation of GTK's GtkToolbar. +type Toolbar struct { + Container +} + +// Native() returns a pointer to the underlying GtkToolbar. +func (v *Toolbar) Native() *C.GtkToolbar { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkToolbar(p) +} + +func wrapToolbar(obj *glib.Object) *Toolbar { + return &Toolbar{Container{Widget{glib.InitiallyUnowned{obj}}}} +} + /* * GtkBox */ @@ -1476,6 +1502,11 @@ func (v *Container) Remove(w IWidget) { C.gtk_container_remove(v.Native(), w.toWidget()) } +// ResizeChildren() is a wrapper around gtk_container_resize_children(). +func (v *Container) ResizeChildren() { + C.gtk_container_resize_children(v.Native()) +} + /* * GtkDialog */ @@ -4752,6 +4783,12 @@ func (v *Window) SetDefaultGeometry(width, height int) { C.gint(height)) } +func (v *Window) GetSize() (width, height int) { + var w,h C.gint + C.gtk_window_get_size(v.Native(), &w, &h) + return int(w), int(h) +} + // TODO(jrick) GdkGeometry GdkWindowHints /* func (v *Window) SetGeometryHints() { @@ -4797,6 +4834,8 @@ func cast(c *C.GObject) (glib.IObject, error) { g = wrapAdjustment(obj) case "GtkBin": g = wrapBin(obj) + case "GtkToolbar": + g = wrapToolbar(obj) case "GtkBox": g = wrapBox(obj) case "GtkButton": diff --git a/gtk/gtk.go.h b/gtk/gtk.go.h index bb720b7..9ce07a9 100644 --- a/gtk/gtk.go.h +++ b/gtk/gtk.go.h @@ -56,6 +56,12 @@ toGtkWindow(void *p) return (GTK_WINDOW(p)); } +static GtkToolbar * +toGtkToolbar(void *p) +{ + return (GTK_TOOLBAR(p)); +} + static GtkBox * toGtkBox(void *p) { From 087681c24f00613121ef72990994841310b3b7e3 Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 19 Sep 2013 14:47:00 +0900 Subject: [PATCH 13/23] initial (and questionable) access to GtkEvent fields --- gdk/gdk.go | 28 ++++++++++++++++++++++++++++ gdk/gdk.go.h | 6 ++++++ gtk/gtk.go | 10 +++++++--- 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/gdk/gdk.go b/gdk/gdk.go index 2254fd5..b2c44cc 100644 --- a/gdk/gdk.go +++ b/gdk/gdk.go @@ -416,6 +416,34 @@ func (v *Event) free() { C.gdk_event_free(v.Native()) } +func ToEvent(c glib.CallbackArg) *Event { + return &Event{GdkEvent: (*C.GdkEvent)(unsafe.Pointer(c))} +} + +func (v *Event) Configure() *EventConfigure { + c := C.toGdkEventConfigure(v.Native()) + return &EventConfigure{ + Type: EventType(c._type), + Window: &Window{(*glib.Object)(unsafe.Pointer(c.window))}, + SendEvent: int8(c.send_event), + X: int(c.x), + Y: int(c.y), + Width: int(c.width), + Height: int(c.height), + } +} + +type EventType C.GdkEventType + +type EventConfigure struct { + Type EventType + Window *Window + SendEvent int8 + X, Y int + Width int + Height int +} + /* * GdkScreen */ diff --git a/gdk/gdk.go.h b/gdk/gdk.go.h index 86ff549..300e5db 100644 --- a/gdk/gdk.go.h +++ b/gdk/gdk.go.h @@ -54,3 +54,9 @@ toGdkWindow(void *p) { return (GDK_WINDOW(p)); } + +static GdkEventConfigure * +toGdkEventConfigure(GdkEvent *p) +{ + return &p->configure; +} diff --git a/gtk/gtk.go b/gtk/gtk.go index e9131b9..b33b335 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -502,6 +502,7 @@ func wrapAdjustment(obj *glib.Object) *Adjustment { return &Adjustment{glib.InitiallyUnowned{obj}} } +// GetPageSize is a wrapper around gtk_adjustment_get_page_size(). func (v *Adjustment) GetPageSize() float64 { return float64(C.gtk_adjustment_get_page_size(v.Native())) } @@ -874,6 +875,8 @@ func wrapToolbar(obj *glib.Object) *Toolbar { return &Toolbar{Container{Widget{glib.InitiallyUnowned{obj}}}} } +// TODO GtkToolbar functions + /* * GtkBox */ @@ -1502,7 +1505,7 @@ func (v *Container) Remove(w IWidget) { C.gtk_container_remove(v.Native(), w.toWidget()) } -// ResizeChildren() is a wrapper around gtk_container_resize_children(). +// ResizeChildren is a wrapper around gtk_container_resize_children(). func (v *Container) ResizeChildren() { C.gtk_container_resize_children(v.Native()) } @@ -3195,7 +3198,7 @@ type FileChooser struct { *glib.Object } -// Native() returns a pointer to the underlying GObject as a GtkScrollable. +// Native() returns a pointer to the underlying GObject as a GtkFileChooser. func (v *FileChooser) Native() *C.GtkFileChooser { if v == nil || v.GObject == nil { return nil @@ -4783,8 +4786,9 @@ func (v *Window) SetDefaultGeometry(width, height int) { C.gint(height)) } +// GetSize is a wrapper around gtk_window_get_size(). func (v *Window) GetSize() (width, height int) { - var w,h C.gint + var w, h C.gint C.gtk_window_get_size(v.Native(), &w, &h) return int(w), int(h) } From 31532744a8bc54c70c62233ef3cf1a47a3621be6 Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 19 Sep 2013 15:15:48 +0900 Subject: [PATCH 14/23] basic definitions fir ToolButton and ToolItem --- gtk/gtk.go | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ gtk/gtk.go.h | 12 ++++++++++++ 2 files changed, 64 insertions(+) diff --git a/gtk/gtk.go b/gtk/gtk.go index b33b335..cfadebb 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -877,6 +877,54 @@ func wrapToolbar(obj *glib.Object) *Toolbar { // TODO GtkToolbar functions +/* + * GtkToolItem + */ + +// ToolItem is a representation of GTK's GtkToolItem. +type ToolItem struct { + Bin +} + +// Native() returns a pointer to the underlying GtkToolItem. +func (v *ToolItem) Native() *C.GtkToolItem { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkToolItem(p) +} + +func wrapToolItem(obj *glib.Object) *ToolItem { + return &ToolItem{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// TODO GtkToolItem functions + +/* + * GtkToolItem + */ + +// ToolButton is a representation of GTK's GtkToolButton. +type ToolButton struct { + ToolItem +} + +// Native() returns a pointer to the underlying GtkToolButton. +func (v *ToolButton) Native() *C.GtkToolButton { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkToolButton(p) +} + +func wrapToolButton(obj *glib.Object) *ToolButton { + return &ToolButton{ToolItem{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}} +} + +// TODO GtkToolButton functions + /* * GtkBox */ @@ -4840,6 +4888,10 @@ func cast(c *C.GObject) (glib.IObject, error) { g = wrapBin(obj) case "GtkToolbar": g = wrapToolbar(obj) + case "GtkToolItem": + g = wrapToolItem(obj) + case "GtkToolButton": + g = wrapToolButton(obj) case "GtkBox": g = wrapBox(obj) case "GtkButton": diff --git a/gtk/gtk.go.h b/gtk/gtk.go.h index 9ce07a9..aa8b675 100644 --- a/gtk/gtk.go.h +++ b/gtk/gtk.go.h @@ -62,6 +62,18 @@ toGtkToolbar(void *p) return (GTK_TOOLBAR(p)); } +static GtkToolItem * +toGtkToolItem(void *p) +{ + return (GTK_TOOL_ITEM(p)); +} + +static GtkToolButton * +toGtkToolButton(void *p) +{ + return (GTK_TOOL_BUTTON(p)); +} + static GtkBox * toGtkBox(void *p) { From 014b626f7ddbc1d4557ced612ec4ed3dfb21b88a Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 19 Sep 2013 16:54:18 +0900 Subject: [PATCH 15/23] GtkCheckMenuItem, Window.Fullscreen and Window.Unfullscreen --- gtk/gtk.go | 45 +++++++++++++++++++++++++++++++++++++++++++++ gtk/gtk.go.h | 6 ++++++ 2 files changed, 51 insertions(+) diff --git a/gtk/gtk.go b/gtk/gtk.go index cfadebb..ea21161 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -3136,6 +3136,39 @@ func wrapImageMenuItem(obj *glib.Object) *ImageMenuItem { // TODO: ImageMenuItem functions. +/* + * GtkCheckMenuItem + */ + +// CheckMenuItem is a representation of GTK's GtkCheckMenuItem. +type CheckMenuItem struct { + MenuItem +} + +// Native returns a pointer to the underlying GtkCheckMenuItem. +func (v *CheckMenuItem) Native() *C.GtkCheckMenuItem { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCheckMenuItem(p) +} + +func wrapCheckMenuItem(obj *glib.Object) *CheckMenuItem { + return &CheckMenuItem{MenuItem{Bin{Container{Widget{ + glib.InitiallyUnowned{obj}}}}}} +} + +func (v *CheckMenuItem) GetActive() bool { + return gobool(C.gtk_check_menu_item_get_active(v.Native())) +} + +func (v *CheckMenuItem) SetActive(active bool) { + C.gtk_check_menu_item_set_active(v.Native(), gbool(active)) +} + +// TODO: CheckMenuItem functions. + /* * GtkMenuShell */ @@ -4841,6 +4874,16 @@ func (v *Window) GetSize() (width, height int) { return int(w), int(h) } +// Fullscreen is a wrapper around gtk_window_fullscreen(). +func (v *Window) Fullscreen() { + C.gtk_window_fullscreen(v.Native()) +} + +// Unfullscreen is a wrapper around gtk_window_unfullscreen(). +func (v *Window) Unfullscreen() { + C.gtk_window_unfullscreen(v.Native()) +} + // TODO(jrick) GdkGeometry GdkWindowHints /* func (v *Window) SetGeometryHints() { @@ -4938,6 +4981,8 @@ func cast(c *C.GObject) (glib.IObject, error) { g = wrapMenuItem(obj) case "GtkImageMenuItem": g = wrapImageMenuItem(obj) + case "GtkCheckMenuItem": + g = wrapCheckMenuItem(obj) case "GtkMenuShell": g = wrapMenuShell(obj) case "GtkMessageDialog": diff --git a/gtk/gtk.go.h b/gtk/gtk.go.h index aa8b675..fd52762 100644 --- a/gtk/gtk.go.h +++ b/gtk/gtk.go.h @@ -158,6 +158,12 @@ toGtkImageMenuItem(void *p) return (GTK_IMAGE_MENU_ITEM(p)); } +static GtkCheckMenuItem * +toGtkCheckMenuItem(void *p) +{ + return (GTK_CHECK_MENU_ITEM(p)); +} + static GtkMenu * toGtkMenu(void *p) { From 83778f86c72759869699bafb276f4c16a6492ded Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 19 Sep 2013 17:16:25 +0900 Subject: [PATCH 16/23] GdkEventKey, and gdkkeysyms.h --- gdk/gdk.go | 31 + gdk/gdk.go.h | 6 + gdk/keysyms.go | 2276 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 2313 insertions(+) create mode 100644 gdk/keysyms.go diff --git a/gdk/gdk.go b/gdk/gdk.go index b2c44cc..470ccb0 100644 --- a/gdk/gdk.go +++ b/gdk/gdk.go @@ -433,6 +433,23 @@ func (v *Event) Configure() *EventConfigure { } } +func (v *Event) Key() *EventKey { + c := C.toGdkEventKey(v.Native()) + return &EventKey{ + Type: EventType(c._type), + Window: &Window{(*glib.Object)(unsafe.Pointer(c.window))}, + SendEvent: int8(c.send_event), + Time: int32(c.time), + State: int(c.state), + Keyval: int(c.keyval), + Length: int(c.length), + String: C.GoString((*C.char)(c.string)), + HardwareKeycode: uint16(c.hardware_keycode), + Group: uint8(c.group), + //IsModifier: c.is_modifier != 0, + } +} + type EventType C.GdkEventType type EventConfigure struct { @@ -444,6 +461,20 @@ type EventConfigure struct { Height int } +type EventKey struct { + Type EventType + Window *Window + SendEvent int8 + Time int32 + State int + Keyval int + Length int + String string + HardwareKeycode uint16 + Group uint8 + IsModifier bool +} + /* * GdkScreen */ diff --git a/gdk/gdk.go.h b/gdk/gdk.go.h index 300e5db..2ee215a 100644 --- a/gdk/gdk.go.h +++ b/gdk/gdk.go.h @@ -60,3 +60,9 @@ toGdkEventConfigure(GdkEvent *p) { return &p->configure; } + +static GdkEventKey * +toGdkEventKey(GdkEvent *p) +{ + return &p->key; +} diff --git a/gdk/keysyms.go b/gdk/keysyms.go new file mode 100644 index 0000000..732473a --- /dev/null +++ b/gdk/keysyms.go @@ -0,0 +1,2276 @@ +package gdk + +// #include +import "C" + +const ( + KEY_VoidSymbol = C.GDK_KEY_VoidSymbol + KEY_BackSpace = C.GDK_KEY_BackSpace + KEY_Tab = C.GDK_KEY_Tab + KEY_Linefeed = C.GDK_KEY_Linefeed + KEY_Clear = C.GDK_KEY_Clear + KEY_Return = C.GDK_KEY_Return + KEY_Pause = C.GDK_KEY_Pause + KEY_Scroll_Lock = C.GDK_KEY_Scroll_Lock + KEY_Sys_Req = C.GDK_KEY_Sys_Req + KEY_Escape = C.GDK_KEY_Escape + KEY_Delete = C.GDK_KEY_Delete + KEY_Multi_key = C.GDK_KEY_Multi_key + KEY_Codeinput = C.GDK_KEY_Codeinput + KEY_SingleCandidate = C.GDK_KEY_SingleCandidate + KEY_MultipleCandidate = C.GDK_KEY_MultipleCandidate + KEY_PreviousCandidate = C.GDK_KEY_PreviousCandidate + KEY_Kanji = C.GDK_KEY_Kanji + KEY_Muhenkan = C.GDK_KEY_Muhenkan + KEY_Henkan_Mode = C.GDK_KEY_Henkan_Mode + KEY_Henkan = C.GDK_KEY_Henkan + KEY_Romaji = C.GDK_KEY_Romaji + KEY_Hiragana = C.GDK_KEY_Hiragana + KEY_Katakana = C.GDK_KEY_Katakana + KEY_Hiragana_Katakana = C.GDK_KEY_Hiragana_Katakana + KEY_Zenkaku = C.GDK_KEY_Zenkaku + KEY_Hankaku = C.GDK_KEY_Hankaku + KEY_Zenkaku_Hankaku = C.GDK_KEY_Zenkaku_Hankaku + KEY_Touroku = C.GDK_KEY_Touroku + KEY_Massyo = C.GDK_KEY_Massyo + KEY_Kana_Lock = C.GDK_KEY_Kana_Lock + KEY_Kana_Shift = C.GDK_KEY_Kana_Shift + KEY_Eisu_Shift = C.GDK_KEY_Eisu_Shift + KEY_Eisu_toggle = C.GDK_KEY_Eisu_toggle + KEY_Kanji_Bangou = C.GDK_KEY_Kanji_Bangou + KEY_Zen_Koho = C.GDK_KEY_Zen_Koho + KEY_Mae_Koho = C.GDK_KEY_Mae_Koho + KEY_Home = C.GDK_KEY_Home + KEY_Left = C.GDK_KEY_Left + KEY_Up = C.GDK_KEY_Up + KEY_Right = C.GDK_KEY_Right + KEY_Down = C.GDK_KEY_Down + KEY_Prior = C.GDK_KEY_Prior + KEY_Page_Up = C.GDK_KEY_Page_Up + KEY_Next = C.GDK_KEY_Next + KEY_Page_Down = C.GDK_KEY_Page_Down + KEY_End = C.GDK_KEY_End + KEY_Begin = C.GDK_KEY_Begin + KEY_Select = C.GDK_KEY_Select + KEY_Print = C.GDK_KEY_Print + KEY_Execute = C.GDK_KEY_Execute + KEY_Insert = C.GDK_KEY_Insert + KEY_Undo = C.GDK_KEY_Undo + KEY_Redo = C.GDK_KEY_Redo + KEY_Menu = C.GDK_KEY_Menu + KEY_Find = C.GDK_KEY_Find + KEY_Cancel = C.GDK_KEY_Cancel + KEY_Help = C.GDK_KEY_Help + KEY_Break = C.GDK_KEY_Break + KEY_Mode_switch = C.GDK_KEY_Mode_switch + KEY_script_switch = C.GDK_KEY_script_switch + KEY_Num_Lock = C.GDK_KEY_Num_Lock + KEY_KP_Space = C.GDK_KEY_KP_Space + KEY_KP_Tab = C.GDK_KEY_KP_Tab + KEY_KP_Enter = C.GDK_KEY_KP_Enter + KEY_KP_F1 = C.GDK_KEY_KP_F1 + KEY_KP_F2 = C.GDK_KEY_KP_F2 + KEY_KP_F3 = C.GDK_KEY_KP_F3 + KEY_KP_F4 = C.GDK_KEY_KP_F4 + KEY_KP_Home = C.GDK_KEY_KP_Home + KEY_KP_Left = C.GDK_KEY_KP_Left + KEY_KP_Up = C.GDK_KEY_KP_Up + KEY_KP_Right = C.GDK_KEY_KP_Right + KEY_KP_Down = C.GDK_KEY_KP_Down + KEY_KP_Prior = C.GDK_KEY_KP_Prior + KEY_KP_Page_Up = C.GDK_KEY_KP_Page_Up + KEY_KP_Next = C.GDK_KEY_KP_Next + KEY_KP_Page_Down = C.GDK_KEY_KP_Page_Down + KEY_KP_End = C.GDK_KEY_KP_End + KEY_KP_Begin = C.GDK_KEY_KP_Begin + KEY_KP_Insert = C.GDK_KEY_KP_Insert + KEY_KP_Delete = C.GDK_KEY_KP_Delete + KEY_KP_Equal = C.GDK_KEY_KP_Equal + KEY_KP_Multiply = C.GDK_KEY_KP_Multiply + KEY_KP_Add = C.GDK_KEY_KP_Add + KEY_KP_Separator = C.GDK_KEY_KP_Separator + KEY_KP_Subtract = C.GDK_KEY_KP_Subtract + KEY_KP_Decimal = C.GDK_KEY_KP_Decimal + KEY_KP_Divide = C.GDK_KEY_KP_Divide + KEY_KP_0 = C.GDK_KEY_KP_0 + KEY_KP_1 = C.GDK_KEY_KP_1 + KEY_KP_2 = C.GDK_KEY_KP_2 + KEY_KP_3 = C.GDK_KEY_KP_3 + KEY_KP_4 = C.GDK_KEY_KP_4 + KEY_KP_5 = C.GDK_KEY_KP_5 + KEY_KP_6 = C.GDK_KEY_KP_6 + KEY_KP_7 = C.GDK_KEY_KP_7 + KEY_KP_8 = C.GDK_KEY_KP_8 + KEY_KP_9 = C.GDK_KEY_KP_9 + KEY_F1 = C.GDK_KEY_F1 + KEY_F2 = C.GDK_KEY_F2 + KEY_F3 = C.GDK_KEY_F3 + KEY_F4 = C.GDK_KEY_F4 + KEY_F5 = C.GDK_KEY_F5 + KEY_F6 = C.GDK_KEY_F6 + KEY_F7 = C.GDK_KEY_F7 + KEY_F8 = C.GDK_KEY_F8 + KEY_F9 = C.GDK_KEY_F9 + KEY_F10 = C.GDK_KEY_F10 + KEY_F11 = C.GDK_KEY_F11 + KEY_L1 = C.GDK_KEY_L1 + KEY_F12 = C.GDK_KEY_F12 + KEY_L2 = C.GDK_KEY_L2 + KEY_F13 = C.GDK_KEY_F13 + KEY_L3 = C.GDK_KEY_L3 + KEY_F14 = C.GDK_KEY_F14 + KEY_L4 = C.GDK_KEY_L4 + KEY_F15 = C.GDK_KEY_F15 + KEY_L5 = C.GDK_KEY_L5 + KEY_F16 = C.GDK_KEY_F16 + KEY_L6 = C.GDK_KEY_L6 + KEY_F17 = C.GDK_KEY_F17 + KEY_L7 = C.GDK_KEY_L7 + KEY_F18 = C.GDK_KEY_F18 + KEY_L8 = C.GDK_KEY_L8 + KEY_F19 = C.GDK_KEY_F19 + KEY_L9 = C.GDK_KEY_L9 + KEY_F20 = C.GDK_KEY_F20 + KEY_L10 = C.GDK_KEY_L10 + KEY_F21 = C.GDK_KEY_F21 + KEY_R1 = C.GDK_KEY_R1 + KEY_F22 = C.GDK_KEY_F22 + KEY_R2 = C.GDK_KEY_R2 + KEY_F23 = C.GDK_KEY_F23 + KEY_R3 = C.GDK_KEY_R3 + KEY_F24 = C.GDK_KEY_F24 + KEY_R4 = C.GDK_KEY_R4 + KEY_F25 = C.GDK_KEY_F25 + KEY_R5 = C.GDK_KEY_R5 + KEY_F26 = C.GDK_KEY_F26 + KEY_R6 = C.GDK_KEY_R6 + KEY_F27 = C.GDK_KEY_F27 + KEY_R7 = C.GDK_KEY_R7 + KEY_F28 = C.GDK_KEY_F28 + KEY_R8 = C.GDK_KEY_R8 + KEY_F29 = C.GDK_KEY_F29 + KEY_R9 = C.GDK_KEY_R9 + KEY_F30 = C.GDK_KEY_F30 + KEY_R10 = C.GDK_KEY_R10 + KEY_F31 = C.GDK_KEY_F31 + KEY_R11 = C.GDK_KEY_R11 + KEY_F32 = C.GDK_KEY_F32 + KEY_R12 = C.GDK_KEY_R12 + KEY_F33 = C.GDK_KEY_F33 + KEY_R13 = C.GDK_KEY_R13 + KEY_F34 = C.GDK_KEY_F34 + KEY_R14 = C.GDK_KEY_R14 + KEY_F35 = C.GDK_KEY_F35 + KEY_R15 = C.GDK_KEY_R15 + KEY_Shift_L = C.GDK_KEY_Shift_L + KEY_Shift_R = C.GDK_KEY_Shift_R + KEY_Control_L = C.GDK_KEY_Control_L + KEY_Control_R = C.GDK_KEY_Control_R + KEY_Caps_Lock = C.GDK_KEY_Caps_Lock + KEY_Shift_Lock = C.GDK_KEY_Shift_Lock + KEY_Meta_L = C.GDK_KEY_Meta_L + KEY_Meta_R = C.GDK_KEY_Meta_R + KEY_Alt_L = C.GDK_KEY_Alt_L + KEY_Alt_R = C.GDK_KEY_Alt_R + KEY_Super_L = C.GDK_KEY_Super_L + KEY_Super_R = C.GDK_KEY_Super_R + KEY_Hyper_L = C.GDK_KEY_Hyper_L + KEY_Hyper_R = C.GDK_KEY_Hyper_R + KEY_ISO_Lock = C.GDK_KEY_ISO_Lock + KEY_ISO_Level2_Latch = C.GDK_KEY_ISO_Level2_Latch + KEY_ISO_Level3_Shift = C.GDK_KEY_ISO_Level3_Shift + KEY_ISO_Level3_Latch = C.GDK_KEY_ISO_Level3_Latch + KEY_ISO_Level3_Lock = C.GDK_KEY_ISO_Level3_Lock + KEY_ISO_Level5_Shift = C.GDK_KEY_ISO_Level5_Shift + KEY_ISO_Level5_Latch = C.GDK_KEY_ISO_Level5_Latch + KEY_ISO_Level5_Lock = C.GDK_KEY_ISO_Level5_Lock + KEY_ISO_Group_Shift = C.GDK_KEY_ISO_Group_Shift + KEY_ISO_Group_Latch = C.GDK_KEY_ISO_Group_Latch + KEY_ISO_Group_Lock = C.GDK_KEY_ISO_Group_Lock + KEY_ISO_Next_Group = C.GDK_KEY_ISO_Next_Group + KEY_ISO_Next_Group_Lock = C.GDK_KEY_ISO_Next_Group_Lock + KEY_ISO_Prev_Group = C.GDK_KEY_ISO_Prev_Group + KEY_ISO_Prev_Group_Lock = C.GDK_KEY_ISO_Prev_Group_Lock + KEY_ISO_First_Group = C.GDK_KEY_ISO_First_Group + KEY_ISO_First_Group_Lock = C.GDK_KEY_ISO_First_Group_Lock + KEY_ISO_Last_Group = C.GDK_KEY_ISO_Last_Group + KEY_ISO_Last_Group_Lock = C.GDK_KEY_ISO_Last_Group_Lock + KEY_ISO_Left_Tab = C.GDK_KEY_ISO_Left_Tab + KEY_ISO_Move_Line_Up = C.GDK_KEY_ISO_Move_Line_Up + KEY_ISO_Move_Line_Down = C.GDK_KEY_ISO_Move_Line_Down + KEY_ISO_Partial_Line_Up = C.GDK_KEY_ISO_Partial_Line_Up + KEY_ISO_Partial_Line_Down = C.GDK_KEY_ISO_Partial_Line_Down + KEY_ISO_Partial_Space_Left = C.GDK_KEY_ISO_Partial_Space_Left + KEY_ISO_Partial_Space_Right = C.GDK_KEY_ISO_Partial_Space_Right + KEY_ISO_Set_Margin_Left = C.GDK_KEY_ISO_Set_Margin_Left + KEY_ISO_Set_Margin_Right = C.GDK_KEY_ISO_Set_Margin_Right + KEY_ISO_Release_Margin_Left = C.GDK_KEY_ISO_Release_Margin_Left + KEY_ISO_Release_Margin_Right = C.GDK_KEY_ISO_Release_Margin_Right + KEY_ISO_Release_Both_Margins = C.GDK_KEY_ISO_Release_Both_Margins + KEY_ISO_Fast_Cursor_Left = C.GDK_KEY_ISO_Fast_Cursor_Left + KEY_ISO_Fast_Cursor_Right = C.GDK_KEY_ISO_Fast_Cursor_Right + KEY_ISO_Fast_Cursor_Up = C.GDK_KEY_ISO_Fast_Cursor_Up + KEY_ISO_Fast_Cursor_Down = C.GDK_KEY_ISO_Fast_Cursor_Down + KEY_ISO_Continuous_Underline = C.GDK_KEY_ISO_Continuous_Underline + KEY_ISO_Discontinuous_Underline = C.GDK_KEY_ISO_Discontinuous_Underline + KEY_ISO_Emphasize = C.GDK_KEY_ISO_Emphasize + KEY_ISO_Center_Object = C.GDK_KEY_ISO_Center_Object + KEY_ISO_Enter = C.GDK_KEY_ISO_Enter + KEY_dead_grave = C.GDK_KEY_dead_grave + KEY_dead_acute = C.GDK_KEY_dead_acute + KEY_dead_circumflex = C.GDK_KEY_dead_circumflex + KEY_dead_tilde = C.GDK_KEY_dead_tilde + KEY_dead_perispomeni = C.GDK_KEY_dead_perispomeni + KEY_dead_macron = C.GDK_KEY_dead_macron + KEY_dead_breve = C.GDK_KEY_dead_breve + KEY_dead_abovedot = C.GDK_KEY_dead_abovedot + KEY_dead_diaeresis = C.GDK_KEY_dead_diaeresis + KEY_dead_abovering = C.GDK_KEY_dead_abovering + KEY_dead_doubleacute = C.GDK_KEY_dead_doubleacute + KEY_dead_caron = C.GDK_KEY_dead_caron + KEY_dead_cedilla = C.GDK_KEY_dead_cedilla + KEY_dead_ogonek = C.GDK_KEY_dead_ogonek + KEY_dead_iota = C.GDK_KEY_dead_iota + KEY_dead_voiced_sound = C.GDK_KEY_dead_voiced_sound + KEY_dead_semivoiced_sound = C.GDK_KEY_dead_semivoiced_sound + KEY_dead_belowdot = C.GDK_KEY_dead_belowdot + KEY_dead_hook = C.GDK_KEY_dead_hook + KEY_dead_horn = C.GDK_KEY_dead_horn + KEY_dead_stroke = C.GDK_KEY_dead_stroke + KEY_dead_abovecomma = C.GDK_KEY_dead_abovecomma + KEY_dead_psili = C.GDK_KEY_dead_psili + KEY_dead_abovereversedcomma = C.GDK_KEY_dead_abovereversedcomma + KEY_dead_dasia = C.GDK_KEY_dead_dasia + KEY_dead_doublegrave = C.GDK_KEY_dead_doublegrave + KEY_dead_belowring = C.GDK_KEY_dead_belowring + KEY_dead_belowmacron = C.GDK_KEY_dead_belowmacron + KEY_dead_belowcircumflex = C.GDK_KEY_dead_belowcircumflex + KEY_dead_belowtilde = C.GDK_KEY_dead_belowtilde + KEY_dead_belowbreve = C.GDK_KEY_dead_belowbreve + KEY_dead_belowdiaeresis = C.GDK_KEY_dead_belowdiaeresis + KEY_dead_invertedbreve = C.GDK_KEY_dead_invertedbreve + KEY_dead_belowcomma = C.GDK_KEY_dead_belowcomma + KEY_dead_currency = C.GDK_KEY_dead_currency + KEY_dead_a = C.GDK_KEY_dead_a + KEY_dead_A = C.GDK_KEY_dead_A + KEY_dead_e = C.GDK_KEY_dead_e + KEY_dead_E = C.GDK_KEY_dead_E + KEY_dead_i = C.GDK_KEY_dead_i + KEY_dead_I = C.GDK_KEY_dead_I + KEY_dead_o = C.GDK_KEY_dead_o + KEY_dead_O = C.GDK_KEY_dead_O + KEY_dead_u = C.GDK_KEY_dead_u + KEY_dead_U = C.GDK_KEY_dead_U + KEY_dead_small_schwa = C.GDK_KEY_dead_small_schwa + KEY_dead_capital_schwa = C.GDK_KEY_dead_capital_schwa + KEY_dead_greek = C.GDK_KEY_dead_greek + KEY_First_Virtual_Screen = C.GDK_KEY_First_Virtual_Screen + KEY_Prev_Virtual_Screen = C.GDK_KEY_Prev_Virtual_Screen + KEY_Next_Virtual_Screen = C.GDK_KEY_Next_Virtual_Screen + KEY_Last_Virtual_Screen = C.GDK_KEY_Last_Virtual_Screen + KEY_Terminate_Server = C.GDK_KEY_Terminate_Server + KEY_AccessX_Enable = C.GDK_KEY_AccessX_Enable + KEY_AccessX_Feedback_Enable = C.GDK_KEY_AccessX_Feedback_Enable + KEY_RepeatKeys_Enable = C.GDK_KEY_RepeatKeys_Enable + KEY_SlowKeys_Enable = C.GDK_KEY_SlowKeys_Enable + KEY_BounceKeys_Enable = C.GDK_KEY_BounceKeys_Enable + KEY_StickyKeys_Enable = C.GDK_KEY_StickyKeys_Enable + KEY_MouseKeys_Enable = C.GDK_KEY_MouseKeys_Enable + KEY_MouseKeys_Accel_Enable = C.GDK_KEY_MouseKeys_Accel_Enable + KEY_Overlay1_Enable = C.GDK_KEY_Overlay1_Enable + KEY_Overlay2_Enable = C.GDK_KEY_Overlay2_Enable + KEY_AudibleBell_Enable = C.GDK_KEY_AudibleBell_Enable + KEY_Pointer_Left = C.GDK_KEY_Pointer_Left + KEY_Pointer_Right = C.GDK_KEY_Pointer_Right + KEY_Pointer_Up = C.GDK_KEY_Pointer_Up + KEY_Pointer_Down = C.GDK_KEY_Pointer_Down + KEY_Pointer_UpLeft = C.GDK_KEY_Pointer_UpLeft + KEY_Pointer_UpRight = C.GDK_KEY_Pointer_UpRight + KEY_Pointer_DownLeft = C.GDK_KEY_Pointer_DownLeft + KEY_Pointer_DownRight = C.GDK_KEY_Pointer_DownRight + KEY_Pointer_Button_Dflt = C.GDK_KEY_Pointer_Button_Dflt + KEY_Pointer_Button1 = C.GDK_KEY_Pointer_Button1 + KEY_Pointer_Button2 = C.GDK_KEY_Pointer_Button2 + KEY_Pointer_Button3 = C.GDK_KEY_Pointer_Button3 + KEY_Pointer_Button4 = C.GDK_KEY_Pointer_Button4 + KEY_Pointer_Button5 = C.GDK_KEY_Pointer_Button5 + KEY_Pointer_DblClick_Dflt = C.GDK_KEY_Pointer_DblClick_Dflt + KEY_Pointer_DblClick1 = C.GDK_KEY_Pointer_DblClick1 + KEY_Pointer_DblClick2 = C.GDK_KEY_Pointer_DblClick2 + KEY_Pointer_DblClick3 = C.GDK_KEY_Pointer_DblClick3 + KEY_Pointer_DblClick4 = C.GDK_KEY_Pointer_DblClick4 + KEY_Pointer_DblClick5 = C.GDK_KEY_Pointer_DblClick5 + KEY_Pointer_Drag_Dflt = C.GDK_KEY_Pointer_Drag_Dflt + KEY_Pointer_Drag1 = C.GDK_KEY_Pointer_Drag1 + KEY_Pointer_Drag2 = C.GDK_KEY_Pointer_Drag2 + KEY_Pointer_Drag3 = C.GDK_KEY_Pointer_Drag3 + KEY_Pointer_Drag4 = C.GDK_KEY_Pointer_Drag4 + KEY_Pointer_Drag5 = C.GDK_KEY_Pointer_Drag5 + KEY_Pointer_EnableKeys = C.GDK_KEY_Pointer_EnableKeys + KEY_Pointer_Accelerate = C.GDK_KEY_Pointer_Accelerate + KEY_Pointer_DfltBtnNext = C.GDK_KEY_Pointer_DfltBtnNext + KEY_Pointer_DfltBtnPrev = C.GDK_KEY_Pointer_DfltBtnPrev + KEY_ch = C.GDK_KEY_ch + KEY_Ch = C.GDK_KEY_Ch + KEY_CH = C.GDK_KEY_CH + KEY_c_h = C.GDK_KEY_c_h + KEY_C_h = C.GDK_KEY_C_h + KEY_C_H = C.GDK_KEY_C_H + KEY_3270_Duplicate = C.GDK_KEY_3270_Duplicate + KEY_3270_FieldMark = C.GDK_KEY_3270_FieldMark + KEY_3270_Right2 = C.GDK_KEY_3270_Right2 + KEY_3270_Left2 = C.GDK_KEY_3270_Left2 + KEY_3270_BackTab = C.GDK_KEY_3270_BackTab + KEY_3270_EraseEOF = C.GDK_KEY_3270_EraseEOF + KEY_3270_EraseInput = C.GDK_KEY_3270_EraseInput + KEY_3270_Reset = C.GDK_KEY_3270_Reset + KEY_3270_Quit = C.GDK_KEY_3270_Quit + KEY_3270_PA1 = C.GDK_KEY_3270_PA1 + KEY_3270_PA2 = C.GDK_KEY_3270_PA2 + KEY_3270_PA3 = C.GDK_KEY_3270_PA3 + KEY_3270_Test = C.GDK_KEY_3270_Test + KEY_3270_Attn = C.GDK_KEY_3270_Attn + KEY_3270_CursorBlink = C.GDK_KEY_3270_CursorBlink + KEY_3270_AltCursor = C.GDK_KEY_3270_AltCursor + KEY_3270_KeyClick = C.GDK_KEY_3270_KeyClick + KEY_3270_Jump = C.GDK_KEY_3270_Jump + KEY_3270_Ident = C.GDK_KEY_3270_Ident + KEY_3270_Rule = C.GDK_KEY_3270_Rule + KEY_3270_Copy = C.GDK_KEY_3270_Copy + KEY_3270_Play = C.GDK_KEY_3270_Play + KEY_3270_Setup = C.GDK_KEY_3270_Setup + KEY_3270_Record = C.GDK_KEY_3270_Record + KEY_3270_ChangeScreen = C.GDK_KEY_3270_ChangeScreen + KEY_3270_DeleteWord = C.GDK_KEY_3270_DeleteWord + KEY_3270_ExSelect = C.GDK_KEY_3270_ExSelect + KEY_3270_CursorSelect = C.GDK_KEY_3270_CursorSelect + KEY_3270_PrintScreen = C.GDK_KEY_3270_PrintScreen + KEY_3270_Enter = C.GDK_KEY_3270_Enter + KEY_space = C.GDK_KEY_space + KEY_exclam = C.GDK_KEY_exclam + KEY_quotedbl = C.GDK_KEY_quotedbl + KEY_numbersign = C.GDK_KEY_numbersign + KEY_dollar = C.GDK_KEY_dollar + KEY_percent = C.GDK_KEY_percent + KEY_ampersand = C.GDK_KEY_ampersand + KEY_apostrophe = C.GDK_KEY_apostrophe + KEY_quoteright = C.GDK_KEY_quoteright + KEY_parenleft = C.GDK_KEY_parenleft + KEY_parenright = C.GDK_KEY_parenright + KEY_asterisk = C.GDK_KEY_asterisk + KEY_plus = C.GDK_KEY_plus + KEY_comma = C.GDK_KEY_comma + KEY_minus = C.GDK_KEY_minus + KEY_period = C.GDK_KEY_period + KEY_slash = C.GDK_KEY_slash + KEY_0 = C.GDK_KEY_0 + KEY_1 = C.GDK_KEY_1 + KEY_2 = C.GDK_KEY_2 + KEY_3 = C.GDK_KEY_3 + KEY_4 = C.GDK_KEY_4 + KEY_5 = C.GDK_KEY_5 + KEY_6 = C.GDK_KEY_6 + KEY_7 = C.GDK_KEY_7 + KEY_8 = C.GDK_KEY_8 + KEY_9 = C.GDK_KEY_9 + KEY_colon = C.GDK_KEY_colon + KEY_semicolon = C.GDK_KEY_semicolon + KEY_less = C.GDK_KEY_less + KEY_equal = C.GDK_KEY_equal + KEY_greater = C.GDK_KEY_greater + KEY_question = C.GDK_KEY_question + KEY_at = C.GDK_KEY_at + KEY_A = C.GDK_KEY_A + KEY_B = C.GDK_KEY_B + KEY_C = C.GDK_KEY_C + KEY_D = C.GDK_KEY_D + KEY_E = C.GDK_KEY_E + KEY_F = C.GDK_KEY_F + KEY_G = C.GDK_KEY_G + KEY_H = C.GDK_KEY_H + KEY_I = C.GDK_KEY_I + KEY_J = C.GDK_KEY_J + KEY_K = C.GDK_KEY_K + KEY_L = C.GDK_KEY_L + KEY_M = C.GDK_KEY_M + KEY_N = C.GDK_KEY_N + KEY_O = C.GDK_KEY_O + KEY_P = C.GDK_KEY_P + KEY_Q = C.GDK_KEY_Q + KEY_R = C.GDK_KEY_R + KEY_S = C.GDK_KEY_S + KEY_T = C.GDK_KEY_T + KEY_U = C.GDK_KEY_U + KEY_V = C.GDK_KEY_V + KEY_W = C.GDK_KEY_W + KEY_X = C.GDK_KEY_X + KEY_Y = C.GDK_KEY_Y + KEY_Z = C.GDK_KEY_Z + KEY_bracketleft = C.GDK_KEY_bracketleft + KEY_backslash = C.GDK_KEY_backslash + KEY_bracketright = C.GDK_KEY_bracketright + KEY_asciicircum = C.GDK_KEY_asciicircum + KEY_underscore = C.GDK_KEY_underscore + KEY_grave = C.GDK_KEY_grave + KEY_quoteleft = C.GDK_KEY_quoteleft + KEY_a = C.GDK_KEY_a + KEY_b = C.GDK_KEY_b + KEY_c = C.GDK_KEY_c + KEY_d = C.GDK_KEY_d + KEY_e = C.GDK_KEY_e + KEY_f = C.GDK_KEY_f + KEY_g = C.GDK_KEY_g + KEY_h = C.GDK_KEY_h + KEY_i = C.GDK_KEY_i + KEY_j = C.GDK_KEY_j + KEY_k = C.GDK_KEY_k + KEY_l = C.GDK_KEY_l + KEY_m = C.GDK_KEY_m + KEY_n = C.GDK_KEY_n + KEY_o = C.GDK_KEY_o + KEY_p = C.GDK_KEY_p + KEY_q = C.GDK_KEY_q + KEY_r = C.GDK_KEY_r + KEY_s = C.GDK_KEY_s + KEY_t = C.GDK_KEY_t + KEY_u = C.GDK_KEY_u + KEY_v = C.GDK_KEY_v + KEY_w = C.GDK_KEY_w + KEY_x = C.GDK_KEY_x + KEY_y = C.GDK_KEY_y + KEY_z = C.GDK_KEY_z + KEY_braceleft = C.GDK_KEY_braceleft + KEY_bar = C.GDK_KEY_bar + KEY_braceright = C.GDK_KEY_braceright + KEY_asciitilde = C.GDK_KEY_asciitilde + KEY_nobreakspace = C.GDK_KEY_nobreakspace + KEY_exclamdown = C.GDK_KEY_exclamdown + KEY_cent = C.GDK_KEY_cent + KEY_sterling = C.GDK_KEY_sterling + KEY_currency = C.GDK_KEY_currency + KEY_yen = C.GDK_KEY_yen + KEY_brokenbar = C.GDK_KEY_brokenbar + KEY_section = C.GDK_KEY_section + KEY_diaeresis = C.GDK_KEY_diaeresis + KEY_copyright = C.GDK_KEY_copyright + KEY_ordfeminine = C.GDK_KEY_ordfeminine + KEY_guillemotleft = C.GDK_KEY_guillemotleft + KEY_notsign = C.GDK_KEY_notsign + KEY_hyphen = C.GDK_KEY_hyphen + KEY_registered = C.GDK_KEY_registered + KEY_macron = C.GDK_KEY_macron + KEY_degree = C.GDK_KEY_degree + KEY_plusminus = C.GDK_KEY_plusminus + KEY_twosuperior = C.GDK_KEY_twosuperior + KEY_threesuperior = C.GDK_KEY_threesuperior + KEY_acute = C.GDK_KEY_acute + KEY_mu = C.GDK_KEY_mu + KEY_paragraph = C.GDK_KEY_paragraph + KEY_periodcentered = C.GDK_KEY_periodcentered + KEY_cedilla = C.GDK_KEY_cedilla + KEY_onesuperior = C.GDK_KEY_onesuperior + KEY_masculine = C.GDK_KEY_masculine + KEY_guillemotright = C.GDK_KEY_guillemotright + KEY_onequarter = C.GDK_KEY_onequarter + KEY_onehalf = C.GDK_KEY_onehalf + KEY_threequarters = C.GDK_KEY_threequarters + KEY_questiondown = C.GDK_KEY_questiondown + KEY_Agrave = C.GDK_KEY_Agrave + KEY_Aacute = C.GDK_KEY_Aacute + KEY_Acircumflex = C.GDK_KEY_Acircumflex + KEY_Atilde = C.GDK_KEY_Atilde + KEY_Adiaeresis = C.GDK_KEY_Adiaeresis + KEY_Aring = C.GDK_KEY_Aring + KEY_AE = C.GDK_KEY_AE + KEY_Ccedilla = C.GDK_KEY_Ccedilla + KEY_Egrave = C.GDK_KEY_Egrave + KEY_Eacute = C.GDK_KEY_Eacute + KEY_Ecircumflex = C.GDK_KEY_Ecircumflex + KEY_Ediaeresis = C.GDK_KEY_Ediaeresis + KEY_Igrave = C.GDK_KEY_Igrave + KEY_Iacute = C.GDK_KEY_Iacute + KEY_Icircumflex = C.GDK_KEY_Icircumflex + KEY_Idiaeresis = C.GDK_KEY_Idiaeresis + KEY_ETH = C.GDK_KEY_ETH + KEY_Eth = C.GDK_KEY_Eth + KEY_Ntilde = C.GDK_KEY_Ntilde + KEY_Ograve = C.GDK_KEY_Ograve + KEY_Oacute = C.GDK_KEY_Oacute + KEY_Ocircumflex = C.GDK_KEY_Ocircumflex + KEY_Otilde = C.GDK_KEY_Otilde + KEY_Odiaeresis = C.GDK_KEY_Odiaeresis + KEY_multiply = C.GDK_KEY_multiply + KEY_Oslash = C.GDK_KEY_Oslash + KEY_Ooblique = C.GDK_KEY_Ooblique + KEY_Ugrave = C.GDK_KEY_Ugrave + KEY_Uacute = C.GDK_KEY_Uacute + KEY_Ucircumflex = C.GDK_KEY_Ucircumflex + KEY_Udiaeresis = C.GDK_KEY_Udiaeresis + KEY_Yacute = C.GDK_KEY_Yacute + KEY_THORN = C.GDK_KEY_THORN + KEY_Thorn = C.GDK_KEY_Thorn + KEY_ssharp = C.GDK_KEY_ssharp + KEY_agrave = C.GDK_KEY_agrave + KEY_aacute = C.GDK_KEY_aacute + KEY_acircumflex = C.GDK_KEY_acircumflex + KEY_atilde = C.GDK_KEY_atilde + KEY_adiaeresis = C.GDK_KEY_adiaeresis + KEY_aring = C.GDK_KEY_aring + KEY_ae = C.GDK_KEY_ae + KEY_ccedilla = C.GDK_KEY_ccedilla + KEY_egrave = C.GDK_KEY_egrave + KEY_eacute = C.GDK_KEY_eacute + KEY_ecircumflex = C.GDK_KEY_ecircumflex + KEY_ediaeresis = C.GDK_KEY_ediaeresis + KEY_igrave = C.GDK_KEY_igrave + KEY_iacute = C.GDK_KEY_iacute + KEY_icircumflex = C.GDK_KEY_icircumflex + KEY_idiaeresis = C.GDK_KEY_idiaeresis + KEY_eth = C.GDK_KEY_eth + KEY_ntilde = C.GDK_KEY_ntilde + KEY_ograve = C.GDK_KEY_ograve + KEY_oacute = C.GDK_KEY_oacute + KEY_ocircumflex = C.GDK_KEY_ocircumflex + KEY_otilde = C.GDK_KEY_otilde + KEY_odiaeresis = C.GDK_KEY_odiaeresis + KEY_division = C.GDK_KEY_division + KEY_oslash = C.GDK_KEY_oslash + KEY_ooblique = C.GDK_KEY_ooblique + KEY_ugrave = C.GDK_KEY_ugrave + KEY_uacute = C.GDK_KEY_uacute + KEY_ucircumflex = C.GDK_KEY_ucircumflex + KEY_udiaeresis = C.GDK_KEY_udiaeresis + KEY_yacute = C.GDK_KEY_yacute + KEY_thorn = C.GDK_KEY_thorn + KEY_ydiaeresis = C.GDK_KEY_ydiaeresis + KEY_Aogonek = C.GDK_KEY_Aogonek + KEY_breve = C.GDK_KEY_breve + KEY_Lstroke = C.GDK_KEY_Lstroke + KEY_Lcaron = C.GDK_KEY_Lcaron + KEY_Sacute = C.GDK_KEY_Sacute + KEY_Scaron = C.GDK_KEY_Scaron + KEY_Scedilla = C.GDK_KEY_Scedilla + KEY_Tcaron = C.GDK_KEY_Tcaron + KEY_Zacute = C.GDK_KEY_Zacute + KEY_Zcaron = C.GDK_KEY_Zcaron + KEY_Zabovedot = C.GDK_KEY_Zabovedot + KEY_aogonek = C.GDK_KEY_aogonek + KEY_ogonek = C.GDK_KEY_ogonek + KEY_lstroke = C.GDK_KEY_lstroke + KEY_lcaron = C.GDK_KEY_lcaron + KEY_sacute = C.GDK_KEY_sacute + KEY_caron = C.GDK_KEY_caron + KEY_scaron = C.GDK_KEY_scaron + KEY_scedilla = C.GDK_KEY_scedilla + KEY_tcaron = C.GDK_KEY_tcaron + KEY_zacute = C.GDK_KEY_zacute + KEY_doubleacute = C.GDK_KEY_doubleacute + KEY_zcaron = C.GDK_KEY_zcaron + KEY_zabovedot = C.GDK_KEY_zabovedot + KEY_Racute = C.GDK_KEY_Racute + KEY_Abreve = C.GDK_KEY_Abreve + KEY_Lacute = C.GDK_KEY_Lacute + KEY_Cacute = C.GDK_KEY_Cacute + KEY_Ccaron = C.GDK_KEY_Ccaron + KEY_Eogonek = C.GDK_KEY_Eogonek + KEY_Ecaron = C.GDK_KEY_Ecaron + KEY_Dcaron = C.GDK_KEY_Dcaron + KEY_Dstroke = C.GDK_KEY_Dstroke + KEY_Nacute = C.GDK_KEY_Nacute + KEY_Ncaron = C.GDK_KEY_Ncaron + KEY_Odoubleacute = C.GDK_KEY_Odoubleacute + KEY_Rcaron = C.GDK_KEY_Rcaron + KEY_Uring = C.GDK_KEY_Uring + KEY_Udoubleacute = C.GDK_KEY_Udoubleacute + KEY_Tcedilla = C.GDK_KEY_Tcedilla + KEY_racute = C.GDK_KEY_racute + KEY_abreve = C.GDK_KEY_abreve + KEY_lacute = C.GDK_KEY_lacute + KEY_cacute = C.GDK_KEY_cacute + KEY_ccaron = C.GDK_KEY_ccaron + KEY_eogonek = C.GDK_KEY_eogonek + KEY_ecaron = C.GDK_KEY_ecaron + KEY_dcaron = C.GDK_KEY_dcaron + KEY_dstroke = C.GDK_KEY_dstroke + KEY_nacute = C.GDK_KEY_nacute + KEY_ncaron = C.GDK_KEY_ncaron + KEY_odoubleacute = C.GDK_KEY_odoubleacute + KEY_rcaron = C.GDK_KEY_rcaron + KEY_uring = C.GDK_KEY_uring + KEY_udoubleacute = C.GDK_KEY_udoubleacute + KEY_tcedilla = C.GDK_KEY_tcedilla + KEY_abovedot = C.GDK_KEY_abovedot + KEY_Hstroke = C.GDK_KEY_Hstroke + KEY_Hcircumflex = C.GDK_KEY_Hcircumflex + KEY_Iabovedot = C.GDK_KEY_Iabovedot + KEY_Gbreve = C.GDK_KEY_Gbreve + KEY_Jcircumflex = C.GDK_KEY_Jcircumflex + KEY_hstroke = C.GDK_KEY_hstroke + KEY_hcircumflex = C.GDK_KEY_hcircumflex + KEY_idotless = C.GDK_KEY_idotless + KEY_gbreve = C.GDK_KEY_gbreve + KEY_jcircumflex = C.GDK_KEY_jcircumflex + KEY_Cabovedot = C.GDK_KEY_Cabovedot + KEY_Ccircumflex = C.GDK_KEY_Ccircumflex + KEY_Gabovedot = C.GDK_KEY_Gabovedot + KEY_Gcircumflex = C.GDK_KEY_Gcircumflex + KEY_Ubreve = C.GDK_KEY_Ubreve + KEY_Scircumflex = C.GDK_KEY_Scircumflex + KEY_cabovedot = C.GDK_KEY_cabovedot + KEY_ccircumflex = C.GDK_KEY_ccircumflex + KEY_gabovedot = C.GDK_KEY_gabovedot + KEY_gcircumflex = C.GDK_KEY_gcircumflex + KEY_ubreve = C.GDK_KEY_ubreve + KEY_scircumflex = C.GDK_KEY_scircumflex + KEY_kra = C.GDK_KEY_kra + KEY_kappa = C.GDK_KEY_kappa + KEY_Rcedilla = C.GDK_KEY_Rcedilla + KEY_Itilde = C.GDK_KEY_Itilde + KEY_Lcedilla = C.GDK_KEY_Lcedilla + KEY_Emacron = C.GDK_KEY_Emacron + KEY_Gcedilla = C.GDK_KEY_Gcedilla + KEY_Tslash = C.GDK_KEY_Tslash + KEY_rcedilla = C.GDK_KEY_rcedilla + KEY_itilde = C.GDK_KEY_itilde + KEY_lcedilla = C.GDK_KEY_lcedilla + KEY_emacron = C.GDK_KEY_emacron + KEY_gcedilla = C.GDK_KEY_gcedilla + KEY_tslash = C.GDK_KEY_tslash + KEY_ENG = C.GDK_KEY_ENG + KEY_eng = C.GDK_KEY_eng + KEY_Amacron = C.GDK_KEY_Amacron + KEY_Iogonek = C.GDK_KEY_Iogonek + KEY_Eabovedot = C.GDK_KEY_Eabovedot + KEY_Imacron = C.GDK_KEY_Imacron + KEY_Ncedilla = C.GDK_KEY_Ncedilla + KEY_Omacron = C.GDK_KEY_Omacron + KEY_Kcedilla = C.GDK_KEY_Kcedilla + KEY_Uogonek = C.GDK_KEY_Uogonek + KEY_Utilde = C.GDK_KEY_Utilde + KEY_Umacron = C.GDK_KEY_Umacron + KEY_amacron = C.GDK_KEY_amacron + KEY_iogonek = C.GDK_KEY_iogonek + KEY_eabovedot = C.GDK_KEY_eabovedot + KEY_imacron = C.GDK_KEY_imacron + KEY_ncedilla = C.GDK_KEY_ncedilla + KEY_omacron = C.GDK_KEY_omacron + KEY_kcedilla = C.GDK_KEY_kcedilla + KEY_uogonek = C.GDK_KEY_uogonek + KEY_utilde = C.GDK_KEY_utilde + KEY_umacron = C.GDK_KEY_umacron + KEY_Wcircumflex = C.GDK_KEY_Wcircumflex + KEY_wcircumflex = C.GDK_KEY_wcircumflex + KEY_Ycircumflex = C.GDK_KEY_Ycircumflex + KEY_ycircumflex = C.GDK_KEY_ycircumflex + KEY_Babovedot = C.GDK_KEY_Babovedot + KEY_babovedot = C.GDK_KEY_babovedot + KEY_Dabovedot = C.GDK_KEY_Dabovedot + KEY_dabovedot = C.GDK_KEY_dabovedot + KEY_Fabovedot = C.GDK_KEY_Fabovedot + KEY_fabovedot = C.GDK_KEY_fabovedot + KEY_Mabovedot = C.GDK_KEY_Mabovedot + KEY_mabovedot = C.GDK_KEY_mabovedot + KEY_Pabovedot = C.GDK_KEY_Pabovedot + KEY_pabovedot = C.GDK_KEY_pabovedot + KEY_Sabovedot = C.GDK_KEY_Sabovedot + KEY_sabovedot = C.GDK_KEY_sabovedot + KEY_Tabovedot = C.GDK_KEY_Tabovedot + KEY_tabovedot = C.GDK_KEY_tabovedot + KEY_Wgrave = C.GDK_KEY_Wgrave + KEY_wgrave = C.GDK_KEY_wgrave + KEY_Wacute = C.GDK_KEY_Wacute + KEY_wacute = C.GDK_KEY_wacute + KEY_Wdiaeresis = C.GDK_KEY_Wdiaeresis + KEY_wdiaeresis = C.GDK_KEY_wdiaeresis + KEY_Ygrave = C.GDK_KEY_Ygrave + KEY_ygrave = C.GDK_KEY_ygrave + KEY_OE = C.GDK_KEY_OE + KEY_oe = C.GDK_KEY_oe + KEY_Ydiaeresis = C.GDK_KEY_Ydiaeresis + KEY_overline = C.GDK_KEY_overline + KEY_kana_fullstop = C.GDK_KEY_kana_fullstop + KEY_kana_openingbracket = C.GDK_KEY_kana_openingbracket + KEY_kana_closingbracket = C.GDK_KEY_kana_closingbracket + KEY_kana_comma = C.GDK_KEY_kana_comma + KEY_kana_conjunctive = C.GDK_KEY_kana_conjunctive + KEY_kana_middledot = C.GDK_KEY_kana_middledot + KEY_kana_WO = C.GDK_KEY_kana_WO + KEY_kana_a = C.GDK_KEY_kana_a + KEY_kana_i = C.GDK_KEY_kana_i + KEY_kana_u = C.GDK_KEY_kana_u + KEY_kana_e = C.GDK_KEY_kana_e + KEY_kana_o = C.GDK_KEY_kana_o + KEY_kana_ya = C.GDK_KEY_kana_ya + KEY_kana_yu = C.GDK_KEY_kana_yu + KEY_kana_yo = C.GDK_KEY_kana_yo + KEY_kana_tsu = C.GDK_KEY_kana_tsu + KEY_kana_tu = C.GDK_KEY_kana_tu + KEY_prolongedsound = C.GDK_KEY_prolongedsound + KEY_kana_A = C.GDK_KEY_kana_A + KEY_kana_I = C.GDK_KEY_kana_I + KEY_kana_U = C.GDK_KEY_kana_U + KEY_kana_E = C.GDK_KEY_kana_E + KEY_kana_O = C.GDK_KEY_kana_O + KEY_kana_KA = C.GDK_KEY_kana_KA + KEY_kana_KI = C.GDK_KEY_kana_KI + KEY_kana_KU = C.GDK_KEY_kana_KU + KEY_kana_KE = C.GDK_KEY_kana_KE + KEY_kana_KO = C.GDK_KEY_kana_KO + KEY_kana_SA = C.GDK_KEY_kana_SA + KEY_kana_SHI = C.GDK_KEY_kana_SHI + KEY_kana_SU = C.GDK_KEY_kana_SU + KEY_kana_SE = C.GDK_KEY_kana_SE + KEY_kana_SO = C.GDK_KEY_kana_SO + KEY_kana_TA = C.GDK_KEY_kana_TA + KEY_kana_CHI = C.GDK_KEY_kana_CHI + KEY_kana_TI = C.GDK_KEY_kana_TI + KEY_kana_TSU = C.GDK_KEY_kana_TSU + KEY_kana_TU = C.GDK_KEY_kana_TU + KEY_kana_TE = C.GDK_KEY_kana_TE + KEY_kana_TO = C.GDK_KEY_kana_TO + KEY_kana_NA = C.GDK_KEY_kana_NA + KEY_kana_NI = C.GDK_KEY_kana_NI + KEY_kana_NU = C.GDK_KEY_kana_NU + KEY_kana_NE = C.GDK_KEY_kana_NE + KEY_kana_NO = C.GDK_KEY_kana_NO + KEY_kana_HA = C.GDK_KEY_kana_HA + KEY_kana_HI = C.GDK_KEY_kana_HI + KEY_kana_FU = C.GDK_KEY_kana_FU + KEY_kana_HU = C.GDK_KEY_kana_HU + KEY_kana_HE = C.GDK_KEY_kana_HE + KEY_kana_HO = C.GDK_KEY_kana_HO + KEY_kana_MA = C.GDK_KEY_kana_MA + KEY_kana_MI = C.GDK_KEY_kana_MI + KEY_kana_MU = C.GDK_KEY_kana_MU + KEY_kana_ME = C.GDK_KEY_kana_ME + KEY_kana_MO = C.GDK_KEY_kana_MO + KEY_kana_YA = C.GDK_KEY_kana_YA + KEY_kana_YU = C.GDK_KEY_kana_YU + KEY_kana_YO = C.GDK_KEY_kana_YO + KEY_kana_RA = C.GDK_KEY_kana_RA + KEY_kana_RI = C.GDK_KEY_kana_RI + KEY_kana_RU = C.GDK_KEY_kana_RU + KEY_kana_RE = C.GDK_KEY_kana_RE + KEY_kana_RO = C.GDK_KEY_kana_RO + KEY_kana_WA = C.GDK_KEY_kana_WA + KEY_kana_N = C.GDK_KEY_kana_N + KEY_voicedsound = C.GDK_KEY_voicedsound + KEY_semivoicedsound = C.GDK_KEY_semivoicedsound + KEY_kana_switch = C.GDK_KEY_kana_switch + KEY_Farsi_0 = C.GDK_KEY_Farsi_0 + KEY_Farsi_1 = C.GDK_KEY_Farsi_1 + KEY_Farsi_2 = C.GDK_KEY_Farsi_2 + KEY_Farsi_3 = C.GDK_KEY_Farsi_3 + KEY_Farsi_4 = C.GDK_KEY_Farsi_4 + KEY_Farsi_5 = C.GDK_KEY_Farsi_5 + KEY_Farsi_6 = C.GDK_KEY_Farsi_6 + KEY_Farsi_7 = C.GDK_KEY_Farsi_7 + KEY_Farsi_8 = C.GDK_KEY_Farsi_8 + KEY_Farsi_9 = C.GDK_KEY_Farsi_9 + KEY_Arabic_percent = C.GDK_KEY_Arabic_percent + KEY_Arabic_superscript_alef = C.GDK_KEY_Arabic_superscript_alef + KEY_Arabic_tteh = C.GDK_KEY_Arabic_tteh + KEY_Arabic_peh = C.GDK_KEY_Arabic_peh + KEY_Arabic_tcheh = C.GDK_KEY_Arabic_tcheh + KEY_Arabic_ddal = C.GDK_KEY_Arabic_ddal + KEY_Arabic_rreh = C.GDK_KEY_Arabic_rreh + KEY_Arabic_comma = C.GDK_KEY_Arabic_comma + KEY_Arabic_fullstop = C.GDK_KEY_Arabic_fullstop + KEY_Arabic_0 = C.GDK_KEY_Arabic_0 + KEY_Arabic_1 = C.GDK_KEY_Arabic_1 + KEY_Arabic_2 = C.GDK_KEY_Arabic_2 + KEY_Arabic_3 = C.GDK_KEY_Arabic_3 + KEY_Arabic_4 = C.GDK_KEY_Arabic_4 + KEY_Arabic_5 = C.GDK_KEY_Arabic_5 + KEY_Arabic_6 = C.GDK_KEY_Arabic_6 + KEY_Arabic_7 = C.GDK_KEY_Arabic_7 + KEY_Arabic_8 = C.GDK_KEY_Arabic_8 + KEY_Arabic_9 = C.GDK_KEY_Arabic_9 + KEY_Arabic_semicolon = C.GDK_KEY_Arabic_semicolon + KEY_Arabic_question_mark = C.GDK_KEY_Arabic_question_mark + KEY_Arabic_hamza = C.GDK_KEY_Arabic_hamza + KEY_Arabic_maddaonalef = C.GDK_KEY_Arabic_maddaonalef + KEY_Arabic_hamzaonalef = C.GDK_KEY_Arabic_hamzaonalef + KEY_Arabic_hamzaonwaw = C.GDK_KEY_Arabic_hamzaonwaw + KEY_Arabic_hamzaunderalef = C.GDK_KEY_Arabic_hamzaunderalef + KEY_Arabic_hamzaonyeh = C.GDK_KEY_Arabic_hamzaonyeh + KEY_Arabic_alef = C.GDK_KEY_Arabic_alef + KEY_Arabic_beh = C.GDK_KEY_Arabic_beh + KEY_Arabic_tehmarbuta = C.GDK_KEY_Arabic_tehmarbuta + KEY_Arabic_teh = C.GDK_KEY_Arabic_teh + KEY_Arabic_theh = C.GDK_KEY_Arabic_theh + KEY_Arabic_jeem = C.GDK_KEY_Arabic_jeem + KEY_Arabic_hah = C.GDK_KEY_Arabic_hah + KEY_Arabic_khah = C.GDK_KEY_Arabic_khah + KEY_Arabic_dal = C.GDK_KEY_Arabic_dal + KEY_Arabic_thal = C.GDK_KEY_Arabic_thal + KEY_Arabic_ra = C.GDK_KEY_Arabic_ra + KEY_Arabic_zain = C.GDK_KEY_Arabic_zain + KEY_Arabic_seen = C.GDK_KEY_Arabic_seen + KEY_Arabic_sheen = C.GDK_KEY_Arabic_sheen + KEY_Arabic_sad = C.GDK_KEY_Arabic_sad + KEY_Arabic_dad = C.GDK_KEY_Arabic_dad + KEY_Arabic_tah = C.GDK_KEY_Arabic_tah + KEY_Arabic_zah = C.GDK_KEY_Arabic_zah + KEY_Arabic_ain = C.GDK_KEY_Arabic_ain + KEY_Arabic_ghain = C.GDK_KEY_Arabic_ghain + KEY_Arabic_tatweel = C.GDK_KEY_Arabic_tatweel + KEY_Arabic_feh = C.GDK_KEY_Arabic_feh + KEY_Arabic_qaf = C.GDK_KEY_Arabic_qaf + KEY_Arabic_kaf = C.GDK_KEY_Arabic_kaf + KEY_Arabic_lam = C.GDK_KEY_Arabic_lam + KEY_Arabic_meem = C.GDK_KEY_Arabic_meem + KEY_Arabic_noon = C.GDK_KEY_Arabic_noon + KEY_Arabic_ha = C.GDK_KEY_Arabic_ha + KEY_Arabic_heh = C.GDK_KEY_Arabic_heh + KEY_Arabic_waw = C.GDK_KEY_Arabic_waw + KEY_Arabic_alefmaksura = C.GDK_KEY_Arabic_alefmaksura + KEY_Arabic_yeh = C.GDK_KEY_Arabic_yeh + KEY_Arabic_fathatan = C.GDK_KEY_Arabic_fathatan + KEY_Arabic_dammatan = C.GDK_KEY_Arabic_dammatan + KEY_Arabic_kasratan = C.GDK_KEY_Arabic_kasratan + KEY_Arabic_fatha = C.GDK_KEY_Arabic_fatha + KEY_Arabic_damma = C.GDK_KEY_Arabic_damma + KEY_Arabic_kasra = C.GDK_KEY_Arabic_kasra + KEY_Arabic_shadda = C.GDK_KEY_Arabic_shadda + KEY_Arabic_sukun = C.GDK_KEY_Arabic_sukun + KEY_Arabic_madda_above = C.GDK_KEY_Arabic_madda_above + KEY_Arabic_hamza_above = C.GDK_KEY_Arabic_hamza_above + KEY_Arabic_hamza_below = C.GDK_KEY_Arabic_hamza_below + KEY_Arabic_jeh = C.GDK_KEY_Arabic_jeh + KEY_Arabic_veh = C.GDK_KEY_Arabic_veh + KEY_Arabic_keheh = C.GDK_KEY_Arabic_keheh + KEY_Arabic_gaf = C.GDK_KEY_Arabic_gaf + KEY_Arabic_noon_ghunna = C.GDK_KEY_Arabic_noon_ghunna + KEY_Arabic_heh_doachashmee = C.GDK_KEY_Arabic_heh_doachashmee + KEY_Farsi_yeh = C.GDK_KEY_Farsi_yeh + KEY_Arabic_farsi_yeh = C.GDK_KEY_Arabic_farsi_yeh + KEY_Arabic_yeh_baree = C.GDK_KEY_Arabic_yeh_baree + KEY_Arabic_heh_goal = C.GDK_KEY_Arabic_heh_goal + KEY_Arabic_switch = C.GDK_KEY_Arabic_switch + KEY_Cyrillic_GHE_bar = C.GDK_KEY_Cyrillic_GHE_bar + KEY_Cyrillic_ghe_bar = C.GDK_KEY_Cyrillic_ghe_bar + KEY_Cyrillic_ZHE_descender = C.GDK_KEY_Cyrillic_ZHE_descender + KEY_Cyrillic_zhe_descender = C.GDK_KEY_Cyrillic_zhe_descender + KEY_Cyrillic_KA_descender = C.GDK_KEY_Cyrillic_KA_descender + KEY_Cyrillic_ka_descender = C.GDK_KEY_Cyrillic_ka_descender + KEY_Cyrillic_KA_vertstroke = C.GDK_KEY_Cyrillic_KA_vertstroke + KEY_Cyrillic_ka_vertstroke = C.GDK_KEY_Cyrillic_ka_vertstroke + KEY_Cyrillic_EN_descender = C.GDK_KEY_Cyrillic_EN_descender + KEY_Cyrillic_en_descender = C.GDK_KEY_Cyrillic_en_descender + KEY_Cyrillic_U_straight = C.GDK_KEY_Cyrillic_U_straight + KEY_Cyrillic_u_straight = C.GDK_KEY_Cyrillic_u_straight + KEY_Cyrillic_U_straight_bar = C.GDK_KEY_Cyrillic_U_straight_bar + KEY_Cyrillic_u_straight_bar = C.GDK_KEY_Cyrillic_u_straight_bar + KEY_Cyrillic_HA_descender = C.GDK_KEY_Cyrillic_HA_descender + KEY_Cyrillic_ha_descender = C.GDK_KEY_Cyrillic_ha_descender + KEY_Cyrillic_CHE_descender = C.GDK_KEY_Cyrillic_CHE_descender + KEY_Cyrillic_che_descender = C.GDK_KEY_Cyrillic_che_descender + KEY_Cyrillic_CHE_vertstroke = C.GDK_KEY_Cyrillic_CHE_vertstroke + KEY_Cyrillic_che_vertstroke = C.GDK_KEY_Cyrillic_che_vertstroke + KEY_Cyrillic_SHHA = C.GDK_KEY_Cyrillic_SHHA + KEY_Cyrillic_shha = C.GDK_KEY_Cyrillic_shha + KEY_Cyrillic_SCHWA = C.GDK_KEY_Cyrillic_SCHWA + KEY_Cyrillic_schwa = C.GDK_KEY_Cyrillic_schwa + KEY_Cyrillic_I_macron = C.GDK_KEY_Cyrillic_I_macron + KEY_Cyrillic_i_macron = C.GDK_KEY_Cyrillic_i_macron + KEY_Cyrillic_O_bar = C.GDK_KEY_Cyrillic_O_bar + KEY_Cyrillic_o_bar = C.GDK_KEY_Cyrillic_o_bar + KEY_Cyrillic_U_macron = C.GDK_KEY_Cyrillic_U_macron + KEY_Cyrillic_u_macron = C.GDK_KEY_Cyrillic_u_macron + KEY_Serbian_dje = C.GDK_KEY_Serbian_dje + KEY_Macedonia_gje = C.GDK_KEY_Macedonia_gje + KEY_Cyrillic_io = C.GDK_KEY_Cyrillic_io + KEY_Ukrainian_ie = C.GDK_KEY_Ukrainian_ie + KEY_Ukranian_je = C.GDK_KEY_Ukranian_je + KEY_Macedonia_dse = C.GDK_KEY_Macedonia_dse + KEY_Ukrainian_i = C.GDK_KEY_Ukrainian_i + KEY_Ukranian_i = C.GDK_KEY_Ukranian_i + KEY_Ukrainian_yi = C.GDK_KEY_Ukrainian_yi + KEY_Ukranian_yi = C.GDK_KEY_Ukranian_yi + KEY_Cyrillic_je = C.GDK_KEY_Cyrillic_je + KEY_Serbian_je = C.GDK_KEY_Serbian_je + KEY_Cyrillic_lje = C.GDK_KEY_Cyrillic_lje + KEY_Serbian_lje = C.GDK_KEY_Serbian_lje + KEY_Cyrillic_nje = C.GDK_KEY_Cyrillic_nje + KEY_Serbian_nje = C.GDK_KEY_Serbian_nje + KEY_Serbian_tshe = C.GDK_KEY_Serbian_tshe + KEY_Macedonia_kje = C.GDK_KEY_Macedonia_kje + KEY_Ukrainian_ghe_with_upturn = C.GDK_KEY_Ukrainian_ghe_with_upturn + KEY_Byelorussian_shortu = C.GDK_KEY_Byelorussian_shortu + KEY_Cyrillic_dzhe = C.GDK_KEY_Cyrillic_dzhe + KEY_Serbian_dze = C.GDK_KEY_Serbian_dze + KEY_numerosign = C.GDK_KEY_numerosign + KEY_Serbian_DJE = C.GDK_KEY_Serbian_DJE + KEY_Macedonia_GJE = C.GDK_KEY_Macedonia_GJE + KEY_Cyrillic_IO = C.GDK_KEY_Cyrillic_IO + KEY_Ukrainian_IE = C.GDK_KEY_Ukrainian_IE + KEY_Ukranian_JE = C.GDK_KEY_Ukranian_JE + KEY_Macedonia_DSE = C.GDK_KEY_Macedonia_DSE + KEY_Ukrainian_I = C.GDK_KEY_Ukrainian_I + KEY_Ukranian_I = C.GDK_KEY_Ukranian_I + KEY_Ukrainian_YI = C.GDK_KEY_Ukrainian_YI + KEY_Ukranian_YI = C.GDK_KEY_Ukranian_YI + KEY_Cyrillic_JE = C.GDK_KEY_Cyrillic_JE + KEY_Serbian_JE = C.GDK_KEY_Serbian_JE + KEY_Cyrillic_LJE = C.GDK_KEY_Cyrillic_LJE + KEY_Serbian_LJE = C.GDK_KEY_Serbian_LJE + KEY_Cyrillic_NJE = C.GDK_KEY_Cyrillic_NJE + KEY_Serbian_NJE = C.GDK_KEY_Serbian_NJE + KEY_Serbian_TSHE = C.GDK_KEY_Serbian_TSHE + KEY_Macedonia_KJE = C.GDK_KEY_Macedonia_KJE + KEY_Ukrainian_GHE_WITH_UPTURN = C.GDK_KEY_Ukrainian_GHE_WITH_UPTURN + KEY_Byelorussian_SHORTU = C.GDK_KEY_Byelorussian_SHORTU + KEY_Cyrillic_DZHE = C.GDK_KEY_Cyrillic_DZHE + KEY_Serbian_DZE = C.GDK_KEY_Serbian_DZE + KEY_Cyrillic_yu = C.GDK_KEY_Cyrillic_yu + KEY_Cyrillic_a = C.GDK_KEY_Cyrillic_a + KEY_Cyrillic_be = C.GDK_KEY_Cyrillic_be + KEY_Cyrillic_tse = C.GDK_KEY_Cyrillic_tse + KEY_Cyrillic_de = C.GDK_KEY_Cyrillic_de + KEY_Cyrillic_ie = C.GDK_KEY_Cyrillic_ie + KEY_Cyrillic_ef = C.GDK_KEY_Cyrillic_ef + KEY_Cyrillic_ghe = C.GDK_KEY_Cyrillic_ghe + KEY_Cyrillic_ha = C.GDK_KEY_Cyrillic_ha + KEY_Cyrillic_i = C.GDK_KEY_Cyrillic_i + KEY_Cyrillic_shorti = C.GDK_KEY_Cyrillic_shorti + KEY_Cyrillic_ka = C.GDK_KEY_Cyrillic_ka + KEY_Cyrillic_el = C.GDK_KEY_Cyrillic_el + KEY_Cyrillic_em = C.GDK_KEY_Cyrillic_em + KEY_Cyrillic_en = C.GDK_KEY_Cyrillic_en + KEY_Cyrillic_o = C.GDK_KEY_Cyrillic_o + KEY_Cyrillic_pe = C.GDK_KEY_Cyrillic_pe + KEY_Cyrillic_ya = C.GDK_KEY_Cyrillic_ya + KEY_Cyrillic_er = C.GDK_KEY_Cyrillic_er + KEY_Cyrillic_es = C.GDK_KEY_Cyrillic_es + KEY_Cyrillic_te = C.GDK_KEY_Cyrillic_te + KEY_Cyrillic_u = C.GDK_KEY_Cyrillic_u + KEY_Cyrillic_zhe = C.GDK_KEY_Cyrillic_zhe + KEY_Cyrillic_ve = C.GDK_KEY_Cyrillic_ve + KEY_Cyrillic_softsign = C.GDK_KEY_Cyrillic_softsign + KEY_Cyrillic_yeru = C.GDK_KEY_Cyrillic_yeru + KEY_Cyrillic_ze = C.GDK_KEY_Cyrillic_ze + KEY_Cyrillic_sha = C.GDK_KEY_Cyrillic_sha + KEY_Cyrillic_e = C.GDK_KEY_Cyrillic_e + KEY_Cyrillic_shcha = C.GDK_KEY_Cyrillic_shcha + KEY_Cyrillic_che = C.GDK_KEY_Cyrillic_che + KEY_Cyrillic_hardsign = C.GDK_KEY_Cyrillic_hardsign + KEY_Cyrillic_YU = C.GDK_KEY_Cyrillic_YU + KEY_Cyrillic_A = C.GDK_KEY_Cyrillic_A + KEY_Cyrillic_BE = C.GDK_KEY_Cyrillic_BE + KEY_Cyrillic_TSE = C.GDK_KEY_Cyrillic_TSE + KEY_Cyrillic_DE = C.GDK_KEY_Cyrillic_DE + KEY_Cyrillic_IE = C.GDK_KEY_Cyrillic_IE + KEY_Cyrillic_EF = C.GDK_KEY_Cyrillic_EF + KEY_Cyrillic_GHE = C.GDK_KEY_Cyrillic_GHE + KEY_Cyrillic_HA = C.GDK_KEY_Cyrillic_HA + KEY_Cyrillic_I = C.GDK_KEY_Cyrillic_I + KEY_Cyrillic_SHORTI = C.GDK_KEY_Cyrillic_SHORTI + KEY_Cyrillic_KA = C.GDK_KEY_Cyrillic_KA + KEY_Cyrillic_EL = C.GDK_KEY_Cyrillic_EL + KEY_Cyrillic_EM = C.GDK_KEY_Cyrillic_EM + KEY_Cyrillic_EN = C.GDK_KEY_Cyrillic_EN + KEY_Cyrillic_O = C.GDK_KEY_Cyrillic_O + KEY_Cyrillic_PE = C.GDK_KEY_Cyrillic_PE + KEY_Cyrillic_YA = C.GDK_KEY_Cyrillic_YA + KEY_Cyrillic_ER = C.GDK_KEY_Cyrillic_ER + KEY_Cyrillic_ES = C.GDK_KEY_Cyrillic_ES + KEY_Cyrillic_TE = C.GDK_KEY_Cyrillic_TE + KEY_Cyrillic_U = C.GDK_KEY_Cyrillic_U + KEY_Cyrillic_ZHE = C.GDK_KEY_Cyrillic_ZHE + KEY_Cyrillic_VE = C.GDK_KEY_Cyrillic_VE + KEY_Cyrillic_SOFTSIGN = C.GDK_KEY_Cyrillic_SOFTSIGN + KEY_Cyrillic_YERU = C.GDK_KEY_Cyrillic_YERU + KEY_Cyrillic_ZE = C.GDK_KEY_Cyrillic_ZE + KEY_Cyrillic_SHA = C.GDK_KEY_Cyrillic_SHA + KEY_Cyrillic_E = C.GDK_KEY_Cyrillic_E + KEY_Cyrillic_SHCHA = C.GDK_KEY_Cyrillic_SHCHA + KEY_Cyrillic_CHE = C.GDK_KEY_Cyrillic_CHE + KEY_Cyrillic_HARDSIGN = C.GDK_KEY_Cyrillic_HARDSIGN + KEY_Greek_ALPHAaccent = C.GDK_KEY_Greek_ALPHAaccent + KEY_Greek_EPSILONaccent = C.GDK_KEY_Greek_EPSILONaccent + KEY_Greek_ETAaccent = C.GDK_KEY_Greek_ETAaccent + KEY_Greek_IOTAaccent = C.GDK_KEY_Greek_IOTAaccent + KEY_Greek_IOTAdieresis = C.GDK_KEY_Greek_IOTAdieresis + KEY_Greek_IOTAdiaeresis = C.GDK_KEY_Greek_IOTAdiaeresis + KEY_Greek_OMICRONaccent = C.GDK_KEY_Greek_OMICRONaccent + KEY_Greek_UPSILONaccent = C.GDK_KEY_Greek_UPSILONaccent + KEY_Greek_UPSILONdieresis = C.GDK_KEY_Greek_UPSILONdieresis + KEY_Greek_OMEGAaccent = C.GDK_KEY_Greek_OMEGAaccent + KEY_Greek_accentdieresis = C.GDK_KEY_Greek_accentdieresis + KEY_Greek_horizbar = C.GDK_KEY_Greek_horizbar + KEY_Greek_alphaaccent = C.GDK_KEY_Greek_alphaaccent + KEY_Greek_epsilonaccent = C.GDK_KEY_Greek_epsilonaccent + KEY_Greek_etaaccent = C.GDK_KEY_Greek_etaaccent + KEY_Greek_iotaaccent = C.GDK_KEY_Greek_iotaaccent + KEY_Greek_iotadieresis = C.GDK_KEY_Greek_iotadieresis + KEY_Greek_iotaaccentdieresis = C.GDK_KEY_Greek_iotaaccentdieresis + KEY_Greek_omicronaccent = C.GDK_KEY_Greek_omicronaccent + KEY_Greek_upsilonaccent = C.GDK_KEY_Greek_upsilonaccent + KEY_Greek_upsilondieresis = C.GDK_KEY_Greek_upsilondieresis + KEY_Greek_upsilonaccentdieresis = C.GDK_KEY_Greek_upsilonaccentdieresis + KEY_Greek_omegaaccent = C.GDK_KEY_Greek_omegaaccent + KEY_Greek_ALPHA = C.GDK_KEY_Greek_ALPHA + KEY_Greek_BETA = C.GDK_KEY_Greek_BETA + KEY_Greek_GAMMA = C.GDK_KEY_Greek_GAMMA + KEY_Greek_DELTA = C.GDK_KEY_Greek_DELTA + KEY_Greek_EPSILON = C.GDK_KEY_Greek_EPSILON + KEY_Greek_ZETA = C.GDK_KEY_Greek_ZETA + KEY_Greek_ETA = C.GDK_KEY_Greek_ETA + KEY_Greek_THETA = C.GDK_KEY_Greek_THETA + KEY_Greek_IOTA = C.GDK_KEY_Greek_IOTA + KEY_Greek_KAPPA = C.GDK_KEY_Greek_KAPPA + KEY_Greek_LAMDA = C.GDK_KEY_Greek_LAMDA + KEY_Greek_LAMBDA = C.GDK_KEY_Greek_LAMBDA + KEY_Greek_MU = C.GDK_KEY_Greek_MU + KEY_Greek_NU = C.GDK_KEY_Greek_NU + KEY_Greek_XI = C.GDK_KEY_Greek_XI + KEY_Greek_OMICRON = C.GDK_KEY_Greek_OMICRON + KEY_Greek_PI = C.GDK_KEY_Greek_PI + KEY_Greek_RHO = C.GDK_KEY_Greek_RHO + KEY_Greek_SIGMA = C.GDK_KEY_Greek_SIGMA + KEY_Greek_TAU = C.GDK_KEY_Greek_TAU + KEY_Greek_UPSILON = C.GDK_KEY_Greek_UPSILON + KEY_Greek_PHI = C.GDK_KEY_Greek_PHI + KEY_Greek_CHI = C.GDK_KEY_Greek_CHI + KEY_Greek_PSI = C.GDK_KEY_Greek_PSI + KEY_Greek_OMEGA = C.GDK_KEY_Greek_OMEGA + KEY_Greek_alpha = C.GDK_KEY_Greek_alpha + KEY_Greek_beta = C.GDK_KEY_Greek_beta + KEY_Greek_gamma = C.GDK_KEY_Greek_gamma + KEY_Greek_delta = C.GDK_KEY_Greek_delta + KEY_Greek_epsilon = C.GDK_KEY_Greek_epsilon + KEY_Greek_zeta = C.GDK_KEY_Greek_zeta + KEY_Greek_eta = C.GDK_KEY_Greek_eta + KEY_Greek_theta = C.GDK_KEY_Greek_theta + KEY_Greek_iota = C.GDK_KEY_Greek_iota + KEY_Greek_kappa = C.GDK_KEY_Greek_kappa + KEY_Greek_lamda = C.GDK_KEY_Greek_lamda + KEY_Greek_lambda = C.GDK_KEY_Greek_lambda + KEY_Greek_mu = C.GDK_KEY_Greek_mu + KEY_Greek_nu = C.GDK_KEY_Greek_nu + KEY_Greek_xi = C.GDK_KEY_Greek_xi + KEY_Greek_omicron = C.GDK_KEY_Greek_omicron + KEY_Greek_pi = C.GDK_KEY_Greek_pi + KEY_Greek_rho = C.GDK_KEY_Greek_rho + KEY_Greek_sigma = C.GDK_KEY_Greek_sigma + KEY_Greek_finalsmallsigma = C.GDK_KEY_Greek_finalsmallsigma + KEY_Greek_tau = C.GDK_KEY_Greek_tau + KEY_Greek_upsilon = C.GDK_KEY_Greek_upsilon + KEY_Greek_phi = C.GDK_KEY_Greek_phi + KEY_Greek_chi = C.GDK_KEY_Greek_chi + KEY_Greek_psi = C.GDK_KEY_Greek_psi + KEY_Greek_omega = C.GDK_KEY_Greek_omega + KEY_Greek_switch = C.GDK_KEY_Greek_switch + KEY_leftradical = C.GDK_KEY_leftradical + KEY_topleftradical = C.GDK_KEY_topleftradical + KEY_horizconnector = C.GDK_KEY_horizconnector + KEY_topintegral = C.GDK_KEY_topintegral + KEY_botintegral = C.GDK_KEY_botintegral + KEY_vertconnector = C.GDK_KEY_vertconnector + KEY_topleftsqbracket = C.GDK_KEY_topleftsqbracket + KEY_botleftsqbracket = C.GDK_KEY_botleftsqbracket + KEY_toprightsqbracket = C.GDK_KEY_toprightsqbracket + KEY_botrightsqbracket = C.GDK_KEY_botrightsqbracket + KEY_topleftparens = C.GDK_KEY_topleftparens + KEY_botleftparens = C.GDK_KEY_botleftparens + KEY_toprightparens = C.GDK_KEY_toprightparens + KEY_botrightparens = C.GDK_KEY_botrightparens + KEY_leftmiddlecurlybrace = C.GDK_KEY_leftmiddlecurlybrace + KEY_rightmiddlecurlybrace = C.GDK_KEY_rightmiddlecurlybrace + KEY_topleftsummation = C.GDK_KEY_topleftsummation + KEY_botleftsummation = C.GDK_KEY_botleftsummation + KEY_topvertsummationconnector = C.GDK_KEY_topvertsummationconnector + KEY_botvertsummationconnector = C.GDK_KEY_botvertsummationconnector + KEY_toprightsummation = C.GDK_KEY_toprightsummation + KEY_botrightsummation = C.GDK_KEY_botrightsummation + KEY_rightmiddlesummation = C.GDK_KEY_rightmiddlesummation + KEY_lessthanequal = C.GDK_KEY_lessthanequal + KEY_notequal = C.GDK_KEY_notequal + KEY_greaterthanequal = C.GDK_KEY_greaterthanequal + KEY_integral = C.GDK_KEY_integral + KEY_therefore = C.GDK_KEY_therefore + KEY_variation = C.GDK_KEY_variation + KEY_infinity = C.GDK_KEY_infinity + KEY_nabla = C.GDK_KEY_nabla + KEY_approximate = C.GDK_KEY_approximate + KEY_similarequal = C.GDK_KEY_similarequal + KEY_ifonlyif = C.GDK_KEY_ifonlyif + KEY_implies = C.GDK_KEY_implies + KEY_identical = C.GDK_KEY_identical + KEY_radical = C.GDK_KEY_radical + KEY_includedin = C.GDK_KEY_includedin + KEY_includes = C.GDK_KEY_includes + KEY_intersection = C.GDK_KEY_intersection + KEY_union = C.GDK_KEY_union + KEY_logicaland = C.GDK_KEY_logicaland + KEY_logicalor = C.GDK_KEY_logicalor + KEY_partialderivative = C.GDK_KEY_partialderivative + KEY_function = C.GDK_KEY_function + KEY_leftarrow = C.GDK_KEY_leftarrow + KEY_uparrow = C.GDK_KEY_uparrow + KEY_rightarrow = C.GDK_KEY_rightarrow + KEY_downarrow = C.GDK_KEY_downarrow + KEY_blank = C.GDK_KEY_blank + KEY_soliddiamond = C.GDK_KEY_soliddiamond + KEY_checkerboard = C.GDK_KEY_checkerboard + KEY_ht = C.GDK_KEY_ht + KEY_ff = C.GDK_KEY_ff + KEY_cr = C.GDK_KEY_cr + KEY_lf = C.GDK_KEY_lf + KEY_nl = C.GDK_KEY_nl + KEY_vt = C.GDK_KEY_vt + KEY_lowrightcorner = C.GDK_KEY_lowrightcorner + KEY_uprightcorner = C.GDK_KEY_uprightcorner + KEY_upleftcorner = C.GDK_KEY_upleftcorner + KEY_lowleftcorner = C.GDK_KEY_lowleftcorner + KEY_crossinglines = C.GDK_KEY_crossinglines + KEY_horizlinescan1 = C.GDK_KEY_horizlinescan1 + KEY_horizlinescan3 = C.GDK_KEY_horizlinescan3 + KEY_horizlinescan5 = C.GDK_KEY_horizlinescan5 + KEY_horizlinescan7 = C.GDK_KEY_horizlinescan7 + KEY_horizlinescan9 = C.GDK_KEY_horizlinescan9 + KEY_leftt = C.GDK_KEY_leftt + KEY_rightt = C.GDK_KEY_rightt + KEY_bott = C.GDK_KEY_bott + KEY_topt = C.GDK_KEY_topt + KEY_vertbar = C.GDK_KEY_vertbar + KEY_emspace = C.GDK_KEY_emspace + KEY_enspace = C.GDK_KEY_enspace + KEY_em3space = C.GDK_KEY_em3space + KEY_em4space = C.GDK_KEY_em4space + KEY_digitspace = C.GDK_KEY_digitspace + KEY_punctspace = C.GDK_KEY_punctspace + KEY_thinspace = C.GDK_KEY_thinspace + KEY_hairspace = C.GDK_KEY_hairspace + KEY_emdash = C.GDK_KEY_emdash + KEY_endash = C.GDK_KEY_endash + KEY_signifblank = C.GDK_KEY_signifblank + KEY_ellipsis = C.GDK_KEY_ellipsis + KEY_doubbaselinedot = C.GDK_KEY_doubbaselinedot + KEY_onethird = C.GDK_KEY_onethird + KEY_twothirds = C.GDK_KEY_twothirds + KEY_onefifth = C.GDK_KEY_onefifth + KEY_twofifths = C.GDK_KEY_twofifths + KEY_threefifths = C.GDK_KEY_threefifths + KEY_fourfifths = C.GDK_KEY_fourfifths + KEY_onesixth = C.GDK_KEY_onesixth + KEY_fivesixths = C.GDK_KEY_fivesixths + KEY_careof = C.GDK_KEY_careof + KEY_figdash = C.GDK_KEY_figdash + KEY_leftanglebracket = C.GDK_KEY_leftanglebracket + KEY_decimalpoint = C.GDK_KEY_decimalpoint + KEY_rightanglebracket = C.GDK_KEY_rightanglebracket + KEY_marker = C.GDK_KEY_marker + KEY_oneeighth = C.GDK_KEY_oneeighth + KEY_threeeighths = C.GDK_KEY_threeeighths + KEY_fiveeighths = C.GDK_KEY_fiveeighths + KEY_seveneighths = C.GDK_KEY_seveneighths + KEY_trademark = C.GDK_KEY_trademark + KEY_signaturemark = C.GDK_KEY_signaturemark + KEY_trademarkincircle = C.GDK_KEY_trademarkincircle + KEY_leftopentriangle = C.GDK_KEY_leftopentriangle + KEY_rightopentriangle = C.GDK_KEY_rightopentriangle + KEY_emopencircle = C.GDK_KEY_emopencircle + KEY_emopenrectangle = C.GDK_KEY_emopenrectangle + KEY_leftsinglequotemark = C.GDK_KEY_leftsinglequotemark + KEY_rightsinglequotemark = C.GDK_KEY_rightsinglequotemark + KEY_leftdoublequotemark = C.GDK_KEY_leftdoublequotemark + KEY_rightdoublequotemark = C.GDK_KEY_rightdoublequotemark + KEY_prescription = C.GDK_KEY_prescription + KEY_permille = C.GDK_KEY_permille + KEY_minutes = C.GDK_KEY_minutes + KEY_seconds = C.GDK_KEY_seconds + KEY_latincross = C.GDK_KEY_latincross + KEY_hexagram = C.GDK_KEY_hexagram + KEY_filledrectbullet = C.GDK_KEY_filledrectbullet + KEY_filledlefttribullet = C.GDK_KEY_filledlefttribullet + KEY_filledrighttribullet = C.GDK_KEY_filledrighttribullet + KEY_emfilledcircle = C.GDK_KEY_emfilledcircle + KEY_emfilledrect = C.GDK_KEY_emfilledrect + KEY_enopencircbullet = C.GDK_KEY_enopencircbullet + KEY_enopensquarebullet = C.GDK_KEY_enopensquarebullet + KEY_openrectbullet = C.GDK_KEY_openrectbullet + KEY_opentribulletup = C.GDK_KEY_opentribulletup + KEY_opentribulletdown = C.GDK_KEY_opentribulletdown + KEY_openstar = C.GDK_KEY_openstar + KEY_enfilledcircbullet = C.GDK_KEY_enfilledcircbullet + KEY_enfilledsqbullet = C.GDK_KEY_enfilledsqbullet + KEY_filledtribulletup = C.GDK_KEY_filledtribulletup + KEY_filledtribulletdown = C.GDK_KEY_filledtribulletdown + KEY_leftpointer = C.GDK_KEY_leftpointer + KEY_rightpointer = C.GDK_KEY_rightpointer + KEY_club = C.GDK_KEY_club + KEY_diamond = C.GDK_KEY_diamond + KEY_heart = C.GDK_KEY_heart + KEY_maltesecross = C.GDK_KEY_maltesecross + KEY_dagger = C.GDK_KEY_dagger + KEY_doubledagger = C.GDK_KEY_doubledagger + KEY_checkmark = C.GDK_KEY_checkmark + KEY_ballotcross = C.GDK_KEY_ballotcross + KEY_musicalsharp = C.GDK_KEY_musicalsharp + KEY_musicalflat = C.GDK_KEY_musicalflat + KEY_malesymbol = C.GDK_KEY_malesymbol + KEY_femalesymbol = C.GDK_KEY_femalesymbol + KEY_telephone = C.GDK_KEY_telephone + KEY_telephonerecorder = C.GDK_KEY_telephonerecorder + KEY_phonographcopyright = C.GDK_KEY_phonographcopyright + KEY_caret = C.GDK_KEY_caret + KEY_singlelowquotemark = C.GDK_KEY_singlelowquotemark + KEY_doublelowquotemark = C.GDK_KEY_doublelowquotemark + KEY_cursor = C.GDK_KEY_cursor + KEY_leftcaret = C.GDK_KEY_leftcaret + KEY_rightcaret = C.GDK_KEY_rightcaret + KEY_downcaret = C.GDK_KEY_downcaret + KEY_upcaret = C.GDK_KEY_upcaret + KEY_overbar = C.GDK_KEY_overbar + KEY_downtack = C.GDK_KEY_downtack + KEY_upshoe = C.GDK_KEY_upshoe + KEY_downstile = C.GDK_KEY_downstile + KEY_underbar = C.GDK_KEY_underbar + KEY_jot = C.GDK_KEY_jot + KEY_quad = C.GDK_KEY_quad + KEY_uptack = C.GDK_KEY_uptack + KEY_circle = C.GDK_KEY_circle + KEY_upstile = C.GDK_KEY_upstile + KEY_downshoe = C.GDK_KEY_downshoe + KEY_rightshoe = C.GDK_KEY_rightshoe + KEY_leftshoe = C.GDK_KEY_leftshoe + KEY_lefttack = C.GDK_KEY_lefttack + KEY_righttack = C.GDK_KEY_righttack + KEY_hebrew_doublelowline = C.GDK_KEY_hebrew_doublelowline + KEY_hebrew_aleph = C.GDK_KEY_hebrew_aleph + KEY_hebrew_bet = C.GDK_KEY_hebrew_bet + KEY_hebrew_beth = C.GDK_KEY_hebrew_beth + KEY_hebrew_gimel = C.GDK_KEY_hebrew_gimel + KEY_hebrew_gimmel = C.GDK_KEY_hebrew_gimmel + KEY_hebrew_dalet = C.GDK_KEY_hebrew_dalet + KEY_hebrew_daleth = C.GDK_KEY_hebrew_daleth + KEY_hebrew_he = C.GDK_KEY_hebrew_he + KEY_hebrew_waw = C.GDK_KEY_hebrew_waw + KEY_hebrew_zain = C.GDK_KEY_hebrew_zain + KEY_hebrew_zayin = C.GDK_KEY_hebrew_zayin + KEY_hebrew_chet = C.GDK_KEY_hebrew_chet + KEY_hebrew_het = C.GDK_KEY_hebrew_het + KEY_hebrew_tet = C.GDK_KEY_hebrew_tet + KEY_hebrew_teth = C.GDK_KEY_hebrew_teth + KEY_hebrew_yod = C.GDK_KEY_hebrew_yod + KEY_hebrew_finalkaph = C.GDK_KEY_hebrew_finalkaph + KEY_hebrew_kaph = C.GDK_KEY_hebrew_kaph + KEY_hebrew_lamed = C.GDK_KEY_hebrew_lamed + KEY_hebrew_finalmem = C.GDK_KEY_hebrew_finalmem + KEY_hebrew_mem = C.GDK_KEY_hebrew_mem + KEY_hebrew_finalnun = C.GDK_KEY_hebrew_finalnun + KEY_hebrew_nun = C.GDK_KEY_hebrew_nun + KEY_hebrew_samech = C.GDK_KEY_hebrew_samech + KEY_hebrew_samekh = C.GDK_KEY_hebrew_samekh + KEY_hebrew_ayin = C.GDK_KEY_hebrew_ayin + KEY_hebrew_finalpe = C.GDK_KEY_hebrew_finalpe + KEY_hebrew_pe = C.GDK_KEY_hebrew_pe + KEY_hebrew_finalzade = C.GDK_KEY_hebrew_finalzade + KEY_hebrew_finalzadi = C.GDK_KEY_hebrew_finalzadi + KEY_hebrew_zade = C.GDK_KEY_hebrew_zade + KEY_hebrew_zadi = C.GDK_KEY_hebrew_zadi + KEY_hebrew_qoph = C.GDK_KEY_hebrew_qoph + KEY_hebrew_kuf = C.GDK_KEY_hebrew_kuf + KEY_hebrew_resh = C.GDK_KEY_hebrew_resh + KEY_hebrew_shin = C.GDK_KEY_hebrew_shin + KEY_hebrew_taw = C.GDK_KEY_hebrew_taw + KEY_hebrew_taf = C.GDK_KEY_hebrew_taf + KEY_Hebrew_switch = C.GDK_KEY_Hebrew_switch + KEY_Thai_kokai = C.GDK_KEY_Thai_kokai + KEY_Thai_khokhai = C.GDK_KEY_Thai_khokhai + KEY_Thai_khokhuat = C.GDK_KEY_Thai_khokhuat + KEY_Thai_khokhwai = C.GDK_KEY_Thai_khokhwai + KEY_Thai_khokhon = C.GDK_KEY_Thai_khokhon + KEY_Thai_khorakhang = C.GDK_KEY_Thai_khorakhang + KEY_Thai_ngongu = C.GDK_KEY_Thai_ngongu + KEY_Thai_chochan = C.GDK_KEY_Thai_chochan + KEY_Thai_choching = C.GDK_KEY_Thai_choching + KEY_Thai_chochang = C.GDK_KEY_Thai_chochang + KEY_Thai_soso = C.GDK_KEY_Thai_soso + KEY_Thai_chochoe = C.GDK_KEY_Thai_chochoe + KEY_Thai_yoying = C.GDK_KEY_Thai_yoying + KEY_Thai_dochada = C.GDK_KEY_Thai_dochada + KEY_Thai_topatak = C.GDK_KEY_Thai_topatak + KEY_Thai_thothan = C.GDK_KEY_Thai_thothan + KEY_Thai_thonangmontho = C.GDK_KEY_Thai_thonangmontho + KEY_Thai_thophuthao = C.GDK_KEY_Thai_thophuthao + KEY_Thai_nonen = C.GDK_KEY_Thai_nonen + KEY_Thai_dodek = C.GDK_KEY_Thai_dodek + KEY_Thai_totao = C.GDK_KEY_Thai_totao + KEY_Thai_thothung = C.GDK_KEY_Thai_thothung + KEY_Thai_thothahan = C.GDK_KEY_Thai_thothahan + KEY_Thai_thothong = C.GDK_KEY_Thai_thothong + KEY_Thai_nonu = C.GDK_KEY_Thai_nonu + KEY_Thai_bobaimai = C.GDK_KEY_Thai_bobaimai + KEY_Thai_popla = C.GDK_KEY_Thai_popla + KEY_Thai_phophung = C.GDK_KEY_Thai_phophung + KEY_Thai_fofa = C.GDK_KEY_Thai_fofa + KEY_Thai_phophan = C.GDK_KEY_Thai_phophan + KEY_Thai_fofan = C.GDK_KEY_Thai_fofan + KEY_Thai_phosamphao = C.GDK_KEY_Thai_phosamphao + KEY_Thai_moma = C.GDK_KEY_Thai_moma + KEY_Thai_yoyak = C.GDK_KEY_Thai_yoyak + KEY_Thai_rorua = C.GDK_KEY_Thai_rorua + KEY_Thai_ru = C.GDK_KEY_Thai_ru + KEY_Thai_loling = C.GDK_KEY_Thai_loling + KEY_Thai_lu = C.GDK_KEY_Thai_lu + KEY_Thai_wowaen = C.GDK_KEY_Thai_wowaen + KEY_Thai_sosala = C.GDK_KEY_Thai_sosala + KEY_Thai_sorusi = C.GDK_KEY_Thai_sorusi + KEY_Thai_sosua = C.GDK_KEY_Thai_sosua + KEY_Thai_hohip = C.GDK_KEY_Thai_hohip + KEY_Thai_lochula = C.GDK_KEY_Thai_lochula + KEY_Thai_oang = C.GDK_KEY_Thai_oang + KEY_Thai_honokhuk = C.GDK_KEY_Thai_honokhuk + KEY_Thai_paiyannoi = C.GDK_KEY_Thai_paiyannoi + KEY_Thai_saraa = C.GDK_KEY_Thai_saraa + KEY_Thai_maihanakat = C.GDK_KEY_Thai_maihanakat + KEY_Thai_saraaa = C.GDK_KEY_Thai_saraaa + KEY_Thai_saraam = C.GDK_KEY_Thai_saraam + KEY_Thai_sarai = C.GDK_KEY_Thai_sarai + KEY_Thai_saraii = C.GDK_KEY_Thai_saraii + KEY_Thai_saraue = C.GDK_KEY_Thai_saraue + KEY_Thai_sarauee = C.GDK_KEY_Thai_sarauee + KEY_Thai_sarau = C.GDK_KEY_Thai_sarau + KEY_Thai_sarauu = C.GDK_KEY_Thai_sarauu + KEY_Thai_phinthu = C.GDK_KEY_Thai_phinthu + KEY_Thai_maihanakat_maitho = C.GDK_KEY_Thai_maihanakat_maitho + KEY_Thai_baht = C.GDK_KEY_Thai_baht + KEY_Thai_sarae = C.GDK_KEY_Thai_sarae + KEY_Thai_saraae = C.GDK_KEY_Thai_saraae + KEY_Thai_sarao = C.GDK_KEY_Thai_sarao + KEY_Thai_saraaimaimuan = C.GDK_KEY_Thai_saraaimaimuan + KEY_Thai_saraaimaimalai = C.GDK_KEY_Thai_saraaimaimalai + KEY_Thai_lakkhangyao = C.GDK_KEY_Thai_lakkhangyao + KEY_Thai_maiyamok = C.GDK_KEY_Thai_maiyamok + KEY_Thai_maitaikhu = C.GDK_KEY_Thai_maitaikhu + KEY_Thai_maiek = C.GDK_KEY_Thai_maiek + KEY_Thai_maitho = C.GDK_KEY_Thai_maitho + KEY_Thai_maitri = C.GDK_KEY_Thai_maitri + KEY_Thai_maichattawa = C.GDK_KEY_Thai_maichattawa + KEY_Thai_thanthakhat = C.GDK_KEY_Thai_thanthakhat + KEY_Thai_nikhahit = C.GDK_KEY_Thai_nikhahit + KEY_Thai_leksun = C.GDK_KEY_Thai_leksun + KEY_Thai_leknung = C.GDK_KEY_Thai_leknung + KEY_Thai_leksong = C.GDK_KEY_Thai_leksong + KEY_Thai_leksam = C.GDK_KEY_Thai_leksam + KEY_Thai_leksi = C.GDK_KEY_Thai_leksi + KEY_Thai_lekha = C.GDK_KEY_Thai_lekha + KEY_Thai_lekhok = C.GDK_KEY_Thai_lekhok + KEY_Thai_lekchet = C.GDK_KEY_Thai_lekchet + KEY_Thai_lekpaet = C.GDK_KEY_Thai_lekpaet + KEY_Thai_lekkao = C.GDK_KEY_Thai_lekkao + KEY_Hangul = C.GDK_KEY_Hangul + KEY_Hangul_Start = C.GDK_KEY_Hangul_Start + KEY_Hangul_End = C.GDK_KEY_Hangul_End + KEY_Hangul_Hanja = C.GDK_KEY_Hangul_Hanja + KEY_Hangul_Jamo = C.GDK_KEY_Hangul_Jamo + KEY_Hangul_Romaja = C.GDK_KEY_Hangul_Romaja + KEY_Hangul_Codeinput = C.GDK_KEY_Hangul_Codeinput + KEY_Hangul_Jeonja = C.GDK_KEY_Hangul_Jeonja + KEY_Hangul_Banja = C.GDK_KEY_Hangul_Banja + KEY_Hangul_PreHanja = C.GDK_KEY_Hangul_PreHanja + KEY_Hangul_PostHanja = C.GDK_KEY_Hangul_PostHanja + KEY_Hangul_SingleCandidate = C.GDK_KEY_Hangul_SingleCandidate + KEY_Hangul_MultipleCandidate = C.GDK_KEY_Hangul_MultipleCandidate + KEY_Hangul_PreviousCandidate = C.GDK_KEY_Hangul_PreviousCandidate + KEY_Hangul_Special = C.GDK_KEY_Hangul_Special + KEY_Hangul_switch = C.GDK_KEY_Hangul_switch + KEY_Hangul_Kiyeog = C.GDK_KEY_Hangul_Kiyeog + KEY_Hangul_SsangKiyeog = C.GDK_KEY_Hangul_SsangKiyeog + KEY_Hangul_KiyeogSios = C.GDK_KEY_Hangul_KiyeogSios + KEY_Hangul_Nieun = C.GDK_KEY_Hangul_Nieun + KEY_Hangul_NieunJieuj = C.GDK_KEY_Hangul_NieunJieuj + KEY_Hangul_NieunHieuh = C.GDK_KEY_Hangul_NieunHieuh + KEY_Hangul_Dikeud = C.GDK_KEY_Hangul_Dikeud + KEY_Hangul_SsangDikeud = C.GDK_KEY_Hangul_SsangDikeud + KEY_Hangul_Rieul = C.GDK_KEY_Hangul_Rieul + KEY_Hangul_RieulKiyeog = C.GDK_KEY_Hangul_RieulKiyeog + KEY_Hangul_RieulMieum = C.GDK_KEY_Hangul_RieulMieum + KEY_Hangul_RieulPieub = C.GDK_KEY_Hangul_RieulPieub + KEY_Hangul_RieulSios = C.GDK_KEY_Hangul_RieulSios + KEY_Hangul_RieulTieut = C.GDK_KEY_Hangul_RieulTieut + KEY_Hangul_RieulPhieuf = C.GDK_KEY_Hangul_RieulPhieuf + KEY_Hangul_RieulHieuh = C.GDK_KEY_Hangul_RieulHieuh + KEY_Hangul_Mieum = C.GDK_KEY_Hangul_Mieum + KEY_Hangul_Pieub = C.GDK_KEY_Hangul_Pieub + KEY_Hangul_SsangPieub = C.GDK_KEY_Hangul_SsangPieub + KEY_Hangul_PieubSios = C.GDK_KEY_Hangul_PieubSios + KEY_Hangul_Sios = C.GDK_KEY_Hangul_Sios + KEY_Hangul_SsangSios = C.GDK_KEY_Hangul_SsangSios + KEY_Hangul_Ieung = C.GDK_KEY_Hangul_Ieung + KEY_Hangul_Jieuj = C.GDK_KEY_Hangul_Jieuj + KEY_Hangul_SsangJieuj = C.GDK_KEY_Hangul_SsangJieuj + KEY_Hangul_Cieuc = C.GDK_KEY_Hangul_Cieuc + KEY_Hangul_Khieuq = C.GDK_KEY_Hangul_Khieuq + KEY_Hangul_Tieut = C.GDK_KEY_Hangul_Tieut + KEY_Hangul_Phieuf = C.GDK_KEY_Hangul_Phieuf + KEY_Hangul_Hieuh = C.GDK_KEY_Hangul_Hieuh + KEY_Hangul_A = C.GDK_KEY_Hangul_A + KEY_Hangul_AE = C.GDK_KEY_Hangul_AE + KEY_Hangul_YA = C.GDK_KEY_Hangul_YA + KEY_Hangul_YAE = C.GDK_KEY_Hangul_YAE + KEY_Hangul_EO = C.GDK_KEY_Hangul_EO + KEY_Hangul_E = C.GDK_KEY_Hangul_E + KEY_Hangul_YEO = C.GDK_KEY_Hangul_YEO + KEY_Hangul_YE = C.GDK_KEY_Hangul_YE + KEY_Hangul_O = C.GDK_KEY_Hangul_O + KEY_Hangul_WA = C.GDK_KEY_Hangul_WA + KEY_Hangul_WAE = C.GDK_KEY_Hangul_WAE + KEY_Hangul_OE = C.GDK_KEY_Hangul_OE + KEY_Hangul_YO = C.GDK_KEY_Hangul_YO + KEY_Hangul_U = C.GDK_KEY_Hangul_U + KEY_Hangul_WEO = C.GDK_KEY_Hangul_WEO + KEY_Hangul_WE = C.GDK_KEY_Hangul_WE + KEY_Hangul_WI = C.GDK_KEY_Hangul_WI + KEY_Hangul_YU = C.GDK_KEY_Hangul_YU + KEY_Hangul_EU = C.GDK_KEY_Hangul_EU + KEY_Hangul_YI = C.GDK_KEY_Hangul_YI + KEY_Hangul_I = C.GDK_KEY_Hangul_I + KEY_Hangul_J_Kiyeog = C.GDK_KEY_Hangul_J_Kiyeog + KEY_Hangul_J_SsangKiyeog = C.GDK_KEY_Hangul_J_SsangKiyeog + KEY_Hangul_J_KiyeogSios = C.GDK_KEY_Hangul_J_KiyeogSios + KEY_Hangul_J_Nieun = C.GDK_KEY_Hangul_J_Nieun + KEY_Hangul_J_NieunJieuj = C.GDK_KEY_Hangul_J_NieunJieuj + KEY_Hangul_J_NieunHieuh = C.GDK_KEY_Hangul_J_NieunHieuh + KEY_Hangul_J_Dikeud = C.GDK_KEY_Hangul_J_Dikeud + KEY_Hangul_J_Rieul = C.GDK_KEY_Hangul_J_Rieul + KEY_Hangul_J_RieulKiyeog = C.GDK_KEY_Hangul_J_RieulKiyeog + KEY_Hangul_J_RieulMieum = C.GDK_KEY_Hangul_J_RieulMieum + KEY_Hangul_J_RieulPieub = C.GDK_KEY_Hangul_J_RieulPieub + KEY_Hangul_J_RieulSios = C.GDK_KEY_Hangul_J_RieulSios + KEY_Hangul_J_RieulTieut = C.GDK_KEY_Hangul_J_RieulTieut + KEY_Hangul_J_RieulPhieuf = C.GDK_KEY_Hangul_J_RieulPhieuf + KEY_Hangul_J_RieulHieuh = C.GDK_KEY_Hangul_J_RieulHieuh + KEY_Hangul_J_Mieum = C.GDK_KEY_Hangul_J_Mieum + KEY_Hangul_J_Pieub = C.GDK_KEY_Hangul_J_Pieub + KEY_Hangul_J_PieubSios = C.GDK_KEY_Hangul_J_PieubSios + KEY_Hangul_J_Sios = C.GDK_KEY_Hangul_J_Sios + KEY_Hangul_J_SsangSios = C.GDK_KEY_Hangul_J_SsangSios + KEY_Hangul_J_Ieung = C.GDK_KEY_Hangul_J_Ieung + KEY_Hangul_J_Jieuj = C.GDK_KEY_Hangul_J_Jieuj + KEY_Hangul_J_Cieuc = C.GDK_KEY_Hangul_J_Cieuc + KEY_Hangul_J_Khieuq = C.GDK_KEY_Hangul_J_Khieuq + KEY_Hangul_J_Tieut = C.GDK_KEY_Hangul_J_Tieut + KEY_Hangul_J_Phieuf = C.GDK_KEY_Hangul_J_Phieuf + KEY_Hangul_J_Hieuh = C.GDK_KEY_Hangul_J_Hieuh + KEY_Hangul_RieulYeorinHieuh = C.GDK_KEY_Hangul_RieulYeorinHieuh + KEY_Hangul_SunkyeongeumMieum = C.GDK_KEY_Hangul_SunkyeongeumMieum + KEY_Hangul_SunkyeongeumPieub = C.GDK_KEY_Hangul_SunkyeongeumPieub + KEY_Hangul_PanSios = C.GDK_KEY_Hangul_PanSios + KEY_Hangul_KkogjiDalrinIeung = C.GDK_KEY_Hangul_KkogjiDalrinIeung + KEY_Hangul_SunkyeongeumPhieuf = C.GDK_KEY_Hangul_SunkyeongeumPhieuf + KEY_Hangul_YeorinHieuh = C.GDK_KEY_Hangul_YeorinHieuh + KEY_Hangul_AraeA = C.GDK_KEY_Hangul_AraeA + KEY_Hangul_AraeAE = C.GDK_KEY_Hangul_AraeAE + KEY_Hangul_J_PanSios = C.GDK_KEY_Hangul_J_PanSios + KEY_Hangul_J_KkogjiDalrinIeung = C.GDK_KEY_Hangul_J_KkogjiDalrinIeung + KEY_Hangul_J_YeorinHieuh = C.GDK_KEY_Hangul_J_YeorinHieuh + KEY_Korean_Won = C.GDK_KEY_Korean_Won + KEY_Armenian_ligature_ew = C.GDK_KEY_Armenian_ligature_ew + KEY_Armenian_full_stop = C.GDK_KEY_Armenian_full_stop + KEY_Armenian_verjaket = C.GDK_KEY_Armenian_verjaket + KEY_Armenian_separation_mark = C.GDK_KEY_Armenian_separation_mark + KEY_Armenian_but = C.GDK_KEY_Armenian_but + KEY_Armenian_hyphen = C.GDK_KEY_Armenian_hyphen + KEY_Armenian_yentamna = C.GDK_KEY_Armenian_yentamna + KEY_Armenian_exclam = C.GDK_KEY_Armenian_exclam + KEY_Armenian_amanak = C.GDK_KEY_Armenian_amanak + KEY_Armenian_accent = C.GDK_KEY_Armenian_accent + KEY_Armenian_shesht = C.GDK_KEY_Armenian_shesht + KEY_Armenian_question = C.GDK_KEY_Armenian_question + KEY_Armenian_paruyk = C.GDK_KEY_Armenian_paruyk + KEY_Armenian_AYB = C.GDK_KEY_Armenian_AYB + KEY_Armenian_ayb = C.GDK_KEY_Armenian_ayb + KEY_Armenian_BEN = C.GDK_KEY_Armenian_BEN + KEY_Armenian_ben = C.GDK_KEY_Armenian_ben + KEY_Armenian_GIM = C.GDK_KEY_Armenian_GIM + KEY_Armenian_gim = C.GDK_KEY_Armenian_gim + KEY_Armenian_DA = C.GDK_KEY_Armenian_DA + KEY_Armenian_da = C.GDK_KEY_Armenian_da + KEY_Armenian_YECH = C.GDK_KEY_Armenian_YECH + KEY_Armenian_yech = C.GDK_KEY_Armenian_yech + KEY_Armenian_ZA = C.GDK_KEY_Armenian_ZA + KEY_Armenian_za = C.GDK_KEY_Armenian_za + KEY_Armenian_E = C.GDK_KEY_Armenian_E + KEY_Armenian_e = C.GDK_KEY_Armenian_e + KEY_Armenian_AT = C.GDK_KEY_Armenian_AT + KEY_Armenian_at = C.GDK_KEY_Armenian_at + KEY_Armenian_TO = C.GDK_KEY_Armenian_TO + KEY_Armenian_to = C.GDK_KEY_Armenian_to + KEY_Armenian_ZHE = C.GDK_KEY_Armenian_ZHE + KEY_Armenian_zhe = C.GDK_KEY_Armenian_zhe + KEY_Armenian_INI = C.GDK_KEY_Armenian_INI + KEY_Armenian_ini = C.GDK_KEY_Armenian_ini + KEY_Armenian_LYUN = C.GDK_KEY_Armenian_LYUN + KEY_Armenian_lyun = C.GDK_KEY_Armenian_lyun + KEY_Armenian_KHE = C.GDK_KEY_Armenian_KHE + KEY_Armenian_khe = C.GDK_KEY_Armenian_khe + KEY_Armenian_TSA = C.GDK_KEY_Armenian_TSA + KEY_Armenian_tsa = C.GDK_KEY_Armenian_tsa + KEY_Armenian_KEN = C.GDK_KEY_Armenian_KEN + KEY_Armenian_ken = C.GDK_KEY_Armenian_ken + KEY_Armenian_HO = C.GDK_KEY_Armenian_HO + KEY_Armenian_ho = C.GDK_KEY_Armenian_ho + KEY_Armenian_DZA = C.GDK_KEY_Armenian_DZA + KEY_Armenian_dza = C.GDK_KEY_Armenian_dza + KEY_Armenian_GHAT = C.GDK_KEY_Armenian_GHAT + KEY_Armenian_ghat = C.GDK_KEY_Armenian_ghat + KEY_Armenian_TCHE = C.GDK_KEY_Armenian_TCHE + KEY_Armenian_tche = C.GDK_KEY_Armenian_tche + KEY_Armenian_MEN = C.GDK_KEY_Armenian_MEN + KEY_Armenian_men = C.GDK_KEY_Armenian_men + KEY_Armenian_HI = C.GDK_KEY_Armenian_HI + KEY_Armenian_hi = C.GDK_KEY_Armenian_hi + KEY_Armenian_NU = C.GDK_KEY_Armenian_NU + KEY_Armenian_nu = C.GDK_KEY_Armenian_nu + KEY_Armenian_SHA = C.GDK_KEY_Armenian_SHA + KEY_Armenian_sha = C.GDK_KEY_Armenian_sha + KEY_Armenian_VO = C.GDK_KEY_Armenian_VO + KEY_Armenian_vo = C.GDK_KEY_Armenian_vo + KEY_Armenian_CHA = C.GDK_KEY_Armenian_CHA + KEY_Armenian_cha = C.GDK_KEY_Armenian_cha + KEY_Armenian_PE = C.GDK_KEY_Armenian_PE + KEY_Armenian_pe = C.GDK_KEY_Armenian_pe + KEY_Armenian_JE = C.GDK_KEY_Armenian_JE + KEY_Armenian_je = C.GDK_KEY_Armenian_je + KEY_Armenian_RA = C.GDK_KEY_Armenian_RA + KEY_Armenian_ra = C.GDK_KEY_Armenian_ra + KEY_Armenian_SE = C.GDK_KEY_Armenian_SE + KEY_Armenian_se = C.GDK_KEY_Armenian_se + KEY_Armenian_VEV = C.GDK_KEY_Armenian_VEV + KEY_Armenian_vev = C.GDK_KEY_Armenian_vev + KEY_Armenian_TYUN = C.GDK_KEY_Armenian_TYUN + KEY_Armenian_tyun = C.GDK_KEY_Armenian_tyun + KEY_Armenian_RE = C.GDK_KEY_Armenian_RE + KEY_Armenian_re = C.GDK_KEY_Armenian_re + KEY_Armenian_TSO = C.GDK_KEY_Armenian_TSO + KEY_Armenian_tso = C.GDK_KEY_Armenian_tso + KEY_Armenian_VYUN = C.GDK_KEY_Armenian_VYUN + KEY_Armenian_vyun = C.GDK_KEY_Armenian_vyun + KEY_Armenian_PYUR = C.GDK_KEY_Armenian_PYUR + KEY_Armenian_pyur = C.GDK_KEY_Armenian_pyur + KEY_Armenian_KE = C.GDK_KEY_Armenian_KE + KEY_Armenian_ke = C.GDK_KEY_Armenian_ke + KEY_Armenian_O = C.GDK_KEY_Armenian_O + KEY_Armenian_o = C.GDK_KEY_Armenian_o + KEY_Armenian_FE = C.GDK_KEY_Armenian_FE + KEY_Armenian_fe = C.GDK_KEY_Armenian_fe + KEY_Armenian_apostrophe = C.GDK_KEY_Armenian_apostrophe + KEY_Georgian_an = C.GDK_KEY_Georgian_an + KEY_Georgian_ban = C.GDK_KEY_Georgian_ban + KEY_Georgian_gan = C.GDK_KEY_Georgian_gan + KEY_Georgian_don = C.GDK_KEY_Georgian_don + KEY_Georgian_en = C.GDK_KEY_Georgian_en + KEY_Georgian_vin = C.GDK_KEY_Georgian_vin + KEY_Georgian_zen = C.GDK_KEY_Georgian_zen + KEY_Georgian_tan = C.GDK_KEY_Georgian_tan + KEY_Georgian_in = C.GDK_KEY_Georgian_in + KEY_Georgian_kan = C.GDK_KEY_Georgian_kan + KEY_Georgian_las = C.GDK_KEY_Georgian_las + KEY_Georgian_man = C.GDK_KEY_Georgian_man + KEY_Georgian_nar = C.GDK_KEY_Georgian_nar + KEY_Georgian_on = C.GDK_KEY_Georgian_on + KEY_Georgian_par = C.GDK_KEY_Georgian_par + KEY_Georgian_zhar = C.GDK_KEY_Georgian_zhar + KEY_Georgian_rae = C.GDK_KEY_Georgian_rae + KEY_Georgian_san = C.GDK_KEY_Georgian_san + KEY_Georgian_tar = C.GDK_KEY_Georgian_tar + KEY_Georgian_un = C.GDK_KEY_Georgian_un + KEY_Georgian_phar = C.GDK_KEY_Georgian_phar + KEY_Georgian_khar = C.GDK_KEY_Georgian_khar + KEY_Georgian_ghan = C.GDK_KEY_Georgian_ghan + KEY_Georgian_qar = C.GDK_KEY_Georgian_qar + KEY_Georgian_shin = C.GDK_KEY_Georgian_shin + KEY_Georgian_chin = C.GDK_KEY_Georgian_chin + KEY_Georgian_can = C.GDK_KEY_Georgian_can + KEY_Georgian_jil = C.GDK_KEY_Georgian_jil + KEY_Georgian_cil = C.GDK_KEY_Georgian_cil + KEY_Georgian_char = C.GDK_KEY_Georgian_char + KEY_Georgian_xan = C.GDK_KEY_Georgian_xan + KEY_Georgian_jhan = C.GDK_KEY_Georgian_jhan + KEY_Georgian_hae = C.GDK_KEY_Georgian_hae + KEY_Georgian_he = C.GDK_KEY_Georgian_he + KEY_Georgian_hie = C.GDK_KEY_Georgian_hie + KEY_Georgian_we = C.GDK_KEY_Georgian_we + KEY_Georgian_har = C.GDK_KEY_Georgian_har + KEY_Georgian_hoe = C.GDK_KEY_Georgian_hoe + KEY_Georgian_fi = C.GDK_KEY_Georgian_fi + KEY_Xabovedot = C.GDK_KEY_Xabovedot + KEY_Ibreve = C.GDK_KEY_Ibreve + KEY_Zstroke = C.GDK_KEY_Zstroke + KEY_Gcaron = C.GDK_KEY_Gcaron + KEY_Ocaron = C.GDK_KEY_Ocaron + KEY_Obarred = C.GDK_KEY_Obarred + KEY_xabovedot = C.GDK_KEY_xabovedot + KEY_ibreve = C.GDK_KEY_ibreve + KEY_zstroke = C.GDK_KEY_zstroke + KEY_gcaron = C.GDK_KEY_gcaron + KEY_ocaron = C.GDK_KEY_ocaron + KEY_obarred = C.GDK_KEY_obarred + KEY_SCHWA = C.GDK_KEY_SCHWA + KEY_schwa = C.GDK_KEY_schwa + KEY_EZH = C.GDK_KEY_EZH + KEY_ezh = C.GDK_KEY_ezh + KEY_Lbelowdot = C.GDK_KEY_Lbelowdot + KEY_lbelowdot = C.GDK_KEY_lbelowdot + KEY_Abelowdot = C.GDK_KEY_Abelowdot + KEY_abelowdot = C.GDK_KEY_abelowdot + KEY_Ahook = C.GDK_KEY_Ahook + KEY_ahook = C.GDK_KEY_ahook + KEY_Acircumflexacute = C.GDK_KEY_Acircumflexacute + KEY_acircumflexacute = C.GDK_KEY_acircumflexacute + KEY_Acircumflexgrave = C.GDK_KEY_Acircumflexgrave + KEY_acircumflexgrave = C.GDK_KEY_acircumflexgrave + KEY_Acircumflexhook = C.GDK_KEY_Acircumflexhook + KEY_acircumflexhook = C.GDK_KEY_acircumflexhook + KEY_Acircumflextilde = C.GDK_KEY_Acircumflextilde + KEY_acircumflextilde = C.GDK_KEY_acircumflextilde + KEY_Acircumflexbelowdot = C.GDK_KEY_Acircumflexbelowdot + KEY_acircumflexbelowdot = C.GDK_KEY_acircumflexbelowdot + KEY_Abreveacute = C.GDK_KEY_Abreveacute + KEY_abreveacute = C.GDK_KEY_abreveacute + KEY_Abrevegrave = C.GDK_KEY_Abrevegrave + KEY_abrevegrave = C.GDK_KEY_abrevegrave + KEY_Abrevehook = C.GDK_KEY_Abrevehook + KEY_abrevehook = C.GDK_KEY_abrevehook + KEY_Abrevetilde = C.GDK_KEY_Abrevetilde + KEY_abrevetilde = C.GDK_KEY_abrevetilde + KEY_Abrevebelowdot = C.GDK_KEY_Abrevebelowdot + KEY_abrevebelowdot = C.GDK_KEY_abrevebelowdot + KEY_Ebelowdot = C.GDK_KEY_Ebelowdot + KEY_ebelowdot = C.GDK_KEY_ebelowdot + KEY_Ehook = C.GDK_KEY_Ehook + KEY_ehook = C.GDK_KEY_ehook + KEY_Etilde = C.GDK_KEY_Etilde + KEY_etilde = C.GDK_KEY_etilde + KEY_Ecircumflexacute = C.GDK_KEY_Ecircumflexacute + KEY_ecircumflexacute = C.GDK_KEY_ecircumflexacute + KEY_Ecircumflexgrave = C.GDK_KEY_Ecircumflexgrave + KEY_ecircumflexgrave = C.GDK_KEY_ecircumflexgrave + KEY_Ecircumflexhook = C.GDK_KEY_Ecircumflexhook + KEY_ecircumflexhook = C.GDK_KEY_ecircumflexhook + KEY_Ecircumflextilde = C.GDK_KEY_Ecircumflextilde + KEY_ecircumflextilde = C.GDK_KEY_ecircumflextilde + KEY_Ecircumflexbelowdot = C.GDK_KEY_Ecircumflexbelowdot + KEY_ecircumflexbelowdot = C.GDK_KEY_ecircumflexbelowdot + KEY_Ihook = C.GDK_KEY_Ihook + KEY_ihook = C.GDK_KEY_ihook + KEY_Ibelowdot = C.GDK_KEY_Ibelowdot + KEY_ibelowdot = C.GDK_KEY_ibelowdot + KEY_Obelowdot = C.GDK_KEY_Obelowdot + KEY_obelowdot = C.GDK_KEY_obelowdot + KEY_Ohook = C.GDK_KEY_Ohook + KEY_ohook = C.GDK_KEY_ohook + KEY_Ocircumflexacute = C.GDK_KEY_Ocircumflexacute + KEY_ocircumflexacute = C.GDK_KEY_ocircumflexacute + KEY_Ocircumflexgrave = C.GDK_KEY_Ocircumflexgrave + KEY_ocircumflexgrave = C.GDK_KEY_ocircumflexgrave + KEY_Ocircumflexhook = C.GDK_KEY_Ocircumflexhook + KEY_ocircumflexhook = C.GDK_KEY_ocircumflexhook + KEY_Ocircumflextilde = C.GDK_KEY_Ocircumflextilde + KEY_ocircumflextilde = C.GDK_KEY_ocircumflextilde + KEY_Ocircumflexbelowdot = C.GDK_KEY_Ocircumflexbelowdot + KEY_ocircumflexbelowdot = C.GDK_KEY_ocircumflexbelowdot + KEY_Ohornacute = C.GDK_KEY_Ohornacute + KEY_ohornacute = C.GDK_KEY_ohornacute + KEY_Ohorngrave = C.GDK_KEY_Ohorngrave + KEY_ohorngrave = C.GDK_KEY_ohorngrave + KEY_Ohornhook = C.GDK_KEY_Ohornhook + KEY_ohornhook = C.GDK_KEY_ohornhook + KEY_Ohorntilde = C.GDK_KEY_Ohorntilde + KEY_ohorntilde = C.GDK_KEY_ohorntilde + KEY_Ohornbelowdot = C.GDK_KEY_Ohornbelowdot + KEY_ohornbelowdot = C.GDK_KEY_ohornbelowdot + KEY_Ubelowdot = C.GDK_KEY_Ubelowdot + KEY_ubelowdot = C.GDK_KEY_ubelowdot + KEY_Uhook = C.GDK_KEY_Uhook + KEY_uhook = C.GDK_KEY_uhook + KEY_Uhornacute = C.GDK_KEY_Uhornacute + KEY_uhornacute = C.GDK_KEY_uhornacute + KEY_Uhorngrave = C.GDK_KEY_Uhorngrave + KEY_uhorngrave = C.GDK_KEY_uhorngrave + KEY_Uhornhook = C.GDK_KEY_Uhornhook + KEY_uhornhook = C.GDK_KEY_uhornhook + KEY_Uhorntilde = C.GDK_KEY_Uhorntilde + KEY_uhorntilde = C.GDK_KEY_uhorntilde + KEY_Uhornbelowdot = C.GDK_KEY_Uhornbelowdot + KEY_uhornbelowdot = C.GDK_KEY_uhornbelowdot + KEY_Ybelowdot = C.GDK_KEY_Ybelowdot + KEY_ybelowdot = C.GDK_KEY_ybelowdot + KEY_Yhook = C.GDK_KEY_Yhook + KEY_yhook = C.GDK_KEY_yhook + KEY_Ytilde = C.GDK_KEY_Ytilde + KEY_ytilde = C.GDK_KEY_ytilde + KEY_Ohorn = C.GDK_KEY_Ohorn + KEY_ohorn = C.GDK_KEY_ohorn + KEY_Uhorn = C.GDK_KEY_Uhorn + KEY_uhorn = C.GDK_KEY_uhorn + KEY_EcuSign = C.GDK_KEY_EcuSign + KEY_ColonSign = C.GDK_KEY_ColonSign + KEY_CruzeiroSign = C.GDK_KEY_CruzeiroSign + KEY_FFrancSign = C.GDK_KEY_FFrancSign + KEY_LiraSign = C.GDK_KEY_LiraSign + KEY_MillSign = C.GDK_KEY_MillSign + KEY_NairaSign = C.GDK_KEY_NairaSign + KEY_PesetaSign = C.GDK_KEY_PesetaSign + KEY_RupeeSign = C.GDK_KEY_RupeeSign + KEY_WonSign = C.GDK_KEY_WonSign + KEY_NewSheqelSign = C.GDK_KEY_NewSheqelSign + KEY_DongSign = C.GDK_KEY_DongSign + KEY_EuroSign = C.GDK_KEY_EuroSign + KEY_zerosuperior = C.GDK_KEY_zerosuperior + KEY_foursuperior = C.GDK_KEY_foursuperior + KEY_fivesuperior = C.GDK_KEY_fivesuperior + KEY_sixsuperior = C.GDK_KEY_sixsuperior + KEY_sevensuperior = C.GDK_KEY_sevensuperior + KEY_eightsuperior = C.GDK_KEY_eightsuperior + KEY_ninesuperior = C.GDK_KEY_ninesuperior + KEY_zerosubscript = C.GDK_KEY_zerosubscript + KEY_onesubscript = C.GDK_KEY_onesubscript + KEY_twosubscript = C.GDK_KEY_twosubscript + KEY_threesubscript = C.GDK_KEY_threesubscript + KEY_foursubscript = C.GDK_KEY_foursubscript + KEY_fivesubscript = C.GDK_KEY_fivesubscript + KEY_sixsubscript = C.GDK_KEY_sixsubscript + KEY_sevensubscript = C.GDK_KEY_sevensubscript + KEY_eightsubscript = C.GDK_KEY_eightsubscript + KEY_ninesubscript = C.GDK_KEY_ninesubscript + KEY_partdifferential = C.GDK_KEY_partdifferential + KEY_emptyset = C.GDK_KEY_emptyset + KEY_elementof = C.GDK_KEY_elementof + KEY_notelementof = C.GDK_KEY_notelementof + KEY_containsas = C.GDK_KEY_containsas + KEY_squareroot = C.GDK_KEY_squareroot + KEY_cuberoot = C.GDK_KEY_cuberoot + KEY_fourthroot = C.GDK_KEY_fourthroot + KEY_dintegral = C.GDK_KEY_dintegral + KEY_tintegral = C.GDK_KEY_tintegral + KEY_because = C.GDK_KEY_because + KEY_approxeq = C.GDK_KEY_approxeq + KEY_notapproxeq = C.GDK_KEY_notapproxeq + KEY_notidentical = C.GDK_KEY_notidentical + KEY_stricteq = C.GDK_KEY_stricteq + KEY_braille_dot_1 = C.GDK_KEY_braille_dot_1 + KEY_braille_dot_2 = C.GDK_KEY_braille_dot_2 + KEY_braille_dot_3 = C.GDK_KEY_braille_dot_3 + KEY_braille_dot_4 = C.GDK_KEY_braille_dot_4 + KEY_braille_dot_5 = C.GDK_KEY_braille_dot_5 + KEY_braille_dot_6 = C.GDK_KEY_braille_dot_6 + KEY_braille_dot_7 = C.GDK_KEY_braille_dot_7 + KEY_braille_dot_8 = C.GDK_KEY_braille_dot_8 + KEY_braille_dot_9 = C.GDK_KEY_braille_dot_9 + KEY_braille_dot_10 = C.GDK_KEY_braille_dot_10 + KEY_braille_blank = C.GDK_KEY_braille_blank + KEY_braille_dots_1 = C.GDK_KEY_braille_dots_1 + KEY_braille_dots_2 = C.GDK_KEY_braille_dots_2 + KEY_braille_dots_12 = C.GDK_KEY_braille_dots_12 + KEY_braille_dots_3 = C.GDK_KEY_braille_dots_3 + KEY_braille_dots_13 = C.GDK_KEY_braille_dots_13 + KEY_braille_dots_23 = C.GDK_KEY_braille_dots_23 + KEY_braille_dots_123 = C.GDK_KEY_braille_dots_123 + KEY_braille_dots_4 = C.GDK_KEY_braille_dots_4 + KEY_braille_dots_14 = C.GDK_KEY_braille_dots_14 + KEY_braille_dots_24 = C.GDK_KEY_braille_dots_24 + KEY_braille_dots_124 = C.GDK_KEY_braille_dots_124 + KEY_braille_dots_34 = C.GDK_KEY_braille_dots_34 + KEY_braille_dots_134 = C.GDK_KEY_braille_dots_134 + KEY_braille_dots_234 = C.GDK_KEY_braille_dots_234 + KEY_braille_dots_1234 = C.GDK_KEY_braille_dots_1234 + KEY_braille_dots_5 = C.GDK_KEY_braille_dots_5 + KEY_braille_dots_15 = C.GDK_KEY_braille_dots_15 + KEY_braille_dots_25 = C.GDK_KEY_braille_dots_25 + KEY_braille_dots_125 = C.GDK_KEY_braille_dots_125 + KEY_braille_dots_35 = C.GDK_KEY_braille_dots_35 + KEY_braille_dots_135 = C.GDK_KEY_braille_dots_135 + KEY_braille_dots_235 = C.GDK_KEY_braille_dots_235 + KEY_braille_dots_1235 = C.GDK_KEY_braille_dots_1235 + KEY_braille_dots_45 = C.GDK_KEY_braille_dots_45 + KEY_braille_dots_145 = C.GDK_KEY_braille_dots_145 + KEY_braille_dots_245 = C.GDK_KEY_braille_dots_245 + KEY_braille_dots_1245 = C.GDK_KEY_braille_dots_1245 + KEY_braille_dots_345 = C.GDK_KEY_braille_dots_345 + KEY_braille_dots_1345 = C.GDK_KEY_braille_dots_1345 + KEY_braille_dots_2345 = C.GDK_KEY_braille_dots_2345 + KEY_braille_dots_12345 = C.GDK_KEY_braille_dots_12345 + KEY_braille_dots_6 = C.GDK_KEY_braille_dots_6 + KEY_braille_dots_16 = C.GDK_KEY_braille_dots_16 + KEY_braille_dots_26 = C.GDK_KEY_braille_dots_26 + KEY_braille_dots_126 = C.GDK_KEY_braille_dots_126 + KEY_braille_dots_36 = C.GDK_KEY_braille_dots_36 + KEY_braille_dots_136 = C.GDK_KEY_braille_dots_136 + KEY_braille_dots_236 = C.GDK_KEY_braille_dots_236 + KEY_braille_dots_1236 = C.GDK_KEY_braille_dots_1236 + KEY_braille_dots_46 = C.GDK_KEY_braille_dots_46 + KEY_braille_dots_146 = C.GDK_KEY_braille_dots_146 + KEY_braille_dots_246 = C.GDK_KEY_braille_dots_246 + KEY_braille_dots_1246 = C.GDK_KEY_braille_dots_1246 + KEY_braille_dots_346 = C.GDK_KEY_braille_dots_346 + KEY_braille_dots_1346 = C.GDK_KEY_braille_dots_1346 + KEY_braille_dots_2346 = C.GDK_KEY_braille_dots_2346 + KEY_braille_dots_12346 = C.GDK_KEY_braille_dots_12346 + KEY_braille_dots_56 = C.GDK_KEY_braille_dots_56 + KEY_braille_dots_156 = C.GDK_KEY_braille_dots_156 + KEY_braille_dots_256 = C.GDK_KEY_braille_dots_256 + KEY_braille_dots_1256 = C.GDK_KEY_braille_dots_1256 + KEY_braille_dots_356 = C.GDK_KEY_braille_dots_356 + KEY_braille_dots_1356 = C.GDK_KEY_braille_dots_1356 + KEY_braille_dots_2356 = C.GDK_KEY_braille_dots_2356 + KEY_braille_dots_12356 = C.GDK_KEY_braille_dots_12356 + KEY_braille_dots_456 = C.GDK_KEY_braille_dots_456 + KEY_braille_dots_1456 = C.GDK_KEY_braille_dots_1456 + KEY_braille_dots_2456 = C.GDK_KEY_braille_dots_2456 + KEY_braille_dots_12456 = C.GDK_KEY_braille_dots_12456 + KEY_braille_dots_3456 = C.GDK_KEY_braille_dots_3456 + KEY_braille_dots_13456 = C.GDK_KEY_braille_dots_13456 + KEY_braille_dots_23456 = C.GDK_KEY_braille_dots_23456 + KEY_braille_dots_123456 = C.GDK_KEY_braille_dots_123456 + KEY_braille_dots_7 = C.GDK_KEY_braille_dots_7 + KEY_braille_dots_17 = C.GDK_KEY_braille_dots_17 + KEY_braille_dots_27 = C.GDK_KEY_braille_dots_27 + KEY_braille_dots_127 = C.GDK_KEY_braille_dots_127 + KEY_braille_dots_37 = C.GDK_KEY_braille_dots_37 + KEY_braille_dots_137 = C.GDK_KEY_braille_dots_137 + KEY_braille_dots_237 = C.GDK_KEY_braille_dots_237 + KEY_braille_dots_1237 = C.GDK_KEY_braille_dots_1237 + KEY_braille_dots_47 = C.GDK_KEY_braille_dots_47 + KEY_braille_dots_147 = C.GDK_KEY_braille_dots_147 + KEY_braille_dots_247 = C.GDK_KEY_braille_dots_247 + KEY_braille_dots_1247 = C.GDK_KEY_braille_dots_1247 + KEY_braille_dots_347 = C.GDK_KEY_braille_dots_347 + KEY_braille_dots_1347 = C.GDK_KEY_braille_dots_1347 + KEY_braille_dots_2347 = C.GDK_KEY_braille_dots_2347 + KEY_braille_dots_12347 = C.GDK_KEY_braille_dots_12347 + KEY_braille_dots_57 = C.GDK_KEY_braille_dots_57 + KEY_braille_dots_157 = C.GDK_KEY_braille_dots_157 + KEY_braille_dots_257 = C.GDK_KEY_braille_dots_257 + KEY_braille_dots_1257 = C.GDK_KEY_braille_dots_1257 + KEY_braille_dots_357 = C.GDK_KEY_braille_dots_357 + KEY_braille_dots_1357 = C.GDK_KEY_braille_dots_1357 + KEY_braille_dots_2357 = C.GDK_KEY_braille_dots_2357 + KEY_braille_dots_12357 = C.GDK_KEY_braille_dots_12357 + KEY_braille_dots_457 = C.GDK_KEY_braille_dots_457 + KEY_braille_dots_1457 = C.GDK_KEY_braille_dots_1457 + KEY_braille_dots_2457 = C.GDK_KEY_braille_dots_2457 + KEY_braille_dots_12457 = C.GDK_KEY_braille_dots_12457 + KEY_braille_dots_3457 = C.GDK_KEY_braille_dots_3457 + KEY_braille_dots_13457 = C.GDK_KEY_braille_dots_13457 + KEY_braille_dots_23457 = C.GDK_KEY_braille_dots_23457 + KEY_braille_dots_123457 = C.GDK_KEY_braille_dots_123457 + KEY_braille_dots_67 = C.GDK_KEY_braille_dots_67 + KEY_braille_dots_167 = C.GDK_KEY_braille_dots_167 + KEY_braille_dots_267 = C.GDK_KEY_braille_dots_267 + KEY_braille_dots_1267 = C.GDK_KEY_braille_dots_1267 + KEY_braille_dots_367 = C.GDK_KEY_braille_dots_367 + KEY_braille_dots_1367 = C.GDK_KEY_braille_dots_1367 + KEY_braille_dots_2367 = C.GDK_KEY_braille_dots_2367 + KEY_braille_dots_12367 = C.GDK_KEY_braille_dots_12367 + KEY_braille_dots_467 = C.GDK_KEY_braille_dots_467 + KEY_braille_dots_1467 = C.GDK_KEY_braille_dots_1467 + KEY_braille_dots_2467 = C.GDK_KEY_braille_dots_2467 + KEY_braille_dots_12467 = C.GDK_KEY_braille_dots_12467 + KEY_braille_dots_3467 = C.GDK_KEY_braille_dots_3467 + KEY_braille_dots_13467 = C.GDK_KEY_braille_dots_13467 + KEY_braille_dots_23467 = C.GDK_KEY_braille_dots_23467 + KEY_braille_dots_123467 = C.GDK_KEY_braille_dots_123467 + KEY_braille_dots_567 = C.GDK_KEY_braille_dots_567 + KEY_braille_dots_1567 = C.GDK_KEY_braille_dots_1567 + KEY_braille_dots_2567 = C.GDK_KEY_braille_dots_2567 + KEY_braille_dots_12567 = C.GDK_KEY_braille_dots_12567 + KEY_braille_dots_3567 = C.GDK_KEY_braille_dots_3567 + KEY_braille_dots_13567 = C.GDK_KEY_braille_dots_13567 + KEY_braille_dots_23567 = C.GDK_KEY_braille_dots_23567 + KEY_braille_dots_123567 = C.GDK_KEY_braille_dots_123567 + KEY_braille_dots_4567 = C.GDK_KEY_braille_dots_4567 + KEY_braille_dots_14567 = C.GDK_KEY_braille_dots_14567 + KEY_braille_dots_24567 = C.GDK_KEY_braille_dots_24567 + KEY_braille_dots_124567 = C.GDK_KEY_braille_dots_124567 + KEY_braille_dots_34567 = C.GDK_KEY_braille_dots_34567 + KEY_braille_dots_134567 = C.GDK_KEY_braille_dots_134567 + KEY_braille_dots_234567 = C.GDK_KEY_braille_dots_234567 + KEY_braille_dots_1234567 = C.GDK_KEY_braille_dots_1234567 + KEY_braille_dots_8 = C.GDK_KEY_braille_dots_8 + KEY_braille_dots_18 = C.GDK_KEY_braille_dots_18 + KEY_braille_dots_28 = C.GDK_KEY_braille_dots_28 + KEY_braille_dots_128 = C.GDK_KEY_braille_dots_128 + KEY_braille_dots_38 = C.GDK_KEY_braille_dots_38 + KEY_braille_dots_138 = C.GDK_KEY_braille_dots_138 + KEY_braille_dots_238 = C.GDK_KEY_braille_dots_238 + KEY_braille_dots_1238 = C.GDK_KEY_braille_dots_1238 + KEY_braille_dots_48 = C.GDK_KEY_braille_dots_48 + KEY_braille_dots_148 = C.GDK_KEY_braille_dots_148 + KEY_braille_dots_248 = C.GDK_KEY_braille_dots_248 + KEY_braille_dots_1248 = C.GDK_KEY_braille_dots_1248 + KEY_braille_dots_348 = C.GDK_KEY_braille_dots_348 + KEY_braille_dots_1348 = C.GDK_KEY_braille_dots_1348 + KEY_braille_dots_2348 = C.GDK_KEY_braille_dots_2348 + KEY_braille_dots_12348 = C.GDK_KEY_braille_dots_12348 + KEY_braille_dots_58 = C.GDK_KEY_braille_dots_58 + KEY_braille_dots_158 = C.GDK_KEY_braille_dots_158 + KEY_braille_dots_258 = C.GDK_KEY_braille_dots_258 + KEY_braille_dots_1258 = C.GDK_KEY_braille_dots_1258 + KEY_braille_dots_358 = C.GDK_KEY_braille_dots_358 + KEY_braille_dots_1358 = C.GDK_KEY_braille_dots_1358 + KEY_braille_dots_2358 = C.GDK_KEY_braille_dots_2358 + KEY_braille_dots_12358 = C.GDK_KEY_braille_dots_12358 + KEY_braille_dots_458 = C.GDK_KEY_braille_dots_458 + KEY_braille_dots_1458 = C.GDK_KEY_braille_dots_1458 + KEY_braille_dots_2458 = C.GDK_KEY_braille_dots_2458 + KEY_braille_dots_12458 = C.GDK_KEY_braille_dots_12458 + KEY_braille_dots_3458 = C.GDK_KEY_braille_dots_3458 + KEY_braille_dots_13458 = C.GDK_KEY_braille_dots_13458 + KEY_braille_dots_23458 = C.GDK_KEY_braille_dots_23458 + KEY_braille_dots_123458 = C.GDK_KEY_braille_dots_123458 + KEY_braille_dots_68 = C.GDK_KEY_braille_dots_68 + KEY_braille_dots_168 = C.GDK_KEY_braille_dots_168 + KEY_braille_dots_268 = C.GDK_KEY_braille_dots_268 + KEY_braille_dots_1268 = C.GDK_KEY_braille_dots_1268 + KEY_braille_dots_368 = C.GDK_KEY_braille_dots_368 + KEY_braille_dots_1368 = C.GDK_KEY_braille_dots_1368 + KEY_braille_dots_2368 = C.GDK_KEY_braille_dots_2368 + KEY_braille_dots_12368 = C.GDK_KEY_braille_dots_12368 + KEY_braille_dots_468 = C.GDK_KEY_braille_dots_468 + KEY_braille_dots_1468 = C.GDK_KEY_braille_dots_1468 + KEY_braille_dots_2468 = C.GDK_KEY_braille_dots_2468 + KEY_braille_dots_12468 = C.GDK_KEY_braille_dots_12468 + KEY_braille_dots_3468 = C.GDK_KEY_braille_dots_3468 + KEY_braille_dots_13468 = C.GDK_KEY_braille_dots_13468 + KEY_braille_dots_23468 = C.GDK_KEY_braille_dots_23468 + KEY_braille_dots_123468 = C.GDK_KEY_braille_dots_123468 + KEY_braille_dots_568 = C.GDK_KEY_braille_dots_568 + KEY_braille_dots_1568 = C.GDK_KEY_braille_dots_1568 + KEY_braille_dots_2568 = C.GDK_KEY_braille_dots_2568 + KEY_braille_dots_12568 = C.GDK_KEY_braille_dots_12568 + KEY_braille_dots_3568 = C.GDK_KEY_braille_dots_3568 + KEY_braille_dots_13568 = C.GDK_KEY_braille_dots_13568 + KEY_braille_dots_23568 = C.GDK_KEY_braille_dots_23568 + KEY_braille_dots_123568 = C.GDK_KEY_braille_dots_123568 + KEY_braille_dots_4568 = C.GDK_KEY_braille_dots_4568 + KEY_braille_dots_14568 = C.GDK_KEY_braille_dots_14568 + KEY_braille_dots_24568 = C.GDK_KEY_braille_dots_24568 + KEY_braille_dots_124568 = C.GDK_KEY_braille_dots_124568 + KEY_braille_dots_34568 = C.GDK_KEY_braille_dots_34568 + KEY_braille_dots_134568 = C.GDK_KEY_braille_dots_134568 + KEY_braille_dots_234568 = C.GDK_KEY_braille_dots_234568 + KEY_braille_dots_1234568 = C.GDK_KEY_braille_dots_1234568 + KEY_braille_dots_78 = C.GDK_KEY_braille_dots_78 + KEY_braille_dots_178 = C.GDK_KEY_braille_dots_178 + KEY_braille_dots_278 = C.GDK_KEY_braille_dots_278 + KEY_braille_dots_1278 = C.GDK_KEY_braille_dots_1278 + KEY_braille_dots_378 = C.GDK_KEY_braille_dots_378 + KEY_braille_dots_1378 = C.GDK_KEY_braille_dots_1378 + KEY_braille_dots_2378 = C.GDK_KEY_braille_dots_2378 + KEY_braille_dots_12378 = C.GDK_KEY_braille_dots_12378 + KEY_braille_dots_478 = C.GDK_KEY_braille_dots_478 + KEY_braille_dots_1478 = C.GDK_KEY_braille_dots_1478 + KEY_braille_dots_2478 = C.GDK_KEY_braille_dots_2478 + KEY_braille_dots_12478 = C.GDK_KEY_braille_dots_12478 + KEY_braille_dots_3478 = C.GDK_KEY_braille_dots_3478 + KEY_braille_dots_13478 = C.GDK_KEY_braille_dots_13478 + KEY_braille_dots_23478 = C.GDK_KEY_braille_dots_23478 + KEY_braille_dots_123478 = C.GDK_KEY_braille_dots_123478 + KEY_braille_dots_578 = C.GDK_KEY_braille_dots_578 + KEY_braille_dots_1578 = C.GDK_KEY_braille_dots_1578 + KEY_braille_dots_2578 = C.GDK_KEY_braille_dots_2578 + KEY_braille_dots_12578 = C.GDK_KEY_braille_dots_12578 + KEY_braille_dots_3578 = C.GDK_KEY_braille_dots_3578 + KEY_braille_dots_13578 = C.GDK_KEY_braille_dots_13578 + KEY_braille_dots_23578 = C.GDK_KEY_braille_dots_23578 + KEY_braille_dots_123578 = C.GDK_KEY_braille_dots_123578 + KEY_braille_dots_4578 = C.GDK_KEY_braille_dots_4578 + KEY_braille_dots_14578 = C.GDK_KEY_braille_dots_14578 + KEY_braille_dots_24578 = C.GDK_KEY_braille_dots_24578 + KEY_braille_dots_124578 = C.GDK_KEY_braille_dots_124578 + KEY_braille_dots_34578 = C.GDK_KEY_braille_dots_34578 + KEY_braille_dots_134578 = C.GDK_KEY_braille_dots_134578 + KEY_braille_dots_234578 = C.GDK_KEY_braille_dots_234578 + KEY_braille_dots_1234578 = C.GDK_KEY_braille_dots_1234578 + KEY_braille_dots_678 = C.GDK_KEY_braille_dots_678 + KEY_braille_dots_1678 = C.GDK_KEY_braille_dots_1678 + KEY_braille_dots_2678 = C.GDK_KEY_braille_dots_2678 + KEY_braille_dots_12678 = C.GDK_KEY_braille_dots_12678 + KEY_braille_dots_3678 = C.GDK_KEY_braille_dots_3678 + KEY_braille_dots_13678 = C.GDK_KEY_braille_dots_13678 + KEY_braille_dots_23678 = C.GDK_KEY_braille_dots_23678 + KEY_braille_dots_123678 = C.GDK_KEY_braille_dots_123678 + KEY_braille_dots_4678 = C.GDK_KEY_braille_dots_4678 + KEY_braille_dots_14678 = C.GDK_KEY_braille_dots_14678 + KEY_braille_dots_24678 = C.GDK_KEY_braille_dots_24678 + KEY_braille_dots_124678 = C.GDK_KEY_braille_dots_124678 + KEY_braille_dots_34678 = C.GDK_KEY_braille_dots_34678 + KEY_braille_dots_134678 = C.GDK_KEY_braille_dots_134678 + KEY_braille_dots_234678 = C.GDK_KEY_braille_dots_234678 + KEY_braille_dots_1234678 = C.GDK_KEY_braille_dots_1234678 + KEY_braille_dots_5678 = C.GDK_KEY_braille_dots_5678 + KEY_braille_dots_15678 = C.GDK_KEY_braille_dots_15678 + KEY_braille_dots_25678 = C.GDK_KEY_braille_dots_25678 + KEY_braille_dots_125678 = C.GDK_KEY_braille_dots_125678 + KEY_braille_dots_35678 = C.GDK_KEY_braille_dots_35678 + KEY_braille_dots_135678 = C.GDK_KEY_braille_dots_135678 + KEY_braille_dots_235678 = C.GDK_KEY_braille_dots_235678 + KEY_braille_dots_1235678 = C.GDK_KEY_braille_dots_1235678 + KEY_braille_dots_45678 = C.GDK_KEY_braille_dots_45678 + KEY_braille_dots_145678 = C.GDK_KEY_braille_dots_145678 + KEY_braille_dots_245678 = C.GDK_KEY_braille_dots_245678 + KEY_braille_dots_1245678 = C.GDK_KEY_braille_dots_1245678 + KEY_braille_dots_345678 = C.GDK_KEY_braille_dots_345678 + KEY_braille_dots_1345678 = C.GDK_KEY_braille_dots_1345678 + KEY_braille_dots_2345678 = C.GDK_KEY_braille_dots_2345678 + KEY_braille_dots_12345678 = C.GDK_KEY_braille_dots_12345678 + KEY_Sinh_ng = C.GDK_KEY_Sinh_ng + KEY_Sinh_h2 = C.GDK_KEY_Sinh_h2 + KEY_Sinh_a = C.GDK_KEY_Sinh_a + KEY_Sinh_aa = C.GDK_KEY_Sinh_aa + KEY_Sinh_ae = C.GDK_KEY_Sinh_ae + KEY_Sinh_aee = C.GDK_KEY_Sinh_aee + KEY_Sinh_i = C.GDK_KEY_Sinh_i + KEY_Sinh_ii = C.GDK_KEY_Sinh_ii + KEY_Sinh_u = C.GDK_KEY_Sinh_u + KEY_Sinh_uu = C.GDK_KEY_Sinh_uu + KEY_Sinh_ri = C.GDK_KEY_Sinh_ri + KEY_Sinh_rii = C.GDK_KEY_Sinh_rii + KEY_Sinh_lu = C.GDK_KEY_Sinh_lu + KEY_Sinh_luu = C.GDK_KEY_Sinh_luu + KEY_Sinh_e = C.GDK_KEY_Sinh_e + KEY_Sinh_ee = C.GDK_KEY_Sinh_ee + KEY_Sinh_ai = C.GDK_KEY_Sinh_ai + KEY_Sinh_o = C.GDK_KEY_Sinh_o + KEY_Sinh_oo = C.GDK_KEY_Sinh_oo + KEY_Sinh_au = C.GDK_KEY_Sinh_au + KEY_Sinh_ka = C.GDK_KEY_Sinh_ka + KEY_Sinh_kha = C.GDK_KEY_Sinh_kha + KEY_Sinh_ga = C.GDK_KEY_Sinh_ga + KEY_Sinh_gha = C.GDK_KEY_Sinh_gha + KEY_Sinh_ng2 = C.GDK_KEY_Sinh_ng2 + KEY_Sinh_nga = C.GDK_KEY_Sinh_nga + KEY_Sinh_ca = C.GDK_KEY_Sinh_ca + KEY_Sinh_cha = C.GDK_KEY_Sinh_cha + KEY_Sinh_ja = C.GDK_KEY_Sinh_ja + KEY_Sinh_jha = C.GDK_KEY_Sinh_jha + KEY_Sinh_nya = C.GDK_KEY_Sinh_nya + KEY_Sinh_jnya = C.GDK_KEY_Sinh_jnya + KEY_Sinh_nja = C.GDK_KEY_Sinh_nja + KEY_Sinh_tta = C.GDK_KEY_Sinh_tta + KEY_Sinh_ttha = C.GDK_KEY_Sinh_ttha + KEY_Sinh_dda = C.GDK_KEY_Sinh_dda + KEY_Sinh_ddha = C.GDK_KEY_Sinh_ddha + KEY_Sinh_nna = C.GDK_KEY_Sinh_nna + KEY_Sinh_ndda = C.GDK_KEY_Sinh_ndda + KEY_Sinh_tha = C.GDK_KEY_Sinh_tha + KEY_Sinh_thha = C.GDK_KEY_Sinh_thha + KEY_Sinh_dha = C.GDK_KEY_Sinh_dha + KEY_Sinh_dhha = C.GDK_KEY_Sinh_dhha + KEY_Sinh_na = C.GDK_KEY_Sinh_na + KEY_Sinh_ndha = C.GDK_KEY_Sinh_ndha + KEY_Sinh_pa = C.GDK_KEY_Sinh_pa + KEY_Sinh_pha = C.GDK_KEY_Sinh_pha + KEY_Sinh_ba = C.GDK_KEY_Sinh_ba + KEY_Sinh_bha = C.GDK_KEY_Sinh_bha + KEY_Sinh_ma = C.GDK_KEY_Sinh_ma + KEY_Sinh_mba = C.GDK_KEY_Sinh_mba + KEY_Sinh_ya = C.GDK_KEY_Sinh_ya + KEY_Sinh_ra = C.GDK_KEY_Sinh_ra + KEY_Sinh_la = C.GDK_KEY_Sinh_la + KEY_Sinh_va = C.GDK_KEY_Sinh_va + KEY_Sinh_sha = C.GDK_KEY_Sinh_sha + KEY_Sinh_ssha = C.GDK_KEY_Sinh_ssha + KEY_Sinh_sa = C.GDK_KEY_Sinh_sa + KEY_Sinh_ha = C.GDK_KEY_Sinh_ha + KEY_Sinh_lla = C.GDK_KEY_Sinh_lla + KEY_Sinh_fa = C.GDK_KEY_Sinh_fa + KEY_Sinh_al = C.GDK_KEY_Sinh_al + KEY_Sinh_aa2 = C.GDK_KEY_Sinh_aa2 + KEY_Sinh_ae2 = C.GDK_KEY_Sinh_ae2 + KEY_Sinh_aee2 = C.GDK_KEY_Sinh_aee2 + KEY_Sinh_i2 = C.GDK_KEY_Sinh_i2 + KEY_Sinh_ii2 = C.GDK_KEY_Sinh_ii2 + KEY_Sinh_u2 = C.GDK_KEY_Sinh_u2 + KEY_Sinh_uu2 = C.GDK_KEY_Sinh_uu2 + KEY_Sinh_ru2 = C.GDK_KEY_Sinh_ru2 + KEY_Sinh_e2 = C.GDK_KEY_Sinh_e2 + KEY_Sinh_ee2 = C.GDK_KEY_Sinh_ee2 + KEY_Sinh_ai2 = C.GDK_KEY_Sinh_ai2 + KEY_Sinh_o2 = C.GDK_KEY_Sinh_o2 + KEY_Sinh_oo2 = C.GDK_KEY_Sinh_oo2 + KEY_Sinh_au2 = C.GDK_KEY_Sinh_au2 + KEY_Sinh_lu2 = C.GDK_KEY_Sinh_lu2 + KEY_Sinh_ruu2 = C.GDK_KEY_Sinh_ruu2 + KEY_Sinh_luu2 = C.GDK_KEY_Sinh_luu2 + KEY_Sinh_kunddaliya = C.GDK_KEY_Sinh_kunddaliya + KEY_ModeLock = C.GDK_KEY_ModeLock + KEY_MonBrightnessUp = C.GDK_KEY_MonBrightnessUp + KEY_MonBrightnessDown = C.GDK_KEY_MonBrightnessDown + KEY_KbdLightOnOff = C.GDK_KEY_KbdLightOnOff + KEY_KbdBrightnessUp = C.GDK_KEY_KbdBrightnessUp + KEY_KbdBrightnessDown = C.GDK_KEY_KbdBrightnessDown + KEY_Standby = C.GDK_KEY_Standby + KEY_AudioLowerVolume = C.GDK_KEY_AudioLowerVolume + KEY_AudioMute = C.GDK_KEY_AudioMute + KEY_AudioRaiseVolume = C.GDK_KEY_AudioRaiseVolume + KEY_AudioPlay = C.GDK_KEY_AudioPlay + KEY_AudioStop = C.GDK_KEY_AudioStop + KEY_AudioPrev = C.GDK_KEY_AudioPrev + KEY_AudioNext = C.GDK_KEY_AudioNext + KEY_HomePage = C.GDK_KEY_HomePage + KEY_Mail = C.GDK_KEY_Mail + KEY_Start = C.GDK_KEY_Start + KEY_Search = C.GDK_KEY_Search + KEY_AudioRecord = C.GDK_KEY_AudioRecord + KEY_Calculator = C.GDK_KEY_Calculator + KEY_Memo = C.GDK_KEY_Memo + KEY_ToDoList = C.GDK_KEY_ToDoList + KEY_Calendar = C.GDK_KEY_Calendar + KEY_PowerDown = C.GDK_KEY_PowerDown + KEY_ContrastAdjust = C.GDK_KEY_ContrastAdjust + KEY_RockerUp = C.GDK_KEY_RockerUp + KEY_RockerDown = C.GDK_KEY_RockerDown + KEY_RockerEnter = C.GDK_KEY_RockerEnter + KEY_Back = C.GDK_KEY_Back + KEY_Forward = C.GDK_KEY_Forward + KEY_Stop = C.GDK_KEY_Stop + KEY_Refresh = C.GDK_KEY_Refresh + KEY_PowerOff = C.GDK_KEY_PowerOff + KEY_WakeUp = C.GDK_KEY_WakeUp + KEY_Eject = C.GDK_KEY_Eject + KEY_ScreenSaver = C.GDK_KEY_ScreenSaver + KEY_WWW = C.GDK_KEY_WWW + KEY_Sleep = C.GDK_KEY_Sleep + KEY_Favorites = C.GDK_KEY_Favorites + KEY_AudioPause = C.GDK_KEY_AudioPause + KEY_AudioMedia = C.GDK_KEY_AudioMedia + KEY_MyComputer = C.GDK_KEY_MyComputer + KEY_VendorHome = C.GDK_KEY_VendorHome + KEY_LightBulb = C.GDK_KEY_LightBulb + KEY_Shop = C.GDK_KEY_Shop + KEY_History = C.GDK_KEY_History + KEY_OpenURL = C.GDK_KEY_OpenURL + KEY_AddFavorite = C.GDK_KEY_AddFavorite + KEY_HotLinks = C.GDK_KEY_HotLinks + KEY_BrightnessAdjust = C.GDK_KEY_BrightnessAdjust + KEY_Finance = C.GDK_KEY_Finance + KEY_Community = C.GDK_KEY_Community + KEY_AudioRewind = C.GDK_KEY_AudioRewind + KEY_BackForward = C.GDK_KEY_BackForward + KEY_Launch0 = C.GDK_KEY_Launch0 + KEY_Launch1 = C.GDK_KEY_Launch1 + KEY_Launch2 = C.GDK_KEY_Launch2 + KEY_Launch3 = C.GDK_KEY_Launch3 + KEY_Launch4 = C.GDK_KEY_Launch4 + KEY_Launch5 = C.GDK_KEY_Launch5 + KEY_Launch6 = C.GDK_KEY_Launch6 + KEY_Launch7 = C.GDK_KEY_Launch7 + KEY_Launch8 = C.GDK_KEY_Launch8 + KEY_Launch9 = C.GDK_KEY_Launch9 + KEY_LaunchA = C.GDK_KEY_LaunchA + KEY_LaunchB = C.GDK_KEY_LaunchB + KEY_LaunchC = C.GDK_KEY_LaunchC + KEY_LaunchD = C.GDK_KEY_LaunchD + KEY_LaunchE = C.GDK_KEY_LaunchE + KEY_LaunchF = C.GDK_KEY_LaunchF + KEY_ApplicationLeft = C.GDK_KEY_ApplicationLeft + KEY_ApplicationRight = C.GDK_KEY_ApplicationRight + KEY_Book = C.GDK_KEY_Book + KEY_CD = C.GDK_KEY_CD + KEY_WindowClear = C.GDK_KEY_WindowClear + KEY_Close = C.GDK_KEY_Close + KEY_Copy = C.GDK_KEY_Copy + KEY_Cut = C.GDK_KEY_Cut + KEY_Display = C.GDK_KEY_Display + KEY_DOS = C.GDK_KEY_DOS + KEY_Documents = C.GDK_KEY_Documents + KEY_Excel = C.GDK_KEY_Excel + KEY_Explorer = C.GDK_KEY_Explorer + KEY_Game = C.GDK_KEY_Game + KEY_Go = C.GDK_KEY_Go + KEY_iTouch = C.GDK_KEY_iTouch + KEY_LogOff = C.GDK_KEY_LogOff + KEY_Market = C.GDK_KEY_Market + KEY_Meeting = C.GDK_KEY_Meeting + KEY_MenuKB = C.GDK_KEY_MenuKB + KEY_MenuPB = C.GDK_KEY_MenuPB + KEY_MySites = C.GDK_KEY_MySites + KEY_New = C.GDK_KEY_New + KEY_News = C.GDK_KEY_News + KEY_OfficeHome = C.GDK_KEY_OfficeHome + KEY_Open = C.GDK_KEY_Open + KEY_Option = C.GDK_KEY_Option + KEY_Paste = C.GDK_KEY_Paste + KEY_Phone = C.GDK_KEY_Phone + KEY_Reply = C.GDK_KEY_Reply + KEY_Reload = C.GDK_KEY_Reload + KEY_RotateWindows = C.GDK_KEY_RotateWindows + KEY_RotationPB = C.GDK_KEY_RotationPB + KEY_RotationKB = C.GDK_KEY_RotationKB + KEY_Save = C.GDK_KEY_Save + KEY_ScrollUp = C.GDK_KEY_ScrollUp + KEY_ScrollDown = C.GDK_KEY_ScrollDown + KEY_ScrollClick = C.GDK_KEY_ScrollClick + KEY_Send = C.GDK_KEY_Send + KEY_Spell = C.GDK_KEY_Spell + KEY_SplitScreen = C.GDK_KEY_SplitScreen + KEY_Support = C.GDK_KEY_Support + KEY_TaskPane = C.GDK_KEY_TaskPane + KEY_Terminal = C.GDK_KEY_Terminal + KEY_Tools = C.GDK_KEY_Tools + KEY_Travel = C.GDK_KEY_Travel + KEY_UserPB = C.GDK_KEY_UserPB + KEY_User1KB = C.GDK_KEY_User1KB + KEY_User2KB = C.GDK_KEY_User2KB + KEY_Video = C.GDK_KEY_Video + KEY_WheelButton = C.GDK_KEY_WheelButton + KEY_Word = C.GDK_KEY_Word + KEY_Xfer = C.GDK_KEY_Xfer + KEY_ZoomIn = C.GDK_KEY_ZoomIn + KEY_ZoomOut = C.GDK_KEY_ZoomOut + KEY_Away = C.GDK_KEY_Away + KEY_Messenger = C.GDK_KEY_Messenger + KEY_WebCam = C.GDK_KEY_WebCam + KEY_MailForward = C.GDK_KEY_MailForward + KEY_Pictures = C.GDK_KEY_Pictures + KEY_Music = C.GDK_KEY_Music + KEY_Battery = C.GDK_KEY_Battery + KEY_Bluetooth = C.GDK_KEY_Bluetooth + KEY_WLAN = C.GDK_KEY_WLAN + KEY_UWB = C.GDK_KEY_UWB + KEY_AudioForward = C.GDK_KEY_AudioForward + KEY_AudioRepeat = C.GDK_KEY_AudioRepeat + KEY_AudioRandomPlay = C.GDK_KEY_AudioRandomPlay + KEY_Subtitle = C.GDK_KEY_Subtitle + KEY_AudioCycleTrack = C.GDK_KEY_AudioCycleTrack + KEY_CycleAngle = C.GDK_KEY_CycleAngle + KEY_FrameBack = C.GDK_KEY_FrameBack + KEY_FrameForward = C.GDK_KEY_FrameForward + KEY_Time = C.GDK_KEY_Time + KEY_SelectButton = C.GDK_KEY_SelectButton + KEY_View = C.GDK_KEY_View + KEY_TopMenu = C.GDK_KEY_TopMenu + KEY_Red = C.GDK_KEY_Red + KEY_Green = C.GDK_KEY_Green + KEY_Yellow = C.GDK_KEY_Yellow + KEY_Blue = C.GDK_KEY_Blue + KEY_Suspend = C.GDK_KEY_Suspend + KEY_Hibernate = C.GDK_KEY_Hibernate + KEY_TouchpadToggle = C.GDK_KEY_TouchpadToggle + KEY_TouchpadOn = C.GDK_KEY_TouchpadOn + KEY_TouchpadOff = C.GDK_KEY_TouchpadOff + KEY_Switch_VT_1 = C.GDK_KEY_Switch_VT_1 + KEY_Switch_VT_2 = C.GDK_KEY_Switch_VT_2 + KEY_Switch_VT_3 = C.GDK_KEY_Switch_VT_3 + KEY_Switch_VT_4 = C.GDK_KEY_Switch_VT_4 + KEY_Switch_VT_5 = C.GDK_KEY_Switch_VT_5 + KEY_Switch_VT_6 = C.GDK_KEY_Switch_VT_6 + KEY_Switch_VT_7 = C.GDK_KEY_Switch_VT_7 + KEY_Switch_VT_8 = C.GDK_KEY_Switch_VT_8 + KEY_Switch_VT_9 = C.GDK_KEY_Switch_VT_9 + KEY_Switch_VT_10 = C.GDK_KEY_Switch_VT_10 + KEY_Switch_VT_11 = C.GDK_KEY_Switch_VT_11 + KEY_Switch_VT_12 = C.GDK_KEY_Switch_VT_12 + KEY_Ungrab = C.GDK_KEY_Ungrab + KEY_ClearGrab = C.GDK_KEY_ClearGrab + KEY_Next_VMode = C.GDK_KEY_Next_VMode + KEY_Prev_VMode = C.GDK_KEY_Prev_VMode + KEY_LogWindowTree = C.GDK_KEY_LogWindowTree + KEY_LogGrabInfo = C.GDK_KEY_LogGrabInfo +) From 04222b5df0a5c13645a15838048cf6d3965b7024 Mon Sep 17 00:00:00 2001 From: raichu Date: Tue, 24 Sep 2013 11:30:55 +0900 Subject: [PATCH 17/23] implement more bits of the propsed event system --- gdk/gdk.go | 84 ++++++++++++++++++++++++++++++++++++++-------------- gdk/gdk.go.h | 12 ++++++++ 2 files changed, 74 insertions(+), 22 deletions(-) diff --git a/gdk/gdk.go b/gdk/gdk.go index 470ccb0..82bc474 100644 --- a/gdk/gdk.go +++ b/gdk/gdk.go @@ -416,65 +416,105 @@ func (v *Event) free() { C.gdk_event_free(v.Native()) } +type EventType C.GdkEventType + func ToEvent(c glib.CallbackArg) *Event { + // TODO: check Type field and confirm it's a valid one. return &Event{GdkEvent: (*C.GdkEvent)(unsafe.Pointer(c))} } +// TODO It is possible to use Type field in various places. + func (v *Event) Configure() *EventConfigure { + // TODO: check Type field and confirm it's a valid one. c := C.toGdkEventConfigure(v.Native()) return &EventConfigure{ Type: EventType(c._type), Window: &Window{(*glib.Object)(unsafe.Pointer(c.window))}, SendEvent: int8(c.send_event), - X: int(c.x), - Y: int(c.y), - Width: int(c.width), - Height: int(c.height), + X: int32(c.x), + Y: int32(c.y), + Width: int32(c.width), + Height: int32(c.height), } } func (v *Event) Key() *EventKey { + // TODO: check Type field and confirm it's a valid one. c := C.toGdkEventKey(v.Native()) return &EventKey{ Type: EventType(c._type), Window: &Window{(*glib.Object)(unsafe.Pointer(c.window))}, SendEvent: int8(c.send_event), - Time: int32(c.time), - State: int(c.state), - Keyval: int(c.keyval), - Length: int(c.length), + Time: uint32(c.time), + State: uint32(c.state), + Keyval: uint32(c.keyval), + Length: int32(c.length), String: C.GoString((*C.char)(c.string)), HardwareKeycode: uint16(c.hardware_keycode), Group: uint8(c.group), - //IsModifier: c.is_modifier != 0, + IsModifier: gobool(C.getGdkEventKeyIsModifier(c)), } } -type EventType C.GdkEventType - -type EventConfigure struct { - Type EventType - Window *Window - SendEvent int8 - X, Y int - Width int - Height int +func free(p unsafe.Pointer) { + C.free(p) } type EventKey struct { Type EventType Window *Window SendEvent int8 - Time int32 - State int - Keyval int - Length int + Time uint32 + State uint32 + Keyval uint32 + Length int32 String string HardwareKeycode uint16 Group uint8 IsModifier bool } +func (v *EventKey) toNative() *C.GdkEventKey { + c := &C.GdkEventKey{ + _type: C.GdkEventType(v.Type), + window: v.Window.Native(), + send_event: C.gint8(v.SendEvent), + time: C.guint32(v.Time), + state: C.guint(v.State), + keyval: C.guint(v.Keyval), + length: C.gint(v.Length), + string: (*C.gchar)(C.CString(v.String)), + hardware_keycode: C.guint16(v.HardwareKeycode), + group: C.guint8(v.Group), + } + + C.setGdkEventKeyIsModifier(c, gbool(v.IsModifier)) + runtime.SetFinalizer(unsafe.Pointer(c.string), free) + return c +} + +type EventConfigure struct { + Type EventType + Window *Window + SendEvent int8 + X, Y int32 + Width int32 + Height int32 +} + +func (v *EventConfigure) toNative() *C.GdkEventConfigure { + return &C.GdkEventConfigure{ + _type: C.GdkEventType(v.Type), + window: v.Window.Native(), + send_event: C.gint8(v.SendEvent), + x: C.gint(v.X), + y: C.gint(v.Y), + width: C.gint(v.Width), + height: C.gint(v.Height), + } +} + /* * GdkScreen */ diff --git a/gdk/gdk.go.h b/gdk/gdk.go.h index 2ee215a..f2ed0a4 100644 --- a/gdk/gdk.go.h +++ b/gdk/gdk.go.h @@ -66,3 +66,15 @@ toGdkEventKey(GdkEvent *p) { return &p->key; } + +static gboolean +getGdkEventKeyIsModifier(GdkEventKey *p) +{ + return p->is_modifier; +} + +static gboolean +setGdkEventKeyIsModifier(GdkEventKey *p, gboolean b) +{ + return p->is_modifier = b; +} From 54698487ce8444abe58eab7df0a3e63464547913 Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 24 Oct 2013 10:25:12 +0900 Subject: [PATCH 18/23] temporarily allow deprecated stuff (oh and thank you gtk devs, for breaking backwards compatibility in the same major version) --- gdk/gdk.go | 1 + gtk/gtk.go | 1 + 2 files changed, 2 insertions(+) diff --git a/gdk/gdk.go b/gdk/gdk.go index 01ad7e3..23477e1 100644 --- a/gdk/gdk.go +++ b/gdk/gdk.go @@ -20,6 +20,7 @@ package gdk // #cgo pkg-config: gdk-3.0 // #include // #include "gdk.go.h" +// #cgo CFLAGS: -Wno-deprecated-declarations import "C" import ( "errors" diff --git a/gtk/gtk.go b/gtk/gtk.go index 850b0b8..367316b 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -47,6 +47,7 @@ package gtk // #cgo pkg-config: gtk+-3.0 // #include // #include "gtk.go.h" +// #cgo CFLAGS: -Wno-deprecated-declarations import "C" import ( "errors" From abb5248776062a1a97b0449edaacf04d1d39ecb1 Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 24 Oct 2013 11:20:41 +0900 Subject: [PATCH 19/23] goodbye GtkImageMenuItem (also remove -Wno-deprecated-declarations) --- gdk/gdk.go | 1 - gtk/gtk.go | 33 --------------------------------- gtk/gtk.go.h | 6 ------ gtk/gtk_3_8.go | 5 +++++ 4 files changed, 5 insertions(+), 40 deletions(-) diff --git a/gdk/gdk.go b/gdk/gdk.go index 23477e1..01ad7e3 100644 --- a/gdk/gdk.go +++ b/gdk/gdk.go @@ -20,7 +20,6 @@ package gdk // #cgo pkg-config: gdk-3.0 // #include // #include "gdk.go.h" -// #cgo CFLAGS: -Wno-deprecated-declarations import "C" import ( "errors" diff --git a/gtk/gtk.go b/gtk/gtk.go index c749968..4dbc9c1 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -47,7 +47,6 @@ package gtk // #cgo pkg-config: gtk+-3.0 // #include // #include "gtk.go.h" -// #cgo CFLAGS: -Wno-deprecated-declarations import "C" import ( "errors" @@ -1498,11 +1497,6 @@ func (v *Container) Remove(w IWidget) { C.gtk_container_remove(v.Native(), w.toWidget()) } -// ResizeChildren is a wrapper around gtk_container_resize_children(). -func (v *Container) ResizeChildren() { - C.gtk_container_resize_children(v.Native()) -} - /* * GtkDialog */ @@ -3118,31 +3112,6 @@ func (v *MenuItem) SetSubmenu(submenu IWidget) { C.gtk_menu_item_set_submenu(v.Native(), submenu.toWidget()) } -/* - * GtkImageMenuItem - */ - -// ImageMenuItem is a representation of GTK's GtkImageMenuItem. -type ImageMenuItem struct { - MenuItem -} - -// Native returns a pointer to the underlying GtkImageMenuItem. -func (v *ImageMenuItem) Native() *C.GtkImageMenuItem { - if v == nil || v.GObject == nil { - return nil - } - p := unsafe.Pointer(v.GObject) - return C.toGtkImageMenuItem(p) -} - -func wrapImageMenuItem(obj *glib.Object) *ImageMenuItem { - return &ImageMenuItem{MenuItem{Bin{Container{Widget{ - glib.InitiallyUnowned{obj}}}}}} -} - -// TODO: ImageMenuItem functions. - /* * GtkCheckMenuItem */ @@ -5257,8 +5226,6 @@ func cast(c *C.GObject) (glib.IObject, error) { g = wrapMenuBar(obj) case "GtkMenuItem": g = wrapMenuItem(obj) - case "GtkImageMenuItem": - g = wrapImageMenuItem(obj) case "GtkCheckMenuItem": g = wrapCheckMenuItem(obj) case "GtkMenuShell": diff --git a/gtk/gtk.go.h b/gtk/gtk.go.h index c9a56cd..3c99c3c 100644 --- a/gtk/gtk.go.h +++ b/gtk/gtk.go.h @@ -152,12 +152,6 @@ toGtkMenuItem(void *p) return (GTK_MENU_ITEM(p)); } -static GtkImageMenuItem * -toGtkImageMenuItem(void *p) -{ - return (GTK_IMAGE_MENU_ITEM(p)); -} - static GtkCheckMenuItem * toGtkCheckMenuItem(void *p) { diff --git a/gtk/gtk_3_8.go b/gtk/gtk_3_8.go index 7038316..28ad22c 100644 --- a/gtk/gtk_3_8.go +++ b/gtk/gtk_3_8.go @@ -212,3 +212,8 @@ const ( STOCK_ZOOM_IN Stock = C.GTK_STOCK_ZOOM_IN STOCK_ZOOM_OUT Stock = C.GTK_STOCK_ZOOM_OUT ) + +// ResizeChildren is a wrapper around gtk_container_resize_children(). +func (v *Container) ResizeChildren() { + C.gtk_container_resize_children(v.Native()) +} From f465d42dbe8cfccffae17095fd8a97a93ede5ba7 Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 24 Oct 2013 15:16:30 +0900 Subject: [PATCH 20/23] implement more GtkScrollbar and GtkRange methods --- gtk/gtk.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/gtk/gtk.go b/gtk/gtk.go index 4dbc9c1..0f9c587 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -3857,6 +3857,26 @@ func wrapRange(obj *glib.Object) *Range { return &Range{Widget{glib.InitiallyUnowned{obj}}} } +// GetValue() is a wrapper around gtk_scrolled_window_new(). +func (v *Range) GetValue() float64 { + return float64(C.gtk_range_get_value(v.Native())) +} + +// SetValue() is a wrapper around gtk_scrolled_window_new(). +func (v *Range) SetValue(value float64) { + C.gtk_range_set_value(v.Native(), C.gdouble(value)) +} + +// SetIncrements() is a wrapper around gtk_range_set_increments(). +func (v *Range) SetIncrements(step, page float64) { + C.gtk_range_set_increments(v.Native(), C.gdouble(step), C.gdouble(page)) +} + +// SetRange() is a wrapper around gtk_range_set_range(). +func (v *Range) SetRange(min, max float64) { + C.gtk_range_set_range(v.Native(), C.gdouble(min), C.gdouble(max)) +} + /* * GtkScrollbar */ @@ -4114,6 +4134,17 @@ func (v *SpinButton) GetValue() float64 { return float64(c) } +// SetRange() is a wrapper around gtk_spin_button_set_range(). +func (v *SpinButton) SetRange(min, max float64) { + C.gtk_spin_button_set_range(v.Native(), C.gdouble(min), C.gdouble(max)) +} + +// SetIncrements() is a wrapper around gtk_spin_button_set_range(). +func (v *SpinButton) SetIncrements(step, page float64) { + C.gtk_spin_button_set_increments(v.Native(), C.gdouble(step), C.gdouble(page)) +} + + /* * GtkStatusbar */ From 96b8f4dde51272be13f7a8d9886bba6688a10f25 Mon Sep 17 00:00:00 2001 From: raichu Date: Wed, 30 Oct 2013 11:04:21 +0900 Subject: [PATCH 21/23] Added RadioMenuItem --- gtk/gtk.go | 21 +++++++++++++++++++++ gtk/gtk.go.h | 6 ++++++ 2 files changed, 27 insertions(+) diff --git a/gtk/gtk.go b/gtk/gtk.go index 0f9c587..d16057d 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -3145,6 +3145,25 @@ func (v *CheckMenuItem) SetActive(active bool) { // TODO: CheckMenuItem functions. +// RadioMenuItem is a representation of GTK's GtkRadioMenuItem. +type RadioMenuItem struct { + CheckMenuItem +} + +// Native returns a pointer to the underlying GtkRadioMenuItem. +func (v *RadioMenuItem) Native() *C.GtkRadioMenuItem { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkRadioMenuItem(p) +} + +func wrapRadioMenuItem(obj *glib.Object) *RadioMenuItem { + return &RadioMenuItem{CheckMenuItem{MenuItem{Bin{Container{Widget{ + glib.InitiallyUnowned{obj}}}}}}} +} + /* * GtkMenuShell */ @@ -5259,6 +5278,8 @@ func cast(c *C.GObject) (glib.IObject, error) { g = wrapMenuItem(obj) case "GtkCheckMenuItem": g = wrapCheckMenuItem(obj) + case "GtkRadioMenuItem": + g = wrapRadioMenuItem(obj) case "GtkMenuShell": g = wrapMenuShell(obj) case "GtkMessageDialog": diff --git a/gtk/gtk.go.h b/gtk/gtk.go.h index 3c99c3c..5809d29 100644 --- a/gtk/gtk.go.h +++ b/gtk/gtk.go.h @@ -158,6 +158,12 @@ toGtkCheckMenuItem(void *p) return (GTK_CHECK_MENU_ITEM(p)); } +static GtkRadioMenuItem * +toGtkRadioMenuItem(void *p) +{ + return (GTK_RADIO_MENU_ITEM(p)); +} + static GtkMenu * toGtkMenu(void *p) { From 8ec5ccfe77d79c43b49371a11c3a93a43eea76cb Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 31 Oct 2013 14:50:05 +0900 Subject: [PATCH 22/23] bindings for gdk_pixbuf_save (SavePNG and SaveJPEG) --- gdkpixbuf/gdkpixbuf.go | 37 +++++++++++++++++++++++++++++++++++++ gdkpixbuf/gdkpixbuf.go.h | 14 ++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/gdkpixbuf/gdkpixbuf.go b/gdkpixbuf/gdkpixbuf.go index cbf1ad5..702e43b 100644 --- a/gdkpixbuf/gdkpixbuf.go +++ b/gdkpixbuf/gdkpixbuf.go @@ -29,6 +29,7 @@ import ( "errors" "github.com/conformal/gotk3/glib" "runtime" + "strconv" "unsafe" ) @@ -199,6 +200,42 @@ func (v *Pixbuf) Flip(horizontal bool) (*Pixbuf, error) { return p, nil } +// SavePNG is a wrapper around gdk_pixbuf_save(). +// Compression is a number between 0...9 +func (v *Pixbuf) SavePNG(path string, compression int) error { + cpath := C.CString(path) + ccompression := C.CString(strconv.Itoa(compression)) + defer C.free(unsafe.Pointer(cpath)) + defer C.free(unsafe.Pointer(ccompression)) + + var cerr *C.GError + c := C._gdk_pixbuf_save_png(v.Native(), cpath, &cerr, ccompression); + if !gobool(c) { + defer C.g_error_free(cerr) + errstr := C.GoString((*C.char)(C.error_get_message(cerr))) + return errors.New(errstr) + } + return nil +} + +// SaveJPEG is a wrapper around gdk_pixbuf_save(). +// Quality is a number between 0...100 +func (v *Pixbuf) SaveJPEG(path string, quality int) error { + cpath := C.CString(path) + cquality := C.CString(strconv.Itoa(quality)) + defer C.free(unsafe.Pointer(cpath)) + defer C.free(unsafe.Pointer(cquality)) + + var cerr *C.GError + c := C._gdk_pixbuf_save_jpeg(v.Native(), cpath, &cerr, cquality); + if !gobool(c) { + defer C.g_error_free(cerr) + errstr := C.GoString((*C.char)(C.error_get_message(cerr))) + return errors.New(errstr) + } + return nil +} + // GetWidth is a wrapper around gdk_pixbuf_get_width(). func (v *Pixbuf) GetWidth() int { return int(C.gdk_pixbuf_get_width(v.Native())) diff --git a/gdkpixbuf/gdkpixbuf.go.h b/gdkpixbuf/gdkpixbuf.go.h index 6260ed5..1e9678d 100644 --- a/gdkpixbuf/gdkpixbuf.go.h +++ b/gdkpixbuf/gdkpixbuf.go.h @@ -36,3 +36,17 @@ error_get_message(GError *error) { return error->message; } + +static gboolean +_gdk_pixbuf_save_png(GdkPixbuf *pixbuf, +const char *filename, GError ** err, const char *compression) +{ + return gdk_pixbuf_save(pixbuf, filename, "png", err, "compression", compression, NULL); +} + +static gboolean +_gdk_pixbuf_save_jpeg(GdkPixbuf *pixbuf, +const char *filename, GError ** err, const char *quality) +{ + return gdk_pixbuf_save(pixbuf, filename, "jpeg", err, "quality", quality, NULL); +} \ No newline at end of file From 60b745f799b8af9cee928f00e986bd53f6c65f31 Mon Sep 17 00:00:00 2001 From: raichu Date: Thu, 31 Oct 2013 16:47:27 +0900 Subject: [PATCH 23/23] More Adjustment and ScrolledWindow functions --- gtk/gtk.go | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/gtk/gtk.go b/gtk/gtk.go index d16057d..ff1d550 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -409,6 +409,23 @@ func (v *Adjustment) GetPageSize() float64 { return float64(C.gtk_adjustment_get_page_size(v.Native())) } +// Configure is a wrapper around gtk_adjustment_configure(). +func (v *Adjustment) Configure(value, lower, upper, stepIncrement, pageIncrement, pageSize float64) { + C.gtk_adjustment_configure(v.Native(), C.gdouble(value), + C.gdouble(lower), C.gdouble(upper), C.gdouble(stepIncrement), + C.gdouble(pageIncrement), C.gdouble(pageSize)) +} + +// SetValue is a wrapper around gtk_adjustment_set_value(). +func (v *Adjustment) SetValue(value float64) { + C.gtk_adjustment_set_value(v.Native(), C.gdouble(value)) +} + +// GetValue is a wrapper around gtk_adjustment_get_value(). +func (v *Adjustment) GetValue() float64 { + return float64(C.gtk_adjustment_get_value(v.Native())) +} + /* * GtkBin */ @@ -3257,6 +3274,11 @@ func wrapAboutDialog(obj *glib.Object) *AboutDialog { glib.InitiallyUnowned{obj}}}}}}} } +// SetLogo() is a wrapper around gtk_about_dialog_set_logo(). +func (v *AboutDialog) SetLogo(pixbuf *gdkpixbuf.Pixbuf) { + C.gtk_about_dialog_set_logo(v.Native(), pixbuf.Native()) +} + /* * GtkFileChooser */ @@ -3974,6 +3996,42 @@ func (v *ScrolledWindow) SetPolicy(hScrollbarPolicy, vScrollbarPolicy PolicyType C.GtkPolicyType(vScrollbarPolicy)) } +// SetHAdjustment is a wrapper around gtk_scrolled_window_set_hadjustment(). +func (v *ScrolledWindow) SetHAdjustment(adjustment *Adjustment) { + C.gtk_scrolled_window_set_hadjustment(v.Native(), adjustment.Native()) +} + +// GetHAdjustment is a wrapper around gtk_scrolled_window_get_hadjustment(). +func (v *ScrolledWindow) GetHAdjustment() (*Adjustment, error) { + c := C.gtk_scrolled_window_get_hadjustment(v.Native()) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + a := wrapAdjustment(obj) + obj.RefSink() + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return a, nil +} + +// SetVAdjustment is a wrapper around gtk_scrolled_window_set_vadjustment(). +func (v *ScrolledWindow) SetVAdjustment(adjustment *Adjustment) { + C.gtk_scrolled_window_set_vadjustment(v.Native(), adjustment.Native()) +} + +// GetVAdjustment is a wrapper around gtk_scrolled_window_get_vadjustment(). +func (v *ScrolledWindow) GetVAdjustment() (*Adjustment, error) { + c := C.gtk_scrolled_window_get_vadjustment(v.Native()) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + a := wrapAdjustment(obj) + obj.RefSink() + runtime.SetFinalizer(obj, (*glib.Object).Unref) + return a, nil +} + /* * GtkSearchEntry */ @@ -5177,6 +5235,11 @@ func (v *Window) SetDeletable(setting bool) { C.gtk_window_set_deletable(v.Native(), gbool(setting)) } +// SetIcon() is a wrapper around gtk_about_dialog_set_logo(). +func (v *Window) SetIcon(pixbuf *gdkpixbuf.Pixbuf) { + C.gtk_window_set_icon(v.Native(), pixbuf.Native()) +} + // TODO(jrick) GdkGeometry GdkWindowHints /* func (v *Window) SetGeometryHints() {