91extern GtkWidget *
work_menu (
int p,
int c);
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;
109 {
"edit.periodicity", GINT_TO_POINTER(1)},
110 {
"edit.cutoffs", GINT_TO_POINTER(2)}};
113 i18n(
"S(q) from FFT[g(r)]"),
114 i18n(
"S(q) from Debye Equation"),
115 i18n(
"g(r)/G(r) from FFT[S(q)]"),
116 i18n(
"Bonds and Angles"),
117 i18n(
"Ring Statistics"),
118 i18n(
"Chain Statistics"),
119 i18n(
"Spherical Harmonics"),
120 i18n(
"Mean Squared Displacement"),
121 i18n(
"Dynamic Structure Factor")};
124 i18n(
"S(q) from FFT[g(r)]"),
125 i18n(
"S(q) from Debye Equation"),
126 i18n(
"g(r)/G(r) from FFT[S(q)]"),
127 i18n(
"Bond Properties"),
128 i18n(
"Angle Distributions"),
129 i18n(
"Ring Statistics"),
130 i18n(
"Chain Statistics"),
131 i18n(
"Spherical Harmonics"),
132 i18n(
"Mean Squared Displacement"),
133 i18n(
"Dynamic Structure Factor")};
152 {
i18n(
"About"),
i18n(
"open about dialog"), GDK_KEY_a,
"<Ctrl>a" },
153 {
i18n(
"Periodic table"),
i18n(
"open periodic table"), GDK_KEY_p,
"<Ctrl>p" },
154 {
i18n(
"Quit"),
i18n(
"quit atomes"), GDK_KEY_q,
"<Ctrl>q" },
157 {
i18n(
"Open workspace"),
i18n(
"open atomes workspace"), GDK_KEY_w,
"<Ctrl>w" },
158 {
i18n(
"Save workspace"),
i18n(
"save atomes workspace"), GDK_KEY_s,
"<Ctrl>s" },
159 {
i18n(
"Close workspace"),
i18n(
"close atomes workspace"), GDK_KEY_c,
"<Ctrl>c" },
162 {
i18n(
"New project"),
i18n(
"create new atomes project"), GDK_KEY_n,
"<Ctrl>n" },
163 {
i18n(
"Open project"),
i18n(
"open atomes project"), GDK_KEY_o,
"<Ctrl>o" }
184 gchar * section_names[sections], gchar * group_names[
groups],
shortcuts shortcs[])
186 GtkShortcutsWindow * win = NULL;
188 win = g_object_new (GTK_TYPE_SHORTCUTS_WINDOW,
"modal", FALSE,
"resizable", TRUE,
"deletable", TRUE, NULL);
190 win = g_object_new (GTK_TYPE_SHORTCUTS_WINDOW,
"modal", FALSE,
"resizable", TRUE, NULL);
192 GtkShortcutsSection * shortcut_section[sections];
193 GtkShortcutsGroup * shortcut_group[
groups];
194 GtkShortcutsShortcut * shortcut;
196#if GTK_MINOR_VERSION < 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION < 4)
197 GtkWidget * sections_book = gtk_notebook_new ();
198 gtk_notebook_set_scrollable (GTK_NOTEBOOK(sections_book), TRUE);
199 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(sections_book), GTK_POS_TOP);
204 for (i=0; i<sections; i++)
206 shortcut_section[i] = g_object_new (GTK_TYPE_SHORTCUTS_SECTION,
"visible", TRUE,
"title", _(section_names[i]),
"section-name", _(section_names[i]), NULL);
208#if GTK_MINOR_VERSION < 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION < 4)
209 gtk_orientable_set_orientation ((GtkOrientable *)shortcut_section[i], GTK_ORIENTATION_HORIZONTAL);
212 for (j=0; j<group_by_section[i]; j++, l++)
214 shortcut_group[l] = g_object_new (GTK_TYPE_SHORTCUTS_GROUP,
"visible", TRUE,
"title", _(group_names[l]), NULL);
215 for (k=0; k<shortcut_by_group[l]; k++, m++)
217 shortcut = g_object_new (GTK_TYPE_SHORTCUTS_SHORTCUT,
219 "shortcut-type", GTK_SHORTCUT_ACCELERATOR,
220 "accelerator", shortcs[m].accelerator,
221 "title", _(shortcs[m].description),
224#if GTK_MINOR_VERSION > 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION >= 4)
225 gtk_shortcuts_group_add_shortcut (shortcut_group[l], shortcut);
227 add_box_child_start (GTK_ORIENTATION_VERTICAL, (GtkWidget *)shortcut_group[l], (GtkWidget *)shortcut, FALSE, FALSE, 0);
230 gtk_container_add (GTK_CONTAINER((GtkWidget *)shortcut_group[l]), (GtkWidget *)shortcut);
234#if GTK_MINOR_VERSION > 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION >= 4)
235 gtk_shortcuts_section_add_group (shortcut_section[i], shortcut_group[l]);
237 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, (GtkWidget *)shortcut_section[i], (GtkWidget *)shortcut_group[l], FALSE, FALSE, 0);
240 gtk_container_add (GTK_CONTAINER((GtkWidget *)shortcut_section[i]), (GtkWidget *)shortcut_group[l]);
244#if GTK_MINOR_VERSION > 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION >= 4)
245 gtk_shortcuts_window_add_section (GTK_SHORTCUTS_WINDOW(win), shortcut_section[i]);
247 gtk_notebook_append_page (GTK_NOTEBOOK(sections_book), (GtkWidget *)shortcut_section[i], gtk_label_new (_(section_names[i])));
250 gtk_container_add (GTK_CONTAINER((GtkWidget *)win), (GtkWidget *)shortcut_section[i]);
254#if GTK_MINOR_VERSION < 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION < 4)
255 gtk_window_set_child ((GtkWindow*) win, sections_book);
260 return (GtkWidget *)win;
273G_MODULE_EXPORT gboolean pop_menu (GtkWidget * widget, GdkEventButton * event, gpointer data)
275 if (event -> button == 3)
294 gtk_widget_set_size_request (
atomes_logo, 550, -1);
299 gtk_container_add (GTK_CONTAINER(MainEvent),
atomes_logo);
317 gtk_scrolled_window_set_child ((GtkScrolledWindow *)
MainScrol[1], NULL);
320 gboolean add = FALSE;
324 gtk_text_view_set_editable (GTK_TEXT_VIEW(
MainView), 0);
328 gtk_text_view_set_buffer (GTK_TEXT_VIEW(
MainView), buffer);
333 gtk_container_add (GTK_CONTAINER(MainEvent),
MainScrol[1]);
356 if (state & GDK_CONTROL_MASK)
419 gchar * name = g_strdup_printf (
"%s", g_action_get_name(G_ACTION(
action)));
421 if (g_strcmp0 (name,
"workspace.open") == 0)
425 else if (g_strcmp0 (name,
"workspace.save") == 0)
429 else if (g_strcmp0 (name,
"workspace.save-as") == 0)
433 else if (g_strcmp0 (name,
"workspace.close") == 0)
437 else if (g_strcmp0 (name,
"project.new") == 0)
441 else if (g_strcmp0 (name,
"project.edit") == 0)
445 else if (g_strcmp0 (name,
"project.active") == 0)
449 else if (g_strcmp0 (name,
"project.compute") == 0)
453 else if (g_strcmp0 (name,
"project.open") == 0)
457 else if (g_strcmp0 (name,
"project.save") == 0)
461 else if (g_strcmp0 (name,
"project.save-as") == 0)
465 else if (g_strcmp0 (name,
"project.close") == 0)
469 else if (g_strcmp0 (name,
"export.isaacs") == 0)
473 else if (g_strcmp0 (name,
"export.coordinates") == 0)
477 else if (g_strcmp0 (name,
"import.isaacs") == 0)
481 else if (g_strcmp0 (name,
"import.coordinates") == 0)
485 else if (g_strcmp0 (name,
"program.quit") == 0)
489 else if (g_strcmp0 (name,
"edit.chemistry") == 0)
493 else if (g_strcmp0 (name,
"edit.periodicity") == 0)
497 else if (g_strcmp0 (name,
"edit.cutoffs") == 0)
501 else if (g_strcmp0 (name,
"analyze.tool-box") == 0)
505 else if (g_strcmp0 (name,
"help.periodic") == 0)
509 else if (g_strcmp0 (name,
"help.about") == 0)
513 else if (g_strcmp0 (name,
"help.shortcuts") == 0)
519 else if (g_strcmp0 (name,
"help.preferences") == 0)
540 gchar * str = g_strdup_printf (
"analyze.%d", act);
541 GSimpleAction * this_action = g_simple_action_new (str, NULL);
543 g_action_map_add_action (G_ACTION_MAP(
AtomesApp), G_ACTION(this_action));
580 for (i=0; i<
NCALCS-1; i++)
582 str = g_strdup_printf (
"analyze.%d", i);
601 return g_file_icon_new (g_file_new_for_path (icon));
604 return g_themed_icon_new (icon);
627void widget_add_action (GSimpleActionGroup * action_group,
const gchar * act, GCallback handler, gpointer data,
628 gboolean check, gboolean
status, gboolean radio,
const gchar * stat)
631 GVariant * action_state;
634 action_state = g_variant_new_string (stat);
635 action = g_simple_action_new_stateful (act, G_VARIANT_TYPE_STRING, action_state);
639 action_state = g_variant_new_boolean (
status);
640 action = g_simple_action_new_stateful (act, NULL, action_state);
644 action = g_simple_action_new (act, NULL);
646 g_signal_connect (
action,
"activate", handler, data);
647 g_action_map_add_action (G_ACTION_MAP(action_group), G_ACTION(
action));
669 const gchar * custom,
int format,
const gchar * icon,
670 gboolean check, gboolean
status, gboolean radio,
const gchar * rstatus)
673 item = g_menu_item_new (label,
action);
677 g_menu_item_set_attribute (item,
"use-markup",
"s",
"TRUE", NULL);
680 g_menu_item_set_attribute (item,
"custom",
"s", custom, NULL);
682 GVariant * cust = g_menu_item_get_attribute_value (item,
"custom", g_variant_type_new(
"s"));
683 if (cust) g_print (
"item :: %s, custom :: %s\n", label, g_variant_get_string (cust, NULL));
687 if (accel) g_menu_item_set_attribute (item,
"accel",
"s", accel, NULL);
689 if (radio) g_menu_item_set_attribute (item,
"target",
"s", rstatus, NULL);
696 g_menu_item_set_icon (item, gicon);
697 g_object_unref (gicon);
716 GMenuItem * item = g_menu_item_new (label, NULL);
720 g_menu_item_set_attribute (item,
"use-markup",
"s",
"TRUE", NULL);
721 g_menu_item_set_submenu (item, (GMenuModel *)submenu);
722 g_menu_append_item (menu, item);
723 g_object_unref (item);
746 const gchar * custom,
int format,
const gchar * icon,
747 gboolean check, gboolean
status, gboolean radio,
const gchar * rstatus)
750 g_menu_append_item (menu, item);
751 g_object_unref (item);
764 GMenu * menu = g_menu_new ();
766 str = g_strdup_printf (
"%s.workspace.open", act);
767 append_menu_item (menu, _(
"Open"), (
const gchar *)str,
"<CTRL>W", NULL,
IMG_STOCK,
FOPEN, FALSE, FALSE, FALSE, NULL);
771 str = g_strdup_printf (
"%s.workspace.save", act);
772 append_menu_item (menu, _(
"Save"), (
const gchar *)str, NULL, NULL,
IMG_STOCK,
FSAVE, FALSE, FALSE, FALSE, NULL);
774 str = g_strdup_printf (
"%s.workspace.save-as", act);
775 append_menu_item (menu, _(
"Save As"), (
const gchar *)str,
"<CTRL>S", NULL,
IMG_STOCK,
FSAVEAS, FALSE, FALSE, FALSE, NULL);
777 str = g_strdup_printf (
"%s.workspace.close", act);
778 append_menu_item (menu, _(
"Close"), (
const gchar *)str,
"<CTRL>C", NULL,
IMG_STOCK,
FCLOSE, FALSE, FALSE, FALSE, NULL);
795 gchar * port_action[2]={
"export",
"import"};
796 GMenu * menu = g_menu_new ();
798 str = g_strdup_printf (
"%s.%s.isaacs", act, port_action[port]);
799 append_menu_item (menu, _(
"ISAACS Project File (*.ipf)"), (
const gchar *)str, NULL, NULL,
IMG_FILE,
PACKAGE_MOL, FALSE, FALSE, FALSE, NULL);
801 str = g_strdup_printf (
"%s.%s.coordinates", act, port_action[port]);
802 append_menu_item (menu, _(
"Atomic Coordinates"), (
const gchar *)str, NULL, NULL,
IMG_FILE, (port) ?
PACKAGE_IMP :
PACKAGE_CON, FALSE, FALSE, FALSE, NULL);
819 GMenu * menu = g_menu_new ();
820 gchar * str, * str_n;
825 str = g_strdup_printf (
"%s.project.active", act);
826 append_menu_item (menu, _(
"Make Active"), (
const gchar *)str, NULL, NULL,
IMG_STOCK,
YES, FALSE, FALSE, FALSE, NULL);
831 str = g_strdup_printf (
"%s.project.compute", act);
832 str_n = g_strdup_printf (_(
"Analyze: %s"), _(
graph_name[calc]));
833 append_menu_item (menu, str_n, (
get_project_by_id(
proj) -> analysis[calc] -> avail_ok) ? (
const gchar *)str :
"None", NULL, NULL,
IMG_FILE,
graph_img[calc], FALSE, FALSE, FALSE, NULL);
837 str = g_strdup_printf (
"%s.project.edit", act);
838 append_menu_item (menu, _(
"Edit Name"), (
const gchar *)str, NULL, NULL,
IMG_STOCK,
EDITA, FALSE, FALSE, FALSE, NULL);
843 str = g_strdup_printf (
"%s.project.new", act);
844 append_menu_item (menu, _(
"New"), (
const gchar *)str,
"<CTRL>N", NULL,
IMG_STOCK,
FNEW, FALSE, FALSE, FALSE, NULL);
846 str = g_strdup_printf (
"%s.project.open", act);
847 append_menu_item (menu, _(
"Open"), (
const gchar *)str,
"<CTRL>O", NULL,
IMG_STOCK,
FOPEN, FALSE, FALSE, FALSE, NULL);
850 if (! pop_up ||
proj > -1)
852 str = g_strdup_printf (
"%s.project.save", act);
853 append_menu_item (menu, _(
"Save"), (
const gchar *)str, NULL, NULL,
IMG_STOCK,
FSAVE, FALSE, FALSE, FALSE, NULL);
855 str = g_strdup_printf (
"%s.project.save-as", act);
856 append_menu_item (menu, _(
"Save As"), (
const gchar *)str, NULL, NULL,
IMG_STOCK,
FSAVEAS, FALSE, FALSE, FALSE, NULL);
860 str = g_strdup_printf (
"%s.project.close", act);
861 append_menu_item (menu, _(
"Close"), (
const gchar *)str, NULL, NULL,
IMG_STOCK,
FCLOSE, FALSE, FALSE, FALSE, NULL);
878 GMenu * menu = g_menu_new ();
892 GMenu * menu = g_menu_new ();
893 gchar * str = g_strdup_printf (
"%s.program.quit", act);
894 append_menu_item (menu, _(
"Quit"), (
const gchar *)str,
"<CTRL>Q", NULL,
IMG_STOCK,
FEXIT, FALSE, FALSE, FALSE, NULL);
906 GMenu * menu = g_menu_new ();
907 append_menu_item (menu, _(
"Workspace"),
"None", NULL, NULL,
IMG_FILE,
PACKAGE_TD, FALSE, FALSE, FALSE, NULL);
921 GMenu * menu = g_menu_new ();
925 append_menu_item (menu, str,
"None", NULL, NULL,
IMG_FILE,
PACKAGE_TD, FALSE, FALSE, FALSE, NULL);
930 append_menu_item (menu, _(
"Project(s)"),
"None", NULL, NULL,
IMG_FILE,
PACKAGE_TD, FALSE, FALSE, FALSE, NULL);
947 GMenu * menu = g_menu_new ();
957 g_menu_append_section (menu, NULL, (GMenuModel*)
import_section(act));
959 g_menu_append_section (menu, NULL, (GMenuModel*)
quit_section(act));
970 GMenu * menu = g_menu_new ();
971 append_menu_item (menu, _(
"Chemistry and Physics"),
"app.edit.chemistry", NULL, NULL,
IMG_STOCK,
DPROPERTIES, FALSE, FALSE, FALSE, NULL);
972 append_menu_item (menu, _(
"Box and Periodicity"),
"app.edit.periodicity", NULL, NULL,
IMG_STOCK,
DPROPERTIES, FALSE, FALSE, FALSE, NULL);
973 append_menu_item (menu, _(
"Bond Cutoffs"),
"app.edit.cutoffs", NULL, NULL,
IMG_STOCK,
DPROPERTIES, FALSE, FALSE, FALSE, NULL);
984 GMenu * menu = g_menu_new ();
985 append_menu_item (menu, _(
"Toolboxes"),
"app.analyze.tool-box",
"<CTRL>T", NULL,
IMG_STOCK,
PAGE_SETUP, FALSE, FALSE, FALSE, NULL);
996 GMenu * menu = g_menu_new ();
999 for (i=0; i<
NCALCS-1; i++)
1001 str = g_strdup_printf (
"app.analyze.%d", i);
1002 append_menu_item (menu, _(
calc_name[i]), str, NULL, NULL,
IMG_FILE,
graph_img[(i <
ANG) ? i : i+1], FALSE, FALSE, FALSE, NULL);
1017 GMenu * menu = g_menu_new ();
1018 append_menu_item (menu, _(
"Periodic Table"),
"app.help.periodic",
"<CTRL>P", NULL,
IMG_STOCK,
ABOUT, FALSE, FALSE, FALSE, NULL);
1019 if (!
atomes_from_libreoffice)
append_menu_item (menu, _(
"Preferences"),
"app.help.preferences", NULL, NULL,
IMG_STOCK,
ABOUT, FALSE, FALSE, FALSE, NULL);
1020 append_menu_item (menu, _(
"Shortcuts"),
"app.help.shortcuts", NULL, NULL,
IMG_STOCK,
ABOUT, FALSE, FALSE, FALSE, NULL);
1021 append_menu_item (menu, _(
"About"),
"app.help.about",
"<CTRL>A", NULL,
IMG_STOCK,
ABOUT, FALSE, FALSE, FALSE, NULL);
1032 GMenu * menu = g_menu_new ();
1052G_MODULE_EXPORT
void atomes_popup_menu (GtkGesture * gesture,
int n_press,
double x,
double y, gpointer data)
1054 if (gtk_gesture_single_get_current_button ((GtkGestureSingle * )gesture) == GDK_BUTTON_SECONDARY)
1056 GtkWidget * popover =
work_menu (-1, -1);
1073G_MODULE_EXPORT gboolean on_atomes_pressed (GtkEventControllerKey * self, guint keyval, guint keycode, GdkModifierType state, gpointer data)
1092 gtk_window_set_default_icon (
THETD);
1095 THEBD = gdk_pixbuf_new_from_file (g_build_filename (PACKAGE_PREFIX,
"pixmaps/bd.png", NULL), NULL);
1102 GtkWidget * window = gtk_application_window_new (GTK_APPLICATION(atomes));
1103 gtk_window_set_title (GTK_WINDOW(window),
PACKAGE);
1104 gtk_window_set_resizable (GTK_WINDOW(window), TRUE);
1105 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);
1136 g_action_map_add_action (G_ACTION_MAP(
AtomesApp), G_ACTION(main_act[i]));
1137 g_signal_connect (main_act[i],
"activate", G_CALLBACK(
atomes_menu_bar_action), main_actions[i].action_data);
1145 GSimpleAction * this_action;
1146 for (i=0; i<
NCALCS-1; i++)
1148 str = g_strdup_printf (
"analyze.%d", i);
1149 this_action = g_simple_action_new (str, NULL);
1158 gtk_application_set_menubar (GTK_APPLICATION(atomes), G_MENU_MODEL(
atomes_menu_bar()));
1159 gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW(window), TRUE);
1162 MainEvent = gtk_event_box_new ();
1163 gtk_widget_add_events (MainEvent,
1164 GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK |
1165 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
1166 g_signal_connect(G_OBJECT(MainEvent),
"button_press_event", G_CALLBACK(pop_menu), NULL);
1167 g_signal_connect(G_OBJECT(MainEvent),
"button_release_event", G_CALLBACK(pop_menu), NULL);
1169 add_widget_gesture_and_key_action (window,
"atomes-context-click", G_CALLBACK(atomes_popup_menu), NULL,
1171 "atomes-key-pressed", G_CALLBACK(on_atomes_pressed), NULL,
1172 NULL, NULL, NULL, NULL, NULL, NULL);
1175 GtkWidget * hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
1176 int frame_size[2]={200, 550};
1180 gtk_widget_set_size_request (
MainFrame[i], frame_size[i], -1);
1190 gtk_container_add (GTK_CONTAINER(MainEvent),
MainScrol[i]);
1193 gtk_scrolled_window_set_propagate_natural_height ((GtkScrolledWindow *)
MainScrol[i], TRUE);
1194 gtk_scrolled_window_set_propagate_natural_width ((GtkScrolledWindow *)
MainScrol[i], TRUE);
1199 gtk_paned_set_start_child (GTK_PANED (hpaned),
MainFrame[0]);
1200 gtk_paned_set_resize_start_child (GTK_PANED (hpaned), FALSE);
1201 gtk_paned_set_shrink_start_child (GTK_PANED (hpaned), FALSE);
1202 gtk_paned_set_end_child (GTK_PANED (hpaned),
MainFrame[1]);
1203 gtk_paned_set_resize_end_child (GTK_PANED (hpaned), TRUE);
1204 gtk_paned_set_shrink_end_child (GTK_PANED (hpaned), FALSE);
1206 gtk_paned_pack1 (GTK_PANED (hpaned),
MainFrame[0], FALSE, FALSE);
1207 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
GSimpleAction * edition_actions[3]
GtkApplication * AtomesApp
GtkWidget * atomes_shortcuts
gboolean atomes_from_libreoffice
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
atomes_action edition_acts[]
gchar * graph_img[NCALCS]
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 remove_action(gchar *action_name)
add action from the main window action map
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
void add_analysis_action(int act)
add action to the main window action map
gchar * main_group_names[]
GMenu * port_section(gchar *act, int pop, int port)
create the import/export menu items
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
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
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
GMenu * create_help_menu()
create atomes 'help' menu
GtkWidget * create_curve_tool_box()
create the curve tool box window
shortcuts main_shortcuts[]
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
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[]
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
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
G_MODULE_EXPORT void change_project_name(GtkWidget *wid, gpointer edata)
change project name
Function declarations for workspace managment.