1 /*
2  * export.h
3  *
4  * by Joern Thyssen  <jthyssen@dk.ibm.com>, 2002.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of version 3 or later of the GNU General Public License as
8  * published by the Free Software Foundation.
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
13  * GNU 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  02111-1307  USA
18  *
19  * $Id: export.h,v 1.40 2018/06/05 19:24:05 plm Exp $
20  */
21 
22 #include "render.h"
23 #include "list.h"
24 #include <glib.h>
25 
26 #ifndef EXPORT_H
27 #define EXPORT_H
28 
29 #define EXPORT_CUBE_ACTUAL   4
30 #define EXPORT_CUBE_MISSED   5
31 #define EXPORT_CUBE_CLOSE    6
32 
33 
34 typedef enum _htmlexporttype {
35     HTML_EXPORT_TYPE_GNU,
36     HTML_EXPORT_TYPE_BBS,
37     HTML_EXPORT_TYPE_FIBS2HTML,
38     NUM_HTML_EXPORT_TYPES
39 } htmlexporttype;
40 
41 typedef enum _htmlexportcss {
42     HTML_EXPORT_CSS_HEAD,
43     HTML_EXPORT_CSS_INLINE,
44     HTML_EXPORT_CSS_EXTERNAL,
45     NUM_HTML_EXPORT_CSS
46 } htmlexportcss;
47 
48 extern const char *aszHTMLExportType[];
49 extern const char *aszHTMLExportCSS[];
50 extern const char *aszHTMLExportCSSCommand[];
51 
52 typedef struct _exportsetup {
53 
54     int fIncludeAnnotation;
55     int fIncludeAnalysis;
56     int fIncludeStatistics;
57     int fIncludeMatchInfo;
58 
59     /* display board: 0 (never), 1 (every move), 2 (every second move) etc */
60 
61     int fDisplayBoard;
62 
63     int fSide;                  /* 0, 1, or -1 for both players */
64 
65     /* moves */
66 
67     unsigned int nMoves;        /* show at most nMoves */
68     int fMovesDetailProb;       /* show detailed probabilities */
69     int afMovesParameters[2];   /* detailed parameters */
70     int afMovesDisplay[4];      /* display moves */
71 
72     /* cube */
73 
74     int fCubeDetailProb;        /* show detailed probabilities */
75     int afCubeParameters[2];    /* detailed parameters */
76     int afCubeDisplay[7];       /* display cube actions */
77 
78     /* FIXME: add format specific options */
79 
80     /* For example, frames/non frames for HTML. */
81 
82     char *szHTMLPictureURL;
83     htmlexporttype het;
84     char *szHTMLExtension;
85     htmlexportcss hecss;
86 
87     /* sizes */
88     int nPNGSize;
89     int nHtmlSize;
90 
91 } exportsetup;
92 
93 extern exportsetup exsExport;
94 
95 extern char *filename_from_iGame(const char *szBase, const int iGame);
96 extern int WritePNG(const char *sz, unsigned char *puch,
97                     unsigned int nStride, unsigned int nSizeX, unsigned int nSizeY);
98 
99 #if defined(USE_BOARD3D)
100 void GenerateImage3d(const char *szName, unsigned int nSize, unsigned int nSizeX, unsigned int nSizeY);
101 #endif
102 
103 extern void TextAnalysis(GString * gsz, const matchstate * pms, moverecord * pmr);
104 extern void TextPrologue(GString * gsz, const matchstate * pms, const int iGame);
105 extern void TextBoardHeader(GString * gsz, const matchstate * pms, const int iGame, const int iMove);
106 #endif
107