Cleanup: comments (long lines) in avi, blf & blt
This commit is contained in:
@@ -153,10 +153,14 @@ typedef struct _AviIndex {
|
||||
} AviIndex;
|
||||
|
||||
typedef enum {
|
||||
AVI_FORMAT_RGB24, /* The most basic of forms, 3 bytes per pixel, 1 per r, g, b */
|
||||
AVI_FORMAT_RGB32, /* The second most basic of forms, 4 bytes per pixel, 1 per r, g, b, alpha */
|
||||
AVI_FORMAT_AVI_RGB, /* Same as above, but is in the weird AVI order (bottom to top, left to right) */
|
||||
AVI_FORMAT_MJPEG, /* Motion-JPEG */
|
||||
/** The most basic of forms, 3 bytes per pixel, 1 per r, g, b. */
|
||||
AVI_FORMAT_RGB24,
|
||||
/** The second most basic of forms, 4 bytes per pixel, 1 per r, g, b, alpha. */
|
||||
AVI_FORMAT_RGB32,
|
||||
/** Same as above, but is in the weird AVI order (bottom to top, left to right). */
|
||||
AVI_FORMAT_AVI_RGB,
|
||||
/** Motion-JPEG. */
|
||||
AVI_FORMAT_MJPEG,
|
||||
} AviFormat;
|
||||
|
||||
typedef struct _AviStreamRec {
|
||||
|
||||
@@ -198,8 +198,8 @@ void BLF_buffer(int fontid,
|
||||
/* Set the color to be used for text. */
|
||||
void BLF_buffer_col(int fontid, const float rgba[4]) ATTR_NONNULL(2);
|
||||
|
||||
/* 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.
|
||||
/* 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_ex(int fontid, const char *str, size_t len, struct ResultBLF *r_info)
|
||||
ATTR_NONNULL(2);
|
||||
|
||||
@@ -106,9 +106,9 @@ void BLF_thumb_preview(const char *filename,
|
||||
|
||||
font->pos[1] -= font->glyph_cache->ascender * 1.1f;
|
||||
|
||||
/* We fallback to default english strings in case not enough chars are available in current font for given
|
||||
* translated string (useful in non-latin i18n context, like chinese, since many fonts will then show
|
||||
* nothing but ugly 'missing char' in their preview).
|
||||
/* We fallback to default english strings in case not enough chars are available in current font
|
||||
* for given translated string (useful in non-latin i18n context, like chinese,
|
||||
* since many fonts will then show nothing but ugly 'missing char' in their preview).
|
||||
* Does not handle all cases, but much better than nothing.
|
||||
*/
|
||||
if (blf_font_count_missing_chars(font, draw_str_i18n, draw_str_i18n_len, &draw_str_i18n_nbr) >
|
||||
|
||||
@@ -42,8 +42,8 @@ void BLT_lang_set(const char *);
|
||||
/* Get the current locale ([partial] ISO code, e.g. es_ES). */
|
||||
const char *BLT_lang_get(void);
|
||||
|
||||
/* Get locale's elements (if relevant pointer is not NULL and element actually exists, e.g. if there is no variant,
|
||||
* *variant and *language_variant will always be NULL).
|
||||
/* Get locale's elements (if relevant pointer is not NULL and element actually exists, e.g.
|
||||
* if there is no variant, *variant and *language_variant will always be NULL).
|
||||
* Non-null elements are always MEM_mallocN'ed, it's the caller's responsibility to free them.
|
||||
* NOTE: Always available, even in non-WITH_INTERNATIONAL builds.
|
||||
*/
|
||||
|
||||
@@ -86,11 +86,11 @@ bool BLT_lang_is_ime_supported(void);
|
||||
|
||||
/* Default, void context.
|
||||
* WARNING! The "" context is not the same as no (NULL) context at mo/boost::locale level!
|
||||
* NOTE: We translate BLT_I18NCONTEXT_DEFAULT as BLT_I18NCONTEXT_DEFAULT_BPY in Python, as we can't use "natural"
|
||||
* None value in rna string properties... :/
|
||||
* NOTE: We translate BLT_I18NCONTEXT_DEFAULT as BLT_I18NCONTEXT_DEFAULT_BPY in Python,
|
||||
* as we can't use "natural" None value in rna string properties... :/
|
||||
* The void string "" is also interpreted as BLT_I18NCONTEXT_DEFAULT.
|
||||
* For perf reason, we only use the first char to detect this context, so other contexts should never start
|
||||
* with the same char!
|
||||
* For perf reason, we only use the first char to detect this context,
|
||||
* so other contexts should never start with the same char!
|
||||
*/
|
||||
#define BLT_I18NCONTEXT_DEFAULT NULL
|
||||
#define BLT_I18NCONTEXT_DEFAULT_BPYRNA "*"
|
||||
@@ -102,7 +102,8 @@ bool BLT_lang_is_ime_supported(void);
|
||||
* easy to get collisions with other areas...). */
|
||||
#define BLT_I18NCONTEXT_UI_EVENTS "UI_Events_KeyMaps"
|
||||
|
||||
/* Mark the msgid applies to several elements (needed in some cases, as english adjectives have no plural mark :( ). */
|
||||
/* Mark the msgid applies to several elements
|
||||
* (needed in some cases, as english adjectives have no plural mark :( ). */
|
||||
#define BLT_I18NCONTEXT_PLURAL "Plural"
|
||||
|
||||
/* ID-types contexts. */
|
||||
|
||||
@@ -118,7 +118,8 @@ static void fill_locales(void)
|
||||
/* And now, build locales and locale_menu! */
|
||||
locales_menu = MEM_callocN(num_locales_menu * sizeof(EnumPropertyItem), __func__);
|
||||
line = lines;
|
||||
/* Do not allocate locales with zero-sized mem, as LOCALE macro uses NULL locales as invalid marker! */
|
||||
/* Do not allocate locales with zero-sized mem,
|
||||
* as LOCALE macro uses NULL locales as invalid marker! */
|
||||
if (num_locales > 0) {
|
||||
locales = MEM_callocN(num_locales * sizeof(char *), __func__);
|
||||
while (line) {
|
||||
@@ -155,7 +156,8 @@ static void fill_locales(void)
|
||||
/* The DEFAULT/Automatic item... */
|
||||
if (BLI_strnlen(loc, 2)) {
|
||||
locales[id] = "";
|
||||
/* Keep this tip in sync with the one in rna_userdef (rna_enum_language_default_items). */
|
||||
/* Keep this tip in sync with the one in rna_userdef
|
||||
* (rna_enum_language_default_items). */
|
||||
locales_menu[idx].description = BLI_strdup(
|
||||
"Automatically choose system's defined language "
|
||||
"if available, or fall-back to English");
|
||||
@@ -307,10 +309,12 @@ const char *BLT_lang_get(void)
|
||||
#undef LOCALE
|
||||
#undef ULANGUAGE
|
||||
|
||||
/* Get locale's elements (if relevant pointer is not NULL and element actually exists, e.g. if there is no variant,
|
||||
/* Get locale's elements (if relevant pointer is not NULL and element actually exists, e.g.
|
||||
* if there is no variant,
|
||||
* *variant and *language_variant will always be NULL).
|
||||
* Non-null elements are always MEM_mallocN'ed, it's the caller's responsibility to free them.
|
||||
* NOTE: Keep that one always available, you never know, may become useful even in no-WITH_INTERNATIONAL context...
|
||||
* NOTE: Keep that one always available, you never know,
|
||||
* may become useful even in no-WITH_INTERNATIONAL context...
|
||||
*/
|
||||
void BLT_lang_locale_explode(const char *locale,
|
||||
char **language,
|
||||
|
||||
@@ -61,8 +61,8 @@ const char *BLT_pgettext(const char *msgctxt, const char *msgid)
|
||||
msgctxt = BLT_I18NCONTEXT_DEFAULT;
|
||||
}
|
||||
ret = bl_locale_pgettext(msgctxt, msgid);
|
||||
/* We assume if the returned string is the same (memory level) as the msgid, no translation was found,
|
||||
* and we can try py scripts' ones!
|
||||
/* We assume if the returned string is the same (memory level) as the msgid,
|
||||
* no translation was found, and we can try py scripts' ones!
|
||||
*/
|
||||
# ifdef WITH_PYTHON
|
||||
if (ret == msgid) {
|
||||
|
||||
@@ -24,8 +24,10 @@
|
||||
*
|
||||
* Generate binary message catalog from textual translation description.
|
||||
*
|
||||
* This program converts a textual Uniforum-style message catalog (.po file) into a binary GNU catalog (.mo file).
|
||||
* This is essentially the same function as the GNU msgfmt program, however, it is a simpler implementation.
|
||||
* This program converts a textual Uniforum-style message catalog (.po file)
|
||||
* into a binary GNU catalog (.mo file).
|
||||
* This is essentially the same function as the GNU msgfmt program,
|
||||
* however, it is a simpler implementation.
|
||||
*
|
||||
* Usage: msgfmt input.po output.po
|
||||
*/
|
||||
@@ -206,7 +208,8 @@ static char *generate(GHash *messages, size_t *r_output_size)
|
||||
tot_vals_len += off->val_len + 1;
|
||||
}
|
||||
|
||||
/* The header is 7 32-bit unsigned integers. then comes the keys index table, then the values index table. */
|
||||
/* The header is 7 32-bit unsigned integers.
|
||||
* Then comes the keys index table, then the values index table. */
|
||||
const uint32_t idx_keystart = 7 * 4;
|
||||
const uint32_t idx_valstart = idx_keystart + 8 * num_keys;
|
||||
/* We don't use hash tables, so the keys start right after the index tables. */
|
||||
|
||||
Reference in New Issue
Block a user