Cairo::RefPtr<Cairo::ImageSurface> surface = Cairo::ImageSurface::create (
data,
- Cairo::FORMAT_ARGB32,
+ Cairo::ImageSurface::Format::ARGB32,
width, height,
/* Cairo ARGB32 means first byte blue, second byte green, third byte red, fourth byte alpha */
- Cairo::ImageSurface::format_stride_for_width (Cairo::FORMAT_ARGB32, width)
+ Cairo::ImageSurface::format_stride_for_width(Cairo::ImageSurface::Format::ARGB32, width)
);
Cairo::RefPtr<Cairo::Context> context = Cairo::Context::create (surface);
context->rectangle (0, 0, width, height);
context->fill ();
- layout->set_alignment (Pango::ALIGN_LEFT);
+ layout->set_alignment (Pango::Alignment::LEFT);
context->set_line_width (1);
// Cairo::FontOptions fo;
copy_lib_env libxml++ "$dest"
copy_lib_env libxslt "$dest"
copy_lib_env libxml2 "$dest"
- copy_lib_env libglibmm-2.4 "$dest"
+ copy_lib_env libglibmm "$dest"
copy_lib_env libgobject "$dest"
copy_lib_env libgthread "$dest"
copy_lib_env libgmodule "$dest"
using namespace dcpomatic;
+#if CAIROMM_MAJOR_VERSION == 1 && CAIROMM_MINOR_VERSION <= 14
+#define DCPOMATIC_OLD_CAIROMM_API
+#endif
+
+#if PANGOMM_MAJOR_VERSION == 2 && PANGOMM_MINOR_VERSION <= 46
+#define DCPOMATIC_OLD_PANGOMM_API
+#endif
+
+
/** Create a Pango layout using a dummy context which we can use to calculate the size
* of the text we will render. Then we can transfer the layout over to the real context
* for the actual render.
auto context = Glib::wrap (c_context);
auto layout = Pango::Layout::create(context);
- layout->set_alignment (Pango::ALIGN_LEFT);
+#ifdef DCPOMATIC_OLD_PANGOMM_API
+ layout->set_alignment(Pango::ALIGN_LEFT);
+#else
+ layout->set_alignment(Pango::Alignment::LEFT);
+#endif
Pango::FontDescription font (font_name);
layout->set_font_description (font);
layout->set_markup (markup);
DCPOMATIC_ASSERT (image->pixel_format() == AV_PIX_FMT_BGRA);
return Cairo::ImageSurface::create (
image->data()[0],
+#ifdef DCPOMATIC_OLD_CAIROMM_API
Cairo::FORMAT_ARGB32,
+#else
+ Cairo::ImageSurface::Format::ARGB32,
+#endif
image->size().width,
image->size().height,
/* Cairo ARGB32 means first byte blue, second byte green, third byte red, fourth byte alpha */
- Cairo::ImageSurface::format_stride_for_width (Cairo::FORMAT_ARGB32, image->size().width)
+ Cairo::ImageSurface::format_stride_for_width(
+#ifdef DCPOMATIC_OLD_CAIROMM_API
+ Cairo::FORMAT_ARGB32,
+#else
+ Cairo::ImageSurface::Format::ARGB32,
+#endif
+ image->size().width
+ )
);
}
/* Border effect */
set_source_rgba (context, first.effect_colour(), fade_factor);
context->set_line_width (border_width);
+#ifdef DCPOMATIC_OLD_CAIROMM_API
context->set_line_join (Cairo::LINE_JOIN_ROUND);
+#else
+ context->set_line_join (Cairo::Context::LineJoin::ROUND);
+#endif
context->move_to (x_offset, y_offset);
layout.pango->add_to_cairo_context (context);
context->stroke ();
film->set_audio_channels(6);
film->write_metadata ();
- list<string> ignore = { "Key", "ContextID", "LastWrittenBy" };
+ list<Glib::ustring> ignore = { "Key", "ContextID", "LastWrittenBy" };
check_xml ("test/data/metadata.xml.ref", dir.string() + "/metadata.xml", ignore);
auto g = make_shared<Film>(dir);
}
void
-check_xml (xmlpp::Element* ref, xmlpp::Element* test, list<string> ignore)
+check_xml(xmlpp::Element* ref, xmlpp::Element* test, list<Glib::ustring> ignore)
{
BOOST_CHECK_EQUAL (ref->get_name (), test->get_name ());
BOOST_CHECK_EQUAL (ref->get_namespace_prefix (), test->get_namespace_prefix ());
}
void
-check_xml (boost::filesystem::path ref, boost::filesystem::path test, list<string> ignore)
+check_xml(boost::filesystem::path ref, boost::filesystem::path test, list<Glib::ustring> ignore)
{
auto ref_parser = new xmlpp::DomParser(ref.string());
auto ref_root = ref_parser->get_document()->get_root_node();
#include "lib/video_frame_type.h"
#include <dcp/types.h>
#include <dcp/verify.h>
+#include <glibmm.h>
#include <boost/filesystem.hpp>
#include <vector>
extern void check_wav_file (boost::filesystem::path ref, boost::filesystem::path check);
extern void check_mxf_audio_file (boost::filesystem::path ref, boost::filesystem::path check);
extern bool mxf_atmos_files_same (boost::filesystem::path ref, boost::filesystem::path check, bool verbose = false);
-extern void check_xml (boost::filesystem::path, boost::filesystem::path, std::list<std::string>);
+extern void check_xml(boost::filesystem::path, boost::filesystem::path, std::list<Glib::ustring>);
extern void check_ffmpeg (boost::filesystem::path, boost::filesystem::path, int audio_tolerance);
extern void check_image (boost::filesystem::path, boost::filesystem::path, double threshold = 4);
extern boost::filesystem::path test_film_dir (std::string);
opt.add_option('--wx-config', help='path to wx-config')
opt.add_option('--enable-asan', action='store_true', help='build with asan')
opt.add_option('--disable-more-warnings', action='store_true', default=False, help='disable some warnings raised by Xcode 15 with the 2.16 branch')
+ opt.add_option('--c++17', action='store_true', default=False, help='build with C++17 and libxml++-4.0')
def configure(conf):
conf.load('compiler_cxx')
if conf.options.target_windows_64 or conf.options.target_windows_32:
conf.load('winres')
+ if vars(conf.options)['c++17']:
+ cpp_std = '17'
+ conf.env.XMLPP_API = '4.0'
+ conf.env.PANGOMM_API = '2.48'
+ conf.env.CAIROMM_API = '1.16'
+ else:
+ cpp_std = '11'
+ conf.env.XMLPP_API = '2.6'
+ conf.env.PANGOMM_API = '1.4'
+ conf.env.CAIROMM_API = '1.0'
+
# Save conf.options that we need elsewhere in conf.env
conf.env.DISABLE_GUI = conf.options.disable_gui
conf.env.DISABLE_TESTS = conf.options.disable_tests
# I tried and failed to ignore these with _Pragma
'-Wno-ignored-qualifiers',
'-D_FILE_OFFSET_BITS=64',
- '-std=c++11'])
+ '-std=c++' + cpp_std])
if conf.options.disable_more_warnings:
# These are for Xcode 15.0.1 with the v2.16.x-era
conf.check_cfg(package='fontconfig', args='--cflags --libs', uselib_store='FONTCONFIG', mandatory=True)
# pangomm
- conf.check_cfg(package='pangomm-1.4', args='--cflags --libs', uselib_store='PANGOMM', mandatory=True)
+ conf.check_cfg(package='pangomm-' + conf.env.PANGOMM_API, args='--cflags --libs', uselib_store='PANGOMM', mandatory=True)
# cairomm
- conf.check_cfg(package='cairomm-1.0', args='--cflags --libs', uselib_store='CAIROMM', mandatory=True)
+ conf.check_cfg(package='cairomm-' + conf.env.CAIROMM_API, args='--cflags --libs', uselib_store='CAIROMM', mandatory=True)
# leqm_nrt
conf.check_cfg(package='leqm_nrt', args='--cflags --libs', uselib_store='LEQM_NRT', mandatory=True)
# libxml++
if conf.options.static_xmlpp:
- conf.env.STLIB_XMLPP = ['xml++-2.6']
+ conf.env.STLIB_XMLPP = ['xml++-' + conf.env.XMLPP_API]
conf.env.LIB_XMLPP = ['xml2']
else:
- conf.check_cfg(package='libxml++-2.6', args='--cflags --libs', uselib_store='XMLPP', mandatory=True)
+ conf.check_cfg(package='libxml++-' + conf.env.XMLPP_API, args='--cflags --libs', uselib_store='XMLPP', mandatory=True)
# libxmlsec
if conf.options.static_xmlsec: