summaryrefslogtreecommitdiff
path: root/src/Fl_Preferences.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2010-03-17 21:11:06 +0000
committerMatthias Melcher <fltk@matthiasm.com>2010-03-17 21:11:06 +0000
commitbde92b83f308c7a446b5996eb04a91a32421d2fc (patch)
treead934ad1b9ce5ca737d50df768193758de9137c1 /src/Fl_Preferences.cxx
parentcfe5cfdac3ee86437aec2e6f0be47d6b60ba28b1 (diff)
Fixed the IDE's for Xcode3, Xcode3.1, and VisualC (last one untested).
Added some code for verbose plugin manager output. This is what you should get when loading "cube" and then calling the regular "print" function. Fl_Plugin: creating a plugin, class "fltk:device", name "opengl.device.fltk.org" Fl_Plugin: creating a plugin manager for class "fltk:device" Fl_Plugin: adding plugin named "opengl.device.fltk.org" at 0x0x175314 Fl_Plugin: deleting a plugin manager Fl_Plugin: creating a plugin manager for class "fltk:device" Fl_Plugin: returning plugin named "opengl.device.fltk.org": 0x0x175314 Fl_Plugin: deleting a plugin manager Fl_Plugin: deleting a plugin git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7291 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Preferences.cxx')
-rw-r--r--src/Fl_Preferences.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx
index 15da95ff7..e29d7cb72 100644
--- a/src/Fl_Preferences.cxx
+++ b/src/Fl_Preferences.cxx
@@ -25,6 +25,7 @@
// http://www.fltk.org/str.php
//
+#define FL_PLUGIN_VERBOSE
#include <FL/Fl.H>
#include <FL/Fl_Preferences.H>
@@ -1812,6 +1813,10 @@ char Fl_Preferences::Node::copyTo(Fl_Tree *tree, Fl_Tree_Item *ti)
Fl_Plugin::Fl_Plugin(const char *klass, const char *name)
: id(0)
{
+#ifdef FL_PLUGIN_VERBOSE
+ printf("Fl_Plugin: creating a plugin, class \"%s\", name \"%s\"\n",
+ klass, name);
+#endif
Fl_Plugin_Manager pm(klass);
id = pm.addPlugin(name, this);
}
@@ -1821,6 +1826,9 @@ Fl_Plugin::Fl_Plugin(const char *klass, const char *name)
*/
Fl_Plugin::~Fl_Plugin()
{
+#ifdef FL_PLUGIN_VERBOSE
+ printf("Fl_Plugin: deleting a plugin\n");
+#endif
if (id)
Fl_Plugin_Manager::remove(id);
}
@@ -1832,6 +1840,9 @@ Fl_Plugin::~Fl_Plugin()
Fl_Plugin_Manager::Fl_Plugin_Manager(const char *klass)
: Fl_Preferences(0, Fl_Preferences::Name("%s/%s", "plugins", klass))
{
+#ifdef FL_PLUGIN_VERBOSE
+ printf("Fl_Plugin: creating a plugin manager for class \"%s\"\n", klass);
+#endif
}
/**
@@ -1842,6 +1853,9 @@ Fl_Plugin_Manager::Fl_Plugin_Manager(const char *klass)
*/
Fl_Plugin_Manager::~Fl_Plugin_Manager()
{
+#ifdef FL_PLUGIN_VERBOSE
+ printf("Fl_Plugin: deleting a plugin manager\n");
+#endif
}
/**
@@ -1854,6 +1868,9 @@ Fl_Plugin *Fl_Plugin_Manager::plugin(int index)
Fl_Preferences pin(this, index);
pin.get("address", buf, "@0", 32);
sscanf(buf, "@%p", &ret);
+#ifdef FL_PLUGIN_VERBOSE
+ printf("Fl_Plugin: returning plugin at index %d: 0x%p\n", index, ret);
+#endif
return ret;
}
@@ -1868,8 +1885,14 @@ Fl_Plugin *Fl_Plugin_Manager::plugin(const char *name)
Fl_Preferences pin(this, name);
pin.get("address", buf, "@0", 32);
sscanf(buf, "@%p", &ret);
+#ifdef FL_PLUGIN_VERBOSE
+ printf("Fl_Plugin: returning plugin named \"%s\": 0x%p\n", name, ret);
+#endif
return ret;
} else {
+#ifdef FL_PLUGIN_VERBOSE
+ printf("Fl_Plugin: no plugin found named \"%s\"\n", name);
+#endif
return 0L;
}
}
@@ -1883,6 +1906,9 @@ Fl_Plugin *Fl_Plugin_Manager::plugin(const char *name)
Fl_Preferences::ID Fl_Plugin_Manager::addPlugin(const char *name, Fl_Plugin *plugin)
{
char buf[32];
+#ifdef FL_PLUGIN_VERBOSE
+ printf("Fl_Plugin: adding plugin named \"%s\" at 0x%p\n", name, plugin);
+#endif
Fl_Preferences pin(this, name);
snprintf(buf, 32, "@%p", plugin);
pin.set("address", buf);