campo-sirio/src/xi/xiport.h
mtollari 1b14ec9415 Spostamento cartella sorgenti
git-svn-id: svn://10.65.10.50/branches/R_10_00@23236 c028cbd2-c16b-5b4b-a496-9718f37d4682
2016-09-09 13:59:02 +00:00

872 lines
26 KiB
C
Executable File

/*******************************************************************************
* Copyright 1991-1996 by ORCA Software, Inc. *
* *
* All rights reserved. May not be reproduced or distributed, in printed or *
* electronic form, without permission of ORCA Software, Inc. May not be *
* distributed as object code, separately or linked with other object modules, *
* without permission. *
*******************************************************************************/
/*==============================================================================
* Note: Portions not implemented on Motif are commented NOTIMP.
* Portions removed from the header are commented out and marked REMOVED
* New parts are marked with NEW
*============================================================================*/
#ifndef XIN_INCL_XIPORT_H
#define XIN_INCL_XIPORT_H
#ifdef WIN32
#if XIAGADLL == 1
#define XIDLL __declspec(dllexport)
#else
#define XIDLL __declspec(dllimport)
#endif
#else
#define XIDLL
#endif
#define R4
#include "xires.h"
#include "stdio.h"
#include "assert.h"
#include "string.h"
#include "math.h"
#include "stdlib.h"
#include "ctype.h"
/* This code is not needed when using the XVT define for native
#if XIWS == XIWS_PM
#define INCL_DOS
#define INCL_WIN
#define INCL_GPI
#define COLOR pm_COLOR
#define UINT pm_UINT
#define ULONG pm_ULONG
#include <os2.h>
#undef COLOR
#undef UINT
#undef ULONG
#define INTERNAL
#endif
*/
/*
We don't really use the following, we just define them so that they are removed
from the XI source code when we don't use XVT.
*/
#ifndef XVT_CALLCONV1
#define XVT_CALLCONV1
#endif
#ifndef XVT_CC_ARGS
#define XVT_CC_ARGS(a) a
#endif
/* Set an object's memory to all zeros */
#define XIN_CLEAR(obj) memset(&obj, 0, sizeof(obj));
#define XIN_INC_TYPE( s_T, T ) typedef struct s_T T
#define XIN_INC_PTR_TYPE( s_T, T ) typedef struct s_T *T
#define XIN_FAKE_TYPE( s_T, T ) typedef struct s_T {int x;} T
#define XIN_FAKE_PTR_TYPE( s_T, T ) typedef struct s_T {int x;} *T
#ifndef BOOLEAN
#define BOOLEAN short
#define FALSE 0
#define TRUE 1
#endif
typedef enum
{
XinFlagNotSet,
XinFlagTrue,
XinFlagFalse
} XinFlag;
typedef enum
{
XinClipboardFormatText,
XinClipboardFormatBitmap /* NOTIMP */
} XinClipboardFormat;
typedef struct
{
short v;
short h;
} XinPoint;
typedef struct
{
short top;
short left;
short bottom;
short right;
} XinRect;
typedef unsigned long XinColor;
#ifdef XIN_INTERNAL_WINDOW
XIN_INC_PTR_TYPE( s_XinWindow, XinWindow );
#else
XIN_FAKE_PTR_TYPE( s_XinWindow, XinWindow );
#endif
#define XI_NULL_WINDOW ((XinWindow)0L)
typedef enum
{
XinEventCreate,
XinEventDestroy,
XinEventFocus,
XinEventResize,
XinEventPaint,
XinEventCloseButton,
XinEventMouseDown,
XinEventMouseUp,
XinEventMouseMove,
XinEventMouseDouble,
XinEventCharacter,
XinEventVScroll, /* NOTIMP */
XinEventHScroll, /* NOTIMP */
XinEventMenuCommand,
XinEventControl,
XinEventTimer,
XinEventQuit,
XinEventHelp, /* NOTIMP */
XinEventFont, /* NOTIMP */
XinEventUser
} XinEventType;
typedef enum
{
XinScrollBarActionNone,
XinScrollBarActionLineUp,
XinScrollBarActionLineDown,
XinScrollBarActionPageUp,
XinScrollBarActionPageDown,
XinScrollBarActionThumb,
XinScrollBarActionThumbTrack
} XinScrollBarAction;
typedef int XinMenuTag;
/* NEW */
typedef enum
{
XinBorderDouble,
XinBorderSingle,
XinBorderSizable,
XinBorderFixed,
XinBorderNone /* NOTIMP -- requires child window support */
} XinBorderStyle;
/* NEW */
typedef enum
{
XinModeless,
XinModalReturn,
XinModalWait,
XinModalAutoclose
} XinWindowMode;
typedef enum
{
XinWindowTypeDocument,
XinWindowTypePrint,
XinWindowTypeTask,
XinWindowTypeScreen,
XinWindowTypeButton, /* NOTIMP */
XinWindowTypeRadioButton, /* NOTIMP */
XinWindowTypeCheckBox, /* NOTIMP */
XinWindowTypeHorizontalScrollBar,
XinWindowTypeVerticalScrollBar
} XinWindowType;
typedef struct
{
XinWindowType type;
XinWindow win;
union
{
struct
{
XinScrollBarAction action;
short position;
} scroll;
} v;
} XinControlInformation;
typedef enum
{
XinScrollBarTypeHorizontal, /* NOTIMP -- no scrollbars on window borders */
XinScrollBarTypeVertical, /* NOTIMP -- no scrollbars on window borders */
XinScrollBarTypeEither
} XinScrollBarType;
typedef enum
{
XinFontFamilySystem,
XinFontFamilyFixed,
XinFontFamilyTimes,
XinFontFamilyHelvetica,
XinFontFamilyOther
} XinFontFamily;
#ifdef XIN_INTERNAL_FONT
/* Use an incomplete type so that complete type can be defined internally */
XIN_INC_TYPE( s_XinFont, XinFont );
#else
/* Use a complete but fake type, so that Borland does not complain */
XIN_FAKE_TYPE( s_XinFont, XinFont );
#endif
#ifdef XIN_INTERNAL_BITMAP
XIN_INC_TYPE( s_XinBitmap, XinBitmap );
#else
XIN_FAKE_TYPE( s_XinBitmap, XinBitmap );
#endif
typedef struct
{
XinEventType type;
union
{
struct
{
XinPoint where;
BOOLEAN shift;
BOOLEAN control;
BOOLEAN alt;
short button;
} mouse;
struct
{
short ch;
BOOLEAN shift;
BOOLEAN control;
BOOLEAN alt;
BOOLEAN consumed; /* For internal use only */
} character;
struct
{
BOOLEAN active;
} focus;
struct
{
BOOLEAN query; /* NOTIMP -- always FALSE on Motif */
} quit;
struct
{
XinScrollBarAction action;
short position;
} scroll;
struct
{
XinMenuTag tag;
BOOLEAN shift;
BOOLEAN control;
} menu_command;
struct
{
BOOLEAN minimized;
short height;
short width;
} resize;
struct
{
short control_id;
XinControlInformation ctrl_info;
} control;
struct
{
XinRect rect;
} paint;
struct
{
long id;
} timer;
struct
{
XinFont *font;
} font;
struct
{
XinWindow obj;
XinMenuTag tag;
long topic_id;
} help;
struct
{
long id;
void *ptr;
} user;
} v;
} XinEvent;
#ifdef __cplusplus
extern "C"
{
#endif
typedef void ( *XinWindowEventHandler ) ( XinWindow win, XinEvent * ep );
typedef BOOLEAN( *XinPrintHandler ) ( long app_data );
#ifdef __cplusplus
}
#endif
typedef struct s_XinMenuItem
{
XinMenuTag tag;
char *text; /* ~ in text indicates mnemonic */
BOOLEAN enabled;
BOOLEAN checked;
BOOLEAN checkable;
BOOLEAN separator;
int nbr_children;
struct s_XinMenuItem *children;
} XinMenuItem;
/* NEW */
typedef struct
{
int nbr_items;
XinMenuItem *items;
} XinMenu;
typedef struct
{
int control_id;
XinWindowType type;
XinRect *p_rect;
char *title; /* NEW -- NULL means no titlebar */
XinBorderStyle border_style; /* NEW */
BOOLEAN vertical_scroll_bar; /* NOTIMP */
BOOLEAN horizontal_scroll_bar;/* NOTIMP */
BOOLEAN close_button;
BOOLEAN visible;
BOOLEAN enabled;
BOOLEAN iconizable;
BOOLEAN iconized;
BOOLEAN maximized;
XinWindowMode mode; /* NEW */
XinWindow parent; /* See note1 below */
XinMenu *menu; /* New -- no menubar if NULL */
int menu_bar_rid; /* NOTIMP */
int icon_rid; /* Implemented via XPM on Motif -- requires
* linkage of icons */
long app_data;
XinWindowEventHandler eh;
XinColor back_color; /* NEW -- window's default background.
* Influences caret color */
XinFont *font; /* NEW -- only used for native controls */
} XinWindowDef;
/*
{
XinWindowDef Def;
MEMCLEAR(Def);
Def.control_id = ;
Def.type = ;
Def.p_rect = ;
Def.title = ;
Def.border_style = ;
Def.vertical_scroll_bar = ;
Def.horizontal_scroll_bar = ;
Def.close_button = ;
Def.visible = ;
Def.enabled = ;
Def.iconizable = ;
Def.iconized = ;
Def.maximized = ;
Def.mode = ;
Def.parent = ;
Def.menu = ;
Def.menu_bar_rid = ;
Def.icon_rid = ;
Def.app_data = ;
Def.eh = ;
Def.back_color = ;
}
*/
/* Note1: if mode ==
* XinModeless, then parent argument may be task, screen or toplevel window. Setting the
* parent to toplevel window enforfces stack-above-parent and iconize-with-parent.
* XinModalReturn or XinModalWait, then parent argument may be task, screen or toplevel window.
* Task or screen window is application-modal (although windows may still be closed).
* XinModalAutoclose, then parent must be a toplevel window. Autoclose windows are closed before
* any user input is sent to the parent window.
*/
typedef struct
{
char *task_win_title; /* NOTIMP */
char *appl_name; /* NOTIMP */
int menu_bar_rid; /* NOTIMP */
XinWindowEventHandler eh;
XinRect *p_rect; /* NOTIMP */
BOOLEAN iconized; /* NOTIMP */
BOOLEAN maximized; /* NOTIMP */
BOOLEAN use_mdi; /* NOTIMP */
BOOLEAN drawable_task_win;
BOOLEAN app_is_unique; /* Don't allow multiple instances of the application to run. */
int argc;
char **argv;
} XinSystemSetup;
typedef unsigned long XinCursor;
/* NEW */
typedef enum
{
XinPenHollow,
XinPenSolid,
XinPenDashed,
XinPenDotted, // Added by Guy
} XinPenPattern;
/* NEW */
typedef enum
{
XinBrushHollow,
XinBrushSolid,
XinBrushHatch
} XinBrushPattern;
typedef struct
{
short width;
XinPenPattern pattern; /* Changed to XinPenPattern */
XinColor fore_color; /* NEW color of pen */
} XinPen;
typedef struct
{
XinBrushPattern pattern; /* Changed to XinBrushPattern */
XinColor fore_color; /* NEW fore_color allows future back_color with
* hatched brushes */
} XinBrush;
typedef enum
{
XinDrawModeCopy,
XinDrawModeXor /* See Note2 */
} XinDrawMode;
/* Note2: XOR mode, if drawn on pixels equalling the back_color of the window, will attempt
* to produce the fore_color of the tool (pen/brush/text). Drawing on pixels of fore_color
* will attempt to produce back_color. The operation is self-reversing.
*/
typedef struct
{
XinPen pen;
XinBrush brush;
XinDrawMode draw_mode;
XinColor text_fore_color;
XinColor text_back_color;
BOOLEAN opaque_text;
} XinDrawTools;
typedef enum
{
XinResponse1,
XinResponse2,
XinResponse3
} XinResponse;
typedef enum
{
XinMetricIconHeight, /* Will pick a constant reflecting the WM
* restirctions */
XinMetricIconWidth, /* Will pick a constant reflecting the WM
* restirctions */
XinMetricHorizontalScrollBarHeight,
XinMetricVerticalScrollBarWidth,
XinMetricScreenHeight,
XinMetricScreenWidth,
XinMetricSizableFrameHeight, /* Guess on Motif */
XinMetricSizableFrameWidth, /* Guess on Motif */
XinMetricDoubleFrameHeight, /* Guess on Motif */
XinMetricDoubleFrameWidth, /* Guess on Motif */
XinMetricFrameHeight, /* Guess on Motif */
XinMetricFrameWidth, /* Guess on Motif */
XinMetricMenuHeight, /* Guess on Motif */
XinMetricTitleHeight, /* Guess on Motif */
XinMetricVerticalStagger,
XinMetricHorizontalStagger,
XinMetricScreenHRes,
XinMetricScreenVRes
} XinMetricType;
#define XI_FILE_MAX 256
typedef char XinDirectory[XI_FILE_MAX + 1];
typedef enum
{
XinFileGood,
XinFileCancel,
XinFileBad
} XinFileResult;
typedef enum
{
XinOpenFileDialog,
XinSaveFileDialog
} XinFileDialogType;
typedef struct
{
char *type;
XinDirectory directory;
char file_name[XI_FILE_MAX + 1];
} XinFileSpec;
typedef struct
{
char *type;
char *pattern;
BOOLEAN include_dirs;
BOOLEAN dirs_only;
} XinFileListSpec;
typedef struct
{
int nbr_files;
char **file_names;
} XinFileList;
#ifdef XIN_INTERNAL_PRINT_RECORD
/* Use an incomplete type so that complete type can be defined internally */
XIN_INC_TYPE( s_XinPrintRecord, XinPrintRecord );
#else
/* Use a complete but fake type, so that Borland does not complain */
XIN_FAKE_TYPE( s_XinPrintRecord, XinPrintRecord );
#endif
#ifndef NOREF
#define NOREF(a) a = a
#endif
#ifndef assert4
#define assert4(a, b, c, d) if (!(a)) XinError( (c),XinSeverityFatal,0L )
#endif
#define XI_KEY_DEL 127
#define XI_KEY_UP 301
#define XI_KEY_DOWN 302
#define XI_KEY_RIGHT 303
#define XI_KEY_LEFT 304
#define XI_KEY_PREV 305
#define XI_KEY_NEXT 306
#define XI_KEY_LHOME 307
#define XI_KEY_LEND 308
#define XI_KEY_HOME 309
#define XI_KEY_END 310
#define XI_KEY_WLEFT 313
#define XI_KEY_WRIGHT 314
#define XI_KEY_BTAB 315
#define XI_KEY_CLEAR 317
#define XI_KEY_F1 331
#define XI_KEY_F2 332
#define XI_KEY_F3 333
#define XI_KEY_F4 334
#define XI_KEY_F5 335
#define XI_KEY_F6 336
#define XI_KEY_F7 337
#define XI_KEY_F8 338
#define XI_KEY_F9 339
#define XI_KEY_F10 340
#define XI_KEY_F11 341
#define XI_KEY_F12 342
#define XI_CURSOR_ARROW 0
#define XI_CURSOR_IBEAM 1
#define XI_CURSOR_CROSS 2
#define XI_CURSOR_WAIT 3
#define XI_COLOR_RED 0x00FF0000L
#define XI_COLOR_GREEN 0x0000FF00L
#define XI_COLOR_BLUE 0x000000FFL
#define XI_COLOR_CYAN 0x0000FFFFL
#define XI_COLOR_MAGENTA 0x00FF00FFL
#define XI_COLOR_YELLOW 0x00FFFF00L
#define XI_COLOR_BLACK 0x80000000L
#define XI_COLOR_DKGRAY 0x00404040L
#define XI_COLOR_GRAY 0x00808080L
#define XI_COLOR_LTGRAY 0x00C0C0C0L
#define XI_COLOR_WHITE 0x00FFFFFFL
/* New -- values for Motif */
#if XIWS == XIWS_XM
#define XI_CLIP_EOL "\012"
#else
#define XI_CLIP_EOL "\015\012"
#endif
#ifdef __cplusplus
extern "C"
{
#endif
/* Memory */
void *XinMemoryAlloc( size_t size );
void XinMemoryFree( void *ptr );
void *XinMemoryRealloc( void *ptr, size_t size );
void *XinMemoryZeroAlloc( size_t size );
/* Dialogs */
XinResponse XinDialogAsk( char *btn_text_1, char *btn_text_2,
char *btn_text_3, char *fmt,... );
void XinDialogError( char *format,... );
void XinDialogFatal( char *format,... );
XinFileResult XinDialogFile( char *message, XinFileSpec * spec,
XinFileDialogType type );
BOOLEAN XinDialogFont( XinFont * font );
void XinDialogNote( char *format,... );
BOOLEAN XinDialogPrinterSetup( XinPrintRecord * rec );
char *XinDialogStringPrompt( char *message, char *response,
int size_response );
/* Rectangles */
BOOLEAN XinRectEmpty( XinRect * rect );
XinRect *XinRectIntersect( XinRect * result, XinRect * r1, XinRect * r2 );
BOOLEAN XinRectPointContained( XinRect * rect, XinPoint * point );
XinRect *XinRectEnclose( XinRect * dst, XinRect * src1, XinRect * src2 );
/* Windows and drawing */
long XinWindowAppDataGet( XinWindow win );
void XinWindowAppDataSet( XinWindow win, long app_data );
void XinWindowArcDraw( XinWindow win, XinRect* ellipse, XinPoint* start, XinPoint* stop );
void XinWindowBitmapDraw( XinWindow win, XinBitmap * bitmap, XinRect * dest,
XinRect * source );
void XinWindowBrushSet( XinWindow win, XinBrush * brush );
void XinWindowCaretOff( XinWindow win );
void XinWindowCaretOn( XinWindow win, int x, int y, int height,
XinColor assumed_back_color, XinRect * clip_rct );
void XinWindowCheckBox( XinWindow win, BOOLEAN check ); /* NOTIMP */
void XinWindowCheckRadioButton( XinWindow win, XinWindow * wins, /* NOTIMP */
int nbr_windows );
BOOLEAN XinWindowClipGet( XinWindow win, XinRect * rect );
void XinWindowClipSet( XinWindow Win, XinRect * rect );
void XinWindowColorTextBackSet( XinWindow win, XinColor color ); /* Added Text */
void XinWindowColorTextForeSet( XinWindow win, XinColor color ); /* Added Text */
XinWindow XinWindowCreate( XinWindowDef * def );
void XinWindowCursorSet( XinWindow win, XinCursor cursor );
void XinWindowDestroy( XinWindow win );
XinDrawMode XinWindowDrawModeGet( XinWindow win );
void XinWindowDrawModeSet( XinWindow win, XinDrawMode mode );
XinDrawTools *XinWindowDrawToolsGet( XinWindow win, XinDrawTools * tools );
XinDrawTools *XinWindowDrawToolsNormalGet( XinDrawTools * tools );
void XinWindowDrawToolsSet( XinWindow win, XinDrawTools * tools );
XinWindow XinWindowDropDownParentGet( XinWindow creating_win );
void XinWindowEllipseDraw( XinWindow win, XinRect* rect );
void XinWindowEnable( XinWindow win, BOOLEAN enable ); /* NOTIMP */
void XinWindowEventUserSend( XinWindow win, long id, void *ptr );
void XinWindowFontMap( XinWindow win, XinFont * font );
XinWindow XinWindowFocusGet( void );
void XinWindowFocusSet( XinWindow win ); /* May be ineffective */
void XinWindowFrontSet( XinWindow win );
void XinWindowHotkeySet( XinWindow win, char ch );
void XinWindowIconDraw( XinWindow win, int x, int y, int icon_rid,
XinColor fore_color, XinColor back_color );
void XinWindowLineDraw( XinWindow win, XinPoint * point );
void XinWindowLineMoveTo( XinWindow win, XinPoint * point );
void XinWindowMouseRelease( void );
void XinWindowMouseTrap( XinWindow win,
BOOLEAN continuous_mouse_moves );
long XinWindowNativeGet( XinWindow win );
void XinWindowPaintForce( XinWindow win );
BOOLEAN XinWindowPaintNeeds( XinWindow win, XinRect * p_rect );
XinWindow XinWindowParentGet( XinWindow win );
void XinWindowPenSet( XinWindow win, XinPen * pen );
void XinWindowPieDraw( XinWindow win, XinRect* ellipse, XinPoint* start, XinPoint* stop );
void XinWindowPointsTranslate( XinWindow from_win, XinWindow to_win,
XinPoint * points, int nbr_points );
void XinWindowPolygonDraw( XinWindow win, XinPoint* points, int nbr_points );
void XinWindowRectDraw( XinWindow win, XinRect * rect );
void XinWindowDottedRectDraw( XinWindow win, XinRect * rect ); /* Added by Guy */
void XinWindowRoundRectDraw( XinWindow win, XinRect * rect, int rh, int rv ); /* Added by Guy */
void XinWindowShadedRectDraw( XinWindow win, XinRect * rect ); /* Added by Guy */
void XinWindowCheckMarkDraw( XinWindow win, XinRect * rect ); /* Added by Guy */
XinRect *XinWindowRectGet( XinWindow win, XinRect * p_rect );
void XinWindowRectInvalidate( XinWindow win, XinRect * rect );
XinRect *XinWindowRectOuterGet( XinWindow win, XinRect * p_rect );
void XinWindowRectScroll( XinWindow win, XinRect * p_rect,
int dh, int dv );
void XinWindowRectSet( XinWindow win, XinRect * rect );
void XinWindowRectTranslate( XinWindow from_win, XinWindow to_win,
XinRect * rect );
XinWindow XinWindowScreenGet( void );
void XinWindowShow( XinWindow win, BOOLEAN show );
XinWindow XinWindowTaskGet( void );
void XinWindowTextOpaqueSet( XinWindow win, BOOLEAN opaque );
void XinWindowTextDraw( XinWindow win, XinFont * font, int x, int y,
char *buf, int len );
void XinWindowTextRotateDraw( XinWindow win, XinFont* font, int x, int y,
int rotation, char* buf, int len );
void XinWindowTimerKill( XinWindow win, long timer_id );
long XinWindowTimerSet( XinWindow win, long millisecs );
char *XinWindowTitleGet( XinWindow win );
void XinWindowTitleSet( XinWindow win, const char *title );
#if XIWS == XIWS_XM
long XinWindowGetWidget( XinWindow win ); /* Return value is really a
* Widget */
#endif
/* Scroll Bars */
int XinScrollBarPositionGet( XinWindow win, XinScrollBarType type );
void XinScrollBarPositionSet( XinWindow win, XinScrollBarType type,
int position );
int XinScrollBarProportionGet( XinWindow win, XinScrollBarType type );
void XinScrollBarRangeGet( XinWindow win, XinScrollBarType type,
int *p_min, int *p_max );
void XinScrollBarSet( XinWindow win, XinScrollBarType type,
int min_val, int max_val,
int proportion, int pos );
/* Clip Board */
BOOLEAN XinClipboardFormatAvail( XinClipboardFormat format );
void *XinClipboardGet( XinClipboardFormat format, long *size );
void XinClipboardPut( XinClipboardFormat format, long size,
void *data );
/* Application */
void XinAppCleanup( void );
void XinAppQuitOk( void ); /* NOP on Motif */
void XinAppTerminate( void );
void XinAppSystemSetupInit( XinSystemSetup * setup );
void XinDebugPrintf( char *format,... ); /* NOTIMP */
void XinPendingEventsProcess( void );
/* Miscellaneous */
void XinBeep( void );
XinColor XinColorMake( int red, int green, int blue );
BOOLEAN XinStringMatch( char *string, char *pattern,
BOOLEAN case_sensitive );
void XinCursorWait( void );
long XinMetricGet( XinMetricType type );
void XinCoalesceInvalidates( XinWindow win, BOOLEAN coalesce );
void XinInitBuffer( void );
#ifdef XI_USE_XVT
void XinXvtEventGet( void *xvtp );
char *XinXvtEventTextGet( void *xvtp );
void XinXvtWindowRegister( XinWindow win, XinWindowEventHandler eh );
#endif
/* Menus */
XinMenuItem *XinMenuAdd( XinMenu * menu, int index, XinMenuItem * item );
XinMenu *XinMenuCreate( void );
BOOLEAN XinMenuDelete( XinMenu * menu, int index );
XinMenu *XinMenuDuplicate( XinMenu * menu );
void XinMenuFree( XinMenu * menu );
XinMenuItem *XinMenuItemAdd( XinMenuItem * item, int index,
XinMenuItem * child );
XinMenuItem *XinMenuItemCreate( char *text );
XinMenuItem *XinMenuItemDuplicate( XinMenuItem * item );
BOOLEAN XinMenuItemDelete( XinMenuItem * item, int index );
void XinMenuItemFree( XinMenuItem * item );
void XinMenuItemTextSet( XinMenuItem * item, char *text );
void XinWindowMenuFontSet( XinWindow win, XinFont * font ); /* NOTIMP */
XinMenu *XinWindowMenuGet( XinWindow win, XinMenuTag tag ); /* menubar if tag==0 */
void XinWindowMenuItemCheck( XinWindow win, XinMenuTag tag,
BOOLEAN check );
void XinWindowMenuItemEnable( XinWindow win, XinMenuTag tag,
BOOLEAN enable );
XinMenuItem *XinWindowMenuItemGet( XinWindow win, XinMenuTag tag );
BOOLEAN XinWindowMenuItemIsChecked( XinWindow win, XinMenuTag tag );
BOOLEAN XinWindowMenuItemIsEnabled( XinWindow win, XinMenuTag tag );
char *XinWindowMenuItemTextGet( XinWindow win, XinMenuTag tag );
void XinWindowMenuItemTextSet( XinWindow win, XinMenuTag tag, char *text );
void XinWindowMenuReplace( XinWindow win, XinMenuTag tag, XinMenu * menu ); /* menubar if tag==0 */
/* Fonts */
BOOLEAN XinFontBoldGet( XinFont * font );
void XinFontBoldSet( XinFont * font, BOOLEAN flag );
BOOLEAN XinFontCompare( XinFont * font1, XinFont * font2 );
void XinFontCopy( XinFont ** to, XinFont * from );
XinFont *XinFontCreate( void );
void XinFontDestroy( XinFont * font );
XinFontFamily XinFontFamilyGet( XinFont * font );
void XinFontFamilySet( XinFont * font, XinFontFamily family );
BOOLEAN XinFontIsMapped( XinFont * font );
BOOLEAN XinFontItalicGet( XinFont * font );
void XinFontItalicSet( XinFont * font, BOOLEAN flag );
void XinFontMetricsGet( XinFont * font, int *p_leading, int *p_ascent,
int *p_descent );
int XinFontSizeGet( XinFont * font );
void XinFontSizeSet( XinFont * font, int size );
int XinFontTextWidthGet( XinFont * font, char *text, int len );
void XinFontNativeConvert( XinFont * font );
#ifdef XI_USE_XVT
XinFont *XinFontXvtConvert( void *font_id );
void *XinFontXvtConvertBack( XinFont * font_id );
void XinFontXvtDestroy( void* font_id );
#endif
void XinFontUnmap( XinFont* font_id ); /* RGM: Font unmap hack */
/* Bitmaps */
void XinBitmapDestroy( XinBitmap * bitmap );
XinBitmap *XinBitmapRead( char *filename );
XinBitmap *XinBitmapReadRes( short id );
void XinBitmapSizeGet( XinBitmap * bitmap, short *pwidth, short *pheight );
/* Printing */
XinRect *XinPrintBandNext( void );
BOOLEAN XinPrintPageEnd( XinPrintRecord * rec );
BOOLEAN XinPrintPageStart( XinPrintRecord * rec );
XinPrintRecord *XinPrintRecordCreate( int *p_size );
void XinPrintRecordDestroy( XinPrintRecord * rec );
BOOLEAN XinPrintRecordValidate( XinPrintRecord * rec );
BOOLEAN XinPrintThreadStart( XinPrintHandler func, long app_data );
XinWindow XinPrintWindowCreate( XinPrintRecord * rec, char *title );
void XinPrintWindowDestroy( XinWindow win );
void XinPrintRecordMetricsGet( XinPrintRecord * rec, long * height, long * width,
long * vres, long * hres );
/* Files and Directories */
BOOLEAN XinDirectoryAbsoluteGet( char *full_name, XinDirectory * dir );
BOOLEAN XinDirectoryCurrentGet( XinDirectory * dir );
BOOLEAN XinDirectoryCurrentSet( XinDirectory * dir );
XinFileList *XinFileListGet( XinFileListSpec * spec );
/* NEW error handling */
typedef enum
{
XinSeverityWarning, XinSeverityFatal
} XinSeverity;
typedef BOOLEAN( *XinErrorHandler ) ( int errocde, XinSeverity severity, long app_data );
/* Note: return value of error handler is TRUE if app should terminate, FALSE to continue */
void XinError( int errcode, XinSeverity severity, long app_data );
XinErrorHandler XinErrorHandlerGet( void );
void XinErrorHandlerSet( XinErrorHandler handler );
BOOLEAN XinErrorDefaultHandler( int errcode, XinSeverity severity,
long app_data );
void XinIconSizeGet( int icon_rid, int *widthp, int *heightp );
/* Native help (only implemented on Windows - these calls do nothing elsewhere) */
void XinHelpFileNameSet( char *filename );
char *XinHelpFileNameGet();
BOOLEAN XinNativeHelp( XinWindow win, char *help_key );
#ifdef __cplusplus
} /* End of extern "C" */
#endif
/* Range of errors used internally by Xin */
#define XIN_ERRCODE_INTERNAL_MIN 1000
#define XIN_ERRCODE_INTERNAL_MAX 2000
#endif