Exemple #1
0
VOID new_tree(WORD sobj, WORD dobj, WORD dx, WORD dy)
{
	WORD	w, h;
	LONG	maddr, tree, obspec;

	if (rcs_lock)
		hndl_locked();
	else
	{
		switch (sobj)
		{
			case MENUICON:
				ini_tree(&maddr, NEWMENU);
				ins_tree(maddr, ROOT, MENU, dobj, dx, dy);
				break;
			case ALRTICON:
				ini_tree(&tree, ALRTPBX);
				obspec = GET_SPEC(tree, APBXIMG0);
				ini_tree(&maddr, NEWALRT);
				tree = ins_tree(maddr, ROOT, ALRT, dobj, dx, dy);
				if (tree != -1L)
				{
					SET_SPEC(tree, ALRTIMG, obspec);
					fix_alert(tree);
				}
				break;
			case PANLICON:
			case FREEICON:
				ini_tree(&maddr, NEWPANEL);
				tree = ins_tree(maddr, ROOT, 
					(sobj == PANLICON)? PANL: FREE, dobj, dx, dy);
				if (tree != -1L)
				{
					SET_HEIGHT(tree, ROOT, view.g_h);
					SET_WIDTH(tree, ROOT, view.g_w);
				}
				break;
			case DIALICON:
				ini_tree(&maddr, NEWDIAL);
				tree = ins_tree(maddr, ROOT, DIAL, dobj, dx, dy);
				if (tree != -1L)
				{
					w = view.g_w;
					h = view.g_h;
					snap_wh(&w, &h);
					SET_HEIGHT(tree, ROOT, h);
					SET_WIDTH(tree, ROOT, w);
				}
				break;
			default:
				break;
		}	
	}
}
Exemple #2
0
int insert_wordlist(const list *word_list, tree **t)
{
    if (!word_list || !t)
        return -1;

    list *all_but_last = upto_last(word_list);
    if (!all_but_last)
        return 0;

    HASH h = key_from_wordlist((list *)all_but_last);
    if (!h)
        return -1;

    const DATA v = lindex((list *)word_list, -1);
    if (!v)
        error(ELIST);

    if (!*t) {
        *t = init_tree(h, v);
    } else {
        if (ins_tree(*t, h, v) < 0)
            error(ETREE);
    }

    return 0;
}
Exemple #3
0
VOID paste_tree(WORD dobj, WORD dx, WORD dy, WORD dup)
{
	if (tree_kind(rcs_clipkind))
	{
		if (ins_tree(ad_clip, ROOT, rcs_clipkind, dobj, dx, dy) != -1L)
		{
			if (!dup)
				clr_clip();
		}
	}
}
Exemple #4
0
VOID dup_tree(WORD sobj, WORD dobj, WORD dx, WORD dy)
{
	WORD	where, kind;
	LONG	stree; 

	if (rcs_lock)
		hndl_locked();
	else
	{
		stree = tree_addr(sobj - 1);
		where = find_value((BYTE *) stree);
		kind = get_kind(where);
		ins_tree(stree, ROOT, kind, dobj, dx, dy);
	}
}