Blender V2.61 - r43446
|
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>
#include <fcntl.h>
#include "MEM_guardedalloc.h"
#include "DNA_userdef_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_sequence_types.h"
#include "DNA_sound_types.h"
#include "BLI_blenlib.h"
#include "BLI_bpath.h"
#include "BLI_dynstr.h"
#include "BLI_utildefines.h"
#include "BLI_callbacks.h"
#include "IMB_imbuf.h"
#include "IMB_moviecache.h"
#include "BKE_blender.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_displist.h"
#include "BKE_global.h"
#include "BKE_idprop.h"
#include "BKE_ipo.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_node.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BKE_sequencer.h"
#include "BKE_sound.h"
#include "BLO_undofile.h"
#include "BLO_readfile.h"
#include "BLO_writefile.h"
#include "BKE_utildefines.h"
#include "RNA_access.h"
#include "WM_api.h"
Go to the source code of this file.
Classes | |
struct | UndoElem |
Defines | |
#define | UNDO_DISK 0 |
#define | MAXUNDONAME 64 |
Typedefs | |
typedef struct UndoElem | UndoElem |
Functions | |
void | free_blender (void) |
void | initglobals (void) |
static void | clear_global (void) |
static int | clean_paths_visit_cb (void *UNUSED(userdata), char *path_dst, const char *path_src) |
static void | clean_paths (Main *main) |
static void | setup_app_data (bContext *C, BlendFileData *bfd, const char *filepath) |
static int | handle_subversion_warning (Main *main, ReportList *reports) |
static void | keymap_item_free (wmKeyMapItem *kmi) |
void | BKE_userdef_free (void) |
int | BKE_read_file (bContext *C, const char *filepath, ReportList *reports) |
int | BKE_read_file_from_memory (bContext *C, char *filebuf, int filelength, ReportList *reports) |
int | BKE_read_file_from_memfile (bContext *C, MemFile *memfile, ReportList *reports) |
void | set_blender_test_break_cb (void(*func)(void)) |
int | blender_test_break (void) |
static int | read_undosave (bContext *C, UndoElem *uel) |
void | BKE_write_undo (bContext *C, const char *name) |
void | BKE_undo_step (bContext *C, int step) |
void | BKE_reset_undo (void) |
void | BKE_undo_number (bContext *C, int nr) |
void | BKE_undo_name (bContext *C, const char *name) |
int | BKE_undo_valid (const char *name) |
const char * | BKE_undo_get_name (int nr, int *active) |
char * | BKE_undo_menu_string (void) |
void | BKE_undo_save_quit (void) |
Main * | BKE_undo_get_main (Scene **scene) |
Variables | |
Global | G |
UserDef | U |
char | versionstr [48] = "" |
static void(* | blender_test_break_cb )(void) = NULL |
static ListBase | undobase = {NULL, NULL} |
static UndoElem * | curundo = NULL |
Definition in file blender.c.
#define UNDO_DISK 0 |
Definition at line 449 of file blender.c.
Referenced by BKE_write_undo(), and read_undosave().
int BKE_read_file | ( | bContext * | C, |
const char * | filepath, | ||
ReportList * | reports | ||
) |
Definition at line 371 of file blender.c.
References BKE_READ_FILE_FAIL, BKE_READ_FILE_OK, BKE_READ_FILE_OK_USERPREFS, BKE_reports_prependf(), BLENDER_STARTUP_FILE, BLO_read_from_file(), free_main(), handle_subversion_warning(), BlendFileData::main, MEM_freeN(), NULL, setup_app_data(), and BlendFileData::user.
Referenced by load_file(), read_undosave(), WM_read_file(), and WM_read_homefile().
int BKE_read_file_from_memfile | ( | bContext * | C, |
MemFile * | memfile, | ||
ReportList * | reports | ||
) |
Definition at line 412 of file blender.c.
References BKE_reports_prepend(), BLO_read_from_memfile(), CTX_data_main(), Global::main, Main::name, and setup_app_data().
Referenced by read_undosave().
int BKE_read_file_from_memory | ( | bContext * | C, |
char * | filebuf, | ||
int | filelength, | ||
ReportList * | reports | ||
) |
Definition at line 398 of file blender.c.
References BKE_reports_prepend(), BLO_read_from_memory(), and setup_app_data().
Referenced by WM_read_homefile().
void BKE_reset_undo | ( | void | ) |
Definition at line 621 of file blender.c.
References BLI_freelistN(), BLO_free_memfile(), ListBase::first, UndoElem::memfile, UndoElem::next, and NULL.
Referenced by WM_exit_ext(), WM_read_file(), and WM_read_homefile().
Definition at line 739 of file blender.c.
References BLO_read_from_memfile(), BlendFileData::curscene, Global::main, BlendFileData::main, MEM_freeN(), UndoElem::memfile, Main::name, and NULL.
Referenced by screen_render_invoke().
const char* BKE_undo_get_name | ( | int | nr, |
int * | active | ||
) |
Definition at line 666 of file blender.c.
References BLI_findlink(), UndoElem::name, and NULL.
Referenced by rna_undo_itemf().
char* BKE_undo_menu_string | ( | void | ) |
Definition at line 680 of file blender.c.
References BLI_dynstr_append(), BLI_dynstr_free(), BLI_dynstr_get_cstring(), BLI_dynstr_new(), ListBase::first, UndoElem::name, and UndoElem::next.
void BKE_undo_name | ( | bContext * | C, |
const char * | name | ||
) |
Definition at line 643 of file blender.c.
References BKE_undo_step(), BLI_rfindstring(), and UndoElem::prev.
Referenced by ed_undo_step().
void BKE_undo_number | ( | bContext * | C, |
int | nr | ||
) |
Definition at line 636 of file blender.c.
References BKE_undo_step(), and BLI_findlink().
Referenced by undo_history_exec().
void BKE_undo_save_quit | ( | void | ) |
Definition at line 700 of file blender.c.
References BLI_make_file_string(), BLI_temporary_dir(), MemFileChunk::buf, MemFile::chunks, curundo, FILE_MAX, ListBase::first, ListBase::last, UndoElem::memfile, MemFileChunk::next, NULL, O_BINARY, MemFileChunk::size, str, UserDef::uiflag, USER_GLOBALUNDO, and io_export_cycles_xml::write().
Referenced by WM_exit_ext().
void BKE_undo_step | ( | bContext * | C, |
int | step | ||
) |
Definition at line 593 of file blender.c.
References Global::f, G_DEBUG, UndoElem::name, UndoElem::next, NULL, UndoElem::prev, and read_undosave().
Referenced by BKE_undo_name(), BKE_undo_number(), and ed_undo_step().
int BKE_undo_valid | ( | const char * | name | ) |
Definition at line 654 of file blender.c.
References BLI_rfindstring(), ListBase::first, ListBase::last, and UndoElem::prev.
Referenced by ED_undo_valid().
void BKE_userdef_free | ( | void | ) |
Definition at line 339 of file blender.c.
References wmKeyMapDiffItem::add_item, UserDef::addons, BLI_freelistN(), wmKeyMap::diff_items, ListBase::first, wmKeyMap::items, keymap_item_free(), MEM_freeN(), wmKeyMap::next, wmKeyMapDiffItem::next, wmKeyMapItem::next, wmKeyMapDiffItem::remove_item, UserDef::themes, UserDef::uifonts, UserDef::uistyles, and UserDef::user_keymaps.
Referenced by setup_app_data(), and WM_exit_ext().
void BKE_write_undo | ( | bContext * | C, |
const char * | name | ||
) |
Definition at line 495 of file blender.c.
References BLI_addtail(), BLI_make_file_string(), BLI_remlink(), BLI_snprintf(), BLI_strncpy(), BLI_temporary_dir(), BLO_free_memfile(), BLO_merge_memfile(), BLO_write_file(), BLO_write_file_mem(), CTX_data_main(), FILE_MAX, Global::fileflags, ListBase::first, G_FILE_HISTORY, ListBase::last, MEM_callocN(), MEM_freeN(), MEM_get_memory_in_use(), UndoElem::memfile, UndoElem::name, UndoElem::next, NULL, UndoElem::prev, UndoElem::str, UserDef::uiflag, UNDO_DISK, UserDef::undomemory, UndoElem::undosize, UserDef::undosteps, and USER_GLOBALUNDO.
Referenced by ED_undo_push(), WM_read_file(), and WM_read_homefile().
int blender_test_break | ( | void | ) |
Definition at line 436 of file blender.c.
References Global::afbreek, Global::background, and blender_test_break_cb.
Referenced by bake_image_exec(), BKE_ptcache_bake(), dynamicPaint_bakeImageSequence(), and screen_render_exec().
static void clean_paths | ( | Main * | main | ) | [static] |
Definition at line 171 of file blender.c.
References BLI_clean(), bpath_traverse_main(), BPATH_TRAVERSE_SKIP_MULTIFILE, clean_paths_visit_cb(), ListBase::first, Scene::id, ID::next, NULL, RenderData::pic, Scene::r, and Main::scene.
Referenced by setup_app_data().
static int clean_paths_visit_cb | ( | void * | UNUSEDuserdata, |
char * | path_dst, | ||
const char * | path_src | ||
) | [static] |
Definition at line 163 of file blender.c.
References BLI_clean(), FALSE, and TRUE.
Referenced by clean_paths().
static void clear_global | ( | void | ) | [static] |
Definition at line 152 of file blender.c.
References free_main(), Global::main, and NULL.
Referenced by setup_app_data().
void free_blender | ( | void | ) |
Definition at line 102 of file blender.c.
References BKE_spacetypes_free(), BLI_cb_finalize(), free_main(), free_nodesystem(), IMB_exit(), IMB_moviecache_destruct(), Global::main, NULL, and seq_stripelem_cache_destruct().
Referenced by WM_exit_ext().
static int handle_subversion_warning | ( | Main * | main, |
ReportList * | reports | ||
) | [static] |
Definition at line 318 of file blender.c.
References BKE_reportf(), BLENDER_SUBVERSION, BLENDER_VERSION, Main::minsubversionfile, Main::minversionfile, and RPT_ERROR.
Referenced by BKE_read_file().
void initglobals | ( | void | ) |
Definition at line 120 of file blender.c.
References BLENDER_SUBVERSION, BLENDER_VERSION, BLI_snprintf(), Global::charmax, Global::charmin, Global::charstart, Global::f, G_SCRIPT_AUTOEXEC, G_WINDOWSTATE_USERDEF, Global::ima, Global::main, MEM_callocN(), UserDef::savetime, versionstr, and Global::windowstate.
Referenced by main().
static void keymap_item_free | ( | wmKeyMapItem * | kmi | ) | [static] |
Definition at line 329 of file blender.c.
References IDP_FreeProperty(), MEM_freeN(), wmKeyMapItem::properties, and wmKeyMapItem::ptr.
Referenced by BKE_userdef_free().
Definition at line 464 of file blender.c.
References BKE_read_file(), BKE_READ_FILE_FAIL, BKE_read_file_from_memfile(), BLI_strncpy(), CTX_wm_manager(), DAG_on_visible_update(), FALSE, Global::fileflags, G_FILE_NO_UI, Global::main, UndoElem::memfile, Main::name, NULL, UndoElem::str, UNDO_DISK, and WM_jobs_stop_all().
Referenced by BKE_undo_step().
void set_blender_test_break_cb | ( | void(*)(void) | func | ) |
Definition at line 430 of file blender.c.
References blender_test_break_cb.
Referenced by WM_init().
static void setup_app_data | ( | bContext * | C, |
BlendFileData * | bfd, | ||
const char * | filepath | ||
) | [static] |
Definition at line 188 of file blender.c.
References Global::background, BKE_userdef_free(), BLI_strncpy(), clean_paths(), clear_global(), CTX_data_main_set(), CTX_data_scene(), CTX_data_scene_set(), CTX_wm_area_set(), CTX_wm_manager_set(), CTX_wm_menu_set(), CTX_wm_region_set(), CTX_wm_screen(), CTX_wm_screen_set(), BlendFileData::curscene, BlendFileData::curscreen, BlendFileData::displaymode, Global::displaymode, do_versions_ipos_to_animato(), Global::f, FILE_MAX, BlendFileData::fileflags, Global::fileflags, BlendFileData::filename, ListBase::first, G_DEBUG, G_FILE_NO_UI, G_FILE_RECOVER, G_SCRIPT_AUTOEXEC, G_SCRIPT_OVERRIDE_PREF, G_SWAP_EXCHANGE, BlendFileData::globalf, lib_link_screen_restore(), Global::main, BlendFileData::main, MEM_freeN(), Main::name, NULL, Global::relbase_valid, RNA_property_update_cache_free(), Main::scene, bScreen::scene, Main::screen, Main::script, set_scene_bg(), sound_init_main(), SWAP, BlendFileData::user, Main::versionfile, Global::winpos, BlendFileData::winpos, and Main::wm.
Referenced by BKE_read_file(), BKE_read_file_from_memfile(), and BKE_read_file_from_memory().
void(* blender_test_break_cb)(void) = NULL [static] |
Definition at line 428 of file blender.c.
Referenced by blender_test_break(), and set_blender_test_break_cb().
Definition at line 461 of file blender.c.
Referenced by BKE_undo_save_quit().
Definition at line 94 of file blender.c.
Referenced by add_empty_text(), add_named_exec(), add_primitive_bone(), add_scene(), add_text(), ANIM_timecode_string_from_frame(), armature_bone_primitive_add_exec(), assign_material(), attach_ndof_data(), axis_set_view(), BIF_do_manipulator(), BIF_draw_manipulator(), blf_glyph_add(), BLF_translate_iface(), BLF_translate_tooltips(), button_activate_state(), button_tooltip_timer_reset(), clip_draw_curfra_label(), SubdAccBuilder::computeEdgeStencil(), console_scrollback_limit(), btGjkEpaSolver2::Distance(), do_history(), do_versions(), draw_depth(), draw_fcurve_curve(), draw_group_socket(), draw_image_seq(), draw_manipulator_rotate(), draw_manipulator_rotate_cyl(), draw_manipulator_scale(), draw_manipulator_translate(), draw_marker_texts(), draw_object(), draw_selected_name(), draw_view_axis(), drawcentercircle(), drawlamp(), duplicate_exec(), ED_fileselect_set_params(), ED_object_add_generic_get_opts(), ED_refresh_viewport_fps(), ED_screen_set_scene(), ED_spacetypes_init(), ED_undo_push(), ed_undo_step(), ED_undo_valid(), ED_view3d_camera_lock_sync(), gjkepa2_impl::GJK::EncloseOrigin(), GregoryTrianglePatch::eval(), GregoryQuadPatch::eval(), gjkepa2_impl::EPA::Evaluate(), gjkepa2_impl::GJK::Evaluate(), ewa_eval(), gjkepa2_impl::EPA::expand(), DocumentExporter::exportCurrentScene(), file_browse_invoke(), file_panel_recent(), flyApply_ndof(), free_old_images(), get_undo_system(), gp_stroke_simplify(), gp_stroke_smooth(), gpencil_draw_init(), GPU_buffer_legacy(), GPU_build_grid_buffers(), GPU_build_mesh_buffers(), GPU_default_lights(), gpu_set_alpha_blend(), MTRand::hash(), id_search_cb(), IDnames_to_dyn_pupstring(), image_open_invoke(), image_view_ndof_invoke(), IMB_isanim(), IMB_ispic(), ColorBlock::init(), init_userdef_do_versions(), initFlyInfo(), gjkepa2_impl::EPA::Initialize(), initTransInfo(), insert_vert_fcurve(), is_pow2_limit(), main(), DirectDrawSurface::mipmap(), ndof_orbit_invoke(), ndof_pan_invoke(), node_draw_group(), node_draw_hidden(), node_update_group(), object_add_generic_invoke_options(), open_invoke(), open_set_load_ui(), outliner_build_tree(), p_chart_convex_hull(), paint_draw_alpha_overlay(), PE_undo_push(), btGjkEpaSolver2::Penetration(), project_paint_end(), gjkepa2_impl::GJK::projectorigin(), pseudoinverse_m4_m4(), rna_ensure_property_description(), rna_ensure_property_name(), RNA_property_enum_items_gettexted(), save_set_compress(), screen_opengl_render_end(), screen_opengl_render_init(), screenshot_startjob(), set_3dcursor_invoke(), btGjkEpaSolver2::SignedDistance(), sk_stroke_filtermval(), smaller_pow2_limit(), smooth_view(), StartKetsjiShell(), KDL::svd_eigen_HH(), text_keymap(), text_scroll_exec(), texture_paint_toggle_exec(), ui_but_start_drag(), UI_GetStyle(), UI_GetTheme(), ui_is_a_warp_but(), ui_numedit_but_HSVCIRCLE(), UI_SetTheme(), ui_theme_init_default(), ui_tooltip_create(), UI_view2d_grid_calc(), UI_view2d_grid_draw(), uiBlockFlipOrder(), uiBlockPicker(), uifont_to_blfont(), uiStyleFontSet(), uiStyleInit(), undo_editmode_push(), undo_stack_push_begin(), undo_stack_push_end(), view3d_main_area_draw_info(), view3d_main_area_draw_objects(), view3d_new(), view_editmove(), view_zoom_inout_invoke(), view_zoom_mouseloc(), view_zoomdrag_apply(), view_zoomdrag_invoke(), view_zoomdrag_modal(), view_zoomin_invoke(), view_zoomout_invoke(), view_zoomstep_apply(), viewdolly_apply(), viewdolly_exec(), viewdolly_invoke(), viewdolly_modal(), viewops_data_create(), vieworbit_exec(), viewrotate_apply(), viewrotate_invoke(), viewzoom_apply(), viewzoom_invoke(), viewzoom_modal(), wm_autosave_delete(), WM_autosave_init(), wm_autosave_timer(), wm_block_create_splash(), WM_cursor_set(), wm_draw_update(), wm_eventemulation(), wm_gesture_evaluate(), wm_handlers_do(), WM_init(), WM_init_splash(), wm_init_userdef(), WM_keyconfig_active(), WM_keyconfig_remove(), WM_keyconfig_set_active(), WM_keyconfig_update(), WM_keymap_restore_to_default(), wm_macro_modal(), WM_modal_tweak_exit(), wm_ndof_sensitivity_exec(), wm_operator_invoke(), WM_read_history(), WM_read_homefile(), WM_userdef_event_map(), WM_write_file(), write_history(), write_previews(), and write_userdef().
Definition at line 460 of file blender.c.
Referenced by undoCurve_to_editCurve().
char versionstr[48] = "" |
Definition at line 97 of file blender.c.
Referenced by initglobals(), and stats_string().