home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
odtlktv4.zip
/
ODTLKT
/
TOOLKIT
/
SAMPLES
/
OPENDOC
/
PARTS
/
TTAPE1
/
TTAPE1.HPP
< prev
next >
Wrap
Text File
|
1995-12-15
|
6KB
|
163 lines
/***********************************************************************
*
* File Name : TTAPE1.HPP
*
* Description : TickerTape1Part class header file.
*
* Notes : N/A
*
* (C) COPYRIGHT International Business Machines Corp. 1995
* All Rights Reserved
* Licensed Materials - Property of IBM
*
* US Government Users Restricted Rights - Use, duplication or
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*
* DISCLAIMER OF WARRANTIES. The following [enclosed] code is
* sample code created by IBM Corporation. This sample code is not
* part of any standard or IBM product and is provided to you solely
* for the purpose of assisting you in the development of your
* applications. The code is provided "AS IS", without
* warranty of any kind. IBM shall not be liable for any damages
* arising out of your use of the sample code, even if they have been
* advised of the possibility of such damages.
*
***********************************************************************/
#ifndef _TTAPE1_HPP_
#define _TTAPE1_HPP_
#ifndef SOM_Module_CmdDefs_OpenDoc_Commands_defined
#include "cmddefs.xh"
#endif
/*
* The default routine which handles messages to the PM timer window.
*/
static PFNWP frameProc;
#define double_t double
#define ODFixedToFloat(a) ((ODFixed)(a) / 65536.0)
#define ODFloatToFixed(a) ((ODFixed)((double_t)(a) * 65536.0))
#define FIXED2LONG(f) (((f) + 0x8000) >> 16)
#define RATE 150UL // Initial scroll rate.
/*
* The Ticker Tape 1 module name is defined for obtaining module
* resources such as the default Ticker Tape text and error messages.
*/
#define MODULENAME "TTAPE1.DLL"
/*
* Ticker Tape 1 part storage unit properties.
*/
const ODPropertyName kODPropTickerTapeAttr = "+//ISO 9070/ANSI::113722::US::CI LABS::IBM:TickerTape:Attributes";
/*
* Ticker Tape 1 values types to add to the storage unit properties.
*/
const ODValueType kTickerTape1AttrType = "+//ISO 9070/ANSI::113722::US::CI LABS::IBM:TickerTape1:Attributes";
const ODValueType kTickerTape1TextType = "+//ISO 9070/ANSI::113722::US::CI LABS::IBM:TickerTape1:Text";
/*
* Ticker Tape 1 types for the OpenDoc registration process.
*/
const ODType kPartHandlerName = "TickerTape1Part";
const ODType kPartHandlerDisplayName = "Ticker Tape 1 Part";
const ODType kKindTickerTape1Part = "+//ISO 9070/ANSI::113722::US::CI LABS::IBM:TickerTape1Part:ttape1";
const ODType kTickerTape1KindDisplayName = "Ticker Tape 1 Kind";
const ODType kTickerTape1Category = "text";
/*
* Ticker Tape 1 constants.
*/
const unsigned MESSAGESIZE = 60; /* Max size of a message string. */
const unsigned TTAPE1_HEIGHT = 40; /* Init height of Ticker Tape box. */
const unsigned TTAPE1_WIDTH = 240; /* Init width of Ticker Tape box. */
const unsigned SMALLICONSIZE = 16; /* Length of one side of small icon. */
const unsigned LARGEICONSIZE = 32; /* Length of one side of large icon. */
const unsigned THUMBNAILSIZE = 64; /* Length of one side of thumbnail. */
/*
* Resource identifiers for selecting the Popup menu resource and
* message resources from the message table resource.
*/
#define RESID_TOPMENU 100
#define RESID_EDMENU 101
#define RESID_ROOTMENU 102
#define RESID_SELECTEDMENU 103
#define RESID_WHENSELECTEDMENU 104
#define ID_POPUPMENU 105
#define IDM_WELCOME 106
#define IDM_OPENTEXTFILE 107
#define IDM_ERROROPENING 108
#define IDM_ERRORFILEINFO 109
#define IDM_ERRORSIZEFILE 110
#define IDM_ERRORREADING 111
#define IDB_BMP1 112
#define IDMA_COLOR_BASE MENUID_ACTIVEPART_USER
#define IDMA_COLOR_GRAY IDMA_COLOR_BASE+1
#define IDMA_COLOR_RED IDMA_COLOR_BASE+2
#define IDMA_COLOR_GREEN IDMA_COLOR_BASE+3
#define IDMA_COLOR_YELLOW IDMA_COLOR_BASE+4
#define IDMA_COLOR_BLUE IDMA_COLOR_BASE+5
#define IDMA_COLOR_MAGENTA IDMA_COLOR_BASE+6
#define IDMA_COLOR_CYAN IDMA_COLOR_BASE+7
#define IDMA_COLOR_WHITE IDMA_COLOR_BASE+8
#define IDMP_COLOR_BASE MENUID_ACTIVEPART_USER +42
#define IDMP_SHOWAS MENUID_ACTIVEPART_USER +43
#define IDMP_FILE_OPEN MENUID_ACTIVEPART_USER +44
#define IDMP_PRINT MENUID_ACTIVEPART_USER +451
#define IDMA_PRINT MENUID_ACTIVEPART_FIRST + 202
#define IDMA_BACKGROUND MENUID_ACTIVEPART_FIRST + 203
#define IDMA_FILENAME MENUID_ACTIVEPART_FIRST + 204
/*
* The color the Container uses to draw itself.
*/
typedef long RGBColor;
/*
* OpenDoc class utility for constructing an ODRectl object from a RECTL.
*/
class ODRECTL : public RECTL
{
public:
operator ODRect() const { ODRect rct = {
MAKEFIXED(xLeft,0),
MAKEFIXED(yTop,0),
MAKEFIXED(xRight,0),
MAKEFIXED(yBottom,0)
}; return rct; } ;
ODRECTL( ODRect rct) {
xLeft = FIXED2LONG(rct.left);
yBottom = FIXED2LONG(rct.bottom);
xRight = FIXED2LONG(rct.right);
yTop = FIXED2LONG(rct.top);
};
ODRECTL( ODPoint botLeft, ODPoint topRight) {
xLeft = FIXED2LONG(botLeft.x);
yBottom = FIXED2LONG(botLeft.y);
xRight = FIXED2LONG(topRight.x);
yTop = FIXED2LONG(topRight.y);
};
ODRECTL( ) { xLeft = yBottom = xRight = yTop = 0; };
ODRECTL( RECTL & rct) { *this = *(ODRECTL *)&rct ;}
};
/*
* Utility macro for releasing an OpenDoc ref-counted object.
*/
#define ODReleaseObject(ev, object) \
do{ \
if (object!=kODNULL) { \
object->Release(ev); \
object = kODNULL; \
} \
}while(0)
#endif // _TTAPE1_HPP_