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:
authorJulian Eisel <julian@blender.org>2020-03-06 18:56:42 +0300
committerJulian Eisel <julian@blender.org>2020-03-06 19:19:23 +0300
commitb2ee1770d4c31078518f4ec9edd5196a41345162 (patch)
tree6b7f6ff9057322245fc3b3407bece3f1c0cb3eb5 /source/blender/editors/space_console
parentb825a95ec311a169d33fe21e28418f11a516c82f (diff)
Cleanup: Rename ARegion variables from ar to region
The old convention was easy to confuse with ScrArea. Part of https://developer.blender.org/T74432. This is mostly a batch rename with some manual fixing. Only single word variable names are changed, no prefixed/suffixed names. Brecht van Lommel and Campbell Barton both gave me a green light for this convention change. Also ran clan clang format on affected files.
Diffstat (limited to 'source/blender/editors/space_console')
-rw-r--r--source/blender/editors/space_console/console_draw.c28
-rw-r--r--source/blender/editors/space_console/console_intern.h8
-rw-r--r--source/blender/editors/space_console/console_ops.c88
-rw-r--r--source/blender/editors/space_console/space_console.c81
4 files changed, 104 insertions, 101 deletions
diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c
index 3ba355b3730..7e32c3d2b5f 100644
--- a/source/blender/editors/space_console/console_draw.c
+++ b/source/blender/editors/space_console/console_draw.c
@@ -184,25 +184,25 @@ static void console_textview_const_colors(TextViewContext *UNUSED(tvc), uchar bg
UI_GetThemeColor4ubv(TH_CONSOLE_SELECT, bg_sel);
}
-static void console_textview_draw_rect_calc(const ARegion *ar,
+static void console_textview_draw_rect_calc(const ARegion *region,
rcti *r_draw_rect,
rcti *r_draw_rect_outer)
{
const int margin = 4 * UI_DPI_FAC;
r_draw_rect->xmin = margin;
- r_draw_rect->xmax = ar->winx - V2D_SCROLL_WIDTH;
+ r_draw_rect->xmax = region->winx - V2D_SCROLL_WIDTH;
r_draw_rect->ymin = margin;
/* No margin at the top (allow text to scroll off the window). */
- r_draw_rect->ymax = ar->winy;
+ r_draw_rect->ymax = region->winy;
r_draw_rect_outer->xmin = 0;
- r_draw_rect_outer->xmax = ar->winx;
+ r_draw_rect_outer->xmax = region->winx;
r_draw_rect_outer->ymin = 0;
- r_draw_rect_outer->ymax = ar->winy;
+ r_draw_rect_outer->ymax = region->winy;
}
static int console_textview_main__internal(struct SpaceConsole *sc,
- const ARegion *ar,
+ const ARegion *region,
const bool do_draw,
const int mval[2],
void **r_mval_pick_item,
@@ -211,7 +211,7 @@ static int console_textview_main__internal(struct SpaceConsole *sc,
ConsoleLine cl_dummy = {NULL};
int ret = 0;
- const View2D *v2d = &ar->v2d;
+ const View2D *v2d = &region->v2d;
TextViewContext tvc = {0};
@@ -234,7 +234,7 @@ static int console_textview_main__internal(struct SpaceConsole *sc,
tvc.scroll_ymin = v2d->cur.ymin;
tvc.scroll_ymax = v2d->cur.ymax;
- console_textview_draw_rect_calc(ar, &tvc.draw_rect, &tvc.draw_rect_outer);
+ console_textview_draw_rect_calc(region, &tvc.draw_rect, &tvc.draw_rect_outer);
console_scrollback_prompt_begin(sc, &cl_dummy);
ret = textview_draw(&tvc, do_draw, mval, r_mval_pick_item, r_mval_pick_offset);
@@ -243,23 +243,23 @@ static int console_textview_main__internal(struct SpaceConsole *sc,
return ret;
}
-void console_textview_main(struct SpaceConsole *sc, const ARegion *ar)
+void console_textview_main(struct SpaceConsole *sc, const ARegion *region)
{
const int mval[2] = {INT_MAX, INT_MAX};
- console_textview_main__internal(sc, ar, true, mval, NULL, NULL);
+ console_textview_main__internal(sc, region, true, mval, NULL, NULL);
}
-int console_textview_height(struct SpaceConsole *sc, const ARegion *ar)
+int console_textview_height(struct SpaceConsole *sc, const ARegion *region)
{
const int mval[2] = {INT_MAX, INT_MAX};
- return console_textview_main__internal(sc, ar, false, mval, NULL, NULL);
+ return console_textview_main__internal(sc, region, false, mval, NULL, NULL);
}
-int console_char_pick(struct SpaceConsole *sc, const ARegion *ar, const int mval[2])
+int console_char_pick(struct SpaceConsole *sc, const ARegion *region, const int mval[2])
{
int r_mval_pick_offset = 0;
void *mval_pick_item = NULL;
- console_textview_main__internal(sc, ar, false, mval, &mval_pick_item, &r_mval_pick_offset);
+ console_textview_main__internal(sc, region, false, mval, &mval_pick_item, &r_mval_pick_offset);
return r_mval_pick_offset;
}
diff --git a/source/blender/editors/space_console/console_intern.h b/source/blender/editors/space_console/console_intern.h
index def7fbc193b..d051e351f3e 100644
--- a/source/blender/editors/space_console/console_intern.h
+++ b/source/blender/editors/space_console/console_intern.h
@@ -28,10 +28,10 @@ struct bContext;
struct wmOperatorType;
/* console_draw.c */
-void console_textview_main(struct SpaceConsole *sc, const struct ARegion *ar);
+void console_textview_main(struct SpaceConsole *sc, const struct ARegion *region);
/* needed to calculate the scrollbar */
-int console_textview_height(struct SpaceConsole *sc, const struct ARegion *ar);
-int console_char_pick(struct SpaceConsole *sc, const struct ARegion *ar, const int mval[2]);
+int console_textview_height(struct SpaceConsole *sc, const struct ARegion *region);
+int console_char_pick(struct SpaceConsole *sc, const struct ARegion *region, const int mval[2]);
void console_scrollback_prompt_begin(struct SpaceConsole *sc, ConsoleLine *cl_dummy);
void console_scrollback_prompt_end(struct SpaceConsole *sc, ConsoleLine *cl_dummy);
@@ -44,7 +44,7 @@ ConsoleLine *console_scrollback_add_str(struct SpaceConsole *sc, char *str, bool
ConsoleLine *console_history_verify(const struct bContext *C);
-void console_textview_update_rect(SpaceConsole *sc, ARegion *ar);
+void console_textview_update_rect(SpaceConsole *sc, ARegion *region);
void CONSOLE_OT_move(struct wmOperatorType *ot);
void CONSOLE_OT_delete(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c
index 122634f86ba..abb566aa39b 100644
--- a/source/blender/editors/space_console/console_ops.c
+++ b/source/blender/editors/space_console/console_ops.c
@@ -49,18 +49,18 @@
#include "console_intern.h"
/* so when we type - the view scrolls to the bottom */
-static void console_scroll_bottom(ARegion *ar)
+static void console_scroll_bottom(ARegion *region)
{
- View2D *v2d = &ar->v2d;
+ View2D *v2d = &region->v2d;
v2d->cur.ymin = 0.0;
v2d->cur.ymax = (float)v2d->winy;
}
-void console_textview_update_rect(SpaceConsole *sc, ARegion *ar)
+void console_textview_update_rect(SpaceConsole *sc, ARegion *region)
{
- View2D *v2d = &ar->v2d;
+ View2D *v2d = &region->v2d;
- UI_view2d_totRect_set(v2d, ar->winx - 1, console_textview_height(sc, ar));
+ UI_view2d_totRect_set(v2d, region->winx - 1, console_textview_height(sc, region));
}
static void console_select_offset(SpaceConsole *sc, const int offset)
@@ -354,10 +354,10 @@ static int console_move_exec(bContext *C, wmOperator *op)
if (done) {
ScrArea *sa = CTX_wm_area(C);
- ARegion *ar = CTX_wm_region(C);
+ ARegion *region = CTX_wm_region(C);
ED_area_tag_redraw(sa);
- console_scroll_bottom(ar);
+ console_scroll_bottom(region);
}
return OPERATOR_FINISHED;
@@ -383,7 +383,7 @@ void CONSOLE_OT_move(wmOperatorType *ot)
static int console_insert_exec(bContext *C, wmOperator *op)
{
SpaceConsole *sc = CTX_wm_space_console(C);
- ARegion *ar = CTX_wm_region(C);
+ ARegion *region = CTX_wm_region(C);
ConsoleLine *ci = console_history_verify(C);
char *str = RNA_string_get_alloc(op->ptr, "text", NULL, 0);
int len;
@@ -407,10 +407,10 @@ static int console_insert_exec(bContext *C, wmOperator *op)
console_select_offset(sc, len);
}
- console_textview_update_rect(sc, ar);
+ console_textview_update_rect(sc, region);
ED_area_tag_redraw(CTX_wm_area(C));
- console_scroll_bottom(ar);
+ console_scroll_bottom(region);
return OPERATOR_FINISHED;
}
@@ -506,7 +506,7 @@ void CONSOLE_OT_indent_or_autocomplete(wmOperatorType *ot)
static int console_indent_exec(bContext *C, wmOperator *UNUSED(op))
{
SpaceConsole *sc = CTX_wm_space_console(C);
- ARegion *ar = CTX_wm_region(C);
+ ARegion *region = CTX_wm_region(C);
ConsoleLine *ci = console_history_verify(C);
int spaces;
int len;
@@ -528,10 +528,10 @@ static int console_indent_exec(bContext *C, wmOperator *UNUSED(op))
console_line_cursor_set(ci, ci->cursor + len);
console_select_offset(sc, len);
- console_textview_update_rect(sc, ar);
+ console_textview_update_rect(sc, region);
ED_area_tag_redraw(CTX_wm_area(C));
- console_scroll_bottom(ar);
+ console_scroll_bottom(region);
return OPERATOR_FINISHED;
}
@@ -553,7 +553,7 @@ void CONSOLE_OT_indent(wmOperatorType *ot)
static int console_unindent_exec(bContext *C, wmOperator *UNUSED(op))
{
SpaceConsole *sc = CTX_wm_space_console(C);
- ARegion *ar = CTX_wm_region(C);
+ ARegion *region = CTX_wm_region(C);
ConsoleLine *ci = console_history_verify(C);
int spaces;
int len;
@@ -582,10 +582,10 @@ static int console_unindent_exec(bContext *C, wmOperator *UNUSED(op))
console_line_cursor_set(ci, ci->cursor - len);
console_select_offset(sc, -len);
- console_textview_update_rect(sc, ar);
+ console_textview_update_rect(sc, region);
ED_area_tag_redraw(CTX_wm_area(C));
- console_scroll_bottom(ar);
+ console_scroll_bottom(region);
return OPERATOR_FINISHED;
}
@@ -613,7 +613,7 @@ static const EnumPropertyItem console_delete_type_items[] = {
static int console_delete_exec(bContext *C, wmOperator *op)
{
SpaceConsole *sc = CTX_wm_space_console(C);
- ARegion *ar = CTX_wm_region(C);
+ ARegion *region = CTX_wm_region(C);
ConsoleLine *ci = console_history_verify(C);
int pos;
int stride;
@@ -678,10 +678,10 @@ static int console_delete_exec(bContext *C, wmOperator *op)
console_select_offset(sc, -stride);
}
- console_textview_update_rect(sc, ar);
+ console_textview_update_rect(sc, region);
ED_area_tag_redraw(CTX_wm_area(C));
- console_scroll_bottom(ar);
+ console_scroll_bottom(region);
return OPERATOR_FINISHED;
}
@@ -709,7 +709,7 @@ void CONSOLE_OT_delete(wmOperatorType *ot)
static int console_clear_line_exec(bContext *C, wmOperator *UNUSED(op))
{
SpaceConsole *sc = CTX_wm_space_console(C);
- ARegion *ar = CTX_wm_region(C);
+ ARegion *region = CTX_wm_region(C);
ConsoleLine *ci = console_history_verify(C);
if (ci->len == 0) {
@@ -720,11 +720,11 @@ static int console_clear_line_exec(bContext *C, wmOperator *UNUSED(op))
console_history_add(sc, NULL);
console_select_offset(sc, -ci->len);
- console_textview_update_rect(sc, ar);
+ console_textview_update_rect(sc, region);
ED_area_tag_redraw(CTX_wm_area(C));
- console_scroll_bottom(ar);
+ console_scroll_bottom(region);
return OPERATOR_FINISHED;
}
@@ -745,7 +745,7 @@ void CONSOLE_OT_clear_line(wmOperatorType *ot)
static int console_clear_exec(bContext *C, wmOperator *op)
{
SpaceConsole *sc = CTX_wm_space_console(C);
- ARegion *ar = CTX_wm_region(C);
+ ARegion *region = CTX_wm_region(C);
const bool scrollback = RNA_boolean_get(op->ptr, "scrollback");
const bool history = RNA_boolean_get(op->ptr, "history");
@@ -765,7 +765,7 @@ static int console_clear_exec(bContext *C, wmOperator *op)
console_history_verify(C);
}
- console_textview_update_rect(sc, ar);
+ console_textview_update_rect(sc, region);
ED_area_tag_redraw(CTX_wm_area(C));
return OPERATOR_FINISHED;
@@ -791,7 +791,7 @@ void CONSOLE_OT_clear(wmOperatorType *ot)
static int console_history_cycle_exec(bContext *C, wmOperator *op)
{
SpaceConsole *sc = CTX_wm_space_console(C);
- ARegion *ar = CTX_wm_region(C);
+ ARegion *region = CTX_wm_region(C);
/* TODO - stupid, just prevents crashes when no command line */
ConsoleLine *ci = console_history_verify(C);
@@ -832,10 +832,10 @@ static int console_history_cycle_exec(bContext *C, wmOperator *op)
console_select_offset(sc, ci->len - prev_len);
/* could be wrapped so update scroll rect */
- console_textview_update_rect(sc, ar);
+ console_textview_update_rect(sc, region);
ED_area_tag_redraw(CTX_wm_area(C));
- console_scroll_bottom(ar);
+ console_scroll_bottom(region);
return OPERATOR_FINISHED;
}
@@ -859,7 +859,7 @@ void CONSOLE_OT_history_cycle(wmOperatorType *ot)
static int console_history_append_exec(bContext *C, wmOperator *op)
{
SpaceConsole *sc = CTX_wm_space_console(C);
- ARegion *ar = CTX_wm_region(C);
+ ARegion *region = CTX_wm_region(C);
ScrArea *sa = CTX_wm_area(C);
ConsoleLine *ci = console_history_verify(C);
/* own this text in the new line, don't free */
@@ -889,8 +889,8 @@ static int console_history_append_exec(bContext *C, wmOperator *op)
/* when calling render modally this can be NULL when calling:
* bpy.ops.render.render('INVOKE_DEFAULT') */
- if (ar) {
- console_scroll_bottom(ar);
+ if (region) {
+ console_scroll_bottom(region);
}
return OPERATOR_FINISHED;
@@ -922,7 +922,7 @@ void CONSOLE_OT_history_append(wmOperatorType *ot)
static int console_scrollback_append_exec(bContext *C, wmOperator *op)
{
SpaceConsole *sc = CTX_wm_space_console(C);
- ARegion *ar = CTX_wm_region(C);
+ ARegion *region = CTX_wm_region(C);
ConsoleLine *ci;
/* own this text in the new line, don't free */
@@ -936,10 +936,10 @@ static int console_scrollback_append_exec(bContext *C, wmOperator *op)
console_scrollback_limit(sc);
- /* 'ar' can be null depending on the operator that runs
+ /* 'region' can be null depending on the operator that runs
* rendering with invoke default for eg causes this */
- if (ar) {
- console_textview_update_rect(sc, ar);
+ if (region) {
+ console_textview_update_rect(sc, region);
}
ED_area_tag_redraw(CTX_wm_area(C));
@@ -1055,7 +1055,7 @@ void CONSOLE_OT_copy(wmOperatorType *ot)
static int console_paste_exec(bContext *C, wmOperator *UNUSED(op))
{
SpaceConsole *sc = CTX_wm_space_console(C);
- ARegion *ar = CTX_wm_region(C);
+ ARegion *region = CTX_wm_region(C);
ConsoleLine *ci = console_history_verify(C);
int buf_len;
@@ -1085,10 +1085,10 @@ static int console_paste_exec(bContext *C, wmOperator *UNUSED(op))
MEM_freeN(buf_str);
- console_textview_update_rect(sc, ar);
+ console_textview_update_rect(sc, region);
ED_area_tag_redraw(CTX_wm_area(C));
- console_scroll_bottom(ar);
+ console_scroll_bottom(region);
return OPERATOR_FINISHED;
}
@@ -1114,10 +1114,10 @@ typedef struct SetConsoleCursor {
// TODO, cursor placement without selection
static void console_cursor_set_to_pos(
- SpaceConsole *sc, ARegion *ar, SetConsoleCursor *scu, const int mval[2], int UNUSED(sel))
+ SpaceConsole *sc, ARegion *region, SetConsoleCursor *scu, const int mval[2], int UNUSED(sel))
{
int pos;
- pos = console_char_pick(sc, ar, mval);
+ pos = console_char_pick(sc, region, mval);
if (scu->sel_init == INT_MAX) {
scu->sel_init = pos;
@@ -1141,7 +1141,7 @@ static void console_cursor_set_to_pos(
static void console_modal_select_apply(bContext *C, wmOperator *op, const wmEvent *event)
{
SpaceConsole *sc = CTX_wm_space_console(C);
- ARegion *ar = CTX_wm_region(C);
+ ARegion *region = CTX_wm_region(C);
SetConsoleCursor *scu = op->customdata;
int mval[2];
int sel_prev[2];
@@ -1152,7 +1152,7 @@ static void console_modal_select_apply(bContext *C, wmOperator *op, const wmEven
sel_prev[0] = sc->sel_start;
sel_prev[1] = sc->sel_end;
- console_cursor_set_to_pos(sc, ar, scu, mval, true);
+ console_cursor_set_to_pos(sc, region, scu, mval, true);
/* only redraw if the selection changed */
if (sel_prev[0] != sc->sel_start || sel_prev[1] != sc->sel_end) {
@@ -1179,7 +1179,7 @@ static void console_cursor_set_exit(bContext *UNUSED(C), wmOperator *op)
static int console_modal_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
SpaceConsole *sc = CTX_wm_space_console(C);
- // ARegion *ar = CTX_wm_region(C);
+ // ARegion *region = CTX_wm_region(C);
SetConsoleCursor *scu;
op->customdata = MEM_callocN(sizeof(SetConsoleCursor), "SetConsoleCursor");
@@ -1238,14 +1238,14 @@ void CONSOLE_OT_select_set(wmOperatorType *ot)
static int console_selectword_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
{
SpaceConsole *sc = CTX_wm_space_console(C);
- ARegion *ar = CTX_wm_region(C);
+ ARegion *region = CTX_wm_region(C);
ConsoleLine cl_dummy = {NULL};
ConsoleLine *cl;
int ret = OPERATOR_CANCELLED;
int pos, offset, n;
- pos = console_char_pick(sc, ar, event->mval);
+ pos = console_char_pick(sc, region, event->mval);
console_scrollback_prompt_begin(sc, &cl_dummy);
diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c
index 207f508d4ee..eb83f9963b0 100644
--- a/source/blender/editors/space_console/space_console.c
+++ b/source/blender/editors/space_console/space_console.c
@@ -48,7 +48,7 @@
static SpaceLink *console_new(const ScrArea *UNUSED(area), const Scene *UNUSED(scene))
{
- ARegion *ar;
+ ARegion *region;
SpaceConsole *sconsole;
sconsole = MEM_callocN(sizeof(SpaceConsole), "initconsole");
@@ -57,28 +57,28 @@ static SpaceLink *console_new(const ScrArea *UNUSED(area), const Scene *UNUSED(s
sconsole->lheight = 14;
/* header */
- ar = MEM_callocN(sizeof(ARegion), "header for console");
+ region = MEM_callocN(sizeof(ARegion), "header for console");
- BLI_addtail(&sconsole->regionbase, ar);
- ar->regiontype = RGN_TYPE_HEADER;
- ar->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP;
+ BLI_addtail(&sconsole->regionbase, region);
+ region->regiontype = RGN_TYPE_HEADER;
+ region->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP;
/* main region */
- ar = MEM_callocN(sizeof(ARegion), "main region for text");
+ region = MEM_callocN(sizeof(ARegion), "main region for text");
- BLI_addtail(&sconsole->regionbase, ar);
- ar->regiontype = RGN_TYPE_WINDOW;
+ BLI_addtail(&sconsole->regionbase, region);
+ region->regiontype = RGN_TYPE_WINDOW;
/* keep in sync with info */
- ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
- ar->v2d.align |= V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_NEG_Y; /* align bottom left */
- ar->v2d.keepofs |= V2D_LOCKOFS_X;
- ar->v2d.keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT);
- ar->v2d.keeptot = V2D_KEEPTOT_BOUNDS;
- ar->v2d.minzoom = ar->v2d.maxzoom = 1.0f;
+ region->v2d.scroll |= (V2D_SCROLL_RIGHT);
+ region->v2d.align |= V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_NEG_Y; /* align bottom left */
+ region->v2d.keepofs |= V2D_LOCKOFS_X;
+ region->v2d.keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT);
+ region->v2d.keeptot = V2D_KEEPTOT_BOUNDS;
+ region->v2d.minzoom = region->v2d.maxzoom = 1.0f;
/* for now, aspect ratio should be maintained, and zoom is clamped within sane default limits */
- // ar->v2d.keepzoom = (V2D_KEEPASPECT|V2D_LIMITZOOM);
+ // region->v2d.keepzoom = (V2D_KEEPASPECT|V2D_LIMITZOOM);
return (SpaceLink *)sconsole;
}
@@ -116,41 +116,41 @@ static SpaceLink *console_duplicate(SpaceLink *sl)
}
/* add handlers, stuff you only do once or on area/region changes */
-static void console_main_region_init(wmWindowManager *wm, ARegion *ar)
+static void console_main_region_init(wmWindowManager *wm, ARegion *region)
{
wmKeyMap *keymap;
ListBase *lb;
- const float prev_y_min = ar->v2d.cur.ymin; /* so re-sizing keeps the cursor visible */
+ const float prev_y_min = region->v2d.cur.ymin; /* so re-sizing keeps the cursor visible */
/* force it on init, for old files, until it becomes config */
- ar->v2d.scroll = (V2D_SCROLL_RIGHT);
+ region->v2d.scroll = (V2D_SCROLL_RIGHT);
- UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
+ UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
/* always keep the bottom part of the view aligned, less annoying */
- if (prev_y_min != ar->v2d.cur.ymin) {
- const float cur_y_range = BLI_rctf_size_y(&ar->v2d.cur);
- ar->v2d.cur.ymin = prev_y_min;
- ar->v2d.cur.ymax = prev_y_min + cur_y_range;
+ if (prev_y_min != region->v2d.cur.ymin) {
+ const float cur_y_range = BLI_rctf_size_y(&region->v2d.cur);
+ region->v2d.cur.ymin = prev_y_min;
+ region->v2d.cur.ymax = prev_y_min + cur_y_range;
}
/* own keymap */
keymap = WM_keymap_ensure(wm->defaultconf, "Console", SPACE_CONSOLE, 0);
- WM_event_add_keymap_handler_v2d_mask(&ar->handlers, keymap);
+ WM_event_add_keymap_handler_v2d_mask(&region->handlers, keymap);
/* add drop boxes */
lb = WM_dropboxmap_find("Console", SPACE_CONSOLE, RGN_TYPE_WINDOW);
- WM_event_add_dropbox_handler(&ar->handlers, lb);
+ WM_event_add_dropbox_handler(&region->handlers, lb);
}
/* same as 'text_cursor' */
-static void console_cursor(wmWindow *win, ScrArea *UNUSED(sa), ARegion *ar)
+static void console_cursor(wmWindow *win, ScrArea *UNUSED(sa), ARegion *region)
{
int wmcursor = WM_CURSOR_TEXT_EDIT;
const wmEvent *event = win->eventstate;
- if (UI_view2d_mouse_in_scrollers(ar, &ar->v2d, event->x, event->y)) {
+ if (UI_view2d_mouse_in_scrollers(region, &region->v2d, event->x, event->y)) {
wmcursor = WM_CURSOR_DEFAULT;
}
@@ -203,11 +203,11 @@ static void console_dropboxes(void)
/* ************* end drop *********** */
-static void console_main_region_draw(const bContext *C, ARegion *ar)
+static void console_main_region_draw(const bContext *C, ARegion *region)
{
/* draw entirely, view changes should be handled here */
SpaceConsole *sc = CTX_wm_space_console(C);
- View2D *v2d = &ar->v2d;
+ View2D *v2d = &region->v2d;
View2DScrollers *scrollers;
if (BLI_listbase_is_empty(&sc->scrollback)) {
@@ -224,7 +224,7 @@ static void console_main_region_draw(const bContext *C, ARegion *ar)
/* data... */
console_history_verify(C); /* make sure we have some command line */
- console_textview_main(sc, ar);
+ console_textview_main(sc, region);
/* reset view matrix */
UI_view2d_view_restore(C);
@@ -267,18 +267,21 @@ static void console_keymap(struct wmKeyConfig *keyconf)
/****************** header region ******************/
/* add handlers, stuff you only do once or on area/region changes */
-static void console_header_region_init(wmWindowManager *UNUSED(wm), ARegion *ar)
+static void console_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region)
{
- ED_region_header_init(ar);
+ ED_region_header_init(region);
}
-static void console_header_region_draw(const bContext *C, ARegion *ar)
+static void console_header_region_draw(const bContext *C, ARegion *region)
{
- ED_region_header(C, ar);
+ ED_region_header(C, region);
}
-static void console_main_region_listener(
- wmWindow *UNUSED(win), ScrArea *sa, ARegion *ar, wmNotifier *wmn, const Scene *UNUSED(scene))
+static void console_main_region_listener(wmWindow *UNUSED(win),
+ ScrArea *sa,
+ ARegion *region,
+ wmNotifier *wmn,
+ const Scene *UNUSED(scene))
{
// SpaceInfo *sinfo = sa->spacedata.first;
@@ -289,13 +292,13 @@ static void console_main_region_listener(
if (wmn->action == NA_EDITED) {
if ((wmn->reference && sa) && (wmn->reference == sa->spacedata.first)) {
/* we've modified the geometry (font size), re-calculate rect */
- console_textview_update_rect(wmn->reference, ar);
- ED_region_tag_redraw(ar);
+ console_textview_update_rect(wmn->reference, region);
+ ED_region_tag_redraw(region);
}
}
else {
/* generic redraw request */
- ED_region_tag_redraw(ar);
+ ED_region_tag_redraw(region);
}
}
break;