-
Notifications
You must be signed in to change notification settings - Fork 1
/
GMenu.go
101 lines (85 loc) · 2.26 KB
/
GMenu.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//GMenu : GMenu — A simple implementation of GMenuModel
package gio
// #cgo pkg-config: gio-2.0 glib-2.0
// #include <gio/gio.h>
// #include "gio.go.h"
import "C"
import (
"unsafe"
"github.com/gotk3/gotk3/glib"
)
func init() {
tm := []glib.TypeMarshaler{
// Enums
// Objects/Interfaces
{glib.Type(C.g_menu_get_type()), marshalMenu},
// Boxed
}
glib.RegisterGValueMarshalers(tm)
}
/*
* GMenu
*/
// Menu is a representation of GIO's GMenu.
type Menu struct {
MenuModel
}
// native returns a pointer to the underlying GMenu.
func (v *Menu) native() *C.GMenu {
if v == nil || v.GObject == nil {
return nil
}
p := unsafe.Pointer(v.GObject)
return C.toGMenu(p)
}
func marshalMenu(p uintptr) (interface{}, error) {
c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p)))
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
return wrapMenu(obj), nil
}
func wrapMenu(obj *glib.Object) *Menu {
return &Menu{MenuModel{obj}}
}
func (v *Menu) toMenu() *C.GMenu {
if v == nil {
return nil
}
return C.toGMenu(unsafe.Pointer(v.GObject))
}
func convertToMenu(c *C.GMenu) *Menu {
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
return wrapMenu(obj)
}
//GMenu * g_menu_new ()
//void g_menu_freeze ()
//void g_menu_insert ()
//void g_menu_prepend ()
//void g_menu_append ()
//void g_menu_insert_item ()
//void g_menu_append_item ()
//void g_menu_prepend_item ()
//void g_menu_insert_section ()
//void g_menu_prepend_section ()
//void g_menu_append_section ()
//void g_menu_append_submenu ()
//void g_menu_insert_submenu ()
//void g_menu_prepend_submenu ()
//void g_menu_remove ()
//void g_menu_remove_all ()
//GMenuItem * g_menu_item_new ()
//GMenuItem * g_menu_item_new_section ()
//GMenuItem * g_menu_item_new_submenu ()
//GMenuItem * g_menu_item_new_from_model ()
//void g_menu_item_set_label ()
//void g_menu_item_set_icon ()
//void g_menu_item_set_action_and_target_value ()
//void g_menu_item_set_action_and_target ()
//void g_menu_item_set_detailed_action ()
//void g_menu_item_set_section ()
//void g_menu_item_set_submenu ()
//GVariant * g_menu_item_get_attribute_value ()
//gboolean g_menu_item_get_attribute ()
//GMenuModel * g_menu_item_get_link ()
//void g_menu_item_set_attribute_value ()
//void g_menu_item_set_attribute ()
//void g_menu_item_set_link ()