2005-05-13 16:47:18 -04:00
|
|
|
// Generated by gtkmmproc -- DO NOT MODIFY!
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
|
2005-05-13 16:47:18 -04:00
|
|
|
#include <gtkmm/entry.h>
|
|
|
|
#include <gtkmm/private/entry_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 <gtk/gtkentry.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
|
|
|
|
static void Entry_signal_populate_popup_callback(GtkEntry* self, GtkMenu* p0,void* data)
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
|
|
|
using namespace Gtk;
|
|
|
|
typedef sigc::slot< void,Menu* > SlotType;
|
|
|
|
|
|
|
|
// Do not try to call a signal on a disassociated wrapper.
|
|
|
|
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
try
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
|
|
|
|
(*static_cast<SlotType*>(slot))(Glib::wrap(p0)
|
|
|
|
);
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
static const Glib::SignalProxyInfo Entry_signal_populate_popup_info =
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
|
|
|
"populate_popup",
|
|
|
|
(GCallback) &Entry_signal_populate_popup_callback,
|
|
|
|
(GCallback) &Entry_signal_populate_popup_callback
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
static void Entry_signal_insert_at_cursor_callback(GtkEntry* self, const gchar* p0,void* data)
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
|
|
|
using namespace Gtk;
|
|
|
|
typedef sigc::slot< void,const Glib::ustring& > SlotType;
|
|
|
|
|
|
|
|
// Do not try to call a signal on a disassociated wrapper.
|
|
|
|
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
try
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
|
|
|
|
(*static_cast<SlotType*>(slot))(Glib::convert_const_gchar_ptr_to_ustring(p0)
|
|
|
|
);
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
static const Glib::SignalProxyInfo Entry_signal_insert_at_cursor_info =
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
|
|
|
"insert_at_cursor",
|
|
|
|
(GCallback) &Entry_signal_insert_at_cursor_callback,
|
|
|
|
(GCallback) &Entry_signal_insert_at_cursor_callback
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
static const Glib::SignalProxyInfo Entry_signal_activate_info =
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
|
|
|
"activate",
|
|
|
|
(GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
|
|
|
|
(GCallback) &Glib::SignalProxyNormal::slot0_void_callback
|
|
|
|
};
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
|
2005-05-13 16:47:18 -04:00
|
|
|
} // anonymous namespace
|
|
|
|
|
|
|
|
|
|
|
|
namespace Glib
|
|
|
|
{
|
|
|
|
|
|
|
|
Gtk::Entry* wrap(GtkEntry* object, bool take_copy)
|
|
|
|
{
|
|
|
|
return dynamic_cast<Gtk::Entry *> (Glib::wrap_auto ((GObject*)(object), take_copy));
|
|
|
|
}
|
|
|
|
|
|
|
|
} /* namespace Glib */
|
|
|
|
|
|
|
|
namespace Gtk
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
/* The *_Class implementation: */
|
|
|
|
|
|
|
|
const Glib::Class& Entry_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_ = &Entry_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(gtk_entry_get_type());
|
|
|
|
|
|
|
|
// Add derived versions of interfaces, if the C type implements any interfaces:
|
|
|
|
Editable::add_interface(get_type());
|
|
|
|
CellEditable::add_interface(get_type());
|
|
|
|
}
|
|
|
|
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Entry_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);
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_VFUNCS_ENABLED
|
|
|
|
#endif //GLIBMM_VFUNCS_ENABLED
|
|
|
|
|
|
|
|
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
klass->populate_popup = &populate_popup_callback;
|
|
|
|
klass->insert_at_cursor = &insert_at_cursor_callback;
|
|
|
|
klass->activate = &activate_callback;
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_VFUNCS_ENABLED
|
|
|
|
#endif //GLIBMM_VFUNCS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
void Entry_Class::populate_popup_callback(GtkEntry* self, GtkMenu* p0)
|
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
|
2005-05-13 16:47:18 -04:00
|
|
|
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:
|
2007-12-18 01:05:55 -05:00
|
|
|
if(obj_base && obj_base->is_derived_())
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
|
|
|
|
if(obj) // This can be NULL during destruction.
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
try // Trap C++ exceptions which would normally be lost because this is a C callback.
|
|
|
|
{
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
// Call the virtual member method, which derived classes might override.
|
|
|
|
obj->on_populate_popup(Glib::wrap(p0)
|
2005-05-13 16:47:18 -04:00
|
|
|
);
|
2007-12-18 01:05:55 -05:00
|
|
|
return;
|
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
}
|
2007-12-18 01:05:55 -05:00
|
|
|
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
2005-05-13 16:47:18 -04:00
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
2007-12-18 01:05:55 -05:00
|
|
|
// Call the original underlying C function:
|
|
|
|
if(base && base->populate_popup)
|
|
|
|
(*base->populate_popup)(self, p0);
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
void Entry_Class::insert_at_cursor_callback(GtkEntry* self, const gchar* p0)
|
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
|
2005-05-13 16:47:18 -04:00
|
|
|
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:
|
2007-12-18 01:05:55 -05:00
|
|
|
if(obj_base && obj_base->is_derived_())
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
|
|
|
|
if(obj) // This can be NULL during destruction.
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
try // Trap C++ exceptions which would normally be lost because this is a C callback.
|
|
|
|
{
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
// Call the virtual member method, which derived classes might override.
|
|
|
|
obj->on_insert_at_cursor(Glib::convert_const_gchar_ptr_to_ustring(p0)
|
2005-05-13 16:47:18 -04:00
|
|
|
);
|
2007-12-18 01:05:55 -05:00
|
|
|
return;
|
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
}
|
2007-12-18 01:05:55 -05:00
|
|
|
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
2005-05-13 16:47:18 -04:00
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
2007-12-18 01:05:55 -05:00
|
|
|
// Call the original underlying C function:
|
|
|
|
if(base && base->insert_at_cursor)
|
|
|
|
(*base->insert_at_cursor)(self, p0);
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
void Entry_Class::activate_callback(GtkEntry* self)
|
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
|
2005-05-13 16:47:18 -04:00
|
|
|
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:
|
2007-12-18 01:05:55 -05:00
|
|
|
if(obj_base && obj_base->is_derived_())
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
|
|
|
|
if(obj) // This can be NULL during destruction.
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
try // Trap C++ exceptions which would normally be lost because this is a C callback.
|
|
|
|
{
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
// Call the virtual member method, which derived classes might override.
|
|
|
|
obj->on_activate();
|
|
|
|
return;
|
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
}
|
2007-12-18 01:05:55 -05:00
|
|
|
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
2005-05-13 16:47:18 -04:00
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
2007-12-18 01:05:55 -05:00
|
|
|
// Call the original underlying C function:
|
|
|
|
if(base && base->activate)
|
|
|
|
(*base->activate)(self);
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
Glib::ObjectBase* Entry_Class::wrap_new(GObject* o)
|
|
|
|
{
|
|
|
|
return manage(new Entry((GtkEntry*)(o)));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* The implementation: */
|
|
|
|
|
|
|
|
Entry::Entry(const Glib::ConstructParams& construct_params)
|
|
|
|
:
|
|
|
|
Gtk::Widget(construct_params)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Entry::Entry(GtkEntry* castitem)
|
|
|
|
:
|
|
|
|
Gtk::Widget((GtkWidget*)(castitem))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Entry::~Entry()
|
|
|
|
{
|
|
|
|
destroy_();
|
|
|
|
}
|
|
|
|
|
|
|
|
Entry::CppClassType Entry::entry_class_; // initialize static member
|
|
|
|
|
|
|
|
GType Entry::get_type()
|
|
|
|
{
|
|
|
|
return entry_class_.init().get_type();
|
|
|
|
}
|
|
|
|
|
|
|
|
GType Entry::get_base_type()
|
|
|
|
{
|
|
|
|
return gtk_entry_get_type();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Entry::Entry()
|
|
|
|
:
|
2007-12-18 01:05:55 -05:00
|
|
|
// Mark this class as non-derived to allow C++ vfuncs to be skipped.
|
|
|
|
Glib::ObjectBase(0),
|
2005-05-13 16:47:18 -04:00
|
|
|
Gtk::Widget(Glib::ConstructParams(entry_class_.init()))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Entry::set_visibility(bool visible)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_entry_set_visibility(gobj(), static_cast<int>(visible));
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Entry::get_visibility() const
|
|
|
|
{
|
|
|
|
return gtk_entry_get_visibility(const_cast<GtkEntry*>(gobj()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void Entry::set_invisible_char(gunichar ch)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_entry_set_invisible_char(gobj(), ch);
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
gunichar Entry::get_invisible_char() const
|
|
|
|
{
|
|
|
|
return gtk_entry_get_invisible_char(const_cast<GtkEntry*>(gobj()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void Entry::set_has_frame(bool setting)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_entry_set_has_frame(gobj(), static_cast<int>(setting));
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Entry::get_has_frame() const
|
|
|
|
{
|
|
|
|
return gtk_entry_get_has_frame(const_cast<GtkEntry*>(gobj()));
|
|
|
|
}
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
void Entry::set_inner_border(const Border& border)
|
|
|
|
{
|
|
|
|
gtk_entry_set_inner_border(gobj(), &(border));
|
|
|
|
}
|
|
|
|
|
|
|
|
Border Entry::get_inner_border() const
|
|
|
|
{
|
|
|
|
return *(gtk_entry_get_inner_border(const_cast<GtkEntry*>(gobj())));
|
|
|
|
}
|
|
|
|
|
2005-05-13 16:47:18 -04:00
|
|
|
void Entry::set_max_length(int max)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_entry_set_max_length(gobj(), max);
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
int Entry::get_max_length() const
|
|
|
|
{
|
|
|
|
return gtk_entry_get_max_length(const_cast<GtkEntry*>(gobj()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void Entry::set_activates_default(bool setting)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_entry_set_activates_default(gobj(), static_cast<int>(setting));
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
gboolean Entry::get_activates_default() const
|
|
|
|
{
|
|
|
|
return gtk_entry_get_activates_default(const_cast<GtkEntry*>(gobj()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void Entry::set_width_chars(int n_chars)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_entry_set_width_chars(gobj(), n_chars);
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
int Entry::get_width_chars() const
|
|
|
|
{
|
|
|
|
return gtk_entry_get_width_chars(const_cast<GtkEntry*>(gobj()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void Entry::set_text(const Glib::ustring & text)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_entry_set_text(gobj(), text.c_str());
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
Glib::ustring Entry::get_text() const
|
|
|
|
{
|
|
|
|
return Glib::convert_const_gchar_ptr_to_ustring(gtk_entry_get_text(const_cast<GtkEntry*>(gobj())));
|
|
|
|
}
|
|
|
|
|
|
|
|
Glib::RefPtr<Pango::Layout> Entry::get_layout()
|
|
|
|
{
|
|
|
|
|
|
|
|
Glib::RefPtr<Pango::Layout> retvalue = Glib::wrap(gtk_entry_get_layout(gobj()));
|
|
|
|
if(retvalue)
|
|
|
|
retvalue->reference(); //The function does not do a ref for us.
|
|
|
|
return retvalue;
|
2007-11-12 18:44:49 -05:00
|
|
|
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
Glib::RefPtr<const Pango::Layout> Entry::get_layout() const
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
return const_cast<Entry*>(this)->get_layout();
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Entry::get_layout_offsets(int& x, int& y)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_entry_get_layout_offsets(gobj(), &x, &y);
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
int Entry::layout_index_to_text_index(int layout_index) const
|
|
|
|
{
|
|
|
|
return gtk_entry_layout_index_to_text_index(const_cast<GtkEntry*>(gobj()), layout_index);
|
|
|
|
}
|
|
|
|
|
|
|
|
int Entry::text_index_to_layout_index(int text_index) const
|
|
|
|
{
|
|
|
|
return gtk_entry_text_index_to_layout_index(const_cast<GtkEntry*>(gobj()), text_index);
|
|
|
|
}
|
|
|
|
|
2007-12-18 01:05:55 -05:00
|
|
|
void Entry::set_cursor_hadjustment(Adjustment& adjustment)
|
|
|
|
{
|
|
|
|
gtk_entry_set_cursor_hadjustment(gobj(), (adjustment).gobj());
|
|
|
|
}
|
|
|
|
|
|
|
|
Adjustment* Entry::get_cursor_hadjustment()
|
|
|
|
{
|
|
|
|
|
|
|
|
Adjustment* retvalue = Glib::wrap(gtk_entry_get_cursor_hadjustment(gobj()));
|
|
|
|
if(retvalue)
|
|
|
|
retvalue->reference(); //The function does not do a ref for us.
|
|
|
|
return retvalue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const Adjustment* Entry::get_cursor_hadjustment() const
|
|
|
|
{
|
|
|
|
return const_cast<Entry*>(this)->get_cursor_hadjustment();
|
|
|
|
}
|
|
|
|
|
2005-05-13 16:47:18 -04:00
|
|
|
void Entry::set_alignment(float xalign)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_entry_set_alignment(gobj(), xalign);
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Entry::set_alignment(AlignmentEnum xalign)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_entry_set_alignment(gobj(), _gtkmm_align_float_from_enum(xalign));
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
float Entry::get_alignment() const
|
|
|
|
{
|
|
|
|
return gtk_entry_get_alignment(const_cast<GtkEntry*>(gobj()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void Entry::set_completion(const Glib::RefPtr<EntryCompletion>& completion)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_entry_set_completion(gobj(), Glib::unwrap(completion));
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
Glib::RefPtr<EntryCompletion> Entry::get_completion()
|
|
|
|
{
|
|
|
|
|
|
|
|
Glib::RefPtr<EntryCompletion> retvalue = Glib::wrap(gtk_entry_get_completion(gobj()));
|
|
|
|
if(retvalue)
|
|
|
|
retvalue->reference(); //The function does not do a ref for us.
|
|
|
|
return retvalue;
|
2007-11-12 18:44:49 -05:00
|
|
|
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
Glib::RefPtr<const EntryCompletion> Entry::get_completion() const
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
return const_cast<Entry*>(this)->get_completion();
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
guint16 Entry::get_text_length() const
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
|
|
|
return gobj()->text_length;
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
|
2005-05-13 16:47:18 -04:00
|
|
|
|
|
|
|
Glib::SignalProxy1< void,Menu* > Entry::signal_populate_popup()
|
|
|
|
{
|
|
|
|
return Glib::SignalProxy1< void,Menu* >(this, &Entry_signal_populate_popup_info);
|
|
|
|
}
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::SignalProxy1< void,const Glib::ustring& > Entry::signal_insert_at_cursor()
|
|
|
|
{
|
|
|
|
return Glib::SignalProxy1< void,const Glib::ustring& >(this, &Entry_signal_insert_at_cursor_info);
|
|
|
|
}
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::SignalProxy0< void > Entry::signal_activate()
|
|
|
|
{
|
|
|
|
return Glib::SignalProxy0< void >(this, &Entry_signal_activate_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy_ReadOnly<int> Entry::property_cursor_position() const
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy_ReadOnly<int>(this, "cursor-position");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy_ReadOnly<int> Entry::property_selection_bound() const
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy_ReadOnly<int>(this, "selection-bound");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy<bool> Entry::property_editable()
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy<bool>(this, "editable");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy_ReadOnly<bool> Entry::property_editable() const
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy_ReadOnly<bool>(this, "editable");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy<int> Entry::property_max_length()
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy<int>(this, "max-length");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy_ReadOnly<int> Entry::property_max_length() const
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy_ReadOnly<int>(this, "max-length");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy<bool> Entry::property_visibility()
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy<bool>(this, "visibility");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy_ReadOnly<bool> Entry::property_visibility() const
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy_ReadOnly<bool>(this, "visibility");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy<bool> Entry::property_has_frame()
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy<bool>(this, "has-frame");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy_ReadOnly<bool> Entry::property_has_frame() const
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy_ReadOnly<bool>(this, "has-frame");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy<gunichar> Entry::property_invisible_char()
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy<gunichar>(this, "invisible-char");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy_ReadOnly<gunichar> Entry::property_invisible_char() const
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy_ReadOnly<gunichar>(this, "invisible-char");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy<bool> Entry::property_activates_default()
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy<bool>(this, "activates-default");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy_ReadOnly<bool> Entry::property_activates_default() const
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy_ReadOnly<bool>(this, "activates-default");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy<int> Entry::property_width_chars()
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy<int>(this, "width-chars");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy_ReadOnly<int> Entry::property_width_chars() const
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy_ReadOnly<int>(this, "width-chars");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy_ReadOnly<int> Entry::property_scroll_offset() const
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy_ReadOnly<int>(this, "scroll-offset");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy<Glib::ustring> Entry::property_text()
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy<Glib::ustring>(this, "text");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy_ReadOnly<Glib::ustring> Entry::property_text() const
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "text");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
|
|
|
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
|
|
Glib::PropertyProxy<float> Entry::property_xalign()
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy<float>(this, "xalign");
|
|
|
|
}
|
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
|
|
|
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
|
|
Glib::PropertyProxy_ReadOnly<float> Entry::property_xalign() const
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy_ReadOnly<float>(this, "xalign");
|
|
|
|
}
|
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
|
|
Glib::PropertyProxy<bool> Entry::property_truncate_multiline()
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy<bool>(this, "truncate-multiline");
|
|
|
|
}
|
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
|
|
Glib::PropertyProxy_ReadOnly<bool> Entry::property_truncate_multiline() const
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy_ReadOnly<bool>(this, "truncate-multiline");
|
|
|
|
}
|
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
void Gtk::Entry::on_populate_popup(Menu* menu)
|
|
|
|
{
|
|
|
|
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->populate_popup)
|
|
|
|
(*base->populate_popup)(gobj(),(GtkMenu*)Glib::unwrap(menu));
|
|
|
|
}
|
|
|
|
void Gtk::Entry::on_insert_at_cursor(const Glib::ustring& str)
|
|
|
|
{
|
|
|
|
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->insert_at_cursor)
|
|
|
|
(*base->insert_at_cursor)(gobj(),str.c_str());
|
|
|
|
}
|
|
|
|
void Gtk::Entry::on_activate()
|
|
|
|
{
|
|
|
|
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->activate)
|
|
|
|
(*base->activate)(gobj());
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
|
|
|
|
|
|
|
#ifdef GLIBMM_VFUNCS_ENABLED
|
|
|
|
#endif //GLIBMM_VFUNCS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
} // namespace Gtk
|
|
|
|
|
|
|
|
|