~stomato463/+junk/nvdajp

« back to all changes in this revision

Viewing changes to source/brailleDisplayDrivers/nvdajp_dummy.py

  • Committer: Masataka Shinke
  • Date: 2011-10-25 12:35:26 UTC
  • mfrom: (4185 jpmain)
  • mto: This revision was merged to the branch mainline in revision 4211.
  • Revision ID: mshinke@users.sourceforge.jp-20111025123526-ze527a2rl3z0g2ky
lp:~nishimotz/nvdajp/main : 4185 をマージ

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# coding: UTF-8
 
2
#brailleDisplayDrivers/nvdajp_dummy.py
 
3
#A part of NonVisual Desktop Access (NVDA)
 
4
#Copyright (C) 2006-2009 NVDA Contributors <http://www.nvda-project.org/>
 
5
#This file is covered by the GNU General Public License.
 
6
#See the file COPYING for more details.
 
7
#by Takuya Nishimoto
 
8
 
 
9
import braille              # NVDA
 
10
import ui                                       # NVDA
 
11
import queueHandler                     # NVDA
 
12
from logHandler import log      # NVDA
 
13
from ctypes import *
 
14
from ctypes.wintypes import *
 
15
 
 
16
# 0x00 -> _
 
17
# 0x03 -> 12
 
18
# 0x10 -> 5
 
19
# 0x3f -> 123456
 
20
# 0x3f -> 123456
 
21
def _cell_to_display_code(cell):
 
22
        if cell == 0: return "__"
 
23
        s = ""
 
24
        if cell & 0x01: s += "1"
 
25
        if cell & 0x02: s += "2"
 
26
        if cell & 0x04: s += "3"
 
27
        if cell & 0x08: s += "4"
 
28
        if cell & 0x10: s += "5"
 
29
        if cell & 0x20: s += "6"
 
30
        if cell & 0x40: s += ","
 
31
        if cell & 0x80: s += "."
 
32
        return s
 
33
 
 
34
class BrailleDisplayDriver(braille.BrailleDisplayDriver):
 
35
        """ nvdajp dummy braille in NVDA.
 
36
        """
 
37
        name = "nvdajp_dummy"
 
38
        description = _(u"nvdajp dummy braille")
 
39
 
 
40
        @classmethod
 
41
        def check(cls):
 
42
                return False # return True              
 
43
 
 
44
        def __init__(self):
 
45
                log.info("initializing nvdajp_dummy_braille")
 
46
                super(BrailleDisplayDriver, self).__init__()
 
47
 
 
48
        def terminate(self):
 
49
                log.info("terminating nvdajp_dummy_braille")
 
50
                super(BrailleDisplayDriver, self).terminate()
 
51
 
 
52
        def _get_numCells(self):
 
53
                #log.info("_get_numCells")
 
54
                return 10
 
55
        
 
56
        def display(self, cells):
 
57
                s = "display " 
 
58
                s += " ".join(_cell_to_display_code(c) for c in cells)
 
59
                #log.info(s)