void zoom_out(void) { canvas_handle canvas; log_info("zoom out request"); canvas = get_current_canvas(); if (canvas != NULL) { canvas_set_zoom(canvas, canvas_get_zoom(canvas) / ZOOM_CHANGE); } }
void zoom_fit(void) { canvas_handle canvas; log_info("zoom fit request"); canvas = get_current_canvas(); if (canvas != NULL) { canvas_set_zoom_fit(canvas); } }
void zoom_100(void) { canvas_handle canvas; log_info("zoom 100%% request"); canvas = get_current_canvas(); if (canvas != NULL) { canvas_set_zoom(canvas, 1.0); } }
void arrange(void) { canvas_handle canvas; log_info("arrange request"); canvas = get_current_canvas(); if (canvas != NULL) { canvas_arrange(canvas); } }
//========================================================================== void render_free_draw(int fdid) { try { #ifdef DEBUG printf("render_free_draw called %%%%%%%%%%%\n"); #endif if( !is_free_draw_rectangle(fdid)) return; if( !is_free_draw_visible(fdid)) return; PluginFreeDrawRectangle *pfdr = freedrawvec[fdid]; #ifdef DEBUG printf("PFDR Data:\nPlugin %d\nX: %f\tY: %f\n", pfdr->plugin, pfdr->x, pfdr->y); printf("W: %f\tH: %f\n", pfdr->w, pfdr->h); #endif JNIEnv* jenv = get_current_jnienv(); if( !jenv ) return; #ifdef DEBUG else printf("JNIEnv Yay\n"); #endif jobject pmo = get_plugin_manager_object(); if( !pmo ) { printf("NULL PMO\n"); return; } #ifdef DEBUG else printf("PMO Yay %d\n", pmo); #endif jclass pmc = get_plugin_manager_class(); if( !pmc ) { return; } #ifdef DEBUG else printf("PMC Yay %d\n", pmc); #endif jmethodID pmm = get_plugin_manager_get_plugin(); if( !pmm ) { return; } #ifdef DEBUG else printf("PMM Yay %d\n", pmm); #endif jobject cpo = jenv->CallObjectMethod( pmo, pmm, pfdr->plugin); if( !cpo ) { return; } #ifdef DEBUG else printf("CPO Yay\n"); #endif jclass cpc = jenv->GetObjectClass(cpo); if( !cpc ) { return; } #ifdef DEBUG else printf("CPC Yay\n"); #endif jmethodID cpm = jenv->GetMethodID( cpc, "renderRectangle", "(IIIIFFFFF)V"); if( !cpm ) { return; } #ifdef DEBUG else printf("CPM Yay\n"); printf("Calling object method!!!\n"); fflush(stdout); #endif int cur_canvas = get_current_canvas(); // if the track id and section id != -1 then set the // width as the the width of the section image scaled for the // canvas CoreSection *cs = get_track_section(get_scene_track(pfdr->track), pfdr->section); jenv->CallObjectMethod( cpo, cpm, fdid, cur_canvas, pfdr->track, pfdr->section, pfdr->x, pfdr->y, pfdr->w, pfdr->h, get_canvas_height(cur_canvas) / get_canvas_orig_height(cur_canvas)); #ifdef DEBUG printf("Called Object Method!!!!\n"); #endif } catch( ... ) { printf("Something very strange!\n"); } }