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>2012-03-28 15:53:18 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-28 15:53:18 +0400
commited61bfc9a6580360805a3daae1003df43a7f2c11 (patch)
tree29ee3248e82a5109b241127b1c2397ca11bf7bcb /source/blender/editors/space_info/info_draw.c
parentca8d262e89c25d15368ec4eb2fe80111e732e1f7 (diff)
style cleanup
Diffstat (limited to 'source/blender/editors/space_info/info_draw.c')
-rw-r--r--source/blender/editors/space_info/info_draw.c134
1 files changed, 67 insertions, 67 deletions
diff --git a/source/blender/editors/space_info/info_draw.c b/source/blender/editors/space_info/info_draw.c
index c06a778951d..2409ab8c4e0 100644
--- a/source/blender/editors/space_info/info_draw.c
+++ b/source/blender/editors/space_info/info_draw.c
@@ -66,42 +66,42 @@
static void info_report_color(unsigned char *fg, unsigned char *bg, Report *report, int bool)
{
if (report->flag & SELECT) {
- fg[0]=255; fg[1]=255; fg[2]=255;
+ fg[0] = 255; fg[1] = 255; fg[2] = 255;
if (bool) {
- bg[0]=96; bg[1]=128; bg[2]=255;
+ bg[0] = 96; bg[1] = 128; bg[2] = 255;
}
else {
- bg[0]=90; bg[1]=122; bg[2]=249;
+ bg[0] = 90; bg[1] = 122; bg[2] = 249;
}
}
else {
- fg[0]=0; fg[1]=0; fg[2]=0;
+ fg[0] = 0; fg[1] = 0; fg[2] = 0;
if (report->type & RPT_ERROR_ALL) {
- if (bool) { bg[0]=220; bg[1]=0; bg[2]=0; }
- else { bg[0]=214; bg[1]=0; bg[2]=0; }
+ if (bool) { bg[0] = 220; bg[1] = 0; bg[2] = 0; }
+ else { bg[0] = 214; bg[1] = 0; bg[2] = 0; }
}
else if (report->type & RPT_WARNING_ALL) {
- if (bool) { bg[0]=220; bg[1]=128; bg[2]=96; }
- else { bg[0]=214; bg[1]=122; bg[2]=90; }
+ if (bool) { bg[0] = 220; bg[1] = 128; bg[2] = 96; }
+ else { bg[0] = 214; bg[1] = 122; bg[2] = 90; }
}
#if 0 // XXX: this looks like the selected color, so don't use this
else if (report->type & RPT_OPERATOR_ALL) {
- if (bool) { bg[0]=96; bg[1]=128; bg[2]=255; }
- else { bg[0]=90; bg[1]=122; bg[2]=249; }
+ if (bool) { bg[0] = 96; bg[1] = 128; bg[2] = 255; }
+ else { bg[0] = 90; bg[1] = 122; bg[2] = 249; }
}
#endif
else if (report->type & RPT_INFO_ALL) {
- if (bool) { bg[0]=0; bg[1]=170; bg[2]=0; }
- else { bg[0]=0; bg[1]=164; bg[2]=0; }
+ if (bool) { bg[0] = 0; bg[1] = 170; bg[2] = 0; }
+ else { bg[0] = 0; bg[1] = 164; bg[2] = 0; }
}
else if (report->type & RPT_DEBUG_ALL) {
- if (bool) { bg[0]=196; bg[1]=196; bg[2]=196; }
- else { bg[0]=190; bg[1]=190; bg[2]=190; }
+ if (bool) { bg[0] = 196; bg[1] = 196; bg[2] = 196; }
+ else { bg[0] = 190; bg[1] = 190; bg[2] = 190; }
}
else {
- if (bool) { bg[0]=120; bg[1]=120; bg[2]=120; }
- else { bg[0]=114; bg[1]=114; bg[2]=114; }
+ if (bool) { bg[0] = 120; bg[1] = 120; bg[2] = 120; }
+ else { bg[0] = 114; bg[1] = 114; bg[2] = 114; }
}
}
}
@@ -110,24 +110,24 @@ static void info_report_color(unsigned char *fg, unsigned char *bg, Report *repo
#ifdef USE_INFO_NEWLINE
static void report_textview_init__internal(TextViewContext *tvc)
{
- Report *report= (Report *)tvc->iter;
- const char *str= report->message;
- const char *next_str= strchr(str + tvc->iter_char, '\n');
+ Report *report = (Report *)tvc->iter;
+ const char *str = report->message;
+ const char *next_str = strchr(str + tvc->iter_char, '\n');
if (next_str) {
- tvc->iter_char_next= (int)(next_str - str);
+ tvc->iter_char_next = (int)(next_str - str);
}
else {
- tvc->iter_char_next= report->len;
+ tvc->iter_char_next = report->len;
}
}
static int report_textview_skip__internal(TextViewContext *tvc)
{
- SpaceInfo *sinfo= (SpaceInfo *)tvc->arg1;
- const int report_mask= info_report_mask(sinfo);
- while (tvc->iter && (((Report *)tvc->iter)->type & report_mask)==0) {
- tvc->iter= (void *)((Link *)tvc->iter)->prev;
+ SpaceInfo *sinfo = (SpaceInfo *)tvc->arg1;
+ const int report_mask = info_report_mask(sinfo);
+ while (tvc->iter && (((Report *)tvc->iter)->type & report_mask) == 0) {
+ tvc->iter = (void *)((Link *)tvc->iter)->prev;
}
return (tvc->iter != NULL);
}
@@ -137,23 +137,23 @@ static int report_textview_skip__internal(TextViewContext *tvc)
static int report_textview_begin(TextViewContext *tvc)
{
// SpaceConsole *sc= (SpaceConsole *)tvc->arg1;
- ReportList *reports= (ReportList *)tvc->arg2;
+ ReportList *reports = (ReportList *)tvc->arg2;
- tvc->lheight= 14; //sc->lheight;
- tvc->sel_start= 0;
- tvc->sel_end= 0;
+ tvc->lheight = 14; //sc->lheight;
+ tvc->sel_start = 0;
+ tvc->sel_end = 0;
/* iterator */
- tvc->iter= reports->list.last;
+ tvc->iter = reports->list.last;
- glClearColor(120.0/255.0, 120.0/255.0, 120.0/255.0, 1.0);
+ glClearColor(120.0 / 255.0, 120.0 / 255.0, 120.0 / 255.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
#ifdef USE_INFO_NEWLINE
- tvc->iter_tmp= 0;
+ tvc->iter_tmp = 0;
if (tvc->iter && report_textview_skip__internal(tvc)) {
/* init the newline iterator */
- tvc->iter_char= 0;
+ tvc->iter_char = 0;
report_textview_init__internal(tvc);
return TRUE;
@@ -175,14 +175,14 @@ static void report_textview_end(TextViewContext *UNUSED(tvc))
static int report_textview_step(TextViewContext *tvc)
{
/* simple case, but no newline support */
- Report *report= (Report *)tvc->iter;
+ Report *report = (Report *)tvc->iter;
if (report->len <= tvc->iter_char_next) {
- tvc->iter= (void *)((Link *)tvc->iter)->prev;
+ tvc->iter = (void *)((Link *)tvc->iter)->prev;
if (tvc->iter && report_textview_skip__internal(tvc)) {
tvc->iter_tmp++;
- tvc->iter_char= 0; /* reset start */
+ tvc->iter_char = 0; /* reset start */
report_textview_init__internal(tvc);
return TRUE;
@@ -193,7 +193,7 @@ static int report_textview_step(TextViewContext *tvc)
}
else {
/* step to the next newline */
- tvc->iter_char= tvc->iter_char_next + 1;
+ tvc->iter_char = tvc->iter_char_next + 1;
report_textview_init__internal(tvc);
return TRUE;
@@ -202,15 +202,15 @@ static int report_textview_step(TextViewContext *tvc)
static int report_textview_line_get(struct TextViewContext *tvc, const char **line, int *len)
{
- Report *report= (Report *)tvc->iter;
- *line= report->message + tvc->iter_char;
- *len= tvc->iter_char_next - tvc->iter_char;
+ Report *report = (Report *)tvc->iter;
+ *line = report->message + tvc->iter_char;
+ *len = tvc->iter_char_next - tvc->iter_char;
return 1;
}
static int report_textview_line_color(struct TextViewContext *tvc, unsigned char fg[3], unsigned char bg[3])
{
- Report *report= (Report *)tvc->iter;
+ Report *report = (Report *)tvc->iter;
info_report_color(fg, bg, report, tvc->iter_tmp % 2);
return TVC_LINE_FG | TVC_LINE_BG;
}
@@ -220,27 +220,27 @@ static int report_textview_line_color(struct TextViewContext *tvc, unsigned char
static int report_textview_step(TextViewContext *tvc)
{
- SpaceInfo *sinfo= (SpaceInfo *)tvc->arg1;
- const int report_mask= info_report_mask(sinfo);
+ SpaceInfo *sinfo = (SpaceInfo *)tvc->arg1;
+ const int report_mask = info_report_mask(sinfo);
do {
- tvc->iter= (void *)((Link *)tvc->iter)->prev;
- } while (tvc->iter && (((Report *)tvc->iter)->type & report_mask)==0);
+ tvc->iter = (void *)((Link *)tvc->iter)->prev;
+ } while (tvc->iter && (((Report *)tvc->iter)->type & report_mask) == 0);
return (tvc->iter != NULL);
}
static int report_textview_line_get(struct TextViewContext *tvc, const char **line, int *len)
{
- Report *report= (Report *)tvc->iter;
- *line= report->message;
- *len= report->len;
+ Report *report = (Report *)tvc->iter;
+ *line = report->message;
+ *len = report->len;
return 1;
}
static int report_textview_line_color(struct TextViewContext *tvc, unsigned char fg[3], unsigned char bg[3])
{
- Report *report= (Report *)tvc->iter;
+ Report *report = (Report *)tvc->iter;
info_report_color(fg, bg, report, tvc->iter_tmp % 2);
return TVC_LINE_FG | TVC_LINE_BG;
}
@@ -251,41 +251,41 @@ static int report_textview_line_color(struct TextViewContext *tvc, unsigned char
static int info_textview_main__internal(struct SpaceInfo *sinfo, struct ARegion *ar, ReportList *reports, int draw, int mval[2], void **mouse_pick, int *pos_pick)
{
- int ret= 0;
+ int ret = 0;
- View2D *v2d= &ar->v2d;
+ View2D *v2d = &ar->v2d;
- TextViewContext tvc= {0};
- tvc.begin= report_textview_begin;
- tvc.end= report_textview_end;
+ TextViewContext tvc = {0};
+ tvc.begin = report_textview_begin;
+ tvc.end = report_textview_end;
- tvc.step= report_textview_step;
- tvc.line_get= report_textview_line_get;
- tvc.line_color= report_textview_line_color;
+ tvc.step = report_textview_step;
+ tvc.line_get = report_textview_line_get;
+ tvc.line_color = report_textview_line_color;
- tvc.arg1= sinfo;
- tvc.arg2= reports;
+ tvc.arg1 = sinfo;
+ tvc.arg2 = reports;
/* view */
- tvc.sel_start= 0;
- tvc.sel_end= 0;
- tvc.lheight= 14; //sc->lheight;
+ tvc.sel_start = 0;
+ tvc.sel_end = 0;
+ tvc.lheight = 14; //sc->lheight;
tvc.ymin = v2d->cur.ymin;
tvc.ymax = v2d->cur.ymax;
- tvc.winx= ar->winx;
+ tvc.winx = ar->winx;
- ret= textview_draw(&tvc, draw, mval, mouse_pick, pos_pick);
+ ret = textview_draw(&tvc, draw, mval, mouse_pick, pos_pick);
return ret;
}
void *info_text_pick(struct SpaceInfo *sinfo, struct ARegion *ar, ReportList *reports, int mouse_y)
{
- void *mouse_pick= NULL;
+ void *mouse_pick = NULL;
int mval[2];
- mval[0]= 0;
- mval[1]= mouse_y;
+ mval[0] = 0;
+ mval[1] = mouse_y;
info_textview_main__internal(sinfo, ar, reports, 0, mval, &mouse_pick, NULL);
return (void *)mouse_pick;