# 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


from androguard.gui.ViewMode import ViewMode
from androguard.gui.cemu import ConsoleEmulator
from androguard.gui import TextSelection
from PyQt5 import QtGui, QtCore
        self.COLUMNS = self.width // self.fontWidth
        self.ROWS = self.height // self.fontHeight
        self.notify(self.ROWS, self.COLUMNS)

    def getPixmap(self):
        for t in self.Ops:
            if len(t) == 1:
                t[0]()

            else:
                t[0](*t[1:])

        self.Ops = []

        if not self.newPix:
            self.draw()

        return self.newPix

    def getDataModel(self):
        return self.dataModel

    def getPageOffset(self):
        return self.dataModel.getOffset()

    def getGeometry(self):
        return self.COLUMNS, self.ROWS

    def draw(self, refresh=False):
        if self.dataModel.getOffset() in self.Paints:

# 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


# Path: androguard/gui/SourceViewMode.py
from androguard.gui.ViewMode import ViewMode
from androguard.gui.cemu import ConsoleEmulator
from androguard.gui import TextSelection
from PyQt5 import QtGui, QtCore

        self.COLUMNS = self.width // self.fontWidth
        self.ROWS = self.height // self.fontHeight
        self.notify(self.ROWS, self.COLUMNS)

    def getPixmap(self):
        for t in self.Ops:
            if len(t) == 1:
                t[0]()

            else:
                t[0](*t[1:])

        self.Ops = []

        if not self.newPix:
            self.draw()

        return self.newPix

    def getDataModel(self):
        return self.dataModel

    def getPageOffset(self):
        return self.dataModel.getOffset()

    def getGeometry(self):
        return self.COLUMNS, self.ROWS

    def draw(self, refresh=False):
        if self.dataModel.getOffset() in self.Paints:

            self.refresh = False