~valavanisalex/ubuntu/precise/inkscape/fix-943984

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/ui/widget/imagetoggler.h

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __UI_DIALOG_IMAGETOGGLER_H__
 
2
#define __UI_DIALOG_IMAGETOGGLER_H__
 
3
/*
 
4
 * Authors:
 
5
 *   Jon A. Cruz
 
6
 *   Johan B. C. Engelen
 
7
 *
 
8
 * Copyright (C) 2006-2008 Authors
 
9
 *
 
10
 * Released under GNU GPL, read the file 'COPYING' for more information
 
11
 */
 
12
 
 
13
#include <gtkmm/cellrendererpixbuf.h>
 
14
#include <gtkmm/widget.h>
 
15
 
 
16
namespace Inkscape {
 
17
namespace UI {
 
18
namespace Widget {
 
19
 
 
20
class ImageToggler : public Gtk::CellRendererPixbuf {
 
21
public:
 
22
    ImageToggler( char const *on, char const *off);
 
23
    virtual ~ImageToggler() {};
 
24
 
 
25
    sigc::signal<void, const Glib::ustring&> signal_toggled() { return _signal_toggled;}
 
26
    sigc::signal<void, GdkEvent const *> signal_pre_toggle()  { return _signal_pre_toggle; }
 
27
 
 
28
    Glib::PropertyProxy<bool> property_active() { return _property_active.get_proxy(); }
 
29
    Glib::PropertyProxy<bool> property_activatable() { return _property_activatable.get_proxy(); }
 
30
    Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixbuf> > property_pixbuf_on();
 
31
    Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixbuf> > property_pixbuf_off();
 
32
 
 
33
protected:
 
34
 
 
35
    virtual void get_size_vfunc( Gtk::Widget &widget,
 
36
                                 Gdk::Rectangle const *cell_area,
 
37
                                 int *x_offset, int *y_offset, int *width, int *height ) const;
 
38
 
 
39
 
 
40
    virtual void render_vfunc( const Glib::RefPtr<Gdk::Drawable>& window,
 
41
                               Gtk::Widget& widget,
 
42
                               const Gdk::Rectangle& background_area,
 
43
                               const Gdk::Rectangle& cell_area,
 
44
                               const Gdk::Rectangle& expose_area,
 
45
                               Gtk::CellRendererState flags );
 
46
 
 
47
    virtual bool activate_vfunc(GdkEvent *event,
 
48
                                Gtk::Widget &widget,
 
49
                                const Glib::ustring &path,
 
50
                                const Gdk::Rectangle &background_area,
 
51
                                const Gdk::Rectangle &cell_area,
 
52
                                Gtk::CellRendererState flags);
 
53
 
 
54
 
 
55
private:
 
56
    Glib::ustring _pixOnName;
 
57
    Glib::ustring _pixOffName;
 
58
 
 
59
    Glib::Property<bool> _property_active;
 
60
    Glib::Property<bool> _property_activatable;
 
61
    Glib::Property< Glib::RefPtr<Gdk::Pixbuf> > _property_pixbuf_on;
 
62
    Glib::Property< Glib::RefPtr<Gdk::Pixbuf> > _property_pixbuf_off;
 
63
 
 
64
    sigc::signal<void, const Glib::ustring&> _signal_toggled;
 
65
    sigc::signal<void, GdkEvent const *> _signal_pre_toggle;
 
66
};
 
67
 
 
68
 
 
69
 
 
70
} // namespace Widget
 
71
} // namespace UI
 
72
} // namespace Inkscape
 
73
 
 
74
 
 
75
#endif /* __UI_DIALOG_IMAGETOGGLER_H__ */
 
76
 
 
77
/*
 
78
  Local Variables:
 
79
  mode:c++
 
80
  c-file-style:"stroustrup"
 
81
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
82
  indent-tabs-mode:nil
 
83
  fill-column:99
 
84
  End:
 
85
*/
 
86
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :