aboutsummaryrefslogtreecommitdiffstats
path: root/Lib/defconQt
diff options
context:
space:
mode:
authorAdrien Tétar2015-10-30 13:52:41 +0100
committerAdrien Tétar2015-10-30 13:52:41 +0100
commit71dd524b999d999d361ab16a2f99c092c8ee0d27 (patch)
tree7b7a86142ffc21d625d5d41eacb70a32b7727aa4 /Lib/defconQt
parent0c218c497fc17fca3460a9b097faf848d5e4bbce (diff)
parentef9a3e050e0565021c7449cc19cccdf26f52cced (diff)
downloadtrufont-71dd524b999d999d361ab16a2f99c092c8ee0d27.tar.bz2
Merge pull request #98 from trufont/patch-8
representationFactories: use the new register mechanism
Diffstat (limited to 'Lib/defconQt')
-rw-r--r--Lib/defconQt/representationFactories/__init__.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/Lib/defconQt/representationFactories/__init__.py b/Lib/defconQt/representationFactories/__init__.py
index 86b8b06..507102f 100644
--- a/Lib/defconQt/representationFactories/__init__.py
+++ b/Lib/defconQt/representationFactories/__init__.py
@@ -1,19 +1,27 @@
-from defcon.objects.glyph import addRepresentationFactory
+from defcon import Glyph, registerRepresentationFactory
from defconQt.representationFactories.qPainterPathFactory import (
QPainterPathFactory)
from defconQt.representationFactories.glyphViewFactory import (
NoComponentsQPainterPathFactory, OnlyComponentsQPainterPathFactory,
OutlineInformationFactory, StartPointsInformationFactory)
+# TODO: add a glyph pixmap factory parametrized on glyph size
+# TODO: fine-tune the destructive notifications
_factories = {
- "defconQt.QPainterPath": QPainterPathFactory,
- "defconQt.OnlyComponentsQPainterPath": OnlyComponentsQPainterPathFactory,
- "defconQt.NoComponentsQPainterPath": NoComponentsQPainterPathFactory,
- "defconQt.OutlineInformation": OutlineInformationFactory,
- "defconQt.StartPointsInformation": StartPointsInformationFactory,
+ "defconQt.QPainterPath": (QPainterPathFactory, None),
+ "defconQt.OnlyComponentsQPainterPath": (
+ OnlyComponentsQPainterPathFactory, None),
+ "defconQt.NoComponentsQPainterPath": (
+ NoComponentsQPainterPathFactory, None),
+ "defconQt.OutlineInformation": (
+ OutlineInformationFactory, None),
+ "defconQt.StartPointsInformation": (
+ StartPointsInformationFactory, None),
}
def registerAllFactories():
- for name, factory in _factories.items():
- addRepresentationFactory(name, factory)
+ for name, (factory, destructiveNotifications) in _factories.items():
+ registerRepresentationFactory(
+ Glyph, name, factory,
+ destructiveNotifications=destructiveNotifications)