atomes 1.1.14
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
gui.c File Reference

GUI of the main window
Menu elements of the workspace menu
Creation of menu items, actions, used in the entire atomes software. More...

#include "global.h"
#include "callbacks.h"
#include "interface.h"
#include "project.h"
#include "workspace.h"
+ Include dependency graph for gui.c:

Go to the source code of this file.

Functions

GtkWidget * curvetbox ()
 create the curve tool box window
 
GtkWidget * work_menu (int p, int c)
 create the workspace popup menu
 
G_MODULE_EXPORT void compute_this_prop (GtkWidget *widg, gpointer data)
 to compute the 'calc_to_compute'
 
G_MODULE_EXPORT void on_create_new_project (GtkWidget *widg, gpointer data)
 create a new project
 
int get_atom_id_from_periodic_table (atom_search *asearch)
 get atom Z from selection in the periodic table
 
G_MODULE_EXPORT void leaving_from_menu (GtkWidget *widg, gpointer data)
 leaving atomes ?
 
G_MODULE_EXPORT void on_edit_activate (GtkWidget *widg, gpointer data)
 create an edition dialog - prepare the dialog
 
G_MODULE_EXPORT void on_calc_activate (GtkWidget *widg, gpointer data)
 create a calculation dialog - prepare the dialog
 
void clean_view ()
 clean the main window
 
void view_buffer (GtkTextBuffer *buffer)
 set a text buffer in the main window or an image
 
void atomes_key_pressed (guint keyval, GdkModifierType state)
 main window key actions callbacks
 
void add_action (GSimpleAction *action)
 add action to the main window action map
 
void remove_action (gchar *action_name)
 add action from the main window action map
 
void remove_edition_actions ()
 remove all edition actions
 
void remove_edition_and_analyze_actions ()
 remove all edition and analysis action
 
G_MODULE_EXPORT void show_periodic_table (GtkWidget *widg, gpointer data)
 show the periodic table of the elements
 
G_MODULE_EXPORT void atomes_menu_bar_action (GSimpleAction *action, GVariant *parameter, gpointer data)
 atomes menu bar actions
 
GIcon * get_gicon_from_data (int format, const gchar *icon)
 
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
 
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
 
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
 
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
 
GMenu * workspace_section (gchar *act, int pop)
 create the workspace section
 
GMenu * port_section (gchar *act, int pop, int port)
 create the import/export menu items
 
GMenu * project_section (gchar *act, int pop_up, int proj, int calc)
 create the project section
 
GMenu * import_section (gchar *act)
 create the 'Import' submenu
 
GMenu * quit_section (gchar *act)
 create the 'Quit' menu item
 
GMenu * workspace_title ()
 create the 'Workspace' menu item
 
GMenu * project_title (int pop_up, int proj)
 create project title menu item
 
GMenu * create_workspace_menu (gchar *act, int pop_up, int proj, int calc)
 create atomes 'workspace' menu
 
GMenu * create_edit_menu ()
 create atomes 'edit' menu
 
GMenu * tool_box_section ()
 create toolboxes menu item
 
GMenu * create_analyze_menu ()
 create atomes 'analyze' menu
 
GMenu * create_help_menu ()
 create atomes 'help' menu
 
GMenu * atomes_menu_bar ()
 create atomes menu bar
 
GtkWidget * create_main_window (GApplication *atomes)
 create the main application window
 

Variables

int objects [3]
 
int * object_was_selected [3]
 
int ** tmp_object_id [3]
 
gchar * dots [NDOTS]
 
gchar * calc_img [NCALCS-2]
 
gchar * graph_img [NGRAPHS]
 
char * calc_name [NCALCS-2]
 
char * graph_name [NGRAPHS]
 
tint cut_sel
 
tint cut_lab
 
dint davect [9]
 
ColRGBA std [6]
 

Detailed Description

GUI of the main window
Menu elements of the workspace menu
Creation of menu items, actions, used in the entire atomes software.

Author
Sébastien Le Roux sebas.nosp@m.tien.nosp@m..lero.nosp@m.ux@i.nosp@m.pcms..nosp@m.unis.nosp@m.tra.f.nosp@m.r

Definition in file gui.c.

Function Documentation

◆ add_action()

void add_action ( GSimpleAction * action)

add action to the main window action map

Parameters
actionthe GAction sending the signal the action to add

Definition at line 284 of file gui.c.

◆ append_menu_item()

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

Parameters
menuthe menu to insert the item in
labelLabel of the menu item
actionAction of the menu item
accelKeyboard accelerator, if any
customCustom menu item ? NULL otherwise
formatImage format if not IMG_NONE
iconImage data if not NULL
checkCheck menu item ?
statusIf check then status
radioRadio menu item ?
rstatusIf radio then variant parameter

