TWIN32 compatibility added; wxMotif uses wxGTK's wxPostScriptDC;

wxByte replaces byte (can conflict with windows.h)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1999-01-19 18:23:02 +00:00
parent 0d2a2b601b
commit 57c208c575
68 changed files with 575 additions and 244 deletions

View File

@@ -9,10 +9,12 @@
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __WXMOTIF__
#ifdef __GNUG__
#pragma implementation
#pragma interface
#endif
#endif
#include "wx/defs.h"
@@ -28,8 +30,12 @@
#include "wx/image.h"
#include "wx/log.h"
#include <math.h>
#ifdef __WXGTK__
#include "gdk/gdk.h"
#include "gtk/gtk.h"
#endif
//-----------------------------------------------------------------------------
// start and end of document/page
@@ -784,7 +790,8 @@ void wxPostScriptDC::SetFont (const wxFont& font)
if (!font.Ok()) return;
m_font = font;
#ifdef __WXGTK__
char *name = wxTheFontNameDirectory->GetPostScriptName( m_font.GetFamily(),
m_font.GetWeight(),
m_font.GetStyle() );
@@ -794,6 +801,84 @@ void wxPostScriptDC::SetFont (const wxFont& font)
<< "/" << name << " findfont\n"
<< YLOG2DEVREL(font.GetPointSize())
<< " scalefont setfont\n";
#else
char buf[100];
const char *name;
const char *style = "";
int Style = m_font.GetStyle ();
int Weight = m_font.GetWeight ();
switch (m_font.GetFamily ())
{
case wxTELETYPE:
case wxMODERN:
name = "/Courier";
break;
case wxSWISS:
name = "/Helvetica";
break;
case wxROMAN:
// name = "/Times-Roman";
name = "/Times"; // Altered by EDZ
break;
case wxSCRIPT:
name = "/Zapf-Chancery-MediumItalic";
Style = wxNORMAL;
Weight = wxNORMAL;
break;
default:
case wxDEFAULT: // Sans Serif Font
name = "/LucidaSans";
}
if (Style == wxNORMAL && (Weight == wxNORMAL || Weight == wxLIGHT))
{
if (m_font.GetFamily () == wxROMAN)
style = "-Roman";
else
style = "";
}
else if (Style == wxNORMAL && Weight == wxBOLD)
style = "-Bold";
else if (Style == wxITALIC && (Weight == wxNORMAL || Weight == wxLIGHT))
{
if (m_font.GetFamily () == wxROMAN)
style = "-Italic";
else
style = "-Oblique";
}
else if (Style == wxITALIC && Weight == wxBOLD)
{
if (m_font.GetFamily () == wxROMAN)
style = "-BoldItalic";
else
style = "-BoldOblique";
}
else if (Style == wxSLANT && (Weight == wxNORMAL || Weight == wxLIGHT))
{
if (m_font.GetFamily () == wxROMAN)
style = "-Italic";
else
style = "-Oblique";
}
else if (Style == wxSLANT && Weight == wxBOLD)
{
if (m_font.GetFamily () == wxROMAN)
style = "-BoldItalic";
else
style = "-BoldOblique";
}
else
style = "";
strcpy (buf, name);
strcat (buf, style);
*m_pstream << buf << " findfont\n";
// *m_pstream << (m_font.GetPointSize() * m_scaleFactor) << " scalefont setfont\n";
// No scale factor in this implementation?
*m_pstream << (m_font.GetPointSize()) << " scalefont setfont\n";
#endif
}
void wxPostScriptDC::SetPen( const wxPen& pen )

View File

@@ -48,7 +48,7 @@ wxWave::wxWave(const wxString& sFileName, bool isResource)
Create(sFileName, isResource);
}
wxWave::wxWave(int size, const byte* data)
wxWave::wxWave(int size, const wxByte* data)
: m_waveLength(0), m_isResource(FALSE), m_waveData(NULL)
{
Create(size, data);
@@ -80,7 +80,7 @@ bool wxWave::Create(const wxString& fileName, bool isResource)
m_waveLength = (int) fileWave.Length();
m_waveData = new byte[m_waveLength];
m_waveData = new wxByte[m_waveLength];
if (!m_waveData)
{
return FALSE;
@@ -92,12 +92,12 @@ bool wxWave::Create(const wxString& fileName, bool isResource)
}
}
bool wxWave::Create(int size, const byte* data)
bool wxWave::Create(int size, const wxByte* data)
{
Free();
m_isResource = FALSE;
m_waveLength=size;
m_waveData = new byte[size];
m_waveData = new wxByte[size];
if (!m_waveData)
{
return FALSE;