1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
/*
* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of the
* License.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#pragma once
#include "mdc.h"
#include "grtpp.h"
#include "grts/structs.model.h"
#include "wbpublic_public_interface.h"
#include "model_object_impl.h"
#include "figure_common.h"
#include "badge_figure.h"
namespace bec {
class UndoAction;
};
class WBPUBLICBACKEND_PUBLIC_FUNC model_Figure::ImplData : public model_Object::ImplData
{
typedef BridgeBase super;
friend class model_Diagram::ImplData;
protected:
std::list<BadgeFigure*> _badges;
bool _resizable;
bool _connected_update_options;
bool _realizing;
ImplData(model_Figure *owner);
virtual void update_options(const std::string &key);
void finish_realize();
void member_changed(const std::string &member, const grt::ValueRef &ovalue);
void figure_resized(const base::Rect &rect);
void figure_bounds_changed(const base::Rect &rect);
virtual bool is_realizable();
void relayout_badges();
public:
mdc::CanvasView* get_canvas_view() const;
bool is_canvas_view_valid();
void set_layer(const model_LayerRef &layer);
void add_badge(BadgeFigure *badge);
void remove_badge(BadgeFigure *badge);
BadgeFigure *get_badge_with_id(const std::string &badge_id);
public:
virtual void render_mini(mdc::CairoCtx *cr);
virtual void unrealize();
virtual void highlight(const base::Color *color= 0);
virtual void unhighlight();
private:
model_Figure *self() const { return (model_Figure*)_self; }
};
|