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

Initialization of the atomes program
Functions required to read data from the command line. More...

#include <getopt.h>
#include <ctype.h>
#include "version.h"
#include "global.h"
#include "bind.h"
#include "callbacks.h"
#include "preferences.h"
#include "interface.h"
#include "project.h"
#include "workspace.h"
#include "glview.h"
#include "movie.h"
#include <pwd.h>
Include dependency graph for main.c:

Go to the source code of this file.

Data Structures

struct  file_list

Macros

#define APP_EXTENSION

Functions

GtkWidget * create_main_window (GApplication *app)
 create the main application window
void print_help ()
 print basic help
void print_version ()
 print version information
int test_this_ext (int len, gchar *arg)
 test extension of an argument from the command line
int test_this_arg (gchar *arg)
 test an argument from the command line
gboolean is_string_in_string_list (gchar *string, gchar **list)
 check if a string is in a list of strings
int get_style_from_string (gchar *style_string)
 retrieve style from command line string
int get_rep_from_string (gchar *rep_string)
 retrieve representation style from command line string
int get_box_axis_from_string (gchar *box_axis_string)
 retrieve box or axis style from command line string
int get_color_map_from_string (gchar *col_string)
 retrieve color map from command line string
ColRGBAget_color_from_hexa_string (gchar *color_string)
 convert Hexadecimal string to ColRGBA
int get_gradient_from_string (gchar *grad_string)
 retrieve background gradient from command line string
int check_for_atomes_file_options (int start, int end, char *argv[])
 retrieve the list of files to read from the command line leave out all other options
int parse_command_line (int argc, char *argv[])
 test command line arguments
gboolean destroy_func (gpointer user_data)
 destroy splash screen
GtkWidget * create_splash_window ()
 create splash screen window
void read_this_file (int file_type, gchar *this_file)
 read file from the command line
void open_this_data_file (int file_type, gchar *file_name)
 open data file from the command line
G_MODULE_EXPORT void run_program (GApplication *app, gpointer data)
 run the program
int check_opengl_rendering ()
 check the initialization parameters for an OpenGL context
int main (int argc, char *argv[])
 initialization of the atomes program

Variables

const gchar * dfi [2]
struct file_listflist = NULL
struct file_listftmp = NULL
gboolean with_workspace = FALSE
gchar * bs_styles []
gchar * wi_styles [] = {"wireframe", "wireframes", "wires", "wire", "wi", "w", NULL}
gchar * co_styles [] = {"covalent_radius", "covalent", "cov_rad", "cov", "co", "cr", NULL}
gchar * io_styles [] = {"ionic_radius", "ionic_rad", "ionic", "ion", "ir", NULL}
gchar * vw_styles [] = {"vdw_radius", "van_der_waals_radius", "van_der_waals", "vdw_radius", "vdw_rad", "vdw", "vr", NULL}
gchar * cr_styles [] = {"crystal", "crystal_radius", "in_crystal", "in_crystal_radius", "cryst", "crystal_rad", "cr", NULL}
gchar * sp_styles [] = {"sphere", "spheres", "sph", "sp", "S", NULL}
gchar * cy_styles [] = {"cylinder", "cylinders", "cyl", "cy", "c", NULL}
gchar * do_styles [] = {"dot", "dots", "d", NULL}

Detailed Description

Initialization of the atomes program
Functions required to read data from the command line.

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 main.c.

Macro Definition Documentation

◆ APP_EXTENSION

#define APP_EXTENSION

Definition at line 88 of file main.c.

Function Documentation

◆ check_for_atomes_file_options()

int check_for_atomes_file_options ( int start,
int end,
char * argv[] )

retrieve the list of files to read from the command line leave out all other options

Parameters
startstarting position on the command line
endending position on the command line
*argv[]list of argument(s) on the command line

Definition at line 496 of file main.c.

◆ check_opengl_rendering()

int check_opengl_rendering ( )

check the initialization parameters for an OpenGL context

Definition at line 1100 of file main.c.

◆ create_main_window()

GtkWidget * create_main_window ( GApplication * atomes)
extern

create the main application window

Parameters
atomesthe initial GtkApplication

Definition at line 1087 of file gui.c.

◆ create_splash_window()

GtkWidget * create_splash_window ( )

create splash screen window

Definition at line 793 of file main.c.

◆ destroy_func()

gboolean destroy_func ( gpointer user_data)

destroy splash screen

Parameters
user_datathe splash screen to destroy

Definition at line 763 of file main.c.

◆ get_box_axis_from_string()

int get_box_axis_from_string ( gchar * box_axis_string)

retrieve box or axis style from command line string

Parameters
box_axis_stringthe axis keyword from command line

Definition at line 382 of file main.c.

◆ get_color_from_hexa_string()

ColRGBA * get_color_from_hexa_string ( gchar * color_string)

convert Hexadecimal string to ColRGBA

