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-06-11 20:30:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-11 20:31:56 +0300
commit691471fe22be17e9ad24ca4da71aeedea640f05c (patch)
tree952c5e9aa3d9bbbc80ce57489cc532608ee4a0fe
parentd4b4504260322c0e259f94599118a148d26f2a7f (diff)
Cleanup: add simplified panel callbacks
-rw-r--r--source/blender/editors/include/ED_screen.h8
-rw-r--r--source/blender/editors/screen/area.c13
-rw-r--r--source/blender/editors/space_action/space_action.c2
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c6
-rw-r--r--source/blender/editors/space_clip/space_clip.c4
-rw-r--r--source/blender/editors/space_file/space_file.c2
-rw-r--r--source/blender/editors/space_graph/space_graph.c2
-rw-r--r--source/blender/editors/space_image/space_image.c4
-rw-r--r--source/blender/editors/space_nla/space_nla.c2
-rw-r--r--source/blender/editors/space_node/space_node.c4
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c2
-rw-r--r--source/blender/editors/space_text/space_text.c2
-rw-r--r--source/blender/editors/space_userpref/space_userpref.c2
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c4
14 files changed, 33 insertions, 24 deletions
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h
index 504e910d043..a2245dcc16e 100644
--- a/source/blender/editors/include/ED_screen.h
+++ b/source/blender/editors/include/ED_screen.h
@@ -78,12 +78,16 @@ void ED_region_tag_redraw_no_rebuild(struct ARegion *ar);
void ED_region_tag_refresh_ui(struct ARegion *ar);
void ED_region_panels_init(struct wmWindowManager *wm, struct ARegion *ar);
-void ED_region_panels(
+void ED_region_panels_ex(
const struct bContext *C, struct ARegion *ar,
const char *contexts[], int contextnr, const bool vertical);
-void ED_region_panels_layout(
+void ED_region_panels(
+ const struct bContext *C, struct ARegion *ar);
+void ED_region_panels_layout_ex(
const struct bContext *C, struct ARegion *ar,
const char *contexts[], int contextnr, const bool vertical);
+void ED_region_panels_layout(
+ const struct bContext *C, struct ARegion *ar);
void ED_region_panels_draw(
const struct bContext *C, struct ARegion *ar);
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 110e428ffff..a5083246ac1 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1891,7 +1891,7 @@ static void ed_panel_draw(const bContext *C,
* Matching against any of these strings will draw the panel.
* Can be NULL to skip context checks.
*/
-void ED_region_panels_layout(
+void ED_region_panels_layout_ex(
const bContext *C, ARegion *ar,
const char *contexts[], int contextnr, const bool vertical)
{
@@ -2097,12 +2097,19 @@ void ED_region_panels_draw(const bContext *C, ARegion *ar)
UI_view2d_scrollers_free(scrollers);
}
-void ED_region_panels(
+void ED_region_panels_ex(
const bContext *C, ARegion *ar,
const char *contexts[], int contextnr, const bool vertical)
{
/* TODO: remove? */
- ED_region_panels_layout(C, ar, contexts, contextnr, vertical);
+ ED_region_panels_layout_ex(C, ar, contexts, contextnr, vertical);
+ ED_region_panels_draw(C, ar);
+}
+
+void ED_region_panels(const bContext *C, ARegion *ar)
+{
+ /* TODO: remove? */
+ ED_region_panels_layout_ex(C, ar, NULL, -1, true);
ED_region_panels_draw(C, ar);
}
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
index e130ea9369c..4498d2016d7 100644
--- a/source/blender/editors/space_action/space_action.c
+++ b/source/blender/editors/space_action/space_action.c
@@ -752,7 +752,7 @@ static void action_buttons_area_init(wmWindowManager *wm, ARegion *ar)
static void action_buttons_area_draw(const bContext *C, ARegion *ar)
{
- ED_region_panels(C, ar, NULL, -1, true);
+ ED_region_panels(C, ar);
}
static void action_region_listener(
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index f322801b122..4fe3423e730 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -203,9 +203,7 @@ static void buttons_main_region_layout_properties(const bContext *C, SpaceButs *
break;
}
- if (contexts[0]) {
- ED_region_panels(C, ar, contexts, sbuts->mainb, vertical);
- }
+ ED_region_panels_layout_ex(C, ar, contexts, sbuts->mainb, vertical);
}
static void buttons_main_region_layout_tool(const bContext *C, SpaceButs *sbuts, ARegion *ar)
@@ -265,7 +263,7 @@ static void buttons_main_region_layout_tool(const bContext *C, SpaceButs *sbuts,
/* TODO */
}
- ED_region_panels_layout(C, ar, contexts, -1, vertical);
+ ED_region_panels_layout_ex(C, ar, contexts, -1, vertical);
}
static void buttons_main_region_layout(const bContext *C, ARegion *ar)
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index f022bb7e6f8..b050e991140 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -1435,7 +1435,7 @@ static void clip_tools_region_init(wmWindowManager *wm, ARegion *ar)
static void clip_tools_region_draw(const bContext *C, ARegion *ar)
{
- ED_region_panels(C, ar, NULL, -1, true);
+ ED_region_panels(C, ar);
}
/****************** tool properties region ******************/
@@ -1484,7 +1484,7 @@ static void clip_properties_region_draw(const bContext *C, ARegion *ar)
BKE_movieclip_update_scopes(sc->clip, &sc->user, &sc->scopes);
- ED_region_panels(C, ar, NULL, -1, true);
+ ED_region_panels(C, ar);
}
static void clip_properties_region_listener(
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index 62e7c7923e8..7b045a42595 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -636,7 +636,7 @@ static void file_tools_region_init(wmWindowManager *wm, ARegion *ar)
static void file_tools_region_draw(const bContext *C, ARegion *ar)
{
- ED_region_panels(C, ar, NULL, -1, true);
+ ED_region_panels(C, ar);
}
static void file_tools_region_listener(
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index 56236ea8f47..59d7d7500ae 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -422,7 +422,7 @@ static void graph_buttons_region_init(wmWindowManager *wm, ARegion *ar)
static void graph_buttons_region_draw(const bContext *C, ARegion *ar)
{
- ED_region_panels(C, ar, NULL, -1, true);
+ ED_region_panels(C, ar);
}
static void graph_region_listener(
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index c143ebbcd67..a99788dcb23 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -869,7 +869,7 @@ static void image_buttons_region_init(wmWindowManager *wm, ARegion *ar)
static void image_buttons_region_draw(const bContext *C, ARegion *ar)
{
- ED_region_panels(C, ar, NULL, -1, true);
+ ED_region_panels(C, ar);
}
static void image_buttons_region_listener(
@@ -944,7 +944,7 @@ static void image_tools_region_draw(const bContext *C, ARegion *ar)
}
ED_space_image_release_buffer(sima, ibuf, lock);
- ED_region_panels(C, ar, NULL, -1, true);
+ ED_region_panels(C, ar);
}
static void image_tools_region_listener(
diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c
index 318d8bf777b..639195c16ac 100644
--- a/source/blender/editors/space_nla/space_nla.c
+++ b/source/blender/editors/space_nla/space_nla.c
@@ -360,7 +360,7 @@ static void nla_buttons_region_init(wmWindowManager *wm, ARegion *ar)
static void nla_buttons_region_draw(const bContext *C, ARegion *ar)
{
- ED_region_panels(C, ar, NULL, -1, true);
+ ED_region_panels(C, ar);
}
static void nla_region_listener(
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 36886d0ab32..441ab03cb28 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -603,7 +603,7 @@ static void node_buttons_region_init(wmWindowManager *wm, ARegion *ar)
static void node_buttons_region_draw(const bContext *C, ARegion *ar)
{
- ED_region_panels(C, ar, NULL, -1, true);
+ ED_region_panels(C, ar);
}
/* add handlers, stuff you only do once or on area/region changes */
@@ -619,7 +619,7 @@ static void node_toolbar_region_init(wmWindowManager *wm, ARegion *ar)
static void node_toolbar_region_draw(const bContext *C, ARegion *ar)
{
- ED_region_panels(C, ar, NULL, -1, true);
+ ED_region_panels(C, ar);
}
static void node_cursor(wmWindow *win, ScrArea *sa, ARegion *ar)
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index 75734963a0e..fc47934bc1e 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -708,7 +708,7 @@ static void sequencer_buttons_region_init(wmWindowManager *wm, ARegion *ar)
static void sequencer_buttons_region_draw(const bContext *C, ARegion *ar)
{
- ED_region_panels(C, ar, NULL, -1, true);
+ ED_region_panels(C, ar);
}
static void sequencer_buttons_region_listener(
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index 5885312e255..e827f4f0149 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -551,7 +551,7 @@ static void text_properties_region_draw(const bContext *C, ARegion *ar)
{
SpaceText *st = CTX_wm_space_text(C);
- ED_region_panels(C, ar, NULL, -1, true);
+ ED_region_panels(C, ar);
/* this flag trick is make sure buttons have been added already */
if (st->flags & ST_FIND_ACTIVATE) {
diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c
index b3f45de518b..14001a11032 100644
--- a/source/blender/editors/space_userpref/space_userpref.c
+++ b/source/blender/editors/space_userpref/space_userpref.c
@@ -113,7 +113,7 @@ static void userpref_main_region_init(wmWindowManager *wm, ARegion *ar)
static void userpref_main_region_draw(const bContext *C, ARegion *ar)
{
- ED_region_panels(C, ar, NULL, -1, true);
+ ED_region_panels(C, ar);
}
static void userpref_operatortypes(void)
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 63d7d98b689..d3f24edc38e 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -1232,7 +1232,7 @@ static void view3d_buttons_region_init(wmWindowManager *wm, ARegion *ar)
static void view3d_buttons_region_draw(const bContext *C, ARegion *ar)
{
- ED_region_panels(C, ar, NULL, -1, true);
+ ED_region_panels(C, ar);
}
static void view3d_buttons_region_listener(
@@ -1361,7 +1361,7 @@ static void view3d_tools_region_init(wmWindowManager *wm, ARegion *ar)
static void view3d_tools_region_draw(const bContext *C, ARegion *ar)
{
- ED_region_panels(C, ar, (const char * []){CTX_data_mode_string(C), NULL}, -1, true);
+ ED_region_panels_ex(C, ar, (const char * []){CTX_data_mode_string(C), NULL}, -1, true);
}
/* area (not region) level listener */