source: wkhtmltox/trunk/fuentes/src/lib/imagesettings.cc @ 51

Last change on this file since 51 was 51, checked in by mabarracus, 4 years ago

wip

File size: 2.2 KB
Line 
1// -*- mode: c++; tab-width: 4; indent-tabs-mode: t; eval: (progn (c-set-style "stroustrup") (c-set-offset 'innamespace 0)); -*-
2// vi:set ts=4 sts=4 sw=4 noet :
3//
4// Copyright 2010, 2011 wkhtmltopdf authors
5//
6// This file is part of wkhtmltopdf.
7//
8// wkhtmltopdf is free software: you can redistribute it and/or modify
9// it under the terms of the GNU Lesser General Public License as published by
10// the Free Software Foundation, either version 3 of the License, or
11// (at your option) any later version.
12//
13// wkhtmltopdf is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU Lesser General Public License
19// along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
20
21
22#include "imagesettings.hh"
23#include "reflect.hh"
24
25#include "dllbegin.inc"
26namespace wkhtmltopdf {
27namespace settings {
28
29template<>
30struct DLL_LOCAL ReflectImpl<CropSettings>: public ReflectClass {
31        ReflectImpl(CropSettings & c) {
32                WKHTMLTOPDF_REFLECT(left);
33                WKHTMLTOPDF_REFLECT(top);
34                WKHTMLTOPDF_REFLECT(width);
35                WKHTMLTOPDF_REFLECT(height);
36        }
37};
38
39template<>
40struct DLL_LOCAL ReflectImpl<ImageGlobal>: public ReflectClass {
41        ReflectImpl(ImageGlobal & c) {
42                WKHTMLTOPDF_REFLECT(screenWidth);
43                WKHTMLTOPDF_REFLECT(screenHeight);
44                WKHTMLTOPDF_REFLECT(quiet);
45                WKHTMLTOPDF_REFLECT(transparent);
46                WKHTMLTOPDF_REFLECT(useGraphics);
47                WKHTMLTOPDF_REFLECT(in);
48                WKHTMLTOPDF_REFLECT(out);
49                WKHTMLTOPDF_REFLECT(fmt);
50                WKHTMLTOPDF_REFLECT(quality);
51                WKHTMLTOPDF_REFLECT(loadGlobal);
52                WKHTMLTOPDF_REFLECT(loadPage);
53        }
54};
55
56CropSettings::CropSettings():
57        left(-1),
58        top(-1),
59        width(-1),
60        height(-1) {}
61
62ImageGlobal::ImageGlobal():
63        quiet(false),
64        transparent(false),
65        useGraphics(false),
66        in(""),
67        out(""),
68        fmt(""),
69        screenWidth(1024),
70        screenHeight(0),
71        quality(94),
72        smartWidth(true) {}
73
74QString ImageGlobal::get(const char * name) {
75        ReflectImpl<ImageGlobal> impl(*this);
76        return impl.get(name);
77}
78
79bool ImageGlobal::set(const char * name, const QString & value) {
80        ReflectImpl<ImageGlobal> impl(*this);
81        return impl.set(name, value);
82}
83
84
85}
86}
Note: See TracBrowser for help on using the repository browser.