10
28
#include <ustring.h>
30
static const char __svn_version[] =
31
"$Id: ffdummies.c 3278 2009-12-21 11:26:19Z taco $ "
32
"$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/luafontloader/src/ffdummies.c $";
13
35
char **gww_errors = NULL;
14
36
int gww_error_count = 0;
16
void gwwv_errors_free (void) {
18
if (gww_error_count>0) {
19
for (i=0;i<gww_error_count;i++) {
38
void gwwv_errors_free(void)
41
if (gww_error_count > 0) {
42
for (i = 0; i < gww_error_count; i++) {
29
static void LUAUI_IError(const char *format,...) {
51
__attribute__ ((format(printf, 1, 0)))
52
static void LUAUI_IError(const char *format, ...)
32
fprintf(stderr, "Internal Error: " );
33
vfprintf(stderr,format,ap);
56
char buffer[400], *str;
57
l = strlen("Internal Error: ");
58
snprintf(buffer, sizeof(buffer), "Internal Error: ");
60
vsnprintf(buffer+l, sizeof(buffer)-l, format, ap);
62
str = xstrdup((char *) buffer);
63
gww_errors = realloc(gww_errors, (gww_error_count + 2) * sizeof(char *));
64
if (gww_errors == NULL) {
65
perror("memory allocation failed");
68
gww_errors[gww_error_count] = str;
70
gww_errors[gww_error_count] = NULL;
37
static void LUAUI__LogError(const char *format,va_list ap) {
73
__attribute__ ((format(printf, 1, 0)))
74
static void LUAUI__LogError(const char *format, va_list ap)
38
76
char buffer[400], *str;
39
vsnprintf(buffer,sizeof(buffer),format,ap);
40
str = utf82def_copy(buffer);
41
gww_errors = realloc(gww_errors, (gww_error_count+2)*sizeof(char *));
42
if (gww_errors==NULL) {
43
perror("memory allocation failed");
77
vsnprintf(buffer, sizeof(buffer), format, ap);
78
str = xstrdup((char *) buffer);
79
gww_errors = realloc(gww_errors, (gww_error_count + 2) * sizeof(char *));
80
if (gww_errors == NULL) {
81
perror("memory allocation failed");
46
gww_errors[gww_error_count ] = str ;
48
gww_errors[gww_error_count ] = NULL;
84
gww_errors[gww_error_count] = str;
86
gww_errors[gww_error_count] = NULL;
51
89
/* this is not static because it is used by gwwiconv.c */
53
void LUAUI_LogError(const char *format,...) {
56
LUAUI__LogError(format,ap);
60
static void LUAUI_post_notice(const char *title,const char *statement,...) {
63
va_start(ap,statement);
64
LUAUI__LogError(statement,ap);
68
static void LUAUI_post_error(const char *title,const char *statement,...) {
71
va_start(ap,statement);
72
LUAUI__LogError(statement,ap);
91
__attribute__ ((format(printf, 1, 2)))
92
void LUAUI_LogError(const char *format, ...)
96
LUAUI__LogError(format, ap);
100
__attribute__ ((format(printf, 2, 3)))
101
static void LUAUI_post_notice(const char *title, const char *statement, ...)
105
va_start(ap, statement);
106
LUAUI__LogError(statement, ap);
110
__attribute__ ((format(printf, 2, 3)))
111
static void LUAUI_post_error(const char *title, const char *statement, ...)
115
va_start(ap, statement);
116
LUAUI__LogError(statement, ap);
76
120
static int LUAUI_ask(const char *title, const char **answers,
77
int def, int cancel,const char *question,...) {
85
static int LUAUI_choose(const char *title, const char **choices,int cnt, int def,
86
const char *question,...) {
94
static int LUAUI_choose_multiple(char *title, const char **choices,char *sel,
95
int cnt, char *buts[2], const char *question,...) {
121
int def, int cancel, const char *question, ...)
130
static int LUAUI_choose(const char *title, const char **choices, int cnt,
131
int def, const char *question, ...)
140
static int LUAUI_choose_multiple(char *title, const char **choices, char *sel,
141
int cnt, char *buts[2], const char *question,
105
153
static char *LUAUI_ask_string(const char *title, const char *def,
106
const char *question,...) {
110
return( (char *) def );
154
const char *question, ...)
159
return ((char *) def);
113
162
static char *LUAUI_open_file(const char *title, const char *defaultfile,
114
const char *initial_filter) {
116
(void)initial_filter;
163
const char *initial_filter)
166
(void) initial_filter;
121
171
static char *LUAUI_saveas_file(const char *title, const char *defaultfile,
122
const char *initial_filter) {
124
(void)initial_filter;
125
return( copy(defaultfile) );
128
static void LUAUI_progress_start(int delay, const char *title, const char *line1,
129
const char *line2, int tot, int stages) {
138
static void LUAUI_void_void_noop(void) {
141
static void LUAUI_void_int_noop(int useless) {
145
static int LUAUI_int_int_noop(int useless) {
150
static void LUAUI_void_str_noop(const char * useless) {
154
static int LUAUI_alwaystrue(void) {
158
static int LUAUI_DefaultStrokeFlags(void) {
159
return( sf_correctdir );
172
const char *initial_filter)
175
(void) initial_filter;
176
return (copy(defaultfile));
179
static void LUAUI_progress_start(int delay, const char *title,
180
const char *line1, const char *line2, int tot,
191
static void LUAUI_void_void_noop(void)
195
static void LUAUI_void_int_noop(int useless)
200
static int LUAUI_int_int_noop(int useless)
206
static void LUAUI_void_str_noop(const char *useless)
211
static int LUAUI_alwaystrue(void)
216
static int LUAUI_DefaultStrokeFlags(void)
218
return (sf_correctdir);
162
221
struct ui_interface luaui_interface = {
198
257
/* some bits and pieces */
200
int URLFromFile(char *url,FILE *from) {
259
int URLFromFile(char *url, FILE * from)
207
int pagewidth = 0, pageheight=0; /* In points */
208
char *printlazyprinter=NULL;
209
char *printcommand=NULL;
267
int pagewidth = 0, pageheight = 0; /* In points */
268
char *printlazyprinter = NULL;
269
char *printcommand = NULL;
210
270
int printtype = 0;
212
void ScriptPrint(FontViewBase *fv,int type,int32 *pointsizes,char *samplefile,
213
unichar_t *sample, char *outputfile) {
272
void ScriptPrint(FontViewBase * fv, int type, int32 * pointsizes,
273
char *samplefile, unichar_t * sample, char *outputfile)
222
int PdfDumpGlyphResources(void *pi, SplineChar *sc) {
283
int PdfDumpGlyphResources(void *pi, SplineChar * sc)
228
290
/* autotrace.c */
229
int autotrace_ask=0, mf_ask=0, mf_clearbackgrounds=0, mf_showerrors=0;
291
int autotrace_ask = 0, mf_ask = 0, mf_clearbackgrounds = 0, mf_showerrors = 0;
230
292
char *mf_args = NULL;
233
void *GetAutoTraceArgs(void) {
237
void SetAutoTraceArgs(void *a) {
241
void FVAutoTrace(FontViewBase *fv,int ask) {
245
SplineFont *SFFromMF(char *filename) {
293
int preferpotrace = 0;
295
void *GetAutoTraceArgs(void)
300
void SetAutoTraceArgs(void *a)
305
void FVAutoTrace(FontViewBase * fv, int ask)
311
SplineFont *SFFromMF(char *filename)
252
FILE *URLToTempFile(char *url,void *_lock) {
253
(void)_lock; (void)url;
254
ff_post_error(_("Could not parse URL"),_("FontForge only handles ftp and http URLs at the moment"));
319
FILE *URLToTempFile(char *url, void *_lock)
323
ff_post_error(_("Could not parse URL"),
324
_("FontForge only handles ftp and http URLs at the moment"));