aboutsummaryrefslogtreecommitdiff
path: root/src/sc_interp.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2014-12-24 17:22:49 +0000
committerThomas White <taw@bitwiz.org.uk>2014-12-24 17:22:49 +0000
commitd36470bcebf57644464754f5ef045a4f8d057c2b (patch)
treef4ee2561d79d7d94ade9d212d3ced14ffbd4b9db /src/sc_interp.c
parent29de55f6415e7dc547f84e7e204e1b93099a0980 (diff)
Structure for callback mechanism
Diffstat (limited to 'src/sc_interp.c')
-rw-r--r--src/sc_interp.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/sc_interp.c b/src/sc_interp.c
index 703b73f..bed8fa2 100644
--- a/src/sc_interp.c
+++ b/src/sc_interp.c
@@ -60,6 +60,7 @@ struct sc_state
struct macro *macros; /* Contents need to be copied on push */
SCBlock *macro_contents;
+ SCBlock *macro_real_block;
};
@@ -77,6 +78,32 @@ struct _scinterp
};
+SCCallbackList *sc_callback_list_new()
+{
+}
+
+
+void sc_callback_list_free(SCCallbackList *cbl)
+{
+}
+
+
+void sc_callback_list_add_callback(SCCallbackList *cbl, const char *name,
+ cairo_surface_t *(*func)(SCBlock *bl, void *p))
+{
+}
+
+
+void sc_interp_set_callbacks(SCInterpreter *scin, SCCallbackList *cbl)
+{
+}
+
+
+static void do_callback(SCInterpreter *scin, const char *name)
+{
+}
+
+
PangoFont *sc_interp_get_font(SCInterpreter *scin)
{
struct sc_state *st = &scin->state[scin->j];
@@ -331,6 +358,13 @@ struct frame *sc_interp_get_frame(SCInterpreter *scin)
}
+SCBlock *sc_interp_get_macro_real_block(SCInterpreter *scin)
+{
+ struct sc_state *st = &scin->state[scin->j];
+ return st->macro_real_block;
+}
+
+
static void set_frame(SCInterpreter *scin, struct frame *fr)
{
struct sc_state *st = &scin->state[scin->j];
@@ -705,6 +739,7 @@ static void exec_macro(SCBlock *bl, SCInterpreter *scin, SCBlock *child)
struct sc_state *st = &scin->state[scin->j];
st->macro_contents = child;
+ st->macro_real_block = bl;
mchild = sc_block_macro_child(bl);
if ( mchild == NULL ) {
@@ -801,7 +836,8 @@ int sc_interp_add_blocks(SCInterpreter *scin, SCBlock *bl)
} else if ( strcmp(name, "bggradv") == 0 ) {
set_frame_bggrad(sc_interp_get_frame(scin), options,
GRAD_VERT);
-
+ } else if ( strcmp(name, "callback") == 0 ) {
+ do_callback(scin, options);
} else {