File: gmain_context.go

package info (click to toggle)
golang-github-gotk3-gotk3 0.6.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,392 kB
  • sloc: ansic: 914; makefile: 4
file content (65 lines) | stat: -rw-r--r-- 1,678 bytes parent folder | download | duplicates (2)
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
package glib

// #include <gio/gio.h>
// #include <glib.h>
// #include <glib-object.h>
// #include "glib.go.h"
import "C"

type MainContext C.GMainContext

// native returns a pointer to the underlying GMainContext.
func (v *MainContext) native() *C.GMainContext {
	if v == nil {
		return nil
	}
	return (*C.GMainContext)(v)
}

// MainContextDefault is a wrapper around g_main_context_default().
func MainContextDefault() *MainContext {
	c := C.g_main_context_default()
	if c == nil {
		return nil
	}
	return (*MainContext)(c)
}

// Iteration is a wrapper around g_main_context_iteration()
func (v *MainContext) Iteration(mayBlock bool) bool {
	return gobool(C.g_main_context_iteration(v.native(), gbool(mayBlock)))
}

// Pending is a wrapper around g_main_context_pending()
func (v *MainContext) Pending() bool {
	return gobool(C.g_main_context_pending(v.native()))
}

// MainDepth is a wrapper around g_main_depth().
func MainDepth() int {
	return int(C.g_main_depth())
}

// FindSourceById is a wrapper around g_main_context_find_source_by_id()
func (v *MainContext) FindSourceById(hdlSrc SourceHandle) *Source {
	c := C.g_main_context_find_source_by_id(v.native(), C.guint(hdlSrc))
	if c == nil {
		return nil
	}
	return (*Source)(c)
}

// Acquire is a wrapper around g_main_context_acquire().
func (v *MainContext) Acquire() bool {
	return gobool(C.g_main_context_acquire(v.native()))
}

// Release is a wrapper around g_main_context_release().
func (v *MainContext) Release() {
	C.g_main_context_release(v.native())
}

// IsOwner is a wrapper around g_main_context_is_owner().
func (v *MainContext) IsOwner() bool {
	return gobool(C.g_main_context_is_owner(v.native()))
}