当前位置: 首页>>代码示例>>Golang>>正文


Golang glib.Pointer函数代码示例

本文整理汇总了Golang中github.com/ziutek/glib.Pointer函数的典型用法代码示例。如果您正苦于以下问题:Golang Pointer函数的具体用法?Golang Pointer怎么用?Golang Pointer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Pointer函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: NewBin

func NewBin(name string) *Bin {
	s := (*C.gchar)(C.CString(name))
	defer C.free(unsafe.Pointer(s))
	b := new(Bin)
	b.SetPtr(glib.Pointer(C.gst_bin_new(s)))
	return b
}
开发者ID:revmischa,项目名称:gst,代码行数:7,代码来源:bin.go

示例2: NewGhostPadNoTarget

func NewGhostPadNoTarget(name string, dir PadDirection) *GhostPad {
	s := (*C.gchar)(C.CString(name))
	defer C.free(unsafe.Pointer(s))
	p := new(GhostPad)
	p.SetPtr(glib.Pointer(C.gst_ghost_pad_new_no_target(s, dir.g())))
	return p
}
开发者ID:revmischa,项目名称:gst,代码行数:7,代码来源:pad.go

示例3: NewButtonWithLabel

func NewButtonWithLabel(label string) *Button {
	b := new(Button)
	b.SetPtr(
		glib.Pointer(C.gtk_button_new_with_label((*C.gchar)(C.CString(label)))),
	)
	return b
}
开发者ID:ziutek,项目名称:gtk,代码行数:7,代码来源:button.go

示例4: NewButtonFromStock

func NewButtonFromStock(stock string) *Button {
	b := new(Button)
	b.SetPtr(
		glib.Pointer(C.gtk_button_new_from_stock((*C.gchar)(C.CString(stock)))),
	)
	return b
}
开发者ID:ziutek,项目名称:gtk,代码行数:7,代码来源:button.go

示例5: NewGhostPad

func NewGhostPad(name string, target *Pad) *GhostPad {
	s := (*C.gchar)(C.CString(name))
	defer C.free(unsafe.Pointer(s))
	p := new(GhostPad)
	p.SetPtr(glib.Pointer(C.gst_ghost_pad_new(s, target.g())))
	return p
}
开发者ID:revmischa,项目名称:gst,代码行数:7,代码来源:pad.go

示例6: NewFileChooserButton

func NewFileChooserButton(title string, action FileChooserAction) *FileChooserButton {
	f := new(FileChooserButton)
	f.SetPtr(glib.Pointer(C.gtk_file_chooser_button_new(
		(*C.gchar)(C.CString(title)),
		action.g(),
	)))
	return f
}
开发者ID:ziutek,项目名称:gtk,代码行数:8,代码来源:file_chooser_button.go

示例7: NewHBox

func NewHBox(homogeneous bool, spacing int) *HBox {
	b := new(HBox)
	var h C.gboolean
	if homogeneous {
		h = 1
	}
	b.SetPtr(glib.Pointer(C.gtk_hbox_new(h, C.gint(spacing))))
	return b
}
开发者ID:ziutek,项目名称:gtk,代码行数:9,代码来源:box.go

示例8: ElementFactoryMake

// TODO: Move ElementFactoryMake to element_factory.go
func ElementFactoryMake(factory_name, name string) *Element {
	fn := (*C.gchar)(C.CString(factory_name))
	defer C.free(unsafe.Pointer(fn))
	n := (*C.gchar)(C.CString(name))
	defer C.free(unsafe.Pointer(n))
	e := new(Element)
	e.SetPtr(glib.Pointer(C.gst_element_factory_make(fn, n)))
	return e
}
开发者ID:jmrobles,项目名称:gst,代码行数:10,代码来源:element.go

示例9: GetBus

func (e *Element) GetBus() *Bus {
	bus := C.gst_element_get_bus(e.g())
	if bus == nil {
		return nil
	}
	b := new(Bus)
	b.SetPtr(glib.Pointer(bus))
	return b
}
开发者ID:jmrobles,项目名称:gst,代码行数:9,代码来源:element.go

示例10: GetStaticPad

func (e *Element) GetStaticPad(name string) *Pad {
	s := (*C.gchar)(C.CString(name))
	defer C.free(unsafe.Pointer(s))
	cp := C.gst_element_get_static_pad(e.g(), s)
	if cp == nil {
		return nil
	}
	p := new(Pad)
	p.SetPtr(glib.Pointer(cp))
	return p
}
开发者ID:jmrobles,项目名称:gst,代码行数:11,代码来源:element.go

示例11: GetByName

// GetByName returns the element with the given name from a bin. Returns nil
// if no element with the given name is found in the bin.
func (b *Bin) GetByName(name string) *Element {
	en := (*C.gchar)(C.CString(name))
	defer C.free(unsafe.Pointer(en))
	p := glib.Pointer(C.gst_bin_get_by_name(b.g(), en))
	if p == nil {
		return nil
	}
	e := new(Element)
	e.SetPtr(p)
	return e
}
开发者ID:revmischa,项目名称:gst,代码行数:13,代码来源:bin.go

示例12: ParseBinFromDescription

// Similar to gst_parse_launch, but makes a bin instead of a pipeline
func ParseBinFromDescription(desc string) (*Bin, error) {
	en := (*C.gchar)(C.CString(desc))
	defer C.free(unsafe.Pointer(en))

	ghost_unlinked_pads := C.gboolean(1) // probably should be true? http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstParse.html#gst-parse-bin-from-description
	var Cerr *C.GError
	p := glib.Pointer(C.gst_parse_bin_from_description(en, ghost_unlinked_pads, &Cerr))
	if Cerr != nil {
		errStr := (*glib.Error)(unsafe.Pointer(Cerr)).Error()
		C.g_error_free(Cerr)
		return nil, errors.New(errStr)
	}
	if p == nil {
		return nil, nil
	}
	b := new(Bin)
	b.SetPtr(p)

	return b, nil
}
开发者ID:revmischa,项目名称:gst,代码行数:21,代码来源:bin.go

示例13: GetSrc

func (m *Message) GetSrc() *GstObj {
	src := new(GstObj)
	src.SetPtr(glib.Pointer(m.src))
	return src
}
开发者ID:TribeMedia,项目名称:gst,代码行数:5,代码来源:message.go

示例14: NewEntry

func NewEntry() *Entry {
	e := new(Entry)
	e.SetPtr(glib.Pointer(C.gtk_entry_new()))
	return e
}
开发者ID:ziutek,项目名称:gtk,代码行数:5,代码来源:entry.go

示例15: NewButton

func NewButton() *Button {
	b := new(Button)
	b.SetPtr(glib.Pointer(C.gtk_button_new()))
	return b
}
开发者ID:ziutek,项目名称:gtk,代码行数:5,代码来源:button.go


注:本文中的github.com/ziutek/glib.Pointer函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。