Commit 862d5b48 authored by Murray Cumming's avatar Murray Cumming Committed by Murray Cumming

Added copy_to_image() as wrapper for gdk_drawable_copy_to_image(). Add a

2004-01-19  Murray Cumming  <murrayc@usa.net>

        * gdk/src/drawable.[hg|ccg]: Added copy_to_image() as wrapper for
        gdk_drawable_copy_to_image().
        * gtk/src/cellrenderertext.hg: Add a custom m4 conversion for the
        Gdk::Drawable paramter of the render() vfunc, so that it takes
        an extra reference.
parent 3e1cb9bb
Please use the mailing list (gtkmm-list@gnome.org) instead of emailing developers directly.
See the ChangeLog for up-to-date information.
Murray Cumming <murrayc@usa.net>
Daniel Elstner <daniel.elstner@gmx.net>
Former contributors:
Some former contributors:
Karl Nelson <kenelson@ece.ucdavis.edu>
Tero Pulkkinen <terop@modeemi.cs.tut.fi>
......
2004-01-19 Murray Cumming <murrayc@usa.net>
* gdk/src/drawable.[hg|ccg]: Added copy_to_image() as wrapper for
gdk_drawable_copy_to_image().
* gtk/src/cellrenderertext.hg: Add a custom m4 conversion for the
Gdk::Drawable paramter of the render() vfunc, so that it takes
an extra reference.
2004-01-16 Murray Cumming <murrayc@usa.net>
* */*.hg: All _WRAP_VFUNCS are now in protected sections, because
gmmproc no longer puts them in a separated protected section
automatically. Note also, that gmmproc now generates correct const
_vfuncs, so some of your overrides might no longer be overrides. Also,
you can add doxygen documentation before the _WRAP_VFUNC() macro now,
and it will be read by doxygen.
2004-01-14 Murray Cumming <murrayc@usa.net>
* gtk/src/treeiter.[hg}ccg]: Added TreeIter::set_stamp() and
......
Please use the mailing list (gtkmm-list@gnome.org) instead of emailing developers directly.
Murray Cumming <murrayc@usa.net>
Daniel Elstner <daniel.elstner@gmx.net>
......@@ -3,50 +3,3 @@ to find when porting apps from gtkmm 1.2 to gtkmm 2:
Some of these are explained in more details in the CHANGES file.
* Use pkg-config checks instead of the various old .m4 macros:
See the gtkmm_hello package:
http://cvs.gnome.org/lxr/source/gnomemm/gtkmm_hello/configure.in#29
* Replace gtk-- 1.2 includes with gtkmm2 includes:
e.g. #include <gtkmm/button.h> instead of <gtk--/button.h>
* Use new signal connection syntax:
e.g. change
button.clicked.connect(
to
button.signal_clicked().connect(
* Use new SigC::slot() syntax:
e.g. change
button.signal_clicked().connect(SigC::slot(this
to
button.signal_clicked().connect(SigC::slot(*this
^^^^^
* Change virtual methods overrides used for signal handling from
signalname_impl() to on_signalname().
* Do not connect to a Gtk::Window's "destroy" signal.
* You do not need to connect to Gtk::Window's "delete_event" signal just to
prevent self-destruction of the window, or to quit the application
appropriately. In most cases you should just use the new
Gtk::Main::run(window) override that shows the window and quits when it
is hidden.
* Change Gtk::Widget::set_usize() to Gtk::Widget::set_size_request() or Gtk::Window::set_default_size().
* Change Gtk::Window::set_policy() to set_resizable().
* Change Gtk::wrap() to Glib::wrap(), and gtkobj() to gobj().
* Change Gtk::Pixmap to Gtk::Image
* Change enums from GTK_FOO to Gtk::FOO and GDK_FOO to Gdk::FOO.
* Gtk::Notebook: Change set_page() to set_current_page()
* Container STL-style interfaces: items are now references rather than pointers.
For instance, change
menuList[i]->somemethod() to
menuList[i[.somemethod()
* Replace Gtk::Text with Gtk::TextView.
* Replace Gtk::CList and Gtk::CTree with Gtk::TreeView.
* See the GTK+ 2 C porting guide:
http://developer.gnome.org/doc/API/2.0/gtk/gtk-changes-2-0.html
amd the GNOME2 C porting guide:
http://developer.gnome.org/dotplan/porting/
gnomemm:
* Replace use of Gnome::Dialog with Gtk::MessageDialog.
* Replace use of Gnome::PropertyBox with a similar, but custom Window
class.
......@@ -22,7 +22,7 @@ from your PATH.
The installation procedure:
* Recent version of the following GNU utilities should be avalaible in
* Recent versions of the following GNU utilities should be avalaible in
your PATH:
make (3.79.1)
......@@ -32,7 +32,7 @@ The installation procedure:
The version information (in brackets) apply to my GNU installation.
* Assumed your compiler installation is in /opt/SUNWspro, the following
* Assuming your compiler installation is in /opt/SUNWspro, the following
environment changes are required:
PATH=/opt/SUNWspro/bin:$PATH
......
......@@ -62,10 +62,10 @@ _GTKMMPROC_H_AND_CC(#endif /* G_OS_WIN32 */)
protected:
_WRAP_VFUNC(bool do_action(int i), "do_action")
_WRAP_VFUNC(int get_n_actions(), "get_n_actions")
_WRAP_VFUNC(const char* get_description(int i), "get_description")
_WRAP_VFUNC(const char* get_name(int i), "get_name")
_WRAP_VFUNC(const char* get_keybinding(int i), "get_keybinding")
_WRAP_VFUNC(int get_n_actions() const, "get_n_actions")
_WRAP_VFUNC(const char* get_description(int i) const, "get_description")
_WRAP_VFUNC(const char* get_name(int i) const, "get_name")
_WRAP_VFUNC(const char* get_keybinding(int i) const, "get_keybinding")
_WRAP_VFUNC(bool set_description(int i, const Glib::ustring& desc), "set_description")
};
......
......@@ -46,6 +46,7 @@ public:
_WRAP_METHOD(Glib::ustring get_document_type() const, atk_document_get_document_type)
_WRAP_METHOD(gpointer get_document(), atk_document_get_document)
protected:
_WRAP_VFUNC(const gchar* get_document_type(), get_document_type)
_WRAP_VFUNC(gpointer get_document() const, get_document)
};
......
......@@ -61,6 +61,12 @@ public:
_WRAP_SIGNAL(void link_activated(), "link_activated")
_WRAP_PROPERTY("selected-link", bool)
_WRAP_PROPERTY("number-of-anchors", int)
_WRAP_PROPERTY("end-index", int)
_WRAP_PROPERTY("start-index", int)
protected:
_WRAP_VFUNC(gchar* get_uri(int i) const, get_uri)
_WRAP_VFUNC(Glib::RefPtr<Atk::Object> get_object(int i), get_object)
_WRAP_VFUNC(int get_end_index() const, get_end_index)
......@@ -69,13 +75,6 @@ public:
_WRAP_VFUNC(int get_n_anchors() const, get_n_anchors)
_WRAP_VFUNC(guint link_state() const, link_state)
_WRAP_VFUNC(bool is_selected_link() const, is_selected_link)
_WRAP_PROPERTY("selected-link", bool)
_WRAP_PROPERTY("number-of-anchors", int)
_WRAP_PROPERTY("end-index", int)
_WRAP_PROPERTY("start-index", int)
};
} // namespace Atk
......
......@@ -46,8 +46,9 @@ public:
_WRAP_METHOD(Glib::ustring get_mime_type(int i) const, atk_streamable_content_get_mime_type)
_WRAP_METHOD(Glib::RefPtr<Glib::IOChannel> get_stream(const Glib::ustring& mime_type), atk_streamable_content_get_stream)
_WRAP_VFUNC(int get_n_mime_types(), get_n_mime_types)
_WRAP_VFUNC(const gchar* get_mime_type(int i), get_mime_type)
protected:
_WRAP_VFUNC(int get_n_mime_types() const, get_n_mime_types)
_WRAP_VFUNC(const gchar* get_mime_type(int i) const, get_mime_type)
_WRAP_VFUNC(GIOChannel* get_stream(const Glib::ustring& mime_type), get_stream)
};
......
......@@ -74,12 +74,12 @@ Gtk::Widget* CellRendererPopup::get_focus_widget()
return focus_widget_;
}
SigC::Signal5<void,const Glib::ustring&,int,int,int,int>& CellRendererPopup::signal_show_popup()
CellRendererPopup::SignalShowPopup& CellRendererPopup::signal_show_popup()
{
return signal_show_popup_;
}
SigC::Signal0<void>& CellRendererPopup::signal_hide_popup()
CellRendererPopup::SignalHidePopup& CellRendererPopup::signal_hide_popup()
{
return signal_hide_popup_;
}
......@@ -92,11 +92,11 @@ void CellRendererPopup::hide_popup()
void CellRendererPopup::get_size_vfunc(Gtk::Widget& widget,
const Gdk::Rectangle* cell_area,
int* x_offset, int* y_offset,
int* width, int* height)
int* width, int* height) const
{
Gtk::CellRendererText::get_size_vfunc(widget, cell_area, x_offset, y_offset, width, height);
// We cache this becuase it takes really long to get the width.
// We cache this because it takes a really long time to get the width.
if(button_width_ < 0)
button_width_ = PopupEntry::get_button_width();
......
......@@ -18,8 +18,11 @@ public:
void set_focus_widget(Gtk::Widget& focus_widget);
Gtk::Widget* get_focus_widget();
SigC::Signal5<void,const Glib::ustring&,int,int,int,int>& signal_show_popup();
SigC::Signal0<void>& signal_hide_popup();
typedef SigC::Signal5<void,const Glib::ustring&,int,int,int,int> SignalShowPopup;
SignalShowPopup& signal_show_popup();
typedef SigC::Signal0<void> SignalHidePopup;
SignalHidePopup& signal_hide_popup();
void hide_popup();
......@@ -27,7 +30,7 @@ protected:
virtual void get_size_vfunc(Gtk::Widget& widget,
const Gdk::Rectangle* cell_area,
int* x_offset, int* y_offset,
int* width, int* height);
int* width, int* height) const;
virtual Gtk::CellEditable* start_editing_vfunc(GdkEvent* event,
Gtk::Widget& widget,
......@@ -42,10 +45,10 @@ protected:
private:
typedef CellRendererPopup Self;
SigC::Signal5<void,const Glib::ustring&,int,int,int,int> signal_show_popup_;
SigC::Signal0<void> signal_hide_popup_;
SignalShowPopup signal_show_popup_;
SignalHidePopup signal_hide_popup_;
int button_width_;
mutable int button_width_; //mutable because it is just a cache.
Gtk::Window popup_window_;
Gtk::Widget* focus_widget_;
PopupEntry* popup_entry_;
......
......@@ -20,15 +20,16 @@ public:
Glib::PropertyProxy<bool> property_active();
Glib::PropertyProxy<bool> property_radio();
SigC::Signal1<void, const Glib::ustring&>& signal_toggled();
typedef SigC::Signal1<void, const Glib::ustring&> SignalToggled;
SignalToggled& signal_toggled();
protected:
virtual void get_size_vfunc(Gtk::Widget& widget,
const Gdk::Rectangle* cell_area,
int* x_offset, int* y_offset,
int* width, int* height);
int* width, int* height) const;
virtual void render_vfunc(const Glib::RefPtr<Gdk::Window>& window,
virtual void render_vfunc(const Glib::RefPtr<Gdk::Drawable>& window,
Gtk::Widget& widget,
const Gdk::Rectangle& background_area,
const Gdk::Rectangle& cell_area,
......@@ -47,7 +48,7 @@ private:
Glib::Property<bool> property_active_;
Glib::Property<bool> property_radio_;
SigC::Signal1<void, const Glib::ustring&> signal_toggled_;
SignalToggled signal_toggled_;
};
......@@ -58,8 +59,9 @@ public:
virtual ~AppWindow();
private:
struct ModelColumns : public Gtk::TreeModel::ColumnRecord
class ModelColumns : public Gtk::TreeModel::ColumnRecord
{
public:
Gtk::TreeModelColumn<Glib::ustring> text;
Gtk::TreeModelColumn<bool> active;
......@@ -105,7 +107,7 @@ Glib::PropertyProxy<bool> MyCellRendererToggle::property_radio()
return property_radio_.get_proxy();
}
SigC::Signal1<void, const Glib::ustring&>& MyCellRendererToggle::signal_toggled()
MyCellRendererToggle::SignalToggled& MyCellRendererToggle::signal_toggled()
{
return signal_toggled_;
}
......@@ -113,7 +115,7 @@ SigC::Signal1<void, const Glib::ustring&>& MyCellRendererToggle::signal_toggled(
void MyCellRendererToggle::get_size_vfunc(Gtk::Widget&,
const Gdk::Rectangle* cell_area,
int* x_offset, int* y_offset,
int* width, int* height)
int* width, int* height) const
{
enum { TOGGLE_WIDTH = 12 };
......@@ -142,7 +144,7 @@ void MyCellRendererToggle::get_size_vfunc(Gtk::Widget&,
}
}
void MyCellRendererToggle::render_vfunc(const Glib::RefPtr<Gdk::Window>& window,
void MyCellRendererToggle::render_vfunc(const Glib::RefPtr<Gdk::Drawable>& window,
Gtk::Widget& widget,
const Gdk::Rectangle&,
const Gdk::Rectangle& cell_area,
......@@ -171,10 +173,14 @@ void MyCellRendererToggle::render_vfunc(const Glib::RefPtr<Gdk::Window>& window,
const Gtk::ShadowType shadow = (property_active_) ? Gtk::SHADOW_IN : Gtk::SHADOW_OUT;
//Cast the drawable to a Window. TODO: Maybe paint_option() should take a Drawable? murrayc.
Glib::RefPtr<Gdk::Window> window_casted = Glib::RefPtr<Gdk::Window>::cast_dynamic<>(window);
if(window_casted)
{
if(property_radio_)
{
widget.get_style()->paint_option(
window, state, shadow,
window_casted, state, shadow,
cell_area, widget, "cellradio",
cell_area.get_x() + x_offset + cell_xpad,
cell_area.get_y() + y_offset + cell_ypad,
......@@ -183,12 +189,13 @@ void MyCellRendererToggle::render_vfunc(const Glib::RefPtr<Gdk::Window>& window,
else
{
widget.get_style()->paint_check(
window, state, shadow,
window_casted, state, shadow,
cell_area, widget, "cellcheck",
cell_area.get_x() + x_offset + cell_xpad,
cell_area.get_y() + y_offset + cell_ypad,
width - 1, height - 1);
}
}
}
bool MyCellRendererToggle::activate_vfunc(GdkEvent*,
......
......@@ -70,17 +70,17 @@ Glib::RefPtr<ExampleTreeModel> ExampleTreeModel::create()
return Glib::RefPtr<ExampleTreeModel>( new ExampleTreeModel );
}
Gtk::TreeModelFlags ExampleTreeModel::get_flags_vfunc()
Gtk::TreeModelFlags ExampleTreeModel::get_flags_vfunc() const
{
return Gtk::TreeModelFlags(0);
}
int ExampleTreeModel::get_n_columns_vfunc()
int ExampleTreeModel::get_n_columns_vfunc() const
{
return m_rows[0].size(); //The number of columns in the first (same as every one) row.
}
GType ExampleTreeModel::get_column_type_vfunc(int index)
GType ExampleTreeModel::get_column_type_vfunc(int index) const
{
if(index <= (int)m_listModelColumns.size())
return m_listModelColumns[index].type();
......@@ -88,7 +88,7 @@ GType ExampleTreeModel::get_column_type_vfunc(int index)
return 0;
}
void ExampleTreeModel::get_value_vfunc(const TreeModel::iterator& iter, int column, Glib::ValueBase& value)
void ExampleTreeModel::get_value_vfunc(const TreeModel::iterator& iter, int column, Glib::ValueBase& value) const
{
if(check_treeiter_validity(iter))
{
......@@ -102,10 +102,10 @@ void ExampleTreeModel::get_value_vfunc(const TreeModel::iterator& iter, int colu
//Glib::Value< Glib::ustring > value_specific;
//value_specific.init( Glib::Value< Glib::ustring >::value_type() ); //TODO: Is there any way to avoid this step?
typeListOfRows::iterator dataRowIter = get_data_row_iter_from_tree_row_iter(iter);
typeListOfRows::const_iterator dataRowIter = get_data_row_iter_from_tree_row_iter(iter);
if(dataRowIter != m_rows.end())
{
typeRow& dataRow = *dataRowIter;
const typeRow& dataRow = *dataRowIter;
Glib::ustring result = dataRow[column];
......@@ -141,7 +141,7 @@ bool ExampleTreeModel::iter_next_vfunc(const iterator& iter, iterator& iter_next
return false; //There is no next row.
}
bool ExampleTreeModel::iter_children_vfunc(const iterator& parent, iterator& iter)
bool ExampleTreeModel::iter_children_vfunc(const iterator& parent, iterator& iter) const
{
return iter_nth_child_vfunc(parent, 0, iter);
}
......@@ -161,7 +161,7 @@ int ExampleTreeModel::iter_n_children_vfunc(const iterator& iter) const
int ExampleTreeModel::iter_n_root_children_vfunc() const
{
return 0; //There are no children
return m_rows.size();
}
bool ExampleTreeModel::iter_nth_child_vfunc(const iterator& parent, int /* n */, iterator& iter) const
......@@ -176,9 +176,23 @@ bool ExampleTreeModel::iter_nth_child_vfunc(const iterator& parent, int /* n */,
return false; //There are no children.
}
bool ExampleTreeModel::iter_nth_root_child_vfunc(int /* n */, iterator& iter) const
bool ExampleTreeModel::iter_nth_root_child_vfunc(int n, iterator& iter) const
{
iter = iterator(); //Set is as invalid, as the TreeModel documentation says that it should be.
if(n < (int)m_rows.size())
{
iter = iterator(); //clear the input parameter.
iter.set_stamp(m_stamp);
//Store the row_index in the GtkTreeIter:
//See also iter_next_vfunc()
//TODO: Store a pointer to some more complex data type such as a typeListOfRows::iterator.
unsigned row_index = n;
iter.gobj()->user_data = (void*)row_index;
return true;
}
return false; //There are no children.
}
......@@ -195,7 +209,7 @@ bool ExampleTreeModel::iter_parent_vfunc(const iterator& child, iterator& iter)
return false; //There are no children, so no parents.
}
Gtk::TreeModel::Path ExampleTreeModel::get_path_vfunc(const iterator& /* iter */)
Gtk::TreeModel::Path ExampleTreeModel::get_path_vfunc(const iterator& /* iter */) const
{
//TODO:
return Path();
......@@ -245,6 +259,15 @@ ExampleTreeModel::typeListOfRows::iterator ExampleTreeModel::get_data_row_iter_f
return m_rows.begin() + row_index; //TODO: Performance.
}
ExampleTreeModel::typeListOfRows::const_iterator ExampleTreeModel::get_data_row_iter_from_tree_row_iter(const iterator& iter) const
{
typeListOfRows::size_type row_index = (typeListOfRows::size_type)iter.gobj()->user_data;
if( row_index > m_rows.size() )
return m_rows.end();
else
return m_rows.begin() + row_index; //TODO: Performance.
}
bool ExampleTreeModel::check_treeiter_validity(const iterator& iter) const
{
// Anything that modifies the model's structure should change the model's stamp,
......
......@@ -36,22 +36,22 @@ public:
protected:
// Overrides:
virtual Gtk::TreeModelFlags get_flags_vfunc();
virtual int get_n_columns_vfunc();
virtual GType get_column_type_vfunc(int index);
virtual void get_value_vfunc(const TreeModel::iterator& iter, int column, Glib::ValueBase& value);
virtual Gtk::TreeModelFlags get_flags_vfunc() const;
virtual int get_n_columns_vfunc() const;
virtual GType get_column_type_vfunc(int index) const;
virtual void get_value_vfunc(const TreeModel::iterator& iter, int column, Glib::ValueBase& value) const;
bool iter_next_vfunc(const iterator& iter, iterator& iter_next) const;
//TODO: Make sure that we make all of these const when we have made them all const in the TreeModel:
virtual bool iter_children_vfunc(const iterator& parent, iterator& iter);
virtual bool iter_children_vfunc(const iterator& parent, iterator& iter) const;
virtual bool iter_has_child_vfunc(const iterator& iter) const;
virtual int iter_n_children_vfunc(const iterator& iter) const;
virtual int iter_n_root_children_vfunc() const;
virtual bool iter_nth_child_vfunc(const iterator& parent, int n, iterator& iter) const;
virtual bool iter_nth_root_child_vfunc(int n, iterator& iter) const;
virtual bool iter_parent_vfunc(const iterator& child, iterator& iter) const;
virtual Path get_path_vfunc(const iterator& iter);
virtual Path get_path_vfunc(const iterator& iter) const;
virtual bool get_iter_vfunc(const Path& path, iterator& iter) const;
virtual bool iter_is_valid(const iterator& iter) const;
......@@ -61,6 +61,7 @@ private:
typedef std::vector< typeRow > typeListOfRows; //Y rows.
typeListOfRows::iterator get_data_row_iter_from_tree_row_iter(const iterator& iter);
typeListOfRows::const_iterator get_data_row_iter_from_tree_row_iter(const iterator& iter) const;
bool check_treeiter_validity(const iterator& iter) const;
//The data:
......
......@@ -22,7 +22,7 @@
ExampleWindow::ExampleWindow()
: m_Button_Quit("Quit")
{
set_title("Gtk::TreeView (TreeStore) example");
set_title("Gtk::TreeView (custom TreeModel) example");
set_border_width(5);
set_default_size(400, 200);
......
......@@ -54,5 +54,11 @@ void Drawable::draw_polygon(const Glib::RefPtr<const GC>& gc, bool filled,
points.size());
}
void Drawable::copy_to_image(const Glib::RefPtr<Image>& image, int src_x, int src_y, int dest_x, int dest_y, int width, int height) const
{
gdk_drawable_copy_to_image(const_cast<GdkDrawable*>(gobj()), Glib::unwrap(image), src_x, src_y, dest_x, dest_y, width, height);
}
} // namespace Gdk
......@@ -102,9 +102,14 @@ public:
int width, int height,
RgbDither dither, int x_dither, int y_dither), gdk_draw_pixbuf)
// XXX: no 'refreturn' -- get_image() returns a newly created Image object.
// Note: This has no 'refreturn' because get_image() returns a newly created Image object.
_WRAP_METHOD(Glib::RefPtr<Image> get_image(int x, int y, int width, int height) const, gdk_drawable_get_image)
// gdk_drawable_copy_to_image() returns a new GdkImage when the image parameter is NULL, but that seems to be much the
// same as gdk_drawable_get_image().
void copy_to_image(const Glib::RefPtr<Image>& image, int src_x, int src_y, int dest_x, int dest_y, int width, int height) const;
_IGNORE(gdk_drawable_copy_to_image)
_WRAP_METHOD(Region get_clip_region() const, gdk_drawable_get_clip_region)
_WRAP_METHOD(Region get_visible_region() const, gdk_drawable_get_visible_region)
......
......@@ -54,9 +54,6 @@ public:
typedef SigC::Slot0<void> SlotActivate;
_WRAP_SIGNAL(void activate(), "activate")
_WRAP_SIGNAL(void connect_proxy(Widget* proxy), "connect_proxy", no_default_handler)
_WRAP_SIGNAL(void disconnect_proxy(Widget* proxy), "disconnect_proxy", no_default_handler)
//Used by AccelGroup:
_WRAP_METHOD(void set_accel_path(const Glib::ustring& accel_path), gtk_action_set_accel_path)
_WRAP_METHOD(void set_accel_group(const Glib::RefPtr<AccelGroup>& accel_group), gtk_action_set_accel_group)
......@@ -80,6 +77,7 @@ protected:
_WRAP_METHOD(void unblock_activate_from(Widget& proxy), gtk_action_unblock_activate_from)
protected:
//Widget-creation routines:
_WRAP_VFUNC(Widget* create_menu_item(), "create_menu_item")
_WRAP_VFUNC(Widget* create_tool_item(), "create_tool_item")
......
......@@ -64,6 +64,11 @@ public:
gtk_action_group_add_radio_actions_full)
//These are also just C convenience methods that are useless unless you are using the other convenience methods:
_IGNORE(gtk_action_group_set_translate_func, gtk_action_group_set_translation_domain)
_WRAP_SIGNAL(void connect_proxy(const Glib::RefPtr<Action>& action, Widget* proxy), "connect_proxy", no_default_handler)
_WRAP_SIGNAL(void disconnect_proxy(const Glib::RefPtr<Action>& action, Widget* proxy), "disconnect_proxy", no_default_handler)
_WRAP_SIGNAL(void pre_activate(const Glib::RefPtr<Action>& action), "pre_activate", no_default_handler)
_WRAP_SIGNAL(void post_activate(const Glib::RefPtr<Action>& action), "post_activate", no_default_handler)
};
} // namespace Gtk
......
......@@ -102,7 +102,6 @@ public:
protected:
_CTOR_DEFAULT()
//TODO: Make this appear next to the actual _vunc in the .h file:
/** Override this in derived CellRenderers.
*
* Obtains the width and height needed to render the cell. Used by view widgets
......@@ -123,7 +122,12 @@ protected:
Widget& widget,
const Gdk::Rectangle* cell_area,
int* x_offset, int* y_offset,
int* width, int* height), get_size)
int* width, int* height) const, get_size)
#m4begin
dnl This extra conversion does the extra reference, often needed by code for vfuncs and signal.
_CONVERSION(`GdkDrawable*',`const Glib::RefPtr<Gdk::Drawable>&', `Glib::wrap($3, true)')
#m4end
_WRAP_VFUNC(void render(
const Glib::RefPtr<Gdk::Drawable>& window,
......
......@@ -57,6 +57,7 @@ public:
explicit CheckButton(const Glib::ustring& label, bool mnemonic = false);
protected:
/** Emited on button redraw to update indicator.
* Triggered when the button is redrawn (e.g.after being toggled)
* Overload this signal if you want to implement your own check button
......
......@@ -60,6 +60,11 @@ public:
*/
_WRAP_SIGNAL(void toggled(), "toggled")
_WRAP_PROPERTY("active", bool)
_WRAP_PROPERTY("inconsistent", bool)
_WRAP_PROPERTY("draw-as-radio", bool)
protected:
/** Triggered when the item is redrawn (e.g.after being toggled)
* Overload this signal if you want to implement your own check item
* look. Otherwise, you most likely don't care about it.
......@@ -67,10 +72,6 @@ public:
* redrawn.
*/
_WRAP_VFUNC(void draw_indicator(GdkRectangle* area), draw_indicator)
_WRAP_PROPERTY("active", bool)
_WRAP_PROPERTY("inconsistent", bool)
_WRAP_PROPERTY("draw-as-radio", bool)
};
} /* namespace Gtk */
......
......@@ -160,21 +160,22 @@ public:
_WRAP_SIGNAL(void check_resize(), "check_resize")
_WRAP_SIGNAL(void set_focus_child(Widget* widget), "set_focus_child")
void show_all_children(bool recursive = true);
protected:
_CTOR_DEFAULT()
_WRAP_VFUNC(GtkType child_type() const, child_type)
_WRAP_VFUNC(void forall(gboolean include_internals, GtkCallback callback, gpointer callback_data), forall)
//TODO: What is this?
_WRAP_VFUNC(char* composite_name(GtkWidget* child), composite_name)
_WRAP_VFUNC(void set_child_property(GtkWidget* child, guint property_id, const GValue* value, GParamSpec* pspec), set_child_property)
_WRAP_VFUNC(void get_child_property(GtkWidget* child, guint property_id, GValue* value, GParamSpec* pspec), get_child_property)
_WRAP_VFUNC(void get_child_property(GtkWidget* child, guint property_id, GValue* value, GParamSpec* pspec) const, get_child_property)
_WRAP_PROPERTY("border_width", guint)
_WRAP_PROPERTY("resize_mode", ResizeMode)
_WRAP_PROPERTY("child", Widget*)
void show_all_children(bool recursive = true);
protected:
_CTOR_DEFAULT()
#m4begin
dnl// Hook in special code to catch explicit uses of gtk_object_destroy() by
dnl// GTK+ code, e.g. when receiving the GDK_DELETE event. For details, look
......
......@@ -72,13 +72,15 @@ public:
_WRAP_METHOD(void set_shadow_type(ShadowType type), gtk_frame_set_shadow_type)
_WRAP_METHOD(ShadowType get_shadow_type() const, gtk_frame_get_shadow_type)
_WRAP_VFUNC(void compute_child_allocation(GtkAllocation* allocation), compute_child_allocation)
_WRAP_PROPERTY("label", Glib::ustring)
_WRAP_PROPERTY("label-xalign", double)
_WRAP_PROPERTY("label-yalign", double)
_WRAP_PROPERTY("shadow-type", ShadowType)
_WRAP_PROPERTY("label-widget", Widget*)
protected:
_WRAP_VFUNC(void compute_child_allocation(GtkAllocation* allocation), compute_child_allocation)
};
} // namespace Gtk
......
......@@ -44,12 +44,6 @@ class Progress : public Widget
gtk_progress_get_value, gtk_progress_set_activity_mode, gtk_progress_get_current_text, gtk_progress_get_text_from_value,
gtk_progress_get_current_percentage,gtk_progress_get_percentage_from_value)
public:
_WRAP_VFUNC(void paint(), paint)
_WRAP_VFUNC(void update(), update)
_WRAP_VFUNC(void act_mode_enter(), act_mode_enter)
_WRAP_PROPERTY("activity-mode", bool)
_WRAP_PROPERTY("show-text", bool)
_WRAP_PROPERTY("text-xalign", float)
......@@ -58,6 +52,11 @@ public:
_MEMBER_GET_PTR(adjustment, adjustment, Adjustment*, GtkAdjustment*)
_MEMBER_GET_GOBJECT(offscreen_pixmap, offscreen_pixmap, Gdk::Pixmap, GdkPixmap*)
_MEMBER_GET(format, format, Glib::ustring, gchar*)
protected:
_WRAP_VFUNC(void paint(), paint)
_WRAP_VFUNC(void update(), update)
_WRAP_VFUNC(void act_mode_enter(), act_mode_enter)
};
} // namespace Gtk
......
......@@ -55,11 +55,13 @@ public:
_WRAP_SIGNAL(void adjust_bounds(double new_value), "adjust_bounds")
_WRAP_SIGNAL(void move_slider(ScrollType scroll), "move_slider")
_WRAP_VFUNC(void get_range_border(GtkBorder* border), get_range_border)
_WRAP_PROPERTY("update-policy", UpdateType)
_WRAP_PROPERTY("adjustment", Adjustment*)
_WRAP_PROPERTY("inverted", bool)
protected:
_WRAP_VFUNC(void get_range_border(GtkBorder* border) const, get_range_border)
};
} // namespace Gtk
......
......@@ -30,7 +30,7 @@
namespace Gtk
{
int Scale::calc_digits_(double step)
int Scale::calc_digits_(double step) const
{
int digits = 0;
......
......@@ -92,8 +92,6 @@ public:
*/
_WRAP_SIGNAL(Glib::ustring format_value(double value), "format_value")
_WRAP_VFUNC(void draw_value(), draw_value)
/** Number of displayed decimal digits.
*/
_WRAP_PROPERTY("digits", int)
......@@ -107,7 +105,10 @@ public:
_WRAP_PROPERTY("value-pos", PositionType)
protected:
virtual int calc_digits_(double step);
_WRAP_VFUNC(void draw_value(), draw_value)
virtual int calc_digits_(double step) const;
};
/** A vertical slider for selecting values.
......
......@@ -396,6 +396,7 @@ public:
Gtk::TextDirection direction, Gtk::StateType state, Gtk::IconSize size,
Gtk::Widget& widget, const Glib::ustring& detail), gtk_style_render_icon)
protected:
_WRAP_VFUNC(void realize(), realize)
_WRAP_VFUNC(void unrealize(), unrealize)
_WRAP_VFUNC(void copy(const Glib::RefPtr<Style>& src), copy)
......
......@@ -50,11 +50,10 @@ public:
_WRAP_METHOD(bool drag_data_delete(const TreeModel::Path& path), gtk_tree_drag_source_drag_data_delete)
protected: