51extern G_MODULE_EXPORT
void on_calc_activate (GtkWidget * widg, gpointer data);
52extern G_MODULE_EXPORT
void set_mode (GtkWidget * widg, gpointer data);
70 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)
active_project -> modelgl -> ogl_mode[1], TRUE);
120GtkWidget * this_work_menu (
int p,
int c)
125 gchar * imp_str[2] = {
"Import",
"Export"};
126 menu = gtk_menu_new ();
127 GtkAccelGroup * accel_group = gtk_accel_group_new ();
128 gtk_window_add_accel_group (GTK_WINDOW (
MainWindow), accel_group);
129 widget_set_sensitive (
gtk3_menu_item (menu,
"Workspace",
IMG_FILE, (gpointer)PACKAGE_TD, NULL, NULL, FALSE, 0, 0, FALSE, FALSE, FALSE), 0);
131 gtk3_menu_item (menu,
"Open",
IMG_STOCK, (gpointer)
FOPEN, G_CALLBACK(
on_open_save_activate), GINT_TO_POINTER(2), TRUE, GDK_KEY_w, GDK_CONTROL_MASK, FALSE, FALSE, FALSE);
132 gtk3_menu_item (menu,
"Save",
IMG_STOCK, (gpointer)
FSAVE, G_CALLBACK(
on_open_save_activate), GINT_TO_POINTER(3), FALSE, 0, 0, FALSE, FALSE, FALSE);
133 gtk3_menu_item (menu,
"Save As",
IMG_STOCK, (gpointer)
FSAVEAS, G_CALLBACK(
on_save_as_activate), GINT_TO_POINTER(3), TRUE, GDK_KEY_s, GDK_CONTROL_MASK, FALSE, FALSE, FALSE);
134 gtk3_menu_item (menu,
"Close",
IMG_STOCK, (gpointer)
FCLOSE, G_CALLBACK(
on_close_workspace), GINT_TO_POINTER(1), TRUE, GDK_KEY_c, GDK_CONTROL_MASK, FALSE, FALSE, FALSE);
138 widget_set_sensitive (
gtk3_menu_item (menu,
"Project(s)",
IMG_FILE, (gpointer)PACKAGE_TD, NULL, NULL, FALSE, 0, 0, FALSE, FALSE, FALSE), FALSE);
140 gtk3_menu_item (menu,
"New",
IMG_STOCK, (gpointer)
FNEW, G_CALLBACK(
on_create_new_project), NULL, TRUE, GDK_KEY_n, GDK_CONTROL_MASK, FALSE, FALSE, FALSE);
141 gtk3_menu_item (menu,
"Open",
IMG_STOCK, (gpointer)
FSAVE, G_CALLBACK(
on_open_save_activate), GINT_TO_POINTER(0), TRUE, GDK_KEY_o, GDK_CONTROL_MASK, FALSE, FALSE, FALSE);
142 gtk3_menu_item (menu,
"Save",
IMG_STOCK, (gpointer)
FSAVE, G_CALLBACK(
on_open_save_activate), GINT_TO_POINTER(1), FALSE, 0, 0, FALSE, FALSE, FALSE);
143 gtk3_menu_item (menu,
"Save As",
IMG_STOCK, (gpointer)
FSAVEAS, G_CALLBACK(
on_save_as_activate), GINT_TO_POINTER(1), FALSE, 0, 0, FALSE, FALSE, FALSE);
144 gtk3_menu_item (menu,
"Close",
IMG_STOCK, (gpointer)
FCLOSE, G_CALLBACK(
on_close_activate), GINT_TO_POINTER(
activep), FALSE, 0, 0, FALSE, FALSE, FALSE);
145 port =
gtk3_menu_item (menu, imp_str[1],
IMG_FILE, (gpointer)PACKAGE_CON, NULL, NULL, FALSE, 0, 0, FALSE, FALSE, FALSE);
146 dmenu = gtk_menu_new ();
147 gtk3_menu_item (dmenu,
"ISAACS Project File '*.ipf'",
IMG_FILE, (gpointer)PACKAGE_MOL, G_CALLBACK(
on_isaacs_port), GINT_TO_POINTER(1), FALSE, 0, 0, FALSE, FALSE, FALSE);
148 gtk3_menu_item (dmenu,
"Atomic Coordinates",
IMG_FILE, (gpointer)PACKAGE_CON, G_CALLBACK(
on_coord_port), GINT_TO_POINTER(1), FALSE, 0, 0, FALSE, FALSE, FALSE);
149 gtk_menu_item_set_submenu ((GtkMenuItem *)port, dmenu);
154 widget_set_sensitive (
gtk3_menu_item (menu, pname,
IMG_FILE, (gpointer)PACKAGE_TD, NULL, NULL, FALSE, 0, 0, FALSE, FALSE, FALSE), 0);
159 gtk3_menu_item (menu,
"Make Active",
IMG_STOCK, (gpointer)
YES, G_CALLBACK(
activate_project), GINT_TO_POINTER(p), FALSE, 0, 0, FALSE, FALSE, FALSE);
164 widget_set_sensitive (
gtk3_menu_item (menu, str,
IMG_FILE, (gpointer)
graph_img[
c], G_CALLBACK(
compute_this_prop), GINT_TO_POINTER(p), FALSE, 0, 0, FALSE, FALSE, FALSE),
get_project_by_id(p) -> runok[
c]);
167 gtk3_menu_item (menu,
"Edit Name",
IMG_STOCK, (gpointer)
EDITA, G_CALLBACK(
change_project_name), GINT_TO_POINTER(p), FALSE, 0, 0, FALSE, FALSE, FALSE);
168 gtk3_menu_item (menu,
"Save",
IMG_STOCK, (gpointer)
FSAVE, G_CALLBACK(
on_open_save_activate), GINT_TO_POINTER(1), FALSE, 0, 0, FALSE, FALSE, FALSE);
169 gtk3_menu_item (menu,
"Save As",
IMG_STOCK, (gpointer)
FSAVEAS, G_CALLBACK(
on_save_as_activate), GINT_TO_POINTER(1), FALSE, 0, 0, FALSE, FALSE, FALSE);
170 gtk3_menu_item (menu,
"Close",
IMG_STOCK, (gpointer)
FCLOSE, G_CALLBACK(
on_close_activate), GINT_TO_POINTER(p), FALSE, 0, 0, FALSE, FALSE, FALSE);
171 port =
gtk3_menu_item (menu, imp_str[1],
IMG_FILE, (gpointer)PACKAGE_CON, NULL, NULL, FALSE, 0, 0, FALSE, FALSE, FALSE);
172 dmenu = gtk_menu_new ();
173 gtk3_menu_item (dmenu,
"ISAACS Project File '*.ipf'",
IMG_FILE, (gpointer)PACKAGE_MOL, G_CALLBACK(
on_isaacs_port), GINT_TO_POINTER(1), FALSE, 0, 0, FALSE, FALSE, FALSE);
174 gtk3_menu_item (dmenu,
"Atomic Coordinates",
IMG_FILE, (gpointer)PACKAGE_CON, G_CALLBACK(
on_coord_port), GINT_TO_POINTER(1), FALSE, 0, 0, FALSE, FALSE, FALSE);
175 gtk_menu_item_set_submenu ((GtkMenuItem *)port, dmenu);
178 port =
gtk3_menu_item (menu, imp_str[0],
IMG_FILE, (gpointer)PACKAGE_IMP, NULL, NULL, FALSE, 0, 0, FALSE, FALSE, FALSE);
179 dmenu = gtk_menu_new ();
180 gtk_menu_item_set_submenu ((GtkMenuItem *)port, dmenu);
181 gtk3_menu_item (dmenu,
"ISAACS Project File '*.ipf'",
IMG_FILE, (gpointer)PACKAGE_MOL, G_CALLBACK(
on_isaacs_port), GINT_TO_POINTER(0), FALSE, 0, 0, FALSE, FALSE, FALSE);
182 gtk3_menu_item (dmenu,
"Atomic Coordinates",
IMG_FILE, (gpointer)PACKAGE_IMP, G_CALLBACK(
on_coord_port), GINT_TO_POINTER(0), FALSE, 0, 0, FALSE, FALSE, FALSE);
184 gtk3_menu_item (menu,
"Quit",
IMG_STOCK, (gpointer)
FEXIT, G_CALLBACK(
leaving_from_menu), NULL, TRUE, GDK_KEY_q, GDK_CONTROL_MASK, FALSE, FALSE, FALSE);
192extern GSimpleAction *
pop_act[7];
206 GSimpleActionGroup * action_popup = g_simple_action_group_new ();
208 pop_act[0] = g_simple_action_new (
"workspace.open", NULL);
209 pop_act[1] = g_simple_action_new (
"workspace.save", NULL);
210 pop_act[2] = g_simple_action_new (
"workspace.save-as", NULL);
211 pop_act[3] = g_simple_action_new (
"workspace.close", NULL);
212 pop_act[4] = g_simple_action_new (
"project.active", NULL);
213 pop_act[5] = g_simple_action_new (
"project.compute", NULL);
214 pop_act[6] = g_simple_action_new (
"project.edit", NULL);
215 pop_act[7] = g_simple_action_new (
"project.new", NULL);
216 pop_act[8] = g_simple_action_new (
"project.open", NULL);
217 pop_act[9] = g_simple_action_new (
"project.save", NULL);
218 pop_act[10] = g_simple_action_new (
"project.save-as", NULL);
219 pop_act[11] = g_simple_action_new (
"project.close", NULL);
220 pop_act[12] = g_simple_action_new (
"export.isaacs", NULL);
221 pop_act[13] = g_simple_action_new (
"export.coordinates", NULL);
222 pop_act[14] = g_simple_action_new (
"import.isaacs", NULL);
223 pop_act[15] = g_simple_action_new (
"import.coordinates", NULL);
224 pop_act[16] = g_simple_action_new (
"program.quit", NULL);
227 for (i=0; i<17; i++) g_action_map_add_action (G_ACTION_MAP(action_popup), G_ACTION(
pop_act[i]));
248 menu = this_work_menu (p,
c);
253 menu = gtk_popover_menu_new_from_model_full (G_MENU_MODEL(popup), GTK_POPOVER_MENU_NESTED);
254 i = (
nprojects) ? (p > -1) ? 235 : 80 : 0;
255 gtk_widget_set_size_request (menu, -1, 235 + i);
263 gtk_widget_insert_action_group (menu,
"pop", G_ACTION_GROUP(action_popup));
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
void apply_project(gboolean showtools)
get project ready for calculation and initialize the OpenGL window
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
Global variable declarations Global convenience function declarations Global data structure defin...
GtkWidget * gtk3_menu_item(GtkWidget *menu, gchar *name, int icon_format, gpointer item_icon, GCallback handler, gpointer data, gboolean accel, guint key, GdkModifierType mod, gboolean check, gboolean radio, gboolean status)
gchar * graph_img[NGRAPHS]
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
void add_menu_separator(GtkWidget *menu)
void show_the_widgets(GtkWidget *widg)
show GtkWidget
project * get_project_by_id(int p)
get project pointer using id number
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
void init_project(gboolean alloc_box)
initialize a new project
G_MODULE_EXPORT gboolean leaving_question(GtkWidget *widget, GdkEvent *event, gpointer data)
Leaving atomes ?
Messaging function declarations.
void prep_calc_actions()
prepare analysis widgets
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.