Removes all Tab characters into agg-plot to use only spaces - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2012年06月27日 17:45:49 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2012年06月27日 17:45:49 +0200
commit1b2fab01c5b721e793a27dd5f5e67eab65a4fd78 (patch)
tree475b9aaa3cd1693c0a83bf965e039c214274ab6b /agg-plot
parentf31d5249020fd59ae6f997c870efa9baac05ca05 (diff)
downloadgsl-shell-1b2fab01c5b721e793a27dd5f5e67eab65a4fd78.tar.gz
Removes all Tab characters into agg-plot to use only spaces
Diffstat (limited to 'agg-plot')
-rw-r--r--agg-plot/agg-parse-trans.cpp 24
-rw-r--r--agg-plot/agg_pixfmt_rgb24_lcd.h 62
-rw-r--r--agg-plot/agg_platform_support_win32.cpp 24
-rw-r--r--agg-plot/agg_platform_support_x11.cpp 80
-rw-r--r--agg-plot/canvas.h 8
-rw-r--r--agg-plot/categories.h 2
-rw-r--r--agg-plot/draw_svg.cpp 10
-rw-r--r--agg-plot/draw_svg.h 56
-rw-r--r--agg-plot/lua-draw.cpp 26
-rw-r--r--agg-plot/lua-plot.cpp 40
-rw-r--r--agg-plot/lua-text.cpp 52
-rw-r--r--agg-plot/markers.cpp 2
-rw-r--r--agg-plot/my_conv_simple_marker.h 72
-rw-r--r--agg-plot/my_tree.h 14
-rw-r--r--agg-plot/platform_support_ext.h 14
-rw-r--r--agg-plot/plot-auto.h 12
-rw-r--r--agg-plot/plot.h 128
-rw-r--r--agg-plot/split-parser.h 44
-rw-r--r--agg-plot/text-shape.h 26
-rw-r--r--agg-plot/text.cpp 22
-rw-r--r--agg-plot/text.h 6
-rw-r--r--agg-plot/units.cpp 2
-rw-r--r--agg-plot/utils.h 6
-rw-r--r--agg-plot/window-cpp.h 2
-rw-r--r--agg-plot/window.cpp 100
-rw-r--r--agg-plot/window_registry.cpp 20
-rw-r--r--agg-plot/window_registry.h 2
27 files changed, 428 insertions, 428 deletions
diff --git a/agg-plot/agg-parse-trans.cpp b/agg-plot/agg-parse-trans.cpp
index cd1bf097..672703e9 100644
--- a/agg-plot/agg-parse-trans.cpp
+++ b/agg-plot/agg-parse-trans.cpp
@@ -109,7 +109,7 @@ sg_object* build_marker (lua_State *L, int specindex, sg_object* src, int li)
{
sg_object* obj = (sg_object*) lua_touserdata(L, -1);
sym = new trans::scaling_a(obj);
- plot_lua_add_ref (L, 1, li);
+ plot_lua_add_ref (L, 1, li);
}
else
{
@@ -142,19 +142,19 @@ sg_object* build_dash (lua_State *L, int specindex, sg_object* src, int li)
lua_rawgeti (L, specindex, j);
if (lua_isnumber (L, -1))
- {
- double a = lua_tonumber (L, -1);
- lua_pop (L, 1);
+ {
+ double a = lua_tonumber (L, -1);
+ lua_pop (L, 1);
- lua_rawgeti (L, specindex, j+1);
+ lua_rawgeti (L, specindex, j+1);
- double b = (lua_isnumber (L, -1) ? lua_tonumber (L, -1) : a);
+ double b = (lua_isnumber (L, -1) ? lua_tonumber (L, -1) : a);
- d->add_dash(a, b);
- lua_pop (L,1);
- }
+ d->add_dash(a, b);
+ lua_pop (L,1);
+ }
else
- break;
+ break;
}
lua_pop (L, 1);
@@ -233,8 +233,8 @@ public:
const reg *p;
for (p = builder_table; p->name != NULL; p++)
{
- if (strcmp (p->name, key) == 0)
- return p->func;
+ if (strcmp (p->name, key) == 0)
+ return p->func;
}
return NULL;
diff --git a/agg-plot/agg_pixfmt_rgb24_lcd.h b/agg-plot/agg_pixfmt_rgb24_lcd.h
index 39fbe8c6..3327ac0a 100644
--- a/agg-plot/agg_pixfmt_rgb24_lcd.h
+++ b/agg-plot/agg_pixfmt_rgb24_lcd.h
@@ -49,34 +49,34 @@ namespace agg
tert *= norm;
for(unsigned i = 0; i < 256; i++)
{
- unsigned char s = round(second * i);
- unsigned char t = round(tert * i);
- unsigned char p = i - (2*s + 2*t);
+ unsigned char s = round(second * i);
+ unsigned char t = round(tert * i);
+ unsigned char p = i - (2*s + 2*t);
- m_data[3*i + 1] = s; /* secondary */
- m_data[3*i + 2] = t; /* tertiary */
- m_data[3*i ] = p; /* primary */
+ m_data[3*i + 1] = s; /* secondary */
+ m_data[3*i + 2] = t; /* tertiary */
+ m_data[3*i ] = p; /* primary */
}
}
unsigned convolution(const int8u* covers, int i0, int i_min, int i_max) const
{
- unsigned sum = 0;
- int k_min = (i0 >= i_min + 2 ? -2 : i_min - i0);
- int k_max = (i0 <= i_max - 2 ? 2 : i_max - i0);
- for (int k = k_min; k <= k_max; k++)
- {
- /* select the primary, secondary or tertiary channel */
- int channel = abs(k) % 3;
- int8u c = covers[i0 + k];
- sum += m_data[3*c + channel];
- }
-
- return sum;
+ unsigned sum = 0;
+ int k_min = (i0 >= i_min + 2 ? -2 : i_min - i0);
+ int k_max = (i0 <= i_max - 2 ? 2 : i_max - i0);
+ for (int k = k_min; k <= k_max; k++)
+ {
+ /* select the primary, secondary or tertiary channel */
+ int channel = abs(k) % 3;
+ int8u c = covers[i0 + k];
+ sum += m_data[3*c + channel];
+ }
+
+ return sum;
}
private:
- unsigned char m_data[256*3];
+ unsigned char m_data[256*3];
};
@@ -128,26 +128,26 @@ namespace agg
const color_type& c,
const int8u* covers)
{
- unsigned rowlen = m_rbuf->width();
- int cx = (x - 2 >= 0 ? -2 : -x);
- int cx_max = (len + 2 <= rowlen ? len + 1 : rowlen - 1);
+ unsigned rowlen = m_rbuf->width();
+ int cx = (x - 2 >= 0 ? -2 : -x);
+ int cx_max = (len + 2 <= rowlen ? len + 1 : rowlen - 1);
- int i = (x + cx) % 3;
+ int i = (x + cx) % 3;
- int8u rgb[3] = { c.r, c.g, c.b };
- int8u* p = m_rbuf->row_ptr(y) + (x + cx);
+ int8u rgb[3] = { c.r, c.g, c.b };
+ int8u* p = m_rbuf->row_ptr(y) + (x + cx);
- for (/* */; cx <= cx_max; cx++)
- {
+ for (/* */; cx <= cx_max; cx++)
+ {
unsigned c_conv = m_lut->convolution(covers, cx, 0, len - 1);
unsigned alpha = (c_conv + 1) * (c.a + 1);
unsigned dst_col = rgb[i], src_col = (*p);
*p = (int8u)((((dst_col - src_col) * alpha) + (src_col << 16)) >> 16);
- p ++;
- i = (i + 1) % 3;
- }
- }
+ p ++;
+ i = (i + 1) % 3;
+ }
+ }
private:
rendering_buffer* m_rbuf;
diff --git a/agg-plot/agg_platform_support_win32.cpp b/agg-plot/agg_platform_support_win32.cpp
index d0738b5c..d7bcb351 100644
--- a/agg-plot/agg_platform_support_win32.cpp
+++ b/agg-plot/agg_platform_support_win32.cpp
@@ -172,17 +172,17 @@ namespace agg
rendering_buffer_ro src_view;
rendering_buffer_get_const_view(src_view, *src, r, m_bpp / 8, m_flip_y);
- if (m_format == m_sys_format)
- {
- rbuf_tmp.copy_from(src_view);
- }
- else
- {
- if (m_sys_format == pix_format_bgr24 && m_format == pix_format_rgb24)
- {
- my_color_conv(&rbuf_tmp, &src_view, color_conv_rgb24_to_bgr24());
- }
- }
+ if (m_format == m_sys_format)
+ {
+ rbuf_tmp.copy_from(src_view);
+ }
+ else
+ {
+ if (m_sys_format == pix_format_bgr24 && m_format == pix_format_rgb24)
+ {
+ my_color_conv(&rbuf_tmp, &src_view, color_conv_rgb24_to_bgr24());
+ }
+ }
unsigned int wh = m_pmap_window.height();
RECT wrect;
@@ -484,7 +484,7 @@ namespace agg
::TranslateMessage(&msg);
if(msg.message == WM_QUIT)
{
- m_specific->m_is_mapped = false;
+ m_specific->m_is_mapped = false;
break;
}
::DispatchMessage(&msg);
diff --git a/agg-plot/agg_platform_support_x11.cpp b/agg-plot/agg_platform_support_x11.cpp
index 9ba74560..b7aff461 100644
--- a/agg-plot/agg_platform_support_x11.cpp
+++ b/agg-plot/agg_platform_support_x11.cpp
@@ -723,7 +723,7 @@ namespace agg
ps->m_update_flag = false;
}
- xc->busy(true);
+ xc->busy(true);
XEvent x_event;
if (ps->m_is_mapped)
@@ -737,7 +737,7 @@ namespace agg
XNextEvent(xc->display, &x_event);
}
- xc->busy(false);
+ xc->busy(false);
switch(x_event.type)
{
@@ -766,8 +766,8 @@ namespace agg
if (ps->m_main_img == 0 || ps->m_draw_img == 0)
{
- if (ps->m_main_img) delete ps->m_main_img;
- if (ps->m_draw_img) delete ps->m_draw_img;
+ if (ps->m_main_img) delete ps->m_main_img;
+ if (ps->m_draw_img) delete ps->m_draw_img;
quit = true;
ret = 1;
break;
@@ -783,11 +783,11 @@ namespace agg
break;
case Expose:
- xc->busy(true);
+ xc->busy(true);
ps->put_image(&m_rbuf_window);
XFlush(xc->display);
XSync(xc->display, false);
- xc->busy(false);
+ xc->busy(false);
break;
case ClientMessage:
@@ -1138,40 +1138,40 @@ platform_support_ext::save_image_file (agg::rendering_buffer& rbuf, const char *
{
const unsigned char* src = rbuf.row_ptr(gslshell::flip_y ? h - 1 - y : y);
switch(gslshell::pixel_format)
- {
- default: break;
- case agg::pix_format_rgb555:
- agg::color_conv_row(tmp_buf, src, w, agg::color_conv_rgb555_to_rgb24());
- break;
-
- case agg::pix_format_rgb565:
- agg::color_conv_row(tmp_buf, src, w, agg::color_conv_rgb565_to_rgb24());
- break;
-
- case agg::pix_format_bgr24:
- agg::color_conv_row(tmp_buf, src, w, agg::color_conv_bgr24_to_rgb24());
- break;
-
- case agg::pix_format_rgb24:
- agg::color_conv_row(tmp_buf, src, w, agg::color_conv_rgb24_to_rgb24());
- break;
-
- case agg::pix_format_rgba32:
- agg::color_conv_row(tmp_buf, src, w, agg::color_conv_rgba32_to_rgb24());
- break;
-
- case agg::pix_format_argb32:
- agg::color_conv_row(tmp_buf, src, w, agg::color_conv_argb32_to_rgb24());
- break;
-
- case agg::pix_format_bgra32:
- agg::color_conv_row(tmp_buf, src, w, agg::color_conv_bgra32_to_rgb24());
- break;
-
- case agg::pix_format_abgr32:
- agg::color_conv_row(tmp_buf, src, w, agg::color_conv_abgr32_to_rgb24());
- break;
- }
+ {
+ default: break;
+ case agg::pix_format_rgb555:
+ agg::color_conv_row(tmp_buf, src, w, agg::color_conv_rgb555_to_rgb24());
+ break;
+
+ case agg::pix_format_rgb565:
+ agg::color_conv_row(tmp_buf, src, w, agg::color_conv_rgb565_to_rgb24());
+ break;
+
+ case agg::pix_format_bgr24:
+ agg::color_conv_row(tmp_buf, src, w, agg::color_conv_bgr24_to_rgb24());
+ break;
+
+ case agg::pix_format_rgb24:
+ agg::color_conv_row(tmp_buf, src, w, agg::color_conv_rgb24_to_rgb24());
+ break;
+
+ case agg::pix_format_rgba32:
+ agg::color_conv_row(tmp_buf, src, w, agg::color_conv_rgba32_to_rgb24());
+ break;
+
+ case agg::pix_format_argb32:
+ agg::color_conv_row(tmp_buf, src, w, agg::color_conv_argb32_to_rgb24());
+ break;
+
+ case agg::pix_format_bgra32:
+ agg::color_conv_row(tmp_buf, src, w, agg::color_conv_bgra32_to_rgb24());
+ break;
+
+ case agg::pix_format_abgr32:
+ agg::color_conv_row(tmp_buf, src, w, agg::color_conv_abgr32_to_rgb24());
+ break;
+ }
fwrite(tmp_buf, 1, w * 3, fd);
}
diff --git a/agg-plot/canvas.h b/agg-plot/canvas.h
index e03797c2..4f99de4f 100644
--- a/agg-plot/canvas.h
+++ b/agg-plot/canvas.h
@@ -34,7 +34,7 @@ class canvas_gen : private Pixel {
public:
canvas_gen(agg::rendering_buffer& ren_buf, double width, double height,
- agg::rgba bgcol):
+ agg::rgba bgcol):
Pixel(ren_buf), rb(Pixel::pixfmt), rs(rb),
ras(), sl(), bg_color(bgcol),
m_width(width), m_height(height)
@@ -65,9 +65,9 @@ public:
if (!direct_render)
{
- this->ras.add_path(vs);
- this->rs.color(c);
- agg::render_scanlines(this->ras, this->sl, this->rs);
+ this->ras.add_path(vs);
+ this->rs.color(c);
+ agg::render_scanlines(this->ras, this->sl, this->rs);
}
};
diff --git a/agg-plot/categories.h b/agg-plot/categories.h
index 3255d354..1ded54d7 100644
--- a/agg-plot/categories.h
+++ b/agg-plot/categories.h
@@ -23,7 +23,7 @@ public:
virtual bool next(double& val, const char*& text)
{
if (m_index >= m_cat.size())
- return false;
+ return false;
item* it = m_cat[m_index];
val = it->value;
diff --git a/agg-plot/draw_svg.cpp b/agg-plot/draw_svg.cpp
index 57123e53..1d915b19 100644
--- a/agg-plot/draw_svg.cpp
+++ b/agg-plot/draw_svg.cpp
@@ -37,15 +37,15 @@ static str gen_path_element(str& content, str& style, int id)
}
str svg_stroke_path(str& path_coords, double width, int id, agg::rgba8 c,
- svg_property_list* properties)
+ svg_property_list* properties)
{
char rgbstr[8];
format_rgb(rgbstr, c);
str s = str::print("fill:none;stroke:%s;"
- "stroke-width:%g;stroke-linecap:butt;"
- "stroke-linejoin:miter",
- rgbstr, width);
+ "stroke-width:%g;stroke-linecap:butt;"
+ "stroke-linejoin:miter",
+ rgbstr, width);
property_append_alpha(s, "stroke-opacity", c);
append_properties(s, properties);
@@ -61,7 +61,7 @@ str svg_marker_path(str& path_coords, double sw, int id, svg_property_list* prop
}
str svg_fill_path(str& path_coords, int id, agg::rgba8 c,
- svg_property_list* properties)
+ svg_property_list* properties)
{
char rgbstr[8];
format_rgb(rgbstr, c);
diff --git a/agg-plot/draw_svg.h b/agg-plot/draw_svg.h
index ba61f86e..34f6f681 100644
--- a/agg-plot/draw_svg.h
+++ b/agg-plot/draw_svg.h
@@ -48,18 +48,18 @@ void svg_coords_from_vs(VertexSource* vs, str& s, double h)
while ((cmd = vertex_flip(vs, &x, &y, h)))
{
if (agg::is_move_to(cmd)) {
- s.printf_add("%sM %g,%g", sep, x, y);
+ s.printf_add("%sM %g,%g", sep, x, y);
} else if (agg::is_line_to(cmd)) {
- s.printf_add("%s%g,%g", sep, x, y);
- } else if (agg::is_close(cmd)) {
- s.printf_add("%sz", sep);
- } else if (agg::is_curve3(cmd)) {
- vertex_flip(vs, &x, &y, h);
- s.printf_add("%s%g,%g", sep, x, y);
- } else if (agg::is_curve4(cmd)) {
- vs->vertex(&x, &y);
- vertex_flip(vs, &x, &y, h);
- s.printf_add("%s%g,%g", sep, x, y);
+ s.printf_add("%s%g,%g", sep, x, y);
+ } else if (agg::is_close(cmd)) {
+ s.printf_add("%sz", sep);
+ } else if (agg::is_curve3(cmd)) {
+ vertex_flip(vs, &x, &y, h);
+ s.printf_add("%s%g,%g", sep, x, y);
+ } else if (agg::is_curve4(cmd)) {
+ vs->vertex(&x, &y);
+ vertex_flip(vs, &x, &y, h);
+ s.printf_add("%s%g,%g", sep, x, y);
}
sep = space;
}
@@ -79,24 +79,24 @@ void svg_curve_coords_from_vs(VertexSource* vs, str& s, double h)
while ((cmd = vertex_flip(vs, &x, &y, h)))
{
if (agg::is_move_to(cmd)) {
- s.printf_add("%sM %g,%g", sep, x, y);
- omit_line_to = true;
+ s.printf_add("%sM %g,%g", sep, x, y);
+ omit_line_to = true;
} else if (agg::is_line_to(cmd)) {
- s.printf_add("%s%s%g,%g", sep, omit_line_to ? "" : "L ", x, y);
- } else if (agg::is_curve4(cmd)) {
- double x1 = x, y1 = y;
- double x2, y2;
- vertex_flip(vs, &x2, &y2, h);
- vertex_flip(vs, &x, &y, h);
- s.printf_add("%sC %g,%g %g,%g %g,%g", sep, x1, y1, x2, y2, x, y);
- omit_line_to = false;
- } else if (agg::is_curve3(cmd)) {
- double x1 = x, y1 = y;
- vertex_flip(vs, &x, &y, h);
- s.printf_add("%sQ %g,%g %g,%g", sep, x1, y1, x, y);
- omit_line_to = false;
- } else if (agg::is_close(cmd)) {
- s.printf_add("%sz", sep);
+ s.printf_add("%s%s%g,%g", sep, omit_line_to ? "" : "L ", x, y);
+ } else if (agg::is_curve4(cmd)) {
+ double x1 = x, y1 = y;
+ double x2, y2;
+ vertex_flip(vs, &x2, &y2, h);
+ vertex_flip(vs, &x, &y, h);
+ s.printf_add("%sC %g,%g %g,%g %g,%g", sep, x1, y1, x2, y2, x, y);
+ omit_line_to = false;
+ } else if (agg::is_curve3(cmd)) {
+ double x1 = x, y1 = y;
+ vertex_flip(vs, &x, &y, h);
+ s.printf_add("%sQ %g,%g %g,%g", sep, x1, y1, x, y);
+ omit_line_to = false;
+ } else if (agg::is_close(cmd)) {
+ s.printf_add("%sz", sep);
}
sep = space;
}
diff --git a/agg-plot/lua-draw.cpp b/agg-plot/lua-draw.cpp
index ff559d51..e8fba890 100644
--- a/agg-plot/lua-draw.cpp
+++ b/agg-plot/lua-draw.cpp
@@ -159,9 +159,9 @@ path_cmd (draw::path *p, int _cmd, struct cmd_call_stack *s)
break;
case CMD_LINE_TO:
if (ps.total_vertices() == 0)
- ps.move_to (s->f[0], s->f[1]);
+ ps.move_to (s->f[0], s->f[1]);
else
- ps.line_to (s->f[0], s->f[1]);
+ ps.line_to (s->f[0], s->f[1]);
break;
case CMD_CLOSE:
ps.close_polygon ();
@@ -193,16 +193,16 @@ agg_path_cmd (lua_State *L)
for (fc = signature; fc[0]; fc++)
{
switch (fc[0])
- {
- case 'f':
- s->f[f_count++] = gs_check_number (L, argc++, FP_CHECK_NORMAL);
- break;
- case 'b':
- if (lua_isboolean (L, argc))
- s->b[b_count++] = lua_toboolean (L, argc++);
- else
- return luaL_error (L, "expected boolean for argument #%i", argc);
- }
+ {
+ case 'f':
+ s->f[f_count++] = gs_check_number (L, argc++, FP_CHECK_NORMAL);
+ break;
+ case 'b':
+ if (lua_isboolean (L, argc))
+ s->b[b_count++] = lua_toboolean (L, argc++);
+ else
+ return luaL_error (L, "expected boolean for argument #%i", argc);
+ }
}
pthread_mutex_lock (agg_mutex);
@@ -224,7 +224,7 @@ agg_path_index (lua_State *L)
for (r = cmd_table; r->cmd; r++)
{
if (strcmp (key, r->cmd) == 0)
- break;
+ break;
}
if (r->cmd)
diff --git a/agg-plot/lua-plot.cpp b/agg-plot/lua-plot.cpp
index 336d1bbd..8a6f186a 100644
--- a/agg-plot/lua-plot.cpp
+++ b/agg-plot/lua-plot.cpp
@@ -154,7 +154,7 @@ plot_new (lua_State *L)
{
const char *title = lua_tostring (L, 1);
if (title)
- p->title() = title;
+ p->title() = title;
}
return 1;
@@ -174,7 +174,7 @@ canvas_new (lua_State *L)
{
const char *title = lua_tostring (L, 1);
if (title)
- p->title() = title;
+ p->title() = title;
}
return 1;
@@ -188,7 +188,7 @@ plot_free (lua_State *L)
void
plot_add_gener_cpp (lua_State *L, sg_plot* p, bool as_line,
- gslshell::ret_status& st)
+ gslshell::ret_status& st)
{
agg::rgba8 color;
int layer_index = p->current_layer_index();
@@ -430,8 +430,8 @@ int
plot_index (lua_State *L)
{
return mlua_index_with_properties (L,
- plot_properties_get,
- plot_methods, false);
+ plot_properties_get,
+ plot_methods, false);
}
int
@@ -645,26 +645,26 @@ plot_set_categories (lua_State *L)
int k, n;
if (!lua_istable(L, 3))
- {
- AGG_UNLOCK();
- return luaL_error(L, "invalid categories, should be a table or nil");
- }
+ {
+ AGG_UNLOCK();
+ return luaL_error(L, "invalid categories, should be a table or nil");
+ }
p->enable_categories(dir);
n = lua_objlen(L, 3);
for (k = 1; k+1 <= n; k += 2)
- {
- lua_rawgeti(L, 3, k);
- lua_rawgeti(L, 3, k+1);
- if (lua_isnumber(L, -2) && lua_isstring(L, -1))
- {
- double v = lua_tonumber(L, -2);
- const char* s = lua_tostring(L, -1);
- p->add_category_entry(dir, v, s);
- }
- lua_pop(L, 2);
- }
+ {
+ lua_rawgeti(L, 3, k);
+ lua_rawgeti(L, 3, k+1);
+ if (lua_isnumber(L, -2) && lua_isstring(L, -1))
+ {
+ double v = lua_tonumber(L, -2);
+ const char* s = lua_tostring(L, -1);
+ p->add_category_entry(dir, v, s);
+ }
+ lua_pop(L, 2);
+ }
}
AGG_UNLOCK();
diff --git a/agg-plot/lua-text.cpp b/agg-plot/lua-text.cpp
index cb5dd7c4..3558addb 100644
--- a/agg-plot/lua-text.cpp
+++ b/agg-plot/lua-text.cpp
@@ -120,19 +120,19 @@ agg_text_justif_set (lua_State *L)
char ch = justif[0];
double hjf;
switch (ch)
- {
- case 'l':
- hjf = 0.0;
- break;
- case 'c':
- hjf = 0.5;
- break;
- case 'r':
- hjf = 1.0;
- break;
- default:
- return luaL_error (L, "invalid text justification");
- }
+ {
+ case 'l':
+ hjf = 0.0;
+ break;
+ case 'c':
+ hjf = 0.5;
+ break;
+ case 'r':
+ hjf = 1.0;
+ break;
+ default:
+ return luaL_error (L, "invalid text justification");
+ }
t->hjustif(hjf);
}
@@ -142,19 +142,19 @@ agg_text_justif_set (lua_State *L)
char ch = justif[1];
double vjf;
switch (ch)
- {
- case 'b':
- vjf = 0.0;
- break;
- case 'c':
- vjf = 0.5;
- break;
- case 't':
- vjf = 1.0;
- break;
- default:
- return luaL_error (L, "invalid text justification");
- }
+ {
+ case 'b':
+ vjf = 0.0;
+ break;
+ case 'c':
+ vjf = 0.5;
+ break;
+ case 't':
+ vjf = 1.0;
+ break;
+ default:
+ return luaL_error (L, "invalid text justification");
+ }
t->vjustif(vjf);
}
diff --git a/agg-plot/markers.cpp b/agg-plot/markers.cpp
index 41c8ab8e..b5d7dcb2 100644
--- a/agg-plot/markers.cpp
+++ b/agg-plot/markers.cpp
@@ -126,7 +126,7 @@ new_marker_symbol_raw(const char *req_name, bool& stroke)
for (reg = builder_table; reg->name != NULL; reg++)
{
if (strcmp (reg->name, req_name) == 0)
- return reg->builder(stroke);
+ return reg->builder(stroke);
}
return builder_table[0].builder(stroke);
diff --git a/agg-plot/my_conv_simple_marker.h b/agg-plot/my_conv_simple_marker.h
index fc155d3d..904aa515 100644
--- a/agg-plot/my_conv_simple_marker.h
+++ b/agg-plot/my_conv_simple_marker.h
@@ -24,10 +24,10 @@ namespace my {
enum status_e
{
- initial,
- markers,
- polygon,
- stop
+ initial,
+ markers,
+ polygon,
+ stop
};
MarkerLocator* m_marker_locator;
@@ -63,38 +63,38 @@ namespace my {
while(!is_stop(cmd))
{
- switch(m_status)
- {
- case initial:
- m_marker_locator->rewind(0);
- m_status = markers;
-
- case markers:
- if(is_stop(m_marker_locator->vertex(&m_x1, &m_y1)))
- {
- cmd = path_cmd_stop;
- m_status = stop;
- break;
- }
- m_marker_shapes->rewind(0);
- m_status = polygon;
-
- case polygon:
- cmd = m_marker_shapes->vertex(x, y);
- if(is_stop(cmd))
- {
- cmd = path_cmd_move_to;
- m_status = markers;
- break;
- }
- *x += m_x1;
- *y += m_y1;
- return cmd;
-
- case stop:
- cmd = path_cmd_stop;
- break;
- }
+ switch(m_status)
+ {
+ case initial:
+ m_marker_locator->rewind(0);
+ m_status = markers;
+
+ case markers:
+ if(is_stop(m_marker_locator->vertex(&m_x1, &m_y1)))
+ {
+ cmd = path_cmd_stop;
+ m_status = stop;
+ break;
+ }
+ m_marker_shapes->rewind(0);
+ m_status = polygon;
+
+ case polygon:
+ cmd = m_marker_shapes->vertex(x, y);
+ if(is_stop(cmd))
+ {
+ cmd = path_cmd_move_to;
+ m_status = markers;
+ break;
+ }
+ *x += m_x1;
+ *y += m_y1;
+ return cmd;
+
+ case stop:
+ cmd = path_cmd_stop;
+ break;
+ }
}
return cmd;
}
diff --git a/agg-plot/my_tree.h b/agg-plot/my_tree.h
index de238cbb..97bc65a9 100644
--- a/agg-plot/my_tree.h
+++ b/agg-plot/my_tree.h
@@ -48,11 +48,11 @@ namespace tree {
{
node_list *n;
for (node_list *p = m_head; p; p = n)
- {
- n = p->next();
- delete p->content();
- delete p;
- }
+ {
+ n = p->next();
+ delete p->content();
+ delete p;
+ }
};
virtual node_list* tree() { return m_head; };
@@ -82,8 +82,8 @@ namespace tree {
typename node<base_type, tree_data_type>::list *ls = t->tree();
if (ls)
{
- for ( ; ls; ls = ls->next())
- walk_rec<base_type, tree_data_type, f> (ls->content());
+ for ( ; ls; ls = ls->next())
+ walk_rec<base_type, tree_data_type, f> (ls->content());
}
}
}
diff --git a/agg-plot/platform_support_ext.h b/agg-plot/platform_support_ext.h
index e50bb327..2006a97f 100644
--- a/agg-plot/platform_support_ext.h
+++ b/agg-plot/platform_support_ext.h
@@ -37,7 +37,7 @@ void my_color_conv(RenBufDst* dst, const RenBufSrc* src, CopyRow copy_row_functo
template<class RenBufDst, class RenBufSrc>
void rendering_buffer_get_region (RenBufDst& dst, RenBufSrc& src, agg::rect_base<int>& r,
- unsigned pixel_width)
+ unsigned pixel_width)
{
int w = r.x2 - r.x1, h = r.y2 - r.y1;
for (int y = 0; y < h; y++)
@@ -51,8 +51,8 @@ void rendering_buffer_get_region (RenBufDst& dst, RenBufSrc& src, agg::rect_base
template<class RenBufDst, class RenBufSrc>
void rendering_buffer_get_const_view (RenBufDst& view, const RenBufSrc& src,
- const agg::rect_base<int>& r,
- unsigned pixel_width, bool flip_y)
+ const agg::rect_base<int>& r,
+ unsigned pixel_width, bool flip_y)
{
int x = r.x1, y = r.y1, w = r.x2 - r.x1, h = r.y2 - r.y1;
const unsigned char *buf_start = src.row_ptr(y);
@@ -63,8 +63,8 @@ void rendering_buffer_get_const_view (RenBufDst& view, const RenBufSrc& src,
template<class RenBufDst, class RenBufSrc>
void rendering_buffer_get_view (RenBufDst& view, RenBufSrc& src,
- const agg::rect_base<int>& r,
- unsigned pixel_width, bool flip_y)
+ const agg::rect_base<int>& r,
+ unsigned pixel_width, bool flip_y)
{
int x = r.x1, y = r.y1, w = r.x2 - r.x1, h = r.y2 - r.y1;
unsigned char *buf_start = src.row_ptr(y);
@@ -75,7 +75,7 @@ void rendering_buffer_get_view (RenBufDst& view, RenBufSrc& src,
template<class RenBufDst, class RenBufSrc>
void rendering_buffer_put_region (RenBufDst& dst, RenBufSrc& src, agg::rect_base<int>& r,
- unsigned pixel_width)
+ unsigned pixel_width)
{
int w = r.x2 - r.x1, h = r.y2 - r.y1;
for (int y = 0; y < h; y++)
@@ -110,7 +110,7 @@ public:
m_stride = stride;
if(stride < 0)
{
- m_start = m_buf - int(height - 1) * stride;
+ m_start = m_buf - int(height - 1) * stride;
}
};
diff --git a/agg-plot/plot-auto.h b/agg-plot/plot-auto.h
index bba420fe..3e8104d3 100644
--- a/agg-plot/plot-auto.h
+++ b/agg-plot/plot-auto.h
@@ -87,18 +87,18 @@ void plot_auto<RM>::check_bounding_box()
if (this->m_rect.is_defined())
{
- const agg::rect_base<double>& bb = this->m_rect.rect();
- this->m_ux = units(bb.x1, bb.x2);
- this->m_uy = units(bb.y1, bb.y2);
+ const agg::rect_base<double>& bb = this->m_rect.rect();
+ this->m_ux = units(bb.x1, bb.x2);
+ this->m_uy = units(bb.y1, bb.y2);
- this->compute_user_trans();
- this->m_bbox_updated = true;
+ this->compute_user_trans();
+ this->m_bbox_updated = true;
}
}
template<class RM>
void plot_auto<RM>::calc_layer_bounding_box(plot_auto<RM>::item_list& layer,
- opt_rect<double>& rect)
+ opt_rect<double>& rect)
{
for (unsigned j = 0; j < layer.size(); j++)
{
diff --git a/agg-plot/plot.h b/agg-plot/plot.h
index f9152a99..0600f4f0 100644
--- a/agg-plot/plot.h
+++ b/agg-plot/plot.h
@@ -146,9 +146,9 @@ public:
layer_dispose_elements(m_root_layer);
for (unsigned k = 0; k < m_layers.size(); k++)
{
- item_list *layer = m_layers[k];
- layer_dispose_elements(*layer);
- delete layer;
+ item_list *layer = m_layers[k];
+ layer_dispose_elements(*layer);
+ delete layer;
}
};
@@ -222,9 +222,9 @@ public:
{
if (req != m_pad_units)
{
- m_pad_units = req;
- m_need_redraw = true;
- compute_user_trans();
+ m_pad_units = req;
+ m_need_redraw = true;
+ compute_user_trans();
}
};
@@ -247,15 +247,15 @@ public:
protected:
double draw_axis_m(axis_e dir, units& u, agg::trans_affine& user_mtx,
- ptr_list<draw::text>& labels, double scale,
- agg::path_storage& mark, agg::path_storage& ln);
+ ptr_list<draw::text>& labels, double scale,
+ agg::path_storage& mark, agg::path_storage& ln);
void draw_elements(canvas_type &canvas, agg::trans_affine& m);
void draw_element(item& c, canvas_type &canvas, agg::trans_affine& m);
void draw_axis(canvas_type& can, agg::trans_affine& m, agg::rect_base<int>* clip = 0);
agg::trans_affine draw_legends(canvas_type& canvas,
- agg::trans_affine& canvas_mtx);
+ agg::trans_affine& canvas_mtx);
agg::trans_affine get_scaled_matrix(agg::trans_affine& canvas_mtx);
@@ -421,9 +421,9 @@ void plot<RM>::draw_elements(canvas_type& canvas, agg::trans_affine& canvas_mtx)
{
item_list& layer = *(m_layers[k]);
for (unsigned j = 0; j < layer.size(); j++)
- {
- draw_element(layer[j], canvas, m);
- }
+ {
+ draw_element(layer[j], canvas, m);
+ }
}
canvas.reset_clipping();
@@ -451,7 +451,7 @@ template <class Canvas> void plot<RM>::draw_queue(Canvas& _canvas, agg::trans_af
bool not_empty = agg::bounding_rect_single(d.content(), 0, &ebb.x1, &ebb.y1, &ebb.x2, &ebb.y2);
if (not_empty)
- bb.add<rect_union>(ebb);
+ bb.add<rect_union>(ebb);
}
canvas.reset_clipping();
@@ -486,9 +486,9 @@ void plot<RM>::compute_user_trans()
template <class RM>
double plot<RM>::draw_axis_m(axis_e dir, units& u,
- agg::trans_affine& user_mtx,
- ptr_list<draw::text>& labels, double scale,
- agg::path_storage& mark, agg::path_storage& ln)
+ agg::trans_affine& user_mtx,
+ ptr_list<draw::text>& labels, double scale,
+ agg::path_storage& mark, agg::path_storage& ln)
{
const double ppad = double(axis_label_prop_space) / 1000.0;
const double eps = 1.0e-3;
@@ -519,7 +519,7 @@ double plot<RM>::draw_axis_m(axis_e dir, units& u,
double q = (isx ? x : y);
if (q < -eps || q > 1.0 + eps)
- continue;
+ continue;
draw::text* label = new draw::text(text, 10.0*scale, line_width, hj, vj);
@@ -544,10 +544,10 @@ double plot<RM>::draw_axis_m(axis_e dir, units& u,
double q = (isx ? x : y);
if (q >= -eps && q <= 1.0 + eps)
- {
- ln.move_to(isx ? q : 0.0, isx ? 0.0 : q);
- ln.line_to(isx ? q : 1.0, isx ? 1.0 : q);
- }
+ {
+ ln.move_to(isx ? q : 0.0, isx ? 0.0 : q);
+ ln.line_to(isx ? q : 1.0, isx ? 1.0 : q);
+ }
}
double label_size;
@@ -571,7 +571,7 @@ static inline double approx_text_height(double text_size)
template <class RM>
agg::trans_affine plot<RM>::draw_legends(canvas_type& canvas,
- agg::trans_affine& canvas_mtx)
+ agg::trans_affine& canvas_mtx)
{
const double sx = canvas_mtx.sx, sy = canvas_mtx.sy;
const double ppad = double(canvas_margin_prop_space) / 1000.0;
@@ -608,47 +608,47 @@ agg::trans_affine plot<RM>::draw_legends(canvas_type& canvas,
plot* mp = m_legend[k];
if (mp)
- {
- agg::rect_base<double> bb;
- mp->get_bounding_rect(bb);
-
- double dx = bb.x2 - bb.x1, dy = bb.y2 - bb.y1;
- double px, py;
- switch (k)
- {
- case right:
- px = sx - dx - ppad * sx - dxr;
- py = (sy - dy) / 2;
- dxr += dx + 2 * ppad * sx;
- break;
- case left:
- px = ppad * sx + dxr;
- py = (sy - dy) / 2;
- dxl += dx + 2 * ppad * sx;
- break;
- case bottom:
- py = ppad * sy + dyb;
- px = (sx - dx) / 2;
- dyb += dy + 2 * ppad * sy;
- break;
- case top:
- py = sy - dy - ppad * sy - dyt;
- px = (sx - dx) / 2;
- dyt += dy + 2 * ppad * sy;
- break;
- default:
- /* */;
- }
-
- if (px >= 0 && py >= 0 && px + dx < sx && py + dy < sy)
- {
- const double tx = canvas_mtx.tx, ty = canvas_mtx.ty;
- agg::trans_affine mtx(dx, 0.0, 0.0, dy, tx + px, ty + py);
- mp->before_draw();
- mp->draw_axis(canvas, mtx);
- mp->draw_elements(canvas, mtx);
- }
- }
+ {
+ agg::rect_base<double> bb;
+ mp->get_bounding_rect(bb);
+
+ double dx = bb.x2 - bb.x1, dy = bb.y2 - bb.y1;
+ double px, py;
+ switch (k)
+ {
+ case right:
+ px = sx - dx - ppad * sx - dxr;
+ py = (sy - dy) / 2;
+ dxr += dx + 2 * ppad * sx;
+ break;
+ case left:
+ px = ppad * sx + dxr;
+ py = (sy - dy) / 2;
+ dxl += dx + 2 * ppad * sx;
+ break;
+ case bottom:
+ py = ppad * sy + dyb;
+ px = (sx - dx) / 2;
+ dyb += dy + 2 * ppad * sy;
+ break;
+ case top:
+ py = sy - dy - ppad * sy - dyt;
+ px = (sx - dx) / 2;
+ dyt += dy + 2 * ppad * sy;
+ break;
+ default:
+ /* */;
+ }
+
+ if (px >= 0 && py >= 0 && px + dx < sx && py + dy < sy)
+ {
+ const double tx = canvas_mtx.tx, ty = canvas_mtx.ty;
+ agg::trans_affine mtx(dx, 0.0, 0.0, dy, tx + px, ty + py);
+ mp->before_draw();
+ mp->draw_axis(canvas, mtx);
+ mp->draw_elements(canvas, mtx);
+ }
+ }
}
double cpx = canvas_mtx.tx, cpy = canvas_mtx.ty;
@@ -658,7 +658,7 @@ agg::trans_affine plot<RM>::draw_legends(canvas_type& canvas,
template <class RM>
void plot<RM>::draw_axis(canvas_type& canvas, agg::trans_affine& canvas_mtx,
- agg::rect_base<int>* clip)
+ agg::rect_base<int>* clip)
{
agg::trans_affine& m = m_area_mtx;
diff --git a/agg-plot/split-parser.h b/agg-plot/split-parser.h
index dcf7dc20..bbc9044d 100644
--- a/agg-plot/split-parser.h
+++ b/agg-plot/split-parser.h
@@ -23,24 +23,24 @@ public:
{
char c = *m_ptr;
if (c != '0円')
- m_ptr++;
+ m_ptr++;
return c;
};
void push()
{
if (m_ptr > m_content)
- m_ptr--;
+ m_ptr--;
};
bool checknext(char reqchar)
{
char c = *m_ptr;
if (c == reqchar)
- {
- m_ptr++;
- return true;
- }
+ {
+ m_ptr++;
+ return true;
+ }
return false;
};
};
@@ -54,10 +54,10 @@ public:
for (int c = 0; ; c++)
{
- node_type* child = parse(lex);
- if (! child)
- break;
- t->add(child);
+ node_type* child = parse(lex);
+ if (! child)
+ break;
+ t->add(child);
}
return t;
@@ -71,23 +71,23 @@ public:
switch (t)
{
case '.':
- return new tree::leaf<base_type, direction_e>();
+ return new tree::leaf<base_type, direction_e>();
case 'h':
- return exprlist(lex, along_x);
+ return exprlist(lex, along_x);
case 'v':
- return exprlist(lex, along_y);
+ return exprlist(lex, along_y);
case '(':
- {
- node_type *nd = parse(lex);
- if (! lex.checknext(')'))
- return 0;
- return nd;
- }
+ {
+ node_type *nd = parse(lex);
+ if (! lex.checknext(')'))
+ return 0;
+ return nd;
+ }
case ')':
- lex.push();
- return 0;
+ lex.push();
+ return 0;
default:
- return 0;
+ return 0;
}
return 0;
diff --git a/agg-plot/text-shape.h b/agg-plot/text-shape.h
index c09b749e..a1a55edf 100644
--- a/agg-plot/text-shape.h
+++ b/agg-plot/text-shape.h
@@ -12,7 +12,7 @@ namespace draw {
class text_shape : public sg_object {
public:
text_shape(double x, double y, const char* text,
- double _size = 10.0, double hjustif = 0.0, double vjustif = 0.0):
+ double _size = 10.0, double hjustif = 0.0, double vjustif = 0.0):
m_sg_text(), m_x(x), m_y(y), m_text(text), m_size(_size),
m_scaling(0), m_trans(m_sg_text, identity_matrix), m_stroke(m_trans)
{
@@ -62,23 +62,23 @@ namespace draw {
const double dx = m.tx, dy = svg_y_coord(m.ty, h);
if (is_unit_matrix(m))
- {
- x += dx;
- y += dy;
- }
+ {
+ x += dx;
+ y += dy;
+ }
- str svgtext = str::print("<text x=\"%g\" y=\"%g\" id=\"text%i\"" \
- " style=\"font-size:%i\">" \
- " <tspan id=\"tspan%i\">%s</tspan>" \
- "</text>",
- x, y, id, txt_size, id, text);
+ str svgtext = str::print("<text x=\"%g\" y=\"%g\" id=\"text%i\"" \
+ " style=\"font-size:%i\">" \
+ " <tspan id=\"tspan%i\">%s</tspan>" \
+ "</text>",
+ x, y, id, txt_size, id, text);
str s;
if (is_unit_matrix(m))
- s = svgtext;
+ s = svgtext;
else
- s = str::print("<g transform=\"matrix(%g,%g,%g,%g,%g,%g)\">%s</g>",
- m.sx, m.shx, m.shy, m.sy, dx, dy, svgtext.cstr());
+ s = str::print("<g transform=\"matrix(%g,%g,%g,%g,%g,%g)\">%s</g>",
+ m.sx, m.shx, m.shy, m.sy, dx, dy, svgtext.cstr());
return s;
}
diff --git a/agg-plot/text.cpp b/agg-plot/text.cpp
index 9946ec13..788889f8 100644
--- a/agg-plot/text.cpp
+++ b/agg-plot/text.cpp
@@ -79,17 +79,17 @@ namespace draw {
}
const char* cont = m_text_buf.cstr();
- str txt = str::print("<text x=\"%g\" y=\"%g\" id=\"text%i\"" \
- " style=\"font-size:%i%s\">" \
- " <tspan id=\"tspan%i\">%s</tspan>" \
- "</text>",
- x, y, id, txt_size, style.cstr(),
- id, cont);
+ str txt = str::print("<text x=\"%g\" y=\"%g\" id=\"text%i\"" \
+ " style=\"font-size:%i%s\">" \
+ " <tspan id=\"tspan%i\">%s</tspan>" \
+ "</text>",
+ x, y, id, txt_size, style.cstr(),
+ id, cont);
if (need_rotate) {
s = str::print("<g transform=\"matrix(%g,%g,%g,%g,%g,%g)\">%s</g>",
- m.sx, m.shx, m.shy, m.sy, m.tx, svg_y_coord(m.ty, h),
- txt.cstr());
+ m.sx, m.shx, m.shy, m.sy, m.tx, svg_y_coord(m.ty, h),
+ txt.cstr());
} else {
s = txt;
}
@@ -98,8 +98,8 @@ namespace draw {
}
bool text::render(pixel_type::lcd_fmt& pixbuf,
- agg::rasterizer_scanline_aa<>& ras,
- agg::scanline_p8& sl, agg::rgba8 c)
+ agg::rasterizer_scanline_aa<>& ras,
+ agg::scanline_p8& sl, agg::rgba8 c)
{
typedef agg::renderer_base<pixel_type::lcd_fmt> renderer_type;
@@ -113,7 +113,7 @@ namespace draw {
double y = -m_vjustif * m_text_height;
m_font_ren.draw_text(ras, sl, ren_solid, m_matrix, x, y,
- text, text_length, c);
+ text, text_length, c);
return true;
}
diff --git a/agg-plot/text.h b/agg-plot/text.h
index 3290f180..b90b23ff 100644
--- a/agg-plot/text.h
+++ b/agg-plot/text.h
@@ -38,7 +38,7 @@ namespace draw {
public:
text(const char* text, double size = 10.0, double width = 1.0,
- double hjustif = 0.0, double vjustif = 0.0):
+ double hjustif = 0.0, double vjustif = 0.0):
m_matrix(), m_user_matrix(), m_text_buf(text),
m_text(), m_trans(m_text, m_user_matrix), m_stroke(m_trans),
m_x(0.0), m_y(0.0), m_angle(0.0),
@@ -89,8 +89,8 @@ namespace draw {
virtual str write_svg(int id, agg::rgba8 c, double h);
virtual bool render(pixel_type::lcd_fmt& ren_buf,
- agg::rasterizer_scanline_aa<>& ras,
- agg::scanline_p8& sl, agg::rgba8 c);
+ agg::rasterizer_scanline_aa<>& ras,
+ agg::scanline_p8& sl, agg::rgba8 c);
const vs_text& self() const { return m_text; };
vs_text& self() { return m_text; };
diff --git a/agg-plot/units.cpp b/agg-plot/units.cpp
index d1a9cbd6..a336e1a0 100644
--- a/agg-plot/units.cpp
+++ b/agg-plot/units.cpp
@@ -72,7 +72,7 @@ void units::mark_label (char *lab, unsigned size, int mark) const
int dec = (nb_decimals < 10 ? nb_decimals : 9);
int base = (int) floor(asup * dmajor);
int space = dec + (base > 0 ? (int)log10(base): 0) + 1 \
- + (minus ? 1 : 0) + 1;
+ + (minus ? 1 : 0) + 1;
snprintf (fmt, 16, "%%%i.%if", space, dec);
fmt[15] = '0円';
snprintf (lab, size, fmt, mark * dmajor);
diff --git a/agg-plot/utils.h b/agg-plot/utils.h
index a6a0a5df..d235745e 100644
--- a/agg-plot/utils.h
+++ b/agg-plot/utils.h
@@ -50,12 +50,12 @@ private:
inline bool is_unit_matrix(const agg::trans_affine& m, double eps = 1.0e-5)
{
- return (fabs(m.sx - 1.0) < eps && fabs(m.shx) < eps && \
- fabs(m.shy) < eps && fabs(m.sy - 1.0) < eps);
+ return (fabs(m.sx - 1.0) < eps && fabs(m.shx) < eps &&
+ fabs(m.shy) < eps && fabs(m.sy - 1.0) < eps);
}
extern void trans_affine_compose (agg::trans_affine& a,
- const agg::trans_affine& b);
+ const agg::trans_affine& b);
extern agg::trans_affine identity_matrix;
diff --git a/agg-plot/window-cpp.h b/agg-plot/window-cpp.h
index f2b88f5f..db8dc6bf 100644
--- a/agg-plot/window-cpp.h
+++ b/agg-plot/window-cpp.h
@@ -43,7 +43,7 @@ public:
~ref() { if (layer_buf) delete layer_buf; };
void save_image (agg::rendering_buffer& winbuf, agg::rect_base<int>& r,
- int bpp, bool flip_y);
+ int bpp, bool flip_y);
static void compose(bmatrix& a, const bmatrix& b);
static int calculate(node *t, const bmatrix& m, int id);
diff --git a/agg-plot/window.cpp b/agg-plot/window.cpp
index 52c606ec..71560795 100644
--- a/agg-plot/window.cpp
+++ b/agg-plot/window.cpp
@@ -44,8 +44,8 @@ struct dispose_buffer {
ref.valid_rect = false;
if (ref.layer_buf)
{
- delete [] ref.layer_buf;
- ref.layer_buf = 0;
+ delete [] ref.layer_buf;
+ ref.layer_buf = 0;
}
}
};
@@ -73,21 +73,21 @@ int window::ref::calculate(window::ref::node* t, const bmatrix& m, int id)
direction_e dir;
ref::node::list *ls = t->tree(dir);
if (ls)
- {
- bmatrix lm;
+ {
+ bmatrix lm;
- double* p = (dir == along_x ? &lm.tx : &lm.ty);
- double* s = (dir == along_x ? &lm.sx : &lm.sy);
+ double* p = (dir == along_x ? &lm.tx : &lm.ty);
+ double* s = (dir == along_x ? &lm.sx : &lm.sy);
- *s = frac;
+ *s = frac;
- for ( ; ls; ls = ls->next(), *p += frac)
- {
- bmatrix sm(lm);
- window::ref::compose(sm, m);
- id = window::ref::calculate (ls->content(), sm, id);
- }
- }
+ for ( ; ls; ls = ls->next(), *p += frac)
+ {
+ bmatrix sm(lm);
+ window::ref::compose(sm, m);
+ id = window::ref::calculate (ls->content(), sm, id);
+ }
+ }
}
return id;
@@ -95,8 +95,8 @@ int window::ref::calculate(window::ref::node* t, const bmatrix& m, int id)
void
window::ref::save_image (agg::rendering_buffer& win_buf,
- agg::rect_base<int>& r,
- int img_bpp, bool flip_y)
+ agg::rect_base<int>& r,
+ int img_bpp, bool flip_y)
{
int w = r.x2 - r.x1, h = r.y2 - r.y1;
int row_len = w * (img_bpp / 8);
@@ -135,14 +135,14 @@ window::ref* window::ref_lookup (ref::node *p, int slot_id)
{
ref *ref = window::ref_lookup(t->content(), slot_id);
if (ref)
- return ref;
+ return ref;
}
ref *ref = p->content();
if (ref)
{
if (ref->slot_id == slot_id)
- return ref;
+ return ref;
}
return NULL;
@@ -159,7 +159,7 @@ void window::draw_slot_by_ref(window::ref& ref, bool draw_image)
if (ref.plot)
{
AGG_LOCK();
- ref.plot->draw(*m_canvas, mtx);
+ ref.plot->draw(*m_canvas, mtx);
AGG_UNLOCK();
}
@@ -176,10 +176,10 @@ window::draw_slot(int slot_id, bool clean_req)
bool redraw = clean_req || ref->plot->need_redraw();
if (redraw)
- {
- draw_slot_by_ref(*ref, false);
- dispose_buffer::func(*ref);
- }
+ {
+ draw_slot_by_ref(*ref, false);
+ dispose_buffer::func(*ref);
+ }
refresh_slot_by_ref(*ref, redraw);
ref->valid_rect = true;
@@ -212,17 +212,17 @@ window::restore_slot_image(int slot_id)
agg::rect_base<int> r = rect_of_slot_matrix<int>(mtx);
if (ref->layer_buf == 0)
- {
- m_canvas->clear_box(r);
- draw_slot_by_ref (*ref, false);
- ref->save_image(this->rbuf_window(), r, this->bpp(), this->flip_y());
- }
+ {
+ m_canvas->clear_box(r);
+ draw_slot_by_ref (*ref, false);
+ ref->save_image(this->rbuf_window(), r, this->bpp(), this->flip_y());
+ }
else
- {
- agg::rendering_buffer& img = ref->layer_img;
- agg::rendering_buffer& win = this->rbuf_window();
- rendering_buffer_put_region (win, img, r, this->bpp() / 8);
- }
+ {
+ agg::rendering_buffer& img = ref->layer_img;
+ agg::rendering_buffer& win = this->rbuf_window();
+ rendering_buffer_put_region (win, img, r, this->bpp() / 8);
+ }
}
}
@@ -281,7 +281,7 @@ window::cleanup_tree_rec (lua_State *L, int window_index, ref::node* n)
if (ref)
{
if (ref->plot)
- window_refs_remove (L, ref->slot_id, window_index);
+ window_refs_remove (L, ref->slot_id, window_index);
}
}
@@ -335,14 +335,14 @@ int window::attach(sg_plot* plot, const char *spec)
ref::node::list* list = n->tree();
if (! list)
- return -1;
+ return -1;
for (int j = 1; j < k; j++)
- {
- list = list->next();
- if (! list)
- return -1;
- }
+ {
+ list = list->next();
+ if (! list)
+ return -1;
+ }
n = list->content();
}
@@ -375,8 +375,8 @@ int window_generic_oper (lua_State *L, window_slot_method_type method)
template <class param_type>
int window_generic_oper_ext (lua_State *L,
- void (window::*method)(int, param_type),
- param_type param)
+ void (window::*method)(int, param_type),
+ param_type param)
{
window *win = object_check<window>(L, 1, GS_WINDOW);
int slot_id = luaL_checkinteger (L, 2);
@@ -404,11 +404,11 @@ void window::start (lua_State *L, gslshell::ret_status& st)
inf->window_id = this->window_id;
if (! this->start_new_thread (inf))
- {
- window_index_remove (L, this->window_id);
- this->unlock();
- st.error("error during thread initialization", "window creation");
- }
+ {
+ window_index_remove (L, this->window_id);
+ this->unlock();
+ st.error("error during thread initialization", "window creation");
+ }
}
else
{
@@ -432,7 +432,7 @@ window_new (lua_State *L)
if (spec)
{
if (!win->split(spec))
- return luaL_error(L, "invalid layout specification");
+ return luaL_error(L, "invalid layout specification");
}
return 1;
@@ -484,7 +484,7 @@ window_split (lua_State *L)
if (! win->split(spec))
{
if (win->status == canvas_window::running)
- win->do_window_update();
+ win->do_window_update();
win->unlock();
return luaL_error(L, "invalid window subdivision specification");
}
@@ -513,7 +513,7 @@ window_attach (lua_State *L)
if (slot_id >= 0)
{
if (win->status == canvas_window::running)
- win->draw_slot(slot_id, true);
+ win->draw_slot(slot_id, true);
win->unlock();
window_refs_add (L, slot_id, 1, 2);
}
diff --git a/agg-plot/window_registry.cpp b/agg-plot/window_registry.cpp
index 0ebfa499..4f324ea8 100644
--- a/agg-plot/window_registry.cpp
+++ b/agg-plot/window_registry.cpp
@@ -154,16 +154,16 @@ window_refs_lookup_apply (lua_State *L, int value_index, lua_CFunction func)
lua_pushnil (L);
while (lua_next (L, -2) != 0)
- {
- if (lua_rawequal (L, -1, value_index))
- {
- lua_pushcfunction (L, func);
- lua_pushvalue (L, -5);
- lua_pushvalue (L, -4);
- lua_call (L, 2, 0);
- }
- lua_pop (L, 1);
- }
+ {
+ if (lua_rawequal (L, -1, value_index))
+ {
+ lua_pushcfunction (L, func);
+ lua_pushvalue (L, -5);
+ lua_pushvalue (L, -4);
+ lua_call (L, 2, 0);
+ }
+ lua_pop (L, 1);
+ }
lua_pop (L, 1);
}
diff --git a/agg-plot/window_registry.h b/agg-plot/window_registry.h
index af7306e5..d40d5906 100644
--- a/agg-plot/window_registry.h
+++ b/agg-plot/window_registry.h
@@ -20,7 +20,7 @@ extern void window_refs_add (lua_State *L, int index, int key_index,
int value_index);
extern void window_refs_remove (lua_State *L, int index, int key_index);
extern void window_refs_lookup_apply (lua_State *L, int value_index,
- lua_CFunction func);
+ lua_CFunction func);
__END_DECLS
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月20日 19:13:49 +0000

AltStyle によって変換されたページ (->オリジナル) /