1/*
2 * tkimg.h --
3 *
4 *  Interface to tkimg Base package.
5 *
6 * Copyright (c) 2002 Andreas Kupries <andreas_kupries@users.sourceforge.net>
7 *
8 * Zveno Pty Ltd makes this software and associated documentation
9 * available free of charge for any purpose.  You may make copies
10 * of the software but you must include all of this notice on any copy.
11 *
12 * Zveno Pty Ltd does not warrant that this software is error free
13 * or fit for any purpose.  Zveno Pty Ltd disclaims any liability for
14 * all claims, expenses, losses, damages and costs any user may incur
15 * as a result of using, copying or modifying the software.
16 *
17 * $Id: tkimg.h 266 2010-06-03 19:48:13Z nijtmans $
18 *
19 */
20
21#ifndef __TKIMG_H__
22#define __TKIMG_H__
23
24#ifdef _MSC_VER
25#pragma warning(disable:4244) /* '=' : conversion from '__int64' to 'int', possible loss of data */
26#pragma warning(disable:4761) /* integral size mismatch in argument; conversion supplied */
27#endif
28
29#include <stdio.h> /* stdout, and other definitions */
30#include <string.h>
31#include <stdlib.h>
32#include <ctype.h>
33#include <tk.h>
34
35/*
36 * On a few systems, type boolean and/or its values FALSE, TRUE may appear
37 * in standard header files.  Or you may have conflicts with application-
38 * specific header files that you want to include together with these files.
39 * Defining HAVE_BOOLEAN before including tkimg.h should make it work.
40 */
41
42/* On windows use the boolean definition from its headers to prevent
43 * any conflicts should a user of this header use "windows.h". Without
44 * this we will have/get conflicting definitions of 'boolean' ('int'
45 * here, 'unsigned' char for windows)
46 */
47
48#ifndef HAVE_BOOLEAN
49#define HAVE_BOOLEAN
50#   ifndef __RPCNDR_H__     /* don't conflict if rpcndr.h already read */
51#if defined(_WINDOWS) || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_Windows)
52typedef unsigned char boolean;
53#else
54typedef int boolean;
55#endif
56#endif
57#endif
58
59/*
60 * Used to block the rest of this header file from resource compilers so
61 * we can just get the version info.
62 */
63#ifndef RC_INVOKED
64
65/* TIP 27 update. If CONST84 is not defined we are compiling against a
66 * core before 8.4 and have to disable some CONST'ness.
67 */
68
69#ifndef CONST84
70#   define CONST84
71#endif
72#ifndef CONST86
73#   define CONST86
74#endif
75
76#ifndef TK_PHOTO_COMPOSITE_OVERLAY
77#   define TK_PHOTO_COMPOSITE_OVERLAY 0
78#endif
79#ifndef TK_PHOTO_COMPOSITE_SET
80#   define TK_PHOTO_COMPOSITE_SET 1
81#endif
82
83#include "tkimgDecls.h"
84
85#ifdef __cplusplus
86extern "C" {
87#endif /* __cplusplus */
88
89/*
90 *----------------------------------------------------------------------------
91 * C API for Tkimg generic layer
92 *----------------------------------------------------------------------------
93 */
94
95#define IMG_SPECIAL (1<<8)
96#define IMG_PAD     (IMG_SPECIAL+1)
97#define IMG_SPACE   (IMG_SPECIAL+2)
98#define IMG_BAD     (IMG_SPECIAL+3)
99#define IMG_DONE    (IMG_SPECIAL+4)
100#define IMG_CHAN    (IMG_SPECIAL+5)
101#define IMG_STRING  (IMG_SPECIAL+6)
102
103/*
104 * The variable "tkimg_initialized" contains flags indicating which
105 * version of Tcl or Perl we are running:
106 *
107 *  IMG_TCL    Tcl
108 *  IMG_PERL   perl
109 *  IMG_COMPOSITE Tcl 8.4 or higher
110 *  IMG_NOPANIC Tcl 8.5 or higher
111 *
112 * These flags will be determined at runtime (except the IMG_PERL
113 * flag, for now), so we can use the same dynamic library for all
114 * Tcl/Tk versions (and for Perl/Tk in the future).
115 */
116
117MODULE_SCOPE int tkimg_initialized;
118
119#define IMG_TCL (1<<9)
120#define IMG_PERL (1<<11)
121#define IMG_COMPOSITE (1<<14)
122#define IMG_NOPANIC (1<<15)
123
124MODULE_SCOPE int TkimgInitUtilities(Tcl_Interp* interp);
125
126/*
127 *----------------------------------------------------------------------------
128 * Function prototypes for stub initialization.
129 *----------------------------------------------------------------------------
130 */
131
132const char *
133Tkimg_InitStubs(Tcl_Interp *interp, const char *version, int exact);
134
135#endif /* RC_INVOKED */
136
137#ifdef __cplusplus
138}
139#endif /* __cplusplus */
140
141#endif /* __TKIMG_H__ */
142