# Path: androguard/gui/cemu.py
# class ConsoleEmulator:
#     def __init__(self, qp, rows, cols):
#         self.qp = qp
#         self._x = 0
#         self._y = 0
#         self._rows = rows
#         self._cols = cols
# 
#         fm = QtGui.QFontMetrics(self.qp.font())
#         self.fontWidth = fm.width('a')
#         self.fontHeight = fm.height()
# 
#     def incrementPosition(self):
#         if self._x < self._cols - 1:
#             self._x += 1
#         else:
#             self._x = 0
#             self._y += 1
# 
#     def newLine(self):
#         self.LF()
#         self.CR()
# 
#     def LF(self):
#         if self._y < self._rows:
#             self._y += 1
# 
#     def CR(self):
#         self._x = 0
# 
#     def _validatePosition(self, x, y):
#         if x >= self._cols:
#             log.warning("x > cols")
#             return False
# 
#         if y >= self._rows:
#             log.warning("y > rows")
#             return False
#         return True
# 
#     def write(self, s, noBackgroudOnSpaces=False):
#         background = self.qp.backgroundMode()
#         for c in s:
#             if self._validatePosition(self._x, self._y):
#                 if noBackgroudOnSpaces and c == ' ':
#                     self.qp.setBackgroundMode(0)
# 
#                 self.qp.drawText(self._x * self.fontWidth, self.fontHeight + self._y * self.fontHeight, c)
#                 self.incrementPosition()
#         self.qp.setBackgroundMode(background)
# 
#     def write_c(self, c, noBackgroudOnSpaces=False):
#         background = self.qp.backgroundMode()
#         if self._validatePosition(self._x, self._y):
#             if noBackgroudOnSpaces and c == ' ':
#                 self.qp.setBackgroundMode(0)
# 
#             self.qp.drawText(self._x * self.fontWidth, self.fontHeight + self._y * self.fontHeight, c)
#             self.incrementPosition()
#         self.qp.setBackgroundMode(background)
# 
#     def getXY(self):
#         return self._x, self._y
# 
#     def writeAt(self, x, y, s, noBackgroudOnSpaces=False):
#         self.gotoXY(x, y)
#         self.write(s, noBackgroudOnSpaces)
# 
#     def writeAt_c(self, x, y, c, noBackgroudOnSpaces=False):
#         self.gotoXY(x, y)
#         self.write_c(c, noBackgroudOnSpaces)
# 
#     def writeLn(self):
#         if True:  # self._validatePosition(self._x, self._y):
#             self._y += 1
#             self._x = 0
# 
#     def gotoXY(self, x, y):
#         if self._validatePosition(x, y):
#             self._x = x
#             self._y = y
# 
# def enum(**enums):
#     return type('Enum', (), enums)


from PyQt5 import QtGui, QtCore
from androguard.gui.cemu import ConsoleEmulator, enum
        sq = 'QWORD: {}'.format(qword)

        byte = self.dataModel.getBYTE(self.viewMode.getCursorAbsolutePosition(), asString=True)
        if byte is None:
            byte = '-'

        sb = 'BYTE: {}'.format(byte)

        cemu.writeAt(1, 0, pos)
        cemu.writeAt(17, 0, sd)
        cemu.writeAt(35, 0, sq)
        cemu.writeAt(62, 0, sb)

        qp.drawLine(15 * self.fontWidth + 5, 0, 15 * self.fontWidth + 5, 50)
        qp.drawLine(33 * self.fontWidth + 5, 0, 33 * self.fontWidth + 5, 50)
        qp.drawLine(59 * self.fontWidth + 5, 0, 59 * self.fontWidth + 5, 50)
        qp.drawLine(71 * self.fontWidth + 5, 0, 71 * self.fontWidth + 5, 50)

        if self.viewMode.selector.getCurrentSelection():
            u, v = self.viewMode.selector.getCurrentSelection()
            if u != v:
                pen = QtGui.QPen(QtGui.QColor(51, 153, 255), 0, QtCore.Qt.SolidLine)
                qp.setPen(pen)

                cemu.writeAt(73, 0, 'Selection: ')
                cemu.write('{:x}:{}'.format(u, v - u))
        else:
            pen = QtGui.QPen(QtGui.QColor(128, 128, 128), 0, QtCore.Qt.SolidLine)
            qp.setPen(pen)


