abmfP_write_init_proc_begin( GenCodeInfo genCodeInfo, ABObj obj ) { if (obj_is_message(obj)) { return abmfP_write_c_func_begin( genCodeInfo, FALSE, /* Is static */ abmfP_str_int, /* return type */ abmfP_get_init_proc_name(obj), /* function name */ "DtbMessageData", /* Argument type */ abmfP_instance_ptr_var_name, /* Argument name */ NULL ); } else { return abmfP_write_c_func_begin( genCodeInfo, FALSE, /* Is static */ abmfP_str_int, /* return type */ abmfP_get_init_proc_name(obj), /* function name */ abmfP_get_c_struct_ptr_type_name(obj), /* Argument type */ abmfP_instance_ptr_var_name, /* Argument name */ abmfP_str_widget, /* Argument type */ "parent", /* Argument name */ NULL ); } }
static void set_up_user_type_variables(GenCodeInfo genCodeInfo, ABObj toObj) { File codeFile = genCodeInfo->code_file; ABObj structObj = abmfP_obj_get_struct_obj(toObj); ABObj winParent = NULL; char winParentName[1024]; *winParentName = 0; /* * Determine window parent of this popup */ winParent = obj_get_win_parent(structObj); if (winParent == NULL) { sprintf(winParentName, "%s()", abmfP_lib_get_toplevel_widget->name); } else { strcpy(winParentName, abmfP_get_c_name(genCodeInfo, winParent)); } /* * REMIND: This is obsolete and should be removed! */ if (cwd_is_dtbuilder_src_dir()) { write_instance_ptr_var(genCodeInfo, toObj, instanceVarName, abmfP_client_data_var_name, TRUE, NULL); abio_puts(genCodeInfo->code_file, nlstr); } else { write_instance_ptr_var(genCodeInfo, toObj, toVarName, abmfP_client_data_var_name, TRUE, NULL); write_instance_ptr_var(genCodeInfo, toObj, instanceVarName, toVarName, FALSE, "/* obsolete */"); abio_puts(genCodeInfo->code_file, nlstr); } abio_printf(codeFile, "if (!(%s->initialized))\n", get_to_var_name()); abmfP_write_c_block_begin(genCodeInfo); abio_printf(codeFile, "%s(%s, %s);\n", abmfP_get_init_proc_name(structObj), get_to_var_name(), winParentName); abmfP_write_c_block_end(genCodeInfo); }
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; }