~ubuntu-branches/ubuntu/quantal/mysql-workbench/quantal

« back to all changes in this revision

Viewing changes to backend/wbpublic/wbcanvas/image_figure.h

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2012-03-01 21:57:30 UTC
  • Revision ID: package-import@ubuntu.com-20120301215730-o7y8av8y38n162ro
Tags: upstream-5.2.38+dfsg
ImportĀ upstreamĀ versionĀ 5.2.38+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
 
3
 *
 
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
 
7
 * License.
 
8
 * 
 
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.
 
13
 * 
 
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
 
17
 * 02110-1301  USA
 
18
 */
 
19
#ifndef __IMAGE_FIGURE_H__
 
20
#define __IMAGE_FIGURE_H__
 
21
 
 
22
#include "figure_common.h"
 
23
#include "wbpublic_public_interface.h"
 
24
 
 
25
 
 
26
namespace wbfig {
 
27
 
 
28
  class WBPUBLICBACKEND_PUBLIC_FUNC Image : public BaseFigure
 
29
  {
 
30
    typedef BaseFigure super;
 
31
    
 
32
    mdc::ImageFigure _image;
 
33
 
 
34
    bool _keep_aspect_ratio;
 
35
 
 
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);
 
38
    
 
39
  public:
 
40
    Image(mdc::Layer *layer, FigureEventHub *hub, const model_ObjectRef &self);
 
41
 
 
42
    void keep_aspect_ratio(bool flag);
 
43
    double get_aspect_ratio();
 
44
 
 
45
    void set_image(cairo_surface_t *image);
 
46
 
 
47
    bool set_image(const std::string &filename);
 
48
    
 
49
    cairo_surface_t *get_image();
 
50
 
 
51
    virtual void set_allow_manual_resizing(bool flag);
 
52
  };  
 
53
  
 
54
};
 
55
 
 
56
#endif
 
57