1 #include "section_chunks.h"
2
parse_fb2_subtitle(APP * app,xmlNode * parent_node,GtkTextIter * text_buff_end)3 int parse_fb2_subtitle(APP* app, xmlNode* parent_node, GtkTextIter* text_buff_end)
4 {
5 g_return_val_if_fail(parent_node != NULL, EXIT_FAILURE);
6 g_return_val_if_fail(text_buff_end != NULL, EXIT_FAILURE);
7
8 GtkTextBuffer* text_buff = app->text_buff;
9 xmlNode* node = parent_node;
10
11 parse_fb2_id_attribute(app, parent_node, text_buff_end);
12
13 GtkTextMark* start_subtitle = gtk_text_buffer_create_mark(text_buff, NULL, text_buff_end, TRUE);
14
15 parse_fb2_p_no_tab(app, node, text_buff_end);
16
17 GtkTextIter start_subtitle_iter;
18 gtk_text_buffer_get_iter_at_mark(text_buff, &start_subtitle_iter, start_subtitle);
19 gtk_text_buffer_delete_mark(text_buff, start_subtitle);
20 gtk_text_buffer_apply_tag_by_name(text_buff, "subtitle_tag", &start_subtitle_iter, text_buff_end);
21
22 return EXIT_SUCCESS;
23 }
24