/**Function******************************************************************** Synopsis [Initializes trace compact object.] Description [] SideEffects [] SeeAlso [] ******************************************************************************/ void trace_compact_init(TraceCompact_ptr self) { trace_plugin_init(TRACE_PLUGIN(self), "TRACE COMPACT PLUGIN - Shows the trace in a compact tabular fashion"); OVERRIDE(Object, finalize) = trace_compact_finalize; OVERRIDE(TracePlugin, action) = trace_compact_action; }
void generic_trans_init(GenericTrans_ptr self, const TransType trans_type) { object_init(OBJECT(self)); self->_type = trans_type; OVERRIDE(Object, finalize) = generic_trans_finalize; OVERRIDE(Object, copy) = generic_trans_copy; }
/**Function******************************************************************** Synopsis [The HrcDumperDebug class private initializer] Description [The HrcDumperDebug class private initializer] SideEffects [] SeeAlso [HrcDumperDebug_create] ******************************************************************************/ void hrc_dumper_debug_init(HrcDumperDebug_ptr self, FILE* fout) { /* base class initialization */ hrc_dumper_init(HRC_DUMPER(self), fout); /* members initialization */ /* virtual methods settings */ OVERRIDE(Object, finalize) = hrc_dumper_debug_finalize; OVERRIDE(HrcDumper, dump_snippet) = hrc_dumper_debug_dump_snippet; }
int hheaFill(hotCtx g) { hheaCtx h = g->ctx.hhea; h->tbl.version = VERSION(1, 0); { if (OVERRIDE(g->font.hheaAscender)) h->tbl.ascender = g->font.hheaAscender; else h->tbl.ascender = g->font.TypoAscender; if (OVERRIDE(g->font.hheaDescender)) h->tbl.descender = g->font.hheaDescender; else h->tbl.descender = g->font.TypoDescender; if (OVERRIDE(g->font.hheaLineGap)) h->tbl.lineGap = g->font.hheaLineGap; else h->tbl.lineGap = g->font.TypoLineGap; } h->tbl.advanceWidthMax = g->font.maxAdv.h; h->tbl.minLeftSideBearing = g->font.minBearing.left; h->tbl.minRightSideBearing = g->font.minBearing.right; h->tbl.xMaxExtent = g->font.maxExtent.h; if (g->font.ItalicAngle == 0) { h->tbl.caretSlopeRise = 1; h->tbl.caretSlopeRun = 0; } else { h->tbl.caretSlopeRise = 1000; h->tbl.caretSlopeRun = (short)RND(tan(FIX2DBL(-g->font.ItalicAngle) / RAD_DEG) * 1000); } if (h->tbl.caretOffset == SHRT_MAX) h->tbl.caretOffset = (g->font.ItalicAngle == 0)? 0: calcCaretOffset(g); h->tbl.reserved[0] = 0; h->tbl.reserved[1] = 0; h->tbl.reserved[2] = 0; h->tbl.reserved[3] = 0; h->tbl.metricDataFormat = 0; h->tbl.numberOfLongHorMetrics = hmtxGetNLongHorMetrics(g); return 1; }
void printer_psl_init(PrinterPsl_ptr self, const NuSMVEnv_ptr env, const char* name, int low, size_t num) { /* base class initialization */ printer_base_init(PRINTER_BASE(self), env, name, low, num, false /*NULL not handled*/); /* members initialization */ /* virtual methods settings */ OVERRIDE(Object, finalize) = printer_psl_finalize; OVERRIDE(PrinterBase, print_node) = printer_psl_print_node; }
/**Function******************************************************************** Synopsis [The CheckerPsl class private initializer] Description [The CheckerPsl class private initializer] SideEffects [] SeeAlso [CheckerPsl_create] ******************************************************************************/ void checker_psl_init(CheckerPsl_ptr self) { /* base class initialization */ checker_base_init(CHECKER_BASE(self), "PSL Type Checker", NUSMV_PSL_SYMBOL_FIRST, NUSMV_PSL_SYMBOL_LAST - NUSMV_PSL_SYMBOL_FIRST); /* members initialization */ /* virtual methods settings */ OVERRIDE(Object, finalize) = checker_psl_finalize; OVERRIDE(CheckerBase, check_expr) = checker_psl_check_expr; OVERRIDE(CheckerBase, viol_handler) = checker_psl_viol_handler; }
/**Function******************************************************************** Synopsis [The BoolEncClient class private initializer] Description [The BoolEncClient class private initializer] SideEffects [] SeeAlso [BoolEncClient_create] ******************************************************************************/ void bool_enc_client_init(BoolEncClient_ptr self, SymbTable_ptr symb_table, BoolEnc_ptr bool_enc) { /* base class initialization */ base_enc_init(BASE_ENC(self), symb_table); /* members initialization */ self->bool_enc = bool_enc; /* virtual methods settings */ OVERRIDE(Object, finalize) = bool_enc_client_finalize; OVERRIDE(BaseEnc, commit_layer) = bool_enc_client_commit_layer; OVERRIDE(BaseEnc, remove_layer) = bool_enc_client_remove_layer; }
void printer_anon_map_entry_init(PrinterNonAmbiguousDot_ptr self, const NuSMVEnv_ptr env, const char* name, int low, size_t num) { /* base class initialization */ printer_base_init(PRINTER_BASE(self), env, name, low, num, true); /* members initialization */ /* virtual methods settings */ OVERRIDE(Object, finalize) = printer_anon_map_entry_finalize; OVERRIDE(PrinterBase, print_node) = printer_anon_map_entry_print_node; }
void logic_recognizer_core_init(LogicRecognizerCore_ptr self, const NuSMVEnv_ptr env, const char* name, int low, size_t num) { /* base class initialization */ logic_recognizer_base_init(LOGIC_RECOGNIZER_BASE(self), env, name, low, num); /* members initialization */ /* virtual methods settings */ OVERRIDE(Object, finalize) = logic_recognizer_core_finalize; OVERRIDE(LogicRecognizerBase, recognize) = logic_recognizer_core_recognize; }
void trace_explainer_init(TraceExplainer_ptr self, boolean changes_only) { if (changes_only) { trace_plugin_init(TRACE_PLUGIN(self), "BASIC TRACE EXPLAINER - shows changes only"); } else { trace_plugin_init(TRACE_PLUGIN(self), "BASIC TRACE EXPLAINER - shows all variables"); } OVERRIDE(Object, finalize) = trace_explainer_finalize; OVERRIDE(TracePlugin, action) = trace_explainer_action; self->changes_only = changes_only; }
/**Function******************************************************************** Synopsis [The BDDPartialTraceExecutor class private initializer] Description [The BDDPartialTraceExecutor class private initializer] SideEffects [] SeeAlso [BDDPartialTraceExecutor_create] ******************************************************************************/ void bdd_partial_trace_executor_init(BDDPartialTraceExecutor_ptr self, const BddFsm_ptr fsm, const BddEnc_ptr enc) { /* base class initialization */ partial_trace_executor_init(PARTIAL_TRACE_EXECUTOR(self)); /* members initialization */ self->fsm = fsm; self->enc = enc; /* virtual methods settings */ OVERRIDE(Object, finalize) = bdd_partial_trace_executor_finalize; /* partial traces virtual execution method */ OVERRIDE(PartialTraceExecutor, execute) = bdd_partial_trace_executor_execute; }
void hrc_dumper_init(HrcDumper_ptr self, const NuSMVEnv_ptr env, FILE* fout) { /* base class initialization */ env_object_init(ENV_OBJECT(self), env); /* members initialization */ self->printer = MASTER_PRINTER(NuSMVEnv_get_value(env, ENV_WFF_PRINTER)); self->fout = fout; self->use_indentation = true; self->indent_pending = false; self->indent = 0; self->indent_size = HRC_DEFAULT_INDENT_SIZE; self->columns = HRC_DEFAULT_COLUMNS; self->use_mod_suffix = false; /* virtual methods settings */ OVERRIDE(Object, finalize) = hrc_dumper_finalize; OVERRIDE(HrcDumper, dump_snippet) = hrc_dumper_dump_snippet; OVERRIDE(HrcDumper, dump_comment) = hrc_dumper_dump_comment; OVERRIDE(HrcDumper, dump_header) = hrc_dumper_dump_header; OVERRIDE(HrcDumper, dump_node) = hrc_dumper_dump_node; }
static void g_calendar_gregorian_class_init (GCalendarGregorianClass *klass) /* IN */ { GCalendarClass *calendar_class = G_CALENDAR_CLASS(klass); #define OVERRIDE(_n) calendar_class->_n = g_calendar_gregorian_real_##_n OVERRIDE(get_year); OVERRIDE(get_month); OVERRIDE(get_day_of_month); OVERRIDE(get_day_of_week); OVERRIDE(get_day_of_year); OVERRIDE(get_hour); OVERRIDE(get_minute); OVERRIDE(get_second); OVERRIDE(is_leap_year); #undef OVERRIDE }
// // D_SetGameModeInfo // // Sets GameModeInfo, sets the missionInfo pointer, and then overrides any // data in GameModeInfo for which the missioninfo object has a replacement // value. This prevents checking for overrides throughout the source. // void D_SetGameModeInfo(GameMode_t mode, GameMission_t mission) { gamemodeinfo_t *gi; missioninfo_t *mi; GameModeInfo = gi = GameModeInfoObjects[mode]; // If gamemode == indetermined, change the id in the structure. // (We will be using object giDoomReg in that case). if(mode == indetermined) gi->id = indetermined; // set the missioninfo pointer gi->missionInfo = mi = MissionInfoObjects[mission]; // If gamemode == indetermined, we want to use the unknown gamemission // information to set overrides, but *not* to actually set the mission // information. Turns out the "none" value of gamemission has never // been used, and some code in the engine might crash if gamemission is // actually set to "none". if(mode == indetermined) mi = &gmUnknown; // apply overrides OVERRIDE(versionName, NULL); OVERRIDE(startupBanner, NULL); OVERRIDE(numEpisodes, 0); OVERRIDE(iwadPath, NULL); OVERRIDE(finaleData, NULL); OVERRIDE(menuBackground, NULL); OVERRIDE(creditBackground, NULL); OVERRIDE(consoleBack, NULL); OVERRIDE(interPic, NULL); OVERRIDE(exitRules, NULL); // Note: demostates are not overridden here, see below. }
// // D_InitGMIPostWads // // haleyjd 11/12/09: Conditionally applies missioninfo overrides which are // contingent upon the presence of certain lumps. This must be called after // W_InitMultipleFiles (and is done so immediately afterward), in order to // account for any PWADs loaded. // // 07/15/2012: Added runtime adjustment of blackIndex and whiteIndex. // void D_InitGMIPostWads(void) { AutoPalette pal(wGlobalDir); gamemodeinfo_t *gi = GameModeInfo; missioninfo_t *mi = gi->missionInfo; // apply the demoStates override from the missioninfo conditionally: // * if MI_DEMOIFDEMO4 is not set, then always override. // * if MI_DEMOIFDEMO4 IS set, then only if DEMO4 actually exists. if(!(mi->flags & MI_DEMOIFDEMO4) || W_CheckNumForName("DEMO4") >= 0) OVERRIDE(demoStates, NULL); GameModeInfo->blackIndex = V_FindBestColor(pal.get(), 0, 0, 0); GameModeInfo->whiteIndex = V_FindBestColor(pal.get(), 255, 255, 255); }
void simulate_state_init(SimulateState_ptr const self, DDMgr_ptr const dd_mgr, bdd_ptr const bdd, TraceLabel const trace_label) { /* base class initialization */ object_init(OBJECT(self)); /* members initialization */ self->dd_mgr = dd_mgr; self->bdd = bdd_dup(bdd); self->trace_label = trace_label; /* virtual methods settings */ OVERRIDE(Object, finalize) = simulate_state_finalize; }
/**Function******************************************************************** Synopsis [This function initializes the SatIncSolver class.] Description [] SideEffects [] SeeAlso [] ******************************************************************************/ void sat_inc_solver_init(SatIncSolver_ptr self, const char* name) { SAT_INC_SOLVER_CHECK_INSTANCE(self); sat_solver_init(SAT_SOLVER(self), name); OVERRIDE(Object, finalize) = sat_inc_solver_finalize; /* use default SatSolver pure-virtual functions */ OVERRIDE(SatIncSolver, create_group) = sat_inc_solver_create_group; OVERRIDE(SatIncSolver, destroy_group) = sat_inc_solver_destroy_group; OVERRIDE(SatIncSolver, move_to_permanent_and_destroy_group) = sat_inc_solver_move_to_permanent_and_destroy_group; OVERRIDE(SatIncSolver, solve_groups) = sat_inc_solver_solve_groups; OVERRIDE(SatIncSolver, solve_groups) = sat_inc_solver_solve_groups; OVERRIDE(SatIncSolver, solve_without_groups) = sat_inc_solver_solve_without_groups; /* inits members: */ }
// // D_SetGameModeInfo // // Sets GameModeInfo, sets the missionInfo pointer, and then overrides any // data in GameModeInfo for which the missioninfo object has a replacement // value. This prevents checking for overrides throughout the source. // void D_SetGameModeInfo(GameMode_t mode, GameMission_t mission) { gamemodeinfo_t *gi; missioninfo_t *mi; GameModeInfo = gi = GameModeInfoObjects[mode]; // If gamemode == indetermined, change the id in the structure. // (We will be using object giDoomReg in that case). if(mode == indetermined) gi->id = indetermined; // set the missioninfo pointer gi->missionInfo = mi = MissionInfoObjects[mission]; // If gamemode == indetermined, we want to use the unknown gamemission // information to set overrides, but *not* to actually set the mission // information. Turns out the "none" value of gamemission has never // been used, and some code in the engine might crash if gamemission is // actually set to "none". if(mode == indetermined) mi = &gmUnknown; // apply GameModeInfo flag additions and removals gi->flags |= mi->addGMIFlags; gi->flags &= ~mi->remGMIFlags; // apply overrides OVERRIDE(versionName, nullptr); OVERRIDE(startupBanner, nullptr); OVERRIDE(numEpisodes, 0); OVERRIDE(iwadPath, nullptr); OVERRIDE(finaleData, nullptr); OVERRIDE(menuBackground, nullptr); OVERRIDE(creditBackground, nullptr); OVERRIDE(interPic, nullptr); OVERRIDE(exitRules, nullptr); OVERRIDE(levelNames, nullptr); OVERRIDE(randMusMax, 0); OVERRIDE(skyData, nullptr); OVERRIDE(skyFlats, nullptr); OVERRIDE(pspriteGlobalScale, nullptr); // Note: demostates are not overridden here, see below. }
/** * Override for clutter.rectangle_new_with_color(). It allows to pass a * 4-element table (or 4 distinct number values) as a constructor for Color. * */ static int l_clutter_rectangle_new_with_color(lua_State *L) { if (lua_gettop(L) == 4) { ClutterColor *color = (ClutterColor*) g_malloc(sizeof(*color)); color->red = lua_tointeger(L, 1); color->green = lua_tointeger(L, 2); color->blue = lua_tointeger(L, 3); color->alpha = lua_tointeger(L, 4); lua_settop(L, 0); typespec_t ts = api->find_struct(L, "ClutterColor", 1); api->get_object(L, color, ts, 0); } else if (lua_istable(L, 1)) { printf("color as table not yet supported\n"); } return api->call_byname(L, thismodule, "clutter_rectangle_new_with_color"); } /* overrides for Clutter */ const luaL_reg clutter_overrides[] = { OVERRIDE(clutter_init), OVERRIDE(clutter_rectangle_new_with_color), { NULL, NULL} };
* This function actually frees the cairo state. * TODO arrange for the normal garbage collection to also use * cairo_destroy */ static int l_cairo_destroy(lua_State *L) { struct object *w = api->object_arg(L, 1, "cairo"); int rc = api->call_byname(L, &modinfo_cairo, "cairo_destroy"); api->invalidate_object(L, w); return rc; } const luaL_reg cairo_overrides[] = { OVERRIDE(cairo_destroy), { NULL, NULL } }; static int _cairo_handler(struct object *w, object_op op, int flags) { switch (op) { case WIDGET_SCORE:; const char *s = api->get_object_name(w); return strcmp(s, "cairo") ? 0 : 100; case WIDGET_UNREF: cairo_destroy(w->p); return 0; default: