diff options
author | Taybin Rutkin <taybin@taybin.com> | 2005-05-13 20:47:18 +0000 |
---|---|---|
committer | Taybin Rutkin <taybin@taybin.com> | 2005-05-13 20:47:18 +0000 |
commit | d09f6b3016bacbc2871a8946cbb24ad705076509 (patch) | |
tree | f27312839c2a772cb2ce068a4f28b2449ad869df /libs/gtkmm2/atk |
Initial revision
git-svn-id: svn://localhost/trunk/ardour2@4 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/gtkmm2/atk')
63 files changed, 16460 insertions, 0 deletions
diff --git a/libs/gtkmm2/atk/SConscript b/libs/gtkmm2/atk/SConscript new file mode 100644 index 0000000000..f0f18d4d12 --- /dev/null +++ b/libs/gtkmm2/atk/SConscript @@ -0,0 +1,10 @@ +import glob + +atkmm_files = glob.glob('atkmm/*.cc') + +Import('env libraries') +atkmm = env.Copy() +atkmm.Merge([libraries['glibmm2'], libraries['gtk2'], libraries['sigc2'] ]) + +libatkmm = atkmm.StaticLibrary('atkmm', atkmm_files) +Default(libatkmm) diff --git a/libs/gtkmm2/atk/atkmm.h b/libs/gtkmm2/atk/atkmm.h new file mode 100644 index 0000000000..712664344f --- /dev/null +++ b/libs/gtkmm2/atk/atkmm.h @@ -0,0 +1,42 @@ +/* $Id$ */ + +/* atkmm - a C++ wrapper for the GLib toolkit + * + * Copyright 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef _ATKMM_H +#define _ATKMM_H + +#include <atkmm/action.h> +#include <atkmm/component.h> +#include <atkmm/document.h> +#include <atkmm/editabletext.h> +#include <atkmm/image.h> +#include <atkmm/implementor.h> +#include <atkmm/object.h> +#include <atkmm/objectaccessible.h> +#include <atkmm/relation.h> +#include <atkmm/relationset.h> +#include <atkmm/selection.h> +#include <atkmm/stateset.h> +#include <atkmm/table.h> +#include <atkmm/text.h> +#include <atkmm/value.h> + +#endif /* _ATKMM_H */ + diff --git a/libs/gtkmm2/atk/atkmm/action.cc b/libs/gtkmm2/atk/atkmm/action.cc new file mode 100644 index 0000000000..69a260463c --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/action.cc @@ -0,0 +1,481 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/action.h> +#include <atkmm/private/action_p.h> + +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atk/atkaction.h> + + +namespace +{ +} // anonymous namespace + + +namespace Glib +{ + +Glib::RefPtr<Atk::Action> wrap(AtkAction* object, bool take_copy) +{ + return Glib::RefPtr<Atk::Action>( dynamic_cast<Atk::Action*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} // namespace Glib + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Interface_Class& Action_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Interface_Class has to know the interface init function + // in order to add interfaces to implementing types. + class_init_func_ = &Action_Class::iface_init_function; + + // We can not derive from another interface, and it is not necessary anyway. + gtype_ = atk_action_get_type(); + } + + return *this; +} + +void Action_Class::iface_init_function(void* g_iface, void*) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_iface); + + //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. + //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc + g_assert(klass != 0); + + klass->do_action = &do_action_vfunc_callback; + klass->get_n_actions = &get_n_actions_vfunc_callback; + klass->get_description = &get_description_vfunc_callback; + klass->get_name = &get_name_vfunc_callback; + klass->get_keybinding = &get_keybinding_vfunc_callback; + klass->set_description = &set_description_vfunc_callback; +} + +gboolean Action_Class::do_action_vfunc_callback(AtkAction* self, gint i) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->do_action_vfunc(i +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->do_action) + return (*base->do_action)(self, i); + } + + typedef gboolean RType; + return RType(); +} + +gint Action_Class::get_n_actions_vfunc_callback(AtkAction* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_n_actions_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_n_actions) + return (*base->get_n_actions)(self); + } + + typedef gint RType; + return RType(); +} + +const gchar* Action_Class::get_description_vfunc_callback(AtkAction* self, gint i) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_description_vfunc(i +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_description) + return (*base->get_description)(self, i); + } + + typedef const gchar* RType; + return RType(); +} + +const gchar* Action_Class::get_name_vfunc_callback(AtkAction* self, gint i) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_name_vfunc(i +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_name) + return (*base->get_name)(self, i); + } + + typedef const gchar* RType; + return RType(); +} + +const gchar* Action_Class::get_keybinding_vfunc_callback(AtkAction* self, gint i) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_keybinding_vfunc(i +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_keybinding) + return (*base->get_keybinding)(self, i); + } + + typedef const gchar* RType; + return RType(); +} + +gboolean Action_Class::set_description_vfunc_callback(AtkAction* self, gint i, const gchar* desc) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->set_description_vfunc(i +, Glib::convert_const_gchar_ptr_to_ustring(desc) +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->set_description) + return (*base->set_description)(self, i, desc); + } + + typedef gboolean RType; + return RType(); +} + + +Glib::ObjectBase* Action_Class::wrap_new(GObject* object) +{ + return new Action((AtkAction*)(object)); +} + + +/* The implementation: */ + +Action::Action() +: + Glib::Interface(action_class_.init()) +{} + +Action::Action(AtkAction* castitem) +: + Glib::Interface((GObject*)(castitem)) +{} + +Action::~Action() +{} + +// static +void Action::add_interface(GType gtype_implementer) +{ + action_class_.init().add_interface(gtype_implementer); +} + +Action::CppClassType Action::action_class_; // initialize static member + +GType Action::get_type() +{ + return action_class_.init().get_type(); +} + +GType Action::get_base_type() +{ + return atk_action_get_type(); +} + + +bool Action::do_action(int i) +{ + return atk_action_do_action(gobj(), i); +} + +int Action::get_n_actions() const +{ + return atk_action_get_n_actions(const_cast<AtkAction*>(gobj())); +} + +Glib::ustring Action::get_description(int i) const +{ + return Glib::convert_const_gchar_ptr_to_ustring(atk_action_get_description(const_cast<AtkAction*>(gobj()), i)); +} + +Glib::ustring Action::get_name(int i) const +{ + return Glib::convert_const_gchar_ptr_to_ustring(atk_action_get_name(const_cast<AtkAction*>(gobj()), i)); +} + +Glib::ustring Action::get_keybinding(int i) +{ + return Glib::convert_const_gchar_ptr_to_ustring(atk_action_get_keybinding(gobj(), i)); +} + +bool Action::set_description(int i, const Glib::ustring& desc) +{ + return atk_action_set_description(gobj(), i, desc.c_str()); +} + +Glib::ustring Action::get_localized_name(int i) +{ + return Glib::convert_const_gchar_ptr_to_ustring(atk_action_get_localized_name(gobj(), i)); +} + + +bool Atk::Action::do_action_vfunc(int i) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->do_action) + return (*base->do_action)(gobj(),i); + + typedef bool RType; + return RType(); +} + +int Atk::Action::get_n_actions_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_n_actions) + return (*base->get_n_actions)(const_cast<AtkAction*>(gobj())); + + typedef int RType; + return RType(); +} + +const char* Atk::Action::get_description_vfunc(int i) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_description) + return (*base->get_description)(const_cast<AtkAction*>(gobj()),i); + + typedef const char* RType; + return RType(); +} + +const char* Atk::Action::get_name_vfunc(int i) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_name) + return (*base->get_name)(const_cast<AtkAction*>(gobj()),i); + + typedef const char* RType; + return RType(); +} + +const char* Atk::Action::get_keybinding_vfunc(int i) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_keybinding) + return (*base->get_keybinding)(const_cast<AtkAction*>(gobj()),i); + + typedef const char* RType; + return RType(); +} + +bool Atk::Action::set_description_vfunc(int i, const Glib::ustring& desc) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->set_description) + return (*base->set_description)(gobj(),i,desc.c_str()); + + typedef bool RType; + return RType(); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/action.h b/libs/gtkmm2/atk/atkmm/action.h new file mode 100644 index 0000000000..af8a131378 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/action.h @@ -0,0 +1,193 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_ACTION_H +#define _ATKMM_ACTION_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +extern "C" { typedef struct _AtkActionIface AtkActionIface; } +#endif + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkAction AtkAction; +typedef struct _AtkActionClass AtkActionClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class Action_Class; } // namespace Atk +namespace Atk +{ + +/** The ATK interface provided by UI components which the user can activate/interact with, + * This should be implemented by instances of Atk::Object classes with which the user can interact directly, i.e. buttons, + * checkboxes, scrollbars, e.g. components which are not "passive" providers of UI information. + * + * Exceptions: when the user interaction is already covered by another appropriate interface such as Atk::EditableText + * (insert/delete test, etc.) or Atk::Value (set value) then these actions should not be exposed by Atk::Action as well. + * + * Also note that the Atk::Action API is limited in that parameters may not be passed to the object being activated; + * thus the action must be self-contained and specifiable via only a single "verb". Concrete examples include "press", + * "release", "click" for buttons, "drag" (meaning initiate drag) and "drop" for drag sources and drop targets, etc. + * + * Though most UI interactions on components should be invocable via keyboard as well as mouse, there will generally be + * a close mapping between "mouse actions" that are possible on a component and the Atk::Actions. Where mouse and keyboard + * actions are redundant in effect, Atk::Action should expose only one action rather than exposing redundant actions if + * possible. By convention we have been using "mouse centric" terminology for Atk::Action names. + */ + +class Action : public Glib::Interface +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef Action CppObjectType; + typedef Action_Class CppClassType; + typedef AtkAction BaseObjectType; + typedef AtkActionIface BaseClassType; + +private: + friend class Action_Class; + static CppClassType action_class_; + + // noncopyable + Action(const Action&); + Action& operator=(const Action&); + +protected: + Action(); // you must derive from this class + explicit Action(AtkAction* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~Action(); + + static void add_interface(GType gtype_implementer); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkAction* gobj() { return reinterpret_cast<AtkAction*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkAction* gobj() const { return reinterpret_cast<AtkAction*>(gobject_); } + +private: + + +public: + + + /** Perform the specified action on the object. + * @param i The action index corresponding to the action to be performed. + * @return <tt>true</tt> if success, <tt>false</tt> otherwise. + */ + bool do_action(int i); + + /** Gets the number of accessible actions available on the object. + * If there are more than one, the first one is considered the + * "default" action of the object. + * @return A the number of actions, or 0 if @a action does not + * implement this interface. + */ + int get_n_actions() const; + + /** Returns a description of the specified action of the object. + * @param i The action index corresponding to the action to be performed. + * @return A description string, or <tt>0</tt> + * if @a action does not implement this interface. + */ + Glib::ustring get_description(int i) const; + + /** Returns the name of the specified action of the object. + * @param i The action index corresponding to the action to be performed. + * @return A name string, or an empty string if @a action does not implement this interface. + */ + Glib::ustring get_name(int i) const; + + /** Returns a keybinding associated with this action, if one exists. + * @param i The action index corresponding to the action to be performed. + * @return A string representing the keybinding, or an empty string + * if there is no keybinding for this action. + */ + Glib::ustring get_keybinding(int i); + + /** Sets a description of the specified action of the object. + * @param i The action index corresponding to the action to be performed. + * @param desc The description to be assigned to this action. + * @return A <tt>bool</tt> representing if the description was successfully set;. + */ + bool set_description(int i, const Glib::ustring& desc); + + /** Returns the localized name of the specified action of the object. + * @param i The action index corresponding to the action to be performed. + * @return A name string, or an empty string + * if @a action does not implement this interface. + */ + Glib::ustring get_localized_name(int i); + +protected: + virtual bool do_action_vfunc(int i); + virtual int get_n_actions_vfunc() const; + virtual const char* get_description_vfunc(int i) const; + virtual const char* get_name_vfunc(int i) const; + virtual const char* get_keybinding_vfunc(int i) const; + virtual bool set_description_vfunc(int i, const Glib::ustring& desc); + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::Action + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::Action> wrap(AtkAction* object, bool take_copy = false); + +} // namespace Glib + +#endif /* _ATKMM_ACTION_H */ + diff --git a/libs/gtkmm2/atk/atkmm/component.cc b/libs/gtkmm2/atk/atkmm/component.cc new file mode 100644 index 0000000000..c4256e7699 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/component.cc @@ -0,0 +1,892 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/component.h> +#include <atkmm/private/component_p.h> + +#include <atk/atk-enum-types.h> +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atkmm/object.h> +#include <atk/atkcomponent.h> + + +namespace +{ +} // anonymous namespace + +// static +GType Glib::Value<Atk::CoordType>::value_type() +{ + return atk_coord_type_get_type(); +} + +// static +GType Glib::Value<Atk::Layer>::value_type() +{ + return atk_layer_get_type(); +} + + +namespace Glib +{ + +Glib::RefPtr<Atk::Component> wrap(AtkComponent* object, bool take_copy) +{ + return Glib::RefPtr<Atk::Component>( dynamic_cast<Atk::Component*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} // namespace Glib + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Interface_Class& Component_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Interface_Class has to know the interface init function + // in order to add interfaces to implementing types. + class_init_func_ = &Component_Class::iface_init_function; + + // We can not derive from another interface, and it is not necessary anyway. + gtype_ = atk_component_get_type(); + } + + return *this; +} + +void Component_Class::iface_init_function(void* g_iface, void*) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_iface); + + //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. + //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc + g_assert(klass != 0); + + klass->add_focus_handler = &add_focus_handler_vfunc_callback; + klass->contains = &contains_vfunc_callback; + klass->ref_accessible_at_point = &ref_accessible_at_point_vfunc_callback; + klass->get_extents = &get_extents_vfunc_callback; + klass->get_position = &get_position_vfunc_callback; + klass->get_size = &get_size_vfunc_callback; + klass->get_layer = &get_layer_vfunc_callback; + klass->get_mdi_zorder = &get_mdi_zorder_vfunc_callback; + klass->grab_focus = &grab_focus_vfunc_callback; + klass->remove_focus_handler = &remove_focus_handler_vfunc_callback; + klass->set_extents = &set_extents_vfunc_callback; + klass->set_position = &set_position_vfunc_callback; + klass->set_size = &set_size_vfunc_callback; +} + +guint Component_Class::add_focus_handler_vfunc_callback(AtkComponent* self, AtkFocusHandler handler) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->add_focus_handler_vfunc(handler); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->add_focus_handler) + return (*base->add_focus_handler)(self, handler); + } + + typedef guint RType; + return RType(); +} + +gboolean Component_Class::contains_vfunc_callback(AtkComponent* self, gint x, gint y, AtkCoordType coord_type) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->contains_vfunc(x +, y +, ((CoordType)(coord_type)) +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->contains) + return (*base->contains)(self, x, y, coord_type); + } + + typedef gboolean RType; + return RType(); +} + +AtkObject* Component_Class::ref_accessible_at_point_vfunc_callback(AtkComponent* self, gint x, gint y, AtkCoordType coord_type) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return Glib::unwrap_copy(obj->get_accessible_at_point_vfunc(x +, y +, ((CoordType)(coord_type)) +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->ref_accessible_at_point) + return (*base->ref_accessible_at_point)(self, x, y, coord_type); + } + + typedef AtkObject* RType; + return RType(); +} + +void Component_Class::get_extents_vfunc_callback(AtkComponent* self, gint* x, gint* y, gint* width, gint* height, AtkCoordType coord_type) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->get_extents_vfunc(*(x) +, *(y) +, *(width) +, *(height) +, ((CoordType)(coord_type)) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_extents) + (*base->get_extents)(self, x, y, width, height, coord_type); + } +} + +void Component_Class::get_position_vfunc_callback(AtkComponent* self, gint* x, gint* y, AtkCoordType coord_type) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->get_position_vfunc(*(x) +, *(y) +, ((CoordType)(coord_type)) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_position) + (*base->get_position)(self, x, y, coord_type); + } +} + +void Component_Class::get_size_vfunc_callback(AtkComponent* self, gint* width, gint* height) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->get_size_vfunc(*(width) +, *(height) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_size) + (*base->get_size)(self, width, height); + } +} + +AtkLayer Component_Class::get_layer_vfunc_callback(AtkComponent* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return ((AtkLayer)(obj->get_layer_vfunc())); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_layer) + return (*base->get_layer)(self); + } + + typedef AtkLayer RType; + return RType(); +} + +gint Component_Class::get_mdi_zorder_vfunc_callback(AtkComponent* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_mdi_zorder_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_mdi_zorder) + return (*base->get_mdi_zorder)(self); + } + + typedef gint RType; + return RType(); +} + +gboolean Component_Class::grab_focus_vfunc_callback(AtkComponent* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->grab_focus_vfunc()); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->grab_focus) + return (*base->grab_focus)(self); + } + + typedef gboolean RType; + return RType(); +} + +void Component_Class::remove_focus_handler_vfunc_callback(AtkComponent* self, guint handler_id) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->remove_focus_handler_vfunc(handler_id); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->remove_focus_handler) + (*base->remove_focus_handler)(self, handler_id); + } +} + +gboolean Component_Class::set_extents_vfunc_callback(AtkComponent* self, gint x, gint y, gint width, gint height, AtkCoordType coord_type) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->set_extents_vfunc(x +, y +, width +, height +, ((CoordType)(coord_type)) +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->set_extents) + return (*base->set_extents)(self, x, y, width, height, coord_type); + } + + typedef gboolean RType; + return RType(); +} + +gboolean Component_Class::set_position_vfunc_callback(AtkComponent* self, gint x, gint y, AtkCoordType coord_type) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->set_position_vfunc(x +, y +, ((CoordType)(coord_type)) +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->set_position) + return (*base->set_position)(self, x, y, coord_type); + } + + typedef gboolean RType; + return RType(); +} + +gboolean Component_Class::set_size_vfunc_callback(AtkComponent* self, gint width, gint height) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->set_size_vfunc(width +, height +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->set_size) + return (*base->set_size)(self, width, height); + } + + typedef gboolean RType; + return RType(); +} + + +Glib::ObjectBase* Component_Class::wrap_new(GObject* object) +{ + return new Component((AtkComponent*)(object)); +} + + +/* The implementation: */ + +Component::Component() +: + Glib::Interface(component_class_.init()) +{} + +Component::Component(AtkComponent* castitem) +: + Glib::Interface((GObject*)(castitem)) +{} + +Component::~Component() +{} + +// static +void Component::add_interface(GType gtype_implementer) +{ + component_class_.init().add_interface(gtype_implementer); +} + +Component::CppClassType Component::component_class_; // initialize static member + +GType Component::get_type() +{ + return component_class_.init().get_type(); +} + +GType Component::get_base_type() +{ + return atk_component_get_type(); +} + + +guint Component::add_focus_handler(AtkFocusHandler handler) +{ + return atk_component_add_focus_handler(gobj(), handler); +} + +bool Component::contains(int x, int y, CoordType coord_type) const +{ + return atk_component_contains(const_cast<AtkComponent*>(gobj()), x, y, ((AtkCoordType)(coord_type))); +} + +Glib::RefPtr<Atk::Object> Component::get_accessible_at_point(int x, int y, CoordType coord_type) +{ + return Glib::wrap(atk_component_ref_accessible_at_point(gobj(), x, y, ((AtkCoordType)(coord_type)))); +} + +void Component::get_extents(int& x, int& y, int& width, int& height, CoordType coord_type) const +{ + atk_component_get_extents(const_cast<AtkComponent*>(gobj()), &x, &y, &width, &height, ((AtkCoordType)(coord_type))); +} + +void Component::get_position(int& x, int& y, CoordType coord_type) const +{ + atk_component_get_position(const_cast<AtkComponent*>(gobj()), &x, &y, ((AtkCoordType)(coord_type))); +} + +void Component::get_size(int& width, int& height) const +{ + atk_component_get_size(const_cast<AtkComponent*>(gobj()), &width, &height); +} + +Layer Component::get_layer() const +{ + return ((Layer)(atk_component_get_layer(const_cast<AtkComponent*>(gobj())))); +} + +int Component::get_mdi_zorder() const +{ + return atk_component_get_mdi_zorder(const_cast<AtkComponent*>(gobj())); +} + +bool Component::grab_focus() +{ + return atk_component_grab_focus(gobj()); +} + +void Component::remove_focus_handler(guint handler_id) +{ + atk_component_remove_focus_handler(gobj(), handler_id); +} + +bool Component::set_extents(int x, int y, int width, int height, CoordType coord_type) +{ + return atk_component_set_extents(gobj(), x, y, width, height, ((AtkCoordType)(coord_type))); +} + +bool Component::set_position(int x, int y, CoordType coord_type) +{ + return atk_component_set_position(gobj(), x, y, ((AtkCoordType)(coord_type))); +} + +bool Component::set_size(int width, int height) +{ + return atk_component_set_size(gobj(), width, height); +} + + +guint Atk::Component::add_focus_handler_vfunc(AtkFocusHandler handler) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->add_focus_handler) + return (*base->add_focus_handler)(gobj(),handler); + + typedef guint RType; + return RType(); +} + +bool Atk::Component::contains_vfunc(int x, int y, CoordType coord_type) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->contains) + return (*base->contains)(const_cast<AtkComponent*>(gobj()),x,y,((AtkCoordType)(coord_type))); + + typedef bool RType; + return RType(); +} + +Glib::RefPtr<Atk::Object> Atk::Component::get_accessible_at_point_vfunc(int x, int y, CoordType coord_type) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->ref_accessible_at_point) + return Glib::wrap((*base->ref_accessible_at_point)(gobj(),x,y,((AtkCoordType)(coord_type)))); + + typedef Glib::RefPtr<Atk::Object> RType; + return RType(); +} + +void Atk::Component::get_extents_vfunc(int& x, int& y, int& width, int& height, CoordType coord_type) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_extents) + (*base->get_extents)(const_cast<AtkComponent*>(gobj()),&x,&y,&width,&height,((AtkCoordType)(coord_type))); +} + +void Atk::Component::get_position_vfunc(int& x, int& y, CoordType coord_type) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_position) + (*base->get_position)(const_cast<AtkComponent*>(gobj()),&x,&y,((AtkCoordType)(coord_type))); +} + +void Atk::Component::get_size_vfunc(int& width, int& height) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_size) + (*base->get_size)(const_cast<AtkComponent*>(gobj()),&width,&height); +} + +Layer Atk::Component::get_layer_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_layer) + return ((Layer)((*base->get_layer)(const_cast<AtkComponent*>(gobj())))); + + typedef Layer RType; + return RType(); +} + +int Atk::Component::get_mdi_zorder_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_mdi_zorder) + return (*base->get_mdi_zorder)(const_cast<AtkComponent*>(gobj())); + + typedef int RType; + return RType(); +} + +bool Atk::Component::grab_focus_vfunc() +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->grab_focus) + return (*base->grab_focus)(gobj()); + + typedef bool RType; + return RType(); +} + +void Atk::Component::remove_focus_handler_vfunc(guint handler_id) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->remove_focus_handler) + (*base->remove_focus_handler)(gobj(),handler_id); +} + +bool Atk::Component::set_extents_vfunc(int x, int y, int width, int height, CoordType coord_type) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->set_extents) + return (*base->set_extents)(gobj(),x,y,width,height,((AtkCoordType)(coord_type))); + + typedef bool RType; + return RType(); +} + +bool Atk::Component::set_position_vfunc(int x, int y, CoordType coord_type) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->set_position) + return (*base->set_position)(gobj(),x,y,((AtkCoordType)(coord_type))); + + typedef bool RType; + return RType(); +} + +bool Atk::Component::set_size_vfunc(int width, int height) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->set_size) + return (*base->set_size)(gobj(),width,height); + + typedef bool RType; + return RType(); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/component.h b/libs/gtkmm2/atk/atkmm/component.h new file mode 100644 index 0000000000..889d626dae --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/component.h @@ -0,0 +1,331 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_COMPONENT_H +#define _ATKMM_COMPONENT_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +extern "C" +{ + typedef struct _AtkComponentIface AtkComponentIface; + typedef struct _AtkObject AtkObject; + typedef void (* AtkFocusHandler) (AtkObject*, gboolean); +} +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkComponent AtkComponent; +typedef struct _AtkComponentClass AtkComponentClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class Component_Class; } // namespace Atk +namespace Atk +{ + + +/** @addtogroup atkmmEnums Enums and Flags */ + +/** + * @ingroup atkmmEnums + */ +enum CoordType +{ + XY_SCREEN, + XY_WINDOW +}; + +} // namespace Atk + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +namespace Glib +{ + +template <> +class Value<Atk::CoordType> : public Glib::Value_Enum<Atk::CoordType> +{ +public: + static GType value_type() G_GNUC_CONST; +}; + +} // namespace Glib +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ + +/** + * @ingroup atkmmEnums + */ +enum Layer +{ + LAYER_INVALID, + LAYER_BACKGROUND, + LAYER_CANVAS, + LAYER_WIDGET, + LAYER_MDI, + LAYER_POPUP, + LAYER_OVERLAY, + LAYER_WINDOW +}; + +} // namespace Atk + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +namespace Glib +{ + +template <> +class Value<Atk::Layer> : public Glib::Value_Enum<Atk::Layer> +{ +public: + static GType value_type() G_GNUC_CONST; +}; + +} // namespace Glib +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ + + +class Object; + + +/** The ATK interface provided by UI components which occupy a physical area on the screen. + * This should be implemented by most if not all UI elements with an actual on-screen presence, i.e. components which + * can be said to have a screen-coordinate bounding box. Virtually all widgets will need to have Atk::Component + * implementations provided for their corresponding Atk::Object class. In short, only UI elements which are *not* GUI + * elements will omit this ATK interface. + * + * A possible exception might be textual information with a transparent background, in which case text glyph bounding + * box information is provided by Atk::Text. + */ + +class Component : public Glib::Interface +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef Component CppObjectType; + typedef Component_Class CppClassType; + typedef AtkComponent BaseObjectType; + typedef AtkComponentIface BaseClassType; + +private: + friend class Component_Class; + static CppClassType component_class_; + + // noncopyable + Component(const Component&); + Component& operator=(const Component&); + +protected: + Component(); // you must derive from this class + explicit Component(AtkComponent* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~Component(); + + static void add_interface(GType gtype_implementer); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkComponent* gobj() { return reinterpret_cast<AtkComponent*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkComponent* gobj() const { return reinterpret_cast<AtkComponent*>(gobject_); } + +private: + + +public: + + /** Add the specified handler to the set of functions to be called + * when this object receives focus events (in or out). If the handler is + * already added it is not added again + * @param handler The Atk::FocusHandler to be attached to @a component . + * @return A handler id which can be used in atk_component_remove_focus_handler + * or zero if the handler was already added. + */ + guint add_focus_handler(AtkFocusHandler handler); + + /** Checks whether the specified point is within the extent of the @a component . + * @param x X coordinate. + * @param y Y coordinate. + * @param coord_type Specifies whether the coordinates are relative to the screen + * or to the components top level window. + * @return <tt>true</tt> or <tt>false</tt> indicating whether the specified point is within + * the extent of the @a component or not. + */ + bool contains(int x, int y, CoordType coord_type) const; + + /** Gets a reference to the accessible child, if one exists, at the + * coordinate point specified by @a x and @a y . + * @param x X coordinate. + * @param y Y coordinate. + * @param coord_type Specifies whether the coordinates are relative to the screen + * or to the components top level window. + * @return A reference to the accessible child, if one exists. + */ + Glib::RefPtr<Atk::Object> get_accessible_at_point(int x, int y, CoordType coord_type); + + /** Gets the rectangle which gives the extent of the @a component . + * @param x Address of <tt>int</tt> to put x coordinate. + * @param y Address of <tt>int</tt> to put y coordinate. + * @param width Address of <tt>int</tt> to put width. + * @param height Address of <tt>int</tt> to put height. + * @param coord_type Specifies whether the coordinates are relative to the screen + * or to the components top level window. + */ + void get_extents(int& x, int& y, int& width, int& height, CoordType coord_type) const; + + /** Gets the position of @a component in the form of + * a point specifying @a component 's top-left corner. + * @param x Address of <tt>int</tt> to put x coordinate position. + * @param y Address of <tt>int</tt> to put y coordinate position. + * @param coord_type Specifies whether the coordinates are relative to the screen + * or to the components top level window. + */ + void get_position(int& x, int& y, CoordType coord_type) const; + + /** Gets the size of the @a component in terms of width and height. + * @param width Address of <tt>int</tt> to put width of @a component . + * @param height Address of <tt>int</tt> to put height of @a component . + */ + void get_size(int& width, int& height) const; + + /** Gets the layer of the component. + * @return An Atk::Layer which is the layer of the component. + */ + Layer get_layer() const; + + /** Gets the zorder of the component. The value G_MININT will be returned + * if the layer of the component is not ATK_LAYER_MDI or ATK_LAYER_WINDOW. + * @return A <tt>int</tt> which is the zorder of the component, i.e. the depth at + * which the component is shown in relation to other components in the same + * container. + */ + int get_mdi_zorder() const; + + /** Grabs focus for this @a component . + * @return <tt>true</tt> if successful, <tt>false</tt> otherwise. + */ + bool grab_focus(); + + /** Remove the handler specified by @a handler_id from the list of + * functions to be executed when this object receives focus events + * (in or out). + * @param handler_id The handler id of the focus handler to be removed + * from @a component . + */ + void remove_focus_handler(guint handler_id); + + /** Sets the extents of @a component . + * @param x X coordinate. + * @param y Y coordinate. + * @param width Width to set for @a component . + * @param height Height to set for @a component . + * @param coord_type Specifies whether the coordinates are relative to the screen + * or to the components top level window. + * @return <tt>true</tt> or <tt>false</tt> whether the extents were set or not. + */ + bool set_extents(int x, int y, int width, int height, CoordType coord_type); + + /** Sets the postition of @a component . + * @param x X coordinate. + * @param y Y coordinate. + * @param coord_type Specifies whether the coordinates are relative to the screen + * or to the components top level window. + * @return <tt>true</tt> or <tt>false</tt> whether or not the position was set or not. + */ + bool set_position(int x, int y, CoordType coord_type); + + /** Set the size of the @a component in terms of width and height. + * @param width Width to set for @a component . + * @param height Height to set for @a component . + * @return <tt>true</tt> or <tt>false</tt> whether the size was set or not. + */ + bool set_size(int width, int height); + +protected: + virtual guint add_focus_handler_vfunc(AtkFocusHandler handler); + virtual bool contains_vfunc(int x, int y, CoordType coord_type) const; + + virtual Glib::RefPtr<Atk::Object> get_accessible_at_point_vfunc(int x, int y, CoordType coord_type); + + virtual void get_extents_vfunc(int& x, int& y, int& width, int& height, CoordType coord_type) const; + virtual void get_position_vfunc(int& x, int& y, CoordType coord_type) const; + virtual void get_size_vfunc(int& width, int& height) const; + virtual Layer get_layer_vfunc() const; + virtual int get_mdi_zorder_vfunc() const; + virtual bool grab_focus_vfunc(); + virtual void remove_focus_handler_vfunc(guint handler_id); + virtual bool set_extents_vfunc(int x, int y, int width, int height, CoordType coord_type); + virtual bool set_position_vfunc(int x, int y, CoordType coord_type); + virtual bool set_size_vfunc(int width, int height); + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::Component + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::Component> wrap(AtkComponent* object, bool take_copy = false); + +} // namespace Glib + +#endif /* _ATKMM_COMPONENT_H */ + diff --git a/libs/gtkmm2/atk/atkmm/document.cc b/libs/gtkmm2/atk/atkmm/document.cc new file mode 100644 index 0000000000..64946c6f84 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/document.cc @@ -0,0 +1,246 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/document.h> +#include <atkmm/private/document_p.h> + +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 2003 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atkmm/object.h> +#include <atk/atkdocument.h> + + +namespace Atk +{ + + +} // namespace Atk + + +namespace +{ +} // anonymous namespace + + +namespace Glib +{ + +Glib::RefPtr<Atk::Document> wrap(AtkDocument* object, bool take_copy) +{ + return Glib::RefPtr<Atk::Document>( dynamic_cast<Atk::Document*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} // namespace Glib + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Interface_Class& Document_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Interface_Class has to know the interface init function + // in order to add interfaces to implementing types. + class_init_func_ = &Document_Class::iface_init_function; + + // We can not derive from another interface, and it is not necessary anyway. + gtype_ = atk_document_get_type(); + } + + return *this; +} + +void Document_Class::iface_init_function(void* g_iface, void*) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_iface); + + //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. + //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc + g_assert(klass != 0); + + klass->get_document_type = &get_document_type_vfunc_callback; + klass->get_document = &get_document_vfunc_callback; +} + +const gchar* Document_Class::get_document_type_vfunc_callback(AtkDocument* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_document_type_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_document_type) + return (*base->get_document_type)(self); + } + + typedef const gchar* RType; + return RType(); +} + +gpointer Document_Class::get_document_vfunc_callback(AtkDocument* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_document_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_document) + return (*base->get_document)(self); + } + + typedef gpointer RType; + return RType(); +} + + +Glib::ObjectBase* Document_Class::wrap_new(GObject* object) +{ + return new Document((AtkDocument*)(object)); +} + + +/* The implementation: */ + +Document::Document() +: + Glib::Interface(document_class_.init()) +{} + +Document::Document(AtkDocument* castitem) +: + Glib::Interface((GObject*)(castitem)) +{} + +Document::~Document() +{} + +// static +void Document::add_interface(GType gtype_implementer) +{ + document_class_.init().add_interface(gtype_implementer); +} + +Document::CppClassType Document::document_class_; // initialize static member + +GType Document::get_type() +{ + return document_class_.init().get_type(); +} + +GType Document::get_base_type() +{ + return atk_document_get_type(); +} + + +Glib::ustring Document::get_document_type() const +{ + return Glib::convert_const_gchar_ptr_to_ustring(atk_document_get_document_type(const_cast<AtkDocument*>(gobj()))); +} + +gpointer Document::get_document() +{ + return atk_document_get_document(gobj()); +} + + +const gchar* Atk::Document::get_document_type_vfunc() +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_document_type) + return (*base->get_document_type)(gobj()); + + typedef const gchar* RType; + return RType(); +} + +gpointer Atk::Document::get_document_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_document) + return (*base->get_document)(const_cast<AtkDocument*>(gobj())); + + typedef gpointer RType; + return RType(); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/document.h b/libs/gtkmm2/atk/atkmm/document.h new file mode 100644 index 0000000000..71808475c3 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/document.h @@ -0,0 +1,145 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_DOCUMENT_H +#define _ATKMM_DOCUMENT_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 2003 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +extern "C" +{ + typedef struct _AtkDocumentIface AtkDocumentIface; + typedef struct _AtkDocument AtkDocument; +} +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkDocument AtkDocument; +typedef struct _AtkDocumentClass AtkDocumentClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class Document_Class; } // namespace Atk +namespace Atk +{ + +class Object; + +/** The ATK interface which allows access to a DOM associated with on object. + * This interface should be supported by any object that has an associated document object model (DOM). This interface + * provides the standard mechanism allowing an assistive technology access to the DOM. + */ + +class Document : public Glib::Interface +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef Document CppObjectType; + typedef Document_Class CppClassType; + typedef AtkDocument BaseObjectType; + typedef AtkDocumentIface BaseClassType; + +private: + friend class Document_Class; + static CppClassType document_class_; + + // noncopyable + Document(const Document&); + Document& operator=(const Document&); + +protected: + Document(); // you must derive from this class + explicit Document(AtkDocument* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~Document(); + + static void add_interface(GType gtype_implementer); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkDocument* gobj() { return reinterpret_cast<AtkDocument*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkDocument* gobj() const { return reinterpret_cast<AtkDocument*>(gobject_); } + +private: + +public: + + + /** Gets a string indicating the document type. + * @return A string indicating the document type. + */ + Glib::ustring get_document_type() const; + + /** Gets a %gpointer that points to an instance of the DOM. It is + * up to the caller to check atk_document_get_type to determine + * how to cast this pointer. + * @return A %gpointer that points to an instance of the DOM. + */ + gpointer get_document(); + +protected: + virtual const gchar* get_document_type_vfunc(); + virtual gpointer get_document_vfunc() const; + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::Document + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::Document> wrap(AtkDocument* object, bool take_copy = false); + +} // namespace Glib + +#endif /* _ATKMM_DOCUMENT_H */ + diff --git a/libs/gtkmm2/atk/atkmm/editabletext.cc b/libs/gtkmm2/atk/atkmm/editabletext.cc new file mode 100644 index 0000000000..10e58003b7 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/editabletext.cc @@ -0,0 +1,506 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/editabletext.h> +#include <atkmm/private/editabletext_p.h> + +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atkmm/object.h> +#include <atk/atkeditabletext.h> + + +namespace +{ +} // anonymous namespace + + +namespace Glib +{ + +Glib::RefPtr<Atk::EditableText> wrap(AtkEditableText* object, bool take_copy) +{ + return Glib::RefPtr<Atk::EditableText>( dynamic_cast<Atk::EditableText*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} // namespace Glib + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Interface_Class& EditableText_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Interface_Class has to know the interface init function + // in order to add interfaces to implementing types. + class_init_func_ = &EditableText_Class::iface_init_function; + + // We can not derive from another interface, and it is not necessary anyway. + gtype_ = atk_editable_text_get_type(); + } + + return *this; +} + +void EditableText_Class::iface_init_function(void* g_iface, void*) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_iface); + + //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. + //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc + g_assert(klass != 0); + + klass->set_run_attributes = &set_run_attributes_vfunc_callback; + klass->set_text_contents = &set_text_contents_vfunc_callback; + klass->insert_text = &insert_text_vfunc_callback; + klass->copy_text = ©_text_vfunc_callback; + klass->cut_text = &cut_text_vfunc_callback; + klass->delete_text = &delete_text_vfunc_callback; + klass->paste_text = &paste_text_vfunc_callback; +} + +gboolean EditableText_Class::set_run_attributes_vfunc_callback(AtkEditableText* self, AtkAttributeSet* attrib_set, gint start_offset, gint end_offset) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->set_run_attributes_vfunc(attrib_set, start_offset +, end_offset +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->set_run_attributes) + return (*base->set_run_attributes)(self, attrib_set, start_offset, end_offset); + } + + typedef gboolean RType; + return RType(); +} + +void EditableText_Class::set_text_contents_vfunc_callback(AtkEditableText* self, const gchar* string) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->set_text_contents_vfunc(Glib::convert_const_gchar_ptr_to_ustring(string) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->set_text_contents) + (*base->set_text_contents)(self, string); + } +} + +void EditableText_Class::insert_text_vfunc_callback(AtkEditableText* self, const gchar* string, gint length, gint* position) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->insert_text_vfunc(Glib::convert_const_gchar_ptr_to_ustring(string) +, length +, *(position) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->insert_text) + (*base->insert_text)(self, string, length, position); + } +} + +void EditableText_Class::copy_text_vfunc_callback(AtkEditableText* self, gint start_pos, gint end_pos) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->copy_text_vfunc(start_pos +, end_pos +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->copy_text) + (*base->copy_text)(self, start_pos, end_pos); + } +} + +void EditableText_Class::cut_text_vfunc_callback(AtkEditableText* self, gint start_pos, gint end_pos) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->cut_text_vfunc(start_pos +, end_pos +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->cut_text) + (*base->cut_text)(self, start_pos, end_pos); + } +} + +void EditableText_Class::delete_text_vfunc_callback(AtkEditableText* self, gint start_pos, gint end_pos) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->delete_text_vfunc(start_pos +, end_pos +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->delete_text) + (*base->delete_text)(self, start_pos, end_pos); + } +} + +void EditableText_Class::paste_text_vfunc_callback(AtkEditableText* self, gint position) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->paste_text_vfunc(position +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->paste_text) + (*base->paste_text)(self, position); + } +} + + +Glib::ObjectBase* EditableText_Class::wrap_new(GObject* object) +{ + return new EditableText((AtkEditableText*)(object)); +} + + +/* The implementation: */ + +EditableText::EditableText() +: + Glib::Interface(editabletext_class_.init()) +{} + +EditableText::EditableText(AtkEditableText* castitem) +: + Glib::Interface((GObject*)(castitem)) +{} + +EditableText::~EditableText() +{} + +// static +void EditableText::add_interface(GType gtype_implementer) +{ + editabletext_class_.init().add_interface(gtype_implementer); +} + +EditableText::CppClassType EditableText::editabletext_class_; // initialize static member + +GType EditableText::get_type() +{ + return editabletext_class_.init().get_type(); +} + +GType EditableText::get_base_type() +{ + return atk_editable_text_get_type(); +} + + +bool EditableText::set_run_attributes(const AttributeSet& attrib_set, int start_offset, int end_offset) +{ + return atk_editable_text_set_run_attributes(gobj(), (attrib_set).data(), start_offset, end_offset); +} + +void EditableText::set_text_contents(const Glib::ustring& string) +{ + atk_editable_text_set_text_contents(gobj(), string.c_str()); +} + +void EditableText::insert_text(const Glib::ustring& string, int length, int& position) +{ + atk_editable_text_insert_text(gobj(), string.c_str(), length, &position); +} + +void EditableText::copy_text(int start_pos, int end_pos) +{ + atk_editable_text_copy_text(gobj(), start_pos, end_pos); +} + +void EditableText::cut_text(int start_pos, int end_pos) +{ + atk_editable_text_cut_text(gobj(), start_pos, end_pos); +} + +void EditableText::delete_text(int start_pos, int end_pos) +{ + atk_editable_text_delete_text(gobj(), start_pos, end_pos); +} + +void EditableText::paste_text(int position) +{ + atk_editable_text_paste_text(gobj(), position); +} + + +bool Atk::EditableText::set_run_attributes_vfunc(AtkAttributeSet* attrib_set, int start_offset, int end_offset) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->set_run_attributes) + return (*base->set_run_attributes)(gobj(),attrib_set,start_offset,end_offset); + + typedef bool RType; + return RType(); +} + +void Atk::EditableText::set_text_contents_vfunc(const Glib::ustring& string) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->set_text_contents) + (*base->set_text_contents)(gobj(),string.c_str()); +} + +void Atk::EditableText::insert_text_vfunc(const Glib::ustring& string, int length, int& position) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->insert_text) + (*base->insert_text)(gobj(),string.c_str(),length,&position); +} + +void Atk::EditableText::copy_text_vfunc(int start_pos, int end_pos) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->copy_text) + (*base->copy_text)(gobj(),start_pos,end_pos); +} + +void Atk::EditableText::cut_text_vfunc(int start_pos, int end_pos) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->cut_text) + (*base->cut_text)(gobj(),start_pos,end_pos); +} + +void Atk::EditableText::delete_text_vfunc(int start_pos, int end_pos) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->delete_text) + (*base->delete_text)(gobj(),start_pos,end_pos); +} + +void Atk::EditableText::paste_text_vfunc(int position) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->paste_text) + (*base->paste_text)(gobj(),position); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/editabletext.h b/libs/gtkmm2/atk/atkmm/editabletext.h new file mode 100644 index 0000000000..233aa9e892 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/editabletext.h @@ -0,0 +1,193 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_EDITABLETEXT_H +#define _ATKMM_EDITABLETEXT_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#include <atkmm/text.h> + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +extern "C" +{ + typedef struct _AtkEditableTextIface AtkEditableTextIface; + typedef struct _AtkEditableText AtkEditableText; +} +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkEditableText AtkEditableText; +typedef struct _AtkEditableTextClass AtkEditableTextClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class EditableText_Class; } // namespace Atk +namespace Atk +{ + +//TODO: I see no evidence that AtkEditableText is actually a subclass of AtkText, as the C docs say. murrayc. +/* The ATK interface implemented by components containing user-editable text content. + * This should be implemented by UI components which contain text which the user can edit, via the Atk::Object + * corresponding to that component (see Atk::Object). + * EditableText is a subclass of AtkText, and as such, an object which implements EditableText is by definition + * an Atk::Text implementor as well. + */ + +class EditableText : public Glib::Interface +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef EditableText CppObjectType; + typedef EditableText_Class CppClassType; + typedef AtkEditableText BaseObjectType; + typedef AtkEditableTextIface BaseClassType; + +private: + friend class EditableText_Class; + static CppClassType editabletext_class_; + + // noncopyable + EditableText(const EditableText&); + EditableText& operator=(const EditableText&); + +protected: + EditableText(); // you must derive from this class + explicit EditableText(AtkEditableText* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~EditableText(); + + static void add_interface(GType gtype_implementer); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkEditableText* gobj() { return reinterpret_cast<AtkEditableText*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkEditableText* gobj() const { return reinterpret_cast<AtkEditableText*>(gobject_); } + +private: + + +public: + + /** Sets the attributes for a specified range. See the ATK_ATTRIBUTE + * macros (such as Atk::ATTRIBUTE_LEFT_MARGIN) for examples of attributes + * that can be set. Note that other attributes that do not have corresponding + * ATK_ATTRIBUTE macros may also be set for certain text widgets. + * @param attrib_set An Atk::AttributeSet. + * @param start_offset Start of range in which to set attributes. + * @param end_offset End of range in which to set attributes. + * @return <tt>true</tt> if attributes successfully set for the specified + * range, otherwise <tt>false</tt>. + */ + bool set_run_attributes(const AttributeSet& attrib_set, int start_offset, int end_offset); + + /** Set text contents of @a text . + * @param string String to set for text contents of @a text . + */ + void set_text_contents(const Glib::ustring& string); + + /** Insert text at a given position. + * @param string The text to insert. + * @param length The length of text to insert, in bytes. + * @param position The caller initializes this to + * the position at which to insert the text. After the call it + * points at the position after the newly inserted text. + */ + void insert_text(const Glib::ustring& string, int length, int& position); + + /** Copy text from @a start_pos up to, but not including @a end_pos + * to the clipboard. + * @param start_pos Start position. + * @param end_pos End position. + */ + void copy_text(int start_pos, int end_pos); + + /** Copy text from @a start_pos up to, but not including @a end_pos + * to the clipboard and then delete from the widget. + * @param start_pos Start position. + * @param end_pos End position. + */ + void cut_text(int start_pos, int end_pos); + + /** Delete text @a start_pos up to, but not including @a end_pos . + * @param start_pos Start position. + * @param end_pos End position. + */ + void delete_text(int start_pos, int end_pos); + + /** Paste text from clipboard to specified @a position . + * @param position Position to paste. + */ + void paste_text(int position); + +protected: + virtual bool set_run_attributes_vfunc(AtkAttributeSet* attrib_set, int start_offset, int end_offset); + virtual void set_text_contents_vfunc(const Glib::ustring& string); + virtual void insert_text_vfunc(const Glib::ustring& string, int length, int& position); + virtual void copy_text_vfunc(int start_pos, int end_pos); + virtual void cut_text_vfunc(int start_pos, int end_pos); + virtual void delete_text_vfunc(int start_pos, int end_pos); + virtual void paste_text_vfunc(int position); + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::EditableText + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::EditableText> wrap(AtkEditableText* object, bool take_copy = false); + +} // namespace Glib + +#endif /* _ATKMM_EDITABLETEXT_H */ + diff --git a/libs/gtkmm2/atk/atkmm/hyperlink.cc b/libs/gtkmm2/atk/atkmm/hyperlink.cc new file mode 100644 index 0000000000..d9e1050a7b --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/hyperlink.cc @@ -0,0 +1,681 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/hyperlink.h> +#include <atkmm/private/hyperlink_p.h> + +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 2003 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atkmm/object.h> +#include <atk/atkobject.h> +#include <atk/atkhyperlink.h> + + +namespace Atk +{ + +} // namespace Atk + + +namespace +{ + +const Glib::SignalProxyInfo Hyperlink_signal_link_activated_info = +{ + "link_activated", + (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, + (GCallback) &Glib::SignalProxyNormal::slot0_void_callback +}; + +} // anonymous namespace + + +namespace Glib +{ + +Glib::RefPtr<Atk::Hyperlink> wrap(AtkHyperlink* object, bool take_copy) +{ + return Glib::RefPtr<Atk::Hyperlink>( dynamic_cast<Atk::Hyperlink*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} /* namespace Glib */ + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Class& Hyperlink_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Class has to know the class init function to clone custom types. + class_init_func_ = &Hyperlink_Class::class_init_function; + + // This is actually just optimized away, apparently with no harm. + // Make sure that the parent type has been created. + //CppClassParent::CppObjectType::get_type(); + + // Create the wrapper type, with the same class/instance size as the base type. + register_derived_type(atk_hyperlink_get_type()); + + // Add derived versions of interfaces, if the C type implements any interfaces: + Action::add_interface(get_type()); + } + + return *this; +} + +void Hyperlink_Class::class_init_function(void* g_class, void* class_data) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_class); + CppClassParent::class_init_function(klass, class_data); + + klass->get_uri = &get_uri_vfunc_callback; + klass->get_object = &get_object_vfunc_callback; + klass->get_end_index = &get_end_index_vfunc_callback; + klass->get_start_index = &get_start_index_vfunc_callback; + klass->is_valid = &is_valid_vfunc_callback; + klass->get_n_anchors = &get_n_anchors_vfunc_callback; + klass->link_state = &link_state_vfunc_callback; + klass->is_selected_link = &is_selected_link_vfunc_callback; + klass->link_activated = &link_activated_callback; +} + +gchar* Hyperlink_Class::get_uri_vfunc_callback(AtkHyperlink* self, gint i) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_uri_vfunc(i +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + ); + + // Call the original underlying C function: + if(base && base->get_uri) + return (*base->get_uri)(self, i); + } + + typedef gchar* RType; + return RType(); +} + +AtkObject* Hyperlink_Class::get_object_vfunc_callback(AtkHyperlink* self, gint i) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return Glib::unwrap(obj->get_object_vfunc(i +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + ); + + // Call the original underlying C function: + if(base && base->get_object) + return (*base->get_object)(self, i); + } + + typedef AtkObject* RType; + return RType(); +} + +gint Hyperlink_Class::get_end_index_vfunc_callback(AtkHyperlink* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_end_index_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + ); + + // Call the original underlying C function: + if(base && base->get_end_index) + return (*base->get_end_index)(self); + } + + typedef gint RType; + return RType(); +} + +gint Hyperlink_Class::get_start_index_vfunc_callback(AtkHyperlink* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_start_index_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + ); + + // Call the original underlying C function: + if(base && base->get_start_index) + return (*base->get_start_index)(self); + } + + typedef gint RType; + return RType(); +} + +gboolean Hyperlink_Class::is_valid_vfunc_callback(AtkHyperlink* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->is_valid_vfunc()); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + ); + + // Call the original underlying C function: + if(base && base->is_valid) + return (*base->is_valid)(self); + } + + typedef gboolean RType; + return RType(); +} + +gint Hyperlink_Class::get_n_anchors_vfunc_callback(AtkHyperlink* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_n_anchors_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + ); + + // Call the original underlying C function: + if(base && base->get_n_anchors) + return (*base->get_n_anchors)(self); + } + + typedef gint RType; + return RType(); +} + +guint Hyperlink_Class::link_state_vfunc_callback(AtkHyperlink* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->link_state_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + ); + + // Call the original underlying C function: + if(base && base->link_state) + return (*base->link_state)(self); + } + + typedef guint RType; + return RType(); +} + +gboolean Hyperlink_Class::is_selected_link_vfunc_callback(AtkHyperlink* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->is_selected_link_vfunc()); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + ); + + // Call the original underlying C function: + if(base && base->is_selected_link) + return (*base->is_selected_link)(self); + } + + typedef gboolean RType; + return RType(); +} + + +void Hyperlink_Class::link_activated_callback(AtkHyperlink* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_link_activated(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + ); + + // Call the original underlying C function: + if(base && base->link_activated) + (*base->link_activated)(self); + } +} + + +Glib::ObjectBase* Hyperlink_Class::wrap_new(GObject* object) +{ + return new Hyperlink((AtkHyperlink*)object); +} + + +/* The implementation: */ + +AtkHyperlink* Hyperlink::gobj_copy() +{ + reference(); + return gobj(); +} + +Hyperlink::Hyperlink(const Glib::ConstructParams& construct_params) +: + Glib::Object(construct_params) +{} + +Hyperlink::Hyperlink(AtkHyperlink* castitem) +: + Glib::Object((GObject*)(castitem)) +{} + +Hyperlink::~Hyperlink() +{} + + +Hyperlink::CppClassType Hyperlink::hyperlink_class_; // initialize static member + +GType Hyperlink::get_type() +{ + return hyperlink_class_.init().get_type(); +} + +GType Hyperlink::get_base_type() +{ + return atk_hyperlink_get_type(); +} + + +Glib::ustring Hyperlink::get_uri(int i) const +{ + return Glib::convert_return_gchar_ptr_to_ustring(atk_hyperlink_get_uri(const_cast<AtkHyperlink*>(gobj()), i)); +} + +Glib::RefPtr<Atk::Object> Hyperlink::get_object(int i) +{ + + Glib::RefPtr<Atk::Object> retvalue = Glib::wrap(atk_hyperlink_get_object(gobj(), i)); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + +Glib::RefPtr<const Atk::Object> Hyperlink::get_object(int i) const +{ + + Glib::RefPtr<const Atk::Object> retvalue = Glib::wrap(atk_hyperlink_get_object(const_cast<AtkHyperlink*>(gobj()), i)); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + +int Hyperlink::get_end_index() const +{ + return atk_hyperlink_get_end_index(const_cast<AtkHyperlink*>(gobj())); +} + +int Hyperlink::get_start_index() const +{ + return atk_hyperlink_get_start_index(const_cast<AtkHyperlink*>(gobj())); +} + +bool Hyperlink::is_valid() const +{ + return atk_hyperlink_is_valid(const_cast<AtkHyperlink*>(gobj())); +} + +bool Hyperlink::is_inline() const +{ + return atk_hyperlink_is_inline(const_cast<AtkHyperlink*>(gobj())); +} + +int Hyperlink::get_n_anchors() const +{ + return atk_hyperlink_get_n_anchors(const_cast<AtkHyperlink*>(gobj())); +} + +bool Hyperlink::is_selected_link() const +{ + return atk_hyperlink_is_selected_link(const_cast<AtkHyperlink*>(gobj())); +} + + +Glib::SignalProxy0< void > Hyperlink::signal_link_activated() +{ + return Glib::SignalProxy0< void >(this, &Hyperlink_signal_link_activated_info); +} + + +Glib::PropertyProxy_ReadOnly<bool> Hyperlink::property_selected_link() const +{ + return Glib::PropertyProxy_ReadOnly<bool>(this, "selected-link"); +} + +Glib::PropertyProxy_ReadOnly<int> Hyperlink::property_number_of_anchors() const +{ + return Glib::PropertyProxy_ReadOnly<int>(this, "number-of-anchors"); +} + +Glib::PropertyProxy_ReadOnly<int> Hyperlink::property_end_index() const +{ + return Glib::PropertyProxy_ReadOnly<int>(this, "end-index"); +} + +Glib::PropertyProxy_ReadOnly<int> Hyperlink::property_start_index() const +{ + return Glib::PropertyProxy_ReadOnly<int>(this, "start-index"); +} + + +void Atk::Hyperlink::on_link_activated() +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). + ); + + if(base && base->link_activated) + (*base->link_activated)(gobj()); +} + + +gchar* Atk::Hyperlink::get_uri_vfunc(int i) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). + ); + + if(base && base->get_uri) + return (*base->get_uri)(const_cast<AtkHyperlink*>(gobj()),i); + + typedef gchar* RType; + return RType(); +} + +Glib::RefPtr<Atk::Object> Atk::Hyperlink::get_object_vfunc(int i) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). + ); + + if(base && base->get_object) + return Glib::wrap((*base->get_object)(gobj(),i)); + + typedef Glib::RefPtr<Atk::Object> RType; + return RType(); +} + +int Atk::Hyperlink::get_end_index_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). + ); + + if(base && base->get_end_index) + return (*base->get_end_index)(const_cast<AtkHyperlink*>(gobj())); + + typedef int RType; + return RType(); +} + +int Atk::Hyperlink::get_start_index_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). + ); + + if(base && base->get_start_index) + return (*base->get_start_index)(const_cast<AtkHyperlink*>(gobj())); + + typedef int RType; + return RType(); +} + +bool Atk::Hyperlink::is_valid_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). + ); + + if(base && base->is_valid) + return (*base->is_valid)(const_cast<AtkHyperlink*>(gobj())); + + typedef bool RType; + return RType(); +} + +int Atk::Hyperlink::get_n_anchors_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). + ); + + if(base && base->get_n_anchors) + return (*base->get_n_anchors)(const_cast<AtkHyperlink*>(gobj())); + + typedef int RType; + return RType(); +} + +guint Atk::Hyperlink::link_state_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). + ); + + if(base && base->link_state) + return (*base->link_state)(const_cast<AtkHyperlink*>(gobj())); + + typedef guint RType; + return RType(); +} + +bool Atk::Hyperlink::is_selected_link_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). + ); + + if(base && base->is_selected_link) + return (*base->is_selected_link)(const_cast<AtkHyperlink*>(gobj())); + + typedef bool RType; + return RType(); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/hyperlink.h b/libs/gtkmm2/atk/atkmm/hyperlink.h new file mode 100644 index 0000000000..293137afb0 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/hyperlink.h @@ -0,0 +1,252 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_HYPERLINK_H +#define _ATKMM_HYPERLINK_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 2003 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atkmm/action.h> + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkHyperlink AtkHyperlink; +typedef struct _AtkHyperlinkClass AtkHyperlinkClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class Hyperlink_Class; } // namespace Atk +namespace Atk +{ + +class Object; + +/* An ATK object which encapsulates a link or set of links in a hypertext document. + * It implements the AtkAction interface. + */ + +class Hyperlink + : public Glib::Object, + public Atk::Action +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef Hyperlink CppObjectType; + typedef Hyperlink_Class CppClassType; + typedef AtkHyperlink BaseObjectType; + typedef AtkHyperlinkClass BaseClassType; + +private: friend class Hyperlink_Class; + static CppClassType hyperlink_class_; + +private: + // noncopyable + Hyperlink(const Hyperlink&); + Hyperlink& operator=(const Hyperlink&); + +protected: + explicit Hyperlink(const Glib::ConstructParams& construct_params); + explicit Hyperlink(AtkHyperlink* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~Hyperlink(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkHyperlink* gobj() { return reinterpret_cast<AtkHyperlink*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkHyperlink* gobj() const { return reinterpret_cast<AtkHyperlink*>(gobject_); } + + ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. + AtkHyperlink* gobj_copy(); + +private: + + +protected: + +public: + + + /** Get a the URI associated with the anchor specified + * by @a i of @a link . + * + * Multiple anchors are primarily used by client-side image maps. + * @param i A (zero-index) integer specifying the desired anchor. + * @return A string specifying the URI. + */ + Glib::ustring get_uri(int i) const; + + + /** Returns the item associated with this hyperlinks nth anchor. + * For instance, the returned Atk::Object will implement Atk::Text + * if @a link is a text hyperlink, Atk::Image if @a link is an image + * hyperlink etc. + * + * Multiple anchors are primarily used by client-side image maps. + * @param i A (zero-index) integer specifying the desired anchor. + * @return An Atk::Object associated with this hyperlinks i-th anchor. + */ + Glib::RefPtr<Atk::Object> get_object(int i); + + /** Returns the item associated with this hyperlinks nth anchor. + * For instance, the returned Atk::Object will implement Atk::Text + * if @a link is a text hyperlink, Atk::Image if @a link is an image + * hyperlink etc. + * + * Multiple anchors are primarily used by client-side image maps. + * @param i A (zero-index) integer specifying the desired anchor. + * @return An Atk::Object associated with this hyperlinks i-th anchor. + */ + Glib::RefPtr<const Atk::Object> get_object(int i) const; + + + /** Gets the index with the hypertext document at which this link ends. + * @return The index with the hypertext document at which this link ends. + */ + int get_end_index() const; + + + /** Gets the index with the hypertext document at which this link begins. + * @return The index with the hypertext document at which this link begins. + */ + int get_start_index() const; + + + /** Since the document that a link is associated with may have changed + * this method returns <tt>true</tt> if the link is still valid (with + * respect to the document it references) and <tt>false</tt> otherwise. + * @return Whether or not this link is still valid. + */ + bool is_valid() const; + + + /** Indicates whether the link currently displays some or all of its + * content inline. Ordinary HTML links will usually return + * <tt>false</tt>, but an inline <src> HTML element will return + * <tt>true</tt>. + * a * + * @return Whether or not this link displays its content inline. + */ + bool is_inline() const; + + + /** Gets the number of anchors associated with this hyperlink. + * @return The number of anchors associated with this hyperlink. + */ + int get_n_anchors() const; + + /** Determines whether this AtkHyperlink is selected + * @return True is the AtkHyperlink is selected, False otherwise. + */ + bool is_selected_link() const; + + + Glib::SignalProxy0< void > signal_link_activated(); + + + /** Specifies whether the AtkHyperlink object is selected. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<bool> property_selected_link() const; + + + /** The number of anchors associated with the AtkHyperlink object. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<int> property_number_of_anchors() const; + + + /** The end index of the AtkHyperlink object. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<int> property_end_index() const; + + + /** The start index of the AtkHyperlink object. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<int> property_start_index() const; + + +protected: + virtual gchar* get_uri_vfunc(int i) const; + virtual Glib::RefPtr<Atk::Object> get_object_vfunc(int i); + virtual int get_end_index_vfunc() const; + virtual int get_start_index_vfunc() const; + virtual bool is_valid_vfunc() const; + virtual int get_n_anchors_vfunc() const; + virtual guint link_state_vfunc() const; + virtual bool is_selected_link_vfunc() const; + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + virtual void on_link_activated(); + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::Hyperlink + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::Hyperlink> wrap(AtkHyperlink* object, bool take_copy = false); +} + + +#endif /* _ATKMM_HYPERLINK_H */ + diff --git a/libs/gtkmm2/atk/atkmm/hypertext.cc b/libs/gtkmm2/atk/atkmm/hypertext.cc new file mode 100644 index 0000000000..f383ba5e74 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/hypertext.cc @@ -0,0 +1,396 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/hypertext.h> +#include <atkmm/private/hypertext_p.h> + +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 2003 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atkmm/object.h> +#include <atk/atkhypertext.h> + + +namespace Atk +{ + + +} // namespace Atk + + +namespace +{ + +void Hypertext_signal_link_selected_callback(AtkHypertext* self, gint p0,void* data) +{ + using namespace Atk; + typedef sigc::slot< void,int > SlotType; + + // Do not try to call a signal on a disassociated wrapper. + if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) + { + try + { + if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data)) + (*static_cast<SlotType*>(slot))(p0 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } +} + +const Glib::SignalProxyInfo Hypertext_signal_link_selected_info = +{ + "link_selected", + (GCallback) &Hypertext_signal_link_selected_callback, + (GCallback) &Hypertext_signal_link_selected_callback +}; + +} // anonymous namespace + + +namespace Glib +{ + +Glib::RefPtr<Atk::Hypertext> wrap(AtkHypertext* object, bool take_copy) +{ + return Glib::RefPtr<Atk::Hypertext>( dynamic_cast<Atk::Hypertext*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} // namespace Glib + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Interface_Class& Hypertext_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Interface_Class has to know the interface init function + // in order to add interfaces to implementing types. + class_init_func_ = &Hypertext_Class::iface_init_function; + + // We can not derive from another interface, and it is not necessary anyway. + gtype_ = atk_hypertext_get_type(); + } + + return *this; +} + +void Hypertext_Class::iface_init_function(void* g_iface, void*) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_iface); + + //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. + //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc + g_assert(klass != 0); + + klass->get_link = &get_link_vfunc_callback; + klass->get_n_links = &get_n_links_vfunc_callback; + klass->get_link_index = &get_link_index_vfunc_callback; + klass->link_selected = &link_selected_callback; +} + +AtkHyperlink* Hypertext_Class::get_link_vfunc_callback(AtkHypertext* self, gint link_index) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return Glib::unwrap(obj->get_link_vfunc(link_index +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_link) + return (*base->get_link)(self, link_index); + } + + typedef AtkHyperlink* RType; + return RType(); +} + +gint Hypertext_Class::get_n_links_vfunc_callback(AtkHypertext* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_n_links_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_n_links) + return (*base->get_n_links)(self); + } + + typedef gint RType; + return RType(); +} + +gint Hypertext_Class::get_link_index_vfunc_callback(AtkHypertext* self, gint char_index) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_link_index_vfunc(char_index +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_link_index) + return (*base->get_link_index)(self, char_index); + } + + typedef gint RType; + return RType(); +} + + +void Hypertext_Class::link_selected_callback(AtkHypertext* self, gint p0) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_link_selected(p0 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->link_selected) + (*base->link_selected)(self, p0); + } +} + + +Glib::ObjectBase* Hypertext_Class::wrap_new(GObject* object) +{ + return new Hypertext((AtkHypertext*)(object)); +} + + +/* The implementation: */ + +Hypertext::Hypertext() +: + Glib::Interface(hypertext_class_.init()) +{} + +Hypertext::Hypertext(AtkHypertext* castitem) +: + Glib::Interface((GObject*)(castitem)) +{} + +Hypertext::~Hypertext() +{} + +// static +void Hypertext::add_interface(GType gtype_implementer) +{ + hypertext_class_.init().add_interface(gtype_implementer); +} + +Hypertext::CppClassType Hypertext::hypertext_class_; // initialize static member + +GType Hypertext::get_type() +{ + return hypertext_class_.init().get_type(); +} + +GType Hypertext::get_base_type() +{ + return atk_hypertext_get_type(); +} + + +Glib::RefPtr<Hyperlink> Hypertext::get_link(int link_index) +{ + return Glib::wrap(atk_hypertext_get_link(gobj(), link_index)); +} + +Glib::RefPtr<const Hyperlink> Hypertext::get_link(int link_index) const +{ + return Glib::wrap(atk_hypertext_get_link(const_cast<AtkHypertext*>(gobj()), link_index)); +} + +int Hypertext::get_n_links() const +{ + return atk_hypertext_get_n_links(const_cast<AtkHypertext*>(gobj())); +} + +int Hypertext::get_link_index(int char_index) const +{ + return atk_hypertext_get_link_index(const_cast<AtkHypertext*>(gobj()), char_index); +} + + +Glib::SignalProxy1< void,int > Hypertext::signal_link_selected() +{ + return Glib::SignalProxy1< void,int >(this, &Hypertext_signal_link_selected_info); +} + + +void Atk::Hypertext::on_link_selected(int link_index) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->link_selected) + (*base->link_selected)(gobj(),link_index); +} + + +Glib::RefPtr<Hyperlink> Atk::Hypertext::get_link_vfunc(int link_index) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_link) + return Glib::wrap((*base->get_link)(gobj(),link_index)); + + typedef Glib::RefPtr<Hyperlink> RType; + return RType(); +} + +int Atk::Hypertext::get_n_links_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_n_links) + return (*base->get_n_links)(const_cast<AtkHypertext*>(gobj())); + + typedef int RType; + return RType(); +} + +int Atk::Hypertext::get_link_index_vfunc(int char_index) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_link_index) + return (*base->get_link_index)(const_cast<AtkHypertext*>(gobj()),char_index); + + typedef int RType; + return RType(); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/hypertext.h b/libs/gtkmm2/atk/atkmm/hypertext.h new file mode 100644 index 0000000000..090827662a --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/hypertext.h @@ -0,0 +1,167 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_HYPERTEXT_H +#define _ATKMM_HYPERTEXT_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 2003 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#include <atkmm/hyperlink.h> + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +extern "C" +{ + typedef struct _AtkHypertextIface AtkHypertextIface; + typedef struct _AtkHypertext AtkHypertext; +} +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +/** The ATK interface which provides standard mechanism for manipulating hyperlinks. + */ +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkHypertext AtkHypertext; +typedef struct _AtkHypertextClass AtkHypertextClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class Hypertext_Class; } // namespace Atk +namespace Atk +{ + +class Object; + + +class Hypertext : public Glib::Interface +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef Hypertext CppObjectType; + typedef Hypertext_Class CppClassType; + typedef AtkHypertext BaseObjectType; + typedef AtkHypertextIface BaseClassType; + +private: + friend class Hypertext_Class; + static CppClassType hypertext_class_; + + // noncopyable + Hypertext(const Hypertext&); + Hypertext& operator=(const Hypertext&); + +protected: + Hypertext(); // you must derive from this class + explicit Hypertext(AtkHypertext* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~Hypertext(); + + static void add_interface(GType gtype_implementer); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkHypertext* gobj() { return reinterpret_cast<AtkHypertext*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkHypertext* gobj() const { return reinterpret_cast<AtkHypertext*>(gobject_); } + +private: + +public: + + + /** Gets the link in this hypertext document at index + * @a link_index + * @param link_index An integer specifying the desired link. + * @return The link in this hypertext document at + * index @a link_index . + */ + Glib::RefPtr<Hyperlink> get_link(int link_index); + + /** Gets the link in this hypertext document at index + * @a link_index + * @param link_index An integer specifying the desired link. + * @return The link in this hypertext document at + * index @a link_index . + */ + Glib::RefPtr<const Hyperlink> get_link(int link_index) const; + + /** Gets the number of links within this hypertext document. + * @return The number of links within this hypertext document. + */ + int get_n_links() const; + + /** Gets the index into the array of hyperlinks that is associated with + * the character specified by @a char_index , or -1 if there is no hyperlink + * associated with this character. + * @param char_index A character index. + * @return An index into the array of hyperlinks in @a hypertext . + */ + int get_link_index(int char_index) const; + + + Glib::SignalProxy1< void,int > signal_link_selected(); + + + virtual Glib::RefPtr<Hyperlink> get_link_vfunc(int link_index); + virtual int get_n_links_vfunc() const; + virtual int get_link_index_vfunc(int char_index) const; + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + virtual void on_link_selected(int link_index); + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::Hypertext + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::Hypertext> wrap(AtkHypertext* object, bool take_copy = false); + +} // namespace Glib + +#endif /* _ATKMM_HYPERTEXT_H */ + diff --git a/libs/gtkmm2/atk/atkmm/image.cc b/libs/gtkmm2/atk/atkmm/image.cc new file mode 100644 index 0000000000..2f1df28c18 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/image.cc @@ -0,0 +1,349 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/image.h> +#include <atkmm/private/image_p.h> + +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atkmm/object.h> +#include <atk/atkimage.h> + + +namespace +{ +} // anonymous namespace + + +namespace Glib +{ + +Glib::RefPtr<Atk::Image> wrap(AtkImage* object, bool take_copy) +{ + return Glib::RefPtr<Atk::Image>( dynamic_cast<Atk::Image*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} // namespace Glib + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Interface_Class& Image_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Interface_Class has to know the interface init function + // in order to add interfaces to implementing types. + class_init_func_ = &Image_Class::iface_init_function; + + // We can not derive from another interface, and it is not necessary anyway. + gtype_ = atk_image_get_type(); + } + + return *this; +} + +void Image_Class::iface_init_function(void* g_iface, void*) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_iface); + + //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. + //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc + g_assert(klass != 0); + + klass->set_image_description = &set_image_description_vfunc_callback; + klass->get_image_description = &get_image_description_vfunc_callback; + klass->get_image_position = &get_image_position_vfunc_callback; + klass->get_image_size = &get_image_size_vfunc_callback; +} + +gboolean Image_Class::set_image_description_vfunc_callback(AtkImage* self, const gchar* description) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->set_image_description_vfunc(Glib::convert_const_gchar_ptr_to_ustring(description) +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->set_image_description) + return (*base->set_image_description)(self, description); + } + + typedef gboolean RType; + return RType(); +} + +const gchar* Image_Class::get_image_description_vfunc_callback(AtkImage* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_image_description_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_image_description) + return (*base->get_image_description)(self); + } + + typedef const gchar* RType; + return RType(); +} + +void Image_Class::get_image_position_vfunc_callback(AtkImage* self, gint* x, gint* y, AtkCoordType coord_type) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->get_image_position_vfunc(*(x) +, *(y) +, ((CoordType)(coord_type)) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_image_position) + (*base->get_image_position)(self, x, y, coord_type); + } +} + +void Image_Class::get_image_size_vfunc_callback(AtkImage* self, gint* width, gint* height) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->get_image_size_vfunc(*(width) +, *(height) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_image_size) + (*base->get_image_size)(self, width, height); + } +} + + +Glib::ObjectBase* Image_Class::wrap_new(GObject* object) +{ + return new Image((AtkImage*)(object)); +} + + +/* The implementation: */ + +Image::Image() +: + Glib::Interface(image_class_.init()) +{} + +Image::Image(AtkImage* castitem) +: + Glib::Interface((GObject*)(castitem)) +{} + +Image::~Image() +{} + +// static +void Image::add_interface(GType gtype_implementer) +{ + image_class_.init().add_interface(gtype_implementer); +} + +Image::CppClassType Image::image_class_; // initialize static member + +GType Image::get_type() +{ + return image_class_.init().get_type(); +} + +GType Image::get_base_type() +{ + return atk_image_get_type(); +} + + +bool Image::set_image_description(const Glib::ustring& description) +{ + return atk_image_set_image_description(gobj(), description.c_str()); +} + +Glib::ustring Image::get_image_description() const +{ + return Glib::convert_const_gchar_ptr_to_ustring(atk_image_get_image_description(const_cast<AtkImage*>(gobj()))); +} + +void Image::get_image_size(int& width, int& height) const +{ + atk_image_get_image_size(const_cast<AtkImage*>(gobj()), &width, &height); +} + +void Image::get_image_position(int& x, int& y, CoordType coord_type) const +{ + atk_image_get_image_position(const_cast<AtkImage*>(gobj()), &x, &y, ((AtkCoordType)(coord_type))); +} + + +bool Atk::Image::set_image_description_vfunc(const Glib::ustring& description) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->set_image_description) + return (*base->set_image_description)(gobj(),description.c_str()); + + typedef bool RType; + return RType(); +} + +const char* Atk::Image::get_image_description_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_image_description) + return (*base->get_image_description)(const_cast<AtkImage*>(gobj())); + + typedef const char* RType; + return RType(); +} + +void Atk::Image::get_image_position_vfunc(int& x, int& y, CoordType coord_type) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_image_position) + (*base->get_image_position)(const_cast<AtkImage*>(gobj()),&x,&y,((AtkCoordType)(coord_type))); +} + +void Atk::Image::get_image_size_vfunc(int& width, int& height) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_image_size) + (*base->get_image_size)(const_cast<AtkImage*>(gobj()),&width,&height); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/image.h b/libs/gtkmm2/atk/atkmm/image.h new file mode 100644 index 0000000000..a6af34884a --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/image.h @@ -0,0 +1,173 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_IMAGE_H +#define _ATKMM_IMAGE_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#include <atkmm/component.h> /* for Atk::CoordType */ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +extern "C" +{ + typedef struct _AtkImageIface AtkImageIface; + typedef struct _AtkImage AtkImage; +} +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkImage AtkImage; +typedef struct _AtkImageClass AtkImageClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class Image_Class; } // namespace Atk +namespace Atk +{ + +/** The ATK Interface implemented by components which expose image or pixmap content on-screen. + * This should be implemented by Atk::Object subtypes on behalf of components which display image/pixmap information + * onscreen, and which provide information (other than just widget borders, etc.) via that image content. For instance, + * icons, buttons with icons, toolbar elements, and image viewing panes typically should implement AtkImage. + * + * Atk::Image primarily provides two types of information: coordinate information (useful for screen review mode of + * screenreaders, and for use by onscreen magnifiers), and descriptive information. The descriptive information is + * provided for alternative, text-only presentation of the most significant information present in the image. + */ + +class Image : public Glib::Interface +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef Image CppObjectType; + typedef Image_Class CppClassType; + typedef AtkImage BaseObjectType; + typedef AtkImageIface BaseClassType; + +private: + friend class Image_Class; + static CppClassType image_class_; + + // noncopyable + Image(const Image&); + Image& operator=(const Image&); + +protected: + Image(); // you must derive from this class + explicit Image(AtkImage* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~Image(); + + static void add_interface(GType gtype_implementer); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkImage* gobj() { return reinterpret_cast<AtkImage*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkImage* gobj() const { return reinterpret_cast<AtkImage*>(gobject_); } + +private: + + +public: + + /** Sets the textual description for this image. + * @param description A string description to set for @a image . + * @return Boolean <tt>true</tt>, or <tt>false</tt> if operation could + * not be completed. + */ + bool set_image_description(const Glib::ustring& description); + + /** Get a textual description of this image. + * @return A string representing the image description. + */ + Glib::ustring get_image_description() const; + + + /** Get the width and height in pixels for the specified image. + * The values of @a width and @a height are returned as -1 if the + * values cannot be obtained. + * @param width Filled with the image width. + * @param height Filled with the image height. + */ + void get_image_size(int& width, int& height) const; + + /** Gets the position of the image in the form of a point specifying the + * images top-left corner. The values of @a x and @a y are returned as -1 + * if the values cannot be obtained. + * @param x Address of <tt>int</tt> to put x coordinate position. + * @param y Address of <tt>int</tt> to put y coordinate position. + * @param coord_type Specifies whether the coordinates are relative to the screen + * or to the components top level window. + */ + void get_image_position(int& x, int& y, CoordType coord_type) const; + +protected: + virtual bool set_image_description_vfunc(const Glib::ustring& description); + virtual const char* get_image_description_vfunc() const; + + virtual void get_image_position_vfunc(int& x, int& y, CoordType coord_type) const; + virtual void get_image_size_vfunc(int& width, int& height) const; + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::Image + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::Image> wrap(AtkImage* object, bool take_copy = false); + +} // namespace Glib + +#endif /* _ATKMM_IMAGE_H */ + diff --git a/libs/gtkmm2/atk/atkmm/implementor.cc b/libs/gtkmm2/atk/atkmm/implementor.cc new file mode 100644 index 0000000000..303bf3d0a1 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/implementor.cc @@ -0,0 +1,175 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/implementor.h> +#include <atkmm/private/implementor_p.h> + +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atkmm/object.h> +#include <atk/atkobject.h> + + +namespace +{ +} // anonymous namespace + + +namespace Glib +{ + +Glib::RefPtr<Atk::Implementor> wrap(AtkImplementor* object, bool take_copy) +{ + return Glib::RefPtr<Atk::Implementor>( dynamic_cast<Atk::Implementor*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} // namespace Glib + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Interface_Class& Implementor_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Interface_Class has to know the interface init function + // in order to add interfaces to implementing types. + class_init_func_ = &Implementor_Class::iface_init_function; + + // We can not derive from another interface, and it is not necessary anyway. + gtype_ = atk_implementor_get_type(); + } + + return *this; +} + +void Implementor_Class::iface_init_function(void* g_iface, void*) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_iface); + + //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. + //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc + g_assert(klass != 0); + + klass->ref_accessible = &ref_accessible_vfunc_callback; +} + +AtkObject* Implementor_Class::ref_accessible_vfunc_callback(AtkImplementor* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return Glib::unwrap(obj->ref_accessibile_vfunc()); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->ref_accessible) + return (*base->ref_accessible)(self); + } + + typedef AtkObject* RType; + return RType(); +} + + +Glib::ObjectBase* Implementor_Class::wrap_new(GObject* object) +{ + return new Implementor((AtkImplementor*)(object)); +} + + +/* The implementation: */ + +Implementor::Implementor() +: + Glib::Interface(implementor_class_.init()) +{} + +Implementor::Implementor(AtkImplementor* castitem) +: + Glib::Interface((GObject*)(castitem)) +{} + +Implementor::~Implementor() +{} + +// static +void Implementor::add_interface(GType gtype_implementer) +{ + implementor_class_.init().add_interface(gtype_implementer); +} + +Implementor::CppClassType Implementor::implementor_class_; // initialize static member + +GType Implementor::get_type() +{ + return implementor_class_.init().get_type(); +} + +GType Implementor::get_base_type() +{ + return atk_implementor_get_type(); +} + + +Glib::RefPtr<Object> Atk::Implementor::ref_accessibile_vfunc() +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->ref_accessible) + return Glib::wrap((*base->ref_accessible)(gobj())); + + typedef Glib::RefPtr<Object> RType; + return RType(); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/implementor.h b/libs/gtkmm2/atk/atkmm/implementor.h new file mode 100644 index 0000000000..7df786ce27 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/implementor.h @@ -0,0 +1,127 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_IMPLEMENTOR_H +#define _ATKMM_IMPLEMENTOR_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#include <atkmm/object.h> + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +extern "C" +{ + typedef struct _AtkImplementorIface AtkImplementorIface; + typedef struct _AtkImplementor AtkImplementor; +} +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkImplementor AtkImplementor; +typedef struct _AtkImplementorClass AtkImplementorClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class Implementor_Class; } // namespace Atk +namespace Atk +{ + + +class Implementor : public Glib::Interface +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef Implementor CppObjectType; + typedef Implementor_Class CppClassType; + typedef AtkImplementor BaseObjectType; + typedef AtkImplementorIface BaseClassType; + +private: + friend class Implementor_Class; + static CppClassType implementor_class_; + + // noncopyable + Implementor(const Implementor&); + Implementor& operator=(const Implementor&); + +protected: + Implementor(); // you must derive from this class + explicit Implementor(AtkImplementor* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~Implementor(); + + static void add_interface(GType gtype_implementer); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkImplementor* gobj() { return reinterpret_cast<AtkImplementor*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkImplementor* gobj() const { return reinterpret_cast<AtkImplementor*>(gobject_); } + +private: + + +protected: + virtual Glib::RefPtr<Object> ref_accessibile_vfunc(); + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::Implementor + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::Implementor> wrap(AtkImplementor* object, bool take_copy = false); + +} // namespace Glib + +#endif /* _ATKMM_IMPLEMENTOR_H */ + diff --git a/libs/gtkmm2/atk/atkmm/init.cc b/libs/gtkmm2/atk/atkmm/init.cc new file mode 100644 index 0000000000..0b103a9b05 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/init.cc @@ -0,0 +1,34 @@ +// -*- c++ -*- +/* $Id$ */ + +/* Copyright (C) 2003 The atkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <glibmm/init.h> +#include <atkmm/wrap_init.h> + +namespace Atk +{ + +void init() +{ + Glib::init(); + Atk::wrap_init(); +} + +} // namespace Atk + diff --git a/libs/gtkmm2/atk/atkmm/init.h b/libs/gtkmm2/atk/atkmm/init.h new file mode 100644 index 0000000000..05bdd07f34 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/init.h @@ -0,0 +1,40 @@ +// -*- c++ -*- +#ifndef _ATKMM_INIT_H +#define _ATKMM_INIT_H + +/* $Id$ */ + +/* Copyright (C) 2003 The atkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +namespace Atk +{ + +/** Initialize atkmm. + * You may call this more than once. + * You do not need to call this if you are using Gtk::Main, + * because it calls this for you. + */ +void init(); + +} // namespace Atk + + + +#endif // _ATKMM_INIT_H + + diff --git a/libs/gtkmm2/atk/atkmm/noopobject.cc b/libs/gtkmm2/atk/atkmm/noopobject.cc new file mode 100644 index 0000000000..c9c78627cd --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/noopobject.cc @@ -0,0 +1,132 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/noopobject.h> +#include <atkmm/private/noopobject_p.h> + +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atk/atknoopobject.h> + + +namespace +{ +} // anonymous namespace + + +namespace Glib +{ + +Glib::RefPtr<Atk::NoOpObject> wrap(AtkNoOpObject* object, bool take_copy) +{ + return Glib::RefPtr<Atk::NoOpObject>( dynamic_cast<Atk::NoOpObject*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} /* namespace Glib */ + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Class& NoOpObject_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Class has to know the class init function to clone custom types. + class_init_func_ = &NoOpObject_Class::class_init_function; + + // This is actually just optimized away, apparently with no harm. + // Make sure that the parent type has been created. + //CppClassParent::CppObjectType::get_type(); + + // Create the wrapper type, with the same class/instance size as the base type. + register_derived_type(atk_no_op_object_get_type()); + + // Add derived versions of interfaces, if the C type implements any interfaces: + Component::add_interface(get_type()); + Action::add_interface(get_type()); + EditableText::add_interface(get_type()); + Image::add_interface(get_type()); + Selection::add_interface(get_type()); + Table::add_interface(get_type()); + Text::add_interface(get_type()); + Hypertext::add_interface(get_type()); + Value::add_interface(get_type()); + } + + return *this; +} + +void NoOpObject_Class::class_init_function(void* g_class, void* class_data) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_class); + CppClassParent::class_init_function(klass, class_data); + +} + + +Glib::ObjectBase* NoOpObject_Class::wrap_new(GObject* object) +{ + return new NoOpObject((AtkNoOpObject*)object); +} + + +/* The implementation: */ + +AtkNoOpObject* NoOpObject::gobj_copy() +{ + reference(); + return gobj(); +} + +NoOpObject::NoOpObject(const Glib::ConstructParams& construct_params) +: + Atk::Object(construct_params) +{} + +NoOpObject::NoOpObject(AtkNoOpObject* castitem) +: + Atk::Object((AtkObject*)(castitem)) +{} + +NoOpObject::~NoOpObject() +{} + + +NoOpObject::CppClassType NoOpObject::noopobject_class_; // initialize static member + +GType NoOpObject::get_type() +{ + return noopobject_class_.init().get_type(); +} + +GType NoOpObject::get_base_type() +{ + return atk_no_op_object_get_type(); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/noopobject.h b/libs/gtkmm2/atk/atkmm/noopobject.h new file mode 100644 index 0000000000..b5ee9bed0c --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/noopobject.h @@ -0,0 +1,143 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_NOOPOBJECT_H +#define _ATKMM_NOOPOBJECT_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atkmm/object.h> +#include <atkmm/component.h> +#include <atkmm/action.h> +#include <atkmm/editabletext.h> +#include <atkmm/image.h> +#include <atkmm/selection.h> +#include <atkmm/table.h> +#include <atkmm/value.h> +#include <atkmm/hypertext.h> + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkNoOpObject AtkNoOpObject; +typedef struct _AtkNoOpObjectClass AtkNoOpObjectClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class NoOpObject_Class; } // namespace Atk +namespace Atk +{ + +/** An Atk::NoOpObject is an Atk::Object which purports to implement all ATK interfaces. + * It is the type of Atk::Object which is created if an accessible object is requested for an object type for which no + * factory type is specified. + */ + +class NoOpObject +: + public Atk::Object, + public Atk::Component, + public Atk::Action, + public Atk::EditableText, + public Atk::Image, + public Atk::Selection, + public Atk::Table, + public Atk::Text, + public Atk::Hypertext, + public Atk::Value +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef NoOpObject CppObjectType; + typedef NoOpObject_Class CppClassType; + typedef AtkNoOpObject BaseObjectType; + typedef AtkNoOpObjectClass BaseClassType; + +private: friend class NoOpObject_Class; + static CppClassType noopobject_class_; + +private: + // noncopyable + NoOpObject(const NoOpObject&); + NoOpObject& operator=(const NoOpObject&); + +protected: + explicit NoOpObject(const Glib::ConstructParams& construct_params); + explicit NoOpObject(AtkNoOpObject* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~NoOpObject(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkNoOpObject* gobj() { return reinterpret_cast<AtkNoOpObject*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkNoOpObject* gobj() const { return reinterpret_cast<AtkNoOpObject*>(gobject_); } + + ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. + AtkNoOpObject* gobj_copy(); + +private: + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + friend class Atk::Object_Class; +#endif + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::NoOpObject + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::NoOpObject> wrap(AtkNoOpObject* object, bool take_copy = false); +} + + +#endif /* _ATKMM_NOOPOBJECT_H */ + diff --git a/libs/gtkmm2/atk/atkmm/object.cc b/libs/gtkmm2/atk/atkmm/object.cc new file mode 100644 index 0000000000..44e7301691 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/object.cc @@ -0,0 +1,834 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/object.h> +#include <atkmm/private/object_p.h> + +#include <atk/atk-enum-types.h> +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atkmm/noopobject.h> +#include <atkmm/relation.h> +#include <atkmm/relationset.h> +#include <atkmm/stateset.h> +#include <atk/atkobject.h> + + +namespace Atk +{ + +/* AtkObject is actually an abstract base class. So if this wrap_new() + * function is called, it means that no wrapper exists for the real C object. + * The problem is that gail (the real accessibility implementation) is + * currently not wrapped and will probably never be. Therefore, code like + * in the following example is doomed to fail: + * + * Gtk::Image image ("icon.png"); + * Glib::RefPtr<Atk::Image> accessible = Glib::RefPtr<Atk::Image>::cast_dynamic(image.get_accessible()); + * accessible->set_image_description("my icon"); + * + * This would segfault, even though the accessible object _does_ implement + * AtkImage. But Atk::Image is an interface class that can't be instantiated + * as is. It needs an object. + * + * The solution is to instantiate a dummy object that implements all of the + * ATK interfaces. Fortunately, ATK already provides us with such a thing, + * AtkNoOpObject. All widget accessible objects are of this type if the gail + * module is not loaded (which is the default). + * + * So what we do here is abusing Atk::NoOpObject to get around the lack of + * C++ wrappers for gail. Instead of instantiating a useless instance of an + * abstract base class, we just create a Atk::NoOpObject instance which can + * be casted to any of the Atk interface classes. + */ +Glib::ObjectBase* Object_Class::wrap_new(GObject* object) +{ + return new Atk::NoOpObject((AtkNoOpObject*) object); +} + +} // namespace Atk + + +namespace +{ + +void Object_signal_children_changed_callback(AtkObject* self, guint p0,gpointer p1,void* data) +{ + using namespace Atk; + typedef sigc::slot< void,guint,gpointer > SlotType; + + // Do not try to call a signal on a disassociated wrapper. + if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) + { + try + { + if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data)) + (*static_cast<SlotType*>(slot))(p0, p1); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } +} + +const Glib::SignalProxyInfo Object_signal_children_changed_info = +{ + "children_changed", + (GCallback) &Object_signal_children_changed_callback, + (GCallback) &Object_signal_children_changed_callback +}; + + +void Object_signal_focus_event_callback(AtkObject* self, gboolean p0,void* data) +{ + using namespace Atk; + typedef sigc::slot< void,bool > SlotType; + + // Do not try to call a signal on a disassociated wrapper. + if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) + { + try + { + if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data)) + (*static_cast<SlotType*>(slot))(p0 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } +} + +const Glib::SignalProxyInfo Object_signal_focus_event_info = +{ + "focus_event", + (GCallback) &Object_signal_focus_event_callback, + (GCallback) &Object_signal_focus_event_callback +}; + + +void Object_signal_property_change_callback(AtkObject* self, AtkPropertyValues* p0,void* data) +{ + using namespace Atk; + typedef sigc::slot< void,AtkPropertyValues* > SlotType; + + // Do not try to call a signal on a disassociated wrapper. + if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) + { + try + { + if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data)) + (*static_cast<SlotType*>(slot))(p0); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } +} + +const Glib::SignalProxyInfo Object_signal_property_change_info = +{ + "property_change", + (GCallback) &Object_signal_property_change_callback, + (GCallback) &Object_signal_property_change_callback +}; + + +void Object_signal_state_change_callback(AtkObject* self, const gchar* p0,gboolean p1,void* data) +{ + using namespace Atk; + typedef sigc::slot< void,const Glib::ustring&,bool > SlotType; + + // Do not try to call a signal on a disassociated wrapper. + if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) + { + try + { + if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data)) + (*static_cast<SlotType*>(slot))(Glib::convert_const_gchar_ptr_to_ustring(p0) +, p1 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } +} + +const Glib::SignalProxyInfo Object_signal_state_change_info = +{ + "state_change", + (GCallback) &Object_signal_state_change_callback, + (GCallback) &Object_signal_state_change_callback +}; + + +const Glib::SignalProxyInfo Object_signal_visible_data_changed_info = +{ + "visible_data_changed", + (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, + (GCallback) &Glib::SignalProxyNormal::slot0_void_callback +}; + + +void Object_signal_active_descendant_changed_callback(AtkObject* self, gpointer* p0,void* data) +{ + using namespace Atk; + typedef sigc::slot< void,void** > SlotType; + + // Do not try to call a signal on a disassociated wrapper. + if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) + { + try + { + if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data)) + (*static_cast<SlotType*>(slot))(p0 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } +} + +const Glib::SignalProxyInfo Object_signal_active_descendant_changed_info = +{ + "active_descendant_changed", + (GCallback) &Object_signal_active_descendant_changed_callback, + (GCallback) &Object_signal_active_descendant_changed_callback +}; + +} // anonymous namespace + +// static +GType Glib::Value<Atk::Role>::value_type() +{ + return atk_role_get_type(); +} + + +namespace Glib +{ + +Glib::RefPtr<Atk::Object> wrap(AtkObject* object, bool take_copy) +{ + return Glib::RefPtr<Atk::Object>( dynamic_cast<Atk::Object*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} /* namespace Glib */ + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Class& Object_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Class has to know the class init function to clone custom types. + class_init_func_ = &Object_Class::class_init_function; + + // This is actually just optimized away, apparently with no harm. + // Make sure that the parent type has been created. + //CppClassParent::CppObjectType::get_type(); + + // Create the wrapper type, with the same class/instance size as the base type. + register_derived_type(atk_object_get_type()); + + // Add derived versions of interfaces, if the C type implements any interfaces: + } + + return *this; +} + +void Object_Class::class_init_function(void* g_class, void* class_data) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_class); + CppClassParent::class_init_function(klass, class_data); + + klass->children_changed = &children_changed_callback; + klass->focus_event = &focus_event_callback; + klass->property_change = &property_change_callback; + klass->state_change = &state_change_callback; + klass->visible_data_changed = &visible_data_changed_callback; + klass->active_descendant_changed = &active_descendant_changed_callback; +} + + +void Object_Class::children_changed_callback(AtkObject* self, guint p0, gpointer p1) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_children_changed(p0, p1); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + ); + + // Call the original underlying C function: + if(base && base->children_changed) + (*base->children_changed)(self, p0, p1); + } +} + +void Object_Class::focus_event_callback(AtkObject* self, gboolean p0) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_focus_event(p0 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + ); + + // Call the original underlying C function: + if(base && base->focus_event) + (*base->focus_event)(self, p0); + } +} + +void Object_Class::property_change_callback(AtkObject* self, AtkPropertyValues* p0) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_property_change(p0); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + ); + + // Call the original underlying C function: + if(base && base->property_change) + (*base->property_change)(self, p0); + } +} + +void Object_Class::state_change_callback(AtkObject* self, const gchar* p0, gboolean p1) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_state_change(Glib::convert_const_gchar_ptr_to_ustring(p0) +, p1 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + ); + + // Call the original underlying C function: + if(base && base->state_change) + (*base->state_change)(self, p0, p1); + } +} + +void Object_Class::visible_data_changed_callback(AtkObject* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_visible_data_changed(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + ); + + // Call the original underlying C function: + if(base && base->visible_data_changed) + (*base->visible_data_changed)(self); + } +} + +void Object_Class::active_descendant_changed_callback(AtkObject* self, gpointer* p0) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_active_descendant_changed(p0 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + ); + + // Call the original underlying C function: + if(base && base->active_descendant_changed) + (*base->active_descendant_changed)(self, p0); + } +} + + +/* The implementation: */ + +AtkObject* Object::gobj_copy() +{ + reference(); + return gobj(); +} + +Object::Object(const Glib::ConstructParams& construct_params) +: + Glib::Object(construct_params) +{} + +Object::Object(AtkObject* castitem) +: + Glib::Object((GObject*)(castitem)) +{} + +Object::~Object() +{} + + +Object::CppClassType Object::object_class_; // initialize static member + +GType Object::get_type() +{ + return object_class_.init().get_type(); +} + +GType Object::get_base_type() +{ + return atk_object_get_type(); +} + + +Glib::ustring Object::get_name() const +{ + return Glib::convert_const_gchar_ptr_to_ustring(atk_object_get_name(const_cast<AtkObject*>(gobj()))); +} + +Glib::ustring Object::get_description() const +{ + return Glib::convert_const_gchar_ptr_to_ustring(atk_object_get_description(const_cast<AtkObject*>(gobj()))); +} + +Glib::RefPtr<Atk::Object> Object::get_parent() +{ + + Glib::RefPtr<Atk::Object> retvalue = Glib::wrap(atk_object_get_parent(gobj())); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + +int Object::get_n_accessible_children() const +{ + return atk_object_get_n_accessible_children(const_cast<AtkObject*>(gobj())); +} + +Glib::RefPtr<Atk::Object> Object::get_accessible_child(int i) +{ + return Glib::wrap(atk_object_ref_accessible_child(gobj(), i)); +} + +Glib::RefPtr<RelationSet> Object::get_relation_set() +{ + + Glib::RefPtr<RelationSet> retvalue = Glib::wrap(atk_object_ref_relation_set(gobj())); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + +Role Object::get_role() const +{ + return ((Role)(atk_object_get_role(const_cast<AtkObject*>(gobj())))); +} + +Glib::RefPtr<StateSet> Object::get_state_set() +{ + return Glib::wrap(atk_object_ref_state_set(gobj())); +} + +int Object::get_index_in_parent() +{ + return atk_object_get_index_in_parent(gobj()); +} + +void Object::set_name(const Glib::ustring& name) +{ + atk_object_set_name(gobj(), name.c_str()); +} + +void Object::set_description(const Glib::ustring& description) +{ + atk_object_set_description(gobj(), description.c_str()); +} + +void Object::set_parent(const Glib::RefPtr<Atk::Object>& parent) +{ + atk_object_set_parent(gobj(), Glib::unwrap(parent)); +} + +void Object::set_role(Role role) +{ + atk_object_set_role(gobj(), ((AtkRole)(role))); +} + +void Object::notify_state_change(State state, bool value) +{ + atk_object_notify_state_change(gobj(), state, static_cast<int>(value)); +} + +bool Object::add_relationship(RelationType relationship, const Glib::RefPtr<Object>& target) +{ + return atk_object_add_relationship(gobj(), ((AtkRelationType)(relationship)), Glib::unwrap(target)); +} + +bool Object::remove_relationship(RelationType relationship, const Glib::RefPtr<Object>& target) +{ + return atk_object_remove_relationship(gobj(), ((AtkRelationType)(relationship)), Glib::unwrap(target)); +} + + +Glib::SignalProxy2< void,guint,gpointer > Object::signal_children_changed() +{ + return Glib::SignalProxy2< void,guint,gpointer >(this, &Object_signal_children_changed_info); +} + +Glib::SignalProxy1< void,bool > Object::signal_focus_event() +{ + return Glib::SignalProxy1< void,bool >(this, &Object_signal_focus_event_info); +} + +Glib::SignalProxy1< void,AtkPropertyValues* > Object::signal_property_change() +{ + return Glib::SignalProxy1< void,AtkPropertyValues* >(this, &Object_signal_property_change_info); +} + +Glib::SignalProxy2< void,const Glib::ustring&,bool > Object::signal_state_change() +{ + return Glib::SignalProxy2< void,const Glib::ustring&,bool >(this, &Object_signal_state_change_info); +} + +Glib::SignalProxy0< void > Object::signal_visible_data_changed() +{ + return Glib::SignalProxy0< void >(this, &Object_signal_visible_data_changed_info); +} + +Glib::SignalProxy1< void,void** > Object::signal_active_descendant_changed() +{ + return Glib::SignalProxy1< void,void** >(this, &Object_signal_active_descendant_changed_info); +} + + +Glib::PropertyProxy<Glib::ustring> Object::property_accessible_name() +{ + return Glib::PropertyProxy<Glib::ustring>(this, "accessible-name"); +} + +Glib::PropertyProxy_ReadOnly<Glib::ustring> Object::property_accessible_name() const +{ + return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "accessible-name"); +} + +Glib::PropertyProxy<Glib::ustring> Object::property_accessible_description() +{ + return Glib::PropertyProxy<Glib::ustring>(this, "accessible-description"); +} + +Glib::PropertyProxy_ReadOnly<Glib::ustring> Object::property_accessible_description() const +{ + return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "accessible-description"); +} + +Glib::PropertyProxy< Glib::RefPtr<Atk::Object> > Object::property_accessible_parent() +{ + return Glib::PropertyProxy< Glib::RefPtr<Atk::Object> >(this, "accessible-parent"); +} + +Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Atk::Object> > Object::property_accessible_parent() const +{ + return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Atk::Object> >(this, "accessible-parent"); +} + +Glib::PropertyProxy<double> Object::property_accessible_value() +{ + return Glib::PropertyProxy<double>(this, "accessible-value"); +} + +Glib::PropertyProxy_ReadOnly<double> Object::property_accessible_value() const +{ + return Glib::PropertyProxy_ReadOnly<double>(this, "accessible-value"); +} + +Glib::PropertyProxy<int> Object::property_accessible_role() +{ + return Glib::PropertyProxy<int>(this, "accessible-role"); +} + +Glib::PropertyProxy_ReadOnly<int> Object::property_accessible_role() const +{ + return Glib::PropertyProxy_ReadOnly<int>(this, "accessible-role"); +} + +Glib::PropertyProxy_ReadOnly<int> Object::property_accessible_component_layer() const +{ + return Glib::PropertyProxy_ReadOnly<int>(this, "accessible-component-layer"); +} + +Glib::PropertyProxy_ReadOnly<int> Object::property_accessible_component_mdi_zorder() const +{ + return Glib::PropertyProxy_ReadOnly<int>(this, "accessible-component-mdi-zorder"); +} + +Glib::PropertyProxy<Glib::ustring> Object::property_accessible_table_caption() +{ + return Glib::PropertyProxy<Glib::ustring>(this, "accessible-table-caption"); +} + +Glib::PropertyProxy_ReadOnly<Glib::ustring> Object::property_accessible_table_caption() const +{ + return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "accessible-table-caption"); +} + +Glib::PropertyProxy<Glib::ustring> Object::property_accessible_table_column_description() +{ + return Glib::PropertyProxy<Glib::ustring>(this, "accessible-table-column-description"); +} + +Glib::PropertyProxy_ReadOnly<Glib::ustring> Object::property_accessible_table_column_description() const +{ + return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "accessible-table-column-description"); +} + +Glib::PropertyProxy< Glib::RefPtr<Atk::Object> > Object::property_accessible_table_column_header() +{ + return Glib::PropertyProxy< Glib::RefPtr<Atk::Object> >(this, "accessible-table-column-header"); +} + +Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Atk::Object> > Object::property_accessible_table_column_header() const +{ + return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Atk::Object> >(this, "accessible-table-column-header"); +} + +Glib::PropertyProxy<Glib::ustring> Object::property_accessible_table_row_description() +{ + return Glib::PropertyProxy<Glib::ustring>(this, "accessible-table-row-description"); +} + +Glib::PropertyProxy_ReadOnly<Glib::ustring> Object::property_accessible_table_row_description() const +{ + return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "accessible-table-row-description"); +} + +Glib::PropertyProxy< Glib::RefPtr<Atk::Object> > Object::property_accessible_table_row_header() +{ + return Glib::PropertyProxy< Glib::RefPtr<Atk::Object> >(this, "accessible-table-row-header"); +} + +Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Atk::Object> > Object::property_accessible_table_row_header() const +{ + return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Atk::Object> >(this, "accessible-table-row-header"); +} + +Glib::PropertyProxy< Glib::RefPtr<Atk::Object> > Object::property_accessible_table_summary() +{ + return Glib::PropertyProxy< Glib::RefPtr<Atk::Object> >(this, "accessible-table-summary"); +} + +Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Atk::Object> > Object::property_accessible_table_summary() const +{ + return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Atk::Object> >(this, "accessible-table-summary"); +} + + +void Atk::Object::on_children_changed(guint change_index, gpointer changed_child) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). + ); + + if(base && base->children_changed) + (*base->children_changed)(gobj(),change_index,changed_child); +} + +void Atk::Object::on_focus_event(bool focus_in) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). + ); + + if(base && base->focus_event) + (*base->focus_event)(gobj(),static_cast<int>(focus_in)); +} + +void Atk::Object::on_property_change(AtkPropertyValues* values) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). + ); + + if(base && base->property_change) + (*base->property_change)(gobj(),values); +} + +void Atk::Object::on_state_change(const Glib::ustring& name, bool state_set) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). + ); + + if(base && base->state_change) + (*base->state_change)(gobj(),name.c_str(),static_cast<int>(state_set)); +} + +void Atk::Object::on_visible_data_changed() +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). + ); + + if(base && base->visible_data_changed) + (*base->visible_data_changed)(gobj()); +} + +void Atk::Object::on_active_descendant_changed(void** child) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). + ); + + if(base && base->active_descendant_changed) + (*base->active_descendant_changed)(gobj(),child); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/object.h b/libs/gtkmm2/atk/atkmm/object.h new file mode 100644 index 0000000000..047cb2a254 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/object.h @@ -0,0 +1,570 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_OBJECT_H +#define _ATKMM_OBJECT_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#include <atkmm/component.h> +#include <atkmm/relation.h> + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +extern "C" { typedef struct _AtkPropertyValues AtkPropertyValues; } +#endif + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkObject AtkObject; +typedef struct _AtkObjectClass AtkObjectClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class Object_Class; } // namespace Atk +namespace Atk +{ + + +/** @addtogroup atkmmEnums Enums and Flags */ + +/** + * @ingroup atkmmEnums + */ +enum Role +{ + ROLE_INVALID, + ROLE_ACCEL_LABEL, + ROLE_ALERT, + ROLE_ANIMATION, + ROLE_ARROW, + ROLE_CALENDAR, + ROLE_CANVAS, + ROLE_CHECK_BOX, + ROLE_CHECK_MENU_ITEM, + ROLE_COLOR_CHOOSER, + ROLE_COLUMN_HEADER, + ROLE_COMBO_BOX, + ROLE_DATE_EDITOR, + ROLE_DESKTOP_ICON, + ROLE_DESKTOP_FRAME, + ROLE_DIAL, + ROLE_DIALOG, + ROLE_DIRECTORY_PANE, + ROLE_DRAWING_AREA, + ROLE_FILE_CHOOSER, + ROLE_FILLER, + ROLE_FONT_CHOOSER, + ROLE_FRAME, + ROLE_GLASS_PANE, + ROLE_HTML_CONTAINER, + ROLE_ICON, + ROLE_IMAGE, + ROLE_INTERNAL_FRAME, + ROLE_LABEL, + ROLE_LAYERED_PANE, + ROLE_LIST, + ROLE_LIST_ITEM, + ROLE_MENU, + ROLE_MENU_BAR, + ROLE_MENU_ITEM, + ROLE_OPTION_PANE, + ROLE_PAGE_TAB, + ROLE_PAGE_TAB_LIST, + ROLE_PANEL, + ROLE_PASSWORD_TEXT, + ROLE_POPUP_MENU, + ROLE_PROGRESS_BAR, + ROLE_PUSH_BUTTON, + ROLE_RADIO_BUTTON, + ROLE_RADIO_MENU_ITEM, + ROLE_ROOT_PANE, + ROLE_ROW_HEADER, + ROLE_SCROLL_BAR, + ROLE_SCROLL_PANE, + ROLE_SEPARATOR, + ROLE_SLIDER, + ROLE_SPLIT_PANE, + ROLE_SPIN_BUTTON, + ROLE_STATUSBAR, + ROLE_TABLE, + ROLE_TABLE_CELL, + ROLE_TABLE_COLUMN_HEADER, + ROLE_TABLE_ROW_HEADER, + ROLE_TEAR_OFF_MENU_ITEM, + ROLE_TERMINAL, + ROLE_TEXT, + ROLE_TOGGLE_BUTTON, + ROLE_TOOL_BAR, + ROLE_TOOL_TIP, + ROLE_TREE, + ROLE_TREE_TABLE, + ROLE_UNKNOWN, + ROLE_VIEWPORT, + ROLE_WINDOW, + ROLE_HEADER, + ROLE_FOOTER, + ROLE_PARAGRAPH, + ROLE_RULER, + ROLE_APPLICATION, + ROLE_AUTOCOMPLETE, + ROLE_EDITBAR, + ROLE_EMBEDDED, + ROLE_LAST_DEFINED +}; + +} // namespace Atk + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +namespace Glib +{ + +template <> +class Value<Atk::Role> : public Glib::Value_Enum<Atk::Role> +{ +public: + static GType value_type() G_GNUC_CONST; +}; + +} // namespace Glib +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ + + +class RelationSet; +class Relation; +class StateSet; + +typedef guint64 State; + +/** The base object class for the Accessibility Toolkit API. + * This class is the primary class for accessibility support via the Accessibility ToolKit (ATK). Objects which are + * instances of Atk::Object (or instances of Atk::Object-derived types) are queried for properties which relate basic + * (and generic) properties of a UI component such as name and description. Instances of Atk::Object may also be queried + * as to whether they implement other ATK interfaces (e.g. Atk::Action, Atk::Component, etc.), as appropriate to the role + * which a given UI component plays in a user interface. + * + * All UI components in an application which provide useful information or services to the user must provide corresponding + * Atk::Object instances on request (in GTK+, for instance, usually on a call to Gtk::Widget::get_accessible()), either via + * ATK support built into the toolkit for the widget class or ancestor class, or in the case of custom widgets, if the + * inherited Atk::Object implementation is insufficient, via instances of a new Atk::Object subclass. + */ + +class Object : public Glib::Object +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef Object CppObjectType; + typedef Object_Class CppClassType; + typedef AtkObject BaseObjectType; + typedef AtkObjectClass BaseClassType; + +private: friend class Object_Class; + static CppClassType object_class_; + +private: + // noncopyable + Object(const Object&); + Object& operator=(const Object&); + +protected: + explicit Object(const Glib::ConstructParams& construct_params); + explicit Object(AtkObject* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~Object(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkObject* gobj() { return reinterpret_cast<AtkObject*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkObject* gobj() const { return reinterpret_cast<AtkObject*>(gobject_); } + + ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. + AtkObject* gobj_copy(); + +private: + + // see wrap_new() implementation in object.ccg + +public: + + + /** Gets the accessible name of the accessible. + * @return A character string representing the accessible name of the object. + */ + Glib::ustring get_name() const; + + /** Gets the accessible description of the accessible. + * @return A character string representing the accessible description + * of the accessible. + */ + Glib::ustring get_description() const; + + /** Gets the accessible parent of the accessible. + * @return A Atk::Object representing the accessible parent of the accessible. + */ + Glib::RefPtr<Atk::Object> get_parent(); + + /** Gets the number of accessible children of the accessible. + * @return An integer representing the number of accessible children + * of the accessible. + */ + int get_n_accessible_children() const; + + /** Gets a reference to the specified accessible child of the object. + * The accessible children are 0-based so the first accessible child is + * at index 0, the second at index 1 and so on. + * @param i A <tt>int</tt> representing the position of the child, starting from 0. + * @return An Atk::Object representing the specified accessible child + * of the accessible. + */ + Glib::RefPtr<Atk::Object> get_accessible_child(int i); + + /** Gets the Atk::RelationSet associated with the object. + * @return An Atk::RelationSet representing the relation set of the object. + */ + Glib::RefPtr<RelationSet> get_relation_set(); + + /** Gets the role of the accessible. + * @return An Atk::Role which is the role of the accessible. + */ + Role get_role() const; + + /** Gets a reference to the state set of the accessible; the caller must + * unreference it when it is no longer needed. + * @return A reference to an Atk::StateSet which is the state + * set of the accessible. + */ + Glib::RefPtr<StateSet> get_state_set(); + + /** Gets the 0-based index of this accessible in its parent; returns -1 if the + * accessible does not have an accessible parent. + * @return An integer which is the index of the accessible in its parent. + */ + int get_index_in_parent(); + + /** Sets the accessible name of the accessible. + * @param name A character string to be set as the accessible name. + */ + void set_name(const Glib::ustring& name); + + /** Sets the accessible description of the accessible. + * @param description A character string to be set as the accessible description. + */ + void set_description(const Glib::ustring& description); + + /** Sets the accessible parent of the accessible. + * @param parent An Atk::Object to be set as the accessible parent. + */ + void set_parent(const Glib::RefPtr<Atk::Object>& parent); + + /** Sets the role of the accessible. + * @param role An Atk::Role to be set as the role. + */ + void set_role(Role role); + //_WRAP_METHOD(guint connect_property_change_handler(AtkPropertyChangeHandler* handler), atk_object_connect_property_change_handler) + //_WRAP_METHOD(void remove_property_change_handler(guint handler_id), atk_object_remove_property_change_handler) + + /** Emits a state-change signal for the specified state. + * @param state An Atk::State whose state is changed. + * @param value A <tt>bool</tt> which indicates whether the state is being set on or off. + */ + void notify_state_change(State state, bool value); + + + /** Adds a relationship of the specified type with the specified target. + * @param relationship The Atk::RelationType of the relation. + * @param target The Atk::Object which is to be the target of the relation. + * @return <tt>true</tt> if the relationship is added. + */ + bool add_relationship(RelationType relationship, const Glib::RefPtr<Object>& target); + + /** Removes a relationship of the specified type with the specified target. + * @param relationship The Atk::RelationType of the relation. + * @param target The Atk::Object which is the target of the relation to be removed. + * @return <tt>true</tt> if the relationship is removed. + */ + bool remove_relationship(RelationType relationship, const Glib::RefPtr<Object>& target); + + + Glib::SignalProxy2< void,guint,gpointer > signal_children_changed(); + + + Glib::SignalProxy1< void,bool > signal_focus_event(); + + + Glib::SignalProxy1< void,AtkPropertyValues* > signal_property_change(); + + + Glib::SignalProxy2< void,const Glib::ustring&,bool > signal_state_change(); + + + Glib::SignalProxy0< void > signal_visible_data_changed(); + + + Glib::SignalProxy1< void,void** > signal_active_descendant_changed(); + + + /** Object instance's name formatted for assistive technology access. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<Glib::ustring> property_accessible_name() ; + +/** Object instance's name formatted for assistive technology access. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<Glib::ustring> property_accessible_name() const; + + /** Description of an object + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<Glib::ustring> property_accessible_description() ; + +/** Description of an object + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<Glib::ustring> property_accessible_description() const; + + /** Is used to notify that the parent has changed. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy< Glib::RefPtr<Atk::Object> > property_accessible_parent() ; + +/** Is used to notify that the parent has changed. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Atk::Object> > property_accessible_parent() const; + + /** Is used to notify that the value has changed. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<double> property_accessible_value() ; + +/** Is used to notify that the value has changed. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<double> property_accessible_value() const; + + /** The accessible role of this object. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<int> property_accessible_role() ; + +/** The accessible role of this object. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<int> property_accessible_role() const; + + /** The accessible layer of this object. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<int> property_accessible_component_layer() const; + + + /** The accessible MDI value of this object. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<int> property_accessible_component_mdi_zorder() const; + + + /** Is used to notify that the table caption has changed; this property should not be used. accessible-table-caption-object should be used instead. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<Glib::ustring> property_accessible_table_caption() ; + +/** Is used to notify that the table caption has changed; this property should not be used. accessible-table-caption-object should be used instead. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<Glib::ustring> property_accessible_table_caption() const; + + /** Is used to notify that the table column description has changed. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<Glib::ustring> property_accessible_table_column_description() ; + +/** Is used to notify that the table column description has changed. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<Glib::ustring> property_accessible_table_column_description() const; + + /** Is used to notify that the table column header has changed. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy< Glib::RefPtr<Atk::Object> > property_accessible_table_column_header() ; + +/** Is used to notify that the table column header has changed. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Atk::Object> > property_accessible_table_column_header() const; + + /** Is used to notify that the table row description has changed. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy<Glib::ustring> property_accessible_table_row_description() ; + +/** Is used to notify that the table row description has changed. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly<Glib::ustring> property_accessible_table_row_description() const; + + /** Is used to notify that the table row header has changed. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy< Glib::RefPtr<Atk::Object> > property_accessible_table_row_header() ; + +/** Is used to notify that the table row header has changed. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Atk::Object> > property_accessible_table_row_header() const; + + /** Is used to notify that the table summary has changed. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy< Glib::RefPtr<Atk::Object> > property_accessible_table_summary() ; + +/** Is used to notify that the table summary has changed. + * + * You rarely need to use properties because there are get_ and set_ methods for almost all of them. + * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when + * the value of the property changes. + */ + Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Atk::Object> > property_accessible_table_summary() const; + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + virtual void on_children_changed(guint change_index, gpointer changed_child); + virtual void on_focus_event(bool focus_in); + virtual void on_property_change(AtkPropertyValues* values); + virtual void on_state_change(const Glib::ustring& name, bool state_set); + virtual void on_visible_data_changed(); + virtual void on_active_descendant_changed(void** child); + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::Object + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::Object> wrap(AtkObject* object, bool take_copy = false); +} + + +#endif /* _ATKMM_OBJECT_H */ + diff --git a/libs/gtkmm2/atk/atkmm/objectaccessible.cc b/libs/gtkmm2/atk/atkmm/objectaccessible.cc new file mode 100644 index 0000000000..da4136bef7 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/objectaccessible.cc @@ -0,0 +1,165 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/objectaccessible.h> +#include <atkmm/private/objectaccessible_p.h> + +// -*- c++ -*- +/* $Id$ */ + +/* + * + * Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atk/atkgobjectaccessible.h> + +namespace +{ +} // anonymous namespace + + +namespace Glib +{ + +Glib::RefPtr<Atk::ObjectAccessible> wrap(AtkGObjectAccessible* object, bool take_copy) +{ + return Glib::RefPtr<Atk::ObjectAccessible>( dynamic_cast<Atk::ObjectAccessible*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} /* namespace Glib */ + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Class& ObjectAccessible_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Class has to know the class init function to clone custom types. + class_init_func_ = &ObjectAccessible_Class::class_init_function; + + // This is actually just optimized away, apparently with no harm. + // Make sure that the parent type has been created. + //CppClassParent::CppObjectType::get_type(); + + // Create the wrapper type, with the same class/instance size as the base type. + register_derived_type(atk_gobject_accessible_get_type()); + + // Add derived versions of interfaces, if the C type implements any interfaces: + } + + return *this; +} + +void ObjectAccessible_Class::class_init_function(void* g_class, void* class_data) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_class); + CppClassParent::class_init_function(klass, class_data); + +} + + +Glib::ObjectBase* ObjectAccessible_Class::wrap_new(GObject* object) +{ + return new ObjectAccessible((AtkGObjectAccessible*)object); +} + + +/* The implementation: */ + +AtkGObjectAccessible* ObjectAccessible::gobj_copy() +{ + reference(); + return gobj(); +} + +ObjectAccessible::ObjectAccessible(const Glib::ConstructParams& construct_params) +: + Atk::Object(construct_params) +{} + +ObjectAccessible::ObjectAccessible(AtkGObjectAccessible* castitem) +: + Atk::Object((AtkObject*)(castitem)) +{} + +ObjectAccessible::~ObjectAccessible() +{} + + +ObjectAccessible::CppClassType ObjectAccessible::objectaccessible_class_; // initialize static member + +GType ObjectAccessible::get_type() +{ + return objectaccessible_class_.init().get_type(); +} + +GType ObjectAccessible::get_base_type() +{ + return atk_gobject_accessible_get_type(); +} + + +Glib::RefPtr<Glib::Object> ObjectAccessible::get_object() +{ + + Glib::RefPtr<Glib::Object> retvalue = Glib::wrap(atk_gobject_accessible_get_object(gobj())); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + +Glib::RefPtr<const Glib::Object> ObjectAccessible::get_object() const +{ + + Glib::RefPtr<const Glib::Object> retvalue = Glib::wrap(atk_gobject_accessible_get_object(const_cast<AtkGObjectAccessible*>(gobj()))); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + +Glib::RefPtr<Atk::Object> ObjectAccessible::for_object(const Glib::RefPtr<Glib::Object>& obj) +{ + + Glib::RefPtr<Atk::Object> retvalue = Glib::wrap(atk_gobject_accessible_for_object(Glib::unwrap(obj))); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + +Glib::RefPtr<const Atk::Object> ObjectAccessible::for_object(const Glib::RefPtr<const Glib::Object>& obj) +{ + + Glib::RefPtr<const Atk::Object> retvalue = Glib::wrap(atk_gobject_accessible_for_object(const_cast<GObject*>(Glib::unwrap<Glib::Object>(obj)))); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/objectaccessible.h b/libs/gtkmm2/atk/atkmm/objectaccessible.h new file mode 100644 index 0000000000..d266f9a97e --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/objectaccessible.h @@ -0,0 +1,145 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_OBJECTACCESSIBLE_H +#define _ATKMM_OBJECTACCESSIBLE_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atkmm/object.h> + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkGObjectAccessible AtkGObjectAccessible; +typedef struct _AtkGObjectAccessibleClass AtkGObjectAccessibleClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class ObjectAccessible_Class; } // namespace Atk +namespace Atk +{ + +/** This object class is derived from AtkObject and can be used as a basis implementing accessible objects. + * This can be used as a basis for implementing accessible objects for Glib::Objects which are not derived from + * Gtk::Widget. One example of its use is in providing an accessible object for GnomeCanvasItem in the GAIL library. + */ + +class ObjectAccessible : public Atk::Object +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef ObjectAccessible CppObjectType; + typedef ObjectAccessible_Class CppClassType; + typedef AtkGObjectAccessible BaseObjectType; + typedef AtkGObjectAccessibleClass BaseClassType; + +private: friend class ObjectAccessible_Class; + static CppClassType objectaccessible_class_; + +private: + // noncopyable + ObjectAccessible(const ObjectAccessible&); + ObjectAccessible& operator=(const ObjectAccessible&); + +protected: + explicit ObjectAccessible(const Glib::ConstructParams& construct_params); + explicit ObjectAccessible(AtkGObjectAccessible* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~ObjectAccessible(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkGObjectAccessible* gobj() { return reinterpret_cast<AtkGObjectAccessible*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkGObjectAccessible* gobj() const { return reinterpret_cast<AtkGObjectAccessible*>(gobject_); } + + ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. + AtkGObjectAccessible* gobj_copy(); + +private: + +protected: + + + /** Gets the GObject for which @a obj is the accessible object. + * @return A G::Object which is the object for which @a obj is the accessible objedct. + */ + Glib::RefPtr<Glib::Object> get_object(); + + /** Gets the GObject for which @a obj is the accessible object. + * @return A G::Object which is the object for which @a obj is the accessible objedct. + */ + Glib::RefPtr<const Glib::Object> get_object() const; + + + /** Gets the accessible object for the specified @a obj . + * @param obj A G::Object. + * @return A Atk::Object which is the accessible object for the @a obj . + */ + static Glib::RefPtr<Atk::Object> for_object(const Glib::RefPtr<Glib::Object>& obj); + + /** Gets the accessible object for the specified @a obj . + * @param obj A G::Object. + * @return A Atk::Object which is the accessible object for the @a obj . + */ + static Glib::RefPtr<const Atk::Object> for_object(const Glib::RefPtr<const Glib::Object>& obj); + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::ObjectAccessible + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::ObjectAccessible> wrap(AtkGObjectAccessible* object, bool take_copy = false); +} + + +#endif /* _ATKMM_OBJECTACCESSIBLE_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/action_p.h b/libs/gtkmm2/atk/atkmm/private/action_p.h new file mode 100644 index 0000000000..bb3c5afa09 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/action_p.h @@ -0,0 +1,47 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_ACTION_P_H +#define _ATKMM_ACTION_P_H +#include <glibmm/private/interface_p.h> + +#include <glibmm/private/interface_p.h> + +namespace Atk +{ + +class Action_Class : public Glib::Interface_Class +{ +public: + typedef Action CppObjectType; + typedef AtkAction BaseObjectType; + typedef AtkActionIface BaseClassType; + typedef Glib::Interface_Class CppClassParent; + + friend class Action; + + const Glib::Interface_Class& init(); + + static void iface_init_function(void* g_iface, void* iface_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + + //Callbacks (virtual functions): + static gboolean do_action_vfunc_callback(AtkAction* self, gint i); + static gint get_n_actions_vfunc_callback(AtkAction* self); + static const gchar* get_description_vfunc_callback(AtkAction* self, gint i); + static const gchar* get_name_vfunc_callback(AtkAction* self, gint i); + static const gchar* get_keybinding_vfunc_callback(AtkAction* self, gint i); + static gboolean set_description_vfunc_callback(AtkAction* self, gint i, const gchar* desc); +}; + + +} // namespace Atk + +#endif /* _ATKMM_ACTION_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/component_p.h b/libs/gtkmm2/atk/atkmm/private/component_p.h new file mode 100644 index 0000000000..010df9e92f --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/component_p.h @@ -0,0 +1,54 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_COMPONENT_P_H +#define _ATKMM_COMPONENT_P_H +#include <atk/atkcomponent.h> + +#include <glibmm/private/interface_p.h> + +namespace Atk +{ + +class Component_Class : public Glib::Interface_Class +{ +public: + typedef Component CppObjectType; + typedef AtkComponent BaseObjectType; + typedef AtkComponentIface BaseClassType; + typedef Glib::Interface_Class CppClassParent; + + friend class Component; + + const Glib::Interface_Class& init(); + + static void iface_init_function(void* g_iface, void* iface_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + + //Callbacks (virtual functions): + static guint add_focus_handler_vfunc_callback(AtkComponent* self, AtkFocusHandler handler); + static gboolean contains_vfunc_callback(AtkComponent* self, gint x, gint y, AtkCoordType coord_type); + static AtkObject* ref_accessible_at_point_vfunc_callback(AtkComponent* self, gint x, gint y, AtkCoordType coord_type); + static void get_extents_vfunc_callback(AtkComponent* self, gint* x, gint* y, gint* width, gint* height, AtkCoordType coord_type); + static void get_position_vfunc_callback(AtkComponent* self, gint* x, gint* y, AtkCoordType coord_type); + static void get_size_vfunc_callback(AtkComponent* self, gint* width, gint* height); + static AtkLayer get_layer_vfunc_callback(AtkComponent* self); + static gint get_mdi_zorder_vfunc_callback(AtkComponent* self); + static gboolean grab_focus_vfunc_callback(AtkComponent* self); + static void remove_focus_handler_vfunc_callback(AtkComponent* self, guint handler_id); + static gboolean set_extents_vfunc_callback(AtkComponent* self, gint x, gint y, gint width, gint height, AtkCoordType coord_type); + static gboolean set_position_vfunc_callback(AtkComponent* self, gint x, gint y, AtkCoordType coord_type); + static gboolean set_size_vfunc_callback(AtkComponent* self, gint width, gint height); +}; + + +} // namespace Atk + +#endif /* _ATKMM_COMPONENT_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/document_p.h b/libs/gtkmm2/atk/atkmm/private/document_p.h new file mode 100644 index 0000000000..01115486b5 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/document_p.h @@ -0,0 +1,43 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_DOCUMENT_P_H +#define _ATKMM_DOCUMENT_P_H +#include <glibmm/private/object_p.h> + +#include <glibmm/private/interface_p.h> + +namespace Atk +{ + +class Document_Class : public Glib::Interface_Class +{ +public: + typedef Document CppObjectType; + typedef AtkDocument BaseObjectType; + typedef AtkDocumentIface BaseClassType; + typedef Glib::Interface_Class CppClassParent; + + friend class Document; + + const Glib::Interface_Class& init(); + + static void iface_init_function(void* g_iface, void* iface_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + + //Callbacks (virtual functions): + static const gchar* get_document_type_vfunc_callback(AtkDocument* self); + static gpointer get_document_vfunc_callback(AtkDocument* self); +}; + + +} // namespace Atk + +#endif /* _ATKMM_DOCUMENT_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/editabletext_p.h b/libs/gtkmm2/atk/atkmm/private/editabletext_p.h new file mode 100644 index 0000000000..fb5004ed1d --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/editabletext_p.h @@ -0,0 +1,47 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_EDITABLETEXT_P_H +#define _ATKMM_EDITABLETEXT_P_H + +#include <glibmm/private/interface_p.h> + +namespace Atk +{ + +class EditableText_Class : public Glib::Interface_Class +{ +public: + typedef EditableText CppObjectType; + typedef AtkEditableText BaseObjectType; + typedef AtkEditableTextIface BaseClassType; + typedef Glib::Interface_Class CppClassParent; + + friend class EditableText; + + const Glib::Interface_Class& init(); + + static void iface_init_function(void* g_iface, void* iface_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + + //Callbacks (virtual functions): + static gboolean set_run_attributes_vfunc_callback(AtkEditableText* self, AtkAttributeSet* attrib_set, gint start_offset, gint end_offset); + static void set_text_contents_vfunc_callback(AtkEditableText* self, const gchar* string); + static void insert_text_vfunc_callback(AtkEditableText* self, const gchar* string, gint length, gint* position); + static void copy_text_vfunc_callback(AtkEditableText* self, gint start_pos, gint end_pos); + static void cut_text_vfunc_callback(AtkEditableText* self, gint start_pos, gint end_pos); + static void delete_text_vfunc_callback(AtkEditableText* self, gint start_pos, gint end_pos); + static void paste_text_vfunc_callback(AtkEditableText* self, gint position); +}; + + +} // namespace Atk + +#endif /* _ATKMM_EDITABLETEXT_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/hyperlink_p.h b/libs/gtkmm2/atk/atkmm/private/hyperlink_p.h new file mode 100644 index 0000000000..a5d9e61275 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/hyperlink_p.h @@ -0,0 +1,54 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_HYPERLINK_P_H +#define _ATKMM_HYPERLINK_P_H +#include <glibmm/private/object_p.h> +#include <atk/atkobject.h> + +#include <glibmm/class.h> + +namespace Atk +{ + +class Hyperlink_Class : public Glib::Class +{ +public: +#ifndef DOXYGEN_SHOULD_SKIP_THIS + typedef Hyperlink CppObjectType; + typedef AtkHyperlink BaseObjectType; + typedef AtkHyperlinkClass BaseClassType; + typedef Glib::Object_Class CppClassParent; + typedef GObjectClass BaseClassParent; + + friend class Hyperlink; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + const Glib::Class& init(); + + static void class_init_function(void* g_class, void* class_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + static void link_activated_callback(AtkHyperlink* self); + + //Callbacks (virtual functions): + static gchar* get_uri_vfunc_callback(AtkHyperlink* self, gint i); + static AtkObject* get_object_vfunc_callback(AtkHyperlink* self, gint i); + static gint get_end_index_vfunc_callback(AtkHyperlink* self); + static gint get_start_index_vfunc_callback(AtkHyperlink* self); + static gboolean is_valid_vfunc_callback(AtkHyperlink* self); + static gint get_n_anchors_vfunc_callback(AtkHyperlink* self); + static guint link_state_vfunc_callback(AtkHyperlink* self); + static gboolean is_selected_link_vfunc_callback(AtkHyperlink* self); +}; + + +} // namespace Atk + +#endif /* _ATKMM_HYPERLINK_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/hypertext_p.h b/libs/gtkmm2/atk/atkmm/private/hypertext_p.h new file mode 100644 index 0000000000..79eaad32c5 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/hypertext_p.h @@ -0,0 +1,45 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_HYPERTEXT_P_H +#define _ATKMM_HYPERTEXT_P_H +#include <glibmm/private/object_p.h> + +#include <glibmm/private/interface_p.h> + +namespace Atk +{ + +class Hypertext_Class : public Glib::Interface_Class +{ +public: + typedef Hypertext CppObjectType; + typedef AtkHypertext BaseObjectType; + typedef AtkHypertextIface BaseClassType; + typedef Glib::Interface_Class CppClassParent; + + friend class Hypertext; + + const Glib::Interface_Class& init(); + + static void iface_init_function(void* g_iface, void* iface_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + static void link_selected_callback(AtkHypertext* self, gint p0); + + //Callbacks (virtual functions): + static AtkHyperlink* get_link_vfunc_callback(AtkHypertext* self, gint link_index); + static gint get_n_links_vfunc_callback(AtkHypertext* self); + static gint get_link_index_vfunc_callback(AtkHypertext* self, gint char_index); +}; + + +} // namespace Atk + +#endif /* _ATKMM_HYPERTEXT_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/image_p.h b/libs/gtkmm2/atk/atkmm/private/image_p.h new file mode 100644 index 0000000000..b2e8d327ca --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/image_p.h @@ -0,0 +1,45 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_IMAGE_P_H +#define _ATKMM_IMAGE_P_H +#include <atk/atkimage.h> + +#include <glibmm/private/interface_p.h> + +namespace Atk +{ + +class Image_Class : public Glib::Interface_Class +{ +public: + typedef Image CppObjectType; + typedef AtkImage BaseObjectType; + typedef AtkImageIface BaseClassType; + typedef Glib::Interface_Class CppClassParent; + + friend class Image; + + const Glib::Interface_Class& init(); + + static void iface_init_function(void* g_iface, void* iface_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + + //Callbacks (virtual functions): + static gboolean set_image_description_vfunc_callback(AtkImage* self, const gchar* description); + static const gchar* get_image_description_vfunc_callback(AtkImage* self); + static void get_image_position_vfunc_callback(AtkImage* self, gint* x, gint* y, AtkCoordType coord_type); + static void get_image_size_vfunc_callback(AtkImage* self, gint* width, gint* height); +}; + + +} // namespace Atk + +#endif /* _ATKMM_IMAGE_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/implementor_p.h b/libs/gtkmm2/atk/atkmm/private/implementor_p.h new file mode 100644 index 0000000000..7c5fc8804f --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/implementor_p.h @@ -0,0 +1,41 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_IMPLEMENTOR_P_H +#define _ATKMM_IMPLEMENTOR_P_H + +#include <glibmm/private/interface_p.h> + +namespace Atk +{ + +class Implementor_Class : public Glib::Interface_Class +{ +public: + typedef Implementor CppObjectType; + typedef AtkImplementor BaseObjectType; + typedef AtkImplementorIface BaseClassType; + typedef Glib::Interface_Class CppClassParent; + + friend class Implementor; + + const Glib::Interface_Class& init(); + + static void iface_init_function(void* g_iface, void* iface_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + + //Callbacks (virtual functions): + static AtkObject* ref_accessible_vfunc_callback(AtkImplementor* self); +}; + + +} // namespace Atk + +#endif /* _ATKMM_IMPLEMENTOR_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/noopobject_p.h b/libs/gtkmm2/atk/atkmm/private/noopobject_p.h new file mode 100644 index 0000000000..afa515b316 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/noopobject_p.h @@ -0,0 +1,44 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_NOOPOBJECT_P_H +#define _ATKMM_NOOPOBJECT_P_H +#include <atkmm/private/object_p.h> + +#include <glibmm/class.h> + +namespace Atk +{ + +class NoOpObject_Class : public Glib::Class +{ +public: +#ifndef DOXYGEN_SHOULD_SKIP_THIS + typedef NoOpObject CppObjectType; + typedef AtkNoOpObject BaseObjectType; + typedef AtkNoOpObjectClass BaseClassType; + typedef Atk::Object_Class CppClassParent; + typedef AtkObjectClass BaseClassParent; + + friend class NoOpObject; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + const Glib::Class& init(); + + static void class_init_function(void* g_class, void* class_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + + //Callbacks (virtual functions): +}; + + +} // namespace Atk + +#endif /* _ATKMM_NOOPOBJECT_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/object_p.h b/libs/gtkmm2/atk/atkmm/private/object_p.h new file mode 100644 index 0000000000..f65e8f8c08 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/object_p.h @@ -0,0 +1,50 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_OBJECT_P_H +#define _ATKMM_OBJECT_P_H +#include <glibmm/private/object_p.h> + +#include <glibmm/class.h> + +namespace Atk +{ + +class Object_Class : public Glib::Class +{ +public: +#ifndef DOXYGEN_SHOULD_SKIP_THIS + typedef Object CppObjectType; + typedef AtkObject BaseObjectType; + typedef AtkObjectClass BaseClassType; + typedef Glib::Object_Class CppClassParent; + typedef GObjectClass BaseClassParent; + + friend class Object; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + const Glib::Class& init(); + + static void class_init_function(void* g_class, void* class_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + static void children_changed_callback(AtkObject* self, guint p0, gpointer p1); + static void focus_event_callback(AtkObject* self, gboolean p0); + static void property_change_callback(AtkObject* self, AtkPropertyValues* p0); + static void state_change_callback(AtkObject* self, const gchar* p0, gboolean p1); + static void visible_data_changed_callback(AtkObject* self); + static void active_descendant_changed_callback(AtkObject* self, gpointer* p0); + + //Callbacks (virtual functions): +}; + + +} // namespace Atk + +#endif /* _ATKMM_OBJECT_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/objectaccessible_p.h b/libs/gtkmm2/atk/atkmm/private/objectaccessible_p.h new file mode 100644 index 0000000000..b94c1320e5 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/objectaccessible_p.h @@ -0,0 +1,44 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_OBJECTACCESSIBLE_P_H +#define _ATKMM_OBJECTACCESSIBLE_P_H +#include <atkmm/private/object_p.h> + +#include <glibmm/class.h> + +namespace Atk +{ + +class ObjectAccessible_Class : public Glib::Class +{ +public: +#ifndef DOXYGEN_SHOULD_SKIP_THIS + typedef ObjectAccessible CppObjectType; + typedef AtkGObjectAccessible BaseObjectType; + typedef AtkGObjectAccessibleClass BaseClassType; + typedef Atk::Object_Class CppClassParent; + typedef AtkObjectClass BaseClassParent; + + friend class ObjectAccessible; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + const Glib::Class& init(); + + static void class_init_function(void* g_class, void* class_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + + //Callbacks (virtual functions): +}; + + +} // namespace Atk + +#endif /* _ATKMM_OBJECTACCESSIBLE_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/relation_p.h b/libs/gtkmm2/atk/atkmm/private/relation_p.h new file mode 100644 index 0000000000..63513db828 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/relation_p.h @@ -0,0 +1,44 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_RELATION_P_H +#define _ATKMM_RELATION_P_H +#include <glibmm/private/object_p.h> + +#include <glibmm/class.h> + +namespace Atk +{ + +class Relation_Class : public Glib::Class +{ +public: +#ifndef DOXYGEN_SHOULD_SKIP_THIS + typedef Relation CppObjectType; + typedef AtkRelation BaseObjectType; + typedef AtkRelationClass BaseClassType; + typedef Glib::Object_Class CppClassParent; + typedef GObjectClass BaseClassParent; + + friend class Relation; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + const Glib::Class& init(); + + static void class_init_function(void* g_class, void* class_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + + //Callbacks (virtual functions): +}; + + +} // namespace Atk + +#endif /* _ATKMM_RELATION_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/relationset_p.h b/libs/gtkmm2/atk/atkmm/private/relationset_p.h new file mode 100644 index 0000000000..8d3787e6e6 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/relationset_p.h @@ -0,0 +1,44 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_RELATIONSET_P_H +#define _ATKMM_RELATIONSET_P_H +#include <glibmm/private/object_p.h> + +#include <glibmm/class.h> + +namespace Atk +{ + +class RelationSet_Class : public Glib::Class +{ +public: +#ifndef DOXYGEN_SHOULD_SKIP_THIS + typedef RelationSet CppObjectType; + typedef AtkRelationSet BaseObjectType; + typedef AtkRelationSetClass BaseClassType; + typedef Glib::Object_Class CppClassParent; + typedef GObjectClass BaseClassParent; + + friend class RelationSet; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + const Glib::Class& init(); + + static void class_init_function(void* g_class, void* class_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + + //Callbacks (virtual functions): +}; + + +} // namespace Atk + +#endif /* _ATKMM_RELATIONSET_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/selection_p.h b/libs/gtkmm2/atk/atkmm/private/selection_p.h new file mode 100644 index 0000000000..dd5f27702a --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/selection_p.h @@ -0,0 +1,49 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_SELECTION_P_H +#define _ATKMM_SELECTION_P_H +#include <atk/atkobject.h> + +#include <glibmm/private/interface_p.h> + +namespace Atk +{ + +class Selection_Class : public Glib::Interface_Class +{ +public: + typedef Selection CppObjectType; + typedef AtkSelection BaseObjectType; + typedef AtkSelectionIface BaseClassType; + typedef Glib::Interface_Class CppClassParent; + + friend class Selection; + + const Glib::Interface_Class& init(); + + static void iface_init_function(void* g_iface, void* iface_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + static void selection_changed_callback(AtkSelection* self); + + //Callbacks (virtual functions): + static gboolean add_selection_vfunc_callback(AtkSelection* self, gint i); + static gboolean clear_selection_vfunc_callback(AtkSelection* self); + static AtkObject* ref_selection_vfunc_callback(AtkSelection* self, gint i); + static gint get_selection_count_vfunc_callback(AtkSelection* self); + static gboolean is_child_selected_vfunc_callback(AtkSelection* self, gint i); + static gboolean remove_selection_vfunc_callback(AtkSelection* self, gint i); + static gboolean select_all_selection_vfunc_callback(AtkSelection* self); +}; + + +} // namespace Atk + +#endif /* _ATKMM_SELECTION_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/stateset_p.h b/libs/gtkmm2/atk/atkmm/private/stateset_p.h new file mode 100644 index 0000000000..51dd352ec0 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/stateset_p.h @@ -0,0 +1,44 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_STATESET_P_H +#define _ATKMM_STATESET_P_H +#include <glibmm/private/object_p.h> + +#include <glibmm/class.h> + +namespace Atk +{ + +class StateSet_Class : public Glib::Class +{ +public: +#ifndef DOXYGEN_SHOULD_SKIP_THIS + typedef StateSet CppObjectType; + typedef AtkStateSet BaseObjectType; + typedef AtkStateSetClass BaseClassType; + typedef Glib::Object_Class CppClassParent; + typedef GObjectClass BaseClassParent; + + friend class StateSet; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + const Glib::Class& init(); + + static void class_init_function(void* g_class, void* class_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + + //Callbacks (virtual functions): +}; + + +} // namespace Atk + +#endif /* _ATKMM_STATESET_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/streamablecontent_p.h b/libs/gtkmm2/atk/atkmm/private/streamablecontent_p.h new file mode 100644 index 0000000000..7c22e8c8ec --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/streamablecontent_p.h @@ -0,0 +1,44 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_STREAMABLECONTENT_P_H +#define _ATKMM_STREAMABLECONTENT_P_H +#include <glibmm/private/object_p.h> + +#include <glibmm/private/interface_p.h> + +namespace Atk +{ + +class StreamableContent_Class : public Glib::Interface_Class +{ +public: + typedef StreamableContent CppObjectType; + typedef AtkStreamableContent BaseObjectType; + typedef AtkStreamableContentIface BaseClassType; + typedef Glib::Interface_Class CppClassParent; + + friend class StreamableContent; + + const Glib::Interface_Class& init(); + + static void iface_init_function(void* g_iface, void* iface_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + + //Callbacks (virtual functions): + static int get_n_mime_types_vfunc_callback(AtkStreamableContent* self); + static const gchar* get_mime_type_vfunc_callback(AtkStreamableContent* self, gint i); + static GIOChannel* get_stream_vfunc_callback(AtkStreamableContent* self, const gchar* mime_type); +}; + + +} // namespace Atk + +#endif /* _ATKMM_STREAMABLECONTENT_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/table_p.h b/libs/gtkmm2/atk/atkmm/private/table_p.h new file mode 100644 index 0000000000..5516bb05c9 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/table_p.h @@ -0,0 +1,77 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_TABLE_P_H +#define _ATKMM_TABLE_P_H +#include <atk/atkobject.h> + +#include <glibmm/private/interface_p.h> + +namespace Atk +{ + +class Table_Class : public Glib::Interface_Class +{ +public: + typedef Table CppObjectType; + typedef AtkTable BaseObjectType; + typedef AtkTableIface BaseClassType; + typedef Glib::Interface_Class CppClassParent; + + friend class Table; + + const Glib::Interface_Class& init(); + + static void iface_init_function(void* g_iface, void* iface_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + static void row_inserted_callback(AtkTable* self, gint p0, gint p1); + static void column_inserted_callback(AtkTable* self, gint p0, gint p1); + static void row_deleted_callback(AtkTable* self, gint p0, gint p1); + static void column_deleted_callback(AtkTable* self, gint p0, gint p1); + static void row_reordered_callback(AtkTable* self); + static void column_reordered_callback(AtkTable* self); + static void model_changed_callback(AtkTable* self); + + //Callbacks (virtual functions): + static AtkObject* ref_at_vfunc_callback(AtkTable* self, gint row, gint column); + static gint get_index_at_vfunc_callback(AtkTable* self, gint row, gint column); + static gint get_column_at_index_vfunc_callback(AtkTable* self, gint index_); + static gint get_row_at_index_vfunc_callback(AtkTable* self, gint index_); + static gint get_n_columns_vfunc_callback(AtkTable* self); + static gint get_n_rows_vfunc_callback(AtkTable* self); + static gint get_column_extent_at_vfunc_callback(AtkTable* self, gint row, gint column); + static gint get_row_extent_at_vfunc_callback(AtkTable* self, gint row, gint column); + static AtkObject* get_caption_vfunc_callback(AtkTable* self); + static const gchar* get_column_description_vfunc_callback(AtkTable* self, gint column); + static AtkObject* get_column_header_vfunc_callback(AtkTable* self, gint column); + static const gchar* get_row_description_vfunc_callback(AtkTable* self, gint row); + static AtkObject* get_row_header_vfunc_callback(AtkTable* self, gint row); + static AtkObject* get_summary_vfunc_callback(AtkTable* self); + static void set_caption_vfunc_callback(AtkTable* self, AtkObject* caption); + static void set_column_description_vfunc_callback(AtkTable* self, gint column, const gchar* description); + static void set_column_header_vfunc_callback(AtkTable* self, gint column, AtkObject* header); + static void set_row_description_vfunc_callback(AtkTable* self, gint row, const gchar* description); + static void set_row_header_vfunc_callback(AtkTable* self, gint row, AtkObject* header); + static void set_summary_vfunc_callback(AtkTable* self, AtkObject* accessible); + static gboolean is_column_selected_vfunc_callback(AtkTable* self, gint column); + static gboolean is_row_selected_vfunc_callback(AtkTable* self, gint row); + static gboolean is_selected_vfunc_callback(AtkTable* self, gint row, gint column); + static gboolean add_row_selection_vfunc_callback(AtkTable* self, gint row); + static gboolean remove_row_selection_vfunc_callback(AtkTable* self, gint row); + static gboolean add_column_selection_vfunc_callback(AtkTable* self, gint column); + static gboolean remove_column_selection_vfunc_callback(AtkTable* self, gint column); + static gint get_selected_columns_vfunc_callback(AtkTable* self, gint** selected); + static gint get_selected_rows_vfunc_callback(AtkTable* self, gint** selected); +}; + + +} // namespace Atk + +#endif /* _ATKMM_TABLE_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/text_p.h b/libs/gtkmm2/atk/atkmm/private/text_p.h new file mode 100644 index 0000000000..3ccc748965 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/text_p.h @@ -0,0 +1,61 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_TEXT_P_H +#define _ATKMM_TEXT_P_H + +#include <glibmm/private/interface_p.h> + +namespace Atk +{ + +class Text_Class : public Glib::Interface_Class +{ +public: + typedef Text CppObjectType; + typedef AtkText BaseObjectType; + typedef AtkTextIface BaseClassType; + typedef Glib::Interface_Class CppClassParent; + + friend class Text; + + const Glib::Interface_Class& init(); + + static void iface_init_function(void* g_iface, void* iface_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + static void text_changed_callback(AtkText* self, gint p0, gint p1); + static void text_caret_moved_callback(AtkText* self, gint p0); + static void text_selection_changed_callback(AtkText* self); + static void text_attributes_changed_callback(AtkText* self); + + //Callbacks (virtual functions): + static gchar* get_text_vfunc_callback(AtkText* self, gint start_offset, gint end_offset); + static gunichar get_character_at_offset_vfunc_callback(AtkText* self, gint offset); + static gchar* get_text_after_offset_vfunc_callback(AtkText* self, gint offset, AtkTextBoundary boundary_type, gint* start_offset, gint* end_offset); + static gchar* get_text_at_offset_vfunc_callback(AtkText* self, gint offset, AtkTextBoundary boundary_type, gint* start_offset, gint* end_offset); + static gchar* get_text_before_offset_vfunc_callback(AtkText* self, gint offset, AtkTextBoundary boundary_type, gint* start_offset, gint* end_offset); + static gint get_caret_offset_vfunc_callback(AtkText* self); + static void get_character_extents_vfunc_callback(AtkText* self, gint offset, gint* x, gint* y, gint* width, gint* height, AtkCoordType coords); + static AtkAttributeSet* get_run_attributes_vfunc_callback(AtkText* self, gint offset, gint* start_offset, gint* end_offset); + static AtkAttributeSet* get_default_attributes_vfunc_callback(AtkText* self); + static gint get_character_count_vfunc_callback(AtkText* self); + static gint get_offset_at_point_vfunc_callback(AtkText* self, gint x, gint y, AtkCoordType coords); + static gint get_n_selections_vfunc_callback(AtkText* self); + static gchar* get_selection_vfunc_callback(AtkText* self, gint selection_num, gint* start_offset, gint* end_offset); + static gboolean add_selection_vfunc_callback(AtkText* self, gint start_offset, gint end_offset); + static gboolean remove_selection_vfunc_callback(AtkText* self, gint selection_num); + static gboolean set_selection_vfunc_callback(AtkText* self, gint selection_num, gint start_offset, gint end_offset); + static gboolean set_caret_offset_vfunc_callback(AtkText* self, gint offset); +}; + + +} // namespace Atk + +#endif /* _ATKMM_TEXT_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/private/value_p.h b/libs/gtkmm2/atk/atkmm/private/value_p.h new file mode 100644 index 0000000000..f712e3cd70 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/private/value_p.h @@ -0,0 +1,44 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_VALUE_P_H +#define _ATKMM_VALUE_P_H + +#include <glibmm/private/interface_p.h> + +namespace Atk +{ + +class Value_Class : public Glib::Interface_Class +{ +public: + typedef Value CppObjectType; + typedef AtkValue BaseObjectType; + typedef AtkValueIface BaseClassType; + typedef Glib::Interface_Class CppClassParent; + + friend class Value; + + const Glib::Interface_Class& init(); + + static void iface_init_function(void* g_iface, void* iface_data); + + static Glib::ObjectBase* wrap_new(GObject*); + +protected: + + //Callbacks (default signal handlers): + //These will call the *_impl member methods, which will then call the existing default signal callbacks, if any. + //You could prevent the original default signal handlers being called by overriding the *_impl method. + + //Callbacks (virtual functions): + static void get_current_value_vfunc_callback(AtkValue* self, GValue* value); + static void get_maximum_value_vfunc_callback(AtkValue* self, GValue* value); + static void get_minimum_value_vfunc_callback(AtkValue* self, GValue* value); + static gboolean set_current_value_vfunc_callback(AtkValue* self, const GValue* value); +}; + + +} // namespace Atk + +#endif /* _ATKMM_VALUE_P_H */ + diff --git a/libs/gtkmm2/atk/atkmm/relation.cc b/libs/gtkmm2/atk/atkmm/relation.cc new file mode 100644 index 0000000000..94c3fe2d48 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/relation.cc @@ -0,0 +1,177 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/relation.h> +#include <atkmm/private/relation_p.h> + +#include <atk/atk-enum-types.h> +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atkmm/object.h> +#include <atk/atkobject.h> +#include <atk/atkrelation.h> + + +namespace Atk +{ + +//TODO: Implement this with the new GValue array thingy. See bug #74246. +Relation::Relation(const Glib::ArrayHandle< Glib::RefPtr<Atk::Object> >& targets, + RelationType relationship) +: + Glib::Object((GObject*) atk_relation_new(const_cast<AtkObject**>(targets.data()), targets.size(), + (AtkRelationType) relationship)) +{} + +Glib::ArrayHandle< Glib::RefPtr<Atk::Object> > Relation::get_target() +{ + GPtrArray *const parray = atk_relation_get_target(gobj()); + + return Glib::ArrayHandle< Glib::RefPtr<Atk::Object> > + (reinterpret_cast<AtkObject**>(parray->pdata), parray->len, Glib::OWNERSHIP_NONE); +} + +Glib::ArrayHandle< Glib::RefPtr<const Atk::Object> > Relation::get_target() const +{ + GPtrArray *const parray = atk_relation_get_target(const_cast<AtkRelation*>(gobj())); + + return Glib::ArrayHandle< Glib::RefPtr<const Atk::Object> > + (reinterpret_cast<AtkObject**>(parray->pdata), parray->len, Glib::OWNERSHIP_NONE); +} + +} // namespace Atk + + +namespace +{ +} // anonymous namespace + +// static +GType Glib::Value<Atk::RelationType>::value_type() +{ + return atk_relation_type_get_type(); +} + + +namespace Glib +{ + +Glib::RefPtr<Atk::Relation> wrap(AtkRelation* object, bool take_copy) +{ + return Glib::RefPtr<Atk::Relation>( dynamic_cast<Atk::Relation*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} /* namespace Glib */ + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Class& Relation_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Class has to know the class init function to clone custom types. + class_init_func_ = &Relation_Class::class_init_function; + + // This is actually just optimized away, apparently with no harm. + // Make sure that the parent type has been created. + //CppClassParent::CppObjectType::get_type(); + + // Create the wrapper type, with the same class/instance size as the base type. + register_derived_type(atk_relation_get_type()); + + // Add derived versions of interfaces, if the C type implements any interfaces: + } + + return *this; +} + +void Relation_Class::class_init_function(void* g_class, void* class_data) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_class); + CppClassParent::class_init_function(klass, class_data); + +} + + +Glib::ObjectBase* Relation_Class::wrap_new(GObject* object) +{ + return new Relation((AtkRelation*)object); +} + + +/* The implementation: */ + +AtkRelation* Relation::gobj_copy() +{ + reference(); + return gobj(); +} + +Relation::Relation(const Glib::ConstructParams& construct_params) +: + Glib::Object(construct_params) +{} + +Relation::Relation(AtkRelation* castitem) +: + Glib::Object((GObject*)(castitem)) +{} + +Relation::~Relation() +{} + + +Relation::CppClassType Relation::relation_class_; // initialize static member + +GType Relation::get_type() +{ + return relation_class_.init().get_type(); +} + +GType Relation::get_base_type() +{ + return atk_relation_get_type(); +} + + +Glib::RefPtr<Relation> Relation::create(const Glib::ArrayHandle< Glib::RefPtr<Atk::Object> >& targets, RelationType relationship) +{ + return Glib::RefPtr<Relation>( new Relation(targets, relationship) ); +} +RelationType Relation::get_relation_type() const +{ + return ((RelationType)(atk_relation_get_relation_type(const_cast<AtkRelation*>(gobj())))); +} + +void Relation::add_target(const Glib::RefPtr<Atk::Object>& target) +{ + atk_relation_add_target(gobj(), Glib::unwrap(target)); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/relation.h b/libs/gtkmm2/atk/atkmm/relation.h new file mode 100644 index 0000000000..683b938947 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/relation.h @@ -0,0 +1,187 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_RELATION_H +#define _ATKMM_RELATION_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkRelation AtkRelation; +typedef struct _AtkRelationClass AtkRelationClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class Relation_Class; } // namespace Atk +namespace Atk +{ + + +/** @addtogroup atkmmEnums Enums and Flags */ + +/** + * @ingroup atkmmEnums + */ +enum RelationType +{ + RELATION_NULL, + RELATION_CONTROLLED_BY, + RELATION_CONTROLLER_FOR, + RELATION_LABEL_FOR, + RELATION_LABELLED_BY, + RELATION_MEMBER_OF, + RELATION_NODE_CHILD_OF, + RELATION_FLOWS_TO, + RELATION_FLOWS_FROM, + RELATION_SUBWINDOW_OF, + RELATION_EMBEDS, + RELATION_EMBEDDED_BY, + RELATION_POPUP_FOR, + RELATION_PARENT_WINDOW_OF, + RELATION_LAST_DEFINED +}; + +} // namespace Atk + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +namespace Glib +{ + +template <> +class Value<Atk::RelationType> : public Glib::Value_Enum<Atk::RelationType> +{ +public: + static GType value_type() G_GNUC_CONST; +}; + +} // namespace Glib +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ + + +class Object; + +/** An Atk::Relation describes a relation between an object and one or more other objects. + * The actual relations that an object has with other objects are defined as an Atk::RelationSet, + * which is a set of Atk::Relations. + */ + +class Relation : public Glib::Object +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef Relation CppObjectType; + typedef Relation_Class CppClassType; + typedef AtkRelation BaseObjectType; + typedef AtkRelationClass BaseClassType; + +private: friend class Relation_Class; + static CppClassType relation_class_; + +private: + // noncopyable + Relation(const Relation&); + Relation& operator=(const Relation&); + +protected: + explicit Relation(const Glib::ConstructParams& construct_params); + explicit Relation(AtkRelation* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~Relation(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkRelation* gobj() { return reinterpret_cast<AtkRelation*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkRelation* gobj() const { return reinterpret_cast<AtkRelation*>(gobject_); } + + ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. + AtkRelation* gobj_copy(); + +private: + + +protected: + explicit Relation(const Glib::ArrayHandle< Glib::RefPtr<Atk::Object> >& targets, + RelationType relationship); + +public: + + static Glib::RefPtr<Relation> create(const Glib::ArrayHandle< Glib::RefPtr<Atk::Object> >& targets, RelationType relationship = RELATION_NULL); + + + /** Gets the type of @a relation + * @return The type of @a relation . + */ + RelationType get_relation_type() const; + + Glib::ArrayHandle< Glib::RefPtr<Atk::Object> > get_target(); + Glib::ArrayHandle< Glib::RefPtr<const Atk::Object> > get_target() const; + + + void add_target(const Glib::RefPtr<Atk::Object>& target); + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::Relation + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::Relation> wrap(AtkRelation* object, bool take_copy = false); +} + + +#endif /* _ATKMM_RELATION_H */ + diff --git a/libs/gtkmm2/atk/atkmm/relationset.cc b/libs/gtkmm2/atk/atkmm/relationset.cc new file mode 100644 index 0000000000..2060639bc1 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/relationset.cc @@ -0,0 +1,181 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/relationset.h> +#include <atkmm/private/relationset_p.h> + +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atk/atkobject.h> +#include <atk/atkrelationset.h> + + +namespace +{ +} // anonymous namespace + + +namespace Glib +{ + +Glib::RefPtr<Atk::RelationSet> wrap(AtkRelationSet* object, bool take_copy) +{ + return Glib::RefPtr<Atk::RelationSet>( dynamic_cast<Atk::RelationSet*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} /* namespace Glib */ + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Class& RelationSet_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Class has to know the class init function to clone custom types. + class_init_func_ = &RelationSet_Class::class_init_function; + + // This is actually just optimized away, apparently with no harm. + // Make sure that the parent type has been created. + //CppClassParent::CppObjectType::get_type(); + + // Create the wrapper type, with the same class/instance size as the base type. + register_derived_type(atk_relation_set_get_type()); + + // Add derived versions of interfaces, if the C type implements any interfaces: + } + + return *this; +} + +void RelationSet_Class::class_init_function(void* g_class, void* class_data) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_class); + CppClassParent::class_init_function(klass, class_data); + +} + + +Glib::ObjectBase* RelationSet_Class::wrap_new(GObject* object) +{ + return new RelationSet((AtkRelationSet*)object); +} + + +/* The implementation: */ + +AtkRelationSet* RelationSet::gobj_copy() +{ + reference(); + return gobj(); +} + +RelationSet::RelationSet(const Glib::ConstructParams& construct_params) +: + Glib::Object(construct_params) +{} + +RelationSet::RelationSet(AtkRelationSet* castitem) +: + Glib::Object((GObject*)(castitem)) +{} + +RelationSet::~RelationSet() +{} + + +RelationSet::CppClassType RelationSet::relationset_class_; // initialize static member + +GType RelationSet::get_type() +{ + return relationset_class_.init().get_type(); +} + +GType RelationSet::get_base_type() +{ + return atk_relation_set_get_type(); +} + + +RelationSet::RelationSet() +: + Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations. + Glib::Object(Glib::ConstructParams(relationset_class_.init())) +{ + } + +Glib::RefPtr<RelationSet> RelationSet::create() +{ + return Glib::RefPtr<RelationSet>( new RelationSet() ); +} +bool RelationSet::set_contains(RelationType relationship) +{ + return atk_relation_set_contains(gobj(), ((AtkRelationType)(relationship))); +} + +void RelationSet::set_remove(const Glib::RefPtr<Relation>& relation) +{ + atk_relation_set_remove(gobj(), Glib::unwrap(relation)); +} + +void RelationSet::set_add(const Glib::RefPtr<Relation>& relation) +{ + atk_relation_set_add(gobj(), Glib::unwrap(relation)); +} + +int RelationSet::get_n_relations() const +{ + return atk_relation_set_get_n_relations(const_cast<AtkRelationSet*>(gobj())); +} + +Glib::RefPtr<Relation> RelationSet::get_relation(gint i) +{ + + Glib::RefPtr<Relation> retvalue = Glib::wrap(atk_relation_set_get_relation(gobj(), i)); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + +Glib::RefPtr<Relation> RelationSet::get_relation(RelationType relationship) +{ + + Glib::RefPtr<Relation> retvalue = Glib::wrap(atk_relation_set_get_relation_by_type(gobj(), ((AtkRelationType)(relationship)))); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + +void RelationSet::add_relation_by_type(RelationType relationship, const Glib::RefPtr<Atk::Object>& target) +{ + atk_relation_set_add_relation_by_type(gobj(), ((AtkRelationType)(relationship)), Glib::unwrap(target)); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/relationset.h b/libs/gtkmm2/atk/atkmm/relationset.h new file mode 100644 index 0000000000..3702083fa5 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/relationset.h @@ -0,0 +1,171 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_RELATIONSET_H +#define _ATKMM_RELATIONSET_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#include <atkmm/relation.h> +#include <atkmm/object.h> + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkRelationSet AtkRelationSet; +typedef struct _AtkRelationSetClass AtkRelationSetClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class RelationSet_Class; } // namespace Atk +namespace Atk +{ + +/** A set of Atk::Relations, normally the set of AtkRelations which an Atk::Object has. + */ + +class RelationSet : public Glib::Object +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef RelationSet CppObjectType; + typedef RelationSet_Class CppClassType; + typedef AtkRelationSet BaseObjectType; + typedef AtkRelationSetClass BaseClassType; + +private: friend class RelationSet_Class; + static CppClassType relationset_class_; + +private: + // noncopyable + RelationSet(const RelationSet&); + RelationSet& operator=(const RelationSet&); + +protected: + explicit RelationSet(const Glib::ConstructParams& construct_params); + explicit RelationSet(AtkRelationSet* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~RelationSet(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkRelationSet* gobj() { return reinterpret_cast<AtkRelationSet*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkRelationSet* gobj() const { return reinterpret_cast<AtkRelationSet*>(gobject_); } + + ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. + AtkRelationSet* gobj_copy(); + +private: + +protected: + RelationSet(); + +public: + + static Glib::RefPtr<RelationSet> create(); + + + /** Determines whether the relation set contains a relation that matches the + * specified type. + * @param relationship An Atk::RelationType. + * @return <tt>true</tt> if @a relationship is the relationship type of a relation + * in @a set , <tt>false</tt> otherwise. + */ + bool set_contains(RelationType relationship); + + /** Removes a relation from the relation set. + * This function unref's the Atk::Relation so it will be deleted unless there + * is another reference to it. + * @param relation An Atk::Relation. + */ + void set_remove(const Glib::RefPtr<Relation>& relation); + + /** Add a new relation to the current relation set if it is not already + * present. + * This function ref's the AtkRelation so the caller of this function + * should unref it to ensure that it will be destroyed when the AtkRelationSet + * is destroyed. + * @param relation An Atk::Relation. + */ + void set_add(const Glib::RefPtr<Relation>& relation); + + /** Determines the number of relations in a relation set. + * @return An integer representing the number of relations in the set. + */ + int get_n_relations() const; + + /** Determines the relation at the specified position in the relation set. + * @param i A <tt>int</tt> representing a position in the set, starting from 0. + * @return A Atk::Relation, which is the relation at position i in the set. + */ + Glib::RefPtr<Relation> get_relation(gint i); + + /** Finds a relation that matches the specified type. + * @param relationship An Atk::RelationType. + * @return An Atk::Relation, which is a relation matching the specified type. + */ + Glib::RefPtr<Relation> get_relation(RelationType relationship); + + + void add_relation_by_type(RelationType relationship, const Glib::RefPtr<Atk::Object>& target); + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::RelationSet + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::RelationSet> wrap(AtkRelationSet* object, bool take_copy = false); +} + + +#endif /* _ATKMM_RELATIONSET_H */ + diff --git a/libs/gtkmm2/atk/atkmm/selection.cc b/libs/gtkmm2/atk/atkmm/selection.cc new file mode 100644 index 0000000000..95c6a0a60a --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/selection.cc @@ -0,0 +1,596 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/selection.h> +#include <atkmm/private/selection_p.h> + +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atkmm/object.h> +#include <atk/atkselection.h> + + +namespace +{ + +const Glib::SignalProxyInfo Selection_signal_selection_changed_info = +{ + "selection_changed", + (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, + (GCallback) &Glib::SignalProxyNormal::slot0_void_callback +}; + +} // anonymous namespace + + +namespace Glib +{ + +Glib::RefPtr<Atk::Selection> wrap(AtkSelection* object, bool take_copy) +{ + return Glib::RefPtr<Atk::Selection>( dynamic_cast<Atk::Selection*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} // namespace Glib + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Interface_Class& Selection_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Interface_Class has to know the interface init function + // in order to add interfaces to implementing types. + class_init_func_ = &Selection_Class::iface_init_function; + + // We can not derive from another interface, and it is not necessary anyway. + gtype_ = atk_selection_get_type(); + } + + return *this; +} + +void Selection_Class::iface_init_function(void* g_iface, void*) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_iface); + + //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. + //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc + g_assert(klass != 0); + + klass->add_selection = &add_selection_vfunc_callback; + klass->clear_selection = &clear_selection_vfunc_callback; + klass->ref_selection = &ref_selection_vfunc_callback; + klass->get_selection_count = &get_selection_count_vfunc_callback; + klass->is_child_selected = &is_child_selected_vfunc_callback; + klass->remove_selection = &remove_selection_vfunc_callback; + klass->select_all_selection = &select_all_selection_vfunc_callback; + klass->selection_changed = &selection_changed_callback; +} + +gboolean Selection_Class::add_selection_vfunc_callback(AtkSelection* self, gint i) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->add_selection_vfunc(i +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->add_selection) + return (*base->add_selection)(self, i); + } + + typedef gboolean RType; + return RType(); +} + +gboolean Selection_Class::clear_selection_vfunc_callback(AtkSelection* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->clear_selection_vfunc()); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->clear_selection) + return (*base->clear_selection)(self); + } + + typedef gboolean RType; + return RType(); +} + +AtkObject* Selection_Class::ref_selection_vfunc_callback(AtkSelection* self, gint i) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return Glib::unwrap_copy(obj->get_selection_vfunc(i +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->ref_selection) + return (*base->ref_selection)(self, i); + } + + typedef AtkObject* RType; + return RType(); +} + +gint Selection_Class::get_selection_count_vfunc_callback(AtkSelection* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_selection_count_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_selection_count) + return (*base->get_selection_count)(self); + } + + typedef gint RType; + return RType(); +} + +gboolean Selection_Class::is_child_selected_vfunc_callback(AtkSelection* self, gint i) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->is_child_selected_vfunc(i +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->is_child_selected) + return (*base->is_child_selected)(self, i); + } + + typedef gboolean RType; + return RType(); +} + +gboolean Selection_Class::remove_selection_vfunc_callback(AtkSelection* self, gint i) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->remove_selection_vfunc(i +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->remove_selection) + return (*base->remove_selection)(self, i); + } + + typedef gboolean RType; + return RType(); +} + +gboolean Selection_Class::select_all_selection_vfunc_callback(AtkSelection* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->select_all_selection_vfunc()); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->select_all_selection) + return (*base->select_all_selection)(self); + } + + typedef gboolean RType; + return RType(); +} + + +void Selection_Class::selection_changed_callback(AtkSelection* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_selection_changed(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->selection_changed) + (*base->selection_changed)(self); + } +} + + +Glib::ObjectBase* Selection_Class::wrap_new(GObject* object) +{ + return new Selection((AtkSelection*)(object)); +} + + +/* The implementation: */ + +Selection::Selection() +: + Glib::Interface(selection_class_.init()) +{} + +Selection::Selection(AtkSelection* castitem) +: + Glib::Interface((GObject*)(castitem)) +{} + +Selection::~Selection() +{} + +// static +void Selection::add_interface(GType gtype_implementer) +{ + selection_class_.init().add_interface(gtype_implementer); +} + +Selection::CppClassType Selection::selection_class_; // initialize static member + +GType Selection::get_type() +{ + return selection_class_.init().get_type(); +} + +GType Selection::get_base_type() +{ + return atk_selection_get_type(); +} + + +bool Selection::add_selection(int i) +{ + return atk_selection_add_selection(gobj(), i); +} + +bool Selection::clear_selection() +{ + return atk_selection_clear_selection(gobj()); +} + +Glib::RefPtr<Atk::Object> Selection::get_selection(int i) +{ + return Glib::wrap(atk_selection_ref_selection(gobj(), i)); +} + +int Selection::get_selection_count() const +{ + return atk_selection_get_selection_count(const_cast<AtkSelection*>(gobj())); +} + +bool Selection::is_child_selected(int i) const +{ + return atk_selection_is_child_selected(const_cast<AtkSelection*>(gobj()), i); +} + +bool Selection::remove_selection(int i) +{ + return atk_selection_remove_selection(gobj(), i); +} + +bool Selection::select_all_selection() +{ + return atk_selection_select_all_selection(gobj()); +} + + +Glib::SignalProxy0< void > Selection::signal_selection_changed() +{ + return Glib::SignalProxy0< void >(this, &Selection_signal_selection_changed_info); +} + + +void Atk::Selection::on_selection_changed() +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->selection_changed) + (*base->selection_changed)(gobj()); +} + + +bool Atk::Selection::add_selection_vfunc(int i) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->add_selection) + return (*base->add_selection)(gobj(),i); + + typedef bool RType; + return RType(); +} + +bool Atk::Selection::clear_selection_vfunc() +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->clear_selection) + return (*base->clear_selection)(gobj()); + + typedef bool RType; + return RType(); +} + +Glib::RefPtr<Atk::Object> Atk::Selection::get_selection_vfunc(int i) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->ref_selection) + return Glib::wrap((*base->ref_selection)(gobj(),i)); + + typedef Glib::RefPtr<Atk::Object> RType; + return RType(); +} + +int Atk::Selection::get_selection_count_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_selection_count) + return (*base->get_selection_count)(const_cast<AtkSelection*>(gobj())); + + typedef int RType; + return RType(); +} + +bool Atk::Selection::is_child_selected_vfunc(int i) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->is_child_selected) + return (*base->is_child_selected)(const_cast<AtkSelection*>(gobj()),i); + + typedef bool RType; + return RType(); +} + +bool Atk::Selection::remove_selection_vfunc(int i) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->remove_selection) + return (*base->remove_selection)(gobj(),i); + + typedef bool RType; + return RType(); +} + +bool Atk::Selection::select_all_selection_vfunc() +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->select_all_selection) + return (*base->select_all_selection)(gobj()); + + typedef bool RType; + return RType(); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/selection.h b/libs/gtkmm2/atk/atkmm/selection.h new file mode 100644 index 0000000000..62185ed0d9 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/selection.h @@ -0,0 +1,208 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_SELECTION_H +#define _ATKMM_SELECTION_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +extern "C" +{ + typedef struct _AtkSelectionIface AtkSelectionIface; + typedef struct _AtkSelection AtkSelection; +} +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkSelection AtkSelection; +typedef struct _AtkSelectionClass AtkSelectionClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class Selection_Class; } // namespace Atk +namespace Atk +{ + +class Object; + +/** The ATK interface implemented by container objects whose Atk::Object children can be selected. + * This should be implemented by UI components with children which are exposed by Atk::Object::ref_child and + * Atk::Object::get_n_children, if the use of the parent UI component ordinarily involves selection of one or + * more of the objects corresponding to those AtkObject children - for example, selectable lists. + * + * Note that other types of "selection" (for instance text selection) are accomplished a other ATK interfaces - + * Atk::Selection is limited to the selection/deselection of children. + */ + +class Selection : public Glib::Interface +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef Selection CppObjectType; + typedef Selection_Class CppClassType; + typedef AtkSelection BaseObjectType; + typedef AtkSelectionIface BaseClassType; + +private: + friend class Selection_Class; + static CppClassType selection_class_; + + // noncopyable + Selection(const Selection&); + Selection& operator=(const Selection&); + +protected: + Selection(); // you must derive from this class + explicit Selection(AtkSelection* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~Selection(); + + static void add_interface(GType gtype_implementer); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkSelection* gobj() { return reinterpret_cast<AtkSelection*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkSelection* gobj() const { return reinterpret_cast<AtkSelection*>(gobject_); } + +private: + + +public: + + /** Adds the specified accessible child of the object to the + * object's selection. + * @param i A <tt>int</tt> specifying the child index. + * @return <tt>true</tt> if success, <tt>false</tt> otherwise. + */ + bool add_selection(int i); + + /** Clears the selection in the object so that no children in the object + * are selected. + * @return <tt>true</tt> if success, <tt>false</tt> otherwise. + */ + bool clear_selection(); + + /** Gets a reference to the accessible object representing the specified + * selected child of the object. + * @note callers should not rely on <tt>0</tt> or on a zero value for + * indication of whether AtkSelectionIface is implemented, they should + * use type checking/interface checking macros or the + * atk_get_accessible_value() convenience method. + * @param i A <tt>int</tt> specifying the index in the selection set. (e.g. the + * ith selection as opposed to the ith child). + * @return An Atk::Object representing the selected accessible , or <tt>0</tt> + * if @a selection does not implement this interface. + */ + Glib::RefPtr<Atk::Object> get_selection(int i); + + /** Gets the number of accessible children currently selected. + * @note callers should not rely on <tt>0</tt> or on a zero value for + * indication of whether AtkSelectionIface is implemented, they should + * use type checking/interface checking macros or the + * atk_get_accessible_value() convenience method. + * @return A <tt>int</tt> representing the number of items selected, or 0 + * if @a selection does not implement this interface. + */ + int get_selection_count() const; + + /** Determines if the current child of this object is selected + * @note callers should not rely on <tt>0</tt> or on a zero value for + * indication of whether AtkSelectionIface is implemented, they should + * use type checking/interface checking macros or the + * atk_get_accessible_value() convenience method. + * @param i A <tt>int</tt> specifying the child index. + * @return A <tt>bool</tt> representing the specified child is selected, or 0 + * if @a selection does not implement this interface. + */ + bool is_child_selected(int i) const; + + /** Removes the specified child of the object from the object's selection. + * @param i A <tt>int</tt> specifying the index in the selection set. (e.g. the + * ith selection as opposed to the ith child). + * @return <tt>true</tt> if success, <tt>false</tt> otherwise. + */ + bool remove_selection(int i); + + /** Causes every child of the object to be selected if the object + * supports multiple selections. + * @return <tt>true</tt> if success, <tt>false</tt> otherwise. + */ + bool select_all_selection(); + + + Glib::SignalProxy0< void > signal_selection_changed(); + + +protected: + virtual bool add_selection_vfunc(int i); + virtual bool clear_selection_vfunc(); + virtual Glib::RefPtr<Atk::Object> get_selection_vfunc(int i); + virtual int get_selection_count_vfunc() const; + virtual bool is_child_selected_vfunc(int i) const; + virtual bool remove_selection_vfunc(int i); + virtual bool select_all_selection_vfunc(); + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + virtual void on_selection_changed(); + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::Selection + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::Selection> wrap(AtkSelection* object, bool take_copy = false); + +} // namespace Glib + +#endif /* _ATKMM_SELECTION_H */ + diff --git a/libs/gtkmm2/atk/atkmm/stateset.cc b/libs/gtkmm2/atk/atkmm/stateset.cc new file mode 100644 index 0000000000..6feb4d6ee3 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/stateset.cc @@ -0,0 +1,200 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/stateset.h> +#include <atkmm/private/stateset_p.h> + +#include <atk/atk-enum-types.h> +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atk/atkobject.h> +#include <atk/atkstateset.h> + + +namespace Atk +{ + +void StateSet::add_states(const Glib::ArrayHandle<StateType>& types) +{ + atk_state_set_add_states(gobj(), (AtkStateType*) types.data(), types.size()); +} + +bool StateSet::contains_states(const Glib::ArrayHandle<StateType>& types) const +{ + return atk_state_set_contains_states( + const_cast<AtkStateSet*>(gobj()), (AtkStateType*) types.data(), types.size()); +} + +} // namespace Atk + + +namespace +{ +} // anonymous namespace + +// static +GType Glib::Value<Atk::StateType>::value_type() +{ + return atk_state_type_get_type(); +} + + +namespace Glib +{ + +Glib::RefPtr<Atk::StateSet> wrap(AtkStateSet* object, bool take_copy) +{ + return Glib::RefPtr<Atk::StateSet>( dynamic_cast<Atk::StateSet*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} /* namespace Glib */ + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Class& StateSet_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Class has to know the class init function to clone custom types. + class_init_func_ = &StateSet_Class::class_init_function; + + // This is actually just optimized away, apparently with no harm. + // Make sure that the parent type has been created. + //CppClassParent::CppObjectType::get_type(); + + // Create the wrapper type, with the same class/instance size as the base type. + register_derived_type(atk_state_set_get_type()); + + // Add derived versions of interfaces, if the C type implements any interfaces: + } + + return *this; +} + +void StateSet_Class::class_init_function(void* g_class, void* class_data) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_class); + CppClassParent::class_init_function(klass, class_data); + +} + + +Glib::ObjectBase* StateSet_Class::wrap_new(GObject* object) +{ + return new StateSet((AtkStateSet*)object); +} + + +/* The implementation: */ + +AtkStateSet* StateSet::gobj_copy() +{ + reference(); + return gobj(); +} + +StateSet::StateSet(const Glib::ConstructParams& construct_params) +: + Glib::Object(construct_params) +{} + +StateSet::StateSet(AtkStateSet* castitem) +: + Glib::Object((GObject*)(castitem)) +{} + +StateSet::~StateSet() +{} + + +StateSet::CppClassType StateSet::stateset_class_; // initialize static member + +GType StateSet::get_type() +{ + return stateset_class_.init().get_type(); +} + +GType StateSet::get_base_type() +{ + return atk_state_set_get_type(); +} + + +StateSet::StateSet() +: + Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations. + Glib::Object(Glib::ConstructParams(stateset_class_.init())) +{ + } + +Glib::RefPtr<StateSet> StateSet::create() +{ + return Glib::RefPtr<StateSet>( new StateSet() ); +} +bool StateSet::is_empty() const +{ + return atk_state_set_is_empty(const_cast<AtkStateSet*>(gobj())); +} + +bool StateSet::add_state(Atk::StateType type) +{ + return atk_state_set_add_state(gobj(), ((AtkStateType)(type))); +} + +void StateSet::clear_states() +{ + atk_state_set_clear_states(gobj()); +} + +bool StateSet::contains_state(Atk::StateType type) +{ + return atk_state_set_contains_state(gobj(), ((AtkStateType)(type))); +} + +bool StateSet::remove_state(Atk::StateType type) +{ + return atk_state_set_remove_state(gobj(), ((AtkStateType)(type))); +} + +Glib::RefPtr<StateSet> StateSet::and_sets(const Glib::RefPtr<StateSet>& compare_set) +{ + return Glib::wrap(atk_state_set_and_sets(gobj(), Glib::unwrap(compare_set))); +} + +Glib::RefPtr<StateSet> StateSet::or_sets(const Glib::RefPtr<StateSet>& compare_set) +{ + return Glib::wrap(atk_state_set_or_sets(gobj(), Glib::unwrap(compare_set))); +} + +Glib::RefPtr<StateSet> StateSet::xor_sets(const Glib::RefPtr<StateSet>& compare_set) +{ + return Glib::wrap(atk_state_set_xor_sets(gobj(), Glib::unwrap(compare_set))); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/stateset.h b/libs/gtkmm2/atk/atkmm/stateset.h new file mode 100644 index 0000000000..f3e8f70504 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/stateset.h @@ -0,0 +1,247 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_STATESET_H +#define _ATKMM_STATESET_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkStateSet AtkStateSet; +typedef struct _AtkStateSetClass AtkStateSetClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class StateSet_Class; } // namespace Atk +namespace Atk +{ + + +/** @addtogroup atkmmEnums Enums and Flags */ + +/** + * @ingroup atkmmEnums + */ +enum StateType +{ + STATE_INVALID, + STATE_ACTIVE, + STATE_ARMED, + STATE_BUSY, + STATE_CHECKED, + STATE_DEFUNCT, + STATE_EDITABLE, + STATE_ENABLED, + STATE_EXPANDABLE, + STATE_EXPANDED, + STATE_FOCUSABLE, + STATE_FOCUSED, + STATE_HORIZONTAL, + STATE_ICONIFIED, + STATE_MODAL, + STATE_MULTI_LINE, + STATE_MULTISELECTABLE, + STATE_OPAQUE, + STATE_PRESSED, + STATE_RESIZABLE, + STATE_SELECTABLE, + STATE_SELECTED, + STATE_SENSITIVE, + STATE_SHOWING, + STATE_SINGLE_LINE, + STATE_STALE, + STATE_TRANSIENT, + STATE_VERTICAL, + STATE_VISIBLE, + STATE_MANAGES_DESCENDANTS, + STATE_INDETERMINATE, + STATE_TRUNCATED, + STATE_LAST_DEFINED +}; + +} // namespace Atk + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +namespace Glib +{ + +template <> +class Value<Atk::StateType> : public Glib::Value_Enum<Atk::StateType> +{ +public: + static GType value_type() G_GNUC_CONST; +}; + +} // namespace Glib +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ + + +/** An AtkStateSet determines a component's state set. + * It is composed of a set of Atk::States. + */ + +class StateSet : public Glib::Object +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef StateSet CppObjectType; + typedef StateSet_Class CppClassType; + typedef AtkStateSet BaseObjectType; + typedef AtkStateSetClass BaseClassType; + +private: friend class StateSet_Class; + static CppClassType stateset_class_; + +private: + // noncopyable + StateSet(const StateSet&); + StateSet& operator=(const StateSet&); + +protected: + explicit StateSet(const Glib::ConstructParams& construct_params); + explicit StateSet(AtkStateSet* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~StateSet(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkStateSet* gobj() { return reinterpret_cast<AtkStateSet*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkStateSet* gobj() const { return reinterpret_cast<AtkStateSet*>(gobject_); } + + ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. + AtkStateSet* gobj_copy(); + +private: + + +protected: + StateSet(); + +public: + + static Glib::RefPtr<StateSet> create(); + + + /** Checks whether the state set is empty, i.e.\ has no states set. + * @return <tt>true</tt> if @a set has no states set, otherwise <tt>false</tt>. + */ + bool is_empty() const; + + //Note that we use Atk::StateType instead of StateType, because there is a Gtk::StateType too, and Doxygen gets confused. + + /** Add a new state for the specified type to the current state set if + * it is not already present. + * @param type An Atk::StateType. + * @return <tt>true</tt> if the state for @a type is not already in @a set . + */ + bool add_state(Atk::StateType type); + void add_states(const Glib::ArrayHandle<Atk::StateType>& types); + + + /** Removes all states from the state set. + */ + void clear_states(); + + /** Checks whether the state for the specified type is in the specified set. + * @param type An Atk::StateType. + * @return <tt>true</tt> if @a type is the state type is in @a set . + */ + bool contains_state(Atk::StateType type); + bool contains_states(const Glib::ArrayHandle<Atk::StateType>& types) const; + + + /** Removes the state for the specified type from the state set. + * @param type An Atk::Type. + * @return <tt>true</tt> if @a type was the state type is in @a set . + */ + bool remove_state(Atk::StateType type); + + /** Constructs the intersection of the two sets, returning <tt>0</tt> if the + * intersection is empty. + * @param compare_set Another Atk::StateSet. + * @return A new Atk::StateSet which is the intersection of the two sets. + */ + Glib::RefPtr<StateSet> and_sets(const Glib::RefPtr<StateSet>& compare_set); + + /** Constructs the union of the two sets. + * @param compare_set Another Atk::StateSet. + * @return A new Atk::StateSet which is the union of the two sets, + * returning <tt>0</tt> is empty. + */ + Glib::RefPtr<StateSet> or_sets(const Glib::RefPtr<StateSet>& compare_set); + + /** Constructs the exclusive-or of the two sets, returning <tt>0</tt> is empty. + * The set returned by this operation contains the states in exactly + * one of the two sets. + * @param compare_set Another Atk::StateSet. + * @return A new Atk::StateSet which contains the states which are + * in exactly one of the two sets. + */ + Glib::RefPtr<StateSet> xor_sets(const Glib::RefPtr<StateSet>& compare_set); + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::StateSet + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::StateSet> wrap(AtkStateSet* object, bool take_copy = false); +} + + +#endif /* _ATKMM_STATESET_H */ + diff --git a/libs/gtkmm2/atk/atkmm/streamablecontent.cc b/libs/gtkmm2/atk/atkmm/streamablecontent.cc new file mode 100644 index 0000000000..13916f861d --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/streamablecontent.cc @@ -0,0 +1,306 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/streamablecontent.h> +#include <atkmm/private/streamablecontent_p.h> + +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 2003 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atkmm/object.h> +#include <atk/atkstreamablecontent.h> + + +namespace Atk +{ + + +} // namespace Atk + + +namespace +{ +} // anonymous namespace + + +namespace Glib +{ + +Glib::RefPtr<Atk::StreamableContent> wrap(AtkStreamableContent* object, bool take_copy) +{ + return Glib::RefPtr<Atk::StreamableContent>( dynamic_cast<Atk::StreamableContent*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} // namespace Glib + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Interface_Class& StreamableContent_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Interface_Class has to know the interface init function + // in order to add interfaces to implementing types. + class_init_func_ = &StreamableContent_Class::iface_init_function; + + // We can not derive from another interface, and it is not necessary anyway. + gtype_ = atk_streamable_content_get_type(); + } + + return *this; +} + +void StreamableContent_Class::iface_init_function(void* g_iface, void*) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_iface); + + //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. + //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc + g_assert(klass != 0); + + klass->get_n_mime_types = &get_n_mime_types_vfunc_callback; + klass->get_mime_type = &get_mime_type_vfunc_callback; + klass->get_stream = &get_stream_vfunc_callback; +} + +int StreamableContent_Class::get_n_mime_types_vfunc_callback(AtkStreamableContent* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_n_mime_types_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_n_mime_types) + return (*base->get_n_mime_types)(self); + } + + typedef int RType; + return RType(); +} + +const gchar* StreamableContent_Class::get_mime_type_vfunc_callback(AtkStreamableContent* self, gint i) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_mime_type_vfunc(i +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_mime_type) + return (*base->get_mime_type)(self, i); + } + + typedef const gchar* RType; + return RType(); +} + +GIOChannel* StreamableContent_Class::get_stream_vfunc_callback(AtkStreamableContent* self, const gchar* mime_type) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_stream_vfunc(Glib::convert_const_gchar_ptr_to_ustring(mime_type) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_stream) + return (*base->get_stream)(self, mime_type); + } + + typedef GIOChannel* RType; + return RType(); +} + + +Glib::ObjectBase* StreamableContent_Class::wrap_new(GObject* object) +{ + return new StreamableContent((AtkStreamableContent*)(object)); +} + + +/* The implementation: */ + +StreamableContent::StreamableContent() +: + Glib::Interface(streamablecontent_class_.init()) +{} + +StreamableContent::StreamableContent(AtkStreamableContent* castitem) +: + Glib::Interface((GObject*)(castitem)) +{} + +StreamableContent::~StreamableContent() +{} + +// static +void StreamableContent::add_interface(GType gtype_implementer) +{ + streamablecontent_class_.init().add_interface(gtype_implementer); +} + +StreamableContent::CppClassType StreamableContent::streamablecontent_class_; // initialize static member + +GType StreamableContent::get_type() +{ + return streamablecontent_class_.init().get_type(); +} + +GType StreamableContent::get_base_type() +{ + return atk_streamable_content_get_type(); +} + + +int StreamableContent::get_n_mime_types() const +{ + return atk_streamable_content_get_n_mime_types(const_cast<AtkStreamableContent*>(gobj())); +} + +Glib::ustring StreamableContent::get_mime_type(int i) const +{ + return Glib::convert_const_gchar_ptr_to_ustring(atk_streamable_content_get_mime_type(const_cast<AtkStreamableContent*>(gobj()), i)); +} + +Glib::RefPtr<Glib::IOChannel> StreamableContent::get_stream(const Glib::ustring& mime_type) +{ + return Glib::wrap(atk_streamable_content_get_stream(gobj(), mime_type.c_str())); +} + + +int Atk::StreamableContent::get_n_mime_types_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_n_mime_types) + return (*base->get_n_mime_types)(const_cast<AtkStreamableContent*>(gobj())); + + typedef int RType; + return RType(); +} + +const gchar* Atk::StreamableContent::get_mime_type_vfunc(int i) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_mime_type) + return (*base->get_mime_type)(const_cast<AtkStreamableContent*>(gobj()),i); + + typedef const gchar* RType; + return RType(); +} + +GIOChannel* Atk::StreamableContent::get_stream_vfunc(const Glib::ustring& mime_type) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_stream) + return (*base->get_stream)(gobj(),mime_type.c_str()); + + typedef GIOChannel* RType; + return RType(); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/streamablecontent.h b/libs/gtkmm2/atk/atkmm/streamablecontent.h new file mode 100644 index 0000000000..698aaef86b --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/streamablecontent.h @@ -0,0 +1,153 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_STREAMABLECONTENT_H +#define _ATKMM_STREAMABLECONTENT_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 2003 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +extern "C" +{ + typedef struct _AtkStreamableContentIface AtkStreamableContentIface; + typedef struct _AtkStreamableContent AtkStreamableContent; +} +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkStreamableContent AtkStreamableContent; +typedef struct _AtkStreamableContentClass AtkStreamableContentClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class StreamableContent_Class; } // namespace Atk +namespace Atk +{ + +class Object; + +/** The ATK interface which provides access to streamable content. + */ + +class StreamableContent : public Glib::Interface +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef StreamableContent CppObjectType; + typedef StreamableContent_Class CppClassType; + typedef AtkStreamableContent BaseObjectType; + typedef AtkStreamableContentIface BaseClassType; + +private: + friend class StreamableContent_Class; + static CppClassType streamablecontent_class_; + + // noncopyable + StreamableContent(const StreamableContent&); + StreamableContent& operator=(const StreamableContent&); + +protected: + StreamableContent(); // you must derive from this class + explicit StreamableContent(AtkStreamableContent* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~StreamableContent(); + + static void add_interface(GType gtype_implementer); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkStreamableContent* gobj() { return reinterpret_cast<AtkStreamableContent*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkStreamableContent* gobj() const { return reinterpret_cast<AtkStreamableContent*>(gobject_); } + +private: + +public: + + + /** Gets the number of mime types supported by this object. + * @return A <tt>int</tt> which is the number of mime types supported by the object. + */ + int get_n_mime_types() const; + + /** Gets the character string of the specified mime type. The first mime + * type is at position 0, the second at position 1, and so on. + * @param i A <tt>int</tt> representing the position of the mime type starting from 0. + * @return : a gchar* representing the specified mime type; the caller + * should not free the character string. + */ + Glib::ustring get_mime_type(int i) const; + + /** Gets the content in the specified mime type. + * @param mime_type A gchar* representing the mime type. + * @return A G::IOChannel which contains the content in the specified mime + * type. + */ + Glib::RefPtr<Glib::IOChannel> get_stream(const Glib::ustring& mime_type); + +protected: + virtual int get_n_mime_types_vfunc() const; + virtual const gchar* get_mime_type_vfunc(int i) const; + virtual GIOChannel* get_stream_vfunc(const Glib::ustring& mime_type); + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::StreamableContent + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::StreamableContent> wrap(AtkStreamableContent* object, bool take_copy = false); + +} // namespace Glib + +#endif /* _ATKMM_STREAMABLECONTENT_H */ + diff --git a/libs/gtkmm2/atk/atkmm/table.cc b/libs/gtkmm2/atk/atkmm/table.cc new file mode 100644 index 0000000000..335fb55ece --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/table.cc @@ -0,0 +1,2394 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/table.h> +#include <atkmm/private/table_p.h> + +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atkmm/object.h> +#include <atk/atktable.h> + + +namespace Atk +{ + +Glib::ArrayHandle<int> Table::get_selected_columns() const +{ + int* selected = 0; + const int n_selected = atk_table_get_selected_columns(const_cast<AtkTable*>(gobj()), &selected); + + return Glib::ArrayHandle<int>(selected, n_selected, Glib::OWNERSHIP_SHALLOW); +} + +Glib::ArrayHandle<int> Table::get_selected_rows() const +{ + int* selected = 0; + const int n_selected = atk_table_get_selected_rows(const_cast<AtkTable*>(gobj()), &selected); + + return Glib::ArrayHandle<int>(selected, n_selected, Glib::OWNERSHIP_SHALLOW); +} + +} // namespace Atk + + +namespace +{ + +void Table_signal_row_inserted_callback(AtkTable* self, gint p0,gint p1,void* data) +{ + using namespace Atk; + typedef sigc::slot< void,int,int > SlotType; + + // Do not try to call a signal on a disassociated wrapper. + if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) + { + try + { + if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data)) + (*static_cast<SlotType*>(slot))(p0 +, p1 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } +} + +const Glib::SignalProxyInfo Table_signal_row_inserted_info = +{ + "row_inserted", + (GCallback) &Table_signal_row_inserted_callback, + (GCallback) &Table_signal_row_inserted_callback +}; + + +void Table_signal_column_inserted_callback(AtkTable* self, gint p0,gint p1,void* data) +{ + using namespace Atk; + typedef sigc::slot< void,int,int > SlotType; + + // Do not try to call a signal on a disassociated wrapper. + if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) + { + try + { + if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data)) + (*static_cast<SlotType*>(slot))(p0 +, p1 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } +} + +const Glib::SignalProxyInfo Table_signal_column_inserted_info = +{ + "column_inserted", + (GCallback) &Table_signal_column_inserted_callback, + (GCallback) &Table_signal_column_inserted_callback +}; + + +void Table_signal_row_deleted_callback(AtkTable* self, gint p0,gint p1,void* data) +{ + using namespace Atk; + typedef sigc::slot< void,int,int > SlotType; + + // Do not try to call a signal on a disassociated wrapper. + if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) + { + try + { + if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data)) + (*static_cast<SlotType*>(slot))(p0 +, p1 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } +} + +const Glib::SignalProxyInfo Table_signal_row_deleted_info = +{ + "row_deleted", + (GCallback) &Table_signal_row_deleted_callback, + (GCallback) &Table_signal_row_deleted_callback +}; + + +void Table_signal_column_deleted_callback(AtkTable* self, gint p0,gint p1,void* data) +{ + using namespace Atk; + typedef sigc::slot< void,int,int > SlotType; + + // Do not try to call a signal on a disassociated wrapper. + if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) + { + try + { + if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data)) + (*static_cast<SlotType*>(slot))(p0 +, p1 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } +} + +const Glib::SignalProxyInfo Table_signal_column_deleted_info = +{ + "column_deleted", + (GCallback) &Table_signal_column_deleted_callback, + (GCallback) &Table_signal_column_deleted_callback +}; + + +const Glib::SignalProxyInfo Table_signal_row_reordered_info = +{ + "row_reordered", + (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, + (GCallback) &Glib::SignalProxyNormal::slot0_void_callback +}; + + +const Glib::SignalProxyInfo Table_signal_column_reordered_info = +{ + "column_reordered", + (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, + (GCallback) &Glib::SignalProxyNormal::slot0_void_callback +}; + + +const Glib::SignalProxyInfo Table_signal_model_changed_info = +{ + "model_changed", + (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, + (GCallback) &Glib::SignalProxyNormal::slot0_void_callback +}; + +} // anonymous namespace + + +namespace Glib +{ + +Glib::RefPtr<Atk::Table> wrap(AtkTable* object, bool take_copy) +{ + return Glib::RefPtr<Atk::Table>( dynamic_cast<Atk::Table*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} // namespace Glib + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Interface_Class& Table_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Interface_Class has to know the interface init function + // in order to add interfaces to implementing types. + class_init_func_ = &Table_Class::iface_init_function; + + // We can not derive from another interface, and it is not necessary anyway. + gtype_ = atk_table_get_type(); + } + + return *this; +} + +void Table_Class::iface_init_function(void* g_iface, void*) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_iface); + + //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. + //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc + g_assert(klass != 0); + + klass->ref_at = &ref_at_vfunc_callback; + klass->get_index_at = &get_index_at_vfunc_callback; + klass->get_column_at_index = &get_column_at_index_vfunc_callback; + klass->get_row_at_index = &get_row_at_index_vfunc_callback; + klass->get_n_columns = &get_n_columns_vfunc_callback; + klass->get_n_rows = &get_n_rows_vfunc_callback; + klass->get_column_extent_at = &get_column_extent_at_vfunc_callback; + klass->get_row_extent_at = &get_row_extent_at_vfunc_callback; + klass->get_caption = &get_caption_vfunc_callback; + klass->get_column_description = &get_column_description_vfunc_callback; + klass->get_column_header = &get_column_header_vfunc_callback; + klass->get_row_description = &get_row_description_vfunc_callback; + klass->get_row_header = &get_row_header_vfunc_callback; + klass->get_summary = &get_summary_vfunc_callback; + klass->set_caption = &set_caption_vfunc_callback; + klass->set_column_description = &set_column_description_vfunc_callback; + klass->set_column_header = &set_column_header_vfunc_callback; + klass->set_row_description = &set_row_description_vfunc_callback; + klass->set_row_header = &set_row_header_vfunc_callback; + klass->set_summary = &set_summary_vfunc_callback; + klass->is_column_selected = &is_column_selected_vfunc_callback; + klass->is_row_selected = &is_row_selected_vfunc_callback; + klass->is_selected = &is_selected_vfunc_callback; + klass->add_row_selection = &add_row_selection_vfunc_callback; + klass->remove_row_selection = &remove_row_selection_vfunc_callback; + klass->add_column_selection = &add_column_selection_vfunc_callback; + klass->remove_column_selection = &remove_column_selection_vfunc_callback; + klass->get_selected_columns = &get_selected_columns_vfunc_callback; + klass->get_selected_rows = &get_selected_rows_vfunc_callback; + klass->row_inserted = &row_inserted_callback; + klass->column_inserted = &column_inserted_callback; + klass->row_deleted = &row_deleted_callback; + klass->column_deleted = &column_deleted_callback; + klass->row_reordered = &row_reordered_callback; + klass->column_reordered = &column_reordered_callback; + klass->model_changed = &model_changed_callback; +} + +AtkObject* Table_Class::ref_at_vfunc_callback(AtkTable* self, gint row, gint column) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return Glib::unwrap_copy(obj->get_at_vfunc(row +, column +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->ref_at) + return (*base->ref_at)(self, row, column); + } + + typedef AtkObject* RType; + return RType(); +} + +gint Table_Class::get_index_at_vfunc_callback(AtkTable* self, gint row, gint column) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_index_at_vfunc(row +, column +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_index_at) + return (*base->get_index_at)(self, row, column); + } + + typedef gint RType; + return RType(); +} + +gint Table_Class::get_column_at_index_vfunc_callback(AtkTable* self, gint index_) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_column_at_index_vfunc(index_ +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_column_at_index) + return (*base->get_column_at_index)(self, index_); + } + + typedef gint RType; + return RType(); +} + +gint Table_Class::get_row_at_index_vfunc_callback(AtkTable* self, gint index_) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_row_at_index_vfunc(index_ +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_row_at_index) + return (*base->get_row_at_index)(self, index_); + } + + typedef gint RType; + return RType(); +} + +gint Table_Class::get_n_columns_vfunc_callback(AtkTable* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_n_columns_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_n_columns) + return (*base->get_n_columns)(self); + } + + typedef gint RType; + return RType(); +} + +gint Table_Class::get_n_rows_vfunc_callback(AtkTable* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_n_rows_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_n_rows) + return (*base->get_n_rows)(self); + } + + typedef gint RType; + return RType(); +} + +gint Table_Class::get_column_extent_at_vfunc_callback(AtkTable* self, gint row, gint column) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_column_extent_at_vfunc(row +, column +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_column_extent_at) + return (*base->get_column_extent_at)(self, row, column); + } + + typedef gint RType; + return RType(); +} + +gint Table_Class::get_row_extent_at_vfunc_callback(AtkTable* self, gint row, gint column) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_row_extent_at_vfunc(row +, column +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_row_extent_at) + return (*base->get_row_extent_at)(self, row, column); + } + + typedef gint RType; + return RType(); +} + +AtkObject* Table_Class::get_caption_vfunc_callback(AtkTable* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return Glib::unwrap(obj->get_caption_vfunc()); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_caption) + return (*base->get_caption)(self); + } + + typedef AtkObject* RType; + return RType(); +} + +const gchar* Table_Class::get_column_description_vfunc_callback(AtkTable* self, gint column) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_column_description_vfunc(column +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_column_description) + return (*base->get_column_description)(self, column); + } + + typedef const gchar* RType; + return RType(); +} + +AtkObject* Table_Class::get_column_header_vfunc_callback(AtkTable* self, gint column) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return Glib::unwrap(obj->get_column_header_vfunc(column +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_column_header) + return (*base->get_column_header)(self, column); + } + + typedef AtkObject* RType; + return RType(); +} + +const gchar* Table_Class::get_row_description_vfunc_callback(AtkTable* self, gint row) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_row_description_vfunc(row +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_row_description) + return (*base->get_row_description)(self, row); + } + + typedef const gchar* RType; + return RType(); +} + +AtkObject* Table_Class::get_row_header_vfunc_callback(AtkTable* self, gint row) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return Glib::unwrap(obj->get_row_header_vfunc(row +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_row_header) + return (*base->get_row_header)(self, row); + } + + typedef AtkObject* RType; + return RType(); +} + +AtkObject* Table_Class::get_summary_vfunc_callback(AtkTable* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return Glib::unwrap(obj->get_summary_vfunc()); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_summary) + return (*base->get_summary)(self); + } + + typedef AtkObject* RType; + return RType(); +} + +void Table_Class::set_caption_vfunc_callback(AtkTable* self, AtkObject* caption) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->set_caption_vfunc(Glib::wrap(caption, true) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->set_caption) + (*base->set_caption)(self, caption); + } +} + +void Table_Class::set_column_description_vfunc_callback(AtkTable* self, gint column, const gchar* description) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->set_column_description_vfunc(column +, description +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->set_column_description) + (*base->set_column_description)(self, column, description); + } +} + +void Table_Class::set_column_header_vfunc_callback(AtkTable* self, gint column, AtkObject* header) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->set_column_header_vfunc(column +, Glib::wrap(header, true) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->set_column_header) + (*base->set_column_header)(self, column, header); + } +} + +void Table_Class::set_row_description_vfunc_callback(AtkTable* self, gint row, const gchar* description) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->set_row_description_vfunc(row +, description +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->set_row_description) + (*base->set_row_description)(self, row, description); + } +} + +void Table_Class::set_row_header_vfunc_callback(AtkTable* self, gint row, AtkObject* header) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->set_row_header_vfunc(row +, Glib::wrap(header, true) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->set_row_header) + (*base->set_row_header)(self, row, header); + } +} + +void Table_Class::set_summary_vfunc_callback(AtkTable* self, AtkObject* accessible) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->set_summary_vfunc(Glib::wrap(accessible, true) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->set_summary) + (*base->set_summary)(self, accessible); + } +} + +gboolean Table_Class::is_column_selected_vfunc_callback(AtkTable* self, gint column) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->is_column_selected_vfunc(column +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->is_column_selected) + return (*base->is_column_selected)(self, column); + } + + typedef gboolean RType; + return RType(); +} + +gboolean Table_Class::is_row_selected_vfunc_callback(AtkTable* self, gint row) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->is_row_selected_vfunc(row +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->is_row_selected) + return (*base->is_row_selected)(self, row); + } + + typedef gboolean RType; + return RType(); +} + +gboolean Table_Class::is_selected_vfunc_callback(AtkTable* self, gint row, gint column) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->is_selected_vfunc(row +, column +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->is_selected) + return (*base->is_selected)(self, row, column); + } + + typedef gboolean RType; + return RType(); +} + +gboolean Table_Class::add_row_selection_vfunc_callback(AtkTable* self, gint row) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->add_row_selection_vfunc(row +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->add_row_selection) + return (*base->add_row_selection)(self, row); + } + + typedef gboolean RType; + return RType(); +} + +gboolean Table_Class::remove_row_selection_vfunc_callback(AtkTable* self, gint row) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->remove_row_selection_vfunc(row +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->remove_row_selection) + return (*base->remove_row_selection)(self, row); + } + + typedef gboolean RType; + return RType(); +} + +gboolean Table_Class::add_column_selection_vfunc_callback(AtkTable* self, gint column) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->add_column_selection_vfunc(column +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->add_column_selection) + return (*base->add_column_selection)(self, column); + } + + typedef gboolean RType; + return RType(); +} + +gboolean Table_Class::remove_column_selection_vfunc_callback(AtkTable* self, gint column) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->remove_column_selection_vfunc(column +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->remove_column_selection) + return (*base->remove_column_selection)(self, column); + } + + typedef gboolean RType; + return RType(); +} + +gint Table_Class::get_selected_columns_vfunc_callback(AtkTable* self, gint** selected) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_selected_columns_vfunc(selected +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_selected_columns) + return (*base->get_selected_columns)(self, selected); + } + + typedef gint RType; + return RType(); +} + +gint Table_Class::get_selected_rows_vfunc_callback(AtkTable* self, gint** selected) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_selected_rows_vfunc(selected +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_selected_rows) + return (*base->get_selected_rows)(self, selected); + } + + typedef gint RType; + return RType(); +} + + +void Table_Class::row_inserted_callback(AtkTable* self, gint p0, gint p1) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_row_inserted(p0 +, p1 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->row_inserted) + (*base->row_inserted)(self, p0, p1); + } +} + +void Table_Class::column_inserted_callback(AtkTable* self, gint p0, gint p1) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_column_inserted(p0 +, p1 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->column_inserted) + (*base->column_inserted)(self, p0, p1); + } +} + +void Table_Class::row_deleted_callback(AtkTable* self, gint p0, gint p1) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_row_deleted(p0 +, p1 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->row_deleted) + (*base->row_deleted)(self, p0, p1); + } +} + +void Table_Class::column_deleted_callback(AtkTable* self, gint p0, gint p1) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_column_deleted(p0 +, p1 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->column_deleted) + (*base->column_deleted)(self, p0, p1); + } +} + +void Table_Class::row_reordered_callback(AtkTable* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_row_reordered(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->row_reordered) + (*base->row_reordered)(self); + } +} + +void Table_Class::column_reordered_callback(AtkTable* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_column_reordered(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->column_reordered) + (*base->column_reordered)(self); + } +} + +void Table_Class::model_changed_callback(AtkTable* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_model_changed(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->model_changed) + (*base->model_changed)(self); + } +} + + +Glib::ObjectBase* Table_Class::wrap_new(GObject* object) +{ + return new Table((AtkTable*)(object)); +} + + +/* The implementation: */ + +Table::Table() +: + Glib::Interface(table_class_.init()) +{} + +Table::Table(AtkTable* castitem) +: + Glib::Interface((GObject*)(castitem)) +{} + +Table::~Table() +{} + +// static +void Table::add_interface(GType gtype_implementer) +{ + table_class_.init().add_interface(gtype_implementer); +} + +Table::CppClassType Table::table_class_; // initialize static member + +GType Table::get_type() +{ + return table_class_.init().get_type(); +} + +GType Table::get_base_type() +{ + return atk_table_get_type(); +} + + +Glib::RefPtr<Atk::Object> Table::get_at(int row, int column) +{ + return Glib::wrap(atk_table_ref_at(gobj(), row, column)); +} + +int Table::get_index_at(int row, int column) const +{ + return atk_table_get_index_at(const_cast<AtkTable*>(gobj()), row, column); +} + +int Table::get_column_at_index(int index) const +{ + return atk_table_get_column_at_index(const_cast<AtkTable*>(gobj()), index); +} + +int Table::get_row_at_index(int index) const +{ + return atk_table_get_row_at_index(const_cast<AtkTable*>(gobj()), index); +} + +int Table::get_n_columns() const +{ + return atk_table_get_n_columns(const_cast<AtkTable*>(gobj())); +} + +int Table::get_n_rows() const +{ + return atk_table_get_n_rows(const_cast<AtkTable*>(gobj())); +} + +int Table::get_column_extent_at(int row, int column) const +{ + return atk_table_get_column_extent_at(const_cast<AtkTable*>(gobj()), row, column); +} + +int Table::get_row_extent_at(int row, int column) const +{ + return atk_table_get_row_extent_at(const_cast<AtkTable*>(gobj()), row, column); +} + +Glib::RefPtr<Atk::Object> Table::get_caption() +{ + + Glib::RefPtr<Atk::Object> retvalue = Glib::wrap(atk_table_get_caption(gobj())); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + +Glib::RefPtr<const Atk::Object> Table::get_caption() const +{ + + Glib::RefPtr<const Atk::Object> retvalue = Glib::wrap(atk_table_get_caption(const_cast<AtkTable*>(gobj()))); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + +Glib::ustring Table::get_column_description(int column) const +{ + return Glib::convert_const_gchar_ptr_to_ustring(atk_table_get_column_description(const_cast<AtkTable*>(gobj()), column)); +} + +Glib::RefPtr<Atk::Object> Table::get_column_header(int column) +{ + + Glib::RefPtr<Atk::Object> retvalue = Glib::wrap(atk_table_get_column_header(gobj(), column)); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + +Glib::RefPtr<const Atk::Object> Table::get_column_header(int column) const +{ + + Glib::RefPtr<const Atk::Object> retvalue = Glib::wrap(atk_table_get_column_header(const_cast<AtkTable*>(gobj()), column)); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + +Glib::ustring Table::get_row_description(int row) const +{ + return Glib::convert_const_gchar_ptr_to_ustring(atk_table_get_row_description(const_cast<AtkTable*>(gobj()), row)); +} + +Glib::RefPtr<Atk::Object> Table::get_row_header(int row) +{ + + Glib::RefPtr<Atk::Object> retvalue = Glib::wrap(atk_table_get_row_header(gobj(), row)); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + +Glib::RefPtr<const Atk::Object> Table::get_row_header(int row) const +{ + + Glib::RefPtr<const Atk::Object> retvalue = Glib::wrap(atk_table_get_row_header(const_cast<AtkTable*>(gobj()), row)); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + +Glib::RefPtr<Atk::Object> Table::get_summary() +{ + + Glib::RefPtr<Atk::Object> retvalue = Glib::wrap(atk_table_get_summary(gobj())); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + +Glib::RefPtr<const Atk::Object> Table::get_summary() const +{ + + Glib::RefPtr<const Atk::Object> retvalue = Glib::wrap(atk_table_get_summary(const_cast<AtkTable*>(gobj()))); + + if(retvalue) + retvalue->reference(); //The function does not do a ref for us. + return retvalue; +} + +void Table::set_caption(const Glib::RefPtr<Atk::Object>& caption) +{ + atk_table_set_caption(gobj(), Glib::unwrap(caption)); +} + +void Table::set_column_description(int column, const Glib::ustring& description) +{ + atk_table_set_column_description(gobj(), column, description.c_str()); +} + +void Table::set_column_header(int column, const Glib::RefPtr<Atk::Object>& header) +{ + atk_table_set_column_header(gobj(), column, Glib::unwrap(header)); +} + +void Table::set_row_description(int row, const Glib::ustring& description) +{ + atk_table_set_row_description(gobj(), row, description.c_str()); +} + +void Table::set_row_header(int row, const Glib::RefPtr<Atk::Object>& header) +{ + atk_table_set_row_header(gobj(), row, Glib::unwrap(header)); +} + +void Table::set_summary(const Glib::RefPtr<Atk::Object>& accessible) +{ + atk_table_set_summary(gobj(), Glib::unwrap(accessible)); +} + +bool Table::is_column_selected(int column) const +{ + return atk_table_is_column_selected(const_cast<AtkTable*>(gobj()), column); +} + +bool Table::is_row_selected(int row) const +{ + return atk_table_is_row_selected(const_cast<AtkTable*>(gobj()), row); +} + +bool Table::is_selected(int row, int column) const +{ + return atk_table_is_selected(const_cast<AtkTable*>(gobj()), row, column); +} + +bool Table::add_row_selection(int row) +{ + return atk_table_add_row_selection(gobj(), row); +} + +bool Table::remove_row_selection(int row) +{ + return atk_table_remove_row_selection(gobj(), row); +} + +bool Table::add_column_selection(int column) +{ + return atk_table_add_column_selection(gobj(), column); +} + +bool Table::remove_column_selection(int column) +{ + return atk_table_remove_column_selection(gobj(), column); +} + + +Glib::SignalProxy2< void,int,int > Table::signal_row_inserted() +{ + return Glib::SignalProxy2< void,int,int >(this, &Table_signal_row_inserted_info); +} + +Glib::SignalProxy2< void,int,int > Table::signal_column_inserted() +{ + return Glib::SignalProxy2< void,int,int >(this, &Table_signal_column_inserted_info); +} + +Glib::SignalProxy2< void,int,int > Table::signal_row_deleted() +{ + return Glib::SignalProxy2< void,int,int >(this, &Table_signal_row_deleted_info); +} + +Glib::SignalProxy2< void,int,int > Table::signal_column_deleted() +{ + return Glib::SignalProxy2< void,int,int >(this, &Table_signal_column_deleted_info); +} + +Glib::SignalProxy0< void > Table::signal_row_reordered() +{ + return Glib::SignalProxy0< void >(this, &Table_signal_row_reordered_info); +} + +Glib::SignalProxy0< void > Table::signal_column_reordered() +{ + return Glib::SignalProxy0< void >(this, &Table_signal_column_reordered_info); +} + +Glib::SignalProxy0< void > Table::signal_model_changed() +{ + return Glib::SignalProxy0< void >(this, &Table_signal_model_changed_info); +} + + +void Atk::Table::on_row_inserted(int row, int num_inserted) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->row_inserted) + (*base->row_inserted)(gobj(),row,num_inserted); +} + +void Atk::Table::on_column_inserted(int column, int num_inserted) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->column_inserted) + (*base->column_inserted)(gobj(),column,num_inserted); +} + +void Atk::Table::on_row_deleted(int row, int num_deleted) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->row_deleted) + (*base->row_deleted)(gobj(),row,num_deleted); +} + +void Atk::Table::on_column_deleted(int column, int num_deleted) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->column_deleted) + (*base->column_deleted)(gobj(),column,num_deleted); +} + +void Atk::Table::on_row_reordered() +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->row_reordered) + (*base->row_reordered)(gobj()); +} + +void Atk::Table::on_column_reordered() +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->column_reordered) + (*base->column_reordered)(gobj()); +} + +void Atk::Table::on_model_changed() +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->model_changed) + (*base->model_changed)(gobj()); +} + + +Glib::RefPtr<Atk::Object> Atk::Table::get_at_vfunc(int row, int column) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->ref_at) + return Glib::wrap((*base->ref_at)(gobj(),row,column)); + + typedef Glib::RefPtr<Atk::Object> RType; + return RType(); +} + +int Atk::Table::get_index_at_vfunc(int row, int column) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_index_at) + return (*base->get_index_at)(const_cast<AtkTable*>(gobj()),row,column); + + typedef int RType; + return RType(); +} + +int Atk::Table::get_column_at_index_vfunc(int index) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_column_at_index) + return (*base->get_column_at_index)(const_cast<AtkTable*>(gobj()),index); + + typedef int RType; + return RType(); +} + +int Atk::Table::get_row_at_index_vfunc(int index) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_row_at_index) + return (*base->get_row_at_index)(const_cast<AtkTable*>(gobj()),index); + + typedef int RType; + return RType(); +} + +int Atk::Table::get_n_columns_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_n_columns) + return (*base->get_n_columns)(const_cast<AtkTable*>(gobj())); + + typedef int RType; + return RType(); +} + +int Atk::Table::get_n_rows_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_n_rows) + return (*base->get_n_rows)(const_cast<AtkTable*>(gobj())); + + typedef int RType; + return RType(); +} + +int Atk::Table::get_column_extent_at_vfunc(int row, int column) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_column_extent_at) + return (*base->get_column_extent_at)(const_cast<AtkTable*>(gobj()),row,column); + + typedef int RType; + return RType(); +} + +int Atk::Table::get_row_extent_at_vfunc(int row, int column) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_row_extent_at) + return (*base->get_row_extent_at)(const_cast<AtkTable*>(gobj()),row,column); + + typedef int RType; + return RType(); +} + +Glib::RefPtr<Atk::Object> Atk::Table::get_caption_vfunc() +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_caption) + return Glib::wrap((*base->get_caption)(gobj())); + + typedef Glib::RefPtr<Atk::Object> RType; + return RType(); +} + +const char* Atk::Table::get_column_description_vfunc(int column) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_column_description) + return (*base->get_column_description)(const_cast<AtkTable*>(gobj()),column); + + typedef const char* RType; + return RType(); +} + +Glib::RefPtr<Atk::Object> Atk::Table::get_column_header_vfunc(int column) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_column_header) + return Glib::wrap((*base->get_column_header)(gobj(),column)); + + typedef Glib::RefPtr<Atk::Object> RType; + return RType(); +} + +const char* Atk::Table::get_row_description_vfunc(int row) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_row_description) + return (*base->get_row_description)(const_cast<AtkTable*>(gobj()),row); + + typedef const char* RType; + return RType(); +} + +Glib::RefPtr<Atk::Object> Atk::Table::get_row_header_vfunc(int row) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_row_header) + return Glib::wrap((*base->get_row_header)(gobj(),row)); + + typedef Glib::RefPtr<Atk::Object> RType; + return RType(); +} + +Glib::RefPtr<Atk::Object> Atk::Table::get_summary_vfunc() +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_summary) + return Glib::wrap((*base->get_summary)(gobj())); + + typedef Glib::RefPtr<Atk::Object> RType; + return RType(); +} + +void Atk::Table::set_caption_vfunc(const Glib::RefPtr<Atk::Object>& caption) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->set_caption) + (*base->set_caption)(gobj(),Glib::unwrap(caption)); +} + +void Atk::Table::set_column_description_vfunc(int column, const char* description) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->set_column_description) + (*base->set_column_description)(gobj(),column,description); +} + +void Atk::Table::set_column_header_vfunc(int column, const Glib::RefPtr<Atk::Object>& header) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->set_column_header) + (*base->set_column_header)(gobj(),column,Glib::unwrap(header)); +} + +void Atk::Table::set_row_description_vfunc(int row, const char* description) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->set_row_description) + (*base->set_row_description)(gobj(),row,description); +} + +void Atk::Table::set_row_header_vfunc(int row, const Glib::RefPtr<Atk::Object>& header) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->set_row_header) + (*base->set_row_header)(gobj(),row,Glib::unwrap(header)); +} + +void Atk::Table::set_summary_vfunc(const Glib::RefPtr<Atk::Object>& accessible) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->set_summary) + (*base->set_summary)(gobj(),Glib::unwrap(accessible)); +} + +bool Atk::Table::is_column_selected_vfunc(int column) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->is_column_selected) + return (*base->is_column_selected)(const_cast<AtkTable*>(gobj()),column); + + typedef bool RType; + return RType(); +} + +bool Atk::Table::is_row_selected_vfunc(int row) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->is_row_selected) + return (*base->is_row_selected)(const_cast<AtkTable*>(gobj()),row); + + typedef bool RType; + return RType(); +} + +bool Atk::Table::is_selected_vfunc(int row, int column) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->is_selected) + return (*base->is_selected)(const_cast<AtkTable*>(gobj()),row,column); + + typedef bool RType; + return RType(); +} + +bool Atk::Table::add_row_selection_vfunc(int row) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->add_row_selection) + return (*base->add_row_selection)(gobj(),row); + + typedef bool RType; + return RType(); +} + +bool Atk::Table::remove_row_selection_vfunc(int row) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->remove_row_selection) + return (*base->remove_row_selection)(gobj(),row); + + typedef bool RType; + return RType(); +} + +bool Atk::Table::add_column_selection_vfunc(int column) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->add_column_selection) + return (*base->add_column_selection)(gobj(),column); + + typedef bool RType; + return RType(); +} + +bool Atk::Table::remove_column_selection_vfunc(int column) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->remove_column_selection) + return (*base->remove_column_selection)(gobj(),column); + + typedef bool RType; + return RType(); +} + +int Atk::Table::get_selected_columns_vfunc(int** selected) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_selected_columns) + return (*base->get_selected_columns)(const_cast<AtkTable*>(gobj()),selected); + + typedef int RType; + return RType(); +} + +int Atk::Table::get_selected_rows_vfunc(int** selected) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_selected_rows) + return (*base->get_selected_rows)(const_cast<AtkTable*>(gobj()),selected); + + typedef int RType; + return RType(); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/table.h b/libs/gtkmm2/atk/atkmm/table.h new file mode 100644 index 0000000000..f1936afd49 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/table.h @@ -0,0 +1,427 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_TABLE_H +#define _ATKMM_TABLE_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +extern "C" +{ + typedef struct _AtkTableIface AtkTableIface; + typedef struct _AtkTable AtkTable; +} +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkTable AtkTable; +typedef struct _AtkTableClass AtkTableClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class Table_Class; } // namespace Atk +namespace Atk +{ + +class Object; + +/** The ATK interface implemented for UI components which contain tabular or row/column information. + * This should be implemented by components which present elements ordered via rows and columns. It may also be used to + * present tree-structured information if the nodes of the trees can be said to contain multiple "columns". Individual + * elements of an Atk::Table are typically referred to as "cells", and these cells are exposed by Atk::Table as child + * Atk::Objects of the Atk::Table. Both row/column and child-index-based access to these children is provided. + * + * Children of Atk::Table are frequently "lightweight" objects, that is, they may not have backing widgets in the host UI + * toolkit. They are therefore often transient. + * + * Since tables are often very complex, Atk::Table includes provision for offering simplified summary information, as + * well as row and column headers and captions. Headers and captions are AtkObjects which may implement other interfaces + * (Atk::Text, Atk::Image, etc.) as appropriate. Atk::Table summaries may themselves be (simplified) Atk::Tables, etc. + */ + +class Table : public Glib::Interface +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef Table CppObjectType; + typedef Table_Class CppClassType; + typedef AtkTable BaseObjectType; + typedef AtkTableIface BaseClassType; + +private: + friend class Table_Class; + static CppClassType table_class_; + + // noncopyable + Table(const Table&); + Table& operator=(const Table&); + +protected: + Table(); // you must derive from this class + explicit Table(AtkTable* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~Table(); + + static void add_interface(GType gtype_implementer); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkTable* gobj() { return reinterpret_cast<AtkTable*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkTable* gobj() const { return reinterpret_cast<AtkTable*>(gobject_); } + +private: + + +public: + + /** Get a reference to the table cell at @a row , @a column . + * @param row A <tt>int</tt> representing a row in @a table . + * @param column A <tt>int</tt> representing a column in @a table . + * @return A AtkObject* representing the referred to accessible. + */ + Glib::RefPtr<Atk::Object> get_at(int row, int column); + + /** Gets a <tt>int</tt> representing the index at the specified @a row and @a column . + * The value -1 is returned if the object at row,column is not a child + * of table or table does not implement this interface. + * @param row A <tt>int</tt> representing a row in @a table . + * @param column A <tt>int</tt> representing a column in @a table . + * @return A <tt>int</tt> representing the index at specified position. + */ + int get_index_at(int row, int column) const; + + /** Gets a <tt>int</tt> representing the column at the specified @a index , or -1 + * if the table does not implement this interface + * @param index A <tt>int</tt> representing an index in @a table . + * @return A <tt>int</tt> representing the column at the specified index. + */ + int get_column_at_index(int index) const; + + /** Gets a <tt>int</tt> representing the row at the specified @a index , or -1 + * if the table does not implement this interface + * @param index A <tt>int</tt> representing an index in @a table . + * @return A <tt>int</tt> representing the row at the specified index. + */ + int get_row_at_index(int index) const; + + /** Gets the number of columns in the table. + * @return A <tt>int</tt> representing the number of columns, or 0 + * if value does not implement this interface. + */ + int get_n_columns() const; + + /** Gets the number of rows in the table. + * @return A <tt>int</tt> representing the number of rows, or 0 + * if value does not implement this interface. + */ + int get_n_rows() const; + + /** Gets the number of columns occupied by the accessible object + * at the specified @a row and @a column in the @a table . + * @param row A <tt>int</tt> representing a row in @a table . + * @param column A <tt>int</tt> representing a column in @a table . + * @return A <tt>int</tt> representing the column extent at specified position, or 0 + * if value does not implement this interface. + */ + int get_column_extent_at(int row, int column) const; + + /** Gets the number of rows occupied by the accessible object + * at a specified @a row and @a column in the @a table . + * @param row A <tt>int</tt> representing a row in @a table . + * @param column A <tt>int</tt> representing a column in @a table . + * @return A <tt>int</tt> representing the row extent at specified position, or 0 + * if value does not implement this interface. + */ + int get_row_extent_at(int row, int column) const; + + + /** Gets the caption for the @a table . + * @return A AtkObject* representing the table caption, or <tt>0</tt> + * if value does not implement this interface. + */ + Glib::RefPtr<Atk::Object> get_caption(); + + /** Gets the caption for the @a table . + * @return A AtkObject* representing the table caption, or <tt>0</tt> + * if value does not implement this interface. + */ + Glib::RefPtr<const Atk::Object> get_caption() const; + + + /** Gets the description text of the specified @a column in the table + * @param column A <tt>int</tt> representing a column in @a table . + * @return A gchar* representing the column description, or <tt>0</tt> + * if value does not implement this interface. + */ + Glib::ustring get_column_description(int column) const; + + + /** Gets the column header of a specified column in an accessible table. + * @param column A <tt>int</tt> representing a column in the table. + * @return A AtkObject* representing the specified column header, or + * <tt>0</tt> if value does not implement this interface. + */ + Glib::RefPtr<Atk::Object> get_column_header(int column); + + /** Gets the column header of a specified column in an accessible table. + * @param column A <tt>int</tt> representing a column in the table. + * @return A AtkObject* representing the specified column header, or + * <tt>0</tt> if value does not implement this interface. + */ + Glib::RefPtr<const Atk::Object> get_column_header(int column) const; + + + /** Gets the description text of the specified row in the table + * @param row A <tt>int</tt> representing a row in @a table . + * @return A gchar* representing the row description, or <tt>0</tt> + * if value does not implement this interface. + */ + Glib::ustring get_row_description(int row) const; + + + /** Gets the row header of a specified row in an accessible table. + * @param row A <tt>int</tt> representing a row in the table. + * @return A AtkObject* representing the specified row header, or + * <tt>0</tt> if value does not implement this interface. + */ + Glib::RefPtr<Atk::Object> get_row_header(int row); + + /** Gets the row header of a specified row in an accessible table. + * @param row A <tt>int</tt> representing a row in the table. + * @return A AtkObject* representing the specified row header, or + * <tt>0</tt> if value does not implement this interface. + */ + Glib::RefPtr<const Atk::Object> get_row_header(int row) const; + + + /** Gets the summary description of the table. + * @return A AtkObject* representing a summary description of the table, + * or zero if value does not implement this interface. + */ + Glib::RefPtr<Atk::Object> get_summary(); + + /** Gets the summary description of the table. + * @return A AtkObject* representing a summary description of the table, + * or zero if value does not implement this interface. + */ + Glib::RefPtr<const Atk::Object> get_summary() const; + + + /** Sets the caption for the table. + * @param caption A Atk::Object representing the caption to set for @a table . + */ + void set_caption(const Glib::RefPtr<Atk::Object>& caption); + + /** Sets the description text for the specified @a column of the @a table . + * @param column A <tt>int</tt> representing a column in @a table . + * @param description A #gchar representing the description text + * to set for the specified @a column of the @a table . + */ + void set_column_description(int column, const Glib::ustring& description); + + /** Sets the specified column header to @a header . + * @param column A <tt>int</tt> representing a column in @a table . + * @param header An Atk::Table. + */ + void set_column_header(int column, const Glib::RefPtr<Atk::Object>& header); + + /** Sets the description text for the specified @a row of @a table . + * @param row A <tt>int</tt> representing a row in @a table . + * @param description A #gchar representing the description text + * to set for the specified @a row of @a table . + */ + void set_row_description(int row, const Glib::ustring& description); + + /** Sets the specified row header to @a header . + * @param row A <tt>int</tt> representing a row in @a table . + * @param header An Atk::Table. + */ + void set_row_header(int row, const Glib::RefPtr<Atk::Object>& header); + + /** Sets the summary description of the table. + * @param accessible An Atk::Object representing the summary description + * to set for @a table . + */ + void set_summary(const Glib::RefPtr<Atk::Object>& accessible); + + + Glib::ArrayHandle<int> get_selected_columns() const; + Glib::ArrayHandle<int> get_selected_rows() const; + + + /** Gets a boolean value indicating whether the specified @a column + * is selected + * @param column A <tt>int</tt> representing a column in @a table . + * @return A <tt>bool</tt> representing if the column is selected, or 0 + * if value does not implement this interface. + */ + bool is_column_selected(int column) const; + + /** Gets a boolean value indicating whether the specified @a row + * is selected + * @param row A <tt>int</tt> representing a row in @a table . + * @return A <tt>bool</tt> representing if the row is selected, or 0 + * if value does not implement this interface. + */ + bool is_row_selected(int row) const; + + /** Gets a boolean value indicating whether the accessible object + * at the specified @a row and @a column is selected + * @param row A <tt>int</tt> representing a row in @a table . + * @param column A <tt>int</tt> representing a column in @a table . + * @return A <tt>bool</tt> representing if the cell is selected, or 0 + * if value does not implement this interface. + */ + bool is_selected(int row, int column) const; + + /** Adds the specified @a row to the selection. + * @param row A <tt>int</tt> representing a row in @a table . + * @return A <tt>bool</tt> representing if row was successfully added to selection, + * or 0 if value does not implement this interface. + */ + bool add_row_selection(int row); + + /** Removes the specified @a row from the selection. + * @param row A <tt>int</tt> representing a row in @a table . + * @return A <tt>bool</tt> representing if the row was successfully removed from + * the selection, or 0 if value does not implement this interface. + */ + bool remove_row_selection(int row); + + /** Adds the specified @a column to the selection. + * @param column A <tt>int</tt> representing a column in @a table . + * @return A <tt>bool</tt> representing if the column was successfully added to + * the selection, or 0 if value does not implement this interface. + */ + bool add_column_selection(int column); + + /** Adds the specified @a column to the selection. + * @param column A <tt>int</tt> representing a column in @a table . + * @return A <tt>bool</tt> representing if the column was successfully removed from + * the selection, or 0 if value does not implement this interface. + */ + bool remove_column_selection(int column); + + + Glib::SignalProxy2< void,int,int > signal_row_inserted(); + + + Glib::SignalProxy2< void,int,int > signal_column_inserted(); + + + Glib::SignalProxy2< void,int,int > signal_row_deleted(); + + + Glib::SignalProxy2< void,int,int > signal_column_deleted(); + + + Glib::SignalProxy0< void > signal_row_reordered(); + + + Glib::SignalProxy0< void > signal_column_reordered(); + + + Glib::SignalProxy0< void > signal_model_changed(); + + +protected: + virtual Glib::RefPtr<Atk::Object> get_at_vfunc(int row, int column); + virtual int get_index_at_vfunc(int row, int column) const; + virtual int get_column_at_index_vfunc(int index) const; + virtual int get_row_at_index_vfunc(int index) const; + virtual int get_n_columns_vfunc() const; + virtual int get_n_rows_vfunc() const; + virtual int get_column_extent_at_vfunc(int row, int column) const; + virtual int get_row_extent_at_vfunc(int row, int column) const; + virtual Glib::RefPtr<Atk::Object> get_caption_vfunc(); + virtual const char* get_column_description_vfunc(int column) const; + virtual Glib::RefPtr<Atk::Object> get_column_header_vfunc(int column); + virtual const char* get_row_description_vfunc(int row) const; + virtual Glib::RefPtr<Atk::Object> get_row_header_vfunc(int row); + virtual Glib::RefPtr<Atk::Object> get_summary_vfunc(); + virtual void set_caption_vfunc(const Glib::RefPtr<Atk::Object>& caption); + virtual void set_column_description_vfunc(int column, const char* description); + virtual void set_column_header_vfunc(int column, const Glib::RefPtr<Atk::Object>& header); + virtual void set_row_description_vfunc(int row, const char* description); + virtual void set_row_header_vfunc(int row, const Glib::RefPtr<Atk::Object>& header); + virtual void set_summary_vfunc(const Glib::RefPtr<Atk::Object>& accessible); + virtual bool is_column_selected_vfunc(int column) const; + virtual bool is_row_selected_vfunc(int row) const; + virtual bool is_selected_vfunc(int row, int column) const; + virtual bool add_row_selection_vfunc(int row); + virtual bool remove_row_selection_vfunc(int row); + virtual bool add_column_selection_vfunc(int column); + virtual bool remove_column_selection_vfunc(int column); + virtual int get_selected_columns_vfunc(int** selected) const; + virtual int get_selected_rows_vfunc(int** selected) const; + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + virtual void on_row_inserted(int row, int num_inserted); + virtual void on_column_inserted(int column, int num_inserted); + virtual void on_row_deleted(int row, int num_deleted); + virtual void on_column_deleted(int column, int num_deleted); + virtual void on_row_reordered(); + virtual void on_column_reordered(); + virtual void on_model_changed(); + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::Table + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::Table> wrap(AtkTable* object, bool take_copy = false); + +} // namespace Glib + +#endif /* _ATKMM_TABLE_H */ + diff --git a/libs/gtkmm2/atk/atkmm/text.cc b/libs/gtkmm2/atk/atkmm/text.cc new file mode 100644 index 0000000000..af101a5117 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/text.cc @@ -0,0 +1,1563 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/text.h> +#include <atkmm/private/text_p.h> + +#include <atk/atk-enum-types.h> +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atkmm/object.h> +#include <glib.h> +#include <algorithm> /* for std::swap() */ + + +// static +GType Glib::Value<Atk::TextAttribute>::value_type() +{ + return atk_text_attribute_get_type(); +} + + +namespace Atk +{ + +/**** Atk::Attribute *******************************************************/ + +Attribute::Attribute() +{ + gobject_.name = 0; + gobject_.value = 0; +} + +Attribute::Attribute(const Glib::ustring& name, const Glib::ustring& value) +{ + gobject_.name = g_strndup(name .data(), name .bytes()); + gobject_.value = g_strndup(value.data(), value.bytes()); +} + +Attribute::Attribute(const AtkAttribute* gobject) +{ + g_return_if_fail(gobject != 0); + + gobject_.name = g_strdup(gobject->name); + gobject_.value = g_strdup(gobject->value); +} + +Attribute::~Attribute() +{ + g_free(gobject_.name); + g_free(gobject_.value); +} + +Attribute::Attribute(const Attribute& other) +{ + gobject_.name = g_strdup(other.gobject_.name); + gobject_.value = g_strdup(other.gobject_.value); +} + +Attribute& Attribute::operator=(const Attribute& other) +{ + Attribute temp (other); + swap(temp); + return *this; +} + +void Attribute::swap(Attribute& other) +{ + std::swap(gobject_.name, other.gobject_.name); + std::swap(gobject_.value, other.gobject_.value); +} + + +/**** Atk::TextAttribute ***************************************************/ + +// static +TextAttribute TextAttribute::for_name(const Glib::ustring& name) +{ + return TextAttribute(int(atk_text_attribute_for_name(name.c_str()))); +} + +// static +Glib::ustring TextAttribute::get_name(TextAttribute attribute) +{ + if(const char *const name = atk_text_attribute_get_name(AtkTextAttribute(int(attribute)))) + return Glib::ustring(name); + else + return Glib::ustring(); +} + +// static +Glib::ustring TextAttribute::get_value(TextAttribute attribute, int index) +{ + if(const char *const value = atk_text_attribute_get_value(AtkTextAttribute(int(attribute)), index)) + return Glib::ustring(value); + else + return Glib::ustring(); +} + +} // namespace Atk + + +namespace +{ + +void Text_signal_text_changed_callback(AtkText* self, gint p0,gint p1,void* data) +{ + using namespace Atk; + typedef sigc::slot< void,int,int > SlotType; + + // Do not try to call a signal on a disassociated wrapper. + if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) + { + try + { + if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data)) + (*static_cast<SlotType*>(slot))(p0 +, p1 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } +} + +const Glib::SignalProxyInfo Text_signal_text_changed_info = +{ + "text_changed", + (GCallback) &Text_signal_text_changed_callback, + (GCallback) &Text_signal_text_changed_callback +}; + + +void Text_signal_text_caret_moved_callback(AtkText* self, gint p0,void* data) +{ + using namespace Atk; + typedef sigc::slot< void,int > SlotType; + + // Do not try to call a signal on a disassociated wrapper. + if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) + { + try + { + if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data)) + (*static_cast<SlotType*>(slot))(p0 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } +} + +const Glib::SignalProxyInfo Text_signal_text_caret_moved_info = +{ + "text_caret_moved", + (GCallback) &Text_signal_text_caret_moved_callback, + (GCallback) &Text_signal_text_caret_moved_callback +}; + + +const Glib::SignalProxyInfo Text_signal_text_selection_changed_info = +{ + "text_selection_changed", + (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, + (GCallback) &Glib::SignalProxyNormal::slot0_void_callback +}; + + +const Glib::SignalProxyInfo Text_signal_text_attributes_changed_info = +{ + "text_attributes_changed", + (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, + (GCallback) &Glib::SignalProxyNormal::slot0_void_callback +}; + +} // anonymous namespace + + +namespace Atk +{ + + +Glib::ustring Attribute::get_name() const +{ + return Glib::convert_const_gchar_ptr_to_ustring(gobj()->name); +} + +Glib::ustring Attribute::get_value() const +{ + return Glib::convert_const_gchar_ptr_to_ustring(gobj()->value); +} + + +} // namespace Atk + +// static +GType Glib::Value<Atk::BuiltinTextAttribute>::value_type() +{ + return atk_text_attribute_get_type(); +} + +// static +GType Glib::Value<Atk::TextBoundary>::value_type() +{ + return atk_text_boundary_get_type(); +} + +// static +GType Glib::Value<Atk::TextClipType>::value_type() +{ + return atk_text_clip_type_get_type(); +} + + +namespace Glib +{ + +Glib::RefPtr<Atk::Text> wrap(AtkText* object, bool take_copy) +{ + return Glib::RefPtr<Atk::Text>( dynamic_cast<Atk::Text*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} // namespace Glib + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Interface_Class& Text_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Interface_Class has to know the interface init function + // in order to add interfaces to implementing types. + class_init_func_ = &Text_Class::iface_init_function; + + // We can not derive from another interface, and it is not necessary anyway. + gtype_ = atk_text_get_type(); + } + + return *this; +} + +void Text_Class::iface_init_function(void* g_iface, void*) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_iface); + + //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. + //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc + g_assert(klass != 0); + + klass->get_text = &get_text_vfunc_callback; + klass->get_character_at_offset = &get_character_at_offset_vfunc_callback; + klass->get_text_after_offset = &get_text_after_offset_vfunc_callback; + klass->get_text_at_offset = &get_text_at_offset_vfunc_callback; + klass->get_text_before_offset = &get_text_before_offset_vfunc_callback; + klass->get_caret_offset = &get_caret_offset_vfunc_callback; + klass->get_character_extents = &get_character_extents_vfunc_callback; + klass->get_run_attributes = &get_run_attributes_vfunc_callback; + klass->get_default_attributes = &get_default_attributes_vfunc_callback; + klass->get_character_count = &get_character_count_vfunc_callback; + klass->get_offset_at_point = &get_offset_at_point_vfunc_callback; + klass->get_n_selections = &get_n_selections_vfunc_callback; + klass->get_selection = &get_selection_vfunc_callback; + klass->add_selection = &add_selection_vfunc_callback; + klass->remove_selection = &remove_selection_vfunc_callback; + klass->set_selection = &set_selection_vfunc_callback; + klass->set_caret_offset = &set_caret_offset_vfunc_callback; + klass->text_changed = &text_changed_callback; + klass->text_caret_moved = &text_caret_moved_callback; + klass->text_selection_changed = &text_selection_changed_callback; + klass->text_attributes_changed = &text_attributes_changed_callback; +} + +gchar* Text_Class::get_text_vfunc_callback(AtkText* self, gint start_offset, gint end_offset) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return g_strdup((obj->get_text_vfunc(start_offset +, end_offset +)).c_str()); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_text) + return (*base->get_text)(self, start_offset, end_offset); + } + + typedef gchar* RType; + return RType(); +} + +gunichar Text_Class::get_character_at_offset_vfunc_callback(AtkText* self, gint offset) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_character_at_offset_vfunc(offset +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_character_at_offset) + return (*base->get_character_at_offset)(self, offset); + } + + typedef gunichar RType; + return RType(); +} + +gchar* Text_Class::get_text_after_offset_vfunc_callback(AtkText* self, gint offset, AtkTextBoundary boundary_type, gint* start_offset, gint* end_offset) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return g_strdup((obj->get_text_after_offset_vfunc(offset +, ((TextBoundary)(boundary_type)) +, *(start_offset) +, *(end_offset) +)).c_str()); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_text_after_offset) + return (*base->get_text_after_offset)(self, offset, boundary_type, start_offset, end_offset); + } + + typedef gchar* RType; + return RType(); +} + +gchar* Text_Class::get_text_at_offset_vfunc_callback(AtkText* self, gint offset, AtkTextBoundary boundary_type, gint* start_offset, gint* end_offset) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return g_strdup((obj->get_text_at_offset_vfunc(offset +, ((TextBoundary)(boundary_type)) +, *(start_offset) +, *(end_offset) +)).c_str()); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_text_at_offset) + return (*base->get_text_at_offset)(self, offset, boundary_type, start_offset, end_offset); + } + + typedef gchar* RType; + return RType(); +} + +gchar* Text_Class::get_text_before_offset_vfunc_callback(AtkText* self, gint offset, AtkTextBoundary boundary_type, gint* start_offset, gint* end_offset) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return g_strdup((obj->get_text_before_offset_vfunc(offset +, ((TextBoundary)(boundary_type)) +, *(start_offset) +, *(end_offset) +)).c_str()); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_text_before_offset) + return (*base->get_text_before_offset)(self, offset, boundary_type, start_offset, end_offset); + } + + typedef gchar* RType; + return RType(); +} + +gint Text_Class::get_caret_offset_vfunc_callback(AtkText* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_caret_offset_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_caret_offset) + return (*base->get_caret_offset)(self); + } + + typedef gint RType; + return RType(); +} + +void Text_Class::get_character_extents_vfunc_callback(AtkText* self, gint offset, gint* x, gint* y, gint* width, gint* height, AtkCoordType coords) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->get_character_extents_vfunc(offset +, *(x) +, *(y) +, *(width) +, *(height) +, ((CoordType)(coords)) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_character_extents) + (*base->get_character_extents)(self, offset, x, y, width, height, coords); + } +} + +AtkAttributeSet* Text_Class::get_run_attributes_vfunc_callback(AtkText* self, gint offset, gint* start_offset, gint* end_offset) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_run_attributes_vfunc(offset +, *(start_offset) +, *(end_offset) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_run_attributes) + return (*base->get_run_attributes)(self, offset, start_offset, end_offset); + } + + typedef AtkAttributeSet* RType; + return RType(); +} + +AtkAttributeSet* Text_Class::get_default_attributes_vfunc_callback(AtkText* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_default_attributes_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_default_attributes) + return (*base->get_default_attributes)(self); + } + + typedef AtkAttributeSet* RType; + return RType(); +} + +gint Text_Class::get_character_count_vfunc_callback(AtkText* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_character_count_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_character_count) + return (*base->get_character_count)(self); + } + + typedef gint RType; + return RType(); +} + +gint Text_Class::get_offset_at_point_vfunc_callback(AtkText* self, gint x, gint y, AtkCoordType coords) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_offset_at_point_vfunc(x +, y +, ((CoordType)(coords)) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_offset_at_point) + return (*base->get_offset_at_point)(self, x, y, coords); + } + + typedef gint RType; + return RType(); +} + +gint Text_Class::get_n_selections_vfunc_callback(AtkText* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return obj->get_n_selections_vfunc(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_n_selections) + return (*base->get_n_selections)(self); + } + + typedef gint RType; + return RType(); +} + +gchar* Text_Class::get_selection_vfunc_callback(AtkText* self, gint selection_num, gint* start_offset, gint* end_offset) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return g_strdup((obj->get_selection_vfunc(selection_num +, *(start_offset) +, *(end_offset) +)).c_str()); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_selection) + return (*base->get_selection)(self, selection_num, start_offset, end_offset); + } + + typedef gchar* RType; + return RType(); +} + +gboolean Text_Class::add_selection_vfunc_callback(AtkText* self, gint start_offset, gint end_offset) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->add_selection_vfunc(start_offset +, end_offset +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->add_selection) + return (*base->add_selection)(self, start_offset, end_offset); + } + + typedef gboolean RType; + return RType(); +} + +gboolean Text_Class::remove_selection_vfunc_callback(AtkText* self, gint selection_num) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->remove_selection_vfunc(selection_num +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->remove_selection) + return (*base->remove_selection)(self, selection_num); + } + + typedef gboolean RType; + return RType(); +} + +gboolean Text_Class::set_selection_vfunc_callback(AtkText* self, gint selection_num, gint start_offset, gint end_offset) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->set_selection_vfunc(selection_num +, start_offset +, end_offset +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->set_selection) + return (*base->set_selection)(self, selection_num, start_offset, end_offset); + } + + typedef gboolean RType; + return RType(); +} + +gboolean Text_Class::set_caret_offset_vfunc_callback(AtkText* self, gint offset) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->set_caret_offset_vfunc(offset +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->set_caret_offset) + return (*base->set_caret_offset)(self, offset); + } + + typedef gboolean RType; + return RType(); +} + + +void Text_Class::text_changed_callback(AtkText* self, gint p0, gint p1) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_text_changed(p0 +, p1 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->text_changed) + (*base->text_changed)(self, p0, p1); + } +} + +void Text_Class::text_caret_moved_callback(AtkText* self, gint p0) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_text_caret_moved(p0 +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->text_caret_moved) + (*base->text_caret_moved)(self, p0); + } +} + +void Text_Class::text_selection_changed_callback(AtkText* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_text_selection_changed(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->text_selection_changed) + (*base->text_selection_changed)(self); + } +} + +void Text_Class::text_attributes_changed_callback(AtkText* self) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->on_text_attributes_changed(); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->text_attributes_changed) + (*base->text_attributes_changed)(self); + } +} + + +Glib::ObjectBase* Text_Class::wrap_new(GObject* object) +{ + return new Text((AtkText*)(object)); +} + + +/* The implementation: */ + +Text::Text() +: + Glib::Interface(text_class_.init()) +{} + +Text::Text(AtkText* castitem) +: + Glib::Interface((GObject*)(castitem)) +{} + +Text::~Text() +{} + +// static +void Text::add_interface(GType gtype_implementer) +{ + text_class_.init().add_interface(gtype_implementer); +} + +Text::CppClassType Text::text_class_; // initialize static member + +GType Text::get_type() +{ + return text_class_.init().get_type(); +} + +GType Text::get_base_type() +{ + return atk_text_get_type(); +} + +Glib::ustring Text::get_text(int start_offset, int end_offset) const +{ + return Glib::convert_return_gchar_ptr_to_ustring(atk_text_get_text(const_cast<AtkText*>(gobj()), start_offset, end_offset)); +} + +gunichar Text::get_character_at_offset(int offset) const +{ + return atk_text_get_character_at_offset(const_cast<AtkText*>(gobj()), offset); +} + +Glib::ustring Text::get_text_after_offset(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const +{ + return Glib::convert_return_gchar_ptr_to_ustring(atk_text_get_text_after_offset(const_cast<AtkText*>(gobj()), offset, ((AtkTextBoundary)(boundary_type)), &start_offset, &end_offset)); +} + +Glib::ustring Text::get_text_at_offset(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const +{ + return Glib::convert_return_gchar_ptr_to_ustring(atk_text_get_text_at_offset(const_cast<AtkText*>(gobj()), offset, ((AtkTextBoundary)(boundary_type)), &start_offset, &end_offset)); +} + +Glib::ustring Text::get_text_before_offset(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const +{ + return Glib::convert_return_gchar_ptr_to_ustring(atk_text_get_text_before_offset(const_cast<AtkText*>(gobj()), offset, ((AtkTextBoundary)(boundary_type)), &start_offset, &end_offset)); +} + +int Text::get_caret_offset() const +{ + return atk_text_get_caret_offset(const_cast<AtkText*>(gobj())); +} + +void Text::get_character_extents(int offset, int& x, int& y, int& width, int& height, CoordType coords) const +{ + atk_text_get_character_extents(const_cast<AtkText*>(gobj()), offset, &x, &y, &width, &height, ((AtkCoordType)(coords))); +} + +AttributeSet Text::get_run_attributes(int offset, int& start_offset, int& end_offset) const +{ + return AttributeSet(atk_text_get_run_attributes(const_cast<AtkText*>(gobj()), offset, &start_offset, &end_offset), Glib::OWNERSHIP_DEEP); +} + +AttributeSet Text::get_default_attributes() const +{ + return AttributeSet(atk_text_get_default_attributes(const_cast<AtkText*>(gobj())), Glib::OWNERSHIP_DEEP); +} + +int Text::get_character_count() const +{ + return atk_text_get_character_count(const_cast<AtkText*>(gobj())); +} + +int Text::get_offset_at_point(int x, int y, CoordType coords) const +{ + return atk_text_get_offset_at_point(const_cast<AtkText*>(gobj()), x, y, ((AtkCoordType)(coords))); +} + +int Text::get_n_selections() const +{ + return atk_text_get_n_selections(const_cast<AtkText*>(gobj())); +} + +Glib::ustring Text::get_selection(int selection_num, int& start_offset, int& end_offset) const +{ + return Glib::convert_return_gchar_ptr_to_ustring(atk_text_get_selection(const_cast<AtkText*>(gobj()), selection_num, &start_offset, &end_offset)); +} + +bool Text::add_selection(int start_offset, int end_offset) +{ + return atk_text_add_selection(gobj(), start_offset, end_offset); +} + +bool Text::remove_selection(int selection_num) +{ + return atk_text_remove_selection(gobj(), selection_num); +} + +bool Text::set_selection(int selection_num, int start_offset, int end_offset) +{ + return atk_text_set_selection(gobj(), selection_num, start_offset, end_offset); +} + +bool Text::set_caret_offset(int offset) +{ + return atk_text_set_caret_offset(gobj(), offset); +} + +void Text::get_range_extents(int start_offset, int end_offset, CoordType coord_type, Rectangle& rect) +{ + atk_text_get_range_extents(gobj(), start_offset, end_offset, ((AtkCoordType)(coord_type)), &(rect)); +} + +AtkTextRange** Text::get_bounded_ranges(const Rectangle& rect, CoordType coord_type, TextClipType x_clip_type, TextClipType y_clip_type) +{ + return atk_text_get_bounded_ranges(gobj(), const_cast<AtkTextRectangle*>(&(rect)), ((AtkCoordType)(coord_type)), ((AtkTextClipType)(x_clip_type)), ((AtkTextClipType)(y_clip_type))); +} + + +Glib::SignalProxy2< void,int,int > Text::signal_text_changed() +{ + return Glib::SignalProxy2< void,int,int >(this, &Text_signal_text_changed_info); +} + +Glib::SignalProxy1< void,int > Text::signal_text_caret_moved() +{ + return Glib::SignalProxy1< void,int >(this, &Text_signal_text_caret_moved_info); +} + +Glib::SignalProxy0< void > Text::signal_text_selection_changed() +{ + return Glib::SignalProxy0< void >(this, &Text_signal_text_selection_changed_info); +} + +Glib::SignalProxy0< void > Text::signal_text_attributes_changed() +{ + return Glib::SignalProxy0< void >(this, &Text_signal_text_attributes_changed_info); +} + + +void Atk::Text::on_text_changed(int position, int length) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->text_changed) + (*base->text_changed)(gobj(),position,length); +} + +void Atk::Text::on_text_caret_moved(int location) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->text_caret_moved) + (*base->text_caret_moved)(gobj(),location); +} + +void Atk::Text::on_text_selection_changed() +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->text_selection_changed) + (*base->text_selection_changed)(gobj()); +} + +void Atk::Text::on_text_attributes_changed() +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->text_attributes_changed) + (*base->text_attributes_changed)(gobj()); +} + + +Glib::ustring Atk::Text::get_text_vfunc(int start_offset, int end_offset) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_text) + return Glib::convert_const_gchar_ptr_to_ustring((*base->get_text)(const_cast<AtkText*>(gobj()),start_offset,end_offset)); + + typedef Glib::ustring RType; + return RType(); +} + +gunichar Atk::Text::get_character_at_offset_vfunc(int offset) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_character_at_offset) + return (*base->get_character_at_offset)(const_cast<AtkText*>(gobj()),offset); + + typedef gunichar RType; + return RType(); +} + +Glib::ustring Atk::Text::get_text_after_offset_vfunc(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_text_after_offset) + return Glib::convert_const_gchar_ptr_to_ustring((*base->get_text_after_offset)(const_cast<AtkText*>(gobj()),offset,((AtkTextBoundary)(boundary_type)),&start_offset,&end_offset)); + + typedef Glib::ustring RType; + return RType(); +} + +Glib::ustring Atk::Text::get_text_at_offset_vfunc(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_text_at_offset) + return Glib::convert_const_gchar_ptr_to_ustring((*base->get_text_at_offset)(const_cast<AtkText*>(gobj()),offset,((AtkTextBoundary)(boundary_type)),&start_offset,&end_offset)); + + typedef Glib::ustring RType; + return RType(); +} + +Glib::ustring Atk::Text::get_text_before_offset_vfunc(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_text_before_offset) + return Glib::convert_const_gchar_ptr_to_ustring((*base->get_text_before_offset)(const_cast<AtkText*>(gobj()),offset,((AtkTextBoundary)(boundary_type)),&start_offset,&end_offset)); + + typedef Glib::ustring RType; + return RType(); +} + +int Atk::Text::get_caret_offset_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_caret_offset) + return (*base->get_caret_offset)(const_cast<AtkText*>(gobj())); + + typedef int RType; + return RType(); +} + +void Atk::Text::get_character_extents_vfunc(int offset, int& x, int& y, int& width, int& height, CoordType coords) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_character_extents) + (*base->get_character_extents)(const_cast<AtkText*>(gobj()),offset,&x,&y,&width,&height,((AtkCoordType)(coords))); +} + +AtkAttributeSet* Atk::Text::get_run_attributes_vfunc(int offset, int& start_offset, int& end_offset) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_run_attributes) + return (*base->get_run_attributes)(const_cast<AtkText*>(gobj()),offset,&start_offset,&end_offset); + + typedef AtkAttributeSet* RType; + return RType(); +} + +AtkAttributeSet* Atk::Text::get_default_attributes_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_default_attributes) + return (*base->get_default_attributes)(const_cast<AtkText*>(gobj())); + + typedef AtkAttributeSet* RType; + return RType(); +} + +int Atk::Text::get_character_count_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_character_count) + return (*base->get_character_count)(const_cast<AtkText*>(gobj())); + + typedef int RType; + return RType(); +} + +int Atk::Text::get_offset_at_point_vfunc(int x, int y, CoordType coords) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_offset_at_point) + return (*base->get_offset_at_point)(const_cast<AtkText*>(gobj()),x,y,((AtkCoordType)(coords))); + + typedef int RType; + return RType(); +} + +int Atk::Text::get_n_selections_vfunc() const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_n_selections) + return (*base->get_n_selections)(const_cast<AtkText*>(gobj())); + + typedef int RType; + return RType(); +} + +Glib::ustring Atk::Text::get_selection_vfunc(int selection_num, int& start_offset, int& end_offset) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_selection) + return Glib::convert_const_gchar_ptr_to_ustring((*base->get_selection)(const_cast<AtkText*>(gobj()),selection_num,&start_offset,&end_offset)); + + typedef Glib::ustring RType; + return RType(); +} + +bool Atk::Text::add_selection_vfunc(int start_offset, int end_offset) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->add_selection) + return (*base->add_selection)(gobj(),start_offset,end_offset); + + typedef bool RType; + return RType(); +} + +bool Atk::Text::remove_selection_vfunc(int selection_num) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->remove_selection) + return (*base->remove_selection)(gobj(),selection_num); + + typedef bool RType; + return RType(); +} + +bool Atk::Text::set_selection_vfunc(int selection_num, int start_offset, int end_offset) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->set_selection) + return (*base->set_selection)(gobj(),selection_num,start_offset,end_offset); + + typedef bool RType; + return RType(); +} + +bool Atk::Text::set_caret_offset_vfunc(int offset) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->set_caret_offset) + return (*base->set_caret_offset)(gobj(),offset); + + typedef bool RType; + return RType(); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/text.h b/libs/gtkmm2/atk/atkmm/text.h new file mode 100644 index 0000000000..86dee7ee39 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/text.h @@ -0,0 +1,687 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_TEXT_H +#define _ATKMM_TEXT_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#include <atkmm/component.h> /* for Atk::CoordType */ +#include <atk/atktext.h> + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkText AtkText; +typedef struct _AtkTextClass AtkTextClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class Text_Class; } // namespace Atk +namespace Atk +{ + +class Attribute +{ + public: +#ifndef DOXYGEN_SHOULD_SKIP_THIS + typedef Attribute CppObjectType; + typedef AtkAttribute BaseObjectType; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +private: + + +public: + Attribute(); + Attribute(const Glib::ustring& name, const Glib::ustring& value); + explicit Attribute(const AtkAttribute* gobject); + ~Attribute(); + + Attribute(const Attribute& other); + Attribute& operator=(const Attribute& other); + + void swap(Attribute& other); + + Glib::ustring get_name() const; + Glib::ustring get_value() const; + + /// Provides access to the underlying C GObject. + AtkAttribute* gobj() { return &gobject_; } + + /// Provides access to the underlying C GObject. + const AtkAttribute* gobj() const { return &gobject_; } + +protected: + AtkAttribute gobject_; + + +}; + +/** @relates Atk::Attribute */ +inline void swap(Attribute& lhs, Attribute& rhs) + { lhs.swap(rhs); } + +struct AttributeTraits +{ + typedef Atk::Attribute CppType; + typedef const AtkAttribute* CType; + typedef AtkAttribute* CTypeNonConst; + + static CType to_c_type(CType item) { return item; } + static CType to_c_type(const CppType& item) { return item.gobj(); } + static CppType to_cpp_type(CType item) { return CppType(item); } + static void release_c_type(CType item) { g_free(const_cast<CTypeNonConst>(item)); } +}; + +typedef Glib::SListHandle<Attribute, AttributeTraits> AttributeSet; + + +/** @addtogroup atkmmEnums Enums and Flags */ + +/** + * @ingroup atkmmEnums + */ +enum BuiltinTextAttribute +{ + TEXT_ATTR_INVALID, + TEXT_ATTR_LEFT_MARGIN, + TEXT_ATTR_RIGHT_MARGIN, + TEXT_ATTR_INDENT, + TEXT_ATTR_INVISIBLE, + TEXT_ATTR_EDITABLE, + TEXT_ATTR_PIXELS_ABOVE_LINES, + TEXT_ATTR_PIXELS_BELOW_LINES, + TEXT_ATTR_PIXELS_INSIDE_WRAP, + TEXT_ATTR_BG_FULL_HEIGHT, + TEXT_ATTR_RISE, + TEXT_ATTR_UNDERLINE, + TEXT_ATTR_STRIKETHROUGH, + TEXT_ATTR_SIZE, + TEXT_ATTR_SCALE, + TEXT_ATTR_WEIGHT, + TEXT_ATTR_LANGUAGE, + TEXT_ATTR_FAMILY_NAME, + TEXT_ATTR_BG_COLOR, + TEXT_ATTR_FG_COLOR, + TEXT_ATTR_BG_STIPPLE, + TEXT_ATTR_FG_STIPPLE, + TEXT_ATTR_WRAP_MODE, + TEXT_ATTR_DIRECTION, + TEXT_ATTR_JUSTIFICATION, + TEXT_ATTR_STRETCH, + TEXT_ATTR_VARIANT, + TEXT_ATTR_STYLE, + TEXT_ATTR_LAST_DEFINED +}; + +} // namespace Atk + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +namespace Glib +{ + +template <> +class Value<Atk::BuiltinTextAttribute> : public Glib::Value_Enum<Atk::BuiltinTextAttribute> +{ +public: + static GType value_type() G_GNUC_CONST; +}; + +} // namespace Glib +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ + + +class TextAttribute +{ +private: + int attribute_; + +public: + TextAttribute() : attribute_ (0) {} + TextAttribute(BuiltinTextAttribute attribute) : attribute_ (attribute) {} + + // Behave like an ordinary enum. + explicit TextAttribute(int attribute) : attribute_ (attribute) {} + operator int() const { return attribute_; } + + static TextAttribute for_name(const Glib::ustring& name); + static Glib::ustring get_name(TextAttribute attribute); + static Glib::ustring get_value(TextAttribute attribute, int index); +}; + +} // namespace Atk + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +namespace Glib +{ + +template <> +class Value<Atk::TextAttribute> : public Glib::Value_Enum<Atk::TextAttribute> +{ +public: + static GType value_type() G_GNUC_CONST; +}; + +} // namespace Glib +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +namespace Atk +{ + +/** + * @ingroup atkmmEnums + */ +enum TextBoundary +{ + TEXT_BOUNDARY_CHAR, + TEXT_BOUNDARY_WORD_START, + TEXT_BOUNDARY_WORD_END, + TEXT_BOUNDARY_SENTENCE_START, + TEXT_BOUNDARY_SENTENCE_END, + TEXT_BOUNDARY_LINE_START, + TEXT_BOUNDARY_LINE_END +}; + +} // namespace Atk + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +namespace Glib +{ + +template <> +class Value<Atk::TextBoundary> : public Glib::Value_Enum<Atk::TextBoundary> +{ +public: + static GType value_type() G_GNUC_CONST; +}; + +} // namespace Glib +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ + +/** + * @ingroup atkmmEnums + */ +enum TextClipType +{ + TEXT_CLIP_NONE, + TEXT_CLIP_MIN, + TEXT_CLIP_MAX, + TEXT_CLIP_BOTH +}; + +} // namespace Atk + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +namespace Glib +{ + +template <> +class Value<Atk::TextClipType> : public Glib::Value_Enum<Atk::TextClipType> +{ +public: + static GType value_type() G_GNUC_CONST; +}; + +} // namespace Glib +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ + + +/** The ATK interface implemented by components with text content. + * This should be implemented by Atk::Objects on behalf of widgets that have text content which is either attributed + * or otherwise non-trivial. Atk::Objects whose text content is simple, unattributed, and very brief may expose that + * content via Atk::Object::get_name() instead; however if the text is editable, multi-line, typically longer than + * three or four words, attributed, selectable, or if the object already uses the 'name' ATK property for other + * information, this Text interface should be used to expose the text content. In the case of editable text content, + * Atk::EditableText (a subtype of the Atk::Text interface) should be implemented instead. + * + * Atk::Text provides not only traversal facilities and change notification for text content, but also caret tracking + * and glyph bounding box calculations. Note that the text strings are exposed as UTF-8, and are therefore potentially + * multi-byte, and caret-to-byte offset mapping makes no assumptions about the character length; also bounding box + * glyph-to-offset mapping may be complex for languages which use ligatures. + */ + +class Text : public Glib::Interface +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef Text CppObjectType; + typedef Text_Class CppClassType; + typedef AtkText BaseObjectType; + typedef AtkTextIface BaseClassType; + +private: + friend class Text_Class; + static CppClassType text_class_; + + // noncopyable + Text(const Text&); + Text& operator=(const Text&); + +protected: + Text(); // you must derive from this class + explicit Text(AtkText* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~Text(); + + static void add_interface(GType gtype_implementer); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkText* gobj() { return reinterpret_cast<AtkText*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkText* gobj() const { return reinterpret_cast<AtkText*>(gobject_); } + +private: + + +public: + + /** Gets the specified text. + * @param start_offset Start position. + * @param end_offset End position. + * @return The text from @a start_offset up to, but not including @a end_offset . + */ + Glib::ustring get_text(int start_offset, int end_offset) const; + + /** Gets the specified text. + * @param offset Position. + * @return The character at @a offset . + */ + gunichar get_character_at_offset(int offset) const; + + /** Gets the specified text. + * + * If the boundary_type if ATK_TEXT_BOUNDARY_CHAR the character after the + * offset is returned. + * + * If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned string + * is from the word start after the offset to the next word start. + * + * The returned string will contain the word after the offset if the offset + * is inside a word or if the offset is not inside a word. + * + * If the boundary_type is ATK_TEXT_BOUNDARY_WORD_END the returned string + * is from the word end at or after the offset to the next work end. + * + * The returned string will contain the word after the offset if the offset + * is inside a word and will contain the word after the word after the offset + * if the offset is not inside a word. + * + * If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the returned + * string is from the sentence start after the offset to the next sentence + * start. + * + * The returned string will contain the sentence after the offset if the offset + * is inside a sentence or if the offset is not inside a sentence. + * + * If the boundary_type is ATK_TEXT_BOUNDARY_SENTENCE_END the returned string + * is from the sentence end at or after the offset to the next sentence end. + * + * The returned string will contain the sentence after the offset if the offset + * is inside a sentence and will contain the sentence after the sentence + * after the offset if the offset is not inside a sentence. + * + * If the boundary type is ATK_TEXT_BOUNDARY_LINE_START the returned + * string is from the line start after the offset to the next line start. + * + * If the boundary_type is ATK_TEXT_BOUNDARY_LINE_END the returned string + * is from the line end at or after the offset to the next line start. + * @param offset Position. + * @param boundary_type An Atk::TextBoundary. + * @param start_offset The start offset of the returned string. + * @param end_offset The end offset of the returned string. + * @return The text after @a offset bounded by the specified @a boundary_type . + */ + Glib::ustring get_text_after_offset(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const; + + /** Gets the specified text. + * + * If the boundary_type if ATK_TEXT_BOUNDARY_CHAR the character at the + * offset is returned. + * + * If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned string + * is from the word start at or before the offset to the word start after + * the offset. + * + * The returned string will contain the word at the offset if the offset + * is inside a word and will contain the word before the offset if the + * offset is not inside a word. + * + * If the boundary_type is ATK_TEXT_BOUNDARY_WORD_END the returned string + * is from the word end before the offset to the word end at or after the + * offset. + * + * The returned string will contain the word at the offset if the offset + * is inside a word and will contain the word after to the offset if the + * offset is not inside a word. + * + * If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the returned + * string is from the sentence start at or before the offset to the sentence + * start after the offset. + * + * The returned string will contain the sentence at the offset if the offset + * is inside a sentence and will contain the sentence before the offset + * if the offset is not inside a sentence. + * + * If the boundary_type is ATK_TEXT_BOUNDARY_SENTENCE_END the returned string + * is from the sentence end before the offset to the sentence end at or + * after the offset. + * + * The returned string will contain the sentence at the offset if the offset + * is inside a sentence and will contain the sentence after the offset + * if the offset is not inside a sentence. + * + * If the boundary type is ATK_TEXT_BOUNDARY_LINE_START the returned + * string is from the line start at or before the offset to the line + * start after the offset. + * + * If the boundary_type is ATK_TEXT_BOUNDARY_LINE_END the returned string + * is from the line end before the offset to the line end at or after + * the offset. + * @param offset Position. + * @param boundary_type An Atk::TextBoundary. + * @param start_offset The start offset of the returned string. + * @param end_offset The end offset of the returned string. + * @return The text at @a offset bounded by the specified @a boundary_type . + */ + Glib::ustring get_text_at_offset(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const; + + /** Gets the specified text. + * + * If the boundary_type if ATK_TEXT_BOUNDARY_CHAR the character before the + * offset is returned. + * + * If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned string + * is from the word start before the word start before the offset to + * the word start before the offset. + * + * The returned string will contain the word before the offset if the offset + * is inside a word and will contain the word before the word before the + * offset if the offset is not inside a word. + * + * If the boundary_type is ATK_TEXT_BOUNDARY_WORD_END the returned string + * is from the word end before the word end at or before the offset to the + * word end at or before the offset. + * + * The returned string will contain the word before the offset if the offset + * is inside a word or if the offset is not inside a word. + * + * If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the returned + * string is from the sentence start before the sentence start before + * the offset to the sentence start before the offset. + * + * The returned string will contain the sentence before the offset if the + * offset is inside a sentence and will contain the sentence before the + * sentence before the offset if the offset is not inside a sentence. + * + * If the boundary_type is ATK_TEXT_BOUNDARY_SENTENCE_END the returned string + * is from the sentence end before the sentence end at or before the offset to + * the sentence end at or before the offset. + * + * The returned string will contain the sentence before the offset if the + * offset is inside a sentence or if the offset is not inside a sentence. + * + * If the boundary type is ATK_TEXT_BOUNDARY_LINE_START the returned + * string is from the line start before the line start ar or before the offset + * to the line start ar or before the offset. + * + * If the boundary_type is ATK_TEXT_BOUNDARY_LINE_END the returned string + * is from the line end before the line end before the offset to the + * line end before the offset. + * @param offset Position. + * @param boundary_type An Atk::TextBoundary. + * @param start_offset The start offset of the returned string. + * @param end_offset The end offset of the returned string. + * @return The text before @a offset bounded by the specified @a boundary_type . + */ + Glib::ustring get_text_before_offset(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const; + + /** Gets the offset position of the caret (cursor). + * @return The offset position of the caret (cursor). + */ + int get_caret_offset() const; + + /** Get the bounding box containing the glyph representing the character at + * a particular text offset. + * @param offset The offset of the text character for which bounding information is required. + * @param x Pointer for the x cordinate of the bounding box. + * @param y Pointer for the y cordinate of the bounding box. + * @param width Pointer for the width of the bounding box. + * @param height Pointer for the height of the bounding box. + * @param coords Specify whether coordinates are relative to the screen or widget window. + */ + void get_character_extents(int offset, int& x, int& y, int& width, int& height, CoordType coords) const; + + /** Creates an Atk::AttributeSet which consists of the attributes explicitly + * set at the position @a offset in the text. @a start_offset and @a end_offset are + * set to the start and end of the range around @a offset where the attributes are + * invariant. See the enum AtkTextAttribute for types of text attributes that + * can be returned. Note that other attributes may also be returned. + * @param offset The offset at which to get the attributes. + * @param start_offset The address to put the start offset of the range. + * @param end_offset The address to put the end offset of the range. + * @return An Atk::AttributeSet which contains the attributes explicitly set + * at @a offset . + */ + AttributeSet get_run_attributes(int offset, int& start_offset, int& end_offset) const; + + /** Creates an Atk::AttributeSet which consists of the default values of + * attributes for the text. See the enum AtkTextAttribute for types of text + * attributes that can be returned. Note that other attributes may also be + * returned. + * @return An Atk::AttributeSet which contains the default values of attributes. + * at @a offset . + */ + AttributeSet get_default_attributes() const; + + /** Gets the character count. + * @return The number of characters. + */ + int get_character_count() const; + + /** Gets the offset of the character located at coordinates @a x and @a y . @a x and @a y + * are interpreted as being relative to the screen or this widget's window + * depending on @a coords . + * @param x Screen x-position of character. + * @param y Screen y-position of character. + * @param coords Specify whether coordinates are relative to the screen or + * widget window. + * @return The offset to the character which is located at + * the specified @a x and @a y coordinates. + */ + int get_offset_at_point(int x, int y, CoordType coords) const; + + /** Gets the number of selected regions. + * @return The number of selected regions, or -1 if a failure + * occurred. + */ + int get_n_selections() const; + + /** Gets the text from the specified selection. + * @param selection_num The selection number. The selected regions are + * assigned numbers that correspond to how far the region is from the + * start of the text. The selected region closest to the beginning + * of the text region is assigned the number 0, etc. Note that adding, + * moving or deleting a selected region can change the numbering. + * @param start_offset Passes back the start position of the selected region. + * @param end_offset Passes back the end position of the selected region. + * @return The selected text. + */ + Glib::ustring get_selection(int selection_num, int& start_offset, int& end_offset) const; + + /** Adds a selection bounded by the specified offsets. + * @param start_offset The start position of the selected region. + * @param end_offset The end position of the selected region. + * @return <tt>true</tt> if success, <tt>false</tt> otherwise. + */ + bool add_selection(int start_offset, int end_offset); + + /** Removes the specified selection. + * @param selection_num The selection number. The selected regions are + * assigned numbers that correspond to how far the region is from the + * start of the text. The selected region closest to the beginning + * of the text region is assigned the number 0, etc. Note that adding, + * moving or deleting a selected region can change the numbering. + * @return <tt>true</tt> if success, <tt>false</tt> otherwise. + */ + bool remove_selection(int selection_num); + + /** Changes the start and end offset of the specified selection. + * @param selection_num The selection number. The selected regions are + * assigned numbers that correspond to how far the region is from the + * start of the text. The selected region closest to the beginning + * of the text region is assigned the number 0, etc. Note that adding, + * moving or deleting a selected region can change the numbering. + * @param start_offset The new start position of the selection. + * @param end_offset The new end position of the selection. + * @return <tt>true</tt> if success, <tt>false</tt> otherwise. + */ + bool set_selection(int selection_num, int start_offset, int end_offset); + + /** Sets the caret (cursor) position to the specified @a offset . + * @param offset Position. + * @return <tt>true</tt> if success, <tt>false</tt> otherwise. + */ + bool set_caret_offset(int offset); + + typedef AtkTextRectangle Rectangle; + + + /** Get the bounding box for text within the specified range. + * @param start_offset The offset of the first text character for which boundary + * information is required. + * @param end_offset The offset of the text character after the last character + * for which boundary information is required. + * @param coord_type Specify whether coordinates are relative to the screen or widget window. + * @param rect A pointer to a AtkTextRectangle which is filled in by this function. + */ + void get_range_extents(int start_offset, int end_offset, + CoordType coord_type, + Rectangle& rect); + + /** Get the ranges of text in the specified bounding box. + * @param rect An AtkTextRectagle giving the dimensions of the bounding box. + * @param coord_type Specify whether coordinates are relative to the screen or widget window. + * @param x_clip_type Specify the horizontal clip type. + * @param y_clip_type Specify the vertical clip type. + * @return Array of AtkTextRange. The last element of the array returned + * by this function will be <tt>0</tt>. + */ + AtkTextRange** get_bounded_ranges(const Rectangle& rect, CoordType coord_type, + TextClipType x_clip_type, TextClipType y_clip_type); + + + Glib::SignalProxy2< void,int,int > signal_text_changed(); + + + Glib::SignalProxy1< void,int > signal_text_caret_moved(); + + + Glib::SignalProxy0< void > signal_text_selection_changed(); + + + Glib::SignalProxy0< void > signal_text_attributes_changed(); + + +protected: + + + virtual Glib::ustring get_text_vfunc(int start_offset, int end_offset) const; + virtual gunichar get_character_at_offset_vfunc(int offset) const; + virtual Glib::ustring get_text_after_offset_vfunc(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const; + virtual Glib::ustring get_text_at_offset_vfunc(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const; + virtual Glib::ustring get_text_before_offset_vfunc(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const; + virtual int get_caret_offset_vfunc() const; + virtual void get_character_extents_vfunc(int offset, int& x, int& y, int& width, int& height, CoordType coords) const; + virtual AtkAttributeSet* get_run_attributes_vfunc(int offset, int& start_offset, int& end_offset) const; + virtual AtkAttributeSet* get_default_attributes_vfunc() const; + virtual int get_character_count_vfunc() const; + virtual int get_offset_at_point_vfunc(int x, int y, CoordType coords) const; + virtual int get_n_selections_vfunc() const; + virtual Glib::ustring get_selection_vfunc(int selection_num, int& start_offset, int& end_offset) const; + virtual bool add_selection_vfunc(int start_offset, int end_offset); + virtual bool remove_selection_vfunc(int selection_num); + virtual bool set_selection_vfunc(int selection_num, int start_offset, int end_offset); + virtual bool set_caret_offset_vfunc(int offset); + + //TODO: Add get_range_extents(), and get_bounded_ranges() vfuncs when we can break ABI. + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + virtual void on_text_changed(int position, int length); + virtual void on_text_caret_moved(int location); + virtual void on_text_selection_changed(); + virtual void on_text_attributes_changed(); + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::Text + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::Text> wrap(AtkText* object, bool take_copy = false); + +} // namespace Glib + +#endif /* _ATKMM_TEXT_H */ + diff --git a/libs/gtkmm2/atk/atkmm/value.cc b/libs/gtkmm2/atk/atkmm/value.cc new file mode 100644 index 0000000000..eeff7dfd2f --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/value.cc @@ -0,0 +1,340 @@ +// Generated by gtkmmproc -- DO NOT MODIFY! + +#include <atkmm/value.h> +#include <atkmm/private/value_p.h> + +// -*- c++ -*- +/* $Id$ */ + +/* Copyright 1998-2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <atk/atkvalue.h> + + +namespace +{ +} // anonymous namespace + + +namespace Glib +{ + +Glib::RefPtr<Atk::Value> wrap(AtkValue* object, bool take_copy) +{ + return Glib::RefPtr<Atk::Value>( dynamic_cast<Atk::Value*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); + //We use dynamic_cast<> in case of multiple inheritance. +} + +} // namespace Glib + + +namespace Atk +{ + + +/* The *_Class implementation: */ + +const Glib::Interface_Class& Value_Class::init() +{ + if(!gtype_) // create the GType if necessary + { + // Glib::Interface_Class has to know the interface init function + // in order to add interfaces to implementing types. + class_init_func_ = &Value_Class::iface_init_function; + + // We can not derive from another interface, and it is not necessary anyway. + gtype_ = atk_value_get_type(); + } + + return *this; +} + +void Value_Class::iface_init_function(void* g_iface, void*) +{ + BaseClassType *const klass = static_cast<BaseClassType*>(g_iface); + + //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. + //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc + g_assert(klass != 0); + + klass->get_current_value = &get_current_value_vfunc_callback; + klass->get_maximum_value = &get_maximum_value_vfunc_callback; + klass->get_minimum_value = &get_minimum_value_vfunc_callback; + klass->set_current_value = &set_current_value_vfunc_callback; +} + +void Value_Class::get_current_value_vfunc_callback(AtkValue* self, GValue* value) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->get_current_value_vfunc(*reinterpret_cast<Glib::ValueBase*>(value) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_current_value) + (*base->get_current_value)(self, value); + } +} + +void Value_Class::get_maximum_value_vfunc_callback(AtkValue* self, GValue* value) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->get_maximum_value_vfunc(*reinterpret_cast<Glib::ValueBase*>(value) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_maximum_value) + (*base->get_maximum_value)(self, value); + } +} + +void Value_Class::get_minimum_value_vfunc_callback(AtkValue* self, GValue* value) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + obj->get_minimum_value_vfunc(*reinterpret_cast<Glib::ValueBase*>(value) +); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->get_minimum_value) + (*base->get_minimum_value)(self, value); + } +} + +gboolean Value_Class::set_current_value_vfunc_callback(AtkValue* self, const GValue* value) +{ + CppObjectType *const obj = dynamic_cast<CppObjectType*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj && obj->is_derived_()) + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + return static_cast<int>(obj->set_current_value_vfunc(*reinterpret_cast<const Glib::ValueBase*>(value) +)); + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + else + { + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. +) ); + + // Call the original underlying C function: + if(base && base->set_current_value) + return (*base->set_current_value)(self, value); + } + + typedef gboolean RType; + return RType(); +} + + +Glib::ObjectBase* Value_Class::wrap_new(GObject* object) +{ + return new Value((AtkValue*)(object)); +} + + +/* The implementation: */ + +Value::Value() +: + Glib::Interface(value_class_.init()) +{} + +Value::Value(AtkValue* castitem) +: + Glib::Interface((GObject*)(castitem)) +{} + +Value::~Value() +{} + +// static +void Value::add_interface(GType gtype_implementer) +{ + value_class_.init().add_interface(gtype_implementer); +} + +Value::CppClassType Value::value_class_; // initialize static member + +GType Value::get_type() +{ + return value_class_.init().get_type(); +} + +GType Value::get_base_type() +{ + return atk_value_get_type(); +} + + +void Value::get_current_value(Glib::ValueBase& value) const +{ + atk_value_get_current_value(const_cast<AtkValue*>(gobj()), (value).gobj()); +} + +void Value::get_maximum_value(Glib::ValueBase& value) const +{ + atk_value_get_maximum_value(const_cast<AtkValue*>(gobj()), (value).gobj()); +} + +void Value::get_minimum_value(Glib::ValueBase& value) const +{ + atk_value_get_minimum_value(const_cast<AtkValue*>(gobj()), (value).gobj()); +} + +bool Value::set_current_value(const Glib::ValueBase& value) +{ + return atk_value_set_current_value(gobj(), (value).gobj()); +} + + +void Atk::Value::get_current_value_vfunc(Glib::ValueBase& value) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_current_value) + (*base->get_current_value)(const_cast<AtkValue*>(gobj()),(value).gobj()); +} + +void Atk::Value::get_maximum_value_vfunc(Glib::ValueBase& value) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_maximum_value) + (*base->get_maximum_value)(const_cast<AtkValue*>(gobj()),(value).gobj()); +} + +void Atk::Value::get_minimum_value_vfunc(Glib::ValueBase& value) const +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->get_minimum_value) + (*base->get_minimum_value)(const_cast<AtkValue*>(gobj()),(value).gobj()); +} + +bool Atk::Value::set_current_value_vfunc(const Glib::ValueBase& value) +{ + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). +g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. +) ); + + if(base && base->set_current_value) + return (*base->set_current_value)(gobj(),(value).gobj()); + + typedef bool RType; + return RType(); +} + + +} // namespace Atk + + diff --git a/libs/gtkmm2/atk/atkmm/value.h b/libs/gtkmm2/atk/atkmm/value.h new file mode 100644 index 0000000000..25615dd92e --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/value.h @@ -0,0 +1,157 @@ +// -*- c++ -*- +// Generated by gtkmmproc -- DO NOT MODIFY! +#ifndef _ATKMM_VALUE_H +#define _ATKMM_VALUE_H + +#include <glibmm.h> + +/* $Id$ */ + +/* Copyright (C) 2002 The gtkmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +extern "C" +{ + typedef struct _AtkValueIface AtkValueIface; + typedef struct _AtkValue AtkValue; +} +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _AtkValue AtkValue; +typedef struct _AtkValueClass AtkValueClass; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + +namespace Atk +{ class Value_Class; } // namespace Atk +namespace Atk +{ + +/** The ATK interface implemented by valuators and components which display or select a value from a bounded range of values. + * This should be implemented for components which either display a value from a bounded range, or which allow the user + * to specify a value from a bounded range, or both. For instance, most sliders and range controls, as well as dials, + * should have Atk::Object representations which implement Atk::Value on the component's behalf. Atk::Values may be + * read-only, in which case attempts to alter the value return false to indicate failure. + */ + +class Value : public Glib::Interface +{ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +public: + typedef Value CppObjectType; + typedef Value_Class CppClassType; + typedef AtkValue BaseObjectType; + typedef AtkValueIface BaseClassType; + +private: + friend class Value_Class; + static CppClassType value_class_; + + // noncopyable + Value(const Value&); + Value& operator=(const Value&); + +protected: + Value(); // you must derive from this class + explicit Value(AtkValue* castitem); + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +public: + virtual ~Value(); + + static void add_interface(GType gtype_implementer); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static GType get_type() G_GNUC_CONST; + static GType get_base_type() G_GNUC_CONST; +#endif + + ///Provides access to the underlying C GObject. + AtkValue* gobj() { return reinterpret_cast<AtkValue*>(gobject_); } + + ///Provides access to the underlying C GObject. + const AtkValue* gobj() const { return reinterpret_cast<AtkValue*>(gobject_); } + +private: + + +public: + + /** Gets the value of this object. + * @param value A G::Value representing the current accessible value. + */ + void get_current_value(Glib::ValueBase& value) const; + + /** Gets the maximum value of this object. + * @param value A G::Value representing the maximum accessible value. + */ + void get_maximum_value(Glib::ValueBase& value) const; + + /** Gets the minimum value of this object. + * @param value A G::Value representing the minimum accessible value. + */ + void get_minimum_value(Glib::ValueBase& value) const; + + /** Sets the value of this object. + * @param value A G::Value which is the desired new accessible value. + * @return <tt>true</tt> if new value is successfully set, <tt>false</tt> otherwise. + */ + bool set_current_value(const Glib::ValueBase& value); + +protected: + virtual void get_current_value_vfunc(Glib::ValueBase& value) const; + virtual void get_maximum_value_vfunc(Glib::ValueBase& value) const; + virtual void get_minimum_value_vfunc(Glib::ValueBase& value) const; + virtual bool set_current_value_vfunc(const Glib::ValueBase& value); + + +public: + +public: + //C++ methods used to invoke GTK+ virtual functions: + +protected: + //GTK+ Virtual Functions (override these to change behaviour): + + //Default Signal Handlers:: + + +}; + +} // namespace Atk + + +namespace Glib +{ + /** @relates Atk::Value + * @param object The C instance + * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. + * @result A C++ instance that wraps this C instance. + */ + Glib::RefPtr<Atk::Value> wrap(AtkValue* object, bool take_copy = false); + +} // namespace Glib + +#endif /* _ATKMM_VALUE_H */ + diff --git a/libs/gtkmm2/atk/atkmm/wrap_init.cc b/libs/gtkmm2/atk/atkmm/wrap_init.cc new file mode 100644 index 0000000000..1c72a15488 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/wrap_init.cc @@ -0,0 +1,91 @@ + +#include <glib.h> + +// Disable the 'const' function attribute of the get_type() functions. +// GCC would optimize them out because we don't use the return value. +#undef G_GNUC_CONST +#define G_GNUC_CONST /* empty */ + +#include <atkmm/wrap_init.h> +#include <glibmm/error.h> +#include <glibmm/object.h> + +// #include the widget headers so that we can call the get_type() static methods: + +#include "action.h" +#include "component.h" +#include "document.h" +#include "editabletext.h" +#include "hyperlink.h" +#include "hypertext.h" +#include "image.h" +#include "implementor.h" +#include "noopobject.h" +#include "object.h" +#include "objectaccessible.h" +#include "relation.h" +#include "relationset.h" +#include "selection.h" +#include "stateset.h" +#include "streamablecontent.h" +#include "table.h" +#include "text.h" +#include "value.h" + +extern "C" +{ + +//Declarations of the *_get_type() functions: + +GType atk_hyperlink_get_type(void); +GType atk_no_op_object_get_type(void); +GType atk_object_get_type(void); +GType atk_gobject_accessible_get_type(void); +GType atk_relation_get_type(void); +GType atk_relation_set_get_type(void); +GType atk_state_set_get_type(void); + +//Declarations of the *_error_quark() functions: + +} // extern "C" + + +//Declarations of the *_Class::wrap_new() methods, instead of including all the private headers: + +namespace Atk { class Hyperlink_Class { public: static Glib::ObjectBase* wrap_new(GObject*); }; } +namespace Atk { class NoOpObject_Class { public: static Glib::ObjectBase* wrap_new(GObject*); }; } +namespace Atk { class Object_Class { public: static Glib::ObjectBase* wrap_new(GObject*); }; } +namespace Atk { class ObjectAccessible_Class { public: static Glib::ObjectBase* wrap_new(GObject*); }; } +namespace Atk { class Relation_Class { public: static Glib::ObjectBase* wrap_new(GObject*); }; } +namespace Atk { class RelationSet_Class { public: static Glib::ObjectBase* wrap_new(GObject*); }; } +namespace Atk { class StateSet_Class { public: static Glib::ObjectBase* wrap_new(GObject*); }; } + +namespace Atk { + +void wrap_init() +{ + // Register Error domains: + +// Map gtypes to gtkmm wrapper-creation functions: + Glib::wrap_register(atk_hyperlink_get_type(), &Atk::Hyperlink_Class::wrap_new); + Glib::wrap_register(atk_no_op_object_get_type(), &Atk::NoOpObject_Class::wrap_new); + Glib::wrap_register(atk_object_get_type(), &Atk::Object_Class::wrap_new); + Glib::wrap_register(atk_gobject_accessible_get_type(), &Atk::ObjectAccessible_Class::wrap_new); + Glib::wrap_register(atk_relation_get_type(), &Atk::Relation_Class::wrap_new); + Glib::wrap_register(atk_relation_set_get_type(), &Atk::RelationSet_Class::wrap_new); + Glib::wrap_register(atk_state_set_get_type(), &Atk::StateSet_Class::wrap_new); + + // Register the gtkmm gtypes: + Atk::Hyperlink::get_type(); + Atk::NoOpObject::get_type(); + Atk::Object::get_type(); + Atk::ObjectAccessible::get_type(); + Atk::Relation::get_type(); + Atk::RelationSet::get_type(); + Atk::StateSet::get_type(); + +} // wrap_init() + +} //Atk + + diff --git a/libs/gtkmm2/atk/atkmm/wrap_init.h b/libs/gtkmm2/atk/atkmm/wrap_init.h new file mode 100644 index 0000000000..2015280680 --- /dev/null +++ b/libs/gtkmm2/atk/atkmm/wrap_init.h @@ -0,0 +1,32 @@ +#ifndef _ATKMM_WRAP_INIT_H +#define _ATKMM_WRAP_INIT_H + +/* wrap_init.h + * + * Copyright (C) 1998-2001 The Gtk-- Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +// wrap_init.cc is generated by tools/generate_wrap_init.pl + +namespace Atk +{ + +void wrap_init(); + +} /* namespace Atk */ + +#endif // _ATKMM_WRAP_INIT_H |