atomes 1.2.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
workspace.c
Go to the documentation of this file.
1/* This file is part of the 'atomes' software
2
3'atomes' is free software: you can redistribute it and/or modify it under the terms
4of the GNU Affero General Public License as published by the Free Software Foundation,
5either version 3 of the License, or (at your option) any later version.
6
7'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9See the GNU General Public License for more details.
10
11You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12If not, see <https://www.gnu.org/licenses/>
13
14Copyright (C) 2022-2025 by CNRS and University of Strasbourg */
15
23/*
24* This file: 'workspace.c'
25*
26* Contains:
27*
28 - Implementation of the workspace tree view
29 - Associated callbacks
30
31*
32* List of functions:
33
34 int find_calc_by_path (GtkTreeView * treeview, GtkTreePath * path);
35 int find_proj_by_path (GtkTreePath * path);
36
37 G_MODULE_EXPORT gboolean on_workspace_button_event (GtkWidget * widget, GdkEventButton * event, gpointer data);
38
39 void add_project (GtkTreeStore * store, int i);
40 void correct_this_window_title (GtkWidget * win, gchar * str);
41 void workspace_menu (GtkWidget * tree, gpointer event, double x, double y);
42 void create_workspace ();
43 void add_project_to_workspace ();
44 void remove_project_from_workspace (int id);
45
46 static void fill_workspace (GtkTreeStore * store);
47
48 G_MODULE_EXPORT void activate_project (GtkWidget * widg, gpointer data);
49 G_MODULE_EXPORT void workspace_ondc (GtkTreeView * treeview,
50 GtkTreePath * path,
51 GtkTreeViewColumn * col,
52 gpointer data);
53 G_MODULE_EXPORT void change_project_name (GtkWidget * wid, gpointer edata);
54 G_MODULE_EXPORT void workspace_popup (GtkGesture * gesture, int n_press, double x, double y, gpointer data);
55
56 GtkWidget * create_workspace_tree ();
57
58*/
59
60#include "global.h"
61#include "callbacks.h"
62#include "interface.h"
63#include "project.h"
64#include "glwindow.h"
65
66extern void workinfo (project * this_proj, int i);
67extern GtkWidget * work_menu (int p, int c);
68
69GdkPixbuf * pix = NULL;
70GtkWidget * img = NULL;
71GtkWidget * hbox = NULL;
72GtkWidget * vbox = NULL;
73GtkWidget * lab = NULL;
74GtkWidget * lap = NULL;
75GtkWidget * eap = NULL;
76gchar * labtmp = NULL;
77gchar * laptmp = NULL;
78GtkWidget * worktree = NULL;
79GtkTreeStore * workstore = NULL;
80GtkTreeIter worklevel;
81GtkTreeIter * piter = NULL;
82GtkTreeIter * witer = NULL;
83GtkTreePath ** prpath = NULL;
84GtkTreePath * wpath = NULL;
85GdkPixbuf * wpix = NULL;
86gchar * wchar = NULL;
88
89char * work_menu_items[NITEMS-2] = {"Workspace ",
90 "Settings ",
91 //"OpenGL - 3D ",
92 "Visualization ",
93 //"Calc. visualization ",
94 "Analysis ",
95 "g(r)/G(r) ",
96 "S(q) from g(r) ",
97 "S(q) from Debye equation ",
98 "g(r) from FFT[S(q) Debye]",
99 "Bonding information ",
100 "Angle distribution ",
101 "Ring statistics ",
102 "Chain statistics ",
103 "Spherical harmonics ",
104 "Mean Square Displacement "};
105
114void add_project (GtkTreeStore * store, int i)
115{
116 int j;
117 gchar * tmp;
118 GtkTreeIter steplevel;
119 GtkTreeIter optslevel;
120 gtk_tree_store_append (store, & piter[i], & worklevel);
121 if (i == activep)
122 {
123 tmp = g_strdup_printf ("<b>%s</b>", active_project -> name);
124 }
125 else
126 {
127 tmp = g_strdup_printf ("%s", get_project_by_id(i) -> name);
128 }
129 gtk_tree_store_set (store, & piter[i], 0, THETD, 1, tmp, 2, -1, -1);
130 prpath[i] = gtk_tree_model_get_path (GTK_TREE_MODEL(store), & piter[i]);
131 g_free (tmp);
132 gtk_tree_store_append (store, & steplevel, & piter[i]);
133 gtk_tree_store_set (store, & steplevel, 0, SETTING, 1, work_menu_items[1], 2, -3, -1);
134 // OpenGL
135 gtk_tree_store_append (store, & steplevel, & piter[i]);
136 gtk_tree_store_set (store, & steplevel, 0, OGLM, 1, work_menu_items[2], 2, -2, -1);
137 //gtk_tree_store_append (store, & optslevel, & steplevel);
138 //gtk_tree_store_set (store, & optslevel, 0, OGLM, 1, work_menu_items[3], 2, -1, -1);
139 //gtk_tree_store_append (store, & optslevel, & steplevel);
140 //gtk_tree_store_set (store, & optslevel, 0, OGLC, 1, work_menu_items[4], 2, -1, -1);
141 // Calculations
142 gtk_tree_store_append (store, & steplevel, & piter[i]);
143 gtk_tree_store_set (store, & steplevel, 0, RUN, 1, work_menu_items[3], 2, -1, -1);
144 for (j=0; j<NCALCS-2; j++)
145 {
146 if (j < NCALCS-3 || get_project_by_id(i) -> steps > 1)
147 {
148 gtk_tree_store_append (store, & optslevel, & steplevel);
149 gtk_tree_store_set (store, & optslevel, 0, gdk_pixbuf_new_from_file(graph_img[j], NULL), 1, work_menu_items[4+j], 2, j, -1);
150 }
151 }
152 gtk_tree_view_expand_to_path (GTK_TREE_VIEW(worktree), gtk_tree_model_get_path(GTK_TREE_MODEL(store), & worklevel));
154}
155
163static void fill_workspace (GtkTreeStore * store)
164{
165 int i;
166
167 gtk_tree_store_append (store, & worklevel, NULL);
168 gtk_tree_store_set (store, & worklevel, 0, THETD, 1, work_menu_items[0], 2, -4, -1);
169
170 if (piter != NULL) g_free (piter);
171 if (prpath != NULL) g_free (prpath);
172 if (nprojects > 0)
173 {
174 piter = g_malloc (nprojects*sizeof*piter);
175 prpath = g_malloc (nprojects*sizeof*prpath);
176 }
177 for (i=0; i<nprojects; i++)
178 {
179 add_project (store, i);
180 }
181}
182
191G_MODULE_EXPORT void activate_project (GtkWidget * widg, gpointer data)
192{
193 int id = GPOINTER_TO_INT (data);
194
195 if (activep < nprojects)
196 {
197 gtk_tree_store_set (workstore, & piter[activep], 1, active_project -> name, -1);
198 }
200
201 gchar * tmp = g_strdup_printf ("<b>%s</b>", active_project -> name);
202 gtk_tree_store_set (workstore, & piter[id], 1, tmp, -1);
203 g_free (tmp);
204}
205
214int find_calc_by_path (GtkTreeView * treeview, GtkTreePath * path)
215{
216 int i;
217 GtkTreeIter iter;
218 GtkTreeModel * model = gtk_tree_view_get_model (treeview);
219 if (gtk_tree_model_get_iter (model, & iter, path))
220 {
221 gtk_tree_model_get (model, & iter, 2, & i, -1);
222 return i;
223 }
224 return -1;
225}
226
227
235int find_proj_by_path (GtkTreePath * path)
236{
237 int i, j;
238
239 i = -1;
240 for (j=0; j<nprojects; j++)
241 {
242 if (gtk_tree_path_compare (prpath[j], path) <= 0) i = j;
243 }
244 return i;
245}
246
262G_MODULE_EXPORT void workspace_ondc (GtkTreeView * treeview,
263 GtkTreePath * path,
264 GtkTreeViewColumn * col,
265 gpointer data)
266{
267 int i, j;
268 GtkTreeModel * model;
269 GtkTreeIter iter;
270 model = gtk_tree_view_get_model (treeview);
271 gboolean was = FALSE;
272#ifdef DEBUG
273 g_debug ("WORKSPACE_ONDC: activep= %d", activep);
274#endif
275 if (gtk_tree_model_get_iter (model, & iter, path))
276 {
277#ifdef DEBUG
278 g_debug ("WORKSPACE_ONDC: in workspace");
279#endif
280 for (i=0; i<nprojects; i++)
281 {
282 if (gtk_tree_path_compare (path, prpath[i]) == 0)
283 {
284 if (i != activep) activate_project (NULL, GINT_TO_POINTER(i));
285 was = TRUE;
286 }
287 }
288 if (! was)
289 {
290#ifdef DEBUG
291 g_debug ("WORKSPACE_ONDC: not an activation");
292#endif
293 if (wpath != NULL && witer != NULL && wchar != NULL)
294 {
295 gtk_tree_store_set (GTK_TREE_STORE(model), witer, 1, wchar, -1);
296 }
297#ifdef DEBUG
298 g_debug ("WORKSPACE_ONDC: saving old data");
299#endif
300 wpath = gtk_tree_path_copy (path);
301 witer = gtk_tree_iter_copy (& iter);
302 gtk_tree_model_get (model, & iter, 1, & wchar, -1);
303#ifdef DEBUG
304 g_debug ("WORKSPACE_ONDC: modifying data");
305#endif
306 gchar * tmp = g_strdup_printf ("<b>%s</b>", wchar);
307 gtk_tree_store_set (GTK_TREE_STORE(model), & iter, 1, tmp, -1);
308 g_free (tmp);
309#ifdef DEBUG
310 g_debug ("WORKSPACE_ONDC: cleaning view");
311 g_debug ("WORKSPACE_ONDC: wchar = %s", wchar);
312#endif
313 gtk_tree_model_get (model, & iter, 2, & i, -1);
314 i += 4;
315#ifdef DEBUG
316 g_debug ("WORKSPACE_ONDC: creating view id= %d", i);
317#endif
319#ifdef DEBUG
320 g_debug ("WORKSPACE_ONDC: for project= %d", j);
321#endif
322 if (j < 0) j = activep;
323 if (i == 2) prep_model (j);
325 }
326 }
327}
328
337void correct_this_window_title (GtkWidget * win, gchar * str)
338{
339 if (win)
340 {
341 if (GTK_IS_WIDGET(win))
342 {
343 gtk_window_set_title (GTK_WINDOW (win), str);
344 }
345 }
346 if (str) g_free (str);
347}
348
357G_MODULE_EXPORT void change_project_name (GtkWidget * wid, gpointer edata)
358{
359 int i, j, k;
360 gchar * tmp;
361 i = GPOINTER_TO_INT (edata);
362 tmp = g_strdup_printf ("Please enter a new name for project N°%d", i);
363 project * this_proj = get_project_by_id(i);
364 tmp = cask(tmp, "Project name", i, this_proj -> name, MainWindow);
365 if (tmp != NULL)
366 {
367 this_proj -> name = g_strdup_printf ("%s", tmp);
368 if (i == activep)
369 {
370 g_free (tmp);
371 tmp = g_strdup_printf ("<b>%s</b>", this_proj -> name);
372 }
373 gtk_tree_store_set (workstore, & piter[i], 1, tmp, -1);
374 g_free (tmp);
375 // Need to update other project windows names !!!
376 gchar * tmp_title = prepare_for_title (this_proj -> name);
377 if (this_proj -> modelgl != NULL)
378 {
379 if (this_proj -> modelgl -> win != NULL)
380 {
381 correct_this_window_title (this_proj -> modelgl -> win, g_strdup_printf ("%s - 3D view - [%s mode]", tmp_title, mode_name[this_proj -> modelgl -> mode]));
382 }
383 gchar * win_title[2]={"Atom(s) configuration", "Clone(s) configuration"};
384 for (j=0; j<2; j++)
385 {
386 if (this_proj -> modelgl -> model_win[j] != NULL)
387 {
388 correct_this_window_title (this_proj -> modelgl -> model_win[j] -> win, g_strdup_printf ("%s - %s", win_title[j], tmp_title));
389 }
390 }
391 if (this_proj -> modelgl -> coord_win != NULL)
392 {
393 correct_this_window_title (this_proj -> modelgl -> coord_win -> win, g_strdup_printf ("Environments configuration - %s", tmp_title));
394 }
395 if (this_proj -> modelgl -> atom_win != NULL)
396 {
397 correct_this_window_title (this_proj -> modelgl -> atom_win -> win, g_strdup_printf ("Model edition - %s", tmp_title));
398 }
399 if (this_proj -> modelgl -> cell_win != NULL)
400 {
401 correct_this_window_title (this_proj -> modelgl -> cell_win -> win, g_strdup_printf ("Cell edition - %s", tmp_title));
402 }
403 if (this_proj -> modelgl -> opengl_win != NULL)
404 {
405 correct_this_window_title (this_proj -> modelgl -> opengl_win -> win, g_strdup_printf ("OpenGL material aspect and light settings - %s", tmp_title));
406 }
407 if (this_proj -> modelgl -> spiner != NULL)
408 {
409 correct_this_window_title (this_proj -> modelgl -> spiner -> win, g_strdup_printf ("%s - spin", tmp_title));
410 }
411 if (this_proj -> modelgl -> player != NULL)
412 {
413 j = this_proj -> modelgl -> anim -> last -> img -> step;
414 correct_this_window_title (this_proj -> modelgl -> player -> win, g_strdup_printf ("%s - player - step %d", tmp_title, j));
415 }
416 if (this_proj -> modelgl -> measure_win != NULL)
417 {
418 correct_this_window_title (this_proj -> modelgl -> measure_win -> win, g_strdup_printf ("%s - measures", tmp_title));
419 }
420 if (this_proj -> modelgl -> gradient_win != NULL)
421 {
422 correct_this_window_title (this_proj -> modelgl -> gradient_win -> win, g_strdup_printf ("%s - background settings", tmp_title));
423 }
424 if (this_proj -> modelgl -> box_win != NULL)
425 {
426 correct_this_window_title (this_proj -> modelgl -> box_win -> win, g_strdup_printf ("%s - box settings", tmp_title));
427 }
428 if (this_proj -> modelgl -> axis_win != NULL)
429 {
430 correct_this_window_title (this_proj -> modelgl -> axis_win -> win, g_strdup_printf ("%s - axis settings", tmp_title));
431 }
432 if (this_proj -> modelgl -> rep_win != NULL)
433 {
434 correct_this_window_title (this_proj -> modelgl -> rep_win -> win, g_strdup_printf ("%s - OpenGL camera set-up", tmp_title));
435 }
436 }
437 g_free (tmp_title);
438 for (j=0; j<NGRAPHS; j++)
439 {
440 if (this_proj -> initok[j])
441 {
442 for (k=0; k<this_proj -> numc[j]; k++)
443 {
444 if (this_proj -> curves[j][k] -> window != NULL)
445 {
446 correct_this_window_title (this_proj -> curves[j][k] -> window, g_strdup_printf ("%s - %s", prepare_for_title(this_proj -> name), this_proj -> curves[j][k] -> name));
447 }
448 }
449 }
450 }
451 if (activep == i)
452 {
453 correct_this_window_title (MainWindow, g_strdup_printf ("%s - %s", PACKAGE, prepare_for_title(active_project -> name)));
454 correct_this_window_title (curvetoolbox, g_strdup_printf ("Toolboxes - %s", prepare_for_title(active_project -> name)));
455 }
456 }
457}
458
469void workspace_menu (GtkWidget * tree, gpointer event, double x, double y)
470{
471 GtkWidget * menu;
472 GtkTreePath * mpath;
473 int this_calc = -1;
474 gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW(tree), (gint)x, (gint)y, & mpath, NULL, NULL, NULL);
475 if (mpath != NULL)
476 {
477 activew = find_proj_by_path (mpath);
478 this_calc = find_calc_by_path (GTK_TREE_VIEW(tree), mpath);
479 }
480 else
481 {
483 }
484 menu = work_menu (activew, this_calc);
485#ifdef GTK3
486 pop_menu_at_pointer (menu, (GdkEvent *)event);
487#else
488 gtk_widget_set_parent (menu, MainWindow);
489 pop_menu_at_pointer (menu, x, y);
490#endif
491}
492
493#ifdef GTK4
505G_MODULE_EXPORT void workspace_popup (GtkGesture * gesture, int n_press, double x, double y, gpointer data)
506{
507 if (gtk_gesture_single_get_current_button ((GtkGestureSingle * )gesture) == GDK_BUTTON_SECONDARY)
508 {
509 workspace_menu ((GtkWidget *)data, NULL, x, y);
510 }
511}
512#else
522G_MODULE_EXPORT gboolean on_workspace_button_event (GtkWidget * widget, GdkEventButton * event, gpointer data)
523{
524 if (event -> type == GDK_BUTTON_PRESS && event -> button == 3)
525 {
526 workspace_menu (widget, (gpointer)event, event -> x, event -> y);
527 }
528 return FALSE;
529}
530#endif
531
532void workspace_set_visible (GtkTreeViewColumn * col,
533 GtkCellRenderer * renderer,
534 GtkTreeModel * mod,
535 GtkTreeIter * iter,
536 gpointer data)
537{
538 gtk_cell_renderer_set_visible (renderer, FALSE);
539}
540
547{
548 GtkTreeViewColumn * col;
549 GtkCellRenderer * renderer;
550 GtkTreeSelection * workselect;
551
553 workstore = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT);
554 fill_workspace (workstore);
555 worktree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(workstore));
556 g_object_unref (workstore);
557
558
559 col = gtk_tree_view_column_new ();
560
561 renderer = gtk_cell_renderer_pixbuf_new ();
562 gtk_tree_view_column_pack_start (col, renderer, FALSE);
563 gtk_tree_view_column_set_attributes (col, renderer, "pixbuf", 0, NULL);
564
565 renderer = gtk_cell_renderer_text_new();
566 gtk_tree_view_column_pack_start (col, renderer, TRUE);
567 gtk_tree_view_column_set_attributes (col, renderer, "markup", 1, NULL);
568
569 renderer = gtk_cell_renderer_text_new ();
570 gtk_tree_view_column_pack_start (col, renderer, TRUE);
571 gtk_tree_view_column_set_attributes (col, renderer, "markup", 2, NULL);
572 gtk_tree_view_column_set_cell_data_func (col, renderer, workspace_set_visible, NULL, NULL);
573
574 gtk_tree_view_append_column(GTK_TREE_VIEW(worktree), col);
575
576 workselect = gtk_tree_view_get_selection (GTK_TREE_VIEW(worktree));
577 gtk_tree_selection_set_mode (workselect, GTK_SELECTION_SINGLE);
578 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(worktree), FALSE);
579 //g_signal_connect (G_OBJECT(workselect), "changed", G_CALLBACK(selework), (gpointer)worktree);
580 g_signal_connect (G_OBJECT(worktree), "row-activated", G_CALLBACK(workspace_ondc), NULL);
581#ifdef GTK3
582 g_signal_connect (G_OBJECT(worktree), "button-press-event", G_CALLBACK(on_workspace_button_event), NULL);
583#else
584 add_widget_gesture_and_key_action (worktree, "workspace-context-click", G_CALLBACK(workspace_popup), (gpointer)worktree,
585 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
586#endif
587 gtk_tree_view_expand_all (GTK_TREE_VIEW(worktree));
588 return worktree;
589}
590
597{
599 lab = NULL;
600 witer = NULL;
601 wpath = NULL;
603}
604
611{
612 if (worktree != NULL && workstore != NULL && nprojects > 0)
613 {
614 int i;
615 if (projects_in_workspace > 0)
616 {
617 GtkTreeIter ** tmpiter;
618 tmpiter = g_malloc (projects_in_workspace*sizeof*tmpiter);
619 for (i=0; i<projects_in_workspace; i++)
620 {
621 tmpiter[i] = gtk_tree_iter_copy (& piter[i]);
622 }
623 if (piter != NULL) g_free (piter);
624 if (prpath != NULL) g_free (prpath);
625 piter = g_malloc ((projects_in_workspace+1)*sizeof*piter);
626 prpath = g_malloc ((projects_in_workspace+1)*sizeof*prpath);
627 for (i=0; i<projects_in_workspace; i++)
628 {
629 piter[i] = * gtk_tree_iter_copy (tmpiter[i]);
630 prpath[i] = gtk_tree_model_get_path (GTK_TREE_MODEL(workstore), & piter[i]);
631 gtk_tree_store_set (workstore, & piter[i], 1, get_project_by_id(i) -> name, -1);
632 }
633 if (tmpiter != NULL) g_free (tmpiter);
634 }
635 else
636 {
637 if (prpath != NULL) g_free (prpath);
638 if (piter != NULL) g_free (piter);
639 piter = g_malloc ((projects_in_workspace+1)*sizeof*piter);
640 prpath = g_malloc ((projects_in_workspace+1)*sizeof*prpath);
641 }
643 newspace = FALSE;
644 }
645 else
646 {
648 }
649 if (nprojects == 0)
650 {
652 }
653 else
654 {
656 }
657}
658
667{
668 int i, j;
669 GtkTreeIter ** tmpiter;
670
671 if (worktree != NULL && workstore != NULL && nprojects > 0)
672 {
673 if (wpath != NULL)
674 {
676 if (i == id)
677 {
678 wpath = NULL;
679 wchar = NULL;
680 }
681 }
682 if (projects_in_workspace > 1)
683 {
684 tmpiter = g_malloc ((projects_in_workspace-1)*sizeof*tmpiter);
685 j = -1;
686 for (i=0; i<projects_in_workspace; i++)
687 {
688 if (i != id)
689 {
690 j++;
691 tmpiter[j] = gtk_tree_iter_copy (& piter[i]);
692 }
693 }
694 gtk_tree_store_remove (workstore, & piter[id]);
695 g_free (piter);
696 g_free (prpath);
698 piter = g_malloc (projects_in_workspace*sizeof*piter);
699 prpath = g_malloc (projects_in_workspace*sizeof*prpath);
700 j = -1;
701 for (i=0; i<projects_in_workspace+1; i++)
702 {
703 if (i != id)
704 {
705 j ++;
706 piter[j] = * gtk_tree_iter_copy (tmpiter[j]);
707 prpath[j] = gtk_tree_model_get_path (GTK_TREE_MODEL(workstore), & piter[j]);
708 gtk_tree_store_set (workstore, & piter[j], 1, get_project_by_id(i) -> name, -1);
709 }
710 }
711 g_free (tmpiter);
712 }
713 else
714 {
715 gtk_tree_store_remove (workstore, & piter[id]);
716 if (prpath != NULL) g_free (prpath);
717 prpath = NULL;
718 if (piter != NULL) g_free (piter);
719 piter = NULL;
722 witer = NULL;
723 wchar = NULL;
724 }
725 }
726}
Callback declarations for main window.
#define PACKAGE
Definition config.h:46
ColRGBA col
Definition d_measures.c:77
GtkTreePath * path
Definition datab.c:103
gboolean newspace
Definition global.c:181
GtkWidget * MainScrol[2]
Definition global.c:207
int activep
Definition global.c:159
int activew
Definition global.c:163
int nprojects
Definition global.c:158
GtkWidget * MainWindow
Definition global.c:201
GdkPixbuf * OGLM
Definition global.c:222
gchar * mode_name[2]
Definition global.c:138
GdkPixbuf * RUN
Definition global.c:224
GdkPixbuf * THETD
Definition global.c:216
GdkPixbuf * SETTING
Definition global.c:219
GtkWidget * curvetoolbox
Definition global.c:205
Global variable declarations Global convenience function declarations Global data structure defin...
gchar * graph_img[NGRAPHS]
Definition gui.c:107
void pop_menu_at_pointer(GtkWidget *widg, GdkEvent *event)
popup a menu at pointer location
Definition gtk-misc.c:2436
#define NGRAPHS
#define NITEMS
Definition global.h:322
@ CONTAINER_SCR
Definition global.h:253
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
Definition gtk-misc.c:215
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
Definition gtk-misc.c:2169
gchar * prepare_for_title(gchar *init)
prepare a string for a window title, getting rid of all markup
Definition tools.c:71
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
Definition gtk-misc.c:235
struct model model
data structure to describe the topology
Definition global.h:830
project * active_project
Definition project.c:47
#define NCALCS
void show_the_widgets(GtkWidget *widg)
show GtkWidget
Definition gtk-misc.c:182
project * get_project_by_id(int p)
get project pointer using id number
Definition project.c:120
int step
Definition ogl_draw.c:74
void prep_model(int p)
prepare, or display, the OpenGL model window
Definition glwindow.c:1533
Function declarations for the creation of the OpenGL window.
gchar * cask(char *question, char *lab, int id, char *old, GtkWidget *win)
enter a string - prepare the dialog
Definition interface.c:706
Messaging function declarations.
double y
Definition ogl_draw.c:61
double x
Definition ogl_draw.c:61
Function declarations for reading atomes project file Function declarations for saving atomes proje...
void active_project_changed(int id)
change the active project
Definition update_p.c:175
int c
Definition tab-1.c:95
int find_calc_by_path(GtkTreeView *treeview, GtkTreePath *path)
find the calculation using the GtkTreePath in the GtkTreeView
Definition workspace.c:214
gchar * wchar
Definition workspace.c:86
GtkTreePath * wpath
Definition workspace.c:84
void add_project_to_workspace()
add project(s) to the workspace tree
Definition workspace.c:610
GdkPixbuf * pix
Definition workspace.c:69
GtkWidget * hbox
Definition workspace.c:71
void workspace_set_visible(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
Definition workspace.c:532
void remove_project_from_workspace(int id)
remove project from workspace
Definition workspace.c:666
GtkTreeIter worklevel
Definition workspace.c:80
GtkWidget * img
Definition workspace.c:70
GtkWidget * lap
Definition workspace.c:74
GtkWidget * create_workspace_tree()
create the workspace tree store
Definition workspace.c:546
GtkWidget * vbox
Definition workspace.c:72
void correct_this_window_title(GtkWidget *win, gchar *str)
use new title for GtkWindow, providing it exists
Definition workspace.c:337
int projects_in_workspace
Definition workspace.c:87
GtkWidget * lab
Definition workspace.c:73
void workspace_menu(GtkWidget *tree, gpointer event, double x, double y)
popup the workspace contextual menu in workspace tree view
Definition workspace.c:469
GdkPixbuf * wpix
Definition workspace.c:85
void create_workspace()
create the workspace
Definition workspace.c:596
int find_proj_by_path(GtkTreePath *path)
find the project id using the GtkTreePath
Definition workspace.c:235
GtkWidget * work_menu(int p, int c)
create the workspace popup menu
Definition work_menu.c:202
GtkTreeStore * workstore
Definition workspace.c:79
gchar * laptmp
Definition workspace.c:77
G_MODULE_EXPORT void activate_project(GtkWidget *widg, gpointer data)
activate a project
Definition workspace.c:191
void workinfo(project *this_proj, int i)
display information about a workspace menu item for a project
Definition workinfo.c:59
gchar * labtmp
Definition workspace.c:76
GtkTreeIter * witer
Definition workspace.c:82
char * work_menu_items[NITEMS-2]
Definition workspace.c:89
GtkTreePath ** prpath
Definition workspace.c:83
GtkWidget * worktree
Definition workspace.c:78
void add_project(GtkTreeStore *store, int i)
add project to the GtkTreeStore of the workspace
Definition workspace.c:114
G_MODULE_EXPORT void change_project_name(GtkWidget *wid, gpointer edata)
change project name
Definition workspace.c:357
G_MODULE_EXPORT gboolean on_workspace_button_event(GtkWidget *widget, GdkEventButton *event, gpointer data)
GTK3 button event on workspace to display contextual menu.
Definition workspace.c:522
GtkWidget * eap
Definition workspace.c:75
GtkTreeIter * piter
Definition workspace.c:81
G_MODULE_EXPORT void workspace_ondc(GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data)
do something after Double Click in the workspace tree
Definition workspace.c:262