/* Copyright (C) 2014 The cairomm Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ #include #include namespace Cairo { #ifdef CAIRO_HAS_SCRIPT_SURFACE Script::Script(cairo_device_t* cobject, bool has_reference) : Device(cobject, has_reference) {} Script::~Script() { // script device is destroyed in base class } void Script::add_from_recording_surface(const RefPtr& recording_surface) { auto status = cairo_script_from_recording_surface(m_cobject, recording_surface->cobj()); check_status_and_throw_exception(status); } ScriptMode Script::get_mode() const { return static_cast(cairo_script_get_mode(m_cobject)); } void Script::set_mode(ScriptMode new_mode) { cairo_script_set_mode(m_cobject, static_cast(new_mode)); } void Script::write_comment(const std::string& comment) { cairo_script_write_comment(m_cobject, comment.data(), comment.length()); } RefPtr