set/remove window for application

This commit is contained in:
chrys
2016-09-24 22:56:18 +02:00
parent 10e1bed491
commit c05382e828
11 changed files with 108 additions and 47 deletions

View File

@ -0,0 +1,26 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from core import debug
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return 'Turn off window mode for application'
def run(self):
if self.env['runtime']['cursorManager'].clearWindowForApplication():
self.env['runtime']['outputManager'].presentText('Window Mode off for application ' + currApp, interrupt=True)
else:
self.env['runtime']['outputManager'].presentText("Not in window Mode", interrupt=True)
def setCallback(self, callback):
pass

View File

@ -1,41 +0,0 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from core import debug
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return 'set Window Mode, needs 2 marks '
def run(self):
if not self.env['commandBuffer']['Marks']['1']:
self.env['runtime']['outputManager'].presentText("No Mark found", interrupt=True)
return
if not self.env['commandBuffer']['Marks']['2']:
self.env['runtime']['outputManager'].presentText("to few makrs found", interrupt=True)
return
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
self.env['commandBuffer']['windowArea'][currApp] = {}
if self.env['commandBuffer']['Marks']['1']['x'] * self.env['commandBuffer']['Marks']['1']['y'] <= \
self.env['commandBuffer']['Marks']['2']['x'] * self.env['commandBuffer']['Marks']['2']['y']:
self.env['commandBuffer']['windowArea'][currApp]['1'] = self.env['commandBuffer']['Marks']['1'].copy()
self.env['commandBuffer']['windowArea'][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy()
else:
self.env['commandBuffer']['windowArea'][currApp]['1'] = self.env['commandBuffer']['Marks']['2'].copy()
self.env['commandBuffer']['windowArea'][currApp]['2'] = self.env['commandBuffer']['Marks']['1'].copy()
self.env['runtime']['outputManager'].presentText('Window Mode set for application ' + currApp, interrupt=True)
self.env['commandBuffer']['Marks']['1'] = None
self.env['commandBuffer']['Marks']['2'] = None
def setCallback(self, callback):
pass

View File

@ -0,0 +1,27 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from core import debug
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return 'set Window Mode, needs 2 marks '
def run(self):
if self.env['runtime']['cursorManager'].setWindowForApplication():
self.env['runtime']['outputManager'].presentText('Window Mode on for application ' + currApp, interrupt=True)
self.env['runtime']['cursorManager'].clearMarks()
else:
self.env['runtime']['outputManager'].presentText("Set window beginn and end marks", interrupt=True)
def setCallback(self, callback):
pass