From a766006297e8fa8b8168b7a887098d5176a87b20 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 20 May 2012 17:08:31 +0200 Subject: implemented "format" file and expression parsing as well as application to the transcript * "formats" are regular expressions encapsulated in Pango markup that allow the description of powerful highlighting rules * highlight as you type via entry boxes * loading from files implemented and tested but cannot yet be done via the UI * transcript widget is built as libtool convenience library * some renamings were necessary * install transcript widget header --- src/default.ui | 93 ++++++++++++++++++++++++++++++++++++++++++++----- src/experiment-player.h | 2 +- src/main.c | 15 ++++++-- 3 files changed, 98 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/default.ui b/src/default.ui index 3ab26f3..a375f54 100644 --- a/src/default.ui +++ b/src/default.ui @@ -268,23 +268,23 @@ audio-volume-medium True 339 - + True False + 3 + 3 True - - 0 - True - 1 + 1 + 2 @@ -292,13 +292,90 @@ audio-volume-medium True - False - 2 + 2 + 3 + GTK_FILL + + + + + True + + + 2 + 3 + 2 + 3 + GTK_FILL + GTK_FILL + + + + + True + + + 1 + 2 + GTK_FILL + + + + + True + + + 1 + 2 + 1 + 2 + GTK_FILL + + + + + True + True + + + + + 2 + 3 + GTK_FILL + + + + + True + True + + + + + 1 + 2 + 2 + 3 + GTK_FILL + + + + + True + + + 2 + 3 + 1 + 2 + GTK_FILL + GTK_FILL - False + True True diff --git a/src/experiment-player.h b/src/experiment-player.h index 0f32945..01c6dce 100644 --- a/src/experiment-player.h +++ b/src/experiment-player.h @@ -14,7 +14,7 @@ extern GtkWidget *player_widget, *playpause_button, *volume_button; -extern GtkWidget *transcript_hbox, +extern GtkWidget *transcript_table, *transcript_wizard_widget, *transcript_proband_widget, *transcript_scroll_widget; diff --git a/src/main.c b/src/main.c index 8901502..217b54f 100644 --- a/src/main.c +++ b/src/main.c @@ -32,7 +32,7 @@ GtkWidget *player_widget, *playpause_button, *volume_button; -GtkWidget *transcript_hbox, +GtkWidget *transcript_table, *transcript_wizard_widget, *transcript_proband_widget, *transcript_scroll_widget; @@ -145,6 +145,15 @@ help_menu_manual_item_activate_cb(GtkWidget *widget __attribute__((unused)), } } +void +generic_transcript_entry_changed_cb(gpointer user_data, GtkEditable *editable) +{ + GtkExperimentTranscript *trans = GTK_EXPERIMENT_TRANSCRIPT(user_data); + const gchar *text = gtk_entry_get_text(GTK_ENTRY(editable)); + + gtk_experiment_transcript_set_interactive_format(trans, text, TRUE); +} + void navigator_widget_time_selected_cb(GtkWidget *widget, gint64 selected_time, gpointer user_data __attribute__((unused))) @@ -218,7 +227,7 @@ load_transcript_file(const gchar *file) g_object_unref(reader); - gtk_widget_set_sensitive(transcript_hbox, TRUE); + gtk_widget_set_sensitive(transcript_table, TRUE); gtk_widget_set_sensitive(navigator_scrolledwindow, TRUE); return FALSE; @@ -279,7 +288,7 @@ main(int argc, char *argv[]) BUILDER_INIT(builder, quickopen_menu); BUILDER_INIT(builder, quickopen_menu_empty_item); - BUILDER_INIT(builder, transcript_hbox); + BUILDER_INIT(builder, transcript_table); BUILDER_INIT(builder, transcript_wizard_widget); BUILDER_INIT(builder, transcript_proband_widget); BUILDER_INIT(builder, transcript_scroll_widget); -- cgit v1.2.3