1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-05 03:50:07 +00:00

Fix for copying NamedValueSets, removed some win32 DC warnings. Removed the obj-C suffix setting from the jucer's global settings. Updated the Jucer to generate correct iPhone/iPad apps for iOS4. Renamed some of the demo build folders from "iPhone" to "iOS".

This commit is contained in:
Julian Storer 2011-01-14 15:22:44 +00:00
parent e7f4dac9f9
commit e17dfb559f
46 changed files with 194 additions and 157 deletions

View file

@ -129,19 +129,14 @@ class FontDCHolder : private DeletedAtShutdown
public:
//==============================================================================
FontDCHolder()
: dc (0), numKPs (0), size (0),
: dc (0), fontH (0), previousFontH (0), numKPs (0), size (0),
bold (false), italic (false)
{
}
~FontDCHolder()
{
if (dc != 0)
{
DeleteDC (dc);
DeleteObject (fontH);
}
deleteDCAndFont();
clearSingletonInstance();
}
@ -157,14 +152,7 @@ public:
italic = italic_;
size = size_;
if (dc != 0)
{
DeleteDC (dc);
DeleteObject (fontH);
kps.free();
}
fontH = 0;
deleteDCAndFont();
dc = CreateCompatibleDC (0);
SetMapperFlags (dc, 0);
@ -187,7 +175,7 @@ public:
if (standardSizedFont != 0)
{
if (SelectObject (dc, standardSizedFont) != 0)
if ((previousFontH = SelectObject (dc, standardSizedFont)) != 0)
{
fontH = standardSizedFont;
@ -204,14 +192,6 @@ public:
}
}
}
else
{
jassertfalse;
}
}
else
{
jassertfalse;
}
}
@ -236,12 +216,31 @@ public:
private:
//==============================================================================
HFONT fontH;
HGDIOBJ previousFontH;
HDC dc;
String fontName;
HeapBlock <KERNINGPAIR> kps;
int numKPs, size;
bool bold, italic;
void deleteDCAndFont()
{
if (dc != 0)
{
SelectObject (dc, previousFontH); // Replacing the previous font before deleting the DC avoids a warning in BoundsChecker
DeleteDC (dc);
dc = 0;
}
if (fontH != 0)
{
DeleteObject (fontH);
fontH = 0;
}
kps.free();
}
JUCE_DECLARE_NON_COPYABLE (FontDCHolder);
};

View file

@ -147,6 +147,7 @@ class WindowsBitmapImage : public Image::SharedImage
public:
//==============================================================================
HBITMAP hBitmap;
HGDIOBJ previousBitmap;
BITMAPV4HEADER bitmapInfo;
HDC hdc;
unsigned char* bitmapData;
@ -195,7 +196,7 @@ public:
(void**) &bitmapData,
0, 0);
SelectObject (hdc, hBitmap);
previousBitmap = SelectObject (hdc, hBitmap);
if (format_ == Image::ARGB && clearImage)
zeromem (bitmapData, abs (h * lineStride));
@ -205,6 +206,7 @@ public:
~WindowsBitmapImage()
{
SelectObject (hdc, previousBitmap); // Selecting the previous bitmap before deleting the DC avoids a warning in BoundsChecker
DeleteDC (hdc);
DeleteObject (hBitmap);
}