2
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation; version 2 of the
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19
#ifndef __IMAGE_FIGURE_H__
20
#define __IMAGE_FIGURE_H__
22
#include "figure_common.h"
23
#include "wbpublic_public_interface.h"
28
class WBPUBLICBACKEND_PUBLIC_FUNC Image : public BaseFigure
30
typedef BaseFigure super;
32
mdc::ImageFigure _image;
34
bool _keep_aspect_ratio;
36
virtual bool on_click(mdc::CanvasItem *target, const MySQL::Geometry::Point &point, mdc::MouseButton button, mdc::EventState state);
37
virtual bool on_double_click(mdc::CanvasItem *target, const MySQL::Geometry::Point &point, mdc::MouseButton button, mdc::EventState state);
40
Image(mdc::Layer *layer, FigureEventHub *hub, const model_ObjectRef &self);
42
void keep_aspect_ratio(bool flag);
43
double get_aspect_ratio();
45
void set_image(cairo_surface_t *image);
47
bool set_image(const std::string &filename);
49
cairo_surface_t *get_image();
51
virtual void set_allow_manual_resizing(bool flag);