97extern G_MODULE_EXPORT
void on_edit_activate (GtkWidget * widg, gpointer data);
98extern G_MODULE_EXPORT
void on_calc_activate (GtkWidget * widg, gpointer data);
102GtkWidget * MainEvent;
110 {
"edit.periodicity", GINT_TO_POINTER(1)},
111 {
"edit.cutoffs", GINT_TO_POINTER(2)}};
114 {
"analyze.sq", GINT_TO_POINTER(1)},
115 {
"analyze.sk", GINT_TO_POINTER(2)},
116 {
"analyze.gk", GINT_TO_POINTER(3)},
117 {
"analyze.bonds", GINT_TO_POINTER(4)},
118 {
"analyze.rings", GINT_TO_POINTER(5)},
119 {
"analyze.chains", GINT_TO_POINTER(6)},
120 {
"analyze.sp", GINT_TO_POINTER(7)},
121 {
"analyze.msd", GINT_TO_POINTER(8)}};
124 "S(q) from FFT[g(r)]",
125 "S(q) from Debye equation",
126 "g(r)/G(r) from FFT[S(q)]",
130 "Spherical harmonics",
131 "Mean Squared Displacement",
135 "S(q) from FFT[g(r)]",
136 "S(q) from Debye equation",
137 "g(r)/G(r) from FFT[S(q)]",
139 "Angle distributions",
142 "Spherical harmonics",
143 "Mean Squared Displacement"};
150 {
"About",
"open about dialog", GDK_KEY_a,
"<Ctrl>a" },
151 {
"Periodic table",
"open periodic table", GDK_KEY_p,
"<Ctrl>p" },
152 {
"Quit",
"quit atomes", GDK_KEY_q,
"<Ctrl>q" },
155 {
"Open workspace",
"open atomes workspace", GDK_KEY_w,
"<Ctrl>w" },
156 {
"Save workspace",
"save atomes workspace", GDK_KEY_s,
"<Ctrl>s" },
157 {
"Close workspace",
"close atomes workspace", GDK_KEY_c,
"<Ctrl>c" },
160 {
"New project",
"create new atomes project", GDK_KEY_n,
"<Ctrl>n" },
161 {
"Open project",
"open atomes project", GDK_KEY_o,
"<Ctrl>o" }
182 gchar * section_names[sections], gchar * group_names[
groups],
shortcuts shortcs[])
184 GtkShortcutsWindow * win = NULL;
186 win = g_object_new (GTK_TYPE_SHORTCUTS_WINDOW,
"modal", FALSE,
"resizable", TRUE,
"deletable", TRUE, NULL);
188 win = g_object_new (GTK_TYPE_SHORTCUTS_WINDOW,
"modal", FALSE,
"resizable", TRUE, NULL);
190 GtkShortcutsSection * shortcut_section[sections];
191 GtkShortcutsGroup * shortcut_group[
groups];
192 GtkShortcutsShortcut * shortcut;
194#if GTK_MINOR_VERSION < 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION < 4)
195 GtkWidget * sections_book = gtk_notebook_new ();
196 gtk_notebook_set_scrollable (GTK_NOTEBOOK(sections_book), TRUE);
197 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(sections_book), GTK_POS_TOP);
202 for (i=0; i<sections; i++)
204 shortcut_section[i] = g_object_new (GTK_TYPE_SHORTCUTS_SECTION,
"visible", TRUE,
"title", section_names[i],
"section-name", section_names[i], NULL);
206#if GTK_MINOR_VERSION < 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION < 4)
207 gtk_orientable_set_orientation ((GtkOrientable *)shortcut_section[i], GTK_ORIENTATION_HORIZONTAL);
210 for (j=0; j<group_by_section[i]; j++, l++)
212 shortcut_group[l] = g_object_new (GTK_TYPE_SHORTCUTS_GROUP,
"visible", TRUE,
"title", group_names[l], NULL);
213 for (k=0; k<shortcut_by_group[l]; k++, m++)
215 shortcut = g_object_new (GTK_TYPE_SHORTCUTS_SHORTCUT,
217 "shortcut-type", GTK_SHORTCUT_ACCELERATOR,
218 "accelerator", shortcs[m].accelerator,
219 "title", shortcs[m].description,
222#if GTK_MINOR_VERSION > 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION >= 4)
223 gtk_shortcuts_group_add_shortcut (shortcut_group[l], shortcut);
225 add_box_child_start (GTK_ORIENTATION_VERTICAL, (GtkWidget *)shortcut_group[l], (GtkWidget *)shortcut, FALSE, FALSE, 0);
228 gtk_container_add (GTK_CONTAINER((GtkWidget *)shortcut_group[l]), (GtkWidget *)shortcut);
232#if GTK_MINOR_VERSION > 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION >= 4)
233 gtk_shortcuts_section_add_group (shortcut_section[i], shortcut_group[l]);
235 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, (GtkWidget *)shortcut_section[i], (GtkWidget *)shortcut_group[l], FALSE, FALSE, 0);
238 gtk_container_add (GTK_CONTAINER((GtkWidget *)shortcut_section[i]), (GtkWidget *)shortcut_group[l]);
242#if GTK_MINOR_VERSION > 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION >= 4)
243 gtk_shortcuts_window_add_section (GTK_SHORTCUTS_WINDOW(win), shortcut_section[i]);
245 gtk_notebook_append_page (GTK_NOTEBOOK(sections_book), (GtkWidget *)shortcut_section[i], gtk_label_new (section_names[i]));
248 gtk_container_add (GTK_CONTAINER((GtkWidget *)win), (GtkWidget *)shortcut_section[i]);
252#if GTK_MINOR_VERSION < 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION < 4)
253 gtk_window_set_child ((GtkWindow*) win, sections_book);
258 return (GtkWidget *)win;
271G_MODULE_EXPORT gboolean pop_menu (GtkWidget * widget, GdkEventButton * event, gpointer data)
273 if (event -> button == 3)
292 gtk_widget_set_size_request (
atomes_logo, 550, -1);
297 gtk_container_add (GTK_CONTAINER(MainEvent),
atomes_logo);
315 gtk_scrolled_window_set_child ((GtkScrolledWindow *)
MainScrol[1], NULL);
318 gboolean add = FALSE;
322 gtk_text_view_set_editable (GTK_TEXT_VIEW(
MainView), 0);
326 gtk_text_view_set_buffer (GTK_TEXT_VIEW(
MainView), buffer);
331 gtk_container_add (GTK_CONTAINER(MainEvent),
MainScrol[1]);
354 if (state & GDK_CONTROL_MASK)
464 gchar * name = g_strdup_printf (
"%s", g_action_get_name(G_ACTION(
action)));
465 if (g_strcmp0 (name,
"workspace.open") == 0)
469 else if (g_strcmp0 (name,
"workspace.save") == 0)
473 else if (g_strcmp0 (name,
"workspace.save-as") == 0)
477 else if (g_strcmp0 (name,
"workspace.close") == 0)
481 else if (g_strcmp0 (name,
"project.new") == 0)
485 else if (g_strcmp0 (name,
"project.edit") == 0)
489 else if (g_strcmp0 (name,
"project.active") == 0)
493 else if (g_strcmp0 (name,
"project.compute") == 0)
497 else if (g_strcmp0 (name,
"project.open") == 0)
501 else if (g_strcmp0 (name,
"project.save") == 0)
505 else if (g_strcmp0 (name,
"project.save-as") == 0)
509 else if (g_strcmp0 (name,
"project.close") == 0)
513 else if (g_strcmp0 (name,
"export.isaacs") == 0)
517 else if (g_strcmp0 (name,
"export.coordinates") == 0)
521 else if (g_strcmp0 (name,
"import.isaacs") == 0)
525 else if (g_strcmp0 (name,
"import.coordinates") == 0)
529 else if (g_strcmp0 (name,
"program.quit") == 0)
533 else if (g_strcmp0 (name,
"edit.chemistry") == 0)
537 else if (g_strcmp0 (name,
"edit.periodicity") == 0)
541 else if (g_strcmp0 (name,
"edit.cutoffs") == 0)
545 else if (g_strcmp0 (name,
"analyze.gr") == 0)
549 else if (g_strcmp0 (name,
"analyze.sq") == 0)
553 else if (g_strcmp0 (name,
"analyze.sk") == 0)
557 else if (g_strcmp0 (name,
"analyze.gk") == 0)
561 else if (g_strcmp0 (name,
"analyze.bonds") == 0)
565 else if (g_strcmp0 (name,
"analyze.rings") == 0)
569 else if (g_strcmp0 (name,
"analyze.chains") == 0)
573 else if (g_strcmp0 (name,
"analyze.sp") == 0)
577 else if (g_strcmp0 (name,
"analyze.msd") == 0)
581 else if (g_strcmp0 (name,
"analyze.tool-box") == 0)
585 else if (g_strcmp0 (name,
"help.periodic") == 0)
589 else if (g_strcmp0 (name,
"help.about") == 0)
593 else if (g_strcmp0 (name,
"help.shortcuts") == 0)
599 else if (g_strcmp0 (name,
"help.preferences") == 0)
619 return g_file_icon_new (g_file_new_for_path (icon));
622 return g_themed_icon_new (icon);
645void widget_add_action (GSimpleActionGroup * action_group,
const gchar * act, GCallback handler, gpointer data,
646 gboolean check, gboolean
status, gboolean radio,
const gchar * stat)
649 GVariant * action_state;
652 action_state = g_variant_new_string (stat);
653 action = g_simple_action_new_stateful (act, G_VARIANT_TYPE_STRING, action_state);
657 action_state = g_variant_new_boolean (
status);
658 action = g_simple_action_new_stateful (act, NULL, action_state);
662 action = g_simple_action_new (act, NULL);
664 g_signal_connect (
action,
"activate", handler, data);
665 g_action_map_add_action (G_ACTION_MAP(action_group), G_ACTION(
action));
687 const gchar * custom,
int format,
const gchar * icon,
688 gboolean check, gboolean
status, gboolean radio,
const gchar * rstatus)
695 g_menu_item_set_attribute (item,
"use-markup",
"s",
"TRUE", NULL);
698 g_menu_item_set_attribute (item,
"custom",
"s", custom, NULL);
700 GVariant * cust = g_menu_item_get_attribute_value (item,
"custom", g_variant_type_new(
"s"));
701 if (cust) g_print (
"item :: %s, custom :: %s\n",
label, g_variant_get_string (cust, NULL));
705 if (accel) g_menu_item_set_attribute (item,
"accel",
"s", accel, NULL);
707 if (radio) g_menu_item_set_attribute (item,
"target",
"s", rstatus, NULL);
714 g_menu_item_set_icon (item, gicon);
715 g_object_unref (gicon);
734 GMenuItem * item = g_menu_item_new (
label, NULL);
738 g_menu_item_set_attribute (item,
"use-markup",
"s",
"TRUE", NULL);
739 g_menu_item_set_submenu (item, (GMenuModel *)submenu);
740 g_menu_append_item (menu, item);
763 const gchar * custom,
int format,
const gchar * icon,
764 gboolean check, gboolean
status, gboolean radio,
const gchar * rstatus)
767 g_menu_append_item (menu, item);
768 g_object_unref (item);
781 GMenu * menu = g_menu_new ();
783 str = g_strdup_printf (
"%s.workspace.open", act);
784 append_menu_item (menu,
"Open", (
const gchar *)str,
"<CTRL>W", NULL,
IMG_STOCK,
FOPEN, FALSE, FALSE, FALSE, NULL);
788 str = g_strdup_printf (
"%s.workspace.save", act);
789 append_menu_item (menu,
"Save", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
FSAVE, FALSE, FALSE, FALSE, NULL);
791 str = g_strdup_printf (
"%s.workspace.save-as", act);
792 append_menu_item (menu,
"Save As", (
const gchar *)str,
"<CTRL>S", NULL,
IMG_STOCK,
FSAVEAS, FALSE, FALSE, FALSE, NULL);
794 str = g_strdup_printf (
"%s.workspace.close", act);
795 append_menu_item (menu,
"Close", (
const gchar *)str,
"<CTRL>C", NULL,
IMG_STOCK,
FCLOSE, FALSE, FALSE, FALSE, NULL);
812 gchar * port_action[2]={
"export",
"import"};
813 GMenu * menu = g_menu_new ();
815 str = g_strdup_printf (
"%s.%s.isaacs", act, port_action[port]);
816 append_menu_item (menu,
"ISAACS Project File (*.ipf)", (
const gchar *)str, NULL, NULL,
IMG_FILE,
PACKAGE_MOL, FALSE, FALSE, FALSE, NULL);
818 str = g_strdup_printf (
"%s.%s.coordinates", act, port_action[port]);
819 append_menu_item (menu,
"Atomic Coordinates", (
const gchar *)str, NULL, NULL,
IMG_FILE, (port) ?
PACKAGE_IMP :
PACKAGE_CON, FALSE, FALSE, FALSE, NULL);
836 GMenu * menu = g_menu_new ();
837 gchar * str, * str_n;
842 str = g_strdup_printf (
"%s.project.active", act);
843 append_menu_item (menu,
"Make Active", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
YES, FALSE, FALSE, FALSE, NULL);
848 str = g_strdup_printf (
"%s.project.compute", act);
850 append_menu_item (menu, str_n, (
get_project_by_id(
proj) -> runok[calc]) ? (
const gchar *)str :
"None", NULL, NULL,
IMG_FILE,
graph_img[calc], FALSE, FALSE, FALSE, NULL);
854 str = g_strdup_printf (
"%s.project.edit", act);
855 append_menu_item (menu,
"Edit Name", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
EDITA, FALSE, FALSE, FALSE, NULL);
858 str = g_strdup_printf (
"%s.project.new", act);
859 append_menu_item (menu,
"New", (
const gchar *)str,
"<CTRL>N", NULL,
IMG_STOCK,
FNEW, FALSE, FALSE, FALSE, NULL);
861 str = g_strdup_printf (
"%s.project.open", act);
862 append_menu_item (menu,
"Open", (
const gchar *)str,
"<CTRL>O", NULL,
IMG_STOCK,
FOPEN, FALSE, FALSE, FALSE, NULL);
864 if (! pop_up ||
proj > -1)
866 str = g_strdup_printf (
"%s.project.save", act);
867 append_menu_item (menu,
"Save", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
FSAVE, FALSE, FALSE, FALSE, NULL);
869 str = g_strdup_printf (
"%s.project.save-as", act);
870 append_menu_item (menu,
"Save As", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
FSAVEAS, FALSE, FALSE, FALSE, NULL);
872 str = g_strdup_printf (
"%s.project.close", act);
873 append_menu_item (menu,
"Close", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
FCLOSE, FALSE, FALSE, FALSE, NULL);
889 GMenu * menu = g_menu_new ();
903 GMenu * menu = g_menu_new ();
904 gchar * str = g_strdup_printf (
"%s.program.quit", act);
905 append_menu_item (menu,
"Quit", (
const gchar *)str,
"<CTRL>Q", NULL,
IMG_STOCK,
FEXIT, FALSE, FALSE, FALSE, NULL);
917 GMenu * menu = g_menu_new ();
918 append_menu_item (menu,
"Workspace",
"None", NULL, NULL,
IMG_FILE,
PACKAGE_TD, FALSE, FALSE, FALSE, NULL);
932 GMenu * menu = g_menu_new ();
936 append_menu_item (menu, str,
"None", NULL, NULL,
IMG_FILE,
PACKAGE_TD, FALSE, FALSE, FALSE, NULL);
941 append_menu_item (menu,
"Project(s)",
"None", NULL, NULL,
IMG_FILE,
PACKAGE_TD, FALSE, FALSE, FALSE, NULL);
958 GMenu * menu = g_menu_new ();
963 g_menu_append_section (menu, NULL, (GMenuModel*)
import_section(act));
964 g_menu_append_section (menu, NULL, (GMenuModel*)
quit_section(act));
975 GMenu * menu = g_menu_new ();
976 append_menu_item (menu,
"Chemistry and Physics",
"app.edit.chemistry", NULL, NULL,
IMG_STOCK,
DPROPERTIES, FALSE, FALSE, FALSE, NULL);
977 append_menu_item (menu,
"Box and Periodicity",
"app.edit.periodicity", NULL, NULL,
IMG_STOCK,
DPROPERTIES, FALSE, FALSE, FALSE, NULL);
978 append_menu_item (menu,
"Bond Cutoffs",
"app.edit.cutoffs", NULL, NULL,
IMG_STOCK,
DPROPERTIES, FALSE, FALSE, FALSE, NULL);
989 GMenu * menu = g_menu_new ();
990 append_menu_item (menu,
"Toolboxes",
"app.analyze.tool-box",
"<CTRL>T", NULL,
IMG_STOCK,
PAGE_SETUP, FALSE, FALSE, FALSE, NULL);
1001 GMenu * menu = g_menu_new ();
1002 append_menu_item (menu,
"g(r) / G(r)",
"app.analyze.gr", NULL, NULL,
IMG_FILE,
PACKAGE_GR, FALSE, FALSE, FALSE, NULL);
1003 append_menu_item (menu,
"S(q) from FFT[g(r)]",
"app.analyze.sq", NULL, NULL,
IMG_FILE,
PACKAGE_SQ, FALSE, FALSE, FALSE, NULL);
1004 append_menu_item (menu,
"S(q) from Debye Eq.",
"app.analyze.sk", NULL, NULL,
IMG_FILE,
PACKAGE_SQ, FALSE, FALSE, FALSE, NULL);
1005 append_menu_item (menu,
"g(r) / G(r) from FFT[S(q)]",
"app.analyze.gk", NULL, NULL,
IMG_FILE,
PACKAGE_GR, FALSE, FALSE, FALSE, NULL);
1006 append_menu_item (menu,
"Bonds and Angles",
"app.analyze.bonds", NULL, NULL,
IMG_FILE,
PACKAGE_BD, FALSE, FALSE, FALSE, NULL);
1007 append_menu_item (menu,
"Ring statistics",
"app.analyze.rings", NULL, NULL,
IMG_FILE,
PACKAGE_RI, FALSE, FALSE, FALSE, NULL);
1008 append_menu_item (menu,
"Chain statistics",
"app.analyze.chains", NULL, NULL,
IMG_FILE,
PACKAGE_CH, FALSE, FALSE, FALSE, NULL);
1009 append_menu_item (menu,
"Spherical Harmonics",
"app.analyze.sp", NULL, NULL,
IMG_FILE,
PACKAGE_SP, FALSE, FALSE, FALSE, NULL);
1010 append_menu_item (menu,
"Mean Squared Displacement",
"app.analyze.msd", NULL, NULL,
IMG_FILE,
PACKAGE_MS, FALSE, FALSE, FALSE, NULL);
1022 GMenu * menu = g_menu_new ();
1023 append_menu_item (menu,
"Periodic Table",
"app.help.periodic",
"<CTRL>P", NULL,
IMG_STOCK,
ABOUT, FALSE, FALSE, FALSE, NULL);
1024 append_menu_item (menu,
"Preferences",
"app.help.preferences", NULL, NULL,
IMG_STOCK,
ABOUT, FALSE, FALSE, FALSE, NULL);
1025 append_menu_item (menu,
"Shortcuts",
"app.help.shortcuts", NULL, NULL,
IMG_STOCK,
ABOUT, FALSE, FALSE, FALSE, NULL);
1026 append_menu_item (menu,
"About",
"app.help.about",
"<CTRL>A", NULL,
IMG_STOCK,
ABOUT, FALSE, FALSE, FALSE, NULL);
1037 GMenu * menu = g_menu_new ();
1057G_MODULE_EXPORT
void atomes_popup_menu (GtkGesture * gesture,
int n_press,
double x,
double y, gpointer data)
1059 if (gtk_gesture_single_get_current_button ((GtkGestureSingle * )gesture) == GDK_BUTTON_SECONDARY)
1061 GtkWidget * popover =
work_menu (-1, -1);
1078G_MODULE_EXPORT gboolean on_atomes_pressed (GtkEventControllerKey * self, guint keyval, guint keycode, GdkModifierType state, gpointer data)
1097 gtk_window_set_default_icon (
THETD);
1107 GtkWidget * window = gtk_application_window_new (GTK_APPLICATION(atomes));
1108 gtk_window_set_title (GTK_WINDOW(window),
PACKAGE);
1109 gtk_window_set_resizable (GTK_WINDOW(window), TRUE);
1110 gtk_widget_set_size_request (window, 900, 450);
1112 atomes_action main_actions[] = {{
"workspace.open", GINT_TO_POINTER(2)},
1113 {
"workspace.save", GINT_TO_POINTER(3)},
1114 {
"workspace.save-as", GINT_TO_POINTER(3)},
1115 {
"workspace.close", GINT_TO_POINTER(1)},
1116 {
"project.new", NULL},
1117 {
"project.open", GINT_TO_POINTER(0)},
1118 {
"project.save", GINT_TO_POINTER(1) },
1119 {
"project.save-as", GINT_TO_POINTER(1)},
1120 {
"project.close", NULL},
1121 {
"export.isaacs", GINT_TO_POINTER(1)},
1122 {
"export.coordinates", GINT_TO_POINTER(1)},
1123 {
"import.isaacs", GINT_TO_POINTER(0)},
1124 {
"import.coordinates", GINT_TO_POINTER(0)},
1125 {
"program.quit", NULL},
1126 {
"analyze.tool-box", NULL},
1127 {
"help.periodic", NULL},
1128 {
"help.about", NULL},
1129 {
"help.shortcuts", NULL},
1130 {
"help.preferences", NULL}};
1132 GSimpleAction ** main_act = g_malloc0 (G_N_ELEMENTS(main_actions)*
sizeof*main_act);
1133 for (i=0; i<G_N_ELEMENTS(main_actions); i++)
1135 main_act[i] = g_simple_action_new (main_actions[i].
action_name, NULL);
1137 g_signal_connect (main_act[i],
"activate", G_CALLBACK(
atomes_menu_bar_action), main_actions[i].action_data);
1154 gtk_application_set_menubar (GTK_APPLICATION(atomes), G_MENU_MODEL(
atomes_menu_bar()));
1155 gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW(window), TRUE);
1158 MainEvent = gtk_event_box_new ();
1159 gtk_widget_add_events (MainEvent,
1160 GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK |
1161 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
1162 g_signal_connect(G_OBJECT(MainEvent),
"button_press_event", G_CALLBACK(pop_menu), NULL);
1163 g_signal_connect(G_OBJECT(MainEvent),
"button_release_event", G_CALLBACK(pop_menu), NULL);
1165 add_widget_gesture_and_key_action (window,
"atomes-context-click", G_CALLBACK(atomes_popup_menu), NULL,
1167 "atomes-key-pressed", G_CALLBACK(on_atomes_pressed), NULL,
1168 NULL, NULL, NULL, NULL, NULL, NULL);
1171 GtkWidget * hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
1172 int frame_size[2]={200, 550};
1176 gtk_widget_set_size_request (
MainFrame[i], frame_size[i], -1);
1186 gtk_container_add (GTK_CONTAINER(MainEvent),
MainScrol[i]);
1189 gtk_scrolled_window_set_propagate_natural_height ((GtkScrolledWindow *)
MainScrol[i], TRUE);
1190 gtk_scrolled_window_set_propagate_natural_width ((GtkScrolledWindow *)
MainScrol[i], TRUE);
1195 gtk_paned_set_start_child (GTK_PANED (hpaned),
MainFrame[0]);
1196 gtk_paned_set_resize_start_child (GTK_PANED (hpaned), FALSE);
1197 gtk_paned_set_shrink_start_child (GTK_PANED (hpaned), FALSE);
1198 gtk_paned_set_end_child (GTK_PANED (hpaned),
MainFrame[1]);
1199 gtk_paned_set_resize_end_child (GTK_PANED (hpaned), TRUE);
1200 gtk_paned_set_shrink_end_child (GTK_PANED (hpaned), FALSE);
1202 gtk_paned_pack1 (GTK_PANED (hpaned),
MainFrame[0], FALSE, FALSE);
1203 gtk_paned_pack2 (GTK_PANED (hpaned),
MainFrame[1], FALSE, FALSE);
G_MODULE_EXPORT void on_close_workspace(GtkWidget *widg, gpointer data)
close the active workspace
G_MODULE_EXPORT void on_open_save_activate(GtkWidget *widg, gpointer data)
open or save an atomes file - prepare the dialog
G_MODULE_EXPORT void on_isaacs_port(GtkWidget *widg, gpointer data)
open or write ISAACS XML file - prepare the dialog
G_MODULE_EXPORT void on_coord_port(GtkWidget *widg, gpointer data)
export or import atomic coordinates: prepare dialog
G_MODULE_EXPORT void on_save_as_activate(GtkWidget *widg, gpointer data)
open or save, choosing a file name
Callback declarations for main window.
G_MODULE_EXPORT void on_close_activate(GtkWidget *widg, gpointer cdata)
signal to close a project
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
GSimpleAction * edition_actions[3]
GtkApplication * AtomesApp
GtkWidget * atomes_shortcuts
GSimpleAction * analyze_actions[9]
Global variable declarations Global convenience function declarations Global data structure defin...
GtkWidget * create_scroll(GtkWidget *box, int dimx, int dimy, int shadow)
create a scroll window
void pop_menu_at_pointer(GtkWidget *widg, GdkEvent *event)
popup a menu at pointer location
G_MODULE_EXPORT gboolean destroy_this_window(GtkWidget *win, GdkEvent *event, gpointer data)
destroy a GtkWindow
void add_gtk_close_event(GtkWidget *widg, GCallback handler, gpointer data)
add a close event signal and callback to a GtkWidget
void add_box_child_start(int orientation, GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the initial position.
void text_view_set_monospace(GtkWidget *view)
set the font of a GtkTextView as monospace
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
void show_the_widgets(GtkWidget *widg)
show GtkWidget
project * get_project_by_id(int p)
get project pointer using id number
GMenu * workspace_section(gchar *act, int pop)
create the workspace section
GMenu * quit_section(gchar *act)
create the 'Quit' menu item
void create_user_preferences_dialog()
G_MODULE_EXPORT void compute_this_prop(GtkWidget *widg, gpointer data)
to compute the 'calc_to_compute'
G_MODULE_EXPORT void on_edit_activate(GtkWidget *widg, gpointer data)
create an edition dialog - prepare the dialog
GMenu * create_analyze_menu()
create atomes 'analyze' menu
gchar * main_group_names[]
GMenu * port_section(gchar *act, int pop, int port)
create the import/export menu items
atomes_action edition_acts[]
void remove_edition_actions()
remove all edition actions
GIcon * get_gicon_from_data(int format, const gchar *icon)
create a new icon using data
GMenu * create_workspace_menu(gchar *act, int pop_up, int proj, int calc)
create atomes 'workspace' menu
gchar * graph_img[NGRAPHS]
void widget_add_action(GSimpleActionGroup *action_group, const gchar *act, GCallback handler, gpointer data, gboolean check, gboolean status, gboolean radio, const gchar *stat)
add an action to an action group
GtkWidget * curvetbox()
create the curve tool box window
void append_submenu(GMenu *menu, const gchar *label, GMenu *submenu)
append a GMenuItem with a subenu to a GMenu, and use markup for the GMenuItem
atomes_action analyze_acts[]
GMenu * create_help_menu()
create atomes 'help' menu
shortcuts main_shortcuts[]
gchar * calc_img[NCALCS-2]
void atomes_key_pressed(guint keyval, GdkModifierType state)
main window key actions callbacks
GtkWidget * shortcuts_window(int sections, int group_by_section[sections], int groups, int shortcut_by_group[groups], gchar *section_names[sections], gchar *group_names[groups], shortcuts shortcs[])
Create the shortcuts information window.
GMenu * workspace_title()
create the 'Workspace' menu item
G_MODULE_EXPORT void leaving_from_menu(GtkWidget *widg, gpointer data)
leaving atomes ?
GMenu * project_title(int pop_up, int proj)
create project title menu item
GMenu * atomes_menu_bar()
create atomes menu bar
GtkWidget * create_main_window(GApplication *atomes)
create the main application window
void remove_edition_and_analyze_actions()
remove all edition and analysis action
void clean_view()
clean the main window
G_MODULE_EXPORT void on_calc_activate(GtkWidget *widg, gpointer data)
create a calculation dialog - prepare the dialog
GtkWidget * work_menu(int p, int c)
create the workspace popup menu
void add_action(GSimpleAction *action)
add action to the main window action map
GMenu * create_edit_menu()
create atomes 'edit' menu
void view_buffer(GtkTextBuffer *buffer)
set a text buffer in the main window or an image
int main_group_by_section[]
G_MODULE_EXPORT void show_periodic_table(GtkWidget *widg, gpointer data)
show the periodic table of the elements
int get_atom_id_from_periodic_table(atom_search *asearch)
get atom Z from selection in the periodic table
gchar * main_section_names[]
char * graph_name[NGRAPHS]
G_MODULE_EXPORT void atomes_menu_bar_action(GSimpleAction *action, GVariant *parameter, gpointer data)
atomes menu bar actions
int main_shortcut_by_group[]
GMenuItem * create_gmenu_item(const gchar *label, const gchar *action, const gchar *accel, const gchar *custom, int format, const gchar *icon, gboolean check, gboolean status, gboolean radio, const gchar *rstatus)
create menu item
G_MODULE_EXPORT void on_create_new_project(GtkWidget *widg, gpointer data)
create a new project
void append_menu_item(GMenu *menu, const gchar *label, const gchar *action, const gchar *accel, const gchar *custom, int format, const gchar *icon, gboolean check, gboolean status, gboolean radio, const gchar *rstatus)
create a menu item, then append it to a menu
int * object_was_selected[3]
GMenu * import_section(gchar *act)
create the 'Import' submenu
void remove_action(gchar *action_name)
add action from the main window action map
char * calc_name[NCALCS-2]
GMenu * tool_box_section()
create toolboxes menu item
GMenu * project_section(gchar *act, int pop_up, int proj, int calc)
create the project section
G_MODULE_EXPORT void create_about_dialog(GtkWidget *widg, gpointer data)
create the about dialog
G_MODULE_EXPORT gboolean leaving_question(GtkWidget *widget, GdkEvent *event, gpointer data)
Leaving atomes ?
Messaging function declarations.
Function declarations for reading atomes project file Function declarations for saving atomes proje...
void add_project_to_workspace()
add project(s) to the workspace tree
G_MODULE_EXPORT void activate_project(GtkWidget *widg, gpointer data)
activate a project
char * work_menu_items[NITEMS-2]
G_MODULE_EXPORT void change_project_name(GtkWidget *wid, gpointer edata)
change project name
Function declarations for workspace managment.