fn ui_linkbutton_create(obj: *const UiObject, args: *const UiLinkButtonArgs);
fn ui_button_args_new() -> *mut UiButtonArgs;
+ fn ui_button_args_set_fill(args: *mut UiButtonArgs, fill: c_int);
+ fn ui_button_args_set_hexpand(args: *mut UiButtonArgs, value: c_int);
+ fn ui_button_args_set_vexpand(args: *mut UiButtonArgs, value: c_int);
+ fn ui_button_args_set_hfill(args: *mut UiButtonArgs, value: c_int);
+ fn ui_button_args_set_vfill(args: *mut UiButtonArgs, value: c_int);
+ fn ui_button_args_set_override_defaults(args: *mut UiButtonArgs, value: c_int);
+ fn ui_button_args_set_margin(args: *mut UiButtonArgs, value: c_int);
+ fn ui_button_args_set_margin_left(args: *mut UiButtonArgs, value: c_int);
+ fn ui_button_args_set_margin_right(args: *mut UiButtonArgs, value: c_int);
+ fn ui_button_args_set_margin_top(args: *mut UiButtonArgs, value: c_int);
+ fn ui_button_args_set_margin_bottom(args: *mut UiButtonArgs, value: c_int);
+ fn ui_button_args_set_colspan(args: *mut UiButtonArgs, value: c_int);
+ fn ui_button_args_set_rowspan(args: *mut UiButtonArgs, value: c_int);
+ fn ui_button_args_set_name(args: *mut UiButtonArgs, name: *const c_char);
+ fn ui_button_args_set_style_class(args: *mut UiButtonArgs, classname: *const c_char);
fn ui_button_args_set_label(args: *mut UiButtonArgs, label: *const c_char);
- // TODO: implement arg funcs
+ fn ui_button_args_set_icon(args: *mut UiButtonArgs, icon: *const c_char);
+ fn ui_button_args_set_tooltip(args: *mut UiButtonArgs, tooltip: *const c_char);
+ fn ui_button_args_set_labeltype(args: *mut UiButtonArgs, ltype: c_int);
+ fn ui_button_args_set_onclick(args: *mut UiButtonArgs, callback: UiCallback);
+ fn ui_button_args_set_onclickdata(args: *mut UiButtonArgs, data: *mut c_void);
+ fn ui_button_args_set_states(args: *mut UiButtonArgs, states: *const c_int, numstates: c_int);
+ fn ui_button_args_set_visibility_states(args: *mut UiButtonArgs, states: *const c_int, numstates: c_int);
fn ui_button_args_free(args: *mut UiButtonArgs);
fn ui_toggle_args_new() -> *mut UiToggleArgs;
+ fn ui_toggle_args_set_fill(args: *mut UiToggleArgs, fill: c_int);
+ fn ui_toggle_args_set_hexpand(args: *mut UiToggleArgs, value: c_int);
+ fn ui_toggle_args_set_vexpand(args: *mut UiToggleArgs, value: c_int);
+ fn ui_toggle_args_set_hfill(args: *mut UiToggleArgs, value: c_int);
+ fn ui_toggle_args_set_vfill(args: *mut UiToggleArgs, value: c_int);
+ fn ui_toggle_args_set_override_defaults(args: *mut UiToggleArgs, value: c_int);
+ fn ui_toggle_args_set_margin(args: *mut UiToggleArgs, value: c_int);
+ fn ui_toggle_args_set_margin_left(args: *mut UiToggleArgs, value: c_int);
+ fn ui_toggle_args_set_margin_right(args: *mut UiToggleArgs, value: c_int);
+ fn ui_toggle_args_set_margin_top(args: *mut UiToggleArgs, value: c_int);
+ fn ui_toggle_args_set_margin_bottom(args: *mut UiToggleArgs, value: c_int);
+ fn ui_toggle_args_set_colspan(args: *mut UiToggleArgs, value: c_int);
+ fn ui_toggle_args_set_rowspan(args: *mut UiToggleArgs, value: c_int);
+ fn ui_toggle_args_set_name(args: *mut UiToggleArgs, name: *const c_char);
+ fn ui_toggle_args_set_style_class(args: *mut UiToggleArgs, classname: *const c_char);
+ fn ui_toggle_args_set_label(args: *mut UiToggleArgs, label: *const c_char);
+ fn ui_toggle_args_set_icon(args: *mut UiToggleArgs, icon: *const c_char);
+ fn ui_toggle_args_set_tooltip(args: *mut UiToggleArgs, tooltip: *const c_char);
+ fn ui_toggle_args_set_labeltype(args: *mut UiToggleArgs, ltype: c_int);
+ fn ui_toggle_args_set_onchange(args: *mut UiToggleArgs, callback: UiCallback);
+ fn ui_toggle_args_set_onchangedata(args: *mut UiToggleArgs, data: *mut c_void);
+ fn ui_toggle_args_set_varname(args: *mut UiToggleArgs, varname: *const c_char);
+ fn ui_toggle_args_set_value(args: *mut UiToggleArgs, ivalue: *mut UiInteger);
+ fn ui_toggle_args_set_enablestate(args: *mut UiToggleArgs, state: c_int);
+ fn ui_toggle_args_set_states(args: *mut UiToggleArgs, states: *const c_int, numstates: c_int);
+ fn ui_toggle_args_set_visibility_states(args: *mut UiToggleArgs, states: *const c_int, numstates: c_int);
fn ui_toggle_args_free(args: *mut UiToggleArgs);
}
create: ToggleButtonCreate
}
+pub enum LabelType {
+ Default = 0,
+ Text = 1,
+ Icon = 2,
+ TextIcon = 3,
+}
+
pub type ToggleButtonCreate = fn(*const UiObject, *const UiToggleArgs);
impl toolkit::UiObject {
}
}
+ pub fn fill(self, fill: bool) -> Self {
+ unsafe {
+ ui_button_args_set_fill(self.args, if fill { 1 } else { 0 });
+ }
+ self
+ }
+
+ pub fn hexpand(self, value: bool) -> Self {
+ unsafe {
+ ui_button_args_set_hexpand(self.args, if value { 1 } else { 0 });
+ }
+ self
+ }
+
+ pub fn vexpand(self, value: bool) -> Self {
+ unsafe {
+ ui_button_args_set_vexpand(self.args, if value { 1 } else { 0 });
+ }
+ self
+ }
+
+ pub fn hfill(self, value: bool) -> Self {
+ unsafe {
+ ui_button_args_set_hfill(self.args, if value { 1 } else { 0 });
+ }
+ self
+ }
+
+ pub fn vfill(self, value: bool) -> Self {
+ unsafe {
+ ui_button_args_set_vfill(self.args, if value { 1 } else { 0 });
+ }
+ self
+ }
+
+ pub fn override_defaults(self, value: bool) -> Self {
+ unsafe {
+ ui_button_args_set_override_defaults(self.args, if value { 1 } else { 0 });
+ }
+ self
+ }
+
+ pub fn margin(self, value: i32) -> Self {
+ unsafe {
+ ui_button_args_set_margin(self.args, value);
+ }
+ self
+ }
+
+ pub fn margin_left(self, value: i32) -> Self {
+ unsafe {
+ ui_button_args_set_margin_left(self.args, value);
+ }
+ self
+ }
+
+ pub fn margin_right(self, value: i32) -> Self {
+ unsafe {
+ ui_button_args_set_margin_right(self.args, value);
+ }
+ self
+ }
+
+ pub fn margin_top(self, value: i32) -> Self {
+ unsafe {
+ ui_button_args_set_margin_top(self.args, value);
+ }
+ self
+ }
+
+ pub fn margin_bottom(self, value: i32) -> Self {
+ unsafe {
+ ui_button_args_set_margin_bottom(self.args, value);
+ }
+ self
+ }
+
+ pub fn colspan(self, value: i32) -> Self {
+ unsafe {
+ ui_button_args_set_colspan(self.args, value);
+ }
+ self
+ }
+
+ pub fn rowspan(self, value: i32) -> Self {
+ unsafe {
+ ui_button_args_set_rowspan(self.args, value);
+ }
+ self
+ }
+
+ pub fn name(self, value: &str) -> Self {
+ let cstr = CString::new(value).unwrap();
+ unsafe {
+ ui_button_args_set_name(self.args, cstr.as_ptr());
+ }
+ self
+ }
+
+ pub fn style_class(self, value: &str) -> Self {
+ let cstr = CString::new(value).unwrap();
+ unsafe {
+ ui_button_args_set_style_class(self.args, cstr.as_ptr());
+ }
+ self
+ }
+
pub fn label(self, label: &str) -> Self {
let cstr = CString::new(label).unwrap();
unsafe {
}
self
}
+
+ pub fn icon(self, icon: &str) -> Self {
+ let cstr = CString::new(icon).unwrap();
+ unsafe {
+ ui_button_args_set_label(self.args, cstr.as_ptr());
+ }
+ self
+ }
+
+ pub fn tooltip(self, tooltip: &str) -> Self {
+ let cstr = CString::new(tooltip).unwrap();
+ unsafe {
+ ui_button_args_set_tooltip(self.args, cstr.as_ptr());
+ }
+ self
+ }
+
+ pub fn labeltype(self, ltype: LabelType) -> Self {
+ let lt = ltype as i32;
+ unsafe {
+ ui_button_args_set_labeltype(self.args, lt);
+ }
+ self
+ }
+
+ // TODO: callback, states
}
impl ToggleBuilder {
pub fn build(self) {
(self.create)(self.obj, self.args)
}
+
+ pub fn fill(self, fill: bool) -> Self {
+ unsafe {
+ ui_toggle_args_set_fill(self.args, if fill { 1 } else { 0 });
+ }
+ self
+ }
+
+ pub fn hexpand(self, value: bool) -> Self {
+ unsafe {
+ ui_toggle_args_set_hexpand(self.args, if value { 1 } else { 0 });
+ }
+ self
+ }
+
+ pub fn vexpand(self, value: bool) -> Self {
+ unsafe {
+ ui_toggle_args_set_vexpand(self.args, if value { 1 } else { 0 });
+ }
+ self
+ }
+
+ pub fn hfill(self, value: bool) -> Self {
+ unsafe {
+ ui_toggle_args_set_hfill(self.args, if value { 1 } else { 0 });
+ }
+ self
+ }
+
+ pub fn vfill(self, value: bool) -> Self {
+ unsafe {
+ ui_toggle_args_set_vfill(self.args, if value { 1 } else { 0 });
+ }
+ self
+ }
+
+ pub fn override_defaults(self, value: bool) -> Self {
+ unsafe {
+ ui_toggle_args_set_override_defaults(self.args, if value { 1 } else { 0 });
+ }
+ self
+ }
+
+ pub fn margin(self, value: i32) -> Self {
+ unsafe {
+ ui_toggle_args_set_margin(self.args, value);
+ }
+ self
+ }
+
+ pub fn margin_left(self, value: i32) -> Self {
+ unsafe {
+ ui_toggle_args_set_margin_left(self.args, value);
+ }
+ self
+ }
+
+ pub fn margin_right(self, value: i32) -> Self {
+ unsafe {
+ ui_toggle_args_set_margin_right(self.args, value);
+ }
+ self
+ }
+
+ pub fn margin_top(self, value: i32) -> Self {
+ unsafe {
+ ui_toggle_args_set_margin_top(self.args, value);
+ }
+ self
+ }
+
+ pub fn margin_bottom(self, value: i32) -> Self {
+ unsafe {
+ ui_toggle_args_set_margin_bottom(self.args, value);
+ }
+ self
+ }
+
+ pub fn colspan(self, value: i32) -> Self {
+ unsafe {
+ ui_toggle_args_set_colspan(self.args, value);
+ }
+ self
+ }
+
+ pub fn rowspan(self, value: i32) -> Self {
+ unsafe {
+ ui_toggle_args_set_rowspan(self.args, value);
+ }
+ self
+ }
+
+ pub fn name(self, value: &str) -> Self {
+ let cstr = CString::new(value).unwrap();
+ unsafe {
+ ui_toggle_args_set_name(self.args, cstr.as_ptr());
+ }
+ self
+ }
+
+ pub fn style_class(self, value: &str) -> Self {
+ let cstr = CString::new(value).unwrap();
+ unsafe {
+ ui_toggle_args_set_style_class(self.args, cstr.as_ptr());
+ }
+ self
+ }
+
+ pub fn label(self, label: &str) -> Self {
+ let cstr = CString::new(label).unwrap();
+ unsafe {
+ ui_toggle_args_set_label(self.args, cstr.as_ptr());
+ }
+ self
+ }
+
+ pub fn icon(self, icon: &str) -> Self {
+ let cstr = CString::new(icon).unwrap();
+ unsafe {
+ ui_toggle_args_set_label(self.args, cstr.as_ptr());
+ }
+ self
+ }
+
+ pub fn tooltip(self, tooltip: &str) -> Self {
+ let cstr = CString::new(tooltip).unwrap();
+ unsafe {
+ ui_toggle_args_set_tooltip(self.args, cstr.as_ptr());
+ }
+ self
+ }
+
+ pub fn labeltype(self, ltype: LabelType) -> Self {
+ let lt = ltype as i32;
+ unsafe {
+ ui_toggle_args_set_labeltype(self.args, lt);
+ }
+ self
+ }
+
+ pub fn varname(self, varname: &str) -> Self {
+ let cstr = CString::new(varname).unwrap();
+ unsafe {
+ ui_toggle_args_set_varname(self.args, cstr.as_ptr());
+ }
+ self
+ }
+
+ // TODO: value, callback, states
}
\ No newline at end of file