home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1996 November
/
VPR9611B.ISO
/
vabasic
/
ntclnt.exe
/
DISK8
/
data.8
/
datab
/
INCLUDE
/
CBITMAP.HH
< prev
next >
Wrap
Text File
|
1996-07-29
|
5KB
|
146 lines
//-------------------------------------------------------------
// $Source: /rcs/crcs/utils/intel/cbitmap.hh,v $
// Checked in by: $Author: thomas $
// $Date: 1996/07/24 18:11:47 $ $Revision: 1.25 $
//--------------------------------------------------------------
// Copyright (c) International Business Machines Inc, 1994
//
// 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
// VwpBitmap class.
//--------------------------------------------------------------
#ifndef CBITMAP_HH
#define CBITMAP_HH
#include <vwglobal.hh>
#include <vtoolkit.hh>
#include <cplace.hh>
VCLASS VwpPalette;
VCLASS VePathList;
#ifdef VSYS_WINDOWS
typedef HBITMAP HDIB;
#ifdef NOTEMPLATES
# ifndef CBitmapListDefined
# define CBitmapListDefined
# define CLASSNAME VwpBitmapList
# define ENTRYTYPE VwpBitmap*
# include <mst/varray.mst>
# endif
#else
# include <varray.hh>
typedef VeArray<VwpBitmap *> VwpBitmapList;
#endif
#endif
// legacy bitmap load functions
VFUNCDECL(VwpHandle*) LoadDIB(FILE *hf);
VFUNCDECL(VwpHandle*) LoadDIB(const char *, long offset, VePathList *pathList=0);
VCLASS VwpBitmap : public VwpDC, public VwpPlaceable {
public:
VOPERDECL VwpBitmap();
VOPERDECL VwpBitmap(HBITMAP bitmap);
VOPERDECL VwpBitmap(VwpHandle *);
VOPERDECL VwpBitmap(int resourceId, long module = 0L);
VOPERDECL VwpBitmap(long, long);
// legacy constructors
VOPERDECL VwpBitmap(VwpDC* pDC, long width, long height);
virtual VOPERDECL ~VwpBitmap();
// Visual Basic functionality
VMETHODDECL(void) SetHandle(VwResHandle);
VMETHODDECL(void) SetHandle(VwpHandle *);
VMETHODDECL(VwStatus) Load(const char *fileName, long offset = 0);
VMETHODDECL(VwStatus) Load(FILE *hf);
VMETHODDECL(VwStatus) Load(void *buffer, LONG buflen);
VMETHODDECL(VwStatus) Paint(VwpDC *, VwpRect *);
VMETHODDECL(bool_t) Transparent();
VMETHODDECL(VwStatus) PutTransparent(bool_t);
VMETHODDECL(VwStatus) PutTransColor(VwResColor);
VMETHODDECL(VwStatus) PaintTransparent(VwpDC *, VwpRect *, long bcolor=0L);
#ifdef VSYS_WINDOWS
VMETHODDECL(VwStatus) PaintFullTransparent(VwpDC *, VwpRect *, long bcolor=0L);
VMETHODDECL(VwStatus) Print();
VMETHODDECL(VwStatus) Save(void *, long len);
#endif
VMETHODDECL(VwStatus) Save(const char * fileName);
VMETHODDECL(VwStatus) Save(FILE *fh);
VMETHODDECL(int) GraphicFormat();
VMETHODDECL(LONG) GraphicLength();
VMETHODDECL(VwStatus) DumpGraphic(void *buffer);
VMETHODDECL(VwResHandle) CloneGraphic();
VMETHODDECL(VwpPlaceable *) Copy();
VMETHODDECL(void) Init();
VMETHODDECL(VwBool) FreeHandle(void);
static VMETHODDECL(VwBool) CanLoadFrom(void *buffer,
LONG buflen,
VeString fileName,
FILE *file,
VwpPlaceable **placeable);
static VMETHODDECL(VwBool) DestroyCallback(VwResHandle);
// Legacy methods from VwpBitmap implementation
VMETHODDECL(void) paintPixmap(VwpDC *,RECT *rect,
long bkColor=-1L, long foColor=0L,
VwBool paintFull = VwFalse);
VINLINEDECL(VwpPalette*) GetPalette();
VINLINEDECL(LONG) Width();
VINLINEDECL(LONG) Height();
VINLINEDECL(VwResColor) TransColor();
static VMETHODDECL(VwpHandle *) LoadBitmap(const char * fileName, long offset = 0);
#ifdef VSYS_WINDOWS
static VMETHODDECL(void) ReleaseBitmaps();
VMETHODDECL(void) LoadBitmap(int resId);
#endif
VINLINEDECL(VTPixmap) GetHandle();
private:
bool_t itsTransparent;
VwResColor itsTransColor;
#ifdef VSYS_OS2
HPS itsOwnHps;
HDC itsOwnHdc;
bool_t itsBitmapSet;
static LONG theSystemColorCount;
#endif
#ifdef VSYS_WINDOWS
HBITMAP itsOldBitmapH; // this is needed for the legacy code
static VwpBitmapList* itsBitmapList;
#endif
};
#ifdef VSYS_OS2
VINLINEDEF(VwpPalette*) VwpBitmap::GetPalette() { return NULL; }
#else // WINDOWS
VINLINEDEF(VwpPalette*) VwpBitmap::GetPalette() { return itsPalette; }
#endif
VINLINEDEF(LONG) VwpBitmap::Width() { return itsSize.cx; };
VINLINEDEF(LONG) VwpBitmap::Height() { return itsSize.cy; };
VINLINEDEF(VTPixmap) VwpBitmap::GetHandle() {return (VTPixmap)PlatformHandle();};
VINLINEDEF(VwResColor) VwpBitmap::TransColor() {return itsTransColor; };
#endif