[libgda-uimm] DataEntry: Wrap vfuncs.



commit bcf1d20a9b80397a13a4df650223b4675a7da3dd
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Tue Apr 13 19:01:49 2010 -0400

    	DataEntry: Wrap vfuncs.
    
    	* libgda-ui/src/dataentry.ccg:
    	* libgda-ui/src/dataentry.hg:
    	* libgda-ui/src/libgda_ui_vfuncs.defs: Wrapped most virtual functions.
    	Left TODO's for two that should be handwritten.  Also removed the
    	set_reference_value() methods because those are not in the most recent
    	release (4.1.4) of libgda.  Hopefully a first release of this will
    	soon occur so compilation must be successful with an already released
    	version of libgda.
    	* libgda-ui/src/datastore.hg: Added local conversions for
    	get_iter_from_values() for when it is wrapped.
    	* tools/m4/convert_libgda_uimm.m4: Included conversions for wrapped
    	vfuncs and methods above.
    
    	* configure.ac: Update libgda and libgdamm version numbers to ones
    	available and with which libgda-uimm compiles.

 ChangeLog                           |   20 ++++++++
 configure.ac                        |    2 +-
 libgda-ui/src/dataentry.hg          |   39 ++++++---------
 libgda-ui/src/datastore.hg          |    7 ++-
 libgda-ui/src/libgda_ui_vfuncs.defs |   91 +++++++++++++++++++++++++++++++++++
 tools/m4/convert_libgda_uimm.m4     |    2 +
 6 files changed, 136 insertions(+), 25 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9e4b3b2..6a76954 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2010-04-13  José Alburquerque  <jaalburqu svn gnome org>
+
+	DataEntry: Wrap vfuncs.
+
+	* libgda-ui/src/dataentry.ccg:
+	* libgda-ui/src/dataentry.hg:
+	* libgda-ui/src/libgda_ui_vfuncs.defs: Wrapped most virtual functions.
+	Left TODO's for two that should be handwritten.  Also removed the
+	set_reference_value() methods because those are not in the most recent
+	release (4.1.4) of libgda.  Hopefully a first release of this will
+	soon occur so compilation must be successful with an already released
+	version of libgda.
+	* libgda-ui/src/datastore.hg: Added local conversions for
+	get_iter_from_values() for when it is wrapped.
+	* tools/m4/convert_libgda_uimm.m4: Included conversions for wrapped
+	vfuncs and methods above.
+
+	* configure.ac: Update libgda and libgdamm version numbers to ones
+	available and with which libgda-uimm compiles.
+
 2010-04-01  José Alburquerque  <jaalburqu svn gnome org>
 
 	Add DataFilter, DataStore and ServerOperation classes.
diff --git a/configure.ac b/configure.ac
index 2aab975..a9c86a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,7 +36,7 @@ AC_DISABLE_STATIC
 AC_LIBTOOL_WIN32_DLL
 AC_PROG_LIBTOOL
 
-AC_SUBST([LIBGDA_UIMM_MODULES], ['libgda-4.0 >= 4.1.2 libgda-ui-4.0 >= 4.1.2 libgdamm-4.0 >= 3.99.17 gtkmm-2.4 >= 2.17.9'])
+AC_SUBST([LIBGDA_UIMM_MODULES], ['libgda-4.0 >= 4.1.4 libgda-ui-4.0 >= 4.1.4 libgdamm-4.0 >= 3.99.19 gtkmm-2.4 >= 2.17.9'])
 PKG_CHECK_MODULES([LIBGDA_UIMM], [$LIBGDA_UIMM_MODULES])
 
 MM_PKG_CONFIG_SUBST([GTHREAD_CFLAGS], [--cflags-only-other gthread-2.0])
diff --git a/libgda-ui/src/dataentry.hg b/libgda-ui/src/dataentry.hg
index 6d2743f..c503eca 100644
--- a/libgda-ui/src/dataentry.hg
+++ b/libgda-ui/src/dataentry.hg
@@ -109,17 +109,6 @@ public:
   void get_value(DataType& value) const;
 
   _WRAP_METHOD(bool content_is_valid(), gdaui_data_entry_content_is_valid, errthrow)
