Permalink
Browse files

Added pygtk patch, removed gaphor/tree/treemodel stuff

git-svn-id: file:///Users/arjan/backup/gaphor/trunk/gaphor@48 a8418922-720d-0410-834f-a69b97ada669
  • Loading branch information...
amolenaar committed Feb 27, 2002
1 parent e6edb79 commit 340148f5fbb2a150d87cd672c51fbd6dafeaf787
View
8 README
@@ -1,9 +1,15 @@
Gaphor - A UML CASE tool.
-This is to become a CASE tool what uses GNOME (GTK-2.0) for visualiization.
+This is to become a CASE tool what uses GNOME (GTK-2.0) for visualization.
Gaphor is mainly written in Python, which makes it very easy to use and
very easy to extend.
+NOTE: If you compile Gaphor yourself, you might want to patch your sources
+ of PyGTK too. This will avoid reference leak (resulting in memory
+ leaks) from objects referenced by a gtk.GenericTreeModel object.
+ I know it is not a nice solution, but it makes things work as long
+ as PyGTK itself does not solve the problem...
+
- Arjan Molenaar <arjanmolenaar@hetnet.nl>
View
@@ -16,6 +16,9 @@
Namespace._attrdef['ownedElement'] = ( Sequence, ModelElement, 'namespace' )
ModelElement._attrdef['namespace'] = ( None, Namespace, 'ownedElement' )
+Association._attrdef['connection'] = ( Sequence, AssociationEnd, 'association' )
+AssociationEnd._attrdef['association'] = ( None, Association, 'connection' )
+
ClassifierRole._attrdef['message'] = ( Sequence, Message )
#Message._attrdef['receiver'] = ( None, ClassifierRole )
#Message._attrdef['sender'] = ( None, ClassifierRole )
@@ -1,7 +1,6 @@
AUTOMAKE_OPTIONS = 1.5
INCLUDES = $(DIACANVAS2_CFLAGS) $(PYTHON_INCLUDES) $(PYGTK_CFLAGS)
-LDADD = $(DIACANVAS2_LIBS)
PYGTK_DEFSDIR = @PYGTK_DEFSDIR@
View
@@ -3,32 +3,3 @@ EXTRA_DIST = __init__.py namespace.py
CLEANFILES = *.pyc *.pyo
-INCLUDES = $(GTK_CFLAGS) $(PYTHON_INCLUDES) $(PYGTK_CFLAGS)
-LDADD = $(GTK_LIBS)
-
-treemodeldir = $(pythondir)
-treemodelexecdir = $(pyexecdir)
-
-treemodelexec_LTLIBRARIES = treemodelmodule.la
-treemodelmodule_la_LDFLAGS = -module -avoid-version -export-symbols-regex inittreemodel
-treemodelmodule_la_LIBADD = $(DIACANVAS_LIBS)
-treemodelmodule_la_SOURCES = treemodel.c treemodelmodule.c
-nodist_treemodelmodule_la_SOURCES = pytreemodel.c
-
-pytreemodel.c: pytreemodel.defs pytreemodel.override
-
-all-local:
- test -f $(srcdir)/treemodelmodule.so || $(LN_S) $(srcdir)/.libs/treemodelmodule.so $(srcdir)
- (cd .. && $(PYTHON) -c "import tree.treemodel")
-
-.defs.c:
- (cd $(srcdir) \
- && $(PYGTK_CODEGEN) \
- --register $(PYGTK_DEFSDIR)/pango-types.defs \
- --register $(PYGTK_DEFSDIR)/gdk-types.defs \
- --register $(PYGTK_DEFSDIR)/gtk-types.defs \
- --override $*.override \
- --prefix $* $*.defs) > gen-$*.c \
- && cp gen-$*.c $*.c \
- && rm -f gen-$*.c
-
View
@@ -8,9 +8,8 @@
import gobject
import types
import UML
-import tree.treemodel
-class NamespaceModel(tree.TreeModel):
+class NamespaceModel(gtk.GenericTreeModel):
''' The node is defined by a instance. We can reach the parent
by <object>.namespace. The children can be found in the
<object>.ownerElement list.'''
@@ -28,12 +27,13 @@ def __init__(self, model):
self.model = model;
# Init parent:
gtk.GenericTreeModel.__init__(self)
- self.set_property ('leak_references', gtk.FALSE);
+ self.set_property ('leak_references', 0)
#self.connect ('dispose', self.__destroy)
# TODO: connect to 'name' and 'unlink' and 'namespace' signal from
# the data objects.
# Removed signals when finalized.
# How can I notify views in a proper way if something changed.
+
def dump(self):
'''Dump the static structure of the model to stdout.'''
def doit(node, depth):
@@ -90,7 +90,7 @@ def on_get_value(self, node, column):
'''returns the value stored in a particular column for the node'''
assert column == 0
assert isinstance (node, UML.Namespace)
- #print "on_get_value", node.name
+ print "on_get_value", node.name
return '<<' + str(node.__class__.__name__) + '>> ' + node.name
def on_iter_next(self, node):
@@ -1,20 +0,0 @@
-;; TreeModel
-
-(define-object TreeModel
- (parent "GObject")
- (c-name "TreeModel")
- (gtype-id "_TYPE_TREE_MODEL")
-; (implements "GtkTreeModel")
-)
-
-(define-function tree_model_get_type
- (c-name "tree_model_get_type")
- (return-type "GtkType")
-)
-
-(define-function tree_model_new
- (c-name "tree_model_new")
- (is-constructor-of TreeModel)
- (return-type "TreeModel*")
-)
-
@@ -1,9 +0,0 @@
-%%
-headers
-#include <gtk/gtk.h>
-#include <pygobject.h>
-#include <pygtk/pygtk.h>
-#include "treemodel.h"
-%%
-import gobject.GObject as PyGObject_Type
-%%
Oops, something went wrong.

0 comments on commit 340148f

Please sign in to comment.