atomes 1.3.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-2026 by CNRS and University of Strasbourg */
15
22
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] = {i18n("Workspace "),
90 i18n("Settings "),
91 //i18n("OpenGL - 3D "),
92 i18n("Visualization "),
93 //i18n("Calc. visualization "),
94 i18n("Analysis ")};
95
104void add_project (GtkTreeStore * store, int i)
105{
106 int j;
107 gchar * tmp;
108 GtkTreeIter steplevel;
109 GtkTreeIter optslevel;
110 gtk_tree_store_append (store, & piter[i], & worklevel);
111 project * this_proj = get_project_by_id(i);
112 if (i == activep)
113 {
114 tmp = g_strdup_printf ("<b>%s</b>", this_proj -> name);
115 }
116 else
117 {
118 tmp = g_strdup_printf ("%s", this_proj -> name);
119 }
120 gtk_tree_store_set (store, & piter[i], 0, THETD, 1, tmp, 2, -1, -1);
121 prpath[i] = gtk_tree_model_get_path (GTK_TREE_MODEL(store), & piter[i]);
122 g_free (tmp);
123 gtk_tree_store_append (store, & steplevel, & piter[i]);
124 gtk_tree_store_set (store, & steplevel, 0, SETTING, 1, _(work_menu_items[1]), 2, -3, -1);
125 // OpenGL
126 gtk_tree_store_append (store, & steplevel, & piter[i]);
127 gtk_tree_store_set (store, & steplevel, 0, OGLM, 1, _(work_menu_items[2]), 2, -2, -1);
128 // Calculations
129 gtk_tree_store_append (store, & steplevel, & piter[i]);
130 gtk_tree_store_set (store, & steplevel, 0, RUN, 1, _(work_menu_items[3]), 2, -1, -1);
131
132 for (j=0; j<NCALCS; j++)
133 {
134 if (j < NCALCS-2 || get_project_by_id(i) -> steps > 1)
135 {
136 gtk_tree_store_append (store, & optslevel, & steplevel);
137 gtk_tree_store_set (store, & optslevel, 0, gdk_pixbuf_new_from_file(graph_img[j], NULL), 1, _(graph_name[j]), 2, j, -1);
138 }
139 }
140 gtk_tree_view_expand_to_path (GTK_TREE_VIEW(worktree), gtk_tree_model_get_path(GTK_TREE_MODEL(store), & worklevel));
142}
143
151static void fill_workspace (GtkTreeStore * store)
152{
153 int i;
154
155 gtk_tree_store_append (store, & worklevel, NULL);
156 gtk_tree_store_set (store, & worklevel, 0, THETD, 1, _(work_menu_items[0]), 2, -4, -1);
157
158 if (piter != NULL) g_free (piter);
159 if (prpath != NULL) g_free (prpath);
160 if (nprojects > 0)
161 {
162 piter = g_malloc0(nprojects*sizeof*piter);
163 prpath = g_malloc0(nprojects*sizeof*prpath);
164 }
165 for (i=0; i<nprojects; i++)
166 {
167 add_project (store, i);
168 }
169}
170
179G_MODULE_EXPORT void activate_project (GtkWidget * widg, gpointer data)
180{
181 int id = GPOINTER_TO_INT (data);
182
183 if (activep < nprojects)
184 {
185 gtk_tree_store_set (workstore, & piter[activep], 1, active_project -> name, -1);
186 }
188
189 gchar * tmp = g_strdup_printf ("<b>%s</b>", active_project -> name);
190 gtk_tree_store_set (workstore, & piter[id], 1, tmp, -1);
191 g_free (tmp);
192}
193
202int find_calc_by_path (GtkTreeView * treeview, GtkTreePath * path)
203{
204 int i;
205 GtkTreeIter iter;
206 GtkTreeModel * model = gtk_tree_view_get_model (treeview);
207 if (gtk_tree_model_get_iter (model, & iter, path))
208 {
209 gtk_tree_model_get (model, & iter, 2, & i, -1);
210 return i;
211 }
212 return -1;
213}
214
215
223int find_proj_by_path (GtkTreePath * path)
224{
225 int i, j;
226
227 i = -1;
228 for (j=0; j<nprojects; j++)
229 {
230 if (gtk_tree_path_compare (prpath[j], path) <= 0) i = j;
231 }
232 return i;
233}
234
250G_MODULE_EXPORT void workspace_ondc (GtkTreeView * treeview,
251 GtkTreePath * path,
252 GtkTreeViewColumn * col,
253 gpointer data)
254{
255 int i, j;
256 GtkTreeModel * model;
257 GtkTreeIter iter;
258 model = gtk_tree_view_get_model (treeview);
259 gboolean was = FALSE;
260#ifdef DEBUG
261 g_debug ("WORKSPACE_ONDC: activep= %d", activep);
262#endif
263 if (gtk_tree_model_get_iter (model, & iter, path))
264 {
265#ifdef DEBUG
266 g_debug ("WORKSPACE_ONDC: in workspace");
267#endif
268 for (i=0; i<nprojects; i++)
269 {
270 if (gtk_tree_path_compare (path, prpath[i]) == 0)
271 {
272 if (i != activep) activate_project (NULL, GINT_TO_POINTER(i));
273 was = TRUE;
274 }
275 }
276 if (! was)
277 {
278#ifdef DEBUG
279 g_debug ("WORKSPACE_ONDC: not an activation");
280#endif
281 if (wpath != NULL && witer != NULL && wchar != NULL)
282 {
283 gtk_tree_store_set (GTK_TREE_STORE(model), witer, 1, wchar, -1);
284 }
285#ifdef DEBUG
286 g_debug ("WORKSPACE_ONDC: saving old data");
287#endif
288 wpath = gtk_tree_path_copy (path);
289 witer = gtk_tree_iter_copy (& iter);
290 gtk_tree_model_get (model, & iter, 1, & wchar, -1);
291#ifdef DEBUG
292 g_debug ("WORKSPACE_ONDC: modifying data");
293#endif
294 gchar * tmp = g_strdup_printf ("<b>%s</b>", wchar);
295 gtk_tree_store_set (GTK_TREE_STORE(model), & iter, 1, tmp, -1);
296 g_free (tmp);
297#ifdef DEBUG
298 g_debug ("WORKSPACE_ONDC: cleaning view");
299 g_debug ("WORKSPACE_ONDC: wchar = %s", wchar);
300#endif
301 gtk_tree_model_get (model, & iter, 2, & i, -1);
302#ifdef DEBUG
303 g_debug ("WORKSPACE_ONDC: creating view id= %d", i);
304#endif
306#ifdef DEBUG
307 g_debug ("WORKSPACE_ONDC: for project= %d", j);
308#endif
309 if (j < 0) j = activep;
310 if (i == -2) prep_model (j);
312 }
313 }
314}
315
324void correct_this_window_title (GtkWidget * win, gchar * str)
325{
326 if (win)
327 {
328 if (GTK_IS_WIDGET(win))
329 {
330 gtk_window_set_title (GTK_WINDOW (win), str);
331 }
332 }
333 if (str) g_free (str);
334}
335
344G_MODULE_EXPORT void change_project_name (GtkWidget * wid, gpointer edata)
345{
346 int i, j, k;
347 gchar * tmp;
348 i = GPOINTER_TO_INT (edata);
349 tmp = g_strdup_printf (_("Please enter a new name for project N°%d"), i);
350 project * this_proj = get_project_by_id(i);
351 tmp = cask(tmp, _("Project name"), i, this_proj -> name, MainWindow);
352 if (tmp != NULL)
353 {
354 this_proj -> name = g_strdup_printf ("%s", tmp);
355 if (i == activep)
356 {
357 g_free (tmp);
358 tmp = g_strdup_printf ("<b>%s</b>", this_proj -> name);
359 }
360 gtk_tree_store_set (workstore, & piter[i], 1, tmp, -1);
361 g_free (tmp);
362 // Need to update other project windows names !!!
363 gchar * tmp_title = prepare_for_title (this_proj -> name);
364 if (this_proj -> modelgl != NULL)
365 {
366 if (this_proj -> modelgl -> win != NULL)
367 {
368 correct_this_window_title (this_proj -> modelgl -> win, g_strdup_printf (_("%s - 3D view - [%s mode]"), tmp_title, _(mode_name[this_proj -> modelgl -> mode])));
369 }
370 gchar * win_title[2]={i18n("Atom(s) configuration"), i18n("Clone(s) configuration")};
371 for (j=0; j<2; j++)
372 {
373 if (this_proj -> modelgl -> model_win[j] != NULL)
374 {
375 correct_this_window_title (this_proj -> modelgl -> model_win[j] -> win, g_strdup_printf ("%s - %s", _(win_title[j]), tmp_title));
376 }
377 }
378 if (this_proj -> modelgl -> coord_win != NULL)
379 {
380 correct_this_window_title (this_proj -> modelgl -> coord_win -> win, g_strdup_printf (_("Environments configuration - %s"), tmp_title));
381 }
382 if (this_proj -> modelgl -> atom_win != NULL)
383 {
384 correct_this_window_title (this_proj -> modelgl -> atom_win -> win, g_strdup_printf (_("Model edition - %s"), tmp_title));
385 }
386 if (this_proj -> modelgl -> cell_win != NULL)
387 {
388 correct_this_window_title (this_proj -> modelgl -> cell_win -> win, g_strdup_printf (_("Cell edition - %s"), tmp_title));
389 }
390 if (this_proj -> modelgl -> opengl_win != NULL)
391 {
392 correct_this_window_title (this_proj -> modelgl -> opengl_win -> win, g_strdup_printf (_("OpenGL material aspect and light settings - %s"), tmp_title));
393 }
394 if (this_proj -> modelgl -> spiner != NULL)
395 {
396 correct_this_window_title (this_proj -> modelgl -> spiner -> win, g_strdup_printf (_("%s - spin"), tmp_title));
397 }
398 if (this_proj -> modelgl -> player != NULL)
399 {
400 j = this_proj -> modelgl -> anim -> last -> img -> step;
401 correct_this_window_title (this_proj -> modelgl -> player -> win, g_strdup_printf (_("%s - player - step %d"), tmp_title, j));
402 }
403 if (this_proj -> modelgl -> measure_win != NULL)
404 {
405 correct_this_window_title (this_proj -> modelgl -> measure_win -> win, g_strdup_printf (_("%s - measures"), tmp_title));
406 }
407 if (this_proj -> modelgl -> gradient_win != NULL)
408 {
409 correct_this_window_title (this_proj -> modelgl -> gradient_win -> win, g_strdup_printf (_("%s - background settings"), tmp_title));
410 }
411 if (this_proj -> modelgl -> box_win != NULL)
412 {
413 correct_this_window_title (this_proj -> modelgl -> box_win -> win, g_strdup_printf (_("%s - box settings"), tmp_title));
414 }
415 if (this_proj -> modelgl -> axis_win != NULL)
416 {
417 correct_this_window_title (this_proj -> modelgl -> axis_win -> win, g_strdup_printf (_("%s - axis settings"), tmp_title));
418 }
419 if (this_proj -> modelgl -> rep_win != NULL)
420 {
421 correct_this_window_title (this_proj -> modelgl -> rep_win -> win, g_strdup_printf ("%s - OpenGL camera set-up", tmp_title));
422 }
423 }
424 g_free (tmp_title);
425 for (j=0; j<NCALCS; j++)
426 {
427 if (this_proj -> analysis[j] -> init_ok)
428 {
429 for (k=0; k<this_proj -> analysis[j] -> numc; k++)
430 {
431 if (this_proj -> analysis[j] -> curves[k] -> window != NULL)
432 {
433 correct_this_window_title (this_proj -> analysis[j] -> curves[k] -> window, g_strdup_printf ("%s - %s", prepare_for_title(this_proj -> name), this_proj -> analysis[j] -> curves[k] -> name));
434 }
435 }
436 }
437 }
438 if (activep == i)
439 {
440 correct_this_window_title (MainWindow, g_strdup_printf ("%s - %s", PACKAGE, prepare_for_title(active_project -> name)));
441 correct_this_window_title (curvetoolbox, g_strdup_printf (_("Toolboxes - %s"), prepare_for_title(active_project -> name)));
442 }
443 }
444}
445
456void workspace_menu (GtkWidget * tree, gpointer event, double x, double y)
457{
458 GtkWidget * menu;
459 GtkTreePath * mpath;
460 int this_calc = -1;
461 gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW(tree), (gint)x, (gint)y, & mpath, NULL, NULL, NULL);
462 if (mpath != NULL)
463 {
464 activew = find_proj_by_path (mpath);
465 this_calc = find_calc_by_path (GTK_TREE_VIEW(tree), mpath);
466 }
467 else
468 {
470 }
471 menu = work_menu (activew, this_calc);
472#ifdef GTK3
473 pop_menu_at_pointer (menu, (GdkEvent *)event);
474#else
475 gtk_widget_set_parent (menu, tree);
476 pop_menu_at_pointer (menu, x, y);
477#endif
478}
479
480#ifdef GTK4
492G_MODULE_EXPORT void workspace_popup (GtkGesture * gesture, int n_press, double x, double y, gpointer data)
493{
494 if (gtk_gesture_single_get_current_button ((GtkGestureSingle * )gesture) == GDK_BUTTON_SECONDARY)
495 {
496 workspace_menu ((GtkWidget *)data, NULL, x, y);
497 }
498}
499#else
509G_MODULE_EXPORT gboolean on_workspace_button_event (GtkWidget * widget, GdkEventButton * event, gpointer data)
510{
511 if (event -> type == GDK_BUTTON_PRESS && event -> button == 3)
512 {
513 workspace_menu (widget, (gpointer)event, event -> x, event -> y);
514 }
515 return FALSE;
516}
517#endif
518
519void workspace_set_visible (GtkTreeViewColumn * col,
520 GtkCellRenderer * renderer,
521 GtkTreeModel * mod,
522 GtkTreeIter * iter,
523 gpointer data)
524{
525 gtk_cell_renderer_set_visible (renderer, FALSE);
526}
527
534{
535 GtkTreeViewColumn * col;
536 GtkCellRenderer * renderer;
537 GtkTreeSelection * workselect;
538
540 workstore = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT);
541 worktree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(workstore));
542 fill_workspace (workstore);
543 g_object_unref (workstore);
544
545
546 col = gtk_tree_view_column_new ();
547
548 renderer = gtk_cell_renderer_pixbuf_new ();
549 gtk_tree_view_column_pack_start (col, renderer, FALSE);
550 gtk_tree_view_column_set_attributes (col, renderer, "pixbuf", 0, NULL);
551
552 renderer = gtk_cell_renderer_text_new();
553 gtk_tree_view_column_pack_start (col, renderer, TRUE);
554 gtk_tree_view_column_set_attributes (col, renderer, "markup", 1, NULL);
555
556 renderer = gtk_cell_renderer_text_new ();
557 gtk_tree_view_column_pack_start (col, renderer, TRUE);
558 gtk_tree_view_column_set_attributes (col, renderer, "markup", 2, NULL);
559 gtk_tree_view_column_set_cell_data_func (col, renderer, workspace_set_visible, NULL, NULL);
560
561 gtk_tree_view_append_column(GTK_TREE_VIEW(worktree), col);
562
563 workselect = gtk_tree_view_get_selection (GTK_TREE_VIEW(worktree));
564 gtk_tree_selection_set_mode (workselect, GTK_SELECTION_SINGLE);
565 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(worktree), FALSE);
566 //g_signal_connect (G_OBJECT(workselect), "changed", G_CALLBACK(selework), (gpointer)worktree);
567 g_signal_connect (G_OBJECT(worktree), "row-activated", G_CALLBACK(workspace_ondc), NULL);
568#ifdef GTK3
569 g_signal_connect (G_OBJECT(worktree), "button-press-event", G_CALLBACK(on_workspace_button_event), NULL);
570#else
571 add_widget_gesture_and_key_action (worktree, "workspace-context-click", G_CALLBACK(workspace_popup), (gpointer)worktree,
572 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
573#endif
574 gtk_tree_view_expand_all (GTK_TREE_VIEW(worktree));
575 return worktree;
576}
577
584{
586 lab = NULL;
587 witer = NULL;
588 wpath = NULL;
590}
591
598{
599 if (worktree != NULL && workstore != NULL && nprojects > 0)
600 {
601 int i;
602 if (projects_in_workspace > 0)
603 {
604 GtkTreeIter ** tmpiter;
605 tmpiter = g_malloc0(projects_in_workspace*sizeof*tmpiter);
606 for (i=0; i<projects_in_workspace; i++)
607 {
608 tmpiter[i] = gtk_tree_iter_copy (& piter[i]);
609 }
610 if (piter != NULL) g_free (piter);
611 if (prpath != NULL) g_free (prpath);
612 piter = g_malloc0((projects_in_workspace+1)*sizeof*piter);
613 prpath = g_malloc0((projects_in_workspace+1)*sizeof*prpath);
614 for (i=0; i<projects_in_workspace; i++)
615 {
616 piter[i] = * gtk_tree_iter_copy (tmpiter[i]);
617 prpath[i] = gtk_tree_model_get_path (GTK_TREE_MODEL(workstore), & piter[i]);
618 gtk_tree_store_set (workstore, & piter[i], 1, get_project_by_id(i) -> name, -1);
619 }
620 if (tmpiter != NULL) g_free (tmpiter);
621 }
622 else
623 {
624 if (prpath != NULL) g_free (prpath);
625 if (piter != NULL) g_free (piter);
626 piter = g_malloc0((projects_in_workspace+1)*sizeof*piter);
627 prpath = g_malloc0((projects_in_workspace+1)*sizeof*prpath);
628 }
630 newspace = FALSE;
631 }
632 else
633 {
635 }
636 if (nprojects == 0)
637 {
639 }
640 else
641 {
643 }
644}
645
654{
655 int i, j;
656 GtkTreeIter ** tmpiter;
657
658 if (worktree != NULL && workstore != NULL && nprojects > 0)
659 {
660 if (wpath != NULL)
661 {
663 if (i == id)
664 {
665 wpath = NULL;
666 wchar = NULL;
667 }
668 }
669 if (projects_in_workspace > 1)
670 {
671 tmpiter = g_malloc0((projects_in_workspace-1)*sizeof*tmpiter);
672 j = -1;
673 for (i=0; i<projects_in_workspace; i++)
674 {
675 if (i != id)
676 {
677 j++;
678 tmpiter[j] = gtk_tree_iter_copy (& piter[i]);
679 }
680 }
681 gtk_tree_store_remove (workstore, & piter[id]);
682 g_free (piter);
683 g_free (prpath);
685 piter = g_malloc0(projects_in_workspace*sizeof*piter);
686 prpath = g_malloc0(projects_in_workspace*sizeof*prpath);
687 j = -1;
688 for (i=0; i<projects_in_workspace+1; i++)
689 {
690 if (i != id)
691 {
692 j ++;
693 piter[j] = * gtk_tree_iter_copy (tmpiter[j]);
694 prpath[j] = gtk_tree_model_get_path (GTK_TREE_MODEL(workstore), & piter[j]);
695 gtk_tree_store_set (workstore, & piter[j], 1, get_project_by_id(i) -> name, -1);
696 }
697 }
698 g_free (tmpiter);
699 }
700 else
701 {
702 gtk_tree_store_remove (workstore, & piter[id]);
703 if (prpath != NULL) g_free (prpath);
704 prpath = NULL;
705 if (piter != NULL) g_free (piter);
706 piter = NULL;
709 witer = NULL;
710 wchar = NULL;
711 }
712 }
713}
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:185
GtkWidget * MainScrol[2]
Definition global.c:213
int activep
Definition global.c:162
int activew
Definition global.c:166
int nprojects
Definition global.c:161
GtkWidget * MainWindow
Definition global.c:207
GdkPixbuf * OGLM
Definition global.c:228
gchar * mode_name[2]
Definition global.c:141
GdkPixbuf * RUN
Definition global.c:230
GdkPixbuf * THETD
Definition global.c:222
GdkPixbuf * SETTING
Definition global.c:225
#define i18n(String)
Definition global.c:80
GtkWidget * curvetoolbox
Definition global.c:211
Global variable declarations Global convenience function declarations Global data structure defin...
gchar * graph_img[NCALCS]
Definition gui.c:106
char * graph_name[]
Definition gui.c:123
void pop_menu_at_pointer(GtkWidget *widg, GdkEvent *event)
popup a menu at pointer location
Definition gtk-misc.c:2471
#define NITEMS
Definition global.h:334
@ CONTAINER_SCR
Definition global.h:267
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
Definition gtk-misc.c:247
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
Definition gtk-misc.c:2213
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:267
project * active_project
Definition project.c:47
#define NCALCS
void show_the_widgets(GtkWidget *widg)
show GtkWidget
Definition gtk-misc.c:202
project * get_project_by_id(int p)
get project pointer using id number
Definition project.c:120
int step
Definition ogl_draw.c:76
void prep_model(int p)
prepare, or display, the OpenGL model window
Definition glwindow.c:1498
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:770
Messaging function declarations.
double y
Definition ogl_draw.c:63
double x
Definition ogl_draw.c:63
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:220
int find_calc_by_path(GtkTreeView *treeview, GtkTreePath *path)
find the calculation using the GtkTreePath in the GtkTreeView
Definition workspace.c:202
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:597
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:519
void remove_project_from_workspace(int id)
remove project from workspace
Definition workspace.c:653
char * work_menu_items[NITEMS]
Definition workspace.c:89
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:533
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:324
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:456
GdkPixbuf * wpix
Definition workspace.c:85
void create_workspace()
create the workspace
Definition workspace.c:583
int find_proj_by_path(GtkTreePath *path)
find the project id using the GtkTreePath
Definition workspace.c:223
GtkWidget * work_menu(int p, int c)
create the workspace popup menu
Definition work_menu.c:216
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:179
void workinfo(project *this_proj, int i)
display information about a workspace menu item for a project
Definition workinfo.c:60
gchar * labtmp
Definition workspace.c:76
GtkTreeIter * witer
Definition workspace.c:82
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:104
G_MODULE_EXPORT void change_project_name(GtkWidget *wid, gpointer edata)
change project name
Definition workspace.c:344
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:509
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:250