VLC 4.0.0-dev
Loading...
Searching...
No Matches
text_style.c File Reference
Include dependency graph for text_style.c:

Macros

#define MERGE(var, fflag)
 
#define MERGE_SIZE(var)
 

Functions

text_style_ttext_style_New (void)
 Create a default text style.
 
text_style_ttext_style_Create (int i_defaults)
 Create a text style.
 
text_style_ttext_style_Copy (text_style_t *p_dst, const text_style_t *p_src)
 Copy a text style into another.
 
void text_style_Merge (text_style_t *p_dst, const text_style_t *p_src, bool b_override)
 Merge two styles using non default values.
 
text_style_ttext_style_Duplicate (const text_style_t *p_src)
 Duplicate a text style.
 
void text_style_Delete (text_style_t *p_style)
 Delete a text style created by text_style_New or text_style_Duplicate.
 
void text_segment_ruby_ChainDelete (text_segment_ruby_t *p_ruby)
 Deletes a ruby sections chain.
 
text_segment_ruby_ttext_segment_ruby_New (const char *psz_base, const char *psz_rt)
 This function will create a ruby section for a text_segment.
 
static text_segment_ruby_ttext_segment_ruby_Duplicate (const text_segment_ruby_t *p_src)
 
text_segment_ttext_segment_New (const char *psz_text)
 This function will create a new text segment.
 
text_segment_ttext_segment_NewInheritStyle (const text_style_t *p_style)
 This function will create a new text segment and duplicates the style passed as argument.
 
text_segment_ttext_segment_FromRuby (text_segment_ruby_t *p_ruby)
 This function creates a text segment from a ruby section, and creates fallback string.
 
void text_segment_Delete (text_segment_t *segment)
 Delete a text segment and its content.
 
void text_segment_ChainDelete (text_segment_t *segment)
 This function will destroy a list of text segments allocated by text_segment_New.
 
text_segment_ttext_segment_Copy (text_segment_t *p_src)
 This function will copy a text_segment and its chain into a new one.
 
unsigned int vlc_html_color (const char *psz_value, bool *ok)
 Returns an integer representation of an HTML color.
 

Variables

struct { 
 
   const char *   psz_name 
 
   uint32_t   i_value 
 
p_html_colors [] 
 

Macro Definition Documentation

◆ MERGE

#define MERGE (   var,
  fflag 
)
Value:
if( (p_src->i_features & fflag) && (b_override || !(p_dst->i_features & fflag)) )\
p_dst->var = p_src->var

◆ MERGE_SIZE

#define MERGE_SIZE (   var)
Value:
if( p_src->var > 0 && (b_override || p_dst->var <= 0) )\
p_dst->var = p_src->var

Function Documentation

◆ text_segment_ChainDelete()

void text_segment_ChainDelete ( text_segment_t segment)

This function will destroy a list of text segments allocated by text_segment_New.

You may pass it NULL.

References text_segment_t::p_next, and text_segment_Delete().

Referenced by subpicture_region_Delete().

◆ text_segment_Copy()

text_segment_t * text_segment_Copy ( text_segment_t p_src)

This function will copy a text_segment and its chain into a new one.

You may give it NULL, but it will return NULL.

References text_segment_t::p_next, text_segment_t::p_ruby, text_segment_t::psz_text, text_segment_t::style, text_segment_New(), text_segment_ruby_Duplicate(), text_style_Duplicate(), and unlikely.

◆ text_segment_Delete()

void text_segment_Delete ( text_segment_t segment)

Delete a text segment and its content.

This assumes the segment is not part of a chain

References text_segment_t::p_ruby, text_segment_t::psz_text, text_segment_t::style, text_segment_ruby_ChainDelete(), and text_style_Delete().

Referenced by text_segment_ChainDelete(), text_segment_NewInheritStyle(), and vout_OSDSegment().

◆ text_segment_FromRuby()

text_segment_t * text_segment_FromRuby ( text_segment_ruby_t p_ruby)

This function creates a text segment from a ruby section, and creates fallback string.

References p, text_segment_ruby_t::p_next, text_segment_t::p_ruby, text_segment_t::psz_text, and text_segment_New().

◆ text_segment_New()

text_segment_t * text_segment_New ( const char *  psz_text)

This function will create a new text segment.

You should use text_segment_ChainDelete to destroy it, to clean all the linked segments, or text_segment_Delete to free a specific one

This duplicates the string passed as argument

References text_segment_t::psz_text, and strdup().

Referenced by OSDTextUpdate(), text_segment_Copy(), text_segment_FromRuby(), text_segment_NewInheritStyle(), and vout_OSDSegment().

◆ text_segment_NewInheritStyle()

text_segment_t * text_segment_NewInheritStyle ( const text_style_t p_style)

This function will create a new text segment and duplicates the style passed as argument.

You should use text_segment_ChainDelete to destroy it, to clean all the linked segments, or text_segment_Delete to free a specific one

This doesn't initialize the text.

References text_segment_t::style, text_segment_Delete(), text_segment_New(), text_style_Duplicate(), and unlikely.

◆ text_segment_ruby_ChainDelete()

void text_segment_ruby_ChainDelete ( text_segment_ruby_t p_ruby)

