parent
3b09f9c356
commit
663ddab7a7
|
|
@ -12,9 +12,9 @@
|
||||||
# add these directories to sys.path here. If the directory is relative to the
|
# add these directories to sys.path here. If the directory is relative to the
|
||||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||||
#
|
#
|
||||||
# import os
|
import os
|
||||||
# import sys
|
import sys
|
||||||
# sys.path.insert(0, os.path.abspath('.'))
|
sys.path.insert(0, os.path.abspath('../../..'))
|
||||||
|
|
||||||
|
|
||||||
# -- Project information -----------------------------------------------------
|
# -- Project information -----------------------------------------------------
|
||||||
|
|
@ -69,7 +69,7 @@ language = None
|
||||||
exclude_patterns = []
|
exclude_patterns = []
|
||||||
|
|
||||||
# The name of the Pygments (syntax highlighting) style to use.
|
# The name of the Pygments (syntax highlighting) style to use.
|
||||||
pygments_style = None
|
pygments_style = 'colorful'
|
||||||
|
|
||||||
|
|
||||||
# -- Options for HTML output -------------------------------------------------
|
# -- Options for HTML output -------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,32 @@
|
||||||
Welcome to Joy VUI's documentation!
|
Welcome to Joy VUI's documentation!
|
||||||
===================================
|
===================================
|
||||||
|
|
||||||
|
.. image:: _static/Joy-VUI-screenshot.PNG
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
:caption: Contents:
|
:caption: Contents:
|
||||||
|
|
||||||
|
|
||||||
|
.. automodule:: joy.vui.core
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
||||||
|
.. automodule:: joy.vui.display
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
||||||
|
.. automodule:: joy.vui.viewer
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
||||||
|
.. automodule:: joy.vui.text_viewer
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
||||||
|
.. automodule:: joy.vui.stack_viewer
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
||||||
Indices and tables
|
Indices and tables
|
||||||
==================
|
==================
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,14 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with Thun. If not see <http://www.gnu.org/licenses/>.
|
# along with Thun. If not see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
'''
|
||||||
|
|
||||||
|
Core
|
||||||
|
=====================
|
||||||
|
|
||||||
|
|
||||||
|
A Module docstring yo.
|
||||||
|
'''
|
||||||
from sys import stderr
|
from sys import stderr
|
||||||
from traceback import format_exc
|
from traceback import format_exc
|
||||||
import pygame
|
import pygame
|
||||||
|
|
@ -39,8 +47,9 @@ MOUSE_EVENTS = frozenset({
|
||||||
pygame.MOUSEBUTTONDOWN,
|
pygame.MOUSEBUTTONDOWN,
|
||||||
pygame.MOUSEBUTTONUP
|
pygame.MOUSEBUTTONUP
|
||||||
})
|
})
|
||||||
|
# AM I DOCSY?
|
||||||
|
|
||||||
|
# What about *moi?*
|
||||||
ARROW_KEYS = frozenset({
|
ARROW_KEYS = frozenset({
|
||||||
pygame.K_UP,
|
pygame.K_UP,
|
||||||
pygame.K_DOWN,
|
pygame.K_DOWN,
|
||||||
|
|
@ -68,6 +77,7 @@ SUCCESS = 1
|
||||||
|
|
||||||
|
|
||||||
class Message(object):
|
class Message(object):
|
||||||
|
'''Message class.'''
|
||||||
|
|
||||||
def __init__(self, sender):
|
def __init__(self, sender):
|
||||||
self.sender = sender
|
self.sender = sender
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,10 @@
|
||||||
# along with Thun. If not see <http://www.gnu.org/licenses/>.
|
# along with Thun. If not see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
Display
|
||||||
|
=================
|
||||||
|
|
||||||
This module implements a simple visual display system modeled on Oberon.
|
This module implements a simple visual display system modeled on Oberon.
|
||||||
|
|
||||||
Refer to Chapter 4 of the Project Oberon book for more information.
|
Refer to Chapter 4 of the Project Oberon book for more information.
|
||||||
|
|
@ -355,7 +359,7 @@ class Track(Viewer):
|
||||||
return self, y
|
return self, y
|
||||||
|
|
||||||
def open_viewer(self, y, class_):
|
def open_viewer(self, y, class_):
|
||||||
'''Open and return a viewer of class_ at y.'''
|
'''Open and return a viewer of class at y.'''
|
||||||
# Todo: if y coincides with some other viewer's y replace it.
|
# Todo: if y coincides with some other viewer's y replace it.
|
||||||
viewer, viewer_y = self.viewer_at(y)
|
viewer, viewer_y = self.viewer_at(y)
|
||||||
h = viewer.split(viewer_y)
|
h = viewer.split(viewer_y)
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,12 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with Thun. If not see <http://www.gnu.org/licenses/>.
|
# along with Thun. If not see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
'''
|
||||||
|
|
||||||
|
Stack Viewer
|
||||||
|
=================
|
||||||
|
|
||||||
|
'''
|
||||||
from joy.utils.stack import expression_to_string, iter_stack
|
from joy.utils.stack import expression_to_string, iter_stack
|
||||||
from joy.vui import core, text_viewer
|
from joy.vui import core, text_viewer
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,12 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with Thun. If not see <http://www.gnu.org/licenses/>.
|
# along with Thun. If not see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
'''
|
||||||
|
|
||||||
|
Text Viewer
|
||||||
|
=================
|
||||||
|
|
||||||
|
'''
|
||||||
import string
|
import string
|
||||||
import pygame
|
import pygame
|
||||||
from joy.utils.stack import expression_to_string
|
from joy.utils.stack import expression_to_string
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,20 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with joy.py. If not see <http://www.gnu.org/licenses/>.
|
# along with joy.py. If not see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
'''
|
||||||
|
|
||||||
|
Viewer
|
||||||
|
=================
|
||||||
|
|
||||||
|
'''
|
||||||
import pygame
|
import pygame
|
||||||
from joy.vui.core import BACKGROUND, FOREGROUND
|
from joy.vui.core import BACKGROUND, FOREGROUND
|
||||||
|
|
||||||
|
|
||||||
class Viewer(object):
|
class Viewer(object):
|
||||||
|
'''
|
||||||
|
Base Viewer class
|
||||||
|
'''
|
||||||
|
|
||||||
MINIMUM_HEIGHT = 11
|
MINIMUM_HEIGHT = 11
|
||||||
|
|
||||||
|
|
@ -97,6 +106,10 @@ class Viewer(object):
|
||||||
|
|
||||||
class MenuViewer(Viewer):
|
class MenuViewer(Viewer):
|
||||||
|
|
||||||
|
'''
|
||||||
|
MenuViewer class
|
||||||
|
'''
|
||||||
|
|
||||||
MINIMUM_HEIGHT = 26
|
MINIMUM_HEIGHT = 26
|
||||||
|
|
||||||
def __init__(self, surface):
|
def __init__(self, surface):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue