# HG changeset patch # User Thinker K.F. Li # Date 1290413124 -28800 # Node ID 32425882e351647bea95041fc4c978f7fa00dba4 # Parent 63f2f1daf5d3f3aa509e16a6f2b3ec1e646256ce Migrate examples/calculator/ to new bacend definition diff -r 63f2f1daf5d3 -r 32425882e351 examples/calculator/main.c --- a/examples/calculator/main.c Mon Nov 22 15:38:11 2010 +0800 +++ b/examples/calculator/main.c Mon Nov 22 16:05:24 2010 +0800 @@ -5,7 +5,7 @@ typedef struct _calc_data calc_data_t; struct _calc_data { - X_MB_runtime_t *rt; + mb_rt_t *rt; calculator_scr_t *code; }; @@ -64,7 +64,7 @@ char buf[20]; redraw_man_t *rdman; - rdman = X_MB_rdman(calc_data->rt); + rdman = mb_runtime_rdman(calc_data->rt); sprintf(buf, "%d%s", num, suffix); sh_stext_set_text(calc_data->code->screen_text_u, buf); @@ -142,7 +142,7 @@ break; } } - rdman = X_MB_rdman(calc_data->rt); + rdman = mb_runtime_rdman(calc_data->rt); rdman_redraw_changed(rdman); } @@ -174,24 +174,24 @@ } int main(int argc, char * const argv[]) { - X_MB_runtime_t *rt; + mb_rt_t *rt; redraw_man_t *rdman; calculator_scr_t *calculator_scr; calc_data_t calc_data; - rt = X_MB_new(":0.0", 300, 400); + rt = mb_runtime_new(":0.0", 300, 400); - rdman = X_MB_rdman(rt); + rdman = mb_runtime_rdman(rt); calculator_scr = calculator_scr_new(rdman, rdman->root_coord); calc_data.rt = rt; calc_data.code = calculator_scr; setup_observers(&calc_data); - X_MB_handle_connection(rt); + mb_runtime_event_loop(rt); calculator_scr_free(calculator_scr); - X_MB_free(rt); + mb_runtime_free(rt); return 0; } diff -r 63f2f1daf5d3 -r 32425882e351 include/mb.h --- a/include/mb.h Mon Nov 22 15:38:11 2010 +0800 +++ b/include/mb.h Mon Nov 22 16:05:24 2010 +0800 @@ -15,5 +15,6 @@ #endif #include "mb_animate.h" #include "mb_shapes.h" +#include "mb_backend.h" #endif /* __MB_H_ */