/* change the origin to a relative filename */ static int change_relative(void) { char buf[80]; int ret, n; int p = 0; grabber_busy_mouse(TRUE); ret = grabber_foreach_selection(do_change_relative, &n, &p, 0); grabber_busy_mouse(FALSE); if (n <= 0) { alert ("Nothing to change!", NULL, NULL, "OK", NULL, 13, 0); } else if (p > 0) { sprintf(buf, "%d object%s ignored", p, (p==1) ? " was" : "s were"); alert(buf, NULL, NULL, "OK", NULL, 13, 0); } if (n > p) grabber_modified(TRUE); return ret; }
/* changes the color depth of bitmap data */ static int changedepth(void) { int depth = (int)((unsigned long)active_menu->dp); char buf[80]; int ret, n; int p = 0; grabber_busy_mouse(TRUE); ret = grabber_foreach_selection(do_changedepth, &n, &p, depth); grabber_busy_mouse(FALSE); if (n <= 0) { alert ("Nothing to change!", NULL, NULL, "OK", NULL, 13, 0); } else if (p > 0) { sprintf(buf, "%d non-bitmap object%s ignored", p, (p==1) ? " was" : "s were"); alert(buf, NULL, NULL, "OK", NULL, 13, 0); } if (n > p) grabber_modified(TRUE); return ret; }
/* checks whether our change command is allowed at the moment */ static int change_query(int popup) { int n, p; if (popup) { p = 0; grabber_foreach_selection(do_origin_check, &n, &p, 0); return (p > 0); } return TRUE; }
/* changes the type of bitmap data */ static int changetype(void) { int type = (int)((unsigned long)active_menu->dp); char buf[80]; int ret, n; int p = 0; ret = grabber_foreach_selection(do_changetype, &n, &p, type); if (n <= 0) { alert ("Nothing to change!", NULL, NULL, "OK", NULL, 13, 0); } else if (p > 0) { sprintf(buf, "%d non-bitmap object%s ignored", p, (p==1) ? " was" : "s were"); alert(buf, NULL, NULL, "OK", NULL, 13, 0); } if (n > p) { grabber_modified(TRUE); grabber_rebuild_list(NULL, FALSE); } return ret; }