本文整理汇总了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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例13: GetSrc
func (m *Message) GetSrc() *GstObj {
src := new(GstObj)
src.SetPtr(glib.Pointer(m.src))
return src
}
示例14: NewEntry
func NewEntry() *Entry {
e := new(Entry)
e.SetPtr(glib.Pointer(C.gtk_entry_new()))
return e
}
示例15: NewButton
func NewButton() *Button {
b := new(Button)
b.SetPtr(glib.Pointer(C.gtk_button_new()))
return b
}