aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-05-20 17:08:31 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-05-30 15:56:16 +0200
commita766006297e8fa8b8168b7a887098d5176a87b20 (patch)
tree6aee522990538c60aaff56cbfc66fedb89d163ae /src
parentb2229a97882e31e0c89061184731082cfd13ec03 (diff)
downloadexperiment-player-a766006297e8fa8b8168b7a887098d5176a87b20.tar.gz
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
Diffstat (limited to 'src')
-rw-r--r--src/default.ui93
-rw-r--r--src/experiment-player.h2
-rw-r--r--src/main.c15
3 files changed, 98 insertions, 12 deletions
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</property>
<property name="can_focus">True</property>
<property name="position">339</property>
<child>
- <object class="GtkHBox" id="transcript_hbox">
+ <object class="GtkTable" id="transcript_table">
<property name="visible">True</property>
<property name="sensitive">False</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">3</property>
<child>
<object class="GtkExperimentTranscript" id="transcript_wizard_widget">
<property name="visible">True</property>
</object>
- <packing>
- <property name="position">0</property>
- </packing>
</child>
<child>
<object class="GtkExperimentTranscript" id="transcript_proband_widget">
<property name="visible">True</property>
</object>
<packing>
- <property name="position">1</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
</packing>
</child>
<child>
@@ -292,13 +292,90 @@ audio-volume-medium</property>
<property name="visible">True</property>
</object>
<packing>
- <property name="expand">False</property>
- <property name="position">2</property>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkDrawingArea" id="dummy_drawingarea2">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="transcript_wizard_combo">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="transcript_proband_combo">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="transcript_wizard_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ <signal name="changed" handler="generic_transcript_entry_changed_cb" object="transcript_wizard_widget"/>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="transcript_proband_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ <signal name="changed" handler="generic_transcript_entry_changed_cb" object="transcript_proband_widget"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkDrawingArea" id="dummy_drawingarea1">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
</object>
<packing>
- <property name="resize">False</property>
+ <property name="resize">True</property>
<property name="shrink">True</property>
</packing>
</child>
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;
@@ -146,6 +146,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);