~ubuntu-branches/debian/sid/genius/sid

« back to all changes in this revision

Viewing changes to gtkextra/gtkplotpc.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-08-21 12:57:45 UTC
  • Revision ID: james.westby@ubuntu.com-20060821125745-sl9ks8v7fq324bdf
Tags: upstream-0.7.6.1
ImportĀ upstreamĀ versionĀ 0.7.6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* gtkplotpc - gtkplot print context - a renderer for printing functions
 
2
 * Copyright 1999-2001  Adrian E. Feiguin <feiguin@ifir.edu.ar>
 
3
 *
 
4
 * This library is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU Library General Public
 
6
 * License as published by the Free Software Foundation; either
 
7
 * version 2 of the License, or (at your option) any later version.
 
8
 *
 
9
 * This library is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
 * Library General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU Library General Public
 
15
 * License along with this library; if not, write to the
 
16
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
17
 * Boston, MA 02111-1307, USA.
 
18
 */
 
19
 
 
20
#ifndef __GTK_PLOT_PC_H__
 
21
#define __GTK_PLOT_PC_H__
 
22
 
 
23
#include <stdio.h>
 
24
#include "gtkpsfont.h"
 
25
 
 
26
#ifdef __cplusplus
 
27
extern "C" {
 
28
#endif /* __cplusplus */
 
29
 
 
30
 
 
31
#define GTK_PLOT_PC(obj)        GTK_CHECK_CAST (obj, gtk_plot_pc_get_type (), GtkPlotPC)
 
32
#define GTK_TYPE_PLOT_PC   (gtk_plot_pc_get_type ())
 
33
 
 
34
#define GTK_PLOT_PC_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_plot_pc_get_type(), GtkPlotPCClass)
 
35
#define GTK_IS_PLOT_PC(obj)     GTK_CHECK_TYPE (obj, gtk_plot_pc_get_type ())
 
36
 
 
37
 
 
38
/* Page size */
 
39
 
 
40
typedef enum{
 
41
     GTK_PLOT_LETTER    ,
 
42
     GTK_PLOT_LEGAL     ,
 
43
     GTK_PLOT_A4        ,
 
44
     GTK_PLOT_EXECUTIVE ,
 
45
     GTK_PLOT_CUSTOM    
 
46
} GtkPlotPageSize;
 
47
 
 
48
#define GTK_PLOT_LETTER_W       612   /* Width and Height in ps points */
 
49
#define GTK_PLOT_LETTER_H       792
 
50
 
 
51
#define GTK_PLOT_LEGAL_W        612
 
52
#define GTK_PLOT_LEGAL_H        1008
 
53
 
 
54
#define GTK_PLOT_A4_W           595
 
55
#define GTK_PLOT_A4_H           842
 
56
 
 
57
#define GTK_PLOT_EXECUTIVE_W    540
 
58
#define GTK_PLOT_EXECUTIVE_H    720
 
59
 
 
60
 
 
61
/* Page orientation */
 
62
typedef enum{
 
63
     GTK_PLOT_PORTRAIT  ,
 
64
     GTK_PLOT_LANDSCAPE 
 
65
} GtkPlotPageOrientation;
 
66
 
 
67
/* Size units */
 
68
typedef enum{
 
69
     GTK_PLOT_PSPOINTS  ,
 
70
     GTK_PLOT_MM        ,
 
71
     GTK_PLOT_CM        ,
 
72
     GTK_PLOT_INCHES    
 
73
} GtkPlotUnits;
 
74
 
 
75
 
 
76
typedef struct _GtkPlotPC GtkPlotPC;
 
77
typedef struct _GtkPlotPCClass GtkPlotPCClass;
 
78
typedef struct _GtkPlotPoint         GtkPlotPoint;
 
79
 
 
80
struct _GtkPlotPoint
 
81
{
 
82
  gdouble x, y;
 
83
};
 
84
 
 
85
struct _GtkPlotPC
 
86
{
 
87
   GtkObject object;
 
88
 
 
89
   gdouble width, height; /* viewport */
 
90
   GdkColor color;
 
91
 
 
92
   gint init_count;
 
93
};
 
94
 
 
95
 
 
96
struct _GtkPlotPCClass
 
97
{
 
98
   GtkObjectClass parent_class;
 
99
 
 
100
   gboolean  (* init)                                   (GtkPlotPC *pc);
 
101
 
 
102
   void  (* leave)                                      (GtkPlotPC *pc);
 
103
 
 
104
   void  (* set_viewport)                               (GtkPlotPC *pc,
 
105
                                                         gdouble w, gdouble h);
 
106
 
 
107
   void  (* gsave)                                      (GtkPlotPC *pc);
 
108
 
 
109
   void  (* grestore)                                   (GtkPlotPC *pc);
 
110
 
 
111
   void  (* clip)                                       (GtkPlotPC *pc,
 
112
                                                         const GdkRectangle *area);
 
113
   void  (* clip_mask)                                  (GtkPlotPC *pc,
 
114
                                                         gdouble x,
 
115
                                                         gdouble y,
 
116
                                                         const GdkBitmap *mask);
 
117
 
 
118
   void  (* set_color)                                  (GtkPlotPC *pc,
 
119
                                                        const GdkColor *color);
 
120
 
 
121
   void  (* set_lineattr)                       (GtkPlotPC *pc,
 
122
                                                 gfloat line_width,
 
123
                                                 GdkLineStyle line_style,
 
124
                                                 GdkCapStyle cap_style,
 
125
                                                 GdkJoinStyle join_style);
 
126
 
 
127
   void  (* set_dash)                                   (GtkPlotPC *pc,
 
128
                                                         gdouble offset_,       
 
129
                                                         gdouble *values,
 
130
                                                         gint num_values);
 
131
 
 
132
   void  (* draw_point)                                 (GtkPlotPC *pc,
 
133
                                                         gdouble x, gdouble y);
 
134
 
 
135
   void  (* draw_line)                                  (GtkPlotPC *pc,
 
136
                                                         gdouble x1, gdouble y1,
 
137
                                                         gdouble x2, gdouble y2);
 
138
 
 
139
   void  (* draw_lines)                                 (GtkPlotPC *pc,
 
140
                                                         GtkPlotPoint *points,
 
141
                                                         gint numpoints);
 
142
 
 
143
   void  (* draw_rectangle)                             (GtkPlotPC *pc,
 
144
                                                         gboolean filled,
 
145
                                                         gdouble x, gdouble y,
 
146
                                                         gdouble width,
 
147
                                                         gdouble height);
 
148
 
 
149
   void  (* draw_polygon)                               (GtkPlotPC *pc,
 
150
                                                         gboolean filled,
 
151
                                                         GtkPlotPoint *points,
 
152
                                                         gint numpoints);
 
153
 
 
154
   void  (* draw_circle)                                (GtkPlotPC *pc,
 
155
                                                         gboolean filled,
 
156
                                                         gdouble x, gdouble y,
 
157
                                                         gdouble size); 
 
158
 
 
159
   void  (* draw_ellipse)                               (GtkPlotPC *pc,
 
160
                                                         gboolean filled,
 
161
                                                         gdouble x, gdouble y,
 
162
                                                         gdouble width, 
 
163
                                                         gdouble height); 
 
164
 
 
165
   void  (* set_font)                                   (GtkPlotPC *pc,
 
166
                                                         GtkPSFont *psfont,
 
167
                                                         gint height);
 
168
 
 
169
   void  (* draw_string)                                (GtkPlotPC *pc,
 
170
                                                         gint x, gint y,
 
171
                                                         gint angle,
 
172
                                                         const GdkColor *fg,
 
173
                                                         const GdkColor *bg,
 
174
                                                         gboolean transparent,
 
175
                                                         gint border,
 
176
                                                         gint border_space,
 
177
                                                         gint border_width,
 
178
                                                         gint shadow_width,
 
179
                                                         const gchar *font,
 
180
                                                         gint height,
 
181
                                                         GtkJustification just,
 
182
                                                         const gchar *text);
 
183
 
 
184
   void  (* draw_pixmap)                                (GtkPlotPC *pc,
 
185
                                                         GdkPixmap *pixmap,
 
186
                                                         GdkBitmap *mask,
 
187
                                                         gint xsrc, gint ysrc,
 
188
                                                         gint xdest, gint ydest,
 
189
                                                         gint width, 
 
190
                                                         gint height, 
 
191
                                                         gdouble scale_x, 
 
192
                                                         gdouble scale_y); 
 
193
};
 
194
 
 
195
GtkType    gtk_plot_pc_get_type                         (void);
 
196
GtkObject *gtk_plot_pc_new                              (void);
 
197
                                                         
 
198
gboolean gtk_plot_pc_init                               (GtkPlotPC *pc);
 
199
 
 
200
void gtk_plot_pc_leave                                  (GtkPlotPC *pc);
 
201
void gtk_plot_pc_set_viewport                           (GtkPlotPC *pc,
 
202
                                                         gdouble w, gdouble h);
 
203
 
 
204
void gtk_plot_pc_gsave                                  (GtkPlotPC *pc);
 
205
 
 
206
void gtk_plot_pc_grestore                               (GtkPlotPC *pc);
 
207
 
 
208
void gtk_plot_pc_clip                                   (GtkPlotPC *pc,
 
209
                                                         GdkRectangle *area);
 
210
void gtk_plot_pc_clip_mask                              (GtkPlotPC *pc,
 
211
                                                         gdouble x, 
 
212
                                                         gdouble y, 
 
213
                                                         GdkBitmap *mask);
 
214
 
 
215
void gtk_plot_pc_set_color                              (GtkPlotPC *pc,
 
216
                                                         GdkColor *color);
 
217
 
 
218
void gtk_plot_pc_set_lineattr                     (GtkPlotPC *pc,
 
219
                                                   gfloat line_width,
 
220
                                                   GdkLineStyle line_style,
 
221
                                                   GdkCapStyle cap_style,
 
222
                                                   GdkJoinStyle join_style);
 
223
 
 
224
void gtk_plot_pc_set_dash                               (GtkPlotPC *pc,
 
225
                                                         gdouble offset_,
 
226
                                                         gdouble *values,
 
227
                                                         gint num_values);
 
228
 
 
229
void gtk_plot_pc_draw_point                             (GtkPlotPC *pc,
 
230
                                                         gdouble x, gdouble y);
 
231
 
 
232
void gtk_plot_pc_draw_line                              (GtkPlotPC *pc,
 
233
                                                         gdouble x1, gdouble y1,
 
234
                                                         gdouble x2, gdouble y2);
 
235
 
 
236
void gtk_plot_pc_draw_lines                             (GtkPlotPC *pc,
 
237
                                                         GtkPlotPoint *points,
 
238
                                                         gint numpoints);
 
239
 
 
240
void gtk_plot_pc_draw_rectangle                         (GtkPlotPC *pc,
 
241
                                                         gboolean filled,
 
242
                                                         gdouble x, gdouble y,
 
243
                                                         gdouble width,
 
244
                                                         gdouble height);
 
245
 
 
246
void gtk_plot_pc_draw_polygon                           (GtkPlotPC *pc,
 
247
                                                         gint filled,
 
248
                                                         GtkPlotPoint *points,
 
249
                                                         gint numpoints);
 
250
 
 
251
void gtk_plot_pc_draw_ellipse                           (GtkPlotPC *pc,
 
252
                                                         gboolean filled,
 
253
                                                         gdouble x, gdouble y,
 
254
                                                         gdouble width,
 
255
                                                         gdouble height);
 
256
 
 
257
void gtk_plot_pc_draw_circle                            (GtkPlotPC *pc,
 
258
                                                         gint filled,
 
259
                                                         gdouble x, gdouble y,
 
260
                                                         gdouble size); 
 
261
 
 
262
void gtk_plot_pc_set_font                               (GtkPlotPC *pc,
 
263
                                                         GtkPSFont *psfont,
 
264
                                                         gint height);
 
265
 
 
266
void gtk_plot_pc_draw_string                            (GtkPlotPC *pc,
 
267
                                                         gint x, gint y,
 
268
                                                         gint angle,
 
269
                                                         const GdkColor *fg,
 
270
                                                         const GdkColor *bg,
 
271
                                                         gboolean transparent,
 
272
                                                         gint border,
 
273
                                                         gint border_space,
 
274
                                                         gint border_width,
 
275
                                                         gint shadow_width,
 
276
                                                         const gchar *font,
 
277
                                                         gint height,
 
278
                                                         GtkJustification just,
 
279
                                                         const gchar *text);
 
280
 
 
281
void  gtk_plot_pc_draw_pixmap                           (GtkPlotPC *pc,
 
282
                                                         GdkPixmap *pixmap,
 
283
                                                         GdkBitmap *mask,
 
284
                                                         gint xsrc, gint ysrc,
 
285
                                                         gint xdest, gint ydest,
 
286
                                                         gint width,
 
287
                                                         gint height, 
 
288
                                                         gdouble scale_x,
 
289
                                                         gdouble scale_y); 
 
290
 
 
291
#ifdef __cplusplus
 
292
}
 
293
#endif /* __cplusplus */
 
294
 
 
295
 
 
296
#endif /* __GTK_PLOT_PC_H__ */
 
297