]> git.mxchange.org Git - flightgear.git/commitdiff
Added fgAddChangeListener convenience functions.
authordavid <david>
Tue, 18 Jun 2002 03:27:21 +0000 (03:27 +0000)
committerdavid <david>
Tue, 18 Jun 2002 03:27:21 +0000 (03:27 +0000)
src/Main/fg_props.cxx
src/Main/fg_props.hxx

index 88d535aaecd5b83e28ce72c2e24261fb6509dbe3..c82aec13830172e1f052c1a41777bb99bcf16fd3 100644 (file)
@@ -702,6 +702,19 @@ fgHasNode (const char * path)
   return (fgGetNode(path, false) != 0);
 }
 
+void
+fgAddChangeListener (SGPropertyChangeListener * listener, const char * path)
+{
+  fgGetNode(path, true)->addChangeListener(listener);
+}
+
+void
+fgAddChangeListener (SGPropertyChangeListener * listener,
+                    const char * path, int index)
+{
+  fgGetNode(path, index, true)->addChangeListener(listener);
+}
+
 bool
 fgGetBool (const char * name, bool defaultValue)
 {
index 6e62ffe7dc26c9f7c909cfc7ad604b8fdbeef2c9..1f9a1f87d0e7781c6e27a0fbc54bef9f29a590cb 100644 (file)
@@ -106,6 +106,30 @@ extern SGPropertyNode * fgGetNode (const char * path,
 extern bool fgHasNode (const char * path);
 
 
+/**
+ * Add a listener to a node.
+ *
+ * @param listener The listener to add to the node.
+ * @param path The path of the node, relative to root.
+ * @param index The index for the last member of the path (overrides
+ * any given in the string).
+ */
+extern void fgAddChangeListener (SGPropertyChangeListener * listener,
+                                const char * path);
+
+
+/**
+ * Add a listener to a node.
+ *
+ * @param listener The listener to add to the node.
+ * @param path The path of the node, relative to root.
+ * @param index The index for the last member of the path (overrides
+ * any given in the string).
+ */
+extern void fgAddChangeListener (SGPropertyChangeListener * listener,
+                                const char * path, int index);
+
+
 /**
  * Get a bool value for a property.
  *