1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use crate::GLShader;
use glib::object::Cast;
use glib::translate::*;

glib::wrapper! {
    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct ShaderArgsBuilder(Shared<ffi::GskShaderArgsBuilder>);

    match fn {
        ref => |ptr| ffi::gsk_shader_args_builder_ref(ptr),
        unref => |ptr| ffi::gsk_shader_args_builder_unref(ptr),
        type_ => || ffi::gsk_shader_args_builder_get_type(),
    }
}

impl ShaderArgsBuilder {
    #[doc(alias = "gsk_shader_args_builder_new")]
    pub fn new(shader: &GLShader, initial_values: Option<&glib::Bytes>) -> ShaderArgsBuilder {
        skip_assert_initialized!();
        unsafe {
            from_glib_full(ffi::gsk_shader_args_builder_new(
                shader.to_glib_none().0,
                initial_values.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gsk_shader_args_builder_set_bool")]
    pub fn set_bool(&self, idx: i32, value: bool) {
        unsafe {
            ffi::gsk_shader_args_builder_set_bool(self.to_glib_none().0, idx, value.into_glib());
        }
    }

    #[doc(alias = "gsk_shader_args_builder_set_float")]
    pub fn set_float(&self, idx: i32, value: f32) {
        unsafe {
            ffi::gsk_shader_args_builder_set_float(self.to_glib_none().0, idx, value);
        }
    }

    #[doc(alias = "gsk_shader_args_builder_set_int")]
    pub fn set_int(&self, idx: i32, value: i32) {
        unsafe {
            ffi::gsk_shader_args_builder_set_int(self.to_glib_none().0, idx, value);
        }
    }

    #[doc(alias = "gsk_shader_args_builder_set_uint")]
    pub fn set_uint(&self, idx: i32, value: u32) {
        unsafe {
            ffi::gsk_shader_args_builder_set_uint(self.to_glib_none().0, idx, value);
        }
    }

    #[doc(alias = "gsk_shader_args_builder_set_vec2")]
    pub fn set_vec2(&self, idx: i32, value: &graphene::Vec2) {
        unsafe {
            ffi::gsk_shader_args_builder_set_vec2(
                self.to_glib_none().0,
                idx,
                value.to_glib_none().0,
            );
        }
    }

    #[doc(alias = "gsk_shader_args_builder_set_vec3")]
    pub fn set_vec3(&self, idx: i32, value: &graphene::Vec3) {
        unsafe {
            ffi::gsk_shader_args_builder_set_vec3(
                self.to_glib_none().0,
                idx,
                value.to_glib_none().0,
            );
        }
    }

    #[doc(alias = "gsk_shader_args_builder_set_vec4")]
    pub fn set_vec4(&self, idx: i32, value: &graphene::Vec4) {
        unsafe {
            ffi::gsk_shader_args_builder_set_vec4(
                self.to_glib_none().0,
                idx,
                value.to_glib_none().0,
            );
        }
    }

    #[doc(alias = "gsk_shader_args_builder_to_args")]
    pub fn to_args(self) -> glib::Bytes {
        unsafe { from_glib_full(ffi::gsk_shader_args_builder_to_args(self.into_glib_ptr())) }
    }
}