-
Notifications
You must be signed in to change notification settings - Fork 1
/
GNotification.go
48 lines (39 loc) · 978 Bytes
/
GNotification.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
//GNotification
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"
)
/*
* GNotification
*/
// Notification is a representation of GIO's GNotification.
type Notification struct {
*glib.Object
}
// native returns a pointer to the underlying GNotification.
func (v *Notification) native() *C.GNotification {
if v == nil || v.GObject == nil {
return nil
}
p := unsafe.Pointer(v.GObject)
return C.toGNotification(p)
}
func marshalNotification(p uintptr) (interface{}, error) {
c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p)))
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
return wrapNotification(obj), nil
}
func wrapNotification(obj *glib.Object) *Notification {
return &Notification{obj}
}
func (v *Notification) toNotification() *C.GNotification {
if v == nil {
return nil
}
return C.toGNotification(unsafe.Pointer(v.GObject))
}