Definition at line 632 of file gui.c.

◆ append_submenu()

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

Parameters
menuthe GMenu to insert the item with a submenu
labelthe text for the menu item
submenuthe submenu to add to the menu item

Definition at line 602 of file gui.c.

◆ atomes_key_pressed()

void atomes_key_pressed ( guint keyval,
GdkModifierType state )

main window key actions callbacks

Parameters
keyvalkey id
statemodifier (Ctrl, Alt ...)

Definition at line 225 of file gui.c.

◆ atomes_menu_bar()

GMenu * atomes_menu_bar ( )

create atomes menu bar

Definition at line 904 of file gui.c.

◆ atomes_menu_bar_action()

G_MODULE_EXPORT void atomes_menu_bar_action ( GSimpleAction * action,
GVariant * parameter,
gpointer data )

atomes menu bar actions

Parameters
actionthe GAction sending the signal the GSimpleAction sending the signal
parameterGVariant parameter of the GAction the parameter of the action, if any
datathe associated data pointer

Definition at line 346 of file gui.c.

◆ clean_view()

void clean_view ( )

clean the main window

Definition at line 159 of file gui.c.

◆ compute_this_prop()

G_MODULE_EXPORT void compute_this_prop ( GtkWidget * widg,
gpointer data )
extern

to compute the 'calc_to_compute'

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 105 of file work_menu.c.

◆ create_analyze_menu()

GMenu * create_analyze_menu ( )

create atomes 'analyze' menu

Definition at line 869 of file gui.c.

◆ create_edit_menu()

GMenu * create_edit_menu ( )

create atomes 'edit' menu

Definition at line 843 of file gui.c.

◆ create_gmenu_item()

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

Parameters
labelLabel of the menu item
actionAction of the menu item
accelKeyboard accelerator, if any
customCustom menu item ? NULL otherwise
formatImage format if not IMG_NONE
iconImage data if not NULL
checkCheck menu item ?
statusIf check then status
radioRadio menu item ?
rstatusIf radio then variant parameter

Definition at line 556 of file gui.c.

◆ create_help_menu()

GMenu * create_help_menu ( )

create atomes 'help' menu

Definition at line 890 of file gui.c.

◆ create_main_window()

GtkWidget * create_main_window ( GApplication * atomes)

create the main application window

Parameters
atomesthe initial GtkApplication

Definition at line 968 of file gui.c.

◆ create_workspace_menu()

GMenu * create_workspace_menu ( gchar * act,
int pop_up,
int proj,
int calc )

create atomes 'workspace' menu

Parameters
act"app" or "pop" key for the GAction
pop_upfrom main app (0) or contextual (1)
projproject id, if any (or -1)
calccalculation id, if any (or -1)

Definition at line 826 of file gui.c.

◆ curvetbox()

GtkWidget * curvetbox ( )
extern

create the curve tool box window

Definition at line 321 of file tools.c.

◆ get_atom_id_from_periodic_table()

int get_atom_id_from_periodic_table ( atom_search * asearch)
extern

get atom Z from selection in the periodic table

Parameters
asearchtarget atom search, if any

Definition at line 672 of file w_periodic.c.

◆ get_gicon_from_data()

GIcon * get_gicon_from_data ( int format,
const gchar * icon )

Definition at line 484 of file gui.c.

◆ import_section()

GMenu * import_section ( gchar * act)

create the 'Import' submenu

Parameters
act"app" or "pop" key for the GAction

Definition at line 757 of file gui.c.

◆ leaving_from_menu()

G_MODULE_EXPORT void leaving_from_menu ( GtkWidget * widg,
gpointer data )
extern

leaving atomes ?

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 86 of file work_menu.c.

◆ on_calc_activate()

G_MODULE_EXPORT void on_calc_activate ( GtkWidget * widg,
gpointer data )
extern

create a calculation dialog - prepare the dialog

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 1378 of file calc_menu.c.

◆ on_create_new_project()

G_MODULE_EXPORT void on_create_new_project ( GtkWidget * widg,
gpointer data )
extern

create a new project

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 62 of file work_menu.c.

◆ on_edit_activate()

G_MODULE_EXPORT void on_edit_activate ( GtkWidget * widg,
gpointer data )
extern

create an edition dialog - prepare the dialog

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 835 of file edit_menu.c.

◆ port_section()

GMenu * port_section ( gchar * act,
int pop,
int port )

create the import/export menu items

