[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44828] trunk/blender/source/blender/ blenfont: Style cleanup in blenfont (spaces, C++ comments, etc.).
Bastien Montagne
montagne29 at wanadoo.fr
Mon Mar 12 10:22:17 CET 2012
Revision: 44828
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44828
Author: mont29
Date: 2012-03-12 09:22:16 +0000 (Mon, 12 Mar 2012)
Log Message:
-----------
Style cleanup in blenfont (spaces, C++ comments, etc.).
Modified Paths:
--------------
trunk/blender/source/blender/blenfont/BLF_api.h
trunk/blender/source/blender/blenfont/BLF_translation.h
trunk/blender/source/blender/blenfont/intern/blf.c
trunk/blender/source/blender/blenfont/intern/blf_dir.c
trunk/blender/source/blender/blenfont/intern/blf_font.c
trunk/blender/source/blender/blenfont/intern/blf_glyph.c
trunk/blender/source/blender/blenfont/intern/blf_internal.h
trunk/blender/source/blender/blenfont/intern/blf_lang.c
trunk/blender/source/blender/blenfont/intern/blf_translation.c
trunk/blender/source/blender/blenfont/intern/blf_util.c
Modified: trunk/blender/source/blender/blenfont/BLF_api.h
===================================================================
--- trunk/blender/source/blender/blenfont/BLF_api.h 2012-03-12 09:20:38 UTC (rev 44827)
+++ trunk/blender/source/blender/blenfont/BLF_api.h 2012-03-12 09:22:16 UTC (rev 44828)
@@ -76,61 +76,49 @@
void BLF_draw(int fontid, const char *str, size_t len);
void BLF_draw_ascii(int fontid, const char *str, size_t len);
-/*
- * This function return the bounding box of the string
+/* This function return the bounding box of the string
* and are not multiplied by the aspect.
*/
void BLF_boundbox(int fontid, const char *str, struct rctf *box);
-/*
- * The next both function return the width and height
+/* The next both function return the width and height
* of the string, using the current font and both value
* are multiplied by the aspect of the font.
*/
float BLF_width(int fontid, const char *str);
float BLF_height(int fontid, const char *str);
-/*
- * Return dimensions of the font without any sample text.
- */
+/* Return dimensions of the font without any sample text. */
float BLF_height_max(int fontid);
float BLF_width_max(int fontid);
float BLF_descender(int fontid);
float BLF_ascender(int fontid);
-/*
- * The following function return the width and height of the string, but
+/* The following function return the width and height of the string, but
* just in one call, so avoid extra freetype2 stuff.
*/
void BLF_width_and_height(int fontid, const char *str, float *width, float *height);
-/*
- * For fixed width fonts only, returns the width of a
+/* For fixed width fonts only, returns the width of a
* character.
*/
float BLF_fixed_width(int fontid);
-/*
- * and this two function return the width and height
+/* and this two function return the width and height
* of the string, using the default font and both value
* are multiplied by the aspect of the font.
*/
float BLF_width_default(const char *str);
float BLF_height_default(const char *str);
-/*
- * Set rotation for default font.
- */
+/* Set rotation for default font. */
void BLF_rotation_default(float angle);
-/*
- * Enable/disable options to the default font.
- */
+/* Enable/disable options to the default font. */
void BLF_enable_default(int option);
void BLF_disable_default(int option);
-/*
- * By default, rotation and clipping are disable and
+/* By default, rotation and clipping are disable and
* have to be enable/disable using BLF_enable/disable.
*/
void BLF_rotation(int fontid, float angle);
@@ -141,39 +129,34 @@
void BLF_enable(int fontid, int option);
void BLF_disable(int fontid, int option);
-/*
- * Shadow options, level is the blur level, can be 3, 5 or 0 and
+/* Shadow options, level is the blur level, can be 3, 5 or 0 and
* the other argument are the rgba color.
- * Take care that shadow need to be enable using BLF_enable!!.
+ * Take care that shadow need to be enable using BLF_enable!!!
*/
void BLF_shadow(int fontid, int level, float r, float g, float b, float a);
-/*
- * Set the offset for shadow text, this is the current cursor
+/* Set the offset for shadow text, this is the current cursor
* position plus this offset, don't need call BLF_position before
* this function, the current position is calculate only on
* BLF_draw, so it's safe call this whenever you like.
*/
void BLF_shadow_offset(int fontid, int x, int y);
-/*
- * Set the buffer, size and number of channels to draw, one thing to take care is call
+/* Set the buffer, size and number of channels to draw, one thing to take care is call
* this function with NULL pointer when we finish, for example:
- * BLF_buffer(my_fbuf, my_cbuf, 100, 100, 4);
*
- * ... set color, position and draw ...
+ * BLF_buffer(my_fbuf, my_cbuf, 100, 100, 4);
*
- * BLF_buffer(NULL, NULL, 0, 0, 0);
+ * ... set color, position and draw ...
+ *
+ * BLF_buffer(NULL, NULL, 0, 0, 0);
*/
void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch);
-/*
- * Set the color to be used for text.
- */
+/* Set the color to be used for text. */
void BLF_buffer_col(int fontid, float r, float g, float b, float a);
-/*
- * Draw the string into the buffer, this function draw in both buffer, float and unsigned char _BUT_
+/* Draw the string into the buffer, this function draw in both buffer, float and unsigned char _BUT_
* it's not necessary set both buffer, NULL is valid here.
*/
void BLF_draw_buffer(int fontid, const char *str);
@@ -200,8 +183,8 @@
#define BLF_DRAW_STR_DUMMY_MAX 1024
-// XXX, bad design
+/* XXX, bad design */
extern int blf_mono_font;
-extern int blf_mono_font_render; // dont mess drawing with render threads.
+extern int blf_mono_font_render; /* dont mess drawing with render threads. */
#endif /* __BLF_API_H__ */
Modified: trunk/blender/source/blender/blenfont/BLF_translation.h
===================================================================
--- trunk/blender/source/blender/blenfont/BLF_translation.h 2012-03-12 09:20:38 UTC (rev 44827)
+++ trunk/blender/source/blender/blenfont/BLF_translation.h 2012-03-12 09:22:16 UTC (rev 44828)
@@ -47,8 +47,7 @@
/* blf_lang.c */
-/*
- * Search the path directory to the locale files, this try all
+/* Search the path directory to the locale files, this try all
* the case for Linux, Win and Mac.
*/
void BLF_lang_init(void);
@@ -66,7 +65,7 @@
const char *BLF_translate_do_tooltip(const char *msgid);
-/*#define _(msgid) BLF_gettext(msgid)*/
+/* #define _(msgid) BLF_gettext(msgid) */
/* The "translation-marker" macro. */
#define N_(msgid) msgid
/* Those macros should be used everywhere in UI code. */
Modified: trunk/blender/source/blender/blenfont/intern/blf.c
===================================================================
--- trunk/blender/source/blender/blenfont/intern/blf.c 2012-03-12 09:20:38 UTC (rev 44827)
+++ trunk/blender/source/blender/blenfont/intern/blf.c 2012-03-12 09:22:16 UTC (rev 44828)
@@ -62,13 +62,13 @@
static FontBLF *global_font[BLF_MAX_FONT] = {0};
/* Default size and dpi, for BLF_draw_default. */
-static int global_font_default= -1;
-static int global_font_points= 11;
-static int global_font_dpi= 72;
+static int global_font_default = -1;
+static int global_font_points = 11;
+static int global_font_dpi = 72;
-// XXX, should these be made into global_font_'s too?
-int blf_mono_font= -1;
-int blf_mono_font_render= -1;
+/* XXX, should these be made into global_font_'s too? */
+int blf_mono_font = -1;
+int blf_mono_font_render = -1;
static FontBLF *BLF_get(int fontid)
{
@@ -81,11 +81,11 @@
{
int i;
- for (i= 0; i < BLF_MAX_FONT; i++)
- global_font[i]= NULL;
+ for (i = 0; i < BLF_MAX_FONT; i++)
+ global_font[i] = NULL;
- global_font_points= points;
- global_font_dpi= dpi;
+ global_font_points = points;
+ global_font_dpi = dpi;
return blf_font_init();
}
@@ -94,11 +94,11 @@
FontBLF *font;
int i;
- for (i= 0; i < BLF_MAX_FONT; i++) {
- font= global_font[i];
+ for (i = 0; i < BLF_MAX_FONT; i++) {
+ font = global_font[i];
if (font) {
blf_font_free(font);
- global_font[i]= NULL;
+ global_font[i] = NULL;
}
}
@@ -110,8 +110,8 @@
FontBLF *font;
int i;
- for (i= 0; i < BLF_MAX_FONT; i++) {
- font= global_font[i];
+ for (i = 0; i < BLF_MAX_FONT; i++) {
+ font = global_font[i];
if (font)
blf_glyph_cache_clear(font);
}
@@ -122,8 +122,8 @@
FontBLF *font;
int i;
- for (i= 0; i < BLF_MAX_FONT; i++) {
- font= global_font[i];
+ for (i = 0; i < BLF_MAX_FONT; i++) {
+ font = global_font[i];
if (font && (!strcmp(font->name, name)))
return i;
}
@@ -135,8 +135,8 @@
{
int i;
- for (i= 0; i < BLF_MAX_FONT; i++)
- if(!global_font[i])
+ for (i = 0; i < BLF_MAX_FONT; i++)
+ if (!global_font[i])
return i;
return -1;
@@ -152,7 +152,7 @@
return -1;
/* check if we already load this font. */
- i= blf_search(name);
+ i = blf_search(name);
if (i >= 0) {
/*font= global_font[i];*/ /*UNUSED*/
return i;
@@ -164,13 +164,13 @@
return -1;
}
- filename= blf_dir_search(name);
+ filename = blf_dir_search(name);
if (!filename) {
printf("Can't find font: %s\n", name);
return -1;
}
- font= blf_font_new(name, filename);
+ font = blf_font_new(name, filename);
MEM_freeN(filename);
if (!font) {
@@ -178,7 +178,7 @@
return -1;
}
- global_font[i]= font;
+ global_font[i] = font;
return i;
}
@@ -200,13 +200,13 @@
return -1;
}
- filename= blf_dir_search(name);
+ filename = blf_dir_search(name);
if (!filename) {
printf("Can't find font: %s\n", name);
return -1;
}
- font= blf_font_new(name, filename);
+ font = blf_font_new(name, filename);
MEM_freeN(filename);
if (!font) {
@@ -214,13 +214,13 @@
return -1;
}
- global_font[i]= font;
+ global_font[i] = font;
return i;
}
void BLF_metrics_attach(int fontid, unsigned char *mem, int mem_size)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
blf_font_attach_from_mem(font, mem, mem_size);
@@ -235,7 +235,7 @@
if (!name)
return -1;
- i= blf_search(name);
+ i = blf_search(name);
if (i >= 0) {
/*font= global_font[i];*/ /*UNUSED*/
return i;
@@ -252,13 +252,13 @@
return -1;
}
- font= blf_font_new_from_mem(name, mem, mem_size);
+ font = blf_font_new_from_mem(name, mem, mem_size);
if (!font) {
printf("Can't load font: %s from memory!!\n", name);
return -1;
}
- global_font[i]= font;
+ global_font[i] = font;
return i;
}
@@ -285,13 +285,13 @@
return -1;
}
- font= blf_font_new_from_mem(name, mem, mem_size);
+ font = blf_font_new_from_mem(name, mem, mem_size);
if (!font) {
printf("Can't load font: %s from memory!!\n", name);
return -1;
}
- global_font[i]= font;
+ global_font[i] = font;
return i;
}
@@ -300,19 +300,19 @@
FontBLF *font;
int i;
- for (i= 0; i < BLF_MAX_FONT; i++) {
- font= global_font[i];
+ for (i = 0; i < BLF_MAX_FONT; i++) {
+ font = global_font[i];
if (font && (!strcmp(font->name, name))) {
blf_font_free(font);
- global_font[i]= NULL;
+ global_font[i] = NULL;
}
}
}
void BLF_enable(int fontid, int option)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
font->flags |= option;
@@ -321,7 +321,7 @@
void BLF_disable(int fontid, int option)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
font->flags &= ~option;
@@ -330,7 +330,7 @@
void BLF_enable_default(int option)
{
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list