File: export.h

package info (click to toggle)
gnubg 1.05.002-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 28,412 kB
  • ctags: 9,788
  • sloc: ansic: 95,352; xml: 15,021; sh: 12,502; yacc: 700; makefile: 587; python: 567; lex: 297; sql: 238; awk: 26
file content (106 lines) | stat: -rw-r--r-- 3,102 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
 * export.h
 *
 * by Jrn Thyssen  <jthyssen@dk.ibm.com>, 2002.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 3 or later of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * $Id: export.h,v 1.38 2013/06/16 02:16:11 mdpetch Exp $
 */

#include "render.h"
#include "list.h"
#include <glib.h>

#ifndef EXPORT_H
#define EXPORT_H

#define EXPORT_CUBE_ACTUAL   7
#define EXPORT_CUBE_MISSED   8
#define EXPORT_CUBE_CLOSE    9


typedef enum _htmlexporttype {
    HTML_EXPORT_TYPE_GNU,
    HTML_EXPORT_TYPE_BBS,
    HTML_EXPORT_TYPE_FIBS2HTML,
    NUM_HTML_EXPORT_TYPES
} htmlexporttype;

typedef enum _htmlexportcss {
    HTML_EXPORT_CSS_HEAD,
    HTML_EXPORT_CSS_INLINE,
    HTML_EXPORT_CSS_EXTERNAL,
    NUM_HTML_EXPORT_CSS
} htmlexportcss;

extern const char *aszHTMLExportType[];
extern const char *aszHTMLExportCSS[];
extern const char *aszHTMLExportCSSCommand[];

typedef struct _exportsetup {

    int fIncludeAnnotation;
    int fIncludeAnalysis;
    int fIncludeStatistics;
    int fIncludeMatchInfo;

    /* display board: 0 (never), 1 (every move), 2 (every second move) etc */

    int fDisplayBoard;

    int fSide;                  /* 0, 1, or -1 for both players */

    /* moves */

    unsigned int nMoves;        /* show at most nMoves */
    int fMovesDetailProb;       /* show detailed probabilities */
    int afMovesParameters[2];   /* detailed parameters */
    int afMovesDisplay[7];      /* display moves */

    /* cube */

    int fCubeDetailProb;        /* show detailed probabilities */
    int afCubeParameters[2];    /* detailed parameters */
    int afCubeDisplay[10];      /* display moves */

    /* FIXME: add format specific options */

    /* For example, frames/non frames for HTML. */

    char *szHTMLPictureURL;
    htmlexporttype het;
    char *szHTMLExtension;
    htmlexportcss hecss;

    /* sizes */
    int nPNGSize;
    int nHtmlSize;

} exportsetup;

extern exportsetup exsExport;

extern char *filename_from_iGame(const char *szBase, const int iGame);
extern int WritePNG(const char *sz, unsigned char *puch,
                    unsigned int nStride, unsigned int nSizeX, unsigned int nSizeY);

#if USE_BOARD3D
void GenerateImage3d(const char *szName, unsigned int nSize, unsigned int nSizeX, unsigned int nSizeY);
#endif

extern void TextAnalysis(GString * gsz, const matchstate * pms, moverecord * pmr);
extern void TextPrologue(GString * gsz, const matchstate * pms, const int iGame);
extern void TextBoardHeader(GString * gsz, const matchstate * pms, const int iGame, const int iMove);
#endif