00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _MT_GEMLIB_X_H_
00011 #define _MT_GEMLIB_X_H_
00012
00013 #ifndef _MT_GEMLIB_H_
00014 #include <mt_gem.h>
00015 #endif
00016
00017 __BEGIN_DECLS
00018
00019
00020
00021
00022
00023
00025 typedef struct
00026 {
00027 short mwhich;
00028 short mx;
00029 short my;
00030 short mbutton;
00031 short kstate;
00032 short key;
00033 short mclicks;
00034 short reserved[9];
00035 short msg[16];
00036 } EVNT;
00037
00038
00042 void mt_EVNT_multi( short evtypes, short nclicks, short bmask, short bstate,
00043 const MOBLK *m1, const MOBLK *m2, unsigned long ms, EVNT *event, short *global_aes );
00044
00047
00048
00049
00050
00056 typedef struct
00057 {
00058 char scancode;
00059 char nclicks;
00060 short objnr;
00061 } SCANX;
00062
00064 typedef struct
00065 {
00066 SCANX *unsh;
00067 SCANX *shift;
00068 SCANX *ctrl;
00069 SCANX *alt;
00070 void *resvd;
00071 } XDO_INF;
00072
00075 struct POPUP_INIT_args
00076 {
00077 OBJECT *tree;
00078 short scrollpos;
00079 short nlines;
00080 void *param;
00081 };
00082
00083 short mt_form_popup (OBJECT *tree, short x, short y, short * global);
00084 short mt_form_wbutton (OBJECT *fo_btree, short fo_bobject, short fo_bclicks, short *fo_bnxtobj, short whandle, short * global);
00085 short mt_form_wkeybd (OBJECT *fo_ktree, short fo_kobject, short fo_kobnext, short fo_kchar, short *fo_knxtobject, short *fo_knxtchar, short whandle, short * global);
00086 short mt_form_xdial (short fo_diflag, short fo_dilittlx, short fo_dilittly, short fo_dilittlw, short fo_dilittlh, short fo_dibigx, short fo_dibigy, short fo_dibigw, short fo_dibigh, void **flydial, short * global);
00087 short mt_form_xdial_grect (short fo_diflag, const GRECT *fo_dilittl, const GRECT *fo_dibig, void **flydial, short * global);
00088 short mt_form_xdo (OBJECT *tree, short startob, short *lastcrsr, XDO_INF *tabs, void *flydial, short * global);
00089 short mt_form_xerr (long errcode, char *errfile, short * global);
00090 short mt_xfrm_popup (OBJECT *tree, short x, short y, short firstscrlob, short lastscrlob, short nlines,
00091 void __CDECL (*init)(struct POPUP_INIT_args),
00092 void *param, short *lastscrlpos, short * global);
00095
00096
00097
00098
00102 void mt_objc_wchange (OBJECT *tree, short obj, short new_state, GRECT *clip, short whandle, short * global);
00103 void mt_objc_wdraw (OBJECT *tree, short start, short depth, GRECT *clip, short whandle, short * global);
00104 short mt_objc_wedit (OBJECT *tree, short obj, short key, short *idx, short kind, short whandle, short * global);
00105 short mt_objc_xedit (OBJECT *tree, short obj, short key, short *xpos, short subfn, GRECT *r, short * global);
00109
00110
00111
00112
00118 typedef void *FNT_DIALOG;
00119
00122 struct UTXT_FN_args
00123 {
00124 short x;
00125 short y;
00126 short *clip_rect;
00127 long id;
00128 long pt;
00129 long ratio;
00130 char *string;
00131 };
00132
00134 typedef void __CDECL (*UTXT_FN)(struct UTXT_FN_args);
00135
00137 typedef struct _fnts_item FNTS_ITEM;
00138
00140 struct _fnts_item
00141 {
00142 FNTS_ITEM *next;
00143 UTXT_FN display;
00144 long id;
00145 short index;
00146 char mono;
00147 char outline;
00148 short npts;
00149 char *full_name;
00150 char *family_name;
00151 char *style_name;
00152 char *pts;
00153 long reserved[4];
00154 };
00155
00156
00157 #define FNTS_BTMP 1
00158 #define FNTS_OUTL 2
00159 #define FNTS_MONO 4
00160 #define FNTS_PROP 8
00162
00163 #define FNTS_3D 1
00165
00166 #define FNTS_SNAME 0x01
00167 #define FNTS_SSTYLE 0x02
00168 #define FNTS_SSIZE 0x04
00169 #define FNTS_SRATIO 0x08
00171 #define FNTS_CHNAME 0x0100
00172 #define FNTS_CHSTYLE 0x0200
00173 #define FNTS_CHSIZE 0x0400
00174 #define FNTS_CHRATIO 0x0800
00175 #define FNTS_RATIO 0x1000
00176 #define FNTS_BSET 0x2000
00177 #define FNTS_BMARK 0x4000
00179
00180 #define FNTS_CANCEL 1
00181 #define FNTS_OK 2
00182 #define FNTS_SET 3
00183 #define FNTS_MARK 4
00184 #define FNTS_OPT 5
00185 #define FNTS_OPTION FNTS_OPT
00187 short mt_fnts_add (FNT_DIALOG *fnt_dialog, FNTS_ITEM *user_fonts, short *global);
00188 short mt_fnts_close (FNT_DIALOG *fnt_dialog, short *x, short *y, short *global);
00189 FNT_DIALOG *mt_fnts_create (short vdi_handle, short no_fonts, short font_flags, short dialog_flags, char *sample, char *opt_button, short *global);
00190 short mt_fnts_delete (FNT_DIALOG *fnt_dialog, short vdi_handle, short *global);
00191 short mt_fnts_do (FNT_DIALOG *fnt_dialog, short button_flags, long id_in, long pt_in, long ratio_in, short *check_boxes, long *id, long *pt, long *ratio, short *global);
00192 short mt_fnts_evnt (FNT_DIALOG *fnt_dialog, EVNT *events, short *button, short *check_boxes, long *id, long *pt, long *ratio, short *global);
00193 short mt_fnts_get_info (FNT_DIALOG *fnt_dialog, long id, short *mono, short *outline, short *global);
00194 short mt_fnts_get_name (FNT_DIALOG *fnt_dialog, long id, char *full_name, char *family_name, char *style_name, short *global);
00195 short mt_fnts_get_no_styles (FNT_DIALOG *fnt_dialog, long id, short *global);
00196 long mt_fnts_get_style (FNT_DIALOG *fnt_dialog, long id, short __index, short *global);
00197 short mt_fnts_open (FNT_DIALOG *fnt_dialog, short button_flags, short x, short y, long id, long pt, long ratio, short *global);
00198 void mt_fnts_remove (FNT_DIALOG *fnt_dialog, short *global);
00199 short mt_fnts_update (FNT_DIALOG *fnt_dialog, short button_flags, long id, long pt, long ratio, short *global);
00202
00203
00204
00205
00206 #ifndef GEMLIB_XATTR
00207
00208
00209
00210 # if defined(__TOS) || defined(_file_h_) || defined(_filesys_h_)
00211 # define GEMLIB_XATTR XATTR
00212 # else
00213 # define GEMLIB_XATTR void
00214 # endif
00215 #endif
00216
00222 typedef short __CDECL (*XFSL_FILTER)(char *path, char *name, GEMLIB_XATTR *xattr);
00223
00224
00225 #define SORTBYNAME 0
00226 #define SORTBYDATE 1
00227 #define SORTBYSIZE 2
00228 #define SORTBYTYPE 3
00229 #define SORTBYNONE 4
00230 #define SORTDEFAULT -1
00232
00233 #define DOSMODE 1
00234 #define NFOLLOWSLKS 2
00235 #define GETMULTI 8
00237
00238 #define SHOW8P3 1
00240 short mt_fslx_close (void *fsd, short *global);
00241 void * mt_fslx_do (char *title, char *path, short pathlen, char *fname, short fnamelen, char *patterns, XFSL_FILTER filter, char *paths, short *sort_mode, short flags, short *button, short *nfiles, char **pattern, short *global);
00242 short mt_fslx_evnt (void *fsd, EVNT *events, char *path, char *fname, short *button, short *nfiles, short *sort_mode, char **pattern, short *global);
00243 short mt_fslx_getnxtfile (void *fsd, char *fname, short *global);
00244 void * mt_fslx_open (char *title, short x, short y, short *handle, char *path, short pathlen, char *fname, short fnamelen, char *patterns, XFSL_FILTER filter, char *paths, short sort_mode, short flags, short *global);
00245 short mt_fslx_set_flags (short flags, short *oldval, short *global);
00248
00249
00250
00251
00257 typedef void *PRN_DIALOG;
00258
00259 typedef struct _prn_tray PRN_TRAY;
00260 typedef struct _media_size MEDIA_SIZE;
00261 typedef struct _media_type MEDIA_TYPE;
00262 typedef struct _prn_mode PRN_MODE;
00263 typedef struct _prn_entry PRN_ENTRY;
00264 typedef struct _dither_mode DITHER_MODE;
00265 typedef struct _drv_entry DRV_ENTRY;
00266 typedef struct _pdlg_sub PDLG_SUB;
00267 typedef struct _prn_settings PRN_SETTINGS;
00270 struct _prn_tray
00271 {
00272 PRN_TRAY *next;
00273 long tray_id;
00274 char name[32];
00275 };
00276
00278 struct _media_size
00279 {
00280 MEDIA_SIZE *next;
00281 long size_id;
00282 char name[32];
00283 };
00284
00286 struct _media_type
00287 {
00288 MEDIA_TYPE *next;
00289 long type_id;
00290 char name[32];
00291 };
00292
00294 struct _prn_mode
00295 {
00296 PRN_MODE *next;
00297 long mode_id;
00298 short hdpi;
00299 short vdpi;
00300 long mode_capabilities;
00301 long color_capabilities;
00302 long dither_flags;
00305 MEDIA_TYPE *paper_types;
00306 long reserved;
00307 char name[32];
00308 };
00309
00310
00311 #define PRN_STD_SUBS 0x0001
00312 #define PRN_FSM_SUBS 0x0002
00313 #define PRN_QD_SUBS 0x0004
00316 typedef long __CDECL (*PRN_SWITCH)(DRV_ENTRY *drivers, PRN_SETTINGS *settings, PRN_ENTRY *old_printer, PRN_ENTRY *new_printer);
00317
00319 struct _prn_entry
00320 {
00321 PRN_ENTRY *next;
00322 long length;
00323 long format;
00324 long reserved;
00325 short driver_id;
00326 short driver_type;
00327 long printer_id;
00328 long printer_capabilities;
00329 long reserved1;
00330 long sub_flags;
00331 PDLG_SUB *sub_dialogs;
00332 PRN_SWITCH setup_panel;
00333 PRN_SWITCH close_panel;
00334 PRN_MODE *modes;
00335 MEDIA_SIZE *papers;
00336 PRN_TRAY *input_trays;
00337 PRN_TRAY *output_trays;
00338 char name[32];
00339 };
00340
00342 struct _dither_mode
00343 {
00344 DITHER_MODE *next;
00345 long length;
00346 long format;
00347 long reserved;
00348 long dither_id;
00349 long color_modes;
00350 long reserved1;
00351 long reserved2;
00352 char name[32];
00353 };
00354
00356 typedef struct
00357 {
00358 long magic;
00359 long length;
00360 long format;
00361 long reserved;
00362 short driver_id;
00363 short driver_type;
00364 long reserved1;
00365 long reserved2;
00366 long reserved3;
00367 PRN_ENTRY *printers;
00368 DITHER_MODE *dither_modes;
00369 long reserved4;
00370 long reserved5;
00371 long reserved6;
00372 long reserved7;
00373 long reserved8;
00374 long reserved9;
00375 char device[128];
00376 } DRV_INFO;
00377
00379 struct _drv_entry
00380 {
00381 DRV_ENTRY *next;
00382 };
00383
00384 #define PDLG_CHG_SUB 0x80000000L
00385 #define PDLG_IS_BUTTON 0x40000000L
00387 #define PDLG_PREBUTTON 0x20000000L
00388 #define PDLG_PB_OK 1
00389 #define PDLG_PB_CANCEL 2
00390 #define PDLG_PB_DEVICE 3
00392 #define PDLG_BUT_OK (PDLG_PREBUTTON + PDLG_PB_OK)
00393 #define PDLG_BUT_CNCL (PDLG_PREBUTTON + PDLG_PB_CANCEL)
00394 #define PDLG_BUT_DEV (PDLG_PREBUTTON + PDLG_PB_DEVICE)
00397 typedef long __CDECL (*PDLG_INIT)(PRN_SETTINGS *settings, PDLG_SUB *sub);
00398
00401 struct PDLG_HNDL_args
00402 {
00403 PRN_SETTINGS *settings;
00404 PDLG_SUB *sub;
00405 short exit_obj;
00406 };
00407
00409 typedef long __CDECL (*PDLG_HNDL)(struct PDLG_HNDL_args);
00410
00412 typedef long __CDECL (*PDLG_RESET)(PRN_SETTINGS *settings, PDLG_SUB *sub);
00413
00415 struct _pdlg_sub
00416 {
00417 PDLG_SUB *next;
00418 long length;
00419 long format;
00420 long reserved;
00421 void *drivers;
00422 short option_flags;
00423 short sub_id;
00425 void *dialog;
00427 OBJECT *tree;
00428 short index_offset;
00429 short reserved1;
00430 long reserved2;
00431 long reserved3;
00432 long reserved4;
00433 PDLG_INIT init_dlg;
00434 PDLG_HNDL do_dlg;
00435 PDLG_RESET reset_dlg;
00436 long reserved5;
00437 OBJECT *sub_icon;
00438 OBJECT *sub_tree;
00440 long reserved6;
00441 long reserved7;
00442 long private1;
00443 long private2;
00444 long private3;
00445 long private4;
00446 };
00447
00448
00449
00450
00451
00452 #define CC_MONO 0x0001
00453 #define CC_4_GREY 0x0002
00454 #define CC_8_GREY 0x0004
00455 #define CC_16_GREY 0x0008
00456 #define CC_256_GREY 0x0010
00457 #define CC_32K_GREY 0x0020
00458 #define CC_65K_GREY 0x0040
00459 #define CC_16M_GREY 0x0080
00461 #define CC_2_COLOR 0x0100
00462 #define CC_4_COLOR 0x0200
00463 #define CC_8_COLOR 0x0400
00464 #define CC_16_COLOR 0x0800
00465 #define CC_256_COLOR 0x1000
00466 #define CC_32K_COLOR 0x2000
00467 #define CC_65K_COLOR 0x4000
00468 #define CC_16M_COLOR 0x8000
00470 #define NO_CC_BITS 16
00472
00473
00474
00475 #define DC_NONE 0
00476 #define DC_FLOYD 1
00477 #define NO_DC_BITS 1
00479
00480
00481
00482 #define PC_FILE 0x0001
00483 #define PC_SERIAL 0x0002
00484 #define PC_PARALLEL 0x0004
00485 #define PC_ACSI 0x0008
00486 #define PC_SCSI 0x0010
00488 #define PC_BACKGROUND 0x0080
00490 #define PC_SCALING 0x0100
00491 #define PC_COPIES 0x0200
00493
00494
00495
00496 #define MC_PORTRAIT 0x0001
00497 #define MC_LANDSCAPE 0x0002
00498 #define MC_REV_PTRT 0x0004
00499 #define MC_REV_LNDSCP 0x0008
00500 #define MC_ORIENTATION 0x000f
00502 #define MC_SLCT_CMYK 0x0400
00503 #define MC_CTRST_BRGHT 0x0800
00505
00506
00507
00508 #define PLANE_BLACK 0x0001
00509 #define PLANE_YELLOW 0x0002
00510 #define PLANE_MAGENTA 0x0004
00511 #define PLANE_CYAN 0x0008
00514
00515 #define DM_BG_PRINTING 0x0001
00517
00518
00519
00520 #define PG_EVEN_PAGES 0x0001
00521 #define PG_ODD_PAGES 0x0002
00523
00524 #define PG_MIN_PAGE 1
00525 #define PG_MAX_PAGE 9999
00527
00528 #define PG_UNKNOWN 0x0000
00529 #define PG_PORTRAIT 0x0001
00530 #define PG_LANDSCAPE 0x0002
00551 struct _prn_settings
00552 {
00553 long magic;
00554 long length;
00555 long format;
00556 long reserved;
00558 long page_flags;
00559 short first_page;
00560 short last_page;
00561 short no_copies;
00562 short orientation;
00563 long scale;
00565 short driver_id;
00566 short driver_type;
00567 long driver_mode;
00568 long reserved1;
00569 long reserved2;
00571 long printer_id;
00572 long mode_id;
00573 short mode_hdpi;
00574 short mode_vdpi;
00575 long quality_id;
00578 long color_mode;
00579 long plane_flags;
00581 long dither_mode;
00582 long dither_value;
00584 long size_id;
00585 long type_id;
00586 long input_id;
00587 long output_id;
00589 long contrast;
00591 long brightness;
00593 long reserved3;
00594 long reserved4;
00596 long reserved5;
00597 long reserved6;
00598 long reserved7;
00599 long reserved8;
00601 char device[128];
00603 struct
00604 {
00605 char inside[120];
00606 } mac_settings;
00607 };
00608
00609
00610
00611 #define PDLG_3D 0x0001
00613
00614 #define PDLG_PREFS 0x0000
00615 #define PDLG_PRINT 0x0001
00617 #define PDLG_ALWAYS_COPIES 0x0010
00618 #define PDLG_ALWAYS_ORIENT 0x0020
00619 #define PDLG_ALWAYS_SCALE 0x0040
00621 #define PDLG_EVENODD 0x0100
00623
00624 #define PDLG_CANCEL 1
00625 #define PDLG_OK 2
00627 short mt_pdlg_add_printers (PRN_DIALOG *prn_dialog, DRV_INFO *drv_info, short *global);
00628 short mt_pdlg_add_sub_dialogs (PRN_DIALOG *prn_dialog, PDLG_SUB *sub_dialogs, short *global);
00629 short mt_pdlg_close (PRN_DIALOG *prn_dialog, short *x, short *y, short *global);
00630 PRN_DIALOG * mt_pdlg_create (short dialog_flags, short *global);
00631 short mt_pdlg_delete (PRN_DIALOG *prn_dialog, short *global);
00632 short mt_pdlg_dflt_settings (PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, short *global);
00633 short mt_pdlg_do (PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, char *document_name, short option_flags, short *global);
00634 short mt_pdlg_evnt (PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, EVNT *events, short *button, short *global);
00635 short mt_pdlg_free_settings (PRN_SETTINGS *settings, short *global);
00636 long mt_pdlg_get_setsize (short *global);
00637 PRN_SETTINGS * mt_pdlg_new_settings (PRN_DIALOG *prn_dialog, short *global);
00638 short mt_pdlg_open (PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, char *document_name, short option_flags, short x, short y, short *global);
00639 short mt_pdlg_remove_printers (PRN_DIALOG *prn_dialog, short *global);
00640 short mt_pdlg_remove_sub_dialogs (PRN_DIALOG *prn_dialog, short *global);
00641 short mt_pdlg_save_default_settings(PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, short *global);
00642 short mt_pdlg_update (PRN_DIALOG *prn_dialog, char *document_name, short *global);
00643 short mt_pdlg_use_settings (PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, short *global);
00644 short mt_pdlg_validate_settings (PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, short *global);
00648
00649
00650
00651
00657 typedef void * LIST_BOX;
00658
00659 typedef struct lbox_item LBOX_ITEM;
00662 struct lbox_item
00663 {
00664 LBOX_ITEM *next;
00665 short selected;
00667 short data1;
00668 void *data2;
00669 void *data3;
00671 };
00672
00674 struct SLCT_ITEM_args
00675 {
00676 LIST_BOX *box;
00677 OBJECT *tree;
00678 struct lbox_item *item;
00679 void *user_data;
00680 short obj_index;
00681 short last_state;
00682 };
00683
00685 struct SET_ITEM_args
00686 {
00687 LIST_BOX *box;
00688 OBJECT *tree;
00689 struct lbox_item *item;
00690 short obj_index;
00691 void *user_data;
00692 GRECT *rect;
00693 short first;
00694 };
00695
00696 typedef void __CDECL (*SLCT_ITEM)(struct SLCT_ITEM_args);
00697 typedef short __CDECL (*SET_ITEM)(struct SET_ITEM_args);
00699 #define LBOX_VERT 1
00700 #define LBOX_AUTO 2
00701 #define LBOX_AUTOSLCT 4
00702 #define LBOX_REAL 8
00703 #define LBOX_SNGL 16
00704 #define LBOX_SHFT 32
00705 #define LBOX_TOGGLE 64
00706 #define LBOX_2SLDRS 128
00708 LIST_BOX * mt_lbox_create (OBJECT *tree, SLCT_ITEM slct, SET_ITEM set,
00709 LBOX_ITEM *items, short visible_a, short first_a,
00710 short *ctrl_objs, short *objs, short flags,
00711 short pause_a, void *user_data, void *dialog,
00712 short visible_b, short first_b, short entries_b,
00713 short pause_b, short *global);
00714 void mt_lbox_update (LIST_BOX *box, GRECT *rect, short *global);
00715 short mt_lbox_do (LIST_BOX *box, short obj, short *global);
00716 short mt_lbox_delete (LIST_BOX *box, short *global);
00717 short mt_lbox_cnt_items (LIST_BOX *box, short *global);
00718 OBJECT * mt_lbox_get_tree (LIST_BOX *box, short *global);
00719 short mt_lbox_get_visible (LIST_BOX *box, short *global);
00720 void * mt_lbox_get_udata (LIST_BOX *box, short *global);
00721 short mt_lbox_get_afirst (LIST_BOX *box, short *global);
00722 short mt_lbox_get_slct_idx (LIST_BOX *box, short *global);
00723 LBOX_ITEM * mt_lbox_get_items (LIST_BOX *box, short *global);
00724 LBOX_ITEM * mt_lbox_get_item (LIST_BOX *box, short n, short *global);
00725 LBOX_ITEM * mt_lbox_get_slct_item (LIST_BOX *box, short *global);
00726 short mt_lbox_get_idx (LBOX_ITEM *items, LBOX_ITEM *search, short *global);
00727 short mt_lbox_get_bvis (LIST_BOX *box, short *global);
00728 short mt_lbox_get_bentries (LIST_BOX *box, short *global);
00729 short mt_lbox_get_bfirst (LIST_BOX *box, short *global);
00730 void mt_lbox_set_asldr (LIST_BOX *box, short first, GRECT *rect, short *global);
00731 void mt_lbox_set_items (LIST_BOX *box, LBOX_ITEM *items, short *global);
00732 void mt_lbox_free_items (LIST_BOX *box, short *global);
00733 void mt_lbox_free_list (LBOX_ITEM *items, short *global);
00734 void mt_lbox_ascroll_to (LIST_BOX *box, short first, GRECT *box_rect,
00735 GRECT *slider_rect, short *global);
00736 void mt_lbox_set_bsldr (LIST_BOX *box, short first, GRECT *rect, short *global);
00737 void mt_lbox_set_bentries (LIST_BOX *box, short entries, short *global);
00738 void mt_lbox_bscroll_to (LIST_BOX *box, short first, GRECT *box_rect,
00739 GRECT *slider_rect, short *global);
00740
00741
00742 #define mt_lbox_get_avis mt_lbox_get_visible
00743 #define mt_lbox_get_first mt_lbox_get_afirst
00744 #define mt_lbox_set_slider mt_lbox_set_asldr
00745 #define mt_lbox_scroll_to mt_lbox_ascroll_to
00748
00749
00750
00751
00758 typedef void * DIALOG;
00759
00761 struct HNDL_OBJ_args
00762 {
00763 DIALOG *dialog;
00764 EVNT *events;
00765 short obj;
00766 short clicks;
00767 void *data;
00768 };
00769
00847 typedef short __CDECL (*HNDL_OBJ)(struct HNDL_OBJ_args);
00848
00849 DIALOG * mt_wdlg_create (HNDL_OBJ handle_exit, OBJECT *tree, void *user_data, short code, void *data, short flags, short *global);
00850 short mt_wdlg_open (DIALOG *dialog, char *title, short kind, short x, short y, short code, void *data, short *global);
00851 short mt_wdlg_close (DIALOG *dialog, short *x, short *y, short *global);
00852 short mt_wdlg_delete (DIALOG *dialog, short *global);
00853 short mt_wdlg_get_tree (DIALOG *dialog, OBJECT **tree, GRECT *r, short *global);
00854 short mt_wdlg_get_edit (DIALOG *dialog, short *cursor, short *global);
00855 void * mt_wdlg_get_udata (DIALOG *dialog, short *global);
00856 short mt_wdlg_get_handle (DIALOG *dialog, short *global);
00857 short mt_wdlg_set_edit (DIALOG *dialog, short obj, short *global);
00858 short mt_wdlg_set_tree (DIALOG *dialog, OBJECT *tree, short *global);
00859 short mt_wdlg_set_size (DIALOG *dialog, GRECT *size, short *global);
00860 short mt_wdlg_set_iconify (DIALOG *dialog, GRECT *g, char *title, OBJECT *tree, short obj, short *global);
00861 short mt_wdlg_set_uniconify (DIALOG *dialog, GRECT *g, char *title, OBJECT *tree, short *global);
00862 short mt_wdlg_evnt (DIALOG *dialog, EVNT *events, short *global );
00863 void mt_wdlg_redraw (DIALOG *dialog, GRECT *rect, short obj, short depth, short *global);
00864
00865
00866 #define WDLG_BKGD 1
00868
00869 #define HNDL_INIT -1
00870 #define HNDL_MESG -2
00871 #define HNDL_CLSD -3
00872 #define HNDL_OPEN -5
00873 #define HNDL_EDIT -6
00874 #define HNDL_EDDN -7
00875 #define HNDL_EDCH -8
00876 #define HNDL_MOVE -9
00877 #define HNDL_TOPW -10
00878 #define HNDL_UNTP -11
00882
00883
00884
00885
00889 typedef void XEDITINFO;
00890 XEDITINFO * mt_edit_create (short *global);
00891 void mt_edit_delete (XEDITINFO *xi, short *global);
00892 short mt_edit_open (OBJECT *tree, short obj, short *global);
00893 void mt_edit_close (OBJECT *tree, short obj, short *global);
00894 short mt_edit_cursor (OBJECT *tree, short obj, short whdl, short show, short *global);
00895 short mt_edit_evnt (OBJECT *tree, short obj, short whdl, EVNT *ev, long *errc, short *global);
00896 short mt_edit_get_buf (OBJECT *tree, short obj, char **buf, long *buflen, long *txtlen, short *global);
00897 short mt_edit_get_format (OBJECT *tree, short obj, short *tabwidth, short *autowrap, short *global);
00898 short mt_edit_get_colour (OBJECT *tree, short obj, short *tcolour, short *bcolour, short *global);
00900 #define mt_edit_get_color mt_edit_get_colour
00901 short mt_edit_get_cursor (OBJECT *tree, short obj, char **cursorpos, short *global);
00902 short mt_edit_get_font (OBJECT *tree, short obj, short *fontID, short *fontH, short *fontPix, short *mono, short *global);
00903 void mt_edit_set_buf (OBJECT *tree, short obj, char *buf, long buflen, short *global);
00904 void mt_edit_set_format (OBJECT *tree, short obj, short tabwidth, short autowrap, short *global);
00905 void mt_edit_set_font (OBJECT *tree, short obj, short fontID, short fontH, short fontPix, short mono, short *global);
00906 void mt_edit_set_colour (OBJECT *tree, short obj, short tcolour, short bcolour, short *global);
00908 #define mt_edit_set_color mt_edit_set_colour
00909 void mt_edit_set_cursor (OBJECT *tree, short obj, char *cursorpos, short *global);
00910 short mt_edit_resized (OBJECT *tree, short obj, short *oldrh, short *newrh, short *global);
00911 short mt_edit_get_dirty (OBJECT *tree, short obj, short *global);
00912 void mt_edit_set_dirty (OBJECT *tree, short obj, short dirty, short *global);
00913 void mt_edit_get_sel (OBJECT *tree, short obj, char **bsel, char **esel, short *global);
00914 void mt_edit_get_pos (OBJECT *tree, short obj, short *xscroll, long *yscroll, char **cyscroll, char **cursorpos, short *cx, short *cy, short *global);
00915 void mt_edit_set_pos (OBJECT *tree, short obj, short xscroll, long yscroll, char *cyscroll, char *cursorpos, short cx, short cy, short *global);
00916 short mt_edit_scroll (OBJECT *tree, short obj, short whdl, long yscroll, short xscroll, short *global);
00917 void mt_edit_get_scrollinfo (OBJECT *tree, short obj, long *nlines, long *yscroll, short *yvis, short *yval, short *ncols, short *xscroll, short *xvis, short *global);
00920
00921
00922
00923
00924
00925
00926
00927 void v_clsbm (short handle);
00928 void v_opnbm (short *work_in, MFDB *bitmap, short *handle, short *work_out);
00929 void vq_scrninfo (short handle, short *work_out);
00930
00931
00932
00933
00934
00935 short v_bez_on (short handle);
00936 void v_bez_off (short handle);
00937 void v_bez (short handle, short count, short *xyarr, char *bezarr, short *extent, short *totpts, short *totmoves);
00938 void v_bez_fill (short handle, short count, short *xyarr, char *bezarr, short *extent, short *totpts, short *totmoves);
00939 void v_bez_qual (short handle, short percent, short *actual);
00940
00941
00942
00943
00944
00945
00947 typedef struct
00948 {
00949 long size;
00951 short format;
00952 short id;
00953 short index;
00954 char font_name[50];
00955 char family_name[50];
00956 char style_name[50];
00957 char file_name1[200];
00959 char file_name2[200];
00960 char file_name3[200];
00961 short pt_cnt;
00963 short pt_sizes[64];
00965 } XFNT_INFO;
00966
00967 typedef unsigned short WCHAR;
00969 #ifdef __GEMLIB_VDI
00970
00971 void v_ftext (VdiHdl, short x, short y, const char *str);
00972 void v_ftext16 (VdiHdl, short x, short y, const WCHAR *wstr);
00973 void v_ftext16n (VdiHdl, PXY pos, const WCHAR *wstr, short num);
00974 void v_ftext_offset (VdiHdl, short x, short y,
00975 const char *str, const short *offset);
00976 void v_ftext_offset16(VdiHdl, short x, short y,
00977 const WCHAR *wstr, const short *offset);
00978 void v_getbitmap_info(VdiHdl, short ch, long *advancex, long *advancey,
00979 long *xoffset, long *yoffset, short *width,
00980 short *height, short **bitmap);
00981 void v_getoutline (VdiHdl, short ch, short *xyarray, char *bezarray,
00982 short maxverts, short *numverts);
00983
00984 short vq_devinfo (VdiHdl, short device, short *dev_exists,
00985 char *file_name, char *device_name);
00986 void vqt_devinfo (VdiHdl, short device, short *dev_busy,
00987 char *file_name, char *device_name);
00988 short vq_ext_devinfo (VdiHdl, short device, short *dev_exists,
00989 char *file_path, char *file_name, char *name);
00990
00991 void vqt_advance (VdiHdl, short ch, short *advx, short *advy,
00992 short *xrem, short *yrem);
00993 void vqt_advance32 (VdiHdl, short ch, long *advx, long *advy);
00994 short vqt_ext_name (VdiHdl, short __index,
00995 char *name, short *font_format, short *flags);
00996 void vqt_f_extent (VdiHdl, const char *str, short extent[]);
00997 void vqt_f_extent16 (VdiHdl, const WCHAR *str, short extent[]);
00998 void vqt_f_extent16n (VdiHdl, const WCHAR *str, short num, short extent[]);
00999 void vqt_fontheader (VdiHdl, char *buffer, char *pathname);
01000 short vqt_name_and_id (VdiHdl, short font_format,
01001 char *font_name, char *ret_name);
01002 void vqt_pairkern (VdiHdl, short ch1, short ch2, long *x, long *y);
01003 void vqt_real_extent (VdiHdl, short x, short y, char *string, short extent[]);
01004 void vqt_trackkern (VdiHdl, long *x, long *y);
01005 short vqt_xfntinfo (VdiHdl, short flags, short id,
01006 short __index, XFNT_INFO *info);
01007
01008 short vst_arbpt (VdiHdl, short point, short *wchar, short *hchar, short *wcell, short *hcell);
01009 long vst_arbpt32 (VdiHdl, long point, short *wchar, short *hchar, short *wcell, short *hcell);
01010 void vst_charmap (VdiHdl, short mode);
01011 void vst_kern (VdiHdl, short tmode, short pmode, short *tracks, short *pairs);
01012 short vst_name (VdiHdl, short font_format, char *font_name, char *ret_name);
01013 short vst_setsize (VdiHdl, short point, short *wchar, short *hchar, short *wcell, short *hcell);
01014 long vst_setsize32 (VdiHdl, long point, short *wchar, short *hchar, short *wcell, short *hcell);
01015 short vst_skew (VdiHdl, short skew);
01016 void vst_track_offset(VdiHdl, long offset, short pairmode, short *tracks, short *pairs);
01017
01018 #define vst_kern_info vst_track_offset
01019 void vst_width (VdiHdl, short width, short *char_width, short *char_height, short *cell_width, short *cell_height);
01020
01021 #endif
01022
01023
01024
01025
01026
01027 short vqt_char_index (short handle, short scr_index, short scr_mode, short dst_mode);
01028 short vst_map_mode (short handle, short mode);
01029
01030 #define vqt_is_char_available(handle,unicode) \
01031 (vqt_char_index(handle,unicode,CHARIDX_UNICODE,CHARIDX_DIRECT)!=0xFFFF)
01032
01033
01034
01035
01036
01037
01038
01039 #define PX_1COMP 0x01000000L
01040 #define PX_3COMP 0x03000000L
01041 #define PX_4COMP 0x04000000L
01042
01043 #define PX_REVERSED 0x00800000L
01044 #define PX_xFIRST 0x00400000L
01045 #define PX_kFIRST 0x00200000L
01046 #define PX_aFIRST 0x00100000L
01047
01048 #define PX_PACKED 0x00020000L
01049 #define PX_PLANES 0x00010000L
01050 #define PX_IPLANES 0x00000000L
01051
01052 #define PX_USES1 0x00000100L
01053 #define PX_USES2 0x00000200L
01054 #define PX_USES3 0x00000300L
01055 #define PX_USES4 0x00000400L
01056 #define PX_USES8 0x00000800L
01057 #define PX_USES15 0x00000f00L
01058 #define PX_USES16 0x00001000L
01059 #define PX_USES24 0x00001800L
01060 #define PX_USES32 0x00002000L
01061 #define PX_USES48 0x00003000L
01062
01063 #define PX_1BIT 0x00000001L
01064 #define PX_2BIT 0x00000002L
01065 #define PX_3BIT 0x00000003L
01066 #define PX_4BIT 0x00000004L
01067 #define PX_8BIT 0x00000008L
01068 #define PX_16BIT 0x00000010L
01069 #define PX_24BIT 0x00000018L
01070 #define PX_32BIT 0x00000020L
01071 #define PX_48BIT 0x00000030L
01072
01073 #define PX_CMPNTS 0x0f000000L
01074 #define PX_FLAGS 0x00f00000L
01075 #define PX_PACKING 0x00030000L
01076 #define PX_USED 0x00003f00L
01077 #define PX_BITS 0x0000003fL
01078
01079
01080
01081
01082 #define PX_ATARI1 ( PX_PACKED + PX_1COMP + PX_USES1 + PX_1BIT )
01083 #define PX_ATARI2 ( PX_IPLANES + PX_1COMP + PX_USES2 + PX_2BIT )
01084 #define PX_ATARI4 ( PX_IPLANES + PX_1COMP + PX_USES4 + PX_4BIT )
01085 #define PX_ATARI8 ( PX_IPLANES + PX_1COMP + PX_USES8 + PX_8BIT )
01086 #define PX_FALCON15 ( PX_PACKED + PX_3COMP + PX_USES16 + PX_16BIT )
01087
01088
01089
01090
01091 #define PX_MAC1 ( PX_PACKED + PX_1COMP + PX_USES1 + PX_1BIT )
01092 #define PX_MAC4 ( PX_PACKED + PX_1COMP + PX_USES4 + PX_4BIT )
01093 #define PX_MAC8 ( PX_PACKED + PX_1COMP + PX_USES8 + PX_8BIT )
01094 #define PX_MAC15 ( PX_xFIRST + PX_PACKED + PX_3COMP + PX_USES15 + PX_16BIT )
01095 #define PX_MAC32 ( PX_xFIRST + PX_PACKED + PX_3COMP + PX_USES24 + PX_32BIT )
01096
01097
01098
01099
01100 #define PX_VGA1 ( PX_PACKED + PX_1COMP + PX_USES1 + PX_1BIT )
01101 #define PX_VGA4 ( PX_PLANES + PX_1COMP + PX_USES4 + PX_4BIT )
01102 #define PX_VGA8 ( PX_PACKED + PX_1COMP + PX_USES8 + PX_8BIT )
01103 #define PX_VGA15 ( PX_REVERSED + PX_xFIRST + PX_PACKED + PX_3COMP + PX_USES15 + PX_16BIT )
01104 #define PX_VGA16 ( PX_REVERSED + PX_PACKED + PX_3COMP + PX_USES16 + PX_16BIT )
01105 #define PX_VGA24 ( PX_REVERSED + PX_PACKED + PX_3COMP + PX_USES24 + PX_24BIT )
01106 #define PX_VGA32 ( PX_REVERSED + PX_xFIRST + PX_PACKED + PX_3COMP + PX_USES24 + PX_32BIT )
01107
01108 #define PX_MATRIX16 ( PX_PACKED + PX_3COMP + PX_USES16 + PX_16BIT )
01109
01110 #define PX_NOVA32 ( PX_PACKED + PX_3COMP + PX_USES24 + PX_32BIT )
01111
01112
01113
01114
01115 #define PX_PRN1 ( PX_PACKED + PX_1COMP + PX_USES1 + PX_1BIT )
01116 #define PX_PRN8 ( PX_PACKED + PX_1COMP + PX_USES8 + PX_8BIT )
01117 #define PX_PRN32 ( PX_xFIRST + PX_PACKED + PX_3COMP + PX_USES24 + PX_32BIT )
01118
01119
01120
01121
01122
01123 #define PX_PREF1 ( PX_PACKED + PX_1COMP + PX_USES1 + PX_1BIT )
01124 #define PX_PREF2 ( PX_PACKED + PX_1COMP + PX_USES2 + PX_2BIT )
01125 #define PX_PREF4 ( PX_PACKED + PX_1COMP + PX_USES4 + PX_4BIT )
01126 #define PX_PREF8 ( PX_PACKED + PX_1COMP + PX_USES8 + PX_8BIT )
01127 #define PX_PREF15 ( PX_xFIRST + PX_PACKED + PX_3COMP + PX_USES15 + PX_16BIT )
01128 #define PX_PREF32 ( PX_xFIRST + PX_PACKED + PX_3COMP + PX_USES24 + PX_32BIT )
01129
01130
01131
01132
01133
01135 enum
01136 {
01137 CSPACE_RGB = 0x0001,
01138 CSPACE_ARGB = 0x0002,
01139 CSPACE_CMYK = 0x0004
01140 };
01141
01143 enum
01144 {
01145 CSPACE_1COMPONENT = 0x0001,
01146 CSPACE_2COMPONENTS = 0x0002,
01147 CSPACE_3COMPONENTS = 0x0003,
01148 CSPACE_4COMPONENTS = 0x0004
01149 };
01150
01152 typedef struct
01153 {
01154 unsigned short reserved;
01155 unsigned short red;
01156 unsigned short green;
01157 unsigned short blue;
01158 } COLOR_RGB;
01159
01161 typedef struct
01162 {
01163 unsigned short cyan;
01164 unsigned short magenta;
01165 unsigned short yellow;
01166 unsigned short black;
01167 } COLOR_CMYK;
01168
01170 typedef union
01171 {
01172 COLOR_RGB rgb;
01173 COLOR_CMYK cmyk;
01174 } COLOR_ENTRY;
01175
01177 #define COLOR_TAB_MAGIC 'ctab'
01178
01180 typedef struct
01181 {
01182 long magic;
01183 long length;
01184 long format;
01185 long reserved;
01187 long map_id;
01188 long color_space;
01189 long flags;
01190 long no_colors;
01192 long reserved1;
01193 long reserved2;
01194 long reserved3;
01195 long reserved4;
01197 #if defined(__GNUC__) || defined (__LATTICE__)
01198 COLOR_ENTRY colors[0];
01199 #else
01200 COLOR_ENTRY colors[];
01201 #endif
01202
01203 } COLOR_TAB;
01204
01205 typedef COLOR_TAB *CTAB_PTR;
01206 typedef COLOR_TAB *CTAB_REF;
01207
01208
01209 typedef void INVERSE_CTAB;
01210 typedef INVERSE_CTAB *ITAB_REF;
01211
01212 typedef struct _gcbitmap GCBITMAP;
01214 struct _gcbitmap
01215 {
01216 long magic;
01217 long length;
01218 long format;
01219 long reserved;
01221 unsigned char *addr;
01222 long width;
01223 long bits;
01224 unsigned long px_format;
01226 long xmin;
01227 long ymin;
01228 long xmax;
01229 long ymax;
01231 CTAB_REF ctab;
01232 ITAB_REF itab;
01233 long reserved0;
01234 long reserved1;
01235 };
01236
01237
01238
01239
01240
01241
01242 #define T_NOT 4
01243 #define T_COLORIZE 16
01245 #define T_LOGIC_MODE 0
01246 #define T_DRAW_MODE 32
01247 #define T_ARITH_MODE 64
01248 #define T_DITHER_MODE 128
01250
01251 #define T_LOGIC_COPY T_LOGIC_MODE+0
01252 #define T_LOGIC_OR T_LOGIC_MODE+1
01253 #define T_LOGIC_XOR T_LOGIC_MODE+2
01254 #define T_LOGIC_AND T_LOGIC_MODE+3
01255 #define T_LOGIC_NOT_COPY T_LOGIC_MODE+4
01256 #define T_LOGIC_NOT_OR T_LOGIC_MODE+5
01257 #define T_LOGIC_NOT_XOR T_LOGIC_MODE+6
01258 #define T_LOGIC_NOT_AND T_LOGIC_MODE+7
01259
01260
01261 #define T_REPLACE T_DRAW_MODE+0
01262 #define T_TRANSPARENT T_DRAW_MODE+1
01263 #define T_HILITE T_DRAW_MODE+2
01264 #define T_REVERS_TRANSPARENT T_DRAW_MODE+3
01265
01266
01267 #define T_BLEND T_ARITH_MODE+0
01268 #define T_ADD T_ARITH_MODE+1
01269 #define T_ADD_OVER T_ARITH_MODE+2
01270 #define T_SUB T_ARITH_MODE+3
01271 #define T_MAX T_ARITH_MODE+5
01272 #define T_SUB_OVER T_ARITH_MODE+6
01273 #define T_MIN T_ARITH_MODE+7
01274
01276 typedef struct
01277 {
01278 short x1;
01279 short y1;
01280 short x2;
01281 short y2;
01282 } RECT16;
01283
01285 typedef struct
01286 {
01287 long x1;
01288 long y1;
01289 long x2;
01290 long y2;
01291 } RECT32;
01292
01293
01294 long v_color2nearest (short handle, long color_space, COLOR_ENTRY *color, COLOR_ENTRY *nearest_color);
01295 unsigned long v_color2value (short handle, long color_space, COLOR_ENTRY *color);
01296 COLOR_TAB * v_create_ctab (short handle, long color_space, unsigned long px_format);
01297 ITAB_REF v_create_itab (short handle, COLOR_TAB *ctab, short bits );
01298 unsigned long v_ctab_idx2value (short handle, short __index );
01299 short v_ctab_idx2vdi (short handle, short __index);
01300 short v_ctab_vdi2idx (short handle, short vdi_index);
01301 short v_delete_ctab (short handle, COLOR_TAB *ctab);
01302 short v_delete_itab (short handle, ITAB_REF itab);
01303 long v_get_ctab_id (short handle);
01304 short v_get_outline (short handle, short __index, short x_offset, short y_offset, short *pts, char *flags, short max_pts);
01305 short v_opnprn (short aes_handle, PRN_SETTINGS *settings, short work_out[]);
01306 short v_open_bm (short base_handle, GCBITMAP *bitmap, short color_flags, short unit_flags, short pixel_width, short pixel_height);
01307 short v_resize_bm (short handle, short width, short height, long b_width, unsigned char *addr);
01308 void v_setrgb (short handle, short type, short r, short g, short b);
01309 long v_value2color (short handle, unsigned long value, COLOR_ENTRY *color);
01310 short vq_ctab (short handle, long ctab_length, COLOR_TAB *ctab);
01311 long vq_ctab_entry (short handle, short __index, COLOR_ENTRY *color);
01312 long vq_ctab_id (short handle);
01313 short vq_dflt_ctab (short handle, long ctab_length, COLOR_TAB *ctab);
01314 long vq_hilite_color (short handle, COLOR_ENTRY *hilite_color);
01315 short vq_margins (short handle, short *top_margin, short *bottom_margin, short *left_margin, short *right_margin, short *hdpi, short *vdpi);
01316 long vq_max_color (short handle, COLOR_ENTRY *hilite_color);
01317 long vq_min_color (short handle, COLOR_ENTRY *hilite_color);
01318 long vq_prn_scaling (short handle);
01319 long vq_px_format (short handle, unsigned long *px_format);
01320 long vq_weight_color (short handle, COLOR_ENTRY *hilite_color);
01321 long vqf_bg_color (short handle, COLOR_ENTRY *fg_color);
01322 long vqf_fg_color (short handle, COLOR_ENTRY *fg_color);
01323 long vql_bg_color (short handle, COLOR_ENTRY *fg_color);
01324 long vql_fg_color (short handle, COLOR_ENTRY *fg_color);
01325 long vqm_bg_color (short handle, COLOR_ENTRY *fg_color);
01326 long vqm_fg_color (short handle, COLOR_ENTRY *fg_color);
01327 long vqr_bg_color (short handle, COLOR_ENTRY *fg_color);
01328 long vqr_fg_color (short handle, COLOR_ENTRY *fg_color);
01329 long vqt_bg_color (short handle, COLOR_ENTRY *fg_color);
01330 long vqt_fg_color (short handle, COLOR_ENTRY *fg_color);
01331 void vr_transfer_bits (short handle, GCBITMAP *src_bm, GCBITMAP *dst_bm, short *src_rect, short *dst_rect, short mode);
01332 short vs_ctab (short handle, COLOR_TAB *ctab);
01333 short vs_ctab_entry (short handle, short __index, long color_space, COLOR_ENTRY *color);
01334 short vs_dflt_ctab (short handle);
01335 short vs_document_info (short vdi_handle, short type, char *s, short wchar);
01336 short vs_hilite_color (short handle, long color_space, COLOR_ENTRY *hilite_color);
01337 short vs_max_color (short handle, long color_space, COLOR_ENTRY *min_color);
01338 short vs_min_color (short handle, long color_space, COLOR_ENTRY *min_color);
01339 short vs_weight_color (short handle, long color_space, COLOR_ENTRY *weight_color);
01340 short vsf_bg_color (short handle, long color_space, COLOR_ENTRY *bg_color);
01341 short vsf_fg_color (short handle, long color_space, COLOR_ENTRY *fg_color);
01342 short vsl_bg_color (short handle, long color_space, COLOR_ENTRY *bg_color);
01343 short vsl_fg_color (short handle, long color_space, COLOR_ENTRY *fg_color);
01344 short vsm_bg_color (short handle, long color_space, COLOR_ENTRY *bg_color);
01345 short vsm_fg_color (short handle, long color_space, COLOR_ENTRY *fg_color);
01346 short vsr_bg_color (short handle, long color_space, COLOR_ENTRY *bg_color);
01347 short vsr_fg_color (short handle, long color_space, COLOR_ENTRY *fg_color);
01348 short vst_bg_color (short handle, long color_space, COLOR_ENTRY *bg_color);
01349 short vst_fg_color (short handle, long color_space, COLOR_ENTRY *fg_color);
01350
01351
01352 __END_DECLS
01353
01354 #endif