1// Same copyright and license as the rest of the files in this project
2
3// +build !glib_2_40
4
5package glib
6
7// #include <gio/gio.h>
8// #include <glib.h>
9// #include <glib-object.h>
10// #include "glib.go.h"
11import "C"
12import "unsafe"
13
14/*
15 * Notification
16 */
17
18// NotificationPriority is a representation of GLib's GNotificationPriority.
19type NotificationPriority int
20
21const (
22	NOTIFICATION_PRIORITY_NORMAL NotificationPriority = C.G_NOTIFICATION_PRIORITY_NORMAL
23	NOTIFICATION_PRIORITY_LOW    NotificationPriority = C.G_NOTIFICATION_PRIORITY_LOW
24	NOTIFICATION_PRIORITY_HIGH   NotificationPriority = C.G_NOTIFICATION_PRIORITY_HIGH
25	NOTIFICATION_PRIORITY_URGENT NotificationPriority = C.G_NOTIFICATION_PRIORITY_URGENT
26)
27
28// SetPriority is a wrapper around g_notification_set_priority().
29func (v *Notification) SetPriority(prio NotificationPriority) {
30	C.g_notification_set_priority(v.native(), C.GNotificationPriority(prio))
31}
32
33/*
34 * Application
35 */
36
37// GetResourceBasePath is a wrapper around g_application_get_resource_base_path().
38func (v *Application) GetResourceBasePath() string {
39	c := C.g_application_get_resource_base_path(v.native())
40
41	return C.GoString((*C.char)(c))
42}
43
44// SetResourceBasePath is a wrapper around g_application_set_resource_base_path().
45func (v *Application) SetResourceBasePath(bp string) {
46	cstr1 := (*C.gchar)(C.CString(bp))
47	defer C.free(unsafe.Pointer(cstr1))
48
49	C.g_application_set_resource_base_path(v.native(), cstr1)
50}
51