cogl/auto/
object.rs

1use glib::object::IsA;
2use glib::translate::*;
3use std::fmt;
4
5glib_wrapper! {
6    pub struct Object(Object<ffi::CoglObject, ObjectClass>);
7
8    match fn {
9        get_type => || ffi::cogl_object_get_gtype(),
10    }
11}
12
13impl Object {
14    //pub fn ref_(object: /*Unimplemented*/Option<Fundamental: Pointer>) -> /*Unimplemented*/Option<Fundamental: Pointer> {
15    //    unsafe { TODO: call cogl_sys:cogl_object_ref() }
16    //}
17
18    //pub fn unref(object: /*Unimplemented*/Option<Fundamental: Pointer>) {
19    //    unsafe { TODO: call cogl_sys:cogl_object_unref() }
20    //}
21
22    //pub fn value_get_object(value: &glib::Value) -> /*Unimplemented*/Option<Fundamental: Pointer> {
23    //    unsafe { TODO: call cogl_sys:cogl_object_value_get_object() }
24    //}
25
26    //pub fn value_set_object(value: &mut glib::Value, object: /*Unimplemented*/Option<Fundamental: Pointer>) {
27    //    unsafe { TODO: call cogl_sys:cogl_object_value_set_object() }
28    //}
29}
30
31pub const NONE_OBJECT: Option<&Object> = None;
32
33/// Trait containing all `Object` methods.
34///
35/// # Implementors
36///
37/// [`AtlasTexture`](struct.AtlasTexture.html), [`AttributeBuffer`](struct.AttributeBuffer.html), [`Attribute`](struct.Attribute.html), [`Bitmap`](struct.Bitmap.html), [`Context`](struct.Context.html), [`Display`](struct.Display.html), [`FrameInfo`](struct.FrameInfo.html), [`Framebuffer`](struct.Framebuffer.html), [`GLES2Context`](struct.GLES2Context.html), [`IndexBuffer`](struct.IndexBuffer.html), [`Indices`](struct.Indices.html), [`MatrixStack`](struct.MatrixStack.html), [`Object`](struct.Object.html), [`OnscreenTemplate`](struct.OnscreenTemplate.html), [`Onscreen`](struct.Onscreen.html), [`Output`](struct.Output.html), [`Pipeline`](struct.Pipeline.html), [`PixelBuffer`](struct.PixelBuffer.html), [`Primitive`](struct.Primitive.html), [`Renderer`](struct.Renderer.html), [`Snippet`](struct.Snippet.html), [`SubTexture`](struct.SubTexture.html), [`SwapChain`](struct.SwapChain.html), [`Texture2DSliced`](struct.Texture2DSliced.html), [`Texture2D`](struct.Texture2D.html), [`Texture3D`](struct.Texture3D.html), [`TexturePixmapX11`](struct.TexturePixmapX11.html), [`TextureRectangle`](struct.TextureRectangle.html), [`Texture`](struct.Texture.html)
38pub trait ObjectExt: 'static {
39    //fn get_user_data(&self, key: &mut UserDataKey) -> /*Unimplemented*/Option<Fundamental: Pointer>;
40
41    //fn set_user_data(&self, key: &mut UserDataKey, user_data: /*Unimplemented*/Option<Fundamental: Pointer>, destroy: UserDataDestroyCallback);
42}
43
44impl<O: IsA<Object>> ObjectExt for O {
45    //fn get_user_data(&self, key: &mut UserDataKey) -> /*Unimplemented*/Option<Fundamental: Pointer> {
46    //    unsafe { TODO: call cogl_sys:cogl_object_get_user_data() }
47    //}
48
49    //fn set_user_data(&self, key: &mut UserDataKey, user_data: /*Unimplemented*/Option<Fundamental: Pointer>, destroy: UserDataDestroyCallback) {
50    //    unsafe { TODO: call cogl_sys:cogl_object_set_user_data() }
51    //}
52}
53
54impl fmt::Display for Object {
55    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
56        write!(f, "Object")
57    }
58}