"Fossies" - the Fresh Open Source Software Archive

Member "gamgi0.17.5x/src/gtk/gamgi_gtk.h" (23 Feb 2022, 13365 Bytes) of package /linux/misc/gamgi-all-0.17.5x.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /*******************************************
    2  *
    3  * $GAMGI/src/gtk/gamgi_gtk.h
    4  *
    5  * Copyright (C) 2001, 2004 Carlos Pereira
    6  *
    7  * Distributed under the terms of the GNU
    8  * General Public License: $GAMGI/LICENSE
    9  *
   10  */
   11 
   12 #ifndef GAMGI_GTK
   13 #define GAMGI_GTK
   14 
   15 /********** types *********
   16  **************************/
   17 
   18 /*******************************************
   19  * These types define pointers to callback *
   20  * functions connected to these signals:   *
   21  * 1) "clicked", "activated"...            *
   22  * 2) "delete_event"                       *
   23  *******************************************/
   24 
   25 typedef void (* gamgi_callback2) (GtkWidget *widget, void *data);
   26 typedef void (* gamgi_callback3) (GtkWidget *widget,
   27 GdkEventButton *event, void *data);
   28 
   29 /********** enumerations **********
   30  **********************************/
   31 
   32 /**************************************************************
   33  * All external enumerations start at 1 and share FALSE for 0 *
   34  **************************************************************/
   35 
   36 enum { GAMGI_GTK_SCALE = 1, GAMGI_GTK_MOVE, GAMGI_GTK_ROTATE };
   37 
   38 enum { GAMGI_GTK_YES = 1, GAMGI_GTK_NO };
   39 
   40 enum { GAMGI_GTK_ALL = 1, GAMGI_GTK_PARTIAL, GAMGI_GTK_NONE };
   41 
   42 enum { GAMGI_GTK_CELL = 1, GAMGI_GTK_ATOMS };
   43 
   44 enum { GAMGI_GTK_ORDER = 1, GAMGI_GTK_NODE };
   45 
   46 /*******************************
   47  * All tasks with a dialog of  *
   48  * level 0 are enumerated here *
   49  *******************************/
   50 
   51 enum { GAMGI_GTK_HELP_TOPIC = 1, GAMGI_GTK_HELP_SEARCH, 
   52 GAMGI_GTK_HELP_TUTORIAL, GAMGI_GTK_HELP_CONFIG,
   53 
   54 GAMGI_GTK_TEXT_CREATE, GAMGI_GTK_TEXT_COPY,
   55 GAMGI_GTK_TEXT_SELECT, GAMGI_GTK_TEXT_LINK,    
   56 GAMGI_GTK_TEXT_MODIFY, GAMGI_GTK_TEXT_REMOVE,
   57 GAMGI_GTK_TEXT_CONFIG,
   58 
   59 GAMGI_GTK_ORBITAL_CREATE, GAMGI_GTK_ORBITAL_COPY, 
   60 GAMGI_GTK_ORBITAL_SELECT, GAMGI_GTK_ORBITAL_LINK, 
   61 GAMGI_GTK_ORBITAL_MODIFY, GAMGI_GTK_ORBITAL_REMOVE,
   62 GAMGI_GTK_ORBITAL_CONFIG,
   63 
   64 GAMGI_GTK_BOND_CREATE, GAMGI_GTK_BOND_COPY, 
   65 GAMGI_GTK_BOND_SELECT, GAMGI_GTK_BOND_LINK, 
   66 GAMGI_GTK_BOND_MODIFY, GAMGI_GTK_BOND_REMOVE,
   67 GAMGI_GTK_BOND_CONFIG, 
   68 
   69 GAMGI_GTK_ATOM_CREATE, GAMGI_GTK_ATOM_COPY, 
   70 GAMGI_GTK_ATOM_SELECT, GAMGI_GTK_ATOM_LINK, 
   71 GAMGI_GTK_ATOM_MODIFY, GAMGI_GTK_ATOM_MEASURE,
   72 GAMGI_GTK_ATOM_REMOVE, GAMGI_GTK_ATOM_CONFIG,
   73 
   74 GAMGI_GTK_DIRECTION_CREATE, GAMGI_GTK_DIRECTION_COPY, 
   75 GAMGI_GTK_DIRECTION_SELECT, GAMGI_GTK_DIRECTION_LINK, 
   76 GAMGI_GTK_DIRECTION_MODIFY, GAMGI_GTK_DIRECTION_MEASURE,
   77 GAMGI_GTK_DIRECTION_REMOVE, GAMGI_GTK_DIRECTION_CONFIG,
   78 
   79 GAMGI_GTK_PLANE_CREATE, GAMGI_GTK_PLANE_COPY, 
   80 GAMGI_GTK_PLANE_SELECT, GAMGI_GTK_PLANE_LINK, 
   81 GAMGI_GTK_PLANE_MODIFY, GAMGI_GTK_PLANE_MEASURE,
   82 GAMGI_GTK_PLANE_REMOVE, GAMGI_GTK_PLANE_CONFIG,
   83 
   84 GAMGI_GTK_GROUP_CREATE, GAMGI_GTK_GROUP_CREATE_POLYTOPE,
   85 GAMGI_GTK_GROUP_COPY, GAMGI_GTK_GROUP_SELECT,
   86 GAMGI_GTK_GROUP_LINK, GAMGI_GTK_GROUP_MODIFY,
   87 GAMGI_GTK_GROUP_MODIFY_POLYTOPE, GAMGI_GTK_GROUP_MEASURE,
   88 GAMGI_GTK_GROUP_MEASURE_GEOMETRY, GAMGI_GTK_GROUP_MEASURE_SYMMETRY,
   89 GAMGI_GTK_GROUP_MEASURE_VORONOI, GAMGI_GTK_GROUP_REMOVE, 
   90 GAMGI_GTK_GROUP_CONFIG,
   91 
   92 GAMGI_GTK_MOLECULE_CREATE, GAMGI_GTK_MOLECULE_COPY, 
   93 GAMGI_GTK_MOLECULE_SELECT, GAMGI_GTK_MOLECULE_LINK, 
   94 GAMGI_GTK_MOLECULE_MODIFY, GAMGI_GTK_MOLECULE_MEASURE, 
   95 GAMGI_GTK_MOLECULE_MEASURE_GEOMETRY, GAMGI_GTK_MOLECULE_MEASURE_SYMMETRY,
   96 GAMGI_GTK_MOLECULE_MEASURE_VORONOI, GAMGI_GTK_MOLECULE_ANIMATE, 
   97 GAMGI_GTK_MOLECULE_REMOVE, GAMGI_GTK_MOLECULE_CONFIG,
   98 
   99 GAMGI_GTK_CLUSTER_CREATE, GAMGI_GTK_CLUSTER_COPY, 
  100 GAMGI_GTK_CLUSTER_SELECT, GAMGI_GTK_CLUSTER_LINK, 
  101 GAMGI_GTK_CLUSTER_MODIFY, GAMGI_GTK_CLUSTER_MEASURE, 
  102 GAMGI_GTK_CLUSTER_MEASURE_GEOMETRY, GAMGI_GTK_CLUSTER_MEASURE_SYMMETRY,
  103 GAMGI_GTK_CLUSTER_MEASURE_VORONOI, GAMGI_GTK_CLUSTER_ANIMATE, 
  104 GAMGI_GTK_CLUSTER_REMOVE, GAMGI_GTK_CLUSTER_CONFIG,
  105 
  106 GAMGI_GTK_CELL_CREATE, GAMGI_GTK_CELL_COPY, 
  107 GAMGI_GTK_CELL_SELECT, GAMGI_GTK_CELL_LINK, 
  108 GAMGI_GTK_CELL_LINK_RCP, GAMGI_GTK_CELL_LINK_POLYTOPE,
  109 GAMGI_GTK_CELL_MODIFY, GAMGI_GTK_CELL_MEASURE,
  110 GAMGI_GTK_CELL_MEASURE_GEOMETRY, GAMGI_GTK_CELL_MEASURE_RECIPROCAL,
  111 GAMGI_GTK_CELL_MEASURE_VORONOI, GAMGI_GTK_CELL_ANIMATE,
  112 GAMGI_GTK_CELL_REMOVE, GAMGI_GTK_CELL_CONFIG,
  113 
  114 GAMGI_GTK_ARROW_CREATE, GAMGI_GTK_ARROW_COPY, 
  115 GAMGI_GTK_ARROW_SELECT, GAMGI_GTK_ARROW_LINK, 
  116 GAMGI_GTK_ARROW_MODIFY, GAMGI_GTK_ARROW_REMOVE,
  117 GAMGI_GTK_ARROW_CONFIG,
  118 
  119 GAMGI_GTK_SHAPE_CREATE, GAMGI_GTK_SHAPE_COPY, 
  120 GAMGI_GTK_SHAPE_SELECT, GAMGI_GTK_SHAPE_LINK, 
  121 GAMGI_GTK_SHAPE_MODIFY, GAMGI_GTK_SHAPE_REMOVE,
  122 GAMGI_GTK_SHAPE_CONFIG,
  123 
  124 GAMGI_GTK_GRAPH_CREATE, GAMGI_GTK_GRAPH_COPY, 
  125 GAMGI_GTK_GRAPH_SELECT, GAMGI_GTK_GRAPH_LINK, 
  126 GAMGI_GTK_GRAPH_MODIFY, GAMGI_GTK_GRAPH_MEASURE, 
  127 GAMGI_GTK_GRAPH_REMOVE, GAMGI_GTK_GRAPH_CONFIG,
  128 
  129 GAMGI_GTK_ASSEMBLY_CREATE, GAMGI_GTK_ASSEMBLY_COPY, 
  130 GAMGI_GTK_ASSEMBLY_SELECT, GAMGI_GTK_ASSEMBLY_LINK, 
  131 GAMGI_GTK_ASSEMBLY_MODIFY, GAMGI_GTK_ASSEMBLY_REMOVE,
  132 GAMGI_GTK_ASSEMBLY_CONFIG,
  133 
  134 GAMGI_GTK_LIGHT_CREATE, GAMGI_GTK_LIGHT_COPY, 
  135 GAMGI_GTK_LIGHT_SELECT, GAMGI_GTK_LIGHT_LINK, 
  136 GAMGI_GTK_LIGHT_MODIFY, GAMGI_GTK_LIGHT_REMOVE,
  137 GAMGI_GTK_LIGHT_CONFIG,
  138 
  139 GAMGI_GTK_LAYER_CREATE, GAMGI_GTK_LAYER_COPY, 
  140 GAMGI_GTK_LAYER_SELECT, GAMGI_GTK_LAYER_LINK, 
  141 GAMGI_GTK_LAYER_MODIFY, GAMGI_GTK_LAYER_REMOVE,
  142 GAMGI_GTK_LAYER_CONFIG,
  143 
  144 GAMGI_GTK_WINDOW_CREATE, GAMGI_GTK_WINDOW_COPY, 
  145 GAMGI_GTK_WINDOW_SELECT, GAMGI_GTK_WINDOW_LINK, 
  146 GAMGI_GTK_WINDOW_MODIFY, GAMGI_GTK_WINDOW_REMOVE,
  147 GAMGI_GTK_WINDOW_CONFIG,
  148 
  149 GAMGI_GTK_FILE_IMPORT, GAMGI_GTK_FILE_EXPORT, 
  150 GAMGI_GTK_FILE_CONFIG,
  151 
  152 GAMGI_GTK_GAMGI_ABOUT, GAMGI_GTK_GAMGI_RESET, 
  153 GAMGI_GTK_GAMGI_EXIT, GAMGI_GTK_GAMGI_CONFIG };
  154 
  155 /************* macros ************
  156  *********************************/
  157 
  158 /***********************************
  159  * Active color: red (used in the  *
  160  * rotate,move,scale tool buttons) *
  161  ***********************************/
  162 
  163 #define GAMGI_GTK_ACTIVE_R 0.039
  164 #define GAMGI_GTK_ACTIVE_G 0.609
  165 #define GAMGI_GTK_ACTIVE_B 0.0
  166 
  167 /****************************
  168  * Stop, Move colors: used  *
  169  * in the Undo/Save dialogs *
  170  ****************************/
  171 
  172 /*******************
  173  * Stop color: red *
  174  *******************/
  175 
  176 #define GAMGI_GTK_STOP_R 1.0
  177 #define GAMGI_GTK_STOP_G 0.0
  178 #define GAMGI_GTK_STOP_B 0.0
  179 
  180 /********************************
  181  * Move color: green (10,156,0) *
  182  ********************************/
  183 
  184 #define GAMGI_GTK_MOVE_R 0.039
  185 #define GAMGI_GTK_MOVE_G 0.609
  186 #define GAMGI_GTK_MOVE_B 0.0
  187 
  188 /*******************************
  189  * Dark, Light colors: used in *
  190  * the Chemical Periodic Table *
  191  *******************************/
  192 
  193 /*********************
  194  * Dark color: black *
  195  *********************/
  196 
  197 #define GAMGI_GTK_DARK_R 0.0
  198 #define GAMGI_GTK_DARK_G 0.0
  199 #define GAMGI_GTK_DARK_B 0.0
  200 
  201 /**********************
  202  * Light color: white *
  203  **********************/
  204 
  205 #define GAMGI_GTK_LIGHT_R 1.0
  206 #define GAMGI_GTK_LIGHT_G 1.0
  207 #define GAMGI_GTK_LIGHT_B 1.0
  208 
  209 /****************************************
  210  * Background, Foreground, Title, Bold, *
  211  * Link: used to show Help information  *
  212  ****************************************/
  213 
  214 /********************************************
  215  * Background color: olive green (47,79,79) *
  216  ********************************************/
  217 
  218 #define GAMGI_GTK_BACKGROUND_R 0.184
  219 #define GAMGI_GTK_BACKGROUND_G 0.309
  220 #define GAMGI_GTK_BACKGROUND_B 0.309
  221 
  222 /************************************************
  223  * Foreground color: light yellow (245,222,179) *
  224  ************************************************/
  225 
  226 #define GAMGI_GTK_FOREGROUND_R 0.957
  227 #define GAMGI_GTK_FOREGROUND_G 0.867
  228 #define GAMGI_GTK_FOREGROUND_B 0.699
  229 
  230 /**********************************
  231  * Title color: very light yellow *
  232  **********************************/
  233 
  234 #define GAMGI_GTK_TITLE_R 1.0
  235 #define GAMGI_GTK_TITLE_G 1.0
  236 #define GAMGI_GTK_TITLE_B 0.0
  237 
  238 /*********************************
  239  * Bold color: very light yellow *
  240  *********************************/
  241 
  242 #define GAMGI_GTK_BOLD_R 1.0
  243 #define GAMGI_GTK_BOLD_G 1.0
  244 #define GAMGI_GTK_BOLD_B 0.0
  245 
  246 /**********************
  247  * Text size increase *
  248  **********************/
  249 
  250 #define GAMGI_GTK_TEXT_NORMAL PANGO_SCALE_MEDIUM
  251 #define GAMGI_GTK_TEXT_LARGE  PANGO_SCALE_LARGE
  252 
  253 /*******************************
  254  * Link color: very light blue *
  255  *******************************/
  256 
  257 #define GAMGI_GTK_LINK_R 0.8
  258 #define GAMGI_GTK_LINK_G 1.0
  259 #define GAMGI_GTK_LINK_B 1.0
  260 
  261 /*******************************************
  262  * x,y origin of a new top window. Setting *
  263  * these values to 0,0, the window starts  *
  264  * at the top left corner of the screen.   *
  265  *******************************************/
  266 
  267 #define GAMGI_GTK_WINDOW_ORIGIN_X 10
  268 #define GAMGI_GTK_WINDOW_ORIGIN_Y 10
  269 
  270 /**************************************
  271  * default dimensions for top windows *
  272  *         (golden rule=1.62)         *
  273  * minimum dimensions for top windows * 
  274  **************************************/
  275 
  276 #define GAMGI_GTK_WINDOW_WIDTH  950
  277 #define GAMGI_GTK_WINDOW_HEIGHT 650
  278 
  279 #define GAMGI_GTK_WINDOW_WIDTH_MIN  700
  280 #define GAMGI_GTK_WINDOW_HEIGHT_MIN 500
  281 
  282 /*************************************************
  283  * default and minimum dimensions for windows    *
  284  * with GtkTextView widgets, used to show large  *
  285  * volumes of information: Help, Analysis, etc.  *
  286  *************************************************/
  287 
  288 #define GAMGI_GTK_TEXT_WIDTH      650
  289 #define GAMGI_GTK_TEXT_HEIGHT     550
  290 
  291 #define GAMGI_GTK_TEXT_WIDTH_MIN  250
  292 #define GAMGI_GTK_TEXT_HEIGHT_MIN 250
  293 
  294 /*****************************************
  295  * dimensions for Object->Select windows *
  296  *****************************************/
  297 
  298 #define GAMGI_GTK_SELECT_WIDTH      300
  299 #define GAMGI_GTK_SELECT_HEIGHT     400
  300 
  301 #define GAMGI_GTK_SELECT_LIST_WIDTH      250
  302 #define GAMGI_GTK_SELECT_LIST_HEIGHT     400
  303 
  304 /************************************************
  305  * height for Help Topic, Help Tutorial windows *
  306  ************************************************/
  307 
  308 #define GAMGI_GTK_HELP_TOPIC_WIDTH     300
  309 #define GAMGI_GTK_HELP_TOPIC_HEIGHT    400
  310 
  311 #define GAMGI_GTK_HELP_TUTORIAL_HEIGHT 400
  312 
  313 /***********************************
  314  * min,max dimensions for Cell     *
  315  * Systems,Lattice,Groups windows. *
  316  ***********************************/
  317 
  318 #define GAMGI_GTK_CELL_SYMMETRY_HEIGHT_MIN 200
  319 #define GAMGI_GTK_CELL_SYMMETRY_HEIGHT_MAX 400
  320 
  321 /******************************
  322  * width of Ok/Cancel buttons *
  323  * used in dialog windows     *
  324  ******************************/
  325 
  326 #define GAMGI_GTK_BUTTON_WIDTH 85
  327 
  328 /*****************************************************
  329  * width in char and allowed char for dialog entries *
  330  *****************************************************/
  331 
  332 #define GAMGI_GTK_CHAR_50 50
  333 #define GAMGI_GTK_CHAR_40 40
  334 #define GAMGI_GTK_CHAR_20 20
  335 #define GAMGI_GTK_CHAR_10 10
  336 #define GAMGI_GTK_CHAR_7  7
  337 #define GAMGI_GTK_CHAR_5  5
  338 #define GAMGI_GTK_CHAR_3  3
  339 #define GAMGI_GTK_CHAR_2  2
  340 
  341 /*******************************************
  342  * width in char used in Method ComboBoxes *
  343  * with submenus in Object->Select dialogs *
  344  *******************************************/
  345 
  346 #define GAMGI_GTK_CHAR_MENU 13
  347 
  348 /***********************************************************
  349  * max number of chars used to create file filter patterns *
  350  ***********************************************************/
  351 
  352 #define GAMGI_GTK_FILE_PATTERNS GAMGI_GTK_CHAR_40
  353 
  354 /**************************
  355  * default for beep sound *
  356  **************************/
  357 
  358 #define GAMGI_GTK_BEEP TRUE
  359 
  360 /***************************************
  361  * ruler amplitude                     *
  362  *                                     *
  363  * ruler maximum rotate: 30 degrees    *
  364  * ruler maximum move:   10.0 Angstrom *
  365  * ruler maximum scale:  2.0           *
  366  *                                     *
  367  * ruler rotate step: 0 (continous)    *
  368  * ruler move step: 0 (continous)      *
  369  * ruler scale step: 0 (continous)     *
  370  ***************************************/
  371 
  372 #define GAMGI_GTK_RULER_MAX 10.0
  373 
  374 #define GAMGI_GTK_ROTATE_MAX 30.0
  375 #define GAMGI_GTK_MOVE_MAX 10.0
  376 #define GAMGI_GTK_SCALE_MAX 2.0
  377 
  378 #define GAMGI_GTK_MOVE_STEP 0.0
  379 #define GAMGI_GTK_ROTATE_STEP 0.0
  380 #define GAMGI_GTK_SCALE_STEP 0.0
  381 
  382 /****************************************************************
  383  *              For each top window statusbar                   *
  384  *                                                              *
  385  * TIME_FOCUS, TIME_LAYER: time delay before color changes      *
  386  *                                                              *
  387  * TIME_TIME: time to update time (every 60 seconds)            *
  388  *                                                              *
  389  * PROGRESS_TIME, PROGRESS_FRACTION:                            *
  390  * time and fraction steps, to update progress bar              *
  391  ****************************************************************/
  392 
  393 #define GAMGI_GTK_STATUSBAR_TIME_FOCUS   2000
  394 #define GAMGI_GTK_STATUSBAR_TIME_LAYER   2000
  395 
  396 #define GAMGI_GTK_STATUSBAR_TIME_TIME   60000
  397 
  398 #define GAMGI_GTK_STATUSBAR_PROGRESS_TIME      200
  399 #define GAMGI_GTK_STATUSBAR_PROGRESS_FRACTION 0.05
  400 
  401 /***********************************
  402  * default order for mouse buttons *
  403  ***********************************/
  404 
  405 #define GAMGI_GTK_BUTTON_1 1
  406 #define GAMGI_GTK_BUTTON_2 2
  407 #define GAMGI_GTK_BUTTON_3 3
  408 
  409 /*****************************
  410  * defaults for copy dialogs *
  411  *****************************/
  412 
  413 #define GAMGI_GTK_COPY_NUMBER 1
  414 #define GAMGI_GTK_COPY_X    0.0
  415 #define GAMGI_GTK_COPY_Y    0.0
  416 #define GAMGI_GTK_COPY_Z    0.0
  417 
  418 /*****************************
  419  * defaults for link dialogs *
  420  *****************************/
  421 
  422 #define GAMGI_GTK_LINK_X    0.0
  423 #define GAMGI_GTK_LINK_Y    0.0
  424 #define GAMGI_GTK_LINK_Z    0.0
  425 
  426 #endif