# Path: androguard/gui/TextDecorators.py
# class RangePen(PageDecorator):
#     def __init__(self, decorated, a, b, pen, ignoreHighlights=True):
#         super().__init__(decorated)
# 
#         self.dataModel = decorated.getDataModel()
#         self.decorated = decorated
#         self.a = a
#         self.b = b
#         self.pen = pen
#         self.already = False
#         self.ignoreHighlights = ignoreHighlights
# 
#     def decorate(self, pageOffset=None):
#         self.page = self.decorated.decorate(pageOffset)
#         self.PenInterval = self.decorated.PenInterval
#         self.brushMap = self.decorated.brushMap
#         self.penMap = self.decorated.penMap
# 
#         if not self.already:
#             self.addPenInterval(self.a, self.b, self.ignoreHighlights, self.pen)
#             self.already = True
# 
#         return self.page
# 
# Path: androguard/gui/cemu.py
# class Cursor:
# class ConsoleEmulator:
#     def __init__(self, x, y):
#     def move(self, dx, dy):
#     def moveAbsolute(self, x, y):
#     def getPosition(self):
# def enum(**enums):
#     def __init__(self, qp, rows, cols):
#     def incrementPosition(self):
#     def newLine(self):
#     def LF(self):
#     def CR(self):
#     def _validatePosition(self, x, y):
#     def write(self, s, noBackgroudOnSpaces=False):
#     def write_c(self, c, noBackgroudOnSpaces=False):
#     def getXY(self):
#     def writeAt(self, x, y, s, noBackgroudOnSpaces=False):
#     def writeAt_c(self, x, y, c, noBackgroudOnSpaces=False):
#     def writeLn(self):
#     def gotoXY(self, x, y):


import string
import os
        import random
from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.uic import loadUi
from androguard.gui.TextDecorators import RangePen
from androguard.gui.ViewMode import ViewMode
from androguard.gui.cemu import Directions, ConsoleEmulator
from androguard.gui import TextSelection
                    qp.setBackgroundMode(1)
                    qp.setBackground(self.transformationEngine.chooseBrush(idx))

                c = self.getDisplayablePage()[idx]

                hex_s = str(hex(c)[2:]).zfill(2) + ' '

                if dx < 0:
                    cemu.writeAt((self.COLUMNS - (column + 1)) * 3, i, hex_s, noBackgroudOnSpaces=True)
                    cemu.writeAt(textBegining + self.COLUMNS - (column + 1), i, self.cp437(c))

                if dx > 0:
                    cemu.writeAt(column * 3, i, hex_s, noBackgroudOnSpaces=True)
                    cemu.writeAt(textBegining + column, i, self.cp437(c))

                qp.setBackgroundMode(0)

        qp.end()

    def scroll_v(self, dy):
        self.qpix.scroll(0, dy * self.fontHeight, self.qpix.rect())

        qp = QtGui.QPainter()

        qp.begin(self.qpix)
        qp.setFont(self.font)
        qp.setPen(self.textPen)

        factor = abs(dy)


# Path: androguard/gui/TextDecorators.py
# class RangePen(PageDecorator):
#     def __init__(self, decorated, a, b, pen, ignoreHighlights=True):
#         super().__init__(decorated)
# 
#         self.dataModel = decorated.getDataModel()
#         self.decorated = decorated
#         self.a = a
#         self.b = b
#         self.pen = pen
#         self.already = False
#         self.ignoreHighlights = ignoreHighlights
# 
#     def decorate(self, pageOffset=None):
#         self.page = self.decorated.decorate(pageOffset)
#         self.PenInterval = self.decorated.PenInterval
#         self.brushMap = self.decorated.brushMap
#         self.penMap = self.decorated.penMap
# 
#         if not self.already:
#             self.addPenInterval(self.a, self.b, self.ignoreHighlights, self.pen)
#             self.already = True
# 
#         return self.page
# 
# Path: androguard/gui/cemu.py
# class Cursor:
# class ConsoleEmulator:
#     def __init__(self, x, y):
#     def move(self, dx, dy):
#     def moveAbsolute(self, x, y):
#     def getPosition(self):
# def enum(**enums):
#     def __init__(self, qp, rows, cols):
#     def incrementPosition(self):
#     def newLine(self):
#     def LF(self):
#     def CR(self):
#     def _validatePosition(self, x, y):
#     def write(self, s, noBackgroudOnSpaces=False):
#     def write_c(self, c, noBackgroudOnSpaces=False):
#     def getXY(self):
#     def writeAt(self, x, y, s, noBackgroudOnSpaces=False):
#     def writeAt_c(self, x, y, c, noBackgroudOnSpaces=False):
#     def writeLn(self):
#     def gotoXY(self, x, y):


# Path: androguard/gui/HexViewMode.py
import string
import os
        import random
from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.uic import loadUi
from androguard.gui.TextDecorators import RangePen
from androguard.gui.ViewMode import ViewMode
from androguard.gui.cemu import Directions, ConsoleEmulator
from androguard.gui import TextSelection

                    qp.setBackgroundMode(1)
                    qp.setBackground(self.transformationEngine.chooseBrush(idx))

                c = self.getDisplayablePage()[idx]

                hex_s = str(hex(c)[2:]).zfill(2) + ' '

                if dx < 0:
                    cemu.writeAt((self.COLUMNS - (column + 1)) * 3, i, hex_s, noBackgroudOnSpaces=True)
                    cemu.writeAt(textBegining + self.COLUMNS - (column + 1), i, self.cp437(c))

                if dx > 0:
                    cemu.writeAt(column * 3, i, hex_s, noBackgroudOnSpaces=True)
                    cemu.writeAt(textBegining + column, i, self.cp437(c))

                qp.setBackgroundMode(0)

        qp.end()

    def scroll_v(self, dy):
        self.qpix.scroll(0, dy * self.fontHeight, self.qpix.rect())

        qp = QtGui.QPainter()

        qp.begin(self.qpix)
        qp.setFont(self.font)
        qp.setPen(self.textPen)

        factor = abs(dy)


        cemu = ConsoleEmulator(qp, self.ROWS, self.CON_COLUMNS)