aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-10-03 14:28:25 +0000
committertaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-10-03 14:28:25 +0000
commit36c105cc55ad40fab27d69b7cb31f243aa3ee35c (patch)
tree1b69a31f83b24e69661e8d7ba9d3c13fb97c51c0 /src
parentb86df90147691912d48a1e9a0108cb07c306a6ed (diff)
Reshuffle for clarity
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@148 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src')
-rw-r--r--src/displaywindow.c218
1 files changed, 109 insertions, 109 deletions
diff --git a/src/displaywindow.c b/src/displaywindow.c
index 4c7771a..8f883b7 100644
--- a/src/displaywindow.c
+++ b/src/displaywindow.c
@@ -39,55 +39,6 @@ enum {
DW_PERSPECTIVE
};
-static void displaywindow_about(GtkWidget *widget, DisplayWindow *dw) {
-
- GtkWidget *window;
-
- const gchar *authors[] = {
- "Thomas White <taw27@cam.ac.uk>",
- "Gordon Ball <gfb21@cam.ac.uk>",
- "Paul Midgley <pam33@cam.ac.uk>",
- NULL
- };
-
- window = gtk_about_dialog_new();
-
- gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(window), PACKAGE_NAME);
- gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(window), PACKAGE_VERSION);
- gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(window), "(c) 2006-2007 Thomas White and contributors");
- gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(window), "Diffraction Tomography Reconstruction");
- gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(window), "(c) 2006-2007 Thomas White <taw27@cam.ac.uk>\n"
- "Virtual trackball (c) Copyright 1993, 1994, Silicon Graphics, Inc.\n"
- "See Credits for a full list of contributors\n"
- "\n"
- "Research funded by:\n"
- "FEI Electron Optics B.V.\n"
- "The Engineering and Physical Sciences Research Council");
- gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(window), "http://www-hrem.msm.cam.ac.uk/");
- gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(window), authors);
-
- g_signal_connect(window, "response", G_CALLBACK(gtk_widget_destroy), NULL);
-
- gtk_widget_show_all(window);
-
-}
-
-static void displaywindow_close(GtkWidget *widget, DisplayWindow *dw) {
- gtk_exit(0);
-}
-
-static void displaywindow_dirax(GtkWidget *widget, DisplayWindow *dw) {
- dirax_invoke(dw->ctx);
-}
-
-static void displaywindow_reproject(GtkWidget *widget, DisplayWindow *dw) {
- reproject_open(dw->ctx);
-}
-
-static void displaywindow_dirax_stop(GtkWidget *widget, DisplayWindow *dw) {
- dirax_stop(dw->ctx);
-}
-
static void displaywindow_gl_set_ortho(DisplayWindow *dw, GLfloat w, GLfloat h) {
glMatrixMode(GL_PROJECTION);
@@ -147,66 +98,6 @@ static gint displaywindow_changecube(GtkWidget *widget, DisplayWindow *dw) {
return 0;
}
-static void displaywindow_addui_callback(GtkUIManager *ui, GtkWidget *widget, GtkContainer *container) {
-
- gtk_box_pack_start(GTK_BOX(container), widget, FALSE, FALSE, 0);
-
- /* Enable overflow menu if this is a toolbar */
- if ( GTK_IS_TOOLBAR(widget) ) {
- gtk_toolbar_set_show_arrow(GTK_TOOLBAR(widget), TRUE);
- }
-
-}
-
-static void displaywindow_addmenubar(DisplayWindow *dw) {
-
- GtkActionEntry entries[] = {
-
- { "FileAction", NULL, "_File", NULL, NULL, NULL },
- { "CloseAction", GTK_STOCK_QUIT, "_Quit", NULL, NULL, G_CALLBACK(displaywindow_close) },
-
- { "ViewAction", NULL, "_View", NULL, NULL, NULL },
-
- { "ToolsAction", NULL, "_Tools", NULL, NULL, NULL },
- { "DirAxAction", GTK_STOCK_EXECUTE, "Start _DirAx", "<Ctrl>D", NULL, G_CALLBACK(displaywindow_dirax) },
- { "StopDirAxAction", GTK_STOCK_CLOSE, "Stop DirAx", "<Ctrl>D", NULL, G_CALLBACK(displaywindow_dirax_stop) },
- { "ReprojectAction", NULL, "_Reproject Diffraction Patterns", "<Ctrl>R", NULL, G_CALLBACK(displaywindow_reproject) },
-
- { "HelpAction", NULL, "_Help", NULL, NULL, NULL },
- { "AboutAction", GTK_STOCK_ABOUT, "_About DTR...", NULL, NULL, G_CALLBACK(displaywindow_about) },
-
- };
- guint n_entries = G_N_ELEMENTS(entries);
- GtkRadioActionEntry radios[] = {
- { "OrthoAction", NULL, "_Orthographic", NULL, NULL, DW_ORTHO },
- { "PerspectiveAction", NULL, "_Perspective", NULL, NULL, DW_PERSPECTIVE },
- };
- guint n_radios = G_N_ELEMENTS(radios);
- GtkToggleActionEntry toggles[] = {
- { "CubeAction", NULL, "100 nm^-1 _cube", "<Ctrl>C", NULL, G_CALLBACK(displaywindow_changecube), TRUE },
- };
- guint n_toggles = G_N_ELEMENTS(toggles);
-
- GError *error = NULL;
-
- dw->action_group = gtk_action_group_new("dtrdisplaywindow");
- gtk_action_group_add_actions(dw->action_group, entries, n_entries, dw);
- gtk_action_group_add_radio_actions(dw->action_group, radios, n_radios, -1, G_CALLBACK(displaywindow_changeview), dw);
- gtk_action_group_add_toggle_actions(dw->action_group, toggles, n_toggles, dw);
-
- dw->ui = gtk_ui_manager_new();
- gtk_ui_manager_insert_action_group(dw->ui, dw->action_group, 0);
- g_signal_connect(dw->ui, "add_widget", G_CALLBACK(displaywindow_addui_callback), dw->bigvbox);
- if ( gtk_ui_manager_add_ui_from_file(dw->ui, DATADIR"/dtr/displaywindow.ui", &error) == 0 ) {
- fprintf(stderr, "Error loading message window menu bar: %s\n", error->message);
- return;
- }
-
- gtk_window_add_accel_group(GTK_WINDOW(dw->window), gtk_ui_manager_get_accel_group(dw->ui));
- gtk_ui_manager_ensure_update(dw->ui);
-
-}
-
static gboolean displaywindow_gl_button_press(GtkWidget *widget, GdkEventButton *event, DisplayWindow *dw) {
dw->x_start = event->x;
dw->y_start = event->y;
@@ -873,6 +764,115 @@ static gint displaywindow_closedown(GtkWidget *widget, DisplayWindow *dw) {
return 0;
}
+static void displaywindow_about(GtkWidget *widget, DisplayWindow *dw) {
+
+ GtkWidget *window;
+
+ const gchar *authors[] = {
+ "Thomas White <taw27@cam.ac.uk>",
+ "Gordon Ball <gfb21@cam.ac.uk>",
+ "Paul Midgley <pam33@cam.ac.uk>",
+ NULL
+ };
+
+ window = gtk_about_dialog_new();
+
+ gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(window), PACKAGE_NAME);
+ gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(window), PACKAGE_VERSION);
+ gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(window), "(c) 2006-2007 Thomas White and contributors");
+ gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(window), "Diffraction Tomography Reconstruction");
+ gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(window), "(c) 2006-2007 Thomas White <taw27@cam.ac.uk>\n"
+ "Virtual trackball (c) Copyright 1993, 1994, Silicon Graphics, Inc.\n"
+ "See Credits for a full list of contributors\n"
+ "\n"
+ "Research funded by:\n"
+ "FEI Electron Optics B.V.\n"
+ "The Engineering and Physical Sciences Research Council");
+ gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(window), "http://www-hrem.msm.cam.ac.uk/");
+ gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(window), authors);
+
+ g_signal_connect(window, "response", G_CALLBACK(gtk_widget_destroy), NULL);
+
+ gtk_widget_show_all(window);
+
+}
+
+static void displaywindow_close(GtkWidget *widget, DisplayWindow *dw) {
+ gtk_exit(0);
+}
+
+static void displaywindow_dirax(GtkWidget *widget, DisplayWindow *dw) {
+ dirax_invoke(dw->ctx);
+}
+
+static void displaywindow_reproject(GtkWidget *widget, DisplayWindow *dw) {
+ reproject_open(dw->ctx);
+}
+
+static void displaywindow_dirax_stop(GtkWidget *widget, DisplayWindow *dw) {
+ dirax_stop(dw->ctx);
+}
+
+static void displaywindow_addui_callback(GtkUIManager *ui, GtkWidget *widget, GtkContainer *container) {
+
+ gtk_box_pack_start(GTK_BOX(container), widget, FALSE, FALSE, 0);
+
+ /* Enable overflow menu if this is a toolbar */
+ if ( GTK_IS_TOOLBAR(widget) ) {
+ gtk_toolbar_set_show_arrow(GTK_TOOLBAR(widget), TRUE);
+ }
+
+}
+
+static void displaywindow_addmenubar(DisplayWindow *dw) {
+
+ GtkActionEntry entries[] = {
+
+ { "FileAction", NULL, "_File", NULL, NULL, NULL },
+ { "CloseAction", GTK_STOCK_QUIT, "_Quit", NULL, NULL, G_CALLBACK(displaywindow_close) },
+
+ { "ViewAction", NULL, "_View", NULL, NULL, NULL },
+
+ { "ToolsAction", NULL, "_Tools", NULL, NULL, NULL },
+ { "DirAxAction", GTK_STOCK_EXECUTE, "Start _DirAx", "<Ctrl>D", NULL, G_CALLBACK(displaywindow_dirax) },
+ { "StopDirAxAction", GTK_STOCK_CLOSE, "Stop DirAx", "<Ctrl>D", NULL, G_CALLBACK(displaywindow_dirax_stop) },
+ { "ReprojectAction", NULL, "_Reproject Diffraction Patterns", "<Ctrl>R", NULL, G_CALLBACK(displaywindow_reproject) },
+
+ { "HelpAction", NULL, "_Help", NULL, NULL, NULL },
+ { "AboutAction", GTK_STOCK_ABOUT, "_About DTR...", NULL, NULL, G_CALLBACK(displaywindow_about) },
+
+ };
+ guint n_entries = G_N_ELEMENTS(entries);
+ GtkRadioActionEntry radios[] = {
+ { "OrthoAction", NULL, "_Orthographic", NULL, NULL, DW_ORTHO },
+ { "PerspectiveAction", NULL, "_Perspective", NULL, NULL, DW_PERSPECTIVE },
+ };
+ guint n_radios = G_N_ELEMENTS(radios);
+ GtkToggleActionEntry toggles[] = {
+ { "CubeAction", NULL, "100 nm^-1 _cube", "<Ctrl>C", NULL, G_CALLBACK(displaywindow_changecube), TRUE },
+ };
+ guint n_toggles = G_N_ELEMENTS(toggles);
+
+ GError *error = NULL;
+
+ dw->action_group = gtk_action_group_new("dtrdisplaywindow");
+ gtk_action_group_add_actions(dw->action_group, entries, n_entries, dw);
+ gtk_action_group_add_radio_actions(dw->action_group, radios, n_radios, -1, G_CALLBACK(displaywindow_changeview), dw);
+ gtk_action_group_add_toggle_actions(dw->action_group, toggles, n_toggles, dw);
+
+ dw->ui = gtk_ui_manager_new();
+ gtk_ui_manager_insert_action_group(dw->ui, dw->action_group, 0);
+ g_signal_connect(dw->ui, "add_widget", G_CALLBACK(displaywindow_addui_callback), dw->bigvbox);
+ if ( gtk_ui_manager_add_ui_from_file(dw->ui, DATADIR"/dtr/displaywindow.ui", &error) == 0 ) {
+ fprintf(stderr, "Error loading message window menu bar: %s\n", error->message);
+ return;
+ }
+
+ gtk_window_add_accel_group(GTK_WINDOW(dw->window), gtk_ui_manager_get_accel_group(dw->ui));
+ gtk_ui_manager_ensure_update(dw->ui);
+
+}
+
DisplayWindow *displaywindow_open(ControlContext *ctx) {
const char *filename;