Example #1
0
func viewHandlesSliceToCArray(arr []View) (*C.wlc_handle, C.size_t) {
	carr := C.handle_array_init(C.size_t(len(arr)))
	for i, h := range arr {
		C.handle_array_insert(carr, C.wlc_handle(h), C.int(i))
	}

	return carr, C.size_t(len(arr))
}
Example #2
0
// GetClass gets class. (shell-surface only).
func (v View) GetClass() string {
	cclass := C.wlc_view_get_class(C.wlc_handle(v))
	return C.GoString(cclass)
}
Example #3
0
// GetMutableViews gets mutable views in creation order.
//This is mainly useful for wm's who need another view stack for inplace
//sorting. For example tiling wms, may want to use this to keep their tiling
//order separated from floating order.
func (o Output) GetMutableViews() []View {
	var len C.size_t
	handles := C.wlc_output_get_mutable_views(C.wlc_handle(o), &len)
	return viewHandlesCArraytoGoSlice(handles, int(len))
}
Example #4
0
// GetMask gets current visibility bitmask.
func (o Output) GetMask() uint32 {
	return uint32(C.wlc_output_get_mask(C.wlc_handle(o)))
}
Example #5
0
// SetResolution sets output resolution.
func (o Output) SetResolution(resolution Size, scale uint32) {
	csize := resolution.c()
	defer C.free(unsafe.Pointer(csize))
	C.wlc_output_set_resolution(C.wlc_handle(o), csize, C.uint32_t(scale))
}
Example #6
0
// SetSleep sets sleep status: wake up / sleep.
func (o Output) SetSleep(sleep bool) {
	C.wlc_output_set_sleep(C.wlc_handle(o), C._Bool(sleep))
}
Example #7
0
// Name gets output name.
func (o Output) Name() string {
	cname := C.wlc_output_get_name(C.wlc_handle(o))
	return C.GoString(cname)
}
Example #8
0
// SetType sets type bit. TOggle indicates whether it is set or not.
func (v View) SetType(typ ViewTypeBit, toggle bool) {
	C.wlc_view_set_type(C.wlc_handle(v), uint32(typ), C._Bool(toggle))
}
Example #9
0
// SendToBack sends view behind everything.
func (v View) SendToBack() {
	C.wlc_view_send_to_back(C.wlc_handle(v))
}
Example #10
0
// SetOutput sets output for view. Alternatively output.SetViews() can be used.
func (v View) SetOutput(output Output) {
	C.wlc_view_set_output(C.wlc_handle(v), C.wlc_handle(output))
}
Example #11
0
// GetOutput gets output of view.
func (v View) GetOutput() Output {
	return Output(C.wlc_view_get_output(C.wlc_handle(v)))
}
Example #12
0
// Close closes view.
func (v View) Close() {
	C.wlc_view_close(C.wlc_handle(v))
}
Example #13
0
// Focus focuses view.
func (v View) Focus() {
	C.wlc_view_focus(C.wlc_handle(v))
}
Example #14
0
// GetPID gets pid of program owning the view.
func (v View) GetPID() int {
	return int(C.wlc_view_get_pid(C.wlc_handle(v)))
}
Example #15
0
// GetAppID gets app id. (xdg-surface only).
func (v View) GetAppID() string {
	capp := C.wlc_view_get_app_id(C.wlc_handle(v))
	return C.GoString(capp)
}
Example #16
0
// SetGeometry sets geometry. Set edges if the geometry change is caused by
// interactive resize.
func (v View) SetGeometry(edges uint32, geometry Geometry) {
	cgeometry := geometry.c()
	defer C.free(unsafe.Pointer(cgeometry))
	C.wlc_view_set_geometry(C.wlc_handle(v), C.uint32_t(edges), cgeometry)
}
Example #17
0
// GetType gets type bitfield for view.
func (v View) GetType() uint32 {
	return uint32(C.wlc_view_get_type(C.wlc_handle(v)))
}
Example #18
0
// SendBelow sends view below another view.
func (v View) SendBelow(other View) {
	C.wlc_view_send_below(C.wlc_handle(v), C.wlc_handle(other))
}
Example #19
0
// Focus focuses output.
func (o Output) Focus() {
	C.wlc_output_focus(C.wlc_handle(o))
}
Example #20
0
// BringAbove brings view above another view.
func (v View) BringAbove(other View) {
	C.wlc_view_bring_above(C.wlc_handle(v), C.wlc_handle(other))
}
Example #21
0
// GetSleep gets output sleep state.
func (o Output) GetSleep() bool {
	return bool(C.wlc_output_get_sleep(C.wlc_handle(o)))
}
Example #22
0
// BringToFront brings view to front of everything.
func (v View) BringToFront() {
	C.wlc_view_bring_to_front(C.wlc_handle(v))
}
Example #23
0
// GetVirtualResolution gets virtual output resolution with transformations
// applied for proper rendering for example on high density displays.
// Use this to figure out coordinate boundary.
func (o Output) GetVirtualResolution() *Size {
	csize := C.wlc_output_get_virtual_resolution(C.wlc_handle(o))
	return sizeCtoGo(csize)
}
Example #24
0
// GetMask gets current visibility bitmask.
func (v View) GetMask() uint32 {
	return uint32(C.wlc_view_get_mask(C.wlc_handle(v)))
}
Example #25
0
// GetScale returns scale factor.
func (o Output) GetScale() uint32 {
	return uint32(C.wlc_output_get_scale(C.wlc_handle(o)))
}
Example #26
0
// SetMask sets visibility bitmask.
func (v View) SetMask(mask uint32) {
	C.wlc_view_set_mask(C.wlc_handle(v), C.uint32_t(mask))
}
Example #27
0
// SetMask sets visibility bitmask.
func (o Output) SetMask(mask uint32) {
	C.wlc_output_set_mask(C.wlc_handle(o), C.uint32_t(mask))
}
Example #28
0
// GetGeometry gets current geometry (what the client sees).
func (v View) GetGeometry() *Geometry {
	cgeometry := C.wlc_view_get_geometry(C.wlc_handle(v))
	return geometryCtoGo(&Geometry{}, cgeometry)
}
Example #29
0
// SetViews sets views in stack order. This will also change mutable
// views. Returns false on failure.
func (o Output) SetViews(views []View) bool {
	cviews, len := viewHandlesSliceToCArray(views)
	return bool(C.wlc_output_set_views(C.wlc_handle(o), cviews, len))
}
Example #30
0
// GetVisibleGeometry gets current visible geometry (what wlc displays).
func (v View) GetVisibleGeometry() Geometry {
	cgeometry := C.struct_wlc_geometry{}
	C.wlc_view_get_visible_geometry(C.wlc_handle(v), &cgeometry)
	return *geometryCtoGo(&Geometry{}, &cgeometry)
}