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>2019-04-13 10:15:15 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-13 10:15:15 +0300
commit73c7aaba226349e93ca4966941f4eb051a94c097 (patch)
treea3883f8abae08ab019ebfded6591728dce2aab24 /source/blender/windowmanager/gizmo
parent45b810e1f8b088f3dc5329cfb0fe01092a156a6c (diff)
Cleanup: style, use braces for the window manager
Diffstat (limited to 'source/blender/windowmanager/gizmo')
-rw-r--r--source/blender/windowmanager/gizmo/intern/wm_gizmo.c12
-rw-r--r--source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c15
-rw-r--r--source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c21
3 files changed, 30 insertions, 18 deletions
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo.c
index 7346fa31300..1a4141c0178 100644
--- a/source/blender/windowmanager/gizmo/intern/wm_gizmo.c
+++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo.c
@@ -644,10 +644,12 @@ void WM_gizmo_properties_create(PointerRNA *ptr, const char *gtstring)
{
const wmGizmoType *gzt = WM_gizmotype_find(gtstring, false);
- if (gzt)
+ if (gzt) {
WM_gizmo_properties_create_ptr(ptr, (wmGizmoType *)gzt);
- else
+ }
+ else {
RNA_pointer_create(NULL, &RNA_GizmoProperties, NULL, ptr);
+ }
}
/* similar to the function above except its uses ID properties
@@ -674,10 +676,12 @@ void WM_gizmo_properties_sanitize(PointerRNA *ptr, const bool no_context)
{
switch (RNA_property_type(prop)) {
case PROP_ENUM:
- if (no_context)
+ if (no_context) {
RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT);
- else
+ }
+ else {
RNA_def_property_clear_flag(prop, PROP_ENUM_NO_CONTEXT);
+ }
break;
case PROP_POINTER:
{
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c
index 42dd5e8f293..ae264480751 100644
--- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c
+++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c
@@ -145,18 +145,18 @@ int WM_gizmo_cmp_temp_fl(const void *gz_a_ptr, const void *gz_b_ptr)
{
const wmGizmo *gz_a = gz_a_ptr;
const wmGizmo *gz_b = gz_b_ptr;
- if (gz_a->temp.f < gz_b->temp.f) return -1;
- else if (gz_a->temp.f > gz_b->temp.f) return 1;
- else return 0;
+ if (gz_a->temp.f < gz_b->temp.f) { return -1; }
+ else if (gz_a->temp.f > gz_b->temp.f) { return 1; }
+ else { return 0; }
}
int WM_gizmo_cmp_temp_fl_reverse(const void *gz_a_ptr, const void *gz_b_ptr)
{
const wmGizmo *gz_a = gz_a_ptr;
const wmGizmo *gz_b = gz_b_ptr;
- if (gz_a->temp.f < gz_b->temp.f) return 1;
- else if (gz_a->temp.f > gz_b->temp.f) return -1;
- else return 0;
+ if (gz_a->temp.f < gz_b->temp.f) { return 1; }
+ else if (gz_a->temp.f > gz_b->temp.f) { return -1; }
+ else { return 0; }
}
wmGizmo *wm_gizmogroup_find_intersected_gizmo(
@@ -636,8 +636,9 @@ static wmKeyMap *gizmogroup_tweak_modal_keymap(wmKeyConfig *keyconf, const char
keymap = WM_modalkeymap_get(keyconf, name);
/* this function is called for each spacetype, only needs to add map once */
- if (keymap && keymap->modal_items)
+ if (keymap && keymap->modal_items) {
return NULL;
+ }
keymap = WM_modalkeymap_add(keyconf, name, modal_items);
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
index df9f38824b0..112943a7dba 100644
--- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
+++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
@@ -345,8 +345,9 @@ static void gizmomap_prepare_drawing(
wmGizmoMap *gzmap, const bContext *C, ListBase *draw_gizmos,
const eWM_GizmoFlagMapDrawStep drawstep)
{
- if (!gzmap || BLI_listbase_is_empty(&gzmap->groups))
+ if (!gzmap || BLI_listbase_is_empty(&gzmap->groups)) {
return;
+ }
gzmap->is_init = false;
@@ -844,8 +845,9 @@ bool WM_gizmomap_select_all(bContext *C, wmGizmoMap *gzmap, const int action)
break;
}
- if (changed)
+ if (changed) {
WM_event_add_mousemove(C);
+ }
return changed;
}
@@ -874,12 +876,15 @@ void wm_gizmomap_handler_context_op(bContext *C, wmEventHandler_Op *handler)
else {
ARegion *ar;
CTX_wm_area_set(C, sa);
- for (ar = sa->regionbase.first; ar; ar = ar->next)
- if (ar == handler->context.region)
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ if (ar == handler->context.region) {
break;
+ }
+ }
/* XXX no warning print here, after full-area and back regions are remade */
- if (ar)
+ if (ar) {
CTX_wm_region_set(C, ar);
+ }
}
}
}
@@ -1198,11 +1203,13 @@ void WM_gizmoconfig_update_tag_remove(
*/
void WM_gizmoconfig_update(struct Main *bmain)
{
- if (G.background)
+ if (G.background) {
return;
+ }
- if (wm_gzmap_type_update_flag == 0)
+ if (wm_gzmap_type_update_flag == 0) {
return;
+ }
if (wm_gzmap_type_update_flag & WM_GIZMOMAPTYPE_GLOBAL_UPDATE_REMOVE) {
for (wmGizmoMapType *gzmap_type = gizmomaptypes.first;