Parameters
color_stringthe color keyword from command line (formats: #RGB, RGB, #RGBA, RGBA, #RRGGBB, RRGGBB, #RRGGBBAA, RRGGBBAA).

Definition at line 418 of file main.c.

◆ get_color_map_from_string()

int get_color_map_from_string ( gchar * col_string)

retrieve color map from command line string

Parameters
col_stringthe color map keyword from command line

Definition at line 396 of file main.c.

◆ get_gradient_from_string()

int get_gradient_from_string ( gchar * grad_string)

retrieve background gradient from command line string

Parameters
grad_stringthe color map keyword from command line

Definition at line 475 of file main.c.

◆ get_rep_from_string()

int get_rep_from_string ( gchar * rep_string)

retrieve representation style from command line string

Parameters
rep_stringthe representation keyword from command line

Definition at line 366 of file main.c.

◆ get_style_from_string()

int get_style_from_string ( gchar * style_string)

retrieve style from command line string

Parameters
style_stringthe style keyword from command line

Definition at line 345 of file main.c.

◆ is_string_in_string_list()

gboolean is_string_in_string_list ( gchar * string,
gchar ** list )

check if a string is in a list of strings

Parameters
stringthe string to search for
listthe string list

Definition at line 322 of file main.c.

◆ main()

int main ( int argc,
char * argv[] )

initialization of the atomes program

Parameters
argcnumber of argument(s) on the command line
*argv[]list of argument(s) on the command line

Definition at line 1183 of file main.c.

◆ open_this_data_file()

void open_this_data_file ( int file_type,
gchar * file_name )

open data file from the command line

Parameters
file_typeFile type
file_nameFile name

Definition at line 862 of file main.c.

◆ parse_command_line()

int parse_command_line ( int argc,
char * argv[] )

test command line arguments

Parameters
argcnumber of argument(s) on the command line
*argv[]list of argument(s) on the command line

Definition at line 537 of file main.c.

◆ print_help()

void print_help ( )

print basic help

Definition at line 123 of file main.c.

◆ print_version()

void print_version ( )

print version information

Definition at line 190 of file main.c.

◆ read_this_file()

void read_this_file ( int file_type,
gchar * this_file )

read file from the command line

Parameters
file_typeFile type
this_fileFile name

Definition at line 831 of file main.c.

◆ run_program()

G_MODULE_EXPORT void run_program ( GApplication * app,
gpointer data )

run the program

Parameters
appthe application to run
datathe associated data pointer

Definition at line 1011 of file main.c.

◆ test_this_arg()

int test_this_arg ( gchar * arg)

test an argument from the command line

Parameters
argthe argument to test

Definition at line 295 of file main.c.

◆ test_this_ext()

int test_this_ext ( int len,
gchar * arg )

test extension of an argument from the command line

Parameters
lenargument string length
argthe argument to test

Definition at line 274 of file main.c.

Variable Documentation

◆ bs_styles

gchar* bs_styles[]
Initial value:
= {"ball&stick", "balls&sticks", "balls&stick", "ball&sticks",
"ball_&_stick", "balls_&_sticks", "balls_&_stick", "ball_&_sticks",
"ball_and_sticks", "balls_and_sticks", "balls_and_stick", "ball_and_stick",
"ballsandsticks", "ballsandstick", "ballanddsticks", "ballandstick",
"b&s", "b_and_s", "bs", "b", NULL}

Definition at line 104 of file main.c.

◆ co_styles

gchar* co_styles[] = {"covalent_radius", "covalent", "cov_rad", "cov", "co", "cr", NULL}

Definition at line 110 of file main.c.

◆ cr_styles

gchar* cr_styles[] = {"crystal", "crystal_radius", "in_crystal", "in_crystal_radius", "cryst", "crystal_rad", "cr", NULL}

Definition at line 113 of file main.c.

◆ cy_styles

gchar* cy_styles[] = {"cylinder", "cylinders", "cyl", "cy", "c", NULL}

Definition at line 115 of file main.c.

◆ dfi

const gchar* dfi[2]

Definition at line 93 of file main.c.

◆ do_styles

gchar* do_styles[] = {"dot", "dots", "d", NULL}

Definition at line 116 of file main.c.

◆ flist

struct file_list* flist = NULL

Definition at line 100 of file main.c.

◆ ftmp

struct file_list* ftmp = NULL

Definition at line 101 of file main.c.

◆ io_styles

gchar* io_styles[] = {"ionic_radius", "ionic_rad", "ionic", "ion", "ir", NULL}

Definition at line 111 of file main.c.

◆ sp_styles

gchar* sp_styles[] = {"sphere", "spheres", "sph", "sp", "S", NULL}

Definition at line 114 of file main.c.

◆ vw_styles

gchar* vw_styles[] = {"vdw_radius", "van_der_waals_radius", "van_der_waals", "vdw_radius", "vdw_rad", "vdw", "vr", NULL}

Definition at line 112 of file main.c.

◆ wi_styles

gchar* wi_styles[] = {"wireframe", "wireframes", "wires", "wire", "wi", "w", NULL}

Definition at line 109 of file main.c.

◆ with_workspace

gboolean with_workspace = FALSE

Definition at line 102 of file main.c.