◆ text_segment_ruby_Duplicate()

◆ text_segment_ruby_New()

text_segment_ruby_t * text_segment_ruby_New ( const char *  psz_base,
const char *  psz_rt 
)

This function will create a ruby section for a text_segment.

References text_segment_ruby_t::p_next, text_segment_ruby_t::psz_base, text_segment_ruby_t::psz_rt, strdup(), and text_segment_ruby_ChainDelete().

Referenced by text_segment_ruby_Duplicate().

◆ text_style_Copy()

text_style_t * text_style_Copy ( text_style_t p_dst,
const text_style_t p_src 
)

Copy a text style into another.

References text_style_t::psz_fontname, text_style_t::psz_monofontname, and strdup().

Referenced by text_style_Duplicate().

◆ text_style_Create()

text_style_t * text_style_Create ( int  i_defaults)

◆ text_style_Delete()

void text_style_Delete ( text_style_t p_style)

Delete a text style created by text_style_New or text_style_Duplicate.

References text_style_t::psz_fontname, and text_style_t::psz_monofontname.

Referenced by text_segment_Delete().

◆ text_style_Duplicate()

text_style_t * text_style_Duplicate ( const text_style_t p_src)

Duplicate a text style.

References text_style_Copy().

Referenced by text_segment_Copy(), and text_segment_NewInheritStyle().

◆ text_style_Merge()

◆ text_style_New()

text_style_t * text_style_New ( void  )

Create a default text style.

References STYLE_FULLY_SET, and text_style_Create().

◆ vlc_html_color()

unsigned int vlc_html_color ( const char *  psz_value,
bool *  ok 
)

Returns an integer representation of an HTML color.

Parameters
psz_valueAn HTML color, which can be either:
  • A standard HTML color (red, cyan, ...) as defined in p_html_colors
  • An hexadecimal color, of the form [#]RRGGBB[AA]
  • A decimal-based color, of the form rgb(RRR,GGG,BBB) or rgba(RRR,GGG,BBB,AAA)
okIf non-null, true will be stored in this pointer to signal a successful conversion

References i_value, p_html_colors, psz_name, psz_value, and strcasecmp().

Variable Documentation

◆ i_value

uint32_t i_value

Referenced by config_PutInt(), and vlc_html_color().

◆ [struct]

const struct { ... } p_html_colors[]

Referenced by vlc_html_color().

◆ psz_name

const char* psz_name

Referenced by AddCallback(), aout_EnableFilter(), config_ChainParse(), config_GetGenericDir(), config_LoadCmdLine(), config_PutPsz(), DelCallback(), demux_FilterChainNew(), demux_IsForced(), DisplayVoutTitle(), EsOutProgramEpg(), EsOutUpdateInfo(), FilterOrder(), get_java_string(), image_Ext2Fourcc(), input_Create(), input_item_AddInfo(), input_item_DelInfo(), input_item_GetInfo(), input_item_GetInfoLocked(), input_item_GetMetaExtra(), input_item_GetMetaExtraLocked(), input_item_GetName(), input_item_NewExt(), input_item_SetMetaExtra(), input_item_SetName(), InputItemVaAddInfo(), InputMetaUser(), keystore_create(), Lookup(), mrl_Parse(), platform_GetUserDir(), rdh_name_from_filename(), sout_AccessOutNew(), sout_StreamChainNew(), sout_StreamDelete(), sout_StreamNewModule(), subtitles_Detect(), Trigger(), TriggerInstanceState(), var_AddCallback(), var_AddListCallback(), var_Change(), var_CountChoices(), var_Create(), var_CreateGetAddress(), var_CreateGetBool(), var_CreateGetBoolCommand(), var_CreateGetFloat(), var_CreateGetFloatCommand(), var_CreateGetInteger(), var_CreateGetIntegerCommand(), var_CreateGetNonEmptyString(), var_CreateGetNonEmptyStringCommand(), var_CreateGetString(), var_CreateGetStringCommand(), var_DecInteger(), var_DelCallback(), var_DelListCallback(), var_Destroy(), var_Get(), var_GetAddress(), var_GetAndSet(), var_GetBool(), var_GetChecked(), var_GetFloat(), var_GetInteger(), var_GetNonEmptyString(), var_GetString(), var_IncInteger(), var_Inherit(), var_OptionParse(), var_Set(), var_SetAddress(), var_SetBool(), var_SetChecked(), var_SetFloat(), var_SetInteger(), var_SetString(), var_ToggleBool(), var_TriggerCallback(), var_Type(), video_splitter_New(), vlc_html_color(), vlc_input_attachment_New(), vlc_meta_GetExtra(), vlc_meta_InsertExtra(), vlc_meta_SetExtraWithPriority(), vlc_ml_media_update_bookmark(), vlc_rd_new(), vlc_rd_probe_add(), vlc_renderer_item_new(), vlm_ControlMediaGetByName(), vlm_ControlMediaGetId(), vlm_MediaInstanceNew(), vlm_SendEventMediaAdded(), vlm_SendEventMediaChanged(), vlm_SendEventMediaInstanceStarted(), vlm_SendEventMediaInstanceState(), vlm_SendEventMediaInstanceStopped(), and vlm_SendEventMediaRemoved().