作者:yamnikov-ole
项目:gotk
// AcceleratorParse is a wrapper around gtk_accelerator_parse().
func AcceleratorParse(acc string) (key uint, mods gdk.ModifierType) {
cstr := C.CString(acc)
defer C.free(unsafe.Pointer(cstr))
k := C.guint(0)
m := C.GdkModifierType(0)
C.gtk_accelerator_parse((*C.gchar)(cstr), &k, &m)
return uint(k), gdk.ModifierType(m)
}
作者:yamnikov-ole
项目:gotk
// Connect is a wrapper around gtk_accel_group_connect().
func (v *AccelGroup) Connect(key uint, mods gdk.ModifierType, flags AccelFlags, f interface{}) {
closure, _ := glib.ClosureNew(f)
cl := (*C.struct__GClosure)(unsafe.Pointer(closure))
C.gtk_accel_group_connect(
v.native(),
C.guint(key),
C.GdkModifierType(mods),
C.GtkAccelFlags(flags),
cl)
}
作者:yamnikov-ole
项目:gotk
// AddAccelerator is a wrapper around gtk_widget_add_accelerator().
func (v *Widget) AddAccelerator(signal string, group *AccelGroup, key uint, mods gdk.ModifierType, flags AccelFlags) {
csignal := (*C.gchar)(C.CString(signal))
defer C.free(unsafe.Pointer(csignal))
C.gtk_widget_add_accelerator(v.native(),
csignal,
group.native(),
C.guint(key),
C.GdkModifierType(mods),
C.GtkAccelFlags(flags))
}
作者:yamnikov-ole
项目:gotk
func (v *AccelKey) native() *C.struct__GtkAccelKey {
if v == nil {
return nil
}
var val C.struct__GtkAccelKey
val.accel_key = C.guint(v.key)
val.accel_mods = C.GdkModifierType(v.mods)
val.accel_flags = v.flags
return &val
}
作者:yamnikov-ole
项目:gotk
// AcceleratorSetDefaultModMask is a wrapper around gtk_accelerator_set_default_mod_mask().
func AcceleratorSetDefaultModMask(mods gdk.ModifierType) {
C.gtk_accelerator_set_default_mod_mask(C.GdkModifierType(mods))
}
作者:yamnikov-ole
项目:gotk
// AcceleratorGetLabel is a wrapper around gtk_accelerator_get_label().
func AcceleratorGetLabel(key uint, mods gdk.ModifierType) string {
c := C.gtk_accelerator_get_label(C.guint(key), C.GdkModifierType(mods))
defer C.free(unsafe.Pointer(c))
return C.GoString((*C.char)(c))
}
作者:yamnikov-ole
项目:gotk
// RemoveAccelerator is a wrapper around gtk_widget_remove_accelerator().
func (v *Widget) RemoveAccelerator(group *AccelGroup, key uint, mods gdk.ModifierType) bool {
return gobool(C.gtk_widget_remove_accelerator(v.native(),
group.native(),
C.guint(key),
C.GdkModifierType(mods)))
}
作者:yamnikov-ole
项目:gotk
// AcceleratorValid is a wrapper around gtk_accelerator_valid().
func AcceleratorValid(key uint, mods gdk.ModifierType) bool {
return gobool(C.gtk_accelerator_valid(C.guint(key), C.GdkModifierType(mods)))
}
作者:yamnikov-ole
项目:gotk
// AccelMapChangeEntry is a wrapper around gtk_accel_map_change_entry().
func AccelMapChangeEntry(path string, key uint, mods gdk.ModifierType, replace bool) bool {
cstr := C.CString(path)
defer C.free(unsafe.Pointer(cstr))
return gobool(C.gtk_accel_map_change_entry((*C.gchar)(cstr), C.guint(key), C.GdkModifierType(mods), gbool(replace)))
}
作者:yamnikov-ole
项目:gotk
// AccelMapAddEntry is a wrapper around gtk_accel_map_add_entry().
func AccelMapAddEntry(path string, key uint, mods gdk.ModifierType) {
cstr := C.CString(path)
defer C.free(unsafe.Pointer(cstr))
C.gtk_accel_map_add_entry((*C.gchar)(cstr), C.guint(key), C.GdkModifierType(mods))
}
作者:yamnikov-ole
项目:gotk
// Activate is a wrapper around gtk_accel_group_activate().
func (v *AccelGroup) Activate(quark glib.Quark, acceleratable *glib.Object, key uint, mods gdk.ModifierType) bool {
return gobool(C.gtk_accel_group_activate(v.native(), C.GQuark(quark), (*C.GObject)(unsafe.Pointer(acceleratable.Native())), C.guint(key), C.GdkModifierType(mods)))
}
作者:yamnikov-ole
项目:gotk
// AccelGroupsActivate is a wrapper around gtk_accel_groups_activate().
func AccelGroupsActivate(obj *glib.Object, key uint, mods gdk.ModifierType) bool {
return gobool(C.gtk_accel_groups_activate((*C.GObject)(unsafe.Pointer(obj.Native())), C.guint(key), C.GdkModifierType(mods)))
}
作者:yamnikov-ole
项目:gotk
// DisconnectKey is a wrapper around gtk_accel_group_disconnect_key().
func (v *AccelGroup) DisconnectKey(key uint, mods gdk.ModifierType) {
C.gtk_accel_group_disconnect_key(v.native(), C.guint(key), C.GdkModifierType(mods))
}
作者:reuse
项目:ggi
TOUCH_MASK = C.GdkEventMask(C.GDK_TOUCH_MASK)
SMOOTH_SCROLL_MASK = C.GdkEventMask(C.GDK_SMOOTH_SCROLL_MASK)
ALL_EVENTS_MASK = C.GdkEventMask(C.GDK_ALL_EVENTS_MASK)
// FrameClockPhase
FRAME_CLOCK_PHASE_NONE = C.GdkFrameClockPhase(C.GDK_FRAME_CLOCK_PHASE_NONE)
FRAME_CLOCK_PHASE_FLUSH_EVENTS = C.GdkFrameClockPhase(C.GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS)
FRAME_CLOCK_PHASE_BEFORE_PAINT = C.GdkFrameClockPhase(C.GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT)
FRAME_CLOCK_PHASE_UPDATE = C.GdkFrameClockPhase(C.GDK_FRAME_CLOCK_PHASE_UPDATE)
FRAME_CLOCK_PHASE_LAYOUT = C.GdkFrameClockPhase(C.GDK_FRAME_CLOCK_PHASE_LAYOUT)
FRAME_CLOCK_PHASE_PAINT = C.GdkFrameClockPhase(C.GDK_FRAME_CLOCK_PHASE_PAINT)
FRAME_CLOCK_PHASE_RESUME_EVENTS = C.GdkFrameClockPhase(C.GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS)
FRAME_CLOCK_PHASE_AFTER_PAINT = C.GdkFrameClockPhase(C.GDK_FRAME_CLOCK_PHASE_AFTER_PAINT)
// ModifierType
SHIFT_MASK = C.GdkModifierType(C.GDK_SHIFT_MASK)
LOCK_MASK = C.GdkModifierType(C.GDK_LOCK_MASK)
CONTROL_MASK = C.GdkModifierType(C.GDK_CONTROL_MASK)
MOD1_MASK = C.GdkModifierType(C.GDK_MOD1_MASK)
MOD2_MASK = C.GdkModifierType(C.GDK_MOD2_MASK)
MOD3_MASK = C.GdkModifierType(C.GDK_MOD3_MASK)
MOD4_MASK = C.GdkModifierType(C.GDK_MOD4_MASK)
MOD5_MASK = C.GdkModifierType(C.GDK_MOD5_MASK)
BUTTON1_MASK = C.GdkModifierType(C.GDK_BUTTON1_MASK)
BUTTON2_MASK = C.GdkModifierType(C.GDK_BUTTON2_MASK)
BUTTON3_MASK = C.GdkModifierType(C.GDK_BUTTON3_MASK)
BUTTON4_MASK = C.GdkModifierType(C.GDK_BUTTON4_MASK)
BUTTON5_MASK = C.GdkModifierType(C.GDK_BUTTON5_MASK)
MODIFIER_RESERVED_13_MASK = C.GdkModifierType(C.GDK_MODIFIER_RESERVED_13_MASK)
MODIFIER_RESERVED_14_MASK = C.GdkModifierType(C.GDK_MODIFIER_RESERVED_14_MASK)
MODIFIER_RESERVED_15_MASK = C.GdkModifierType(C.GDK_MODIFIER_RESERVED_15_MASK)