author | francesco-ST <francesco.abbate@st.com> | 2011年04月29日 12:04:09 +0200 |
---|---|---|
committer | francesco-ST <francesco.abbate@st.com> | 2011年05月02日 08:49:15 +0200 |
commit | a7096dd693d4042b27e33e616576f4f79f34ad39 (patch) | |
tree | 5206c62801f87b2961a9497005b50ed5c2be09a5 /agg-plot/lua-plot.cpp | |
parent | 5d6ade3d7faffa14aae1079d18490cc6015aca42 (diff) | |
download | gsl-shell-a7096dd693d4042b27e33e616576f4f79f34ad39.tar.gz |
-rw-r--r-- | agg-plot/lua-plot.cpp | 24 |
diff --git a/agg-plot/lua-plot.cpp b/agg-plot/lua-plot.cpp index 826204b6..d953ac50 100644 --- a/agg-plot/lua-plot.cpp +++ b/agg-plot/lua-plot.cpp @@ -63,6 +63,8 @@ static int plot_sync_mode_get (lua_State *L); static int plot_sync_mode_set (lua_State *L); static int plot_pad_mode_get (lua_State *L); static int plot_pad_mode_set (lua_State *L); +static int plot_clip_mode_get (lua_State *L); +static int plot_clip_mode_set (lua_State *L); static int canvas_new (lua_State *L); @@ -101,6 +103,7 @@ static const struct luaL_Reg plot_properties_get[] = { {"units", plot_units_get }, {"sync", plot_sync_mode_get }, {"pad", plot_pad_mode_get }, + {"clip", plot_clip_mode_get }, {NULL, NULL} }; @@ -109,6 +112,7 @@ static const struct luaL_Reg plot_properties_set[] = { {"units", plot_units_set }, {"sync", plot_sync_mode_set }, {"pad", plot_pad_mode_set }, + {"clip", plot_clip_mode_set }, {NULL, NULL} }; @@ -437,6 +441,26 @@ static int plot_pad_mode_get (lua_State *L) return 1; } +static int plot_clip_mode_set (lua_State *L) +{ + lua_plot *p = object_check<lua_plot>(L, 1, GS_PLOT); + bool request = (bool) lua_toboolean (L, 2); + AGG_LOCK(); + p->set_clip_mode(request); + AGG_UNLOCK(); + plot_update_raw (L, p, 1); + return 0; +} + +static int plot_clip_mode_get (lua_State *L) +{ + lua_plot *p = object_check<lua_plot>(L, 1, GS_PLOT); + AGG_LOCK(); + lua_pushboolean (L, p->clip_is_active()); + AGG_UNLOCK(); + return 1; +} + int plot_sync_mode_get (lua_State *L) { |