|
Packit |
908522 |
/* Copyright (C) 2014 The cairomm Development Team
|
|
Packit |
908522 |
*
|
|
Packit |
908522 |
* This library is free software; you can redistribute it and/or
|
|
Packit |
908522 |
* modify it under the terms of the GNU Library General Public
|
|
Packit |
908522 |
* License as published by the Free Software Foundation; either
|
|
Packit |
908522 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit |
908522 |
*
|
|
Packit |
908522 |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
908522 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
908522 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
908522 |
* Library General Public License for more details.
|
|
Packit |
908522 |
*
|
|
Packit |
908522 |
* You should have received a copy of the GNU Library General Public
|
|
Packit |
908522 |
* License along with this library; if not, write to the Free Software
|
|
Packit |
908522 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
Packit |
908522 |
* 02110-1301, USA.
|
|
Packit |
908522 |
*/
|
|
Packit |
908522 |
|
|
Packit |
908522 |
#ifndef __CAIROMM_SCRIPT_SURFACE_H
|
|
Packit |
908522 |
#define __CAIROMM_SCRIPT_SURFACE_H
|
|
Packit |
908522 |
|
|
Packit |
908522 |
#include <cairomm/surface.h>
|
|
Packit |
908522 |
#include <cairomm/script.h>
|
|
Packit |
908522 |
|
|
Packit |
908522 |
namespace Cairo {
|
|
Packit |
908522 |
|
|
Packit |
908522 |
#ifdef CAIRO_HAS_SCRIPT_SURFACE
|
|
Packit |
908522 |
|
|
Packit |
908522 |
/**
|
|
Packit |
908522 |
* The script surface provides the ability to render to a native script that
|
|
Packit |
908522 |
* matches the cairo drawing model. The scripts can be replayed using tools under
|
|
Packit |
908522 |
* the util/cairo-script directoriy, or with cairo-perf-trace.
|
|
Packit |
908522 |
*
|
|
Packit |
908522 |
* @since 1.12
|
|
Packit |
908522 |
*/
|
|
Packit |
908522 |
class ScriptSurface : public Surface {
|
|
Packit |
908522 |
public:
|
|
Packit |
908522 |
|
|
Packit |
908522 |
/**
|
|
Packit |
908522 |
* Create a C++ wrapper for the C instance. This C++ instance should then be
|
|
Packit |
908522 |
* given to a RefPtr.
|
|
Packit |
908522 |
*
|
|
Packit |
908522 |
* @param cobject The C instance.
|
|
Packit |
908522 |
* @param has_reference whether we already have a reference. Otherwise, the
|
|
Packit |
908522 |
* constructor will take an extra reference.
|
|
Packit |
908522 |
*
|
|
Packit |
908522 |
* @since 1.12
|
|
Packit |
908522 |
*/
|
|
Packit |
908522 |
explicit ScriptSurface(cairo_surface_t* cobject, bool has_reference = false);
|
|
Packit |
908522 |
virtual ~ScriptSurface();
|
|
Packit |
908522 |
|
|
Packit |
908522 |
/**
|
|
Packit |
908522 |
* Create a new surface that will emit its rendering through script.
|
|
Packit |
908522 |
*
|
|
Packit |
908522 |
* Throws an exception on error.
|
|
Packit |
908522 |
*
|
|
Packit |
908522 |
* @param script The script (output device)
|
|
Packit |
908522 |
* @param content The content of the surface
|
|
Packit |
908522 |
* @param width Width in pixels
|
|
Packit |
908522 |
* @param height Height in pixels
|
|
Packit |
908522 |
*
|
|
Packit |
908522 |
* @since 1.12
|
|
Packit |
908522 |
*/
|
|
Packit |
908522 |
static RefPtr<ScriptSurface> create(const RefPtr<Script>& script,
|
|
Packit |
908522 |
Content content, double width, double height);
|
|
Packit |
908522 |
|
|
Packit |
908522 |
/**
|
|
Packit |
908522 |
* Create a proxy surface that will render to target and record the operations
|
|
Packit |
908522 |
* to device.
|
|
Packit |
908522 |
*
|
|
Packit |
908522 |
* Throws an exception on error.
|
|
Packit |
908522 |
*
|
|
Packit |
908522 |
* @param script The script (output device)
|
|
Packit |
908522 |
* @param target A target surface to wrap
|
|
Packit |
908522 |
*
|
|
Packit |
908522 |
* @since 1.12
|
|
Packit |
908522 |
*/
|
|
Packit |
908522 |
static RefPtr<ScriptSurface> create_for_target(const RefPtr<Script>& script,
|
|
Packit |
908522 |
const RefPtr<Surface>& target);
|
|
Packit |
908522 |
};
|
|
Packit |
908522 |
|
|
Packit |
908522 |
#endif // CAIRO_HAS_SCRIPT_SURFACE
|
|
Packit |
908522 |
|
|
Packit |
908522 |
} // namespace Cairo
|
|
Packit |
908522 |
|
|
Packit |
908522 |
#endif //__CAIROMM_SCRIPT_SURFACE_H
|
|
Packit |
908522 |
|