Lines Matching refs:edit_select

141 static GimpItem * gimp_edit_selection_tool_get_active_item     (GimpEditSelectionTool *edit_select,
143 static void gimp_edit_selection_tool_calc_coords (GimpEditSelectionTool *edit_select,
147 static void gimp_edit_selection_tool_start_undo_group (GimpEditSelectionTool *edit_select,
174 gimp_edit_selection_tool_init (GimpEditSelectionTool *edit_select) in gimp_edit_selection_tool_init() argument
176 GimpTool *tool = GIMP_TOOL (edit_select); in gimp_edit_selection_tool_init()
178 edit_select->first_move = TRUE; in gimp_edit_selection_tool_init()
187 GimpEditSelectionTool *edit_select = GIMP_EDIT_SELECTION_TOOL (object); in gimp_edit_selection_tool_finalize() local
189 g_clear_pointer (&edit_select->segs_in, g_free); in gimp_edit_selection_tool_finalize()
190 edit_select->num_segs_in = 0; in gimp_edit_selection_tool_finalize()
192 g_clear_pointer (&edit_select->segs_out, g_free); in gimp_edit_selection_tool_finalize()
193 edit_select->num_segs_out = 0; in gimp_edit_selection_tool_finalize()
195 g_clear_pointer (&edit_select->live_items, g_list_free); in gimp_edit_selection_tool_finalize()
196 g_clear_pointer (&edit_select->delayed_items, g_list_free); in gimp_edit_selection_tool_finalize()
208 GimpEditSelectionTool *edit_select; in gimp_edit_selection_tool_start() local
216 edit_select = g_object_new (GIMP_TYPE_EDIT_SELECTION_TOOL, in gimp_edit_selection_tool_start()
220 edit_select->propagate_release = propagate_release; in gimp_edit_selection_tool_start()
222 tool = GIMP_TOOL (edit_select); in gimp_edit_selection_tool_start()
243 edit_select->edit_mode = edit_mode; in gimp_edit_selection_tool_start()
245 gimp_edit_selection_tool_start_undo_group (edit_select, image); in gimp_edit_selection_tool_start()
248 edit_select->start_x = coords->x; in gimp_edit_selection_tool_start()
249 edit_select->start_y = coords->y; in gimp_edit_selection_tool_start()
251 active_item = gimp_edit_selection_tool_get_active_item (edit_select, image); in gimp_edit_selection_tool_start()
256 edit_select->last_x = coords->x - off_x; in gimp_edit_selection_tool_start()
257 edit_select->last_y = coords->y - off_y; in gimp_edit_selection_tool_start()
259 edit_select->constrain = FALSE; in gimp_edit_selection_tool_start()
274 &edit_select->num_segs_in, in gimp_edit_selection_tool_start()
275 &edit_select->num_segs_out, in gimp_edit_selection_tool_start()
278 edit_select->segs_in = g_memdup (segs_in, in gimp_edit_selection_tool_start()
279 edit_select->num_segs_in * in gimp_edit_selection_tool_start()
282 edit_select->segs_out = g_memdup (segs_out, in gimp_edit_selection_tool_start()
283 edit_select->num_segs_out * in gimp_edit_selection_tool_start()
286 if (edit_select->edit_mode == GIMP_TRANSLATE_MODE_VECTORS) in gimp_edit_selection_tool_start()
288 edit_select->sel_x = 0; in gimp_edit_selection_tool_start()
289 edit_select->sel_y = 0; in gimp_edit_selection_tool_start()
290 edit_select->sel_width = gimp_image_get_width (image); in gimp_edit_selection_tool_start()
291 edit_select->sel_height = gimp_image_get_height (image); in gimp_edit_selection_tool_start()
301 &edit_select->sel_x, in gimp_edit_selection_tool_start()
302 &edit_select->sel_y, in gimp_edit_selection_tool_start()
303 &edit_select->sel_width, in gimp_edit_selection_tool_start()
304 &edit_select->sel_height); in gimp_edit_selection_tool_start()
308 gimp_edit_selection_tool_calc_coords (edit_select, image, in gimp_edit_selection_tool_start()
314 switch (edit_select->edit_mode) in gimp_edit_selection_tool_start()
326 x = edit_select->sel_x + off_x; in gimp_edit_selection_tool_start()
327 y = edit_select->sel_y + off_y; in gimp_edit_selection_tool_start()
328 w = edit_select->sel_width; in gimp_edit_selection_tool_start()
329 h = edit_select->sel_height; in gimp_edit_selection_tool_start()
365 edit_select->center_x = x + w / 2.0; in gimp_edit_selection_tool_start()
366 edit_select->center_y = y + h / 2.0; in gimp_edit_selection_tool_start()
371 switch (edit_select->edit_mode) in gimp_edit_selection_tool_start()
376 edit_select->live_items = in gimp_edit_selection_tool_start()
381 edit_select->live_items = in gimp_edit_selection_tool_start()
382 gimp_image_item_list_filter (edit_select->live_items); in gimp_edit_selection_tool_start()
384 edit_select->delayed_items = in gimp_edit_selection_tool_start()
388 edit_select->delayed_items = in gimp_edit_selection_tool_start()
389 gimp_image_item_list_filter (edit_select->delayed_items); in gimp_edit_selection_tool_start()
399 switch (edit_select->edit_mode) in gimp_edit_selection_tool_start()
404 edit_select->live_items = g_list_append (NULL, active_item); in gimp_edit_selection_tool_start()
410 edit_select->delayed_items = g_list_append (NULL, active_item); in gimp_edit_selection_tool_start()
419 for (list = edit_select->live_items; list; list = g_list_next (list)) in gimp_edit_selection_tool_start()
441 gimp_draw_tool_start (GIMP_DRAW_TOOL (edit_select), display); in gimp_edit_selection_tool_start()
453 GimpEditSelectionTool *edit_select = GIMP_EDIT_SELECTION_TOOL (tool); in gimp_edit_selection_tool_button_release() local
466 gimp_draw_tool_stop (GIMP_DRAW_TOOL (edit_select)); in gimp_edit_selection_tool_button_release()
474 edit_select->delayed_items, in gimp_edit_selection_tool_button_release()
475 edit_select->cuml_x, in gimp_edit_selection_tool_button_release()
476 edit_select->cuml_y, in gimp_edit_selection_tool_button_release()
479 for (list = edit_select->live_items; list; list = g_list_next (list)) in gimp_edit_selection_tool_button_release()
498 if (edit_select->propagate_release && in gimp_edit_selection_tool_button_release()
506 g_object_unref (edit_select); in gimp_edit_selection_tool_button_release()
510 gimp_edit_selection_tool_update_motion (GimpEditSelectionTool *edit_select, in gimp_edit_selection_tool_update_motion() argument
515 GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (edit_select); in gimp_edit_selection_tool_update_motion()
516 GimpTool *tool = GIMP_TOOL (edit_select); in gimp_edit_selection_tool_update_motion()
525 if (edit_select->constrain) in gimp_edit_selection_tool_update_motion()
527 gimp_constrain_line (edit_select->start_x, edit_select->start_y, in gimp_edit_selection_tool_update_motion()
532 gimp_edit_selection_tool_calc_coords (edit_select, image, in gimp_edit_selection_tool_update_motion()
535 dx = edit_select->current_x - edit_select->last_x; in gimp_edit_selection_tool_update_motion()
536 dy = edit_select->current_y - edit_select->last_y; in gimp_edit_selection_tool_update_motion()
544 active_item = gimp_edit_selection_tool_get_active_item (edit_select, in gimp_edit_selection_tool_update_motion()
547 edit_select->cuml_x += dx; in gimp_edit_selection_tool_update_motion()
548 edit_select->cuml_y += dy; in gimp_edit_selection_tool_update_motion()
550 switch (edit_select->edit_mode) in gimp_edit_selection_tool_update_motion()
556 edit_select->last_x = edit_select->current_x; in gimp_edit_selection_tool_update_motion()
557 edit_select->last_y = edit_select->current_y; in gimp_edit_selection_tool_update_motion()
563 edit_select->live_items, in gimp_edit_selection_tool_update_motion()
565 edit_select->first_move); in gimp_edit_selection_tool_update_motion()
573 edit_select->edit_mode == in gimp_edit_selection_tool_update_motion()
587 edit_select->last_x -= edit_select->sel_x; in gimp_edit_selection_tool_update_motion()
588 edit_select->last_y -= edit_select->sel_y; in gimp_edit_selection_tool_update_motion()
589 edit_select->sel_x = 0; in gimp_edit_selection_tool_update_motion()
590 edit_select->sel_y = 0; in gimp_edit_selection_tool_update_motion()
592 edit_select->edit_mode = GIMP_TRANSLATE_MODE_FLOATING_SEL; in gimp_edit_selection_tool_update_motion()
594 active_item = gimp_edit_selection_tool_get_active_item (edit_select, in gimp_edit_selection_tool_update_motion()
597 edit_select->live_items = g_list_prepend (NULL, active_item); in gimp_edit_selection_tool_update_motion()
607 edit_select->live_items, in gimp_edit_selection_tool_update_motion()
609 edit_select->first_move); in gimp_edit_selection_tool_update_motion()
613 edit_select->first_move = FALSE; in gimp_edit_selection_tool_update_motion()
622 edit_select->cuml_x, in gimp_edit_selection_tool_update_motion()
624 edit_select->cuml_y, in gimp_edit_selection_tool_update_motion()
638 GimpEditSelectionTool *edit_select = GIMP_EDIT_SELECTION_TOOL (tool); in gimp_edit_selection_tool_motion() local
640 edit_select->last_motion_x = coords->x; in gimp_edit_selection_tool_motion()
641 edit_select->last_motion_y = coords->y; in gimp_edit_selection_tool_motion()
643 gimp_edit_selection_tool_update_motion (edit_select, in gimp_edit_selection_tool_motion()
655 GimpEditSelectionTool *edit_select = GIMP_EDIT_SELECTION_TOOL (tool); in gimp_edit_selection_tool_active_modifier_key() local
657 edit_select->constrain = (state & gimp_get_constrain_behavior_mask () ? in gimp_edit_selection_tool_active_modifier_key()
665 gimp_edit_selection_tool_update_motion (edit_select, in gimp_edit_selection_tool_active_modifier_key()
666 edit_select->last_motion_x, in gimp_edit_selection_tool_active_modifier_key()
667 edit_select->last_motion_y, in gimp_edit_selection_tool_active_modifier_key()
675 GimpEditSelectionTool *edit_select = GIMP_EDIT_SELECTION_TOOL (draw_tool); in gimp_edit_selection_tool_draw() local
682 active_item = gimp_edit_selection_tool_get_active_item (edit_select, image); in gimp_edit_selection_tool_draw()
686 switch (edit_select->edit_mode) in gimp_edit_selection_tool_draw()
694 if (edit_select->edit_mode == GIMP_TRANSLATE_MODE_MASK) in gimp_edit_selection_tool_draw()
702 if (! floating_sel && edit_select->segs_in) in gimp_edit_selection_tool_draw()
705 edit_select->segs_in, in gimp_edit_selection_tool_draw()
706 edit_select->num_segs_in, in gimp_edit_selection_tool_draw()
708 edit_select->cuml_x + off_x, in gimp_edit_selection_tool_draw()
709 edit_select->cuml_y + off_y); in gimp_edit_selection_tool_draw()
712 if (edit_select->segs_out) in gimp_edit_selection_tool_draw()
715 edit_select->segs_out, in gimp_edit_selection_tool_draw()
716 edit_select->num_segs_out, in gimp_edit_selection_tool_draw()
718 edit_select->cuml_x + off_x, in gimp_edit_selection_tool_draw()
719 edit_select->cuml_y + off_y); in gimp_edit_selection_tool_draw()
721 else if (edit_select->edit_mode != GIMP_TRANSLATE_MODE_MASK) in gimp_edit_selection_tool_draw()
725 edit_select->cuml_x + off_x, in gimp_edit_selection_tool_draw()
726 edit_select->cuml_y + off_y, in gimp_edit_selection_tool_draw()
737 edit_select->sel_x + off_x, in gimp_edit_selection_tool_draw()
738 edit_select->sel_y + off_y, in gimp_edit_selection_tool_draw()
739 edit_select->sel_width, in gimp_edit_selection_tool_draw()
740 edit_select->sel_height); in gimp_edit_selection_tool_draw()
776 if (edit_select->segs_in) in gimp_edit_selection_tool_draw()
779 edit_select->segs_in, in gimp_edit_selection_tool_draw()
780 edit_select->num_segs_in, in gimp_edit_selection_tool_draw()
782 edit_select->cuml_x, in gimp_edit_selection_tool_draw()
783 edit_select->cuml_y); in gimp_edit_selection_tool_draw()
791 edit_select->center_x + edit_select->cuml_x, in gimp_edit_selection_tool_draw()
792 edit_select->center_y + edit_select->cuml_y, in gimp_edit_selection_tool_draw()
801 gimp_edit_selection_tool_get_active_item (GimpEditSelectionTool *edit_select, in gimp_edit_selection_tool_get_active_item() argument
806 switch (edit_select->edit_mode) in gimp_edit_selection_tool_get_active_item()
829 gimp_edit_selection_tool_calc_coords (GimpEditSelectionTool *edit_select, in gimp_edit_selection_tool_calc_coords() argument
839 active_item = gimp_edit_selection_tool_get_active_item (edit_select, image); in gimp_edit_selection_tool_calc_coords()
843 dx = (x - off_x) - edit_select->last_x; in gimp_edit_selection_tool_calc_coords()
844 dy = (y - off_y) - edit_select->last_y; in gimp_edit_selection_tool_calc_coords()
846 x1 = edit_select->sel_x + dx; in gimp_edit_selection_tool_calc_coords()
847 y1 = edit_select->sel_y + dy; in gimp_edit_selection_tool_calc_coords()
849 edit_select->current_x = ((gint) floor (x1) - in gimp_edit_selection_tool_calc_coords()
850 (edit_select->sel_x - edit_select->last_x)); in gimp_edit_selection_tool_calc_coords()
851 edit_select->current_y = ((gint) floor (y1) - in gimp_edit_selection_tool_calc_coords()
852 (edit_select->sel_y - edit_select->last_y)); in gimp_edit_selection_tool_calc_coords()
856 gimp_edit_selection_tool_start_undo_group (GimpEditSelectionTool *edit_select, in gimp_edit_selection_tool_start_undo_group() argument
862 active_item = gimp_edit_selection_tool_get_active_item (edit_select, image); in gimp_edit_selection_tool_start_undo_group()
864 switch (edit_select->edit_mode) in gimp_edit_selection_tool_start_undo_group()
885 edit_select->edit_mode == in gimp_edit_selection_tool_start_undo_group()