projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
No real changes, just replace -1 with wxNOT_FOUND in wxBookCtrl code.
[wxWidgets.git]
/
src
/
cocoa
/
pen.mm
diff --git
a/src/cocoa/pen.mm
b/src/cocoa/pen.mm
index 2ab4e00e2867148852e21ab4b69d627611a323fb..5ff2d91a51f8ec12a44cd0aee77e4a8540fb3420 100644
(file)
--- a/
src/cocoa/pen.mm
+++ b/
src/cocoa/pen.mm
@@
-6,15
+6,18
@@
// Created: 2003/08/02
// RCS-ID: $Id$
// Copyright: (c) 2003 David Elliott
// Created: 2003/08/02
// RCS-ID: $Id$
// Copyright: (c) 2003 David Elliott
-// Licence:
wxWidget
s licence
+// Licence:
wxWindow
s licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
+
#ifndef WX_PRECOMP
#include "wx/pen.h"
#ifndef WX_PRECOMP
#include "wx/pen.h"
+ #include "wx/bitmap.h"
+ #include "wx/colour.h"
#endif //WX_PRECOMP
#endif //WX_PRECOMP
-#include "wx/bitmap.h"
-#include "wx/co
lour
.h"
+
+#include "wx/co
coa/ObjcRef
.h"
#import <AppKit/NSColor.h>
#import <AppKit/NSColor.h>
@@
-23,7
+26,6
@@
// ========================================================================
class WXDLLEXPORT wxPenRefData: public wxGDIRefData
{
// ========================================================================
class WXDLLEXPORT wxPenRefData: public wxGDIRefData
{
- friend class WXDLLEXPORT wxPen;
public:
wxPenRefData(const wxColour& colour = wxNullColour,
int width = 1, int style = wxSOLID,
public:
wxPenRefData(const wxColour& colour = wxNullColour,
int width = 1, int style = wxSOLID,
@@
-53,7
+55,7
@@
public:
m_style = wxSTIPPLE;
}
WX_NSColor GetNSColor();
m_style = wxSTIPPLE;
}
WX_NSColor GetNSColor();
- int GetCocoaLineDash(const
f
loat **pattern);
+ int GetCocoaLineDash(const
CGF
loat **pattern);
protected:
void FreeCocoaNSColor();
void FreeCocoaDash();
protected:
void FreeCocoaNSColor();
void FreeCocoaDash();
@@
-67,36
+69,39
@@
protected:
wxDash *m_dash;
wxBitmap m_stipple;
WX_NSColor m_cocoaNSColor;
wxDash *m_dash;
wxBitmap m_stipple;
WX_NSColor m_cocoaNSColor;
-
float
*m_cocoaDash;
+
CGFloat
*m_cocoaDash;
// Predefined dash patterns
static const int scm_countDot;
// Predefined dash patterns
static const int scm_countDot;
- static const
f
loat scm_patternDot[];
+ static const
CGF
loat scm_patternDot[];
static const int scm_countLongDash;
static const int scm_countLongDash;
- static const
f
loat scm_patternLongDash[];
+ static const
CGF
loat scm_patternLongDash[];
static const int scm_countShortDash;
static const int scm_countShortDash;
- static const
f
loat scm_patternShortDash[];
+ static const
CGF
loat scm_patternShortDash[];
static const int scm_countDotDash;
static const int scm_countDotDash;
- static const float scm_patternDotDash[];
+ static const CGFloat scm_patternDotDash[];
+
+ friend class WXDLLIMPEXP_FWD_CORE wxPen;
+
private:
// Don't allow assignment
wxPenRefData& operator=(const wxPenRefData& data);
};
const int wxPenRefData::scm_countDot = 1;
private:
// Don't allow assignment
wxPenRefData& operator=(const wxPenRefData& data);
};
const int wxPenRefData::scm_countDot = 1;
-const
f
loat wxPenRefData::scm_patternDot[] = {
+const
CGF
loat wxPenRefData::scm_patternDot[] = {
1.0
};
const int wxPenRefData::scm_countLongDash = 1;
1.0
};
const int wxPenRefData::scm_countLongDash = 1;
-const
f
loat wxPenRefData::scm_patternLongDash[] = {
+const
CGF
loat wxPenRefData::scm_patternLongDash[] = {
10.0
};
const int wxPenRefData::scm_countShortDash = 1;
10.0
};
const int wxPenRefData::scm_countShortDash = 1;
-const
f
loat wxPenRefData::scm_patternShortDash[] = {
+const
CGF
loat wxPenRefData::scm_patternShortDash[] = {
5.0
};
const int wxPenRefData::scm_countDotDash = 4;
5.0
};
const int wxPenRefData::scm_countDotDash = 4;
-const
f
loat wxPenRefData::scm_patternDotDash[] = {
+const
CGF
loat wxPenRefData::scm_patternDotDash[] = {
1.0
, 1.0
, 5.0
1.0
, 1.0
, 5.0
@@
-130,13
+135,13
@@
inline wxPenRefData::wxPenRefData(const wxPenRefData& data)
m_nbDash = data.m_nbDash;
m_dash = data.m_dash;
m_stipple = data.m_stipple;
m_nbDash = data.m_nbDash;
m_dash = data.m_dash;
m_stipple = data.m_stipple;
- m_cocoaNSColor =
[data.m_cocoaNSColor retain]
;
+ m_cocoaNSColor =
wxGCSafeRetain(data.m_cocoaNSColor)
;
m_cocoaDash = NULL;
}
inline void wxPenRefData::FreeCocoaNSColor()
{
m_cocoaDash = NULL;
}
inline void wxPenRefData::FreeCocoaNSColor()
{
-
[m_cocoaNSColor release]
;
+
wxGCSafeRelease(m_cocoaNSColor)
;
m_cocoaNSColor = nil;
}
m_cocoaNSColor = nil;
}
@@
-153,7
+158,7
@@
inline WX_NSColor wxPenRefData::GetNSColor()
switch( m_style )
{
case wxTRANSPARENT:
switch( m_style )
{
case wxTRANSPARENT:
- m_cocoaNSColor =
[[NSColor clearColor] retain]
;
+ m_cocoaNSColor =
wxGCSafeRetain([NSColor clearColor])
;
break;
case wxSTIPPLE:
// wxBitmap isn't implemented yet
break;
case wxSTIPPLE:
// wxBitmap isn't implemented yet
@@
-178,13
+183,14
@@
inline WX_NSColor wxPenRefData::GetNSColor()
if(!colour_NSColor)
colour_NSColor = [NSColor clearColor];
m_cocoaNSColor = [colour_NSColor copyWithZone:nil];
if(!colour_NSColor)
colour_NSColor = [NSColor clearColor];
m_cocoaNSColor = [colour_NSColor copyWithZone:nil];
+ [wxGCSafeRetain(m_cocoaNSColor) release]; // retain in GC. no change in RR.
break;
}
}
return m_cocoaNSColor;
}
break;
}
}
return m_cocoaNSColor;
}
-int wxPenRefData::GetCocoaLineDash(const
f
loat **pattern)
+int wxPenRefData::GetCocoaLineDash(const
CGF
loat **pattern)
{
int count;
switch( m_style )
{
int count;
switch( m_style )
@@
-215,7
+221,7
@@
int wxPenRefData::GetCocoaLineDash(const float **pattern)
{
if(!m_cocoaDash)
{
{
if(!m_cocoaDash)
{
- m_cocoaDash = new
f
loat[count];
+ m_cocoaDash = new
CGF
loat[count];
for(int i=0; i<count; i++)
m_cocoaDash[i] = m_dash[i];
}
for(int i=0; i<count; i++)
m_cocoaDash[i] = m_dash[i];
}
@@
-263,12
+269,12
@@
wxPen::wxPen(const wxBitmap& stipple, int width)
m_refData = new wxPenRefData(wxNullColour,width,wxSTIPPLE,stipple);
}
m_refData = new wxPenRefData(wxNullColour,width,wxSTIPPLE,stipple);
}
-wx
ObjectRefData *wxPen::Create
RefData() const
+wx
GDIRefData *wxPen::CreateGDI
RefData() const
{
return new wxPenRefData;
}
{
return new wxPenRefData;
}
-wx
ObjectRefData *wxPen::CloneRefData(const wxObject
RefData *data) const
+wx
GDIRefData *wxPen::CloneGDIRefData(const wxGDI
RefData *data) const
{
return new wxPenRefData(*(wxPenRefData *)data);
}
{
return new wxPenRefData(*(wxPenRefData *)data);
}
@@
-321,29
+327,29
@@
void wxPen::SetStipple(const wxBitmap& Stipple)
M_PENDATA->SetStipple(Stipple);
}
M_PENDATA->SetStipple(Stipple);
}
-wxColour
&
wxPen::GetColour() const
+wxColour wxPen::GetColour() const
{
{
- return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour);
+ return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour);
}
int wxPen::GetWidth() const
{
}
int wxPen::GetWidth() const
{
- return (M_PENDATA ? M_PENDATA->m_width : 0);
+ return (M_PENDATA ? M_PENDATA->m_width : 0);
}
int wxPen::GetStyle() const
{
}
int wxPen::GetStyle() const
{
- return (M_PENDATA ? M_PENDATA->m_style : 0);
+ return (M_PENDATA ? M_PENDATA->m_style : 0);
}
int wxPen::GetJoin() const
{
}
int wxPen::GetJoin() const
{
- return (M_PENDATA ? M_PENDATA->m_join : 0);
+ return (M_PENDATA ? M_PENDATA->m_join : 0);
}
int wxPen::GetCap() const
{
}
int wxPen::GetCap() const
{
- return (M_PENDATA ? M_PENDATA->m_cap : 0);
+ return (M_PENDATA ? M_PENDATA->m_cap : 0);
}
int wxPen::GetDashes(wxDash **ptr) const
}
int wxPen::GetDashes(wxDash **ptr) const
@@
-353,7
+359,7
@@
int wxPen::GetDashes(wxDash **ptr) const
wxBitmap *wxPen::GetStipple() const
{
wxBitmap *wxPen::GetStipple() const
{
- return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL);
+ return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL);
}
WX_NSColor wxPen::GetNSColor()
}
WX_NSColor wxPen::GetNSColor()
@@
-361,7
+367,7
@@
WX_NSColor wxPen::GetNSColor()
return (M_PENDATA ? M_PENDATA->GetNSColor() : nil);
}
return (M_PENDATA ? M_PENDATA->GetNSColor() : nil);
}
-int wxPen::GetCocoaLineDash(const
f
loat **pattern)
+int wxPen::GetCocoaLineDash(const
CGF
loat **pattern)
{
if(M_PENDATA)
return M_PENDATA->GetCocoaLineDash(pattern);
{
if(M_PENDATA)
return M_PENDATA->GetCocoaLineDash(pattern);
@@
-369,4
+375,3
@@
int wxPen::GetCocoaLineDash(const float **pattern)
*pattern = NULL;
return 0;
}
*pattern = NULL;
return 0;
}
-