void shoes_slot_scroll_to(shoes_canvas *canvas, int dy, int rel) { if (rel) canvas->slot->scrolly += dy; else canvas->slot->scrolly = dy; if (canvas->slot->scrolly > canvas->endy - canvas->height) canvas->slot->scrolly = canvas->endy - canvas->height; if (canvas->slot->scrolly < 0) canvas->slot->scrolly = 0; if (DC(canvas->app->slot) == DC(canvas->slot)) canvas->app->slot->scrolly = canvas->slot->scrolly; shoes_native_slot_scroll_top(canvas->slot); shoes_slot_repaint(canvas->slot); }
shoes_code shoes_app_goto(shoes_app *app, char *path) { shoes_code code = SHOES_OK; const char http_scheme[] = "http://"; if (strlen(path) > strlen(http_scheme) && strncmp(http_scheme, path, strlen(http_scheme)) == 0) { shoes_browser_open(path); } else { code = shoes_app_visit(app, path); if (code == SHOES_OK) { shoes_app_motion(app, app->mousex, app->mousey); shoes_slot_repaint(app->slot); } } return code; }