Statistics
| Revision:

root / tmp / org.txm.statsengine.r.core.win32 / res / win32 / include / ga.h @ 2486

History | View | Annotate | Download (8 kB)

1
/*
2
 *
3
 *  R : A Computer Language for Statistical Data Analysis
4
 *  file ga.h
5
 *  Copyright (C) 1998--1999  Guido Masarotto
6
 *  Copyright (C) 2004--2008   The R Foundation
7
 *
8
 *  This program is free software; you can redistribute it and/or modify
9
 *  it under the terms of the GNU General Public License as published by
10
 *  the Free Software Foundation; either version 2 of the License, or
11
 *  (at your option) any later version.
12
 *
13
 *  This program is distributed in the hope that it will be useful,
14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 *  GNU General Public License for more details.
17
 *
18
 *  You should have received a copy of the GNU General Public License
19
 *  along with this program; if not, a copy is available at
20
 *  http://www.r-project.org/Licenses/
21
 */
22

    
23
/*
24
   New declarations.
25
*/
26

    
27
#ifndef __GA__VERSION
28
#define __GA__VERSION 2.45(1)
29
#include "graphapp.h"
30

    
31
/* renamed functions */
32
void        gamainloop(void);
33
void        gabeep(void);
34

    
35
#define DblClick        0x0010/* added for buttons.c*/
36

    
37

    
38
/* windows.c */
39
#define Border        0x10100000L
40
void        app_cleanup(void);
41
int        ismdi(void);
42
int        isUnicodeWindow(control c);
43
int        isiconic(window w);
44
rect        screen_coords(control c);
45

    
46
/* gmenus.c */
47
typedef struct {
48
    char *nm;
49
    menufn fn;
50
    int key;
51
    menuitem m;
52
} MenuItem;
53

    
54
#define STARTMENU {"#STARTMENU", 0, 0}
55
#define ENDMENU {"#ENDMENU", 0, 0}
56
#define STARTSUBMENU {"#STARTSUBMENU", 0, 0}
57
#define ENDSUBMENU {"#ENDSUBMENU", 0, 0}
58
#define MDIMENU {"#MDIMENU", 0, 0}
59
#define LASTMENUITEM {0, 0, 0}
60
menu        newmdimenu(void);
61
typedef menu popup;
62
popup        newpopup(actionfn fn);
63
menubar gmenubar(actionfn fn, MenuItem []);
64
popup        gpopup(actionfn fn, MenuItem []);
65
void        gchangepopup(window w, popup p);
66
/* next is limited to current window... */
67
void        gchangemenubar(menubar mb);
68

    
69

    
70
/* tooltips.c */
71
int        addtooltip(control c, const char *tp);
72

    
73
/* status.c */
74
int        addstatusbar(void);
75
int        delstatusbar(void);
76
void        setstatus(const char *text);
77

    
78
/* dialogs.c */
79
void        setuserfilter(const char *);
80
void    askchangedir(void);
81
char *        askcdstring(const char *question, const char *default_string);
82
char *        askfilesavewithdir(const char *title, const char *default_name,
83
                           const char *dir);
84
char *  askfilenames(const char *title, const char *default_name, int multi,
85
                     const char *filters, int filterindex, char *strbuf,
86
                     int bufsize, const char *dir);
87
int     countFilenames(const char *strbuf); /* Note that first name is path when there are multiple names */
88

    
89
void        setuserfilterW(const wchar_t *);
90
wchar_t *askfilenameW(const char *title, const char *default_name);
91
wchar_t *askfilenamesW(const wchar_t *title, const wchar_t *default_name,
92
                       int multi,
93
                       const wchar_t *filters, int filterindex,
94
                       const wchar_t *dir);
95
wchar_t *askfilesaveW(const char *title, const char *default_name);
96

    
97

    
98

    
99
/*  rgb.c */
100
rgb     nametorgb(const char *colourname);
101
const char *  rgbtoname(rgb in);
102
int     rgbtonum(rgb in);
103
rgb     myGetSysColor(int);
104
rgb        dialog_bg(void);
105

    
106

    
107
/* clipboard.c */
108
void    copytoclipboard(drawing src);
109
int     copystringtoclipboard(const char *str);
110
int     getstringfromclipboard(char * str, int n);
111
int     clipboardhastext(void);
112

    
113
/* gimage.c */
114
image  bitmaptoimage(bitmap bm);
115

    
116
/* printer.c  */
117
typedef objptr printer;
118
printer newprinter(double w,  double h, const char *name);
119
void    nextpage(printer p);
120

    
121
/* metafile.c */
122
typedef objptr metafile;
123
metafile newmetafile(const char *name, double width, double height);
124

    
125

    
126
/* thread safe and extended  drawing functions (gdraw.c) */
127
#define lSolid 0
128
#define lDash  (5 | (4<<4))
129
#define lShortDash  (3 | (4<<4))
130
#define lLongDash  (8 | (4<<4))
131
#define lDot   (1 | (4<<4))
132
#define lDashDot (5 | (4<<4) | (1<<8) | (4<<12))
133
#define lShortDashDot (3 | (4<<4) | (1<<8) | (4<<12))
134
#define lLongDashDot (8 | (4<<4) | (1<<8) | (4<<12))
135
#define lDashDotDot    (5 | (4<<4) | (1<<8) | (3<<12) | (1<<16) | (4<< 20))
136
#define lShortDashDotDot    (3 | (4<<4) | (1<<8) | (3<<12) | (1<<16) | (4<< 20))
137
#define lLongDashDotDot    (8 | (4<<4) | (1<<8) | (3<<12) | (1<<16) | (4<< 20))
138

    
139
rect  ggetcliprect(drawing d);
140
void  gsetcliprect(drawing d, rect r);
141
void  gbitblt(bitmap db, bitmap sb, point p, rect r);
142
void  gscroll(drawing d, point dp, rect r);
143
void  ginvert(drawing d, rect r);
144
rgb   ggetpixel(drawing d, point p);
145
void  gsetpixel(drawing d, point p, rgb c);
146
void  gdrawline(drawing d, int width, int style, rgb c, point p1, point p2,
147
                int fast, int lend, int ljoin, float lmitre);
