gnomemm r1727 - in libgdamm/trunk: . libgda/src
- From: jhs svn gnome org
- To: svn-commits-list gnome org
- Subject: gnomemm r1727 - in libgdamm/trunk: . libgda/src
- Date: Wed, 1 Oct 2008 09:44:04 +0000 (UTC)
Author: jhs
Date: Wed Oct 1 09:44:04 2008
New Revision: 1727
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1727&view=rev
Log:
2008-10-01 Johannes Schmid <johannes schmid openismus com>
* libgda/src/column.hg:
* libgda/src/connection.hg:
* libgda/src/datamodel.ccg:
* libgda/src/datamodel.hg:
* libgda/src/datamodelarray.hg:
* libgda/src/dataproxy.hg:
* libgda/src/holder.ccg:
* libgda/src/holder.hg:
* libgda/src/libgda_signals.defs:
* libgda/src/metastruct.hg:
* libgda/src/set.hg:
Wrapped more missing methods and signals
Modified:
libgdamm/trunk/ChangeLog
libgdamm/trunk/libgda/src/column.hg
libgdamm/trunk/libgda/src/connection.hg
libgdamm/trunk/libgda/src/datamodel.ccg
libgdamm/trunk/libgda/src/datamodel.hg
libgdamm/trunk/libgda/src/datamodelarray.hg
libgdamm/trunk/libgda/src/dataproxy.hg
libgdamm/trunk/libgda/src/holder.ccg
libgdamm/trunk/libgda/src/holder.hg
libgdamm/trunk/libgda/src/libgda_signals.defs
libgdamm/trunk/libgda/src/metastruct.hg
libgdamm/trunk/libgda/src/set.hg
Modified: libgdamm/trunk/libgda/src/column.hg
==============================================================================
--- libgdamm/trunk/libgda/src/column.hg (original)
+++ libgdamm/trunk/libgda/src/column.hg Wed Oct 1 09:44:04 2008
@@ -73,7 +73,7 @@
#m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)
_WRAP_SIGNAL(void name_changed(const Glib::ustring& old_name), "name-changed")
- _WRAP_SIGNAL(void g_type_changed(int old_type, int new_type), "g-type-changed", no_default_handler)
+ _WRAP_SIGNAL(void g_type_changed(GType old_type, GType new_type), "g-type-changed")
_WRAP_PROPERTY("id", Glib::ustring)
};
Modified: libgdamm/trunk/libgda/src/connection.hg
==============================================================================
--- libgdamm/trunk/libgda/src/connection.hg (original)
+++ libgdamm/trunk/libgda/src/connection.hg Wed Oct 1 09:44:04 2008
@@ -172,11 +172,13 @@
//_WRAP_METHOD(Glib::RefPtr<DataModel> get_meta_store_data (...), gda_connection_get_meta_store_data)
_WRAP_METHOD(Glib::RefPtr<MetaStore> get_meta_store(), gda_connection_get_meta_store);
- _IGNORE (gda_connection_batch_execute) // has no implementation
- //_WRAP_METHOD(Glib::RefPtr<Glib::Object> batch_execute(const Glib::RefPtr<Batch>& batch, const Glib::RefPtr<Set>& params, StatementModelUsage model_usage), gda_connection_batch_execute, errthrow)
+ #m4 _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<Glib::Object> >',`$2((GSList*)$3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(Glib::SListHandle< Glib::RefPtr<Glib::Object> > batch_execute(const Glib::RefPtr<Batch>& batch, const Glib::RefPtr<Set>& params, StatementModelUsage model_usage), gda_connection_batch_execute, errthrow)
_WRAP_METHOD(Glib::RefPtr<ServerOperation> create_operation (ServerOperationType type, const Glib::RefPtr<Set>& options), gda_connection_create_operation, errthrow)
_WRAP_METHOD(bool perform_operation (const Glib::RefPtr<ServerOperation>& op), gda_connection_perform_operation, errthrow)
+ _WRAP_METHOD(Glib::RefPtr<ServerProvider> get_provider(), gda_connection_get_provider)
+
_CONVERSION(`GdaConnectionEvent*',`const Glib::RefPtr<ConnectionEvent>&',Glib::wrap($3, true))
_WRAP_SIGNAL(void error(const Glib::RefPtr<ConnectionEvent>& error), "error")
Modified: libgdamm/trunk/libgda/src/datamodel.ccg
==============================================================================
--- libgdamm/trunk/libgda/src/datamodel.ccg (original)
+++ libgdamm/trunk/libgda/src/datamodel.ccg Wed Oct 1 09:44:04 2008
@@ -23,6 +23,7 @@
#include <libgdamm/serverprovider.h>
#include <libgda/gda-data-model.h>
#include <libgda/gda-data-model-extra.h>
+#include <libgda/gda-data-model-iter-extra.h>
#include <libgda/gda-data-model-array.h>
#include <libgda/gda-enum-types.h>
@@ -56,6 +57,28 @@
}
#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::ValueBase DataModel::get_typed_value_at (int col, int row, GType expected_type, bool nullok) const
+#else
+Glib::ValueBase DataModel::get_typed_value_at (int col, int row, GType expected_type, bool nullok, std::auto_ptr<Glib::Error>& error) const
+#endif
+{
+ GError* gerror = 0;
+ Glib::ValueBase retval;
+ const GValue* value;
+ //Note that the function does not return a new value, so we should not free it:
+ value = gda_data_model_get_typed_value_at(const_cast<GdaDataModel*>(gobj()), col, row, expected_type, nullok, &gerror);
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+ retval.init(value);
+ return retval;
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool DataModel::export_to_file(DataModelIOFormat format, const std::string& file, const Glib::ArrayHandle<int>& cols, const Glib::ArrayHandle<int>& rows, const Glib::RefPtr<Set>& options)
#else
bool DataModel::export_to_file(DataModelIOFormat format, const std::string& file, const Glib::ArrayHandle<int>& cols, const Glib::ArrayHandle<int>& rows, const Glib::RefPtr<Set>& options, std::auto_ptr<Glib::Error>& error)
Modified: libgdamm/trunk/libgda/src/datamodel.hg
==============================================================================
--- libgdamm/trunk/libgda/src/datamodel.hg (original)
+++ libgdamm/trunk/libgda/src/datamodel.hg Wed Oct 1 09:44:04 2008
@@ -109,19 +109,26 @@
_WRAP_METHOD(int get_n_rows() const, gda_data_model_get_n_rows)
_WRAP_METHOD(int get_n_columns() const, gda_data_model_get_n_columns)
+ _WRAP_METHOD(int get_column_index(const Glib::ustring& name), gda_data_model_get_column_index);
+
_WRAP_METHOD(Glib::RefPtr<Column> describe_column(int col), gda_data_model_describe_column, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Column> describe_column(int col) const, gda_data_model_describe_column, refreturn, constversion)
_WRAP_METHOD(Glib::ustring get_column_title(int col) const, gda_data_model_get_column_title)
_WRAP_METHOD(void set_column_title(int col, const Glib::ustring& title), gda_data_model_set_column_title)
- //We use a custom conversion here, because we need to copy the value:
- //#m4 _CONVERSION(`GValue*',`Value',`Glib::wrap($3, true /* take_copy=true */)')
- //#m4 _CONVERSION(`const GValue*',`Value',`Glib::wrap(const_cast<GValue*>($3), true /* take_copy */)')
-
_WRAP_METHOD_DOCS_ONLY(gda_data_model_get_value_at)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::ValueBase get_value_at(int col, int row) const;
-
+#else
+ Glib::ValueBase get_value_at(int col, int row, std::auto_ptr<Glib::Error>& error) const;
+#endif
+ _WRAP_METHOD_DOCS_ONLY (gda_data_model_get_typed_value_at);
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ Glib::ValueBase get_typed_value_at (int col, int row, GType expected_type, bool nullok) const;
+#else
+ Glib::ValueBase get_typed_value_at (int col, int row, GType expected_type, bool nullok, std::auto_ptr<Glib::Error>& error) const;
+#endif
_WRAP_METHOD(ValueAttribute get_attributes_at(int col, int row), gda_data_model_get_attributes_at)
_WRAP_METHOD(Glib::RefPtr<DataModelIter> create_iter(), gda_data_model_create_iter)
@@ -213,7 +220,12 @@
_WRAP_METHOD(void set_column_name (int col, const Glib::ustring& name), gda_data_model_set_column_name)
_WRAP_METHOD(Glib::ustring get_column_name (int col), gda_data_model_get_column_name)
-
+
+ // It is a bit strange that those are int GdaDataModel and not in GdaDataModelIter
+ _WRAP_METHOD(bool iter_move_next_default (const Glib::RefPtr<DataModelIter>& iter), gda_data_model_iter_move_next_default)
+ _WRAP_METHOD(bool iter_move_prev_default (const Glib::RefPtr<DataModelIter>& iter), gda_data_model_iter_move_prev_default)
+ _WRAP_METHOD(bool iter_move_at_row_default (const Glib::RefPtr<DataModelIter>& iter, int row), gda_data_model_iter_move_at_row_default)
+
//These are in a private header. Ignore them:
_IGNORE(gda_data_model_changed, gda_data_model_row_inserted, gda_data_model_row_updated, gda_data_model_row_removed,
gda_data_model_get_command_text, gda_data_model_set_command_text, gda_data_model_get_command_type,
Modified: libgdamm/trunk/libgda/src/datamodelarray.hg
==============================================================================
--- libgdamm/trunk/libgda/src/datamodelarray.hg (original)
+++ libgdamm/trunk/libgda/src/datamodelarray.hg Wed Oct 1 09:44:04 2008
@@ -20,6 +20,7 @@
*/
#include <glibmm/object.h>
+#include <libgdamm/row.h>
_DEFS(libgdamm,libgda)
_PINCLUDE(glibmm/private/object_p.h)
@@ -47,6 +48,8 @@
_WRAP_METHOD(void set_n_columns(int cols), gda_data_model_array_set_n_columns)
_WRAP_METHOD(void clear(), gda_data_model_array_clear)
+ _WRAP_METHOD(Glib::RefPtr<Row> get_row (int row), gda_data_model_array_get_row, errthrow)
+
_WRAP_PROPERTY("n-columns", guint);
};
Modified: libgdamm/trunk/libgda/src/dataproxy.hg
==============================================================================
--- libgdamm/trunk/libgda/src/dataproxy.hg (original)
+++ libgdamm/trunk/libgda/src/dataproxy.hg Wed Oct 1 09:44:04 2008
@@ -110,6 +110,10 @@
_WRAP_SIGNAL(void sample_changed(int sample_start, int sample_end), "sample-changed")
_WRAP_SIGNAL(void sample_size_changed(int sample_size), "sample-size-changed")
_WRAP_SIGNAL(void filter_changed(), "filter-changed", no_default_handler)
+ #m4 _CONVERSION(`gpointer',`Glib::Error*',`Glib::wrap($3)')
+ #m4 _CONVERSION(`Glib::Error*',`gpointer',`(gpointer) $3->gobj()')
+ _WRAP_SIGNAL(Glib::Error* validate_row_changes(int row, int proxied_row), "validate-row-changes", no_default_handler)
+ _WRAP_SIGNAL(void row_changes_applied(int row, int proxied_row), "row-changes-applied")
};
} // namespace Gda
Modified: libgdamm/trunk/libgda/src/holder.ccg
==============================================================================
--- libgdamm/trunk/libgda/src/holder.ccg (original)
+++ libgdamm/trunk/libgda/src/holder.ccg Wed Oct 1 09:44:04 2008
@@ -29,6 +29,28 @@
namespace Gda
{
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::ValueBase Holder::take_statis_value (const Glib::ValueBase& value)
+#else
+Glib::ValueBase Holder::take_statis_value (const Glib::ValueBase& value, std::auto_ptr<Glib::Error>& error)
+#endif
+{
+ GError* gerror = 0;
+ Glib::ValueBase retval;
+ const GValue* cvalue;
+ //Note that the function does not return a new value, so we should not free it:
+ cvalue = gda_holder_take_static_value(gobj(), value.gobj(), &gerror);
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+ retval.init(cvalue);
+ return retval;
+}
+
Glib::ValueBase Holder::get_value()
{
Glib::ValueBase retval;
Modified: libgdamm/trunk/libgda/src/holder.hg
==============================================================================
--- libgdamm/trunk/libgda/src/holder.hg (original)
+++ libgdamm/trunk/libgda/src/holder.hg Wed Oct 1 09:44:04 2008
@@ -53,7 +53,12 @@
_WRAP_METHOD(bool set_value(const Glib::ValueBase& value), gda_holder_set_value, errthrow)
_WRAP_METHOD(bool set_value_str (const Glib::RefPtr<DataHandler>& dh, const Glib::ustring& value), gda_holder_set_value_str, errthrow)
_WRAP_METHOD(bool take_value (Glib::ValueBase& value), gda_holder_take_value, errthrow)
-
+ _WRAP_METHOD_DOCS_ONLY(gda_holder_take_static_value)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ Glib::ValueBase take_statis_value (const Glib::ValueBase& value);
+#else
+ Glib::ValueBase take_statis_value (const Glib::ValueBase& value, std::auto_ptr<Glib::Error>& error);
+#endif
_WRAP_METHOD_DOCS_ONLY(gda_holder_get_default_value)
Glib::ValueBase get_default_value();
_WRAP_METHOD(void set_default_value(const Glib::ValueBase& value), gda_holder_set_default_value)
Modified: libgdamm/trunk/libgda/src/libgda_signals.defs
==============================================================================
--- libgdamm/trunk/libgda/src/libgda_signals.defs (original)
+++ libgdamm/trunk/libgda/src/libgda_signals.defs Wed Oct 1 09:44:04 2008
@@ -25,8 +25,8 @@
(return-type "void")
(when "last")
(parameters
- '("gint" "p0")
- '("gint" "p1")
+ '("GType" "p0")
+ '("GType" "p1")
)
)
@@ -77,7 +77,7 @@
)
)
-(define-property system-filename
+(define-property user-filename
(of-object "GdaConfig")
(prop-type "GParamString")
(docs "")
@@ -86,7 +86,7 @@
(construct-only #f)
)
-(define-property user-filename
+(define-property system-filename
(of-object "GdaConfig")
(prop-type "GParamString")
(docs "")
Modified: libgdamm/trunk/libgda/src/metastruct.hg
==============================================================================
--- libgdamm/trunk/libgda/src/metastruct.hg (original)
+++ libgdamm/trunk/libgda/src/metastruct.hg Wed Oct 1 09:44:04 2008
@@ -63,6 +63,10 @@
_WRAP_METHOD(MetaDbObject* get_db_object(const Glib::ValueBase& catalog, const Glib::ValueBase& schema, const Glib::ValueBase& name), gda_meta_struct_get_db_object)
_WRAP_METHOD(MetaTableColumn* get_table_column(MetaTable* table, const Glib::ValueBase& col_name), gda_meta_struct_get_table_column)
_WRAP_METHOD(Glib::ustring dump_as_graph(MetaGraphInfo info), gda_meta_struct_dump_as_graph, errthrow)
+
+ // FIXME: Use C++ type
+ _WRAP_METHOD(GSList* get_all_db_objects(), gda_meta_struct_get_all_db_objects)
+
_WRAP_PROPERTY("features", guint)
};
Modified: libgdamm/trunk/libgda/src/set.hg
==============================================================================
--- libgdamm/trunk/libgda/src/set.hg (original)
+++ libgdamm/trunk/libgda/src/set.hg Wed Oct 1 09:44:04 2008
@@ -74,7 +74,12 @@
_WRAP_SIGNAL(void holder_changed (const Glib::RefPtr<Holder>& holder), "holder-changed")
_WRAP_SIGNAL(void holder_plugin_changed (const Glib::RefPtr<Holder>& holder), "holder-plugin-changed")
_WRAP_SIGNAL(void public_data_changed (), "public-data-changed")
-
+ #m4 _CONVERSION(`gpointer',`Glib::Error*',`Glib::wrap($3)')
+ #m4 _CONVERSION(`Glib::Error*',`gpointer',`(gpointer) $3->gobj()')
+ _WRAP_SIGNAL(Glib::Error* validate_set(), "validate-set", no_default_handler)
+ // FIXME: Use C++ type for value
+ //_WRAP_SIGNAL(Glib::Error* validate_holder_change(const Glib::RefPtr<Set> set, const Glib::RefPtr<Holder> holder, gpointer value), "validate-holder-change", no_default_handler)
+
_WRAP_PROPERTY("description", Glib::ustring)
_WRAP_PROPERTY("id", Glib::ustring)
_WRAP_PROPERTY("name", Glib::ustring)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]