MACHINE.H

Go to the documentation of this file.
00001 
00002 /*  $Id: MACHINE.H 424 2005-01-24 03:48:34Z terry_teague $    */
00003 
00004 /* This is the generic header file for "machinespecific.h". You do NOT need
00005 to modify this header as its definitions are intended to compile on various
00006 platforms. However, you will need to completely swap out "machinespecific.c"
00007 since that file -- and only that file -- contains code unique to your platform
00008 and/or OS. */
00009 
00010 /* Updated by Board Member TR Shaw, OITC, Inc. 12 Feb/19 Apr 1994 for C/C++/Pascal linkage and PPC control
00011     and for size and speed */
00012 
00013 /* Updated by Board Member TR Shaw, OITC, Inc. / 25 Apr 1994 for platform independant font changes */
00014 
00015 
00016 #ifndef MACHINE_H
00017 #define MACHINE_H
00018 
00019 #include "PAIGE.H"
00020 
00021 #define OFFSCREEN_SUCCESSFUL    1           /* Offscreen enable was successful */
00022 #define OFFSCREEN_UNSUCCESSFUL  -1          /* Offscreen enable was not successful */
00023 
00024 #define CTL_CHAR_BITS       (PAR_SEL_BIT | LINE_SEL_BIT | TAB_BIT)
00025 #define NON_CTL_CHAR_BITS   (long) (~CTL_CHAR_BITS)
00026 #define DOUBLE_UNDERLINE        0x0001      /* Double underline */
00027 #define GRAY_UNDERLINE          0x0002      /* "Dotted" underline */
00028 #define WORD_UNDERLINE          0x0004      /* Word(s) underline */
00029 #define FAKE_UNDERLINE          0x0008      /* Underline is faked */
00030 #define OVERLINE_LINE           0x0010      /* Overline style */
00031 
00032 #define FONT_NAME_SIZE(fname) (short)fname[0]
00033 
00034 /* Clipping verbs (passed to pgClipGrafDevice) : */
00035 
00036 enum {
00037     clip_standard_verb,
00038     clip_with_none_verb
00039 };
00040 
00041 #ifdef MAC_PLATFORM
00042 #if !TARGET_API_MAC_CARBON
00043 #include <FixMath.h>
00044 #include <ToolUtils.h>
00045 #endif
00046 #endif
00047 
00048 #ifdef __cplusplus
00049 extern  "C" {
00050 #endif
00051 
00052 #define CLIP_PAGE_CHANGED       0x0001      /* Page area changed since last clip region */
00053 #define CLIP_VIS_CHANGED        0x0002      /* Vis area has changed */
00054 #define CLIP_EXCLUDE_CHANGED    0x0004      /* Exclude area changed since last clip region */
00055 #define CLIP_DEVICE_CHANGED     0x0008      /* Graf device changed since last clip region */
00056 #define CLIP_SCROLL_CHANGED     0x0010      /* Clip region changed by virtue of scrolling. */
00057 
00058  /* QD style conversions */
00059 
00060 extern PG_PASCAL (long) PaigeToQDStyle (const style_info_ptr the_style);
00061 extern PG_PASCAL (void) QDStyleToPaige (long qd_styles, style_info_ptr the_style);
00062 
00063 
00064 extern PG_PASCAL (void) pgMachineInit (pg_globals_ptr globals);
00065 extern PG_PASCAL (void) pgMachineShutdown (const pg_globals_ptr globals);
00066 extern PG_PASCAL (void) pgInitDefaultDevice (const pg_globals_ptr globals, graf_device_ptr device);
00067 extern PG_PASCAL (void) pgInitDefaultFont (const pg_globals_ptr globals, font_info_ptr font);
00068 extern PG_PASCAL (void) pgInitDefaultStyle (const pg_globals_ptr globals, style_info_ptr style, font_info_ptr def_font);
00069 extern PG_PASCAL (void) pgInitDefaultPar (const pg_globals_ptr globals, par_info_ptr def_par);
00070 #ifdef MAC_PLATFORM
00071 extern PG_PASCAL (GrafPtr) pgGetPlatformDevice (graf_device_ptr the_device);
00072 #define pgReleasePlatformDevice(the_device)
00073 #endif
00074 #ifdef WINDOWS_PLATFORM
00075 extern PG_PASCAL (HDC) pgGetPlatformDevice (graf_device_ptr the_device);
00076 extern PG_PASCAL (void) pgReleasePlatformDevice (graf_device_ptr the_device);
00077 #endif
00078 extern PG_PASCAL (void) pgClipGrafDevice (paige_rec_ptr pg, short clip_verb, shape_ref alternate_vis);
00079 extern PG_PASCAL (void) pgSetMeasureDevice (paige_rec_ptr pg);
00080 extern PG_PASCAL (void) pgUnsetMeasureDevice (paige_rec_ptr pg);
00081 extern PG_PASCAL (void) pgPrintDeviceChanged (paige_rec_ptr pg);
00082 extern PG_PASCAL (void) pgPrepareOffscreen (paige_rec_ptr pg, rectangle_ptr target_area,
00083             rectangle_ptr real_bits_target, co_ordinate_ptr offset_adjust,
00084             long text_offset, point_start_ptr line_start, short draw_mode);
00085 extern PG_PASCAL (pg_boolean) pgFinishOffscreen (paige_rec_ptr pg, long text_offset,
00086         point_start_ptr line_start, co_ordinate_ptr new_offset,
00087         rectangle_ptr new_target, short draw_mode);
00088 extern PG_PASCAL (void) pgScaleGrafDevice (paige_rec_ptr pg);
00089 extern PG_PASCAL (pg_region) pgScrollRect (paige_rec_ptr pg, rectangle_ptr rect, long distance_h,
00090         long distance_v, rectangle_ptr affected_area, short draw_mode);
00091 extern PG_PASCAL (void) pgEraseRect (pg_globals_ptr globals, rectangle_ptr rect,
00092         pg_scale_ptr scaling, co_ordinate_ptr offset_extra);
00093 extern PG_PASCAL (pg_short_t) pgMeasureText (paige_rec_ptr pg, short measure_verb, pg_char_ptr data,
00094         long length, long slop, long num_spaces, pg_text_int PG_FAR *positions,
00095         style_walk_ptr walker);
00096 extern PG_PASCAL (pg_boolean) pgTransColor (pg_globals_ptr globals, color_value_ptr color);
00097 extern PG_PASCAL (pg_boolean) pgEqualColor (color_value_ptr color1, color_value_ptr color2);
00098 extern PG_PASCAL (short) pgScalePointSize (paige_rec_ptr pg, style_walk_ptr walker,
00099         pg_char_ptr text, long length, pg_boolean PG_FAR *did_scale);
00100 extern PG_PASCAL (void) pgDrawWordUnderline (paige_rec_ptr pg, style_walk_ptr walker,
00101         short draw_bits, pg_char_ptr text, pg_short_t offset, pg_short_t length,
00102         long extra, draw_points_ptr draw_position);
00103 extern PG_PASCAL (short) pgSystemDirection (pg_globals_ptr globals);
00104 extern PG_PASCAL (short) pgGlobalStrCopy (pg_char_ptr src_str, pg_char_ptr target_str,
00105         short max_target_size);
00106 extern PG_PASCAL (void) pgFixFontName (font_info_ptr font);
00107 extern PG_PASCAL (pg_boolean) pgIsRealFont(pg_globals_ptr globals, font_info_ptr font, pg_boolean use_alternate);
00108 extern PG_PASCAL (short) SpecialUnderline (style_info_ptr style);
00109 extern PG_PASCAL (pg_fixed) pgPointsizeToScreen (pg_ref pg, pg_fixed pointsize);
00110 extern PG_PASCAL (pg_fixed) pgScreenToPointsize (pg_ref pg, pg_fixed screensize);
00111 extern PG_PASCAL (void) pgOSToPgColor (const pg_plat_color_value PG_FAR *os_color, color_value_ptr pg_color);
00112 extern PG_PASCAL (void) pgColorToOS (const color_value_ptr pg_color, pg_plat_color_value PG_FAR *os_color);
00113 extern PG_PASCAL (long) pgDeviceResolution (graf_device_ptr device);
00114 extern PG_PASCAL (void) pgTransLiterate (pg_char_ptr text, long length, pg_char_ptr target,
00115         pg_boolean do_uppercase);
00116 extern PG_PASCAL (void) pgOpenPrinter (paige_rec_ptr pg_rec, graf_device_ptr print_dev,
00117         long first_position, rectangle_ptr page_rect);
00118 extern PG_PASCAL (void) pgClosePrinter (paige_rec_ptr pg_rec, graf_device_ptr print_dev);
00119 extern PG_PASCAL (pg_boolean) pgIsCaretTime(paige_rec_ptr pg);
00120 
00121 #ifdef NO_OS_INLINE
00122 
00123 extern PG_PASCAL (pg_fixed) pgMultiplyFixed (pg_fixed fix1, pg_fixed fix2);
00124 extern PG_PASCAL (pg_fixed) pgDivideFixed (pg_fixed fix1, pg_fixed fix2);
00125 extern PG_PASCAL (pg_fixed) pgRoundFixed (pg_fixed fix);
00126 extern PG_PASCAL (pg_fixed) pgFixedRatio (short n, short d);
00127 
00128 #else
00129 
00130 #define pgMultiplyFixed(fix1,fix2)  (pg_fixed)FixMul(fix1,fix2)
00131 #define pgDivideFixed(fix1,fix2)    (pg_fixed)FixDiv(fix1,fix2)
00132 #define pgRoundFixed(fix)           (pg_fixed)(((fix) + 0x00008000) & 0xFFFF0000)
00133 #define pgFixedRatio(n,d)           (pg_fixed)FixRatio(n,d)
00134 
00135 #endif
00136 
00137 #ifdef __cplusplus
00138     }
00139 #endif
00140 
00141 #endif

Generated on Wed May 31 18:19:54 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6