gnomemm r1784 - in gstreamermm/trunk: . tests tools/extra_defs_gen
- From: jaalburqu svn gnome org
- To: svn-commits-list gnome org
- Subject: gnomemm r1784 - in gstreamermm/trunk: . tests tools/extra_defs_gen
- Date: Thu, 13 Nov 2008 00:25:51 +0000 (UTC)
Author: jaalburqu
Date: Thu Nov 13 00:25:51 2008
New Revision: 1784
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1784&view=rev
Log:
2008-11-12 Josà Alburquerque <jaalburqu svn gnome org>
* tools/extra_defs_gen/generate_plugin_gmmproc_file.cc: Modified so
that gen. plugin has create() methods.
* tests/test-plugin-gen.cc: Modified test to use
Gst::FakeSrc::create() instead of casting.
Modified:
gstreamermm/trunk/ChangeLog
gstreamermm/trunk/tests/test-plugin-gen.cc
gstreamermm/trunk/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc
Modified: gstreamermm/trunk/tests/test-plugin-gen.cc
==============================================================================
--- gstreamermm/trunk/tests/test-plugin-gen.cc (original)
+++ gstreamermm/trunk/tests/test-plugin-gen.cc Thu Nov 13 00:25:51 2008
@@ -6,12 +6,11 @@
{
Gst::init(argc, argv);
- Glib::RefPtr<Gst::Element> element =
- Gst::ElementFactory::create_element("fakesrc");
+ Glib::RefPtr<Gst::FakeSrc> fakesrc = Gst::FakeSrc::create();
- Glib::RefPtr<Gst::FakeSrc> fakesrc = Glib::RefPtr<Gst::FakeSrc>::cast_dynamic(element);
-
- if (!fakesrc)
+ if (fakesrc)
+ std::cout << "fakesrc is valid." << std::endl;
+ else
std::cout << "fakesrc is invalid." << std::endl;
return 0;
Modified: gstreamermm/trunk/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc
==============================================================================
--- gstreamermm/trunk/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc (original)
+++ gstreamermm/trunk/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc Thu Nov 13 00:25:51 2008
@@ -76,7 +76,20 @@
std::cout << "{" << std::endl;
std::cout << " _CLASS_GOBJECT(" << cppTypeName << ", " << cTypeName <<
", " << castMacro << ", " << cppParentTypeName <<
- ", " << cParentTypeName << ")" << std::endl;
+ ", " << cParentTypeName << ")" << std::endl << std::endl;
+
+ std::cout << "protected:" << std::endl;
+ std::cout << " " << cppTypeName << "();" << std::endl;
+ std::cout << " " << cppTypeName << "(const Glib::ustring& name);" << std::endl << std::endl;
+
+ std::cout << "public:" << std::endl;
+ std::cout << "/** Creates a new " << pluginName << " plugin with a unique name." << std::endl;
+ std::cout << " */" << std::endl;
+ std::cout << " _WRAP_CREATE()" << std::endl << std::endl;
+
+ std::cout << "/** Creates a new " << pluginName << " plugin with the given name." << std::endl;
+ std::cout << " */" << std::endl;
+ std::cout << " _WRAP_CREATE(const Glib::ustring& name)" << std::endl;
std::cout << "};" << std::endl;
std::cout << std::endl << "} //namespace " << nmspace << std::endl;
@@ -114,7 +127,20 @@
std::cout << " }" << std::endl << std::endl;
std::cout << " return type;" << std::endl;
- std::cout << "}" << std::endl;
+ std::cout << "}" << std::endl << std::endl;
+
+ std::cout << "namespace " << nmspace << std::endl;
+ std::cout << "{" << std::endl << std::endl;
+
+ std::cout << cppTypeName << "::" << cppTypeName << "()" << std::endl;
+ std::cout << ": _CONSTRUCT(\"name\", NULL)" << std::endl;
+ std::cout << "{}" << std::endl << std::endl;
+
+ std::cout << cppTypeName << "::" << cppTypeName << "(const Glib::ustring& name)" << std::endl;
+ std::cout << ": _CONSTRUCT(\"name\", name.c_str())" << std::endl;
+ std::cout << "{}" << std::endl;
+
+ std::cout << std::endl << "}" << std::endl;
}
int main(int argc, char* argv[])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]