Esempio n. 1
0
static int
write_map_window(
			GenCodeInfo	genCodeInfo, 
			ABObj 		window,
			BOOL		show
)
{
    File	codeFile = genCodeInfo->code_file;
    ABObj	project = obj_get_project(window);
    ABObj	proj_root_window = abmfP_get_root_window(project);
    ABObjRec	showActionRec;
    ABObj	showAction = &showActionRec;
    ABObj	winParent = NULL;
    char	winParentName[1024];
    obj_construct(showAction, AB_TYPE_ACTION, NULL);
    *winParentName = 0;

    obj_set_from(showAction, NULL);
    obj_set_to(showAction, window);
    obj_set_func_type(showAction, AB_FUNC_BUILTIN);
    obj_set_func_builtin(showAction, AB_STDACT_SHOW);

    winParent = obj_get_win_parent(window);
    if (winParent == NULL)
    {
	sprintf(winParentName, "%s()", abmfP_lib_get_toplevel_widget->name);
    }
    else
    {
        strcpy(winParentName, abmfP_get_c_name(genCodeInfo, winParent));
    }
    abio_printf(codeFile, "%s(%s, %s);\n",
	abmfP_get_init_proc_name(window),
	abmfP_get_c_struct_ptr_name(genCodeInfo, window),
	winParentName);

    if (show)
    	abmfP_write_builtin_action(genCodeInfo, showAction, FALSE);

    obj_destruct(showAction);
    return 0;
}
Esempio n. 2
0
ABObj 
obj_create(AB_OBJECT_TYPE obj_type, ABObj parent)
{
	ABObj obj= (ABObj)util_malloc(sizeof(AB_OBJ));
	if (obj == NULL)
	{
		return NULL;
	}

	/*
	 * Don't send reparent
	 */
	objP_notify_push_mode();
	    objP_notify_clear_mode(OBJEV_MODE_SEND_ALLOW_EVS);
	    objP_notify_clear_mode(OBJEV_MODE_SEND_NOTIFY_EVS);
	    obj_construct(obj, obj_type, parent);
	objP_notify_pop_mode();

	objP_notify_send_create(obj);

	return obj;
}