initial setup of thesis repository
[cluster_expansion_thesis.git] / little_helpers / tikz / sketch-0.2.161 / global.h
blobbbf2e3a96390249f148743e40662b319c4fa77b5
1 /* global.h
2 Copyright (C) 2005,2006,2007,2008 Eugene K. Ressler, Jr.
4 This file is part of Sketch, a small, simple system for making
5 3d drawings with LaTeX and the PSTricks or TikZ package.
7 Sketch is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
12 Sketch is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Sketch; see the file COPYING.txt. If not, see
19 http://www.gnu.org/copyleft */
21 #ifndef __GLOBAL_H
22 #define __GLOBAL_H
24 #include "opts.h"
25 #include "error.h"
26 #include "geometry.h"
27 #include "langver.h"
29 #define GE_EXTENT 0
30 #define GE_BASELINE 1
31 #define GE_OPTS 2
32 #define GE_FRAME 3
33 #define GE_SPLIT 4
34 #define GE_CAMERA 8
35 #define GE_OUTPUT_LANGUAGE 9
37 // these must match table in opt.c and global.c
38 #define GEOL_GRAPHICS_BIT 1
39 #define GEOL_TEX_MACROS_BIT 2
40 #define GEOL_PSTRICKS (GEOL_GRAPHICS_BIT*0)
41 #define GEOL_TIKZ (GEOL_GRAPHICS_BIT*1)
42 #define GEOL_LATEX (GEOL_TEX_MACROS_BIT*0)
43 #define GEOL_CONTEXT (GEOL_TEX_MACROS_BIT*1)
45 // this must match string table in global.c
46 extern char *output_language_str[];
48 typedef struct global_env_t
50 unsigned set_p_mask;
51 OPTS opts[1];
52 POINT_3D bb1, bb2; // bounding box
53 char *frame_opts; // null if frame has none
54 FLOAT baseline;
55 int split_p;
56 TRANSFORM camera;
57 int output_language;
58 PST_VERSION pst_version[1];
59 TIKZ_VERSION tikz_version[1];
61 GLOBAL_ENV;
63 #define global_env_is_set_p(Env, F) ((Env)->set_p_mask & bit(F))
65 void init_global_env (GLOBAL_ENV * env, PST_VERSION *pst_version, TIKZ_VERSION *tikz_version);
66 void set_global_baseline (GLOBAL_ENV * env, FLOAT baseline, SRC_LINE line);
67 #define NO_BASELINE FLT_MAX
68 void set_global_env_extent (GLOBAL_ENV * env, POINT_3D p1, POINT_3D p2,
69 SRC_LINE line);
70 int get_transformed_global_env_extent (BOX_3D * extent, GLOBAL_ENV * env);
71 void set_global_env_opts (GLOBAL_ENV * env, char *opt_str, SRC_LINE line);
72 void set_global_env_frame (GLOBAL_ENV * env, char *opt_str, SRC_LINE line);
73 void set_global_env_camera (GLOBAL_ENV * env, TRANSFORM camera,
74 SRC_LINE line);
75 void set_global_output_language (GLOBAL_ENV * env, int output_language,
76 SRC_LINE line);
77 int get_global_output_language (int *output_language, GLOBAL_ENV * env);
78 int cmp_with_global_pst_version(GLOBAL_ENV * env,
79 char * version_str,
80 SRC_LINE line);
82 extern GLOBAL_ENV __the_global_env[1];
84 #define global_env __the_global_env
86 #endif