-  _WRAP_METHOD(void set_reference_value(const Glib::ValueBase& value), gdaui_data_entry_set_reference_value)
-
-  /** Push a value into the DataEntry in the same way as set_value() but also
-   * sets this value as the original value.
-   *
-   * @param value The value to set.
-   *
-   * @newin{4,2}
-   */
-  template <class DataType>
-  void set_reference_value(const DataType& value);
 
   /** Fetch the original value held in the GdauiDataEntry widget.
    *
@@ -174,7 +163,22 @@ public:
 
   _WRAP_SIGNAL(void status_changed(), "status-changed")
 
-  //TODO: Wrap vfuncs.
+  _WRAP_VFUNC(void set_value_type(GType type), "set_value_type")
+  _WRAP_VFUNC(GType get_value_type() const, "get_value_type")
+  _WRAP_VFUNC(void set_value(const Glib::ValueBase& value), "set_value")
+  //TODO: _WRAP_VFUNC(void get_value(Glib::ValueBase& value) const, "get_value")
+  _WRAP_VFUNC(void set_value_orig(const Glib::ValueBase& value), "set_value_orig")
+  //TODO: _WRAP_VFUNC(void get_value_orig(Glib::ValueBase& value) const, "get_value_orig")
+  _WRAP_VFUNC(void set_value_default(const Glib::ValueBase& value), "set_value_default")
+  _WRAP_VFUNC(void set_attributes(Gnome::Gda::ValueAttribute attrs, Gnome::Gda::ValueAttribute mask), "set_attributes")
+  _WRAP_VFUNC(Gnome::Gda::ValueAttribute get_attributes() const, "get_attributes")
+
+#m4 _CONVERSION(`GdaDataHandler', `Glib::RefPtr<Gnome::Gda::DataHandler>', `Glib::wrap($3, true)')
+  _WRAP_VFUNC(Glib::RefPtr<Gnome::Gda::DataHandler> get_handler() const, "get_handler")
+
+  _WRAP_VFUNC(bool expand_in_layout() const, "expand-in-layout")
+  _WRAP_VFUNC(void set_editable(bool editable), "set_editable")
+  _WRAP_VFUNC(void grab_focus(), "grab-focus")
 };
 
 /***************************** DataEntry *****************************/
@@ -200,17 +204,6 @@ void DataEntry::get_value(DataType& value) const
   value = temp.get();
 }
 
