]> git.saurik.com Git - wxWidgets.git/blame - src/os2/colour.cpp
Fix another crash when conversion fails in Unix PostScript code.
[wxWidgets.git] / src / os2 / colour.cpp
CommitLineData
0e320a79 1/////////////////////////////////////////////////////////////////////////////
edc536d3 2// Name: src/os2/colour.cpp
0e320a79 3// Purpose: wxColour class
37f214d5 4// Author: David Webster
0e320a79 5// Modified by:
37f214d5 6// Created: 10/13/99
37f214d5 7// Copyright: (c) David Webster
65571936 8// Licence: wxWindows licence
0e320a79
DW
9/////////////////////////////////////////////////////////////////////////////
10
37f214d5
DW
11// For compilers that support precompilation, includes "wx.h".
12#include "wx/wxprec.h"
0e320a79 13
40989e46
WS
14#include "wx/colour.h"
15
4fe9efc1 16#ifndef WX_PRECOMP
dd05139a 17 #include "wx/gdicmn.h"
4fe9efc1
SN
18#endif
19
37f214d5
DW
20#define INCL_GPI
21#define INCL_PM
22#include<os2.h>
0e320a79 23
0e320a79
DW
24// Colour
25
aad6765c 26void wxColour::Init()
0e320a79 27{
aad6765c 28 m_bIsInit = false;
a0606634
DW
29 m_vPixel = 0;
30 m_cRed = m_cBlue = m_cGreen = 0;
aad6765c
JS
31} // end of wxColour::Init
32
6b5d2431 33wxColour::wxColour( const wxColour& rCol )
0e320a79 34{
6d63b094 35 *this = rCol;
a0606634 36} // end of wxColour::wxColour
0e320a79 37
6b5d2431 38wxColour& wxColour::operator= (const wxColour& rCol)
0e320a79 39{
a0606634
DW
40 m_cRed = rCol.m_cRed;
41 m_cGreen = rCol.m_cGreen;
42 m_cBlue = rCol.m_cBlue;
43 m_bIsInit = rCol.m_bIsInit;
44 m_vPixel = rCol.m_vPixel;
45 return *this;
46} // end of wxColour& wxColour::operator =
0e320a79 47
aad6765c 48wxColour::~wxColour()
0e320a79 49{
a0606634 50} // end of wxColour::~wxColour
0e320a79 51
aea95b1c 52void wxColour::InitRGBA( unsigned char cRed,
6b5d2431 53 unsigned char cGreen,
aea95b1c
VZ
54 unsigned char cBlue,
55 unsigned char WXUNUSED(calpha) )
0e320a79 56{
a0606634
DW
57 m_cRed = cRed;
58 m_cGreen = cGreen;
59 m_cBlue = cBlue;
aad6765c 60 m_bIsInit = true;
26ac77db 61 m_vPixel = OS2RGB (m_cRed, m_cGreen, m_cBlue);
a0606634 62} // end of wxColour::Set