當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。