Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-05-05 18:52:04 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-05 18:52:04 +0400
commit34b18fcbc18c6d89a1a1516d19c489994e4964dc (patch)
tree2b53d4290e09ecb04762a1efc07d8553449faf11 /source
parent299ff91ea1fe5623bea1c6775cb8250d5e4ec3a0 (diff)
code cleanup: BKE_ naming, also make bpy.data.images.load() always load a new image. (not use existing one)
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_font.h14
-rw-r--r--source/blender/blenkernel/BKE_image.h6
-rw-r--r--source/blender/blenkernel/BKE_text.h10
-rw-r--r--source/blender/blenkernel/intern/anim.c2
-rw-r--r--source/blender/blenkernel/intern/curve.c2
-rw-r--r--source/blender/blenkernel/intern/displist.c2
-rw-r--r--source/blender/blenkernel/intern/font.c20
-rw-r--r--source/blender/blenkernel/intern/image.c63
-rw-r--r--source/blender/blenkernel/intern/library.c2
-rw-r--r--source/blender/blenkernel/intern/text.c10
-rw-r--r--source/blender/blenlib/intern/freetypefont.c2
-rw-r--r--source/blender/blenloader/intern/readfile.c2
-rw-r--r--source/blender/collada/DocumentImporter.cpp2
-rw-r--r--source/blender/editors/curve/editfont.c22
-rw-r--r--source/blender/editors/interface/interface_ops.c6
-rw-r--r--source/blender/editors/mesh/mesh_data.c2
-rw-r--r--source/blender/editors/object/object_edit.c2
-rw-r--r--source/blender/editors/render/render_shading.c2
-rw-r--r--source/blender/editors/space_image/image_ops.c2
-rw-r--r--source/blender/editors/space_node/node_edit.c2
-rw-r--r--source/blender/editors/space_text/text_ops.c6
-rw-r--r--source/blender/editors/space_view3d/drawobject.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c2
-rw-r--r--source/blender/makesrna/intern/rna_ID.c2
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c8
-rw-r--r--source/blender/makesrna/intern/rna_text_api.c4
-rw-r--r--source/blender/windowmanager/intern/wm_files.c2
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c2
-rw-r--r--source/creator/creator.c2
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp2
30 files changed, 109 insertions, 98 deletions
diff --git a/source/blender/blenkernel/BKE_font.h b/source/blender/blenkernel/BKE_font.h
index 640a70a8e87..6636a70e94d 100644
--- a/source/blender/blenkernel/BKE_font.h
+++ b/source/blender/blenkernel/BKE_font.h
@@ -71,17 +71,17 @@ typedef struct EditFont {
} EditFont;
-void BKE_font_register_builtin(void *mem, int size);
+void BKE_vfont_builtin_register(void *mem, int size);
void BKE_vfont_free(struct VFont *sc);
-void free_ttfont(void);
-struct VFont *get_builtin_font(void);
-struct VFont *load_vfont(struct Main *bmain, const char *name);
-struct TmpFont *vfont_find_tmpfont(struct VFont *vfont);
+void BKE_vfont_free_global_ttf(void);
+struct VFont *BKE_vfont_builtin_get(void);
+struct VFont *BKE_vfont_load(struct Main *bmain, const char *name);
+struct TmpFont *BKE_vfont_find_tmpfont(struct VFont *vfont);
-struct chartrans *BKE_text_to_curve(struct Main *bmain, struct Scene *scene, struct Object *ob, int mode);
+struct chartrans *BKE_vfont_to_curve(struct Main *bmain, struct Scene *scene, struct Object *ob, int mode);
-int BKE_font_getselection(struct Object *ob, int *start, int *end);
+int BKE_vfont_select_get(struct Object *ob, int *start, int *end);
#ifdef __cplusplus
}
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h
index 637b57af0bc..d9a656a8a40 100644
--- a/source/blender/blenkernel/BKE_image.h
+++ b/source/blender/blenkernel/BKE_image.h
@@ -74,7 +74,7 @@ struct anim *openanim(const char *name, int flags, int streamindex);
void image_de_interlace(struct Image *ima, int odd);
-void make_local_image(struct Image *ima);
+void BKE_image_make_local(struct Image *ima);
void tag_image_time(struct Image *ima);
void free_old_images(void);
@@ -130,8 +130,10 @@ struct ImBuf *BKE_image_get_ibuf(struct Image *ima, struct ImageUser *iuser);
struct ImBuf *BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **lock_r);
void BKE_image_release_ibuf(struct Image *ima, void *lock);
+/* returns a new image or NULL if it can't load */
+struct Image *BKE_image_load(const char *filepath);
/* returns existing Image when filename/type is same (frame optional) */
-struct Image *BKE_add_image_file(const char *name);
+struct Image *BKE_image_load_exists(const char *filepath);
/* adds image, adds ibuf, generates color or pattern */
struct Image *BKE_add_image_size(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short uvtestgrid, float color[4]);
diff --git a/source/blender/blenkernel/BKE_text.h b/source/blender/blenkernel/BKE_text.h
index 4b033557026..875903f2e20 100644
--- a/source/blender/blenkernel/BKE_text.h
+++ b/source/blender/blenkernel/BKE_text.h
@@ -45,14 +45,14 @@ struct SpaceText;
void BKE_text_free (struct Text *text);
void txt_set_undostate (int u);
int txt_get_undostate (void);
-struct Text* add_empty_text (const char *name);
+struct Text* BKE_text_add (const char *name);
int txt_extended_ascii_as_utf8(char **str);
-int reopen_text (struct Text *text);
-struct Text* add_text (const char *file, const char *relpath);
+int BKE_text_reload (struct Text *text);
+struct Text* BKE_text_load (const char *file, const char *relpath);
struct Text* BKE_text_copy (struct Text *ta);
void BKE_text_unlink (struct Main *bmain, struct Text *text);
-void clear_text(struct Text *text);
-void write_text(struct Text *text, const char *str);
+void BKE_text_clear (struct Text *text);
+void BKE_text_write (struct Text *text, const char *str);
char* txt_to_buf (struct Text *text);
void txt_clean_text (struct Text *text);
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 96e962bc3d3..1d05ecca909 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -1545,7 +1545,7 @@ static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int level, i
/* in par the family name is stored, use this to find the other objects */
- chartransdata= BKE_text_to_curve(G.main, scene, par, FO_DUPLI);
+ chartransdata= BKE_vfont_to_curve(G.main, scene, par, FO_DUPLI);
if (chartransdata==NULL) return;
cu= par->data;
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 04a2eef5615..bfefc1f0cd9 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -175,7 +175,7 @@ Curve *BKE_curve_add(const char *name, int type)
cu->bb= BKE_boundbox_alloc_unit();
if (type==OB_FONT) {
- cu->vfont= cu->vfontb= cu->vfonti= cu->vfontbi= get_builtin_font();
+ cu->vfont= cu->vfontb= cu->vfonti= cu->vfontbi= BKE_vfont_builtin_get();
cu->vfont->id.us+=4;
cu->str= MEM_mallocN(12, "str");
BLI_strncpy(cu->str, "Text", 12);
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index 60f060d154e..ebcebaedd2d 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -1271,7 +1271,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
if (cu->path) free_path(cu->path);
cu->path= NULL;
- if (ob->type==OB_FONT) BKE_text_to_curve(G.main, scene, ob, 0);
+ if (ob->type==OB_FONT) BKE_vfont_to_curve(G.main, scene, ob, 0);
if (!forOrco) curve_calc_modifiers_pre(scene, ob, forRender, &originalVerts, &deformedVerts, &numVerts);
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 03a1298a053..fa57cc7ce44 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -93,7 +93,7 @@ void BKE_vfont_free(struct VFont *vf)
static void *builtin_font_data= NULL;
static int builtin_font_size= 0;
-void BKE_font_register_builtin(void *mem, int size)
+void BKE_vfont_builtin_register(void *mem, int size)
{
builtin_font_data= mem;
builtin_font_size= size;
@@ -115,7 +115,7 @@ static PackedFile *get_builtin_packedfile(void)
}
}
-void free_ttfont(void)
+void BKE_vfont_free_global_ttf(void)
{
struct TmpFont *tf;
@@ -127,7 +127,7 @@ void free_ttfont(void)
BLI_freelistN(&ttfdata);
}
-struct TmpFont *vfont_find_tmpfont(VFont *vfont)
+struct TmpFont *BKE_vfont_find_tmpfont(VFont *vfont)
{
struct TmpFont *tmpfnt = NULL;
@@ -151,7 +151,7 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont)
if (vfont==NULL) return NULL;
// Try finding the font from font list
- tmpfnt = vfont_find_tmpfont(vfont);
+ tmpfnt = BKE_vfont_find_tmpfont(vfont);
// And then set the data
if (!vfont->data) {
@@ -210,7 +210,7 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont)
return vfont->data;
}
-VFont *load_vfont(Main *bmain, const char *name)
+VFont *BKE_vfont_load(Main *bmain, const char *name)
{
char filename[FILE_MAXFILE];
VFont *vfont= NULL;
@@ -290,7 +290,7 @@ static VFont *which_vfont(Curve *cu, CharInfo *info)
}
}
-VFont *get_builtin_font(void)
+VFont *BKE_vfont_builtin_get(void)
{
VFont *vf;
@@ -298,7 +298,7 @@ VFont *get_builtin_font(void)
if (strcmp(vf->name, FO_BUILTIN_NAME)==0)
return vf;
- return load_vfont(G.main, FO_BUILTIN_NAME);
+ return BKE_vfont_load(G.main, FO_BUILTIN_NAME);
}
static VChar *find_vfont_char(VFontData *vfd, intptr_t character)
@@ -487,7 +487,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
}
}
-int BKE_font_getselection(Object *ob, int *start, int *end)
+int BKE_vfont_select_get(Object *ob, int *start, int *end)
{
Curve *cu= ob->data;
@@ -520,7 +520,7 @@ static float char_width(Curve *cu, VChar *che, CharInfo *info)
}
}
-struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int mode)
+struct chartrans *BKE_vfont_to_curve(Main *bmain, Scene *scene, Object *ob, int mode)
{
VFont *vfont, *oldvfont;
VFontData *vfd= NULL;
@@ -605,7 +605,7 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
if (cu->selboxes) MEM_freeN(cu->selboxes);
cu->selboxes = NULL;
- if (BKE_font_getselection(ob, &selstart, &selend))
+ if (BKE_vfont_select_get(ob, &selstart, &selend))
cu->selboxes = MEM_callocN((selend-selstart+1)*sizeof(SelBox), "font selboxes");
tb = &(cu->tb[0]);
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 8262e8722c6..1690ad9e3aa 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -327,7 +327,7 @@ static void extern_local_image(Image *UNUSED(ima))
* match id_make_local pattern. */
}
-void make_local_image(struct Image *ima)
+void BKE_image_make_local(struct Image *ima)
{
Main *bmain= G.main;
Tex *tex;
@@ -505,26 +505,48 @@ void BKE_image_merge(Image *dest, Image *source)
}
}
-
-/* checks if image was already loaded, then returns same image */
-/* otherwise creates new. */
-/* does not load ibuf itself */
-/* pass on optional frame for #name images */
-Image *BKE_add_image_file(const char *name)
+Image *BKE_image_load(const char *filepath)
{
Image *ima;
int file, len;
const char *libname;
- char str[FILE_MAX], strtest[FILE_MAX];
-
- BLI_strncpy(str, name, sizeof(str));
+ char str[FILE_MAX];
+
+ BLI_strncpy(str, filepath, sizeof(str));
BLI_path_abs(str, G.main->name);
-
+
/* exists? */
file= BLI_open(str, O_BINARY|O_RDONLY, 0);
if (file== -1) return NULL;
close(file);
+
+ /* create a short library name */
+ len= strlen(filepath);
+
+ while (len > 0 && filepath[len - 1] != '/' && filepath[len - 1] != '\\') len--;
+ libname= filepath+len;
+
+ ima= image_alloc(libname, IMA_SRC_FILE, IMA_TYPE_IMAGE);
+ BLI_strncpy(ima->name, filepath, sizeof(ima->name));
+
+ if (BLI_testextensie_array(filepath, imb_ext_movie))
+ ima->source= IMA_SRC_MOVIE;
+
+ return ima;
+}
+
+/* checks if image was already loaded, then returns same image */
+/* otherwise creates new. */
+/* does not load ibuf itself */
+/* pass on optional frame for #name images */
+Image *BKE_image_load_exists(const char *filepath)
+{
+ Image *ima;
+ char str[FILE_MAX], strtest[FILE_MAX];
+ BLI_strncpy(str, filepath, sizeof(str));
+ BLI_path_abs(str, G.main->name);
+
/* first search an identical image */
for (ima= G.main->image.first; ima; ima= ima->id.next) {
if (ima->source!=IMA_SRC_VIEWER && ima->source!=IMA_SRC_GENERATED) {
@@ -533,7 +555,7 @@ Image *BKE_add_image_file(const char *name)
if (BLI_path_cmp(strtest, str)==0) {
if (ima->anim==NULL || ima->id.us==0) {
- BLI_strncpy(ima->name, name, sizeof(ima->name)); /* for stringcode */
+ BLI_strncpy(ima->name, filepath, sizeof(ima->name)); /* for stringcode */
ima->id.us++; /* officially should not, it doesn't link here! */
if (ima->ok==0)
ima->ok= IMA_OK;
@@ -543,21 +565,8 @@ Image *BKE_add_image_file(const char *name)
}
}
}
- /* add new image */
-
- /* create a short library name */
- len= strlen(name);
-
- while (len > 0 && name[len - 1] != '/' && name[len - 1] != '\\') len--;
- libname= name+len;
-
- ima= image_alloc(libname, IMA_SRC_FILE, IMA_TYPE_IMAGE);
- BLI_strncpy(ima->name, name, sizeof(ima->name));
-
- if (BLI_testextensie_array(name, imb_ext_movie))
- ima->source= IMA_SRC_MOVIE;
-
- return ima;
+
+ return BKE_image_load(filepath);
}
static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short uvtestgrid, float color[4])
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 1c13c96d8a3..e9520566dd0 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -212,7 +212,7 @@ int id_make_local(ID *id, int test)
if (!test) make_local_texture((Tex *)id);
return 1;
case ID_IM:
- if (!test) make_local_image((Image *)id);
+ if (!test) BKE_image_make_local((Image *)id);
return 1;
case ID_LT:
if (!test) {
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index bd925faf847..e3e4f663e27 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -180,7 +180,7 @@ void BKE_text_free(Text *text)
#endif
}
-Text *add_empty_text(const char *name)
+Text *BKE_text_add(const char *name)
{
Main *bmain= G.main;
Text *ta;
@@ -278,7 +278,7 @@ static void cleanup_textline(TextLine * tl)
tl->len+= txt_extended_ascii_as_utf8(&tl->line);
}
-int reopen_text(Text *text)
+int BKE_text_reload(Text *text)
{
FILE *fp;
int i, llen, len;
@@ -373,7 +373,7 @@ int reopen_text(Text *text)
return 1;
}
-Text *add_text(const char *file, const char *relpath)
+Text *BKE_text_load(const char *file, const char *relpath)
{
Main *bmain= G.main;
FILE *fp;
@@ -593,7 +593,7 @@ void BKE_text_unlink(Main *bmain, Text *text)
text->id.us= 0;
}
-void clear_text(Text *text) /* called directly from rna */
+void BKE_text_clear(Text *text) /* called directly from rna */
{
int oldstate;
@@ -606,7 +606,7 @@ void clear_text(Text *text) /* called directly from rna */
txt_make_dirty(text);
}
-void write_text(Text *text, const char *str) /* called directly from rna */
+void BKE_text_write(Text *text, const char *str) /* called directly from rna */
{
int oldstate;
diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c
index c9f7b7c7e64..d85765d8f56 100644
--- a/source/blender/blenlib/intern/freetypefont.c
+++ b/source/blender/blenlib/intern/freetypefont.c
@@ -297,7 +297,7 @@ static int objchr_to_ftvfontdata(VFont *vfont, FT_ULong charcode)
struct TmpFont *tf;
// Find the correct FreeType font
- tf= vfont_find_tmpfont(vfont);
+ tf= BKE_vfont_find_tmpfont(vfont);
// What, no font found. Something strange here
if (!tf) return FALSE;
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 3005837ba7f..231c1ab8d03 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2955,7 +2955,7 @@ static void direct_link_text(FileData *fd, Text *text)
#if 0
if (text->flags & TXT_ISEXT) {
- reopen_text(text);
+ BKE_text_reload(text);
}
else {
#endif
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index 3976d8115c1..98a30fbef74 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -921,7 +921,7 @@ bool DocumentImporter::writeImage( const COLLADAFW::Image* image )
BLI_split_dir_part(filename, dir, sizeof(dir));
BLI_join_dirfile(full_path, sizeof(full_path), dir, filepath.c_str());
- Image *ima = BKE_add_image_file(full_path);
+ Image *ima = BKE_image_load_exists(full_path);
if (!ima) {
fprintf(stderr, "Cannot create image.\n");
return true;
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index 22f1cd578ac..05dc2d1c04e 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -275,7 +275,7 @@ static void text_update_edited(bContext *C, Scene *scene, Object *obedit, int re
if (mode == FO_EDIT)
update_string(cu);
- BKE_text_to_curve(bmain, scene, obedit, mode);
+ BKE_vfont_to_curve(bmain, scene, obedit, mode);
if (recalc)
DAG_id_tag_update(obedit->data, 0);
@@ -449,7 +449,7 @@ static void txt_add_object(bContext *C, TextLine *firstline, int totline, float
obedit->loc[2] += offset[2];
cu= obedit->data;
- cu->vfont= get_builtin_font();
+ cu->vfont= BKE_vfont_builtin_get();
cu->vfont->id.us++;
for (tmp=firstline, a=0; cu->len<MAXTEXT && a<totline; tmp=tmp->next, a++)
@@ -556,7 +556,7 @@ static int kill_selection(Object *obedit, int ins) /* 1 == new character */
int offset = 0;
int getfrom;
- direction = BKE_font_getselection(obedit, &selstart, &selend);
+ direction = BKE_vfont_select_get(obedit, &selstart, &selend);
if (direction) {
int size;
if (ins) offset = 1;
@@ -593,7 +593,7 @@ static int set_style(bContext *C, const int style, const int clear)
EditFont *ef= cu->editfont;
int i, selstart, selend;
- if (!BKE_font_getselection(obedit, &selstart, &selend))
+ if (!BKE_vfont_select_get(obedit, &selstart, &selend))
return OPERATOR_CANCELLED;
for (i=selstart; i<=selend; i++) {
@@ -644,7 +644,7 @@ static int toggle_style_exec(bContext *C, wmOperator *op)
Curve *cu= obedit->data;
int style, clear, selstart, selend;
- if (!BKE_font_getselection(obedit, &selstart, &selend))
+ if (!BKE_vfont_select_get(obedit, &selstart, &selend))
return OPERATOR_CANCELLED;
style= RNA_enum_get(op->ptr, "style");
@@ -679,7 +679,7 @@ static void copy_selection(Object *obedit)
{
int selstart, selend;
- if (BKE_font_getselection(obedit, &selstart, &selend)) {
+ if (BKE_vfont_select_get(obedit, &selstart, &selend)) {
Curve *cu= obedit->data;
EditFont *ef= cu->editfont;
@@ -718,7 +718,7 @@ static int cut_text_exec(bContext *C, wmOperator *UNUSED(op))
Object *obedit= CTX_data_edit_object(C);
int selstart, selend;
- if (!BKE_font_getselection(obedit, &selstart, &selend))
+ if (!BKE_vfont_select_get(obedit, &selstart, &selend))
return OPERATOR_CANCELLED;
copy_selection(obedit);
@@ -901,7 +901,7 @@ static int move_cursor(bContext *C, int type, int select)
struct Main *bmain= CTX_data_main(C);
cu->selstart = cu->selend = 0;
update_string(cu);
- BKE_text_to_curve(bmain, scene, obedit, FO_SELCHANGE);
+ BKE_vfont_to_curve(bmain, scene, obedit, FO_SELCHANGE);
}
}
@@ -1121,7 +1121,7 @@ static int delete_exec(bContext *C, wmOperator *op)
if (cu->len == 0)
return OPERATOR_CANCELLED;
- if (BKE_font_getselection(obedit, &selstart, &selend)) {
+ if (BKE_vfont_select_get(obedit, &selstart, &selend)) {
if (type == DEL_NEXT_SEL) type= DEL_SELECTION;
else if (type == DEL_PREV_SEL) type= DEL_SELECTION;
}
@@ -1634,7 +1634,7 @@ static int font_open_exec(bContext *C, wmOperator *op)
char filepath[FILE_MAX];
RNA_string_get(op->ptr, "filepath", filepath);
- font= load_vfont(bmain, filepath);
+ font= BKE_vfont_load(bmain, filepath);
if (!font) {
if (op->customdata) MEM_freeN(op->customdata);
@@ -1726,7 +1726,7 @@ static int font_unlink_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- builtin_font = get_builtin_font();
+ builtin_font = BKE_vfont_builtin_get();
RNA_id_pointer_create(&builtin_font->id, &idptr);
RNA_property_pointer_set(&pprop.ptr, pprop.prop, idptr);
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index 93546d74c1b..aaca5181531 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -507,7 +507,7 @@ static int reports_to_text_exec(bContext *C, wmOperator *UNUSED(op))
char *str;
/* create new text-block to write to */
- txt = add_empty_text("Recent Reports");
+ txt = BKE_text_add("Recent Reports");
/* convert entire list to a display string, and add this to the text-block
* - if commandline debug option enabled, show debug reports too
@@ -516,7 +516,7 @@ static int reports_to_text_exec(bContext *C, wmOperator *UNUSED(op))
str = BKE_reports_string(reports, (G.debug & G_DEBUG) ? RPT_DEBUG : RPT_INFO);
if (str) {
- write_text(txt, str);
+ BKE_text_write(txt, str);
MEM_freeN(str);
return OPERATOR_FINISHED;
@@ -652,7 +652,7 @@ static int editsource_text_edit(bContext *C, wmOperator *op,
}
if (text == NULL) {
- text = add_text(filepath, bmain->name);
+ text = BKE_text_load(filepath, bmain->name);
}
if (text == NULL) {
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c
index f611a985797..042deb3def7 100644
--- a/source/blender/editors/mesh/mesh_data.c
+++ b/source/blender/editors/mesh/mesh_data.c
@@ -556,7 +556,7 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
char path[FILE_MAX];
RNA_string_get(op->ptr, "filepath", path);
- ima = BKE_add_image_file(path);
+ ima = BKE_image_load_exists(path);
}
else {
RNA_string_get(op->ptr, "name", name);
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index a683b1cc0ae..fa8ed0fd94d 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -885,7 +885,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
cu1->vfontbi = cu->vfontbi;
id_us_plus((ID *)cu1->vfontbi);
- BKE_text_to_curve(bmain, scene, base->object, 0); /* needed? */
+ BKE_vfont_to_curve(bmain, scene, base->object, 0); /* needed? */
BLI_strncpy(cu1->family, cu->family, sizeof(cu1->family));
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index eb874932d40..c8fd8d0c93f 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -190,7 +190,7 @@ static int material_slot_assign_exec(bContext *C, wmOperator *UNUSED(op))
EditFont *ef = ((Curve *)ob->data)->editfont;
int i, selstart, selend;
- if (ef && BKE_font_getselection(ob, &selstart, &selend)) {
+ if (ef && BKE_vfont_select_get(ob, &selstart, &selend)) {
for (i = selstart; i <= selend; i++)
ef->textbufinfo[i].mat_nr = ob->actcol;
}
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index bbc12520978..66070bf54b0 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -833,7 +833,7 @@ static int image_open_exec(bContext *C, wmOperator *op)
errno = 0;
- ima = BKE_add_image_file(str);
+ ima = BKE_image_load_exists(str);
if (!ima) {
if (op->customdata) MEM_freeN(op->customdata);
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index 746fa9e34d7..d47a1d557ab 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -3408,7 +3408,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
errno= 0;
- ima= BKE_add_image_file(path);
+ ima= BKE_image_load_exists(path);
if (!ima) {
BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s", path, errno ? strerror(errno) : "Unsupported image format");
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index ca72d1e3094..d38a4caeab7 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -167,7 +167,7 @@ static int text_new_exec(bContext *C, wmOperator *UNUSED(op))
PointerRNA ptr, idptr;
PropertyRNA *prop;
- text = add_empty_text("Text");
+ text = BKE_text_add("Text");
/* hook into UI */
uiIDContextProperty(C, &ptr, &prop);
@@ -236,7 +236,7 @@ static int text_open_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "filepath", str);
- text = add_text(str, G.main->name);
+ text = BKE_text_load(str, G.main->name);
if (!text) {
if (op->customdata) MEM_freeN(op->customdata);
@@ -320,7 +320,7 @@ static int text_reload_exec(bContext *C, wmOperator *op)
{
Text *text = CTX_data_edit_text(C);
- if (!reopen_text(text)) {
+ if (!BKE_text_reload(text)) {
BKE_report(op->reports, RPT_ERROR, "Could not reopen file");
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 37f24dda8ab..79dce3e6bcd 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -6647,7 +6647,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
setlinestyle(0);
- if (BKE_font_getselection(ob, &selstart, &selend) && cu->selboxes) {
+ if (BKE_vfont_select_get(ob, &selstart, &selend) && cu->selboxes) {
float selboxw;
cpack(0xffffff);
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index b5354ac5e03..de17f0af1e8 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -3094,7 +3094,7 @@ static int background_image_add_invoke(bContext *C, wmOperator *op, wmEvent *UNU
char path[FILE_MAX];
RNA_string_get(op->ptr, "filepath", path);
- ima = BKE_add_image_file(path);
+ ima = BKE_image_load_exists(path);
}
else if (RNA_struct_property_is_set(op->ptr, "name")) {
RNA_string_get(op->ptr, "name", name);
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 6992d992cca..74a55b97e1b 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -269,7 +269,7 @@ static void rna_ID_update_tag(ID *id, ReportList *reports, int flag)
if (ob->type == OB_FONT) {
Curve *cu = ob->data;
freedisplist(&cu->disp);
- BKE_text_to_curve(sce, ob, CU_LEFT);
+ BKE_vfont_to_curve(sce, ob, CU_LEFT);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 2b6582bc1d9..661e4b18c6d 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -278,7 +278,7 @@ Image *rna_Main_images_load(Main *UNUSED(bmain), ReportList *reports, const char
Image *ima;
errno = 0;
- ima = BKE_add_image_file(filepath);
+ ima = BKE_image_load(filepath);
if (!ima)
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath,
@@ -347,7 +347,7 @@ VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, const char *filepat
VFont *font;
errno = 0;
- font = load_vfont(bmain, filepath);
+ font = BKE_vfont_load(bmain, filepath);
if (!font)
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath,
@@ -443,7 +443,7 @@ void rna_Main_speakers_remove(Main *bmain, ReportList *reports, Speaker *speaker
Text *rna_Main_texts_new(Main *UNUSED(bmain), const char *name)
{
- return add_empty_text(name);
+ return BKE_text_add(name);
}
void rna_Main_texts_remove(Main *bmain, Text *text)
{
@@ -457,7 +457,7 @@ Text *rna_Main_texts_load(Main *bmain, ReportList *reports, const char *filepath
Text *txt;
errno = 0;
- txt = add_text(filepath, bmain->name);
+ txt = BKE_text_load(filepath, bmain->name);
if (!txt)
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath,
diff --git a/source/blender/makesrna/intern/rna_text_api.c b/source/blender/makesrna/intern/rna_text_api.c
index 3f511858332..338d0c7c52c 100644
--- a/source/blender/makesrna/intern/rna_text_api.c
+++ b/source/blender/makesrna/intern/rna_text_api.c
@@ -37,13 +37,13 @@
static void rna_Text_clear(Text *text)
{
- clear_text(text);
+ BKE_text_clear(text);
WM_main_add_notifier(NC_TEXT|NA_EDITED, text);
}
static void rna_Text_write(Text *text, const char *str)
{
- write_text(text, str);
+ BKE_text_write(text, str);
WM_main_add_notifier(NC_TEXT|NA_EDITED, text);
}
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index a366810e647..56052b895ab 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -484,7 +484,7 @@ int WM_read_homefile(bContext *C, ReportList *UNUSED(reports), short from_memory
char tstr[FILE_MAX];
int success = 0;
- free_ttfont(); /* still weird... what does it here? */
+ BKE_vfont_free_global_ttf(); /* still weird... what does it here? */
G.relbase_valid = 0;
if (!from_memory) {
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 58c2c649163..1a1cb9d6507 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -360,7 +360,7 @@ void WM_exit_ext(bContext *C, const short do_python)
// BIF_freeRetarget();
BIF_freeTemplates(C);
- free_ttfont(); /* bke_font.h */
+ BKE_vfont_free_global_ttf(); /* bke_font.h */
free_openrecent();
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 8394ff32750..c3da352136d 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -1270,7 +1270,7 @@ int main(int argc, const char **argv)
#endif
/* background render uses this font too */
- BKE_font_register_builtin(datatoc_Bfont, datatoc_Bfont_size);
+ BKE_vfont_builtin_register(datatoc_Bfont, datatoc_Bfont_size);
/* Initialize ffmpeg if built in, also needed for bg mode if videos are
* rendered via ffmpeg */
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index b5e165a58ec..9e072f2de3a 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -870,7 +870,7 @@ int main(int argc, char** argv)
if (domeWarp)
{
//XXX to do: convert relative to absolute path
- domeText= add_text(domeWarp, "");
+ domeText= BKE_text_load(domeWarp, "");
if (!domeText)
printf("error: invalid warpdata text file - %s\n", domeWarp);
else