-template <class DataType>
-void DataEntry::set_reference_value(const DataType& value)
-{
-  typedef Glib::Value<DataType> ValueType;
-
-  ValueType temp;
-  temp.init(ValueType::value_type());
-  temp.set(value);
-  this->set_reference_value(temp);
-}
-
 template<class DataType>
 void DataEntry::get_original_value(DataType& value) const
 {
diff --git a/libgda-ui/src/datastore.hg b/libgda-ui/src/datastore.hg
index d06a8dd..cb209c4 100644
--- a/libgda-ui/src/datastore.hg
+++ b/libgda-ui/src/datastore.hg
@@ -57,7 +57,12 @@ public:
   _WRAP_METHOD(Glib::RefPtr<Gnome::Gda::DataProxy> get_proxy(), gdaui_data_store_get_proxy)
   _WRAP_METHOD(Glib::RefPtr<const Gnome::Gda::DataProxy> get_proxy() const, gdaui_data_store_get_proxy, constversion)
   _WRAP_METHOD(int get_row_from_iter(const Gtk::TreeModel::const_iterator& iter) const, gdaui_data_store_get_row_from_iter)
-  //TODO: _WRAP_METHOD(bool get_iter_from_values(Gtk::TreeModel::iterator& iter, const Glib::SListHandle<Glib::ValueBase>& values, const Glib::ArrayHandle<int>& cols_index), gdaui_data_store_get_iter_from_values)
+
+//TODO:
+//#m4 _CONVERSION(`const Glib::SListHandle<Glib::ValueBase>&', `GSList*', `$3.data()')
+//#m4 _CONVERSION(`const Glib::ArrayHandle<int>&', `gint*', `const_cast<int*>($3.data())')
+  //_WRAP_METHOD(bool get_iter_from_values(Gtk::TreeModel::iterator& iter, const Glib::SListHandle<Glib::ValueBase>& values, const Glib::ArrayHandle<int>& cols_index), gdaui_data_store_get_iter_from_values)
+
   _WRAP_METHOD(bool set_value(const Gtk::TreeModel::iterator& iter, int col, const Glib::ValueBase& value), gdaui_data_store_set_value)
 
   /** Stores a value in the store data model.
diff --git a/libgda-ui/src/libgda_ui_vfuncs.defs b/libgda-ui/src/libgda_ui_vfuncs.defs
index c905bdb..50f12bb 100644
--- a/libgda-ui/src/libgda_ui_vfuncs.defs
+++ b/libgda-ui/src/libgda_ui_vfuncs.defs
@@ -2,6 +2,97 @@
 ; virtual function definitions
 ; define-vfunc is gtkmm-specific
 
+; GdauiDataEntry
+
+(define-vfunc set_value_type
+  (of-object "GdauiDataEntry")
+  (return-type "void")
+  (parameters
+   '("GType" "type")
+  )
+)
+
+(define-vfunc get_value_type
+  (of-object "GdauiDataEntry")
+  (return-type "GType")
+)
+
+(define-vfunc set_value
+  (of-object "GdauiDataEntry")
+  (return-type "void")
+  (parameters
+   '("const-GValue*" "type")
+  )
+)
+
+(define-vfunc get_value
+  (of-object "GdauiDataEntry")
+  (return-type "GValue*")
+)
+
+(define-vfunc set_value_orig
+  (of-object "GdauiDataEntry")
+  (return-type "void")
+  (parameters
+   '("const-GValue*" "value")
+  )
+)
+
+(define-vfunc get_value_orig
+  (of-object "GdauiDataEntry")
+  (return-type "const-GValue*")
+)
+
+(define-vfunc set_value_default
+  (of-object "GdauiDataEntry")
+  (return-type "void")
+  (parameters
+   '("const-GValue*" "value")
+  )
+)
+
+(define-vfunc set_attributes
+  (of-object "GdauiDataEntry")
+  (return-type "void")
+  (parameters
+   '("GdaValueAttribute" "attrs")
+   '("GdaValueAttribute" "mask")
+  )
+)
+
+(define-vfunc get_attributes
+  (of-object "GdauiDataEntry")
+  (return-type "GdaValueAttribute")
+)
+
+(define-vfunc get_handler
+  (of-object "GdauiDataEntry")
+  (return-type "GdaDataHandler*")
+)
+
+(define-vfunc expand_in_layout
+  (of-object "GdauiDataEntry")
+  (return-type "gboolean")
+)
+
+(define-vfunc set_editable
+  (of-object "GdauiDataEntry")
+  (return-type "void")
+  (parameters
+   '("gboolean" "editable")
+  )
+)
+
+(define-vfunc get_editable
+  (of-object "GdauiDataEntry")
+  (return-type "gboolean")
+)
+
+(define-vfunc grab_focus
+  (of-object "GdauiDataEntry")
+  (return-type "void")
+)
+
 ; GdauiDataProxy
 
 (define-vfunc get_proxy
diff --git a/tools/m4/convert_libgda_uimm.m4 b/tools/m4/convert_libgda_uimm.m4
index 903dbd1..bbd29ff 100644
--- a/tools/m4/convert_libgda_uimm.m4
+++ b/tools/m4/convert_libgda_uimm.m4
@@ -15,6 +15,7 @@ _CONVERSION(`GdauiDataEntry*', `Glib::RefPtr<DataEntry>', `Glib::wrap($3)')
 
 dnl Gnome::Gda::DataHandler:
 _CONVERSION(`GdaDataHandler*', `Glib::RefPtr<Gnome::Gda::DataHandler>', `Glib::wrap($3)')
+_CONVERSION(`Glib::RefPtr<Gnome::Gda::DataHandler>', `GdaDataHandler*', `Glib::unwrap($3)')
 
 dnl Gnome::Gda::DataProxy:
 _CONVERSION(`GdaDataProxy*', `Glib::RefPtr<Gnome::Gda::DataProxy>', `Glib::wrap($3)')
@@ -54,6 +55,7 @@ _CONVERSION(`GdaSet*', `Glib::RefPtr<Gnome::Gda::Set>', `Glib::wrap($3)')
 dnl Gtk::TreeModel::iterator:
 _CONVERSION(`const Gtk::TreeModel::const_iterator&', `GtkTreeIter*', `const_cast<GtkTreeIter*>($3->gobj())')
 _CONVERSION(`const Gtk::TreeModel::iterator&', `GtkTreeIter*', `const_cast<GtkTreeIter*>($3->gobj())')
+_CONVERSION(`Gtk::TreeModel::iterator&', `GtkTreeIter*', `const_cast<GtkTreeIter*>($3->gobj())')
 
 dnl Window:
 _CONVERSION(`Gtk::Window*', `GtkWindow*', `Glib::unwrap($3)')



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]