diff options
Diffstat (limited to 'apps/plugins/pdbox/PDa')
-rw-r--r-- | apps/plugins/pdbox/PDa/src/g_editor.c | 49 |
1 files changed, 39 insertions, 10 deletions
diff --git a/apps/plugins/pdbox/PDa/src/g_editor.c b/apps/plugins/pdbox/PDa/src/g_editor.c index 1446a451fd..6a1fbab13b 100644 --- a/apps/plugins/pdbox/PDa/src/g_editor.c +++ b/apps/plugins/pdbox/PDa/src/g_editor.c | |||
@@ -290,13 +290,17 @@ static const char *canvas_undo_name; | |||
290 | void canvas_setundo(t_canvas *x, t_undofn undofn, void *buf, | 290 | void canvas_setundo(t_canvas *x, t_undofn undofn, void *buf, |
291 | const char *name) | 291 | const char *name) |
292 | { | 292 | { |
293 | #ifndef ROCKBOX | ||
293 | int hadone = 0; | 294 | int hadone = 0; |
295 | #endif | ||
294 | /* blow away the old undo information. In one special case the | 296 | /* blow away the old undo information. In one special case the |
295 | old undo info is re-used; if so we shouldn't free it here. */ | 297 | old undo info is re-used; if so we shouldn't free it here. */ |
296 | if (canvas_undo_fn && canvas_undo_buf && (buf != canvas_undo_buf)) | 298 | if (canvas_undo_fn && canvas_undo_buf && (buf != canvas_undo_buf)) |
297 | { | 299 | { |
298 | (*canvas_undo_fn)(canvas_undo_canvas, canvas_undo_buf, UNDO_FREE); | 300 | (*canvas_undo_fn)(canvas_undo_canvas, canvas_undo_buf, UNDO_FREE); |
301 | #ifndef ROCKBOX | ||
299 | hadone = 1; | 302 | hadone = 1; |
303 | #endif | ||
300 | } | 304 | } |
301 | canvas_undo_canvas = x; | 305 | canvas_undo_canvas = x; |
302 | canvas_undo_fn = undofn; | 306 | canvas_undo_fn = undofn; |
@@ -809,9 +813,9 @@ static t_gobj *canvas_findhitbox(t_canvas *x, int xpos, int ypos, | |||
809 | /* right-clicking on a canvas object pops up a menu. */ | 813 | /* right-clicking on a canvas object pops up a menu. */ |
810 | static void canvas_rightclick(t_canvas *x, int xpos, int ypos, t_gobj *y) | 814 | static void canvas_rightclick(t_canvas *x, int xpos, int ypos, t_gobj *y) |
811 | { | 815 | { |
812 | int canprop, canopen; | 816 | /* int canprop, canopen; unused */ |
813 | canprop = (!y || (y && class_getpropertiesfn(pd_class(&y->g_pd)))); | 817 | /* canprop = */ (!y || (y && class_getpropertiesfn(pd_class(&y->g_pd)))); |
814 | canopen = (y && zgetfn(&y->g_pd, gensym("menu-open"))); | 818 | /* canopen = */ (y && zgetfn(&y->g_pd, gensym("menu-open"))); |
815 | #ifdef ROCKBOX | 819 | #ifdef ROCKBOX |
816 | (void) x; | 820 | (void) x; |
817 | (void) xpos; | 821 | (void) xpos; |
@@ -1267,26 +1271,46 @@ void canvas_doconnect(t_canvas *x, int xpos, int ypos, int which, int doit) | |||
1267 | (noutlet1 = obj_noutlets(ob1)) | 1271 | (noutlet1 = obj_noutlets(ob1)) |
1268 | && (ninlet2 = obj_ninlets(ob2))) | 1272 | && (ninlet2 = obj_ninlets(ob2))) |
1269 | { | 1273 | { |
1270 | int width1 = x12 - x11, closest1, hotspot1; | 1274 | #ifndef ROCKBOX |
1271 | int width2 = x22 - x21, closest2, hotspot2; | 1275 | int hotspot1; |
1276 | int hotspot2; | ||
1272 | int lx1, lx2, ly1, ly2; | 1277 | int lx1, lx2, ly1, ly2; |
1273 | t_outconnect *oc; | 1278 | t_outconnect *oc; |
1274 | 1279 | #else | |
1280 | int width1 = x12 - x11, closest1; | ||
1281 | int width2 = x22 - x21, closest2; | ||
1282 | #endif | ||
1275 | if (noutlet1 > 1) | 1283 | if (noutlet1 > 1) |
1276 | { | 1284 | { |
1277 | closest1 = ((xwas-x11) * (noutlet1-1) + width1/2)/width1; | 1285 | closest1 = ((xwas-x11) * (noutlet1-1) + width1/2)/width1; |
1286 | #ifndef ROCKBOX | ||
1278 | hotspot1 = x11 + | 1287 | hotspot1 = x11 + |
1279 | (width1 - IOWIDTH) * closest1 / (noutlet1-1); | 1288 | (width1 - IOWIDTH) * closest1 / (noutlet1-1); |
1289 | #endif | ||
1290 | } | ||
1291 | else | ||
1292 | { | ||
1293 | closest1 = 0; | ||
1294 | #ifndef ROCKBOX | ||
1295 | hotspot1 = x11; | ||
1296 | #endif | ||
1280 | } | 1297 | } |
1281 | else closest1 = 0, hotspot1 = x11; | ||
1282 | 1298 | ||
1283 | if (ninlet2 > 1) | 1299 | if (ninlet2 > 1) |
1284 | { | 1300 | { |
1285 | closest2 = ((xpos-x21) * (ninlet2-1) + width2/2)/width2; | 1301 | closest2 = ((xpos-x21) * (ninlet2-1) + width2/2)/width2; |
1302 | #ifndef ROCKBOX | ||
1286 | hotspot2 = x21 + | 1303 | hotspot2 = x21 + |
1287 | (width2 - IOWIDTH) * closest2 / (ninlet2-1); | 1304 | (width2 - IOWIDTH) * closest2 / (ninlet2-1); |
1305 | #endif | ||
1288 | } | 1306 | } |
1289 | else closest2 = 0, hotspot2 = x21; | 1307 | else |
1308 | { | ||
1309 | closest2 = 0; | ||
1310 | #ifndef ROCKBOX | ||
1311 | hotspot2 = x21; | ||
1312 | #endif | ||
1313 | } | ||
1290 | 1314 | ||
1291 | if (closest1 >= noutlet1) | 1315 | if (closest1 >= noutlet1) |
1292 | closest1 = noutlet1 - 1; | 1316 | closest1 = noutlet1 - 1; |
@@ -1308,6 +1332,7 @@ void canvas_doconnect(t_canvas *x, int xpos, int ypos, int which, int doit) | |||
1308 | } | 1332 | } |
1309 | if (doit) | 1333 | if (doit) |
1310 | { | 1334 | { |
1335 | #ifndef ROCKBOX | ||
1311 | oc = obj_connect(ob1, closest1, ob2, closest2); | 1336 | oc = obj_connect(ob1, closest1, ob2, closest2); |
1312 | lx1 = x11 + (noutlet1 > 1 ? | 1337 | lx1 = x11 + (noutlet1 > 1 ? |
1313 | ((x12-x11-IOWIDTH) * closest1)/(noutlet1-1) : 0) | 1338 | ((x12-x11-IOWIDTH) * closest1)/(noutlet1-1) : 0) |
@@ -1317,7 +1342,6 @@ void canvas_doconnect(t_canvas *x, int xpos, int ypos, int which, int doit) | |||
1317 | ((x22-x21-IOWIDTH) * closest2)/(ninlet2-1) : 0) | 1342 | ((x22-x21-IOWIDTH) * closest2)/(ninlet2-1) : 0) |
1318 | + IOMIDDLE; | 1343 | + IOMIDDLE; |
1319 | ly2 = y21; | 1344 | ly2 = y21; |
1320 | #ifndef ROCKBOX | ||
1321 | sys_vgui(".x%x.c create line %d %d %d %d -width %d -tags l%x\n", | 1345 | sys_vgui(".x%x.c create line %d %d %d %d -width %d -tags l%x\n", |
1322 | glist_getcanvas(x), | 1346 | glist_getcanvas(x), |
1323 | lx1, ly1, lx2, ly2, | 1347 | lx1, ly1, lx2, ly2, |
@@ -1456,7 +1480,10 @@ static void canvas_displaceselection(t_canvas *x, int dx, int dy) | |||
1456 | void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av) | 1480 | void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av) |
1457 | { | 1481 | { |
1458 | static t_symbol *keynumsym, *keyupsym, *keynamesym; | 1482 | static t_symbol *keynumsym, *keyupsym, *keynamesym; |
1459 | int keynum, fflag; | 1483 | #ifndef ROCKBOX |
1484 | int fflag; | ||
1485 | #endif | ||
1486 | int keynum; | ||
1460 | t_symbol *gotkeysym; | 1487 | t_symbol *gotkeysym; |
1461 | 1488 | ||
1462 | int down, shift; | 1489 | int down, shift; |
@@ -1488,7 +1515,9 @@ void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av) | |||
1488 | gotkeysym = gensym(buf); | 1515 | gotkeysym = gensym(buf); |
1489 | } | 1516 | } |
1490 | else gotkeysym = gensym("?"); | 1517 | else gotkeysym = gensym("?"); |
1518 | #ifndef ROCKBOX | ||
1491 | fflag = (av[0].a_type == A_FLOAT ? av[0].a_w.w_float : 0); | 1519 | fflag = (av[0].a_type == A_FLOAT ? av[0].a_w.w_float : 0); |
1520 | #endif | ||
1492 | keynum = (av[1].a_type == A_FLOAT ? av[1].a_w.w_float : 0); | 1521 | keynum = (av[1].a_type == A_FLOAT ? av[1].a_w.w_float : 0); |
1493 | if (keynum == '\\' || keynum == '{' || keynum == '}') | 1522 | if (keynum == '\\' || keynum == '{' || keynum == '}') |
1494 | { | 1523 | { |