"Fossies" - the Fresh Open Source Software Archive

Member "gfsview-snapshot-121130/view/gfkgl.h" (30 Nov 2012, 13910 Bytes) of package /linux/privat/gfsview-snapshot-121130.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. For more information about "gfkgl.h" see the Fossies "Dox" file reference documentation.

    1 /* Gerris - The GNU Flow Solver
    2  * Copyright (C) 2001-2004 National * Institute of Water and
    3  * Atmospheric Research
    4  *
    5  * This program is free software; you can redistribute it and/or
    6  * modify it under the terms of the GNU General Public License as
    7  * published by the Free Software Foundation; either version 2 of the
    8  * License, or (at your option) any later version.
    9  *
   10  * This program is distributed in the hope that it will be useful,
   11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   13  * General Public License for more details.
   14  *
   15  * You should have received a copy of the GNU General Public License
   16  * along with this program; if not, write to the Free Software
   17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
   18  * 02111-1307, USA.  
   19  */
   20 
   21 #ifndef __GFKGL_H__
   22 #define __GFKGL_H__
   23 
   24 #include <gfs.h>
   25 #include <gtk/gtk.h>
   26 
   27 #include "gl/gfsgl.h"
   28 
   29 #ifdef __cplusplus
   30 extern "C" {
   31 #endif /* __cplusplus */
   32 
   33 #define GFK_IS_EDITED(o) (g_object_get_data (G_OBJECT (o), "edited"))
   34 
   35 G_LOCK_EXTERN (gfk_gl_scripting);
   36 extern gboolean gfk_gl_scripting;
   37 
   38 G_LOCK_EXTERN (scripting_pending);
   39 
   40 typedef enum {
   41   GFS_SAVE_EVENT, GFS_APPEND_EVENT, GFS_ECHO_EVENT
   42 } GfkScriptingEvent;
   43 
   44 typedef struct {
   45   GfkScriptingEvent event;
   46   GtkWidget * view;
   47   gpointer data;
   48 } GfkScriptingMessage;
   49 
   50 gboolean gfk_receive_scripting_message (gpointer data);
   51 
   52 enum {
   53   VISIBLE_COLUMN,
   54   ICON_COLUMN,
   55   PROPERTIES_COLUMN,
   56   GL_COLUMN,
   57   SELECTED_COLUMN,
   58   N_COLUMNS
   59 };
   60 
   61 guint         gfk_decimal_digits           (double x, guint significant);
   62 
   63 /* GfkGl: Header */
   64 
   65 typedef struct _GfkGl           GfkGl;
   66 
   67 struct _GfkGl {
   68   /*< private >*/
   69   GtsObject parent;
   70   gchar * props;
   71 
   72   /*< public >*/
   73   GfsGl * gl;
   74   GtkWidget * glarea, * list;
   75   GtkWidget * params, * properties, * color_selector, * font;
   76 };
   77 
   78 typedef struct _GfkGlClass    GfkGlClass;
   79 
   80 struct _GfkGlClass {
   81   /*< private >*/
   82   GtsObjectClass parent_class;
   83   GfsGlClass * gl_class;
   84 
   85   /*< public >*/
   86   void          (* post_init)        (GfkGl *);
   87   void          (* set_simulation)   (GfkGl *, GfsSimulation *);
   88   void          (* update_interface) (GfkGl *);
   89   GtkWidget   * (* icon)             (GfkGlClass *);
   90   gchar       * (* name)             (GfkGlClass *);
   91   gchar       * (* properties)       (GfkGl *);
   92   gchar       * (* pickinfo)         (GfkGl *, gboolean);
   93 };
   94 
   95 #define GFK_GL(obj)            GTS_OBJECT_CAST (obj,\
   96                              GfkGl,\
   97                              gfk_gl_class ())
   98 #define GFK_GL_CLASS(klass)    GTS_OBJECT_CLASS_CAST (klass,\
   99                          GfkGlClass,\
  100                          gfk_gl_class())
  101 #define GFK_IS_GL(obj)         (gts_object_is_from_class (obj,\
  102                          gfk_gl_class ()))
  103 
  104 GfkGlClass *  gfk_gl_class                 (void);
  105 GfkGl *       gfk_gl_new                   (GfkGlClass * klass,
  106                         GtkWidget * glarea,
  107                         GtkWidget * list);
  108 void          gfk_gl_expose                (GfkGl * gl);
  109 void          gfk_gl_set_sensitive         (GfkGl * gl, 
  110                         GtkWidget * page, 
  111                         gboolean sensitive);
  112 void          gfk_gl_prepend_params        (GfkGl * gl, 
  113                         GtkWidget * widget, 
  114                         GtkWidget * label);
  115 void          gfk_gl_set_color             (GfkGl * gl, 
  116                         GtsColor c);
  117 void          gfk_gl_update_properties     (GfkGl * gl);
  118 void          gfk_gl_update_interface      (GfkGl * gl);
  119 void          gfk_gl_set_simulation        (GfkGl * gl, 
  120                         GfsSimulation * sim);
  121 
  122 /* GfkGlLabel: Header */
  123 
  124 typedef struct _GfkGlLabel         GfkGlLabel;
  125 
  126 struct _GfkGlLabel {
  127   /*< private >*/
  128   GfkGl parent;
  129   GtkWidget * label;
  130 };
  131 
  132 #define GFK_GL_LABEL(obj)            GTS_OBJECT_CAST (obj,\
  133                              GfkGlLabel,\
  134                              gfk_gl_label_class ())
  135 #define GFK_IS_GL_LABEL(obj)         (gts_object_is_from_class (obj,\
  136                          gfk_gl_label_class ()))
  137 
  138 GfkGlClass * gfk_gl_label_class  (void);
  139 
  140 /* GfkGl2D: Header */
  141 
  142 typedef struct _GfkGl2D         GfkGl2D;
  143 
  144 struct _GfkGl2D {
  145   /*< private >*/
  146   GfkGl parent;
  147   FttVector n;
  148   GtkWidget * params;
  149   gchar * pickinfo;
  150 };
  151 
  152 #define GFK_GL2D(obj)            GTS_OBJECT_CAST (obj,\
  153                              GfkGl2D,\
  154                              gfk_gl2D_class ())
  155 #define GFK_IS_GL2D(obj)         (gts_object_is_from_class (obj,\
  156                          gfk_gl2D_class ()))
  157 
  158 GfkGlClass *  gfk_gl2D_class               (void);
  159 void          gfk_gl2D_update_pos_bounds   (GfkGl2D * gl);
  160 
  161 /* GfkGlSymmetry: Header */
  162 
  163 #define GFK_IS_GL_SYMMETRY(obj)         (gts_object_is_from_class (obj,\
  164                          gfk_gl_symmetry_class ()))
  165 
  166 GfkGlClass *  gfk_gl_symmetry_class             (void);
  167 
  168 /* GfkGlPeriodic: Header */
  169 
  170 #define GFK_IS_GL_PERIODIC(obj)         (gts_object_is_from_class (obj,\
  171                          gfk_gl_periodic_class ()))
  172 
  173 GfkGlClass *  gfk_gl_periodic_class             (void);
  174 
  175 /* GfkGlCells: Header */
  176 
  177 typedef struct _GfkGlCells         GfkGlCells;
  178 
  179 struct _GfkGlCells {
  180   /*< private >*/
  181   GfkGl2D parent;
  182   GtkWidget * cells;
  183   gboolean edit;
  184   guint level;
  185 };
  186 
  187 #define GFK_GL_CELLS(obj)            GTS_OBJECT_CAST (obj,\
  188                              GfkGlCells,\
  189                              gfk_gl_cells_class ())
  190 #define GFK_IS_GL_CELLS(obj)         (gts_object_is_from_class (obj,\
  191                          gfk_gl_cells_class ()))
  192 
  193 GfkGlClass * gfk_gl_cells_class  (void);
  194 
  195 /* GfkGlFractions: Header */
  196 
  197 #define GFK_IS_GL_FRACTIONS(obj)         (gts_object_is_from_class (obj,\
  198                          gfk_gl_fractions_class ()))
  199 
  200 GfkGlClass * gfk_gl_fractions_class  (void);
  201 
  202 /* GfkGlBoundaries: Header */
  203 
  204 #define GFK_IS_GL_BOUNDARIES(obj)         (gts_object_is_from_class (obj,\
  205                          gfk_gl_boundaries_class ()))
  206 
  207 GfkGlClass * gfk_gl_boundaries_class  (void);
  208 
  209 /* GfkGlScalar: Header */
  210 
  211 typedef struct _GfkGlScalar         GfkGlScalar;
  212 
  213 struct _GfkGlScalar {
  214   /*< private >*/
  215   GfkGl2D parent;
  216   GtkWidget * scalar;
  217 };
  218 
  219 #define GFK_GL_SCALAR(obj)            GTS_OBJECT_CAST (obj,\
  220                              GfkGlScalar,\
  221                              gfk_gl_scalar_class ())
  222 #define GFK_IS_GL_SCALAR(obj)         (gts_object_is_from_class (obj,\
  223                          gfk_gl_scalar_class ()))
  224 
  225 GfkGlClass *  gfk_gl_scalar_class            (void);
  226 
  227 /* GfkGlSquares: Header */
  228 
  229 typedef struct _GfkGlSquares         GfkGlSquares;
  230 
  231 struct _GfkGlSquares {
  232   /*< private >*/
  233   GfkGlScalar parent;
  234 
  235   /*< public >*/
  236 };
  237 
  238 #define GFK_GL_SQUARES(obj)            GTS_OBJECT_CAST (obj,\
  239                              GfkGlSquares,\
  240                              gfk_gl_squares_class ())
  241 #define GFK_IS_GL_SQUARES(obj)         (gts_object_is_from_class (obj,\
  242                          gfk_gl_squares_class ()))
  243 
  244 GfkGlClass * gfk_gl_squares_class  (void);
  245 
  246 /* GfkGlLinear: Header */
  247 
  248 typedef struct _GfkGlLinear         GfkGlLinear;
  249 
  250 struct _GfkGlLinear {
  251   /*< private >*/
  252   GfkGlScalar parent;
  253   GtkWidget * scalar;
  254 
  255   /*< public >*/
  256 };
  257 
  258 #define GFK_GL_LINEAR(obj)            GTS_OBJECT_CAST (obj,\
  259                              GfkGlLinear,\
  260                              gfk_gl_linear_class ())
  261 #define GFK_IS_GL_LINEAR(obj)         (gts_object_is_from_class (obj,\
  262                          gfk_gl_linear_class ()))
  263 
  264 GfkGlClass * gfk_gl_linear_class  (void);
  265 
  266 /* GfkGlIsoline: Header */
  267 
  268 typedef struct _GfkGlIsoline         GfkGlIsoline;
  269 
  270 struct _GfkGlIsoline {
  271   /*< private >*/
  272   GfkGlLinear parent;
  273 };
  274 
  275 #define GFK_GL_ISOLINE(obj)            GTS_OBJECT_CAST (obj,\
  276                              GfkGlIsoline,\
  277                              gfk_gl_isoline_class ())
  278 #define GFK_IS_GL_ISOLINE(obj)         (gts_object_is_from_class (obj,\
  279                          gfk_gl_isoline_class ()))
  280 
  281 GfkGlClass * gfk_gl_isoline_class  (void);
  282 
  283 /* GfkGlSolid: Header */
  284 
  285 #if (!FTT_2D)
  286 typedef struct _GfkGlSolid         GfkGlSolid;
  287 
  288 struct _GfkGlSolid {
  289   /*< private >*/
  290   GfkGlScalar parent;
  291   GtkWidget * solid;
  292 };
  293 
  294 #define GFK_GL_SOLID(obj)            GTS_OBJECT_CAST (obj,\
  295                              GfkGlSolid,\
  296                              gfk_gl_solid_class ())
  297 #endif /* 3D */
  298 
  299 #define GFK_IS_GL_SOLID(obj)         (gts_object_is_from_class (obj,\
  300                          gfk_gl_solid_class ()))
  301 
  302 GfkGlClass * gfk_gl_solid_class  (void);
  303 
  304 /* GfkGlLevels: Header */
  305 
  306 typedef struct _GfkGlLevels         GfkGlLevels;
  307 
  308 struct _GfkGlLevels {
  309   /*< private >*/
  310   GfkGl2D parent;
  311 };
  312 
  313 #define GFK_GL_LEVELS(obj)            GTS_OBJECT_CAST (obj,\
  314                              GfkGlLevels,\
  315                              gfk_gl_levels_class ())
  316 #define GFK_IS_GL_LEVELS(obj)         (gts_object_is_from_class (obj,\
  317                          gfk_gl_levels_class ()))
  318 
  319 GfkGlClass * gfk_gl_levels_class  (void);
  320 
  321 /* GfkGlVectors: Header */
  322 
  323 typedef struct _GfkGlVectors         GfkGlVectors;
  324 
  325 struct _GfkGlVectors {
  326   /*< private >*/
  327   GfkGlScalar parent;
  328   GtkWidget * vector;
  329 };
  330 
  331 #define GFK_GL_VECTORS(obj)            GTS_OBJECT_CAST (obj,\
  332                              GfkGlVectors,\
  333                              gfk_gl_vectors_class ())
  334 #define GFK_IS_GL_VECTORS(obj)         (gts_object_is_from_class (obj,\
  335                          gfk_gl_vectors_class ()))
  336 
  337 GfkGlClass * gfk_gl_vectors_class        (void);
  338 
  339 /* GfkGlStreamlines: Header */
  340 
  341 typedef struct _GfkGlStreamlines         GfkGlStreamlines;
  342 
  343 struct _GfkGlStreamlines {
  344   /*< private >*/
  345   GfkGlVectors parent;
  346   GtkWidget * stream;
  347   gboolean edit;
  348 };
  349 
  350 #define GFK_GL_STREAMLINES(obj)            GTS_OBJECT_CAST (obj,\
  351                              GfkGlStreamlines,\
  352                              gfk_gl_streamlines_class ())
  353 #define GFK_IS_GL_STREAMLINES(obj)         (gts_object_is_from_class (obj,\
  354                          gfk_gl_streamlines_class ()))
  355 
  356 GfkGlClass * gfk_gl_streamlines_class        (void);
  357 
  358 /* GfkGlEllipses: Header */
  359 
  360 typedef struct _GfkGlEllipses         GfkGlEllipses;
  361 
  362 struct _GfkGlEllipses {
  363   /*< private >*/
  364   GfkGlScalar parent;
  365   GtkWidget * ellipse;
  366 };
  367 
  368 #define GFK_GL_ELLIPSES(obj)            GTS_OBJECT_CAST (obj,\
  369                              GfkGlEllipses,\
  370                              gfk_gl_ellipses_class ())
  371 #define GFK_IS_GL_ELLIPSES(obj)         (gts_object_is_from_class (obj,\
  372                          gfk_gl_ellipses_class ()))
  373 
  374 GfkGlClass * gfk_gl_ellipses_class            (void);
  375 
  376 /* GfkGlLocation: Header */
  377 
  378 typedef struct _GfkGlLocation         GfkGlLocation;
  379 
  380 struct _GfkGlLocation {
  381   /*< private >*/
  382   GfkGl parent;
  383   GtkWidget * location;
  384 };
  385 
  386 #define GFK_GL_LOCATION(obj)            GTS_OBJECT_CAST (obj,\
  387                              GfkGlLocation,\
  388                              gfk_gl_location_class ())
  389 
  390 #define GFK_IS_GL_LOCATION(obj)         (gts_object_is_from_class (obj,\
  391                          gfk_gl_location_class ()))
  392 
  393 GfkGlClass * gfk_gl_location_class  (void);
  394 
  395 /* GfkGlHeight: Header */
  396 
  397 #define GFK_IS_GL_HEIGHT(obj)         (gts_object_is_from_class (obj,\
  398                          gfk_gl_height_class ()))
  399 
  400 GfkGlClass * gfk_gl_height_class  (void);
  401 
  402 /* GfkGlLocate: Header */
  403 
  404 typedef struct _GfkGlLocate         GfkGlLocate;
  405 
  406 struct _GfkGlLocate {
  407   /*< private >*/
  408   GfkGl parent;
  409   GtkWidget * locate;
  410 };
  411 
  412 #define GFK_GL_LOCATE(obj)            GTS_OBJECT_CAST (obj,\
  413                              GfkGlLocate,\
  414                              gfk_gl_locate_class ())
  415 
  416 #define GFK_IS_GL_LOCATE(obj)         (gts_object_is_from_class (obj,\
  417                          gfk_gl_locate_class ()))
  418 
  419 GfkGlClass * gfk_gl_locate_class  (void);
  420 
  421 /* GfkGlPipes: Header */
  422 
  423 #define GFK_IS_GL_PIPES(obj)         (gts_object_is_from_class (obj,\
  424                          gfk_gl_pipes_class ()))
  425 
  426 GfkGlClass * gfk_gl_pipes_class  (void);
  427 
  428 /* GfkGlInfo: Header */
  429 
  430 typedef struct _GfkGlInfo         GfkGlInfo;
  431 
  432 struct _GfkGlInfo {
  433   /*< private >*/
  434   GfkGl parent;
  435   GtkWidget * info;
  436 };
  437 
  438 #define GFK_GL_INFO(obj)            GTS_OBJECT_CAST (obj,\
  439                              GfkGlInfo,\
  440                              gfk_gl_info_class ())
  441 #define GFK_IS_GL_INFO(obj)         (gts_object_is_from_class (obj,\
  442                          gfk_gl_info_class ()))
  443 
  444 GfkGlClass *  gfk_gl_info_class            (void);
  445 
  446 /* GfkGlView: Header */
  447 
  448 #define GFK_GL_PACK_MSG(msg, p)   (memcpy (&(msg).data.b[0], &(p), sizeof (GfsGl2PSParams *)))
  449 #define GFK_GL_UNPACK_MSG(msg, p) (memcpy (&(p), &(msg)->data.b[0], sizeof (GfsGl2PSParams *)))
  450 
  451 GtkWidget *     gfk_gl_view                (GtkWidget * glarea);
  452 void            gfk_gl_view_set_scripting  (GtkWidget * view, 
  453                         gboolean active);
  454 void            gfk_gl_view_set_simulation (GtkWidget * view, 
  455                         GfsSimulation * sim,
  456                         const gchar * fname);
  457 gboolean        gfk_gl_view_read_parameters (GtkWidget * view, 
  458                          GtsFile * fp,
  459                          gboolean discard);
  460 GfsSimulation * gfk_gl_simulation_read     (const gchar * fname,
  461                         GtkWidget * view,
  462                         gboolean set);
  463 void            gfk_gl_view_draw           (GtkWidget * view,
  464                         guint format);
  465 void            gfk_gl_view_pick           (GtkWidget * view, 
  466                         GfsGlRay * ray,
  467                         gboolean motion);
  468 void            gfk_gl_view_clear          (GtkWidget * view);
  469 void            gfs_gl2ps                  (GfsGl2PSParams * p, 
  470                         FILE * fp,
  471                         const gchar * fname, 
  472                         GtkWidget * view);
  473 
  474 /* GfkGlVOF: Header */
  475 
  476 typedef struct _GfkGlVOF         GfkGlVOF;
  477 
  478 struct _GfkGlVOF {
  479   /*< private >*/
  480   GfkGlScalar parent;
  481   GtkWidget * scalar;
  482 
  483   /*< public >*/
  484 };
  485 
  486 #define GFK_GL_VOF(obj)            GTS_OBJECT_CAST (obj,\
  487                              GfkGlVOF,\
  488                              gfk_gl_vof_class ())
  489 #define GFK_IS_GL_VOF(obj)         (gts_object_is_from_class (obj,\
  490                          gfk_gl_vof_class ()))
  491 
  492 GfkGlClass * gfk_gl_vof_class            (void);
  493 
  494 /* GfkGlClipPlane: Header */
  495 
  496 #define GFK_IS_GL_CLIP_PLANE(obj)         (gts_object_is_from_class (obj,\
  497                          gfk_gl_clip_plane_class ()))
  498 
  499 GfkGlClass * gfk_gl_clip_plane_class            (void);
  500 
  501 #if (!FTT_2D)
  502 
  503 /* GfkGlIsosurface: Header */
  504 
  505 typedef struct _GfkGlIsosurface         GfkGlIsosurface;
  506 
  507 struct _GfkGlIsosurface {
  508   /*< private >*/
  509   GfkGlScalar parent;
  510   GtkWidget * scalar;
  511 
  512   /*< public >*/
  513 };
  514 
  515 #define GFK_GL_ISOSURFACE(obj)            GTS_OBJECT_CAST (obj,\
  516                              GfkGlIsosurface,\
  517                              gfk_gl_isosurface_class ())
  518 #define GFK_IS_GL_ISOSURFACE(obj)         (gts_object_is_from_class (obj,\
  519                          gfk_gl_isosurface_class ()))
  520 
  521 GfkGlClass * gfk_gl_isosurface_class            (void);
  522 
  523 /* GfkGlCutPlane: Header */
  524 
  525 #define GFK_IS_GL_CUT_PLANE(obj)         (gts_object_is_from_class (obj,\
  526                          gfk_gl_cut_plane_class ()))
  527 
  528 GfkGlClass * gfk_gl_cut_plane_class            (void);
  529 
  530 #endif /* 3D */
  531 
  532 #ifdef __cplusplus
  533 }
  534 #endif /* __cplusplus */
  535 
  536 #endif /* __GFKGL_H__ */