first multiple window implementation - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/window-cpp.h
diff options
context:
space:
mode:
authorfrancesco-ST <francesco.abbate@st.com>2010年08月09日 15:50:43 +0200
committerfrancesco-ST <francesco.abbate@st.com>2010年08月09日 15:50:43 +0200
commit129604a18b0f93e89cf638a079b6f1ab349fbe8f (patch)
tree8abeb52bc7a01472ba505aebaa36fb2ef1765646 /agg-plot/window-cpp.h
parent99c6c9b47f25eb7bc8756d5b2a5fd5ec7dac73e6 (diff)
downloadgsl-shell-129604a18b0f93e89cf638a079b6f1ab349fbe8f.tar.gz
first multiple window implementation
Still work in progress. The real function to split the window should be implemented. A problem is pending: references to plot are added but never removed.
Diffstat (limited to 'agg-plot/window-cpp.h')
-rw-r--r--agg-plot/window-cpp.h 70
1 files changed, 70 insertions, 0 deletions
diff --git a/agg-plot/window-cpp.h b/agg-plot/window-cpp.h
new file mode 100644
index 00000000..1c09ad69
--- /dev/null
+++ b/agg-plot/window-cpp.h
@@ -0,0 +1,70 @@
+
+extern "C" {
+#include "lua.h"
+}
+
+#include "window.h"
+#include "canvas-window-cpp.h"
+#include "resource-manager.h"
+#include "lua-plot-cpp.h"
+#include "plot.h"
+#include "drawable.h"
+
+#include "agg_color_rgba.h"
+#include "agg_trans_affine.h"
+
+template <class T>
+class pod_list {
+ T m_content;
+ pod_list *m_next;
+
+public:
+ pod_list(const T& c, pod_list* next = NULL) : m_content(c), m_next(next) { };
+
+ void free_subtree()
+ {
+ if (m_next)
+ {
+ m_next->free_subtree();
+ delete m_next;
+ }
+ };
+
+ T& content() { return m_content; };
+ const T& content() const { return m_content; };
+
+ pod_list *next() { return m_next; };
+
+ static void free(pod_list *list);
+};
+
+template <class T>
+void pod_list<T>::free(pod_list<T> *list)
+{
+ list->free_subtree();
+ delete list;
+}
+
+class window : public canvas_window {
+ typedef plot<drawable, lua_management> plot_type;
+
+ struct plot_matrix {
+ plot_type *plot;
+ agg::trans_affine matrix;
+
+ plot_matrix(plot_type *p) : plot(p), matrix() {};
+ };
+
+ pod_list<plot_matrix> *m_plot_matrix;
+
+public:
+ window(agg::rgba& bgcol) : canvas_window(bgcol), m_plot_matrix(NULL) {};
+
+ static window *check (lua_State *L, int index);
+
+ void split3();
+ bool attach(lua_plot *plot, int slot);
+
+ void on_draw_unprotected();
+ virtual void on_draw();
+};
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月13日 19:46:52 +0000

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