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"};
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)
615 return g_file_icon_new (g_file_new_for_path (icon));
618 return g_themed_icon_new (icon);
641void widget_add_action (GSimpleActionGroup * action_group,
const gchar * act, GCallback handler, gpointer data,
642 gboolean check, gboolean
status, gboolean radio,
const gchar * stat)
645 GVariant * action_state;
648 action_state = g_variant_new_string (stat);
649 action = g_simple_action_new_stateful (act, G_VARIANT_TYPE_STRING, action_state);
653 action_state = g_variant_new_boolean (
status);
654 action = g_simple_action_new_stateful (act, NULL, action_state);
658 action = g_simple_action_new (act, NULL);
660 g_signal_connect (
action,
"activate", handler, data);
661 g_action_map_add_action (G_ACTION_MAP(action_group), G_ACTION(
action));
683 const gchar * custom,
int format,
const gchar * icon,
684 gboolean check, gboolean
status, gboolean radio,
const gchar * rstatus)
691 g_menu_item_set_attribute (item,
"use-markup",
"s",
"TRUE", NULL);
694 g_menu_item_set_attribute (item,
"custom",
"s", custom, NULL);
696 GVariant * cust = g_menu_item_get_attribute_value (item,
"custom", g_variant_type_new(
"s"));
697 if (cust) g_print (
"item :: %s, custom :: %s\n",
label, g_variant_get_string (cust, NULL));
701 if (accel) g_menu_item_set_attribute (item,
"accel",
"s", accel, NULL);
703 if (radio) g_menu_item_set_attribute (item,
"target",
"s", rstatus, NULL);
710 g_menu_item_set_icon (item, gicon);
711 g_object_unref (gicon);
730 GMenuItem * item = g_menu_item_new (
label, NULL);
734 g_menu_item_set_attribute (item,
"use-markup",
"s",
"TRUE", NULL);
735 g_menu_item_set_submenu (item, (GMenuModel *)submenu);
736 g_menu_append_item (menu, item);
759 const gchar * custom,
int format,
const gchar * icon,
760 gboolean check, gboolean
status, gboolean radio,
const gchar * rstatus)
763 g_menu_append_item (menu, item);
764 g_object_unref (item);
777 GMenu * menu = g_menu_new ();
779 str = g_strdup_printf (
"%s.workspace.open", act);
780 append_menu_item (menu,
"Open", (
const gchar *)str,
"<CTRL>W", NULL,
IMG_STOCK,
FOPEN, FALSE, FALSE, FALSE, NULL);
784 str = g_strdup_printf (
"%s.workspace.save", act);
785 append_menu_item (menu,
"Save", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
FSAVE, FALSE, FALSE, FALSE, NULL);
787 str = g_strdup_printf (
"%s.workspace.save-as", act);
788 append_menu_item (menu,
"Save As", (
const gchar *)str,
"<CTRL>S", NULL,
IMG_STOCK,
FSAVEAS, FALSE, FALSE, FALSE, NULL);
790 str = g_strdup_printf (
"%s.workspace.close", act);
791 append_menu_item (menu,
"Close", (
const gchar *)str,
"<CTRL>C", NULL,
IMG_STOCK,
FCLOSE, FALSE, FALSE, FALSE, NULL);
808 gchar * port_action[2]={
"export",
"import"};
809 GMenu * menu = g_menu_new ();
811 str = g_strdup_printf (
"%s.%s.isaacs", act, port_action[port]);
812 append_menu_item (menu,
"ISAACS Project File (*.ipf)", (
const gchar *)str, NULL, NULL,
IMG_FILE,
PACKAGE_MOL, FALSE, FALSE, FALSE, NULL);
814 str = g_strdup_printf (
"%s.%s.coordinates", act, port_action[port]);
815 append_menu_item (menu,
"Atomic Coordinates", (
const gchar *)str, NULL, NULL,
IMG_FILE, (port) ?
PACKAGE_IMP :
PACKAGE_CON, FALSE, FALSE, FALSE, NULL);
832 GMenu * menu = g_menu_new ();
833 gchar * str, * str_n;
838 str = g_strdup_printf (
"%s.project.active", act);
839 append_menu_item (menu,
"Make Active", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
YES, FALSE, FALSE, FALSE, NULL);
844 str = g_strdup_printf (
"%s.project.compute", act);
846 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);
850 str = g_strdup_printf (
"%s.project.edit", act);
851 append_menu_item (menu,
"Edit Name", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
EDITA, FALSE, FALSE, FALSE, NULL);
854 str = g_strdup_printf (
"%s.project.new", act);
855 append_menu_item (menu,
"New", (
const gchar *)str,
"<CTRL>N", NULL,
IMG_STOCK,
FNEW, FALSE, FALSE, FALSE, NULL);
857 str = g_strdup_printf (
"%s.project.open", act);
858 append_menu_item (menu,
"Open", (
const gchar *)str,
"<CTRL>O", NULL,
IMG_STOCK,
FOPEN, FALSE, FALSE, FALSE, NULL);
860 if (! pop_up ||
proj > -1)
862 str = g_strdup_printf (
"%s.project.save", act);
863 append_menu_item (menu,
"Save", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
FSAVE, FALSE, FALSE, FALSE, NULL);
865 str = g_strdup_printf (
"%s.project.save-as", act);
866 append_menu_item (menu,
"Save As", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
FSAVEAS, FALSE, FALSE, FALSE, NULL);
868 str = g_strdup_printf (
"%s.project.close", act);
869 append_menu_item (menu,
"Close", (
const gchar *)str, NULL, NULL,
IMG_STOCK,
FCLOSE, FALSE, FALSE, FALSE, NULL);
885 GMenu * menu = g_menu_new ();
899 GMenu * menu = g_menu_new ();
900 gchar * str = g_strdup_printf (
"%s.program.quit", act);
901 append_menu_item (menu,
"Quit", (
const gchar *)str,
"<CTRL>Q", NULL,
IMG_STOCK,
FEXIT, FALSE, FALSE, FALSE, NULL);
913 GMenu * menu = g_menu_new ();
914 append_menu_item (menu,
"Workspace",
"None", NULL, NULL,
IMG_FILE,
PACKAGE_TD, FALSE, FALSE, FALSE, NULL);
928 GMenu * menu = g_menu_new ();
932 append_menu_item (menu, str,
"None", NULL, NULL,
IMG_FILE,
PACKAGE_TD, FALSE, FALSE, FALSE, NULL);
937 append_menu_item (menu,
"Project(s)",
"None", NULL, NULL,
IMG_FILE,
PACKAGE_TD, FALSE, FALSE, FALSE, NULL);
954 GMenu * menu = g_menu_new ();
959 g_menu_append_section (menu, NULL, (GMenuModel*)
import_section(act));
960 g_menu_append_section (menu, NULL, (GMenuModel*)
quit_section(act));
971 GMenu * menu = g_menu_new ();
972 append_menu_item (menu,
"Chemistry and Physics",
"app.edit.chemistry", NULL, NULL,
IMG_STOCK,
DPROPERTIES, FALSE, FALSE, FALSE, NULL);
973 append_menu_item (menu,
"Box and Periodicity",
"app.edit.periodicity", NULL, NULL,
IMG_STOCK,
DPROPERTIES, FALSE, FALSE, FALSE, NULL);
974 append_menu_item (menu,
"Bond Cutoffs",
"app.edit.cutoffs", NULL, NULL,
IMG_STOCK,
DPROPERTIES, FALSE, FALSE, FALSE, NULL);
985 GMenu * menu = g_menu_new ();
986 append_menu_item (menu,
"Toolboxes",
"app.analyze.tool-box",
"<CTRL>T", NULL,
IMG_STOCK,
PAGE_SETUP, FALSE, FALSE, FALSE, NULL);
997 GMenu * menu = g_menu_new ();
998 append_menu_item (menu,
"g(r) / G(r)",
"app.analyze.gr", NULL, NULL,
IMG_FILE,
PACKAGE_GR, FALSE, FALSE, FALSE, NULL);
999 append_menu_item (menu,
"S(q) from FFT[g(r)]",
"app.analyze.sq", NULL, NULL,
IMG_FILE,
PACKAGE_SQ, FALSE, FALSE, FALSE, NULL);
1000 append_menu_item (menu,
"S(q) from Debye Eq.",
"app.analyze.sk", NULL, NULL,
IMG_FILE,
PACKAGE_SQ, FALSE, FALSE, FALSE, NULL);
1001 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);
1002 append_menu_item (menu,
"Bonds and Angles",
"app.analyze.bonds", NULL, NULL,
IMG_FILE,
PACKAGE_BD, FALSE, FALSE, FALSE, NULL);
1003 append_menu_item (menu,
"Ring statistics",
"app.analyze.rings", NULL, NULL,
IMG_FILE,
PACKAGE_RI, FALSE, FALSE, FALSE, NULL);
1004 append_menu_item (menu,
"Chain statistics",
"app.analyze.chains", NULL, NULL,
IMG_FILE,
PACKAGE_CH, FALSE, FALSE, FALSE, NULL);
1005 append_menu_item (menu,
"Spherical Harmonics",
"app.analyze.sp", NULL, NULL,
IMG_FILE,
PACKAGE_SP, FALSE, FALSE, FALSE, NULL);
1006 append_menu_item (menu,
"Mean Squared Displacement",
"app.analyze.msd", NULL, NULL,
IMG_FILE,
PACKAGE_MS, FALSE, FALSE, FALSE, NULL);
1018 GMenu * menu = g_menu_new ();
1019 append_menu_item (menu,
"Periodic Table",
"app.help.periodic",
"<CTRL>P", 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);
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);
1107 atomes_action main_actions[] = {{
"workspace.open", GINT_TO_POINTER(2)},
1108 {
"workspace.save", GINT_TO_POINTER(3)},
1109 {
"workspace.save-as", GINT_TO_POINTER(3)},
1110 {
"workspace.close", GINT_TO_POINTER(1)},
1111 {
"project.new", NULL},
1112 {
"project.open", GINT_TO_POINTER(0)},
1113 {
"project.save", GINT_TO_POINTER(1) },
1114 {
"project.save-as", GINT_TO_POINTER(1)},
1115 {
"project.close", NULL},
1116 {
"export.isaacs", GINT_TO_POINTER(1)},
1117 {
"export.coordinates", GINT_TO_POINTER(1)},
1118 {
"import.isaacs", GINT_TO_POINTER(0)},
1119 {
"import.coordinates", GINT_TO_POINTER(0)},
1120 {
"program.quit", NULL},
1121 {
"analyze.tool-box", NULL},
1122 {
"help.periodic", NULL},
1123 {
"help.about", NULL},
1124 {
"help.shortcuts", NULL}};
1126 GSimpleAction * main_act[18];
1127 for (i=0; i<G_N_ELEMENTS(main_actions); i++)
1129 main_act[i] = g_simple_action_new (main_actions[i].
action_name, NULL);
1131 g_signal_connect (main_act[i],
"activate", G_CALLBACK(
atomes_menu_bar_action), main_actions[i].action_data);
1148 gtk_application_set_menubar (GTK_APPLICATION(atomes), G_MENU_MODEL(
atomes_menu_bar()));
1149 gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW(window), TRUE);
1152 MainEvent = gtk_event_box_new ();
1153 gtk_widget_add_events (MainEvent,
1154 GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK |
1155 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
1156 g_signal_connect(G_OBJECT(MainEvent),
"button_press_event", G_CALLBACK(pop_menu), NULL);
1157 g_signal_connect(G_OBJECT(MainEvent),
"button_release_event", G_CALLBACK(pop_menu), NULL);
1159 add_widget_gesture_and_key_action (window,
"atomes-context-click", G_CALLBACK(atomes_popup_menu), NULL,
1161 "atomes-key-pressed", G_CALLBACK(on_atomes_pressed), NULL,
1162 NULL, NULL, NULL, NULL, NULL, NULL);
1165 GtkWidget * hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
1166 int frame_size[2]={200, 550};
1170 gtk_widget_set_size_request (
MainFrame[i], frame_size[i], -1);
1180 gtk_container_add (GTK_CONTAINER(MainEvent),
MainScrol[i]);
1183 gtk_scrolled_window_set_propagate_natural_height ((GtkScrolledWindow *)
MainScrol[i], TRUE);
1184 gtk_scrolled_window_set_propagate_natural_width ((GtkScrolledWindow *)
MainScrol[i], TRUE);
1189 gtk_paned_set_start_child (GTK_PANED (hpaned),
MainFrame[0]);
1190 gtk_paned_set_resize_start_child (GTK_PANED (hpaned), FALSE);
1191 gtk_paned_set_shrink_start_child (GTK_PANED (hpaned), FALSE);
1192 gtk_paned_set_end_child (GTK_PANED (hpaned),
MainFrame[1]);
1193 gtk_paned_set_resize_end_child (GTK_PANED (hpaned), TRUE);
1194 gtk_paned_set_shrink_end_child (GTK_PANED (hpaned), FALSE);
1196 gtk_paned_pack1 (GTK_PANED (hpaned),
MainFrame[0], FALSE, FALSE);
1197 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.