LiVES 3.2.0
pangotext.h
Go to the documentation of this file.
1// pangotext.h
2// text handling code
3// (c) A. Penkov 2010
4// pieces of code taken and modified from scribbler.c
5// released under the GNU GPL 3 or later
6// see file COPYING or www.gnu.org for details
7
8// (c) G. Finch 2002 - 2015
9
10#ifndef LIVES_PANGOTEXT_H
11#define LIVES_PANGOTEXT_H
12
13#define SUB_OPACITY 20480 // TODO
14
15typedef enum {
20
21// for future use
22typedef struct {
26
27typedef struct _lives_subtitle_t xlives_subtitle_t;
28
29typedef struct _lives_subtitle_t {
30 double start_time;
31 double end_time;
33 long textpos;
37
38typedef struct {
40 int tfile;
41 char *text;
45 int offset;
46 double last_time;
48
49typedef enum {
55
56char **get_font_list(void);
57
58weed_plant_t *render_text_overlay(weed_layer_t *layer, const char *text);
59
60weed_plant_t *render_text_to_layer(weed_layer_t *layer, const char *text, const char *fontname,
61 double size, lives_text_mode_t mode, lives_colRGBA64_t *fg_col,
62 lives_colRGBA64_t *bg_col, boolean center, boolean rising, double top);
63
64LingoLayout *render_text_to_cr(LiVESWidget *widget, lives_painter_t *, const char *text, const char *fontname,
65 double size, lives_text_mode_t mode, lives_colRGBA64_t *fg_col, lives_colRGBA64_t *bg_col,
66 boolean center, boolean rising, double *top, int *start, int dwidth, int *dheight);
67
68void layout_to_lives_painter(LingoLayout *layout, lives_painter_t *cr, lives_text_mode_t mode, lives_colRGBA64_t *fg,
69 lives_colRGBA64_t *bg, int dwidth, int dheight, double x_bg, double y_bg, double x_text, double y_text);
70
71LingoLayout *layout_nth_message_at_bottom(int n, int width, int height, LiVESWidget *widget, int *linecount);
72
74
75#define SRT_DEF_CHARSET "Windows-1252"
76#define LIVES_CHARSET_UTF8 "UTF-8"
77
78typedef struct _lives_clip_t lives_clip_t;
79
80boolean subtitles_init(lives_clip_t *sfile, char *fname, lives_subtitle_type_t);
81void subtitles_free(lives_clip_t *sfile);
82boolean get_subt_text(lives_clip_t *sfile, double xtime);
83boolean save_sub_subtitles(lives_clip_t *sfile, double start_time, double end_time, double offset_time, const char *filename);
84boolean save_srt_subtitles(lives_clip_t *sfile, double start_time, double end_time, double offset_time, const char *filename);
85
86boolean lives_parse_font_string(const char *string, char **font, int *size, char **stretch,
87 char **style, char **weight);
88
89#endif
90
weed_plant_t weed_layer_t
Definition: colourspace.h:71
weed_plant_t * render_text_to_layer(weed_layer_t *layer, const char *text, const char *fontname, double size, lives_text_mode_t mode, lives_colRGBA64_t *fg_col, lives_colRGBA64_t *bg_col, boolean center, boolean rising, double top)
Definition: pangotext.c:570
boolean subtitles_init(lives_clip_t *sfile, char *fname, lives_subtitle_type_t)
Definition: pangotext.c:996
LingoLayout * render_text_to_cr(LiVESWidget *widget, lives_painter_t *, const char *text, const char *fontname, double size, lives_text_mode_t mode, lives_colRGBA64_t *fg_col, lives_colRGBA64_t *bg_col, boolean center, boolean rising, double *top, int *start, int dwidth, int *dheight)
Definition: pangotext.c:468
LingoLayout * layout_nth_message_at_bottom(int n, int width, int height, LiVESWidget *widget, int *linecount)
Definition: pangotext.c:193
void subtitles_free(lives_clip_t *sfile)
Definition: pangotext.c:976
lives_text_mode_t
Definition: pangotext.h:49
@ LIVES_TEXT_MODE_PRECALCULATE
Definition: pangotext.h:53
@ LIVES_TEXT_MODE_BACKGROUND_ONLY
Definition: pangotext.h:52
@ LIVES_TEXT_MODE_FOREGROUND_AND_BACKGROUND
Definition: pangotext.h:51
@ LIVES_TEXT_MODE_FOREGROUND_ONLY
Definition: pangotext.h:50
boolean get_subt_text(lives_clip_t *sfile, double xtime)
Definition: pangotext.c:930
weed_plant_t * render_text_overlay(weed_layer_t *layer, const char *text)
Definition: pangotext.c:543
boolean save_srt_subtitles(lives_clip_t *sfile, double start_time, double end_time, double offset_time, const char *filename)
Definition: pangotext.c:1039
struct _lives_subtitle_t xlives_subtitle_t
Definition: pangotext.h:27
char ** get_font_list(void)
Definition: pangotext.c:416
boolean lives_parse_font_string(const char *string, char **font, int *size, char **stretch, char **style, char **weight)
Definition: pangotext.c:1182
boolean save_sub_subtitles(lives_clip_t *sfile, double start_time, double end_time, double offset_time, const char *filename)
Definition: pangotext.c:1101
void layout_to_lives_painter(LingoLayout *layout, lives_painter_t *cr, lives_text_mode_t mode, lives_colRGBA64_t *fg, lives_colRGBA64_t *bg, int dwidth, int dheight, double x_bg, double y_bg, double x_text, double y_text)
Definition: pangotext.c:165
lives_subtitle_type_t
Definition: pangotext.h:15
@ SUBTITLE_TYPE_SUB
Definition: pangotext.h:18
@ SUBTITLE_TYPE_SRT
Definition: pangotext.h:17
@ SUBTITLE_TYPE_NONE
Definition: pangotext.h:16
corresponds to one clip in the GUI
Definition: main.h:877
lives_colRGB48_t bg
Definition: pangotext.h:24
lives_colRGB48_t fg
Definition: pangotext.h:23
xlives_subtitle_t * prev
for future use
Definition: pangotext.h:34
xlives_subtitle_t * next
Definition: pangotext.h:35
lives_subtitle_style_t * style
for future use
Definition: pangotext.h:32
double start_time
Definition: pangotext.h:30
double end_time
Definition: pangotext.h:31
lives_subtitle_type_t type
Definition: pangotext.h:39
lives_subtitle_t * current
pointer to current entry in index
Definition: pangotext.h:42
lives_subtitle_t * first
Definition: pangotext.h:43
lives_subtitle_t * last
Definition: pangotext.h:44
double last_time
Definition: pangotext.h:46
int offset
offset in frames (default 0)
Definition: pangotext.h:45