Build fixes for using Cairo on MSW.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67816 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -396,6 +396,11 @@ def main(scriptName, args):
|
|||||||
args.append("BUILD=release")
|
args.append("BUILD=release")
|
||||||
else:
|
else:
|
||||||
args.append("BUILD=debug")
|
args.append("BUILD=debug")
|
||||||
|
|
||||||
|
if options.shared:
|
||||||
|
args.append("SHARED=1")
|
||||||
|
if options.cairo:
|
||||||
|
args.append("USE_CAIRO=1")
|
||||||
|
|
||||||
wxBuilder = builder.MSVCBuilder()
|
wxBuilder = builder.MSVCBuilder()
|
||||||
|
|
||||||
@@ -416,11 +421,7 @@ def main(scriptName, args):
|
|||||||
|
|
||||||
if options.clean:
|
if options.clean:
|
||||||
print "Performing cleanup."
|
print "Performing cleanup."
|
||||||
wxBuilder.clean()
|
wxBuilder.clean(dir=buildDir, options=args)
|
||||||
|
|
||||||
if options.wxpython:
|
|
||||||
exitIfError(wxBuilder.clean(os.path.join(contribDir, "gizmos")), "Error building gizmos")
|
|
||||||
exitIfError(wxBuilder.clean(os.path.join(contribDir, "stc")), "Error building stc")
|
|
||||||
|
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
@@ -430,21 +431,12 @@ def main(scriptName, args):
|
|||||||
if not sys.platform.startswith("win"):
|
if not sys.platform.startswith("win"):
|
||||||
args.append("--jobs=" + options.jobs)
|
args.append("--jobs=" + options.jobs)
|
||||||
exitIfError(wxBuilder.build(dir=buildDir, options=args), "Error building")
|
exitIfError(wxBuilder.build(dir=buildDir, options=args), "Error building")
|
||||||
|
|
||||||
if options.wxpython and os.path.exists(contribDir):
|
|
||||||
exitIfError(wxBuilder.build(os.path.join(contribDir, "gizmos"), options=args), "Error building gizmos")
|
|
||||||
exitIfError(wxBuilder.build(os.path.join(contribDir, "stc"),options=args), "Error building stc")
|
|
||||||
|
|
||||||
if options.install:
|
if options.install:
|
||||||
extra=None
|
extra=None
|
||||||
if installDir:
|
if installDir:
|
||||||
extra = ['DESTDIR='+installDir]
|
extra = ['DESTDIR='+installDir]
|
||||||
wxBuilder.install(dir=buildDir, options=extra)
|
wxBuilder.install(dir=buildDir, options=extra)
|
||||||
|
|
||||||
if options.wxpython and os.path.exists(contribDir):
|
|
||||||
exitIfError(wxBuilder.install(os.path.join(contribDir, "gizmos"), options=extra), "Error building gizmos")
|
|
||||||
exitIfError(wxBuilder.install(os.path.join(contribDir, "stc"), options=extra), "Error building stc")
|
|
||||||
|
|
||||||
|
|
||||||
if options.install and options.mac_framework:
|
if options.install and options.mac_framework:
|
||||||
|
|
||||||
|
@@ -89,17 +89,21 @@ class Builder:
|
|||||||
|
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
def clean(self, dir=None, projectFile=None):
|
def clean(self, dir=None, projectFile=None, options=None):
|
||||||
"""
|
"""
|
||||||
dir = the directory containing the project file
|
dir = the directory containing the project file
|
||||||
projectFile = Some formats need to explicitly specify the project file's name
|
projectFile = Some formats need to explicitly specify the project file's name
|
||||||
"""
|
"""
|
||||||
|
|
||||||
args = [self.getProgramPath(), "clean"]
|
|
||||||
if dir:
|
|
||||||
args.append(dir)
|
|
||||||
if self.isAvailable():
|
if self.isAvailable():
|
||||||
result = runInDir(args)
|
if options:
|
||||||
|
optionList = list(options)
|
||||||
|
else:
|
||||||
|
optionList = []
|
||||||
|
|
||||||
|
optionList.insert(0, self.getProgramPath())
|
||||||
|
optionList.append("clean")
|
||||||
|
|
||||||
|
result = runInDir(optionList, dir)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
@@ -132,11 +132,12 @@ public:
|
|||||||
wxDL_VOIDMETHOD_DEFINE( cairo_translate,
|
wxDL_VOIDMETHOD_DEFINE( cairo_translate,
|
||||||
(cairo_t *cr, double tx, double ty), (cr, tx, ty) )
|
(cairo_t *cr, double tx, double ty), (cr, tx, ty) )
|
||||||
|
|
||||||
|
#if wxUSE_PANGO
|
||||||
wxDL_VOIDMETHOD_DEFINE( pango_cairo_update_layout,
|
wxDL_VOIDMETHOD_DEFINE( pango_cairo_update_layout,
|
||||||
(cairo_t *cr, PangoLayout *layout), (cr, layout) )
|
(cairo_t *cr, PangoLayout *layout), (cr, layout) )
|
||||||
wxDL_VOIDMETHOD_DEFINE( pango_cairo_show_layout,
|
wxDL_VOIDMETHOD_DEFINE( pango_cairo_show_layout,
|
||||||
(cairo_t *cr, PangoLayout *layout), (cr, layout) )
|
(cairo_t *cr, PangoLayout *layout), (cr, layout) )
|
||||||
|
#endif
|
||||||
wxDECLARE_NO_COPY_CLASS(wxCairoLibrary);
|
wxDECLARE_NO_COPY_CLASS(wxCairoLibrary);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -41,6 +41,7 @@ wxCairoLibrary::wxCairoLibrary()
|
|||||||
if ( !m_ok )
|
if ( !m_ok )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#if wxUSE_PANGO
|
||||||
m_libPangoCairo.Load("libpangocairo-1.0.so.0");
|
m_libPangoCairo.Load("libpangocairo-1.0.so.0");
|
||||||
m_ok = m_libPangoCairo.IsLoaded();
|
m_ok = m_libPangoCairo.IsLoaded();
|
||||||
if ( !m_ok )
|
if ( !m_ok )
|
||||||
@@ -48,6 +49,7 @@ wxCairoLibrary::wxCairoLibrary()
|
|||||||
m_libCairo.Unload();
|
m_libCairo.Unload();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
m_ok = InitializeMethods();
|
m_ok = InitializeMethods();
|
||||||
}
|
}
|
||||||
@@ -129,8 +131,10 @@ bool wxCairoLibrary::InitializeMethods()
|
|||||||
wxDL_METHOD_LOAD(m_libCairo, cairo_surface_destroy);
|
wxDL_METHOD_LOAD(m_libCairo, cairo_surface_destroy);
|
||||||
wxDL_METHOD_LOAD(m_libCairo, cairo_translate);
|
wxDL_METHOD_LOAD(m_libCairo, cairo_translate);
|
||||||
|
|
||||||
|
#if wxUSE_PANGO
|
||||||
wxDL_METHOD_LOAD(m_libPangoCairo, pango_cairo_update_layout);
|
wxDL_METHOD_LOAD(m_libPangoCairo, pango_cairo_update_layout);
|
||||||
wxDL_METHOD_LOAD(m_libPangoCairo, pango_cairo_show_layout);
|
wxDL_METHOD_LOAD(m_libPangoCairo, pango_cairo_show_layout);
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -301,9 +301,6 @@ private :
|
|||||||
cairo_font_slant_t m_slant;
|
cairo_font_slant_t m_slant;
|
||||||
cairo_font_weight_t m_weight;
|
cairo_font_weight_t m_weight;
|
||||||
#endif
|
#endif
|
||||||
#ifdef __WXMSW__
|
|
||||||
wxCairoContext( wxGraphicsRenderer* renderer, HDC context );
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class wxCairoBitmapData : public wxGraphicsObjectRefData
|
class wxCairoBitmapData : public wxGraphicsObjectRefData
|
||||||
@@ -332,6 +329,9 @@ public:
|
|||||||
wxCairoContext( wxGraphicsRenderer* renderer, const wxPrinterDC& dc );
|
wxCairoContext( wxGraphicsRenderer* renderer, const wxPrinterDC& dc );
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
wxCairoContext( wxGraphicsRenderer* renderer, GdkDrawable *drawable );
|
wxCairoContext( wxGraphicsRenderer* renderer, GdkDrawable *drawable );
|
||||||
|
#endif
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
wxCairoContext( wxGraphicsRenderer* renderer, HDC context );
|
||||||
#endif
|
#endif
|
||||||
wxCairoContext( wxGraphicsRenderer* renderer, cairo_t *context );
|
wxCairoContext( wxGraphicsRenderer* renderer, cairo_t *context );
|
||||||
wxCairoContext( wxGraphicsRenderer* renderer, wxWindow *window);
|
wxCairoContext( wxGraphicsRenderer* renderer, wxWindow *window);
|
||||||
@@ -1342,6 +1342,12 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, wxWindow *window)
|
|||||||
m_width = sz.x;
|
m_width = sz.x;
|
||||||
m_height = sz.y;
|
m_height = sz.y;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
m_mswSurface = cairo_win32_surface_create((HDC)window->GetHandle());
|
||||||
|
Init(cairo_create(m_mswSurface));
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCairoContext::~wxCairoContext()
|
wxCairoContext::~wxCairoContext()
|
||||||
@@ -1349,10 +1355,6 @@ wxCairoContext::~wxCairoContext()
|
|||||||
if ( m_context )
|
if ( m_context )
|
||||||
{
|
{
|
||||||
PopState();
|
PopState();
|
||||||
#ifdef __WXMSW__
|
|
||||||
m_mswSurface = cairo_win32_surface_create((HDC)window->GetHandle());
|
|
||||||
m_context = cairo_create(m_mswSurface);
|
|
||||||
#endif
|
|
||||||
PopState();
|
PopState();
|
||||||
cairo_destroy(m_context);
|
cairo_destroy(m_context);
|
||||||
}
|
}
|
||||||
@@ -1785,7 +1787,11 @@ public :
|
|||||||
virtual wxGraphicsContext * CreateContext( wxWindow* window );
|
virtual wxGraphicsContext * CreateContext( wxWindow* window );
|
||||||
|
|
||||||
virtual wxGraphicsContext * CreateMeasuringContext();
|
virtual wxGraphicsContext * CreateMeasuringContext();
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
#if wxUSE_ENH_METAFILE
|
||||||
|
virtual wxGraphicsContext * CreateContext( const wxEnhMetaFileDC& dc);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
// Path
|
// Path
|
||||||
|
|
||||||
virtual wxGraphicsPath CreatePath();
|
virtual wxGraphicsPath CreatePath();
|
||||||
@@ -1860,6 +1866,15 @@ wxGraphicsContext * wxCairoRenderer::CreateContext( const wxPrinterDC& dc)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
#if wxUSE_ENH_METAFILE
|
||||||
|
wxGraphicsContext * wxCairoRenderer::CreateContext( const wxEnhMetaFileDC& dc)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
wxGraphicsContext * wxCairoRenderer::CreateContextFromNativeContext( void * context )
|
wxGraphicsContext * wxCairoRenderer::CreateContextFromNativeContext( void * context )
|
||||||
{
|
{
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
|
Reference in New Issue
Block a user