home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1996 November
/
VPR9611B.ISO
/
vabasic
/
ntclnt.exe
/
DISK8
/
data.8
/
datab
/
INCLUDE
/
VWFONT.HH
< prev
next >
Wrap
Text File
|
1996-07-29
|
6KB
|
219 lines
//--------------------------------------------------------------
// $Source: /rcs/vwrcs/components/vwfont.hh,v $
// Checked in by: $Author: robert $
// $Date: 1996/07/06 02:37:10 $ $Revision: 1.14 $
//--------------------------------------------------------------
// Copyright (c) International Business Machines Inc, 1994
// Copyright(c) 1993, Visual Edge Software Ltd.
//
// ALL RIGHTS RESERVED. This notice is intended as a precaution
// against inadvertent publication, and shall not be deemed to
// consitute an acknowledgment that publication has occurred
// nor to imply any waiver of confidentiality. The year included
// in the notice is the year of the creation of the work.
//--------------------------------------------------------------
// DESCRIPTION:
// This file contains the class declaration for the
// VwFont class. The VwFont class implements
// the common functionality of all the Viper components
// that have a graphical user interface.
//--------------------------------------------------------------
#ifndef VWFONT_HH
#define VWFONT_HH
#include <dllclass.hh>
VCLASS VwFont;
#ifdef VSYS_WININTEL
VCLASS VwpFont;
VCLASS VwiFont;
typedef VwiFont* ToolkitFont;
#else
typedef XmFontList ToolkitFont;
typedef XFontSet ToolkitFontSet;
#endif
typedef struct VwFontList {
unsigned int refcount;
ToolkitFont fontlist;
#ifdef VSYS_UNIX
ToolkitFontSet fontset;
#endif
} VwFontList;
#ifdef VSYS_UNIX
#ifndef DEFAULT_SYS_FONT_NAME
#define DEFAULT_SYS_FONT_NAME "helvetica"
#endif
#ifndef DEFAULT_SYS_FONT_SIZE
#define DEFAULT_SYS_FONT_SIZE 8
#endif
#endif // VSYS_UNIX
#ifdef VSYS_WINDOWS
#ifndef DEFAULT_SYS_FONT_NAME
#define DEFAULT_SYS_FONT_NAME "MS Sans Serif"
#endif
#ifndef DEFAULT_SYS_FONT_SIZE
#define DEFAULT_SYS_FONT_SIZE 8
#endif
#endif // VSYS_WINDOWS
#ifdef VSYS_OS2
#ifndef DEFAULT_SYS_FONT_NAME
#define DEFAULT_SYS_FONT_NAME "Helv"
#endif
#ifndef DEFAULT_SYS_FONT_SIZE
#define DEFAULT_SYS_FONT_SIZE 8
#endif
#endif // VSYS_OS2
#define DEFAULT_SYS_FONT_FOUNDRY "*"
#ifdef VW_NO_FONT_BOLD
#define DEFAULT_SYS_FONT_BOLD VwFalse
#else
#define DEFAULT_SYS_FONT_BOLD VwTrue
#endif
#define DEFAULT_SYS_FONT_ITALIC VwFalse
#define DEFAULT_SYS_FONT_STRIKETHRU VwFalse
#define DEFAULT_SYS_FONT_UNDERLINE VwFalse
// Must also define the compatible fonts
#ifdef VSYS_UNIX
#ifndef COMPATIBLE_SYS_FONT_NAME
#define COMPATIBLE_SYS_FONT_NAME "helvetica"
#endif
#ifndef COMPATIBLE_SYS_FONT_SIZE
#define COMPATIBLE_SYS_FONT_SIZE 8
#endif
#endif // VSYS_UNIX
#ifdef VSYS_WINDOWS
#ifndef COMPATIBLE_SYS_FONT_NAME
#define COMPATIBLE_SYS_FONT_NAME "MS Sans Serif"
#endif
#ifndef COMPATIBLE_SYS_FONT_SIZE
#define COMPATIBLE_SYS_FONT_SIZE 8
#endif
#endif // VSYS_WINDOWS
#ifdef VSYS_OS2
#ifndef COMPATIBLE_SYS_FONT_NAME
#define COMPATIBLE_SYS_FONT_NAME "Helv"
#endif
#ifndef COMPATIBLE_SYS_FONT_SIZE
#define COMPATIBLE_SYS_FONT_SIZE 8
#endif
#endif // VSYS_OS2
#define COMPATIBLE_SYS_FONT_FOUNDRY "*"
#define COMPATIBLE_SYS_FONT_BOLD VwTrue
#define COMPATIBLE_SYS_FONT_ITALIC VwFalse
#define COMPATIBLE_SYS_FONT_STRIKETHRU VwFalse
#define COMPATIBLE_SYS_FONT_UNDERLINE VwFalse
VCLASS VwFont : public VeDllBasedClass {
public:
VOPERDECL VwFont ( VTDisplay aDisplay = 0);
VOPERDECL VwFont ( VeString aFontFoundry,
VeString aFontName,
float aFontSize,
VwBool aFontBold,
VwBool aFontItalic,
VwBool aFontStrikethru,
VwBool aFontUnderline,
VTDisplay aDisplay = 0);
VOPERDECL ~VwFont ();
VVIRTUALDECL(status_t) PutFont (
VeString aFontFoundry,
VeString aFontName,
float aFontSize,
VwBool aFontBold = DEFAULT_SYS_FONT_BOLD,
VwBool aFontItalic = DEFAULT_SYS_FONT_ITALIC,
VwBool aFontStrikethru = DEFAULT_SYS_FONT_STRIKETHRU,
VwBool aFontUnderline = DEFAULT_SYS_FONT_UNDERLINE);
VVIRTUALDECL(VwBool) FontBold ();
VVIRTUALDECL(status_t) PutFontBold ( VwBool );
VVIRTUALDECL(VwBool) FontItalic ();
VVIRTUALDECL(status_t) PutFontItalic ( VwBool );
VVIRTUALDECL(const char *) FontFoundry ();
VVIRTUALDECL(status_t) PutFontFoundry ( char * );
VVIRTUALDECL(const char *) FontName ();
VVIRTUALDECL(status_t) PutFontName ( char * );
VVIRTUALDECL(float) FontSize ();
VVIRTUALDECL(status_t) PutFontSize ( float );
VVIRTUALDECL(VwBool) FontStrikethru ();
VVIRTUALDECL(status_t) PutFontStrikethru ( VwBool );
VVIRTUALDECL(VwBool) FontUnderline ();
VVIRTUALDECL(status_t) PutFontUnderline ( VwBool );
VVIRTUALDECL(void) Acquire ( );
VVIRTUALDECL(void) Release ( );
VVIRTUALDECL(ToolkitFont) GetToolkitFont();
VVIRTUALDECL(VwFontList*) GetVwFontList();
VVIRTUALDECL(status_t) CreateVwFontList( );
VVIRTUALDECL(status_t) CreateToolkitFont( VwFontList*);
VVIRTUALDECL(void) DelayUpdate();
VVIRTUALDECL(status_t) Update();
static VMETHODDECL(VwFont *) GetVwFont(VeString foundry,
VeString name, VwSingle size,
VwBool bold, VwBool italic,
VwBool strikethru,
VwBool underline,
VTDisplay);
static VMETHODDECL(void) DeleteCachedFonts();
static VMETHODDECL(VwFont *) GetDefaultVwFont(VTDisplay, VeString);
protected:
VeString itsFontFoundry;
VeString itsFontName;
float itsFontSize;
VwBool isFontBold;
VwBool isFontItalic;
VwBool isFontStrikethru;
VwBool isFontUnderline;
VwBool isFontDirty; // not used yet
private:
VwBool isDelayed;
VwFontList *itsVwFontList;
#ifdef VSYS_UNIX
VTDisplay itsDisplay;
#endif
VMETHODDECL(void) Init ();
};
#endif