void CropTool::buttonEvent(ButtonType type, bool isPress, int x, int y) { if (!isPress || (type != LEFT)) { return; } if (x1 == -1) { x1 = x; y1 = y; x2 = x; y2 = y; draw_xor_rect(getRect()); } else { draw_xor_rect(getRect()); x2 = x; y2 = y; crop(); // disable drawing in deactivate x1 = -1; } }
void ZoomInTool::moveEvent(int x, int y) { draw_xor_rect(rect); rect.x = x; rect.y = y; draw_xor_rect(rect); }
void CropTool::moveEvent(int x, int y) { if (x1 != -1) { draw_xor_rect(getRect()); x2 = x; y2 = y; draw_xor_rect(getRect()); } }
void ZoomInTool::buttonEvent(ButtonType type, bool isPress, int x, int y) { if (!isPress) { // button has been released, stop changing zoom box size if we // were doing that killTimer(); return; } // don't accept additional clicks while timer is active (other than // middle click) if ((timer_id != -1) && ((type == LEFT) || (type == RIGHT))) { return; } intptr_t zoom_dir = 0; if (type == LEFT) { zoom_dir = 1; } else if (type == MIDDLE) { zoom(); } else if (type == RIGHT) { zoom_dir = -1; } if (zoom_dir) { draw_xor_rect(rect); resizeRect(zoom_dir); if (!rectIsValidSize()) { resizeRect(-zoom_dir); } else { timer_id = g_timeout_add(ZOOM_INTERVAL, (GtkFunction)zoom_in_callback, (void*)(2 * zoom_dir)); } draw_xor_rect(rect); } }
void ZoomInTool::timerCallback(int arg) { draw_xor_rect(rect); resizeRect(arg); if (!rectIsValidSize()) { resizeRect(-arg); } draw_xor_rect(rect); }
void meta_effects_update_wireframe (MetaScreen *screen, const MetaRectangle *old_rect, int old_width, int old_height, const MetaRectangle *new_rect, int new_width, int new_height) { if (old_rect) draw_xor_rect (screen, old_rect, old_width, old_height); if (new_rect) draw_xor_rect (screen, new_rect, new_width, new_height); XFlush (screen->display->xdisplay); }
void ZoomInTool::deactivate() { draw_xor_rect(rect); killTimer(); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toolbarButton), FALSE); }
void CropTool::deactivate() { if (x1 != -1) { draw_xor_rect(getRect()); x1 = -1; } gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toolbarButton), FALSE); }
bool ZoomInTool::activate() { rect.x = 0; rect.y = 0; rect.width = int(ZOOM_BOX_WIDTH * img->user_width); rect.height = int(rect.width / img->ratio); draw_xor_rect(rect); return true; }