annotate enso/graphics/__init__.py @ 40:835c7c35e4c4

The graphics subsystem now operates entirely in points.
author Andrew Wilson <andrew@humanized.com>
date Sun, 24 Feb 2008 17:24:55 -0600
parents 5e4c680f49a3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31
5e4c680f49a3 Added a prototype 'provider' framework to allow the Enso core to connect with platform-specific modules such as enso_osx. Also created a scripts/run_enso.py script, which doesn't currently work because of some annoying font issues which will be fixed soon.
Atul Varma <varmaa@toolness.com>
parents: 19
diff changeset
1 import enso.providers
5e4c680f49a3 Added a prototype 'provider' framework to allow the Enso core to connect with platform-specific modules such as enso_osx. Also created a scripts/run_enso.py script, which doesn't currently work because of some annoying font issues which will be fixed soon.
Atul Varma <varmaa@toolness.com>
parents: 19
diff changeset
2
5e4c680f49a3 Added a prototype 'provider' framework to allow the Enso core to connect with platform-specific modules such as enso_osx. Also created a scripts/run_enso.py script, which doesn't currently work because of some annoying font issues which will be fixed soon.
Atul Varma <varmaa@toolness.com>
parents: 19
diff changeset
3 _graphics = enso.providers.getInterface( "graphics" )
5e4c680f49a3 Added a prototype 'provider' framework to allow the Enso core to connect with platform-specific modules such as enso_osx. Also created a scripts/run_enso.py script, which doesn't currently work because of some annoying font issues which will be fixed soon.
Atul Varma <varmaa@toolness.com>
parents: 19
diff changeset
4
40
835c7c35e4c4 The graphics subsystem now operates entirely in points.
Andrew Wilson <andrew@humanized.com>
parents: 31
diff changeset
5 from enso.graphics.measurement import pointsToPixels, pixelsToPoints
835c7c35e4c4 The graphics subsystem now operates entirely in points.
Andrew Wilson <andrew@humanized.com>
parents: 31
diff changeset
6
835c7c35e4c4 The graphics subsystem now operates entirely in points.
Andrew Wilson <andrew@humanized.com>
parents: 31
diff changeset
7 def getDesktopSize():
835c7c35e4c4 The graphics subsystem now operates entirely in points.
Andrew Wilson <andrew@humanized.com>
parents: 31
diff changeset
8 width, height = _graphics.getDesktopSize()
835c7c35e4c4 The graphics subsystem now operates entirely in points.
Andrew Wilson <andrew@humanized.com>
parents: 31
diff changeset
9 width = pixelsToPoints( width )
835c7c35e4c4 The graphics subsystem now operates entirely in points.
Andrew Wilson <andrew@humanized.com>
parents: 31
diff changeset
10 height = pixelsToPoints( height )
835c7c35e4c4 The graphics subsystem now operates entirely in points.
Andrew Wilson <andrew@humanized.com>
parents: 31
diff changeset
11 return ( width, height )