94 if (vfont_dst->
data) {
160 .struct_size =
sizeof(
VFont),
162 .name_plural =
"fonts",
165 .asset_type_info =
NULL,
172 .foreach_cache =
NULL,
178 .blend_read_lib =
NULL,
179 .blend_read_expand =
NULL,
181 .blend_read_undo_preserve =
NULL,
183 .lib_override_apply_post =
NULL,
417 for (vfont =
G_MAIN->fonts.first; vfont; vfont = vfont->
id.
next) {
438 const float font_size)
474 for (
int i = nu2->
pntsu; i > 0; i--) {
477 float x = fp[0] - rect->
xmin;
478 float y = fp[1] - rect->
ymin;
480 fp[0] = (+co *
x + si *
y) + rect->
xmin;
481 fp[1] = (-si *
x + co *
y) + rect->
ymin;
497 unsigned int character,
511 float shear = cu->
shear;
531 memcpy(nu2, nu1,
sizeof(
struct Nurb));
552 memcpy(bezt2, bezt1, u *
sizeof(
struct BezTriple));
558 for (
int i = nu2->
pntsu; i > 0; i--) {
559 bezt2->
vec[0][0] += shear * bezt2->
vec[0][1];
560 bezt2->
vec[1][0] += shear * bezt2->
vec[1][1];
561 bezt2->
vec[2][0] += shear * bezt2->
vec[2][1];
567 for (
int i = nu2->
pntsu; i > 0; i--) {
568 float *fp = bezt2->
vec[0];
571 fp[0] = co *
x + si * fp[1];
572 fp[1] = -si *
x + co * fp[1];
574 fp[3] = co *
x + si * fp[4];
575 fp[4] = -si *
x + co * fp[4];
577 fp[6] = co *
x + si * fp[7];
578 fp[7] = -si *
x + co * fp[7];
587 for (
int i = nu2->
pntsu; i > 0; i--) {
588 float *fp = bezt2->
vec[0];
600 for (
int i = nu2->
pntsu; i > 0; i--) {
601 float *fp = bezt2->
vec[0];
602 fp[0] = (fp[0] + ofsx) * fsize;
603 fp[1] = (fp[1] + ofsy) * fsize;
604 fp[3] = (fp[3] + ofsx) * fsize;
605 fp[4] = (fp[4] + ofsy) * fsize;
606 fp[6] = (fp[6] + ofsx) * fsize;
607 fp[7] = (fp[7] + ofsy) * fsize;
622 int start, end, direction;
648 if (start == end + 1) {
685 tb_dst->
x = tb_src->
x * scale;
686 tb_dst->
y = tb_src->
y * scale;
687 tb_dst->
w = tb_src->
w * scale;
688 tb_dst->
h = tb_src->
h * scale;
739 #define FONT_TO_CURVE_SCALE_ITERATIONS 20
740 #define FONT_TO_CURVE_SCALE_THRESHOLD 0.0001f
773 const char32_t **r_text,
780 VFont *vfont, *oldvfont;
788 float *f, xof, yof, xtrax, linedist;
789 float twidth = 0, maxlen = 0;
792 int selstart = 0, selend = 0;
793 int cnr = 0, lnr = 0, wsnr = 0;
794 const char32_t *mem =
NULL;
798 const bool word_wrap = iter_data->
word_wrap;
803 float current_line_length = 0.0f;
804 float longest_line_length = 0.0f;
809 "TextBox initial char index");
811 #define MARGIN_X_MIN (xof_scale + tb_scale.x)
812 #define MARGIN_Y_MIN (yof_scale + tb_scale.y)
895 use_textbox = (tb_scale.
w != 0.0f);
900 xtrax = 0.5f * cu->
spacing - 0.5f;
904 for (i = 0; i < slen; i++) {
911 info = &custrinfo[i];
914 ascii = towupper(ascii);
915 if (mem[i] != ascii) {
926 if (vfont != oldvfont) {
934 chartransdata =
NULL;
939 if (!
ELEM(ascii,
'\n',
'\0')) {
968 if ((tb_scale.
w != 0.0f) && (ct->dobreak == 0)) {
969 const float x_available = xof_scale + tb_scale.
w;
970 const float x_used = (xof - tb_scale.
x) + twidth;
972 if (word_wrap ==
false) {
978 if (x_used > x_available) {
980 "VFontToCurveIter.scale_to_fit not set correctly!");
983 else if (x_used > x_available) {
985 bool dobreak =
false;
986 for (j = i; (mem[j] !=
'\n') && (chartransdata[j].dobreak == 0); j--) {
1002 if (
ELEM(mem[j],
' ',
'-')) {
1003 ct -= (i - (j - 1));
1004 cnr -= (i - (j - 1));
1005 if (mem[j] ==
' ') {
1008 if (mem[j] ==
'-') {
1022 if (tb_scale.
h == 0.0f) {
1032 if (ascii ==
'\n' || ascii == 0 || ct->dobreak) {
1040 lineinfo[lnr].
x_min = (xof - xtrax) - tb_scale.
x;
1041 lineinfo[lnr].
x_max = tb_scale.
w;
1047 if ((tb_scale.
h != 0.0f) && ((-(yof - tb_scale.
y)) > (tb_scale.
h - linedist) - yof_scale)) {
1048 if (cu->
totbox > (curbox + 1)) {
1051 i_textbox_array[curbox] = i + 1;
1057 else if (last_line == -1) {
1058 last_line = lnr + 1;
1065 current_line_length += twidth;
1068 longest_line_length =
MAX2(current_line_length, longest_line_length);
1069 current_line_length = 0.0f;
1077 else if (ascii ==
'\t') {
1086 tabfac = 2.0f *
ceilf(tabfac / 2.0f);
1098 if (selboxes && (i >= selstart) && (i <= selend)) {
1099 sb = &selboxes[i - selstart];
1100 sb->
y = yof * font_size - linedist * font_size * 0.1f;
1101 sb->
h = linedist * font_size;
1102 sb->
w = xof * font_size;
1116 xof += (twidth * wsfac * (1.0f + (info->
kern / 40.0f))) + xtrax;
1119 sb->
w = (xof * font_size) - sb->
w;
1127 longest_line_length =
MAX2(current_line_length, longest_line_length);
1130 for (i = 0; i <= slen; i++) {
1132 ct = &chartransdata[i];
1133 if (ascii ==
'\n' || ct->dobreak) {
1146 for (i = 0, li = lineinfo; i < lnr; i++, li++) {
1150 for (i = 0; i <= slen; i++) {
1151 ct->xof += lineinfo[ct->linenr].
x_min;
1158 for (i = 0, li = lineinfo; i < lnr; i++, li++) {
1162 for (i = 0; i <= slen; i++) {
1163 ct->xof += lineinfo[ct->linenr].
x_min;
1170 for (i = 0, li = lineinfo; i < lnr; i++, li++) {
1177 for (i = 0; i <= slen; i++) {
1178 for (j = i; (!
ELEM(mem[j],
'\0',
'\n')) && (chartransdata[j].dobreak == 0) && (j < slen);
1184 ct->xof += ct->charnr * lineinfo[ct->linenr].
x_min;
1190 float curofs = 0.0f;
1191 for (i = 0; i <= slen; i++) {
1192 for (j = i; (mem[j]) && (mem[j] !=
'\n') && (chartransdata[j].
dobreak == 0) && (j < slen);
1197 if ((mem[j] !=
'\n') && ((chartransdata[j].
dobreak != 0))) {
1198 if (mem[i] ==
' ') {
1201 li = &lineinfo[ct->linenr];
1206 if (mem[i] ==
'\n' || chartransdata[i].dobreak) {
1216 if (tb_scale.
h != 0.0f) {
1219 for (
int tb_index = 0; tb_index < cu->
totbox; tb_index++) {
1221 const int i_textbox = i_textbox_array[tb_index];
1222 const int i_textbox_next = i_textbox_array[tb_index + 1];
1223 const bool is_last_filled_textbox =
ELEM(i_textbox_next, 0, slen + 1);
1226 ct_first = chartransdata + i_textbox;
1227 ct_last = chartransdata + (is_last_filled_textbox ? slen : i_textbox_next - 1);
1233 if ((tb_index == cu->
totbox - 1) && (last_line != -1)) {
1234 lines = last_line - ct_first->
linenr;
1240 const float textbox_y_origin = 1.0f;
1251 (tb_scale.
h * 0.5f) + textbox_y_origin);
1254 yoff = textbox_y_origin + ((lines - 1) * linedist) - tb_scale.
h;
1257 yoff = textbox_y_origin + ((lines - 1) * linedist) - tb_scale.
h +
vfont_descent(vfd);
1261 for (ct = ct_first; ct <= ct_last; ct++) {
1265 if (is_last_filled_textbox) {
1284 yoff = (lnr - 1) * linedist;
1292 for (i = 0; i <= slen; i++) {
1308 float distfac, imat[4][4], imat3[3][3], cmat[3][3];
1310 float timeofs, sizefac;
1325 minx = maxx = ct->
xof;
1327 for (i = 1; i <= slen; i++, ct++) {
1328 if (minx > ct->xof) {
1331 if (maxx < ct->
xof) {
1339 const float chartrans_size_x = maxx - minx;
1340 if (chartrans_size_x != 0.0f) {
1343 distfac = (sizefac * totdist) / chartrans_size_x;
1344 distfac = (distfac > 1.0f) ? (1.0f / distfac) : 1.0f;
1353 if (distfac < 1.0f) {
1357 timeofs = 1.0f - distfac;
1360 timeofs = (1.0f - distfac) / 2.0f;
1367 if (chartrans_size_x != 0.0f) {
1368 distfac /= chartrans_size_x;
1371 timeofs += distfac * cu->
xof;
1374 for (i = 0; i <= slen; i++, ct++) {
1375 float ctime, dtime, vec[4], rotvec[3];
1379 info = &custrinfo[i];
1382 ascii = towupper(ascii);
1389 dtime = distfac * 0.5f * twidth;
1391 ctime = timeofs + distfac * (ct->xof - minx);
1392 CLAMP(ctime, 0.0f, 1.0f);
1408 ct->xof = vec[0] + si *
yof;
1409 ct->yof = vec[1] + co *
yof;
1411 if (selboxes && (i >= selstart) && (i <= selend)) {
1413 sb = &selboxes[i - selstart];
1422 for (i = 0; i <= selend; i++, ct++) {
1423 if (i >= selstart) {
1424 selboxes[i - selstart].
x = ct->xof * font_size;
1425 selboxes[i - selstart].
y = ct->yof * font_size;
1432 ct = &chartransdata[ef->
pos];
1443 lnr = ct->linenr - 1;
1446 lnr = ct->linenr + 1;
1449 lnr = ct->linenr - 10;
1452 lnr = ct->linenr + 10;
1459 for (i = 0; i < slen; i++) {
1460 if (ct->linenr == lnr) {
1461 if ((ct->charnr == cnr) || ((ct + 1)->charnr == 0)) {
1465 else if (ct->linenr > lnr) {
1478 ct = &chartransdata[ef->
pos];
1484 f[0] = font_size * (-0.1f * co + ct->xof);
1485 f[1] = font_size * (0.1f * si + ct->yof);
1487 f[2] = font_size * (0.1f * co + ct->xof);
1488 f[3] = font_size * (-0.1f * si + ct->yof);
1490 f[4] = font_size * (0.1f * co + 0.8f * si + ct->xof);
1491 f[5] = font_size * (-0.1f * si + 0.8f * co + ct->yof);
1493 f[6] = font_size * (-0.1f * co + 0.8f * si + ct->xof);
1494 f[7] = font_size * (0.1f * si + 0.8f * co + ct->yof);
1499 chartransdata =
NULL;
1506 for (i = 0; i < slen; i++) {
1507 unsigned int cha = (
unsigned int)mem[i];
1508 info = &(custrinfo[i]);
1516 cha = towupper(cha);
1532 float ulwidth, uloverlap = 0.0f;
1535 if ((i < (slen - 1)) && (mem[i + 1] !=
'\n') &&
1538 uloverlap = xtrax + 0.1f;
1545 ulwidth = (twidth * (1.0f + (info->
kern / 40.0f))) + uloverlap;
1547 rect.
xmin = ct->xof;
1550 rect.
ymin = ct->yof;
1554 cu, r_nubase, &rect, cu->
ulpos - 0.05f, ct->rot, i, info->
mat_nr, font_size);
1568 else if ((tb_scale.
h == 0.0f) && (tb_scale.
w == 0.0f)) {
1572 if ((cu->
totbox == 1) && ((tb_scale.
w == 0.0f) || (tb_scale.
h == 0.0f))) {
1574 if (tb_scale.
w == 0.0f) {
1577 if ((last_line != -1) && (lnr > last_line)) {
1578 const float total_text_height = lnr * linedist;
1584 else if (tb_scale.
h == 0.0f) {
1586 if (longest_line_length > tb_scale.
w) {
1588 float scale_to_fit = tb_scale.
w / longest_line_length;
1606 for (
int tb_index = 0; tb_index <= curbox; tb_index++) {
1608 if ((tb->
w == 0.0f) || (tb->
h == 0.0f)) {
1614 if (valid && (last_line != -1) && (lnr > last_line)) {
1615 const float total_text_height = lnr * linedist;
1616 float scale_to_fit = tb_scale.
h / total_text_height;
1630 if ((last_line != -1) && (lnr > last_line)) {
1661 if (r_nubase !=
NULL) {
1665 if (chartransdata !=
NULL) {
1680 *r_text_free = (ef ==
NULL);
1688 if (chartransdata) {
1689 if (ok && r_chartransdata) {
1690 *r_chartransdata = chartransdata;
1713 const char32_t **r_text,
1720 .scale_to_fit = 1.0f,
1728 ob, cu, mode, &
data, r_nubase, r_text, r_text_len, r_text_free, r_chartransdata);
1734 #undef FONT_TO_CURVE_SCALE_ITERATIONS
1735 #undef FONT_TO_CURVE_SCALE_THRESHOLD
1789 memcpy(text, text_buf,
len *
sizeof(*text));
1803 size_t *r_len_utf32)
typedef float(TangentPoint)[2]
bool BKE_where_on_path(const struct Object *ob, float ctime, float r_vec[4], float r_dir[3], float r_quat[4], float *r_radius, float *r_weight)
float BKE_anim_path_get_length(const struct CurveCache *curve_cache)
bool BKE_bpath_foreach_path_fixed_process(struct BPathForeachPathData *bpath_data, char *path)
@ BKE_BPATH_FOREACH_PATH_SKIP_PACKED
void BKE_nurbList_free(struct ListBase *lb)
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
@ IDTYPE_FLAGS_NO_ANIMDATA
@ LIB_ID_CREATE_NO_USER_REFCOUNT
void * BKE_libblock_alloc(struct Main *bmain, short type, const char *name, int flag) ATTR_WARN_UNUSED_RESULT
void id_us_plus(struct ID *id)
void BKE_id_blend_write(struct BlendWriter *writer, struct ID *id)
const char * BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL()
struct PackedFile * BKE_packedfile_new(struct ReportList *reports, const char *filepath, const char *basepath)
struct PackedFile * BKE_packedfile_new_from_memory(void *mem, int memlen)
struct PackedFile * BKE_packedfile_duplicate(const struct PackedFile *pf_src)
void BKE_packedfile_blend_write(struct BlendWriter *writer, struct PackedFile *pf)
void BKE_packedfile_blend_read(struct BlendDataReader *reader, struct PackedFile **pf_p)
void BKE_packedfile_free(struct PackedFile *pf)
A structure to represent vector fonts, and to load them from PostScript fonts.
VFontData * BKE_vfontdata_from_freetypefont(struct PackedFile *pf)
VChar * BKE_vfontdata_char_from_freetypefont(struct VFont *vfont, unsigned long character)
VFontData * BKE_vfontdata_copy(const VFontData *vfont_src, int flag)
#define BLI_assert_msg(a, msg)
BLI_INLINE void * BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
#define GHASH_ITER(gh_iter_, ghash_)
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE int compare_ff_relative(float a, float b, float max_diff, int max_ulps)
void copy_m3_m4(float m1[3][3], const float m2[4][4])
void unit_m4(float m[4][4])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
MINLINE void copy_v4_fl4(float v[4], float x, float y, float z, float w)
MINLINE float normalize_v3(float r[3])
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void mul_v3_fl(float r[3], float f)
void BLI_split_file_part(const char *string, char *file, size_t filelen)
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
size_t BLI_str_utf8_as_utf32(char32_t *__restrict dst_w, const char *__restrict src_c, size_t maxncpy) ATTR_NONNULL(1
size_t size_t size_t BLI_str_utf32_as_utf8_len(const char32_t *src) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
pthread_rwlock_t ThreadRWMutex
#define THREAD_LOCK_WRITE
#define BLI_RWLOCK_INITIALIZER
void BLI_rw_mutex_lock(ThreadRWMutex *mutex, int mode)
void BLI_rw_mutex_unlock(ThreadRWMutex *mutex)
#define POINTER_FROM_UINT(i)
#define BLO_write_id_struct(writer, struct_name, id_address, id)
bool BLO_write_is_undo(BlendWriter *writer)
#define BLT_I18NCONTEXT_ID_VFONT
#define CLOG_ERROR(clg_ref,...)
#define CLOG_WARN(clg_ref,...)
#define ID_BLEND_PATH_FROM_GLOBAL(_id)
#define ID_BLEND_PATH(_bmain, _id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
@ CU_ALIGN_Y_BOTTOM_BASELINE
@ CU_ALIGN_Y_TOP_BASELINE
@ CU_CHINFO_SMALLCAPS_CHECK
Object is a sort of wrapper for general info.
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
Read Guarded memory(de)allocation.
static void init_data(ModifierData *md)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
#define pf(_x, _i)
Prefetch 64.
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_calloc_arrayN)(size_t len, size_t size, const char *str)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
bool is_builtin(const void *UNUSED(owner), const AttributeIDRef &attribute_id)
T safe_divide(const T &a, const T &b)
const float * anim_path_accum_length
struct EditFont * editfont
struct CharInfo * strinfo
struct Object * textoncurve
EditFontSelBox * selboxes
struct CharInfo * textbufinfo
struct CurveCache * curve_cache
struct GHash * characters
struct VFontToCurveIter::@107 bisect
struct PackedFile * temp_pf
struct PackedFile * packedfile
static PackedFile * get_builtin_packedfile(void)
VFont * BKE_vfont_load_exists(struct Main *bmain, const char *filepath)
static void vfont_init_data(ID *id)
VFont * BKE_vfont_load_exists_ex(struct Main *bmain, const char *filepath, bool *r_exists)
@ VFONT_TO_CURVE_SCALE_ONCE
void BKE_vfont_select_clamp(Object *ob)
static struct @106 g_vfont_clipboard
static float char_width(Curve *cu, VChar *che, CharInfo *info)
static float vfont_descent(const VFontData *vfd)
VFont * BKE_vfont_builtin_get(void)
static int builtin_font_size
bool BKE_vfont_to_curve(Object *ob, int mode)
void BKE_vfont_free_data(struct VFont *vfont)
void BKE_vfont_build_char(Curve *cu, ListBase *nubase, unsigned int character, CharInfo *info, float ofsx, float ofsy, float rot, int charidx, const float fsize)
static void vfont_blend_read_data(BlendDataReader *reader, ID *id)
static VChar * find_vfont_char(VFontData *vfd, unsigned int character)
static const void * builtin_font_data
int BKE_vfont_select_get(Object *ob, int *r_start, int *r_end)
static void vfont_foreach_path(ID *id, BPathForeachPathData *bpath_data)
static ThreadRWMutex vfont_rwlock
bool BKE_vfont_to_curve_ex(Object *ob, Curve *cu, int mode, ListBase *r_nubase, const char32_t **r_text, int *r_text_len, bool *r_text_free, struct CharTrans **r_chartransdata)
static float vfont_ascent(const VFontData *vfd)
static VFont * which_vfont(Curve *cu, CharInfo *info)
static void build_underline(Curve *cu, ListBase *nubase, const rctf *rect, float yofs, float rot, int charidx, short mat_nr, const float font_size)
void BKE_vfont_clipboard_set(const char32_t *text_buf, const CharInfo *info_buf, const size_t len)
VFont * BKE_vfont_load(Main *bmain, const char *filepath)
static VFontData * vfont_get_data(VFont *vfont)
bool BKE_vfont_is_builtin(const struct VFont *vfont)
#define FONT_TO_CURVE_SCALE_THRESHOLD
static void vfont_blend_write(BlendWriter *writer, ID *id, const void *id_address)
void BKE_vfont_builtin_register(const void *mem, int size)
void BKE_vfont_clipboard_get(char32_t **r_text_buf, CharInfo **r_info_buf, size_t *r_len_utf8, size_t *r_len_utf32)
static bool vfont_to_curve(Object *ob, Curve *cu, int mode, VFontToCurveIter *iter_data, ListBase *r_nubase, const char32_t **r_text, int *r_text_len, bool *r_text_free, struct CharTrans **r_chartransdata)
struct VFontToCurveIter VFontToCurveIter
bool BKE_vfont_to_curve_nubase(Object *ob, int mode, ListBase *r_nubase)
#define FONT_TO_CURVE_SCALE_ITERATIONS
void BKE_vfont_clipboard_free(void)
static void textbox_scale(TextBox *tb_dst, const TextBox *tb_src, float scale)
static void vfont_free_data(ID *id)
static void vfont_copy_data(Main *UNUSED(bmain), ID *id_dst, const ID *UNUSED(id_src), const int flag)