Ejemplo n.º 1
0
static void
place_lib_object(int x, int y, unsigned int shift)
{
    F_compound *this_c;

    canvas_leftbut_proc = null_proc;
    canvas_middlebut_proc = null_proc;
    canvas_rightbut_proc = null_proc;
    canvas_locmove_proc = null_proc;
    canvas_ref_proc = null_proc;
    put_draw(ERASE);
    clean_up();
    if (draw_box) 
    	translate_compound(new_c,cur_x,cur_y);
    /* remove it from the depths because it will be added when it is put in the main list */
    remove_compound_depth(new_c);
    add_compound(new_c);
    set_modifiedflag();
    redisplay_compound(new_c);
    if (shift) {
	/* temporarily turn off library place mode so we can edit the object just placed */
	canvas_kbd_proc = null_proc;
	clear_mousefun();
	set_mousefun("","","", "", "", "");
	turn_off_current();
	set_cursor(arrow_cursor);
	edit_remember_lib_mode = True;
	this_c = new_c;
	edit_item(this_c, O_COMPOUND, 0, 0);
    } else {
	put_selected();
    }
}
Ejemplo n.º 2
0
static void
place_lib_object_orig(int x, int y, unsigned int shift)
{
    int dx,dy;

    canvas_ref_proc = null_proc;
    put_draw(ERASE);
    clean_up();
    /* move back to original position */
    dx = orig_put_x-x;
    dy = orig_put_y-y;
    translate_compound(new_c,dx,dy);
    /* remove it from the depths because it will be added when it is put in the main list */
    remove_compound_depth(new_c);
    add_compound(new_c);
    set_modifiedflag();
    redisplay_compound(new_c);
    put_selected();
}
Ejemplo n.º 3
0
static void
init_flipcompound(F_compound *old_c, int px, int py)
{
    F_compound	   *new_c;

    set_temp_cursor(wait_cursor);
    new_c = copy_compound(old_c);
    flip_compound(new_c, px, py, flip_axis);
    if (copy) {
	add_compound(new_c);
    } else {
	toggle_compoundmarker(old_c);
	draw_compoundelements(old_c, ERASE);
	change_compound(old_c, new_c);
    }
    /* redisplay objects under this object before it was rotated */
    redisplay_compound(old_c);
    /* and this object and any other objects on top */
    redisplay_compound(new_c);
    reset_cursor();
}
Ejemplo n.º 4
0
static void
place_compound_x(int x, int y)
{
    int		    dx, dy;

    canvas_leftbut_proc = null_proc;
    canvas_middlebut_proc = null_proc;
    canvas_rightbut_proc = null_proc;
    canvas_locmove_proc = null_proc;
    canvas_ref_proc = null_proc;
    adjust_pos(x, y, fix_x, fix_y, &x, &y);
    dx = x - fix_x;
    dy = y - fix_y;
    translate_compound(new_c, dx, dy);
    clean_up();
    set_latestcompound(new_c);
    if (return_proc == copy_selected) {
	add_compound(new_c);
	adjust_links(cur_linkmode, cur_links, dx, dy, 0, 0, 1.0, 1.0, True);
	free_linkinfo(&cur_links);
    } else {
	list_add_compound(&objects.compounds, new_c);
	adjust_links(cur_linkmode, cur_links, dx, dy, 0, 0, 1.0, 1.0, False);
	set_lastposition(fix_x, fix_y);
	set_newposition(x, y);
	set_lastlinkinfo(cur_linkmode, cur_links);
	cur_links = NULL;
	set_action_object(F_MOVE, O_COMPOUND);
    }
    set_modifiedflag();
    redisplay_compound(new_c);
    /* turn back on all relevant markers */
    update_markers(new_objmask);
    (*return_proc) ();
    draw_mousefun_canvas();
}