[dia] dox: document PyDia example for register_callback



commit 723ba812f5e0324fffbf23b72a8bfb77d9c6a55b
Author: Hans Breuer <hans breuer org>
Date:   Fri Sep 14 22:31:21 2012 +0200

    dox: document PyDia example for register_callback

 lib/dia.dox                |    2 +-
 plug-ins/python/arrange.py |   10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/lib/dia.dox b/lib/dia.dox
index e9a3bc8..dd8c86f 100644
--- a/lib/dia.dox
+++ b/lib/dia.dox
@@ -16,7 +16,7 @@ Import and export facilties of Dia can be extended by plug-ins
 Additionally there is the possibility to extend Dia with arbitrary
 functionality by registering actions in the menu. Again by
  - writing plug-ins in C/C++ (e.g. \ref LayoutPlugin)
- - or with Python (\ref PyDia)
+ - or with Python (e.g. \ref arrange.py)
 
  */
 
diff --git a/plug-ins/python/arrange.py b/plug-ins/python/arrange.py
index a2d899d..8a523df 100644
--- a/plug-ins/python/arrange.py
+++ b/plug-ins/python/arrange.py
@@ -28,6 +28,11 @@ def DeepCalc (dict, key, seen = None) :
 		DeepCalc (dict, k, seen)
 	return len(seen.keys())
 
+##
+# \brief Callback function to be invoked by Dia's menu
+#
+# Implements a simple layout algorithm based on object connections
+#
 def arrange_connected (data, flags) :
 	objs = data.get_sorted_selected()
 	if len(objs) == 0 :
@@ -108,9 +113,14 @@ def arrange_connected (data, flags) :
 		offsets[y] += 1
 	data.update_extents ()
 
+##
+# \file arrange.py \brief Arrange Objects Plugin
+#
 # this module is loaded by some other plug-ins but can also work on it's own
 # if it is loaded first as Dia plug-in and later as Python module everything works
 # fine due to Pythoninitializing the module only once
+#
+# \ingroup PyDia
 dia.register_callback ("Arrange Objects", 
                        "<Display>/Objects/Arrange", 
                        arrange_connected)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]