void UI_execute_initialization() { /* * Initialization Function: init * Component: UI */ UI_init(); }
/* only called once, for startup */ void WM_init(bContext *C) { wm_ghost_init(C); /* note: it assigns C to ghost! */ wm_init_cursor_data(); wm_operatortype_init(); set_free_windowmanager_cb(wm_close_and_free); /* library.c */ set_blender_test_break_cb(wm_window_testbreak); /* blender.c */ DAG_editors_update_cb(ED_render_id_flush_update); /* depsgraph.c */ ED_spacetypes_init(); /* editors/space_api/spacetype.c */ ED_file_init(); /* for fsmenu */ ED_init_node_butfuncs(); BLF_init(11, U.dpi); BLF_lang_init(); init_builtin_keyingsets(); /* editors/animation/keyframing.c */ /* get the default database, plus a wm */ WM_read_homefile(C, NULL); wm_init_reports(C); /* reports cant be initialized before the wm */ GPU_extensions_init(); UI_init(); // clear_matcopybuf(); /* XXX */ // glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); // init_node_butfuncs(); ED_preview_init_dbase(); G.ndofdevice = -1; /* XXX bad initializer, needs set otherwise buttons show! */ read_Blog(); BLI_strncpy(G.lib, G.sce, FILE_MAX); }
/****************************************************************************** * uiSetup ******************************************************************************/ static UI_Handle uiSetup(Args *argsp) { UI_Attrs uiAttrs; UI_Handle hUI; /* Create the user interface */ uiAttrs.osd = argsp->osd; uiAttrs.videoStd = argsp->videoStd; uiAttrs.displayOutput = argsp->displayOutput; hUI = UI_create(&uiAttrs); if (hUI == NULL) { ERR("Failed to create UI\n"); return NULL; } /* Initialize values */ UI_updateValue(hUI, UI_Value_DemoName, "Encode"); UI_updateValue(hUI, UI_Value_DisplayType, argsp->videoStdString); if (argsp->videoEncoder) { UI_updateValue(hUI, UI_Value_VideoCodec, argsp->videoEncoder->uiString); } else { UI_updateValue(hUI, UI_Value_VideoCodec, "N/A"); } if (argsp->speechEncoder) { UI_updateValue(hUI, UI_Value_SoundCodec,argsp->speechEncoder->uiString); } else { UI_updateValue(hUI, UI_Value_SoundCodec, "N/A"); } UI_updateValue(hUI, UI_Value_ImageResolution, "N/A"); UI_updateValue(hUI, UI_Value_SoundFrequency, "N/A"); /* Initialize the user interface */ UI_init(hUI); return hUI; }
int main(int argc, char **argv) { GMainLoop *loop; loop = g_main_loop_new(NULL, FALSE); if(!loop) { fprintf(stderr, "Failed to create mainloop\n"); return -1; } if (control_tracing() < 0) return -1; data_dumped_init(NULL, MAX_EVENTS_STORAGE); UI_init(argc, argv, loop); printf("bluez-traffic %s\n", VERSION); g_main_loop_run(loop); return 0; }
/* only called once, for startup */ void WM_init(bContext *C, int argc, const char **argv) { if (!G.background) { wm_ghost_init(C); /* note: it assigns C to ghost! */ wm_init_cursor_data(); } GHOST_CreateSystemPaths(); BKE_addon_pref_type_init(); wm_operatortype_init(); wm_operatortypes_register(); WM_menutype_init(); WM_uilisttype_init(); ED_undosys_type_init(); BKE_library_callback_free_window_manager_set(wm_close_and_free); /* library.c */ BKE_library_callback_free_notifier_reference_set(WM_main_remove_notifier_reference); /* library.c */ BKE_library_callback_remap_editor_id_reference_set(WM_main_remap_editor_id_reference); /* library.c */ BKE_blender_callback_test_break_set(wm_window_testbreak); /* blender.c */ BKE_spacedata_callback_id_remap_set(ED_spacedata_id_remap); /* screen.c */ DAG_editors_update_cb(ED_render_id_flush_update, ED_render_scene_update, ED_render_scene_update_pre); /* depsgraph.c */ ED_spacetypes_init(); /* editors/space_api/spacetype.c */ ED_file_init(); /* for fsmenu */ ED_node_init_butfuncs(); BLF_init(); /* Please update source/gamengine/GamePlayer/GPG_ghost.cpp if you change this */ BLT_lang_init(); /* Must call first before doing any .blend file reading, since versionning code may create new IDs... See T57066. */ BLT_lang_set(NULL); /* reports cant be initialized before the wm, * but keep before file reading, since that may report errors */ wm_init_reports(C); /* get the default database, plus a wm */ wm_homefile_read(C, NULL, G.factory_startup, false, true, NULL, WM_init_state_app_template_get()); /* Call again to set from userpreferences... */ BLT_lang_set(NULL); if (!G.background) { #ifdef WITH_INPUT_NDOF /* sets 3D mouse deadzone */ WM_ndof_deadzone_set(U.ndof_deadzone); #endif GPU_init(); GPU_set_mipmap(G_MAIN, !(U.gameflags & USER_DISABLE_MIPMAP)); GPU_set_linear_mipmap(true); GPU_set_anisotropic(G_MAIN, U.anisotropic_filter); GPU_set_gpu_mipmapping(G_MAIN, U.use_gpu_mipmap); #ifdef WITH_OPENSUBDIV BKE_subsurf_osd_init(); #endif UI_init(); } else { /* Note: Currently only inits icons, which we now want in background mode too * (scripts could use those in background processing...). * In case we do more later, we may need to pass a 'background' flag. * Called from 'UI_init' above */ BKE_icons_init(1); } ED_spacemacros_init(); /* note: there is a bug where python needs initializing before loading the * startup.blend because it may contain PyDrivers. It also needs to be after * initializing space types and other internal data. * * However cant redo this at the moment. Solution is to load python * before wm_homefile_read() or make py-drivers check if python is running. * Will try fix when the crash can be repeated. - campbell. */ #ifdef WITH_PYTHON BPY_context_set(C); /* necessary evil */ BPY_python_start(argc, argv); BPY_python_reset(C); #else (void)argc; /* unused */ (void)argv; /* unused */ #endif if (!G.background && !wm_start_with_console) GHOST_toggleConsole(3); clear_matcopybuf(); ED_render_clear_mtex_copybuf(); // glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); wm_history_file_read(); /* allow a path of "", this is what happens when making a new file */ #if 0 if (BKE_main_blendfile_path_from_global()[0] == '\0') BLI_make_file_string("/", G_MAIN->name, BKE_appdir_folder_default(), "untitled.blend"); #endif BLI_strncpy(G.lib, BKE_main_blendfile_path_from_global(), sizeof(G.lib)); #ifdef WITH_COMPOSITOR if (1) { extern void *COM_linker_hack; COM_linker_hack = COM_execute; } #endif /* load last session, uses regular file reading so it has to be in end (after init py etc) */ if (U.uiflag2 & USER_KEEP_SESSION) { /* calling WM_recover_last_session(C, NULL) has been moved to creator.c */ /* that prevents loading both the kept session, and the file on the command line */ } else { Main *bmain = CTX_data_main(C); /* note, logic here is from wm_file_read_post, * call functions that depend on Python being initialized. */ /* normally 'wm_homefile_read' will do this, * however python is not initialized when called from this function. * * unlikely any handlers are set but its possible, * note that recovering the last session does its own callbacks. */ CTX_wm_window_set(C, CTX_wm_manager(C)->windows.first); BLI_callback_exec(bmain, NULL, BLI_CB_EVT_VERSION_UPDATE); BLI_callback_exec(bmain, NULL, BLI_CB_EVT_LOAD_POST); wm_file_read_report(C, bmain); if (!G.background) { CTX_wm_window_set(C, NULL); } } }
/* *------------------------------------------------------------------------------ * void main(void) * Summary : Application specifc main routine. Initializes all port and * : pheriperal and put the main task into an infinite loop. * * Input : None * * Output : None * *------------------------------------------------------------------------------ */ void main(void) { UINT8 i; #ifdef KEYPAD_TEST UINT8 scancode, duration; #endif BOARD_init(); TIMER0_init(TIMER0_RELOAD,0); LCD_init(); #ifdef TEST_LCD for(i = 0 ; i< 26; i++) { LCD_putChar(i+'A'); DelayMs(200); } LCD_clear(); #endif #ifdef TOWER_LAMP_TEST GREEN = 1; DelayMs(1000); GREEN = 0; YELLOW = 1; DelayMs(1000); YELLOW = 0; RED = 1; DelayMs(1000); RED = 0; BUZZER = 1; DelayMs(1000); BUZZER = 0; #endif KEYPAD_init(); UI_init(); //MUST BE DONE AFTER IAS INIT APP_init(); #ifdef __UART_TEST__ COM_txStr("IDEONICS ANDON TERMINAL "); #endif EnableInterrupts(); //DelayMs(3000); while(TRUE) { if( heartBeatCount >= 100 ) { HB_task(); heartBeatCount = 0; } if( keypadUpdateCount >= 8 ) { KEYPAD_task(); LinearKeyPad_scan( ); keypadUpdateCount = 0; } if( comUpdateCount >= 2 ) { MB_task(); //COM_task(); comUpdateCount = 0; } //ClrWdt(); if( appUpdateCount >= 50 ) { APP_task(); appUpdateCount = 0; } //ClrWdt(); #ifdef KEYPAD_TEST if( KEYPAD_read(&scancode, &duration) == TRUE ) LCD_putChar(scancode); #else if( uiUpdateCount >=40 ) { UI_task(); uiUpdateCount = 0; } #endif ClrWdt(); } }
/* only called once, for startup */ void WM_init(bContext *C, int argc, const char **argv) { if (!G.background) { wm_ghost_init(C); /* note: it assigns C to ghost! */ wm_init_cursor_data(); } GHOST_CreateSystemPaths(); BKE_addon_pref_type_init(); wm_operatortype_init(); WM_menutype_init(); WM_uilisttype_init(); set_free_windowmanager_cb(wm_close_and_free); /* library.c */ set_free_notifier_reference_cb(WM_main_remove_notifier_reference); /* library.c */ set_blender_test_break_cb(wm_window_testbreak); /* blender.c */ DAG_editors_update_cb(ED_render_id_flush_update, ED_render_scene_update); /* depsgraph.c */ ED_spacetypes_init(); /* editors/space_api/spacetype.c */ ED_file_init(); /* for fsmenu */ ED_node_init_butfuncs(); BLF_init(11, U.dpi); /* Please update source/gamengine/GamePlayer/GPG_ghost.cpp if you change this */ BLF_lang_init(); /* get the default database, plus a wm */ wm_homefile_read(C, NULL, G.factory_startup); BLF_lang_set(NULL); /* note: there is a bug where python needs initializing before loading the * startup.blend because it may contain PyDrivers. It also needs to be after * initializing space types and other internal data. * * However cant redo this at the moment. Solution is to load python * before wm_homefile_read() or make py-drivers check if python is running. * Will try fix when the crash can be repeated. - campbell. */ #ifdef WITH_PYTHON BPY_context_set(C); /* necessary evil */ BPY_python_start(argc, argv); BPY_python_reset(C); #else (void)argc; /* unused */ (void)argv; /* unused */ #endif if (!G.background && !wm_start_with_console) GHOST_toggleConsole(3); wm_init_reports(C); /* reports cant be initialized before the wm */ if (!G.background) { GPU_extensions_init(); GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP)); GPU_set_anisotropic(U.anisotropic_filter); GPU_set_gpu_mipmapping(U.use_gpu_mipmap); UI_init(); } clear_matcopybuf(); ED_render_clear_mtex_copybuf(); // glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); ED_preview_init_dbase(); wm_read_history(); /* allow a path of "", this is what happens when making a new file */ #if 0 if (G.main->name[0] == 0) BLI_make_file_string("/", G.main->name, BLI_getDefaultDocumentFolder(), "untitled.blend"); #endif BLI_strncpy(G.lib, G.main->name, FILE_MAX); #ifdef WITH_COMPOSITOR if (1) { extern void *COM_linker_hack; COM_linker_hack = COM_execute; } #endif /* load last session, uses regular file reading so it has to be in end (after init py etc) */ if (U.uiflag2 & USER_KEEP_SESSION) { /* calling WM_recover_last_session(C, NULL) has been moved to creator.c */ /* that prevents loading both the kept session, and the file on the command line */ } else { /* normally 'wm_homefile_read' will do this, * however python is not initialized when called from this function. * * unlikely any handlers are set but its possible, * note that recovering the last session does its own callbacks. */ BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST); } }
/* only called once, for startup */ void WM_init(bContext *C, int argc, const char **argv) { if (!G.background) { wm_ghost_init(C); /* note: it assigns C to ghost! */ wm_init_cursor_data(); } GHOST_CreateSystemPaths(); wm_operatortype_init(); WM_menutype_init(); set_free_windowmanager_cb(wm_close_and_free); /* library.c */ set_blender_test_break_cb(wm_window_testbreak); /* blender.c */ DAG_editors_update_cb(ED_render_id_flush_update); /* depsgraph.c */ ED_spacetypes_init(); /* editors/space_api/spacetype.c */ ED_file_init(); /* for fsmenu */ ED_init_node_butfuncs(); BLF_init(11, U.dpi); /* Please update source/gamengine/GamePlayer/GPG_ghost.cpp if you change this */ BLF_lang_init(); /* get the default database, plus a wm */ WM_read_homefile(C, NULL, G.factory_startup); BLF_lang_set(NULL); /* note: there is a bug where python needs initializing before loading the * startup.blend because it may contain PyDrivers. It also needs to be after * initializing space types and other internal data. * * However cant redo this at the moment. Solution is to load python * before WM_read_homefile() or make py-drivers check if python is running. * Will try fix when the crash can be repeated. - campbell. */ #ifdef WITH_PYTHON BPY_context_set(C); /* necessary evil */ BPY_python_start(argc, argv); BPY_driver_reset(); BPY_app_handlers_reset(); /* causes addon callbacks to be freed [#28068], * but this is actually what we want. */ BPY_modules_load_user(C); #else (void)argc; /* unused */ (void)argv; /* unused */ #endif if (!G.background && !wm_start_with_console) GHOST_toggleConsole(3); wm_init_reports(C); /* reports cant be initialized before the wm */ if (!G.background) { GPU_extensions_init(); GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP)); GPU_set_anisotropic(U.anisotropic_filter); UI_init(); } clear_matcopybuf(); ED_render_clear_mtex_copybuf(); // glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); ED_preview_init_dbase(); WM_read_history(); /* allow a path of "", this is what happens when making a new file */ /* if(G.main->name[0] == 0) BLI_make_file_string("/", G.main->name, BLI_getDefaultDocumentFolder(), "untitled.blend"); */ BLI_strncpy(G.lib, G.main->name, FILE_MAX); }
/* *------------------------------------------------------------------------------ * void main(void) * Summary : Application specifc main routine. Initializes all port and * : pheriperal and put the main task into an infinite loop. * * Input : None * * Output : None * *------------------------------------------------------------------------------ */ void main(void) { UINT8 i; volatile UINT16 StartupDelay = 0 ; #ifdef KEYPAD_TEST UINT8 scancode, duration; #endif BOARD_init(); TIMER0_init(TIMER0_RELOAD,0); LCD_init(); for(i = 0 ; i< strlen(DeviceTag); i++) { LCD_putChar(DeviceTag[i]); //DelayMs(200); } //LCD_clear(); #ifdef TOWER_LAMP_TEST GREEN = 1; DelayMs(1000); GREEN = 0; YELLOW = 1; DelayMs(1000); YELLOW = 0; RED = 1; DelayMs(1000); RED = 0; BUZZER = 1; DelayMs(1000); BUZZER = 0; #endif KEYPAD_init(); UI_init(); //MUST BE DONE AFTER IAS INIT APP_init(); #ifdef __UART_TEST__ COM_txStr(DeviceTag); #endif EnableInterrupts(); //DelayMs(3000); while(TRUE) { if( heartBeatCount >= 100 ) { HB_task(); heartBeatCount = 0; if(StartupDelay <= STARTDELAY_TIME) StartupDelay++; } if( keypadUpdateCount >= 8 ) { if(StartupDelay >= STARTDELAY_TIME) { KEYPAD_task(); keypadUpdateCount = 0; } } if( comUpdateCount >= 2 ) { COM_task(); comUpdateCount = 0; } //ClrWdt(); if( appUpdateCount >= 100 ) { APP_task(); appUpdateCount = 0; } //ClrWdt(); #ifdef KEYPAD_TEST if( KEYPAD_read(&scancode, &duration) == TRUE ) LCD_putChar(scancode); #else if( uiUpdateCount >=40) { UI_task(); uiUpdateCount = 0; } #endif ClrWdt(); } }