Parameters
act"app" or "pop" key for the GAction
popfrom main app (0) or contextual (1)
portImport (1) or Export (0)

Definition at line 680 of file gui.c.

◆ project_section()

GMenu * project_section ( gchar * act,
int pop_up,
int proj,
int calc )

create the project section

Parameters
act"app" or "pop" key for the GAction
pop_upfrom main app (0) or contextual (1)
projproject id, if any (or -1)
calccalculation id, if any (or -1)

Definition at line 704 of file gui.c.

◆ project_title()

GMenu * project_title ( int pop_up,
int proj )

create project title menu item

Parameters
pop_upfrom main app (0) or contextual (1)
projproject id, if any (or -1)

Definition at line 800 of file gui.c.

◆ quit_section()

GMenu * quit_section ( gchar * act)

create the 'Quit' menu item

Parameters
act"app" or "pop" key for the GAction

Definition at line 771 of file gui.c.

◆ remove_action()

void remove_action ( gchar * action_name)

add action from the main window action map

Parameters
action_namethe action to remove

Definition at line 296 of file gui.c.

◆ remove_edition_actions()

void remove_edition_actions ( )

remove all edition actions

Definition at line 306 of file gui.c.

◆ remove_edition_and_analyze_actions()

void remove_edition_and_analyze_actions ( )

remove all edition and analysis action

Definition at line 317 of file gui.c.

◆ show_periodic_table()

G_MODULE_EXPORT void show_periodic_table ( GtkWidget * widg,
gpointer data )

show the periodic table of the elements

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 332 of file gui.c.

◆ tool_box_section()

GMenu * tool_box_section ( )

create toolboxes menu item

Definition at line 857 of file gui.c.

◆ view_buffer()

void view_buffer ( GtkTextBuffer * buffer)

set a text buffer in the main window or an image

Parameters
bufferthe GtkTextBuffer to display

Definition at line 182 of file gui.c.

◆ widget_add_action()

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

Parameters
action_groupthe action group to add an action to
actthe name of the action to add
handlerthe associated callback
datathe associated data pointer
checkis the action a check (1/0)
statusif check or radio, status of the action (1/0)
radiois the action a radio (1/0)
statif radio variant parameter of the action

Definition at line 515 of file gui.c.

◆ work_menu()

GtkWidget * work_menu ( int p,
int c )
extern

create the workspace popup menu

Parameters
pproject id, or -1
ccalculation id, or -1

Definition at line 202 of file work_menu.c.

◆ workspace_section()

GMenu * workspace_section ( gchar * act,
int pop )

create the workspace section

Parameters
actapp" or "pop" key for the GAction
popfrom main app (0) or contextual (1)

Definition at line 649 of file gui.c.

◆ workspace_title()

GMenu * workspace_title ( )

create the 'Workspace' menu item

Definition at line 785 of file gui.c.

Variable Documentation

◆ calc_img

gchar* calc_img[NCALCS-2]

Definition at line 104 of file gui.c.

◆ calc_name

char* calc_name[NCALCS-2]
Initial value:
= {"g(r)/G(r)",
"S(q) from FFT[g(r)]",
"S(q) from Debye equation",
"g(r)/G(r) from FFT[S(q)]",
"Bonds and angles",
"Ring statistics",
"Chain statistics",
"Spherical harmonics",
"Mean Squared Displacement",
"Bond valence"}

Definition at line 107 of file gui.c.

◆ cut_lab

tint cut_lab

Definition at line 130 of file gui.c.

◆ cut_sel

tint cut_sel

Definition at line 129 of file gui.c.

◆ davect

dint davect[9]

Definition at line 131 of file gui.c.

◆ dots

gchar* dots[NDOTS]

Definition at line 103 of file gui.c.

◆ graph_img

gchar* graph_img[NGRAPHS]

Definition at line 105 of file gui.c.

◆ graph_name

char* graph_name[NGRAPHS]
Initial value:
= {"g(r)/G(r)",
"S(q) from FFT[g(r)]",
"S(q) from Debye equation",
"g(r)/G(r) from FFT[S(q)]",
"Bonds properties",
"Angle distributions",
"Ring statistics",
"Chain statistics",
"Spherical harmonics",
"Mean Squared Displacement"}

Definition at line 118 of file gui.c.

◆ object_was_selected

int* object_was_selected[3]
extern

Definition at line 213 of file selection.c.

◆ objects

int objects[3]
extern

Definition at line 212 of file selection.c.

◆ std

ColRGBA std[6]

Definition at line 132 of file gui.c.

◆ tmp_object_id

int** tmp_object_id[3]
extern

Definition at line 214 of file selection.c.