Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-07-01 16:47:09 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-01 16:57:59 +0300
commitddee0931b8687d01186f1941d483c6b3622d1833 (patch)
treeafc6e71c703bc1bd7a941e7d3f2e4617f0be27e6 /source/blender/editors/interface
parent3ec6f2172d890972b46c26a72dd30122b697c101 (diff)
RNA: use bool for boolean RNA types
We were using int's for bool arguments in BKE, just to avoid having wrapper functions.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_handlers.c2
-rw-r--r--source/blender/editors/interface/interface_layout.c16
-rw-r--r--source/blender/editors/interface/interface_templates.c18
3 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 7d059137a00..a529568ccc9 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -1605,7 +1605,7 @@ static void ui_selectcontext_apply(
wmWindow *win = CTX_wm_window(C);
if (!win->eventstate->shift) {
const int len = RNA_property_array_length(&but->rnapoin, prop);
- int *tmparray = MEM_callocN(sizeof(int) * len, __func__);
+ bool *tmparray = MEM_callocN(sizeof(bool) * len, __func__);
tmparray[index] = true;
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 1ff458e743f..d7a892e0e01 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -351,7 +351,7 @@ static int ui_layout_local_dir(uiLayout *layout)
}
}
-static uiLayout *ui_item_local_sublayout(uiLayout *test, uiLayout *layout, int align)
+static uiLayout *ui_item_local_sublayout(uiLayout *test, uiLayout *layout, bool align)
{
uiLayout *sub;
@@ -521,7 +521,7 @@ static void ui_item_array(
uiDefAutoButR(block, ptr, prop, -1, "", ICON_NONE, 0, 0, w, UI_UNIT_Y);
}
else {
- int *boolarr = NULL;
+ bool *boolarr = NULL;
/* even if 'expand' is fale, expanding anyway */
@@ -536,7 +536,7 @@ static void ui_item_array(
/* show checkboxes for rna on a non-emboss block (menu for eg) */
if (type == PROP_BOOLEAN && ELEM(layout->root->block->dt, UI_EMBOSS_NONE, UI_EMBOSS_PULLDOWN)) {
- boolarr = MEM_callocN(sizeof(int) * len, __func__);
+ boolarr = MEM_callocN(sizeof(bool) * len, __func__);
RNA_property_boolean_get_array(ptr, prop, boolarr);
}
@@ -2859,7 +2859,7 @@ static void ui_litem_layout_overlap(uiLayout *litem)
}
/* layout create functions */
-uiLayout *uiLayoutRow(uiLayout *layout, int align)
+uiLayout *uiLayoutRow(uiLayout *layout, bool align)
{
uiLayout *litem;
@@ -2880,7 +2880,7 @@ uiLayout *uiLayoutRow(uiLayout *layout, int align)
return litem;
}
-uiLayout *uiLayoutColumn(uiLayout *layout, int align)
+uiLayout *uiLayoutColumn(uiLayout *layout, bool align)
{
uiLayout *litem;
@@ -2901,7 +2901,7 @@ uiLayout *uiLayoutColumn(uiLayout *layout, int align)
return litem;
}
-uiLayout *uiLayoutColumnFlow(uiLayout *layout, int number, int align)
+uiLayout *uiLayoutColumnFlow(uiLayout *layout, int number, bool align)
{
uiLayoutItemFlow *flow;
@@ -3023,7 +3023,7 @@ uiLayout *uiLayoutListBox(
return (uiLayout *)box;
}
-uiLayout *uiLayoutAbsolute(uiLayout *layout, int align)
+uiLayout *uiLayoutAbsolute(uiLayout *layout, bool align)
{
uiLayout *litem;
@@ -3070,7 +3070,7 @@ uiLayout *uiLayoutOverlap(uiLayout *layout)
return litem;
}
-uiLayout *uiLayoutSplit(uiLayout *layout, float percentage, int align)
+uiLayout *uiLayoutSplit(uiLayout *layout, float percentage, bool align)
{
uiLayoutItemSplit *split;
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 4838bdf524e..174e5f13f66 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -1373,7 +1373,7 @@ static void do_preview_buttons(bContext *C, void *arg, int event)
}
void uiTemplatePreview(
- uiLayout *layout, bContext *C, ID *id, int show_buttons, ID *parent, MTex *slot,
+ uiLayout *layout, bContext *C, ID *id, bool show_buttons, ID *parent, MTex *slot,
const char *preview_id)
{
uiLayout *row, *col;
@@ -1683,7 +1683,7 @@ static void colorband_buttons_layout(
}
}
-void uiTemplateColorRamp(uiLayout *layout, PointerRNA *ptr, const char *propname, int expand)
+void uiTemplateColorRamp(uiLayout *layout, PointerRNA *ptr, const char *propname, bool expand)
{
PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
PointerRNA cptr;
@@ -1783,7 +1783,7 @@ static uiBlock *ui_icon_view_menu_cb(bContext *C, ARegion *ar, void *arg_litem)
/**
* \param icon_scale: Scale of the icon, 1x == button height.
*/
-void uiTemplateIconView(uiLayout *layout, PointerRNA *ptr, const char *propname, int show_labels, float icon_scale)
+void uiTemplateIconView(uiLayout *layout, PointerRNA *ptr, const char *propname, bool show_labels, float icon_scale)
{
PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
IconViewMenuArgs *cb_args;
@@ -2176,8 +2176,8 @@ static void curvemap_buttons_reset(bContext *C, void *cb_v, void *cumap_v)
/* still unsure how this call evolves... we use labeltype for defining what curve-channels to show */
static void curvemap_buttons_layout(
- uiLayout *layout, PointerRNA *ptr, char labeltype, int levels,
- int brush, int neg_slope, RNAUpdateCb *cb)
+ uiLayout *layout, PointerRNA *ptr, char labeltype, bool levels,
+ bool brush, bool neg_slope, RNAUpdateCb *cb)
{
CurveMapping *cumap = ptr->data;
CurveMap *cm = &cumap->cm[cumap->cur];
@@ -2340,7 +2340,7 @@ static void curvemap_buttons_layout(
void uiTemplateCurveMapping(
uiLayout *layout, PointerRNA *ptr, const char *propname, int type,
- int levels, int brush, int neg_slope)
+ bool levels, bool brush, bool neg_slope)
{
RNAUpdateCb *cb;
PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
@@ -2384,8 +2384,8 @@ void uiTemplateCurveMapping(
/* This template now follows User Preference for type - name is not correct anymore... */
void uiTemplateColorPicker(
- uiLayout *layout, PointerRNA *ptr, const char *propname, int value_slider,
- int lock, int lock_luminosity, int cubic)
+ uiLayout *layout, PointerRNA *ptr, const char *propname, bool value_slider,
+ bool lock, bool lock_luminosity, bool cubic)
{
PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
uiBlock *block = uiLayoutGetBlock(layout);
@@ -2481,7 +2481,7 @@ void uiTemplateColorPicker(
}
}
-void uiTemplatePalette(uiLayout *layout, PointerRNA *ptr, const char *propname, int UNUSED(colors))
+void uiTemplatePalette(uiLayout *layout, PointerRNA *ptr, const char *propname, bool UNUSED(colors))
{
PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
PointerRNA cptr;