# Path: androguard/gui/cemu.py
# class ConsoleEmulator:
#     def __init__(self, qp, rows, cols):
#         self.qp = qp
#         self._x = 0
#         self._y = 0
#         self._rows = rows
#         self._cols = cols
# 
#         fm = QtGui.QFontMetrics(self.qp.font())
#         self.fontWidth = fm.width('a')
#         self.fontHeight = fm.height()
# 
#     def incrementPosition(self):
#         if self._x < self._cols - 1:
#             self._x += 1
#         else:
#             self._x = 0
#             self._y += 1
# 
#     def newLine(self):
#         self.LF()
#         self.CR()
# 
#     def LF(self):
#         if self._y < self._rows:
#             self._y += 1
# 
#     def CR(self):
#         self._x = 0
# 
#     def _validatePosition(self, x, y):
#         if x >= self._cols:
#             log.warning("x > cols")
#             return False
# 
#         if y >= self._rows:
#             log.warning("y > rows")
#             return False
#         return True
# 
#     def write(self, s, noBackgroudOnSpaces=False):
#         background = self.qp.backgroundMode()
#         for c in s:
#             if self._validatePosition(self._x, self._y):
#                 if noBackgroudOnSpaces and c == ' ':
#                     self.qp.setBackgroundMode(0)
# 
#                 self.qp.drawText(self._x * self.fontWidth, self.fontHeight + self._y * self.fontHeight, c)
#                 self.incrementPosition()
#         self.qp.setBackgroundMode(background)
# 
#     def write_c(self, c, noBackgroudOnSpaces=False):
#         background = self.qp.backgroundMode()
#         if self._validatePosition(self._x, self._y):
#             if noBackgroudOnSpaces and c == ' ':
#                 self.qp.setBackgroundMode(0)
# 
#             self.qp.drawText(self._x * self.fontWidth, self.fontHeight + self._y * self.fontHeight, c)
#             self.incrementPosition()
#         self.qp.setBackgroundMode(background)
# 
#     def getXY(self):
#         return self._x, self._y
# 
#     def writeAt(self, x, y, s, noBackgroudOnSpaces=False):
#         self.gotoXY(x, y)
#         self.write(s, noBackgroudOnSpaces)
# 
#     def writeAt_c(self, x, y, c, noBackgroudOnSpaces=False):
#         self.gotoXY(x, y)
#         self.write_c(c, noBackgroudOnSpaces)
# 
#     def writeLn(self):
#         if True:  # self._validatePosition(self._x, self._y):
#             self._y += 1
#             self._x = 0
# 
#     def gotoXY(self, x, y):
#         if self._validatePosition(x, y):
#             self._x = x
#             self._y = y
# 
# def enum(**enums):
#     return type('Enum', (), enums)


# Path: androguard/gui/Banners.py
from PyQt5 import QtGui, QtCore
from androguard.gui.cemu import ConsoleEmulator, enum

        sq = 'QWORD: {}'.format(qword)

        byte = self.dataModel.getBYTE(self.viewMode.getCursorAbsolutePosition(), asString=True)
        if byte is None:
            byte = '-'

        sb = 'BYTE: {}'.format(byte)

        cemu.writeAt(1, 0, pos)
        cemu.writeAt(17, 0, sd)
        cemu.writeAt(35, 0, sq)
        cemu.writeAt(62, 0, sb)

        qp.drawLine(15 * self.fontWidth + 5, 0, 15 * self.fontWidth + 5, 50)
        qp.drawLine(33 * self.fontWidth + 5, 0, 33 * self.fontWidth + 5, 50)
        qp.drawLine(59 * self.fontWidth + 5, 0, 59 * self.fontWidth + 5, 50)
        qp.drawLine(71 * self.fontWidth + 5, 0, 71 * self.fontWidth + 5, 50)

        if self.viewMode.selector.getCurrentSelection():
            u, v = self.viewMode.selector.getCurrentSelection()
            if u != v:
                pen = QtGui.QPen(QtGui.QColor(51, 153, 255), 0, QtCore.Qt.SolidLine)
                qp.setPen(pen)

                cemu.writeAt(73, 0, 'Selection: ')
                cemu.write('{:x}:{}'.format(u, v - u))
        else:
            pen = QtGui.QPen(QtGui.QColor(128, 128, 128), 0, QtCore.Qt.SolidLine)
            qp.setPen(pen)


            cemu.writeAt(73, 0, '<no selection>')