diff options
Diffstat (limited to 'apps/plugins/pdbox/PDa/extra/image.c')
-rw-r--r-- | apps/plugins/pdbox/PDa/extra/image.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/apps/plugins/pdbox/PDa/extra/image.c b/apps/plugins/pdbox/PDa/extra/image.c index 946a363986..7f55a01a87 100644 --- a/apps/plugins/pdbox/PDa/extra/image.c +++ b/apps/plugins/pdbox/PDa/extra/image.c | |||
@@ -23,6 +23,11 @@ typedef struct _image | |||
23 | 23 | ||
24 | void image_drawme(t_image *x, t_glist *glist, int firsttime) | 24 | void image_drawme(t_image *x, t_glist *glist, int firsttime) |
25 | { | 25 | { |
26 | #ifdef ROCKBOX | ||
27 | (void) x; | ||
28 | (void) glist; | ||
29 | (void) firsttime; | ||
30 | #else /* ROCKBOX */ | ||
26 | if (firsttime) { | 31 | if (firsttime) { |
27 | char fname[MAXPDSTRING]; | 32 | char fname[MAXPDSTRING]; |
28 | canvas_makefilename(glist_getcanvas(x->x_glist), x->x_fname->s_name, | 33 | canvas_makefilename(glist_getcanvas(x->x_glist), x->x_fname->s_name, |
@@ -42,16 +47,20 @@ void image_drawme(t_image *x, t_glist *glist, int firsttime) | |||
42 | glist_getcanvas(glist), x, | 47 | glist_getcanvas(glist), x, |
43 | text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)); | 48 | text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)); |
44 | } | 49 | } |
45 | 50 | #endif /* ROCKBOX */ | |
46 | } | 51 | } |
47 | 52 | ||
48 | 53 | ||
49 | void image_erase(t_image* x,t_glist* glist) | 54 | void image_erase(t_image* x,t_glist* glist) |
50 | { | 55 | { |
56 | #ifdef ROCKBOX | ||
57 | (void) x; | ||
58 | (void) glist; | ||
59 | #else /* ROCKBOX */ | ||
51 | int n; | 60 | int n; |
52 | sys_vgui(".x%x.c delete %xS\n", | 61 | sys_vgui(".x%x.c delete %xS\n", |
53 | glist_getcanvas(glist), x); | 62 | glist_getcanvas(glist), x); |
54 | 63 | #endif /* ROCKBOX */ | |
55 | } | 64 | } |
56 | 65 | ||
57 | 66 | ||
@@ -80,17 +89,23 @@ static void image_displace(t_gobj *z, t_glist *glist, | |||
80 | t_image *x = (t_image *)z; | 89 | t_image *x = (t_image *)z; |
81 | x->x_obj.te_xpix += dx; | 90 | x->x_obj.te_xpix += dx; |
82 | x->x_obj.te_ypix += dy; | 91 | x->x_obj.te_ypix += dy; |
92 | #ifndef ROCKBOX | ||
83 | sys_vgui(".x%x.c coords %xSEL %d %d %d %d\n", | 93 | sys_vgui(".x%x.c coords %xSEL %d %d %d %d\n", |
84 | glist_getcanvas(glist), x, | 94 | glist_getcanvas(glist), x, |
85 | text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist), | 95 | text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist), |
86 | text_xpix(&x->x_obj, glist) + x->x_width, text_ypix(&x->x_obj, glist) + x->x_height); | 96 | text_xpix(&x->x_obj, glist) + x->x_width, text_ypix(&x->x_obj, glist) + x->x_height); |
87 | 97 | #endif | |
88 | image_drawme(x, glist, 0); | 98 | image_drawme(x, glist, 0); |
89 | canvas_fixlinesfor(glist_getcanvas(glist),(t_text*) x); | 99 | canvas_fixlinesfor(glist_getcanvas(glist),(t_text*) x); |
90 | } | 100 | } |
91 | 101 | ||
92 | static void image_select(t_gobj *z, t_glist *glist, int state) | 102 | static void image_select(t_gobj *z, t_glist *glist, int state) |
93 | { | 103 | { |
104 | #ifdef ROCKBOX | ||
105 | (void) z; | ||
106 | (void) glist; | ||
107 | (void) state; | ||
108 | #else /* ROCKBOX */ | ||
94 | t_image *x = (t_image *)z; | 109 | t_image *x = (t_image *)z; |
95 | if (state) { | 110 | if (state) { |
96 | sys_vgui(".x%x.c create rectangle \ | 111 | sys_vgui(".x%x.c create rectangle \ |
@@ -104,14 +119,17 @@ static void image_select(t_gobj *z, t_glist *glist, int state) | |||
104 | sys_vgui(".x%x.c delete %xSEL\n", | 119 | sys_vgui(".x%x.c delete %xSEL\n", |
105 | glist_getcanvas(glist), x); | 120 | glist_getcanvas(glist), x); |
106 | } | 121 | } |
107 | 122 | #endif /* ROCKBOX */ | |
108 | |||
109 | |||
110 | } | 123 | } |
111 | 124 | ||
112 | 125 | ||
113 | static void image_activate(t_gobj *z, t_glist *glist, int state) | 126 | static void image_activate(t_gobj *z, t_glist *glist, int state) |
114 | { | 127 | { |
128 | #ifdef ROCKBOX | ||
129 | (void) z; | ||
130 | (void) glist; | ||
131 | (void) state; | ||
132 | #endif | ||
115 | /* t_text *x = (t_text *)z; | 133 | /* t_text *x = (t_text *)z; |
116 | t_rtext *y = glist_findrtext(glist, x); | 134 | t_rtext *y = glist_findrtext(glist, x); |
117 | if (z->g_pd != gatom_class) rtext_activate(y, state);*/ | 135 | if (z->g_pd != gatom_class) rtext_activate(y, state);*/ |
@@ -154,6 +172,10 @@ void image_size(t_image* x,t_floatarg w,t_floatarg h) { | |||
154 | 172 | ||
155 | void image_color(t_image* x,t_symbol* col) | 173 | void image_color(t_image* x,t_symbol* col) |
156 | { | 174 | { |
175 | #ifdef ROCKBOX | ||
176 | (void) x; | ||
177 | (void) col; | ||
178 | #endif | ||
157 | /* outlet_bang(x->x_obj.ob_outlet); only bang if there was a bang .. | 179 | /* outlet_bang(x->x_obj.ob_outlet); only bang if there was a bang .. |
158 | so color black does the same as bang, but doesn't forward the bang | 180 | so color black does the same as bang, but doesn't forward the bang |
159 | */ | 181 | */ |
@@ -167,11 +189,11 @@ static void image_setwidget(void) | |||
167 | image_widgetbehavior.w_activatefn = image_activate; | 189 | image_widgetbehavior.w_activatefn = image_activate; |
168 | image_widgetbehavior.w_deletefn = image_delete; | 190 | image_widgetbehavior.w_deletefn = image_delete; |
169 | image_widgetbehavior.w_visfn = image_vis; | 191 | image_widgetbehavior.w_visfn = image_vis; |
170 | #if (PD_VERSION_MINOR > 31) | 192 | #if defined(PD_VERSION_MINOR) && (PD_VERSION_MINOR > 31) |
171 | image_widgetbehavior.w_clickfn = NULL; | 193 | image_widgetbehavior.w_clickfn = NULL; |
172 | image_widgetbehavior.w_propertiesfn = NULL; | 194 | image_widgetbehavior.w_propertiesfn = NULL; |
173 | #endif | 195 | #endif |
174 | #if PD_MINOR_VERSION < 37 | 196 | #if defined(PD_VERSION_MINOR) && PD_MINOR_VERSION < 37 |
175 | image_widgetbehavior.w_savefn = image_save; | 197 | image_widgetbehavior.w_savefn = image_save; |
176 | #endif | 198 | #endif |
177 | } | 199 | } |