gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/window.cpp
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2012年03月29日 17:23:35 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2012年04月01日 22:57:19 +0200
commit5c80bf0af85627c0e62d0f097e9ed6679f6bed73 (patch)
tree53c88940049bef966c8994cf59f831c26061a8c2 /agg-plot/window.cpp
parente255825367665691584ae44755df5f2882a25c66 (diff)
downloadgsl-shell-5c80bf0af85627c0e62d0f097e9ed6679f6bed73.tar.gz
Introduce gsl_shell_state and improve factorization
Diffstat (limited to 'agg-plot/window.cpp')
-rw-r--r--agg-plot/window.cpp 9
1 files changed, 8 insertions, 1 deletions
diff --git a/agg-plot/window.cpp b/agg-plot/window.cpp
index 4a412b7b..f48a725c 100644
--- a/agg-plot/window.cpp
+++ b/agg-plot/window.cpp
@@ -423,7 +423,14 @@ void window::start (lua_State *L, gslshell::ret_status& st)
int
window_new (lua_State *L)
{
- window *win = push_new_object<window>(L, GS_WINDOW, colors::white);
+ lua_getfield(L, LUA_REGISTRYINDEX, "__gsl_shell");
+ gsl_shell_state* gs = (gsl_shell_state*) lua_touserdata(L, -1);
+ lua_pop(L, 1);
+
+ if (unlikely(gs == NULL))
+ return luaL_error(L, "cannot create window: not a GSL Shell state");
+
+ window *win = push_new_object<window>(L, GS_WINDOW, gs);
const char *spec = lua_tostring (L, 1);
gslshell::ret_status st;
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月14日 23:59:26 +0000

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