97extern G_MODULE_EXPORT
void on_edit_activate (GtkWidget * widg, gpointer data);
98extern G_MODULE_EXPORT
void on_calc_activate (GtkWidget * widg, gpointer data);
101GtkWidget * MainEvent;
109 {
"edit.periodicity", GINT_TO_POINTER(1)},
110 {
"edit.cutoffs", GINT_TO_POINTER(2)}};
113 {
"analyze.sq", GINT_TO_POINTER(1)},
114 {
"analyze.sk", GINT_TO_POINTER(2)},
115 {
"analyze.gk", GINT_TO_POINTER(3)},
116 {
"analyze.bonds", GINT_TO_POINTER(4)},
117 {
"analyze.rings", GINT_TO_POINTER(5)},
118 {
"analyze.chains", GINT_TO_POINTER(6)},
119 {
"analyze.sp", GINT_TO_POINTER(7)},
120 {
"analyze.msd", GINT_TO_POINTER(8)}};
123 "S(q) from FFT[g(r)]",
124 "S(q) from Debye equation",
125 "g(r)/G(r) from FFT[S(q)]",
129 "Spherical harmonics",
130 "Mean Squared Displacement",
134 "S(q) from FFT[g(r)]",
135 "S(q) from Debye equation",
136 "g(r)/G(r) from FFT[S(q)]",
138 "Angle distributions",
141 "Spherical harmonics",
142 "Mean Squared Displacement"};
149 {
"About",
"open about dialog", GDK_KEY_a,
"<Ctrl>a" },
150 {
"Periodic table",
"open periodic table", GDK_KEY_p,
"<Ctrl>p" },
151 {
"Quit",
"quit atomes", GDK_KEY_q,
"<Ctrl>q" },
154 {
"Open workspace",
"open atomes workspace", GDK_KEY_w,
"<Ctrl>w" },
155 {
"Save workspace",
"save atomes workspace", GDK_KEY_s,
"<Ctrl>s" },
156 {
"Close workspace",
"close atomes workspace", GDK_KEY_c,
"<Ctrl>c" },
159 {
"New project",
"create new atomes project", GDK_KEY_n,
"<Ctrl>n" },
160 {
"Open project",
"open atomes project", GDK_KEY_o,
"<Ctrl>o" }
181 gchar * section_names[sections], gchar * group_names[
groups],
shortcuts shortcs[])
183 GtkShortcutsWindow * win = NULL;
185 win = g_object_new (GTK_TYPE_SHORTCUTS_WINDOW,
"modal", FALSE,
"resizable", TRUE,
"deletable", TRUE, NULL);
187 win = g_object_new (GTK_TYPE_SHORTCUTS_WINDOW,
"modal", FALSE,
"resizable", TRUE, NULL);
189 GtkShortcutsSection * shortcut_section[sections];
190 GtkShortcutsGroup * shortcut_group[
groups];
191 GtkShortcutsShortcut * shortcut;
193#if GTK_MINOR_VERSION < 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION < 4)
194 GtkWidget * sections_book = gtk_notebook_new ();
195 gtk_notebook_set_scrollable (GTK_NOTEBOOK(sections_book), TRUE);
196 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(sections_book), GTK_POS_TOP);
201 for (i=0; i<sections; i++)
203 shortcut_section[i] = g_object_new (GTK_TYPE_SHORTCUTS_SECTION,
"visible", TRUE,
"title", section_names[i],
"section-name", section_names[i], NULL);
205#if GTK_MINOR_VERSION < 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION < 4)
206 gtk_orientable_set_orientation ((GtkOrientable *)shortcut_section[i], GTK_ORIENTATION_HORIZONTAL);
209 for (j=0; j<group_by_section[i]; j++, l++)
211 shortcut_group[l] = g_object_new (GTK_TYPE_SHORTCUTS_GROUP,
"visible", TRUE,
"title", group_names[l], NULL);
212 for (k=0; k<shortcut_by_group[l]; k++, m++)
214 shortcut = g_object_new (GTK_TYPE_SHORTCUTS_SHORTCUT,
216 "shortcut-type", GTK_SHORTCUT_ACCELERATOR,
217 "accelerator", shortcs[m].accelerator,
218 "title", shortcs[m].description,
221#if GTK_MINOR_VERSION > 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION >= 4)
222 gtk_shortcuts_group_add_shortcut (shortcut_group[l], shortcut);
224 add_box_child_start (GTK_ORIENTATION_VERTICAL, (GtkWidget *)shortcut_group[l], (GtkWidget *)shortcut, FALSE, FALSE, 0);
227 gtk_container_add (GTK_CONTAINER((GtkWidget *)shortcut_group[l]), (GtkWidget *)shortcut);
231#if GTK_MINOR_VERSION > 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION >= 4)
232 gtk_shortcuts_section_add_group (shortcut_section[i], shortcut_group[l]);
234 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, (GtkWidget *)shortcut_section[i], (GtkWidget *)shortcut_group[l], FALSE, FALSE, 0);
237 gtk_container_add (GTK_CONTAINER((GtkWidget *)shortcut_section[i]), (GtkWidget *)shortcut_group[l]);
241#if GTK_MINOR_VERSION > 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION >= 4)
242 gtk_shortcuts_window_add_section (GTK_SHORTCUTS_WINDOW(win), shortcut_section[i]);
244 gtk_notebook_append_page (GTK_NOTEBOOK(sections_book), (GtkWidget *)shortcut_section[i], gtk_label_new (section_names[i]));
247 gtk_container_add (GTK_CONTAINER((GtkWidget *)win), (GtkWidget *)shortcut_section[i]);
251#if GTK_MINOR_VERSION < 14 || (GTK_MINOR_VERSION == 14 && GTK_MICRO_VERSION < 4)
252 gtk_window_set_child ((GtkWindow*) win, sections_book);
257 return (GtkWidget *)win;
270G_MODULE_EXPORT gboolean pop_menu (GtkWidget * widget, GdkEventButton * event, gpointer data)
272 if (event -> button == 3)
291 gtk_widget_set_size_request (
atomes_logo, 550, -1);
296 gtk_container_add (GTK_CONTAINER(MainEvent),
atomes_logo);
314 gtk_scrolled_window_set_child ((GtkScrolledWindow *)
MainScrol[1], NULL);
317 gboolean add = FALSE;
321 gtk_text_view_set_editable (GTK_TEXT_VIEW(
MainView), 0);
325 gtk_text_view_set_buffer (GTK_TEXT_VIEW(
MainView), buffer);
330 gtk_container_add (GTK_CONTAINER(MainEvent),
MainScrol[1]);
353 if (state & GDK_CONTROL_MASK)
463 gchar * name = g_strdup_printf (
"%s", g_action_get_name(G_ACTION(
action)));
464 if (g_strcmp0 (name,
"workspace.open") == 0)
468 else if (g_strcmp0 (name,
"workspace.save") == 0)
472 else if (g_strcmp0 (name,
"workspace.save-as") == 0)
476 else if (g_strcmp0 (name,
"workspace.close") == 0)
480 else if (g_strcmp0 (name,
"project.new") == 0)
484 else if (g_strcmp0 (name,
"project.edit") == 0)
488 else if (g_strcmp0 (name,
"project.active") == 0)
492 else if (g_strcmp0 (name,
"project.compute") == 0)
496 else if (g_strcmp0 (name,
"project.open") == 0)
500 else if (g_strcmp0 (name,
"project.save") == 0)
504 else if (g_strcmp0 (name,
"project.save-as") == 0)
508 else if (g_strcmp0 (name,
"project.close") == 0)
512 else if (g_strcmp0 (name,
"export.isaacs") == 0)
516 else if (g_strcmp0 (name,
"export.coordinates") == 0)
520 else if (g_strcmp0 (name,
"import.isaacs") == 0)
524 else if (g_strcmp0 (name,
"import.coordinates") == 0)
528 else if (g_strcmp0 (name,
"program.quit") == 0)
532 else if (g_strcmp0 (name,
"edit.chemistry") == 0)
536 else if (g_strcmp0 (name,
"edit.periodicity") == 0)
540 else if (g_strcmp0 (name,
"edit.cutoffs") == 0)
544 else if (g_strcmp0 (name,
"analyze.gr") == 0)
548 else if (g_strcmp0 (name,
"analyze.sq") == 0)
552 else if (g_strcmp0 (name,
"analyze.sk") == 0)
556 else if (g_strcmp0 (name,
"analyze.gk") == 0)
560 else if (g_strcmp0 (name,
"analyze.bonds") == 0)
564 else if (g_strcmp0 (name,
"analyze.rings") == 0)
568 else if (g_strcmp0 (name,
"analyze.chains") == 0)
572 else if (g_strcmp0 (name,
"analyze.sp") == 0)
576 else if (g_strcmp0 (name,
"analyze.msd") == 0)
580 else if (g_strcmp0 (name,
"analyze.tool-box") == 0)
584 else if (g_strcmp0 (name,
"help.periodic") == 0)
588 else if (g_strcmp0 (name,
"help.about") == 0)
592 else if (g_strcmp0 (name,
"help.shortcuts") == 0)
614 return g_file_icon_new (g_file_new_for_path (icon));
617 return g_themed_icon_new (icon);
640void widget_add_action (GSimpleActionGroup * action_group,
const gchar * act, GCallback handler, gpointer data,
641 gboolean check, gboolean
status, gboolean radio,
const gchar * stat)
644 GVariant * action_state;
647 action_state = g_variant_new_string (stat);
648 action = g_simple_action_new_stateful (act, G_VARIANT_TYPE_STRING, action_state);
652 action_state = g_variant_new_boolean (
status);
653 action = g_simple_action_new_stateful (act, NULL, action_state);
657 action = g_simple_action_new (act, NULL);
659 g_signal_connect (
action,
"activate", handler, data);
660 g_action_map_add_action (G_ACTION_MAP(action_group), G_ACTION(
action));
640void widget_add_action (GSimpleActionGroup * action_group,
const gchar * act, GCallback handler, gpointer data, {
…}
682 const gchar * custom,
int format,
const gchar * icon,
683 gboolean check, gboolean
status, gboolean radio,
const gchar * rstatus)
690 g_menu_item_set_attribute (item,
"use-markup",
"s",
"TRUE", NULL);
693 g_menu_item_set_attribute (item,
"custom",
"s", custom, NULL);
695 GVariant * cust = g_menu_item_get_attribute_value (item,
"custom", g_variant_type_new(
"s"));
696 if (cust) g_print (
"item :: %s, custom :: %s\n",
label, g_variant_get_string (cust, NULL));
700 if (accel) g_menu_item_set_attribute (item,
"accel",
"s", accel, NULL);
702 if (radio) g_menu_item_set_attribute (item,
"target",
"s", rstatus, NULL);
709 g_menu_item_set_icon (item, gicon);
710 g_object_unref (gicon);
729 GMenuItem * item = g_menu_item_new (
label, NULL);
733 g_menu_item_set_attribute (item,
"use-markup",
"s",
"TRUE", NULL);
734 g_menu_item_set_submenu (item, (GMenuModel *)submenu);
735 g_menu_append_item (menu, item);
758 const gchar * custom,
int format,
const gchar * icon,
759 gboolean check, gboolean
status, gboolean radio,
const gchar * rstatus)
762 g_menu_append_item (menu, item);
763 g_object_unref (item);
776 GMenu * menu = g_menu_new ();
778 str = g_strdup_printf (
"%s.workspace.open", act);
779 append_menu_item (menu,
"Open", (
const gchar *)str,
"<CTRL>W", NULL,
IMG_STOCK,
FOPEN, FALSE, FALSE, FALSE, NULL);
783 str = g_strdup_printf (
"%s.workspace.save", act);
784 append_menu_item (menu,
"Save", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
FSAVE, FALSE, FALSE, FALSE, NULL);
786 str = g_strdup_printf (
"%s.workspace.save-as", act);
787 append_menu_item (menu,
"Save As", (
const gchar *)str,
"<CTRL>S", NULL,
IMG_STOCK,
FSAVEAS, FALSE, FALSE, FALSE, NULL);
789 str = g_strdup_printf (
"%s.workspace.close", act);
790 append_menu_item (menu,
"Close", (
const gchar *)str,
"<CTRL>C", NULL,
IMG_STOCK,
FCLOSE, FALSE, FALSE, FALSE, NULL);
807 gchar * port_action[2]={
"export",
"import"};
808 GMenu * menu = g_menu_new ();
810 str = g_strdup_printf (
"%s.%s.isaacs", act, port_action[port]);
811 append_menu_item (menu,
"ISAACS Project File (*.ipf)", (
const gchar *)str, NULL, NULL,
IMG_FILE,
PACKAGE_MOL, FALSE, FALSE, FALSE, NULL);
813 str = g_strdup_printf (
"%s.%s.coordinates", act, port_action[port]);
814 append_menu_item (menu,
"Atomic Coordinates", (
const gchar *)str, NULL, NULL,
IMG_FILE, (port) ?
PACKAGE_IMP :
PACKAGE_CON, FALSE, FALSE, FALSE, NULL);
831 GMenu * menu = g_menu_new ();
832 gchar * str, * str_n;
837 str = g_strdup_printf (
"%s.project.active", act);
838 append_menu_item (menu,
"Make Active", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
YES, FALSE, FALSE, FALSE, NULL);
843 str = g_strdup_printf (
"%s.project.compute", act);
845 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);
849 str = g_strdup_printf (
"%s.project.edit", act);
850 append_menu_item (menu,
"Edit Name", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
EDITA, FALSE, FALSE, FALSE, NULL);
853 str = g_strdup_printf (
"%s.project.new", act);
854 append_menu_item (menu,
"New", (
const gchar *)str,
"<CTRL>N", NULL,
IMG_STOCK,
FNEW, FALSE, FALSE, FALSE, NULL);
856 str = g_strdup_printf (
"%s.project.open", act);
857 append_menu_item (menu,
"Open", (
const gchar *)str,
"<CTRL>O", NULL,
IMG_STOCK,
FOPEN, FALSE, FALSE, FALSE, NULL);
859 if (! pop_up ||
proj > -1)
861 str = g_strdup_printf (
"%s.project.save", act);
862 append_menu_item (menu,
"Save", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
FSAVE, FALSE, FALSE, FALSE, NULL);
864 str = g_strdup_printf (
"%s.project.save-as", act);
865 append_menu_item (menu,
"Save As", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
FSAVEAS, FALSE, FALSE, FALSE, NULL);
867 str = g_strdup_printf (
"%s.project.close", act);
868 append_menu_item (menu,
"Close", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
FCLOSE, FALSE, FALSE, FALSE, NULL);
884 GMenu * menu = g_menu_new ();
898 GMenu * menu = g_menu_new ();
899 gchar * str = g_strdup_printf (
"%s.program.quit", act);
900 append_menu_item (menu,
"Quit", (
const gchar *)str,
"<CTRL>Q", NULL,
IMG_STOCK,
FEXIT, FALSE, FALSE, FALSE, NULL);
912 GMenu * menu = g_menu_new ();
913 append_menu_item (menu,
"Workspace",
"None", NULL, NULL,
IMG_FILE,
PACKAGE_TD, FALSE, FALSE, FALSE, NULL);
927 GMenu * menu = g_menu_new ();
931 append_menu_item (menu, str,
"None", NULL, NULL,
IMG_FILE,
PACKAGE_TD, FALSE, FALSE, FALSE, NULL);
936 append_menu_item (menu,
"Project(s)",
"None", NULL, NULL,
IMG_FILE,
PACKAGE_TD, FALSE, FALSE, FALSE, NULL);
953 GMenu * menu = g_menu_new ();
958 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 ();
997 append_menu_item (menu,
"g(r) / G(r)",
"app.analyze.gr", NULL, NULL,
IMG_FILE,
PACKAGE_GR, FALSE, FALSE, FALSE, NULL);
998 append_menu_item (menu,
"S(q) from FFT[g(r)]",
"app.analyze.sq", NULL, NULL,
IMG_FILE,
PACKAGE_SQ, FALSE, FALSE, FALSE, NULL);
999 append_menu_item (menu,
"S(q) from Debye Eq.",
"app.analyze.sk", NULL, NULL,
IMG_FILE,
PACKAGE_SQ, FALSE, FALSE, FALSE, NULL);
1000 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);
1001 append_menu_item (menu,
"Bonds and Angles",
"app.analyze.bonds", NULL, NULL,
IMG_FILE,
PACKAGE_BD, FALSE, FALSE, FALSE, NULL);
1002 append_menu_item (menu,
"Ring statistics",
"app.analyze.rings", NULL, NULL,
IMG_FILE,
PACKAGE_RI, FALSE, FALSE, FALSE, NULL);
1003 append_menu_item (menu,
"Chain statistics",
"app.analyze.chains", NULL, NULL,
IMG_FILE,
PACKAGE_CH, FALSE, FALSE, FALSE, NULL);
1004 append_menu_item (menu,
"Spherical Harmonics",
"app.analyze.sp", NULL, NULL,
IMG_FILE,
PACKAGE_SP, FALSE, FALSE, FALSE, NULL);
1005 append_menu_item (menu,
"Mean Squared Displacement",
"app.analyze.msd", NULL, NULL,
IMG_FILE,
PACKAGE_MS, 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 append_menu_item (menu,
"Shortcuts",
"app.help.shortcuts", NULL, NULL,
IMG_STOCK,
ABOUT, FALSE, FALSE, FALSE, NULL);
1020 append_menu_item (menu,
"About",
"app.help.about",
"<CTRL>A", NULL,
IMG_STOCK,
ABOUT, FALSE, FALSE, FALSE, NULL);
1031 GMenu * menu = g_menu_new ();
1051G_MODULE_EXPORT
void atomes_popup_menu (GtkGesture * gesture,
int n_press,
double x,
double y, gpointer data)
1053 if (gtk_gesture_single_get_current_button ((GtkGestureSingle * )gesture) == GDK_BUTTON_SECONDARY)
1055 GtkWidget * popover =
work_menu (-1, -1);
1072G_MODULE_EXPORT gboolean on_atomes_pressed (GtkEventControllerKey * self, guint keyval, guint keycode, GdkModifierType state, gpointer data)
1091 gtk_window_set_default_icon (
THETD);
1101 GtkWidget * window = gtk_application_window_new (GTK_APPLICATION(atomes));
1102 gtk_window_set_title (GTK_WINDOW(window),
PACKAGE);
1103 gtk_window_set_resizable (GTK_WINDOW(window), TRUE);
1104 gtk_widget_set_size_request (window, 900, 450);
1106 atomes_action main_actions[] = {{
"workspace.open", GINT_TO_POINTER(2)},
1107 {
"workspace.save", GINT_TO_POINTER(3)},
1108 {
"workspace.save-as", GINT_TO_POINTER(3)},
1109 {
"workspace.close", GINT_TO_POINTER(1)},
1110 {
"project.new", NULL},
1111 {
"project.open", GINT_TO_POINTER(0)},
1112 {
"project.save", GINT_TO_POINTER(1) },
1113 {
"project.save-as", GINT_TO_POINTER(1)},
1114 {
"project.close", NULL},
1115 {
"export.isaacs", GINT_TO_POINTER(1)},
1116 {
"export.coordinates", GINT_TO_POINTER(1)},
1117 {
"import.isaacs", GINT_TO_POINTER(0)},
1118 {
"import.coordinates", GINT_TO_POINTER(0)},
1119 {
"program.quit", NULL},
1120 {
"analyze.tool-box", NULL},
1121 {
"help.periodic", NULL},
1122 {
"help.about", NULL},
1123 {
"help.shortcuts", NULL}};
1125 GSimpleAction * main_act[18];
1126 for (i=0; i<G_N_ELEMENTS(main_actions); i++)
1128 main_act[i] = g_simple_action_new (main_actions[i].
action_name, NULL);
1130 g_signal_connect (main_act[i],
"activate", G_CALLBACK(
atomes_menu_bar_action), main_actions[i].action_data);
1147 gtk_application_set_menubar (GTK_APPLICATION(atomes), G_MENU_MODEL(
atomes_menu_bar()));
1148 gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW(window), TRUE);
1151 MainEvent = gtk_event_box_new ();
1152 gtk_widget_add_events (MainEvent,
1153 GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK |
1154 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
1155 g_signal_connect(G_OBJECT(MainEvent),
"button_press_event", G_CALLBACK(pop_menu), NULL);
1156 g_signal_connect(G_OBJECT(MainEvent),
"button_release_event", G_CALLBACK(pop_menu), NULL);
1158 add_widget_gesture_and_key_action (window,
"atomes-context-click", G_CALLBACK(atomes_popup_menu), NULL,
1160 "atomes-key-pressed", G_CALLBACK(on_atomes_pressed), NULL,
1161 NULL, NULL, NULL, NULL, NULL, NULL);
1164 GtkWidget * hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
1165 int frame_size[2]={200, 550};
1169 gtk_widget_set_size_request (
MainFrame[i], frame_size[i], -1);
1179 gtk_container_add (GTK_CONTAINER(MainEvent),
MainScrol[i]);
1182 gtk_scrolled_window_set_propagate_natural_height ((GtkScrolledWindow *)
MainScrol[i], TRUE);
1183 gtk_scrolled_window_set_propagate_natural_width ((GtkScrolledWindow *)
MainScrol[i], TRUE);
1188 gtk_paned_set_start_child (GTK_PANED (hpaned),
MainFrame[0]);
1189 gtk_paned_set_resize_start_child (GTK_PANED (hpaned), FALSE);
1190 gtk_paned_set_shrink_start_child (GTK_PANED (hpaned), FALSE);
1191 gtk_paned_set_end_child (GTK_PANED (hpaned),
MainFrame[1]);
1192 gtk_paned_set_resize_end_child (GTK_PANED (hpaned), TRUE);
1193 gtk_paned_set_shrink_end_child (GTK_PANED (hpaned), FALSE);
1195 gtk_paned_pack1 (GTK_PANED (hpaned),
MainFrame[0], FALSE, FALSE);
1196 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
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.