1 /* Copyright (C) 1994-2001, Ghostgum Software Pty Ltd. All rights reserved. 2 Portions Copyright (C) 1999 Aladdin Enterprises. All rights reserved. 3 4 This program is free software; you can redistribute it and/or modify it 5 under the terms of the GNU General Public License as published by the 6 Free Software Foundation; either version 2 of the License, or (at your 7 option) any later version. 8 9 This program is distributed in the hope that it will be useful, but 10 WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 General Public License for more details. 13 14 You should have received a copy of the GNU General Public License along 15 with this program; if not, write to the Free Software Foundation, Inc., 16 59 Temple Place, Suite 330, Boston, MA, 02111-1307. 17 18 */ 19 20 21 /* $Id: gsdll.h,v 1.3.2.2.2.1 2003/01/17 00:49:02 giles Exp $ */ 22 23 /* This interface is deprecated and will be removed in future 24 * ghostscript releases. Use the interface described in 25 * API.htm and iapi.h. 26 */ 27 28 29 #ifndef gsdll_INCLUDED 30 # define gsdll_INCLUDED 31 32 #include "iapi.h" 33 34 #ifdef __MACINTOSH__ 35 #define HWND char * 36 #include <QDOffscreen.h> 37 #pragma export on 38 #endif 39 40 #ifdef __WINDOWS__ 41 #define _Windows 42 #endif 43 44 #ifdef __IBMC__ 45 #define GSDLLCALLLINK _System 46 #else 47 #define GSDLLCALLLINK 48 #endif 49 50 /* global pointer to callback */ 51 typedef int (* GSDLLCALLLINK GSDLL_CALLBACK) (int, char *, unsigned long); 52 extern GSDLL_CALLBACK pgsdll_callback; 53 54 /* message values for callback */ 55 #define GSDLL_STDIN 1 /* get count characters to str from stdin */ 56 /* return number of characters read */ 57 #define GSDLL_STDOUT 2 /* put count characters from str to stdout */ 58 /* return number of characters written */ 59 #define GSDLL_DEVICE 3 /* device = str has been opened if count=1 */ 60 /* or closed if count=0 */ 61 #define GSDLL_SYNC 4 /* sync_output for device str */ 62 #define GSDLL_PAGE 5 /* output_page for device str */ 63 #define GSDLL_SIZE 6 /* resize for device str */ 64 /* LOWORD(count) is new xsize */ 65 /* HIWORD(count) is new ysize */ 66 #define GSDLL_POLL 7 /* Called from gp_check_interrupt */ 67 /* Can be used by caller to poll the message queue */ 68 /* Normally returns 0 */ 69 /* To abort gsdll_execute_cont(), return a */ 70 /* non zero error code until gsdll_execute_cont() */ 71 /* returns */ 72 73 /* return values from gsdll_init() */ 74 #define GSDLL_INIT_IN_USE 100 /* DLL is in use */ 75 #define GSDLL_INIT_QUIT 101 /* quit or EOF during init */ 76 /* This is not an error. */ 77 /* gsdll_exit() must not be called */ 78 79 80 /* DLL exported functions */ 81 /* for load time dynamic linking */ 82 GSDLLEXPORT int GSDLLAPI gsdll_revision(const char * * product, const char * * copyright, long * gs_revision, long * gs_revisiondate); 83 GSDLLEXPORT int GSDLLAPI gsdll_init(GSDLL_CALLBACK callback, HWND hwnd, int argc, char * * argv); 84 GSDLLEXPORT int GSDLLAPI gsdll_execute_begin(void); 85 GSDLLEXPORT int GSDLLAPI gsdll_execute_cont(const char * str, int len); 86 GSDLLEXPORT int GSDLLAPI gsdll_execute_end(void); 87 GSDLLEXPORT int GSDLLAPI gsdll_exit(void); 88 GSDLLEXPORT int GSDLLAPI gsdll_lock_device(unsigned char *device, int flag); 89 90 /* Function pointer typedefs */ 91 /* for run time dynamic linking */ 92 typedef int (GSDLLAPIPTR PFN_gsdll_revision)(const char ** product, 93 const char ** copyright, long * revision, long * revisiondate); 94 typedef int (GSDLLAPIPTR PFN_gsdll_init) (GSDLL_CALLBACK, HWND, int argc, char * * argv); 95 typedef int (GSDLLAPIPTR PFN_gsdll_execute_begin) (void); 96 typedef int (GSDLLAPIPTR PFN_gsdll_execute_cont) (const char * str, int len); 97 typedef int (GSDLLAPIPTR PFN_gsdll_execute_end) (void); 98 typedef int (GSDLLAPIPTR PFN_gsdll_exit) (void); 99 typedef int (GSDLLAPIPTR PFN_gsdll_lock_device) (unsigned char *, int); 100 101 #ifdef __MACINTOSH__ 102 #pragma export off 103 #endif 104 105 #endif /* gsdll_INCLUDED */ 106