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-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/editors/space_api/spacetypes.c
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/editors/space_api/spacetypes.c')
-rw-r--r--source/blender/editors/space_api/spacetypes.c377
1 files changed, 186 insertions, 191 deletions
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
index 0288d7888d8..89758bd35da 100644
--- a/source/blender/editors/space_api/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -20,7 +20,6 @@
* \ingroup spapi
*/
-
#include <stdlib.h>
#include "MEM_guardedalloc.h"
@@ -31,14 +30,12 @@
#include "DNA_scene_types.h"
#include "DNA_windowmanager_types.h"
-
#include "BKE_context.h"
#include "BKE_screen.h"
#include "UI_interface.h"
#include "UI_view2d.h"
-
#include "ED_anim_api.h"
#include "ED_armature.h"
#include "ED_curve.h"
@@ -72,119 +69,119 @@
/* only call once on startup, storage is global in BKE kernel listbase */
void ED_spacetypes_init(void)
{
- const ListBase *spacetypes;
- SpaceType *type;
-
- /* UI_UNIT_X is now a variable, is used in some spacetype inits? */
- U.widget_unit = 20;
-
- /* create space types */
- ED_spacetype_outliner();
- ED_spacetype_view3d();
- ED_spacetype_ipo();
- ED_spacetype_image();
- ED_spacetype_node();
- ED_spacetype_buttons();
- ED_spacetype_info();
- ED_spacetype_file();
- ED_spacetype_action();
- ED_spacetype_nla();
- ED_spacetype_script();
- ED_spacetype_text();
- ED_spacetype_sequencer();
- ED_spacetype_console();
- ED_spacetype_userpref();
- ED_spacetype_clip();
- ED_spacetype_statusbar();
- ED_spacetype_topbar();
-// ...
-
- /* register operator types for screen and all spaces */
- ED_operatortypes_userpref();
- ED_operatortypes_workspace();
- ED_operatortypes_scene();
- ED_operatortypes_screen();
- ED_operatortypes_anim();
- ED_operatortypes_animchannels();
- ED_operatortypes_gpencil();
- ED_operatortypes_object();
- ED_operatortypes_lattice();
- ED_operatortypes_mesh();
- ED_operatortypes_sculpt();
- ED_operatortypes_uvedit();
- ED_operatortypes_paint();
- ED_operatortypes_physics();
- ED_operatortypes_curve();
- ED_operatortypes_armature();
- ED_operatortypes_marker();
- ED_operatortypes_metaball();
- ED_operatortypes_sound();
- ED_operatortypes_render();
- ED_operatortypes_mask();
- ED_operatortypes_io();
-
- ED_operatortypes_view2d();
- ED_operatortypes_ui();
-
- ED_screen_user_menu_register();
-
- /* gizmo types */
- ED_gizmotypes_button_2d();
- ED_gizmotypes_dial_3d();
- ED_gizmotypes_move_3d();
- ED_gizmotypes_arrow_2d();
- ED_gizmotypes_arrow_3d();
- ED_gizmotypes_preselect_3d();
- ED_gizmotypes_primitive_3d();
- ED_gizmotypes_blank_3d();
- ED_gizmotypes_cage_2d();
- ED_gizmotypes_cage_3d();
- ED_gizmotypes_value_2d();
-
- /* gizmo group types */
- ED_gizmogrouptypes_value_2d();
-
- /* register types for operators and gizmos */
- spacetypes = BKE_spacetypes_list();
- for (type = spacetypes->first; type; type = type->next) {
- /* init gizmo types first, operator-types need them */
- if (type->gizmos) {
- type->gizmos();
- }
- if (type->operatortypes) {
- type->operatortypes();
- }
- }
+ const ListBase *spacetypes;
+ SpaceType *type;
+
+ /* UI_UNIT_X is now a variable, is used in some spacetype inits? */
+ U.widget_unit = 20;
+
+ /* create space types */
+ ED_spacetype_outliner();
+ ED_spacetype_view3d();
+ ED_spacetype_ipo();
+ ED_spacetype_image();
+ ED_spacetype_node();
+ ED_spacetype_buttons();
+ ED_spacetype_info();
+ ED_spacetype_file();
+ ED_spacetype_action();
+ ED_spacetype_nla();
+ ED_spacetype_script();
+ ED_spacetype_text();
+ ED_spacetype_sequencer();
+ ED_spacetype_console();
+ ED_spacetype_userpref();
+ ED_spacetype_clip();
+ ED_spacetype_statusbar();
+ ED_spacetype_topbar();
+ // ...
+
+ /* register operator types for screen and all spaces */
+ ED_operatortypes_userpref();
+ ED_operatortypes_workspace();
+ ED_operatortypes_scene();
+ ED_operatortypes_screen();
+ ED_operatortypes_anim();
+ ED_operatortypes_animchannels();
+ ED_operatortypes_gpencil();
+ ED_operatortypes_object();
+ ED_operatortypes_lattice();
+ ED_operatortypes_mesh();
+ ED_operatortypes_sculpt();
+ ED_operatortypes_uvedit();
+ ED_operatortypes_paint();
+ ED_operatortypes_physics();
+ ED_operatortypes_curve();
+ ED_operatortypes_armature();
+ ED_operatortypes_marker();
+ ED_operatortypes_metaball();
+ ED_operatortypes_sound();
+ ED_operatortypes_render();
+ ED_operatortypes_mask();
+ ED_operatortypes_io();
+
+ ED_operatortypes_view2d();
+ ED_operatortypes_ui();
+
+ ED_screen_user_menu_register();
+
+ /* gizmo types */
+ ED_gizmotypes_button_2d();
+ ED_gizmotypes_dial_3d();
+ ED_gizmotypes_move_3d();
+ ED_gizmotypes_arrow_2d();
+ ED_gizmotypes_arrow_3d();
+ ED_gizmotypes_preselect_3d();
+ ED_gizmotypes_primitive_3d();
+ ED_gizmotypes_blank_3d();
+ ED_gizmotypes_cage_2d();
+ ED_gizmotypes_cage_3d();
+ ED_gizmotypes_value_2d();
+
+ /* gizmo group types */
+ ED_gizmogrouptypes_value_2d();
+
+ /* register types for operators and gizmos */
+ spacetypes = BKE_spacetypes_list();
+ for (type = spacetypes->first; type; type = type->next) {
+ /* init gizmo types first, operator-types need them */
+ if (type->gizmos) {
+ type->gizmos();
+ }
+ if (type->operatortypes) {
+ type->operatortypes();
+ }
+ }
}
void ED_spacemacros_init(void)
{
- const ListBase *spacetypes;
- SpaceType *type;
-
- /* Macros's must go last since they reference other operators.
- * We need to have them go after python operators too */
- ED_operatormacros_armature();
- ED_operatormacros_mesh();
- ED_operatormacros_metaball();
- ED_operatormacros_node();
- ED_operatormacros_object();
- ED_operatormacros_file();
- ED_operatormacros_graph();
- ED_operatormacros_action();
- ED_operatormacros_clip();
- ED_operatormacros_curve();
- ED_operatormacros_mask();
- ED_operatormacros_sequencer();
- ED_operatormacros_paint();
- ED_operatormacros_gpencil();
-
- /* register dropboxes (can use macros) */
- spacetypes = BKE_spacetypes_list();
- for (type = spacetypes->first; type; type = type->next) {
- if (type->dropboxes)
- type->dropboxes();
- }
+ const ListBase *spacetypes;
+ SpaceType *type;
+
+ /* Macros's must go last since they reference other operators.
+ * We need to have them go after python operators too */
+ ED_operatormacros_armature();
+ ED_operatormacros_mesh();
+ ED_operatormacros_metaball();
+ ED_operatormacros_node();
+ ED_operatormacros_object();
+ ED_operatormacros_file();
+ ED_operatormacros_graph();
+ ED_operatormacros_action();
+ ED_operatormacros_clip();
+ ED_operatormacros_curve();
+ ED_operatormacros_mask();
+ ED_operatormacros_sequencer();
+ ED_operatormacros_paint();
+ ED_operatormacros_gpencil();
+
+ /* register dropboxes (can use macros) */
+ spacetypes = BKE_spacetypes_list();
+ for (type = spacetypes->first; type; type = type->next) {
+ if (type->dropboxes)
+ type->dropboxes();
+ }
}
/* called in wm.c */
@@ -192,94 +189,93 @@ void ED_spacemacros_init(void)
* using the keymap the actual areas/regions add the handlers */
void ED_spacetypes_keymap(wmKeyConfig *keyconf)
{
- const ListBase *spacetypes;
- SpaceType *stype;
- ARegionType *atype;
-
- ED_keymap_screen(keyconf);
- ED_keymap_anim(keyconf);
- ED_keymap_animchannels(keyconf);
- ED_keymap_gpencil(keyconf);
- ED_keymap_object(keyconf);
- ED_keymap_lattice(keyconf);
- ED_keymap_mesh(keyconf);
- ED_keymap_uvedit(keyconf);
- ED_keymap_curve(keyconf);
- ED_keymap_armature(keyconf);
- ED_keymap_physics(keyconf);
- ED_keymap_metaball(keyconf);
- ED_keymap_paint(keyconf);
- ED_keymap_mask(keyconf);
- ED_keymap_marker(keyconf);
-
- ED_keymap_view2d(keyconf);
- ED_keymap_ui(keyconf);
-
- ED_keymap_transform(keyconf);
-
- spacetypes = BKE_spacetypes_list();
- for (stype = spacetypes->first; stype; stype = stype->next) {
- if (stype->keymap)
- stype->keymap(keyconf);
- for (atype = stype->regiontypes.first; atype; atype = atype->next) {
- if (atype->keymap)
- atype->keymap(keyconf);
- }
- }
+ const ListBase *spacetypes;
+ SpaceType *stype;
+ ARegionType *atype;
+
+ ED_keymap_screen(keyconf);
+ ED_keymap_anim(keyconf);
+ ED_keymap_animchannels(keyconf);
+ ED_keymap_gpencil(keyconf);
+ ED_keymap_object(keyconf);
+ ED_keymap_lattice(keyconf);
+ ED_keymap_mesh(keyconf);
+ ED_keymap_uvedit(keyconf);
+ ED_keymap_curve(keyconf);
+ ED_keymap_armature(keyconf);
+ ED_keymap_physics(keyconf);
+ ED_keymap_metaball(keyconf);
+ ED_keymap_paint(keyconf);
+ ED_keymap_mask(keyconf);
+ ED_keymap_marker(keyconf);
+
+ ED_keymap_view2d(keyconf);
+ ED_keymap_ui(keyconf);
+
+ ED_keymap_transform(keyconf);
+
+ spacetypes = BKE_spacetypes_list();
+ for (stype = spacetypes->first; stype; stype = stype->next) {
+ if (stype->keymap)
+ stype->keymap(keyconf);
+ for (atype = stype->regiontypes.first; atype; atype = atype->next) {
+ if (atype->keymap)
+ atype->keymap(keyconf);
+ }
+ }
}
/* ********************** custom drawcall api ***************** */
typedef struct RegionDrawCB {
- struct RegionDrawCB *next, *prev;
+ struct RegionDrawCB *next, *prev;
- void (*draw)(const struct bContext *, struct ARegion *, void *);
- void *customdata;
+ void (*draw)(const struct bContext *, struct ARegion *, void *);
+ void *customdata;
- int type;
+ int type;
} RegionDrawCB;
void *ED_region_draw_cb_activate(ARegionType *art,
void (*draw)(const struct bContext *, struct ARegion *, void *),
- void *customdata, int type)
+ void *customdata,
+ int type)
{
- RegionDrawCB *rdc = MEM_callocN(sizeof(RegionDrawCB), "RegionDrawCB");
+ RegionDrawCB *rdc = MEM_callocN(sizeof(RegionDrawCB), "RegionDrawCB");
- BLI_addtail(&art->drawcalls, rdc);
- rdc->draw = draw;
- rdc->customdata = customdata;
- rdc->type = type;
+ BLI_addtail(&art->drawcalls, rdc);
+ rdc->draw = draw;
+ rdc->customdata = customdata;
+ rdc->type = type;
- return rdc;
+ return rdc;
}
void ED_region_draw_cb_exit(ARegionType *art, void *handle)
{
- RegionDrawCB *rdc;
-
- for (rdc = art->drawcalls.first; rdc; rdc = rdc->next) {
- if (rdc == (RegionDrawCB *)handle) {
- BLI_remlink(&art->drawcalls, rdc);
- MEM_freeN(rdc);
- return;
- }
- }
+ RegionDrawCB *rdc;
+
+ for (rdc = art->drawcalls.first; rdc; rdc = rdc->next) {
+ if (rdc == (RegionDrawCB *)handle) {
+ BLI_remlink(&art->drawcalls, rdc);
+ MEM_freeN(rdc);
+ return;
+ }
+ }
}
void ED_region_draw_cb_draw(const bContext *C, ARegion *ar, int type)
{
- RegionDrawCB *rdc;
+ RegionDrawCB *rdc;
- for (rdc = ar->type->drawcalls.first; rdc; rdc = rdc->next) {
- if (rdc->type == type) {
- rdc->draw(C, ar, rdc->customdata);
- }
- }
+ for (rdc = ar->type->drawcalls.first; rdc; rdc = rdc->next) {
+ if (rdc->type == type) {
+ rdc->draw(C, ar, rdc->customdata);
+ }
+ }
}
-
-
/* ********************* space template *********************** */
/* forward declare */
void ED_spacetype_xxx(void);
@@ -287,57 +283,56 @@ void ED_spacetype_xxx(void);
/* allocate and init some vars */
static SpaceLink *xxx_new(const ScrArea *UNUSED(sa), const Scene *UNUSED(scene))
{
- return NULL;
+ return NULL;
}
/* not spacelink itself */
static void xxx_free(SpaceLink *UNUSED(sl))
{
-
}
/* spacetype; init callback for usage, should be redoable */
static void xxx_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa))
{
- /* link area to SpaceXXX struct */
+ /* link area to SpaceXXX struct */
- /* define how many regions, the order and types */
+ /* define how many regions, the order and types */
- /* add types to regions */
+ /* add types to regions */
}
static SpaceLink *xxx_duplicate(SpaceLink *UNUSED(sl))
{
- return NULL;
+ return NULL;
}
static void xxx_operatortypes(void)
{
- /* register operator types for this space */
+ /* register operator types for this space */
}
static void xxx_keymap(wmKeyConfig *UNUSED(keyconf))
{
- /* add default items to keymap */
+ /* add default items to keymap */
}
/* only called once, from screen/spacetypes.c */
void ED_spacetype_xxx(void)
{
- static SpaceType st;
+ static SpaceType st;
- st.spaceid = SPACE_VIEW3D;
+ st.spaceid = SPACE_VIEW3D;
- st.new = xxx_new;
- st.free = xxx_free;
- st.init = xxx_init;
- st.duplicate = xxx_duplicate;
- st.operatortypes = xxx_operatortypes;
- st.keymap = xxx_keymap;
+ st.new = xxx_new;
+ st.free = xxx_free;
+ st.init = xxx_init;
+ st.duplicate = xxx_duplicate;
+ st.operatortypes = xxx_operatortypes;
+ st.keymap = xxx_keymap;
- BKE_spacetype_register(&st);
+ BKE_spacetype_register(&st);
}
/* ****************************** end template *********************** */