glibmm r775 - in branches/glibmm-2-18: . tools/extra_defs_gen
- From: jaalburqu svn gnome org
- To: svn-commits-list gnome org
- Subject: glibmm r775 - in branches/glibmm-2-18: . tools/extra_defs_gen
- Date: Mon, 12 Jan 2009 00:41:05 +0000 (UTC)
Author: jaalburqu
Date: Mon Jan 12 00:41:05 2009
New Revision: 775
URL: http://svn.gnome.org/viewvc/glibmm?rev=775&view=rev
Log:
2009-01-11 Josà Alburquerque <jaalburqu svn gnome org>
* tools/extra_defs_gen/generate_extra_defs.cc:
* tools/extra_defs_gen/generate_extra_defs.h: Undid patch from bug
#562810 (Josà Alburquerque). All the confusion about gstreamermm
packaging (see bug #565454) led to suggested patch which will really
probably never be used.
Modified:
branches/glibmm-2-18/ChangeLog
branches/glibmm-2-18/tools/extra_defs_gen/generate_extra_defs.cc
branches/glibmm-2-18/tools/extra_defs_gen/generate_extra_defs.h
Modified: branches/glibmm-2-18/tools/extra_defs_gen/generate_extra_defs.cc
==============================================================================
--- branches/glibmm-2-18/tools/extra_defs_gen/generate_extra_defs.cc (original)
+++ branches/glibmm-2-18/tools/extra_defs_gen/generate_extra_defs.cc Mon Jan 12 00:41:05 2009
@@ -100,16 +100,11 @@
return strResult;
}
-bool gtype_is_a_pointer(GType gtype)
-{
- return (g_type_is_a(gtype, G_TYPE_OBJECT) || g_type_is_a(gtype, G_TYPE_BOXED));
-}
-
-std::string get_type_name(GType gtype, GTypeIsAPointerFunc is_a_pointer_func) //Adds a * if necessary.
+std::string get_type_name(GType gtype) //Adds a * if necessary.
{
std::string strTypeName = g_type_name(gtype);
- if (is_a_pointer_func && is_a_pointer_func(gtype))
+ if( g_type_is_a(gtype, G_TYPE_OBJECT) || g_type_is_a(gtype, G_TYPE_BOXED) )
strTypeName += "*"; //Add * to show that it's a pointer.
else if( g_type_is_a(gtype, G_TYPE_STRING) )
strTypeName = "gchar*"; //g_type_name() returns "gchararray".
@@ -117,9 +112,9 @@
return strTypeName;
}
-std::string get_type_name_parameter(GType gtype, GTypeIsAPointerFunc is_a_pointer_func)
+std::string get_type_name_parameter(GType gtype)
{
- std::string strTypeName = get_type_name(gtype, is_a_pointer_func);
+ std::string strTypeName = get_type_name(gtype);
//All signal parameters that are registered as GTK_TYPE_STRING are actually const gchar*.
if(strTypeName == "gchar*")
@@ -128,13 +123,13 @@
return strTypeName;
}
-std::string get_type_name_signal(GType gtype, GTypeIsAPointerFunc is_a_pointer_func)
+std::string get_type_name_signal(GType gtype)
{
- return get_type_name_parameter(gtype, is_a_pointer_func); //At the moment, it needs the same stuff.
+ return get_type_name_parameter(gtype); //At the moment, it needs the same stuff.
}
-std::string get_signals(GType gtype, GTypeIsAPointerFunc is_a_pointer_func)
+std::string get_signals(GType gtype)
{
std::string strResult;
std::string strObjectName = g_type_name(gtype);
@@ -170,7 +165,7 @@
g_signal_query(signal_id, &signalQuery);
//Return type:
- std::string strReturnTypeName = get_type_name_signal( signalQuery.return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE, is_a_pointer_func ); //The type is mangled with a flag. Hacky.
+ std::string strReturnTypeName = get_type_name_signal( signalQuery.return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE ); //The type is mangled with a flag. Hacky.
//bool bReturnTypeHasStaticScope = (signalQuery.return_type & G_SIGNAL_TYPE_STATIC_SCOPE) == G_SIGNAL_TYPE_STATIC_SCOPE;
strResult += " (return-type \"" + strReturnTypeName + "\")\n";
@@ -211,7 +206,7 @@
pchNum = 0;
//Just like above, for the return type:
- std::string strTypeName = get_type_name_signal( typeParamMangled & ~G_SIGNAL_TYPE_STATIC_SCOPE, is_a_pointer_func ); //The type is mangled with a flag. Hacky.
+ std::string strTypeName = get_type_name_signal( typeParamMangled & ~G_SIGNAL_TYPE_STATIC_SCOPE ); //The type is mangled with a flag. Hacky.
//bool bReturnTypeHasStaticScope = (typeParamMangled & G_SIGNAL_TYPE_STATIC_SCOPE) == G_SIGNAL_TYPE_STATIC_SCOPE;
strResult += " '(\"" + strTypeName + "\" \"" + strParamName + "\")\n";
@@ -236,14 +231,14 @@
-std::string get_defs(GType gtype, GTypeIsAPointerFunc is_a_pointer_func)
+std::string get_defs(GType gtype)
{
std::string strObjectName = g_type_name(gtype);
std::string strDefs = ";; From " + strObjectName + "\n\n";
if(G_TYPE_IS_OBJECT(gtype) || G_TYPE_IS_INTERFACE(gtype))
{
- strDefs += get_signals(gtype, is_a_pointer_func);
+ strDefs += get_signals(gtype);
strDefs += get_properties(gtype);
}
Modified: branches/glibmm-2-18/tools/extra_defs_gen/generate_extra_defs.h
==============================================================================
--- branches/glibmm-2-18/tools/extra_defs_gen/generate_extra_defs.h (original)
+++ branches/glibmm-2-18/tools/extra_defs_gen/generate_extra_defs.h Mon Jan 12 00:41:05 2009
@@ -24,31 +24,10 @@
#include <iostream>
#include <string>
-/** Function pointer type for functions that determine if a GType is a pointer
- * type.
- */
-typedef bool (*GTypeIsAPointerFunc)(GType gtype);
-
-/** Default extra defs utility function to determine if a GType is a pointer
- * type.
- * @param gtype The GType.
- * @return true if the GType is a GObject or a boxed type, false otherwise.
- */
-bool gtype_is_a_pointer(GType gtype);
-
-std::string get_defs(GType gtype,
- GTypeIsAPointerFunc is_a_pointer_func = gtype_is_a_pointer);
+std::string get_defs(GType gtype);
std::string get_properties(GType gtype);
-
-std::string get_type_name(GType gtype,
- GTypeIsAPointerFunc is_a_pointer_func = gtype_is_a_pointer);
-
-std::string get_type_name_parameter(GType gtype,
- GTypeIsAPointerFunc is_a_pointer_func = gtype_is_a_pointer);
-
-std::string get_type_name_signal(GType gtype,
- GTypeIsAPointerFunc is_a_pointer_func = gtype_is_a_pointer);
-
-std::string get_signals(GType gtype,
- GTypeIsAPointerFunc is_a_pointer_func = gtype_is_a_pointer);
+std::string get_type_name(GType gtype);
+std::string get_type_name_parameter(GType gtype);
+std::string get_type_name_signal(GType gtype);
+std::string get_signals(GType gtype);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]