home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 15
/
BUGCD1998_06.ISO
/
aplic
/
felixcad
/
fcaddata.z
/
FDT.H
< prev
next >
Wrap
C/C++ Source or Header
|
1997-11-13
|
20KB
|
429 lines
/****************************************************************************
(C) FELIX Computer Aided Technologies GmbH 1995-96
Module: Data type definitions and function prototypes for FDT
File: fdt.h
Author: R. Nuernberger
Created: Oct. 18, 1993
Changed:
****************************************************************************/
#ifndef _fdt_h
#define _fdt_h
#include "fdt_type.h"
#include "fdtcodes.h"
#include <time.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Byte Alignment 2 */
#pragma pack(2)
/* Useful definitions */
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifdef _WIN32
#define FDT_DLLEXPORT __declspec(dllexport)
#define EXPORT
#else
#define FDT_DLLEXPORT
#define EXPORT __far __pascal __export
#endif
#ifndef FDT_KERNEL
/* DLL-Entry-Procedure Macro */
#ifdef _WIN32
#define FDT_INIT \
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) \
{ \
switch (dwReason) \
{ \
case DLL_PROCESS_ATTACH: break;\
case DLL_PROCESS_DETACH: break;\
default: break;\
} \
return(TRUE);\
}
#else
#define FDT_INIT \
int EXPORT LibMain(HINSTANCE hInstance, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine) \
{ \
return(TRUE); \
} \
int FAR PASCAL WEP(int nParam) \
{ \
return(TRUE); \
}
#endif
#define MAX_FLX 4 /* 0 ... 3 */
#define MAX_VIEW 4 /* 0 ... 3 */
#endif /* #ifndef FDT_KERNEL */
typedef enum {
DB_HEAD, /* First entity in drawing database */
DB_END, /* Last entity in drawing database */
DB_NEXT, /* Next entity in drawing database */
DB_BEFORE, /* Previous entity in drawing database */
DB_CURRENT /* Current entity in drawing database */
} fdt_pos;
typedef struct tablet_rec {
char szMacro[133];
char szTabSectionID[133];
char szTabMenuID[133];
short TabRow;
short TabColumn;
} fdt_tablet_rec;
typedef struct fdt_flx_info {
time_t First_Date;
time_t Save_Date;
char szProjName[32];
char szDrNumber[32];
char szDrName[32];
char szDraftsman[32];
char szBem1[32];
char szBem2[32];
char szBem3[32];
} FDT_FLX_INFO;
/* Prototypes for application control */
FDT_DLLEXPORT int EXPORT fdt_app_init(void);
FDT_DLLEXPORT int EXPORT fdt_app_exit(void);
FDT_DLLEXPORT int EXPORT fdt_register(const char *, const char *);
FDT_DLLEXPORT int EXPORT fdt_register_param(const char *, const char *, unsigned long);
/* Interface to retrieve arguments from LISP or from command level */
FDT_DLLEXPORT int EXPORT fdt_xload(char *);
FDT_DLLEXPORT int EXPORT fdt_xunload(char *);
FDT_DLLEXPORT struct resbuf * EXPORT fdt_getargs(void);
FDT_DLLEXPORT int EXPORT fdt_retint(int);
FDT_DLLEXPORT int EXPORT fdt_retreal(fdt_real);
FDT_DLLEXPORT int EXPORT fdt_retpoint(const fdt_point);
FDT_DLLEXPORT int EXPORT fdt_retnil(void);
FDT_DLLEXPORT int EXPORT fdt_rett(void);
FDT_DLLEXPORT int EXPORT fdt_retvoid(void);
FDT_DLLEXPORT int EXPORT fdt_retstr(const char *);
FDT_DLLEXPORT int EXPORT fdt_retname(const fdt_name);
FDT_DLLEXPORT int EXPORT fdt_retlist(const struct resbuf *);
FDT_DLLEXPORT int EXPORT fdt_retval(const struct resbuf *);
FDT_DLLEXPORT int EXPORT fdt_invoke(const struct resbuf *, struct resbuf **);
FDT_DLLEXPORT struct resbuf * EXPORT fdt_loaded(void);
/* Get or set LISP symbol */
FDT_DLLEXPORT int EXPORT fdt_getsym(const char *, struct resbuf **);
FDT_DLLEXPORT int EXPORT fdt_putsym(const char *, struct resbuf *);
/* Display Alert dialog, Print error message */
FDT_DLLEXPORT int EXPORT fdt_alert (const char *);
FDT_DLLEXPORT void EXPORT fdt_fail(const char *);
/* Generate a result buffer element */
#ifdef _WIN32
FDT_DLLEXPORT struct resbuf * fdt_buildlist(int ,...);
#else
struct resbuf * _export _loadds _far _cdecl fdt_buildlist(int ,...);
#endif
FDT_DLLEXPORT struct resbuf * EXPORT fdt_newrb(int);
FDT_DLLEXPORT int EXPORT fdt_copyresbuf(const struct resbuf * ,struct resbuf **);
/* Release a result buffer and all associated elements */
FDT_DLLEXPORT int EXPORT fdt_relrb(struct resbuf *);
/* Execution of FCAD commands */
#ifdef _WIN32
FDT_DLLEXPORT int fdt_command(int, ...);
#else
int _export _loadds _far _cdecl fdt_command(int , ...);
#endif
FDT_DLLEXPORT int EXPORT fdt_cmd(const struct resbuf *);
/* Re-activate or de-activate FCAD command */
FDT_DLLEXPORT int EXPORT fdt_actcmd(char *);
FDT_DLLEXPORT int EXPORT fdt_delcmd(char *);
/* Get FCAD environment settings*/
FDT_DLLEXPORT int EXPORT fdt_fgetenv(char *, char *);
/* Allocate or release string memory */
FDT_DLLEXPORT char * EXPORT fdt_strmalloc(int);
FDT_DLLEXPORT void EXPORT fdt_strfree(char *);
FDT_DLLEXPORT void * EXPORT fdt_malloc(unsigned int);
FDT_DLLEXPORT void EXPORT fdt_free(void *);
/* Functions to test character */
FDT_DLLEXPORT int EXPORT fdt_isalpha (int);
FDT_DLLEXPORT int EXPORT fdt_isupper (int);
FDT_DLLEXPORT int EXPORT fdt_islower (int);
FDT_DLLEXPORT int EXPORT fdt_isdigit (int);
FDT_DLLEXPORT int EXPORT fdt_isxdigit(int);
FDT_DLLEXPORT int EXPORT fdt_isspace (int);
FDT_DLLEXPORT int EXPORT fdt_ispunct (int);
FDT_DLLEXPORT int EXPORT fdt_isalnum (int);
FDT_DLLEXPORT int EXPORT fdt_isprint (int);
FDT_DLLEXPORT int EXPORT fdt_isgraph (int);
FDT_DLLEXPORT int EXPORT fdt_iscntrl (int);
FDT_DLLEXPORT int EXPORT fdt_toupper (int);
FDT_DLLEXPORT int EXPORT fdt_tolower (int);
/* Read or Write system settings */
FDT_DLLEXPORT int EXPORT fdt_setvar (const char *, const struct resbuf *);
FDT_DLLEXPORT int EXPORT fdt_getvar (const char *, struct resbuf *);
/* Convert functions */
FDT_DLLEXPORT int EXPORT fdt_cvunit (fdt_real, const char *, const char *, fdt_real *);
FDT_DLLEXPORT int EXPORT fdt_angtos (fdt_real, int, int, char *);
FDT_DLLEXPORT int EXPORT fdt_rtos (fdt_real, int, int, char *);
FDT_DLLEXPORT int EXPORT fdt_angtof (const char *, int, fdt_real *);
FDT_DLLEXPORT int EXPORT fdt_distof (const char *, int, fdt_real *);
/* Wildcard pattern matching */
FDT_DLLEXPORT int EXPORT fdt_wcmatch(const char *, const char *);
/* Print a message or prompt */
FDT_DLLEXPORT int EXPORT fdt_prompt (const char *);
#ifdef _WIN32
FDT_DLLEXPORT int EXPORT fdt_printf(const char *, ...);
#else
int _export _loadds _far _cdecl fdt_printf(const char *, ...);
#endif
/* Window handling */
FDT_DLLEXPORT int EXPORT fdt_graphscr(void);
FDT_DLLEXPORT int EXPORT fdt_textscr (void);
/* Selection set functions */
FDT_DLLEXPORT int EXPORT fdt_ssget(const char *, const void *,
const fdt_point, const struct resbuf *,
fdt_name);
FDT_DLLEXPORT int EXPORT fdt_ssfree(const fdt_name);
FDT_DLLEXPORT int EXPORT fdt_sslength(const fdt_name, long *);
FDT_DLLEXPORT int EXPORT fdt_ssadd(const fdt_name, const fdt_name, fdt_name);
FDT_DLLEXPORT int EXPORT fdt_ssname(const fdt_name, long, fdt_name);
FDT_DLLEXPORT int EXPORT fdt_ssdbnr(const fdt_name, int *);
FDT_DLLEXPORT int EXPORT fdt_ssmemb(const fdt_name, const fdt_name);
FDT_DLLEXPORT int EXPORT fdt_ssdel(const fdt_name, fdt_name);
FDT_DLLEXPORT int EXPORT fdt_xformss(fdt_name, fdt_matrix);
FDT_DLLEXPORT int EXPORT fdti_ssinc(const fdt_name); /* used internally */
FDT_DLLEXPORT int EXPORT fdti_clear_sset(int); /* used internally */
/* normalizes a valid dxf-code to a value defined in fdtcodes.h (like RTSHORT, RTSTRING ...) */
FDT_DLLEXPORT int EXPORT fdt_norm_dxfcode(int);
/* Entity functions */
FDT_DLLEXPORT int EXPORT fdt_regapp(char *);
FDT_DLLEXPORT int EXPORT fdt_entnext(const fdt_name, fdt_name);
FDT_DLLEXPORT int EXPORT fdt_entpos(const fdt_pos, fdt_name);
FDT_DLLEXPORT int EXPORT fdt_entlast(fdt_name);
FDT_DLLEXPORT int EXPORT fdt_entdel(const fdt_name);
FDT_DLLEXPORT struct resbuf * EXPORT fdt_entget(const fdt_name);
FDT_DLLEXPORT struct resbuf * EXPORT fdt_entgetx(const fdt_name, const struct resbuf *);
FDT_DLLEXPORT int EXPORT fdt_entmod(struct resbuf *);
FDT_DLLEXPORT int EXPORT fdt_entmake(struct resbuf *);
FDT_DLLEXPORT int EXPORT fdt_entupd(fdt_name);
FDT_DLLEXPORT int EXPORT fdt_entcheck(fdt_name);
FDT_DLLEXPORT int EXPORT fdt_entsel(const char *, fdt_name, fdt_point);
FDT_DLLEXPORT int EXPORT fdt_nentsel(const char *, fdt_name, fdt_point,
fdt_matrix, struct resbuf **);
FDT_DLLEXPORT int EXPORT fdt_nentselp(const char *, fdt_name, fdt_point, int,
fdt_matrix, struct resbuf **);
FDT_DLLEXPORT int EXPORT fdt_hatch(const fdt_name, fdt_name);
/* Table functions */
FDT_DLLEXPORT struct resbuf * EXPORT fdt_tblnext(char *, int);
FDT_DLLEXPORT struct resbuf * EXPORT fdt_tblsearch(char *, char *);
FDT_DLLEXPORT int EXPORT fdt_tblmod(struct resbuf *);
FDT_DLLEXPORT int EXPORT fdt_tblmake(struct resbuf *);
FDT_DLLEXPORT int EXPORT fdt_tblset(const char *, const char *);
FDT_DLLEXPORT int EXPORT fdt_tblren(const char *, const char *, const char *);
FDT_DLLEXPORT int EXPORT fdt_tbldel(const char *, const char *);
FDT_DLLEXPORT int EXPORT fdt_tblpurge(const char *, const int);
FDT_DLLEXPORT int EXPORT fdt_tblcheckref(const char *, const char *);
/* Geometric functions */
FDT_DLLEXPORT int EXPORT fdt_inters (const fdt_point, const fdt_point,
const fdt_point, const fdt_point,
int, fdt_point);
FDT_DLLEXPORT fdt_real EXPORT fdt_angle (const fdt_point, const fdt_point);
FDT_DLLEXPORT fdt_real EXPORT fdt_distance(const fdt_point, const fdt_point);
FDT_DLLEXPORT void EXPORT fdt_polar (const fdt_point, fdt_real, fdt_real,
fdt_point);
/* Functions to get user input */
FDT_DLLEXPORT int EXPORT fdt_initget (int, const char *);
FDT_DLLEXPORT int EXPORT fdt_getangle (const fdt_point, const char *, fdt_real *);
FDT_DLLEXPORT int EXPORT fdt_getcorner(const fdt_point, const char *, fdt_point);
FDT_DLLEXPORT int EXPORT fdt_getdist (const fdt_point, const char *, fdt_real *);
FDT_DLLEXPORT int EXPORT fdt_getorient(const fdt_point, const char *, fdt_real *);
FDT_DLLEXPORT int EXPORT fdt_getpoint (const fdt_point, const char *, fdt_point);
FDT_DLLEXPORT int EXPORT fdt_getint (const char *, int *);
FDT_DLLEXPORT int EXPORT fdt_getkword (const char *, char *);
FDT_DLLEXPORT int EXPORT fdt_getreal (const char *, fdt_real *);
FDT_DLLEXPORT int EXPORT fdt_getinput (char *);
FDT_DLLEXPORT int EXPORT fdt_getstring(int , const char *, char *);
/* Test user break (canceling by ESC) */
FDT_DLLEXPORT int EXPORT fdt_usrbrk(void);
/* File handling */
FDT_DLLEXPORT int EXPORT fdt_findfile(const char *, char *);
FDT_DLLEXPORT int EXPORT fdt_getfiled(char *, char *, char *, int, struct resbuf *);
/* Drawing database manipulations */
FDT_DLLEXPORT int EXPORT fdt_handent(char *, fdt_name);
FDT_DLLEXPORT int EXPORT fdt_trans(const fdt_point, const struct resbuf *,
const struct resbuf *, int, fdt_point);
/* Graphic functions */
FDT_DLLEXPORT int EXPORT fdt_redraw(const fdt_name ent, int mode);
FDT_DLLEXPORT int EXPORT fdt_regen(void);
FDT_DLLEXPORT int EXPORT fdt_grread(int , int *, struct resbuf *);
FDT_DLLEXPORT int EXPORT fdt_capture_grread(void);
FDT_DLLEXPORT int EXPORT fdt_release_grread(void);
FDT_DLLEXPORT int EXPORT fdt_grdraw(fdt_point, fdt_point, int, int);
FDT_DLLEXPORT int EXPORT fdt_grtext(char *);
FDT_DLLEXPORT int EXPORT fdt_grclear(void);
FDT_DLLEXPORT int EXPORT fdt_osnap(fdt_point, char *, fdt_point);
FDT_DLLEXPORT int EXPORT fdt_osnap_mode(fdt_point, int, fdt_point);
FDT_DLLEXPORT int EXPORT fdt_appinters(fdt_point, fdt_point, fdt_point);
FDT_DLLEXPORT int EXPORT fdt_textbox(const struct resbuf *, fdt_point, fdt_point);
#ifdef _WIN32
FDT_DLLEXPORT int EXPORT fdt_draggen(const fdt_name, const char *, int,
int (*scnf)(fdt_point, fdt_matrix),fdt_point);
#else
int EXPORT fdt_draggen(const fdt_name, const char *, int,
int (EXPORT *scnf)(fdt_point, fdt_matrix),fdt_point);
#endif
FDT_DLLEXPORT int EXPORT fdt_init_dragmode(int, struct resbuf *);
FDT_DLLEXPORT int EXPORT fdt_exit_dragmode(void);
/* Read tablet menu informations */
FDT_DLLEXPORT int EXPORT fdt_tabletinfo(fdt_tablet_rec *);
/* Drawing file functions */
FDT_DLLEXPORT int EXPORT fdt_flxnew(const char *, const char *, short *);
FDT_DLLEXPORT int EXPORT fdt_flxopen(const char *, int , short *);
FDT_DLLEXPORT int EXPORT fdt_flxsave(void);
FDT_DLLEXPORT int EXPORT fdt_flxsaveas(const char*);
FDT_DLLEXPORT int EXPORT fdt_flxclose(int);
FDT_DLLEXPORT int EXPORT fdt_flxclosevport(void);
FDT_DLLEXPORT int EXPORT fdt_flxnames(struct resbuf **names);
FDT_DLLEXPORT int EXPORT fdt_getflxinfo(const char *, FDT_FLX_INFO *,
DWORD *, HGLOBAL *);
FDT_DLLEXPORT int EXPORT fdt_setflxinfo(const char *, FDT_FLX_INFO *);
FDT_DLLEXPORT int EXPORT fdt_getpreviewbitmap(const char *, HBITMAP *, HPALETTE *);
FDT_DLLEXPORT int EXPORT fdt_getcolorindex(HWND, int, int, int *);
/* Get or set current database and current viewport */
FDT_DLLEXPORT int EXPORT fdt_getactvport(short *, short *);
FDT_DLLEXPORT int EXPORT fdt_setactvport(const short, const short);
FDT_DLLEXPORT int EXPORT fdt_zoomext(short, short);
/* Get FCAD handles */
FDT_DLLEXPORT int EXPORT fdt_gethandle(HWND *, HWND *);
/* Compile FCAD fonts */
FDT_DLLEXPORT int EXPORT fdt_compfont(const char *, const char *);
/* Get or Set Cursor settings */
FDT_DLLEXPORT int EXPORT fdt_setcursor(short, struct cursordef);
FDT_DLLEXPORT int EXPORT fdt_getcursor(short, struct cursordef *);
/* Convert polyline to cubic B-spline */
FDT_DLLEXPORT int EXPORT fdt_poly2bspline(fdt_name, int);
FDT_DLLEXPORT int EXPORT fdt_bspline2poly(fdt_name);
/* Convert polyline to catmull room curve */
FDT_DLLEXPORT int EXPORT fdt_poly2catrom_2d(fdt_name, int, fdt_real);
FDT_DLLEXPORT int EXPORT fdt_catrom2poly_2d(fdt_name);
/* Basic input function similiar to fdt_grread */
FDT_DLLEXPORT struct resbuf * EXPORT fdt_input(char *, int);
/* Calculate bounding box of a single entity, a selection set, or of all entities */
FDT_DLLEXPORT int EXPORT fdt_boundingbox(fdt_name, fdt_point, fdt_point);
/* Calculate bounding polyline */
FDT_DLLEXPORT int EXPORT fdt_pcontour(fdt_name, int, fdt_point, fdt_name);
/* 3d-view setting */
FDT_DLLEXPORT int EXPORT fdt_set3dview(int, int, fdt_point, fdt_point, fdt_point, fdt_real);
/* WMF-Output */
FDT_DLLEXPORT int EXPORT fdt_wmfout(char *, int, int, char, fdt_point, fdt_point, int, int);
/* CallBack-Functions */
#ifdef _WIN32
FDT_DLLEXPORT typedef int (WINAPI * SELECTHOOKPROC)(const fdt_name);
FDT_DLLEXPORT typedef int (WINAPI * DBMODHOOKPROC)(const fdt_name);
FDT_DLLEXPORT typedef int (WINAPI * MOUSEHOOKPROC)(const fdt_point, const fdt_point);
#else
typedef int (EXPORT * SELECTHOOKPROC)(const fdt_name);
typedef int (EXPORT * DBMODHOOKPROC)(const fdt_name);
typedef int (EXPORT * MOUSEHOOKPROC)(const fdt_point, const fdt_point);
#endif
/* defines needed in callback-finctions */
#define FDT_NONE 0 // no callback for databasemodification activ
#define FDT_MODIFY 1 // callback from function thats modifies a entity
#define FDT_DELETE 2 // callback from function thats delets a entity
#define FDT_ADD 4 // callback from function thats adds a entity
FDT_DLLEXPORT int EXPORT fdt_setselecthook(SELECTHOOKPROC, char *);
FDT_DLLEXPORT int EXPORT fdt_delselecthook(SELECTHOOKPROC);
FDT_DLLEXPORT int EXPORT fdt_purgeselecthooklist(void);
FDT_DLLEXPORT int EXPORT fdt_setmousehook(MOUSEHOOKPROC);
FDT_DLLEXPORT int EXPORT fdt_delmousehook(void);
FDT_DLLEXPORT int EXPORT fdt_setdbmodhook(DBMODHOOKPROC, char *);
FDT_DLLEXPORT int EXPORT fdt_deldbmodhook(DBMODHOOKPROC);
FDT_DLLEXPORT int EXPORT fdt_purgedbmodhooklist(void);
FDT_DLLEXPORT int EXPORT fdt_entnext_dbhook(fdt_name, fdt_name);
FDT_DLLEXPORT struct resbuf * EXPORT fdt_entget_dbhook(fdt_name);
FDT_DLLEXPORT int EXPORT fdt_entmod_dbhook(struct resbuf *);
FDT_DLLEXPORT int EXPORT fdt_entmod_type(void);
FDT_DLLEXPORT int EXPORT fdt_isselecthook(void);
FDT_DLLEXPORT int EXPORT fdt_isdbmodhook(void);
/* Notifies all permanent loaded applications */
FDT_DLLEXPORT int EXPORT fdt_call_notify_app(int, struct resbuf *);
FDT_DLLEXPORT int EXPORT fdti_notify(int, char *); /* used internally */
/* Sets help for external command */
FDT_DLLEXPORT int EXPORT fdt_setfunhelp(char *, char *, char *);
/* Functions to manipulat image libraries */
FDT_DLLEXPORT int EXPORT fdt_addimage2lib(LPCSTR, LPCSTR, LPCSTR, WORD);
FDT_DLLEXPORT int EXPORT fdt_delimagefromlib(LPCSTR, LPCSTR);
FDT_DLLEXPORT WORD EXPORT fdt_getimagetype(LPCSTR, LPCSTR);
/* Reset Byte Alignment */
#pragma pack()
#ifdef __cplusplus
}
#endif
#endif
/* end of file */