148
void  gdrawrect(drawing d, int width, int style, rgb c, rect r, int fast,
149
                int lend, int ljoin, float lmitre);
150
void  gfillrect(drawing d, rgb fill, rect r);
151
void  gcopy(drawing d, drawing d2, rect r);
152
void  gcopyalpha(drawing d, drawing d2, rect r, int alpha);
153
void  gcopyalpha2(drawing d, image src, rect r);
154
void  gdrawellipse(drawing d, int width, rgb border, rect r, int fast,
155
                   int lend, int ljoin, float lmitre);
156
void  gfillellipse(drawing d, rgb fill, rect r);
157
void  gdrawpolyline(drawing d, int width, int style, rgb c,
158
                    point *p, int n, int closepath, int fast,
159
                    int lend, int ljoin, float lmitre);
160
#define gdrawpolygon(d,w,s,c,p,n,f,e,j,m) gdrawpolyline(d,w,s,c,p,n,1,f,e,j,m)
161
void  gsetpolyfillmode(drawing d, int oddeven);
162
void  gfillpolygon(drawing d, rgb fill, point *p, int n);
163
void  gfillpolypolygon(drawing d, rgb fill, point *p, int npoly, int *nper);
164
void  gdrawimage(drawing d, image img, rect dr, rect sr);
165
void  gmaskimage(drawing d, image img, rect dr, rect sr, image mask);
166
int   gdrawstr(drawing d, font f, rgb c, point p, const char *s);
167
void  gdrawstr1(drawing d, font f, rgb c, point p, const char *s, double hadj);
168
rect  gstrrect(drawing d, font f, const char *s);
169
point gstrsize(drawing d, font f, const char *s);
170
int   gstrwidth(drawing d ,font f, const char *s);
171
void  gcharmetric(drawing d, font f, int c, int *ascent, int *descent,
172
                  int *width);
173
font  gnewfont(drawing d, const char *face, int style, int size,
174
               double rot, int usePoints);
175
font  gnewfont2(drawing d, const char *face, int style, int size,
176
                double rot, int usePoints, int quality);
177
int   ghasfixedwidth(font f);
178
field newfield_no_border(const char *text, rect r);
179

    
180
int gdrawwcs(drawing d, font f, rgb c, point p, const wchar_t *s);
181
int gwcswidth(drawing d, font f, const wchar_t *s);
182

    
183
void gwcharmetric(drawing d, font f, int c, int *ascent, int *descent,
184
                  int *width);
185
void gwdrawstr1(drawing d, font f, rgb c, point p, const wchar_t *s, int cnt,
186
                double hadj);
187
int   gstrwidth1(drawing d ,font f, const char *s, int enc);
188

    
189
/* pixels */
190
int   devicewidth(drawing dev);
191
int   deviceheight(drawing dev);
192
/* mm */
193
int   devicewidthmm(drawing dev);
194
int   deviceheightmm(drawing dev);
195
/* pixels per inch */
196
int   devicepixelsx(drawing dev);
197
int   devicepixelsy(drawing dev);
198

    
199
int        isTopmost(window w);
200
void        BringToTop(window w, int stay); /* stay=0 for regular, 1 for topmost, 2 for toggle */
201
void *        getHandle(window w);
202
void         GA_msgWindow(window c, int type);
203

    
204

    
205
/* gbuttons.c */
206
/* horizontal, vertical and control scrollbar */
207
#define HWINSB 0
208
#define VWINSB 1
209
#define CONTROLSB 2
210
void        gchangescrollbar(scrollbar sb, int which, int where, int max,
211
                         int pagesize, int disablenoscroll);
212
void        gsetcursor(drawing d, cursor c);
213
control newtoolbar(int height);
214
button  newtoolbutton(image img, rect r, actionfn fn);
215
void        scrolltext(textbox c, int lines);
216
int        ggetkeystate(void);
217

    
218
void        scrollcaret(textbox c, int lines);
219
void    gsetmodified(textbox c, int modified);
220
int     ggetmodified(textbox c);
221
int getlinelength(textbox c);
222
void getcurrentline(textbox c, char *line, int length);
223
void getseltext(textbox c, char *text);
224
void setlimittext(textbox t, long limit);
225
long getlimittext(textbox t);
226
void checklimittext(textbox t, long n);
227
long getpastelength(void);
228
void textselectionex(control obj, long *start, long *end);
229
void selecttextex(control obj, long start, long end);
230

    
231
void finddialog(textbox t);
232
void replacedialog(textbox t);
233
int modeless_active(void);
234

    
235

    
236
/* menus.c */
237
void        remove_menu_item(menuitem obj);
238

    
239
/* events.c */
240
void toolbar_show(void);
241
void toolbar_hide(void);
242

    
243
#endif /* __GA__VERSION */