From 2ea89a0559539f44f4431a64060f217598ac9e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 16:19:07 +0100 Subject: [PATCH 001/148] Initial commit. --- mirc2png.py | 204 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100755 mirc2png.py diff --git a/mirc2png.py b/mirc2png.py new file mode 100755 index 0000000..ab88412 --- /dev/null +++ b/mirc2png.py @@ -0,0 +1,204 @@ +#!/usr/bin/env python3 +# +# mirc2png -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from enum import Enum +from PIL import Image, ImageDraw, ImageFont +import string, sys + +class MiRCART: + """Abstraction over ASCIIs containing mIRC control codes""" + + # {{{ mIRC colour number to RGBA map given ^B (bold) + ColourMapBold = [ + (255, 255, 255, 255), # White + (85, 85, 85, 255), # Grey + (85, 85, 255, 255), # Light Blue + (85, 255, 85, 255), # Light Green + (255, 85, 85, 255), # Light Red + (255, 85, 85, 255), # Light Red + (255, 85, 255, 255), # Pink + (255, 255, 85, 255), # Light Yellow + (255, 255, 85, 255), # Light Yellow + (85, 255, 85, 255), # Light Green + (85, 255, 255, 255), # Light Cyan + (85, 255, 255, 255), # Light Cyan + (85, 85, 255, 255), # Light Blue + (255, 85, 255, 255), # Pink + (85, 85, 85, 255), # Grey + (255, 255, 255, 255), # White + ] + # }}} + # {{{ mIRC colour number to RGBA map given none of ^[BFV_] (bold, italic, reverse, underline) + ColourMapNormal = [ + (255, 255, 255, 255), # White + (0, 0, 0, 255), # Black + (0, 0, 187, 255), # Blue + (0, 187, 0, 255), # Green + (255, 85, 85, 255), # Light Red + (187, 0, 0, 255), # Red + (187, 0, 187, 255), # Purple + (187, 187, 0, 255), # Yellow + (255, 255, 85, 255), # Light Yellow + (85, 255, 85, 255), # Light Green + (0, 187, 187, 255), # Cyan + (85, 255, 255, 255), # Light Cyan + (85, 85, 255, 255), # Light Blue + (255, 85, 255, 255), # Pink + (85, 85, 85, 255), # Grey + (187, 187, 187, 255), # Light Grey + ] + # }}} + # {{{ Parsing loop state + class State(Enum): + STATE_CHAR = 1 + STATE_COLOUR_SPEC = 2 + # }}} + + inFilePath = inFile = None; + inLines = inColsMax = inRows = None; + + outFontFilePath = outFontSize = None; + outImg = outImgDraw = outImgFont = None; + outCurColourBg = outCurColourFg = None; + outCurX = outCurY = None; + + inCurBold = inCurItalic = inCurReverse = inCurUnderline = None; + inCurColourSpec = None; + state = None; + inCurCol = None; + + # {{{ Calculate widest row in lines, ignoring non-printable & mIRC control code sequences + def getMaxCols(self, lines): + maxCols = 0; + for curRow in range(0, len(lines)): + curRowCols = 0; curState = self.State.STATE_CHAR; + curCol = 0; curColLen = len(lines[curRow]); + while curCol < curColLen: + curChar = lines[curRow][curCol] + if curState == self.State.STATE_CHAR: + if curChar == "": + curState = self.State.STATE_COLOUR_SPEC; curCol += 1; + elif curChar in string.printable: + curRowCols += 1; curCol += 1; + else: + curCol += 1; + elif curState == self.State.STATE_COLOUR_SPEC: + if curChar in set(",0123456789"): + curCol += 1; + else: + curState = self.State.STATE_CHAR; + maxCols = max(maxCols, curRowCols) + return maxCols + # }}} + # {{{ Parse single character as regular character and mutate state + def parseAsChar(self, char): + if char == "": + self.inCurCol += 1; self.inCurBold = 0 if self.inCurBold else 1; + elif char == "": + self.state = self.State.STATE_COLOUR_SPEC; self.inCurCol += 1; + elif char == "": + self.inCurCol += 1; self.inCurItalic = 0 if self.inCurItalic else 1; + elif char == "": + self.inCurCol += 1; + self.inCurBold = 0; self.inCurItalic = 0; self.inCurReverse = 0; self.inCurUnderline = 0; + self.inCurColourSpec = ""; + elif char == "": + self.inCurCol += 1; self.inCurReverse = 0 if self.inCurReverse else 1; + elif char == "": + self.inCurCol += 1; self.inCurUnderline = 0 if self.inCurUnderline else 1; + elif char == " ": + if self.inCurBold: + self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + 7, self.outCurY + 14)), fill=self.ColourMapBold[self.outCurColourBg]) + else: + self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + 7, self.outCurY + 14)), fill=self.ColourMapNormal[self.outCurColourBg]) + self.outCurX += 7; self.inCurCol += 1; + else: + if self.inCurBold: + self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + 7, self.outCurY + 14)), fill=self.ColourMapBold[self.outCurColourBg]) + # XXX implement italic, reverse, underline + self.outImgDraw.text((self.outCurX, self.outCurY), char, self.ColourMapBold[self.outCurColourFg], self.outImgFont) + else: + self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + 7, self.outCurY + 14)), fill=self.ColourMapNormal[self.outCurColourBg]) + # XXX implement italic, reverse, underline + self.outImgDraw.text((self.outCurX, self.outCurY), char, self.ColourMapNormal[self.outCurColourFg], self.outImgFont) + self.outCurX += 7; self.inCurCol += 1; + # }}} + # {{{ Parse single character as mIRC colour control code sequence and mutate state + def parseAsColourSpec(self, char): + if char in set(",0123456789"): + self.inCurColourSpec += char; self.inCurCol += 1; + else: + self.inCurColourSpec = self.inCurColourSpec.split(",") + if len(self.inCurColourSpec) == 2: + self.outCurColourFg = int(self.inCurColourSpec[0]) + self.outCurColourBg = int(self.inCurColourSpec[1] or self.outCurColourBg) + elif len(self.inCurColourSpec) == 1: + self.outCurColourFg = int(self.inCurColourSpec[0]) + else: + self.outCurColourBg = 1; self.outCurColourFg = 15; + self.inCurColourSpec = ""; self.state = self.State.STATE_CHAR; + # }}} + + # + # Initialisation method + def __init__(self, inFilePath, imgFilePath, fontFilePath, fontSize): + self.inFilePath = inFilePath; self.inFile = open(inFilePath, "r"); + self.inLines = self.inFile.readlines() + self.inColsMax = self.getMaxCols(self.inLines) + self.inRows = len(self.inLines) + self.outFontFilePath = fontFilePath; self.outFontSize = int(fontSize); + self.outImg = Image.new("RGBA", (self.inColsMax * 7, self.inRows * 14), self.ColourMapNormal[1]) + self.outImgDraw = ImageDraw.Draw(self.outImg) + self.outImgFont = ImageFont.truetype(self.outFontFilePath, self.outFontSize) + self.outCurColourBg = 1; self.outCurColourFg = 15; + self.outCurX = 0; self.outCurY = 0; + for inCurRow in range(0, len(self.inLines)): + self.inCurBold = 0; self.inCurItalic = 0; self.inCurReverse = 0; self.inCurUnderline = 0; + self.inCurColourSpec = ""; self.state = self.State.STATE_CHAR; + self.inCurCol = 0; + while self.inCurCol < len(self.inLines[inCurRow]): + if self.state == self.State.STATE_CHAR: + self.parseAsChar(self.inLines[inCurRow][self.inCurCol]) + elif self.state == self.State.STATE_COLOUR_SPEC: + self.parseAsColourSpec(self.inLines[inCurRow][self.inCurCol]) + self.outCurX = 0; self.outCurY += 14; + self.inFile.close(); + self.outImg.save(imgFilePath); + +# +# Entry point +def main(argv0, inFilePath, imgFilePath, fontFilePath, fontSize=11): + _MiRCART = MiRCART(inFilePath, imgFilePath, fontFilePath, fontSize) +if __name__ == "__main__": + if ((len(sys.argv) - 1) < 3)\ + or ((len(sys.argv) - 1) > 4): + print("usage: {} " \ + " " \ + " " \ + " " \ + "[]".format(sys.argv[0]), file=sys.stderr) + else: + main(*sys.argv) + +# vim:expandtab foldmethod=marker sw=8 ts=8 tw=120 From abaa92b53d09e7d30437c7e635ab7f32902c3021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 16:54:39 +0100 Subject: [PATCH 002/148] mirc2png.py:parseAsChar(): implement underline (^_.) mirc2png.py:__init__(): increment self.outCurY by correct row height. --- mirc2png.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/mirc2png.py b/mirc2png.py index ab88412..5442ad6 100755 --- a/mirc2png.py +++ b/mirc2png.py @@ -129,19 +129,25 @@ class MiRCART: self.inCurCol += 1; self.inCurUnderline = 0 if self.inCurUnderline else 1; elif char == " ": if self.inCurBold: - self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + 7, self.outCurY + 14)), fill=self.ColourMapBold[self.outCurColourBg]) + colourBg = self.ColourMapBold[self.outCurColourBg] else: - self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + 7, self.outCurY + 14)), fill=self.ColourMapNormal[self.outCurColourBg]) + colourBg = self.ColourMapNormal[self.outCurColourBg] + self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + 7, self.outCurY + 14)), fill=colourBg) + if self.inCurUnderline: + self.outImgDraw.line((self.outCurX, self.outCurY + 11, self.outCurX + 7, self.outCurY + 11), fill=colourFg) self.outCurX += 7; self.inCurCol += 1; else: if self.inCurBold: - self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + 7, self.outCurY + 14)), fill=self.ColourMapBold[self.outCurColourBg]) - # XXX implement italic, reverse, underline - self.outImgDraw.text((self.outCurX, self.outCurY), char, self.ColourMapBold[self.outCurColourFg], self.outImgFont) + colourBg = self.ColourMapBold[self.outCurColourBg] + colourFg = self.ColourMapBold[self.outCurColourFg] else: - self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + 7, self.outCurY + 14)), fill=self.ColourMapNormal[self.outCurColourBg]) - # XXX implement italic, reverse, underline - self.outImgDraw.text((self.outCurX, self.outCurY), char, self.ColourMapNormal[self.outCurColourFg], self.outImgFont) + colourBg = self.ColourMapNormal[self.outCurColourBg] + colourFg = self.ColourMapNormal[self.outCurColourFg] + self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + 7, self.outCurY + 14)), fill=colourBg) + # XXX implement italic, reverse + self.outImgDraw.text((self.outCurX, self.outCurY), char, colourFg, self.outImgFont) + if self.inCurUnderline: + self.outImgDraw.line((self.outCurX, self.outCurY + 11, self.outCurX + 7, self.outCurY + 11), fill=colourFg) self.outCurX += 7; self.inCurCol += 1; # }}} # {{{ Parse single character as mIRC colour control code sequence and mutate state @@ -182,7 +188,7 @@ class MiRCART: self.parseAsChar(self.inLines[inCurRow][self.inCurCol]) elif self.state == self.State.STATE_COLOUR_SPEC: self.parseAsColourSpec(self.inLines[inCurRow][self.inCurCol]) - self.outCurX = 0; self.outCurY += 14; + self.outCurX = 0; self.outCurY += 13; self.inFile.close(); self.outImg.save(imgFilePath); From 734cc1933341661c3412a2e35c5df93b7dd97a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 16:58:15 +0100 Subject: [PATCH 003/148] DejaVuSansMono.ttf: added to repository for convenience. mirc2png.py:main(): default fontFilePath to `DejaVuSansMono.ttf'. --- DejaVuSansMono.ttf | Bin 0 -> 340712 bytes mirc2png.py | 12 ++++++------ 2 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 DejaVuSansMono.ttf diff --git a/DejaVuSansMono.ttf b/DejaVuSansMono.ttf new file mode 100644 index 0000000000000000000000000000000000000000..f5786022f18216b4c59c6fb0c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Qy19}Ci{VY`~GAvOLl9r)s?<%b--57c5Rvbc=t-5tvu4byxW#1yH6&&CE1B& zON-ZKOJ{8H_ymwE zvhO%$-=6H-hV5IEJ-=%-dw#O#t=Y8)?77$M%bpwUn$GU*ntgWl)V}QMWLHVLYSyMD zO|RM1K0Bm}L(w|zp{%ppI%l^|PWE)STLW2p$l7POZjscQ?9W;Q);inuh@{CY`?AS? zn>^cfTGEw$J=v9gcIDZw$;sL7Z%OtXHQ_nu?3Pc_1p1rnX(6%Srrc-ZAmJOS!bNZ6@ lR#j}h!n)Leu2I`EXkBN!X79MW>(c)}e_Q^Kcjf6@z6RY+?mhqj literal 0 HcmV?d00001 diff --git a/mirc2png.py b/mirc2png.py index 5442ad6..4d88a5a 100755 --- a/mirc2png.py +++ b/mirc2png.py @@ -194,15 +194,15 @@ class MiRCART: # # Entry point -def main(argv0, inFilePath, imgFilePath, fontFilePath, fontSize=11): +def main(argv0, inFilePath, imgFilePath, fontFilePath="DejaVuSansMono.ttf", fontSize=11): _MiRCART = MiRCART(inFilePath, imgFilePath, fontFilePath, fontSize) if __name__ == "__main__": - if ((len(sys.argv) - 1) < 3)\ + if ((len(sys.argv) - 1) < 2)\ or ((len(sys.argv) - 1) > 4): - print("usage: {} " \ - " " \ - " " \ - " " \ + print("usage: {} " \ + " " \ + " " \ + "[] " \ "[]".format(sys.argv[0]), file=sys.stderr) else: main(*sys.argv) From 2d397ad4cfeeaa549c93c2d80ab5a8e74de6c83d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 17:03:15 +0100 Subject: [PATCH 004/148] README.md: added to repository. --- README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..1dc207d --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# mirc2png -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) +* Prerequisites: python3 && python3-pil on Debian-family Linux distributions +* Usage: ./mirc2png.py `` `` [``] [``] From 1c664f26e009c829cfd4b4c6b07131d87b8ed038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 19:16:09 +0100 Subject: [PATCH 005/148] .gitignore: added to repository. --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dbec55f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.sw[op] From 89e244890c40df95f173c563f5d0ef2d31a6fa9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 20:50:40 +0100 Subject: [PATCH 006/148] .gitignore: ignore __pycache__/. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index dbec55f..7a00c01 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +__pycache__/ *.sw[op] From 93946c3bc9ef0808e1a1a3c5e4c9da3201142521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 20:51:06 +0100 Subject: [PATCH 007/148] mirc2png.py: fix class declaration & commenting style. --- mirc2png.py | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/mirc2png.py b/mirc2png.py index 4d88a5a..7cd95f5 100755 --- a/mirc2png.py +++ b/mirc2png.py @@ -28,8 +28,20 @@ import string, sys class MiRCART: """Abstraction over ASCIIs containing mIRC control codes""" + inFilePath = inFile = None; + inLines = inColsMax = inRows = None; - # {{{ mIRC colour number to RGBA map given ^B (bold) + outFontFilePath = outFontSize = None; + outImg = outImgDraw = outImgFont = None; + outCurColourBg = outCurColourFg = None; + outCurX = outCurY = None; + + inCurBold = inCurItalic = inCurReverse = inCurUnderline = None; + inCurColourSpec = None; + state = None; + inCurCol = None; + + # {{{ ColourMapBold: mIRC colour number to RGBA map given ^B (bold) ColourMapBold = [ (255, 255, 255, 255), # White (85, 85, 85, 255), # Grey @@ -49,7 +61,7 @@ class MiRCART: (255, 255, 255, 255), # White ] # }}} - # {{{ mIRC colour number to RGBA map given none of ^[BFV_] (bold, italic, reverse, underline) + # {{{ ColourMapNormal: mIRC colour number to RGBA map given none of ^[BFV_] (bold, italic, reverse, underline) ColourMapNormal = [ (255, 255, 255, 255), # White (0, 0, 0, 255), # Black @@ -69,26 +81,13 @@ class MiRCART: (187, 187, 187, 255), # Light Grey ] # }}} - # {{{ Parsing loop state + # {{{ State: Parsing loop state class State(Enum): STATE_CHAR = 1 STATE_COLOUR_SPEC = 2 # }}} - inFilePath = inFile = None; - inLines = inColsMax = inRows = None; - - outFontFilePath = outFontSize = None; - outImg = outImgDraw = outImgFont = None; - outCurColourBg = outCurColourFg = None; - outCurX = outCurY = None; - - inCurBold = inCurItalic = inCurReverse = inCurUnderline = None; - inCurColourSpec = None; - state = None; - inCurCol = None; - - # {{{ Calculate widest row in lines, ignoring non-printable & mIRC control code sequences + # {{{ getMaxCols(): Calculate widest row in lines, ignoring non-printable & mIRC control code sequences def getMaxCols(self, lines): maxCols = 0; for curRow in range(0, len(lines)): @@ -111,7 +110,7 @@ class MiRCART: maxCols = max(maxCols, curRowCols) return maxCols # }}} - # {{{ Parse single character as regular character and mutate state + # {{{ parseAsChar(): Parse single character as regular character and mutate state def parseAsChar(self, char): if char == "": self.inCurCol += 1; self.inCurBold = 0 if self.inCurBold else 1; @@ -150,7 +149,7 @@ class MiRCART: self.outImgDraw.line((self.outCurX, self.outCurY + 11, self.outCurX + 7, self.outCurY + 11), fill=colourFg) self.outCurX += 7; self.inCurCol += 1; # }}} - # {{{ Parse single character as mIRC colour control code sequence and mutate state + # {{{ parseAsColourSpec(): Parse single character as mIRC colour control code sequence and mutate state def parseAsColourSpec(self, char): if char in set(",0123456789"): self.inCurColourSpec += char; self.inCurCol += 1; @@ -165,9 +164,7 @@ class MiRCART: self.outCurColourBg = 1; self.outCurColourFg = 15; self.inCurColourSpec = ""; self.state = self.State.STATE_CHAR; # }}} - - # - # Initialisation method + # {{{ Initialisation method def __init__(self, inFilePath, imgFilePath, fontFilePath, fontSize): self.inFilePath = inFilePath; self.inFile = open(inFilePath, "r"); self.inLines = self.inFile.readlines() @@ -191,6 +188,7 @@ class MiRCART: self.outCurX = 0; self.outCurY += 13; self.inFile.close(); self.outImg.save(imgFilePath); + # }}} # # Entry point From 5f4aa470b94c42d66b8892080366e2e75c7ddc90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 20:51:32 +0100 Subject: [PATCH 008/148] README.md: add pngbot.py prerequisites. pngbot.py: initial commit (requires python3-{json,requests,urllib3}.) --- README.md | 2 +- pngbot.py | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 136 insertions(+), 1 deletion(-) create mode 100755 pngbot.py diff --git a/README.md b/README.md index 1dc207d..2272eba 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # mirc2png -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) -* Prerequisites: python3 && python3-pil on Debian-family Linux distributions +* Prerequisites: python3 && python3-pil (&& python3-{json,requests,urllib3} for pngbot.py) on Debian-family Linux distributions * Usage: ./mirc2png.py `` `` [``] [``] diff --git a/pngbot.py b/pngbot.py new file mode 100755 index 0000000..8a6a45e --- /dev/null +++ b/pngbot.py @@ -0,0 +1,135 @@ +#!/usr/bin/env python3 +# +# mirc2png -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from itertools import chain +import base64 +import json +import mirc2png +import os, socket, sys +import requests +import urllib.request + +class IrcBot: + """Blocking abstraction over the IRC protocol""" + serverHname = serverPort = None; + clientNick = clientIdent = clientGecos = None; + clientSocket = clientSocketFile = None; + + # {{{ connect(): Connect to server and register + def connect(self): + self.clientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self.clientSocket.connect((self.serverHname, int(self.serverPort))) + self.clientSocketFile = self.clientSocket.makefile() + self.sendline("NICK", self.clientNick) + self.sendline("USER", self.clientIdent, "0", "0", self.clientGecos) + # }}} + # {{{ close(): Close connection to server + def close(self): + self.clientSocket.close() + self.clientSocket = self.clientSocketFile = None; + # }}} + # {{{ readline(): Read and parse single line from server into canonicalised list + def readline(self): + msg = self.clientSocketFile.readline() + if len(msg): + msg = msg.rstrip("\r\n") + else: + return None + msg = msg.split(" :", 1) + if len(msg) == 1: + msg = list(chain.from_iterable(m.split(" ") for m in msg)) + elif len(msg) == 2: + msg = msg[0].split(" ") + [msg[1]] + if msg[0][0] == ':': + msg = [msg[0][1:]] + msg[1:] + else: + msg = [""] + msg[1:] + return msg + # }}} + # {{{ sendline(): Parse and send single line to server from list + def sendline(self, *args): + msg = ""; argNumMax = len(args); + for argNum in range(0, argNumMax): + if argNum == (argNumMax - 1): + msg += ":" + args[argNum] + else: + msg += args[argNum] + " " + return self.clientSocket.send((msg + "\r\n").encode()) + # }}} + # {{{ Initialisation method + def __init__(self, serverHname, serverPort, clientNick, clientIdent, clientGecos): + self.serverHname = serverHname; self.serverPort = serverPort; + self.clientNick = clientNick; self.clientIdent = clientIdent; self.clientGecos = clientGecos; + # }}} + +# +# Entry point +def main(argv0, ircServerHname, ircServerPort="6667", ircClientNick="pngbot", ircClientIdent="pngbot", ircClientGecos="pngbot", ircClientChannel="#MiRCART"): + _IrcBot = IrcBot(ircServerHname, ircServerPort, ircClientNick, ircClientIdent, ircClientGecos) + print("Connecting to {}:{}...".format(ircServerHname, ircServerPort)) + _IrcBot.connect() + print("Connected to {}:{}.".format(ircServerHname, ircServerPort)) + print("Registering on {}:{} as {}, {}, {}...".format(ircServerHname, ircServerPort, ircClientNick, ircClientIdent, ircClientGecos)) + while True: + ircServerMessage = _IrcBot.readline() + if ircServerMessage == None: + print("Disconnected from {}:{}.".format(ircServerHname, ircServerPort)) + _IrcBot.close(); break; + elif ircServerMessage[1] == "001": + print("Registered on {}:{} as {}, {}, {}.".format(ircServerHname, ircServerPort, ircClientNick, ircClientIdent, ircClientGecos)) + print("Joining {} on {}:{}...".format(ircClientChannel, ircServerHname, ircServerPort)) + _IrcBot.sendline("JOIN", ircClientChannel) + elif ircServerMessage[1] == "PING": + _IrcBot.sendline("PONG", ircServerMessage[2]) + elif ircServerMessage[1] == "PRIVMSG" \ + and ircServerMessage[2] == ircClientChannel \ + and ircServerMessage[3].startswith("!pngbot "): + asciiUrl = ircServerMessage[3].split(" ")[1] + asciiTmpFilePath = "tmp.txt"; imgTmpFilePath = "tmp.png"; + if os.path.isfile(asciiTmpFilePath): + os.remove(asciiTmpFilePath) + if os.path.isfile(imgTmpFilePath): + os.remove(imgTmpFilePath) + urllib.request.urlretrieve(asciiUrl, asciiTmpFilePath) + _MiRCART = mirc2png.MiRCART(asciiTmpFilePath, imgTmpFilePath, "DejaVuSansMono.ttf", 11) + imgurResponseHttp = requests.post("https://api.imgur.com/3/upload.json", data={"key":"c9a6efb3d7932fd", "image":base64.b64encode(open(imgTmpFilePath, "rb").read()), "type":"base64", "name":"tmp.png", "title":"tmp.png"}, headers={"Authorization": "Client-ID c9a6efb3d7932fd"}) + imgurResponse = json.loads(imgurResponseHttp.text) + imgurResponseUrl = imgurResponse.get("data").get("link") + _IrcBot.sendline("PRIVMSG", ircServerMessage[2], "Uploaded as {}".format(imgurResponseUrl)) + os.remove(asciiTmpFilePath); os.remove(imgTmpFilePath); + +if __name__ == "__main__": + if ((len(sys.argv) - 1) < 1)\ + or ((len(sys.argv) - 1) > 4): + print("usage: {} " \ + " " \ + "[] " \ + "[] " \ + "[] " \ + "[] " \ + "[] ".format(sys.argv[0]), file=sys.stderr) + else: + main(*sys.argv) + +# vim:expandtab foldmethod=marker sw=8 ts=8 tw=120 From b94d3afdb5c4c659061dcb72f1556d10836357f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 21:54:02 +0100 Subject: [PATCH 009/148] pngbot.py: convert to lower case when comparing channel names. --- pngbot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pngbot.py b/pngbot.py index 8a6a45e..afddc1a 100755 --- a/pngbot.py +++ b/pngbot.py @@ -102,8 +102,8 @@ def main(argv0, ircServerHname, ircServerPort="6667", ircClientNick="pngbot", ir _IrcBot.sendline("JOIN", ircClientChannel) elif ircServerMessage[1] == "PING": _IrcBot.sendline("PONG", ircServerMessage[2]) - elif ircServerMessage[1] == "PRIVMSG" \ - and ircServerMessage[2] == ircClientChannel \ + elif ircServerMessage[1] == "PRIVMSG" \ + and ircServerMessage[2].lower() == ircClientChannel.lower() \ and ircServerMessage[3].startswith("!pngbot "): asciiUrl = ircServerMessage[3].split(" ")[1] asciiTmpFilePath = "tmp.txt"; imgTmpFilePath = "tmp.png"; From e091920bda5ec3f40af3f60e0a8da2f5ff9acb1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 21:57:21 +0100 Subject: [PATCH 010/148] pngbot.py: handle HTTP status codes differing from 200. pngbot.py: update IRC message text. --- pngbot.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pngbot.py b/pngbot.py index afddc1a..5bc33b7 100755 --- a/pngbot.py +++ b/pngbot.py @@ -115,8 +115,11 @@ def main(argv0, ircServerHname, ircServerPort="6667", ircClientNick="pngbot", ir _MiRCART = mirc2png.MiRCART(asciiTmpFilePath, imgTmpFilePath, "DejaVuSansMono.ttf", 11) imgurResponseHttp = requests.post("https://api.imgur.com/3/upload.json", data={"key":"c9a6efb3d7932fd", "image":base64.b64encode(open(imgTmpFilePath, "rb").read()), "type":"base64", "name":"tmp.png", "title":"tmp.png"}, headers={"Authorization": "Client-ID c9a6efb3d7932fd"}) imgurResponse = json.loads(imgurResponseHttp.text) - imgurResponseUrl = imgurResponse.get("data").get("link") - _IrcBot.sendline("PRIVMSG", ircServerMessage[2], "Uploaded as {}".format(imgurResponseUrl)) + if imgurResponse.status_code == 200: + imgurResponseUrl = imgurResponse.get("data").get("link") + _IrcBot.sendline("PRIVMSG", ircServerMessage[2], "8/!\\ Uploaded as: {}".format(imgurResponseUrl)) + else: + _IrcBot.sendline("PRIVMSG", ircServerMessage[2], "4/!\\ Uploaded failed with HTTP status code {}!".format(imgurResponse.status_code)) os.remove(asciiTmpFilePath); os.remove(imgTmpFilePath); if __name__ == "__main__": From 4c5755d2fc552f46903ec783bfefd1c7d80c9cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 22:02:36 +0100 Subject: [PATCH 011/148] pngbot.py: rate-limit `!pngbot' processing to once (1) each 45 seconds. --- pngbot.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pngbot.py b/pngbot.py index 5bc33b7..16cfa19 100755 --- a/pngbot.py +++ b/pngbot.py @@ -26,7 +26,7 @@ from itertools import chain import base64 import json import mirc2png -import os, socket, sys +import os, socket, sys, time import requests import urllib.request @@ -92,6 +92,7 @@ def main(argv0, ircServerHname, ircServerPort="6667", ircClientNick="pngbot", ir print("Connected to {}:{}.".format(ircServerHname, ircServerPort)) print("Registering on {}:{} as {}, {}, {}...".format(ircServerHname, ircServerPort, ircClientNick, ircClientIdent, ircClientGecos)) while True: + ircClientLastMessage = int(time.time()) ircServerMessage = _IrcBot.readline() if ircServerMessage == None: print("Disconnected from {}:{}.".format(ircServerHname, ircServerPort)) @@ -105,6 +106,10 @@ def main(argv0, ircServerHname, ircServerPort="6667", ircClientNick="pngbot", ir elif ircServerMessage[1] == "PRIVMSG" \ and ircServerMessage[2].lower() == ircClientChannel.lower() \ and ircServerMessage[3].startswith("!pngbot "): + if (int(time.time()) - ircClientLastMessage) < 45: + continue + else: + ircClientLastMessage = int(time.time()) asciiUrl = ircServerMessage[3].split(" ")[1] asciiTmpFilePath = "tmp.txt"; imgTmpFilePath = "tmp.png"; if os.path.isfile(asciiTmpFilePath): From 4f56b9c78393d1ace6c7309d69c9a2b3ab5d7880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 22:20:20 +0100 Subject: [PATCH 012/148] pngbot.py: splits main into class IrcMiRCARTBot. pngbot.py:IrcBot.close(): only close() clientSocket if non-None. pngbot.py:IrcMiRCARTBot.connect(): correctly zero-initialise clientLastMessage. pngbot.py:IrcMiRCARTBot.dispatch(): fix imgurResponseHttp.status_code reference. --- pngbot.py | 103 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 62 insertions(+), 41 deletions(-) mode change 100755 => 100644 pngbot.py diff --git a/pngbot.py b/pngbot.py old mode 100755 new mode 100644 index 16cfa19..aed396f --- a/pngbot.py +++ b/pngbot.py @@ -46,7 +46,8 @@ class IrcBot: # }}} # {{{ close(): Close connection to server def close(self): - self.clientSocket.close() + if self.clientSocket != None: + self.clientSocket.close() self.clientSocket = self.clientSocketFile = None; # }}} # {{{ readline(): Read and parse single line from server into canonicalised list @@ -83,49 +84,69 @@ class IrcBot: self.clientNick = clientNick; self.clientIdent = clientIdent; self.clientGecos = clientGecos; # }}} +class IrcMiRCARTBot(IrcBot): + """IRC<->MiRCART bot""" + clientLastMessage = clientChannel = None + + # {{{ connect(): Connect to server and (re)initialise + def connect(self): + print("Connecting to {}:{}...".format(self.serverHname, self.serverPort)) + super().connect() + print("Connected to {}:{}.".format(self.serverHname, self.serverPort)) + print("Registering on {}:{} as {}, {}, {}...".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) + self.clientLastMessage = 0 + # }}} + # {{{ dispatch(): Read, parse, and dispatch single line from server + def dispatch(self): + while True: + serverMessage = self.readline() + if serverMessage == None: + print("Disconnected from {}:{}.".format(self.serverHname, self.serverPort)) + self.close(); break; + elif serverMessage[1] == "001": + print("Registered on {}:{} as {}, {}, {}.".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) + print("Joining {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) + self.sendline("JOIN", self.clientChannel) + elif serverMessage[1] == "PING": + self.sendline("PONG", serverMessage[2]) + elif serverMessage[1] == "PRIVMSG" \ + and serverMessage[2].lower() == self.clientChannel.lower() \ + and serverMessage[3].startswith("!pngbot "): + if (int(time.time()) - self.clientLastMessage) < 45: + continue + else: + self.clientLastMessage = int(time.time()) + asciiUrl = serverMessage[3].split(" ")[1] + asciiTmpFilePath = "tmp.txt"; imgTmpFilePath = "tmp.png"; + if os.path.isfile(asciiTmpFilePath): + os.remove(asciiTmpFilePath) + if os.path.isfile(imgTmpFilePath): + os.remove(imgTmpFilePath) + urllib.request.urlretrieve(asciiUrl, asciiTmpFilePath) + _MiRCART = mirc2png.MiRCART(asciiTmpFilePath, imgTmpFilePath, "DejaVuSansMono.ttf", 11) + imgurResponseHttp = requests.post("https://api.imgur.com/3/upload.json", data={"key":"c9a6efb3d7932fd", "image":base64.b64encode(open(imgTmpFilePath, "rb").read()), "type":"base64", "name":"tmp.png", "title":"tmp.png"}, headers={"Authorization": "Client-ID c9a6efb3d7932fd"}) + imgurResponse = json.loads(imgurResponseHttp.text) + if imgurResponseHttp.status_code == 200: + imgurResponseUrl = imgurResponse.get("data").get("link") + self.sendline("PRIVMSG", serverMessage[2], "8/!\\ Uploaded as: {}".format(imgurResponseUrl)) + else: + self.sendline("PRIVMSG", serverMessage[2], "4/!\\ Uploaded failed with HTTP status code {}!".format(imgurResponseHttp.status_code)) + os.remove(asciiTmpFilePath); os.remove(imgTmpFilePath); + # }}} + # {{{ Initialisation method + def __init__(self, serverHname, serverPort="6667", clientNick="pngbot", clientIdent="pngbot", clientGecos="pngbot", clientChannel="#MiRCART"): + super().__init__(serverHname, serverPort, clientNick, clientIdent, clientGecos) + self.clientChannel = clientChannel + # }}} + # # Entry point -def main(argv0, ircServerHname, ircServerPort="6667", ircClientNick="pngbot", ircClientIdent="pngbot", ircClientGecos="pngbot", ircClientChannel="#MiRCART"): - _IrcBot = IrcBot(ircServerHname, ircServerPort, ircClientNick, ircClientIdent, ircClientGecos) - print("Connecting to {}:{}...".format(ircServerHname, ircServerPort)) - _IrcBot.connect() - print("Connected to {}:{}.".format(ircServerHname, ircServerPort)) - print("Registering on {}:{} as {}, {}, {}...".format(ircServerHname, ircServerPort, ircClientNick, ircClientIdent, ircClientGecos)) +def main(*argv): + _IrcMiRCARTBot = IrcMiRCARTBot(*argv[1:]) while True: - ircClientLastMessage = int(time.time()) - ircServerMessage = _IrcBot.readline() - if ircServerMessage == None: - print("Disconnected from {}:{}.".format(ircServerHname, ircServerPort)) - _IrcBot.close(); break; - elif ircServerMessage[1] == "001": - print("Registered on {}:{} as {}, {}, {}.".format(ircServerHname, ircServerPort, ircClientNick, ircClientIdent, ircClientGecos)) - print("Joining {} on {}:{}...".format(ircClientChannel, ircServerHname, ircServerPort)) - _IrcBot.sendline("JOIN", ircClientChannel) - elif ircServerMessage[1] == "PING": - _IrcBot.sendline("PONG", ircServerMessage[2]) - elif ircServerMessage[1] == "PRIVMSG" \ - and ircServerMessage[2].lower() == ircClientChannel.lower() \ - and ircServerMessage[3].startswith("!pngbot "): - if (int(time.time()) - ircClientLastMessage) < 45: - continue - else: - ircClientLastMessage = int(time.time()) - asciiUrl = ircServerMessage[3].split(" ")[1] - asciiTmpFilePath = "tmp.txt"; imgTmpFilePath = "tmp.png"; - if os.path.isfile(asciiTmpFilePath): - os.remove(asciiTmpFilePath) - if os.path.isfile(imgTmpFilePath): - os.remove(imgTmpFilePath) - urllib.request.urlretrieve(asciiUrl, asciiTmpFilePath) - _MiRCART = mirc2png.MiRCART(asciiTmpFilePath, imgTmpFilePath, "DejaVuSansMono.ttf", 11) - imgurResponseHttp = requests.post("https://api.imgur.com/3/upload.json", data={"key":"c9a6efb3d7932fd", "image":base64.b64encode(open(imgTmpFilePath, "rb").read()), "type":"base64", "name":"tmp.png", "title":"tmp.png"}, headers={"Authorization": "Client-ID c9a6efb3d7932fd"}) - imgurResponse = json.loads(imgurResponseHttp.text) - if imgurResponse.status_code == 200: - imgurResponseUrl = imgurResponse.get("data").get("link") - _IrcBot.sendline("PRIVMSG", ircServerMessage[2], "8/!\\ Uploaded as: {}".format(imgurResponseUrl)) - else: - _IrcBot.sendline("PRIVMSG", ircServerMessage[2], "4/!\\ Uploaded failed with HTTP status code {}!".format(imgurResponse.status_code)) - os.remove(asciiTmpFilePath); os.remove(imgTmpFilePath); + _IrcMiRCARTBot.connect() + _IrcMiRCARTBot.dispatch() + _IrcMiRCARTBot.close() if __name__ == "__main__": if ((len(sys.argv) - 1) < 1)\ From 3b29343e151346d767909f9377293e7500490228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 22:24:21 +0100 Subject: [PATCH 013/148] mirc2png.py:MiRCART.__init__(): move defaults from main(). --- mirc2png.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mirc2png.py b/mirc2png.py index 7cd95f5..d88ce8b 100755 --- a/mirc2png.py +++ b/mirc2png.py @@ -165,7 +165,7 @@ class MiRCART: self.inCurColourSpec = ""; self.state = self.State.STATE_CHAR; # }}} # {{{ Initialisation method - def __init__(self, inFilePath, imgFilePath, fontFilePath, fontSize): + def __init__(self, inFilePath, imgFilePath, fontFilePath="DejaVuSansMono.ttf", fontSize=11): self.inFilePath = inFilePath; self.inFile = open(inFilePath, "r"); self.inLines = self.inFile.readlines() self.inColsMax = self.getMaxCols(self.inLines) @@ -192,8 +192,8 @@ class MiRCART: # # Entry point -def main(argv0, inFilePath, imgFilePath, fontFilePath="DejaVuSansMono.ttf", fontSize=11): - _MiRCART = MiRCART(inFilePath, imgFilePath, fontFilePath, fontSize) +def main(*argv): + _MiRCART = MiRCART(*argv[1:]) if __name__ == "__main__": if ((len(sys.argv) - 1) < 2)\ or ((len(sys.argv) - 1) > 4): From 4556f8b238278a8c44a2bae8cb0adcec0d3bcc91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 22:25:00 +0100 Subject: [PATCH 014/148] pngbot.py: set +x bit. --- pngbot.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 pngbot.py diff --git a/pngbot.py b/pngbot.py old mode 100644 new mode 100755 From 75e8e5fdf0241d603d2a35f86a3e3ff66fb7ecd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 22:38:10 +0100 Subject: [PATCH 015/148] pngbot.py:IrcMiRCARTBot.uploadToImgur(): split from dispatch(). pngbot.py:IrcMiRCARTBot.dispatch(): only os.remove() if target file exists. --- pngbot.py | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/pngbot.py b/pngbot.py index aed396f..0f95c99 100755 --- a/pngbot.py +++ b/pngbot.py @@ -124,14 +124,33 @@ class IrcMiRCARTBot(IrcBot): os.remove(imgTmpFilePath) urllib.request.urlretrieve(asciiUrl, asciiTmpFilePath) _MiRCART = mirc2png.MiRCART(asciiTmpFilePath, imgTmpFilePath, "DejaVuSansMono.ttf", 11) - imgurResponseHttp = requests.post("https://api.imgur.com/3/upload.json", data={"key":"c9a6efb3d7932fd", "image":base64.b64encode(open(imgTmpFilePath, "rb").read()), "type":"base64", "name":"tmp.png", "title":"tmp.png"}, headers={"Authorization": "Client-ID c9a6efb3d7932fd"}) - imgurResponse = json.loads(imgurResponseHttp.text) - if imgurResponseHttp.status_code == 200: - imgurResponseUrl = imgurResponse.get("data").get("link") - self.sendline("PRIVMSG", serverMessage[2], "8/!\\ Uploaded as: {}".format(imgurResponseUrl)) + imgurResponse = self.uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") + if imgurResponse[0] == 200: + self.sendline("PRIVMSG", serverMessage[2], "8/!\\ Uploaded as: {}".format(imgurResponse[1])) else: - self.sendline("PRIVMSG", serverMessage[2], "4/!\\ Uploaded failed with HTTP status code {}!".format(imgurResponseHttp.status_code)) - os.remove(asciiTmpFilePath); os.remove(imgTmpFilePath); + self.sendline("PRIVMSG", serverMessage[2], "4/!\\ Uploaded failed with HTTP status code {}!".format(imgurResponse[0])) + if os.path.isfile(asciiTmpFilePath): + os.remove(asciiTmpFilePath) + if os.path.isfile(imgTmpFilePath): + os.remove(imgTmpFilePath) + # }}} + # {{{ uploadToImgur(): Upload single file to Imgur + def uploadToImgur(self, imgFilePath, imgName, imgTitle, apiKey): + requestImageData = open(imgFilePath, "rb").read() + requestData = { \ + "image": base64.b64encode(requestImageData), \ + "key": apiKey, \ + "name": imgName, \ + "title": imgTitle, \ + "type": "base64"} + requestHeaders = { \ + "Authorization": "Client-ID " + apiKey} + responseHttp = requests.post("https://api.imgur.com/3/upload.json", data=requestData, headers=requestHeaders) + responseDict = json.loads(responseHttp.text) + if responseHttp.status_code == 200: + return [200, responseDict.get("data").get("link")] + else: + return [responseHttp.status_code] # }}} # {{{ Initialisation method def __init__(self, serverHname, serverPort="6667", clientNick="pngbot", clientIdent="pngbot", clientGecos="pngbot", clientChannel="#MiRCART"): From 993e986ec03fa523127f536e1ba62d8a6f9ec579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 23:12:26 +0100 Subject: [PATCH 016/148] pngbot.py:IrcMiRCARTBot.clientChannelOps: added to track nicks authorised to use `!pngbot'. pngbot.py:IrcMiRCARTBot.dispatch(): sync clientChannelOps w/ 353 (RPL_NAMREPLY) and (channel) MODE messages. --- pngbot.py | 51 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/pngbot.py b/pngbot.py index 0f95c99..4c51e26 100755 --- a/pngbot.py +++ b/pngbot.py @@ -86,7 +86,7 @@ class IrcBot: class IrcMiRCARTBot(IrcBot): """IRC<->MiRCART bot""" - clientLastMessage = clientChannel = None + clientChannelLastMessage = clientChannelOps = clientChannel = None # {{{ connect(): Connect to server and (re)initialise def connect(self): @@ -94,7 +94,7 @@ class IrcMiRCARTBot(IrcBot): super().connect() print("Connected to {}:{}.".format(self.serverHname, self.serverPort)) print("Registering on {}:{} as {}, {}, {}...".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) - self.clientLastMessage = 0 + self.clientLastMessage = 0; self.clientChannelOps = []; # }}} # {{{ dispatch(): Read, parse, and dispatch single line from server def dispatch(self): @@ -107,10 +107,41 @@ class IrcMiRCARTBot(IrcBot): print("Registered on {}:{} as {}, {}, {}.".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) print("Joining {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) self.sendline("JOIN", self.clientChannel) + elif serverMessage[1] == "353" \ + and serverMessage[4].lower() == self.clientChannel.lower(): + for channelNickSpec in serverMessage[5].split(" "): + if channelNickSpec[0] == "@" \ + and len(channelNickSpec[1:]): + self.clientChannelOps.append(channelNickSpec[1:]) + print("Authorising {} on {}".format(channelNickSpec[1:], serverMessage[2])) + elif serverMessage[1] == "MODE" \ + and serverMessage[2].lower() == self.clientChannel.lower(): + channelModeType = "+"; channelModeArg = 4; + channelAuthAdd = ""; channelAuthDel = ""; + for channelModeChar in serverMessage[3]: + if channelModeChar[0] == "-": + channelModeType = "-" + elif channelModeChar[0] == "+": + channelModeType = "+" + elif channelModeChar[0].isalpha(): + if channelModeChar[0] == "o": + if channelModeType == "+": + channelAuthAdd = serverMessage[channelModeArg]; channelAuthDel = ""; + elif channelModeType == "-": + channelAuthAdd = ""; channelAuthDel = serverMessage[channelModeArg]; + channelModeArg += 1 + if len(channelAuthAdd) \ + and channelAuthAdd not in self.clientChannelOps: + print("Authorising {} on {}".format(channelAuthAdd, serverMessage[2])) + self.clientChannelOps.append(channelAuthAdd) + elif len(channelAuthDel) \ + and channelAuthDel in self.clientChannelOps: + print("Deauthorising {} on {}".format(channelAuthDel, serverMessage[2])) + self.clientChannelOps.remove(channelAuthDel) elif serverMessage[1] == "PING": self.sendline("PONG", serverMessage[2]) - elif serverMessage[1] == "PRIVMSG" \ - and serverMessage[2].lower() == self.clientChannel.lower() \ + elif serverMessage[1] == "PRIVMSG" \ + and serverMessage[2].lower() == self.clientChannel.lower() \ and serverMessage[3].startswith("!pngbot "): if (int(time.time()) - self.clientLastMessage) < 45: continue @@ -170,12 +201,12 @@ def main(*argv): if __name__ == "__main__": if ((len(sys.argv) - 1) < 1)\ or ((len(sys.argv) - 1) > 4): - print("usage: {} " \ - " " \ - "[] " \ - "[] " \ - "[] " \ - "[] " \ + print("usage: {} " \ + " " \ + "[] " \ + "[] " \ + "[] " \ + "[] " \ "[] ".format(sys.argv[0]), file=sys.stderr) else: main(*sys.argv) From 28e5b9b9585e8fa8572118790895490949d73583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 23:23:30 +0100 Subject: [PATCH 017/148] pngbot.py:IrcMiRCARTBot.dispatch(): ignore `!pngbot' requests from unauthorised (non-opped) nicks. pngbot.py:IrcMiRCARTBot.dispatch(): add status (stdout) messages. pngbot.py:IrcMiRCARTBot.dispatch(): always use lower-case channel name in status (stdout) messages. --- pngbot.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/pngbot.py b/pngbot.py index 4c51e26..e32f521 100755 --- a/pngbot.py +++ b/pngbot.py @@ -112,8 +112,8 @@ class IrcMiRCARTBot(IrcBot): for channelNickSpec in serverMessage[5].split(" "): if channelNickSpec[0] == "@" \ and len(channelNickSpec[1:]): - self.clientChannelOps.append(channelNickSpec[1:]) - print("Authorising {} on {}".format(channelNickSpec[1:], serverMessage[2])) + self.clientChannelOps.append(channelNickSpec[1:].lower()) + print("Authorising {} on {}".format(channelNickSpec[1:].lower(), serverMessage[2].lower())) elif serverMessage[1] == "MODE" \ and serverMessage[2].lower() == self.clientChannel.lower(): channelModeType = "+"; channelModeArg = 4; @@ -132,11 +132,13 @@ class IrcMiRCARTBot(IrcBot): channelModeArg += 1 if len(channelAuthAdd) \ and channelAuthAdd not in self.clientChannelOps: - print("Authorising {} on {}".format(channelAuthAdd, serverMessage[2])) + channelAuthAdd = channelAuthAdd.lower() + print("Authorising {} on {}".format(channelAuthAdd, serverMessage[2].lower())) self.clientChannelOps.append(channelAuthAdd) elif len(channelAuthDel) \ and channelAuthDel in self.clientChannelOps: - print("Deauthorising {} on {}".format(channelAuthDel, serverMessage[2])) + channelAuthDel = channelAuthDel.lower() + print("Deauthorising {} on {}".format(channelAuthDel, serverMessage[2].lower())) self.clientChannelOps.remove(channelAuthDel) elif serverMessage[1] == "PING": self.sendline("PONG", serverMessage[2]) @@ -144,8 +146,13 @@ class IrcMiRCARTBot(IrcBot): and serverMessage[2].lower() == self.clientChannel.lower() \ and serverMessage[3].startswith("!pngbot "): if (int(time.time()) - self.clientLastMessage) < 45: + print("Ignoring request on {} from {} due to rate limit: {}".format(serverMessage[2].lower(), serverMessage[0], serverMessage[3])) + continue + elif serverMessage[0].split("!")[0].lower() not in self.clientChannelOps: + print("Ignoring request on {} from {} due to lack of authorisation: {}".format(serverMessage[2].lower(), serverMessage[0], serverMessage[3])) continue else: + print("Processing request on {} from {}: {}".format(serverMessage[2].lower(), serverMessage[0], serverMessage[3])) self.clientLastMessage = int(time.time()) asciiUrl = serverMessage[3].split(" ")[1] asciiTmpFilePath = "tmp.txt"; imgTmpFilePath = "tmp.png"; @@ -157,8 +164,10 @@ class IrcMiRCARTBot(IrcBot): _MiRCART = mirc2png.MiRCART(asciiTmpFilePath, imgTmpFilePath, "DejaVuSansMono.ttf", 11) imgurResponse = self.uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") if imgurResponse[0] == 200: + print("Uploaded as: {}".format(imgurResponse[1])) self.sendline("PRIVMSG", serverMessage[2], "8/!\\ Uploaded as: {}".format(imgurResponse[1])) else: + print("Upload failed with HTTP status code {}".format(imgurResponse[0])) self.sendline("PRIVMSG", serverMessage[2], "4/!\\ Uploaded failed with HTTP status code {}!".format(imgurResponse[0])) if os.path.isfile(asciiTmpFilePath): os.remove(asciiTmpFilePath) From f4218e8ae1d0b382604b37558a71661e49a7ba5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 23:35:01 +0100 Subject: [PATCH 018/148] pngbot.py:IrcMiRCARTBot.dispatch{001,353,MODE,None,PING,PRIVMSG}(): split from dispatch(). --- pngbot.py | 164 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 94 insertions(+), 70 deletions(-) diff --git a/pngbot.py b/pngbot.py index e32f521..663ac58 100755 --- a/pngbot.py +++ b/pngbot.py @@ -96,83 +96,107 @@ class IrcMiRCARTBot(IrcBot): print("Registering on {}:{} as {}, {}, {}...".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) self.clientLastMessage = 0; self.clientChannelOps = []; # }}} + # {{{ dispatchNone(): Dispatch None message from server + def dispatchNone(self): + print("Disconnected from {}:{}.".format(self.serverHname, self.serverPort)) + self.close() + # }}} + # {{{ dispatch001(): Dispatch single 001 (RPL_WELCOME) + def dispatch001(self, message): + print("Registered on {}:{} as {}, {}, {}.".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) + print("Joining {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) + self.sendline("JOIN", self.clientChannel) + # }}} + # {{{ dispatch353(): Dispatch single 353 (RPL_NAMREPLY) + def dispatch353(self, message): + if message[4].lower() == self.clientChannel.lower(): + for channelNickSpec in message[5].split(" "): + if channelNickSpec[0] == "@" \ + and len(channelNickSpec[1:]): + self.clientChannelOps.append(channelNickSpec[1:].lower()) + print("Authorising {} on {}".format(channelNickSpec[1:].lower(), message[2].lower())) + # }}} + # {{{ dispatchMode(): Dispatch single MODE message from server + def dispatchMode(self, message): + if message[2].lower() == self.clientChannel.lower(): + channelModeType = "+"; channelModeArg = 4; + channelAuthAdd = ""; channelAuthDel = ""; + for channelModeChar in message[3]: + if channelModeChar[0] == "-": + channelModeType = "-" + elif channelModeChar[0] == "+": + channelModeType = "+" + elif channelModeChar[0].isalpha(): + if channelModeChar[0] == "o": + if channelModeType == "+": + channelAuthAdd = message[channelModeArg]; channelAuthDel = ""; + elif channelModeType == "-": + channelAuthAdd = ""; channelAuthDel = message[channelModeArg]; + channelModeArg += 1 + if len(channelAuthAdd) \ + and channelAuthAdd not in self.clientChannelOps: + channelAuthAdd = channelAuthAdd.lower() + print("Authorising {} on {}".format(channelAuthAdd, message[2].lower())) + self.clientChannelOps.append(channelAuthAdd) + elif len(channelAuthDel) \ + and channelAuthDel in self.clientChannelOps: + channelAuthDel = channelAuthDel.lower() + print("Deauthorising {} on {}".format(channelAuthDel, message[2].lower())) + self.clientChannelOps.remove(channelAuthDel) + # }}} + # {{{ dispatchPing(): Dispatch single PING message from server + def dispatchPing(self, message): + self.sendline("PONG", message[2]) + # }}} + # {{{ dispatchPrivmsg(): Dispatch single PRIVMSG message from server + def dispatchPrivmsg(self, message): + if message[2].lower() == self.clientChannel.lower() \ + and message[3].startswith("!pngbot "): + if (int(time.time()) - self.clientLastMessage) < 45: + print("Ignoring request on {} from {} due to rate limit: {}".format(message[2].lower(), message[0], message[3])) + return + elif message[0].split("!")[0].lower() not in self.clientChannelOps: + print("Ignoring request on {} from {} due to lack of authorisation: {}".format(message[2].lower(), message[0], message[3])) + return + else: + print("Processing request on {} from {}: {}".format(message[2].lower(), message[0], message[3])) + self.clientLastMessage = int(time.time()) + asciiUrl = message[3].split(" ")[1] + asciiTmpFilePath = "tmp.txt"; imgTmpFilePath = "tmp.png"; + if os.path.isfile(asciiTmpFilePath): + os.remove(asciiTmpFilePath) + if os.path.isfile(imgTmpFilePath): + os.remove(imgTmpFilePath) + urllib.request.urlretrieve(asciiUrl, asciiTmpFilePath) + _MiRCART = mirc2png.MiRCART(asciiTmpFilePath, imgTmpFilePath, "DejaVuSansMono.ttf", 11) + imgurResponse = self.uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") + if imgurResponse[0] == 200: + print("Uploaded as: {}".format(imgurResponse[1])) + self.sendline("PRIVMSG", message[2], "8/!\\ Uploaded as: {}".format(imgurResponse[1])) + else: + print("Upload failed with HTTP status code {}".format(imgurResponse[0])) + self.sendline("PRIVMSG", message[2], "4/!\\ Uploaded failed with HTTP status code {}!".format(imgurResponse[0])) + if os.path.isfile(asciiTmpFilePath): + os.remove(asciiTmpFilePath) + if os.path.isfile(imgTmpFilePath): + os.remove(imgTmpFilePath) + # }}} # {{{ dispatch(): Read, parse, and dispatch single line from server def dispatch(self): while True: serverMessage = self.readline() if serverMessage == None: - print("Disconnected from {}:{}.".format(self.serverHname, self.serverPort)) - self.close(); break; + self.dispatchNone(); break; elif serverMessage[1] == "001": - print("Registered on {}:{} as {}, {}, {}.".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) - print("Joining {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) - self.sendline("JOIN", self.clientChannel) - elif serverMessage[1] == "353" \ - and serverMessage[4].lower() == self.clientChannel.lower(): - for channelNickSpec in serverMessage[5].split(" "): - if channelNickSpec[0] == "@" \ - and len(channelNickSpec[1:]): - self.clientChannelOps.append(channelNickSpec[1:].lower()) - print("Authorising {} on {}".format(channelNickSpec[1:].lower(), serverMessage[2].lower())) - elif serverMessage[1] == "MODE" \ - and serverMessage[2].lower() == self.clientChannel.lower(): - channelModeType = "+"; channelModeArg = 4; - channelAuthAdd = ""; channelAuthDel = ""; - for channelModeChar in serverMessage[3]: - if channelModeChar[0] == "-": - channelModeType = "-" - elif channelModeChar[0] == "+": - channelModeType = "+" - elif channelModeChar[0].isalpha(): - if channelModeChar[0] == "o": - if channelModeType == "+": - channelAuthAdd = serverMessage[channelModeArg]; channelAuthDel = ""; - elif channelModeType == "-": - channelAuthAdd = ""; channelAuthDel = serverMessage[channelModeArg]; - channelModeArg += 1 - if len(channelAuthAdd) \ - and channelAuthAdd not in self.clientChannelOps: - channelAuthAdd = channelAuthAdd.lower() - print("Authorising {} on {}".format(channelAuthAdd, serverMessage[2].lower())) - self.clientChannelOps.append(channelAuthAdd) - elif len(channelAuthDel) \ - and channelAuthDel in self.clientChannelOps: - channelAuthDel = channelAuthDel.lower() - print("Deauthorising {} on {}".format(channelAuthDel, serverMessage[2].lower())) - self.clientChannelOps.remove(channelAuthDel) + self.dispatch001(serverMessage) + elif serverMessage[1] == "353": + self.dispatch353(serverMessage) + elif serverMessage[1] == "MODE": + self.dispatchMode(serverMessage) elif serverMessage[1] == "PING": - self.sendline("PONG", serverMessage[2]) - elif serverMessage[1] == "PRIVMSG" \ - and serverMessage[2].lower() == self.clientChannel.lower() \ - and serverMessage[3].startswith("!pngbot "): - if (int(time.time()) - self.clientLastMessage) < 45: - print("Ignoring request on {} from {} due to rate limit: {}".format(serverMessage[2].lower(), serverMessage[0], serverMessage[3])) - continue - elif serverMessage[0].split("!")[0].lower() not in self.clientChannelOps: - print("Ignoring request on {} from {} due to lack of authorisation: {}".format(serverMessage[2].lower(), serverMessage[0], serverMessage[3])) - continue - else: - print("Processing request on {} from {}: {}".format(serverMessage[2].lower(), serverMessage[0], serverMessage[3])) - self.clientLastMessage = int(time.time()) - asciiUrl = serverMessage[3].split(" ")[1] - asciiTmpFilePath = "tmp.txt"; imgTmpFilePath = "tmp.png"; - if os.path.isfile(asciiTmpFilePath): - os.remove(asciiTmpFilePath) - if os.path.isfile(imgTmpFilePath): - os.remove(imgTmpFilePath) - urllib.request.urlretrieve(asciiUrl, asciiTmpFilePath) - _MiRCART = mirc2png.MiRCART(asciiTmpFilePath, imgTmpFilePath, "DejaVuSansMono.ttf", 11) - imgurResponse = self.uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") - if imgurResponse[0] == 200: - print("Uploaded as: {}".format(imgurResponse[1])) - self.sendline("PRIVMSG", serverMessage[2], "8/!\\ Uploaded as: {}".format(imgurResponse[1])) - else: - print("Upload failed with HTTP status code {}".format(imgurResponse[0])) - self.sendline("PRIVMSG", serverMessage[2], "4/!\\ Uploaded failed with HTTP status code {}!".format(imgurResponse[0])) - if os.path.isfile(asciiTmpFilePath): - os.remove(asciiTmpFilePath) - if os.path.isfile(imgTmpFilePath): - os.remove(imgTmpFilePath) + self.dispatchPing(serverMessage) + elif serverMessage[1] == "PRIVMSG": + self.dispatchPrivmsg(serverMessage) # }}} # {{{ uploadToImgur(): Upload single file to Imgur def uploadToImgur(self, imgFilePath, imgName, imgTitle, apiKey): From 8f29ba4e166f4a9e178a5bbeee1cdb40ad53ee87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 23:38:32 +0100 Subject: [PATCH 019/148] pngbot.py:IrcMiRCARTBot.dispatch353(): correctly print channel name. --- pngbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pngbot.py b/pngbot.py index 663ac58..9644bc6 100755 --- a/pngbot.py +++ b/pngbot.py @@ -114,7 +114,7 @@ class IrcMiRCARTBot(IrcBot): if channelNickSpec[0] == "@" \ and len(channelNickSpec[1:]): self.clientChannelOps.append(channelNickSpec[1:].lower()) - print("Authorising {} on {}".format(channelNickSpec[1:].lower(), message[2].lower())) + print("Authorising {} on {}".format(channelNickSpec[1:].lower(), message[4].lower())) # }}} # {{{ dispatchMode(): Dispatch single MODE message from server def dispatchMode(self, message): From 95c950d2eebcfbdd1caa62fa75d5f89b53c84d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 23:39:38 +0100 Subject: [PATCH 020/148] pngbot.py:IrcMiRCARTBot.dispatch353(): fix indentation. --- pngbot.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pngbot.py b/pngbot.py index 9644bc6..7a129c3 100755 --- a/pngbot.py +++ b/pngbot.py @@ -110,11 +110,11 @@ class IrcMiRCARTBot(IrcBot): # {{{ dispatch353(): Dispatch single 353 (RPL_NAMREPLY) def dispatch353(self, message): if message[4].lower() == self.clientChannel.lower(): - for channelNickSpec in message[5].split(" "): - if channelNickSpec[0] == "@" \ - and len(channelNickSpec[1:]): - self.clientChannelOps.append(channelNickSpec[1:].lower()) - print("Authorising {} on {}".format(channelNickSpec[1:].lower(), message[4].lower())) + for channelNickSpec in message[5].split(" "): + if channelNickSpec[0] == "@" \ + and len(channelNickSpec[1:]): + self.clientChannelOps.append(channelNickSpec[1:].lower()) + print("Authorising {} on {}".format(channelNickSpec[1:].lower(), message[4].lower())) # }}} # {{{ dispatchMode(): Dispatch single MODE message from server def dispatchMode(self, message): From 90d9d146f12c2e735d3a5cc0ef3a8a6df60c093c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 2 Jan 2018 23:43:39 +0100 Subject: [PATCH 021/148] README.md: update usage information. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2272eba..12d6ca8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # mirc2png -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) * Prerequisites: python3 && python3-pil (&& python3-{json,requests,urllib3} for pngbot.py) on Debian-family Linux distributions -* Usage: ./mirc2png.py `` `` [``] [``] +* mirc2png.py usage: mirc2png.py `` `` [``] [``] +* pngbot.py usage: pngbot.py `` [``] [``] [``] [``] [``] From c6aa3f9ad981d812e21586a23ce2aef6cdaabf03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 00:05:46 +0100 Subject: [PATCH 022/148] pngbot.py:IrcBot.readline(): correctly parse messages w/o a prefix. --- pngbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pngbot.py b/pngbot.py index 7a129c3..1e72a97 100755 --- a/pngbot.py +++ b/pngbot.py @@ -65,7 +65,7 @@ class IrcBot: if msg[0][0] == ':': msg = [msg[0][1:]] + msg[1:] else: - msg = [""] + msg[1:] + msg = [""] + msg[0:] return msg # }}} # {{{ sendline(): Parse and send single line to server from list From 936bfb6c86d91e02fd4ec9f96aa3d8bf3c03f520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 00:13:02 +0100 Subject: [PATCH 023/148] pngbot.py:IrcMiRCARTBot.dispatchKick(): rejoin channel on kick. --- pngbot.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pngbot.py b/pngbot.py index 1e72a97..08d0998 100755 --- a/pngbot.py +++ b/pngbot.py @@ -116,6 +116,13 @@ class IrcMiRCARTBot(IrcBot): self.clientChannelOps.append(channelNickSpec[1:].lower()) print("Authorising {} on {}".format(channelNickSpec[1:].lower(), message[4].lower())) # }}} + # {{{ dispatchKick(): Dispatch single KICK message from server + def dispatchKick(self, message): + if message[2].lower() == self.clientChannel.lower() \ + and message[3].lower() == self.clientNick.lower(): + print("Kicked from {} by {}, rejoining".format(message[2].lower(), message[0])) + self.sendline("JOIN", message[2]) + # }}} # {{{ dispatchMode(): Dispatch single MODE message from server def dispatchMode(self, message): if message[2].lower() == self.clientChannel.lower(): @@ -191,6 +198,8 @@ class IrcMiRCARTBot(IrcBot): self.dispatch001(serverMessage) elif serverMessage[1] == "353": self.dispatch353(serverMessage) + elif serverMessage[1] == "KICK": + self.dispatchKick(serverMessage) elif serverMessage[1] == "MODE": self.dispatchMode(serverMessage) elif serverMessage[1] == "PING": From a0db56a530308cb7e7582394d7022654f7144445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 00:40:37 +0100 Subject: [PATCH 024/148] pngbot.py:IrcBot.readline(): add optional timeout parameter. pngbot.py:IrcMiRCARTBot.clientChannelRejoin{,TimerNext}: added to support delayed rejoin-on-kick logic. pngbot.py:IrcMiRCARTBot.dispatchJoin(): reset clientChannelRejoin{,TimerNext} on successful (re)join to clientChannel. pngbot.py:IrcMiRCARTBot.dispatchKick(): set clientChannelRejoin{,TimerNext} on kick from clientChannel to time.time() + 15 (seconds.) pngbot.py:IrcMiRCARTBot.dispatchTimer(): (re)join clientChannel and set clientChannelRejoin{,TimerNext} to time.time() + 15 (seconds.) pngbot.py:IrcMiRCARTBot.dispatch(): call readline() w/ timeout delta given clientChannelRejoinTimerNext. --- pngbot.py | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/pngbot.py b/pngbot.py index 08d0998..627e928 100755 --- a/pngbot.py +++ b/pngbot.py @@ -50,9 +50,14 @@ class IrcBot: self.clientSocket.close() self.clientSocket = self.clientSocketFile = None; # }}} - # {{{ readline(): Read and parse single line from server into canonicalised list - def readline(self): - msg = self.clientSocketFile.readline() + # {{{ readline(): Read and parse single line from server into canonicalised list w/ optional timeout + def readline(self, timeout=0): + if timeout: + self.clientSocket.settimeout(timeout) + try: + msg = self.clientSocketFile.readline() + except TimeoutException: + return "TIMEOUT" if len(msg): msg = msg.rstrip("\r\n") else: @@ -87,6 +92,7 @@ class IrcBot: class IrcMiRCARTBot(IrcBot): """IRC<->MiRCART bot""" clientChannelLastMessage = clientChannelOps = clientChannel = None + clientChannelRejoinTimerNext = clientChannelRejoin = None # {{{ connect(): Connect to server and (re)initialise def connect(self): @@ -95,6 +101,7 @@ class IrcMiRCARTBot(IrcBot): print("Connected to {}:{}.".format(self.serverHname, self.serverPort)) print("Registering on {}:{} as {}, {}, {}...".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) self.clientLastMessage = 0; self.clientChannelOps = []; + clientChannelRejoinTimerNext = 0; self.clientChannelRejoin = False; # }}} # {{{ dispatchNone(): Dispatch None message from server def dispatchNone(self): @@ -104,7 +111,7 @@ class IrcMiRCARTBot(IrcBot): # {{{ dispatch001(): Dispatch single 001 (RPL_WELCOME) def dispatch001(self, message): print("Registered on {}:{} as {}, {}, {}.".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) - print("Joining {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) + print("Attempting to join {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) self.sendline("JOIN", self.clientChannel) # }}} # {{{ dispatch353(): Dispatch single 353 (RPL_NAMREPLY) @@ -116,12 +123,17 @@ class IrcMiRCARTBot(IrcBot): self.clientChannelOps.append(channelNickSpec[1:].lower()) print("Authorising {} on {}".format(channelNickSpec[1:].lower(), message[4].lower())) # }}} + # {{{ dispatchJoin(): Dispatch single JOIN message from server + def dispatchJoin(self, message): + print("Joined {} on {}:{}.".format(message[2].lower(), self.serverHname, self.serverPort)) + self.clientChannelRejoinTimerNext = 0; self.clientChannelRejoin = False; + # }}} # {{{ dispatchKick(): Dispatch single KICK message from server def dispatchKick(self, message): if message[2].lower() == self.clientChannel.lower() \ and message[3].lower() == self.clientNick.lower(): - print("Kicked from {} by {}, rejoining".format(message[2].lower(), message[0])) - self.sendline("JOIN", message[2]) + print("Kicked from {} by {}, rejoining in 15 seconds".format(message[2].lower(), message[0])) + self.clientChannelRejoinTimerNext = time.time() + 15; self.clientChannelRejoin = True; # }}} # {{{ dispatchMode(): Dispatch single MODE message from server def dispatchMode(self, message): @@ -188,16 +200,32 @@ class IrcMiRCARTBot(IrcBot): if os.path.isfile(imgTmpFilePath): os.remove(imgTmpFilePath) # }}} + # {{{ dispatchTimer(): Dispatch single client timer expiration + def dispatchTimer(self): + if self.clientChannelRejoin: + print("Attempting to join {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) + self.sendline("JOIN", self.clientChannel) + self.clientChannelRejoinTimerNext = time.time() + 15; self.clientChannelRejoin = True; + # }}} # {{{ dispatch(): Read, parse, and dispatch single line from server def dispatch(self): while True: - serverMessage = self.readline() + clientTimerNextDelta = 0 + if self.clientChannelRejoinTimerNext: + timeNow = time.time() + if self.clientChannelRejoinTimerNext > timeNow: + clientTimerNextDelta = self.clientChannelRejoinTimerNext - timeNow + serverMessage = self.readline(clientTimerNextDelta) if serverMessage == None: self.dispatchNone(); break; + elif serverMessage == "TIMEOUT": + self.dispatchTimer() elif serverMessage[1] == "001": self.dispatch001(serverMessage) elif serverMessage[1] == "353": self.dispatch353(serverMessage) + elif serverMessage[1] == "JOIN": + self.dispatchJoin(serverMessage) elif serverMessage[1] == "KICK": self.dispatchKick(serverMessage) elif serverMessage[1] == "MODE": From ebd2ce93936d9f96a4366cdc284607e58a507e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 00:53:42 +0100 Subject: [PATCH 025/148] pngbot.py:IrcMiRCARTBot.dispatch353(): skip empty nick specs. --- pngbot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pngbot.py b/pngbot.py index 627e928..fdfa397 100755 --- a/pngbot.py +++ b/pngbot.py @@ -118,7 +118,8 @@ class IrcMiRCARTBot(IrcBot): def dispatch353(self, message): if message[4].lower() == self.clientChannel.lower(): for channelNickSpec in message[5].split(" "): - if channelNickSpec[0] == "@" \ + if len(channelNickSpec) \ + and channelNickSpec[0] == "@" \ and len(channelNickSpec[1:]): self.clientChannelOps.append(channelNickSpec[1:].lower()) print("Authorising {} on {}".format(channelNickSpec[1:].lower(), message[4].lower())) From 532806176cdfb97a476b1cbadc218002758f7cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 00:57:55 +0100 Subject: [PATCH 026/148] pngbot.py:IrcBot.readline(): correctly catch socket.timeout exception. --- pngbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pngbot.py b/pngbot.py index fdfa397..dac750e 100755 --- a/pngbot.py +++ b/pngbot.py @@ -56,7 +56,7 @@ class IrcBot: self.clientSocket.settimeout(timeout) try: msg = self.clientSocketFile.readline() - except TimeoutException: + except socket.timeout: return "TIMEOUT" if len(msg): msg = msg.rstrip("\r\n") From 09a7995a50789d953df6aedca4f32d4498605626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 01:25:46 +0100 Subject: [PATCH 027/148] mirc2png.py:MiRCART.parseAsChar(): implement ^V (reverse) by swapping {background,foreground} colours. --- mirc2png.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mirc2png.py b/mirc2png.py index d88ce8b..a3c34f2 100755 --- a/mirc2png.py +++ b/mirc2png.py @@ -36,7 +36,7 @@ class MiRCART: outCurColourBg = outCurColourFg = None; outCurX = outCurY = None; - inCurBold = inCurItalic = inCurReverse = inCurUnderline = None; + inCurBold = inCurItalic = inCurUnderline = None; inCurColourSpec = None; state = None; inCurCol = None; @@ -120,10 +120,11 @@ class MiRCART: self.inCurCol += 1; self.inCurItalic = 0 if self.inCurItalic else 1; elif char == "": self.inCurCol += 1; - self.inCurBold = 0; self.inCurItalic = 0; self.inCurReverse = 0; self.inCurUnderline = 0; + self.inCurBold = 0; self.inCurItalic = 0; self.inCurUnderline = 0; self.inCurColourSpec = ""; elif char == "": - self.inCurCol += 1; self.inCurReverse = 0 if self.inCurReverse else 1; + self.inCurCol += 1 + self.outCurColourBg, self.outCurColourFg = self.outCurColourFg, self.outCurColourBg; elif char == "": self.inCurCol += 1; self.inCurUnderline = 0 if self.inCurUnderline else 1; elif char == " ": @@ -143,7 +144,7 @@ class MiRCART: colourBg = self.ColourMapNormal[self.outCurColourBg] colourFg = self.ColourMapNormal[self.outCurColourFg] self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + 7, self.outCurY + 14)), fill=colourBg) - # XXX implement italic, reverse + # XXX implement italic self.outImgDraw.text((self.outCurX, self.outCurY), char, colourFg, self.outImgFont) if self.inCurUnderline: self.outImgDraw.line((self.outCurX, self.outCurY + 11, self.outCurX + 7, self.outCurY + 11), fill=colourFg) @@ -177,7 +178,7 @@ class MiRCART: self.outCurColourBg = 1; self.outCurColourFg = 15; self.outCurX = 0; self.outCurY = 0; for inCurRow in range(0, len(self.inLines)): - self.inCurBold = 0; self.inCurItalic = 0; self.inCurReverse = 0; self.inCurUnderline = 0; + self.inCurBold = 0; self.inCurItalic = 0; self.inCurUnderline = 0; self.inCurColourSpec = ""; self.state = self.State.STATE_CHAR; self.inCurCol = 0; while self.inCurCol < len(self.inLines[inCurRow]): From 3a207fc53c5f07800463aafe93dc937afa1612e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 01:38:41 +0100 Subject: [PATCH 028/148] pngbot.py:IrcBot.connect(): set socket non-blocking, ignore BlockingIOError, and select() for writability & optionally specified timeout. pngbot.py:IrcBot.readline(): replace settimeout()/socket.timeout-based logic w/ select() for readability & optionally specified timeout. pngbot.py:IrcBot.sendline(): select() for writability & optionally specified timeout and send() full buffer until failure. pngbot.py:IrcMiRCARTBot.dispatch(): dispatch expired timers prior to calling readline(). pngbot.py:main(): default (maximum) connect timeout to 15 seconds. --- pngbot.py | 61 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/pngbot.py b/pngbot.py index dac750e..f00954c 100755 --- a/pngbot.py +++ b/pngbot.py @@ -24,22 +24,29 @@ from itertools import chain import base64 +import errno, os, select, socket, sys, time import json import mirc2png -import os, socket, sys, time -import requests -import urllib.request +import requests, urllib.request class IrcBot: - """Blocking abstraction over the IRC protocol""" + """Non-blocking abstraction over the IRC protocol""" serverHname = serverPort = None; clientNick = clientIdent = clientGecos = None; clientSocket = clientSocketFile = None; - # {{{ connect(): Connect to server and register - def connect(self): + # {{{ connect(): Connect to server and register w/ optional timeout + def connect(self, timeout=None): self.clientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.clientSocket.connect((self.serverHname, int(self.serverPort))) + self.clientSocket.setblocking(0) + try: + self.clientSocket.connect((self.serverHname, int(self.serverPort))) + except BlockingIOError: + pass + if timeout: + select.select([], [self.clientSocket.fileno()], [], timeout) + else: + select.select([], [self.clientSocket.fileno()], []) self.clientSocketFile = self.clientSocket.makefile() self.sendline("NICK", self.clientNick) self.sendline("USER", self.clientIdent, "0", "0", self.clientGecos) @@ -51,13 +58,12 @@ class IrcBot: self.clientSocket = self.clientSocketFile = None; # }}} # {{{ readline(): Read and parse single line from server into canonicalised list w/ optional timeout - def readline(self, timeout=0): + def readline(self, timeout=None): if timeout: - self.clientSocket.settimeout(timeout) - try: - msg = self.clientSocketFile.readline() - except socket.timeout: - return "TIMEOUT" + select.select([self.clientSocket.fileno()], [], [], timeout) + else: + select.select([self.clientSocket.fileno()], [], []) + msg = self.clientSocketFile.readline() if len(msg): msg = msg.rstrip("\r\n") else: @@ -73,15 +79,24 @@ class IrcBot: msg = [""] + msg[0:] return msg # }}} - # {{{ sendline(): Parse and send single line to server from list - def sendline(self, *args): + # {{{ sendline(): Parse and send single line to server from list w/ optional timeout + def sendline(self, *args, timeout=None): msg = ""; argNumMax = len(args); for argNum in range(0, argNumMax): if argNum == (argNumMax - 1): msg += ":" + args[argNum] else: msg += args[argNum] + " " - return self.clientSocket.send((msg + "\r\n").encode()) + msg = (msg + "\r\n").encode(); msgLen = len(msg); msgBytesSent = 0; + while msgBytesSent < msgLen: + if timeout: + timeLast = time.time() + select.select([], [self.clientSocket.fileno()], [], timeout) + timeNow = time.time(); timeout -= timeNow - timeLast; + else: + select.select([], [self.clientSocket.fileno()], []) + msgBytesSent = self.clientSocket.send(msg) + msg = msg[msgBytesSent:]; msgLen -= msgBytesSent; # }}} # {{{ Initialisation method def __init__(self, serverHname, serverPort, clientNick, clientIdent, clientGecos): @@ -94,10 +109,10 @@ class IrcMiRCARTBot(IrcBot): clientChannelLastMessage = clientChannelOps = clientChannel = None clientChannelRejoinTimerNext = clientChannelRejoin = None - # {{{ connect(): Connect to server and (re)initialise - def connect(self): + # {{{ connect(): Connect to server and (re)initialise w/ optional timeout + def connect(self, timeout=None): print("Connecting to {}:{}...".format(self.serverHname, self.serverPort)) - super().connect() + super().connect(timeout) print("Connected to {}:{}.".format(self.serverHname, self.serverPort)) print("Registering on {}:{} as {}, {}, {}...".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) self.clientLastMessage = 0; self.clientChannelOps = []; @@ -216,11 +231,13 @@ class IrcMiRCARTBot(IrcBot): timeNow = time.time() if self.clientChannelRejoinTimerNext > timeNow: clientTimerNextDelta = self.clientChannelRejoinTimerNext - timeNow + if clientTimerNextDelta: + timeNow = time.time() + if self.clientChannelRejoinTimerNext <= timeNow: + self.dispatchTimer() serverMessage = self.readline(clientTimerNextDelta) if serverMessage == None: self.dispatchNone(); break; - elif serverMessage == "TIMEOUT": - self.dispatchTimer() elif serverMessage[1] == "001": self.dispatch001(serverMessage) elif serverMessage[1] == "353": @@ -265,7 +282,7 @@ class IrcMiRCARTBot(IrcBot): def main(*argv): _IrcMiRCARTBot = IrcMiRCARTBot(*argv[1:]) while True: - _IrcMiRCARTBot.connect() + _IrcMiRCARTBot.connect(15) _IrcMiRCARTBot.dispatch() _IrcMiRCARTBot.close() From 98eae4257c2aefe47737938747e64ded50508815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 02:16:55 +0100 Subject: [PATCH 029/148] pngbot.py:IrcBot.clientNextTimeout: moved from IrcMiRCARTBot. pngbot.py:IrcBot.connect(): close() & return False given timeout and True given success. pngbot.py:IrcBot.readline(): honour clientNextTimeout and return "" given timer expiry. pngbot.py:IrcBot.sendline(): ignore clientNextTimeout. pngbot.py:IrcMiRCARTBot.connect(): honour & pass IrcBot.connect() return value. pngbot.py:IrcMiRCARTBot.dispatch{Join,Kick,Timer}(): (re)set clientNextTimeout to time.time() + 15 seconds. pngbot.py:IrcMiRCARTBot.dispatch(): dispatch expired timers prior to calling readline() & honour "" return value. pngbot.py:main(): honour IrcMiRCARTBot.connect() return value & delay reconnection by 15 seconds. --- pngbot.py | 77 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/pngbot.py b/pngbot.py index f00954c..ca701a6 100755 --- a/pngbot.py +++ b/pngbot.py @@ -34,6 +34,7 @@ class IrcBot: serverHname = serverPort = None; clientNick = clientIdent = clientGecos = None; clientSocket = clientSocketFile = None; + clientNextTimeout = None # {{{ connect(): Connect to server and register w/ optional timeout def connect(self, timeout=None): @@ -44,12 +45,15 @@ class IrcBot: except BlockingIOError: pass if timeout: - select.select([], [self.clientSocket.fileno()], [], timeout) + readySet = select.select([], [self.clientSocket.fileno()], [], timeout) + if len(readySet[1]) == 0: + self.close(); return False; else: select.select([], [self.clientSocket.fileno()], []) self.clientSocketFile = self.clientSocket.makefile() self.sendline("NICK", self.clientNick) self.sendline("USER", self.clientIdent, "0", "0", self.clientGecos) + return True # }}} # {{{ close(): Close connection to server def close(self): @@ -57,17 +61,24 @@ class IrcBot: self.clientSocket.close() self.clientSocket = self.clientSocketFile = None; # }}} - # {{{ readline(): Read and parse single line from server into canonicalised list w/ optional timeout - def readline(self, timeout=None): - if timeout: - select.select([self.clientSocket.fileno()], [], [], timeout) + # {{{ readline(): Read and parse single line from server into canonicalised list, honouring timers + def readline(self): + if self.clientNextTimeout: + timeNow = time.time() + if self.clientNextTimeout <= timeNow: + return "" + else: + readySet = select.select([self.clientSocket.fileno()], [], [], self.clientNextTimeout - timeNow) else: - select.select([self.clientSocket.fileno()], [], []) + readySet = select.select([self.clientSocket.fileno()], [], []) msg = self.clientSocketFile.readline() if len(msg): msg = msg.rstrip("\r\n") else: - return None + if len(readySet[0]) == 0: + return "" + else: + return None msg = msg.split(" :", 1) if len(msg) == 1: msg = list(chain.from_iterable(m.split(" ") for m in msg)) @@ -79,8 +90,8 @@ class IrcBot: msg = [""] + msg[0:] return msg # }}} - # {{{ sendline(): Parse and send single line to server from list w/ optional timeout - def sendline(self, *args, timeout=None): + # {{{ sendline(): Parse and send single line to server from list, ignoring timers + def sendline(self, *args): msg = ""; argNumMax = len(args); for argNum in range(0, argNumMax): if argNum == (argNumMax - 1): @@ -89,12 +100,7 @@ class IrcBot: msg += args[argNum] + " " msg = (msg + "\r\n").encode(); msgLen = len(msg); msgBytesSent = 0; while msgBytesSent < msgLen: - if timeout: - timeLast = time.time() - select.select([], [self.clientSocket.fileno()], [], timeout) - timeNow = time.time(); timeout -= timeNow - timeLast; - else: - select.select([], [self.clientSocket.fileno()], []) + readySet = select.select([], [self.clientSocket.fileno()], []) msgBytesSent = self.clientSocket.send(msg) msg = msg[msgBytesSent:]; msgLen -= msgBytesSent; # }}} @@ -107,16 +113,19 @@ class IrcBot: class IrcMiRCARTBot(IrcBot): """IRC<->MiRCART bot""" clientChannelLastMessage = clientChannelOps = clientChannel = None - clientChannelRejoinTimerNext = clientChannelRejoin = None + clientChannelRejoin = None # {{{ connect(): Connect to server and (re)initialise w/ optional timeout def connect(self, timeout=None): print("Connecting to {}:{}...".format(self.serverHname, self.serverPort)) - super().connect(timeout) - print("Connected to {}:{}.".format(self.serverHname, self.serverPort)) - print("Registering on {}:{} as {}, {}, {}...".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) - self.clientLastMessage = 0; self.clientChannelOps = []; - clientChannelRejoinTimerNext = 0; self.clientChannelRejoin = False; + if super().connect(timeout): + print("Connected to {}:{}.".format(self.serverHname, self.serverPort)) + print("Registering on {}:{} as {}, {}, {}...".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) + self.clientLastMessage = 0; self.clientChannelOps = []; + self.clientChannelRejoin = False + return True + else: + return False # }}} # {{{ dispatchNone(): Dispatch None message from server def dispatchNone(self): @@ -142,14 +151,14 @@ class IrcMiRCARTBot(IrcBot): # {{{ dispatchJoin(): Dispatch single JOIN message from server def dispatchJoin(self, message): print("Joined {} on {}:{}.".format(message[2].lower(), self.serverHname, self.serverPort)) - self.clientChannelRejoinTimerNext = 0; self.clientChannelRejoin = False; + self.clientNextTimeout = None; self.clientChannelRejoin = False; # }}} # {{{ dispatchKick(): Dispatch single KICK message from server def dispatchKick(self, message): if message[2].lower() == self.clientChannel.lower() \ and message[3].lower() == self.clientNick.lower(): print("Kicked from {} by {}, rejoining in 15 seconds".format(message[2].lower(), message[0])) - self.clientChannelRejoinTimerNext = time.time() + 15; self.clientChannelRejoin = True; + self.clientNextTimeout = time.time() + 15; self.clientChannelRejoin = True; # }}} # {{{ dispatchMode(): Dispatch single MODE message from server def dispatchMode(self, message): @@ -221,23 +230,20 @@ class IrcMiRCARTBot(IrcBot): if self.clientChannelRejoin: print("Attempting to join {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) self.sendline("JOIN", self.clientChannel) - self.clientChannelRejoinTimerNext = time.time() + 15; self.clientChannelRejoin = True; + self.clientNextTimeout = time.time() + 15; self.clientChannelRejoin = True; # }}} # {{{ dispatch(): Read, parse, and dispatch single line from server def dispatch(self): while True: - clientTimerNextDelta = 0 - if self.clientChannelRejoinTimerNext: + if self.clientNextTimeout: timeNow = time.time() - if self.clientChannelRejoinTimerNext > timeNow: - clientTimerNextDelta = self.clientChannelRejoinTimerNext - timeNow - if clientTimerNextDelta: - timeNow = time.time() - if self.clientChannelRejoinTimerNext <= timeNow: + if self.clientNextTimeout <= timeNow: self.dispatchTimer() - serverMessage = self.readline(clientTimerNextDelta) + serverMessage = self.readline() if serverMessage == None: self.dispatchNone(); break; + elif serverMessage == "": + continue elif serverMessage[1] == "001": self.dispatch001(serverMessage) elif serverMessage[1] == "353": @@ -282,9 +288,10 @@ class IrcMiRCARTBot(IrcBot): def main(*argv): _IrcMiRCARTBot = IrcMiRCARTBot(*argv[1:]) while True: - _IrcMiRCARTBot.connect(15) - _IrcMiRCARTBot.dispatch() - _IrcMiRCARTBot.close() + if _IrcMiRCARTBot.connect(15): + _IrcMiRCARTBot.dispatch() + _IrcMiRCARTBot.close() + time.sleep(15) if __name__ == "__main__": if ((len(sys.argv) - 1) < 1)\ From c32d749675f3ddeb2e39f0ae94a997329f7566b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 02:33:12 +0100 Subject: [PATCH 030/148] IrcClient.py: split from IrcMiRCARTBot.py. IrcMiRCARTBot.py: renamed from pngbot.py, importing IrcClient.IrcClient. MiRCART.py: renamed from mirc2png.py. README.md: updated. --- IrcClient.py | 110 ++++++++++++++++++++++++++++++++++ pngbot.py => IrcMiRCARTBot.py | 93 ++-------------------------- mirc2png.py => MiRCART.py | 5 +- README.md | 6 +- 4 files changed, 122 insertions(+), 92 deletions(-) create mode 100644 IrcClient.py rename pngbot.py => IrcMiRCARTBot.py (77%) rename mirc2png.py => MiRCART.py (99%) diff --git a/IrcClient.py b/IrcClient.py new file mode 100644 index 0000000..b8eccb9 --- /dev/null +++ b/IrcClient.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python3 +# +# mirc2png -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from itertools import chain +import select, socket, time + +class IrcClient: + """Non-blocking abstraction over the IRC protocol""" + serverHname = serverPort = None; + clientNick = clientIdent = clientGecos = None; + clientSocket = clientSocketFile = None; + clientNextTimeout = None + + # {{{ connect(): Connect to server and register w/ optional timeout + def connect(self, timeout=None): + self.clientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self.clientSocket.setblocking(0) + try: + self.clientSocket.connect((self.serverHname, int(self.serverPort))) + except BlockingIOError: + pass + if timeout: + readySet = select.select([], [self.clientSocket.fileno()], [], timeout) + if len(readySet[1]) == 0: + self.close(); return False; + else: + select.select([], [self.clientSocket.fileno()], []) + self.clientSocketFile = self.clientSocket.makefile() + self.sendline("NICK", self.clientNick) + self.sendline("USER", self.clientIdent, "0", "0", self.clientGecos) + return True + # }}} + # {{{ close(): Close connection to server + def close(self): + if self.clientSocket != None: + self.clientSocket.close() + self.clientSocket = self.clientSocketFile = None; + # }}} + # {{{ readline(): Read and parse single line from server into canonicalised list, honouring timers + def readline(self): + if self.clientNextTimeout: + timeNow = time.time() + if self.clientNextTimeout <= timeNow: + return "" + else: + readySet = select.select([self.clientSocket.fileno()], [], [], self.clientNextTimeout - timeNow) + else: + readySet = select.select([self.clientSocket.fileno()], [], []) + msg = self.clientSocketFile.readline() + if len(msg): + msg = msg.rstrip("\r\n") + else: + if len(readySet[0]) == 0: + return "" + else: + return None + msg = msg.split(" :", 1) + if len(msg) == 1: + msg = list(chain.from_iterable(m.split(" ") for m in msg)) + elif len(msg) == 2: + msg = msg[0].split(" ") + [msg[1]] + if msg[0][0] == ':': + msg = [msg[0][1:]] + msg[1:] + else: + msg = [""] + msg[0:] + return msg + # }}} + # {{{ sendline(): Parse and send single line to server from list, ignoring timers + def sendline(self, *args): + msg = ""; argNumMax = len(args); + for argNum in range(0, argNumMax): + if argNum == (argNumMax - 1): + msg += ":" + args[argNum] + else: + msg += args[argNum] + " " + msg = (msg + "\r\n").encode(); msgLen = len(msg); msgBytesSent = 0; + while msgBytesSent < msgLen: + readySet = select.select([], [self.clientSocket.fileno()], []) + msgBytesSent = self.clientSocket.send(msg) + msg = msg[msgBytesSent:]; msgLen -= msgBytesSent; + # }}} + + # + # Initialisation method + def __init__(self, serverHname, serverPort, clientNick, clientIdent, clientGecos): + self.serverHname = serverHname; self.serverPort = serverPort; + self.clientNick = clientNick; self.clientIdent = clientIdent; self.clientGecos = clientGecos; + +# vim:expandtab foldmethod=marker sw=8 ts=8 tw=120 diff --git a/pngbot.py b/IrcMiRCARTBot.py similarity index 77% rename from pngbot.py rename to IrcMiRCARTBot.py index ca701a6..5ab59ba 100755 --- a/pngbot.py +++ b/IrcMiRCARTBot.py @@ -22,95 +22,13 @@ # SOFTWARE. # -from itertools import chain import base64 -import errno, os, select, socket, sys, time +import os, sys, time import json -import mirc2png +import IrcClient, MiRCART import requests, urllib.request -class IrcBot: - """Non-blocking abstraction over the IRC protocol""" - serverHname = serverPort = None; - clientNick = clientIdent = clientGecos = None; - clientSocket = clientSocketFile = None; - clientNextTimeout = None - - # {{{ connect(): Connect to server and register w/ optional timeout - def connect(self, timeout=None): - self.clientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.clientSocket.setblocking(0) - try: - self.clientSocket.connect((self.serverHname, int(self.serverPort))) - except BlockingIOError: - pass - if timeout: - readySet = select.select([], [self.clientSocket.fileno()], [], timeout) - if len(readySet[1]) == 0: - self.close(); return False; - else: - select.select([], [self.clientSocket.fileno()], []) - self.clientSocketFile = self.clientSocket.makefile() - self.sendline("NICK", self.clientNick) - self.sendline("USER", self.clientIdent, "0", "0", self.clientGecos) - return True - # }}} - # {{{ close(): Close connection to server - def close(self): - if self.clientSocket != None: - self.clientSocket.close() - self.clientSocket = self.clientSocketFile = None; - # }}} - # {{{ readline(): Read and parse single line from server into canonicalised list, honouring timers - def readline(self): - if self.clientNextTimeout: - timeNow = time.time() - if self.clientNextTimeout <= timeNow: - return "" - else: - readySet = select.select([self.clientSocket.fileno()], [], [], self.clientNextTimeout - timeNow) - else: - readySet = select.select([self.clientSocket.fileno()], [], []) - msg = self.clientSocketFile.readline() - if len(msg): - msg = msg.rstrip("\r\n") - else: - if len(readySet[0]) == 0: - return "" - else: - return None - msg = msg.split(" :", 1) - if len(msg) == 1: - msg = list(chain.from_iterable(m.split(" ") for m in msg)) - elif len(msg) == 2: - msg = msg[0].split(" ") + [msg[1]] - if msg[0][0] == ':': - msg = [msg[0][1:]] + msg[1:] - else: - msg = [""] + msg[0:] - return msg - # }}} - # {{{ sendline(): Parse and send single line to server from list, ignoring timers - def sendline(self, *args): - msg = ""; argNumMax = len(args); - for argNum in range(0, argNumMax): - if argNum == (argNumMax - 1): - msg += ":" + args[argNum] - else: - msg += args[argNum] + " " - msg = (msg + "\r\n").encode(); msgLen = len(msg); msgBytesSent = 0; - while msgBytesSent < msgLen: - readySet = select.select([], [self.clientSocket.fileno()], []) - msgBytesSent = self.clientSocket.send(msg) - msg = msg[msgBytesSent:]; msgLen -= msgBytesSent; - # }}} - # {{{ Initialisation method - def __init__(self, serverHname, serverPort, clientNick, clientIdent, clientGecos): - self.serverHname = serverHname; self.serverPort = serverPort; - self.clientNick = clientNick; self.clientIdent = clientIdent; self.clientGecos = clientGecos; - # }}} - -class IrcMiRCARTBot(IrcBot): +class IrcMiRCARTBot(IrcClient.IrcClient): """IRC<->MiRCART bot""" clientChannelLastMessage = clientChannelOps = clientChannel = None clientChannelRejoin = None @@ -277,11 +195,12 @@ class IrcMiRCARTBot(IrcBot): else: return [responseHttp.status_code] # }}} - # {{{ Initialisation method + + # + # Initialisation method def __init__(self, serverHname, serverPort="6667", clientNick="pngbot", clientIdent="pngbot", clientGecos="pngbot", clientChannel="#MiRCART"): super().__init__(serverHname, serverPort, clientNick, clientIdent, clientGecos) self.clientChannel = clientChannel - # }}} # # Entry point diff --git a/mirc2png.py b/MiRCART.py similarity index 99% rename from mirc2png.py rename to MiRCART.py index a3c34f2..9fac4cb 100755 --- a/mirc2png.py +++ b/MiRCART.py @@ -165,7 +165,9 @@ class MiRCART: self.outCurColourBg = 1; self.outCurColourFg = 15; self.inCurColourSpec = ""; self.state = self.State.STATE_CHAR; # }}} - # {{{ Initialisation method + + # + # Initialisation method def __init__(self, inFilePath, imgFilePath, fontFilePath="DejaVuSansMono.ttf", fontSize=11): self.inFilePath = inFilePath; self.inFile = open(inFilePath, "r"); self.inLines = self.inFile.readlines() @@ -189,7 +191,6 @@ class MiRCART: self.outCurX = 0; self.outCurY += 13; self.inFile.close(); self.outImg.save(imgFilePath); - # }}} # # Entry point diff --git a/README.md b/README.md index 12d6ca8..6239374 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ # mirc2png -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) -* Prerequisites: python3 && python3-pil (&& python3-{json,requests,urllib3} for pngbot.py) on Debian-family Linux distributions -* mirc2png.py usage: mirc2png.py `` `` [``] [``] -* pngbot.py usage: pngbot.py `` [``] [``] [``] [``] [``] +* Prerequisites: python3 && python3-pil (&& python3-{json,requests,urllib3} for IrcMiRCARTBot.py) on Debian-family Linux distributions +* IrcMiRCARTBot.py usage: IrcMiRCARTBot.py `` [``] [``] [``] [``] [``] +* MiRCART.py usage: MiRCART.py `` `` [``] [``] From 9896108028c4904f47ded48a94270bc05a4076dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 03:28:05 +0100 Subject: [PATCH 031/148] IrcMiRCARTBot.py:IrcMiRCARTBot: replace print() w/ _log() calls. IrcMiRCARTBot.py:IrcMiRCARTBot._log(): log message w/ timestamp. --- IrcMiRCARTBot.py | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index 5ab59ba..a2d1a50 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -35,10 +35,10 @@ class IrcMiRCARTBot(IrcClient.IrcClient): # {{{ connect(): Connect to server and (re)initialise w/ optional timeout def connect(self, timeout=None): - print("Connecting to {}:{}...".format(self.serverHname, self.serverPort)) + self._log("Connecting to {}:{}...".format(self.serverHname, self.serverPort)) if super().connect(timeout): - print("Connected to {}:{}.".format(self.serverHname, self.serverPort)) - print("Registering on {}:{} as {}, {}, {}...".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) + self._log("Connected to {}:{}.".format(self.serverHname, self.serverPort)) + self._log("Registering on {}:{} as {}, {}, {}...".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) self.clientLastMessage = 0; self.clientChannelOps = []; self.clientChannelRejoin = False return True @@ -47,13 +47,13 @@ class IrcMiRCARTBot(IrcClient.IrcClient): # }}} # {{{ dispatchNone(): Dispatch None message from server def dispatchNone(self): - print("Disconnected from {}:{}.".format(self.serverHname, self.serverPort)) + self._log("Disconnected from {}:{}.".format(self.serverHname, self.serverPort)) self.close() # }}} # {{{ dispatch001(): Dispatch single 001 (RPL_WELCOME) def dispatch001(self, message): - print("Registered on {}:{} as {}, {}, {}.".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) - print("Attempting to join {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) + self._log("Registered on {}:{} as {}, {}, {}.".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) + self._log("Attempting to join {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) self.sendline("JOIN", self.clientChannel) # }}} # {{{ dispatch353(): Dispatch single 353 (RPL_NAMREPLY) @@ -64,18 +64,18 @@ class IrcMiRCARTBot(IrcClient.IrcClient): and channelNickSpec[0] == "@" \ and len(channelNickSpec[1:]): self.clientChannelOps.append(channelNickSpec[1:].lower()) - print("Authorising {} on {}".format(channelNickSpec[1:].lower(), message[4].lower())) + self._log("Authorising {} on {}".format(channelNickSpec[1:].lower(), message[4].lower())) # }}} # {{{ dispatchJoin(): Dispatch single JOIN message from server def dispatchJoin(self, message): - print("Joined {} on {}:{}.".format(message[2].lower(), self.serverHname, self.serverPort)) + self._log("Joined {} on {}:{}.".format(message[2].lower(), self.serverHname, self.serverPort)) self.clientNextTimeout = None; self.clientChannelRejoin = False; # }}} # {{{ dispatchKick(): Dispatch single KICK message from server def dispatchKick(self, message): if message[2].lower() == self.clientChannel.lower() \ and message[3].lower() == self.clientNick.lower(): - print("Kicked from {} by {}, rejoining in 15 seconds".format(message[2].lower(), message[0])) + self._log("Kicked from {} by {}, rejoining in 15 seconds".format(message[2].lower(), message[0])) self.clientNextTimeout = time.time() + 15; self.clientChannelRejoin = True; # }}} # {{{ dispatchMode(): Dispatch single MODE message from server @@ -98,12 +98,12 @@ class IrcMiRCARTBot(IrcClient.IrcClient): if len(channelAuthAdd) \ and channelAuthAdd not in self.clientChannelOps: channelAuthAdd = channelAuthAdd.lower() - print("Authorising {} on {}".format(channelAuthAdd, message[2].lower())) + self._log("Authorising {} on {}".format(channelAuthAdd, message[2].lower())) self.clientChannelOps.append(channelAuthAdd) elif len(channelAuthDel) \ and channelAuthDel in self.clientChannelOps: channelAuthDel = channelAuthDel.lower() - print("Deauthorising {} on {}".format(channelAuthDel, message[2].lower())) + self._log("Deauthorising {} on {}".format(channelAuthDel, message[2].lower())) self.clientChannelOps.remove(channelAuthDel) # }}} # {{{ dispatchPing(): Dispatch single PING message from server @@ -115,13 +115,13 @@ class IrcMiRCARTBot(IrcClient.IrcClient): if message[2].lower() == self.clientChannel.lower() \ and message[3].startswith("!pngbot "): if (int(time.time()) - self.clientLastMessage) < 45: - print("Ignoring request on {} from {} due to rate limit: {}".format(message[2].lower(), message[0], message[3])) + self._log("Ignoring request on {} from {} due to rate limit: {}".format(message[2].lower(), message[0], message[3])) return elif message[0].split("!")[0].lower() not in self.clientChannelOps: - print("Ignoring request on {} from {} due to lack of authorisation: {}".format(message[2].lower(), message[0], message[3])) + self._log("Ignoring request on {} from {} due to lack of authorisation: {}".format(message[2].lower(), message[0], message[3])) return else: - print("Processing request on {} from {}: {}".format(message[2].lower(), message[0], message[3])) + self._log("Processing request on {} from {}: {}".format(message[2].lower(), message[0], message[3])) self.clientLastMessage = int(time.time()) asciiUrl = message[3].split(" ")[1] asciiTmpFilePath = "tmp.txt"; imgTmpFilePath = "tmp.png"; @@ -133,10 +133,10 @@ class IrcMiRCARTBot(IrcClient.IrcClient): _MiRCART = mirc2png.MiRCART(asciiTmpFilePath, imgTmpFilePath, "DejaVuSansMono.ttf", 11) imgurResponse = self.uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") if imgurResponse[0] == 200: - print("Uploaded as: {}".format(imgurResponse[1])) + self._log("Uploaded as: {}".format(imgurResponse[1])) self.sendline("PRIVMSG", message[2], "8/!\\ Uploaded as: {}".format(imgurResponse[1])) else: - print("Upload failed with HTTP status code {}".format(imgurResponse[0])) + self._log("Upload failed with HTTP status code {}".format(imgurResponse[0])) self.sendline("PRIVMSG", message[2], "4/!\\ Uploaded failed with HTTP status code {}!".format(imgurResponse[0])) if os.path.isfile(asciiTmpFilePath): os.remove(asciiTmpFilePath) @@ -146,7 +146,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): # {{{ dispatchTimer(): Dispatch single client timer expiration def dispatchTimer(self): if self.clientChannelRejoin: - print("Attempting to join {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) + self._log("Attempting to join {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) self.sendline("JOIN", self.clientChannel) self.clientNextTimeout = time.time() + 15; self.clientChannelRejoin = True; # }}} @@ -177,6 +177,10 @@ class IrcMiRCARTBot(IrcClient.IrcClient): elif serverMessage[1] == "PRIVMSG": self.dispatchPrivmsg(serverMessage) # }}} + # {{{ self._log(): Log single message to stdout w/ timestamp + def _log(self, msg): + print(time.strftime("%Y/%m/%d %H:%M:%S") + " " + msg) + # }}} # {{{ uploadToImgur(): Upload single file to Imgur def uploadToImgur(self, imgFilePath, imgName, imgTitle, apiKey): requestImageData = open(imgFilePath, "rb").read() From e182f0ffa9db1620c0f5be147d21858343e63071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 03:33:57 +0100 Subject: [PATCH 032/148] {IrcMiRCARTBot,MiRCART}.py: differentiate private class member functions. --- IrcClient.py | 12 ++--- IrcMiRCARTBot.py | 128 +++++++++++++++++++++++------------------------ MiRCART.py | 64 ++++++++++++------------ 3 files changed, 102 insertions(+), 102 deletions(-) diff --git a/IrcClient.py b/IrcClient.py index b8eccb9..423cb55 100644 --- a/IrcClient.py +++ b/IrcClient.py @@ -32,6 +32,12 @@ class IrcClient: clientSocket = clientSocketFile = None; clientNextTimeout = None + # {{{ close(): Close connection to server + def close(self): + if self.clientSocket != None: + self.clientSocket.close() + self.clientSocket = self.clientSocketFile = None; + # }}} # {{{ connect(): Connect to server and register w/ optional timeout def connect(self, timeout=None): self.clientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) @@ -51,12 +57,6 @@ class IrcClient: self.sendline("USER", self.clientIdent, "0", "0", self.clientGecos) return True # }}} - # {{{ close(): Close connection to server - def close(self): - if self.clientSocket != None: - self.clientSocket.close() - self.clientSocket = self.clientSocketFile = None; - # }}} # {{{ readline(): Read and parse single line from server into canonicalised list, honouring timers def readline(self): if self.clientNextTimeout: diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index a2d1a50..bcb049f 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -33,31 +33,14 @@ class IrcMiRCARTBot(IrcClient.IrcClient): clientChannelLastMessage = clientChannelOps = clientChannel = None clientChannelRejoin = None - # {{{ connect(): Connect to server and (re)initialise w/ optional timeout - def connect(self, timeout=None): - self._log("Connecting to {}:{}...".format(self.serverHname, self.serverPort)) - if super().connect(timeout): - self._log("Connected to {}:{}.".format(self.serverHname, self.serverPort)) - self._log("Registering on {}:{} as {}, {}, {}...".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) - self.clientLastMessage = 0; self.clientChannelOps = []; - self.clientChannelRejoin = False - return True - else: - return False - # }}} - # {{{ dispatchNone(): Dispatch None message from server - def dispatchNone(self): - self._log("Disconnected from {}:{}.".format(self.serverHname, self.serverPort)) - self.close() - # }}} - # {{{ dispatch001(): Dispatch single 001 (RPL_WELCOME) - def dispatch001(self, message): + # {{{ _dispatch001(): Dispatch single 001 (RPL_WELCOME) + def _dispatch001(self, message): self._log("Registered on {}:{} as {}, {}, {}.".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) self._log("Attempting to join {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) self.sendline("JOIN", self.clientChannel) # }}} - # {{{ dispatch353(): Dispatch single 353 (RPL_NAMREPLY) - def dispatch353(self, message): + # {{{ _dispatch353(): Dispatch single 353 (RPL_NAMREPLY) + def _dispatch353(self, message): if message[4].lower() == self.clientChannel.lower(): for channelNickSpec in message[5].split(" "): if len(channelNickSpec) \ @@ -66,20 +49,20 @@ class IrcMiRCARTBot(IrcClient.IrcClient): self.clientChannelOps.append(channelNickSpec[1:].lower()) self._log("Authorising {} on {}".format(channelNickSpec[1:].lower(), message[4].lower())) # }}} - # {{{ dispatchJoin(): Dispatch single JOIN message from server - def dispatchJoin(self, message): + # {{{ _dispatchJoin(): Dispatch single JOIN message from server + def _dispatchJoin(self, message): self._log("Joined {} on {}:{}.".format(message[2].lower(), self.serverHname, self.serverPort)) self.clientNextTimeout = None; self.clientChannelRejoin = False; # }}} - # {{{ dispatchKick(): Dispatch single KICK message from server - def dispatchKick(self, message): + # {{{ _dispatchKick(): Dispatch single KICK message from server + def _dispatchKick(self, message): if message[2].lower() == self.clientChannel.lower() \ and message[3].lower() == self.clientNick.lower(): self._log("Kicked from {} by {}, rejoining in 15 seconds".format(message[2].lower(), message[0])) self.clientNextTimeout = time.time() + 15; self.clientChannelRejoin = True; # }}} - # {{{ dispatchMode(): Dispatch single MODE message from server - def dispatchMode(self, message): + # {{{ _dispatchMode(): Dispatch single MODE message from server + def _dispatchMode(self, message): if message[2].lower() == self.clientChannel.lower(): channelModeType = "+"; channelModeArg = 4; channelAuthAdd = ""; channelAuthDel = ""; @@ -106,12 +89,17 @@ class IrcMiRCARTBot(IrcClient.IrcClient): self._log("Deauthorising {} on {}".format(channelAuthDel, message[2].lower())) self.clientChannelOps.remove(channelAuthDel) # }}} - # {{{ dispatchPing(): Dispatch single PING message from server - def dispatchPing(self, message): + # {{{ _dispatchNone(): Dispatch None message from server + def _dispatchNone(self): + self._log("Disconnected from {}:{}.".format(self.serverHname, self.serverPort)) + self.close() + # }}} + # {{{ _dispatchPing(): Dispatch single PING message from server + def _dispatchPing(self, message): self.sendline("PONG", message[2]) # }}} - # {{{ dispatchPrivmsg(): Dispatch single PRIVMSG message from server - def dispatchPrivmsg(self, message): + # {{{ _dispatchPrivmsg(): Dispatch single PRIVMSG message from server + def _dispatchPrivmsg(self, message): if message[2].lower() == self.clientChannel.lower() \ and message[3].startswith("!pngbot "): if (int(time.time()) - self.clientLastMessage) < 45: @@ -131,7 +119,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): os.remove(imgTmpFilePath) urllib.request.urlretrieve(asciiUrl, asciiTmpFilePath) _MiRCART = mirc2png.MiRCART(asciiTmpFilePath, imgTmpFilePath, "DejaVuSansMono.ttf", 11) - imgurResponse = self.uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") + imgurResponse = self._uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") if imgurResponse[0] == 200: self._log("Uploaded as: {}".format(imgurResponse[1])) self.sendline("PRIVMSG", message[2], "8/!\\ Uploaded as: {}".format(imgurResponse[1])) @@ -143,46 +131,19 @@ class IrcMiRCARTBot(IrcClient.IrcClient): if os.path.isfile(imgTmpFilePath): os.remove(imgTmpFilePath) # }}} - # {{{ dispatchTimer(): Dispatch single client timer expiration - def dispatchTimer(self): + # {{{ _dispatchTimer(): Dispatch single client timer expiration + def _dispatchTimer(self): if self.clientChannelRejoin: self._log("Attempting to join {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) self.sendline("JOIN", self.clientChannel) self.clientNextTimeout = time.time() + 15; self.clientChannelRejoin = True; # }}} - # {{{ dispatch(): Read, parse, and dispatch single line from server - def dispatch(self): - while True: - if self.clientNextTimeout: - timeNow = time.time() - if self.clientNextTimeout <= timeNow: - self.dispatchTimer() - serverMessage = self.readline() - if serverMessage == None: - self.dispatchNone(); break; - elif serverMessage == "": - continue - elif serverMessage[1] == "001": - self.dispatch001(serverMessage) - elif serverMessage[1] == "353": - self.dispatch353(serverMessage) - elif serverMessage[1] == "JOIN": - self.dispatchJoin(serverMessage) - elif serverMessage[1] == "KICK": - self.dispatchKick(serverMessage) - elif serverMessage[1] == "MODE": - self.dispatchMode(serverMessage) - elif serverMessage[1] == "PING": - self.dispatchPing(serverMessage) - elif serverMessage[1] == "PRIVMSG": - self.dispatchPrivmsg(serverMessage) - # }}} - # {{{ self._log(): Log single message to stdout w/ timestamp + # {{{ _log(): Log single message to stdout w/ timestamp def _log(self, msg): print(time.strftime("%Y/%m/%d %H:%M:%S") + " " + msg) # }}} - # {{{ uploadToImgur(): Upload single file to Imgur - def uploadToImgur(self, imgFilePath, imgName, imgTitle, apiKey): + # {{{ _uploadToImgur(): Upload single file to Imgur + def _uploadToImgur(self, imgFilePath, imgName, imgTitle, apiKey): requestImageData = open(imgFilePath, "rb").read() requestData = { \ "image": base64.b64encode(requestImageData), \ @@ -199,6 +160,45 @@ class IrcMiRCARTBot(IrcClient.IrcClient): else: return [responseHttp.status_code] # }}} + # {{{ connect(): Connect to server and (re)initialise w/ optional timeout + def connect(self, timeout=None): + self._log("Connecting to {}:{}...".format(self.serverHname, self.serverPort)) + if super().connect(timeout): + self._log("Connected to {}:{}.".format(self.serverHname, self.serverPort)) + self._log("Registering on {}:{} as {}, {}, {}...".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) + self.clientLastMessage = 0; self.clientChannelOps = []; + self.clientChannelRejoin = False + return True + else: + return False + # }}} + # {{{ dispatch(): Read, parse, and dispatch single line from server + def dispatch(self): + while True: + if self.clientNextTimeout: + timeNow = time.time() + if self.clientNextTimeout <= timeNow: + self._dispatchTimer() + serverMessage = self.readline() + if serverMessage == None: + self._dispatchNone(); break; + elif serverMessage == "": + continue + elif serverMessage[1] == "001": + self._dispatch001(serverMessage) + elif serverMessage[1] == "353": + self._dispatch353(serverMessage) + elif serverMessage[1] == "JOIN": + self._dispatchJoin(serverMessage) + elif serverMessage[1] == "KICK": + self._dispatchKick(serverMessage) + elif serverMessage[1] == "MODE": + self._dispatchMode(serverMessage) + elif serverMessage[1] == "PING": + self._dispatchPing(serverMessage) + elif serverMessage[1] == "PRIVMSG": + self._dispatchPrivmsg(serverMessage) + # }}} # # Initialisation method diff --git a/MiRCART.py b/MiRCART.py index 9fac4cb..ead67fc 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -41,8 +41,8 @@ class MiRCART: state = None; inCurCol = None; - # {{{ ColourMapBold: mIRC colour number to RGBA map given ^B (bold) - ColourMapBold = [ + # {{{ _ColourMapBold: mIRC colour number to RGBA map given ^B (bold) + _ColourMapBold = [ (255, 255, 255, 255), # White (85, 85, 85, 255), # Grey (85, 85, 255, 255), # Light Blue @@ -61,8 +61,8 @@ class MiRCART: (255, 255, 255, 255), # White ] # }}} - # {{{ ColourMapNormal: mIRC colour number to RGBA map given none of ^[BFV_] (bold, italic, reverse, underline) - ColourMapNormal = [ + # {{{ _ColourMapNormal: mIRC colour number to RGBA map given none of ^[BFV_] (bold, italic, reverse, underline) + _ColourMapNormal = [ (255, 255, 255, 255), # White (0, 0, 0, 255), # Black (0, 0, 187, 255), # Blue @@ -81,41 +81,41 @@ class MiRCART: (187, 187, 187, 255), # Light Grey ] # }}} - # {{{ State: Parsing loop state - class State(Enum): + # {{{ _State: Parsing loop state + class _State(Enum): STATE_CHAR = 1 STATE_COLOUR_SPEC = 2 # }}} - # {{{ getMaxCols(): Calculate widest row in lines, ignoring non-printable & mIRC control code sequences - def getMaxCols(self, lines): + # {{{ _getMaxCols(): Calculate widest row in lines, ignoring non-printable & mIRC control code sequences + def _getMaxCols(self, lines): maxCols = 0; for curRow in range(0, len(lines)): - curRowCols = 0; curState = self.State.STATE_CHAR; + curRowCols = 0; curState = self._State.STATE_CHAR; curCol = 0; curColLen = len(lines[curRow]); while curCol < curColLen: curChar = lines[curRow][curCol] - if curState == self.State.STATE_CHAR: + if curState == self._State.STATE_CHAR: if curChar == "": - curState = self.State.STATE_COLOUR_SPEC; curCol += 1; + curState = self._State.STATE_COLOUR_SPEC; curCol += 1; elif curChar in string.printable: curRowCols += 1; curCol += 1; else: curCol += 1; - elif curState == self.State.STATE_COLOUR_SPEC: + elif curState == self._State.STATE_COLOUR_SPEC: if curChar in set(",0123456789"): curCol += 1; else: - curState = self.State.STATE_CHAR; + curState = self._State.STATE_CHAR; maxCols = max(maxCols, curRowCols) return maxCols # }}} - # {{{ parseAsChar(): Parse single character as regular character and mutate state - def parseAsChar(self, char): + # {{{ _parseAsChar(): Parse single character as regular character and mutate state + def _parseAsChar(self, char): if char == "": self.inCurCol += 1; self.inCurBold = 0 if self.inCurBold else 1; elif char == "": - self.state = self.State.STATE_COLOUR_SPEC; self.inCurCol += 1; + self._State = self._State.STATE_COLOUR_SPEC; self.inCurCol += 1; elif char == "": self.inCurCol += 1; self.inCurItalic = 0 if self.inCurItalic else 1; elif char == "": @@ -129,20 +129,20 @@ class MiRCART: self.inCurCol += 1; self.inCurUnderline = 0 if self.inCurUnderline else 1; elif char == " ": if self.inCurBold: - colourBg = self.ColourMapBold[self.outCurColourBg] + colourBg = self._ColourMapBold[self.outCurColourBg] else: - colourBg = self.ColourMapNormal[self.outCurColourBg] + colourBg = self._ColourMapNormal[self.outCurColourBg] self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + 7, self.outCurY + 14)), fill=colourBg) if self.inCurUnderline: self.outImgDraw.line((self.outCurX, self.outCurY + 11, self.outCurX + 7, self.outCurY + 11), fill=colourFg) self.outCurX += 7; self.inCurCol += 1; else: if self.inCurBold: - colourBg = self.ColourMapBold[self.outCurColourBg] - colourFg = self.ColourMapBold[self.outCurColourFg] + colourBg = self._ColourMapBold[self.outCurColourBg] + colourFg = self._ColourMapBold[self.outCurColourFg] else: - colourBg = self.ColourMapNormal[self.outCurColourBg] - colourFg = self.ColourMapNormal[self.outCurColourFg] + colourBg = self._ColourMapNormal[self.outCurColourBg] + colourFg = self._ColourMapNormal[self.outCurColourFg] self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + 7, self.outCurY + 14)), fill=colourBg) # XXX implement italic self.outImgDraw.text((self.outCurX, self.outCurY), char, colourFg, self.outImgFont) @@ -150,8 +150,8 @@ class MiRCART: self.outImgDraw.line((self.outCurX, self.outCurY + 11, self.outCurX + 7, self.outCurY + 11), fill=colourFg) self.outCurX += 7; self.inCurCol += 1; # }}} - # {{{ parseAsColourSpec(): Parse single character as mIRC colour control code sequence and mutate state - def parseAsColourSpec(self, char): + # {{{ _parseAsColourSpec(): Parse single character as mIRC colour control code sequence and mutate state + def _parseAsColourSpec(self, char): if char in set(",0123456789"): self.inCurColourSpec += char; self.inCurCol += 1; else: @@ -163,7 +163,7 @@ class MiRCART: self.outCurColourFg = int(self.inCurColourSpec[0]) else: self.outCurColourBg = 1; self.outCurColourFg = 15; - self.inCurColourSpec = ""; self.state = self.State.STATE_CHAR; + self.inCurColourSpec = ""; self._State = self._State.STATE_CHAR; # }}} # @@ -171,23 +171,23 @@ class MiRCART: def __init__(self, inFilePath, imgFilePath, fontFilePath="DejaVuSansMono.ttf", fontSize=11): self.inFilePath = inFilePath; self.inFile = open(inFilePath, "r"); self.inLines = self.inFile.readlines() - self.inColsMax = self.getMaxCols(self.inLines) + self.inColsMax = self._getMaxCols(self.inLines) self.inRows = len(self.inLines) self.outFontFilePath = fontFilePath; self.outFontSize = int(fontSize); - self.outImg = Image.new("RGBA", (self.inColsMax * 7, self.inRows * 14), self.ColourMapNormal[1]) + self.outImg = Image.new("RGBA", (self.inColsMax * 7, self.inRows * 14), self._ColourMapNormal[1]) self.outImgDraw = ImageDraw.Draw(self.outImg) self.outImgFont = ImageFont.truetype(self.outFontFilePath, self.outFontSize) self.outCurColourBg = 1; self.outCurColourFg = 15; self.outCurX = 0; self.outCurY = 0; for inCurRow in range(0, len(self.inLines)): self.inCurBold = 0; self.inCurItalic = 0; self.inCurUnderline = 0; - self.inCurColourSpec = ""; self.state = self.State.STATE_CHAR; + self.inCurColourSpec = ""; self._State = self._State.STATE_CHAR; self.inCurCol = 0; while self.inCurCol < len(self.inLines[inCurRow]): - if self.state == self.State.STATE_CHAR: - self.parseAsChar(self.inLines[inCurRow][self.inCurCol]) - elif self.state == self.State.STATE_COLOUR_SPEC: - self.parseAsColourSpec(self.inLines[inCurRow][self.inCurCol]) + if self._State == self._State.STATE_CHAR: + self._parseAsChar(self.inLines[inCurRow][self.inCurCol]) + elif self._State == self._State.STATE_COLOUR_SPEC: + self._parseAsColourSpec(self.inLines[inCurRow][self.inCurCol]) self.outCurX = 0; self.outCurY += 13; self.inFile.close(); self.outImg.save(imgFilePath); From 523d91ff894bfab7ee310f21dabd53523f887080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 03:52:41 +0100 Subject: [PATCH 033/148] MiRCART.py:MiRCART._parseAsChar(): derive rectangle & line coordinates and outCur{X,Y} offset from outImgFontSize[{0,1}]. MiRCART.py:MiRCART.__init__(): initialise outImgFontSize and add underline area offset. MiRCART.py:MiRCART.__init__(): derive outCurY offset from outImgFontSize[1]. --- MiRCART.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index ead67fc..c15ff81 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -132,10 +132,10 @@ class MiRCART: colourBg = self._ColourMapBold[self.outCurColourBg] else: colourBg = self._ColourMapNormal[self.outCurColourBg] - self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + 7, self.outCurY + 14)), fill=colourBg) + self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + self.outImgFontSize[0], self.outCurY + self.outImgFontSize[1])), fill=colourBg) if self.inCurUnderline: - self.outImgDraw.line((self.outCurX, self.outCurY + 11, self.outCurX + 7, self.outCurY + 11), fill=colourFg) - self.outCurX += 7; self.inCurCol += 1; + self.outImgDraw.line((self.outCurX, self.outCurY + (self.outImgFontSize[1] - 2), self.outCurX + self.outImgFontSize[0], self.outCurY + (self.outImgFontSize[1] - 2)), fill=colourFg) + self.outCurX += self.outImgFontSize[0]; self.inCurCol += 1; else: if self.inCurBold: colourBg = self._ColourMapBold[self.outCurColourBg] @@ -143,12 +143,12 @@ class MiRCART: else: colourBg = self._ColourMapNormal[self.outCurColourBg] colourFg = self._ColourMapNormal[self.outCurColourFg] - self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + 7, self.outCurY + 14)), fill=colourBg) + self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + self.outImgFontSize[0], self.outCurY + self.outImgFontSize[1])), fill=colourBg) # XXX implement italic self.outImgDraw.text((self.outCurX, self.outCurY), char, colourFg, self.outImgFont) if self.inCurUnderline: - self.outImgDraw.line((self.outCurX, self.outCurY + 11, self.outCurX + 7, self.outCurY + 11), fill=colourFg) - self.outCurX += 7; self.inCurCol += 1; + self.outImgDraw.line((self.outCurX, self.outCurY + (self.outImgFontSize[1] - 2), self.outCurX + self.outImgFontSize[0], self.outCurY + (self.outImgFontSize[1] - 2)), fill=colourFg) + self.outCurX += self.outImgFontSize[0]; self.inCurCol += 1; # }}} # {{{ _parseAsColourSpec(): Parse single character as mIRC colour control code sequence and mutate state def _parseAsColourSpec(self, char): @@ -174,9 +174,10 @@ class MiRCART: self.inColsMax = self._getMaxCols(self.inLines) self.inRows = len(self.inLines) self.outFontFilePath = fontFilePath; self.outFontSize = int(fontSize); - self.outImg = Image.new("RGBA", (self.inColsMax * 7, self.inRows * 14), self._ColourMapNormal[1]) - self.outImgDraw = ImageDraw.Draw(self.outImg) self.outImgFont = ImageFont.truetype(self.outFontFilePath, self.outFontSize) + self.outImgFontSize = list(self.outImgFont.getsize(" ")); self.outImgFontSize[1] += 3; + self.outImg = Image.new("RGBA", (self.inColsMax * self.outImgFontSize[0], self.inRows * self.outImgFontSize[1]), self._ColourMapNormal[1]) + self.outImgDraw = ImageDraw.Draw(self.outImg) self.outCurColourBg = 1; self.outCurColourFg = 15; self.outCurX = 0; self.outCurY = 0; for inCurRow in range(0, len(self.inLines)): @@ -188,7 +189,7 @@ class MiRCART: self._parseAsChar(self.inLines[inCurRow][self.inCurCol]) elif self._State == self._State.STATE_COLOUR_SPEC: self._parseAsColourSpec(self.inLines[inCurRow][self.inCurCol]) - self.outCurX = 0; self.outCurY += 13; + self.outCurX = 0; self.outCurY += self.outImgFontSize[1]; self.inFile.close(); self.outImg.save(imgFilePath); From 6fcf0e0a4f8152b103efac6c594fc31bab8e01f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 04:15:43 +0100 Subject: [PATCH 034/148] IrcClient.py:IrcClient.{queue,unqueue}(): split. IrcMiRCARTBot.py:IrcMiRCARTBot._dispatch{001,Ping,Privmsg,Timer}(): replace readline() calls w/ queue() calls. IrcMiRCARTBot.py:IrcMiRCARTBot.dispatch(): call unqueue() after processing timers and prior to calling readline(). --- IrcClient.py | 34 ++++++++++++++++++++++++---------- IrcMiRCARTBot.py | 11 ++++++----- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/IrcClient.py b/IrcClient.py index 423cb55..e475ba2 100644 --- a/IrcClient.py +++ b/IrcClient.py @@ -30,7 +30,7 @@ class IrcClient: serverHname = serverPort = None; clientNick = clientIdent = clientGecos = None; clientSocket = clientSocketFile = None; - clientNextTimeout = None + clientNextTimeout = None; clientQueue = None; # {{{ close(): Close connection to server def close(self): @@ -53,8 +53,9 @@ class IrcClient: else: select.select([], [self.clientSocket.fileno()], []) self.clientSocketFile = self.clientSocket.makefile() - self.sendline("NICK", self.clientNick) - self.sendline("USER", self.clientIdent, "0", "0", self.clientGecos) + self.clientQueue = [] + self.queue("NICK", self.clientNick) + self.queue("USER", self.clientIdent, "0", "0", self.clientGecos) return True # }}} # {{{ readline(): Read and parse single line from server into canonicalised list, honouring timers @@ -86,20 +87,33 @@ class IrcClient: msg = [""] + msg[0:] return msg # }}} - # {{{ sendline(): Parse and send single line to server from list, ignoring timers - def sendline(self, *args): + # {{{ queue(): Parse and queue single line to server from list + def queue(self, *args): msg = ""; argNumMax = len(args); for argNum in range(0, argNumMax): if argNum == (argNumMax - 1): msg += ":" + args[argNum] else: msg += args[argNum] + " " - msg = (msg + "\r\n").encode(); msgLen = len(msg); msgBytesSent = 0; - while msgBytesSent < msgLen: - readySet = select.select([], [self.clientSocket.fileno()], []) - msgBytesSent = self.clientSocket.send(msg) - msg = msg[msgBytesSent:]; msgLen -= msgBytesSent; + self.clientQueue.append(msg) # }}} + # {{{ unqueue(): Send all queued lines to server, honouring timers + def unqueue(self): + while self.clientQueue: + msg = self.clientQueue[0] + msg = (msg + "\r\n").encode(); msgLen = len(msg); msgBytesSent = 0; + while msgBytesSent < msgLen: + if self.clientNextTimeout: + timeNow = time.time() + if self.clientNextTimeout <= timeNow: + self.clientQueue[0] = msg; return; + else: + readySet = select.select([], [self.clientSocket.fileno()], [], self.clientNextTimeout - timeNow) + else: + readySet = select.select([], [self.clientSocket.fileno()], []) + msgBytesSent = self.clientSocket.send(msg) + msg = msg[msgBytesSent:]; msgLen -= msgBytesSent; + del self.clientQueue[0] # # Initialisation method diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index bcb049f..8c32884 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -37,7 +37,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): def _dispatch001(self, message): self._log("Registered on {}:{} as {}, {}, {}.".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) self._log("Attempting to join {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) - self.sendline("JOIN", self.clientChannel) + self.queue("JOIN", self.clientChannel) # }}} # {{{ _dispatch353(): Dispatch single 353 (RPL_NAMREPLY) def _dispatch353(self, message): @@ -96,7 +96,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): # }}} # {{{ _dispatchPing(): Dispatch single PING message from server def _dispatchPing(self, message): - self.sendline("PONG", message[2]) + self.queue("PONG", message[2]) # }}} # {{{ _dispatchPrivmsg(): Dispatch single PRIVMSG message from server def _dispatchPrivmsg(self, message): @@ -122,10 +122,10 @@ class IrcMiRCARTBot(IrcClient.IrcClient): imgurResponse = self._uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") if imgurResponse[0] == 200: self._log("Uploaded as: {}".format(imgurResponse[1])) - self.sendline("PRIVMSG", message[2], "8/!\\ Uploaded as: {}".format(imgurResponse[1])) + self.queue("PRIVMSG", message[2], "8/!\\ Uploaded as: {}".format(imgurResponse[1])) else: self._log("Upload failed with HTTP status code {}".format(imgurResponse[0])) - self.sendline("PRIVMSG", message[2], "4/!\\ Uploaded failed with HTTP status code {}!".format(imgurResponse[0])) + self.queue("PRIVMSG", message[2], "4/!\\ Uploaded failed with HTTP status code {}!".format(imgurResponse[0])) if os.path.isfile(asciiTmpFilePath): os.remove(asciiTmpFilePath) if os.path.isfile(imgTmpFilePath): @@ -135,7 +135,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): def _dispatchTimer(self): if self.clientChannelRejoin: self._log("Attempting to join {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) - self.sendline("JOIN", self.clientChannel) + self.queue("JOIN", self.clientChannel) self.clientNextTimeout = time.time() + 15; self.clientChannelRejoin = True; # }}} # {{{ _log(): Log single message to stdout w/ timestamp @@ -179,6 +179,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): timeNow = time.time() if self.clientNextTimeout <= timeNow: self._dispatchTimer() + self.unqueue() serverMessage = self.readline() if serverMessage == None: self._dispatchNone(); break; From 95b706b4bd2339c52cc279a38cc1b09e302c98d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 04:19:13 +0100 Subject: [PATCH 035/148] IrcMiRCARTBot.py:IrcMiRCARTBot._dispatchPrivmsg(): correctly instantiate MiRCART.MiRCART. --- IrcMiRCARTBot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index 8c32884..d00fc24 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -118,7 +118,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): if os.path.isfile(imgTmpFilePath): os.remove(imgTmpFilePath) urllib.request.urlretrieve(asciiUrl, asciiTmpFilePath) - _MiRCART = mirc2png.MiRCART(asciiTmpFilePath, imgTmpFilePath, "DejaVuSansMono.ttf", 11) + _MiRCART = MiRCART.MiRCART(asciiTmpFilePath, imgTmpFilePath, "DejaVuSansMono.ttf", 11) imgurResponse = self._uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") if imgurResponse[0] == 200: self._log("Uploaded as: {}".format(imgurResponse[1])) From f2affda37e27007b921f5891737fbc8662552a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 04:24:18 +0100 Subject: [PATCH 036/148] IrcMiRCARTBot.py:IrcMiRCARTBot._dispatchPrivmsg(): catch urllib.error.HTTPError exception during download. IrcMiRCARTBot.py:IrcMiRCARTBot._dispatchPrivmsg(): fix typo. --- IrcMiRCARTBot.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index d00fc24..3be31c9 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -117,7 +117,12 @@ class IrcMiRCARTBot(IrcClient.IrcClient): os.remove(asciiTmpFilePath) if os.path.isfile(imgTmpFilePath): os.remove(imgTmpFilePath) - urllib.request.urlretrieve(asciiUrl, asciiTmpFilePath) + try: + urllib.request.urlretrieve(asciiUrl, asciiTmpFilePath) + except urllib.error.HTTPError as err: + self._log("Download failed with HTTP status code {}".format(err.code)) + self.queue("PRIVMSG", message[2], "4/!\\ Download failed with HTTP status code {}!".format(err.code)) + return _MiRCART = MiRCART.MiRCART(asciiTmpFilePath, imgTmpFilePath, "DejaVuSansMono.ttf", 11) imgurResponse = self._uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") if imgurResponse[0] == 200: @@ -125,7 +130,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): self.queue("PRIVMSG", message[2], "8/!\\ Uploaded as: {}".format(imgurResponse[1])) else: self._log("Upload failed with HTTP status code {}".format(imgurResponse[0])) - self.queue("PRIVMSG", message[2], "4/!\\ Uploaded failed with HTTP status code {}!".format(imgurResponse[0])) + self.queue("PRIVMSG", message[2], "4/!\\ Upload failed with HTTP status code {}!".format(imgurResponse[0])) if os.path.isfile(asciiTmpFilePath): os.remove(asciiTmpFilePath) if os.path.isfile(imgTmpFilePath): From 97d8caaf1ed8fb9884bccee52aa4cdf967317dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 15:12:28 +0100 Subject: [PATCH 037/148] IrcClient.py: add missing `# {{{'. --- IrcClient.py | 1 + 1 file changed, 1 insertion(+) diff --git a/IrcClient.py b/IrcClient.py index e475ba2..03e0e6f 100644 --- a/IrcClient.py +++ b/IrcClient.py @@ -114,6 +114,7 @@ class IrcClient: msgBytesSent = self.clientSocket.send(msg) msg = msg[msgBytesSent:]; msgLen -= msgBytesSent; del self.clientQueue[0] + # }}} # # Initialisation method From 9c34fe32209de6a8deca9cbfbd3036200841f12f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 15:13:52 +0100 Subject: [PATCH 038/148] IrcClient.py:IrcClient.unqueue(): handle timeout from timed select(). --- IrcClient.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IrcClient.py b/IrcClient.py index 03e0e6f..90b2629 100644 --- a/IrcClient.py +++ b/IrcClient.py @@ -109,6 +109,8 @@ class IrcClient: self.clientQueue[0] = msg; return; else: readySet = select.select([], [self.clientSocket.fileno()], [], self.clientNextTimeout - timeNow) + if len(readySet[1]) == 0: + self.clientQueue[0] = msg; return; else: readySet = select.select([], [self.clientSocket.fileno()], []) msgBytesSent = self.clientSocket.send(msg) From b71ca6af897af94adb03f961cb9257a51f213da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 15:18:28 +0100 Subject: [PATCH 039/148] IrcClient.py:IrcClient.{queue,unqueue}(): always CR NL-terminate messages & encode() before queuing. --- IrcClient.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/IrcClient.py b/IrcClient.py index 90b2629..161e1ca 100644 --- a/IrcClient.py +++ b/IrcClient.py @@ -95,13 +95,12 @@ class IrcClient: msg += ":" + args[argNum] else: msg += args[argNum] + " " - self.clientQueue.append(msg) + self.clientQueue.append((msg + "\r\n").encode()) # }}} # {{{ unqueue(): Send all queued lines to server, honouring timers def unqueue(self): while self.clientQueue: - msg = self.clientQueue[0] - msg = (msg + "\r\n").encode(); msgLen = len(msg); msgBytesSent = 0; + msg = self.clientQueue[0]; msgLen = len(msg); msgBytesSent = 0; while msgBytesSent < msgLen: if self.clientNextTimeout: timeNow = time.time() From 49705ad4bc4476b4013d39ff3683ca81d9d51fd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 15:37:26 +0100 Subject: [PATCH 040/148] IrcMiRCARTBot.py:IrcMiRCARTBot.{ContentTooLargeException,_urlretrieveReportHook()}: restrict ASCII downloads to 1 MB in size. IrcMiRCARTBot.py:IrcMiRCARTBot._dispatchPrivmsg(): pass (static) _urlretrieveReportHook() to urllib.request.urlretrieve(). IrcMiRCARTBot.py:IrcMiRCARTBot._dispatchPrivmsg(): handle ContentTooLargeException, urllib.error.URLError, and ValueError exceptions. IrcMiRCARTBot.py:IrcMiRCARTBot._dispatchPrivmsg(): only reset clientLastMessage after successful completion. --- IrcMiRCARTBot.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index 3be31c9..65674ae 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -33,6 +33,10 @@ class IrcMiRCARTBot(IrcClient.IrcClient): clientChannelLastMessage = clientChannelOps = clientChannel = None clientChannelRejoin = None + # {{{ ContentTooLargeException: Raised by _urlretrieveReportHook() given download size > 1 MB + class ContentTooLargeException(Exception): + pass + # }}} # {{{ _dispatch001(): Dispatch single 001 (RPL_WELCOME) def _dispatch001(self, message): self._log("Registered on {}:{} as {}, {}, {}.".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) @@ -110,7 +114,6 @@ class IrcMiRCARTBot(IrcClient.IrcClient): return else: self._log("Processing request on {} from {}: {}".format(message[2].lower(), message[0], message[3])) - self.clientLastMessage = int(time.time()) asciiUrl = message[3].split(" ")[1] asciiTmpFilePath = "tmp.txt"; imgTmpFilePath = "tmp.png"; if os.path.isfile(asciiTmpFilePath): @@ -118,16 +121,29 @@ class IrcMiRCARTBot(IrcClient.IrcClient): if os.path.isfile(imgTmpFilePath): os.remove(imgTmpFilePath) try: - urllib.request.urlretrieve(asciiUrl, asciiTmpFilePath) + urllib.request.urlretrieve(asciiUrl, asciiTmpFilePath, IrcMiRCARTBot._urlretrieveReportHook) + except IrcMiRCARTBot.ContentTooLargeException: + self._log("Download size exceeds quota of 1 MB!") + self.queue("PRIVMSG", message[2], "4/!\\ Download size exceeds quota of 1 MB!") + return except urllib.error.HTTPError as err: self._log("Download failed with HTTP status code {}".format(err.code)) self.queue("PRIVMSG", message[2], "4/!\\ Download failed with HTTP status code {}!".format(err.code)) return + except urllib.error.URLError as err: + self._log("Invalid URL specified!") + self.queue("PRIVMSG", message[2], "4/!\\ Invalid URL specified!") + return + except ValueError as err: + self._log("Unknown URL type specified!") + self.queue("PRIVMSG", message[2], "4/!\\ Unknown URL type specified!") + return _MiRCART = MiRCART.MiRCART(asciiTmpFilePath, imgTmpFilePath, "DejaVuSansMono.ttf", 11) imgurResponse = self._uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") if imgurResponse[0] == 200: self._log("Uploaded as: {}".format(imgurResponse[1])) self.queue("PRIVMSG", message[2], "8/!\\ Uploaded as: {}".format(imgurResponse[1])) + self.clientLastMessage = int(time.time()) else: self._log("Upload failed with HTTP status code {}".format(imgurResponse[0])) self.queue("PRIVMSG", message[2], "4/!\\ Upload failed with HTTP status code {}!".format(imgurResponse[0])) @@ -165,6 +181,11 @@ class IrcMiRCARTBot(IrcClient.IrcClient): else: return [responseHttp.status_code] # }}} + # {{{ _urlretrieveReportHook(): Limit downloads to 1 MB + def _urlretrieveReportHook(count, blockSize, totalSize): + if (totalSize > pow(2,10)): + raise IrcMiRCARTBot.ContentTooLargeException + # }}} # {{{ connect(): Connect to server and (re)initialise w/ optional timeout def connect(self, timeout=None): self._log("Connecting to {}:{}...".format(self.serverHname, self.serverPort)) From 1a2dd5f6921cd74695b726042d355fc75aa99c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 4 Jan 2018 16:24:06 +0100 Subject: [PATCH 041/148] MiRC2png.py: renamed from MiRCART.py. {IrcClient,IrcMiRCARTBot,MiRC2png}.py: update Vim modeline w/ `sw=4 ts=4'. {IrcMiRCARTBot,MiRC2png}.py: update header legend. IrcMiRCARTBot.py:IrcMiRCARTBot._dispatchPrivmsg(): lower rate limit to (once per) 30 seconds. IrcMiRCARTBot.py:IrcMiRCARTBot._dispatchPrivmsg(): eliminate useless instance variable. IrcMiRCARTBot.py:IrcMiRCARTBot._urlretrieveReportHook(): compare against correct limit of 1 MB (2**20.) MiRCART.py: initial commit. README.md: updated. --- IrcClient.py | 2 +- IrcMiRCARTBot.py | 12 +- MiRC2png.py | 211 +++++++++++++++++++++++++++++++++++ MiRCART.py | 285 +++++++++++++++++++++-------------------------- README.md | 12 +- 5 files changed, 356 insertions(+), 166 deletions(-) create mode 100755 MiRC2png.py diff --git a/IrcClient.py b/IrcClient.py index 161e1ca..61e6d31 100644 --- a/IrcClient.py +++ b/IrcClient.py @@ -123,4 +123,4 @@ class IrcClient: self.serverHname = serverHname; self.serverPort = serverPort; self.clientNick = clientNick; self.clientIdent = clientIdent; self.clientGecos = clientGecos; -# vim:expandtab foldmethod=marker sw=8 ts=8 tw=120 +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index 65674ae..3af1764 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# mirc2png -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) +# IrcMiRCARTBot.py -- XXX # Copyright (c) 2018 Lucio Andrés Illanes Albornoz # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -25,7 +25,7 @@ import base64 import os, sys, time import json -import IrcClient, MiRCART +import IrcClient, MiRC2png import requests, urllib.request class IrcMiRCARTBot(IrcClient.IrcClient): @@ -106,7 +106,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): def _dispatchPrivmsg(self, message): if message[2].lower() == self.clientChannel.lower() \ and message[3].startswith("!pngbot "): - if (int(time.time()) - self.clientLastMessage) < 45: + if (int(time.time()) - self.clientLastMessage) < 30: self._log("Ignoring request on {} from {} due to rate limit: {}".format(message[2].lower(), message[0], message[3])) return elif message[0].split("!")[0].lower() not in self.clientChannelOps: @@ -138,7 +138,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): self._log("Unknown URL type specified!") self.queue("PRIVMSG", message[2], "4/!\\ Unknown URL type specified!") return - _MiRCART = MiRCART.MiRCART(asciiTmpFilePath, imgTmpFilePath, "DejaVuSansMono.ttf", 11) + MiRC2png.MiRC2png(asciiTmpFilePath, imgTmpFilePath, "DejaVuSansMono.ttf", 11) imgurResponse = self._uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") if imgurResponse[0] == 200: self._log("Uploaded as: {}".format(imgurResponse[1])) @@ -183,7 +183,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): # }}} # {{{ _urlretrieveReportHook(): Limit downloads to 1 MB def _urlretrieveReportHook(count, blockSize, totalSize): - if (totalSize > pow(2,10)): + if (totalSize > pow(2,20)): raise IrcMiRCARTBot.ContentTooLargeException # }}} # {{{ connect(): Connect to server and (re)initialise w/ optional timeout @@ -256,4 +256,4 @@ if __name__ == "__main__": else: main(*sys.argv) -# vim:expandtab foldmethod=marker sw=8 ts=8 tw=120 +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRC2png.py b/MiRC2png.py new file mode 100755 index 0000000..adf3b44 --- /dev/null +++ b/MiRC2png.py @@ -0,0 +1,211 @@ +#!/usr/bin/env python3 +# +# MiRC2png.py -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from enum import Enum +from PIL import Image, ImageDraw, ImageFont +import string, sys + +class MiRC2png: + """Abstraction over ASCIIs containing mIRC control codes""" + inFilePath = inFile = None; + inLines = inColsMax = inRows = None; + + outFontFilePath = outFontSize = None; + outImg = outImgDraw = outImgFont = None; + outCurColourBg = outCurColourFg = None; + outCurX = outCurY = None; + + inCurBold = inCurItalic = inCurUnderline = None; + inCurColourSpec = None; + state = None; + inCurCol = None; + + # {{{ _ColourMapBold: mIRC colour number to RGBA map given ^B (bold) + _ColourMapBold = [ + (255, 255, 255, 255), # White + (85, 85, 85, 255), # Grey + (85, 85, 255, 255), # Light Blue + (85, 255, 85, 255), # Light Green + (255, 85, 85, 255), # Light Red + (255, 85, 85, 255), # Light Red + (255, 85, 255, 255), # Pink + (255, 255, 85, 255), # Light Yellow + (255, 255, 85, 255), # Light Yellow + (85, 255, 85, 255), # Light Green + (85, 255, 255, 255), # Light Cyan + (85, 255, 255, 255), # Light Cyan + (85, 85, 255, 255), # Light Blue + (255, 85, 255, 255), # Pink + (85, 85, 85, 255), # Grey + (255, 255, 255, 255), # White + ] + # }}} + # {{{ _ColourMapNormal: mIRC colour number to RGBA map given none of ^[BFV_] (bold, italic, reverse, underline) + _ColourMapNormal = [ + (255, 255, 255, 255), # White + (0, 0, 0, 255), # Black + (0, 0, 187, 255), # Blue + (0, 187, 0, 255), # Green + (255, 85, 85, 255), # Light Red + (187, 0, 0, 255), # Red + (187, 0, 187, 255), # Purple + (187, 187, 0, 255), # Yellow + (255, 255, 85, 255), # Light Yellow + (85, 255, 85, 255), # Light Green + (0, 187, 187, 255), # Cyan + (85, 255, 255, 255), # Light Cyan + (85, 85, 255, 255), # Light Blue + (255, 85, 255, 255), # Pink + (85, 85, 85, 255), # Grey + (187, 187, 187, 255), # Light Grey + ] + # }}} + # {{{ _State: Parsing loop state + class _State(Enum): + STATE_CHAR = 1 + STATE_COLOUR_SPEC = 2 + # }}} + + # {{{ _getMaxCols(): Calculate widest row in lines, ignoring non-printable & mIRC control code sequences + def _getMaxCols(self, lines): + maxCols = 0; + for curRow in range(0, len(lines)): + curRowCols = 0; curState = self._State.STATE_CHAR; + curCol = 0; curColLen = len(lines[curRow]); + while curCol < curColLen: + curChar = lines[curRow][curCol] + if curState == self._State.STATE_CHAR: + if curChar == "": + curState = self._State.STATE_COLOUR_SPEC; curCol += 1; + elif curChar in string.printable: + curRowCols += 1; curCol += 1; + else: + curCol += 1; + elif curState == self._State.STATE_COLOUR_SPEC: + if curChar in set(",0123456789"): + curCol += 1; + else: + curState = self._State.STATE_CHAR; + maxCols = max(maxCols, curRowCols) + return maxCols + # }}} + # {{{ _parseAsChar(): Parse single character as regular character and mutate state + def _parseAsChar(self, char): + if char == "": + self.inCurCol += 1; self.inCurBold = 0 if self.inCurBold else 1; + elif char == "": + self._State = self._State.STATE_COLOUR_SPEC; self.inCurCol += 1; + elif char == "": + self.inCurCol += 1; self.inCurItalic = 0 if self.inCurItalic else 1; + elif char == "": + self.inCurCol += 1; + self.inCurBold = 0; self.inCurItalic = 0; self.inCurUnderline = 0; + self.inCurColourSpec = ""; + elif char == "": + self.inCurCol += 1 + self.outCurColourBg, self.outCurColourFg = self.outCurColourFg, self.outCurColourBg; + elif char == "": + self.inCurCol += 1; self.inCurUnderline = 0 if self.inCurUnderline else 1; + elif char == " ": + if self.inCurBold: + colourBg = self._ColourMapBold[self.outCurColourBg] + else: + colourBg = self._ColourMapNormal[self.outCurColourBg] + self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + self.outImgFontSize[0], self.outCurY + self.outImgFontSize[1])), fill=colourBg) + if self.inCurUnderline: + self.outImgDraw.line((self.outCurX, self.outCurY + (self.outImgFontSize[1] - 2), self.outCurX + self.outImgFontSize[0], self.outCurY + (self.outImgFontSize[1] - 2)), fill=colourFg) + self.outCurX += self.outImgFontSize[0]; self.inCurCol += 1; + else: + if self.inCurBold: + colourBg = self._ColourMapBold[self.outCurColourBg] + colourFg = self._ColourMapBold[self.outCurColourFg] + else: + colourBg = self._ColourMapNormal[self.outCurColourBg] + colourFg = self._ColourMapNormal[self.outCurColourFg] + self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + self.outImgFontSize[0], self.outCurY + self.outImgFontSize[1])), fill=colourBg) + # XXX implement italic + self.outImgDraw.text((self.outCurX, self.outCurY), char, colourFg, self.outImgFont) + if self.inCurUnderline: + self.outImgDraw.line((self.outCurX, self.outCurY + (self.outImgFontSize[1] - 2), self.outCurX + self.outImgFontSize[0], self.outCurY + (self.outImgFontSize[1] - 2)), fill=colourFg) + self.outCurX += self.outImgFontSize[0]; self.inCurCol += 1; + # }}} + # {{{ _parseAsColourSpec(): Parse single character as mIRC colour control code sequence and mutate state + def _parseAsColourSpec(self, char): + if char in set(",0123456789"): + self.inCurColourSpec += char; self.inCurCol += 1; + else: + self.inCurColourSpec = self.inCurColourSpec.split(",") + if len(self.inCurColourSpec) == 2: + self.outCurColourFg = int(self.inCurColourSpec[0]) + self.outCurColourBg = int(self.inCurColourSpec[1] or self.outCurColourBg) + elif len(self.inCurColourSpec) == 1: + self.outCurColourFg = int(self.inCurColourSpec[0]) + else: + self.outCurColourBg = 1; self.outCurColourFg = 15; + self.inCurColourSpec = ""; self._State = self._State.STATE_CHAR; + # }}} + + # + # Initialisation method + def __init__(self, inFilePath, imgFilePath, fontFilePath="DejaVuSansMono.ttf", fontSize=11): + self.inFilePath = inFilePath; self.inFile = open(inFilePath, "r"); + self.inLines = self.inFile.readlines() + self.inColsMax = self._getMaxCols(self.inLines) + self.inRows = len(self.inLines) + self.outFontFilePath = fontFilePath; self.outFontSize = int(fontSize); + self.outImgFont = ImageFont.truetype(self.outFontFilePath, self.outFontSize) + self.outImgFontSize = list(self.outImgFont.getsize(" ")); self.outImgFontSize[1] += 3; + self.outImg = Image.new("RGBA", (self.inColsMax * self.outImgFontSize[0], self.inRows * self.outImgFontSize[1]), self._ColourMapNormal[1]) + self.outImgDraw = ImageDraw.Draw(self.outImg) + self.outCurColourBg = 1; self.outCurColourFg = 15; + self.outCurX = 0; self.outCurY = 0; + for inCurRow in range(0, len(self.inLines)): + self.inCurBold = 0; self.inCurItalic = 0; self.inCurUnderline = 0; + self.inCurColourSpec = ""; self._State = self._State.STATE_CHAR; + self.inCurCol = 0; + while self.inCurCol < len(self.inLines[inCurRow]): + if self._State == self._State.STATE_CHAR: + self._parseAsChar(self.inLines[inCurRow][self.inCurCol]) + elif self._State == self._State.STATE_COLOUR_SPEC: + self._parseAsColourSpec(self.inLines[inCurRow][self.inCurCol]) + self.outCurX = 0; self.outCurY += self.outImgFontSize[1]; + self.inFile.close(); + self.outImg.save(imgFilePath); + +# +# Entry point +def main(*argv): + MiRC2png(*argv[1:]) +if __name__ == "__main__": + if ((len(sys.argv) - 1) < 2)\ + or ((len(sys.argv) - 1) > 4): + print("usage: {} " \ + " " \ + " " \ + "[] " \ + "[]".format(sys.argv[0]), file=sys.stderr) + else: + main(*sys.argv) + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCART.py b/MiRCART.py index c15ff81..3cf69b8 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# mirc2png -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) +# MiRCART.py -- XXX # Copyright (c) 2018 Lucio Andrés Illanes Albornoz # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -22,47 +22,18 @@ # SOFTWARE. # -from enum import Enum -from PIL import Image, ImageDraw, ImageFont -import string, sys +import wx +import sys -class MiRCART: - """Abstraction over ASCIIs containing mIRC control codes""" - inFilePath = inFile = None; - inLines = inColsMax = inRows = None; - - outFontFilePath = outFontSize = None; - outImg = outImgDraw = outImgFont = None; - outCurColourBg = outCurColourFg = None; - outCurX = outCurY = None; - - inCurBold = inCurItalic = inCurUnderline = None; - inCurColourSpec = None; - state = None; - inCurCol = None; - - # {{{ _ColourMapBold: mIRC colour number to RGBA map given ^B (bold) - _ColourMapBold = [ - (255, 255, 255, 255), # White - (85, 85, 85, 255), # Grey - (85, 85, 255, 255), # Light Blue - (85, 255, 85, 255), # Light Green - (255, 85, 85, 255), # Light Red - (255, 85, 85, 255), # Light Red - (255, 85, 255, 255), # Pink - (255, 255, 85, 255), # Light Yellow - (255, 255, 85, 255), # Light Yellow - (85, 255, 85, 255), # Light Green - (85, 255, 255, 255), # Light Cyan - (85, 255, 255, 255), # Light Cyan - (85, 85, 255, 255), # Light Blue - (255, 85, 255, 255), # Pink - (85, 85, 85, 255), # Grey - (255, 255, 255, 255), # White - ] - # }}} - # {{{ _ColourMapNormal: mIRC colour number to RGBA map given none of ^[BFV_] (bold, italic, reverse, underline) - _ColourMapNormal = [ +class MiRCARTCanvas(wx.Panel): + """XXX""" + canvasPos = canvasSize = None + canvasMap = None + cellPos = cellSize = None + brushBg = brushFg = penBg = penFg = None + mircBg = mircFg = None + # {{{ mircColours: mIRC colour number to RGBA map given none of ^[BFV_] (bold, italic, reverse, underline) + mircColours = [ (255, 255, 255, 255), # White (0, 0, 0, 255), # Black (0, 0, 187, 255), # Blue @@ -81,131 +52,133 @@ class MiRCART: (187, 187, 187, 255), # Light Grey ] # }}} - # {{{ _State: Parsing loop state - class _State(Enum): - STATE_CHAR = 1 - STATE_COLOUR_SPEC = 2 - # }}} - # {{{ _getMaxCols(): Calculate widest row in lines, ignoring non-printable & mIRC control code sequences - def _getMaxCols(self, lines): - maxCols = 0; - for curRow in range(0, len(lines)): - curRowCols = 0; curState = self._State.STATE_CHAR; - curCol = 0; curColLen = len(lines[curRow]); - while curCol < curColLen: - curChar = lines[curRow][curCol] - if curState == self._State.STATE_CHAR: - if curChar == "": - curState = self._State.STATE_COLOUR_SPEC; curCol += 1; - elif curChar in string.printable: - curRowCols += 1; curCol += 1; - else: - curCol += 1; - elif curState == self._State.STATE_COLOUR_SPEC: - if curChar in set(",0123456789"): - curCol += 1; - else: - curState = self._State.STATE_CHAR; - maxCols = max(maxCols, curRowCols) - return maxCols + # {{{ _onMouseEvent(): XXX + def _onMouseEvent(self, event): + eventObject = event.GetEventObject() + if event.Dragging(): + eventDc = wx.ClientDC(self) + eventPoint = event.GetLogicalPosition(eventDc) + rectX = eventPoint.x - (eventPoint.x % self.cellSize[0]) + rectY = eventPoint.y - (eventPoint.y % self.cellSize[1]) + mapX = int(rectX / 7 if rectX else 0) + mapY = int(rectY / 14 if rectY else 0) + eventDc.SetBackground(self.brushBg); + if event.LeftIsDown(): + eventDc.SetBrush(self.brushFg); + eventDc.SetPen(self.penFg) + self.canvasMap[mapX][mapY] = [self.mircFg, self.mircFg, " "] + elif event.RightIsDown(): + eventDc.SetBrush(self.brushBg); + eventDc.SetPen(self.penBg) + self.canvasMap[mapX][mapY] = [self.mircBg, self.mircBg, " "] + eventDc.DrawRectangle(rectX, rectY, \ + self.cellSize[0], self.cellSize[1]) # }}} - # {{{ _parseAsChar(): Parse single character as regular character and mutate state - def _parseAsChar(self, char): - if char == "": - self.inCurCol += 1; self.inCurBold = 0 if self.inCurBold else 1; - elif char == "": - self._State = self._State.STATE_COLOUR_SPEC; self.inCurCol += 1; - elif char == "": - self.inCurCol += 1; self.inCurItalic = 0 if self.inCurItalic else 1; - elif char == "": - self.inCurCol += 1; - self.inCurBold = 0; self.inCurItalic = 0; self.inCurUnderline = 0; - self.inCurColourSpec = ""; - elif char == "": - self.inCurCol += 1 - self.outCurColourBg, self.outCurColourFg = self.outCurColourFg, self.outCurColourBg; - elif char == "": - self.inCurCol += 1; self.inCurUnderline = 0 if self.inCurUnderline else 1; - elif char == " ": - if self.inCurBold: - colourBg = self._ColourMapBold[self.outCurColourBg] - else: - colourBg = self._ColourMapNormal[self.outCurColourBg] - self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + self.outImgFontSize[0], self.outCurY + self.outImgFontSize[1])), fill=colourBg) - if self.inCurUnderline: - self.outImgDraw.line((self.outCurX, self.outCurY + (self.outImgFontSize[1] - 2), self.outCurX + self.outImgFontSize[0], self.outCurY + (self.outImgFontSize[1] - 2)), fill=colourFg) - self.outCurX += self.outImgFontSize[0]; self.inCurCol += 1; - else: - if self.inCurBold: - colourBg = self._ColourMapBold[self.outCurColourBg] - colourFg = self._ColourMapBold[self.outCurColourFg] - else: - colourBg = self._ColourMapNormal[self.outCurColourBg] - colourFg = self._ColourMapNormal[self.outCurColourFg] - self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + self.outImgFontSize[0], self.outCurY + self.outImgFontSize[1])), fill=colourBg) - # XXX implement italic - self.outImgDraw.text((self.outCurX, self.outCurY), char, colourFg, self.outImgFont) - if self.inCurUnderline: - self.outImgDraw.line((self.outCurX, self.outCurY + (self.outImgFontSize[1] - 2), self.outCurX + self.outImgFontSize[0], self.outCurY + (self.outImgFontSize[1] - 2)), fill=colourFg) - self.outCurX += self.outImgFontSize[0]; self.inCurCol += 1; + # {{{ onCharHook(): XXX + def onCharHook(self, event): + keyCode = event.GetKeyCode() + if keyCode == wx.WXK_UP: + self.mircFg = self.mircFg + 1 if self.mircFg < 15 else 15 + elif keyCode == wx.WXK_DOWN: + self.mircFg = self.mircFg - 1 if self.mircFg > 0 else 0 + self.brushBg = wx.Brush(wx.Colour(self.mircColours[self.mircBg]), wx.BRUSHSTYLE_SOLID) + self.brushFg = wx.Brush(wx.Colour(self.mircColours[self.mircFg]), wx.BRUSHSTYLE_SOLID) + self.penBg = wx.Pen(wx.Colour(self.mircColours[self.mircBg]), 1) + self.penFg = wx.Pen(wx.Colour(self.mircColours[self.mircFg]), 1) # }}} - # {{{ _parseAsColourSpec(): Parse single character as mIRC colour control code sequence and mutate state - def _parseAsColourSpec(self, char): - if char in set(",0123456789"): - self.inCurColourSpec += char; self.inCurCol += 1; - else: - self.inCurColourSpec = self.inCurColourSpec.split(",") - if len(self.inCurColourSpec) == 2: - self.outCurColourFg = int(self.inCurColourSpec[0]) - self.outCurColourBg = int(self.inCurColourSpec[1] or self.outCurColourBg) - elif len(self.inCurColourSpec) == 1: - self.outCurColourFg = int(self.inCurColourSpec[0]) - else: - self.outCurColourBg = 1; self.outCurColourFg = 15; - self.inCurColourSpec = ""; self._State = self._State.STATE_CHAR; + # {{{ onLeftDown(): XXX + def onLeftDown(self, event): + self._onMouseEvent(event) + # }}} + # {{{ onMotion(): XXX + def onMotion(self, event): + self._onMouseEvent(event) + # }}} + # {{{ onPaint(): XXX + def onPaint(self, event): + eventDc = wx.BufferedPaintDC(self) + eventDc.SetBackground(wx.Brush(wx.BLACK)) + eventDc.Clear() + for cellX in range(0, self.canvasSize[0]): + for cellY in range(0, self.canvasSize[1]): + eventDc.SetBackground(wx.Brush(wx.Colour(self.mircColours[self.canvasMap[cellX][cellY][0]]), wx.BRUSHSTYLE_SOLID)) + eventDc.SetBrush(wx.Brush(wx.Colour(self.mircColours[self.canvasMap[cellX][cellY][1]]), wx.BRUSHSTYLE_SOLID)) + eventDc.SetPen(wx.Pen(wx.Colour(self.mircColours[self.canvasMap[cellX][cellY][1]]), 1)) + rectX = cellX * self.cellSize[0]; rectY = cellY * self.cellSize[1]; + eventDc.DrawRectangle(rectX, rectY, \ + self.cellSize[0], self.cellSize[1]) + # }}} + # {{{ onRightDown(): XXX + def onRightDown(self, event): + self._onMouseEvent(event) # }}} # # Initialisation method - def __init__(self, inFilePath, imgFilePath, fontFilePath="DejaVuSansMono.ttf", fontSize=11): - self.inFilePath = inFilePath; self.inFile = open(inFilePath, "r"); - self.inLines = self.inFile.readlines() - self.inColsMax = self._getMaxCols(self.inLines) - self.inRows = len(self.inLines) - self.outFontFilePath = fontFilePath; self.outFontSize = int(fontSize); - self.outImgFont = ImageFont.truetype(self.outFontFilePath, self.outFontSize) - self.outImgFontSize = list(self.outImgFont.getsize(" ")); self.outImgFontSize[1] += 3; - self.outImg = Image.new("RGBA", (self.inColsMax * self.outImgFontSize[0], self.inRows * self.outImgFontSize[1]), self._ColourMapNormal[1]) - self.outImgDraw = ImageDraw.Draw(self.outImg) - self.outCurColourBg = 1; self.outCurColourFg = 15; - self.outCurX = 0; self.outCurY = 0; - for inCurRow in range(0, len(self.inLines)): - self.inCurBold = 0; self.inCurItalic = 0; self.inCurUnderline = 0; - self.inCurColourSpec = ""; self._State = self._State.STATE_CHAR; - self.inCurCol = 0; - while self.inCurCol < len(self.inLines[inCurRow]): - if self._State == self._State.STATE_CHAR: - self._parseAsChar(self.inLines[inCurRow][self.inCurCol]) - elif self._State == self._State.STATE_COLOUR_SPEC: - self._parseAsColourSpec(self.inLines[inCurRow][self.inCurCol]) - self.outCurX = 0; self.outCurY += self.outImgFontSize[1]; - self.inFile.close(); - self.outImg.save(imgFilePath); + def __init__(self, parent, canvasPos, cellSize, canvasSize): + super().__init__(parent, pos=canvasPos, size=( \ + cellSize[0] * canvasSize[0], + cellSize[1] * canvasSize[1])) + + self.canvasPos = canvasPos; self.canvasSize = canvasSize; + self.canvasMap = [[[1, 1, " "] for y in range(canvasSize[1])] for x in range(canvasSize[0])] + self.cellPos = (0, 0); self.cellSize = cellSize; + self.brushBg = wx.Brush(wx.Colour(self.mircColours[1]), wx.BRUSHSTYLE_SOLID) + self.brushFg = wx.Brush(wx.Colour(self.mircColours[4]), wx.BRUSHSTYLE_SOLID) + self.penBg = wx.Pen(wx.Colour(self.mircColours[1]), 1) + self.penFg = wx.Pen(wx.Colour(self.mircColours[4]), 1) + self.mircBg = 1; self.mircFg = 4; + self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM) + + self.Bind(wx.EVT_CHAR_HOOK, self.onCharHook) + self.Bind(wx.EVT_LEFT_DOWN, self.onLeftDown) + self.Bind(wx.EVT_MOTION, self.onMotion) + self.Bind(wx.EVT_PAINT, self.onPaint) + self.Bind(wx.EVT_RIGHT_DOWN, self.onRightDown) + +class MiRCARTFrame(wx.Frame): + """XXX""" + menuFile = menuFileSaveAs = menuFileExit = menuBar = None + panelSkin = panelCanvas = None + + # {{{ onFileSaveAs(): XXX + def onFileSaveAs(self, event): + pass + # }}} + # {{{ onFileExit(): XXX + def onFileExit(self, event): + self.Close(True) + # }}} + + # + # Initialisation method + def __init__(self, parent, appSize=(1024, 768), canvasPos=(25, 25), cellSize=(7, 14), canvasSize=(80, 25)): + super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) + + self.menuFile = wx.Menu() + self.menuFileExit = self.menuFile.Append(wx.ID_EXIT, "E&xit", "Exit") + self.menuFileSaveAs = self.menuFile.Append(wx.ID_SAVE, "Save &As...", "Save As...") + self.menuBar = wx.MenuBar() + self.menuBar.Append(self.menuFile, "&File") + + self.panelSkin = wx.Panel(self, wx.ID_ANY) + self.panelCanvas = MiRCARTCanvas(self.panelSkin, \ + canvasPos=canvasPos, cellSize=cellSize, canvasSize=canvasSize) + + self.Bind(wx.EVT_MENU, self.onFileExit, self.menuFileExit) + self.Bind(wx.EVT_MENU, self.onFileSaveAs, self.menuFileSaveAs) + self.CreateStatusBar() + self.SetMenuBar(self.menuBar) + self.Show(True) # # Entry point def main(*argv): - _MiRCART = MiRCART(*argv[1:]) + wxApp = wx.App(False) + MiRCARTFrame(None) + wxApp.MainLoop() if __name__ == "__main__": - if ((len(sys.argv) - 1) < 2)\ - or ((len(sys.argv) - 1) > 4): - print("usage: {} " \ - " " \ - " " \ - "[] " \ - "[]".format(sys.argv[0]), file=sys.stderr) - else: - main(*sys.argv) + main(*sys.argv) -# vim:expandtab foldmethod=marker sw=8 ts=8 tw=120 +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/README.md b/README.md index 6239374..cfde2b4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ -# mirc2png -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) -* Prerequisites: python3 && python3-pil (&& python3-{json,requests,urllib3} for IrcMiRCARTBot.py) on Debian-family Linux distributions +# MiRCART -- XXX +* Prerequisites: python3 && python-wx{gtk2.8,tools} on Debian-family Linux distributions + +# IrcMiRCARTBot.py -- XXX +* Prerequisites: python3 && python3-{json,requests,urllib3} on Debian-family Linux distributions * IrcMiRCARTBot.py usage: IrcMiRCARTBot.py `` [``] [``] [``] [``] [``] -* MiRCART.py usage: MiRCART.py `` `` [``] [``] + +# MiRC2png.py -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) +* Prerequisites: python3 && python3-pil on Debian-family Linux distributions +* MiRC2png.py usage: MiRC2png.py `` `` [``] [``] From 427290e7831a95dd49911df016c99ec11ef0137b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 4 Jan 2018 17:26:12 +0100 Subject: [PATCH 042/148] MiRCART.py:mircColours, MiRCARTCanvas.{onPaint,__init__}(): moved from MiRCARTCanvas.mircColours. MiRCART.py:MiRCARTCanvas.get{Background,Foreground}Colour: added for MiRCARTFrame._updateStatusBar(). MiRCART.py:MiRCARTCanvas.onCharHook(): merged into MiRCARTCanvas.onPaletteEvent(). MiRCART.py:MiRCARTCanvas.onPaletteEvent(): set self.{mirc,brush,pen}{Fg,Bg} from colour choice event. MiRCART.py:MiRCARTPalette: implements 16 colour palette panels GUI. MiRCART.py:MiRCARTFrame._updateStatusBar(): show canvas {fore,back}ground colours in status bar. MiRCART.py:MiRCARTFrame.onPaletteEvent(): hand off to MiRCARTCanvas.onPaletteEvent() and call _updateStatusBar(). MiRCART.py:MiRCARTFrame.__init__(): fix `&File' menu item order. MiRCART.py:MiRCARTFrame.__init__(): create & update status bar. --- MiRCART.py | 158 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 110 insertions(+), 48 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index 3cf69b8..fdc6804 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -25,6 +25,27 @@ import wx import sys +# {{{ mircColours: mIRC colour number to RGBA map given none of ^[BFV_] (bold, italic, reverse, underline) +mircColours = [ + (255, 255, 255, 255), # White + (0, 0, 0, 255), # Black + (0, 0, 187, 255), # Blue + (0, 187, 0, 255), # Green + (255, 85, 85, 255), # Light Red + (187, 0, 0, 255), # Red + (187, 0, 187, 255), # Purple + (187, 187, 0, 255), # Yellow + (255, 255, 85, 255), # Light Yellow + (85, 255, 85, 255), # Light Green + (0, 187, 187, 255), # Cyan + (85, 255, 255, 255), # Light Cyan + (85, 85, 255, 255), # Light Blue + (255, 85, 255, 255), # Pink + (85, 85, 85, 255), # Grey + (187, 187, 187, 255), # Light Grey +] +# }}} + class MiRCARTCanvas(wx.Panel): """XXX""" canvasPos = canvasSize = None @@ -32,26 +53,6 @@ class MiRCARTCanvas(wx.Panel): cellPos = cellSize = None brushBg = brushFg = penBg = penFg = None mircBg = mircFg = None - # {{{ mircColours: mIRC colour number to RGBA map given none of ^[BFV_] (bold, italic, reverse, underline) - mircColours = [ - (255, 255, 255, 255), # White - (0, 0, 0, 255), # Black - (0, 0, 187, 255), # Blue - (0, 187, 0, 255), # Green - (255, 85, 85, 255), # Light Red - (187, 0, 0, 255), # Red - (187, 0, 187, 255), # Purple - (187, 187, 0, 255), # Yellow - (255, 255, 85, 255), # Light Yellow - (85, 255, 85, 255), # Light Green - (0, 187, 187, 255), # Cyan - (85, 255, 255, 255), # Light Cyan - (85, 85, 255, 255), # Light Blue - (255, 85, 255, 255), # Pink - (85, 85, 85, 255), # Grey - (187, 187, 187, 255), # Light Grey - ] - # }}} # {{{ _onMouseEvent(): XXX def _onMouseEvent(self, event): @@ -72,20 +73,21 @@ class MiRCARTCanvas(wx.Panel): eventDc.SetBrush(self.brushBg); eventDc.SetPen(self.penBg) self.canvasMap[mapX][mapY] = [self.mircBg, self.mircBg, " "] - eventDc.DrawRectangle(rectX, rectY, \ + eventDc.DrawRectangle(rectX, rectY, \ self.cellSize[0], self.cellSize[1]) # }}} + # {{{ getBackgroundColour(): XXX + def getBackgroundColour(self): + return self.mircBg + # }}} + # {{{ getForegroundColour(): XXX + def getForegroundColour(self): + return self.mircFg + # }}} # {{{ onCharHook(): XXX def onCharHook(self, event): keyCode = event.GetKeyCode() - if keyCode == wx.WXK_UP: - self.mircFg = self.mircFg + 1 if self.mircFg < 15 else 15 - elif keyCode == wx.WXK_DOWN: - self.mircFg = self.mircFg - 1 if self.mircFg > 0 else 0 - self.brushBg = wx.Brush(wx.Colour(self.mircColours[self.mircBg]), wx.BRUSHSTYLE_SOLID) - self.brushFg = wx.Brush(wx.Colour(self.mircColours[self.mircFg]), wx.BRUSHSTYLE_SOLID) - self.penBg = wx.Pen(wx.Colour(self.mircColours[self.mircBg]), 1) - self.penFg = wx.Pen(wx.Colour(self.mircColours[self.mircFg]), 1) + pass # }}} # {{{ onLeftDown(): XXX def onLeftDown(self, event): @@ -102,32 +104,41 @@ class MiRCARTCanvas(wx.Panel): eventDc.Clear() for cellX in range(0, self.canvasSize[0]): for cellY in range(0, self.canvasSize[1]): - eventDc.SetBackground(wx.Brush(wx.Colour(self.mircColours[self.canvasMap[cellX][cellY][0]]), wx.BRUSHSTYLE_SOLID)) - eventDc.SetBrush(wx.Brush(wx.Colour(self.mircColours[self.canvasMap[cellX][cellY][1]]), wx.BRUSHSTYLE_SOLID)) - eventDc.SetPen(wx.Pen(wx.Colour(self.mircColours[self.canvasMap[cellX][cellY][1]]), 1)) + eventDc.SetBackground(wx.Brush(wx.Colour(mircColours[self.canvasMap[cellX][cellY][0]]), wx.BRUSHSTYLE_SOLID)) + eventDc.SetBrush(wx.Brush(wx.Colour(mircColours[self.canvasMap[cellX][cellY][1]]), wx.BRUSHSTYLE_SOLID)) + eventDc.SetPen(wx.Pen(wx.Colour(mircColours[self.canvasMap[cellX][cellY][1]]), 1)) rectX = cellX * self.cellSize[0]; rectY = cellY * self.cellSize[1]; - eventDc.DrawRectangle(rectX, rectY, \ + eventDc.DrawRectangle(rectX, rectY, \ self.cellSize[0], self.cellSize[1]) # }}} + # {{{ onPaletteEvent(): XXX + def onPaletteEvent(self, leftDown, rightDown, numColour): + if leftDown: + self.mircFg = numColour + self.brushFg = wx.Brush(wx.Colour(mircColours[self.mircFg]), wx.BRUSHSTYLE_SOLID) + self.penFg = wx.Pen(wx.Colour(mircColours[self.mircFg]), 1) + elif rightDown: + self.mircBg = numColour + self.brushBg = wx.Brush(wx.Colour(mircColours[self.mircBg]), wx.BRUSHSTYLE_SOLID) + self.penBg = wx.Pen(wx.Colour(mircColours[self.mircBg]), 1) + # }}} # {{{ onRightDown(): XXX def onRightDown(self, event): self._onMouseEvent(event) # }}} - - # - # Initialisation method + # {{{ Initialisation method def __init__(self, parent, canvasPos, cellSize, canvasSize): - super().__init__(parent, pos=canvasPos, size=( \ + super().__init__(parent, pos=canvasPos, size=( \ cellSize[0] * canvasSize[0], cellSize[1] * canvasSize[1])) self.canvasPos = canvasPos; self.canvasSize = canvasSize; self.canvasMap = [[[1, 1, " "] for y in range(canvasSize[1])] for x in range(canvasSize[0])] self.cellPos = (0, 0); self.cellSize = cellSize; - self.brushBg = wx.Brush(wx.Colour(self.mircColours[1]), wx.BRUSHSTYLE_SOLID) - self.brushFg = wx.Brush(wx.Colour(self.mircColours[4]), wx.BRUSHSTYLE_SOLID) - self.penBg = wx.Pen(wx.Colour(self.mircColours[1]), 1) - self.penFg = wx.Pen(wx.Colour(self.mircColours[4]), 1) + self.brushBg = wx.Brush(wx.Colour(mircColours[1]), wx.BRUSHSTYLE_SOLID) + self.brushFg = wx.Brush(wx.Colour(mircColours[4]), wx.BRUSHSTYLE_SOLID) + self.penBg = wx.Pen(wx.Colour(mircColours[1]), 1) + self.penFg = wx.Pen(wx.Colour(mircColours[4]), 1) self.mircBg = 1; self.mircFg = 4; self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM) @@ -136,12 +147,55 @@ class MiRCARTCanvas(wx.Panel): self.Bind(wx.EVT_MOTION, self.onMotion) self.Bind(wx.EVT_PAINT, self.onPaint) self.Bind(wx.EVT_RIGHT_DOWN, self.onRightDown) + # }}} + +class MiRCARTPalette(wx.Panel): + """XXX""" + panelsByColour = onPaletteEvent = None + + # {{{ onLeftDown(): XXX + def onLeftDown(self, event): + numColour = int(event.GetEventObject().GetName()) + self.onPaletteEvent(True, False, numColour) + # }}} + # {{{ onRightDown(): XXX + def onRightDown(self, event): + numColour = int(event.GetEventObject().GetName()) + self.onPaletteEvent(False, True, numColour) + # }}} + # {{{ Initialisation method + def __init__(self, parent, parentPos, cellSize, onPaletteEvent): + panelSizeW = 6 * cellSize[0]; panelSizeH = 2 * cellSize[1]; + paletteSize = (panelSizeW * 16, panelSizeH) + super().__init__(parent, pos=parentPos, size=paletteSize) + self.panelsByColour = [None] * len(mircColours) + for numColour in range(0, len(mircColours)): + posX = (numColour * (cellSize[0] * 6)) + self.panelsByColour[numColour] = wx.Panel(self, \ + pos=(posX, 0), size=(panelSizeW, panelSizeH)) + self.panelsByColour[numColour].SetBackgroundColour( \ + wx.Colour(mircColours[numColour])) + self.panelsByColour[numColour].Bind(wx.EVT_LEFT_DOWN, self.onLeftDown) + self.panelsByColour[numColour].Bind(wx.EVT_RIGHT_DOWN, self.onRightDown) + self.panelsByColour[numColour].SetName(str(numColour)) + self.onPaletteEvent = onPaletteEvent + # }}} class MiRCARTFrame(wx.Frame): """XXX""" menuFile = menuFileSaveAs = menuFileExit = menuBar = None - panelSkin = panelCanvas = None + panelSkin = panelCanvas = panelPalette = None + statusBar = None + # {{{ _updateStatusBar(): XXX + def _updateStatusBar(self): + text = "Foreground colour:" + text += " " + str(self.panelCanvas.getForegroundColour()) + text += " | " + text += "Background colour:" + text += " " + str(self.panelCanvas.getBackgroundColour()) + self.statusBar.SetStatusText(text) + # }}} # {{{ onFileSaveAs(): XXX def onFileSaveAs(self, event): pass @@ -150,27 +204,35 @@ class MiRCARTFrame(wx.Frame): def onFileExit(self, event): self.Close(True) # }}} - - # - # Initialisation method + # {{{ onPaletteEvent(): XXX + def onPaletteEvent(self, leftDown, rightDown, numColour): + self.panelCanvas.onPaletteEvent(leftDown, rightDown, numColour) + self._updateStatusBar() + # }}} + # {{{ Initialisation method def __init__(self, parent, appSize=(1024, 768), canvasPos=(25, 25), cellSize=(7, 14), canvasSize=(80, 25)): super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) self.menuFile = wx.Menu() - self.menuFileExit = self.menuFile.Append(wx.ID_EXIT, "E&xit", "Exit") self.menuFileSaveAs = self.menuFile.Append(wx.ID_SAVE, "Save &As...", "Save As...") + self.menuFileExit = self.menuFile.Append(wx.ID_EXIT, "E&xit", "Exit") self.menuBar = wx.MenuBar() self.menuBar.Append(self.menuFile, "&File") self.panelSkin = wx.Panel(self, wx.ID_ANY) - self.panelCanvas = MiRCARTCanvas(self.panelSkin, \ + self.panelCanvas = MiRCARTCanvas(self.panelSkin, \ canvasPos=canvasPos, cellSize=cellSize, canvasSize=canvasSize) + self.panelPalette = MiRCARTPalette(self.panelSkin, \ + (25, (canvasSize[1] + 3) * cellSize[1]), cellSize, self.onPaletteEvent) + + self.statusBar = self.CreateStatusBar() + self._updateStatusBar() self.Bind(wx.EVT_MENU, self.onFileExit, self.menuFileExit) self.Bind(wx.EVT_MENU, self.onFileSaveAs, self.menuFileSaveAs) - self.CreateStatusBar() self.SetMenuBar(self.menuBar) self.Show(True) + # }}} # # Entry point From 42e18ec252ce0c4ef105025d0ace09a5630fd9ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 4 Jan 2018 18:11:57 +0100 Subject: [PATCH 043/148] MiRCART.py:MiRCARTCanvas.{_onMouseEvent,onPaint,__init__}(): switch addressing mode of self.canvasMap to [Y][X]. MiRCART.py:MiRCARTCanvas.get{Height,Map,Width}(): added for MiRCARTFrame.onFileSaveAs(). MiRCART.py:MiRCARTFrame.onFileSaveAs(): initial implementation. --- MiRCART.py | 51 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index fdc6804..3f02006 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -23,7 +23,7 @@ # import wx -import sys +import os, sys # {{{ mircColours: mIRC colour number to RGBA map given none of ^[BFV_] (bold, italic, reverse, underline) mircColours = [ @@ -68,11 +68,11 @@ class MiRCARTCanvas(wx.Panel): if event.LeftIsDown(): eventDc.SetBrush(self.brushFg); eventDc.SetPen(self.penFg) - self.canvasMap[mapX][mapY] = [self.mircFg, self.mircFg, " "] + self.canvasMap[mapY][mapX] = [self.mircFg, self.mircFg, " "] elif event.RightIsDown(): eventDc.SetBrush(self.brushBg); eventDc.SetPen(self.penBg) - self.canvasMap[mapX][mapY] = [self.mircBg, self.mircBg, " "] + self.canvasMap[mapY][mapX] = [self.mircBg, self.mircBg, " "] eventDc.DrawRectangle(rectX, rectY, \ self.cellSize[0], self.cellSize[1]) # }}} @@ -84,6 +84,18 @@ class MiRCARTCanvas(wx.Panel): def getForegroundColour(self): return self.mircFg # }}} + # {{{ getHeight(): XXX + def getHeight(self): + return self.canvasSize[1] + # }}} + # {{{ getMap(): XXX + def getMap(self): + return self.canvasMap + # }}} + # {{{ getWidth(): XXX + def getWidth(self): + return self.canvasSize[0] + # }}} # {{{ onCharHook(): XXX def onCharHook(self, event): keyCode = event.GetKeyCode() @@ -104,9 +116,9 @@ class MiRCARTCanvas(wx.Panel): eventDc.Clear() for cellX in range(0, self.canvasSize[0]): for cellY in range(0, self.canvasSize[1]): - eventDc.SetBackground(wx.Brush(wx.Colour(mircColours[self.canvasMap[cellX][cellY][0]]), wx.BRUSHSTYLE_SOLID)) - eventDc.SetBrush(wx.Brush(wx.Colour(mircColours[self.canvasMap[cellX][cellY][1]]), wx.BRUSHSTYLE_SOLID)) - eventDc.SetPen(wx.Pen(wx.Colour(mircColours[self.canvasMap[cellX][cellY][1]]), 1)) + eventDc.SetBackground(wx.Brush(wx.Colour(mircColours[self.canvasMap[cellY][cellX][0]]), wx.BRUSHSTYLE_SOLID)) + eventDc.SetBrush(wx.Brush(wx.Colour(mircColours[self.canvasMap[cellY][cellX][1]]), wx.BRUSHSTYLE_SOLID)) + eventDc.SetPen(wx.Pen(wx.Colour(mircColours[self.canvasMap[cellY][cellX][1]]), 1)) rectX = cellX * self.cellSize[0]; rectY = cellY * self.cellSize[1]; eventDc.DrawRectangle(rectX, rectY, \ self.cellSize[0], self.cellSize[1]) @@ -133,7 +145,7 @@ class MiRCARTCanvas(wx.Panel): cellSize[1] * canvasSize[1])) self.canvasPos = canvasPos; self.canvasSize = canvasSize; - self.canvasMap = [[[1, 1, " "] for y in range(canvasSize[1])] for x in range(canvasSize[0])] + self.canvasMap = [[[1, 1, " "] for x in range(canvasSize[0])] for y in range(canvasSize[1])] self.cellPos = (0, 0); self.cellSize = cellSize; self.brushBg = wx.Brush(wx.Colour(mircColours[1]), wx.BRUSHSTYLE_SOLID) self.brushFg = wx.Brush(wx.Colour(mircColours[4]), wx.BRUSHSTYLE_SOLID) @@ -198,7 +210,30 @@ class MiRCARTFrame(wx.Frame): # }}} # {{{ onFileSaveAs(): XXX def onFileSaveAs(self, event): - pass + with wx.FileDialog(self, "Save As...", os.getcwd(), "", \ + "*.txt", wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) as dialog: + if dialog.ShowModal() == wx.ID_CANCEL: + return + else: + try: + with open(dialog.GetPath(), "w") as file: + canvasMap = self.panelCanvas.getMap() + canvasHeight = self.panelCanvas.getHeight() + canvasWidth = self.panelCanvas.getWidth() + for canvasRow in range(0, canvasHeight): + colourLastBg = colourLastFg = None; + for canvasCol in range(0, canvasWidth): + canvasColBg = canvasMap[canvasRow][canvasCol][0] + canvasColFg = canvasMap[canvasRow][canvasCol][1] + canvasColText = canvasMap[canvasRow][canvasCol][2] + if colourLastBg != canvasColBg \ + or colourLastFg != canvasColFg: + colourLastBg = canvasColBg; colourLastFg = canvasColFg; + file.write("" + str(canvasColFg) + "," + str(canvasColBg)) + file.write(canvasColText) + file.write("\n") + except IOError as error: + wx.LogError("IOError {}".format(error)) # }}} # {{{ onFileExit(): XXX def onFileExit(self, event): From dcb4ca83bb99cbc8fd07c25ea99374cb25f1b17f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 4 Jan 2018 20:13:38 +0100 Subject: [PATCH 044/148] MiRCART.py:MiRCARTCanvas.{onCharHook,__init__}(): removes wx.EVT_CHAR_HOOK event handler. --- MiRCART.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index 3f02006..29cb75a 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -96,11 +96,6 @@ class MiRCARTCanvas(wx.Panel): def getWidth(self): return self.canvasSize[0] # }}} - # {{{ onCharHook(): XXX - def onCharHook(self, event): - keyCode = event.GetKeyCode() - pass - # }}} # {{{ onLeftDown(): XXX def onLeftDown(self, event): self._onMouseEvent(event) @@ -154,7 +149,6 @@ class MiRCARTCanvas(wx.Panel): self.mircBg = 1; self.mircFg = 4; self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM) - self.Bind(wx.EVT_CHAR_HOOK, self.onCharHook) self.Bind(wx.EVT_LEFT_DOWN, self.onLeftDown) self.Bind(wx.EVT_MOTION, self.onMotion) self.Bind(wx.EVT_PAINT, self.onPaint) From 91e33f8a4a87ed56dea292385048cd70db7eb338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 4 Jan 2018 20:22:15 +0100 Subject: [PATCH 045/148] MiRCART.py:MiRCARTCanvas.canvasBitmap: added to optimise onPaint(). MiRCART.py:MiRCARTCanvas._onMouseEvent(): additionally draw to canvasBitmap via temporary wx.MemoryDC(). MiRCART.py:MiRCARTCanvas.onPaint(): reimplement using (double-buffered) wx.BufferedPaintDC() from canvasBitmap. MiRCART.py:MiRCARTCanvas.__init__(): initialise canvasBitmap from canvas window size. --- MiRCART.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index 29cb75a..90cc980 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -49,7 +49,7 @@ mircColours = [ class MiRCARTCanvas(wx.Panel): """XXX""" canvasPos = canvasSize = None - canvasMap = None + canvasBitmap = canvasMap = None cellPos = cellSize = None brushBg = brushFg = penBg = penFg = None mircBg = mircFg = None @@ -59,22 +59,31 @@ class MiRCARTCanvas(wx.Panel): eventObject = event.GetEventObject() if event.Dragging(): eventDc = wx.ClientDC(self) + tmpDc = wx.MemoryDC() + tmpDc.SelectObject(self.canvasBitmap) eventPoint = event.GetLogicalPosition(eventDc) rectX = eventPoint.x - (eventPoint.x % self.cellSize[0]) rectY = eventPoint.y - (eventPoint.y % self.cellSize[1]) mapX = int(rectX / 7 if rectX else 0) mapY = int(rectY / 14 if rectY else 0) eventDc.SetBackground(self.brushBg); + tmpDc.SetBackground(self.brushBg); if event.LeftIsDown(): eventDc.SetBrush(self.brushFg); eventDc.SetPen(self.penFg) + tmpDc.SetBrush(self.brushFg); + tmpDc.SetPen(self.penFg) self.canvasMap[mapY][mapX] = [self.mircFg, self.mircFg, " "] elif event.RightIsDown(): eventDc.SetBrush(self.brushBg); eventDc.SetPen(self.penBg) + tmpDc.SetBrush(self.brushBg); + tmpDc.SetPen(self.penBg) self.canvasMap[mapY][mapX] = [self.mircBg, self.mircBg, " "] eventDc.DrawRectangle(rectX, rectY, \ self.cellSize[0], self.cellSize[1]) + tmpDc.DrawRectangle(rectX, rectY, \ + self.cellSize[0], self.cellSize[1]) # }}} # {{{ getBackgroundColour(): XXX def getBackgroundColour(self): @@ -106,17 +115,7 @@ class MiRCARTCanvas(wx.Panel): # }}} # {{{ onPaint(): XXX def onPaint(self, event): - eventDc = wx.BufferedPaintDC(self) - eventDc.SetBackground(wx.Brush(wx.BLACK)) - eventDc.Clear() - for cellX in range(0, self.canvasSize[0]): - for cellY in range(0, self.canvasSize[1]): - eventDc.SetBackground(wx.Brush(wx.Colour(mircColours[self.canvasMap[cellY][cellX][0]]), wx.BRUSHSTYLE_SOLID)) - eventDc.SetBrush(wx.Brush(wx.Colour(mircColours[self.canvasMap[cellY][cellX][1]]), wx.BRUSHSTYLE_SOLID)) - eventDc.SetPen(wx.Pen(wx.Colour(mircColours[self.canvasMap[cellY][cellX][1]]), 1)) - rectX = cellX * self.cellSize[0]; rectY = cellY * self.cellSize[1]; - eventDc.DrawRectangle(rectX, rectY, \ - self.cellSize[0], self.cellSize[1]) + eventDc = wx.BufferedPaintDC(self, self.canvasBitmap) # }}} # {{{ onPaletteEvent(): XXX def onPaletteEvent(self, leftDown, rightDown, numColour): @@ -135,11 +134,12 @@ class MiRCARTCanvas(wx.Panel): # }}} # {{{ Initialisation method def __init__(self, parent, canvasPos, cellSize, canvasSize): - super().__init__(parent, pos=canvasPos, size=( \ - cellSize[0] * canvasSize[0], - cellSize[1] * canvasSize[1])) + winSizeW = cellSize[0] * canvasSize[0] + winSizeH = cellSize[1] * canvasSize[1] + super().__init__(parent, pos=canvasPos, size=(winSizeW, winSizeH)) self.canvasPos = canvasPos; self.canvasSize = canvasSize; + self.canvasBitmap = wx.Bitmap(winSizeW, winSizeH) self.canvasMap = [[[1, 1, " "] for x in range(canvasSize[0])] for y in range(canvasSize[1])] self.cellPos = (0, 0); self.cellSize = cellSize; self.brushBg = wx.Brush(wx.Colour(mircColours[1]), wx.BRUSHSTYLE_SOLID) From 325a454db71e10a42408982dbfdc56e19020ee26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 4 Jan 2018 23:22:09 +0100 Subject: [PATCH 046/148] MiRCART.py:MiRCARTCanvas._eventPointToMap[XY](): added for _onMouseEvent(). MiRCART.py:MiRCARTCanvas._onMouseEvent(): split into _processMapPatches() and _drawPatch(). MiRCART.py:MiRCARTCanvas.getCell{Height,Width}(): added for _drawPatch() and _eventPointToMap[XY](). MiRCART.py:MiRCARTCanvas.onPaletteEvent(): only set self.mirc[FB]g. MiRCART.py:MiRCARTCanvas.__init__(): cache canvas window size. MiRCART.py:MiRCARTCanvas.__init__(): initialise & append canvasTools. MiRCART.py:MiRCARTCanvas.__init__(): pre-create 16 mIRC colour brushes & pens. MiRCART.py:MiRCARTCanvas.__init__(): initialise temporary & {un,re}do patches. MiRCART.py:MiRCARTTool: added abstract base class for all canvas tools. MiRCART.py:MiRCARTToolRect: initial implementation w/ cursor, limited to 1x1 rectangles. MiRCART.py:MiRCARTFrame.__init__(): initialise MiRCARTCanvas() w/ canvasTools=[MiRCARTToolRect]. --- MiRCART.py | 206 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 150 insertions(+), 56 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index 90cc980..e0d7c91 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -48,47 +48,79 @@ mircColours = [ class MiRCARTCanvas(wx.Panel): """XXX""" - canvasPos = canvasSize = None - canvasBitmap = canvasMap = None - cellPos = cellSize = None - brushBg = brushFg = penBg = penFg = None - mircBg = mircFg = None + canvasPos = canvasSize = canvasWinSize = cellPos = cellSize = None + canvasBitmap = canvasMap = canvasTools = None + mircBg = mircFg = mircBrushes = mircPens = None + patchesTmp = patchesUndo = None + # {{{ _drawPatch(): XXX + def _drawPatch(self, patch, eventDc, tmpDc, atX, atY): + patchXabs = (atX + patch[0]) * self.getCellWidth() + patchYabs = (atY + patch[1]) * self.getCellHeight() + brushFg = self.mircBrushes[patch[2]] + brushBg = self.mircBrushes[patch[3]] + pen = self.mircPens[patch[2]] + for dc in (eventDc, tmpDc): + dc.SetBrush(brushFg); dc.SetBackground(brushBg); dc.SetPen(pen); + dc.DrawRectangle(patchXabs, patchYabs, \ + self.getCellWidth(), self.getCellHeight()) + # }}} + # {{{ _eventPointToMapX(): XXX + def _eventPointToMapX(self, eventPoint): + rectX = eventPoint.x - (eventPoint.x % self.getCellWidth()) + return int(rectX / self.getCellWidth() if rectX else 0) + # }}} + # {{{ _eventPointToMapY(): XXX + def _eventPointToMapY(self, eventPoint): + rectY = eventPoint.y - (eventPoint.y % self.getCellHeight()) + return int(rectY / self.getCellHeight() if rectY else 0) + # }}} # {{{ _onMouseEvent(): XXX def _onMouseEvent(self, event): eventObject = event.GetEventObject() - if event.Dragging(): - eventDc = wx.ClientDC(self) - tmpDc = wx.MemoryDC() - tmpDc.SelectObject(self.canvasBitmap) - eventPoint = event.GetLogicalPosition(eventDc) - rectX = eventPoint.x - (eventPoint.x % self.cellSize[0]) - rectY = eventPoint.y - (eventPoint.y % self.cellSize[1]) - mapX = int(rectX / 7 if rectX else 0) - mapY = int(rectY / 14 if rectY else 0) - eventDc.SetBackground(self.brushBg); - tmpDc.SetBackground(self.brushBg); - if event.LeftIsDown(): - eventDc.SetBrush(self.brushFg); - eventDc.SetPen(self.penFg) - tmpDc.SetBrush(self.brushFg); - tmpDc.SetPen(self.penFg) - self.canvasMap[mapY][mapX] = [self.mircFg, self.mircFg, " "] - elif event.RightIsDown(): - eventDc.SetBrush(self.brushBg); - eventDc.SetPen(self.penBg) - tmpDc.SetBrush(self.brushBg); - tmpDc.SetPen(self.penBg) - self.canvasMap[mapY][mapX] = [self.mircBg, self.mircBg, " "] - eventDc.DrawRectangle(rectX, rectY, \ - self.cellSize[0], self.cellSize[1]) - tmpDc.DrawRectangle(rectX, rectY, \ - self.cellSize[0], self.cellSize[1]) + eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); + tmpDc.SelectObject(self.canvasBitmap) + eventPoint = event.GetLogicalPosition(eventDc) + mapX = self._eventPointToMapX(eventPoint) + mapY = self._eventPointToMapY(eventPoint) + for tool in self.canvasTools: + if event.Dragging(): + mapPatches = tool.onMouseMotion(event, mapX, mapY, event.LeftIsDown(), event.RightIsDown()) + else: + mapPatches = tool.onMouseDown(event, mapX, mapY, event.LeftIsDown(), event.RightIsDown()) + self._processMapPatches(mapPatches, eventDc, tmpDc, mapX, mapY) + # }}} + # {{{ _processMapPatches(): XXX + def _processMapPatches(self, mapPatches, eventDc, tmpDc, atX, atY): + for mapPatch in mapPatches: + mapPatchTmp = mapPatch[0]; mapPatchW = mapPatch[1]; mapPatchH = mapPatch[2]; + if mapPatchTmp and self.patchesTmp: + for patch in self.patchesTmp: + self._drawPatch(patch, eventDc, tmpDc, 0, 0) + self.patchesTmp = [] + for patch in mapPatch[3]: + if mapPatchTmp: + mapItem = self.canvasMap[atY + patch[1]][atX + patch[0]] + self.patchesTmp.append((atX + patch[0], \ + atY + patch[1], mapItem[0], mapItem[1], mapItem[2])) + self._drawPatch(patch, eventDc, tmpDc, atX, atY) + else: + self._drawPatch(patch, eventDc, tmpDc, atX, atY) + self.canvasMap[atY + patch[1]][atX + patch[0]] =\ + [patch[2], patch[3], " "]; # }}} # {{{ getBackgroundColour(): XXX def getBackgroundColour(self): return self.mircBg # }}} + # {{{ getCellHeight(): XXX + def getCellHeight(self): + return self.cellSize[1] + # }}} + # {{{ getCellWidth(): XXX + def getCellWidth(self): + return self.cellSize[0] + # }}} # {{{ getForegroundColour(): XXX def getForegroundColour(self): return self.mircFg @@ -121,33 +153,36 @@ class MiRCARTCanvas(wx.Panel): def onPaletteEvent(self, leftDown, rightDown, numColour): if leftDown: self.mircFg = numColour - self.brushFg = wx.Brush(wx.Colour(mircColours[self.mircFg]), wx.BRUSHSTYLE_SOLID) - self.penFg = wx.Pen(wx.Colour(mircColours[self.mircFg]), 1) elif rightDown: self.mircBg = numColour - self.brushBg = wx.Brush(wx.Colour(mircColours[self.mircBg]), wx.BRUSHSTYLE_SOLID) - self.penBg = wx.Pen(wx.Colour(mircColours[self.mircBg]), 1) # }}} # {{{ onRightDown(): XXX def onRightDown(self, event): self._onMouseEvent(event) # }}} # {{{ Initialisation method - def __init__(self, parent, canvasPos, cellSize, canvasSize): - winSizeW = cellSize[0] * canvasSize[0] - winSizeH = cellSize[1] * canvasSize[1] - super().__init__(parent, pos=canvasPos, size=(winSizeW, winSizeH)) - - self.canvasPos = canvasPos; self.canvasSize = canvasSize; - self.canvasBitmap = wx.Bitmap(winSizeW, winSizeH) - self.canvasMap = [[[1, 1, " "] for x in range(canvasSize[0])] for y in range(canvasSize[1])] + def __init__(self, parent, canvasPos, cellSize, canvasSize, canvasTools): + canvasWinSize = (cellSize[0] * canvasSize[0], cellSize[1] * canvasSize[1]) + super().__init__(parent, pos=canvasPos, size=canvasWinSize) + self.canvasPos = canvasPos; self.canvasSize = canvasSize; self.canvasWinSize = canvasWinSize; self.cellPos = (0, 0); self.cellSize = cellSize; - self.brushBg = wx.Brush(wx.Colour(mircColours[1]), wx.BRUSHSTYLE_SOLID) - self.brushFg = wx.Brush(wx.Colour(mircColours[4]), wx.BRUSHSTYLE_SOLID) - self.penBg = wx.Pen(wx.Colour(mircColours[1]), 1) - self.penFg = wx.Pen(wx.Colour(mircColours[4]), 1) + + self.canvasBitmap = wx.Bitmap(canvasWinSize) + self.canvasMap = [[[1, 1, " "] for x in range(canvasSize[0])] for y in range(canvasSize[1])] + self.canvasTools = [] + for canvasTool in canvasTools: + self.canvasTools.append(canvasTool(self)) + self.mircBg = 1; self.mircFg = 4; - self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM) + self.mircBrushes = [None for x in range(len(mircColours))] + self.mircPens = [None for x in range(len(mircColours))] + for mircColour in range(0, len(mircColours)): + self.mircBrushes[mircColour] = wx.Brush( \ + wx.Colour(mircColours[mircColour]), wx.BRUSHSTYLE_SOLID) + self.mircPens[mircColour] = wx.Pen( \ + wx.Colour(mircColours[mircColour]), 1) + + self.patchesTmp = []; self.patchesUndo = []; self.Bind(wx.EVT_LEFT_DOWN, self.onLeftDown) self.Bind(wx.EVT_MOTION, self.onMotion) @@ -155,6 +190,64 @@ class MiRCARTCanvas(wx.Panel): self.Bind(wx.EVT_RIGHT_DOWN, self.onRightDown) # }}} +class MiRCARTTool(): + """XXX""" + parentCanvas = None + + # {{{ onMouseDown(): XXX + def onMouseDown(self, event, mapX, mapY, isLeftDown, isRightDown): + pass + # }}} + # {{{ onMouseMotion(): XXX + def onMouseMotion(self, event, mapX, mapY, isLeftDown, isRightDown): + pass + # }}} + # {{{ Initialisation method + def __init__(self, parentCanvas): + self.parentCanvas = parentCanvas + # }}} + +class MiRCARTToolRect(MiRCARTTool): + """XXX""" + + # {{{ _draw(): XXX + def _draw(self, event, mapX, mapY, isLeftDown, isRightDown): + if isLeftDown: + return [[False, 1, 1, [[0, 0, \ + self.parentCanvas.getForegroundColour(), \ + self.parentCanvas.getForegroundColour(), " "]]], + [True, 1, 1, [[0, 0, \ + self.parentCanvas.getForegroundColour(), \ + self.parentCanvas.getForegroundColour(), " "]]]] + elif isRightDown: + return [[False, 1, 1, [[0, 0, \ + self.parentCanvas.getBackgroundColour(), \ + self.parentCanvas.getBackgroundColour(), " "]]], \ + [True, 1, 1, [[0, 0, \ + self.parentCanvas.getForegroundColour(), \ + self.parentCanvas.getForegroundColour(), " "]]]] + else: + return [[True, 1, 1, [[0, 0, \ + self.parentCanvas.getForegroundColour(), \ + self.parentCanvas.getForegroundColour(), " "]]]] + # }}} + # {{{ onMouseDown(): XXX + def onMouseDown(self, event, mapX, mapY, isLeftDown, isRightDown): + print("mouse down") + return self._draw(event, mapX, mapY, isLeftDown, isRightDown) + # }}} + # {{{ onMouseMotion(): XXX + def onMouseMotion(self, event, mapX, mapY, isLeftDown, isRightDown): + print("mouse moving") + if isLeftDown or isRightDown: + print("mouse depressed") + return self._draw(event, mapX, mapY, isLeftDown, isRightDown) + # }}} + # {{{ Initialisation method + def __init__(self, parentCanvas): + super().__init__(parentCanvas) + # }}} + class MiRCARTPalette(wx.Panel): """XXX""" panelsByColour = onPaletteEvent = None @@ -177,9 +270,9 @@ class MiRCARTPalette(wx.Panel): self.panelsByColour = [None] * len(mircColours) for numColour in range(0, len(mircColours)): posX = (numColour * (cellSize[0] * 6)) - self.panelsByColour[numColour] = wx.Panel(self, \ + self.panelsByColour[numColour] = wx.Panel(self, \ pos=(posX, 0), size=(panelSizeW, panelSizeH)) - self.panelsByColour[numColour].SetBackgroundColour( \ + self.panelsByColour[numColour].SetBackgroundColour( \ wx.Colour(mircColours[numColour])) self.panelsByColour[numColour].Bind(wx.EVT_LEFT_DOWN, self.onLeftDown) self.panelsByColour[numColour].Bind(wx.EVT_RIGHT_DOWN, self.onRightDown) @@ -204,7 +297,7 @@ class MiRCARTFrame(wx.Frame): # }}} # {{{ onFileSaveAs(): XXX def onFileSaveAs(self, event): - with wx.FileDialog(self, "Save As...", os.getcwd(), "", \ + with wx.FileDialog(self, "Save As...", os.getcwd(), "", \ "*.txt", wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) as dialog: if dialog.ShowModal() == wx.ID_CANCEL: return @@ -220,7 +313,7 @@ class MiRCARTFrame(wx.Frame): canvasColBg = canvasMap[canvasRow][canvasCol][0] canvasColFg = canvasMap[canvasRow][canvasCol][1] canvasColText = canvasMap[canvasRow][canvasCol][2] - if colourLastBg != canvasColBg \ + if colourLastBg != canvasColBg \ or colourLastFg != canvasColFg: colourLastBg = canvasColBg; colourLastFg = canvasColFg; file.write("" + str(canvasColFg) + "," + str(canvasColBg)) @@ -249,9 +342,10 @@ class MiRCARTFrame(wx.Frame): self.menuBar.Append(self.menuFile, "&File") self.panelSkin = wx.Panel(self, wx.ID_ANY) - self.panelCanvas = MiRCARTCanvas(self.panelSkin, \ - canvasPos=canvasPos, cellSize=cellSize, canvasSize=canvasSize) - self.panelPalette = MiRCARTPalette(self.panelSkin, \ + self.panelCanvas = MiRCARTCanvas(self.panelSkin, \ + canvasPos=canvasPos, cellSize=cellSize, \ + canvasSize=canvasSize, canvasTools=[MiRCARTToolRect]) + self.panelPalette = MiRCARTPalette(self.panelSkin, \ (25, (canvasSize[1] + 3) * cellSize[1]), cellSize, self.onPaletteEvent) self.statusBar = self.CreateStatusBar() From e0300331fdf9c90419d7015e17618c9de62d864d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 4 Jan 2018 23:45:30 +0100 Subject: [PATCH 047/148] MiRC2png.py:MiRC2png._parseAs{Char,ColourSpec}(): fix indentation. --- MiRC2png.py | 94 ++++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/MiRC2png.py b/MiRC2png.py index adf3b44..abc18b1 100755 --- a/MiRC2png.py +++ b/MiRC2png.py @@ -112,58 +112,58 @@ class MiRC2png: # }}} # {{{ _parseAsChar(): Parse single character as regular character and mutate state def _parseAsChar(self, char): - if char == "": - self.inCurCol += 1; self.inCurBold = 0 if self.inCurBold else 1; - elif char == "": - self._State = self._State.STATE_COLOUR_SPEC; self.inCurCol += 1; - elif char == "": - self.inCurCol += 1; self.inCurItalic = 0 if self.inCurItalic else 1; - elif char == "": - self.inCurCol += 1; - self.inCurBold = 0; self.inCurItalic = 0; self.inCurUnderline = 0; - self.inCurColourSpec = ""; - elif char == "": - self.inCurCol += 1 - self.outCurColourBg, self.outCurColourFg = self.outCurColourFg, self.outCurColourBg; - elif char == "": - self.inCurCol += 1; self.inCurUnderline = 0 if self.inCurUnderline else 1; - elif char == " ": - if self.inCurBold: - colourBg = self._ColourMapBold[self.outCurColourBg] - else: - colourBg = self._ColourMapNormal[self.outCurColourBg] - self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + self.outImgFontSize[0], self.outCurY + self.outImgFontSize[1])), fill=colourBg) - if self.inCurUnderline: - self.outImgDraw.line((self.outCurX, self.outCurY + (self.outImgFontSize[1] - 2), self.outCurX + self.outImgFontSize[0], self.outCurY + (self.outImgFontSize[1] - 2)), fill=colourFg) - self.outCurX += self.outImgFontSize[0]; self.inCurCol += 1; + if char == "": + self.inCurCol += 1; self.inCurBold = 0 if self.inCurBold else 1; + elif char == "": + self._State = self._State.STATE_COLOUR_SPEC; self.inCurCol += 1; + elif char == "": + self.inCurCol += 1; self.inCurItalic = 0 if self.inCurItalic else 1; + elif char == "": + self.inCurCol += 1; + self.inCurBold = 0; self.inCurItalic = 0; self.inCurUnderline = 0; + self.inCurColourSpec = ""; + elif char == "": + self.inCurCol += 1 + self.outCurColourBg, self.outCurColourFg = self.outCurColourFg, self.outCurColourBg; + elif char == "": + self.inCurCol += 1; self.inCurUnderline = 0 if self.inCurUnderline else 1; + elif char == " ": + if self.inCurBold: + colourBg = self._ColourMapBold[self.outCurColourBg] else: - if self.inCurBold: - colourBg = self._ColourMapBold[self.outCurColourBg] - colourFg = self._ColourMapBold[self.outCurColourFg] - else: - colourBg = self._ColourMapNormal[self.outCurColourBg] - colourFg = self._ColourMapNormal[self.outCurColourFg] - self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + self.outImgFontSize[0], self.outCurY + self.outImgFontSize[1])), fill=colourBg) - # XXX implement italic - self.outImgDraw.text((self.outCurX, self.outCurY), char, colourFg, self.outImgFont) - if self.inCurUnderline: - self.outImgDraw.line((self.outCurX, self.outCurY + (self.outImgFontSize[1] - 2), self.outCurX + self.outImgFontSize[0], self.outCurY + (self.outImgFontSize[1] - 2)), fill=colourFg) - self.outCurX += self.outImgFontSize[0]; self.inCurCol += 1; + colourBg = self._ColourMapNormal[self.outCurColourBg] + self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + self.outImgFontSize[0], self.outCurY + self.outImgFontSize[1])), fill=colourBg) + if self.inCurUnderline: + self.outImgDraw.line((self.outCurX, self.outCurY + (self.outImgFontSize[1] - 2), self.outCurX + self.outImgFontSize[0], self.outCurY + (self.outImgFontSize[1] - 2)), fill=colourFg) + self.outCurX += self.outImgFontSize[0]; self.inCurCol += 1; + else: + if self.inCurBold: + colourBg = self._ColourMapBold[self.outCurColourBg] + colourFg = self._ColourMapBold[self.outCurColourFg] + else: + colourBg = self._ColourMapNormal[self.outCurColourBg] + colourFg = self._ColourMapNormal[self.outCurColourFg] + self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + self.outImgFontSize[0], self.outCurY + self.outImgFontSize[1])), fill=colourBg) + # XXX implement italic + self.outImgDraw.text((self.outCurX, self.outCurY), char, colourFg, self.outImgFont) + if self.inCurUnderline: + self.outImgDraw.line((self.outCurX, self.outCurY + (self.outImgFontSize[1] - 2), self.outCurX + self.outImgFontSize[0], self.outCurY + (self.outImgFontSize[1] - 2)), fill=colourFg) + self.outCurX += self.outImgFontSize[0]; self.inCurCol += 1; # }}} # {{{ _parseAsColourSpec(): Parse single character as mIRC colour control code sequence and mutate state def _parseAsColourSpec(self, char): - if char in set(",0123456789"): - self.inCurColourSpec += char; self.inCurCol += 1; + if char in set(",0123456789"): + self.inCurColourSpec += char; self.inCurCol += 1; + else: + self.inCurColourSpec = self.inCurColourSpec.split(",") + if len(self.inCurColourSpec) == 2: + self.outCurColourFg = int(self.inCurColourSpec[0]) + self.outCurColourBg = int(self.inCurColourSpec[1] or self.outCurColourBg) + elif len(self.inCurColourSpec) == 1: + self.outCurColourFg = int(self.inCurColourSpec[0]) else: - self.inCurColourSpec = self.inCurColourSpec.split(",") - if len(self.inCurColourSpec) == 2: - self.outCurColourFg = int(self.inCurColourSpec[0]) - self.outCurColourBg = int(self.inCurColourSpec[1] or self.outCurColourBg) - elif len(self.inCurColourSpec) == 1: - self.outCurColourFg = int(self.inCurColourSpec[0]) - else: - self.outCurColourBg = 1; self.outCurColourFg = 15; - self.inCurColourSpec = ""; self._State = self._State.STATE_CHAR; + self.outCurColourBg = 1; self.outCurColourFg = 15; + self.inCurColourSpec = ""; self._State = self._State.STATE_CHAR; # }}} # From 68ba42f2444872cde1da610b8670fcce458000a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 5 Jan 2018 00:52:02 +0100 Subject: [PATCH 048/148] MiRC2png.py: fix mIRC colour control code sequence counting & rendering logic. --- MiRC2png.py | 148 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 96 insertions(+), 52 deletions(-) diff --git a/MiRC2png.py b/MiRC2png.py index abc18b1..5ee3eee 100755 --- a/MiRC2png.py +++ b/MiRC2png.py @@ -39,7 +39,7 @@ class MiRC2png: inCurBold = inCurItalic = inCurUnderline = None; inCurColourSpec = None; state = None; - inCurCol = None; + inCurCol = inCurDigits = None; # {{{ _ColourMapBold: mIRC colour number to RGBA map given ^B (bold) _ColourMapBold = [ @@ -85,48 +85,104 @@ class MiRC2png: class _State(Enum): STATE_CHAR = 1 STATE_COLOUR_SPEC = 2 + STATE_CSPEC_DIGIT0 = 2 + STATE_CSPEC_DIGIT1 = 3 # }}} + # {{{ _countChar(): XXX + def _countChar(self, char): + return True + # }}} + # {{{ _countColourSpecState(): XXX + def _countColourSpecState(self, colourSpec): + return 0 + # }}} + # {{{ _render(): XXX + def _render(self): + self.outCurX = 0; self.outCurY = 0; + for inCurRow in range(0, len(self.inLines)): + self.inCurBold = 0; self.inCurItalic = 0; self.inCurUnderline = 0; + self.inCurColourSpec = ""; self._State = self._State.STATE_CHAR; + self.inCurCol = 0; self.inCurDigits = 0; + while self.inCurCol < len(self.inLines[inCurRow]): + if self._State == self._State.STATE_CHAR: + self._parseAsChar( \ + self.inLines[inCurRow][self.inCurCol], \ + self._syncChar) + elif self._State == self._State.STATE_CSPEC_DIGIT0 \ + or self._State == self._State.STATE_CSPEC_DIGIT1: \ + self._parseAsColourSpec( \ + self.inLines[inCurRow][self.inCurCol], \ + self._syncColourSpecState) + self.outCurX = 0; self.outCurY += self.outImgFontSize[1]; + # }}} # {{{ _getMaxCols(): Calculate widest row in lines, ignoring non-printable & mIRC control code sequences def _getMaxCols(self, lines): maxCols = 0; - for curRow in range(0, len(lines)): - curRowCols = 0; curState = self._State.STATE_CHAR; - curCol = 0; curColLen = len(lines[curRow]); - while curCol < curColLen: - curChar = lines[curRow][curCol] - if curState == self._State.STATE_CHAR: - if curChar == "": - curState = self._State.STATE_COLOUR_SPEC; curCol += 1; - elif curChar in string.printable: - curRowCols += 1; curCol += 1; - else: - curCol += 1; - elif curState == self._State.STATE_COLOUR_SPEC: - if curChar in set(",0123456789"): - curCol += 1; - else: - curState = self._State.STATE_CHAR; + for inCurRow in range(0, len(lines)): + self.inCurBold = 0; self.inCurItalic = 0; self.inCurUnderline = 0; + self.inCurColourSpec = ""; self._State = self._State.STATE_CHAR; + self.inCurCol = 0; self.inCurDigits = 0; curRowCols = 0; + while self.inCurCol < len(self.inLines[inCurRow]): + if self._State == self._State.STATE_CHAR: + if self._parseAsChar( \ + self.inLines[inCurRow][self.inCurCol], self._countChar): + curRowCols += 1 + elif self._State == self._State.STATE_CSPEC_DIGIT0 \ + or self._State == self._State.STATE_CSPEC_DIGIT1: + self._parseAsColourSpec( \ + self.inLines[inCurRow][self.inCurCol], \ + self._countColourSpecState) maxCols = max(maxCols, curRowCols) return maxCols # }}} # {{{ _parseAsChar(): Parse single character as regular character and mutate state - def _parseAsChar(self, char): + def _parseAsChar(self, char, fn): + if char == "": + self._State = self._State.STATE_CSPEC_DIGIT0; self.inCurCol += 1; + return False + else: + self.inCurCol += 1; return fn(char); + # }}} + # {{{ _parseAsColourSpec(): Parse single character as mIRC colour control code sequence and mutate state + def _parseAsColourSpec(self, char, fn): + if self._State == self._State.STATE_CSPEC_DIGIT0 \ + and char == ",": + self.inCurColourSpec += char; self.inCurCol += 1; + self._State = self._State.STATE_CSPEC_DIGIT1; + self.inCurDigits = 0 + return [False] + elif self._State == self._State.STATE_CSPEC_DIGIT0 \ + and char in set("0123456789") \ + and self.inCurDigits <= 1: + self.inCurColourSpec += char; self.inCurCol += 1; + self.inCurDigits += 1 + return [False] + elif self._State == self._State.STATE_CSPEC_DIGIT1 \ + and char in set("0123456789") \ + and self.inCurDigits <= 1: + self.inCurColourSpec += char; self.inCurCol += 1; + self.inCurDigits += 1 + return [False] + else: + result = fn(self.inCurColourSpec) + self.inCurColourSpec = ""; self._State = self._State.STATE_CHAR; + self.inCurDigits = 0 + return [True, result] + # }}} + # {{{ _syncChar(): XXX + def _syncChar(self, char): if char == "": - self.inCurCol += 1; self.inCurBold = 0 if self.inCurBold else 1; - elif char == "": - self._State = self._State.STATE_COLOUR_SPEC; self.inCurCol += 1; + self.inCurBold = 0 if self.inCurBold else 1; elif char == "": - self.inCurCol += 1; self.inCurItalic = 0 if self.inCurItalic else 1; + self.inCurItalic = 0 if self.inCurItalic else 1; elif char == "": - self.inCurCol += 1; self.inCurBold = 0; self.inCurItalic = 0; self.inCurUnderline = 0; self.inCurColourSpec = ""; elif char == "": - self.inCurCol += 1 self.outCurColourBg, self.outCurColourFg = self.outCurColourFg, self.outCurColourBg; elif char == "": - self.inCurCol += 1; self.inCurUnderline = 0 if self.inCurUnderline else 1; + self.inCurUnderline = 0 if self.inCurUnderline else 1; elif char == " ": if self.inCurBold: colourBg = self._ColourMapBold[self.outCurColourBg] @@ -135,7 +191,7 @@ class MiRC2png: self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + self.outImgFontSize[0], self.outCurY + self.outImgFontSize[1])), fill=colourBg) if self.inCurUnderline: self.outImgDraw.line((self.outCurX, self.outCurY + (self.outImgFontSize[1] - 2), self.outCurX + self.outImgFontSize[0], self.outCurY + (self.outImgFontSize[1] - 2)), fill=colourFg) - self.outCurX += self.outImgFontSize[0]; self.inCurCol += 1; + self.outCurX += self.outImgFontSize[0]; else: if self.inCurBold: colourBg = self._ColourMapBold[self.outCurColourBg] @@ -148,22 +204,20 @@ class MiRC2png: self.outImgDraw.text((self.outCurX, self.outCurY), char, colourFg, self.outImgFont) if self.inCurUnderline: self.outImgDraw.line((self.outCurX, self.outCurY + (self.outImgFontSize[1] - 2), self.outCurX + self.outImgFontSize[0], self.outCurY + (self.outImgFontSize[1] - 2)), fill=colourFg) - self.outCurX += self.outImgFontSize[0]; self.inCurCol += 1; + self.outCurX += self.outImgFontSize[0]; + return True # }}} - # {{{ _parseAsColourSpec(): Parse single character as mIRC colour control code sequence and mutate state - def _parseAsColourSpec(self, char): - if char in set(",0123456789"): - self.inCurColourSpec += char; self.inCurCol += 1; + # {{{ _syncColourSpecState(): XXX + def _syncColourSpecState(self, colourSpec): + colourSpec = colourSpec.split(",") + if len(colourSpec) == 2: + self.outCurColourFg = int(colourSpec[0]) + self.outCurColourBg = int(colourSpec[1] or self.outCurColourBg) + elif len(colourSpec) == 1: + self.outCurColourFg = int(colourSpec[0]) else: - self.inCurColourSpec = self.inCurColourSpec.split(",") - if len(self.inCurColourSpec) == 2: - self.outCurColourFg = int(self.inCurColourSpec[0]) - self.outCurColourBg = int(self.inCurColourSpec[1] or self.outCurColourBg) - elif len(self.inCurColourSpec) == 1: - self.outCurColourFg = int(self.inCurColourSpec[0]) - else: - self.outCurColourBg = 1; self.outCurColourFg = 15; - self.inCurColourSpec = ""; self._State = self._State.STATE_CHAR; + self.outCurColourBg = 1; self.outCurColourFg = 15; + return True # }}} # @@ -179,17 +233,7 @@ class MiRC2png: self.outImg = Image.new("RGBA", (self.inColsMax * self.outImgFontSize[0], self.inRows * self.outImgFontSize[1]), self._ColourMapNormal[1]) self.outImgDraw = ImageDraw.Draw(self.outImg) self.outCurColourBg = 1; self.outCurColourFg = 15; - self.outCurX = 0; self.outCurY = 0; - for inCurRow in range(0, len(self.inLines)): - self.inCurBold = 0; self.inCurItalic = 0; self.inCurUnderline = 0; - self.inCurColourSpec = ""; self._State = self._State.STATE_CHAR; - self.inCurCol = 0; - while self.inCurCol < len(self.inLines[inCurRow]): - if self._State == self._State.STATE_CHAR: - self._parseAsChar(self.inLines[inCurRow][self.inCurCol]) - elif self._State == self._State.STATE_COLOUR_SPEC: - self._parseAsColourSpec(self.inLines[inCurRow][self.inCurCol]) - self.outCurX = 0; self.outCurY += self.outImgFontSize[1]; + self._render() self.inFile.close(); self.outImg.save(imgFilePath); From 7a891d9863d5c0a9c48136d549ad6c5d25fcae77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 5 Jan 2018 00:57:22 +0100 Subject: [PATCH 049/148] MiRCART.py:MiRCARTToolRect.onMouse{Down,Motion}(): remove debugging print()s. --- MiRCART.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index e0d7c91..f940fb3 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -233,14 +233,10 @@ class MiRCARTToolRect(MiRCARTTool): # }}} # {{{ onMouseDown(): XXX def onMouseDown(self, event, mapX, mapY, isLeftDown, isRightDown): - print("mouse down") return self._draw(event, mapX, mapY, isLeftDown, isRightDown) # }}} # {{{ onMouseMotion(): XXX def onMouseMotion(self, event, mapX, mapY, isLeftDown, isRightDown): - print("mouse moving") - if isLeftDown or isRightDown: - print("mouse depressed") return self._draw(event, mapX, mapY, isLeftDown, isRightDown) # }}} # {{{ Initialisation method From 423f923b4ede6fa5092375de52cb821582d26f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 5 Jan 2018 01:34:57 +0100 Subject: [PATCH 050/148] MiRCART.py:MiRCARTCanvas._processMapPatches(): don't process patches that don't introduce changes.. MiRCART.py:MiRCARTCanvas._processMapPatches(): append redo and undo patches to self.patchesUndo. MiRCART.py:MiRCARTCanvas.undo(): initial implementation. MiRCART.py:MiRCARTFrame.{menuFileUndo,onFileUndo,__init__}(): add GUI for MiRCARTCanvas.undo(). --- MiRCART.py | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index f940fb3..c3a1a70 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -105,9 +105,15 @@ class MiRCARTCanvas(wx.Panel): atY + patch[1], mapItem[0], mapItem[1], mapItem[2])) self._drawPatch(patch, eventDc, tmpDc, atX, atY) else: - self._drawPatch(patch, eventDc, tmpDc, atX, atY) - self.canvasMap[atY + patch[1]][atX + patch[0]] =\ - [patch[2], patch[3], " "]; + mapItem = self.canvasMap[atY + patch[1]][atX + patch[0]] + if mapItem != [patch[2], patch[3], patch[4]]: + self.patchesUndo.append((atX + patch[0], \ + atY + patch[1], patch[2], patch[3], " ")) + self.patchesUndo.append((atX + patch[0], \ + atY + patch[1], mapItem[0], mapItem[1], mapItem[2])) + self.canvasMap[atY + patch[1]][atX + patch[0]] =\ + [patch[2], patch[3], " "]; + self._drawPatch(patch, eventDc, tmpDc, atX, atY) # }}} # {{{ getBackgroundColour(): XXX def getBackgroundColour(self): @@ -160,6 +166,19 @@ class MiRCARTCanvas(wx.Panel): def onRightDown(self, event): self._onMouseEvent(event) # }}} + # {{{ undo(): XXX + def undo(self): + if len(self.patchesUndo) >= 2: + deltaPatch = self.patchesUndo[-1]; + del self.patchesUndo[-1]; del self.patchesUndo[-1]; + self.canvasMap[deltaPatch[1]][deltaPatch[0]] = \ + [deltaPatch[2], deltaPatch[3], deltaPatch[4]] + eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); + tmpDc.SelectObject(self.canvasBitmap) + self._drawPatch(deltaPatch, eventDc, tmpDc, 0, 0) + else: + return False + # }}} # {{{ Initialisation method def __init__(self, parent, canvasPos, cellSize, canvasSize, canvasTools): canvasWinSize = (cellSize[0] * canvasSize[0], cellSize[1] * canvasSize[1]) @@ -278,7 +297,7 @@ class MiRCARTPalette(wx.Panel): class MiRCARTFrame(wx.Frame): """XXX""" - menuFile = menuFileSaveAs = menuFileExit = menuBar = None + menuFile = menuFileUndo = menuFileSaveAs = menuFileExit = menuBar = None panelSkin = panelCanvas = panelPalette = None statusBar = None @@ -291,6 +310,10 @@ class MiRCARTFrame(wx.Frame): text += " " + str(self.panelCanvas.getBackgroundColour()) self.statusBar.SetStatusText(text) # }}} + # {{{ onFileUndo(): XXX + def onFileUndo(self, event): + self.panelCanvas.undo() + # }}} # {{{ onFileSaveAs(): XXX def onFileSaveAs(self, event): with wx.FileDialog(self, "Save As...", os.getcwd(), "", \ @@ -332,6 +355,7 @@ class MiRCARTFrame(wx.Frame): super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) self.menuFile = wx.Menu() + self.menuFileUndo = self.menuFile.Append(wx.ID_SAVE, "&Undo", "Undo") self.menuFileSaveAs = self.menuFile.Append(wx.ID_SAVE, "Save &As...", "Save As...") self.menuFileExit = self.menuFile.Append(wx.ID_EXIT, "E&xit", "Exit") self.menuBar = wx.MenuBar() @@ -349,6 +373,7 @@ class MiRCARTFrame(wx.Frame): self.Bind(wx.EVT_MENU, self.onFileExit, self.menuFileExit) self.Bind(wx.EVT_MENU, self.onFileSaveAs, self.menuFileSaveAs) + self.Bind(wx.EVT_MENU, self.onFileUndo, self.menuFileUndo) self.SetMenuBar(self.menuBar) self.Show(True) # }}} From 8b6d7ab4454c56859dd7bdcfce893fb8d3f7e1d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 5 Jan 2018 01:59:04 +0100 Subject: [PATCH 051/148] MiRCART.py:MiRCARTFrame.accel{UndoId,Table}: added. MiRCART.py:MiRCARTFrame.onAccelUndo(): call self.panelCanvas.undo(). MiRCART.py:MiRCARTFrame.__init__(): create self.menuFileUndo w/ wx.ID_UNDO. MiRCART.py:MiRCARTFrame.__init__(): bind ^Z accelerator to self.onAccelUndo(). --- MiRCART.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index c3a1a70..5b4ed7b 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -299,7 +299,7 @@ class MiRCARTFrame(wx.Frame): """XXX""" menuFile = menuFileUndo = menuFileSaveAs = menuFileExit = menuBar = None panelSkin = panelCanvas = panelPalette = None - statusBar = None + accelUndoId = accelTable = statusBar = None # {{{ _updateStatusBar(): XXX def _updateStatusBar(self): @@ -310,6 +310,10 @@ class MiRCARTFrame(wx.Frame): text += " " + str(self.panelCanvas.getBackgroundColour()) self.statusBar.SetStatusText(text) # }}} + # {{{ onAccelUndo(): XXX + def onAccelUndo(self, event): + self.panelCanvas.undo() + # }}} # {{{ onFileUndo(): XXX def onFileUndo(self, event): self.panelCanvas.undo() @@ -355,11 +359,12 @@ class MiRCARTFrame(wx.Frame): super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) self.menuFile = wx.Menu() - self.menuFileUndo = self.menuFile.Append(wx.ID_SAVE, "&Undo", "Undo") + self.menuFileUndo = self.menuFile.Append(wx.ID_UNDO, "&Undo", "Undo") self.menuFileSaveAs = self.menuFile.Append(wx.ID_SAVE, "Save &As...", "Save As...") self.menuFileExit = self.menuFile.Append(wx.ID_EXIT, "E&xit", "Exit") self.menuBar = wx.MenuBar() self.menuBar.Append(self.menuFile, "&File") + self.SetMenuBar(self.menuBar) self.panelSkin = wx.Panel(self, wx.ID_ANY) self.panelCanvas = MiRCARTCanvas(self.panelSkin, \ @@ -368,13 +373,18 @@ class MiRCARTFrame(wx.Frame): self.panelPalette = MiRCARTPalette(self.panelSkin, \ (25, (canvasSize[1] + 3) * cellSize[1]), cellSize, self.onPaletteEvent) + self.accelUndoId = wx.NewId() + self.accelTable = wx.AcceleratorTable([( \ + wx.ACCEL_CTRL, ord('Z'), self.accelUndoId)]) + self.SetAcceleratorTable(self.accelTable) self.statusBar = self.CreateStatusBar() self._updateStatusBar() + self.SetFocus() + self.Bind(wx.EVT_MENU, self.onAccelUndo, id=self.accelUndoId) self.Bind(wx.EVT_MENU, self.onFileExit, self.menuFileExit) self.Bind(wx.EVT_MENU, self.onFileSaveAs, self.menuFileSaveAs) self.Bind(wx.EVT_MENU, self.onFileUndo, self.menuFileUndo) - self.SetMenuBar(self.menuBar) self.Show(True) # }}} From 496e4c7a4bd2efd0fb5896405166bf647f0d08ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 5 Jan 2018 03:27:57 +0100 Subject: [PATCH 052/148] MiRCART.py:MiRCARTToolRect.__processMapPatches(): always obtain cell state from canvasMap. MiRCART.py:MiRCARTToolRect._draw(): always paint w/ background colour given isRightDown. --- MiRCART.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index 5b4ed7b..1b51b02 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -96,13 +96,16 @@ class MiRCARTCanvas(wx.Panel): mapPatchTmp = mapPatch[0]; mapPatchW = mapPatch[1]; mapPatchH = mapPatch[2]; if mapPatchTmp and self.patchesTmp: for patch in self.patchesTmp: + patch[2] = self.canvasMap[patch[1]][patch[0]][0] + patch[3] = self.canvasMap[patch[1]][patch[0]][1] + patch[4] = self.canvasMap[patch[1]][patch[0]][2] self._drawPatch(patch, eventDc, tmpDc, 0, 0) self.patchesTmp = [] for patch in mapPatch[3]: if mapPatchTmp: mapItem = self.canvasMap[atY + patch[1]][atX + patch[0]] - self.patchesTmp.append((atX + patch[0], \ - atY + patch[1], mapItem[0], mapItem[1], mapItem[2])) + self.patchesTmp.append([atX + patch[0], \ + atY + patch[1], None, None, None]) self._drawPatch(patch, eventDc, tmpDc, atX, atY) else: mapItem = self.canvasMap[atY + patch[1]][atX + patch[0]] @@ -243,8 +246,8 @@ class MiRCARTToolRect(MiRCARTTool): self.parentCanvas.getBackgroundColour(), \ self.parentCanvas.getBackgroundColour(), " "]]], \ [True, 1, 1, [[0, 0, \ - self.parentCanvas.getForegroundColour(), \ - self.parentCanvas.getForegroundColour(), " "]]]] + self.parentCanvas.getBackgroundColour(), \ + self.parentCanvas.getBackgroundColour(), " "]]]] else: return [[True, 1, 1, [[0, 0, \ self.parentCanvas.getForegroundColour(), \ From ba99dc1280cca38cf28cb2c91d6e83087d9a8783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 5 Jan 2018 16:48:50 +0100 Subject: [PATCH 053/148] MiRC2png.py:MiRC2png._syncColourSpecState(): handle empty mIRC colour control code sequences. --- MiRC2png.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/MiRC2png.py b/MiRC2png.py index 5ee3eee..89c8976 100755 --- a/MiRC2png.py +++ b/MiRC2png.py @@ -209,14 +209,15 @@ class MiRC2png: # }}} # {{{ _syncColourSpecState(): XXX def _syncColourSpecState(self, colourSpec): - colourSpec = colourSpec.split(",") - if len(colourSpec) == 2: - self.outCurColourFg = int(colourSpec[0]) - self.outCurColourBg = int(colourSpec[1] or self.outCurColourBg) - elif len(colourSpec) == 1: - self.outCurColourFg = int(colourSpec[0]) - else: - self.outCurColourBg = 1; self.outCurColourFg = 15; + if len(colourSpec) > 0: + colourSpec = colourSpec.split(",") + if len(colourSpec) == 2: + self.outCurColourFg = int(colourSpec[0]) + self.outCurColourBg = int(colourSpec[1] or self.outCurColourBg) + elif len(colourSpec) == 1: + self.outCurColourFg = int(colourSpec[0]) + else: + self.outCurColourBg = 1; self.outCurColourFg = 15; return True # }}} From 31d644515a2974fc2a1a3848de6691c876067da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 5 Jan 2018 16:59:51 +0100 Subject: [PATCH 054/148] README.md:MiRCART.py: add prerequisites for Windows & title. --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cfde2b4..4167833 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ -# MiRCART -- XXX -* Prerequisites: python3 && python-wx{gtk2.8,tools} on Debian-family Linux distributions +# MiRCART.py -- mIRC art editor for Windows & Linux +* Prerequisites on Windows: install Python v3.6.x[1] and wxPython v4.x.x w/ the following elevated command prompt command line: + `pip install wxPython` +* Prerequisites on Linux: python3 && python-wx{gtk2.8,tools} on Debian-family Linux distributions # IrcMiRCARTBot.py -- XXX * Prerequisites: python3 && python3-{json,requests,urllib3} on Debian-family Linux distributions @@ -8,3 +10,6 @@ # MiRC2png.py -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) * Prerequisites: python3 && python3-pil on Debian-family Linux distributions * MiRC2png.py usage: MiRC2png.py `` `` [``] [``] + +References: +Fri, 05 Jan 2018 17:01:47 +0100 [1] Python Releases for Windows | Python.org From bcf52d8dc5f9a57feab282b5a2a826063a759e7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 5 Jan 2018 17:05:58 +0100 Subject: [PATCH 055/148] IrcMiRCARTBot.py, README.md:IrcMiRCARTBot.py: update title. --- IrcMiRCARTBot.py | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index 3af1764..7932e3d 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# IrcMiRCARTBot.py -- XXX +# IrcMiRCARTBot.py -- IRC<->MiRC2png bot (for EFnet #MiRCART) # Copyright (c) 2018 Lucio Andrés Illanes Albornoz # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -29,7 +29,7 @@ import IrcClient, MiRC2png import requests, urllib.request class IrcMiRCARTBot(IrcClient.IrcClient): - """IRC<->MiRCART bot""" + """IRC<->MiRC2png bot""" clientChannelLastMessage = clientChannelOps = clientChannel = None clientChannelRejoin = None diff --git a/README.md b/README.md index 4167833..acff52d 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,11 @@ `pip install wxPython` * Prerequisites on Linux: python3 && python-wx{gtk2.8,tools} on Debian-family Linux distributions -# IrcMiRCARTBot.py -- XXX +# IrcMiRCARTBot.py -- IRC<->MiRC2png bot (for EFnet #MiRCART) * Prerequisites: python3 && python3-{json,requests,urllib3} on Debian-family Linux distributions * IrcMiRCARTBot.py usage: IrcMiRCARTBot.py `` [``] [``] [``] [``] [``] -# MiRC2png.py -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) +# MiRC2png.py -- convert ASCII w/ mIRC control codes to monospaced PNG * Prerequisites: python3 && python3-pil on Debian-family Linux distributions * MiRC2png.py usage: MiRC2png.py `` `` [``] [``] From 133c4dc240d40366f6afe1b5ae64c7a843bc43ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 5 Jan 2018 17:21:14 +0100 Subject: [PATCH 056/148] MiRCART.py:MiRCARTCanvas.patchesUndoLevel: added to track {un,re}do queue movement in both directions. MiRCART.py:MiRCARTCanvas._processMapPatches(): remove {un,re}do queue items 0..patchesUndoLevel when updating queue. MiRCART.py:MiRCARTCanvas._processMapPatches(): prepend to queue instead of appending. MiRCART.py:MiRCARTCanvas._processMapPatches(): insert {un,re}do queue items as single (list) item each. MiRCART.py:MiRCARTCanvas.redo(): decrement patchesUndoLevel & apply redo patch, if patchesUndoLevel > 0. MiRCART.py:MiRCARTCanvas.undo(): apply undo patch & increment patchesUndoLevel, if patchesUndo[patchesUndoLevel] != None. MiRCART.py:MiRCARTFrame.{menuFileRedo,onFileRedo(),__init__()}: adds `&Redo' File menu item w/ wx.ID_REDO. MiRCART.py:MiRCARTFrame.{accelRedoId,onAccelRedo(),__init__()}: binds ^Y accelerator to MiRCARTCanvas.redo(). MiRCART.py: update title. --- MiRCART.py | 77 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 53 insertions(+), 24 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index 1b51b02..f22e66b 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# MiRCART.py -- XXX +# MiRCART.py -- mIRC art editor for Windows & Linux # Copyright (c) 2018 Lucio Andrés Illanes Albornoz # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -51,7 +51,7 @@ class MiRCARTCanvas(wx.Panel): canvasPos = canvasSize = canvasWinSize = cellPos = cellSize = None canvasBitmap = canvasMap = canvasTools = None mircBg = mircFg = mircBrushes = mircPens = None - patchesTmp = patchesUndo = None + patchesTmp = patchesUndo = patchesUndoLevel = None # {{{ _drawPatch(): XXX def _drawPatch(self, patch, eventDc, tmpDc, atX, atY): @@ -104,18 +104,18 @@ class MiRCARTCanvas(wx.Panel): for patch in mapPatch[3]: if mapPatchTmp: mapItem = self.canvasMap[atY + patch[1]][atX + patch[0]] - self.patchesTmp.append([atX + patch[0], \ - atY + patch[1], None, None, None]) + self.patchesTmp.append([atX + patch[0], atY + patch[1], None, None, None]) self._drawPatch(patch, eventDc, tmpDc, atX, atY) else: mapItem = self.canvasMap[atY + patch[1]][atX + patch[0]] if mapItem != [patch[2], patch[3], patch[4]]: - self.patchesUndo.append((atX + patch[0], \ - atY + patch[1], patch[2], patch[3], " ")) - self.patchesUndo.append((atX + patch[0], \ - atY + patch[1], mapItem[0], mapItem[1], mapItem[2])) - self.canvasMap[atY + patch[1]][atX + patch[0]] =\ - [patch[2], patch[3], " "]; + if self.patchesUndoLevel > 0: + del self.patchesUndo[0:self.patchesUndoLevel] + self.patchesUndoLevel = 0 + self.patchesUndo.insert(0, ( \ + (atX + patch[0], atY + patch[1], mapItem[0], mapItem[1], mapItem[2]), \ + (atX + patch[0], atY + patch[1], patch[2], patch[3], " "))) + self.canvasMap[atY + patch[1]][atX + patch[0]] = [patch[2], patch[3], " "]; self._drawPatch(patch, eventDc, tmpDc, atX, atY) # }}} # {{{ getBackgroundColour(): XXX @@ -169,16 +169,31 @@ class MiRCARTCanvas(wx.Panel): def onRightDown(self, event): self._onMouseEvent(event) # }}} - # {{{ undo(): XXX - def undo(self): - if len(self.patchesUndo) >= 2: - deltaPatch = self.patchesUndo[-1]; - del self.patchesUndo[-1]; del self.patchesUndo[-1]; - self.canvasMap[deltaPatch[1]][deltaPatch[0]] = \ - [deltaPatch[2], deltaPatch[3], deltaPatch[4]] + # {{{ redo(): XXX + def redo(self): + if self.patchesUndoLevel > 0: + self.patchesUndoLevel -= 1 + redoPatch = self.patchesUndo[self.patchesUndoLevel][1] + self.canvasMap[redoPatch[1]][redoPatch[0]] = \ + [redoPatch[2], redoPatch[3], redoPatch[4]] eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); tmpDc.SelectObject(self.canvasBitmap) - self._drawPatch(deltaPatch, eventDc, tmpDc, 0, 0) + self._drawPatch(redoPatch, eventDc, tmpDc, 0, 0) + return True + else: + return False + # }}} + # {{{ undo(): XXX + def undo(self): + if self.patchesUndo[self.patchesUndoLevel] != None: + undoPatch = self.patchesUndo[self.patchesUndoLevel][0] + self.canvasMap[undoPatch[1]][undoPatch[0]] = \ + [undoPatch[2], undoPatch[3], undoPatch[4]] + eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); + tmpDc.SelectObject(self.canvasBitmap) + self._drawPatch(undoPatch, eventDc, tmpDc, 0, 0) + self.patchesUndoLevel += 1 + return True else: return False # }}} @@ -204,7 +219,8 @@ class MiRCARTCanvas(wx.Panel): self.mircPens[mircColour] = wx.Pen( \ wx.Colour(mircColours[mircColour]), 1) - self.patchesTmp = []; self.patchesUndo = []; + self.patchesTmp = [] + self.patchesUndo = [None]; self.patchesUndoLevel = 0; self.Bind(wx.EVT_LEFT_DOWN, self.onLeftDown) self.Bind(wx.EVT_MOTION, self.onMotion) @@ -300,9 +316,9 @@ class MiRCARTPalette(wx.Panel): class MiRCARTFrame(wx.Frame): """XXX""" - menuFile = menuFileUndo = menuFileSaveAs = menuFileExit = menuBar = None + menuFile = menuFileRedo = menuFileUndo = menuFileSaveAs = menuFileExit = menuBar = None panelSkin = panelCanvas = panelPalette = None - accelUndoId = accelTable = statusBar = None + accelRedoId = accelUndoId = accelTable = statusBar = None # {{{ _updateStatusBar(): XXX def _updateStatusBar(self): @@ -313,10 +329,18 @@ class MiRCARTFrame(wx.Frame): text += " " + str(self.panelCanvas.getBackgroundColour()) self.statusBar.SetStatusText(text) # }}} + # {{{ onAccelRedo(): XXX + def onAccelRedo(self, event): + self.panelCanvas.redo() + # }}} # {{{ onAccelUndo(): XXX def onAccelUndo(self, event): self.panelCanvas.undo() # }}} + # {{{ onFileRedo(): XXX + def onFileRedo(self, event): + self.panelCanvas.redo() + # }}} # {{{ onFileUndo(): XXX def onFileUndo(self, event): self.panelCanvas.undo() @@ -362,6 +386,7 @@ class MiRCARTFrame(wx.Frame): super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) self.menuFile = wx.Menu() + self.menuFileRedo = self.menuFile.Append(wx.ID_REDO, "&Redo", "Redo") self.menuFileUndo = self.menuFile.Append(wx.ID_UNDO, "&Undo", "Undo") self.menuFileSaveAs = self.menuFile.Append(wx.ID_SAVE, "Save &As...", "Save As...") self.menuFileExit = self.menuFile.Append(wx.ID_EXIT, "E&xit", "Exit") @@ -376,17 +401,21 @@ class MiRCARTFrame(wx.Frame): self.panelPalette = MiRCARTPalette(self.panelSkin, \ (25, (canvasSize[1] + 3) * cellSize[1]), cellSize, self.onPaletteEvent) - self.accelUndoId = wx.NewId() - self.accelTable = wx.AcceleratorTable([( \ - wx.ACCEL_CTRL, ord('Z'), self.accelUndoId)]) + self.accelRedoId = wx.NewId(); self.accelUndoId = wx.NewId(); + accelTableEntries = [wx.AcceleratorEntry() for n in range(2)] + accelTableEntries[0].Set(wx.ACCEL_CTRL, ord('Y'), self.accelRedoId) + accelTableEntries[1].Set(wx.ACCEL_CTRL, ord('Z'), self.accelUndoId) + self.accelTable = wx.AcceleratorTable(accelTableEntries) self.SetAcceleratorTable(self.accelTable) self.statusBar = self.CreateStatusBar() self._updateStatusBar() self.SetFocus() + self.Bind(wx.EVT_MENU, self.onAccelRedo, id=self.accelRedoId) self.Bind(wx.EVT_MENU, self.onAccelUndo, id=self.accelUndoId) self.Bind(wx.EVT_MENU, self.onFileExit, self.menuFileExit) self.Bind(wx.EVT_MENU, self.onFileSaveAs, self.menuFileSaveAs) + self.Bind(wx.EVT_MENU, self.onFileRedo, self.menuFileRedo) self.Bind(wx.EVT_MENU, self.onFileUndo, self.menuFileUndo) self.Show(True) # }}} From 8215229f84aff34ed6aefc8fbdb556c9740c2f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 5 Jan 2018 18:08:10 +0100 Subject: [PATCH 057/148] MiRCART.py:MiRCARTFrame: complete GUI skeleton. --- MiRCART.py | 162 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 137 insertions(+), 25 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index f22e66b..a80d4bf 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -316,7 +316,16 @@ class MiRCARTPalette(wx.Panel): class MiRCARTFrame(wx.Frame): """XXX""" - menuFile = menuFileRedo = menuFileUndo = menuFileSaveAs = menuFileExit = menuBar = None + menuFile = None + menuFileNew = menuFileOpen = menuFileSave = menuFileSaveAs = None + menuFileExportPastebin = menuFileExportPng = None + menuFileExit = None + menuEdit = None + menuEditRedo = menuEditUndo = None + menuEditCopy = menuEditCut = menuEditDelete = menuEditPaste = None + menuEditDecrBrush = menuEditIncrBrush = menuEditSolidBrush = None + menuTools = menuToolsCircle = menuToolsLine = menuToolsRect = None + menuBar = None panelSkin = panelCanvas = panelPalette = None accelRedoId = accelUndoId = accelTable = statusBar = None @@ -337,14 +346,66 @@ class MiRCARTFrame(wx.Frame): def onAccelUndo(self, event): self.panelCanvas.undo() # }}} - # {{{ onFileRedo(): XXX - def onFileRedo(self, event): + # {{{ onEditCopy(): XXX + def onEditCopy(self, event): + pass + # }}} + # {{{ onEditCut(): XXX + def onEditCut(self, event): + pass + # }}} + # {{{ onEditDecrBrush(): XXX + def onEditDecrBrush(self, event): + pass + # }}} + # {{{ onEditDelete(): XXX + def onEditDelete(self, event): + pass + # }}} + # {{{ onEditIncrBrush(): XXX + def onEditIncrBrush(self, event): + pass + # }}} + # {{{ onEditPaste(): XXX + def onEditPaste(self, event): + pass + # }}} + # {{{ onEditRedo(): XXX + def onEditRedo(self, event): self.panelCanvas.redo() # }}} - # {{{ onFileUndo(): XXX - def onFileUndo(self, event): + # {{{ onEditSolidBrush(): XXX + def onEditSolidBrush(self, event): + pass + # }}} + # {{{ onEditUndo(): XXX + def onEditUndo(self, event): self.panelCanvas.undo() # }}} + # {{{ onFileExit(): XXX + def onFileExit(self, event): + self.Close(True) + # }}} + # {{{ onFileExportPastebin(): XXX + def onFileExportPastebin(self, event): + pass + # }}} + # {{{ onFileExportPng(): XXX + def onFileExportPng(self, event): + pass + # }}} + # {{{ onFileNew(): XXX + def onFileNew(self, event): + pass + # }}} + # {{{ onFileOpen(): XXX + def onFileOpen(self, event): + pass + # }}} + # {{{ onFileSave(): XXX + def onFileSave(self, event): + pass + # }}} # {{{ onFileSaveAs(): XXX def onFileSaveAs(self, event): with wx.FileDialog(self, "Save As...", os.getcwd(), "", \ @@ -372,9 +433,17 @@ class MiRCARTFrame(wx.Frame): except IOError as error: wx.LogError("IOError {}".format(error)) # }}} - # {{{ onFileExit(): XXX - def onFileExit(self, event): - self.Close(True) + # {{{ onToolsRect(): XXX + def onToolsRect(self, event): + pass + # }}} + # {{{ onToolsCircle(): XXX + def onToolsCircle(self, event): + pass + # }}} + # {{{ onToolsLine(): XXX + def onToolsLine(self, event): + pass # }}} # {{{ onPaletteEvent(): XXX def onPaletteEvent(self, leftDown, rightDown, numColour): @@ -385,15 +454,6 @@ class MiRCARTFrame(wx.Frame): def __init__(self, parent, appSize=(1024, 768), canvasPos=(25, 25), cellSize=(7, 14), canvasSize=(80, 25)): super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) - self.menuFile = wx.Menu() - self.menuFileRedo = self.menuFile.Append(wx.ID_REDO, "&Redo", "Redo") - self.menuFileUndo = self.menuFile.Append(wx.ID_UNDO, "&Undo", "Undo") - self.menuFileSaveAs = self.menuFile.Append(wx.ID_SAVE, "Save &As...", "Save As...") - self.menuFileExit = self.menuFile.Append(wx.ID_EXIT, "E&xit", "Exit") - self.menuBar = wx.MenuBar() - self.menuBar.Append(self.menuFile, "&File") - self.SetMenuBar(self.menuBar) - self.panelSkin = wx.Panel(self, wx.ID_ANY) self.panelCanvas = MiRCARTCanvas(self.panelSkin, \ canvasPos=canvasPos, cellSize=cellSize, \ @@ -401,22 +461,74 @@ class MiRCARTFrame(wx.Frame): self.panelPalette = MiRCARTPalette(self.panelSkin, \ (25, (canvasSize[1] + 3) * cellSize[1]), cellSize, self.onPaletteEvent) - self.accelRedoId = wx.NewId(); self.accelUndoId = wx.NewId(); + self.menuFile = wx.Menu() + self.menuFileNew = self.menuFile.Append(wx.ID_NEW, "&New", "New") + self.Bind(wx.EVT_MENU, self.onFileNew, self.menuFileNew) + self.menuFileOpen = self.menuFile.Append(wx.ID_OPEN, "&Open...", "Open...") + self.Bind(wx.EVT_MENU, self.onFileOpen, self.menuFileOpen) + self.menuFileSave = self.menuFile.Append(wx.ID_SAVE, "&Save", "Save") + self.Bind(wx.EVT_MENU, self.onFileSave, self.menuFileSave) + self.menuFileSaveAs = self.menuFile.Append(wx.ID_SAVEAS, "Save &As...", "Save As...") + self.Bind(wx.EVT_MENU, self.onFileSaveAs, self.menuFileSaveAs) + self.menuFile.AppendSeparator() + self.menuFileExportPastebin = self.menuFile.Append(wx.NewId(), "Export to &Pastebin...", "Export to Pastebin...") + self.Bind(wx.EVT_MENU, self.onFileExportPastebin, self.menuFileExportPastebin) + self.menuFileExportPng = self.menuFile.Append(wx.NewId(), "Export as &PNG...", "Export as PNG...") + self.Bind(wx.EVT_MENU, self.onFileExportPng, self.menuFileExportPng) + self.menuFile.AppendSeparator() + self.menuFileExit = self.menuFile.Append(wx.ID_EXIT, "E&xit", "Exit") + self.Bind(wx.EVT_MENU, self.onFileExit, self.menuFileExit) + + self.menuEdit = wx.Menu() + self.menuEditUndo = self.menuEdit.Append(wx.ID_UNDO, "&Undo", "Undo") + self.Bind(wx.EVT_MENU, self.onEditUndo, self.menuEditUndo) + self.menuEditRedo = self.menuEdit.Append(wx.ID_REDO, "&Redo", "Redo") + self.Bind(wx.EVT_MENU, self.onEditRedo, self.menuEditRedo) + self.menuEdit.AppendSeparator() + self.menuEditCut = self.menuEdit.Append(wx.ID_CUT, "Cu&t", "Cut") + self.Bind(wx.EVT_MENU, self.onEditCut, self.menuEditCut) + self.menuEditCopy = self.menuEdit.Append(wx.ID_COPY, "&Copy", "Copy") + self.Bind(wx.EVT_MENU, self.onEditCopy, self.menuEditCopy) + self.menuEditPaste = self.menuEdit.Append(wx.ID_PASTE, "&Paste", "Paste") + self.Bind(wx.EVT_MENU, self.onEditPaste, self.menuEditPaste) + self.menuEditDelete = self.menuEdit.Append(wx.ID_DELETE, "De&lete", "Delete") + self.Bind(wx.EVT_MENU, self.onEditDelete, self.menuEditDelete) + self.menuEdit.AppendSeparator() + self.menuEditIncrBrush = self.menuEdit.Append(wx.NewId(), "&Increase brush size", "Increase brush size") + self.Bind(wx.EVT_MENU, self.onEditIncrBrush, self.menuEditIncrBrush) + self.menuEditDecrBrush = self.menuEdit.Append(wx.NewId(), "&Decrease brush size", "Decrease brush size") + self.Bind(wx.EVT_MENU, self.onEditDecrBrush, self.menuEditDecrBrush) + self.menuEditSolidBrush = self.menuEdit.AppendRadioItem(wx.NewId(), "&Solid brush", "Solid brush") + self.Bind(wx.EVT_MENU, self.onEditSolidBrush, self.menuEditSolidBrush) + + self.menuTools = wx.Menu() + self.menuToolsRect = self.menuTools.AppendRadioItem(wx.NewId(), "&Rectangle", "Rectangle") + self.Bind(wx.EVT_MENU, self.onToolsRect, self.menuToolsRect) + self.menuToolsCircle = self.menuTools.AppendRadioItem(wx.NewId(), "&Circle", "Circle") + self.Bind(wx.EVT_MENU, self.onToolsCircle, self.menuToolsCircle) + self.menuToolsLine = self.menuTools.AppendRadioItem(wx.NewId(), "&Line", "Line") + self.Bind(wx.EVT_MENU, self.onToolsLine, self.menuToolsLine) + + self.menuBar = wx.MenuBar() + self.menuBar.Append(self.menuFile, "&File") + self.menuBar.Append(self.menuEdit, "&Edit") + self.menuBar.Append(self.menuTools, "&Tools") + self.SetMenuBar(self.menuBar) + accelTableEntries = [wx.AcceleratorEntry() for n in range(2)] + self.accelRedoId = wx.NewId() accelTableEntries[0].Set(wx.ACCEL_CTRL, ord('Y'), self.accelRedoId) + self.Bind(wx.EVT_MENU, self.onAccelRedo, id=self.accelRedoId) + self.accelUndoId = wx.NewId() accelTableEntries[1].Set(wx.ACCEL_CTRL, ord('Z'), self.accelUndoId) + self.Bind(wx.EVT_MENU, self.onAccelUndo, id=self.accelUndoId) self.accelTable = wx.AcceleratorTable(accelTableEntries) self.SetAcceleratorTable(self.accelTable) + self.statusBar = self.CreateStatusBar() self._updateStatusBar() - self.SetFocus() - self.Bind(wx.EVT_MENU, self.onAccelRedo, id=self.accelRedoId) - self.Bind(wx.EVT_MENU, self.onAccelUndo, id=self.accelUndoId) - self.Bind(wx.EVT_MENU, self.onFileExit, self.menuFileExit) - self.Bind(wx.EVT_MENU, self.onFileSaveAs, self.menuFileSaveAs) - self.Bind(wx.EVT_MENU, self.onFileRedo, self.menuFileRedo) - self.Bind(wx.EVT_MENU, self.onFileUndo, self.menuFileUndo) + self.SetFocus() self.Show(True) # }}} From c7fbe5b20c69b3f1e79d5bc4e210a0c3bbaeb9fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 5 Jan 2018 18:09:25 +0100 Subject: [PATCH 058/148] MiRCART.py:MiRCARTFrame.__init__(): change default appSize to (800, 600). --- MiRCART.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MiRCART.py b/MiRCART.py index a80d4bf..8c7a86b 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -451,7 +451,7 @@ class MiRCARTFrame(wx.Frame): self._updateStatusBar() # }}} # {{{ Initialisation method - def __init__(self, parent, appSize=(1024, 768), canvasPos=(25, 25), cellSize=(7, 14), canvasSize=(80, 25)): + def __init__(self, parent, appSize=(800, 600), canvasPos=(25, 25), cellSize=(7, 14), canvasSize=(80, 25)): super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) self.panelSkin = wx.Panel(self, wx.ID_ANY) From 813d49a3f242c7a94ae37e8dd26c5355d76d0652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 5 Jan 2018 18:12:02 +0100 Subject: [PATCH 059/148] MiRCART.py:MiRCARTFrame.__init__(): disable (grey out) menuEdit{Redo,Undo} initially. --- MiRCART.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MiRCART.py b/MiRCART.py index 8c7a86b..8d79396 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -481,8 +481,10 @@ class MiRCARTFrame(wx.Frame): self.menuEdit = wx.Menu() self.menuEditUndo = self.menuEdit.Append(wx.ID_UNDO, "&Undo", "Undo") + self.menuEditUndo.Enable(False) self.Bind(wx.EVT_MENU, self.onEditUndo, self.menuEditUndo) self.menuEditRedo = self.menuEdit.Append(wx.ID_REDO, "&Redo", "Redo") + self.menuEditRedo.Enable(False) self.Bind(wx.EVT_MENU, self.onEditRedo, self.menuEditRedo) self.menuEdit.AppendSeparator() self.menuEditCut = self.menuEdit.Append(wx.ID_CUT, "Cu&t", "Cut") From 28ae8f04f819ba2993a536ffa0d4b4431911e4e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 5 Jan 2018 18:21:38 +0100 Subject: [PATCH 060/148] MiRCART.py:MiRCARTCanvas.{parentFrame,__init__()}: added for MiRCARTFrame.onCanvasUpdate(). MiRCART.py:MiRCARTCanvas._processMapPatches(): call parentFrame.onCanvasUpdate() given updates. MiRCART.py:MiRCARTCanvas.{re,un}do(): call parentFrame.onCanvasUpdate() given {re,un}do. MiRCART.py:MiRCARTFrame.onCanvasUpdate(): {dis,en}able menuEdit{Re,Un}do on updates. --- MiRCART.py | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index 8d79396..79b0354 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -48,6 +48,7 @@ mircColours = [ class MiRCARTCanvas(wx.Panel): """XXX""" + parentFrame = None canvasPos = canvasSize = canvasWinSize = cellPos = cellSize = None canvasBitmap = canvasMap = canvasTools = None mircBg = mircFg = mircBrushes = mircPens = None @@ -117,6 +118,8 @@ class MiRCARTCanvas(wx.Panel): (atX + patch[0], atY + patch[1], patch[2], patch[3], " "))) self.canvasMap[atY + patch[1]][atX + patch[0]] = [patch[2], patch[3], " "]; self._drawPatch(patch, eventDc, tmpDc, atX, atY) + if len(mapPatch[3]): + self.parentFrame.onCanvasUpdate() # }}} # {{{ getBackgroundColour(): XXX def getBackgroundColour(self): @@ -179,6 +182,7 @@ class MiRCARTCanvas(wx.Panel): eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); tmpDc.SelectObject(self.canvasBitmap) self._drawPatch(redoPatch, eventDc, tmpDc, 0, 0) + self.parentFrame.onCanvasUpdate() return True else: return False @@ -193,12 +197,14 @@ class MiRCARTCanvas(wx.Panel): tmpDc.SelectObject(self.canvasBitmap) self._drawPatch(undoPatch, eventDc, tmpDc, 0, 0) self.patchesUndoLevel += 1 + self.parentFrame.onCanvasUpdate() return True else: return False # }}} # {{{ Initialisation method - def __init__(self, parent, canvasPos, cellSize, canvasSize, canvasTools): + def __init__(self, parent, parentFrame, canvasPos, cellSize, canvasSize, canvasTools): + self.parentFrame = parentFrame canvasWinSize = (cellSize[0] * canvasSize[0], cellSize[1] * canvasSize[1]) super().__init__(parent, pos=canvasPos, size=canvasWinSize) self.canvasPos = canvasPos; self.canvasSize = canvasSize; self.canvasWinSize = canvasWinSize; @@ -346,6 +352,17 @@ class MiRCARTFrame(wx.Frame): def onAccelUndo(self, event): self.panelCanvas.undo() # }}} + # {{{ onCanvasUpdate(): XXX + def onCanvasUpdate(self): + if self.panelCanvas.patchesUndo[self.panelCanvas.patchesUndoLevel] != None: + self.menuEditUndo.Enable(True) + else: + self.menuEditUndo.Enable(False) + if self.panelCanvas.patchesUndoLevel > 0: + self.menuEditRedo.Enable(True) + else: + self.menuEditRedo.Enable(False) + # }}} # {{{ onEditCopy(): XXX def onEditCopy(self, event): pass @@ -433,6 +450,11 @@ class MiRCARTFrame(wx.Frame): except IOError as error: wx.LogError("IOError {}".format(error)) # }}} + # {{{ onPaletteEvent(): XXX + def onPaletteEvent(self, leftDown, rightDown, numColour): + self.panelCanvas.onPaletteEvent(leftDown, rightDown, numColour) + self._updateStatusBar() + # }}} # {{{ onToolsRect(): XXX def onToolsRect(self, event): pass @@ -445,20 +467,15 @@ class MiRCARTFrame(wx.Frame): def onToolsLine(self, event): pass # }}} - # {{{ onPaletteEvent(): XXX - def onPaletteEvent(self, leftDown, rightDown, numColour): - self.panelCanvas.onPaletteEvent(leftDown, rightDown, numColour) - self._updateStatusBar() - # }}} # {{{ Initialisation method def __init__(self, parent, appSize=(800, 600), canvasPos=(25, 25), cellSize=(7, 14), canvasSize=(80, 25)): super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) self.panelSkin = wx.Panel(self, wx.ID_ANY) - self.panelCanvas = MiRCARTCanvas(self.panelSkin, \ - canvasPos=canvasPos, cellSize=cellSize, \ + self.panelCanvas = MiRCARTCanvas(self.panelSkin, \ + parentFrame=self, canvasPos=canvasPos, cellSize=cellSize, \ canvasSize=canvasSize, canvasTools=[MiRCARTToolRect]) - self.panelPalette = MiRCARTPalette(self.panelSkin, \ + self.panelPalette = MiRCARTPalette(self.panelSkin, \ (25, (canvasSize[1] + 3) * cellSize[1]), cellSize, self.onPaletteEvent) self.menuFile = wx.Menu() From 55381cf57b8dba0fd614180f5a1ac5f8bc1ff526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 5 Jan 2018 18:27:01 +0100 Subject: [PATCH 061/148] MiRCART.py:MiRCARTFrame.__init__(): update File menu titles to "Export to Pasteb&in..." and "Export as PN&G...". --- MiRCART.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index 79b0354..23a3cb9 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -488,9 +488,9 @@ class MiRCARTFrame(wx.Frame): self.menuFileSaveAs = self.menuFile.Append(wx.ID_SAVEAS, "Save &As...", "Save As...") self.Bind(wx.EVT_MENU, self.onFileSaveAs, self.menuFileSaveAs) self.menuFile.AppendSeparator() - self.menuFileExportPastebin = self.menuFile.Append(wx.NewId(), "Export to &Pastebin...", "Export to Pastebin...") + self.menuFileExportPastebin = self.menuFile.Append(wx.NewId(), "Export to Pasteb&in...", "Export to Pastebin...") self.Bind(wx.EVT_MENU, self.onFileExportPastebin, self.menuFileExportPastebin) - self.menuFileExportPng = self.menuFile.Append(wx.NewId(), "Export as &PNG...", "Export as PNG...") + self.menuFileExportPng = self.menuFile.Append(wx.NewId(), "Export as PN&G...", "Export as PNG...") self.Bind(wx.EVT_MENU, self.onFileExportPng, self.menuFileExportPng) self.menuFile.AppendSeparator() self.menuFileExit = self.menuFile.Append(wx.ID_EXIT, "E&xit", "Exit") From 703aa2c388c4a063da9a3993087996bddf1bef9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 5 Jan 2018 20:45:21 +0100 Subject: [PATCH 062/148] MiRCART.py:MiRCARTPalette, MiRCARTFrame.panelPalette: replaced w/ toolbar items. MiRCART.py:MiRCARTFrame.toolBar*: added. MiRCART.py:MiRCARTFrame.onToolColour{Bg,Fg}(): hand off to onPaletteEvent(). MiRCART.py:MiRCARTFrame.__init__(): create & initialise toolbar. --- MiRCART.py | 134 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 96 insertions(+), 38 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index 23a3cb9..fe2ef01 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -288,38 +288,6 @@ class MiRCARTToolRect(MiRCARTTool): super().__init__(parentCanvas) # }}} -class MiRCARTPalette(wx.Panel): - """XXX""" - panelsByColour = onPaletteEvent = None - - # {{{ onLeftDown(): XXX - def onLeftDown(self, event): - numColour = int(event.GetEventObject().GetName()) - self.onPaletteEvent(True, False, numColour) - # }}} - # {{{ onRightDown(): XXX - def onRightDown(self, event): - numColour = int(event.GetEventObject().GetName()) - self.onPaletteEvent(False, True, numColour) - # }}} - # {{{ Initialisation method - def __init__(self, parent, parentPos, cellSize, onPaletteEvent): - panelSizeW = 6 * cellSize[0]; panelSizeH = 2 * cellSize[1]; - paletteSize = (panelSizeW * 16, panelSizeH) - super().__init__(parent, pos=parentPos, size=paletteSize) - self.panelsByColour = [None] * len(mircColours) - for numColour in range(0, len(mircColours)): - posX = (numColour * (cellSize[0] * 6)) - self.panelsByColour[numColour] = wx.Panel(self, \ - pos=(posX, 0), size=(panelSizeW, panelSizeH)) - self.panelsByColour[numColour].SetBackgroundColour( \ - wx.Colour(mircColours[numColour])) - self.panelsByColour[numColour].Bind(wx.EVT_LEFT_DOWN, self.onLeftDown) - self.panelsByColour[numColour].Bind(wx.EVT_RIGHT_DOWN, self.onRightDown) - self.panelsByColour[numColour].SetName(str(numColour)) - self.onPaletteEvent = onPaletteEvent - # }}} - class MiRCARTFrame(wx.Frame): """XXX""" menuFile = None @@ -332,7 +300,14 @@ class MiRCARTFrame(wx.Frame): menuEditDecrBrush = menuEditIncrBrush = menuEditSolidBrush = None menuTools = menuToolsCircle = menuToolsLine = menuToolsRect = None menuBar = None - panelSkin = panelCanvas = panelPalette = None + panelSkin = panelCanvas = None + toolBar = None + toolBarIdNew = toolBarIdOpen = toolBarIdSave = toolBarIdSaveAs = None + toolBarIdUndo = toolBarIdRedo = None + toolBarIdCut = toolBarIdCopy = toolBarIdPaste = toolBarIdDelete = None + toolBarIdIncrBrush = toolBarIdDecrBrush = toolBarIdSolidBrush = None + toolBarIdRect = toolBarIdCircle = toolBarIdLine = None + toolBarIdColours = toolBarBitmapColours = None accelRedoId = accelUndoId = accelTable = statusBar = None # {{{ _updateStatusBar(): XXX @@ -455,6 +430,20 @@ class MiRCARTFrame(wx.Frame): self.panelCanvas.onPaletteEvent(leftDown, rightDown, numColour) self._updateStatusBar() # }}} + # {{{ onToolColourBg(): XXX + def onToolColourBg(self, event): + itemId = event.GetId() + for numColour in range(0, len(mircColours)): + if self.toolBarIdColours[numColour] == itemId: + self.onPaletteEvent(False, True, numColour) + # }}} + # {{{ onToolColourFg(): XXX + def onToolColourFg(self, event): + itemId = event.GetId() + for numColour in range(0, len(mircColours)): + if self.toolBarIdColours[numColour] == itemId: + self.onPaletteEvent(True, False, numColour) + # }}} # {{{ onToolsRect(): XXX def onToolsRect(self, event): pass @@ -468,15 +457,13 @@ class MiRCARTFrame(wx.Frame): pass # }}} # {{{ Initialisation method - def __init__(self, parent, appSize=(800, 600), canvasPos=(25, 25), cellSize=(7, 14), canvasSize=(80, 25)): + def __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), cellSize=(7, 14), canvasSize=(80, 25)): super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) self.panelSkin = wx.Panel(self, wx.ID_ANY) - self.panelCanvas = MiRCARTCanvas(self.panelSkin, \ - parentFrame=self, canvasPos=canvasPos, cellSize=cellSize, \ + self.panelCanvas = MiRCARTCanvas(self.panelSkin, \ + parentFrame=self, canvasPos=canvasPos, cellSize=cellSize, \ canvasSize=canvasSize, canvasTools=[MiRCARTToolRect]) - self.panelPalette = MiRCARTPalette(self.panelSkin, \ - (25, (canvasSize[1] + 3) * cellSize[1]), cellSize, self.onPaletteEvent) self.menuFile = wx.Menu() self.menuFileNew = self.menuFile.Append(wx.ID_NEW, "&New", "New") @@ -547,6 +534,77 @@ class MiRCARTFrame(wx.Frame): self.statusBar = self.CreateStatusBar() self._updateStatusBar() + self.toolBar = wx.ToolBar(self.panelSkin, -1, style=wx.HORIZONTAL|wx.TB_FLAT|wx.TB_NODIVIDER) + self.toolBar.SetToolBitmapSize((16,16)) + self.toolNew = self.toolBar.AddTool(wx.NewId(), "New", \ + wx.ArtProvider.GetBitmap(wx.ART_NEW, wx.ART_TOOLBAR, (16,16))) + self.Bind(wx.EVT_TOOL, self.onFileNew, self.toolNew) + self.toolOpen = self.toolBar.AddTool(wx.NewId(), "Open", \ + wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOLBAR, (16,16))) + self.Bind(wx.EVT_TOOL, self.onFileOpen, self.toolOpen) + self.toolSave = self.toolBar.AddTool(wx.NewId(), "Save", \ + wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE, wx.ART_TOOLBAR, (16,16))) + self.Bind(wx.EVT_TOOL, self.onFileSave, self.toolSave) + self.toolSaveAs = self.toolBar.AddTool(wx.NewId(), "Save As...", \ + wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE_AS, wx.ART_TOOLBAR, (16,16))) + self.Bind(wx.EVT_TOOL, self.onFileSaveAs, self.toolSaveAs) + self.toolUndo = self.toolBar.AddTool(wx.NewId(), "Undo", \ + wx.ArtProvider.GetBitmap(wx.ART_UNDO, wx.ART_TOOLBAR, (16,16))) + self.Bind(wx.EVT_TOOL, self.onEditUndo, self.toolUndo) + self.toolRedo = self.toolBar.AddTool(wx.NewId(), "Redo", \ + wx.ArtProvider.GetBitmap(wx.ART_REDO, wx.ART_TOOLBAR, (16,16))) + self.Bind(wx.EVT_TOOL, self.onEditRedo, self.toolRedo) + self.toolBar.AddSeparator() + self.toolCut = self.toolBar.AddTool(wx.NewId(), "Cut", \ + wx.ArtProvider.GetBitmap(wx.ART_CUT, wx.ART_TOOLBAR, (16,16))) + self.Bind(wx.EVT_TOOL, self.onEditCut, self.toolCut) + self.toolCopy = self.toolBar.AddTool(wx.NewId(), "Copy", \ + wx.ArtProvider.GetBitmap(wx.ART_COPY, wx.ART_TOOLBAR, (16,16))) + self.Bind(wx.EVT_TOOL, self.onEditCopy, self.toolCopy) + self.toolPaste = self.toolBar.AddTool(wx.NewId(), "Paste", \ + wx.ArtProvider.GetBitmap(wx.ART_PASTE, wx.ART_TOOLBAR, (16,16))) + self.Bind(wx.EVT_TOOL, self.onEditPaste, self.toolPaste) + self.toolDelete = self.toolBar.AddTool(wx.NewId(), "Delete", \ + wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_TOOLBAR, (16,16))) + self.Bind(wx.EVT_TOOL, self.onEditDelete, self.toolDelete) + self.toolBar.AddSeparator() + self.toolIncrBrush = self.toolBar.AddTool(wx.NewId(), "Increase brush size", \ + wx.ArtProvider.GetBitmap(wx.ART_PLUS, wx.ART_TOOLBAR, (16,16))) + self.Bind(wx.EVT_TOOL, self.onEditIncrBrush, self.toolIncrBrush) + self.toolDecrBrush = self.toolBar.AddTool(wx.NewId(), "Decrease brush size", \ + wx.ArtProvider.GetBitmap(wx.ART_MINUS, wx.ART_TOOLBAR, (16,16))) + self.Bind(wx.EVT_TOOL, self.onEditDecrBrush, self.toolDecrBrush) + self.toolSolidBrush = self.toolBar.AddTool(wx.NewId(), "Solid brush", \ + wx.ArtProvider.GetBitmap(wx.ART_HELP, wx.ART_TOOLBAR, (16,16))) + self.Bind(wx.EVT_TOOL, self.onEditSolidBrush, self.toolSolidBrush) + self.toolBar.AddSeparator() + self.toolRect = self.toolBar.AddTool(wx.NewId(), "Rectangle", \ + wx.ArtProvider.GetBitmap(wx.ART_HELP, wx.ART_TOOLBAR, (16,16))) + self.Bind(wx.EVT_TOOL, self.onToolsRect, self.toolRect) + self.toolCircle = self.toolBar.AddTool(wx.NewId(), "Circle", \ + wx.ArtProvider.GetBitmap(wx.ART_HELP, wx.ART_TOOLBAR, (16,16))) + self.Bind(wx.EVT_TOOL, self.onToolsCircle, self.toolCircle) + self.toolLine = self.toolBar.AddTool(wx.NewId(), "Line", \ + wx.ArtProvider.GetBitmap(wx.ART_HELP, wx.ART_TOOLBAR, (16,16))) + self.Bind(wx.EVT_TOOL, self.onToolsLine, self.toolLine) + self.toolBar.AddSeparator() + self.toolBarIdColours = [None for x in range(0, len(mircColours))] + self.toolBarBitmapColours = [None for x in range(0, len(mircColours))] + for numColour in range(0, len(mircColours)): + self.toolBarBitmapColours[numColour] = wx.Bitmap((16,16)) + tmpDc = wx.MemoryDC(); tmpDc.SelectObject(self.toolBarBitmapColours[numColour]); + tmpDc.SetBrush(self.panelCanvas.mircBrushes[numColour]) + tmpDc.SetBackground(self.panelCanvas.mircBrushes[numColour]) + tmpDc.SetPen(self.panelCanvas.mircPens[numColour]) + tmpDc.DrawRectangle(0, 0, 16, 16) + self.toolBarIdColours[numColour] = wx.NewId() + print(self.toolBarIdColours[numColour]) + self.toolBar.AddTool(self.toolBarIdColours[numColour], \ + "mIRC colour #" + str(numColour), self.toolBarBitmapColours[numColour]) + self.Bind(wx.EVT_TOOL, self.onToolColourFg, id=self.toolBarIdColours[numColour]) + self.Bind(wx.EVT_TOOL_RCLICKED, self.onToolColourBg, id=self.toolBarIdColours[numColour]) + self.toolBar.Realize(); self.toolBar.Fit(); + self.SetFocus() self.Show(True) # }}} From 61d53c818c0d291ac62cb2e3fa6c6f7924b33580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 5 Jan 2018 21:15:33 +0100 Subject: [PATCH 063/148] MiRCART.py:MiRCARTFrame.__init__(): remove debugging print(). --- MiRCART.py | 1 - 1 file changed, 1 deletion(-) diff --git a/MiRCART.py b/MiRCART.py index fe2ef01..f49bca5 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -598,7 +598,6 @@ class MiRCARTFrame(wx.Frame): tmpDc.SetPen(self.panelCanvas.mircPens[numColour]) tmpDc.DrawRectangle(0, 0, 16, 16) self.toolBarIdColours[numColour] = wx.NewId() - print(self.toolBarIdColours[numColour]) self.toolBar.AddTool(self.toolBarIdColours[numColour], \ "mIRC colour #" + str(numColour), self.toolBarBitmapColours[numColour]) self.Bind(wx.EVT_TOOL, self.onToolColourFg, id=self.toolBarIdColours[numColour]) From 5350ebd88179efef39147608ec9787210db88aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 5 Jan 2018 21:18:06 +0100 Subject: [PATCH 064/148] README.md, MiRCART.png: added screenshot & WIP/pending cleanup tags. --- MiRCART.png | Bin 0 -> 30019 bytes README.md | 8 +++++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 MiRCART.png diff --git a/MiRCART.png b/MiRCART.png new file mode 100644 index 0000000000000000000000000000000000000000..a803fefefcb79a42a9910309d7d87cb6e6205357 GIT binary patch literal 30019 zcmeIbc|6qX`#@5{2xlj|pjSG(9$1O`a@52m$Dx}+(FvTx*R zNmtlt+Hp7S?$SM5ZLuF47pcijJw9@^uw%KQ*dFS(nv^8Rt=p0PY{xl|6H{nU*Qlu- zRdw#SJ#HMaX{6d?4LNGIH=;TV~5%bEIc#P zmbseqb$q%>Y`@Uea#NGcL$_8^QhHPOJBfO+TMcpU`S98(XL>1bi!|SEp4t_u(_%g) z;{mt9pQJ8ZRbKUayQU%R`j*laDw^eNr(eB1;Exh_w=uZv?nE0@KD0O4U|$TEWNP!? z?OV0(rM+K%NnT%kBHj)>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# MiRCART.py -- mIRC art editor for Windows & Linux (WIP) * Prerequisites on Windows: install Python v3.6.x[1] and wxPython v4.x.x w/ the following elevated command prompt command line: `pip install wxPython` * Prerequisites on Linux: python3 && python-wx{gtk2.8,tools} on Debian-family Linux distributions +* Screenshot: +![Screenshot](https://github.com/lalbornoz/MiRCARTools/raw/master/MiRCART.png "Screenshot") -# IrcMiRCARTBot.py -- IRC<->MiRC2png bot (for EFnet #MiRCART) +# IrcMiRCARTBot.py -- IRC<->MiRC2png bot (for EFnet #MiRCART) (pending cleanup) * Prerequisites: python3 && python3-{json,requests,urllib3} on Debian-family Linux distributions * IrcMiRCARTBot.py usage: IrcMiRCARTBot.py `` [``] [``] [``] [``] [``] -# MiRC2png.py -- convert ASCII w/ mIRC control codes to monospaced PNG +# MiRC2png.py -- convert ASCII w/ mIRC control codes to monospaced PNG (pending cleanup) * Prerequisites: python3 && python3-pil on Debian-family Linux distributions * MiRC2png.py usage: MiRC2png.py `` `` [``] [``] From 845185f9c390e672ac9e6e967af709f7aa230616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sat, 6 Jan 2018 01:23:48 +0100 Subject: [PATCH 065/148] MiRCART.py:MiRCARTFrame: cleaned up. --- MiRCART.py | 517 ++++++++++++++++++++++++----------------------------- 1 file changed, 231 insertions(+), 286 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index f49bca5..a8bd09f 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -22,6 +22,7 @@ # SOFTWARE. # +import enum import wx import os, sys @@ -290,26 +291,164 @@ class MiRCARTToolRect(MiRCARTTool): class MiRCARTFrame(wx.Frame): """XXX""" - menuFile = None - menuFileNew = menuFileOpen = menuFileSave = menuFileSaveAs = None - menuFileExportPastebin = menuFileExportPng = None - menuFileExit = None - menuEdit = None - menuEditRedo = menuEditUndo = None - menuEditCopy = menuEditCut = menuEditDelete = menuEditPaste = None - menuEditDecrBrush = menuEditIncrBrush = menuEditSolidBrush = None - menuTools = menuToolsCircle = menuToolsLine = menuToolsRect = None - menuBar = None panelSkin = panelCanvas = None - toolBar = None - toolBarIdNew = toolBarIdOpen = toolBarIdSave = toolBarIdSaveAs = None - toolBarIdUndo = toolBarIdRedo = None - toolBarIdCut = toolBarIdCopy = toolBarIdPaste = toolBarIdDelete = None - toolBarIdIncrBrush = toolBarIdDecrBrush = toolBarIdSolidBrush = None - toolBarIdRect = toolBarIdCircle = toolBarIdLine = None - toolBarIdColours = toolBarBitmapColours = None - accelRedoId = accelUndoId = accelTable = statusBar = None + menuItemsById = menuBar = toolBar = accelTable = None + statusBar = None + # {{{ Types + TID_COMMAND = (0x001) + TID_NOTHING = (0x002) + TID_MENU = (0x003) + TID_TOOLBAR = (0x004) + TID_ACCELS = (0x005) + # }}} + # {{{ Commands + # Id Type Id Labels Icon bitmap Accelerator + CID_NEW = (0x100, TID_COMMAND, "New", "&New", [wx.ART_NEW], None) + CID_OPEN = (0x101, TID_COMMAND, "Open", "&Open", [wx.ART_FILE_OPEN], None) + CID_SAVE = (0x102, TID_COMMAND, "Save", "&Save", [wx.ART_FILE_SAVE], None) + CID_SAVEAS = (0x103, TID_COMMAND, "Save As...", "Save &As...", [wx.ART_FILE_SAVE_AS], None) + CID_EXPORT_PASTEBIN = (0x104, TID_COMMAND, "Export to Pastebin...", "Export to Pasteb&in...", (), None) + CID_EXPORT_AS_PNG = (0x105, TID_COMMAND, "Export as PNG...", "Export as PN&G...", (), None) + CID_EXIT = (0x106, TID_COMMAND, "Exit", "E&xit", (), None) + CID_UNDO = (0x107, TID_COMMAND, "Undo", "&Undo", [wx.ART_UNDO], (wx.ACCEL_CTRL, ord("Z"))) + CID_REDO = (0x108, TID_COMMAND, "Redo", "&Redo", [wx.ART_REDO], (wx.ACCEL_CTRL, ord("Y"))) + CID_CUT = (0x109, TID_COMMAND, "Cut", "Cu&t", [wx.ART_CUT], None) + CID_COPY = (0x10a, TID_COMMAND, "Copy", "&Copy", [wx.ART_COPY], None) + CID_PASTE = (0x10b, TID_COMMAND, "Paste", "&Paste", [wx.ART_PASTE], None) + CID_DELETE = (0x10c, TID_COMMAND, "Delete", "De&lete", [wx.ART_DELETE], None) + CID_INCRBRUSH = (0x10d, TID_COMMAND, "Increase brush size", "&Increase brush size", [wx.ART_PLUS], None) + CID_DECRBRUSH = (0x10e, TID_COMMAND, "Decrease brush size", "&Decrease brush size", [wx.ART_MINUS], None) + CID_SOLIDBRUSH = (0x10f, TID_COMMAND, "Solid brush", "&Solid brush", [None], None) + CID_RECT = (0x110, TID_COMMAND, "Rectangle", "&Rectangle", [None], None) + CID_CIRCLE = (0x111, TID_COMMAND, "Circle", "&Circle", [None], None) + CID_LINE = (0x112, TID_COMMAND, "Line", "&Line", [None], None) + CID_COLOUR00 = (0x113, TID_COMMAND, "Colour #00", "Colour #00", mircColours[0], None) + CID_COLOUR01 = (0x114, TID_COMMAND, "Colour #01", "Colour #01", mircColours[1], None) + CID_COLOUR02 = (0x115, TID_COMMAND, "Colour #02", "Colour #02", mircColours[2], None) + CID_COLOUR03 = (0x116, TID_COMMAND, "Colour #03", "Colour #03", mircColours[3], None) + CID_COLOUR04 = (0x117, TID_COMMAND, "Colour #04", "Colour #04", mircColours[4], None) + CID_COLOUR05 = (0x118, TID_COMMAND, "Colour #05", "Colour #05", mircColours[5], None) + CID_COLOUR06 = (0x119, TID_COMMAND, "Colour #06", "Colour #06", mircColours[6], None) + CID_COLOUR07 = (0x11a, TID_COMMAND, "Colour #07", "Colour #07", mircColours[7], None) + CID_COLOUR08 = (0x11b, TID_COMMAND, "Colour #08", "Colour #08", mircColours[8], None) + CID_COLOUR09 = (0x11c, TID_COMMAND, "Colour #09", "Colour #09", mircColours[9], None) + CID_COLOUR10 = (0x11d, TID_COMMAND, "Colour #10", "Colour #10", mircColours[10], None) + CID_COLOUR11 = (0x11e, TID_COMMAND, "Colour #11", "Colour #11", mircColours[11], None) + CID_COLOUR12 = (0x11f, TID_COMMAND, "Colour #12", "Colour #12", mircColours[12], None) + CID_COLOUR13 = (0x120, TID_COMMAND, "Colour #13", "Colour #13", mircColours[13], None) + CID_COLOUR14 = (0x121, TID_COMMAND, "Colour #14", "Colour #14", mircColours[14], None) + CID_COLOUR15 = (0x122, TID_COMMAND, "Colour #15", "Colour #15", mircColours[15], None) + # }}} + # {{{ Non-items + NID_MENU_SEP = (0x200, TID_NOTHING) + NID_TOOLBAR_SEP = (0x201, TID_NOTHING) + # }}} + # {{{ Menus + MID_FILE = (0x300, TID_MENU, "File", "&File", ( \ + CID_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_MENU_SEP, \ + CID_EXPORT_PASTEBIN, CID_EXPORT_AS_PNG, NID_MENU_SEP, \ + CID_EXIT)) + MID_EDIT = (0x301, TID_MENU, "Edit", "&Edit", ( \ + CID_UNDO, CID_REDO, NID_MENU_SEP, \ + CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_MENU_SEP, \ + CID_INCRBRUSH, CID_DECRBRUSH, CID_SOLIDBRUSH)) + MID_TOOLS = (0x302, TID_MENU, "Tools", "&Tools", ( \ + CID_RECT, CID_CIRCLE, CID_LINE)) + # }}} + # {{{ Toolbars + BID_TOOLBAR = (0x400, TID_TOOLBAR, ( \ + CID_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_TOOLBAR_SEP, \ + CID_UNDO, CID_REDO, NID_TOOLBAR_SEP, \ + CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_TOOLBAR_SEP, \ + CID_INCRBRUSH, CID_DECRBRUSH, CID_SOLIDBRUSH, NID_TOOLBAR_SEP, \ + CID_RECT, CID_CIRCLE, CID_LINE, NID_TOOLBAR_SEP, \ + CID_COLOUR00, CID_COLOUR01, CID_COLOUR02, CID_COLOUR03, CID_COLOUR04, \ + CID_COLOUR05, CID_COLOUR06, CID_COLOUR07, CID_COLOUR08, CID_COLOUR09, \ + CID_COLOUR10, CID_COLOUR11, CID_COLOUR12, CID_COLOUR13, CID_COLOUR14, \ + CID_COLOUR15)) + # }}} + # {{{ Accelerators (hotkeys) + AID_EDIT = (0x500, TID_ACCELS, (CID_UNDO, CID_REDO)) + # }}} + + # {{{ _drawIcon(): XXX + def _drawIcon(self, solidColour): + iconBitmap = wx.Bitmap((16,16)) + iconDc = wx.MemoryDC(); iconDc.SelectObject(iconBitmap); + iconBrush = wx.Brush(wx.Colour(solidColour), wx.BRUSHSTYLE_SOLID) + iconDc.SetBrush(iconBrush); iconDc.SetBackground(iconBrush); + iconDc.SetPen(wx.Pen(wx.Colour(solidColour), 1)) + iconDc.DrawRectangle(0, 0, 16, 16) + return iconBitmap + # }}} + # {{{ _initAccelTable(): XXX + def _initAccelTable(self, accelsDescr, handler): + accelTableEntries = [wx.AcceleratorEntry() for n in range(0, len(accelsDescr[2]))] + for numAccel in range(0, len(accelsDescr[2])): + accelDescr = accelsDescr[2][numAccel] + if accelDescr[5] != None: + accelTableEntries[numAccel].Set(accelDescr[5][0], accelDescr[5][1], accelDescr[0]) + self.Bind(wx.EVT_MENU, handler, id=accelDescr[0]) + return accelTableEntries + # }}} + # {{{ _initMenus(): XXX + def _initMenus(self, menuBar, menusDescr, handler): + for menuDescr in menusDescr: + menuWindow = wx.Menu() + for menuItem in menuDescr[4]: + if menuItem == self.NID_MENU_SEP: + menuWindow.AppendSeparator() + else: + menuItemWindow = menuWindow.Append(menuItem[0], menuItem[3], menuItem[2]) + self.menuItemsById[menuItem[0]] = menuItemWindow + self.Bind(wx.EVT_MENU, handler, menuItemWindow) + menuBar.Append(menuWindow, menuDescr[3]) + # }}} + # {{{ _initToolBars(): XXX + def _initToolBars(self, toolBar, toolBarsDescr, handler): + for toolBarDescr in toolBarsDescr: + for toolBarItem in toolBarDescr[2]: + if toolBarItem == self.NID_TOOLBAR_SEP: + toolBar.AddSeparator() + else: + if len(toolBarItem[4]) == 4: + toolBarItemIcon = self._drawIcon(toolBarItem[4]) + elif len(toolBarItem[4]) == 1 \ + and toolBarItem[4][0] != None: + toolBarItemIcon = wx.ArtProvider.GetBitmap( \ + toolBarItem[4][0], wx.ART_TOOLBAR, (16,16)) + else: + toolBarItemIcon = wx.ArtProvider.GetBitmap( \ + wx.ART_HELP, wx.ART_TOOLBAR, (16,16)) + toolBarItemWindow = self.toolBar.AddTool( \ + toolBarItem[0], toolBarItem[2], toolBarItemIcon) + self.Bind(wx.EVT_TOOL, handler, toolBarItemWindow) + self.Bind(wx.EVT_TOOL_RCLICKED, handler, toolBarItemWindow) + # }}} + # {{{ _saveAs(): XXX + def _saveAs(self, pathName): + try: + with open(pathName, "w") as file: + canvasMap = self.panelCanvas.getMap() + canvasHeight = self.panelCanvas.getHeight() + canvasWidth = self.panelCanvas.getWidth() + for canvasRow in range(0, canvasHeight): + colourLastBg = colourLastFg = None; + for canvasCol in range(0, canvasWidth): + canvasColBg = canvasMap[canvasRow][canvasCol][0] + canvasColFg = canvasMap[canvasRow][canvasCol][1] + canvasColText = canvasMap[canvasRow][canvasCol][2] + if colourLastBg != canvasColBg \ + or colourLastFg != canvasColFg: + colourLastBg = canvasColBg; colourLastFg = canvasColFg; + file.write("" + str(canvasColFg) + "," + str(canvasColBg)) + file.write(canvasColText) + file.write("\n") + return [True] + except IOError as error: + return [False, error] + # }}} # {{{ _updateStatusBar(): XXX def _updateStatusBar(self): text = "Foreground colour:" @@ -319,293 +458,99 @@ class MiRCARTFrame(wx.Frame): text += " " + str(self.panelCanvas.getBackgroundColour()) self.statusBar.SetStatusText(text) # }}} - # {{{ onAccelRedo(): XXX - def onAccelRedo(self, event): - self.panelCanvas.redo() - # }}} - # {{{ onAccelUndo(): XXX - def onAccelUndo(self, event): - self.panelCanvas.undo() - # }}} + # {{{ onCanvasUpdate(): XXX def onCanvasUpdate(self): if self.panelCanvas.patchesUndo[self.panelCanvas.patchesUndoLevel] != None: - self.menuEditUndo.Enable(True) + self.menuItemsById[self.CID_UNDO[0]].Enable(True) else: - self.menuEditUndo.Enable(False) + self.menuItemsById[self.CID_UNDO[0]].Enable(False) if self.panelCanvas.patchesUndoLevel > 0: - self.menuEditRedo.Enable(True) + self.menuItemsById[self.CID_REDO[0]].Enable(True) else: - self.menuEditRedo.Enable(False) + self.menuItemsById[self.CID_REDO[0]].Enable(False) # }}} - # {{{ onEditCopy(): XXX - def onEditCopy(self, event): - pass - # }}} - # {{{ onEditCut(): XXX - def onEditCut(self, event): - pass - # }}} - # {{{ onEditDecrBrush(): XXX - def onEditDecrBrush(self, event): - pass - # }}} - # {{{ onEditDelete(): XXX - def onEditDelete(self, event): - pass - # }}} - # {{{ onEditIncrBrush(): XXX - def onEditIncrBrush(self, event): - pass - # }}} - # {{{ onEditPaste(): XXX - def onEditPaste(self, event): - pass - # }}} - # {{{ onEditRedo(): XXX - def onEditRedo(self, event): - self.panelCanvas.redo() - # }}} - # {{{ onEditSolidBrush(): XXX - def onEditSolidBrush(self, event): - pass - # }}} - # {{{ onEditUndo(): XXX - def onEditUndo(self, event): - self.panelCanvas.undo() - # }}} - # {{{ onFileExit(): XXX - def onFileExit(self, event): - self.Close(True) - # }}} - # {{{ onFileExportPastebin(): XXX - def onFileExportPastebin(self, event): - pass - # }}} - # {{{ onFileExportPng(): XXX - def onFileExportPng(self, event): - pass - # }}} - # {{{ onFileNew(): XXX - def onFileNew(self, event): - pass - # }}} - # {{{ onFileOpen(): XXX - def onFileOpen(self, event): - pass - # }}} - # {{{ onFileSave(): XXX - def onFileSave(self, event): - pass - # }}} - # {{{ onFileSaveAs(): XXX - def onFileSaveAs(self, event): - with wx.FileDialog(self, "Save As...", os.getcwd(), "", \ - "*.txt", wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) as dialog: - if dialog.ShowModal() == wx.ID_CANCEL: - return - else: - try: - with open(dialog.GetPath(), "w") as file: - canvasMap = self.panelCanvas.getMap() - canvasHeight = self.panelCanvas.getHeight() - canvasWidth = self.panelCanvas.getWidth() - for canvasRow in range(0, canvasHeight): - colourLastBg = colourLastFg = None; - for canvasCol in range(0, canvasWidth): - canvasColBg = canvasMap[canvasRow][canvasCol][0] - canvasColFg = canvasMap[canvasRow][canvasCol][1] - canvasColText = canvasMap[canvasRow][canvasCol][2] - if colourLastBg != canvasColBg \ - or colourLastFg != canvasColFg: - colourLastBg = canvasColBg; colourLastFg = canvasColFg; - file.write("" + str(canvasColFg) + "," + str(canvasColBg)) - file.write(canvasColText) - file.write("\n") - except IOError as error: - wx.LogError("IOError {}".format(error)) - # }}} - # {{{ onPaletteEvent(): XXX - def onPaletteEvent(self, leftDown, rightDown, numColour): - self.panelCanvas.onPaletteEvent(leftDown, rightDown, numColour) - self._updateStatusBar() - # }}} - # {{{ onToolColourBg(): XXX - def onToolColourBg(self, event): - itemId = event.GetId() - for numColour in range(0, len(mircColours)): - if self.toolBarIdColours[numColour] == itemId: - self.onPaletteEvent(False, True, numColour) - # }}} - # {{{ onToolColourFg(): XXX - def onToolColourFg(self, event): - itemId = event.GetId() - for numColour in range(0, len(mircColours)): - if self.toolBarIdColours[numColour] == itemId: - self.onPaletteEvent(True, False, numColour) - # }}} - # {{{ onToolsRect(): XXX - def onToolsRect(self, event): - pass - # }}} - # {{{ onToolsCircle(): XXX - def onToolsCircle(self, event): - pass - # }}} - # {{{ onToolsLine(): XXX - def onToolsLine(self, event): - pass + # {{{ onFrameCommand(): XXX + def onFrameCommand(self, event): + cid = event.GetId() + if cid == self.CID_NEW[0]: + pass + elif cid == self.CID_OPEN[0]: + pass + elif cid == self.CID_SAVE[0]: + pass + elif cid == self.CID_SAVEAS[0]: + with wx.FileDialog(self, self.CID_SAVEAS[2], os.getcwd(), "", \ + "*.txt", wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) as dialog: + if dialog.ShowModal() == wx.ID_CANCEL: + return + else: + self._saveAs(dialog.GetPath()) + elif cid == self.CID_EXPORT_PASTEBIN[0]: + pass + elif cid == self.CID_EXPORT_AS_PNG[0]: + pass + elif cid == self.CID_EXIT[0]: + self.Close(True) + elif cid == self.CID_UNDO[0]: + self.panelCanvas.undo() + elif cid == self.CID_REDO[0]: + self.panelCanvas.redo() + elif cid == self.CID_CUT[0]: + pass + elif cid == self.CID_COPY[0]: + pass + elif cid == self.CID_PASTE[0]: + pass + elif cid == self.CID_DELETE[0]: + pass + elif cid == self.CID_INCRBRUSH[0]: + pass + elif cid == self.CID_DECRBRUSH[0]: + pass + elif cid == self.CID_SOLIDBRUSH[0]: + pass + elif cid == self.CID_RECT[0]: + pass + elif cid == self.CID_CIRCLE[0]: + pass + elif cid == self.CID_LINE[0]: + pass + elif cid >= self.CID_COLOUR00[0] \ + and cid <= self.CID_COLOUR15[0]: + if event.GetEventType() == wx.wxEVT_TOOL: + leftIsDown = True; rightIsDown = False; + elif event.GetEventType() == wx.wxEVT_TOOL_RCLICKED: + leftIsDown = False; rightIsDown = True; + numColour = cid - self.CID_COLOUR00[0] + self.panelCanvas.onPaletteEvent(leftIsDown, rightIsDown, numColour) + self._updateStatusBar() # }}} # {{{ Initialisation method def __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), cellSize=(7, 14), canvasSize=(80, 25)): super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) - self.panelSkin = wx.Panel(self, wx.ID_ANY) - self.panelCanvas = MiRCARTCanvas(self.panelSkin, \ - parentFrame=self, canvasPos=canvasPos, cellSize=cellSize, \ + self.panelCanvas = MiRCARTCanvas(self.panelSkin, \ + parentFrame=self, canvasPos=canvasPos, cellSize=cellSize, \ canvasSize=canvasSize, canvasTools=[MiRCARTToolRect]) - self.menuFile = wx.Menu() - self.menuFileNew = self.menuFile.Append(wx.ID_NEW, "&New", "New") - self.Bind(wx.EVT_MENU, self.onFileNew, self.menuFileNew) - self.menuFileOpen = self.menuFile.Append(wx.ID_OPEN, "&Open...", "Open...") - self.Bind(wx.EVT_MENU, self.onFileOpen, self.menuFileOpen) - self.menuFileSave = self.menuFile.Append(wx.ID_SAVE, "&Save", "Save") - self.Bind(wx.EVT_MENU, self.onFileSave, self.menuFileSave) - self.menuFileSaveAs = self.menuFile.Append(wx.ID_SAVEAS, "Save &As...", "Save As...") - self.Bind(wx.EVT_MENU, self.onFileSaveAs, self.menuFileSaveAs) - self.menuFile.AppendSeparator() - self.menuFileExportPastebin = self.menuFile.Append(wx.NewId(), "Export to Pasteb&in...", "Export to Pastebin...") - self.Bind(wx.EVT_MENU, self.onFileExportPastebin, self.menuFileExportPastebin) - self.menuFileExportPng = self.menuFile.Append(wx.NewId(), "Export as PN&G...", "Export as PNG...") - self.Bind(wx.EVT_MENU, self.onFileExportPng, self.menuFileExportPng) - self.menuFile.AppendSeparator() - self.menuFileExit = self.menuFile.Append(wx.ID_EXIT, "E&xit", "Exit") - self.Bind(wx.EVT_MENU, self.onFileExit, self.menuFileExit) - - self.menuEdit = wx.Menu() - self.menuEditUndo = self.menuEdit.Append(wx.ID_UNDO, "&Undo", "Undo") - self.menuEditUndo.Enable(False) - self.Bind(wx.EVT_MENU, self.onEditUndo, self.menuEditUndo) - self.menuEditRedo = self.menuEdit.Append(wx.ID_REDO, "&Redo", "Redo") - self.menuEditRedo.Enable(False) - self.Bind(wx.EVT_MENU, self.onEditRedo, self.menuEditRedo) - self.menuEdit.AppendSeparator() - self.menuEditCut = self.menuEdit.Append(wx.ID_CUT, "Cu&t", "Cut") - self.Bind(wx.EVT_MENU, self.onEditCut, self.menuEditCut) - self.menuEditCopy = self.menuEdit.Append(wx.ID_COPY, "&Copy", "Copy") - self.Bind(wx.EVT_MENU, self.onEditCopy, self.menuEditCopy) - self.menuEditPaste = self.menuEdit.Append(wx.ID_PASTE, "&Paste", "Paste") - self.Bind(wx.EVT_MENU, self.onEditPaste, self.menuEditPaste) - self.menuEditDelete = self.menuEdit.Append(wx.ID_DELETE, "De&lete", "Delete") - self.Bind(wx.EVT_MENU, self.onEditDelete, self.menuEditDelete) - self.menuEdit.AppendSeparator() - self.menuEditIncrBrush = self.menuEdit.Append(wx.NewId(), "&Increase brush size", "Increase brush size") - self.Bind(wx.EVT_MENU, self.onEditIncrBrush, self.menuEditIncrBrush) - self.menuEditDecrBrush = self.menuEdit.Append(wx.NewId(), "&Decrease brush size", "Decrease brush size") - self.Bind(wx.EVT_MENU, self.onEditDecrBrush, self.menuEditDecrBrush) - self.menuEditSolidBrush = self.menuEdit.AppendRadioItem(wx.NewId(), "&Solid brush", "Solid brush") - self.Bind(wx.EVT_MENU, self.onEditSolidBrush, self.menuEditSolidBrush) - - self.menuTools = wx.Menu() - self.menuToolsRect = self.menuTools.AppendRadioItem(wx.NewId(), "&Rectangle", "Rectangle") - self.Bind(wx.EVT_MENU, self.onToolsRect, self.menuToolsRect) - self.menuToolsCircle = self.menuTools.AppendRadioItem(wx.NewId(), "&Circle", "Circle") - self.Bind(wx.EVT_MENU, self.onToolsCircle, self.menuToolsCircle) - self.menuToolsLine = self.menuTools.AppendRadioItem(wx.NewId(), "&Line", "Line") - self.Bind(wx.EVT_MENU, self.onToolsLine, self.menuToolsLine) - - self.menuBar = wx.MenuBar() - self.menuBar.Append(self.menuFile, "&File") - self.menuBar.Append(self.menuEdit, "&Edit") - self.menuBar.Append(self.menuTools, "&Tools") + self.menuItemsById = {}; self.menuBar = wx.MenuBar(); + self._initMenus(self.menuBar, \ + [self.MID_FILE, self.MID_EDIT, self.MID_TOOLS], self.onFrameCommand) self.SetMenuBar(self.menuBar) - accelTableEntries = [wx.AcceleratorEntry() for n in range(2)] - self.accelRedoId = wx.NewId() - accelTableEntries[0].Set(wx.ACCEL_CTRL, ord('Y'), self.accelRedoId) - self.Bind(wx.EVT_MENU, self.onAccelRedo, id=self.accelRedoId) - self.accelUndoId = wx.NewId() - accelTableEntries[1].Set(wx.ACCEL_CTRL, ord('Z'), self.accelUndoId) - self.Bind(wx.EVT_MENU, self.onAccelUndo, id=self.accelUndoId) - self.accelTable = wx.AcceleratorTable(accelTableEntries) - self.SetAcceleratorTable(self.accelTable) - - self.statusBar = self.CreateStatusBar() - self._updateStatusBar() - - self.toolBar = wx.ToolBar(self.panelSkin, -1, style=wx.HORIZONTAL|wx.TB_FLAT|wx.TB_NODIVIDER) + self.toolBar = wx.ToolBar(self.panelSkin, -1, \ + style=wx.HORIZONTAL|wx.TB_FLAT|wx.TB_NODIVIDER) self.toolBar.SetToolBitmapSize((16,16)) - self.toolNew = self.toolBar.AddTool(wx.NewId(), "New", \ - wx.ArtProvider.GetBitmap(wx.ART_NEW, wx.ART_TOOLBAR, (16,16))) - self.Bind(wx.EVT_TOOL, self.onFileNew, self.toolNew) - self.toolOpen = self.toolBar.AddTool(wx.NewId(), "Open", \ - wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOLBAR, (16,16))) - self.Bind(wx.EVT_TOOL, self.onFileOpen, self.toolOpen) - self.toolSave = self.toolBar.AddTool(wx.NewId(), "Save", \ - wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE, wx.ART_TOOLBAR, (16,16))) - self.Bind(wx.EVT_TOOL, self.onFileSave, self.toolSave) - self.toolSaveAs = self.toolBar.AddTool(wx.NewId(), "Save As...", \ - wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE_AS, wx.ART_TOOLBAR, (16,16))) - self.Bind(wx.EVT_TOOL, self.onFileSaveAs, self.toolSaveAs) - self.toolUndo = self.toolBar.AddTool(wx.NewId(), "Undo", \ - wx.ArtProvider.GetBitmap(wx.ART_UNDO, wx.ART_TOOLBAR, (16,16))) - self.Bind(wx.EVT_TOOL, self.onEditUndo, self.toolUndo) - self.toolRedo = self.toolBar.AddTool(wx.NewId(), "Redo", \ - wx.ArtProvider.GetBitmap(wx.ART_REDO, wx.ART_TOOLBAR, (16,16))) - self.Bind(wx.EVT_TOOL, self.onEditRedo, self.toolRedo) - self.toolBar.AddSeparator() - self.toolCut = self.toolBar.AddTool(wx.NewId(), "Cut", \ - wx.ArtProvider.GetBitmap(wx.ART_CUT, wx.ART_TOOLBAR, (16,16))) - self.Bind(wx.EVT_TOOL, self.onEditCut, self.toolCut) - self.toolCopy = self.toolBar.AddTool(wx.NewId(), "Copy", \ - wx.ArtProvider.GetBitmap(wx.ART_COPY, wx.ART_TOOLBAR, (16,16))) - self.Bind(wx.EVT_TOOL, self.onEditCopy, self.toolCopy) - self.toolPaste = self.toolBar.AddTool(wx.NewId(), "Paste", \ - wx.ArtProvider.GetBitmap(wx.ART_PASTE, wx.ART_TOOLBAR, (16,16))) - self.Bind(wx.EVT_TOOL, self.onEditPaste, self.toolPaste) - self.toolDelete = self.toolBar.AddTool(wx.NewId(), "Delete", \ - wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_TOOLBAR, (16,16))) - self.Bind(wx.EVT_TOOL, self.onEditDelete, self.toolDelete) - self.toolBar.AddSeparator() - self.toolIncrBrush = self.toolBar.AddTool(wx.NewId(), "Increase brush size", \ - wx.ArtProvider.GetBitmap(wx.ART_PLUS, wx.ART_TOOLBAR, (16,16))) - self.Bind(wx.EVT_TOOL, self.onEditIncrBrush, self.toolIncrBrush) - self.toolDecrBrush = self.toolBar.AddTool(wx.NewId(), "Decrease brush size", \ - wx.ArtProvider.GetBitmap(wx.ART_MINUS, wx.ART_TOOLBAR, (16,16))) - self.Bind(wx.EVT_TOOL, self.onEditDecrBrush, self.toolDecrBrush) - self.toolSolidBrush = self.toolBar.AddTool(wx.NewId(), "Solid brush", \ - wx.ArtProvider.GetBitmap(wx.ART_HELP, wx.ART_TOOLBAR, (16,16))) - self.Bind(wx.EVT_TOOL, self.onEditSolidBrush, self.toolSolidBrush) - self.toolBar.AddSeparator() - self.toolRect = self.toolBar.AddTool(wx.NewId(), "Rectangle", \ - wx.ArtProvider.GetBitmap(wx.ART_HELP, wx.ART_TOOLBAR, (16,16))) - self.Bind(wx.EVT_TOOL, self.onToolsRect, self.toolRect) - self.toolCircle = self.toolBar.AddTool(wx.NewId(), "Circle", \ - wx.ArtProvider.GetBitmap(wx.ART_HELP, wx.ART_TOOLBAR, (16,16))) - self.Bind(wx.EVT_TOOL, self.onToolsCircle, self.toolCircle) - self.toolLine = self.toolBar.AddTool(wx.NewId(), "Line", \ - wx.ArtProvider.GetBitmap(wx.ART_HELP, wx.ART_TOOLBAR, (16,16))) - self.Bind(wx.EVT_TOOL, self.onToolsLine, self.toolLine) - self.toolBar.AddSeparator() - self.toolBarIdColours = [None for x in range(0, len(mircColours))] - self.toolBarBitmapColours = [None for x in range(0, len(mircColours))] - for numColour in range(0, len(mircColours)): - self.toolBarBitmapColours[numColour] = wx.Bitmap((16,16)) - tmpDc = wx.MemoryDC(); tmpDc.SelectObject(self.toolBarBitmapColours[numColour]); - tmpDc.SetBrush(self.panelCanvas.mircBrushes[numColour]) - tmpDc.SetBackground(self.panelCanvas.mircBrushes[numColour]) - tmpDc.SetPen(self.panelCanvas.mircPens[numColour]) - tmpDc.DrawRectangle(0, 0, 16, 16) - self.toolBarIdColours[numColour] = wx.NewId() - self.toolBar.AddTool(self.toolBarIdColours[numColour], \ - "mIRC colour #" + str(numColour), self.toolBarBitmapColours[numColour]) - self.Bind(wx.EVT_TOOL, self.onToolColourFg, id=self.toolBarIdColours[numColour]) - self.Bind(wx.EVT_TOOL_RCLICKED, self.onToolColourBg, id=self.toolBarIdColours[numColour]) + self._initToolBars(self.toolBar, [self.BID_TOOLBAR], self.onFrameCommand) self.toolBar.Realize(); self.toolBar.Fit(); - self.SetFocus() - self.Show(True) + self.accelTable = wx.AcceleratorTable( \ + self._initAccelTable(self.AID_EDIT, self.onFrameCommand)) + self.SetAcceleratorTable(self.accelTable) + + self.statusBar = self.CreateStatusBar(); self._updateStatusBar(); + self.SetFocus(); self.Show(True); self.onCanvasUpdate(); # }}} # From 44e593714d9c048a03adc044e16029f278803ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sat, 6 Jan 2018 01:44:45 +0100 Subject: [PATCH 066/148] {IrcClient,IrcMiRCARTBot.py,MiRC{2png,ART}}.py: include parameters in function header comments. --- IrcClient.py | 12 ++++---- IrcMiRCARTBot.py | 32 ++++++++++----------- MiRC2png.py | 20 ++++++------- MiRCART.py | 75 ++++++++++++++++++++++++------------------------ 4 files changed, 69 insertions(+), 70 deletions(-) diff --git a/IrcClient.py b/IrcClient.py index 61e6d31..dc407be 100644 --- a/IrcClient.py +++ b/IrcClient.py @@ -32,13 +32,13 @@ class IrcClient: clientSocket = clientSocketFile = None; clientNextTimeout = None; clientQueue = None; - # {{{ close(): Close connection to server + # {{{ close(self): Close connection to server def close(self): if self.clientSocket != None: self.clientSocket.close() self.clientSocket = self.clientSocketFile = None; # }}} - # {{{ connect(): Connect to server and register w/ optional timeout + # {{{ connect(self, timeout=None): Connect to server and register w/ optional timeout def connect(self, timeout=None): self.clientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.clientSocket.setblocking(0) @@ -58,7 +58,7 @@ class IrcClient: self.queue("USER", self.clientIdent, "0", "0", self.clientGecos) return True # }}} - # {{{ readline(): Read and parse single line from server into canonicalised list, honouring timers + # {{{ readline(self): Read and parse single line from server into canonicalised list, honouring timers def readline(self): if self.clientNextTimeout: timeNow = time.time() @@ -87,7 +87,7 @@ class IrcClient: msg = [""] + msg[0:] return msg # }}} - # {{{ queue(): Parse and queue single line to server from list + # {{{ queue(self, *args): Parse and queue single line to server from list def queue(self, *args): msg = ""; argNumMax = len(args); for argNum in range(0, argNumMax): @@ -97,7 +97,7 @@ class IrcClient: msg += args[argNum] + " " self.clientQueue.append((msg + "\r\n").encode()) # }}} - # {{{ unqueue(): Send all queued lines to server, honouring timers + # {{{ unqueue(self): Send all queued lines to server, honouring timers def unqueue(self): while self.clientQueue: msg = self.clientQueue[0]; msgLen = len(msg); msgBytesSent = 0; @@ -118,7 +118,7 @@ class IrcClient: # }}} # - # Initialisation method + # __init__(self, serverHname, serverPort, clientNick, clientIdent, clientGecos): initialisation method def __init__(self, serverHname, serverPort, clientNick, clientIdent, clientGecos): self.serverHname = serverHname; self.serverPort = serverPort; self.clientNick = clientNick; self.clientIdent = clientIdent; self.clientGecos = clientGecos; diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index 7932e3d..f996f49 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -33,17 +33,17 @@ class IrcMiRCARTBot(IrcClient.IrcClient): clientChannelLastMessage = clientChannelOps = clientChannel = None clientChannelRejoin = None - # {{{ ContentTooLargeException: Raised by _urlretrieveReportHook() given download size > 1 MB + # {{{ ContentTooLargeException(Exception): Raised by _urlretrieveReportHook() given download size > 1 MB class ContentTooLargeException(Exception): pass # }}} - # {{{ _dispatch001(): Dispatch single 001 (RPL_WELCOME) + # {{{ _dispatch001(self, message): Dispatch single 001 (RPL_WELCOME) def _dispatch001(self, message): self._log("Registered on {}:{} as {}, {}, {}.".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) self._log("Attempting to join {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) self.queue("JOIN", self.clientChannel) # }}} - # {{{ _dispatch353(): Dispatch single 353 (RPL_NAMREPLY) + # {{{ _dispatch353(self, message): Dispatch single 353 (RPL_NAMREPLY) def _dispatch353(self, message): if message[4].lower() == self.clientChannel.lower(): for channelNickSpec in message[5].split(" "): @@ -53,19 +53,19 @@ class IrcMiRCARTBot(IrcClient.IrcClient): self.clientChannelOps.append(channelNickSpec[1:].lower()) self._log("Authorising {} on {}".format(channelNickSpec[1:].lower(), message[4].lower())) # }}} - # {{{ _dispatchJoin(): Dispatch single JOIN message from server + # {{{ _dispatchJoin(self, message): Dispatch single JOIN message from server def _dispatchJoin(self, message): self._log("Joined {} on {}:{}.".format(message[2].lower(), self.serverHname, self.serverPort)) self.clientNextTimeout = None; self.clientChannelRejoin = False; # }}} - # {{{ _dispatchKick(): Dispatch single KICK message from server + # {{{ _dispatchKick(self, message): Dispatch single KICK message from server def _dispatchKick(self, message): if message[2].lower() == self.clientChannel.lower() \ and message[3].lower() == self.clientNick.lower(): self._log("Kicked from {} by {}, rejoining in 15 seconds".format(message[2].lower(), message[0])) self.clientNextTimeout = time.time() + 15; self.clientChannelRejoin = True; # }}} - # {{{ _dispatchMode(): Dispatch single MODE message from server + # {{{ _dispatchMode(self, message): Dispatch single MODE message from server def _dispatchMode(self, message): if message[2].lower() == self.clientChannel.lower(): channelModeType = "+"; channelModeArg = 4; @@ -93,16 +93,16 @@ class IrcMiRCARTBot(IrcClient.IrcClient): self._log("Deauthorising {} on {}".format(channelAuthDel, message[2].lower())) self.clientChannelOps.remove(channelAuthDel) # }}} - # {{{ _dispatchNone(): Dispatch None message from server + # {{{ _dispatchNone(self): Dispatch None message from server def _dispatchNone(self): self._log("Disconnected from {}:{}.".format(self.serverHname, self.serverPort)) self.close() # }}} - # {{{ _dispatchPing(): Dispatch single PING message from server + # {{{ _dispatchPing(self, message): Dispatch single PING message from server def _dispatchPing(self, message): self.queue("PONG", message[2]) # }}} - # {{{ _dispatchPrivmsg(): Dispatch single PRIVMSG message from server + # {{{ _dispatchPrivmsg(self, message): Dispatch single PRIVMSG message from server def _dispatchPrivmsg(self, message): if message[2].lower() == self.clientChannel.lower() \ and message[3].startswith("!pngbot "): @@ -152,18 +152,18 @@ class IrcMiRCARTBot(IrcClient.IrcClient): if os.path.isfile(imgTmpFilePath): os.remove(imgTmpFilePath) # }}} - # {{{ _dispatchTimer(): Dispatch single client timer expiration + # {{{ _dispatchTimer(self): Dispatch single client timer expiration def _dispatchTimer(self): if self.clientChannelRejoin: self._log("Attempting to join {} on {}:{}...".format(self.clientChannel, self.serverHname, self.serverPort)) self.queue("JOIN", self.clientChannel) self.clientNextTimeout = time.time() + 15; self.clientChannelRejoin = True; # }}} - # {{{ _log(): Log single message to stdout w/ timestamp + # {{{ _log(self, msg): Log single message to stdout w/ timestamp def _log(self, msg): print(time.strftime("%Y/%m/%d %H:%M:%S") + " " + msg) # }}} - # {{{ _uploadToImgur(): Upload single file to Imgur + # {{{ _uploadToImgur(self, imgFilePath, imgName, imgTitle, apiKey): Upload single file to Imgur def _uploadToImgur(self, imgFilePath, imgName, imgTitle, apiKey): requestImageData = open(imgFilePath, "rb").read() requestData = { \ @@ -181,12 +181,12 @@ class IrcMiRCARTBot(IrcClient.IrcClient): else: return [responseHttp.status_code] # }}} - # {{{ _urlretrieveReportHook(): Limit downloads to 1 MB + # {{{ _urlretrieveReportHook(count, blockSize, totalSize): Limit downloads to 1 MB def _urlretrieveReportHook(count, blockSize, totalSize): if (totalSize > pow(2,20)): raise IrcMiRCARTBot.ContentTooLargeException # }}} - # {{{ connect(): Connect to server and (re)initialise w/ optional timeout + # {{{ connect(self, timeout=None): Connect to server and (re)initialise w/ optional timeout def connect(self, timeout=None): self._log("Connecting to {}:{}...".format(self.serverHname, self.serverPort)) if super().connect(timeout): @@ -198,7 +198,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): else: return False # }}} - # {{{ dispatch(): Read, parse, and dispatch single line from server + # {{{ dispatch(self): Read, parse, and dispatch single line from server def dispatch(self): while True: if self.clientNextTimeout: @@ -228,7 +228,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): # }}} # - # Initialisation method + # __init__(self, serverHname, serverPort="6667", clientNick="pngbot", clientIdent="pngbot", clientGecos="pngbot", clientChannel="#MiRCART"): initialisation method def __init__(self, serverHname, serverPort="6667", clientNick="pngbot", clientIdent="pngbot", clientGecos="pngbot", clientChannel="#MiRCART"): super().__init__(serverHname, serverPort, clientNick, clientIdent, clientGecos) self.clientChannel = clientChannel diff --git a/MiRC2png.py b/MiRC2png.py index 89c8976..7b1633e 100755 --- a/MiRC2png.py +++ b/MiRC2png.py @@ -81,7 +81,7 @@ class MiRC2png: (187, 187, 187, 255), # Light Grey ] # }}} - # {{{ _State: Parsing loop state + # {{{ _State(Enum): Parsing loop state class _State(Enum): STATE_CHAR = 1 STATE_COLOUR_SPEC = 2 @@ -89,15 +89,15 @@ class MiRC2png: STATE_CSPEC_DIGIT1 = 3 # }}} - # {{{ _countChar(): XXX + # {{{ _countChar(self, char): XXX def _countChar(self, char): return True # }}} - # {{{ _countColourSpecState(): XXX + # {{{ _countColourSpecState(self, colourSpec): XXX def _countColourSpecState(self, colourSpec): return 0 # }}} - # {{{ _render(): XXX + # {{{ _render(self): XXX def _render(self): self.outCurX = 0; self.outCurY = 0; for inCurRow in range(0, len(self.inLines)): @@ -116,7 +116,7 @@ class MiRC2png: self._syncColourSpecState) self.outCurX = 0; self.outCurY += self.outImgFontSize[1]; # }}} - # {{{ _getMaxCols(): Calculate widest row in lines, ignoring non-printable & mIRC control code sequences + # {{{ _getMaxCols(self, lines): Calculate widest row in lines, ignoring non-printable & mIRC control code sequences def _getMaxCols(self, lines): maxCols = 0; for inCurRow in range(0, len(lines)): @@ -136,7 +136,7 @@ class MiRC2png: maxCols = max(maxCols, curRowCols) return maxCols # }}} - # {{{ _parseAsChar(): Parse single character as regular character and mutate state + # {{{ _parseAsChar(self, char, fn): Parse single character as regular character and mutate state def _parseAsChar(self, char, fn): if char == "": self._State = self._State.STATE_CSPEC_DIGIT0; self.inCurCol += 1; @@ -144,7 +144,7 @@ class MiRC2png: else: self.inCurCol += 1; return fn(char); # }}} - # {{{ _parseAsColourSpec(): Parse single character as mIRC colour control code sequence and mutate state + # {{{ _parseAsColourSpec(self, char, fn): Parse single character as mIRC colour control code sequence and mutate state def _parseAsColourSpec(self, char, fn): if self._State == self._State.STATE_CSPEC_DIGIT0 \ and char == ",": @@ -170,7 +170,7 @@ class MiRC2png: self.inCurDigits = 0 return [True, result] # }}} - # {{{ _syncChar(): XXX + # {{{ _syncChar(self, char): XXX def _syncChar(self, char): if char == "": self.inCurBold = 0 if self.inCurBold else 1; @@ -207,7 +207,7 @@ class MiRC2png: self.outCurX += self.outImgFontSize[0]; return True # }}} - # {{{ _syncColourSpecState(): XXX + # {{{ _syncColourSpecState(self, colourSpec): XXX def _syncColourSpecState(self, colourSpec): if len(colourSpec) > 0: colourSpec = colourSpec.split(",") @@ -222,7 +222,7 @@ class MiRC2png: # }}} # - # Initialisation method + # __init__(self, inFilePath, imgFilePath, fontFilePath="DejaVuSansMono.ttf", fontSize=11): initialisation method def __init__(self, inFilePath, imgFilePath, fontFilePath="DejaVuSansMono.ttf", fontSize=11): self.inFilePath = inFilePath; self.inFile = open(inFilePath, "r"); self.inLines = self.inFile.readlines() diff --git a/MiRCART.py b/MiRCART.py index a8bd09f..f0de10f 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -55,7 +55,7 @@ class MiRCARTCanvas(wx.Panel): mircBg = mircFg = mircBrushes = mircPens = None patchesTmp = patchesUndo = patchesUndoLevel = None - # {{{ _drawPatch(): XXX + # {{{ _drawPatch(self, patch, eventDc, tmpDc, atX, atY): XXX def _drawPatch(self, patch, eventDc, tmpDc, atX, atY): patchXabs = (atX + patch[0]) * self.getCellWidth() patchYabs = (atY + patch[1]) * self.getCellHeight() @@ -67,17 +67,17 @@ class MiRCARTCanvas(wx.Panel): dc.DrawRectangle(patchXabs, patchYabs, \ self.getCellWidth(), self.getCellHeight()) # }}} - # {{{ _eventPointToMapX(): XXX + # {{{ _eventPointToMapX(self, eventPoint): XXX def _eventPointToMapX(self, eventPoint): rectX = eventPoint.x - (eventPoint.x % self.getCellWidth()) return int(rectX / self.getCellWidth() if rectX else 0) # }}} - # {{{ _eventPointToMapY(): XXX + # {{{ _eventPointToMapY(self, eventPoint): XXX def _eventPointToMapY(self, eventPoint): rectY = eventPoint.y - (eventPoint.y % self.getCellHeight()) return int(rectY / self.getCellHeight() if rectY else 0) # }}} - # {{{ _onMouseEvent(): XXX + # {{{ _onMouseEvent(self, event): XXX def _onMouseEvent(self, event): eventObject = event.GetEventObject() eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); @@ -92,7 +92,7 @@ class MiRCARTCanvas(wx.Panel): mapPatches = tool.onMouseDown(event, mapX, mapY, event.LeftIsDown(), event.RightIsDown()) self._processMapPatches(mapPatches, eventDc, tmpDc, mapX, mapY) # }}} - # {{{ _processMapPatches(): XXX + # {{{ _processMapPatches(self, mapPatches, eventDc, tmpDc, atX, atY): XXX def _processMapPatches(self, mapPatches, eventDc, tmpDc, atX, atY): for mapPatch in mapPatches: mapPatchTmp = mapPatch[0]; mapPatchW = mapPatch[1]; mapPatchH = mapPatch[2]; @@ -122,58 +122,58 @@ class MiRCARTCanvas(wx.Panel): if len(mapPatch[3]): self.parentFrame.onCanvasUpdate() # }}} - # {{{ getBackgroundColour(): XXX + # {{{ getBackgroundColour(self): XXX def getBackgroundColour(self): return self.mircBg # }}} - # {{{ getCellHeight(): XXX + # {{{ getCellHeight(self): XXX def getCellHeight(self): return self.cellSize[1] # }}} - # {{{ getCellWidth(): XXX + # {{{ getCellWidth(self): XXX def getCellWidth(self): return self.cellSize[0] # }}} - # {{{ getForegroundColour(): XXX + # {{{ getForegroundColour(self): XXX def getForegroundColour(self): return self.mircFg # }}} - # {{{ getHeight(): XXX + # {{{ getHeight(self): XXX def getHeight(self): return self.canvasSize[1] # }}} - # {{{ getMap(): XXX + # {{{ getMap(self): XXX def getMap(self): return self.canvasMap # }}} - # {{{ getWidth(): XXX + # {{{ getWidth(self): XXX def getWidth(self): return self.canvasSize[0] # }}} - # {{{ onLeftDown(): XXX + # {{{ onLeftDown(self, event): XXX def onLeftDown(self, event): self._onMouseEvent(event) # }}} - # {{{ onMotion(): XXX + # {{{ onMotion(self, event): XXX def onMotion(self, event): self._onMouseEvent(event) # }}} - # {{{ onPaint(): XXX + # {{{ onPaint(self, event): XXX def onPaint(self, event): eventDc = wx.BufferedPaintDC(self, self.canvasBitmap) # }}} - # {{{ onPaletteEvent(): XXX + # {{{ onPaletteEvent(self, leftDown, rightDown, numColour): XXX def onPaletteEvent(self, leftDown, rightDown, numColour): if leftDown: self.mircFg = numColour elif rightDown: self.mircBg = numColour # }}} - # {{{ onRightDown(): XXX + # {{{ onRightDown(self, event): XXX def onRightDown(self, event): self._onMouseEvent(event) # }}} - # {{{ redo(): XXX + # {{{ redo(self): XXX def redo(self): if self.patchesUndoLevel > 0: self.patchesUndoLevel -= 1 @@ -188,7 +188,7 @@ class MiRCARTCanvas(wx.Panel): else: return False # }}} - # {{{ undo(): XXX + # {{{ undo(self): XXX def undo(self): if self.patchesUndo[self.patchesUndoLevel] != None: undoPatch = self.patchesUndo[self.patchesUndoLevel][0] @@ -203,7 +203,7 @@ class MiRCARTCanvas(wx.Panel): else: return False # }}} - # {{{ Initialisation method + # {{{ __init__(self, parent, parentFrame, canvasPos, cellSize, canvasSize, canvasTools): Initialisation method def __init__(self, parent, parentFrame, canvasPos, cellSize, canvasSize, canvasTools): self.parentFrame = parentFrame canvasWinSize = (cellSize[0] * canvasSize[0], cellSize[1] * canvasSize[1]) @@ -239,15 +239,15 @@ class MiRCARTTool(): """XXX""" parentCanvas = None - # {{{ onMouseDown(): XXX + # {{{ onMouseDown(self, event, mapX, mapY, isLeftDown, isRightDown): XXX def onMouseDown(self, event, mapX, mapY, isLeftDown, isRightDown): pass # }}} - # {{{ onMouseMotion(): XXX + # {{{ onMouseMotion(self, event, mapX, mapY, isLeftDown, isRightDown): XXX def onMouseMotion(self, event, mapX, mapY, isLeftDown, isRightDown): pass # }}} - # {{{ Initialisation method + # {{{ __init__(self, parentCanvas): initialisation method def __init__(self, parentCanvas): self.parentCanvas = parentCanvas # }}} @@ -255,7 +255,7 @@ class MiRCARTTool(): class MiRCARTToolRect(MiRCARTTool): """XXX""" - # {{{ _draw(): XXX + # {{{ _draw(self, event, mapX, mapY, isLeftDown, isRightDown): XXX def _draw(self, event, mapX, mapY, isLeftDown, isRightDown): if isLeftDown: return [[False, 1, 1, [[0, 0, \ @@ -276,15 +276,15 @@ class MiRCARTToolRect(MiRCARTTool): self.parentCanvas.getForegroundColour(), \ self.parentCanvas.getForegroundColour(), " "]]]] # }}} - # {{{ onMouseDown(): XXX + # {{{ onMouseDown(self, event, mapX, mapY, isLeftDown, isRightDown): XXX def onMouseDown(self, event, mapX, mapY, isLeftDown, isRightDown): return self._draw(event, mapX, mapY, isLeftDown, isRightDown) # }}} - # {{{ onMouseMotion(): XXX + # {{{ onMouseMotion(self, event, mapX, mapY, isLeftDown, isRightDown): XXX def onMouseMotion(self, event, mapX, mapY, isLeftDown, isRightDown): return self._draw(event, mapX, mapY, isLeftDown, isRightDown) # }}} - # {{{ Initialisation method + # {{{ __init__(self, parentCanvas): initialisation method def __init__(self, parentCanvas): super().__init__(parentCanvas) # }}} @@ -292,8 +292,7 @@ class MiRCARTToolRect(MiRCARTTool): class MiRCARTFrame(wx.Frame): """XXX""" panelSkin = panelCanvas = None - menuItemsById = menuBar = toolBar = accelTable = None - statusBar = None + menuItemsById = menuBar = toolBar = accelTable = statusBar = None # {{{ Types TID_COMMAND = (0x001) @@ -372,7 +371,7 @@ class MiRCARTFrame(wx.Frame): AID_EDIT = (0x500, TID_ACCELS, (CID_UNDO, CID_REDO)) # }}} - # {{{ _drawIcon(): XXX + # {{{ _drawIcon(self, solidColour): XXX def _drawIcon(self, solidColour): iconBitmap = wx.Bitmap((16,16)) iconDc = wx.MemoryDC(); iconDc.SelectObject(iconBitmap); @@ -382,7 +381,7 @@ class MiRCARTFrame(wx.Frame): iconDc.DrawRectangle(0, 0, 16, 16) return iconBitmap # }}} - # {{{ _initAccelTable(): XXX + # {{{ _initAccelTable(self, accelsDescr, handler): XXX def _initAccelTable(self, accelsDescr, handler): accelTableEntries = [wx.AcceleratorEntry() for n in range(0, len(accelsDescr[2]))] for numAccel in range(0, len(accelsDescr[2])): @@ -392,7 +391,7 @@ class MiRCARTFrame(wx.Frame): self.Bind(wx.EVT_MENU, handler, id=accelDescr[0]) return accelTableEntries # }}} - # {{{ _initMenus(): XXX + # {{{ _initMenus(self, menuBar, menusDescr, handler): XXX def _initMenus(self, menuBar, menusDescr, handler): for menuDescr in menusDescr: menuWindow = wx.Menu() @@ -405,7 +404,7 @@ class MiRCARTFrame(wx.Frame): self.Bind(wx.EVT_MENU, handler, menuItemWindow) menuBar.Append(menuWindow, menuDescr[3]) # }}} - # {{{ _initToolBars(): XXX + # {{{ _initToolBars(self, toolBar, toolBarsDescr, handler): XXX def _initToolBars(self, toolBar, toolBarsDescr, handler): for toolBarDescr in toolBarsDescr: for toolBarItem in toolBarDescr[2]: @@ -426,7 +425,7 @@ class MiRCARTFrame(wx.Frame): self.Bind(wx.EVT_TOOL, handler, toolBarItemWindow) self.Bind(wx.EVT_TOOL_RCLICKED, handler, toolBarItemWindow) # }}} - # {{{ _saveAs(): XXX + # {{{ _saveAs(self, pathName): XXX def _saveAs(self, pathName): try: with open(pathName, "w") as file: @@ -449,7 +448,7 @@ class MiRCARTFrame(wx.Frame): except IOError as error: return [False, error] # }}} - # {{{ _updateStatusBar(): XXX + # {{{ _updateStatusBar(self): XXX def _updateStatusBar(self): text = "Foreground colour:" text += " " + str(self.panelCanvas.getForegroundColour()) @@ -459,7 +458,7 @@ class MiRCARTFrame(wx.Frame): self.statusBar.SetStatusText(text) # }}} - # {{{ onCanvasUpdate(): XXX + # {{{ onCanvasUpdate(self): XXX def onCanvasUpdate(self): if self.panelCanvas.patchesUndo[self.panelCanvas.patchesUndoLevel] != None: self.menuItemsById[self.CID_UNDO[0]].Enable(True) @@ -470,7 +469,7 @@ class MiRCARTFrame(wx.Frame): else: self.menuItemsById[self.CID_REDO[0]].Enable(False) # }}} - # {{{ onFrameCommand(): XXX + # {{{ onFrameCommand(self, event): XXX def onFrameCommand(self, event): cid = event.GetId() if cid == self.CID_NEW[0]: @@ -526,7 +525,7 @@ class MiRCARTFrame(wx.Frame): self.panelCanvas.onPaletteEvent(leftIsDown, rightIsDown, numColour) self._updateStatusBar() # }}} - # {{{ Initialisation method + # {{{ __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), cellSize=(7, 14), canvasSize=(80, 25)): initialisation method def __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), cellSize=(7, 14), canvasSize=(80, 25)): super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) self.panelSkin = wx.Panel(self, wx.ID_ANY) From 16065401e8738e65ac53bb34c1a6d3d9f19f1685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sat, 6 Jan 2018 02:42:26 +0100 Subject: [PATCH 067/148] MiRCART.py:MiRCARTCanvas: cleaned up. --- MiRCART.py | 258 +++++++++++++++++++++++------------------------------ 1 file changed, 112 insertions(+), 146 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index f0de10f..d93344a 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -55,134 +55,101 @@ class MiRCARTCanvas(wx.Panel): mircBg = mircFg = mircBrushes = mircPens = None patchesTmp = patchesUndo = patchesUndoLevel = None - # {{{ _drawPatch(self, patch, eventDc, tmpDc, atX, atY): XXX - def _drawPatch(self, patch, eventDc, tmpDc, atX, atY): - patchXabs = (atX + patch[0]) * self.getCellWidth() - patchYabs = (atY + patch[1]) * self.getCellHeight() - brushFg = self.mircBrushes[patch[2]] - brushBg = self.mircBrushes[patch[3]] + # {{{ _drawPatch(self, patch, eventDc, tmpDc, atPoint): XXX + def _drawPatch(self, patch, eventDc, tmpDc, atPoint): + absPoint = self._relMapPointToAbsPoint((patch[0], patch[1]), atPoint) + brushFg = self.mircBrushes[patch[2]]; brushBg = self.mircBrushes[patch[3]]; pen = self.mircPens[patch[2]] for dc in (eventDc, tmpDc): dc.SetBrush(brushFg); dc.SetBackground(brushBg); dc.SetPen(pen); - dc.DrawRectangle(patchXabs, patchYabs, \ - self.getCellWidth(), self.getCellHeight()) + dc.DrawRectangle(absPoint[0], absPoint[1], self.cellSize[0], self.cellSize[1]) # }}} - # {{{ _eventPointToMapX(self, eventPoint): XXX - def _eventPointToMapX(self, eventPoint): - rectX = eventPoint.x - (eventPoint.x % self.getCellWidth()) - return int(rectX / self.getCellWidth() if rectX else 0) + # {{{ _eventPointToMapPoint(self, eventPoint): XXX + def _eventPointToMapPoint(self, eventPoint): + rectX = eventPoint.x - (eventPoint.x % self.cellSize[0]) + rectY = eventPoint.y - (eventPoint.y % self.cellSize[1]) + mapX = int(rectX / self.cellSize[0] if rectX else 0) + mapY = int(rectY / self.cellSize[1] if rectY else 0) + return (mapX, mapY) # }}} - # {{{ _eventPointToMapY(self, eventPoint): XXX - def _eventPointToMapY(self, eventPoint): - rectY = eventPoint.y - (eventPoint.y % self.getCellHeight()) - return int(rectY / self.getCellHeight() if rectY else 0) + # {{{ _getMapCell(self, absMapPoint): XXX + def _getMapCell(self, absMapPoint): + return self.canvasMap[absMapPoint[1]][absMapPoint[0]] # }}} - # {{{ _onMouseEvent(self, event): XXX - def _onMouseEvent(self, event): + # {{{ _processMapPatches(self, mapPatches, eventDc, tmpDc, atPoint): XXX + def _processMapPatches(self, mapPatches, eventDc, tmpDc, atPoint): + for mapPatch in mapPatches: + mapPatchTmp = mapPatch[0] + if mapPatchTmp and self.patchesTmp: + for patch in self.patchesTmp: + patch[2:] = self._getMapCell([patch[0], patch[1]]) + self._drawPatch(patch, eventDc, tmpDc, (0, 0)) + self.patchesTmp = [] + for patch in mapPatch[1]: + absMapPoint = self._relMapPointToAbsMapPoint(patch[0:2], atPoint) + mapItem = self._getMapCell(absMapPoint) + if mapPatchTmp: + self.patchesTmp.append([*absMapPoint, None, None, None]) + self._drawPatch(patch, eventDc, tmpDc, atPoint) + elif mapItem != patch[2:5]: + self._pushUndo(atPoint, patch, mapItem) + self._setMapCell(absMapPoint, *patch[2:5]) + self._drawPatch(patch, eventDc, tmpDc, atPoint) + self.parentFrame.onCanvasUpdate() + # }}} + # {{{ _pushUndo(self, atPoint, patch): XXXX + def _pushUndo(self, atPoint, patch, mapItem): + if self.patchesUndoLevel > 0: + del self.patchesUndo[0:self.patchesUndoLevel] + self.patchesUndoLevel = 0 + absMapPoint = self._relMapPointToAbsMapPoint((patch[0], patch[1]), atPoint) + self.patchesUndo.insert(0, ( \ + (absMapPoint[0], absMapPoint[1], mapItem[0], mapItem[1], mapItem[2]), \ + (absMapPoint[0], absMapPoint[1], patch[2], patch[3], patch[4]))) + # }}} + # {{{ _relMapPointToAbsMapPoint(self, relMapPoint, atPoint): XXX + def _relMapPointToAbsMapPoint(self, relMapPoint, atPoint): + return (atPoint[0] + relMapPoint[0], atPoint[1] + relMapPoint[1]) + # }}} + # {{{ _relMapPointToAbsPoint(self, relMapPoint, atPoint): XXX + def _relMapPointToAbsPoint(self, relMapPoint, atPoint): + absX = (atPoint[0] + relMapPoint[0]) * self.cellSize[0] + absY = (atPoint[1] + relMapPoint[1]) * self.cellSize[1] + return (absX, absY) + # }}} + # {{{ _setMapCell(self, absMapPoint, colourFg, colourBg, char): XXX + def _setMapCell(self, absMapPoint, colourFg, colourBg, char): + self.canvasMap[absMapPoint[1]][absMapPoint[0]] = [colourFg, colourBg, char] + # }}} + + # {{{ onMouseEvent(self, event): XXX + def onMouseEvent(self, event): eventObject = event.GetEventObject() eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); tmpDc.SelectObject(self.canvasBitmap) eventPoint = event.GetLogicalPosition(eventDc) - mapX = self._eventPointToMapX(eventPoint) - mapY = self._eventPointToMapY(eventPoint) + mapPoint = self._eventPointToMapPoint(eventPoint) for tool in self.canvasTools: if event.Dragging(): - mapPatches = tool.onMouseMotion(event, mapX, mapY, event.LeftIsDown(), event.RightIsDown()) + mapPatches = tool.onMouseMotion(event, mapPoint, event.LeftIsDown(), event.RightIsDown()) else: - mapPatches = tool.onMouseDown(event, mapX, mapY, event.LeftIsDown(), event.RightIsDown()) - self._processMapPatches(mapPatches, eventDc, tmpDc, mapX, mapY) - # }}} - # {{{ _processMapPatches(self, mapPatches, eventDc, tmpDc, atX, atY): XXX - def _processMapPatches(self, mapPatches, eventDc, tmpDc, atX, atY): - for mapPatch in mapPatches: - mapPatchTmp = mapPatch[0]; mapPatchW = mapPatch[1]; mapPatchH = mapPatch[2]; - if mapPatchTmp and self.patchesTmp: - for patch in self.patchesTmp: - patch[2] = self.canvasMap[patch[1]][patch[0]][0] - patch[3] = self.canvasMap[patch[1]][patch[0]][1] - patch[4] = self.canvasMap[patch[1]][patch[0]][2] - self._drawPatch(patch, eventDc, tmpDc, 0, 0) - self.patchesTmp = [] - for patch in mapPatch[3]: - if mapPatchTmp: - mapItem = self.canvasMap[atY + patch[1]][atX + patch[0]] - self.patchesTmp.append([atX + patch[0], atY + patch[1], None, None, None]) - self._drawPatch(patch, eventDc, tmpDc, atX, atY) - else: - mapItem = self.canvasMap[atY + patch[1]][atX + patch[0]] - if mapItem != [patch[2], patch[3], patch[4]]: - if self.patchesUndoLevel > 0: - del self.patchesUndo[0:self.patchesUndoLevel] - self.patchesUndoLevel = 0 - self.patchesUndo.insert(0, ( \ - (atX + patch[0], atY + patch[1], mapItem[0], mapItem[1], mapItem[2]), \ - (atX + patch[0], atY + patch[1], patch[2], patch[3], " "))) - self.canvasMap[atY + patch[1]][atX + patch[0]] = [patch[2], patch[3], " "]; - self._drawPatch(patch, eventDc, tmpDc, atX, atY) - if len(mapPatch[3]): - self.parentFrame.onCanvasUpdate() - # }}} - # {{{ getBackgroundColour(self): XXX - def getBackgroundColour(self): - return self.mircBg - # }}} - # {{{ getCellHeight(self): XXX - def getCellHeight(self): - return self.cellSize[1] - # }}} - # {{{ getCellWidth(self): XXX - def getCellWidth(self): - return self.cellSize[0] - # }}} - # {{{ getForegroundColour(self): XXX - def getForegroundColour(self): - return self.mircFg - # }}} - # {{{ getHeight(self): XXX - def getHeight(self): - return self.canvasSize[1] - # }}} - # {{{ getMap(self): XXX - def getMap(self): - return self.canvasMap - # }}} - # {{{ getWidth(self): XXX - def getWidth(self): - return self.canvasSize[0] - # }}} - # {{{ onLeftDown(self, event): XXX - def onLeftDown(self, event): - self._onMouseEvent(event) - # }}} - # {{{ onMotion(self, event): XXX - def onMotion(self, event): - self._onMouseEvent(event) + mapPatches = tool.onMouseDown(event, mapPoint, event.LeftIsDown(), event.RightIsDown()) + self._processMapPatches(mapPatches, eventDc, tmpDc, mapPoint) # }}} # {{{ onPaint(self, event): XXX def onPaint(self, event): eventDc = wx.BufferedPaintDC(self, self.canvasBitmap) # }}} - # {{{ onPaletteEvent(self, leftDown, rightDown, numColour): XXX - def onPaletteEvent(self, leftDown, rightDown, numColour): - if leftDown: - self.mircFg = numColour - elif rightDown: - self.mircBg = numColour - # }}} - # {{{ onRightDown(self, event): XXX - def onRightDown(self, event): - self._onMouseEvent(event) - # }}} # {{{ redo(self): XXX def redo(self): if self.patchesUndoLevel > 0: self.patchesUndoLevel -= 1 redoPatch = self.patchesUndo[self.patchesUndoLevel][1] - self.canvasMap[redoPatch[1]][redoPatch[0]] = \ - [redoPatch[2], redoPatch[3], redoPatch[4]] + self._setMapCell([redoPatch[0], redoPatch[1]], \ + redoPatch[2], redoPatch[3], redoPatch[4]) eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); tmpDc.SelectObject(self.canvasBitmap) - self._drawPatch(redoPatch, eventDc, tmpDc, 0, 0) + self._drawPatch(redoPatch, eventDc, tmpDc, (0, 0)) self.parentFrame.onCanvasUpdate() return True else: @@ -192,11 +159,11 @@ class MiRCARTCanvas(wx.Panel): def undo(self): if self.patchesUndo[self.patchesUndoLevel] != None: undoPatch = self.patchesUndo[self.patchesUndoLevel][0] - self.canvasMap[undoPatch[1]][undoPatch[0]] = \ - [undoPatch[2], undoPatch[3], undoPatch[4]] + self._setMapCell([undoPatch[0], undoPatch[1]], \ + undoPatch[2], undoPatch[3], undoPatch[4]) eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); tmpDc.SelectObject(self.canvasBitmap) - self._drawPatch(undoPatch, eventDc, tmpDc, 0, 0) + self._drawPatch(undoPatch, eventDc, tmpDc, (0, 0)) self.patchesUndoLevel += 1 self.parentFrame.onCanvasUpdate() return True @@ -229,22 +196,22 @@ class MiRCARTCanvas(wx.Panel): self.patchesTmp = [] self.patchesUndo = [None]; self.patchesUndoLevel = 0; - self.Bind(wx.EVT_LEFT_DOWN, self.onLeftDown) - self.Bind(wx.EVT_MOTION, self.onMotion) + self.Bind(wx.EVT_LEFT_DOWN, self.onMouseEvent) + self.Bind(wx.EVT_MOTION, self.onMouseEvent) self.Bind(wx.EVT_PAINT, self.onPaint) - self.Bind(wx.EVT_RIGHT_DOWN, self.onRightDown) + self.Bind(wx.EVT_RIGHT_DOWN, self.onMouseEvent) # }}} class MiRCARTTool(): """XXX""" parentCanvas = None - # {{{ onMouseDown(self, event, mapX, mapY, isLeftDown, isRightDown): XXX - def onMouseDown(self, event, mapX, mapY, isLeftDown, isRightDown): + # {{{ onMouseDown(self, event, mapPoint, isLeftDown, isRightDown): XXX + def onMouseDown(self, event, mapPoint, isLeftDown, isRightDown): pass # }}} - # {{{ onMouseMotion(self, event, mapX, mapY, isLeftDown, isRightDown): XXX - def onMouseMotion(self, event, mapX, mapY, isLeftDown, isRightDown): + # {{{ onMouseMotion(self, event, mapPoint, isLeftDown, isRightDown): XXX + def onMouseMotion(self, event, mapPoint, isLeftDown, isRightDown): pass # }}} # {{{ __init__(self, parentCanvas): initialisation method @@ -255,34 +222,34 @@ class MiRCARTTool(): class MiRCARTToolRect(MiRCARTTool): """XXX""" - # {{{ _draw(self, event, mapX, mapY, isLeftDown, isRightDown): XXX - def _draw(self, event, mapX, mapY, isLeftDown, isRightDown): + # {{{ _draw(self, event, mapPoint, isLeftDown, isRightDown): XXX + def _draw(self, event, mapPoint, isLeftDown, isRightDown): if isLeftDown: - return [[False, 1, 1, [[0, 0, \ - self.parentCanvas.getForegroundColour(), \ - self.parentCanvas.getForegroundColour(), " "]]], - [True, 1, 1, [[0, 0, \ - self.parentCanvas.getForegroundColour(), \ - self.parentCanvas.getForegroundColour(), " "]]]] + return [[False, [[0, 0, \ + self.parentCanvas.mircFg, \ + self.parentCanvas.mircFg, " "]]], + [True, [[0, 0, \ + self.parentCanvas.mircFg, \ + self.parentCanvas.mircFg, " "]]]] elif isRightDown: - return [[False, 1, 1, [[0, 0, \ - self.parentCanvas.getBackgroundColour(), \ - self.parentCanvas.getBackgroundColour(), " "]]], \ - [True, 1, 1, [[0, 0, \ - self.parentCanvas.getBackgroundColour(), \ - self.parentCanvas.getBackgroundColour(), " "]]]] + return [[False, [[0, 0, \ + self.parentCanvas.mircBg, \ + self.parentCanvas.mircBg, " "]]], \ + [True, [[0, 0, \ + self.parentCanvas.mircBg, \ + self.parentCanvas.mircBg, " "]]]] else: - return [[True, 1, 1, [[0, 0, \ - self.parentCanvas.getForegroundColour(), \ - self.parentCanvas.getForegroundColour(), " "]]]] + return [[True, [[0, 0, \ + self.parentCanvas.mircFg, \ + self.parentCanvas.mircFg, " "]]]] # }}} - # {{{ onMouseDown(self, event, mapX, mapY, isLeftDown, isRightDown): XXX - def onMouseDown(self, event, mapX, mapY, isLeftDown, isRightDown): - return self._draw(event, mapX, mapY, isLeftDown, isRightDown) + # {{{ onMouseDown(self, event, mapPoint, isLeftDown, isRightDown): XXX + def onMouseDown(self, event, mapPoint, isLeftDown, isRightDown): + return self._draw(event, mapPoint, isLeftDown, isRightDown) # }}} - # {{{ onMouseMotion(self, event, mapX, mapY, isLeftDown, isRightDown): XXX - def onMouseMotion(self, event, mapX, mapY, isLeftDown, isRightDown): - return self._draw(event, mapX, mapY, isLeftDown, isRightDown) + # {{{ onMouseMotion(self, event, mapPoint, isLeftDown, isRightDown): XXX + def onMouseMotion(self, event, mapPoint, isLeftDown, isRightDown): + return self._draw(event, mapPoint, isLeftDown, isRightDown) # }}} # {{{ __init__(self, parentCanvas): initialisation method def __init__(self, parentCanvas): @@ -429,9 +396,9 @@ class MiRCARTFrame(wx.Frame): def _saveAs(self, pathName): try: with open(pathName, "w") as file: - canvasMap = self.panelCanvas.getMap() - canvasHeight = self.panelCanvas.getHeight() - canvasWidth = self.panelCanvas.getWidth() + canvasMap = self.panelCanvas.canvasMap + canvasHeight = self.panelCanvas.canvasSize[1] + canvasWidth = self.panelCanvas.canvasSize[0] for canvasRow in range(0, canvasHeight): colourLastBg = colourLastFg = None; for canvasCol in range(0, canvasWidth): @@ -451,10 +418,10 @@ class MiRCARTFrame(wx.Frame): # {{{ _updateStatusBar(self): XXX def _updateStatusBar(self): text = "Foreground colour:" - text += " " + str(self.panelCanvas.getForegroundColour()) + text += " " + str(self.panelCanvas.mircFg) text += " | " text += "Background colour:" - text += " " + str(self.panelCanvas.getBackgroundColour()) + text += " " + str(self.panelCanvas.mircBg) self.statusBar.SetStatusText(text) # }}} @@ -517,12 +484,11 @@ class MiRCARTFrame(wx.Frame): pass elif cid >= self.CID_COLOUR00[0] \ and cid <= self.CID_COLOUR15[0]: - if event.GetEventType() == wx.wxEVT_TOOL: - leftIsDown = True; rightIsDown = False; - elif event.GetEventType() == wx.wxEVT_TOOL_RCLICKED: - leftIsDown = False; rightIsDown = True; numColour = cid - self.CID_COLOUR00[0] - self.panelCanvas.onPaletteEvent(leftIsDown, rightIsDown, numColour) + if event.GetEventType() == wx.wxEVT_TOOL: + self.panelCanvas.mircFg = numColour + elif event.GetEventType() == wx.wxEVT_TOOL_RCLICKED: + self.panelCanvas.mircBg = numColour self._updateStatusBar() # }}} # {{{ __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), cellSize=(7, 14), canvasSize=(80, 25)): initialisation method From 968d07050e1b6f3fe133f53c21ea620e798bd82f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sat, 6 Jan 2018 02:46:46 +0100 Subject: [PATCH 068/148] MiRCART.py:MiRCARTTool{,Rect}: cleaned up. --- MiRCART.py | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index d93344a..536113f 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -130,10 +130,8 @@ class MiRCARTCanvas(wx.Panel): eventPoint = event.GetLogicalPosition(eventDc) mapPoint = self._eventPointToMapPoint(eventPoint) for tool in self.canvasTools: - if event.Dragging(): - mapPatches = tool.onMouseMotion(event, mapPoint, event.LeftIsDown(), event.RightIsDown()) - else: - mapPatches = tool.onMouseDown(event, mapPoint, event.LeftIsDown(), event.RightIsDown()) + mapPatches = tool.onMouseEvent(event, mapPoint, event.Dragging(), \ + event.LeftIsDown(), event.RightIsDown()) self._processMapPatches(mapPatches, eventDc, tmpDc, mapPoint) # }}} # {{{ onPaint(self, event): XXX @@ -206,12 +204,8 @@ class MiRCARTTool(): """XXX""" parentCanvas = None - # {{{ onMouseDown(self, event, mapPoint, isLeftDown, isRightDown): XXX - def onMouseDown(self, event, mapPoint, isLeftDown, isRightDown): - pass - # }}} - # {{{ onMouseMotion(self, event, mapPoint, isLeftDown, isRightDown): XXX - def onMouseMotion(self, event, mapPoint, isLeftDown, isRightDown): + # {{{ onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): XXX + def onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): pass # }}} # {{{ __init__(self, parentCanvas): initialisation method @@ -222,8 +216,8 @@ class MiRCARTTool(): class MiRCARTToolRect(MiRCARTTool): """XXX""" - # {{{ _draw(self, event, mapPoint, isLeftDown, isRightDown): XXX - def _draw(self, event, mapPoint, isLeftDown, isRightDown): + # {{{ onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): XXX + def onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): if isLeftDown: return [[False, [[0, 0, \ self.parentCanvas.mircFg, \ @@ -243,18 +237,6 @@ class MiRCARTToolRect(MiRCARTTool): self.parentCanvas.mircFg, \ self.parentCanvas.mircFg, " "]]]] # }}} - # {{{ onMouseDown(self, event, mapPoint, isLeftDown, isRightDown): XXX - def onMouseDown(self, event, mapPoint, isLeftDown, isRightDown): - return self._draw(event, mapPoint, isLeftDown, isRightDown) - # }}} - # {{{ onMouseMotion(self, event, mapPoint, isLeftDown, isRightDown): XXX - def onMouseMotion(self, event, mapPoint, isLeftDown, isRightDown): - return self._draw(event, mapPoint, isLeftDown, isRightDown) - # }}} - # {{{ __init__(self, parentCanvas): initialisation method - def __init__(self, parentCanvas): - super().__init__(parentCanvas) - # }}} class MiRCARTFrame(wx.Frame): """XXX""" From fcc4215b6826160dad2ec624c1a329d1de028542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sat, 6 Jan 2018 02:50:12 +0100 Subject: [PATCH 069/148] {IrcClient,IrcMiRCARTBot,MiRC{2png,ART}}.py: fix spaces & typo. --- IrcClient.py | 6 +++--- IrcMiRCARTBot.py | 6 +++--- MiRC2png.py | 6 +++--- MiRCART.py | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/IrcClient.py b/IrcClient.py index dc407be..5c59d7a 100644 --- a/IrcClient.py +++ b/IrcClient.py @@ -2,17 +2,17 @@ # # mirc2png -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) # Copyright (c) 2018 Lucio Andrés Illanes Albornoz -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index f996f49..4b9b4ca 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -2,17 +2,17 @@ # # IrcMiRCARTBot.py -- IRC<->MiRC2png bot (for EFnet #MiRCART) # Copyright (c) 2018 Lucio Andrés Illanes Albornoz -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/MiRC2png.py b/MiRC2png.py index 7b1633e..ec5ca9d 100755 --- a/MiRC2png.py +++ b/MiRC2png.py @@ -2,17 +2,17 @@ # # MiRC2png.py -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) # Copyright (c) 2018 Lucio Andrés Illanes Albornoz -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/MiRCART.py b/MiRCART.py index 536113f..895ede0 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -2,17 +2,17 @@ # # MiRCART.py -- mIRC art editor for Windows & Linux # Copyright (c) 2018 Lucio Andrés Illanes Albornoz -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -97,7 +97,7 @@ class MiRCARTCanvas(wx.Panel): self._drawPatch(patch, eventDc, tmpDc, atPoint) self.parentFrame.onCanvasUpdate() # }}} - # {{{ _pushUndo(self, atPoint, patch): XXXX + # {{{ _pushUndo(self, atPoint, patch): XXX def _pushUndo(self, atPoint, patch, mapItem): if self.patchesUndoLevel > 0: del self.patchesUndo[0:self.patchesUndoLevel] From d93e1fecda5caa3dfc186d4bc3512ab66af627c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sat, 6 Jan 2018 04:42:15 +0100 Subject: [PATCH 070/148] MiRCART.py:MiRCARTCanvasJournal: split from MiRCARTCanvas. --- MiRCART.py | 164 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 99 insertions(+), 65 deletions(-) diff --git a/MiRCART.py b/MiRCART.py index 895ede0..9095dd7 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -47,13 +47,92 @@ mircColours = [ ] # }}} +class MiRCARTCanvasJournal(): + """XXX""" + parentCanvas = None + patchesTmp = patchesUndo = patchesUndoLevel = None + + # {{{ _popTmp(self, eventDc, tmpDc): XXX + def _popTmp(self, eventDc, tmpDc): + if self.patchesTmp: + for patch in self.patchesTmp: + patch[2:] = self.parentCanvas._getMapCell([patch[0], patch[1]]) + self.parentCanvas.onJournalUpdate(True, \ + (patch[0:2]), patch, eventDc, tmpDc, (0, 0)) + self.patchesTmp = [] + # }}} + # {{{ _pushTmp(self, atPoint, patch): XXX + def _pushTmp(self, absMapPoint): + self.patchesTmp.append([*absMapPoint, None, None, None]) + # }}} + # {{{ _pushUndo(self, atPoint, patch): XXX + def _pushUndo(self, atPoint, patch, mapItem): + if self.patchesUndoLevel > 0: + del self.patchesUndo[0:self.patchesUndoLevel] + self.patchesUndoLevel = 0 + absMapPoint = self._relMapPointToAbsMapPoint((patch[0], patch[1]), atPoint) + self.patchesUndo.insert(0, ( \ + (absMapPoint[0], absMapPoint[1], mapItem[0], mapItem[1], mapItem[2]), \ + (absMapPoint[0], absMapPoint[1], patch[2], patch[3], patch[4]))) + # }}} + # {{{ _relMapPointToAbsMapPoint(self, relMapPoint, atPoint): XXX + def _relMapPointToAbsMapPoint(self, relMapPoint, atPoint): + return (atPoint[0] + relMapPoint[0], atPoint[1] + relMapPoint[1]) + # }}} + # {{{ merge(self, mapPatches, eventDc, tmpDc, atPoint): XXX + def merge(self, mapPatches, eventDc, tmpDc, atPoint): + for mapPatch in mapPatches: + mapPatchTmp = mapPatch[0] + if mapPatchTmp: + self._popTmp(eventDc, tmpDc) + for patch in mapPatch[1]: + absMapPoint = self._relMapPointToAbsMapPoint(patch[0:2], atPoint) + mapItem = self.parentCanvas._getMapCell(absMapPoint) + if mapPatchTmp: + self._pushTmp(absMapPoint) + self.parentCanvas.onJournalUpdate(mapPatchTmp, \ + absMapPoint, patch, eventDc, tmpDc, atPoint) + elif mapItem != patch[2:5]: + self._pushUndo(atPoint, patch, mapItem) + self.parentCanvas.onJournalUpdate(mapPatchTmp, \ + absMapPoint, patch, eventDc, tmpDc, atPoint) + # }}} + # {{{ redo(self): XXX + def redo(self): + if self.patchesUndoLevel > 0: + self.patchesUndoLevel -= 1 + redoPatch = self.patchesUndo[self.patchesUndoLevel][1] + self.parentCanvas.onJournalUpdate(False, \ + (redoPatch[0:2]), redoPatch, None, None, (0, 0)) + return True + else: + return False + # }}} + # {{{ undo(self): XXX + def undo(self): + if self.patchesUndo[self.patchesUndoLevel] != None: + undoPatch = self.patchesUndo[self.patchesUndoLevel][0] + self.patchesUndoLevel += 1 + self.parentCanvas.onJournalUpdate(False, \ + (undoPatch[0:2]), undoPatch, None, None, (0, 0)) + return True + else: + return False + # }}} + # {{{ __init__(self, parentCanvas): initialisation method + def __init__(self, parentCanvas): + self.parentCanvas = parentCanvas + self.patchesTmp = [] + self.patchesUndo = [None]; self.patchesUndoLevel = 0; + # }}} + class MiRCARTCanvas(wx.Panel): """XXX""" parentFrame = None canvasPos = canvasSize = canvasWinSize = cellPos = cellSize = None canvasBitmap = canvasMap = canvasTools = None mircBg = mircFg = mircBrushes = mircPens = None - patchesTmp = patchesUndo = patchesUndoLevel = None + canvasJournal = None # {{{ _drawPatch(self, patch, eventDc, tmpDc, atPoint): XXX def _drawPatch(self, patch, eventDc, tmpDc, atPoint): @@ -76,41 +155,6 @@ class MiRCARTCanvas(wx.Panel): def _getMapCell(self, absMapPoint): return self.canvasMap[absMapPoint[1]][absMapPoint[0]] # }}} - # {{{ _processMapPatches(self, mapPatches, eventDc, tmpDc, atPoint): XXX - def _processMapPatches(self, mapPatches, eventDc, tmpDc, atPoint): - for mapPatch in mapPatches: - mapPatchTmp = mapPatch[0] - if mapPatchTmp and self.patchesTmp: - for patch in self.patchesTmp: - patch[2:] = self._getMapCell([patch[0], patch[1]]) - self._drawPatch(patch, eventDc, tmpDc, (0, 0)) - self.patchesTmp = [] - for patch in mapPatch[1]: - absMapPoint = self._relMapPointToAbsMapPoint(patch[0:2], atPoint) - mapItem = self._getMapCell(absMapPoint) - if mapPatchTmp: - self.patchesTmp.append([*absMapPoint, None, None, None]) - self._drawPatch(patch, eventDc, tmpDc, atPoint) - elif mapItem != patch[2:5]: - self._pushUndo(atPoint, patch, mapItem) - self._setMapCell(absMapPoint, *patch[2:5]) - self._drawPatch(patch, eventDc, tmpDc, atPoint) - self.parentFrame.onCanvasUpdate() - # }}} - # {{{ _pushUndo(self, atPoint, patch): XXX - def _pushUndo(self, atPoint, patch, mapItem): - if self.patchesUndoLevel > 0: - del self.patchesUndo[0:self.patchesUndoLevel] - self.patchesUndoLevel = 0 - absMapPoint = self._relMapPointToAbsMapPoint((patch[0], patch[1]), atPoint) - self.patchesUndo.insert(0, ( \ - (absMapPoint[0], absMapPoint[1], mapItem[0], mapItem[1], mapItem[2]), \ - (absMapPoint[0], absMapPoint[1], patch[2], patch[3], patch[4]))) - # }}} - # {{{ _relMapPointToAbsMapPoint(self, relMapPoint, atPoint): XXX - def _relMapPointToAbsMapPoint(self, relMapPoint, atPoint): - return (atPoint[0] + relMapPoint[0], atPoint[1] + relMapPoint[1]) - # }}} # {{{ _relMapPointToAbsPoint(self, relMapPoint, atPoint): XXX def _relMapPointToAbsPoint(self, relMapPoint, atPoint): absX = (atPoint[0] + relMapPoint[0]) * self.cellSize[0] @@ -122,6 +166,19 @@ class MiRCARTCanvas(wx.Panel): self.canvasMap[absMapPoint[1]][absMapPoint[0]] = [colourFg, colourBg, char] # }}} + # {{{ onJournalUpdate(self, isTmp, absMapPoint, patch, eventDc, tmpDc, atPoint): + def onJournalUpdate(self, isTmp, absMapPoint, patch, eventDc, tmpDc, atPoint): + if eventDc == None: + eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); + if tmpDc == None: + tmpDc.SelectObject(self.canvasBitmap) + if isTmp == True: + self._drawPatch(patch, eventDc, tmpDc, atPoint) + else: + self._setMapCell(absMapPoint, *patch[2:5]) + self._drawPatch(patch, eventDc, tmpDc, atPoint) + self.parentFrame.onCanvasUpdate() + # }}} # {{{ onMouseEvent(self, event): XXX def onMouseEvent(self, event): eventObject = event.GetEventObject() @@ -132,7 +189,7 @@ class MiRCARTCanvas(wx.Panel): for tool in self.canvasTools: mapPatches = tool.onMouseEvent(event, mapPoint, event.Dragging(), \ event.LeftIsDown(), event.RightIsDown()) - self._processMapPatches(mapPatches, eventDc, tmpDc, mapPoint) + self.canvasJournal.merge(mapPatches, eventDc, tmpDc, mapPoint) # }}} # {{{ onPaint(self, event): XXX def onPaint(self, event): @@ -140,33 +197,11 @@ class MiRCARTCanvas(wx.Panel): # }}} # {{{ redo(self): XXX def redo(self): - if self.patchesUndoLevel > 0: - self.patchesUndoLevel -= 1 - redoPatch = self.patchesUndo[self.patchesUndoLevel][1] - self._setMapCell([redoPatch[0], redoPatch[1]], \ - redoPatch[2], redoPatch[3], redoPatch[4]) - eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); - tmpDc.SelectObject(self.canvasBitmap) - self._drawPatch(redoPatch, eventDc, tmpDc, (0, 0)) - self.parentFrame.onCanvasUpdate() - return True - else: - return False + return self.canvasJournal.redo() # }}} # {{{ undo(self): XXX def undo(self): - if self.patchesUndo[self.patchesUndoLevel] != None: - undoPatch = self.patchesUndo[self.patchesUndoLevel][0] - self._setMapCell([undoPatch[0], undoPatch[1]], \ - undoPatch[2], undoPatch[3], undoPatch[4]) - eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); - tmpDc.SelectObject(self.canvasBitmap) - self._drawPatch(undoPatch, eventDc, tmpDc, (0, 0)) - self.patchesUndoLevel += 1 - self.parentFrame.onCanvasUpdate() - return True - else: - return False + return self.canvasJournal.undo() # }}} # {{{ __init__(self, parent, parentFrame, canvasPos, cellSize, canvasSize, canvasTools): Initialisation method def __init__(self, parent, parentFrame, canvasPos, cellSize, canvasSize, canvasTools): @@ -191,8 +226,7 @@ class MiRCARTCanvas(wx.Panel): self.mircPens[mircColour] = wx.Pen( \ wx.Colour(mircColours[mircColour]), 1) - self.patchesTmp = [] - self.patchesUndo = [None]; self.patchesUndoLevel = 0; + self.canvasJournal = MiRCARTCanvasJournal(self) self.Bind(wx.EVT_LEFT_DOWN, self.onMouseEvent) self.Bind(wx.EVT_MOTION, self.onMouseEvent) @@ -409,11 +443,11 @@ class MiRCARTFrame(wx.Frame): # {{{ onCanvasUpdate(self): XXX def onCanvasUpdate(self): - if self.panelCanvas.patchesUndo[self.panelCanvas.patchesUndoLevel] != None: + if self.panelCanvas.canvasJournal.patchesUndo[self.panelCanvas.canvasJournal.patchesUndoLevel] != None: self.menuItemsById[self.CID_UNDO[0]].Enable(True) else: self.menuItemsById[self.CID_UNDO[0]].Enable(False) - if self.panelCanvas.patchesUndoLevel > 0: + if self.panelCanvas.canvasJournal.patchesUndoLevel > 0: self.menuItemsById[self.CID_REDO[0]].Enable(True) else: self.menuItemsById[self.CID_REDO[0]].Enable(False) From 0259662a4e27ff8385e9f40f36be1efefbd58377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sat, 6 Jan 2018 16:38:20 +0100 Subject: [PATCH 071/148] IrcClient.py:IrcClient.connect(): explicitly pass encoding="utf-8" to clientSocket.makeFile(). --- IrcClient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IrcClient.py b/IrcClient.py index 5c59d7a..0816558 100644 --- a/IrcClient.py +++ b/IrcClient.py @@ -52,7 +52,7 @@ class IrcClient: self.close(); return False; else: select.select([], [self.clientSocket.fileno()], []) - self.clientSocketFile = self.clientSocket.makefile() + self.clientSocketFile = self.clientSocket.makefile(encoding="utf-8") self.clientQueue = [] self.queue("NICK", self.clientNick) self.queue("USER", self.clientIdent, "0", "0", self.clientGecos) From 4abf68e168a07b9870633b5db0c8fd51c3e76ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sun, 7 Jan 2018 02:08:35 +0100 Subject: [PATCH 072/148] MiRCART.py: hand off to MiRCARTFrame(). MiRCARTCanvas.py: split from MiRCART.py. MiRCARTCanvasJournal.py: split from MiRCART.py. MiRCARTColours.py: split from MiRCART.py. MiRCARTFrame.py: split from MiRCART.py. MiRCARTFromTextFile.py: initial implementation. MiRCARTToPastebin.py: initial implementation. MiRCARTToPngFile.py, IrcMiRCARTBot.py: renamed MiRC2png to MiRCARTToPngFile. MiRCARTToTextFile.py: split from MiRCART.py. MiRCARTTool.py: split from MiRCART.py. MiRCARTToolRect.py: split from MiRCART.py. README.md: updated. --- IrcMiRCARTBot.py | 5 +- MiRC2png.py | 256 -------------------- MiRCART.py | 516 +--------------------------------------- MiRCARTCanvas.py | 157 ++++++++++++ MiRCARTCanvasJournal.py | 105 ++++++++ MiRCARTColours.py | 47 ++++ MiRCARTFrame.py | 375 +++++++++++++++++++++++++++++ MiRCARTFromTextFile.py | 147 ++++++++++++ MiRCARTToPastebin.py | 55 +++++ MiRCARTToPngFile.py | 145 +++++++++++ MiRCARTToTextFile.py | 47 ++++ MiRCARTTool.py | 39 +++ MiRCARTToolRect.py | 52 ++++ README.md | 2 +- 14 files changed, 1177 insertions(+), 771 deletions(-) delete mode 100755 MiRC2png.py create mode 100644 MiRCARTCanvas.py create mode 100644 MiRCARTCanvasJournal.py create mode 100755 MiRCARTColours.py create mode 100644 MiRCARTFrame.py create mode 100644 MiRCARTFromTextFile.py create mode 100644 MiRCARTToPastebin.py create mode 100755 MiRCARTToPngFile.py create mode 100644 MiRCARTToTextFile.py create mode 100644 MiRCARTTool.py create mode 100644 MiRCARTToolRect.py diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index 4b9b4ca..6d75554 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -25,8 +25,9 @@ import base64 import os, sys, time import json -import IrcClient, MiRC2png +import IrcClient import requests, urllib.request +from MiRCARTToPngFile import MiRCARTToPngFile class IrcMiRCARTBot(IrcClient.IrcClient): """IRC<->MiRC2png bot""" @@ -138,7 +139,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): self._log("Unknown URL type specified!") self.queue("PRIVMSG", message[2], "4/!\\ Unknown URL type specified!") return - MiRC2png.MiRC2png(asciiTmpFilePath, imgTmpFilePath, "DejaVuSansMono.ttf", 11) + MiRCARTToPngFile(asciiTmpFilePath, "DejaVuSansMono.ttf", 11).export(imgTmpFilePath) imgurResponse = self._uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") if imgurResponse[0] == 200: self._log("Uploaded as: {}".format(imgurResponse[1])) diff --git a/MiRC2png.py b/MiRC2png.py deleted file mode 100755 index ec5ca9d..0000000 --- a/MiRC2png.py +++ /dev/null @@ -1,256 +0,0 @@ -#!/usr/bin/env python3 -# -# MiRC2png.py -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) -# Copyright (c) 2018 Lucio Andrés Illanes Albornoz -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# - -from enum import Enum -from PIL import Image, ImageDraw, ImageFont -import string, sys - -class MiRC2png: - """Abstraction over ASCIIs containing mIRC control codes""" - inFilePath = inFile = None; - inLines = inColsMax = inRows = None; - - outFontFilePath = outFontSize = None; - outImg = outImgDraw = outImgFont = None; - outCurColourBg = outCurColourFg = None; - outCurX = outCurY = None; - - inCurBold = inCurItalic = inCurUnderline = None; - inCurColourSpec = None; - state = None; - inCurCol = inCurDigits = None; - - # {{{ _ColourMapBold: mIRC colour number to RGBA map given ^B (bold) - _ColourMapBold = [ - (255, 255, 255, 255), # White - (85, 85, 85, 255), # Grey - (85, 85, 255, 255), # Light Blue - (85, 255, 85, 255), # Light Green - (255, 85, 85, 255), # Light Red - (255, 85, 85, 255), # Light Red - (255, 85, 255, 255), # Pink - (255, 255, 85, 255), # Light Yellow - (255, 255, 85, 255), # Light Yellow - (85, 255, 85, 255), # Light Green - (85, 255, 255, 255), # Light Cyan - (85, 255, 255, 255), # Light Cyan - (85, 85, 255, 255), # Light Blue - (255, 85, 255, 255), # Pink - (85, 85, 85, 255), # Grey - (255, 255, 255, 255), # White - ] - # }}} - # {{{ _ColourMapNormal: mIRC colour number to RGBA map given none of ^[BFV_] (bold, italic, reverse, underline) - _ColourMapNormal = [ - (255, 255, 255, 255), # White - (0, 0, 0, 255), # Black - (0, 0, 187, 255), # Blue - (0, 187, 0, 255), # Green - (255, 85, 85, 255), # Light Red - (187, 0, 0, 255), # Red - (187, 0, 187, 255), # Purple - (187, 187, 0, 255), # Yellow - (255, 255, 85, 255), # Light Yellow - (85, 255, 85, 255), # Light Green - (0, 187, 187, 255), # Cyan - (85, 255, 255, 255), # Light Cyan - (85, 85, 255, 255), # Light Blue - (255, 85, 255, 255), # Pink - (85, 85, 85, 255), # Grey - (187, 187, 187, 255), # Light Grey - ] - # }}} - # {{{ _State(Enum): Parsing loop state - class _State(Enum): - STATE_CHAR = 1 - STATE_COLOUR_SPEC = 2 - STATE_CSPEC_DIGIT0 = 2 - STATE_CSPEC_DIGIT1 = 3 - # }}} - - # {{{ _countChar(self, char): XXX - def _countChar(self, char): - return True - # }}} - # {{{ _countColourSpecState(self, colourSpec): XXX - def _countColourSpecState(self, colourSpec): - return 0 - # }}} - # {{{ _render(self): XXX - def _render(self): - self.outCurX = 0; self.outCurY = 0; - for inCurRow in range(0, len(self.inLines)): - self.inCurBold = 0; self.inCurItalic = 0; self.inCurUnderline = 0; - self.inCurColourSpec = ""; self._State = self._State.STATE_CHAR; - self.inCurCol = 0; self.inCurDigits = 0; - while self.inCurCol < len(self.inLines[inCurRow]): - if self._State == self._State.STATE_CHAR: - self._parseAsChar( \ - self.inLines[inCurRow][self.inCurCol], \ - self._syncChar) - elif self._State == self._State.STATE_CSPEC_DIGIT0 \ - or self._State == self._State.STATE_CSPEC_DIGIT1: \ - self._parseAsColourSpec( \ - self.inLines[inCurRow][self.inCurCol], \ - self._syncColourSpecState) - self.outCurX = 0; self.outCurY += self.outImgFontSize[1]; - # }}} - # {{{ _getMaxCols(self, lines): Calculate widest row in lines, ignoring non-printable & mIRC control code sequences - def _getMaxCols(self, lines): - maxCols = 0; - for inCurRow in range(0, len(lines)): - self.inCurBold = 0; self.inCurItalic = 0; self.inCurUnderline = 0; - self.inCurColourSpec = ""; self._State = self._State.STATE_CHAR; - self.inCurCol = 0; self.inCurDigits = 0; curRowCols = 0; - while self.inCurCol < len(self.inLines[inCurRow]): - if self._State == self._State.STATE_CHAR: - if self._parseAsChar( \ - self.inLines[inCurRow][self.inCurCol], self._countChar): - curRowCols += 1 - elif self._State == self._State.STATE_CSPEC_DIGIT0 \ - or self._State == self._State.STATE_CSPEC_DIGIT1: - self._parseAsColourSpec( \ - self.inLines[inCurRow][self.inCurCol], \ - self._countColourSpecState) - maxCols = max(maxCols, curRowCols) - return maxCols - # }}} - # {{{ _parseAsChar(self, char, fn): Parse single character as regular character and mutate state - def _parseAsChar(self, char, fn): - if char == "": - self._State = self._State.STATE_CSPEC_DIGIT0; self.inCurCol += 1; - return False - else: - self.inCurCol += 1; return fn(char); - # }}} - # {{{ _parseAsColourSpec(self, char, fn): Parse single character as mIRC colour control code sequence and mutate state - def _parseAsColourSpec(self, char, fn): - if self._State == self._State.STATE_CSPEC_DIGIT0 \ - and char == ",": - self.inCurColourSpec += char; self.inCurCol += 1; - self._State = self._State.STATE_CSPEC_DIGIT1; - self.inCurDigits = 0 - return [False] - elif self._State == self._State.STATE_CSPEC_DIGIT0 \ - and char in set("0123456789") \ - and self.inCurDigits <= 1: - self.inCurColourSpec += char; self.inCurCol += 1; - self.inCurDigits += 1 - return [False] - elif self._State == self._State.STATE_CSPEC_DIGIT1 \ - and char in set("0123456789") \ - and self.inCurDigits <= 1: - self.inCurColourSpec += char; self.inCurCol += 1; - self.inCurDigits += 1 - return [False] - else: - result = fn(self.inCurColourSpec) - self.inCurColourSpec = ""; self._State = self._State.STATE_CHAR; - self.inCurDigits = 0 - return [True, result] - # }}} - # {{{ _syncChar(self, char): XXX - def _syncChar(self, char): - if char == "": - self.inCurBold = 0 if self.inCurBold else 1; - elif char == "": - self.inCurItalic = 0 if self.inCurItalic else 1; - elif char == "": - self.inCurBold = 0; self.inCurItalic = 0; self.inCurUnderline = 0; - self.inCurColourSpec = ""; - elif char == "": - self.outCurColourBg, self.outCurColourFg = self.outCurColourFg, self.outCurColourBg; - elif char == "": - self.inCurUnderline = 0 if self.inCurUnderline else 1; - elif char == " ": - if self.inCurBold: - colourBg = self._ColourMapBold[self.outCurColourBg] - else: - colourBg = self._ColourMapNormal[self.outCurColourBg] - self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + self.outImgFontSize[0], self.outCurY + self.outImgFontSize[1])), fill=colourBg) - if self.inCurUnderline: - self.outImgDraw.line((self.outCurX, self.outCurY + (self.outImgFontSize[1] - 2), self.outCurX + self.outImgFontSize[0], self.outCurY + (self.outImgFontSize[1] - 2)), fill=colourFg) - self.outCurX += self.outImgFontSize[0]; - else: - if self.inCurBold: - colourBg = self._ColourMapBold[self.outCurColourBg] - colourFg = self._ColourMapBold[self.outCurColourFg] - else: - colourBg = self._ColourMapNormal[self.outCurColourBg] - colourFg = self._ColourMapNormal[self.outCurColourFg] - self.outImgDraw.rectangle(((self.outCurX, self.outCurY), (self.outCurX + self.outImgFontSize[0], self.outCurY + self.outImgFontSize[1])), fill=colourBg) - # XXX implement italic - self.outImgDraw.text((self.outCurX, self.outCurY), char, colourFg, self.outImgFont) - if self.inCurUnderline: - self.outImgDraw.line((self.outCurX, self.outCurY + (self.outImgFontSize[1] - 2), self.outCurX + self.outImgFontSize[0], self.outCurY + (self.outImgFontSize[1] - 2)), fill=colourFg) - self.outCurX += self.outImgFontSize[0]; - return True - # }}} - # {{{ _syncColourSpecState(self, colourSpec): XXX - def _syncColourSpecState(self, colourSpec): - if len(colourSpec) > 0: - colourSpec = colourSpec.split(",") - if len(colourSpec) == 2: - self.outCurColourFg = int(colourSpec[0]) - self.outCurColourBg = int(colourSpec[1] or self.outCurColourBg) - elif len(colourSpec) == 1: - self.outCurColourFg = int(colourSpec[0]) - else: - self.outCurColourBg = 1; self.outCurColourFg = 15; - return True - # }}} - - # - # __init__(self, inFilePath, imgFilePath, fontFilePath="DejaVuSansMono.ttf", fontSize=11): initialisation method - def __init__(self, inFilePath, imgFilePath, fontFilePath="DejaVuSansMono.ttf", fontSize=11): - self.inFilePath = inFilePath; self.inFile = open(inFilePath, "r"); - self.inLines = self.inFile.readlines() - self.inColsMax = self._getMaxCols(self.inLines) - self.inRows = len(self.inLines) - self.outFontFilePath = fontFilePath; self.outFontSize = int(fontSize); - self.outImgFont = ImageFont.truetype(self.outFontFilePath, self.outFontSize) - self.outImgFontSize = list(self.outImgFont.getsize(" ")); self.outImgFontSize[1] += 3; - self.outImg = Image.new("RGBA", (self.inColsMax * self.outImgFontSize[0], self.inRows * self.outImgFontSize[1]), self._ColourMapNormal[1]) - self.outImgDraw = ImageDraw.Draw(self.outImg) - self.outCurColourBg = 1; self.outCurColourFg = 15; - self._render() - self.inFile.close(); - self.outImg.save(imgFilePath); - -# -# Entry point -def main(*argv): - MiRC2png(*argv[1:]) -if __name__ == "__main__": - if ((len(sys.argv) - 1) < 2)\ - or ((len(sys.argv) - 1) > 4): - print("usage: {} " \ - " " \ - " " \ - "[] " \ - "[]".format(sys.argv[0]), file=sys.stderr) - else: - main(*sys.argv) - -# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCART.py b/MiRCART.py index 9095dd7..28e9d36 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -22,523 +22,15 @@ # SOFTWARE. # -import enum -import wx -import os, sys - -# {{{ mircColours: mIRC colour number to RGBA map given none of ^[BFV_] (bold, italic, reverse, underline) -mircColours = [ - (255, 255, 255, 255), # White - (0, 0, 0, 255), # Black - (0, 0, 187, 255), # Blue - (0, 187, 0, 255), # Green - (255, 85, 85, 255), # Light Red - (187, 0, 0, 255), # Red - (187, 0, 187, 255), # Purple - (187, 187, 0, 255), # Yellow - (255, 255, 85, 255), # Light Yellow - (85, 255, 85, 255), # Light Green - (0, 187, 187, 255), # Cyan - (85, 255, 255, 255), # Light Cyan - (85, 85, 255, 255), # Light Blue - (255, 85, 255, 255), # Pink - (85, 85, 85, 255), # Grey - (187, 187, 187, 255), # Light Grey -] -# }}} - -class MiRCARTCanvasJournal(): - """XXX""" - parentCanvas = None - patchesTmp = patchesUndo = patchesUndoLevel = None - - # {{{ _popTmp(self, eventDc, tmpDc): XXX - def _popTmp(self, eventDc, tmpDc): - if self.patchesTmp: - for patch in self.patchesTmp: - patch[2:] = self.parentCanvas._getMapCell([patch[0], patch[1]]) - self.parentCanvas.onJournalUpdate(True, \ - (patch[0:2]), patch, eventDc, tmpDc, (0, 0)) - self.patchesTmp = [] - # }}} - # {{{ _pushTmp(self, atPoint, patch): XXX - def _pushTmp(self, absMapPoint): - self.patchesTmp.append([*absMapPoint, None, None, None]) - # }}} - # {{{ _pushUndo(self, atPoint, patch): XXX - def _pushUndo(self, atPoint, patch, mapItem): - if self.patchesUndoLevel > 0: - del self.patchesUndo[0:self.patchesUndoLevel] - self.patchesUndoLevel = 0 - absMapPoint = self._relMapPointToAbsMapPoint((patch[0], patch[1]), atPoint) - self.patchesUndo.insert(0, ( \ - (absMapPoint[0], absMapPoint[1], mapItem[0], mapItem[1], mapItem[2]), \ - (absMapPoint[0], absMapPoint[1], patch[2], patch[3], patch[4]))) - # }}} - # {{{ _relMapPointToAbsMapPoint(self, relMapPoint, atPoint): XXX - def _relMapPointToAbsMapPoint(self, relMapPoint, atPoint): - return (atPoint[0] + relMapPoint[0], atPoint[1] + relMapPoint[1]) - # }}} - # {{{ merge(self, mapPatches, eventDc, tmpDc, atPoint): XXX - def merge(self, mapPatches, eventDc, tmpDc, atPoint): - for mapPatch in mapPatches: - mapPatchTmp = mapPatch[0] - if mapPatchTmp: - self._popTmp(eventDc, tmpDc) - for patch in mapPatch[1]: - absMapPoint = self._relMapPointToAbsMapPoint(patch[0:2], atPoint) - mapItem = self.parentCanvas._getMapCell(absMapPoint) - if mapPatchTmp: - self._pushTmp(absMapPoint) - self.parentCanvas.onJournalUpdate(mapPatchTmp, \ - absMapPoint, patch, eventDc, tmpDc, atPoint) - elif mapItem != patch[2:5]: - self._pushUndo(atPoint, patch, mapItem) - self.parentCanvas.onJournalUpdate(mapPatchTmp, \ - absMapPoint, patch, eventDc, tmpDc, atPoint) - # }}} - # {{{ redo(self): XXX - def redo(self): - if self.patchesUndoLevel > 0: - self.patchesUndoLevel -= 1 - redoPatch = self.patchesUndo[self.patchesUndoLevel][1] - self.parentCanvas.onJournalUpdate(False, \ - (redoPatch[0:2]), redoPatch, None, None, (0, 0)) - return True - else: - return False - # }}} - # {{{ undo(self): XXX - def undo(self): - if self.patchesUndo[self.patchesUndoLevel] != None: - undoPatch = self.patchesUndo[self.patchesUndoLevel][0] - self.patchesUndoLevel += 1 - self.parentCanvas.onJournalUpdate(False, \ - (undoPatch[0:2]), undoPatch, None, None, (0, 0)) - return True - else: - return False - # }}} - # {{{ __init__(self, parentCanvas): initialisation method - def __init__(self, parentCanvas): - self.parentCanvas = parentCanvas - self.patchesTmp = [] - self.patchesUndo = [None]; self.patchesUndoLevel = 0; - # }}} - -class MiRCARTCanvas(wx.Panel): - """XXX""" - parentFrame = None - canvasPos = canvasSize = canvasWinSize = cellPos = cellSize = None - canvasBitmap = canvasMap = canvasTools = None - mircBg = mircFg = mircBrushes = mircPens = None - canvasJournal = None - - # {{{ _drawPatch(self, patch, eventDc, tmpDc, atPoint): XXX - def _drawPatch(self, patch, eventDc, tmpDc, atPoint): - absPoint = self._relMapPointToAbsPoint((patch[0], patch[1]), atPoint) - brushFg = self.mircBrushes[patch[2]]; brushBg = self.mircBrushes[patch[3]]; - pen = self.mircPens[patch[2]] - for dc in (eventDc, tmpDc): - dc.SetBrush(brushFg); dc.SetBackground(brushBg); dc.SetPen(pen); - dc.DrawRectangle(absPoint[0], absPoint[1], self.cellSize[0], self.cellSize[1]) - # }}} - # {{{ _eventPointToMapPoint(self, eventPoint): XXX - def _eventPointToMapPoint(self, eventPoint): - rectX = eventPoint.x - (eventPoint.x % self.cellSize[0]) - rectY = eventPoint.y - (eventPoint.y % self.cellSize[1]) - mapX = int(rectX / self.cellSize[0] if rectX else 0) - mapY = int(rectY / self.cellSize[1] if rectY else 0) - return (mapX, mapY) - # }}} - # {{{ _getMapCell(self, absMapPoint): XXX - def _getMapCell(self, absMapPoint): - return self.canvasMap[absMapPoint[1]][absMapPoint[0]] - # }}} - # {{{ _relMapPointToAbsPoint(self, relMapPoint, atPoint): XXX - def _relMapPointToAbsPoint(self, relMapPoint, atPoint): - absX = (atPoint[0] + relMapPoint[0]) * self.cellSize[0] - absY = (atPoint[1] + relMapPoint[1]) * self.cellSize[1] - return (absX, absY) - # }}} - # {{{ _setMapCell(self, absMapPoint, colourFg, colourBg, char): XXX - def _setMapCell(self, absMapPoint, colourFg, colourBg, char): - self.canvasMap[absMapPoint[1]][absMapPoint[0]] = [colourFg, colourBg, char] - # }}} - - # {{{ onJournalUpdate(self, isTmp, absMapPoint, patch, eventDc, tmpDc, atPoint): - def onJournalUpdate(self, isTmp, absMapPoint, patch, eventDc, tmpDc, atPoint): - if eventDc == None: - eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); - if tmpDc == None: - tmpDc.SelectObject(self.canvasBitmap) - if isTmp == True: - self._drawPatch(patch, eventDc, tmpDc, atPoint) - else: - self._setMapCell(absMapPoint, *patch[2:5]) - self._drawPatch(patch, eventDc, tmpDc, atPoint) - self.parentFrame.onCanvasUpdate() - # }}} - # {{{ onMouseEvent(self, event): XXX - def onMouseEvent(self, event): - eventObject = event.GetEventObject() - eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); - tmpDc.SelectObject(self.canvasBitmap) - eventPoint = event.GetLogicalPosition(eventDc) - mapPoint = self._eventPointToMapPoint(eventPoint) - for tool in self.canvasTools: - mapPatches = tool.onMouseEvent(event, mapPoint, event.Dragging(), \ - event.LeftIsDown(), event.RightIsDown()) - self.canvasJournal.merge(mapPatches, eventDc, tmpDc, mapPoint) - # }}} - # {{{ onPaint(self, event): XXX - def onPaint(self, event): - eventDc = wx.BufferedPaintDC(self, self.canvasBitmap) - # }}} - # {{{ redo(self): XXX - def redo(self): - return self.canvasJournal.redo() - # }}} - # {{{ undo(self): XXX - def undo(self): - return self.canvasJournal.undo() - # }}} - # {{{ __init__(self, parent, parentFrame, canvasPos, cellSize, canvasSize, canvasTools): Initialisation method - def __init__(self, parent, parentFrame, canvasPos, cellSize, canvasSize, canvasTools): - self.parentFrame = parentFrame - canvasWinSize = (cellSize[0] * canvasSize[0], cellSize[1] * canvasSize[1]) - super().__init__(parent, pos=canvasPos, size=canvasWinSize) - self.canvasPos = canvasPos; self.canvasSize = canvasSize; self.canvasWinSize = canvasWinSize; - self.cellPos = (0, 0); self.cellSize = cellSize; - - self.canvasBitmap = wx.Bitmap(canvasWinSize) - self.canvasMap = [[[1, 1, " "] for x in range(canvasSize[0])] for y in range(canvasSize[1])] - self.canvasTools = [] - for canvasTool in canvasTools: - self.canvasTools.append(canvasTool(self)) - - self.mircBg = 1; self.mircFg = 4; - self.mircBrushes = [None for x in range(len(mircColours))] - self.mircPens = [None for x in range(len(mircColours))] - for mircColour in range(0, len(mircColours)): - self.mircBrushes[mircColour] = wx.Brush( \ - wx.Colour(mircColours[mircColour]), wx.BRUSHSTYLE_SOLID) - self.mircPens[mircColour] = wx.Pen( \ - wx.Colour(mircColours[mircColour]), 1) - - self.canvasJournal = MiRCARTCanvasJournal(self) - - self.Bind(wx.EVT_LEFT_DOWN, self.onMouseEvent) - self.Bind(wx.EVT_MOTION, self.onMouseEvent) - self.Bind(wx.EVT_PAINT, self.onPaint) - self.Bind(wx.EVT_RIGHT_DOWN, self.onMouseEvent) - # }}} - -class MiRCARTTool(): - """XXX""" - parentCanvas = None - - # {{{ onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): XXX - def onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): - pass - # }}} - # {{{ __init__(self, parentCanvas): initialisation method - def __init__(self, parentCanvas): - self.parentCanvas = parentCanvas - # }}} - -class MiRCARTToolRect(MiRCARTTool): - """XXX""" - - # {{{ onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): XXX - def onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): - if isLeftDown: - return [[False, [[0, 0, \ - self.parentCanvas.mircFg, \ - self.parentCanvas.mircFg, " "]]], - [True, [[0, 0, \ - self.parentCanvas.mircFg, \ - self.parentCanvas.mircFg, " "]]]] - elif isRightDown: - return [[False, [[0, 0, \ - self.parentCanvas.mircBg, \ - self.parentCanvas.mircBg, " "]]], \ - [True, [[0, 0, \ - self.parentCanvas.mircBg, \ - self.parentCanvas.mircBg, " "]]]] - else: - return [[True, [[0, 0, \ - self.parentCanvas.mircFg, \ - self.parentCanvas.mircFg, " "]]]] - # }}} - -class MiRCARTFrame(wx.Frame): - """XXX""" - panelSkin = panelCanvas = None - menuItemsById = menuBar = toolBar = accelTable = statusBar = None - - # {{{ Types - TID_COMMAND = (0x001) - TID_NOTHING = (0x002) - TID_MENU = (0x003) - TID_TOOLBAR = (0x004) - TID_ACCELS = (0x005) - # }}} - # {{{ Commands - # Id Type Id Labels Icon bitmap Accelerator - CID_NEW = (0x100, TID_COMMAND, "New", "&New", [wx.ART_NEW], None) - CID_OPEN = (0x101, TID_COMMAND, "Open", "&Open", [wx.ART_FILE_OPEN], None) - CID_SAVE = (0x102, TID_COMMAND, "Save", "&Save", [wx.ART_FILE_SAVE], None) - CID_SAVEAS = (0x103, TID_COMMAND, "Save As...", "Save &As...", [wx.ART_FILE_SAVE_AS], None) - CID_EXPORT_PASTEBIN = (0x104, TID_COMMAND, "Export to Pastebin...", "Export to Pasteb&in...", (), None) - CID_EXPORT_AS_PNG = (0x105, TID_COMMAND, "Export as PNG...", "Export as PN&G...", (), None) - CID_EXIT = (0x106, TID_COMMAND, "Exit", "E&xit", (), None) - CID_UNDO = (0x107, TID_COMMAND, "Undo", "&Undo", [wx.ART_UNDO], (wx.ACCEL_CTRL, ord("Z"))) - CID_REDO = (0x108, TID_COMMAND, "Redo", "&Redo", [wx.ART_REDO], (wx.ACCEL_CTRL, ord("Y"))) - CID_CUT = (0x109, TID_COMMAND, "Cut", "Cu&t", [wx.ART_CUT], None) - CID_COPY = (0x10a, TID_COMMAND, "Copy", "&Copy", [wx.ART_COPY], None) - CID_PASTE = (0x10b, TID_COMMAND, "Paste", "&Paste", [wx.ART_PASTE], None) - CID_DELETE = (0x10c, TID_COMMAND, "Delete", "De&lete", [wx.ART_DELETE], None) - CID_INCRBRUSH = (0x10d, TID_COMMAND, "Increase brush size", "&Increase brush size", [wx.ART_PLUS], None) - CID_DECRBRUSH = (0x10e, TID_COMMAND, "Decrease brush size", "&Decrease brush size", [wx.ART_MINUS], None) - CID_SOLIDBRUSH = (0x10f, TID_COMMAND, "Solid brush", "&Solid brush", [None], None) - CID_RECT = (0x110, TID_COMMAND, "Rectangle", "&Rectangle", [None], None) - CID_CIRCLE = (0x111, TID_COMMAND, "Circle", "&Circle", [None], None) - CID_LINE = (0x112, TID_COMMAND, "Line", "&Line", [None], None) - CID_COLOUR00 = (0x113, TID_COMMAND, "Colour #00", "Colour #00", mircColours[0], None) - CID_COLOUR01 = (0x114, TID_COMMAND, "Colour #01", "Colour #01", mircColours[1], None) - CID_COLOUR02 = (0x115, TID_COMMAND, "Colour #02", "Colour #02", mircColours[2], None) - CID_COLOUR03 = (0x116, TID_COMMAND, "Colour #03", "Colour #03", mircColours[3], None) - CID_COLOUR04 = (0x117, TID_COMMAND, "Colour #04", "Colour #04", mircColours[4], None) - CID_COLOUR05 = (0x118, TID_COMMAND, "Colour #05", "Colour #05", mircColours[5], None) - CID_COLOUR06 = (0x119, TID_COMMAND, "Colour #06", "Colour #06", mircColours[6], None) - CID_COLOUR07 = (0x11a, TID_COMMAND, "Colour #07", "Colour #07", mircColours[7], None) - CID_COLOUR08 = (0x11b, TID_COMMAND, "Colour #08", "Colour #08", mircColours[8], None) - CID_COLOUR09 = (0x11c, TID_COMMAND, "Colour #09", "Colour #09", mircColours[9], None) - CID_COLOUR10 = (0x11d, TID_COMMAND, "Colour #10", "Colour #10", mircColours[10], None) - CID_COLOUR11 = (0x11e, TID_COMMAND, "Colour #11", "Colour #11", mircColours[11], None) - CID_COLOUR12 = (0x11f, TID_COMMAND, "Colour #12", "Colour #12", mircColours[12], None) - CID_COLOUR13 = (0x120, TID_COMMAND, "Colour #13", "Colour #13", mircColours[13], None) - CID_COLOUR14 = (0x121, TID_COMMAND, "Colour #14", "Colour #14", mircColours[14], None) - CID_COLOUR15 = (0x122, TID_COMMAND, "Colour #15", "Colour #15", mircColours[15], None) - # }}} - # {{{ Non-items - NID_MENU_SEP = (0x200, TID_NOTHING) - NID_TOOLBAR_SEP = (0x201, TID_NOTHING) - # }}} - # {{{ Menus - MID_FILE = (0x300, TID_MENU, "File", "&File", ( \ - CID_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_MENU_SEP, \ - CID_EXPORT_PASTEBIN, CID_EXPORT_AS_PNG, NID_MENU_SEP, \ - CID_EXIT)) - MID_EDIT = (0x301, TID_MENU, "Edit", "&Edit", ( \ - CID_UNDO, CID_REDO, NID_MENU_SEP, \ - CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_MENU_SEP, \ - CID_INCRBRUSH, CID_DECRBRUSH, CID_SOLIDBRUSH)) - MID_TOOLS = (0x302, TID_MENU, "Tools", "&Tools", ( \ - CID_RECT, CID_CIRCLE, CID_LINE)) - # }}} - # {{{ Toolbars - BID_TOOLBAR = (0x400, TID_TOOLBAR, ( \ - CID_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_TOOLBAR_SEP, \ - CID_UNDO, CID_REDO, NID_TOOLBAR_SEP, \ - CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_TOOLBAR_SEP, \ - CID_INCRBRUSH, CID_DECRBRUSH, CID_SOLIDBRUSH, NID_TOOLBAR_SEP, \ - CID_RECT, CID_CIRCLE, CID_LINE, NID_TOOLBAR_SEP, \ - CID_COLOUR00, CID_COLOUR01, CID_COLOUR02, CID_COLOUR03, CID_COLOUR04, \ - CID_COLOUR05, CID_COLOUR06, CID_COLOUR07, CID_COLOUR08, CID_COLOUR09, \ - CID_COLOUR10, CID_COLOUR11, CID_COLOUR12, CID_COLOUR13, CID_COLOUR14, \ - CID_COLOUR15)) - # }}} - # {{{ Accelerators (hotkeys) - AID_EDIT = (0x500, TID_ACCELS, (CID_UNDO, CID_REDO)) - # }}} - - # {{{ _drawIcon(self, solidColour): XXX - def _drawIcon(self, solidColour): - iconBitmap = wx.Bitmap((16,16)) - iconDc = wx.MemoryDC(); iconDc.SelectObject(iconBitmap); - iconBrush = wx.Brush(wx.Colour(solidColour), wx.BRUSHSTYLE_SOLID) - iconDc.SetBrush(iconBrush); iconDc.SetBackground(iconBrush); - iconDc.SetPen(wx.Pen(wx.Colour(solidColour), 1)) - iconDc.DrawRectangle(0, 0, 16, 16) - return iconBitmap - # }}} - # {{{ _initAccelTable(self, accelsDescr, handler): XXX - def _initAccelTable(self, accelsDescr, handler): - accelTableEntries = [wx.AcceleratorEntry() for n in range(0, len(accelsDescr[2]))] - for numAccel in range(0, len(accelsDescr[2])): - accelDescr = accelsDescr[2][numAccel] - if accelDescr[5] != None: - accelTableEntries[numAccel].Set(accelDescr[5][0], accelDescr[5][1], accelDescr[0]) - self.Bind(wx.EVT_MENU, handler, id=accelDescr[0]) - return accelTableEntries - # }}} - # {{{ _initMenus(self, menuBar, menusDescr, handler): XXX - def _initMenus(self, menuBar, menusDescr, handler): - for menuDescr in menusDescr: - menuWindow = wx.Menu() - for menuItem in menuDescr[4]: - if menuItem == self.NID_MENU_SEP: - menuWindow.AppendSeparator() - else: - menuItemWindow = menuWindow.Append(menuItem[0], menuItem[3], menuItem[2]) - self.menuItemsById[menuItem[0]] = menuItemWindow - self.Bind(wx.EVT_MENU, handler, menuItemWindow) - menuBar.Append(menuWindow, menuDescr[3]) - # }}} - # {{{ _initToolBars(self, toolBar, toolBarsDescr, handler): XXX - def _initToolBars(self, toolBar, toolBarsDescr, handler): - for toolBarDescr in toolBarsDescr: - for toolBarItem in toolBarDescr[2]: - if toolBarItem == self.NID_TOOLBAR_SEP: - toolBar.AddSeparator() - else: - if len(toolBarItem[4]) == 4: - toolBarItemIcon = self._drawIcon(toolBarItem[4]) - elif len(toolBarItem[4]) == 1 \ - and toolBarItem[4][0] != None: - toolBarItemIcon = wx.ArtProvider.GetBitmap( \ - toolBarItem[4][0], wx.ART_TOOLBAR, (16,16)) - else: - toolBarItemIcon = wx.ArtProvider.GetBitmap( \ - wx.ART_HELP, wx.ART_TOOLBAR, (16,16)) - toolBarItemWindow = self.toolBar.AddTool( \ - toolBarItem[0], toolBarItem[2], toolBarItemIcon) - self.Bind(wx.EVT_TOOL, handler, toolBarItemWindow) - self.Bind(wx.EVT_TOOL_RCLICKED, handler, toolBarItemWindow) - # }}} - # {{{ _saveAs(self, pathName): XXX - def _saveAs(self, pathName): - try: - with open(pathName, "w") as file: - canvasMap = self.panelCanvas.canvasMap - canvasHeight = self.panelCanvas.canvasSize[1] - canvasWidth = self.panelCanvas.canvasSize[0] - for canvasRow in range(0, canvasHeight): - colourLastBg = colourLastFg = None; - for canvasCol in range(0, canvasWidth): - canvasColBg = canvasMap[canvasRow][canvasCol][0] - canvasColFg = canvasMap[canvasRow][canvasCol][1] - canvasColText = canvasMap[canvasRow][canvasCol][2] - if colourLastBg != canvasColBg \ - or colourLastFg != canvasColFg: - colourLastBg = canvasColBg; colourLastFg = canvasColFg; - file.write("" + str(canvasColFg) + "," + str(canvasColBg)) - file.write(canvasColText) - file.write("\n") - return [True] - except IOError as error: - return [False, error] - # }}} - # {{{ _updateStatusBar(self): XXX - def _updateStatusBar(self): - text = "Foreground colour:" - text += " " + str(self.panelCanvas.mircFg) - text += " | " - text += "Background colour:" - text += " " + str(self.panelCanvas.mircBg) - self.statusBar.SetStatusText(text) - # }}} - - # {{{ onCanvasUpdate(self): XXX - def onCanvasUpdate(self): - if self.panelCanvas.canvasJournal.patchesUndo[self.panelCanvas.canvasJournal.patchesUndoLevel] != None: - self.menuItemsById[self.CID_UNDO[0]].Enable(True) - else: - self.menuItemsById[self.CID_UNDO[0]].Enable(False) - if self.panelCanvas.canvasJournal.patchesUndoLevel > 0: - self.menuItemsById[self.CID_REDO[0]].Enable(True) - else: - self.menuItemsById[self.CID_REDO[0]].Enable(False) - # }}} - # {{{ onFrameCommand(self, event): XXX - def onFrameCommand(self, event): - cid = event.GetId() - if cid == self.CID_NEW[0]: - pass - elif cid == self.CID_OPEN[0]: - pass - elif cid == self.CID_SAVE[0]: - pass - elif cid == self.CID_SAVEAS[0]: - with wx.FileDialog(self, self.CID_SAVEAS[2], os.getcwd(), "", \ - "*.txt", wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) as dialog: - if dialog.ShowModal() == wx.ID_CANCEL: - return - else: - self._saveAs(dialog.GetPath()) - elif cid == self.CID_EXPORT_PASTEBIN[0]: - pass - elif cid == self.CID_EXPORT_AS_PNG[0]: - pass - elif cid == self.CID_EXIT[0]: - self.Close(True) - elif cid == self.CID_UNDO[0]: - self.panelCanvas.undo() - elif cid == self.CID_REDO[0]: - self.panelCanvas.redo() - elif cid == self.CID_CUT[0]: - pass - elif cid == self.CID_COPY[0]: - pass - elif cid == self.CID_PASTE[0]: - pass - elif cid == self.CID_DELETE[0]: - pass - elif cid == self.CID_INCRBRUSH[0]: - pass - elif cid == self.CID_DECRBRUSH[0]: - pass - elif cid == self.CID_SOLIDBRUSH[0]: - pass - elif cid == self.CID_RECT[0]: - pass - elif cid == self.CID_CIRCLE[0]: - pass - elif cid == self.CID_LINE[0]: - pass - elif cid >= self.CID_COLOUR00[0] \ - and cid <= self.CID_COLOUR15[0]: - numColour = cid - self.CID_COLOUR00[0] - if event.GetEventType() == wx.wxEVT_TOOL: - self.panelCanvas.mircFg = numColour - elif event.GetEventType() == wx.wxEVT_TOOL_RCLICKED: - self.panelCanvas.mircBg = numColour - self._updateStatusBar() - # }}} - # {{{ __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), cellSize=(7, 14), canvasSize=(80, 25)): initialisation method - def __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), cellSize=(7, 14), canvasSize=(80, 25)): - super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) - self.panelSkin = wx.Panel(self, wx.ID_ANY) - self.panelCanvas = MiRCARTCanvas(self.panelSkin, \ - parentFrame=self, canvasPos=canvasPos, cellSize=cellSize, \ - canvasSize=canvasSize, canvasTools=[MiRCARTToolRect]) - - self.menuItemsById = {}; self.menuBar = wx.MenuBar(); - self._initMenus(self.menuBar, \ - [self.MID_FILE, self.MID_EDIT, self.MID_TOOLS], self.onFrameCommand) - self.SetMenuBar(self.menuBar) - - self.toolBar = wx.ToolBar(self.panelSkin, -1, \ - style=wx.HORIZONTAL|wx.TB_FLAT|wx.TB_NODIVIDER) - self.toolBar.SetToolBitmapSize((16,16)) - self._initToolBars(self.toolBar, [self.BID_TOOLBAR], self.onFrameCommand) - self.toolBar.Realize(); self.toolBar.Fit(); - - self.accelTable = wx.AcceleratorTable( \ - self._initAccelTable(self.AID_EDIT, self.onFrameCommand)) - self.SetAcceleratorTable(self.accelTable) - - self.statusBar = self.CreateStatusBar(); self._updateStatusBar(); - self.SetFocus(); self.Show(True); self.onCanvasUpdate(); - # }}} +from MiRCARTFrame import MiRCARTFrame +from MiRCARTToolRect import MiRCARTToolRect +import sys, wx # # Entry point def main(*argv): wxApp = wx.App(False) - MiRCARTFrame(None) + MiRCARTFrame(None, canvasTools=[MiRCARTToolRect]) wxApp.MainLoop() if __name__ == "__main__": main(*sys.argv) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py new file mode 100644 index 0000000..3743b5c --- /dev/null +++ b/MiRCARTCanvas.py @@ -0,0 +1,157 @@ +#!/usr/bin/env python3 +# +# MiRCARTCanvas.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from MiRCARTCanvasJournal import MiRCARTCanvasJournal +from MiRCARTColours import MiRCARTColours +import wx + +class MiRCARTCanvas(wx.Panel): + """XXX""" + parentFrame = None + canvasPos = canvasSize = canvasWinSize = cellPos = cellSize = None + canvasBitmap = canvasMap = canvasTools = None + mircBg = mircFg = mircBrushes = mircPens = None + canvasJournal = None + + # {{{ _drawPatch(self, patch, eventDc, tmpDc, atPoint): XXX + def _drawPatch(self, patch, eventDc, tmpDc, atPoint): + absPoint = self._relMapPointToAbsPoint((patch[0], patch[1]), atPoint) + if patch[4] == " ": + brushFg = self.mircBrushes[patch[3]]; brushBg = self.mircBrushes[patch[3]]; + pen = self.mircPens[patch[3]] + else: + brushFg = self.mircBrushes[patch[2]]; brushBg = self.mircBrushes[patch[3]]; + pen = self.mircPens[patch[2]] + for dc in (eventDc, tmpDc): + dc.SetBrush(brushFg); dc.SetBackground(brushBg); dc.SetPen(pen); + dc.DrawRectangle(absPoint[0], absPoint[1], self.cellSize[0], self.cellSize[1]) + # }}} + # {{{ _eventPointToMapPoint(self, eventPoint): XXX + def _eventPointToMapPoint(self, eventPoint): + rectX = eventPoint.x - (eventPoint.x % self.cellSize[0]) + rectY = eventPoint.y - (eventPoint.y % self.cellSize[1]) + mapX = int(rectX / self.cellSize[0] if rectX else 0) + mapY = int(rectY / self.cellSize[1] if rectY else 0) + return (mapX, mapY) + # }}} + # {{{ _getMapCell(self, absMapPoint): XXX + def _getMapCell(self, absMapPoint): + return self.canvasMap[absMapPoint[1]][absMapPoint[0]] + # }}} + # {{{ _relMapPointToAbsPoint(self, relMapPoint, atPoint): XXX + def _relMapPointToAbsPoint(self, relMapPoint, atPoint): + absX = (atPoint[0] + relMapPoint[0]) * self.cellSize[0] + absY = (atPoint[1] + relMapPoint[1]) * self.cellSize[1] + return (absX, absY) + # }}} + # {{{ _setMapCell(self, absMapPoint, colourFg, colourBg, char): XXX + def _setMapCell(self, absMapPoint, colourFg, colourBg, char): + self.canvasMap[absMapPoint[1]][absMapPoint[0]] = [colourFg, colourBg, char] + # }}} + # {{{ onClose(self, event): XXX + def onClose(self, event): + self.Destroy(); self.__del__(); + # }}} + # {{{ onJournalUpdate(self, isTmp, absMapPoint, patch, eventDc, tmpDc, atPoint): + def onJournalUpdate(self, isTmp, absMapPoint, patch, eventDc, tmpDc, atPoint): + if eventDc == None: + eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); + if tmpDc == None: + tmpDc.SelectObject(self.canvasBitmap) + if isTmp == True: + self._drawPatch(patch, eventDc, tmpDc, atPoint) + else: + self._setMapCell(absMapPoint, *patch[2:5]) + self._drawPatch(patch, eventDc, tmpDc, atPoint) + self.parentFrame.onCanvasUpdate() + # }}} + # {{{ onMouseEvent(self, event): XXX + def onMouseEvent(self, event): + eventObject = event.GetEventObject() + eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); + tmpDc.SelectObject(self.canvasBitmap) + eventPoint = event.GetLogicalPosition(eventDc) + mapPoint = self._eventPointToMapPoint(eventPoint) + for tool in self.canvasTools: + mapPatches = tool.onMouseEvent(event, mapPoint, event.Dragging(), \ + event.LeftIsDown(), event.RightIsDown()) + self.canvasJournal.merge(mapPatches, eventDc, tmpDc, mapPoint) + # }}} + # {{{ onPaint(self, event): XXX + def onPaint(self, event): + eventDc = wx.BufferedPaintDC(self, self.canvasBitmap) + # }}} + # {{{ redo(self): XXX + def redo(self): + return self.canvasJournal.redo() + # }}} + # {{{ undo(self): XXX + def undo(self): + return self.canvasJournal.undo() + # }}} + # {{{ __del__(self): destructor method + def __del__(self): + if self.canvasBitmap != None: + self.canvasBitmap.Destroy(); self.canvasBitmap = None; + for brush in self.mircBrushes or []: + brush.Destroy() + self.mircBrushes = None + for pen in self.mircPens or []: + pen.Destroy() + self.mircPens = None + # }}} + + # + # _init__(self, parent, parentFrame, canvasPos, cellSize, canvasSize, canvasTools): initialisation method + def __init__(self, parent, parentFrame, canvasPos, cellSize, canvasSize, canvasTools): + self.parentFrame = parentFrame + canvasWinSize = (cellSize[0] * canvasSize[0], cellSize[1] * canvasSize[1]) + super().__init__(parent, pos=canvasPos, size=canvasWinSize) + self.canvasPos = canvasPos; self.canvasSize = canvasSize; self.canvasWinSize = canvasWinSize; + self.cellPos = (0, 0); self.cellSize = cellSize; + + self.canvasBitmap = wx.Bitmap(canvasWinSize) + self.canvasMap = [[[1, 1, " "] for x in range(canvasSize[0])] for y in range(canvasSize[1])] + self.canvasTools = [] + for canvasTool in canvasTools: + self.canvasTools.append(canvasTool(self)) + + self.mircBg = 1; self.mircFg = 4; + self.mircBrushes = [None for x in range(len(MiRCARTColours))] + self.mircPens = [None for x in range(len(MiRCARTColours))] + for mircColour in range(0, len(MiRCARTColours)): + self.mircBrushes[mircColour] = wx.Brush( \ + wx.Colour(MiRCARTColours[mircColour]), wx.BRUSHSTYLE_SOLID) + self.mircPens[mircColour] = wx.Pen( \ + wx.Colour(MiRCARTColours[mircColour]), 1) + + self.canvasJournal = MiRCARTCanvasJournal(self) + + self.Bind(wx.EVT_CLOSE, self.onClose) + self.Bind(wx.EVT_LEFT_DOWN, self.onMouseEvent) + self.Bind(wx.EVT_MOTION, self.onMouseEvent) + self.Bind(wx.EVT_PAINT, self.onPaint) + self.Bind(wx.EVT_RIGHT_DOWN, self.onMouseEvent) + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTCanvasJournal.py b/MiRCARTCanvasJournal.py new file mode 100644 index 0000000..03e5f93 --- /dev/null +++ b/MiRCARTCanvasJournal.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python3 +# +# MiRCARTCanvasJournal.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +class MiRCARTCanvasJournal(): + """XXX""" + parentCanvas = None + patchesTmp = patchesUndo = patchesUndoLevel = None + + # {{{ _popTmp(self, eventDc, tmpDc): XXX + def _popTmp(self, eventDc, tmpDc): + if self.patchesTmp: + for patch in self.patchesTmp: + patch[2:] = self.parentCanvas._getMapCell([patch[0], patch[1]]) + self.parentCanvas.onJournalUpdate(True, \ + (patch[0:2]), patch, eventDc, tmpDc, (0, 0)) + self.patchesTmp = [] + # }}} + # {{{ _pushTmp(self, atPoint, patch): XXX + def _pushTmp(self, absMapPoint): + self.patchesTmp.append([*absMapPoint, None, None, None]) + # }}} + # {{{ _pushUndo(self, atPoint, patch): XXX + def _pushUndo(self, atPoint, patch, mapItem): + if self.patchesUndoLevel > 0: + del self.patchesUndo[0:self.patchesUndoLevel] + self.patchesUndoLevel = 0 + absMapPoint = self._relMapPointToAbsMapPoint((patch[0], patch[1]), atPoint) + self.patchesUndo.insert(0, ( \ + (absMapPoint[0], absMapPoint[1], mapItem[0], mapItem[1], mapItem[2]), \ + (absMapPoint[0], absMapPoint[1], patch[2], patch[3], patch[4]))) + # }}} + # {{{ _relMapPointToAbsMapPoint(self, relMapPoint, atPoint): XXX + def _relMapPointToAbsMapPoint(self, relMapPoint, atPoint): + return (atPoint[0] + relMapPoint[0], atPoint[1] + relMapPoint[1]) + # }}} + # {{{ merge(self, mapPatches, eventDc, tmpDc, atPoint): XXX + def merge(self, mapPatches, eventDc, tmpDc, atPoint): + for mapPatch in mapPatches: + mapPatchTmp = mapPatch[0] + if mapPatchTmp: + self._popTmp(eventDc, tmpDc) + for patch in mapPatch[1]: + absMapPoint = self._relMapPointToAbsMapPoint(patch[0:2], atPoint) + mapItem = self.parentCanvas._getMapCell(absMapPoint) + if mapPatchTmp: + self._pushTmp(absMapPoint) + self.parentCanvas.onJournalUpdate(mapPatchTmp, \ + absMapPoint, patch, eventDc, tmpDc, atPoint) + elif mapItem != patch[2:5]: + self._pushUndo(atPoint, patch, mapItem) + self.parentCanvas.onJournalUpdate(mapPatchTmp, \ + absMapPoint, patch, eventDc, tmpDc, atPoint) + # }}} + # {{{ redo(self): XXX + def redo(self): + if self.patchesUndoLevel > 0: + self.patchesUndoLevel -= 1 + redoPatch = self.patchesUndo[self.patchesUndoLevel][1] + self.parentCanvas.onJournalUpdate(False, \ + (redoPatch[0:2]), redoPatch, None, None, (0, 0)) + return True + else: + return False + # }}} + # {{{ undo(self): XXX + def undo(self): + if self.patchesUndo[self.patchesUndoLevel] != None: + undoPatch = self.patchesUndo[self.patchesUndoLevel][0] + self.patchesUndoLevel += 1 + self.parentCanvas.onJournalUpdate(False, \ + (undoPatch[0:2]), undoPatch, None, None, (0, 0)) + return True + else: + return False + # }}} + + # + # __init__(self, parentCanvas): initialisation method + def __init__(self, parentCanvas): + self.parentCanvas = parentCanvas + self.patchesTmp = [] + self.patchesUndo = [None]; self.patchesUndoLevel = 0; + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTColours.py b/MiRCARTColours.py new file mode 100755 index 0000000..9489b08 --- /dev/null +++ b/MiRCARTColours.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +# +# MiRCARTColours.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +# +# MiRCARTColours: mIRC colour number to RGBA map given none of ^[BFV_] (bold, italic, reverse, underline) +# +MiRCARTColours = [ + (255, 255, 255, 255), # White + (0, 0, 0, 255), # Black + (0, 0, 187, 255), # Blue + (0, 187, 0, 255), # Green + (255, 85, 85, 255), # Light Red + (187, 0, 0, 255), # Red + (187, 0, 187, 255), # Purple + (187, 187, 0, 255), # Yellow + (255, 255, 85, 255), # Light Yellow + (85, 255, 85, 255), # Light Green + (0, 187, 187, 255), # Cyan + (85, 255, 255, 255), # Light Cyan + (85, 85, 255, 255), # Light Blue + (255, 85, 255, 255), # Pink + (85, 85, 85, 255), # Grey + (187, 187, 187, 255), # Light Grey +] + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py new file mode 100644 index 0000000..4e84a8b --- /dev/null +++ b/MiRCARTFrame.py @@ -0,0 +1,375 @@ +#!/usr/bin/env python3 +# +# MiRCARTFrame.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from MiRCARTCanvas import MiRCARTCanvas +from MiRCARTColours import MiRCARTColours +from MiRCARTFromTextFile import MiRCARTFromTextFile +from MiRCARTToTextFile import MiRCARTToTextFile +import os, wx + +try: + from MiRCARTToPastebin import MiRCARTToPastebin + haveMiRCARTToPastebin = True +except ImportError: + haveMiRCARTToPastebin = False + +try: + from MiRCARTToPngFile import MiRCARTToPngFile + haveMiRCARTToPngFile = True +except ImportError: + haveMiRCARTToPngFile = False + +class MiRCARTFrame(wx.Frame): + """XXX""" + panelSkin = panelCanvas = canvasPathName = None + canvasPos = canvasSize = canvasTools = cellSize = None + menuItemsById = menuBar = toolBar = accelTable = statusBar = None + + # {{{ Types + TID_COMMAND = (0x001) + TID_NOTHING = (0x002) + TID_MENU = (0x003) + TID_TOOLBAR = (0x004) + TID_ACCELS = (0x005) + # }}} + # {{{ Commands + # Id Type Id Labels Icon bitmap Accelerator + CID_NEW = (0x100, TID_COMMAND, "New", "&New", [wx.ART_NEW], None) + CID_OPEN = (0x101, TID_COMMAND, "Open", "&Open", [wx.ART_FILE_OPEN], None) + CID_SAVE = (0x102, TID_COMMAND, "Save", "&Save", [wx.ART_FILE_SAVE], None) + CID_SAVEAS = (0x103, TID_COMMAND, "Save As...", "Save &As...", [wx.ART_FILE_SAVE_AS], None) + CID_EXPORT_AS_PNG = (0x104, TID_COMMAND, "Export as PNG...", "Export as PN&G...", (), None) + CID_EXPORT_PASTEBIN = (0x105, TID_COMMAND, "Export to Pastebin...", "Export to Pasteb&in...", (), None) + CID_EXIT = (0x106, TID_COMMAND, "Exit", "E&xit", (), None) + CID_UNDO = (0x107, TID_COMMAND, "Undo", "&Undo", [wx.ART_UNDO], (wx.ACCEL_CTRL, ord("Z"))) + CID_REDO = (0x108, TID_COMMAND, "Redo", "&Redo", [wx.ART_REDO], (wx.ACCEL_CTRL, ord("Y"))) + CID_CUT = (0x109, TID_COMMAND, "Cut", "Cu&t", [wx.ART_CUT], None) + CID_COPY = (0x10a, TID_COMMAND, "Copy", "&Copy", [wx.ART_COPY], None) + CID_PASTE = (0x10b, TID_COMMAND, "Paste", "&Paste", [wx.ART_PASTE], None) + CID_DELETE = (0x10c, TID_COMMAND, "Delete", "De&lete", [wx.ART_DELETE], None) + CID_INCRBRUSH = (0x10d, TID_COMMAND, "Increase brush size", "&Increase brush size", [wx.ART_PLUS], None) + CID_DECRBRUSH = (0x10e, TID_COMMAND, "Decrease brush size", "&Decrease brush size", [wx.ART_MINUS], None) + CID_SOLIDBRUSH = (0x10f, TID_COMMAND, "Solid brush", "&Solid brush", [None], None) + CID_RECT = (0x110, TID_COMMAND, "Rectangle", "&Rectangle", [None], None) + CID_CIRCLE = (0x111, TID_COMMAND, "Circle", "&Circle", [None], None) + CID_LINE = (0x112, TID_COMMAND, "Line", "&Line", [None], None) + CID_COLOUR00 = (0x113, TID_COMMAND, "Colour #00", "Colour #00", MiRCARTColours[0], None) + CID_COLOUR01 = (0x114, TID_COMMAND, "Colour #01", "Colour #01", MiRCARTColours[1], None) + CID_COLOUR02 = (0x115, TID_COMMAND, "Colour #02", "Colour #02", MiRCARTColours[2], None) + CID_COLOUR03 = (0x116, TID_COMMAND, "Colour #03", "Colour #03", MiRCARTColours[3], None) + CID_COLOUR04 = (0x117, TID_COMMAND, "Colour #04", "Colour #04", MiRCARTColours[4], None) + CID_COLOUR05 = (0x118, TID_COMMAND, "Colour #05", "Colour #05", MiRCARTColours[5], None) + CID_COLOUR06 = (0x119, TID_COMMAND, "Colour #06", "Colour #06", MiRCARTColours[6], None) + CID_COLOUR07 = (0x11a, TID_COMMAND, "Colour #07", "Colour #07", MiRCARTColours[7], None) + CID_COLOUR08 = (0x11b, TID_COMMAND, "Colour #08", "Colour #08", MiRCARTColours[8], None) + CID_COLOUR09 = (0x11c, TID_COMMAND, "Colour #09", "Colour #09", MiRCARTColours[9], None) + CID_COLOUR10 = (0x11d, TID_COMMAND, "Colour #10", "Colour #10", MiRCARTColours[10], None) + CID_COLOUR11 = (0x11e, TID_COMMAND, "Colour #11", "Colour #11", MiRCARTColours[11], None) + CID_COLOUR12 = (0x11f, TID_COMMAND, "Colour #12", "Colour #12", MiRCARTColours[12], None) + CID_COLOUR13 = (0x120, TID_COMMAND, "Colour #13", "Colour #13", MiRCARTColours[13], None) + CID_COLOUR14 = (0x121, TID_COMMAND, "Colour #14", "Colour #14", MiRCARTColours[14], None) + CID_COLOUR15 = (0x122, TID_COMMAND, "Colour #15", "Colour #15", MiRCARTColours[15], None) + # }}} + # {{{ Non-items + NID_MENU_SEP = (0x200, TID_NOTHING) + NID_TOOLBAR_SEP = (0x201, TID_NOTHING) + # }}} + # {{{ Menus + MID_FILE = (0x300, TID_MENU, "File", "&File", ( \ + CID_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_MENU_SEP, \ + CID_EXPORT_PASTEBIN, CID_EXPORT_AS_PNG, NID_MENU_SEP, \ + CID_EXIT)) + MID_EDIT = (0x301, TID_MENU, "Edit", "&Edit", ( \ + CID_UNDO, CID_REDO, NID_MENU_SEP, \ + CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_MENU_SEP, \ + CID_INCRBRUSH, CID_DECRBRUSH, CID_SOLIDBRUSH)) + MID_TOOLS = (0x302, TID_MENU, "Tools", "&Tools", ( \ + CID_RECT, CID_CIRCLE, CID_LINE)) + # }}} + # {{{ Toolbars + BID_TOOLBAR = (0x400, TID_TOOLBAR, ( \ + CID_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_TOOLBAR_SEP, \ + CID_UNDO, CID_REDO, NID_TOOLBAR_SEP, \ + CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_TOOLBAR_SEP, \ + CID_INCRBRUSH, CID_DECRBRUSH, CID_SOLIDBRUSH, NID_TOOLBAR_SEP, \ + CID_RECT, CID_CIRCLE, CID_LINE, NID_TOOLBAR_SEP, \ + CID_COLOUR00, CID_COLOUR01, CID_COLOUR02, CID_COLOUR03, CID_COLOUR04, \ + CID_COLOUR05, CID_COLOUR06, CID_COLOUR07, CID_COLOUR08, CID_COLOUR09, \ + CID_COLOUR10, CID_COLOUR11, CID_COLOUR12, CID_COLOUR13, CID_COLOUR14, \ + CID_COLOUR15)) + # }}} + # {{{ Accelerators (hotkeys) + AID_EDIT = (0x500, TID_ACCELS, (CID_UNDO, CID_REDO)) + # }}} + + # {{{ _drawIcon(self, solidColour): XXX + def _drawIcon(self, solidColour): + iconBitmap = wx.Bitmap((16,16)) + iconDc = wx.MemoryDC(); iconDc.SelectObject(iconBitmap); + iconBrush = wx.Brush(wx.Colour(solidColour), wx.BRUSHSTYLE_SOLID) + iconDc.SetBrush(iconBrush); iconDc.SetBackground(iconBrush); + iconDc.SetPen(wx.Pen(wx.Colour(solidColour), 1)) + iconDc.DrawRectangle(0, 0, 16, 16) + return iconBitmap + # }}} + # {{{ _initAccelTable(self, accelsDescr, handler): XXX + def _initAccelTable(self, accelsDescr, handler): + accelTableEntries = [wx.AcceleratorEntry() for n in range(0, len(accelsDescr[2]))] + for numAccel in range(0, len(accelsDescr[2])): + accelDescr = accelsDescr[2][numAccel] + if accelDescr[5] != None: + accelTableEntries[numAccel].Set(accelDescr[5][0], accelDescr[5][1], accelDescr[0]) + self.Bind(wx.EVT_MENU, handler, id=accelDescr[0]) + return accelTableEntries + # }}} + # {{{ _initMenus(self, menuBar, menusDescr, handler): XXX + def _initMenus(self, menuBar, menusDescr, handler): + for menuDescr in menusDescr: + menuWindow = wx.Menu() + for menuItem in menuDescr[4]: + if menuItem == self.NID_MENU_SEP: + menuWindow.AppendSeparator() + else: + menuItemWindow = menuWindow.Append(menuItem[0], menuItem[3], menuItem[2]) + self.menuItemsById[menuItem[0]] = menuItemWindow + self.Bind(wx.EVT_MENU, handler, menuItemWindow) + menuBar.Append(menuWindow, menuDescr[3]) + # }}} + # {{{ _initToolBars(self, toolBar, toolBarsDescr, handler): XXX + def _initToolBars(self, toolBar, toolBarsDescr, handler): + for toolBarDescr in toolBarsDescr: + for toolBarItem in toolBarDescr[2]: + if toolBarItem == self.NID_TOOLBAR_SEP: + toolBar.AddSeparator() + else: + if len(toolBarItem[4]) == 4: + toolBarItemIcon = self._drawIcon(toolBarItem[4]) + elif len(toolBarItem[4]) == 1 \ + and toolBarItem[4][0] != None: + toolBarItemIcon = wx.ArtProvider.GetBitmap( \ + toolBarItem[4][0], wx.ART_TOOLBAR, (16,16)) + else: + toolBarItemIcon = wx.ArtProvider.GetBitmap( \ + wx.ART_HELP, wx.ART_TOOLBAR, (16,16)) + toolBarItemWindow = self.toolBar.AddTool( \ + toolBarItem[0], toolBarItem[2], toolBarItemIcon) + self.Bind(wx.EVT_TOOL, handler, toolBarItemWindow) + self.Bind(wx.EVT_TOOL_RCLICKED, handler, toolBarItemWindow) + # }}} + # {{{ _updateStatusBar(self): XXX + def _updateStatusBar(self): + text = "Foreground colour:" + text += " " + str(self.panelCanvas.mircFg) + text += " | " + text += "Background colour:" + text += " " + str(self.panelCanvas.mircBg) + self.statusBar.SetStatusText(text) + # }}} + + # {{{ canvasExportAsPng(self): XXX + def canvasExportAsPng(self): + with wx.FileDialog(self, self.CID_SAVEAS[2], os.getcwd(), "", \ + "*.png", wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) as dialog: + if dialog.ShowModal() == wx.ID_CANCEL: + return False + else: + outPathName = dialog.GetPath() + outTmpFile = io.StringIO() + outToTextFile = MiRCARTToTextFile( \ + self.panelCanvas.canvasMap, self.canvasSize) + outToTextFile.export(outTmpFile) + MiRCARTToPngFile(tmpFile).export(outPathName) + return True + # }}} + # {{{ canvasExportPastebin(self): XXX + def canvasExportPastebin(self): + MiRCARTToPastebin("253ce2f0a45140ee0a44ca99aa49260", \ + self.panelCanvas.canvasMap, self.canvasSize).export() + # }}} + # {{{ canvasNew(self, canvasPos=None, canvasSize=None, cellSize=None): XXX + def canvasNew(self, canvasPos=None, canvasSize=None, cellSize=None): + canvasPos = canvasPos if canvasPos != None else self.canvasPos + canvasSize = canvasSize if canvasSize != None else self.canvasSize + cellSize = cellSize if cellSize != None else self.cellSize + if self.panelCanvas != None: + self.panelCanvas.Close(); self.panelCanvas = None; + self.canvasPos = canvasPos; self.canvasSize = canvasSize; + self.cellSize = cellSize + self.panelCanvas = MiRCARTCanvas(self.panelSkin, parentFrame=self, \ + canvasPos=self.canvasPos, cellSize=self.cellSize, \ + canvasSize=self.canvasSize, canvasTools=self.canvasTools) + self._updateStatusBar(); self.onCanvasUpdate(); + # }}} + # {{{ canvasOpen(self): XXX + def canvasOpen(self): + with wx.FileDialog(self, self.CID_OPEN[2], os.getcwd(), "", \ + "*.txt", wx.FD_OPEN) as dialog: + if dialog.ShowModal() == wx.ID_CANCEL: + return False + else: + self.canvasPathName = dialog.GetPath() + with open(self.canvasPathName, "r") as newFile: + newFromTextFile = MiRCARTFromTextFile(newFile) + newMap = newFromTextFile.getMap() + self.canvasNew(canvasSize=newFromTextFile.getSize()) + eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); + tmpDc.SelectObject(self.panelCanvas.canvasBitmap) + for newNumRow in range(0, len(newMap)): + for newNumCol in range(0, len(newMap[newNumRow])): + self.panelCanvas.onJournalUpdate(False, \ + (newNumCol, newNumRow), \ + [newNumCol, newNumRow, \ + newMap[newNumRow][newNumCol][0][0], \ + newMap[newNumRow][newNumCol][0][1], \ + newMap[newNumRow][newNumCol][2]], \ + eventDc, tmpDc, (0, 0)) + wx.SafeYield() + return True + # }}} + # {{{ canvasSave(self): XXX + def canvasSave(self): + if self.canvasPathName == None: + if self.canvasSaveAs() == False: + return + try: + with open(self.canvasPathName, "w") as outFile: + MiRCARTToTextFile(self.panelCanvas.canvasMap, \ + self.panelCanvas.canvasSize).export(outFile) + except IOError as error: + pass + # }}} + # {{{ canvasSaveAs(self): XXX + def canvasSaveAs(self): + with wx.FileDialog(self, self.CID_SAVEAS[2], os.getcwd(), "", \ + "*.txt", wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) as dialog: + if dialog.ShowModal() == wx.ID_CANCEL: + return False + else: + self.canvasPathName = dialog.GetPath() + return True + # }}} + # {{{ onCanvasUpdate(self): XXX + def onCanvasUpdate(self): + if self.panelCanvas.canvasJournal.patchesUndo[self.panelCanvas.canvasJournal.patchesUndoLevel] != None: + self.menuItemsById[self.CID_UNDO[0]].Enable(True) + else: + self.menuItemsById[self.CID_UNDO[0]].Enable(False) + if self.panelCanvas.canvasJournal.patchesUndoLevel > 0: + self.menuItemsById[self.CID_REDO[0]].Enable(True) + else: + self.menuItemsById[self.CID_REDO[0]].Enable(False) + # }}} + # {{{ onClose(self, event): XXX + def onClose(self, event): + self.Destroy(); self.__del__(); + # }}} + # {{{ onFrameCommand(self, event): XXX + def onFrameCommand(self, event): + cid = event.GetId() + if cid == self.CID_NEW[0]: + self.canvasNew() + elif cid == self.CID_OPEN[0]: + self.canvasOpen() + elif cid == self.CID_SAVE[0]: + self.canvasSave() + elif cid == self.CID_SAVEAS[0]: + self.canvasSaveAs() + elif cid == self.CID_EXPORT_AS_PNG[0]: + self.canvasExportAsPng() + elif cid == self.CID_EXPORT_PASTEBIN[0]: + self.canvasExportPastebin() + elif cid == self.CID_EXIT[0]: + self.Close(True) + elif cid == self.CID_UNDO[0]: + self.panelCanvas.undo() + elif cid == self.CID_REDO[0]: + self.panelCanvas.redo() + elif cid == self.CID_CUT[0]: + pass + elif cid == self.CID_COPY[0]: + pass + elif cid == self.CID_PASTE[0]: + pass + elif cid == self.CID_DELETE[0]: + pass + elif cid == self.CID_INCRBRUSH[0]: + pass + elif cid == self.CID_DECRBRUSH[0]: + pass + elif cid == self.CID_SOLIDBRUSH[0]: + pass + elif cid == self.CID_RECT[0]: + pass + elif cid == self.CID_CIRCLE[0]: + pass + elif cid == self.CID_LINE[0]: + pass + elif cid >= self.CID_COLOUR00[0] \ + and cid <= self.CID_COLOUR15[0]: + numColour = cid - self.CID_COLOUR00[0] + if event.GetEventType() == wx.wxEVT_TOOL: + self.panelCanvas.mircFg = numColour + elif event.GetEventType() == wx.wxEVT_TOOL_RCLICKED: + self.panelCanvas.mircBg = numColour + self._updateStatusBar() + # }}} + # {{{ __del__(self): destructor method + def __del__(self): + if self.panelCanvas != None: + self.panelCanvas.Close(); self.panelCanvas = None; + # }}} + + # + # __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), cellSize=(7, 14), canvasSize=(100, 30), canvasTools=[]): initialisation method + def __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), cellSize=(7, 14), canvasSize=(100, 30), canvasTools=[]): + super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) + self.panelSkin = wx.Panel(self, wx.ID_ANY) + self.canvasPathName = None + + self.menuItemsById = {}; self.menuBar = wx.MenuBar(); + self._initMenus(self.menuBar, \ + [self.MID_FILE, self.MID_EDIT, self.MID_TOOLS], self.onFrameCommand) + self.SetMenuBar(self.menuBar) + if not haveMiRCARTToPastebin: + self.menuItemsById[self.CID_EXPORT_PASTEBIN[0]].Enable(False) + if not haveMiRCARTToPngFile: + self.menuItemsById[self.CID_EXPORT_AS_PNG[0]].Enable(False) + + self.toolBar = wx.ToolBar(self.panelSkin, -1, \ + style=wx.HORIZONTAL|wx.TB_FLAT|wx.TB_NODIVIDER) + self.toolBar.SetToolBitmapSize((16,16)) + self._initToolBars(self.toolBar, [self.BID_TOOLBAR], self.onFrameCommand) + self.toolBar.Realize(); self.toolBar.Fit(); + + self.accelTable = wx.AcceleratorTable( \ + self._initAccelTable(self.AID_EDIT, self.onFrameCommand)) + self.SetAcceleratorTable(self.accelTable) + + self.Bind(wx.EVT_CLOSE, self.onClose) + self.statusBar = self.CreateStatusBar(); + self.SetFocus(); self.Show(True); + self.canvasTools = canvasTools + self.canvasNew(canvasPos, canvasSize, cellSize) + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTFromTextFile.py b/MiRCARTFromTextFile.py new file mode 100644 index 0000000..6459877 --- /dev/null +++ b/MiRCARTFromTextFile.py @@ -0,0 +1,147 @@ +#!/usr/bin/env python3 +# +# MiRCARTFromTextFile.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +class MiRCARTFromTextFile(): + """XXX""" + inFile = inSize = outMap = None + + # + # _CellState(): Cell state + class _CellState(): + CS_NONE = 0x00 + CS_BOLD = 0x01 + CS_ITALIC = 0x02 + CS_UNDERLINE = 0x04 + + # + # _ParseState(): Parsing loop state + class _ParseState(): + PS_CHAR = 1 + PS_COLOUR_DIGIT0 = 2 + PS_COLOUR_DIGIT1 = 3 + + # {{{ _parseCharAsColourSpec(self, colourSpec, curColours): XXX + def _parseCharAsColourSpec(self, colourSpec, curColours): + if len(colourSpec) > 0: + colourSpec = colourSpec.split(",") + if len(colourSpec) == 2: + return (int(colourSpec[0] or curColours[0]), \ + int(colourSpec[1])) + elif len(colourSpec) == 1: + return (int(colourSpec[0]), curColours[0]) + else: + return (15, 1) + # }}} + # {{{ _flipCellStateBit(self, cellState, bit): XXX + def _flipCellStateBit(self, cellState, bit): + if cellState & bit: + return cellState & ~bit + else: + return cellState | bit + # }}} + # {{{ _transform(self): XXX + def _transform(self): + inCurColourSpec = ""; inCurRow = -1; + inLine = self.inFile.readline() + inSize = [0, 0]; outMap = []; inMaxCols = 0; + while inLine: + inCellState = self._CellState.CS_NONE + inParseState = self._ParseState.PS_CHAR + inCurCol = 0; inMaxCol = len(inLine); + inCurColourDigits = 0; inCurColours = (15, 1); inCurColourSpec = ""; + inCurRow += 1; outMap.append([]); inRowCols = 0; inSize[1] += 1; + while inCurCol < inMaxCol: + inChar = inLine[inCurCol] + if inChar in set("\r\n"): \ + inCurCol += 1 + elif inParseState == self._ParseState.PS_CHAR: + inCurCol += 1 + if inChar == "": + inCellState = self._flipCellStateBit( \ + inCellState, self._CellState.CS_BOLD) + elif inChar == "": + inParseState = self._ParseState.PS_COLOUR_DIGIT0 + elif inChar == "": + inCellState = self._flipCellStateBit( \ + inCellState, self._CellState.CS_ITALIC) + elif inChar == "": + inCellState |= self._CellState.CS_NONE + inCurColours = (15, 1) + elif inChar == "": + inCurColours = (inCurColours[1], inCurColours[0]) + elif inChar == "": + inCellState = self._flipCellStateBit( \ + inCellState, self._CellState.CS_UNDERLINE) + else: + inRowCols += 1 + outMap[inCurRow].append((inCurColours, inCellState, inChar)) + elif inParseState == self._ParseState.PS_COLOUR_DIGIT0 \ + or inParseState == self._ParseState.PS_COLOUR_DIGIT1: + if inChar == "," \ + and inParseState == self._ParseState.PS_COLOUR_DIGIT0: + inCurCol += 1 + inCurColourDigits = 0; inCurColourSpec += inChar; + inParseState = self._ParseState.PS_COLOUR_DIGIT1 + elif inChar in set("0123456789") \ + and inCurColourDigits == 0: + inCurCol += 1 + inCurColourDigits += 1; inCurColourSpec += inChar; + elif inChar in set("0123456789") \ + and inCurColourDigits == 1 \ + and inCurColourSpec[-1] == "0": + inCurCol += 1 + inCurColourDigits += 1; inCurColourSpec += inChar; + elif inChar in set("012345") \ + and inCurColourDigits == 1 \ + and inCurColourSpec[-1] == "1": + inCurCol += 1 + inCurColourDigits += 1; inCurColourSpec += inChar; + else: + inCurColours = self._parseCharAsColourSpec( \ + inCurColourSpec, inCurColours) + inCurColourDigits = 0; inCurColourSpec = ""; + inParseState = self._ParseState.PS_CHAR + inMaxCols = max(inMaxCols, inRowCols) + inLine = self.inFile.readline() + inSize[0] = inMaxCols; self.inSize = inSize; self.outMap = outMap; + # }}} + # {{{ getMap(self): XXX + def getMap(self): + if self.outMap == None: + self._transform() + return self.outMap + # }}} + # {{{ getSize(self): XXX + def getSize(self): + if self.inSize == None: + self._transform() + return self.inSize + # }}} + + # + # __init__(self): initialisation method + def __init__(self, inFile): + self.inFile = inFile; self.inSize = None; self.outMap = None; + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTToPastebin.py b/MiRCARTToPastebin.py new file mode 100644 index 0000000..88b25bc --- /dev/null +++ b/MiRCARTToPastebin.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# +# MiRCARTToPastebin.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from MiRCARTToTextFile import MiRCARTToTextFile +import io +import base64 +import requests, urllib.request + +class MiRCARTToPastebin(): + apiDevKey = outFile = outToTextFile = None + + # export(self): XXX + def export(self): + self.outToTextFile.export(self.outFile, pasteName="", pastePrivate=0) + requestData = { \ + "api_dev_key": self.apiDevKey, \ + "api_option": "paste", \ + "api_paste_code": base64.b64encode(self.outFile.read()), \ + "api_paste_name": pasteName, \ + "api_paste_private": pastePrivate} + responseHttp = requests.post("https://pastebin.com/post.php", \ + data=requestData) + if responseHttp.status_code == 200: + return responseHttp.text + else: + return None + + # __init__(self, canvasMap, canvasSize): XXX + def __init__(self, apiDevKey, canvasMap, canvasSize): + self.apiDevKey = apiDevKey + self.outFile = io.StringIO() + self.outToTextFile = MiRCARTToTextFile(canvasMap, canvasSize) + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTToPngFile.py b/MiRCARTToPngFile.py new file mode 100755 index 0000000..8503b41 --- /dev/null +++ b/MiRCARTToPngFile.py @@ -0,0 +1,145 @@ +#!/usr/bin/env python3 +# +# MiRCARTToPngFile.py -- convert ASCII w/ mIRC control codes to monospaced PNG (for EFnet #MiRCART) +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from PIL import Image, ImageDraw, ImageFont +from MiRCARTFromTextFile import MiRCARTFromTextFile +import string, sys + +class MiRCARTToPngFile: + """XXX""" + inFile = inFilePath = inFromTextFile = None + outFontFilePath = outFontSize = None + + # {{{ _ColourMapBold: mIRC colour number to RGBA map given ^B (bold) + _ColourMapBold = [ + [255, 255, 255], # White + [85, 85, 85], # Grey + [85, 85, 255], # Light Blue + [85, 255, 85], # Light Green + [255, 85, 85], # Light Red + [255, 85, 85], # Light Red + [255, 85, 255], # Pink + [255, 255, 85], # Light Yellow + [255, 255, 85], # Light Yellow + [85, 255, 85], # Light Green + [85, 255, 255], # Light Cyan + [85, 255, 255], # Light Cyan + [85, 85, 255], # Light Blue + [255, 85, 255], # Pink + [85, 85, 85], # Grey + [255, 255, 255], # White + ] + # }}} + # {{{ _ColourMapNormal: mIRC colour number to RGBA map given none of ^[BFV_] (bold, italic, reverse, underline) + _ColourMapNormal = [ + [255, 255, 255], # White + [0, 0, 0], # Black + [0, 0, 187], # Blue + [0, 187, 0], # Green + [255, 85, 85], # Light Red + [187, 0, 0], # Red + [187, 0, 187], # Purple + [187, 187, 0], # Yellow + [255, 255, 85], # Light Yellow + [85, 255, 85], # Light Green + [0, 187, 187], # Cyan + [85, 255, 255], # Light Cyan + [85, 85, 255], # Light Blue + [255, 85, 255], # Pink + [85, 85, 85], # Grey + [187, 187, 187], # Light Grey + ] + # }}} + # {{{ _drawUnderline(self, curPos, fontSize, imgDraw): XXX + def _drawUnderLine(self, curPos, fontSize, imgDraw): + imgDraw.line( \ + (curPos[0], \ + curPos[1] + (fontSize[1] - 2)), \ + (curPos[0] + fontSize[0], \ + curPos[1] + (fontSize[1] - 2)), fill=outColours[0]) + # }}} + # {{{ export(self, outFilePath): XXX + def export(self, outFilePath): + inSize = self.inFromTextFile.getSize(); + outSize = [inSize[n] * self.outImgFontSize[n] for n in range(0, 2)] + outCurPos = [0, 0] + outImg = Image.new("RGBA", outSize, (*self._ColourMapNormal[1], 255)) + outImgDraw = ImageDraw.Draw(outImg) + for inCurRow in range(0, inSize[1]): + for inCurCol in range(0, len(self.inFromTextFile.outMap[inCurRow])): + inCurCell = self.inFromTextFile.outMap[inCurRow][inCurCol] + outColours = [0, 0] + if inCurCell[1] & MiRCARTFromTextFile._CellState.CS_BOLD: + if inCurCell[2] != " ": + outColours[0] = self._ColourMapBold[inCurCell[0][0]] + outColours[1] = self._ColourMapBold[inCurCell[0][1]] + else: + if inCurCell[2] != " ": + outColours[0] = self._ColourMapNormal[inCurCell[0][0]] + outColours[1] = self._ColourMapNormal[inCurCell[0][1]] + outImgDraw.rectangle((*outCurPos, \ + outCurPos[0] + self.outImgFontSize[0], \ + outCurPos[1] + self.outImgFontSize[1]), \ + fill=(*outColours[1], 255)) + if inCurCell[2] != " " \ + and outColours[0] != outColours[1]: + # XXX implement italic + outImgDraw.text(outCurPos, \ + inCurCell[2], (*outColours[0], 255), self.outImgFont) + if inCurCell[1] & MiRCARTFromTextFile._CellState.CS_UNDERLINE: + self._drawUnderLine(curPos, self.outImgFontSize, outImgDraw) + outCurPos[0] += self.outImgFontSize[0]; + outCurPos[0] = 0 + outCurPos[1] += self.outImgFontSize[1] + outImg.save(outFilePath); + # }}} + + # + # __init__(self, inFilePath, fontFilePath="DejaVuSansMono.ttf", fontSize=11): initialisation method + def __init__(self, inFilePath, fontFilePath="DejaVuSansMono.ttf", fontSize=11): + self.inFilePath = inFilePath; self.inFile = open(inFilePath, "r"); + self.inFromTextFile = MiRCARTFromTextFile(self.inFile) + + self.outFontFilePath = fontFilePath; self.outFontSize = int(fontSize); + self.outImgFont = ImageFont.truetype( \ + self.outFontFilePath, self.outFontSize) + self.outImgFontSize = [*self.outImgFont.getsize(" ")] + self.outImgFontSize[1] += 3 + +# +# Entry point +def main(*argv): + MiRCARTToPngFile(argv[1], *argv[3:]).export(argv[2]) +if __name__ == "__main__": + if ((len(sys.argv) - 1) < 2)\ + or ((len(sys.argv) - 1) > 4): + print("usage: {} " \ + " " \ + " " \ + "[] " \ + "[]".format(sys.argv[0]), file=sys.stderr) + else: + main(*sys.argv) + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTToTextFile.py b/MiRCARTToTextFile.py new file mode 100644 index 0000000..ee0950d --- /dev/null +++ b/MiRCARTToTextFile.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +# +# MiRCARTToTextFile.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +class MiRCARTToTextFile(): + canvasMap = canvasSize = None + + # export(self, outFile): XXX + def export(self, outFile): + for canvasRow in range(0, self.canvasSize[1]): + canvasLastColours = [] + for canvasCol in range(0, self.canvasSize[0]): + canvasColColours = self.canvasMap[canvasRow][canvasCol][0:2] + canvasColText = self.canvasMap[canvasRow][canvasCol][2] + if canvasColColours != canvasLastColours: + canvasLastColours = canvasColColours + outFile.write("\x03" + \ + str(canvasColColours[0]) + \ + "," + str(canvasColColours[1])) + outFile.write(canvasColText) + outFile.write("\n") + + # __init__(self, canvasMap, canvasSize): XXX + def __init__(self, canvasMap, canvasSize): + self.canvasMap = canvasMap; self.canvasSize = canvasSize; + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTTool.py b/MiRCARTTool.py new file mode 100644 index 0000000..0dad5ad --- /dev/null +++ b/MiRCARTTool.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +# +# MiRCARTTool.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +class MiRCARTTool(): + """XXX""" + parentCanvas = None + + # {{{ onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): XXX + def onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): + pass + # }}} + + # + # __init__(self, parentCanvas): initialisation method + def __init__(self, parentCanvas): + self.parentCanvas = parentCanvas + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTToolRect.py b/MiRCARTToolRect.py new file mode 100644 index 0000000..b9e9fb2 --- /dev/null +++ b/MiRCARTToolRect.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 +# +# MiRCARTToolRect.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from MiRCARTTool import MiRCARTTool + +class MiRCARTToolRect(MiRCARTTool): + """XXX""" + + # + # onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): XXX + def onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): + if isLeftDown: + return [[False, [[0, 0, \ + self.parentCanvas.mircFg, \ + self.parentCanvas.mircFg, " "]]], + [True, [[0, 0, \ + self.parentCanvas.mircFg, \ + self.parentCanvas.mircFg, " "]]]] + elif isRightDown: + return [[False, [[0, 0, \ + self.parentCanvas.mircBg, \ + self.parentCanvas.mircBg, " "]]], \ + [True, [[0, 0, \ + self.parentCanvas.mircBg, \ + self.parentCanvas.mircBg, " "]]]] + else: + return [[True, [[0, 0, \ + self.parentCanvas.mircFg, \ + self.parentCanvas.mircFg, " "]]]] + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/README.md b/README.md index 736ccee..5785840 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ * Prerequisites: python3 && python3-{json,requests,urllib3} on Debian-family Linux distributions * IrcMiRCARTBot.py usage: IrcMiRCARTBot.py `` [``] [``] [``] [``] [``] -# MiRC2png.py -- convert ASCII w/ mIRC control codes to monospaced PNG (pending cleanup) +# MiRCARTToPngFile.py -- convert ASCII w/ mIRC control codes to monospaced PNG (pending cleanup) * Prerequisites: python3 && python3-pil on Debian-family Linux distributions * MiRC2png.py usage: MiRC2png.py `` `` [``] [``] From a58781ed7a2d2d33b9e9b6f673e6b318c0234739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sun, 7 Jan 2018 04:19:38 +0100 Subject: [PATCH 073/148] MiRCARTCanvasStore.py: split & merge MiRCART{FromTextFile,ToPastebin,ToTextFile}.py. --- MiRCARTCanvas.py | 65 ++++++--- MiRCARTCanvasJournal.py | 9 +- ...RTFromTextFile.py => MiRCARTCanvasStore.py | 132 +++++++++++++++--- MiRCARTFrame.py | 77 ++++------ MiRCARTToPastebin.py | 55 -------- MiRCARTToTextFile.py | 47 ------- 6 files changed, 193 insertions(+), 192 deletions(-) rename MiRCARTFromTextFile.py => MiRCARTCanvasStore.py (54%) delete mode 100644 MiRCARTToPastebin.py delete mode 100644 MiRCARTToTextFile.py diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index 3743b5c..f8b5a47 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -23,6 +23,7 @@ # from MiRCARTCanvasJournal import MiRCARTCanvasJournal +from MiRCARTCanvasStore import MiRCARTCanvasStore from MiRCARTColours import MiRCARTColours import wx @@ -32,8 +33,18 @@ class MiRCARTCanvas(wx.Panel): canvasPos = canvasSize = canvasWinSize = cellPos = cellSize = None canvasBitmap = canvasMap = canvasTools = None mircBg = mircFg = mircBrushes = mircPens = None - canvasJournal = None + canvasJournal = canvasStore = None + # {{{ _initBrushesAndPens(self): XXX + def _initBrushesAndPens(self): + self.mircBrushes = [None for x in range(len(MiRCARTColours))] + self.mircPens = [None for x in range(len(MiRCARTColours))] + for mircColour in range(0, len(MiRCARTColours)): + self.mircBrushes[mircColour] = wx.Brush( \ + wx.Colour(MiRCARTColours[mircColour]), wx.BRUSHSTYLE_SOLID) + self.mircPens[mircColour] = wx.Pen( \ + wx.Colour(MiRCARTColours[mircColour]), 1) + # }}} # {{{ _drawPatch(self, patch, eventDc, tmpDc, atPoint): XXX def _drawPatch(self, patch, eventDc, tmpDc, atPoint): absPoint = self._relMapPointToAbsPoint((patch[0], patch[1]), atPoint) @@ -69,6 +80,7 @@ class MiRCARTCanvas(wx.Panel): def _setMapCell(self, absMapPoint, colourFg, colourBg, char): self.canvasMap[absMapPoint[1]][absMapPoint[0]] = [colourFg, colourBg, char] # }}} + # {{{ onClose(self, event): XXX def onClose(self, event): self.Destroy(); self.__del__(); @@ -106,10 +118,30 @@ class MiRCARTCanvas(wx.Panel): def redo(self): return self.canvasJournal.redo() # }}} + # {{{ resize(self, newCanvasSize): XXX + def resize(self, newCanvasSize): + if newCanvasSize != self.canvasSize: + self.SetSize(*self.canvasPos, \ + newCanvasSize[0] * self.cellSize[0], \ + newCanvasSize[1] * self.cellSize[1]) + for numRow in range(0, self.canvasSize[1]): + for numNewCol in range(self.canvasSize[0], newCanvasSize[0]): + self.canvasMap[numRow].append([1, 1, " "]) + for numNewRow in range(self.canvasSize[1], newCanvasSize[1]): + self.canvasMap.append([]) + for numNewCol in range(0, newCanvasSize[0]): + self.canvasMap[numNewRow].append([1, 1, " "]) + self.canvasSize = newCanvasSize + canvasWinSize = ( \ + self.cellSize[0] * self.canvasSize[0], \ + self.cellSize[1] * self.canvasSize[1]) + self.canvasBitmap = wx.Bitmap(canvasWinSize) + # }}} # {{{ undo(self): XXX def undo(self): return self.canvasJournal.undo() # }}} + # {{{ __del__(self): destructor method def __del__(self): if self.canvasBitmap != None: @@ -124,30 +156,19 @@ class MiRCARTCanvas(wx.Panel): # # _init__(self, parent, parentFrame, canvasPos, cellSize, canvasSize, canvasTools): initialisation method - def __init__(self, parent, parentFrame, canvasPos, cellSize, canvasSize, canvasTools): + def __init__(self, parent, parentFrame, canvasPos, canvasSize, canvasTools, cellSize): self.parentFrame = parentFrame - canvasWinSize = (cellSize[0] * canvasSize[0], cellSize[1] * canvasSize[1]) - super().__init__(parent, pos=canvasPos, size=canvasWinSize) - self.canvasPos = canvasPos; self.canvasSize = canvasSize; self.canvasWinSize = canvasWinSize; - self.cellPos = (0, 0); self.cellSize = cellSize; + self.canvasPos = canvasPos; self.canvasSize = canvasSize; + self.canvasTools = [canvasTool(self) for canvasTool in canvasTools] + self.cellSize = cellSize - self.canvasBitmap = wx.Bitmap(canvasWinSize) - self.canvasMap = [[[1, 1, " "] for x in range(canvasSize[0])] for y in range(canvasSize[1])] - self.canvasTools = [] - for canvasTool in canvasTools: - self.canvasTools.append(canvasTool(self)) - - self.mircBg = 1; self.mircFg = 4; - self.mircBrushes = [None for x in range(len(MiRCARTColours))] - self.mircPens = [None for x in range(len(MiRCARTColours))] - for mircColour in range(0, len(MiRCARTColours)): - self.mircBrushes[mircColour] = wx.Brush( \ - wx.Colour(MiRCARTColours[mircColour]), wx.BRUSHSTYLE_SOLID) - self.mircPens[mircColour] = wx.Pen( \ - wx.Colour(MiRCARTColours[mircColour]), 1) - - self.canvasJournal = MiRCARTCanvasJournal(self) + self.cellPos = (0, 0) + self.mircBg = 1; self.mircFg = 4; self._initBrushesAndPens(); + self.canvasJournal = MiRCARTCanvasJournal(parentCanvas=self) + self.canvasStore = MiRCARTCanvasStore(parentCanvas=self) + super().__init__(parent, pos=canvasPos, \ + size=[w*h for w,h in zip(canvasSize, cellSize)]) self.Bind(wx.EVT_CLOSE, self.onClose) self.Bind(wx.EVT_LEFT_DOWN, self.onMouseEvent) self.Bind(wx.EVT_MOTION, self.onMouseEvent) diff --git a/MiRCARTCanvasJournal.py b/MiRCARTCanvasJournal.py index 03e5f93..a712d36 100644 --- a/MiRCARTCanvasJournal.py +++ b/MiRCARTCanvasJournal.py @@ -83,6 +83,11 @@ class MiRCARTCanvasJournal(): else: return False # }}} + # {{{ reset(self): XXX + def reset(self): + self.patchesTmp = [] + self.patchesUndo = [None]; self.patchesUndoLevel = 0; + # }}} # {{{ undo(self): XXX def undo(self): if self.patchesUndo[self.patchesUndoLevel] != None: @@ -98,8 +103,6 @@ class MiRCARTCanvasJournal(): # # __init__(self, parentCanvas): initialisation method def __init__(self, parentCanvas): - self.parentCanvas = parentCanvas - self.patchesTmp = [] - self.patchesUndo = [None]; self.patchesUndoLevel = 0; + self.parentCanvas = parentCanvas; self.reset(); # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTFromTextFile.py b/MiRCARTCanvasStore.py similarity index 54% rename from MiRCARTFromTextFile.py rename to MiRCARTCanvasStore.py index 6459877..a3b106e 100644 --- a/MiRCARTFromTextFile.py +++ b/MiRCARTCanvasStore.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# MiRCARTFromTextFile.py -- XXX +# MiRCARTCanvasStore.py -- XXX # Copyright (c) 2018 Lucio Andrés Illanes Albornoz # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -22,9 +22,26 @@ # SOFTWARE. # -class MiRCARTFromTextFile(): +import base64 +import io +import wx + +try: + from MiRCARTToPngFile import MiRCARTToPngFile + haveMiRCARTToPngFile = True +except ImportError: + haveMiRCARTToPngFile = False + +try: + import requests, urllib.request + haveUrllib = True +except ImportError: + haveUrllib = False + +class MiRCARTCanvasStore(): """XXX""" inFile = inSize = outMap = None + parentCanvas = None # # _CellState(): Cell state @@ -60,8 +77,72 @@ class MiRCARTFromTextFile(): else: return cellState | bit # }}} - # {{{ _transform(self): XXX - def _transform(self): + + # {{{ exportPastebin(self, apiDevKey): XXX + def exportPastebin(self, apiDevKey): + if haveUrllib: + outFile = io.StringIO(); self.exportTextFile(outFile); + requestData = { \ + "api_dev_key": self.apiDevKey, \ + "api_option": "paste", \ + "api_paste_code": base64.b64encode(outFile.read()), \ + "api_paste_name": pasteName, \ + "api_paste_private": pastePrivate} + responseHttp = requests.post("https://pastebin.com/post.php", \ + data=requestData) + if responseHttp.status_code == 200: + return responseHttp.text + else: + return None + else: + return None + # }}} + # {{{ exportPngFile(self): XXX + def exportPngFile(self, pathName): + if haveMiRCARTToPngFile: + outFile = io.StringIO(); self.exportTextFile(outFile); + MiRCARTToPng(outFile).export(pathName) + return True + else: + return False + # }}} + # {{{ exportTextFile(self, outFile): XXX + def exportTextFile(self, outFile): + canvasMap = self.parentCanvas.canvasMap + canvasSize = self.parentCanvas.canvasSize + for canvasRow in range(0, canvasSize[1]): + canvasLastColours = [] + for canvasCol in range(0, canvasSize[0]): + canvasColColours = canvasMap[canvasRow][canvasCol][0:2] + canvasColText = self.canvasMap[canvasRow][canvasCol][2] + if canvasColColours != canvasLastColours: + canvasLastColours = canvasColColours + outFile.write("\x03" + \ + str(canvasColColours[0]) + \ + "," + str(canvasColColours[1])) + outFile.write(canvasColText) + outFile.write("\n") + # }}} + # {{{ importIntoPanel(self): XXX + def importIntoPanel(self): + canvasSize = self.inSize; self.parentCanvas.resize(canvasSize); + self.parentCanvas.canvasJournal.reset() + eventDc = wx.ClientDC(self.parentCanvas); tmpDc = wx.MemoryDC(); + tmpDc.SelectObject(self.parentCanvas.canvasBitmap) + for numRow in range(0, len(self.outMap)): + for numCol in range(0, len(self.outMap[numRow])): + self.parentCanvas.onJournalUpdate(False, \ + (numCol, numRow), [numCol, numRow, \ + self.outMap[numRow][numCol][0][0], \ + self.outMap[numRow][numCol][0][1], \ + self.outMap[numRow][numCol][2]], \ + eventDc, tmpDc, (0, 0)) + wx.SafeYield() + # }}} + # {{{ importTextFile(self, pathName): XXX + def importTextFile(self, pathName): + self.inFile = open(pathName, "r") + self.inSize = self.outMap = None; inCurColourSpec = ""; inCurRow = -1; inLine = self.inFile.readline() inSize = [0, 0]; outMap = []; inMaxCols = 0; @@ -125,23 +206,38 @@ class MiRCARTFromTextFile(): inMaxCols = max(inMaxCols, inRowCols) inLine = self.inFile.readline() inSize[0] = inMaxCols; self.inSize = inSize; self.outMap = outMap; + self.inFile.close() # }}} - # {{{ getMap(self): XXX - def getMap(self): - if self.outMap == None: - self._transform() - return self.outMap - # }}} - # {{{ getSize(self): XXX - def getSize(self): - if self.inSize == None: - self._transform() - return self.inSize + # {{{ importNew(self, newCanvasSize=None): XXX + def importNew(self, newCanvasSize=None): + if newCanvasSize != None: + self.parentCanvas.resize(newCanvasSize) + self.parentCanvas.canvasJournal.reset() + self.parentCanvas.canvasMap = [[[1, 1, " "] \ + for x in range(self.parentCanvas.canvasSize[0])] \ + for y in range(self.parentCanvas.canvasSize[1])] + canvasWinSize = ( \ + self.parentCanvas.cellSize[0] * self.parentCanvas.canvasSize[0], \ + self.parentCanvas.cellSize[1] * self.parentCanvas.canvasSize[1]) + if self.parentCanvas.canvasBitmap != None: + self.parentCanvas.canvasBitmap.Destroy() + self.parentCanvas.canvasBitmap = wx.Bitmap(canvasWinSize) + eventDc = wx.ClientDC(self.parentCanvas); tmpDc = wx.MemoryDC(); + tmpDc.SelectObject(self.parentCanvas.canvasBitmap) + for numRow in range(0, len(self.parentCanvas.canvasMap)): + for numCol in range(0, len(self.parentCanvas.canvasMap[numRow])): + self.parentCanvas.onJournalUpdate(False, \ + (numCol, numRow), [numCol, numRow, 1, 1, " "], \ + eventDc, tmpDc, (0, 0)) + wx.SafeYield() # }}} # - # __init__(self): initialisation method - def __init__(self, inFile): - self.inFile = inFile; self.inSize = None; self.outMap = None; + # __init__(self, inFile=None, parentCanvas=None): initialisation method + def __init__(self, inFile=None, parentCanvas=None): + self.inFile = inFile; self.inSize = self.outMap = None; + self.parentCanvas = parentCanvas + if inFile != None: + self.importTextFile(inFile) # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 4e84a8b..d658eb6 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -24,8 +24,6 @@ from MiRCARTCanvas import MiRCARTCanvas from MiRCARTColours import MiRCARTColours -from MiRCARTFromTextFile import MiRCARTFromTextFile -from MiRCARTToTextFile import MiRCARTToTextFile import os, wx try: @@ -194,31 +192,26 @@ class MiRCARTFrame(wx.Frame): if dialog.ShowModal() == wx.ID_CANCEL: return False else: - outPathName = dialog.GetPath() - outTmpFile = io.StringIO() - outToTextFile = MiRCARTToTextFile( \ - self.panelCanvas.canvasMap, self.canvasSize) - outToTextFile.export(outTmpFile) - MiRCARTToPngFile(tmpFile).export(outPathName) - return True + try: + outPathName = dialog.GetPath() + self.panelCanvas.exportPngFile(outhPathName) + return True + except IOError as error: + pass # }}} # {{{ canvasExportPastebin(self): XXX def canvasExportPastebin(self): - MiRCARTToPastebin("253ce2f0a45140ee0a44ca99aa49260", \ - self.panelCanvas.canvasMap, self.canvasSize).export() + try: + self.panelCanvas.exportPastebin("253ce2f0a45140ee0a44ca99aa49260") + return True + except IOError as error: + pass # }}} - # {{{ canvasNew(self, canvasPos=None, canvasSize=None, cellSize=None): XXX - def canvasNew(self, canvasPos=None, canvasSize=None, cellSize=None): - canvasPos = canvasPos if canvasPos != None else self.canvasPos - canvasSize = canvasSize if canvasSize != None else self.canvasSize - cellSize = cellSize if cellSize != None else self.cellSize - if self.panelCanvas != None: - self.panelCanvas.Close(); self.panelCanvas = None; - self.canvasPos = canvasPos; self.canvasSize = canvasSize; - self.cellSize = cellSize - self.panelCanvas = MiRCARTCanvas(self.panelSkin, parentFrame=self, \ - canvasPos=self.canvasPos, cellSize=self.cellSize, \ - canvasSize=self.canvasSize, canvasTools=self.canvasTools) + # {{{ canvasNew(self, newCanvasSize=None): XXX + def canvasNew(self, newCanvasSize=None): + if newCanvasSize == None: + newCanvasSize = (100, 30) + self.panelCanvas.canvasStore.importNew(newCanvasSize) self._updateStatusBar(); self.onCanvasUpdate(); # }}} # {{{ canvasOpen(self): XXX @@ -229,23 +222,10 @@ class MiRCARTFrame(wx.Frame): return False else: self.canvasPathName = dialog.GetPath() - with open(self.canvasPathName, "r") as newFile: - newFromTextFile = MiRCARTFromTextFile(newFile) - newMap = newFromTextFile.getMap() - self.canvasNew(canvasSize=newFromTextFile.getSize()) - eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); - tmpDc.SelectObject(self.panelCanvas.canvasBitmap) - for newNumRow in range(0, len(newMap)): - for newNumCol in range(0, len(newMap[newNumRow])): - self.panelCanvas.onJournalUpdate(False, \ - (newNumCol, newNumRow), \ - [newNumCol, newNumRow, \ - newMap[newNumRow][newNumCol][0][0], \ - newMap[newNumRow][newNumCol][0][1], \ - newMap[newNumRow][newNumCol][2]], \ - eventDc, tmpDc, (0, 0)) - wx.SafeYield() - return True + self.panelCanvas.canvasStore.importTextFile(self.canvasPathName) + self.panelCanvas.canvasStore.importIntoPanel() + self._updateStatusBar(); self.onCanvasUpdate(); + return True # }}} # {{{ canvasSave(self): XXX def canvasSave(self): @@ -253,9 +233,8 @@ class MiRCARTFrame(wx.Frame): if self.canvasSaveAs() == False: return try: - with open(self.canvasPathName, "w") as outFile: - MiRCARTToTextFile(self.panelCanvas.canvasMap, \ - self.panelCanvas.canvasSize).export(outFile) + self.panelCanvas.exportTextFile(self.canvasPathName) + return True except IOError as error: pass # }}} @@ -345,10 +324,11 @@ class MiRCARTFrame(wx.Frame): def __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), cellSize=(7, 14), canvasSize=(100, 30), canvasTools=[]): super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) self.panelSkin = wx.Panel(self, wx.ID_ANY) + self.canvasPos = canvasPos; self.cellSize = cellSize; self.canvasSize = canvasSize; self.canvasPathName = None self.menuItemsById = {}; self.menuBar = wx.MenuBar(); - self._initMenus(self.menuBar, \ + self._initMenus(self.menuBar, \ [self.MID_FILE, self.MID_EDIT, self.MID_TOOLS], self.onFrameCommand) self.SetMenuBar(self.menuBar) if not haveMiRCARTToPastebin: @@ -356,13 +336,13 @@ class MiRCARTFrame(wx.Frame): if not haveMiRCARTToPngFile: self.menuItemsById[self.CID_EXPORT_AS_PNG[0]].Enable(False) - self.toolBar = wx.ToolBar(self.panelSkin, -1, \ + self.toolBar = wx.ToolBar(self.panelSkin, -1, \ style=wx.HORIZONTAL|wx.TB_FLAT|wx.TB_NODIVIDER) self.toolBar.SetToolBitmapSize((16,16)) self._initToolBars(self.toolBar, [self.BID_TOOLBAR], self.onFrameCommand) self.toolBar.Realize(); self.toolBar.Fit(); - self.accelTable = wx.AcceleratorTable( \ + self.accelTable = wx.AcceleratorTable( \ self._initAccelTable(self.AID_EDIT, self.onFrameCommand)) self.SetAcceleratorTable(self.accelTable) @@ -370,6 +350,9 @@ class MiRCARTFrame(wx.Frame): self.statusBar = self.CreateStatusBar(); self.SetFocus(); self.Show(True); self.canvasTools = canvasTools - self.canvasNew(canvasPos, canvasSize, cellSize) + self.panelCanvas = MiRCARTCanvas(self.panelSkin, parentFrame=self, \ + canvasPos=self.canvasPos, canvasSize=self.canvasSize, \ + canvasTools=self.canvasTools, cellSize=self.cellSize) + self.canvasNew() # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTToPastebin.py b/MiRCARTToPastebin.py deleted file mode 100644 index 88b25bc..0000000 --- a/MiRCARTToPastebin.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python3 -# -# MiRCARTToPastebin.py -- XXX -# Copyright (c) 2018 Lucio Andrés Illanes Albornoz -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# - -from MiRCARTToTextFile import MiRCARTToTextFile -import io -import base64 -import requests, urllib.request - -class MiRCARTToPastebin(): - apiDevKey = outFile = outToTextFile = None - - # export(self): XXX - def export(self): - self.outToTextFile.export(self.outFile, pasteName="", pastePrivate=0) - requestData = { \ - "api_dev_key": self.apiDevKey, \ - "api_option": "paste", \ - "api_paste_code": base64.b64encode(self.outFile.read()), \ - "api_paste_name": pasteName, \ - "api_paste_private": pastePrivate} - responseHttp = requests.post("https://pastebin.com/post.php", \ - data=requestData) - if responseHttp.status_code == 200: - return responseHttp.text - else: - return None - - # __init__(self, canvasMap, canvasSize): XXX - def __init__(self, apiDevKey, canvasMap, canvasSize): - self.apiDevKey = apiDevKey - self.outFile = io.StringIO() - self.outToTextFile = MiRCARTToTextFile(canvasMap, canvasSize) - -# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTToTextFile.py b/MiRCARTToTextFile.py deleted file mode 100644 index ee0950d..0000000 --- a/MiRCARTToTextFile.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python3 -# -# MiRCARTToTextFile.py -- XXX -# Copyright (c) 2018 Lucio Andrés Illanes Albornoz -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# - -class MiRCARTToTextFile(): - canvasMap = canvasSize = None - - # export(self, outFile): XXX - def export(self, outFile): - for canvasRow in range(0, self.canvasSize[1]): - canvasLastColours = [] - for canvasCol in range(0, self.canvasSize[0]): - canvasColColours = self.canvasMap[canvasRow][canvasCol][0:2] - canvasColText = self.canvasMap[canvasRow][canvasCol][2] - if canvasColColours != canvasLastColours: - canvasLastColours = canvasColColours - outFile.write("\x03" + \ - str(canvasColColours[0]) + \ - "," + str(canvasColColours[1])) - outFile.write(canvasColText) - outFile.write("\n") - - # __init__(self, canvasMap, canvasSize): XXX - def __init__(self, canvasMap, canvasSize): - self.canvasMap = canvasMap; self.canvasSize = canvasSize; - -# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 From 45f2f8005024392b5e91bd4bcac428f995a4299e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sun, 7 Jan 2018 15:07:37 +0100 Subject: [PATCH 074/148] MiRCARTFrame.py: remove obsolete MiRCARTTo{Pastebin,PngFile} imports. MiRCARTFrame.py:MiRCARTFrame.__init__(): initially disable (grey out) Copy, Cut, Delete, Paste, Export to Pastebin, and Export as PNG menu items. --- MiRCARTFrame.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index d658eb6..3c92cc5 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -26,18 +26,6 @@ from MiRCARTCanvas import MiRCARTCanvas from MiRCARTColours import MiRCARTColours import os, wx -try: - from MiRCARTToPastebin import MiRCARTToPastebin - haveMiRCARTToPastebin = True -except ImportError: - haveMiRCARTToPastebin = False - -try: - from MiRCARTToPngFile import MiRCARTToPngFile - haveMiRCARTToPngFile = True -except ImportError: - haveMiRCARTToPngFile = False - class MiRCARTFrame(wx.Frame): """XXX""" panelSkin = panelCanvas = canvasPathName = None @@ -331,10 +319,12 @@ class MiRCARTFrame(wx.Frame): self._initMenus(self.menuBar, \ [self.MID_FILE, self.MID_EDIT, self.MID_TOOLS], self.onFrameCommand) self.SetMenuBar(self.menuBar) - if not haveMiRCARTToPastebin: - self.menuItemsById[self.CID_EXPORT_PASTEBIN[0]].Enable(False) - if not haveMiRCARTToPngFile: - self.menuItemsById[self.CID_EXPORT_AS_PNG[0]].Enable(False) + self.menuItemsById[self.CID_COPY[0]].Enable(False) + self.menuItemsById[self.CID_CUT[0]].Enable(False) + self.menuItemsById[self.CID_DELETE[0]].Enable(False) + self.menuItemsById[self.CID_PASTE[0]].Enable(False) + self.menuItemsById[self.CID_EXPORT_PASTEBIN[0]].Enable(False) + self.menuItemsById[self.CID_EXPORT_AS_PNG[0]].Enable(False) self.toolBar = wx.ToolBar(self.panelSkin, -1, \ style=wx.HORIZONTAL|wx.TB_FLAT|wx.TB_NODIVIDER) From e195bcde47528e0a3d12b62aa377fcc344123dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sun, 7 Jan 2018 15:20:27 +0100 Subject: [PATCH 075/148] MiRCARTFrame:MiRCARTFrame.TID_SELECT, [CM]ID_*: adds selectable item type. MiRCARTFrame:MiRCARTFrame.{_initMenus,__init__}(): automatically set menu item initial state. --- MiRCARTFrame.py | 51 ++++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 3c92cc5..2331250 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -36,30 +36,31 @@ class MiRCARTFrame(wx.Frame): TID_COMMAND = (0x001) TID_NOTHING = (0x002) TID_MENU = (0x003) - TID_TOOLBAR = (0x004) - TID_ACCELS = (0x005) + TID_SELECT = (0x004) + TID_TOOLBAR = (0x005) + TID_ACCELS = (0x006) # }}} # {{{ Commands - # Id Type Id Labels Icon bitmap Accelerator + # Id Type Id Labels Icon bitmap Accelerator [Initial state] CID_NEW = (0x100, TID_COMMAND, "New", "&New", [wx.ART_NEW], None) CID_OPEN = (0x101, TID_COMMAND, "Open", "&Open", [wx.ART_FILE_OPEN], None) CID_SAVE = (0x102, TID_COMMAND, "Save", "&Save", [wx.ART_FILE_SAVE], None) CID_SAVEAS = (0x103, TID_COMMAND, "Save As...", "Save &As...", [wx.ART_FILE_SAVE_AS], None) - CID_EXPORT_AS_PNG = (0x104, TID_COMMAND, "Export as PNG...", "Export as PN&G...", (), None) - CID_EXPORT_PASTEBIN = (0x105, TID_COMMAND, "Export to Pastebin...", "Export to Pasteb&in...", (), None) + CID_EXPORT_AS_PNG = (0x104, TID_COMMAND, "Export as PNG...", "Export as PN&G...", (), None, False) + CID_EXPORT_PASTEBIN = (0x105, TID_COMMAND, "Export to Pastebin...", "Export to Pasteb&in...", (), None, False) CID_EXIT = (0x106, TID_COMMAND, "Exit", "E&xit", (), None) - CID_UNDO = (0x107, TID_COMMAND, "Undo", "&Undo", [wx.ART_UNDO], (wx.ACCEL_CTRL, ord("Z"))) - CID_REDO = (0x108, TID_COMMAND, "Redo", "&Redo", [wx.ART_REDO], (wx.ACCEL_CTRL, ord("Y"))) - CID_CUT = (0x109, TID_COMMAND, "Cut", "Cu&t", [wx.ART_CUT], None) - CID_COPY = (0x10a, TID_COMMAND, "Copy", "&Copy", [wx.ART_COPY], None) - CID_PASTE = (0x10b, TID_COMMAND, "Paste", "&Paste", [wx.ART_PASTE], None) - CID_DELETE = (0x10c, TID_COMMAND, "Delete", "De&lete", [wx.ART_DELETE], None) + CID_UNDO = (0x107, TID_COMMAND, "Undo", "&Undo", [wx.ART_UNDO], (wx.ACCEL_CTRL, ord("Z")), False) + CID_REDO = (0x108, TID_COMMAND, "Redo", "&Redo", [wx.ART_REDO], (wx.ACCEL_CTRL, ord("Y")), False) + CID_CUT = (0x109, TID_COMMAND, "Cut", "Cu&t", [wx.ART_CUT], None, False) + CID_COPY = (0x10a, TID_COMMAND, "Copy", "&Copy", [wx.ART_COPY], None, False) + CID_PASTE = (0x10b, TID_COMMAND, "Paste", "&Paste", [wx.ART_PASTE], None, False) + CID_DELETE = (0x10c, TID_COMMAND, "Delete", "De&lete", [wx.ART_DELETE], None, False) CID_INCRBRUSH = (0x10d, TID_COMMAND, "Increase brush size", "&Increase brush size", [wx.ART_PLUS], None) CID_DECRBRUSH = (0x10e, TID_COMMAND, "Decrease brush size", "&Decrease brush size", [wx.ART_MINUS], None) - CID_SOLIDBRUSH = (0x10f, TID_COMMAND, "Solid brush", "&Solid brush", [None], None) - CID_RECT = (0x110, TID_COMMAND, "Rectangle", "&Rectangle", [None], None) - CID_CIRCLE = (0x111, TID_COMMAND, "Circle", "&Circle", [None], None) - CID_LINE = (0x112, TID_COMMAND, "Line", "&Line", [None], None) + CID_SOLID_BRUSH = (0x10f, TID_SELECT, "Solid brush", "&Solid brush", [None], None, True) + CID_RECT = (0x110, TID_SELECT, "Rectangle", "&Rectangle", [None], None, True) + CID_CIRCLE = (0x111, TID_SELECT, "Circle", "&Circle", [None], None, False) + CID_LINE = (0x112, TID_SELECT, "Line", "&Line", [None], None, False) CID_COLOUR00 = (0x113, TID_COMMAND, "Colour #00", "Colour #00", MiRCARTColours[0], None) CID_COLOUR01 = (0x114, TID_COMMAND, "Colour #01", "Colour #01", MiRCARTColours[1], None) CID_COLOUR02 = (0x115, TID_COMMAND, "Colour #02", "Colour #02", MiRCARTColours[2], None) @@ -89,7 +90,7 @@ class MiRCARTFrame(wx.Frame): MID_EDIT = (0x301, TID_MENU, "Edit", "&Edit", ( \ CID_UNDO, CID_REDO, NID_MENU_SEP, \ CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_MENU_SEP, \ - CID_INCRBRUSH, CID_DECRBRUSH, CID_SOLIDBRUSH)) + CID_INCRBRUSH, CID_DECRBRUSH, CID_SOLID_BRUSH)) MID_TOOLS = (0x302, TID_MENU, "Tools", "&Tools", ( \ CID_RECT, CID_CIRCLE, CID_LINE)) # }}} @@ -98,7 +99,7 @@ class MiRCARTFrame(wx.Frame): CID_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_TOOLBAR_SEP, \ CID_UNDO, CID_REDO, NID_TOOLBAR_SEP, \ CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_TOOLBAR_SEP, \ - CID_INCRBRUSH, CID_DECRBRUSH, CID_SOLIDBRUSH, NID_TOOLBAR_SEP, \ + CID_INCRBRUSH, CID_DECRBRUSH, CID_SOLID_BRUSH, NID_TOOLBAR_SEP, \ CID_RECT, CID_CIRCLE, CID_LINE, NID_TOOLBAR_SEP, \ CID_COLOUR00, CID_COLOUR01, CID_COLOUR02, CID_COLOUR03, CID_COLOUR04, \ CID_COLOUR05, CID_COLOUR06, CID_COLOUR07, CID_COLOUR08, CID_COLOUR09, \ @@ -136,10 +137,18 @@ class MiRCARTFrame(wx.Frame): for menuItem in menuDescr[4]: if menuItem == self.NID_MENU_SEP: menuWindow.AppendSeparator() + elif menuItem[1] == self.TID_SELECT: + menuItemWindow = menuWindow.AppendRadioItem(menuItem[0], menuItem[3], menuItem[2]) + self.menuItemsById[menuItem[0]] = menuItemWindow + self.Bind(wx.EVT_MENU, handler, menuItemWindow) + if len(menuItem) == 7: + menuItemWindow.Check(menuItem[6]) else: menuItemWindow = menuWindow.Append(menuItem[0], menuItem[3], menuItem[2]) self.menuItemsById[menuItem[0]] = menuItemWindow self.Bind(wx.EVT_MENU, handler, menuItemWindow) + if len(menuItem) == 7: + menuItemWindow.Enable(menuItem[6]) menuBar.Append(menuWindow, menuDescr[3]) # }}} # {{{ _initToolBars(self, toolBar, toolBarsDescr, handler): XXX @@ -284,7 +293,7 @@ class MiRCARTFrame(wx.Frame): pass elif cid == self.CID_DECRBRUSH[0]: pass - elif cid == self.CID_SOLIDBRUSH[0]: + elif cid == self.CID_SOLID_BRUSH[0]: pass elif cid == self.CID_RECT[0]: pass @@ -319,12 +328,6 @@ class MiRCARTFrame(wx.Frame): self._initMenus(self.menuBar, \ [self.MID_FILE, self.MID_EDIT, self.MID_TOOLS], self.onFrameCommand) self.SetMenuBar(self.menuBar) - self.menuItemsById[self.CID_COPY[0]].Enable(False) - self.menuItemsById[self.CID_CUT[0]].Enable(False) - self.menuItemsById[self.CID_DELETE[0]].Enable(False) - self.menuItemsById[self.CID_PASTE[0]].Enable(False) - self.menuItemsById[self.CID_EXPORT_PASTEBIN[0]].Enable(False) - self.menuItemsById[self.CID_EXPORT_AS_PNG[0]].Enable(False) self.toolBar = wx.ToolBar(self.panelSkin, -1, \ style=wx.HORIZONTAL|wx.TB_FLAT|wx.TB_NODIVIDER) From 74e3f41000ab4fd4b297f6cd0af63ab67a57d335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sun, 7 Jan 2018 16:43:41 +0100 Subject: [PATCH 076/148] Initial release sans tools. --- IrcClient.py | 2 +- IrcMiRCARTBot.py | 5 +- MiRCARTCanvas.py | 108 ++++++++++---- MiRCARTCanvasJournal.py | 51 ++++--- MiRCARTCanvasStore.py | 106 ++++++------- MiRCARTColours.py | 34 ++--- MiRCARTFrame.py | 322 ++++++++++++++++++++-------------------- MiRCARTGeneralFrame.py | 140 +++++++++++++++++ MiRCARTToPngFile.py | 31 ++-- MiRCARTTool.py | 4 +- MiRCARTToolRect.py | 28 ++-- README.md | 4 +- 12 files changed, 503 insertions(+), 332 deletions(-) create mode 100644 MiRCARTGeneralFrame.py diff --git a/IrcClient.py b/IrcClient.py index 0816558..1d8647a 100644 --- a/IrcClient.py +++ b/IrcClient.py @@ -90,7 +90,7 @@ class IrcClient: # {{{ queue(self, *args): Parse and queue single line to server from list def queue(self, *args): msg = ""; argNumMax = len(args); - for argNum in range(0, argNumMax): + for argNum in range(argNumMax): if argNum == (argNumMax - 1): msg += ":" + args[argNum] else: diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index 6d75554..b943f23 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -27,6 +27,7 @@ import os, sys, time import json import IrcClient import requests, urllib.request +from MiRCARTCanvasStore import MiRCARTCanvasStore from MiRCARTToPngFile import MiRCARTToPngFile class IrcMiRCARTBot(IrcClient.IrcClient): @@ -139,7 +140,9 @@ class IrcMiRCARTBot(IrcClient.IrcClient): self._log("Unknown URL type specified!") self.queue("PRIVMSG", message[2], "4/!\\ Unknown URL type specified!") return - MiRCARTToPngFile(asciiTmpFilePath, "DejaVuSansMono.ttf", 11).export(imgTmpFilePath) + + canvasStore = MiRCARTCanvasStore(inFile=asciiTmpFilePath) + MiRCARTToPngFile(canvasStore.outMap, "DejaVuSansMono.ttf", 11).export(imgTmpFilePath) imgurResponse = self._uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") if imgurResponse[0] == 200: self._log("Uploaded as: {}".format(imgurResponse[1])) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index f8b5a47..0503889 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -23,40 +23,43 @@ # from MiRCARTCanvasJournal import MiRCARTCanvasJournal -from MiRCARTCanvasStore import MiRCARTCanvasStore +from MiRCARTCanvasStore import MiRCARTCanvasStore, haveMiRCARTToPngFile, haveUrllib from MiRCARTColours import MiRCARTColours import wx class MiRCARTCanvas(wx.Panel): """XXX""" parentFrame = None - canvasPos = canvasSize = canvasWinSize = cellPos = cellSize = None + canvasPos = canvasSize = canvasWinSize = cellSize = None canvasBitmap = canvasMap = canvasTools = None - mircBg = mircFg = mircBrushes = mircPens = None + brushColours = brushPos = brushSize = None + mircBrushes = mircPens = None canvasJournal = canvasStore = None # {{{ _initBrushesAndPens(self): XXX def _initBrushesAndPens(self): self.mircBrushes = [None for x in range(len(MiRCARTColours))] self.mircPens = [None for x in range(len(MiRCARTColours))] - for mircColour in range(0, len(MiRCARTColours)): + for mircColour in range(len(MiRCARTColours)): self.mircBrushes[mircColour] = wx.Brush( \ - wx.Colour(MiRCARTColours[mircColour]), wx.BRUSHSTYLE_SOLID) + wx.Colour(MiRCARTColours[mircColour][0:4]), wx.BRUSHSTYLE_SOLID) self.mircPens[mircColour] = wx.Pen( \ - wx.Colour(MiRCARTColours[mircColour]), 1) + wx.Colour(MiRCARTColours[mircColour][0:4]), 1) # }}} # {{{ _drawPatch(self, patch, eventDc, tmpDc, atPoint): XXX def _drawPatch(self, patch, eventDc, tmpDc, atPoint): - absPoint = self._relMapPointToAbsPoint((patch[0], patch[1]), atPoint) - if patch[4] == " ": - brushFg = self.mircBrushes[patch[3]]; brushBg = self.mircBrushes[patch[3]]; - pen = self.mircPens[patch[3]] + absPoint = self._relMapPointToAbsPoint(patch[0], atPoint) + if patch[3] == " ": + brushFg = self.mircBrushes[patch[1][1]] + brushBg = self.mircBrushes[patch[1][0]] + pen = self.mircPens[patch[1][1]] else: - brushFg = self.mircBrushes[patch[2]]; brushBg = self.mircBrushes[patch[3]]; - pen = self.mircPens[patch[2]] + brushFg = self.mircBrushes[patch[1][0]] + brushBg = self.mircBrushes[patch[1][1]] + pen = self.mircPens[patch[1][0]] for dc in (eventDc, tmpDc): dc.SetBrush(brushFg); dc.SetBackground(brushBg); dc.SetPen(pen); - dc.DrawRectangle(absPoint[0], absPoint[1], self.cellSize[0], self.cellSize[1]) + dc.DrawRectangle(*absPoint, *self.cellSize) # }}} # {{{ _eventPointToMapPoint(self, eventPoint): XXX def _eventPointToMapPoint(self, eventPoint): @@ -72,13 +75,11 @@ class MiRCARTCanvas(wx.Panel): # }}} # {{{ _relMapPointToAbsPoint(self, relMapPoint, atPoint): XXX def _relMapPointToAbsPoint(self, relMapPoint, atPoint): - absX = (atPoint[0] + relMapPoint[0]) * self.cellSize[0] - absY = (atPoint[1] + relMapPoint[1]) * self.cellSize[1] - return (absX, absY) + return [(a+b)*c for a,b,c in zip(atPoint, relMapPoint, self.cellSize)] # }}} - # {{{ _setMapCell(self, absMapPoint, colourFg, colourBg, char): XXX - def _setMapCell(self, absMapPoint, colourFg, colourBg, char): - self.canvasMap[absMapPoint[1]][absMapPoint[0]] = [colourFg, colourBg, char] + # {{{ _setMapCell(self, absMapPoint, colours, charAttrs, char): XXX + def _setMapCell(self, absMapPoint, colours, charAttrs, char): + self.canvasMap[absMapPoint[1]][absMapPoint[0]] = [colours, charAttrs, char] # }}} # {{{ onClose(self, event): XXX @@ -86,17 +87,24 @@ class MiRCARTCanvas(wx.Panel): self.Destroy(); self.__del__(); # }}} # {{{ onJournalUpdate(self, isTmp, absMapPoint, patch, eventDc, tmpDc, atPoint): - def onJournalUpdate(self, isTmp, absMapPoint, patch, eventDc, tmpDc, atPoint): + def onJournalUpdate(self, isTmp, absMapPoint, patch, eventDc, tmpDc, atPoint, isInherit=False): if eventDc == None: eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); if tmpDc == None: tmpDc.SelectObject(self.canvasBitmap) if isTmp == True: + if isInherit: + patch[1:] = self._getMapCell(patch[0]) self._drawPatch(patch, eventDc, tmpDc, atPoint) else: - self._setMapCell(absMapPoint, *patch[2:5]) + if isInherit: + patchOld = patch.copy() + patchOld[1:] = self._getMapCell(patchOld[0]) + self._setMapCell(absMapPoint, *patch[1:]) self._drawPatch(patch, eventDc, tmpDc, atPoint) self.parentFrame.onCanvasUpdate() + if isInherit: + return patchOld # }}} # {{{ onMouseEvent(self, event): XXX def onMouseEvent(self, event): @@ -106,14 +114,58 @@ class MiRCARTCanvas(wx.Panel): eventPoint = event.GetLogicalPosition(eventDc) mapPoint = self._eventPointToMapPoint(eventPoint) for tool in self.canvasTools: - mapPatches = tool.onMouseEvent(event, mapPoint, event.Dragging(), \ - event.LeftIsDown(), event.RightIsDown()) + mapPatches = tool.onMouseEvent( \ + event, mapPoint, self.brushColours, self.brushSize, \ + event.Dragging(), event.LeftIsDown(), event.RightIsDown()) self.canvasJournal.merge(mapPatches, eventDc, tmpDc, mapPoint) + self.parentFrame.onCanvasMotion(event, mapPoint) + # }}} + # {{{ onMouseWindowEvent(self, event): XXX + def onMouseWindowEvent(self, event): + eventObject = event.GetEventObject() + eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); + tmpDc.SelectObject(self.canvasBitmap) + self.canvasJournal.resetCursor(eventDc, tmpDc) + self.parentFrame.onCanvasMotion(event) # }}} # {{{ onPaint(self, event): XXX def onPaint(self, event): eventDc = wx.BufferedPaintDC(self, self.canvasBitmap) # }}} + # {{{ onStoreUpdate(self, newCanvasSize, newCanvas=None): + def onStoreUpdate(self, newCanvasSize, newCanvas=None): + if newCanvasSize != None: + self.resize(newCanvasSize) + self.canvasJournal.reset() + if newCanvas != None: + self.canvasMap = newCanvas.copy() + for numRow in range(self.canvasSize[1]): + numRowCols = len(self.canvasMap[numRow]) + if numRowCols < self.canvasSize[0]: + colsDelta = self.canvasSize[0] - numRowCols + self.canvasMap[numRow][self.canvasSize[0]:] = \ + [[(1, 1), 0, " "] for y in range(colsDelta)] + else: + del self.canvasMap[numRow][self.canvasSize[0]:] + else: + self.canvasMap = [[[(1, 1), 0, " "] \ + for x in range(self.canvasSize[0])] \ + for y in range(self.canvasSize[1])] + canvasWinSize = [a*b for a,b in zip(self.canvasSize, self.cellSize)] + if self.canvasBitmap != None: + self.canvasBitmap.Destroy() + self.canvasBitmap = wx.Bitmap(canvasWinSize) + eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); + tmpDc.SelectObject(self.canvasBitmap) + for numRow in range(self.canvasSize[1]): + for numCol in range(self.canvasSize[0]): + self.onJournalUpdate(False, \ + (numCol, numRow), \ + [(numCol, numRow), \ + *self.canvasMap[numRow][numCol]], \ + eventDc, tmpDc, (0, 0)) + wx.SafeYield() + # }}} # {{{ redo(self): XXX def redo(self): return self.canvasJournal.redo() @@ -124,12 +176,12 @@ class MiRCARTCanvas(wx.Panel): self.SetSize(*self.canvasPos, \ newCanvasSize[0] * self.cellSize[0], \ newCanvasSize[1] * self.cellSize[1]) - for numRow in range(0, self.canvasSize[1]): + for numRow in range(self.canvasSize[1]): for numNewCol in range(self.canvasSize[0], newCanvasSize[0]): self.canvasMap[numRow].append([1, 1, " "]) for numNewRow in range(self.canvasSize[1], newCanvasSize[1]): self.canvasMap.append([]) - for numNewCol in range(0, newCanvasSize[0]): + for numNewCol in range(newCanvasSize[0]): self.canvasMap[numNewRow].append([1, 1, " "]) self.canvasSize = newCanvasSize canvasWinSize = ( \ @@ -162,14 +214,16 @@ class MiRCARTCanvas(wx.Panel): self.canvasTools = [canvasTool(self) for canvasTool in canvasTools] self.cellSize = cellSize - self.cellPos = (0, 0) - self.mircBg = 1; self.mircFg = 4; self._initBrushesAndPens(); + self.brushColours = [4, 1]; self._initBrushesAndPens(); + self.brushPos = [0, 0]; self.brushSize = [1, 1]; self.canvasJournal = MiRCARTCanvasJournal(parentCanvas=self) self.canvasStore = MiRCARTCanvasStore(parentCanvas=self) super().__init__(parent, pos=canvasPos, \ size=[w*h for w,h in zip(canvasSize, cellSize)]) self.Bind(wx.EVT_CLOSE, self.onClose) + self.Bind(wx.EVT_ENTER_WINDOW, self.onMouseWindowEvent) + self.Bind(wx.EVT_LEAVE_WINDOW, self.onMouseWindowEvent) self.Bind(wx.EVT_LEFT_DOWN, self.onMouseEvent) self.Bind(wx.EVT_MOTION, self.onMouseEvent) self.Bind(wx.EVT_PAINT, self.onPaint) diff --git a/MiRCARTCanvasJournal.py b/MiRCARTCanvasJournal.py index a712d36..3b70dbc 100644 --- a/MiRCARTCanvasJournal.py +++ b/MiRCARTCanvasJournal.py @@ -31,28 +31,26 @@ class MiRCARTCanvasJournal(): def _popTmp(self, eventDc, tmpDc): if self.patchesTmp: for patch in self.patchesTmp: - patch[2:] = self.parentCanvas._getMapCell([patch[0], patch[1]]) - self.parentCanvas.onJournalUpdate(True, \ - (patch[0:2]), patch, eventDc, tmpDc, (0, 0)) + self.parentCanvas.onJournalUpdate(True, \ + patch[0], patch, eventDc, tmpDc, (0, 0), True) self.patchesTmp = [] # }}} # {{{ _pushTmp(self, atPoint, patch): XXX def _pushTmp(self, absMapPoint): - self.patchesTmp.append([*absMapPoint, None, None, None]) + self.patchesTmp.append([absMapPoint, None, None, None]) # }}} - # {{{ _pushUndo(self, atPoint, patch): XXX - def _pushUndo(self, atPoint, patch, mapItem): + # {{{ _pushUndo(self, atPoint, patchUndo, patchRedo): XXX + def _pushUndo(self, atPoint, patchUndo, patchRedo): if self.patchesUndoLevel > 0: del self.patchesUndo[0:self.patchesUndoLevel] self.patchesUndoLevel = 0 - absMapPoint = self._relMapPointToAbsMapPoint((patch[0], patch[1]), atPoint) - self.patchesUndo.insert(0, ( \ - (absMapPoint[0], absMapPoint[1], mapItem[0], mapItem[1], mapItem[2]), \ - (absMapPoint[0], absMapPoint[1], patch[2], patch[3], patch[4]))) + absMapPoint = self._relMapPointToAbsMapPoint(patchUndo[0], atPoint) + self.patchesUndo.insert(0, [ \ + [absMapPoint, *patchUndo[1:]], [absMapPoint, *patchRedo[1:]]]) # }}} # {{{ _relMapPointToAbsMapPoint(self, relMapPoint, atPoint): XXX def _relMapPointToAbsMapPoint(self, relMapPoint, atPoint): - return (atPoint[0] + relMapPoint[0], atPoint[1] + relMapPoint[1]) + return [a+b for a,b in zip(atPoint, relMapPoint)] # }}} # {{{ merge(self, mapPatches, eventDc, tmpDc, atPoint): XXX def merge(self, mapPatches, eventDc, tmpDc, atPoint): @@ -61,40 +59,45 @@ class MiRCARTCanvasJournal(): if mapPatchTmp: self._popTmp(eventDc, tmpDc) for patch in mapPatch[1]: - absMapPoint = self._relMapPointToAbsMapPoint(patch[0:2], atPoint) - mapItem = self.parentCanvas._getMapCell(absMapPoint) + absMapPoint = self._relMapPointToAbsMapPoint(patch[0], atPoint) if mapPatchTmp: self._pushTmp(absMapPoint) - self.parentCanvas.onJournalUpdate(mapPatchTmp, \ - absMapPoint, patch, eventDc, tmpDc, atPoint) - elif mapItem != patch[2:5]: - self._pushUndo(atPoint, patch, mapItem) - self.parentCanvas.onJournalUpdate(mapPatchTmp, \ + self.parentCanvas.onJournalUpdate(mapPatchTmp, \ absMapPoint, patch, eventDc, tmpDc, atPoint) + else: + patchUndo = \ + self.parentCanvas.onJournalUpdate(mapPatchTmp, \ + absMapPoint, patch, eventDc, tmpDc, atPoint, True) + self._pushUndo(atPoint, patchUndo, patch) # }}} # {{{ redo(self): XXX def redo(self): if self.patchesUndoLevel > 0: self.patchesUndoLevel -= 1 redoPatch = self.patchesUndo[self.patchesUndoLevel][1] - self.parentCanvas.onJournalUpdate(False, \ - (redoPatch[0:2]), redoPatch, None, None, (0, 0)) + self.parentCanvas.onJournalUpdate(False, \ + redoPatch[0], redoPatch, None, None, (0, 0)) return True else: return False # }}} # {{{ reset(self): XXX def reset(self): - self.patchesTmp = [] - self.patchesUndo = [None]; self.patchesUndoLevel = 0; + self.patchesTmp = []; self.patchesUndo = [None]; self.patchesUndoLevel = 0; + # }}} + # {{{ resetCursor(self, eventDc, tmpDc): XXX + def resetCursor(self, eventDc, tmpDc): + if len(self.patchesTmp): + self._popTmp(eventDc, tmpDc) + self.patchesTmp = [] # }}} # {{{ undo(self): XXX def undo(self): if self.patchesUndo[self.patchesUndoLevel] != None: undoPatch = self.patchesUndo[self.patchesUndoLevel][0] self.patchesUndoLevel += 1 - self.parentCanvas.onJournalUpdate(False, \ - (undoPatch[0:2]), undoPatch, None, None, (0, 0)) + self.parentCanvas.onJournalUpdate(False, \ + undoPatch[0], undoPatch, None, None, (0, 0)) return True else: return False diff --git a/MiRCARTCanvasStore.py b/MiRCARTCanvasStore.py index a3b106e..8a65cd2 100644 --- a/MiRCARTCanvasStore.py +++ b/MiRCARTCanvasStore.py @@ -22,9 +22,13 @@ # SOFTWARE. # -import base64 import io -import wx + +try: + import wx + haveWx = True +except ImportError: + haveWx = False try: from MiRCARTToPngFile import MiRCARTToPngFile @@ -78,66 +82,59 @@ class MiRCARTCanvasStore(): return cellState | bit # }}} - # {{{ exportPastebin(self, apiDevKey): XXX - def exportPastebin(self, apiDevKey): + # {{{ exportBitmapToPngFile(self, canvasBitmap, outPathName, outType): XXX + def exportBitmapToPngFile(self, canvasBitmap, outPathName, outType): + return canvasBitmap.ConvertToImage().SaveFile(outPathName, outType) + # }}} + # {{{ exportPastebin(self, apiDevKey, canvasMap, canvasSize, pasteName="", pastePrivate=0): XXX + def exportPastebin(self, apiDevKey, canvasMap, canvasSize, pasteName="", pastePrivate=0): if haveUrllib: - outFile = io.StringIO(); self.exportTextFile(outFile); - requestData = { \ - "api_dev_key": self.apiDevKey, \ - "api_option": "paste", \ - "api_paste_code": base64.b64encode(outFile.read()), \ - "api_paste_name": pasteName, \ + outFile = io.StringIO() + self.exportTextFile(canvasMap, canvasSize, outFile) + requestData = { \ + "api_dev_key": apiDevKey, \ + "api_option": "paste", \ + "api_paste_code": outFile.getvalue().encode(), \ + "api_paste_name": pasteName, \ "api_paste_private": pastePrivate} - responseHttp = requests.post("https://pastebin.com/post.php", \ + responseHttp = requests.post("https://pastebin.com/api/api_post.php", \ data=requestData) if responseHttp.status_code == 200: - return responseHttp.text + if responseHttp.text.startswith("http"): + return (True, responseHttp.text) + else: + return (False, responseHttp.text) else: - return None + return (False, str(responseHttp.status_code)) else: - return None + return (False, "missing requests and/or urllib3 module(s)") # }}} - # {{{ exportPngFile(self): XXX - def exportPngFile(self, pathName): + # {{{ exportPngFile(self, canvasMap, outPathName): XXX + def exportPngFile(self, canvasMap, outPathName): if haveMiRCARTToPngFile: - outFile = io.StringIO(); self.exportTextFile(outFile); - MiRCARTToPng(outFile).export(pathName) + MiRCARTToPngFile(canvasMap).export(outPathName) return True else: return False # }}} - # {{{ exportTextFile(self, outFile): XXX - def exportTextFile(self, outFile): - canvasMap = self.parentCanvas.canvasMap - canvasSize = self.parentCanvas.canvasSize - for canvasRow in range(0, canvasSize[1]): + # {{{ exportTextFile(self, canvasMap, canvasSize, outFile): XXX + def exportTextFile(self, canvasMap, canvasSize, outFile): + for canvasRow in range(canvasSize[1]): canvasLastColours = [] - for canvasCol in range(0, canvasSize[0]): - canvasColColours = canvasMap[canvasRow][canvasCol][0:2] - canvasColText = self.canvasMap[canvasRow][canvasCol][2] - if canvasColColours != canvasLastColours: - canvasLastColours = canvasColColours - outFile.write("\x03" + \ - str(canvasColColours[0]) + \ - "," + str(canvasColColours[1])) + for canvasCol in range(canvasSize[0]): + canvasColColours = canvasMap[canvasRow][canvasCol][0] + canvasColText = canvasMap[canvasRow][canvasCol][2] + if canvasColColours != canvasLastColours: + canvasLastColours = canvasColColours + outFile.write("\x03" + \ + str(canvasColColours[0]) + \ + "," + str(canvasColColours[1])) outFile.write(canvasColText) outFile.write("\n") # }}} # {{{ importIntoPanel(self): XXX def importIntoPanel(self): - canvasSize = self.inSize; self.parentCanvas.resize(canvasSize); - self.parentCanvas.canvasJournal.reset() - eventDc = wx.ClientDC(self.parentCanvas); tmpDc = wx.MemoryDC(); - tmpDc.SelectObject(self.parentCanvas.canvasBitmap) - for numRow in range(0, len(self.outMap)): - for numCol in range(0, len(self.outMap[numRow])): - self.parentCanvas.onJournalUpdate(False, \ - (numCol, numRow), [numCol, numRow, \ - self.outMap[numRow][numCol][0][0], \ - self.outMap[numRow][numCol][0][1], \ - self.outMap[numRow][numCol][2]], \ - eventDc, tmpDc, (0, 0)) - wx.SafeYield() + self.parentCanvas.onStoreUpdate(self.inSize, self.outMap) # }}} # {{{ importTextFile(self, pathName): XXX def importTextFile(self, pathName): @@ -210,26 +207,7 @@ class MiRCARTCanvasStore(): # }}} # {{{ importNew(self, newCanvasSize=None): XXX def importNew(self, newCanvasSize=None): - if newCanvasSize != None: - self.parentCanvas.resize(newCanvasSize) - self.parentCanvas.canvasJournal.reset() - self.parentCanvas.canvasMap = [[[1, 1, " "] \ - for x in range(self.parentCanvas.canvasSize[0])] \ - for y in range(self.parentCanvas.canvasSize[1])] - canvasWinSize = ( \ - self.parentCanvas.cellSize[0] * self.parentCanvas.canvasSize[0], \ - self.parentCanvas.cellSize[1] * self.parentCanvas.canvasSize[1]) - if self.parentCanvas.canvasBitmap != None: - self.parentCanvas.canvasBitmap.Destroy() - self.parentCanvas.canvasBitmap = wx.Bitmap(canvasWinSize) - eventDc = wx.ClientDC(self.parentCanvas); tmpDc = wx.MemoryDC(); - tmpDc.SelectObject(self.parentCanvas.canvasBitmap) - for numRow in range(0, len(self.parentCanvas.canvasMap)): - for numCol in range(0, len(self.parentCanvas.canvasMap[numRow])): - self.parentCanvas.onJournalUpdate(False, \ - (numCol, numRow), [numCol, numRow, 1, 1, " "], \ - eventDc, tmpDc, (0, 0)) - wx.SafeYield() + self.parentCanvas.onStoreUpdate(newCanvasSize) # }}} # diff --git a/MiRCARTColours.py b/MiRCARTColours.py index 9489b08..2475cc6 100755 --- a/MiRCARTColours.py +++ b/MiRCARTColours.py @@ -23,25 +23,25 @@ # # -# MiRCARTColours: mIRC colour number to RGBA map given none of ^[BFV_] (bold, italic, reverse, underline) +# MiRCARTColours: mIRC colour number to RGBA map given none of ^[BFV_] (bold, italic, reverse, underline], # MiRCARTColours = [ - (255, 255, 255, 255), # White - (0, 0, 0, 255), # Black - (0, 0, 187, 255), # Blue - (0, 187, 0, 255), # Green - (255, 85, 85, 255), # Light Red - (187, 0, 0, 255), # Red - (187, 0, 187, 255), # Purple - (187, 187, 0, 255), # Yellow - (255, 255, 85, 255), # Light Yellow - (85, 255, 85, 255), # Light Green - (0, 187, 187, 255), # Cyan - (85, 255, 255, 255), # Light Cyan - (85, 85, 255, 255), # Light Blue - (255, 85, 255, 255), # Pink - (85, 85, 85, 255), # Grey - (187, 187, 187, 255), # Light Grey + [255, 255, 255, 255, "White"], + [0, 0, 0, 255, "Black"], + [0, 0, 187, 255, "Blue"], + [0, 187, 0, 255, "Green"], + [255, 85, 85, 255, "Light Red"], + [187, 0, 0, 255, "Red"], + [187, 0, 187, 255, "Purple"], + [187, 187, 0, 255, "Yellow"], + [255, 255, 85, 255, "Light Yellow"], + [85, 255, 85, 255, "Light Green"], + [0, 187, 187, 255, "Cyan"], + [85, 255, 255, 255, "Light Cyan"], + [85, 85, 255, 255, "Light Blue"], + [255, 85, 255, 255, "Pink"], + [85, 85, 85, 255, "Grey"], + [187, 187, 187, 255, "Light Grey"], ] # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 2331250..fae9d0d 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -22,61 +22,59 @@ # SOFTWARE. # -from MiRCARTCanvas import MiRCARTCanvas +from MiRCARTCanvas import MiRCARTCanvas, haveUrllib from MiRCARTColours import MiRCARTColours +from MiRCARTGeneralFrame import MiRCARTGeneralFrame, \ + TID_COMMAND, TID_MENU, TID_NOTHING, TID_SELECT, TID_TOOLBAR, TID_ACCELS + import os, wx -class MiRCARTFrame(wx.Frame): +class MiRCARTFrame(MiRCARTGeneralFrame): """XXX""" - panelSkin = panelCanvas = canvasPathName = None + panelCanvas = canvasPathName = None canvasPos = canvasSize = canvasTools = cellSize = None - menuItemsById = menuBar = toolBar = accelTable = statusBar = None - # {{{ Types - TID_COMMAND = (0x001) - TID_NOTHING = (0x002) - TID_MENU = (0x003) - TID_SELECT = (0x004) - TID_TOOLBAR = (0x005) - TID_ACCELS = (0x006) - # }}} # {{{ Commands # Id Type Id Labels Icon bitmap Accelerator [Initial state] - CID_NEW = (0x100, TID_COMMAND, "New", "&New", [wx.ART_NEW], None) - CID_OPEN = (0x101, TID_COMMAND, "Open", "&Open", [wx.ART_FILE_OPEN], None) - CID_SAVE = (0x102, TID_COMMAND, "Save", "&Save", [wx.ART_FILE_SAVE], None) - CID_SAVEAS = (0x103, TID_COMMAND, "Save As...", "Save &As...", [wx.ART_FILE_SAVE_AS], None) - CID_EXPORT_AS_PNG = (0x104, TID_COMMAND, "Export as PNG...", "Export as PN&G...", (), None, False) - CID_EXPORT_PASTEBIN = (0x105, TID_COMMAND, "Export to Pastebin...", "Export to Pasteb&in...", (), None, False) - CID_EXIT = (0x106, TID_COMMAND, "Exit", "E&xit", (), None) - CID_UNDO = (0x107, TID_COMMAND, "Undo", "&Undo", [wx.ART_UNDO], (wx.ACCEL_CTRL, ord("Z")), False) - CID_REDO = (0x108, TID_COMMAND, "Redo", "&Redo", [wx.ART_REDO], (wx.ACCEL_CTRL, ord("Y")), False) - CID_CUT = (0x109, TID_COMMAND, "Cut", "Cu&t", [wx.ART_CUT], None, False) - CID_COPY = (0x10a, TID_COMMAND, "Copy", "&Copy", [wx.ART_COPY], None, False) - CID_PASTE = (0x10b, TID_COMMAND, "Paste", "&Paste", [wx.ART_PASTE], None, False) - CID_DELETE = (0x10c, TID_COMMAND, "Delete", "De&lete", [wx.ART_DELETE], None, False) - CID_INCRBRUSH = (0x10d, TID_COMMAND, "Increase brush size", "&Increase brush size", [wx.ART_PLUS], None) - CID_DECRBRUSH = (0x10e, TID_COMMAND, "Decrease brush size", "&Decrease brush size", [wx.ART_MINUS], None) - CID_SOLID_BRUSH = (0x10f, TID_SELECT, "Solid brush", "&Solid brush", [None], None, True) - CID_RECT = (0x110, TID_SELECT, "Rectangle", "&Rectangle", [None], None, True) - CID_CIRCLE = (0x111, TID_SELECT, "Circle", "&Circle", [None], None, False) - CID_LINE = (0x112, TID_SELECT, "Line", "&Line", [None], None, False) - CID_COLOUR00 = (0x113, TID_COMMAND, "Colour #00", "Colour #00", MiRCARTColours[0], None) - CID_COLOUR01 = (0x114, TID_COMMAND, "Colour #01", "Colour #01", MiRCARTColours[1], None) - CID_COLOUR02 = (0x115, TID_COMMAND, "Colour #02", "Colour #02", MiRCARTColours[2], None) - CID_COLOUR03 = (0x116, TID_COMMAND, "Colour #03", "Colour #03", MiRCARTColours[3], None) - CID_COLOUR04 = (0x117, TID_COMMAND, "Colour #04", "Colour #04", MiRCARTColours[4], None) - CID_COLOUR05 = (0x118, TID_COMMAND, "Colour #05", "Colour #05", MiRCARTColours[5], None) - CID_COLOUR06 = (0x119, TID_COMMAND, "Colour #06", "Colour #06", MiRCARTColours[6], None) - CID_COLOUR07 = (0x11a, TID_COMMAND, "Colour #07", "Colour #07", MiRCARTColours[7], None) - CID_COLOUR08 = (0x11b, TID_COMMAND, "Colour #08", "Colour #08", MiRCARTColours[8], None) - CID_COLOUR09 = (0x11c, TID_COMMAND, "Colour #09", "Colour #09", MiRCARTColours[9], None) - CID_COLOUR10 = (0x11d, TID_COMMAND, "Colour #10", "Colour #10", MiRCARTColours[10], None) - CID_COLOUR11 = (0x11e, TID_COMMAND, "Colour #11", "Colour #11", MiRCARTColours[11], None) - CID_COLOUR12 = (0x11f, TID_COMMAND, "Colour #12", "Colour #12", MiRCARTColours[12], None) - CID_COLOUR13 = (0x120, TID_COMMAND, "Colour #13", "Colour #13", MiRCARTColours[13], None) - CID_COLOUR14 = (0x121, TID_COMMAND, "Colour #14", "Colour #14", MiRCARTColours[14], None) - CID_COLOUR15 = (0x122, TID_COMMAND, "Colour #15", "Colour #15", MiRCARTColours[15], None) + CID_NEW = (0x100, TID_COMMAND, "New", "&New", wx.ART_NEW, (wx.ACCEL_CTRL, ord("N"))) + CID_OPEN = (0x101, TID_COMMAND, "Open", "&Open", wx.ART_FILE_OPEN, (wx.ACCEL_CTRL, ord("O"))) + CID_SAVE = (0x102, TID_COMMAND, "Save", "&Save", wx.ART_FILE_SAVE, (wx.ACCEL_CTRL, ord("S"))) + CID_SAVEAS = (0x103, TID_COMMAND, "Save As...", "Save &As...", wx.ART_FILE_SAVE_AS, None) + CID_EXPORT_AS_PNG = (0x104, TID_COMMAND, "Export as PNG...", \ + "Export as PN&G...", None, None) + CID_EXPORT_PASTEBIN = (0x105, TID_COMMAND, "Export to Pastebin...", \ + "Export to Pasteb&in...", None, None, haveUrllib) + CID_EXIT = (0x106, TID_COMMAND, "Exit", "E&xit", None, None) + CID_UNDO = (0x107, TID_COMMAND, "Undo", "&Undo", wx.ART_UNDO, (wx.ACCEL_CTRL, ord("Z")), False) + CID_REDO = (0x108, TID_COMMAND, "Redo", "&Redo", wx.ART_REDO, (wx.ACCEL_CTRL, ord("Y")), False) + CID_CUT = (0x109, TID_COMMAND, "Cut", "Cu&t", wx.ART_CUT, None, False) + CID_COPY = (0x10a, TID_COMMAND, "Copy", "&Copy", wx.ART_COPY, None, False) + CID_PASTE = (0x10b, TID_COMMAND, "Paste", "&Paste", wx.ART_PASTE, None, False) + CID_DELETE = (0x10c, TID_COMMAND, "Delete", "De&lete", wx.ART_DELETE, None, False) + CID_INCRBRUSH = (0x10d, TID_COMMAND, "Increase brush size", \ + "&Increase brush size", wx.ART_PLUS, None) + CID_DECRBRUSH = (0x10e, TID_COMMAND, "Decrease brush size", \ + "&Decrease brush size", wx.ART_MINUS, None) + CID_SOLID_BRUSH = (0x10f, TID_SELECT, "Solid brush", "&Solid brush", None, None, True) + CID_RECT = (0x110, TID_SELECT, "Rectangle", "&Rectangle", None, None, True) + CID_CIRCLE = (0x111, TID_SELECT, "Circle", "&Circle", None, None, False) + CID_LINE = (0x112, TID_SELECT, "Line", "&Line", None, None, False) + CID_COLOUR00 = (0x113, TID_COMMAND, "Colour #00", "Colour #00", None, None) + CID_COLOUR01 = (0x114, TID_COMMAND, "Colour #01", "Colour #01", None, None) + CID_COLOUR02 = (0x115, TID_COMMAND, "Colour #02", "Colour #02", None, None) + CID_COLOUR03 = (0x116, TID_COMMAND, "Colour #03", "Colour #03", None, None) + CID_COLOUR04 = (0x117, TID_COMMAND, "Colour #04", "Colour #04", None, None) + CID_COLOUR05 = (0x118, TID_COMMAND, "Colour #05", "Colour #05", None, None) + CID_COLOUR06 = (0x119, TID_COMMAND, "Colour #06", "Colour #06", None, None) + CID_COLOUR07 = (0x11a, TID_COMMAND, "Colour #07", "Colour #07", None, None) + CID_COLOUR08 = (0x11b, TID_COMMAND, "Colour #08", "Colour #08", None, None) + CID_COLOUR09 = (0x11c, TID_COMMAND, "Colour #09", "Colour #09", None, None) + CID_COLOUR10 = (0x11d, TID_COMMAND, "Colour #10", "Colour #10", None, None) + CID_COLOUR11 = (0x11e, TID_COMMAND, "Colour #11", "Colour #11", None, None) + CID_COLOUR12 = (0x11f, TID_COMMAND, "Colour #12", "Colour #12", None, None) + CID_COLOUR13 = (0x120, TID_COMMAND, "Colour #13", "Colour #13", None, None) + CID_COLOUR14 = (0x121, TID_COMMAND, "Colour #14", "Colour #14", None, None) + CID_COLOUR15 = (0x122, TID_COMMAND, "Colour #15", "Colour #15", None, None) # }}} # {{{ Non-items NID_MENU_SEP = (0x200, TID_NOTHING) @@ -107,79 +105,61 @@ class MiRCARTFrame(wx.Frame): CID_COLOUR15)) # }}} # {{{ Accelerators (hotkeys) - AID_EDIT = (0x500, TID_ACCELS, (CID_UNDO, CID_REDO)) + AID_EDIT = (0x500, TID_ACCELS, ( \ + CID_NEW, CID_OPEN, CID_SAVE, CID_UNDO, CID_REDO)) # }}} - # {{{ _drawIcon(self, solidColour): XXX - def _drawIcon(self, solidColour): - iconBitmap = wx.Bitmap((16,16)) - iconDc = wx.MemoryDC(); iconDc.SelectObject(iconBitmap); - iconBrush = wx.Brush(wx.Colour(solidColour), wx.BRUSHSTYLE_SOLID) - iconDc.SetBrush(iconBrush); iconDc.SetBackground(iconBrush); - iconDc.SetPen(wx.Pen(wx.Colour(solidColour), 1)) - iconDc.DrawRectangle(0, 0, 16, 16) - return iconBitmap + # {{{ _dialogSaveChanges(self) + def _dialogSaveChanges(self): + with wx.MessageDialog(self, \ + "Do you want to save changes to {}?".format( \ + self.canvasPathName), "MiRCART", \ + wx.CANCEL|wx.CANCEL_DEFAULT|wx.ICON_QUESTION|wx.YES_NO) as dialog: + dialogChoice = dialog.ShowModal() + return dialogChoice # }}} - # {{{ _initAccelTable(self, accelsDescr, handler): XXX - def _initAccelTable(self, accelsDescr, handler): - accelTableEntries = [wx.AcceleratorEntry() for n in range(0, len(accelsDescr[2]))] - for numAccel in range(0, len(accelsDescr[2])): - accelDescr = accelsDescr[2][numAccel] - if accelDescr[5] != None: - accelTableEntries[numAccel].Set(accelDescr[5][0], accelDescr[5][1], accelDescr[0]) - self.Bind(wx.EVT_MENU, handler, id=accelDescr[0]) - return accelTableEntries + # {{{ _setPaletteToolBitmaps(self): XXX + def _setPaletteToolBitmaps(self): + paletteDescr = ( \ + self.CID_COLOUR00, self.CID_COLOUR01, self.CID_COLOUR02, self.CID_COLOUR03, self.CID_COLOUR04, \ + self.CID_COLOUR05, self.CID_COLOUR06, self.CID_COLOUR07, self.CID_COLOUR08, self.CID_COLOUR09, \ + self.CID_COLOUR10, self.CID_COLOUR11, self.CID_COLOUR12, self.CID_COLOUR13, self.CID_COLOUR14, \ + self.CID_COLOUR15) + for numColour in range(len(paletteDescr)): + toolBitmapColour = MiRCARTColours[numColour][0:4] + toolBitmap = wx.Bitmap((16,16)) + toolBitmapDc = wx.MemoryDC(); toolBitmapDc.SelectObject(toolBitmap); + toolBitmapBrush = wx.Brush( \ + wx.Colour(toolBitmapColour), wx.BRUSHSTYLE_SOLID) + toolBitmapDc.SetBrush(toolBitmapBrush) + toolBitmapDc.SetBackground(toolBitmapBrush) + toolBitmapDc.SetPen(wx.Pen(wx.Colour(toolBitmapColour), 1)) + toolBitmapDc.DrawRectangle(0, 0, 16, 16) + self.toolBar.SetToolNormalBitmap( \ + paletteDescr[numColour][0], toolBitmap) # }}} - # {{{ _initMenus(self, menuBar, menusDescr, handler): XXX - def _initMenus(self, menuBar, menusDescr, handler): - for menuDescr in menusDescr: - menuWindow = wx.Menu() - for menuItem in menuDescr[4]: - if menuItem == self.NID_MENU_SEP: - menuWindow.AppendSeparator() - elif menuItem[1] == self.TID_SELECT: - menuItemWindow = menuWindow.AppendRadioItem(menuItem[0], menuItem[3], menuItem[2]) - self.menuItemsById[menuItem[0]] = menuItemWindow - self.Bind(wx.EVT_MENU, handler, menuItemWindow) - if len(menuItem) == 7: - menuItemWindow.Check(menuItem[6]) - else: - menuItemWindow = menuWindow.Append(menuItem[0], menuItem[3], menuItem[2]) - self.menuItemsById[menuItem[0]] = menuItemWindow - self.Bind(wx.EVT_MENU, handler, menuItemWindow) - if len(menuItem) == 7: - menuItemWindow.Enable(menuItem[6]) - menuBar.Append(menuWindow, menuDescr[3]) - # }}} - # {{{ _initToolBars(self, toolBar, toolBarsDescr, handler): XXX - def _initToolBars(self, toolBar, toolBarsDescr, handler): - for toolBarDescr in toolBarsDescr: - for toolBarItem in toolBarDescr[2]: - if toolBarItem == self.NID_TOOLBAR_SEP: - toolBar.AddSeparator() - else: - if len(toolBarItem[4]) == 4: - toolBarItemIcon = self._drawIcon(toolBarItem[4]) - elif len(toolBarItem[4]) == 1 \ - and toolBarItem[4][0] != None: - toolBarItemIcon = wx.ArtProvider.GetBitmap( \ - toolBarItem[4][0], wx.ART_TOOLBAR, (16,16)) - else: - toolBarItemIcon = wx.ArtProvider.GetBitmap( \ - wx.ART_HELP, wx.ART_TOOLBAR, (16,16)) - toolBarItemWindow = self.toolBar.AddTool( \ - toolBarItem[0], toolBarItem[2], toolBarItemIcon) - self.Bind(wx.EVT_TOOL, handler, toolBarItemWindow) - self.Bind(wx.EVT_TOOL_RCLICKED, handler, toolBarItemWindow) - # }}} - # {{{ _updateStatusBar(self): XXX - def _updateStatusBar(self): - text = "Foreground colour:" - text += " " + str(self.panelCanvas.mircFg) - text += " | " - text += "Background colour:" - text += " " + str(self.panelCanvas.mircBg) - self.statusBar.SetStatusText(text) + # {{{ _updateStatusBar(self, showColours=None, showFileName=True, showPos=None): XXX + def _updateStatusBar(self, showColours=True, showFileName=True, showPos=True): + if showColours == True: + showColours = self.panelCanvas.brushColours + if showPos == True: + showPos = self.panelCanvas.brushPos + if showFileName == True: + showFileName = self.canvasPathName + textItems = [] + if showPos != None: + textItems.append("X: {:03d} Y: {:03d}".format( \ + showPos[0], showPos[1])) + if showColours != None: + textItems.append("FG: {:02d}, BG: {:02d}".format( \ + showColours[0],showColours[1])) + textItems.append("{} on {}".format( \ + MiRCARTColours[showColours[0]][4], \ + MiRCARTColours[showColours[1]][4])) + if showFileName != None: + textItems.append("Current file: {}".format( \ + os.path.basename(showFileName))) + self.statusBar.SetStatusText(" | ".join(textItems)) # }}} # {{{ canvasExportAsPng(self): XXX @@ -189,31 +169,57 @@ class MiRCARTFrame(wx.Frame): if dialog.ShowModal() == wx.ID_CANCEL: return False else: - try: - outPathName = dialog.GetPath() - self.panelCanvas.exportPngFile(outhPathName) - return True - except IOError as error: - pass + outPathName = dialog.GetPath() + self.panelCanvas.canvasStore.exportBitmapToPngFile( \ + self.panelCanvas.canvasBitmap, outPathName, \ + wx.BITMAP_TYPE_PNG) + return True # }}} # {{{ canvasExportPastebin(self): XXX def canvasExportPastebin(self): - try: - self.panelCanvas.exportPastebin("253ce2f0a45140ee0a44ca99aa49260") - return True - except IOError as error: - pass + pasteStatus, pasteResult = \ + self.panelCanvas.canvasStore.exportPastebin( \ + "253ce2f0a45140ee0a44ca99aa49260", \ + self.panelCanvas.canvasMap, \ + self.panelCanvas.canvasSize) + if pasteStatus: + if not wx.TheClipboard.IsOpened(): + wx.TheClipboard.Open() + wx.TheClipboard.SetData(wx.TextDataObject(pasteResult)) + wx.TheClipboard.Close() + wx.MessageBox("Exported to Pastebin: " + pasteResult, \ + "Export to Pastebin", wx.OK|wx.ICON_INFORMATION) + else: + wx.MessageBox("Failed to export to Pastebin: " + pasteResult, \ + "Export to Pastebin", wx.OK|wx.ICON_EXCLAMATION) # }}} # {{{ canvasNew(self, newCanvasSize=None): XXX def canvasNew(self, newCanvasSize=None): + if self.canvasPathName != None: + saveChanges = self._dialogSaveChanges() + if saveChanges == wx.ID_CANCEL: + return + elif saveChanges == wx.ID_NO: + pass + elif saveChanges == wx.ID_YES: + self.canvasSave() if newCanvasSize == None: newCanvasSize = (100, 30) self.panelCanvas.canvasStore.importNew(newCanvasSize) + self.canvasPathName = None self._updateStatusBar(); self.onCanvasUpdate(); # }}} # {{{ canvasOpen(self): XXX def canvasOpen(self): - with wx.FileDialog(self, self.CID_OPEN[2], os.getcwd(), "", \ + if self.canvasPathName != None: + saveChanges = self._dialogSaveChanges() + if saveChanges == wx.ID_CANCEL: + return + elif saveChanges == wx.ID_NO: + pass + elif saveChanges == wx.ID_YES: + self.canvasSave() + with wx.FileDialog(self, self.CID_OPEN[2], os.getcwd(), "", \ "*.txt", wx.FD_OPEN) as dialog: if dialog.ShowModal() == wx.ID_CANCEL: return False @@ -230,10 +236,13 @@ class MiRCARTFrame(wx.Frame): if self.canvasSaveAs() == False: return try: - self.panelCanvas.exportTextFile(self.canvasPathName) - return True + with open(self.canvasPathName, "w") as outFile: + self.panelCanvas.canvasStore.exportTextFile( \ + self.panelCanvas.canvasMap, \ + self.panelCanvas.canvasSize, outFile) + return True except IOError as error: - pass + return False # }}} # {{{ canvasSaveAs(self): XXX def canvasSaveAs(self): @@ -243,22 +252,32 @@ class MiRCARTFrame(wx.Frame): return False else: self.canvasPathName = dialog.GetPath() - return True + return self.canvasSave() + # }}} + # {{{ onCanvasMotion(self, event): XXX + def onCanvasMotion(self, event, mapPoint=None): + eventType = event.GetEventType() + if eventType == wx.wxEVT_ENTER_WINDOW: + pass + elif eventType == wx.wxEVT_MOTION: + self._updateStatusBar(showPos=mapPoint) + elif eventType == wx.wxEVT_LEAVE_WINDOW: + pass # }}} # {{{ onCanvasUpdate(self): XXX def onCanvasUpdate(self): if self.panelCanvas.canvasJournal.patchesUndo[self.panelCanvas.canvasJournal.patchesUndoLevel] != None: self.menuItemsById[self.CID_UNDO[0]].Enable(True) + self.toolBar.EnableTool(self.CID_UNDO[0], True) else: self.menuItemsById[self.CID_UNDO[0]].Enable(False) + self.toolBar.EnableTool(self.CID_UNDO[0], False) if self.panelCanvas.canvasJournal.patchesUndoLevel > 0: self.menuItemsById[self.CID_REDO[0]].Enable(True) + self.toolBar.EnableTool(self.CID_REDO[0], True) else: self.menuItemsById[self.CID_REDO[0]].Enable(False) - # }}} - # {{{ onClose(self, event): XXX - def onClose(self, event): - self.Destroy(); self.__del__(); + self.toolBar.EnableTool(self.CID_REDO[0], False) # }}} # {{{ onFrameCommand(self, event): XXX def onFrameCommand(self, event): @@ -305,9 +324,9 @@ class MiRCARTFrame(wx.Frame): and cid <= self.CID_COLOUR15[0]: numColour = cid - self.CID_COLOUR00[0] if event.GetEventType() == wx.wxEVT_TOOL: - self.panelCanvas.mircFg = numColour + self.panelCanvas.brushColours[0] = numColour elif event.GetEventType() == wx.wxEVT_TOOL_RCLICKED: - self.panelCanvas.mircBg = numColour + self.panelCanvas.brushColours[1] = numColour self._updateStatusBar() # }}} # {{{ __del__(self): destructor method @@ -319,32 +338,13 @@ class MiRCARTFrame(wx.Frame): # # __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), cellSize=(7, 14), canvasSize=(100, 30), canvasTools=[]): initialisation method def __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), cellSize=(7, 14), canvasSize=(100, 30), canvasTools=[]): - super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) - self.panelSkin = wx.Panel(self, wx.ID_ANY) + panelSkin = super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) + self._setPaletteToolBitmaps() self.canvasPos = canvasPos; self.cellSize = cellSize; self.canvasSize = canvasSize; self.canvasPathName = None - - self.menuItemsById = {}; self.menuBar = wx.MenuBar(); - self._initMenus(self.menuBar, \ - [self.MID_FILE, self.MID_EDIT, self.MID_TOOLS], self.onFrameCommand) - self.SetMenuBar(self.menuBar) - - self.toolBar = wx.ToolBar(self.panelSkin, -1, \ - style=wx.HORIZONTAL|wx.TB_FLAT|wx.TB_NODIVIDER) - self.toolBar.SetToolBitmapSize((16,16)) - self._initToolBars(self.toolBar, [self.BID_TOOLBAR], self.onFrameCommand) - self.toolBar.Realize(); self.toolBar.Fit(); - - self.accelTable = wx.AcceleratorTable( \ - self._initAccelTable(self.AID_EDIT, self.onFrameCommand)) - self.SetAcceleratorTable(self.accelTable) - - self.Bind(wx.EVT_CLOSE, self.onClose) - self.statusBar = self.CreateStatusBar(); - self.SetFocus(); self.Show(True); self.canvasTools = canvasTools - self.panelCanvas = MiRCARTCanvas(self.panelSkin, parentFrame=self, \ - canvasPos=self.canvasPos, canvasSize=self.canvasSize, \ + self.panelCanvas = MiRCARTCanvas(panelSkin, parentFrame=self, \ + canvasPos=self.canvasPos, canvasSize=self.canvasSize, \ canvasTools=self.canvasTools, cellSize=self.cellSize) self.canvasNew() diff --git a/MiRCARTGeneralFrame.py b/MiRCARTGeneralFrame.py new file mode 100644 index 0000000..798af47 --- /dev/null +++ b/MiRCARTGeneralFrame.py @@ -0,0 +1,140 @@ +#!/usr/bin/env python3 +# +# MiRCARTGeneralFrame.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +import os, wx + +# +# Types +TID_COMMAND = (0x001) +TID_MENU = (0x002) +TID_NOTHING = (0x003) +TID_SELECT = (0x004) +TID_TOOLBAR = (0x005) +TID_ACCELS = (0x006) + +class MiRCARTGeneralFrame(wx.Frame): + """XXX""" + menuItemsById = toolBarItemsById = None + statusBar = toolBar = None + + # {{{ _initAccelTable(self, accelsDescr, handler): XXX + def _initAccelTable(self, accelsDescr, handler): + accelTableEntries = [wx.AcceleratorEntry() for n in range(len(accelsDescr[2]))] + for numAccel in range(len(accelsDescr[2])): + accelDescr = accelsDescr[2][numAccel] + if accelDescr[5] != None: + accelTableEntries[numAccel].Set(*accelDescr[5], accelDescr[0]) + self.Bind(wx.EVT_MENU, handler, id=accelDescr[0]) + return accelTableEntries + # }}} + # {{{ _initMenus(self, menuBar, menusDescr, handler): XXX + def _initMenus(self, menuBar, menusDescr, handler): + for menuDescr in menusDescr: + menuWindow = wx.Menu() + for menuItem in menuDescr[4]: + if menuItem == self.NID_MENU_SEP: + menuWindow.AppendSeparator() + elif menuItem[1] == TID_SELECT: + menuItemWindow = menuWindow.AppendRadioItem(menuItem[0], menuItem[3], menuItem[2]) + self.menuItemsById[menuItem[0]] = menuItemWindow + self.Bind(wx.EVT_MENU, handler, menuItemWindow) + if len(menuItem) == 7: + menuItemWindow.Check(menuItem[6]) + else: + menuItemWindow = menuWindow.Append(menuItem[0], menuItem[3], menuItem[2]) + self.menuItemsById[menuItem[0]] = menuItemWindow + self.Bind(wx.EVT_MENU, handler, menuItemWindow) + if len(menuItem) == 7: + menuItemWindow.Enable(menuItem[6]) + menuBar.Append(menuWindow, menuDescr[3]) + # }}} + # {{{ _initToolBars(self, toolBar, toolBarsDescr, handler): XXX + def _initToolBars(self, toolBar, toolBarsDescr, handler): + for toolBarDescr in toolBarsDescr: + for toolBarItem in toolBarDescr[2]: + if toolBarItem == self.NID_TOOLBAR_SEP: + toolBar.AddSeparator() + else: + if toolBarItem[4] != None: + toolBarItemIcon = wx.ArtProvider.GetBitmap( \ + toolBarItem[4], wx.ART_TOOLBAR, (16,16)) + else: + toolBarItemIcon = wx.ArtProvider.GetBitmap( \ + wx.ART_HELP, wx.ART_TOOLBAR, (16,16)) + toolBarItemWindow = self.toolBar.AddTool( \ + toolBarItem[0], toolBarItem[2], toolBarItemIcon) + self.toolBarItemsById[toolBarItem[0]] = toolBarItemWindow + if len(toolBarItem) == 7 \ + and toolBarItem[1] == TID_COMMAND: + toolBarItemWindow.Enable(toolBarItem[6]) + self.Bind(wx.EVT_TOOL, handler, toolBarItemWindow) + self.Bind(wx.EVT_TOOL_RCLICKED, handler, toolBarItemWindow) + # }}} + # {{{ onClose(self, event): XXX + def onClose(self, event): + self.Destroy(); self.__del__(); + # }}} + # {{{ onFrameCommand(self, event): XXX + def onFrameCommand(self, event): + pass + # }}} + + # + # __init__(self, *args, **kwargs): initialisation method + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + panelSkin = wx.Panel(self, wx.ID_ANY) + + # Initialise menu bar, menus & menu items + self.menuItemsById = {}; menuBar = wx.MenuBar(); + self._initMenus(menuBar, \ + [self.MID_FILE, self.MID_EDIT, self.MID_TOOLS], + self.onFrameCommand) + self.SetMenuBar(menuBar) + + # Initialise toolbar & toolbar items + self.toolBarItemsById = {} + self.toolBar = wx.ToolBar(panelSkin, -1, \ + style=wx.HORIZONTAL|wx.TB_FLAT|wx.TB_NODIVIDER) + self.toolBar.SetToolBitmapSize((16,16)) + self._initToolBars(self.toolBar, [self.BID_TOOLBAR], self.onFrameCommand) + self.toolBar.Realize(); self.toolBar.Fit(); + + # Initialise accelerators (hotkeys) + accelTable = wx.AcceleratorTable( \ + self._initAccelTable(self.AID_EDIT, self.onFrameCommand)) + self.SetAcceleratorTable(accelTable) + + # Initialise status bar + self.statusBar = self.CreateStatusBar() + + # Bind event handlers + self.Bind(wx.EVT_CLOSE, self.onClose) + + # Set focus on & show window + self.SetFocus(); self.Show(True); + + return panelSkin + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTToPngFile.py b/MiRCARTToPngFile.py index 8503b41..cf6e7de 100755 --- a/MiRCARTToPngFile.py +++ b/MiRCARTToPngFile.py @@ -22,13 +22,13 @@ # SOFTWARE. # +import MiRCARTCanvasStore from PIL import Image, ImageDraw, ImageFont -from MiRCARTFromTextFile import MiRCARTFromTextFile import string, sys class MiRCARTToPngFile: """XXX""" - inFile = inFilePath = inFromTextFile = None + inFile = inFromTextFile = None outFontFilePath = outFontSize = None # {{{ _ColourMapBold: mIRC colour number to RGBA map given ^B (bold) @@ -81,23 +81,23 @@ class MiRCARTToPngFile: # }}} # {{{ export(self, outFilePath): XXX def export(self, outFilePath): - inSize = self.inFromTextFile.getSize(); - outSize = [inSize[n] * self.outImgFontSize[n] for n in range(0, 2)] + inSize = (len(self.inCanvasMap[0]), len(self.inCanvasMap)) + outSize = [a*b for a,b in zip(inSize, self.outImgFontSize)] outCurPos = [0, 0] outImg = Image.new("RGBA", outSize, (*self._ColourMapNormal[1], 255)) outImgDraw = ImageDraw.Draw(outImg) - for inCurRow in range(0, inSize[1]): - for inCurCol in range(0, len(self.inFromTextFile.outMap[inCurRow])): - inCurCell = self.inFromTextFile.outMap[inCurRow][inCurCol] + for inCurRow in range(len(self.inCanvasMap)): + for inCurCol in range(len(self.inCanvasMap[inCurRow])): + inCurCell = self.inCanvasMap[inCurRow][inCurCol] outColours = [0, 0] - if inCurCell[1] & MiRCARTFromTextFile._CellState.CS_BOLD: + if inCurCell[1] & 0x02: if inCurCell[2] != " ": outColours[0] = self._ColourMapBold[inCurCell[0][0]] outColours[1] = self._ColourMapBold[inCurCell[0][1]] else: if inCurCell[2] != " ": outColours[0] = self._ColourMapNormal[inCurCell[0][0]] - outColours[1] = self._ColourMapNormal[inCurCell[0][1]] + outColours[1] = self._ColourMapNormal[inCurCell[0][1]] outImgDraw.rectangle((*outCurPos, \ outCurPos[0] + self.outImgFontSize[0], \ outCurPos[1] + self.outImgFontSize[1]), \ @@ -107,7 +107,7 @@ class MiRCARTToPngFile: # XXX implement italic outImgDraw.text(outCurPos, \ inCurCell[2], (*outColours[0], 255), self.outImgFont) - if inCurCell[1] & MiRCARTFromTextFile._CellState.CS_UNDERLINE: + if inCurCell[1] & 0x1f: self._drawUnderLine(curPos, self.outImgFontSize, outImgDraw) outCurPos[0] += self.outImgFontSize[0]; outCurPos[0] = 0 @@ -116,11 +116,9 @@ class MiRCARTToPngFile: # }}} # - # __init__(self, inFilePath, fontFilePath="DejaVuSansMono.ttf", fontSize=11): initialisation method - def __init__(self, inFilePath, fontFilePath="DejaVuSansMono.ttf", fontSize=11): - self.inFilePath = inFilePath; self.inFile = open(inFilePath, "r"); - self.inFromTextFile = MiRCARTFromTextFile(self.inFile) - + # __init__(self, inCanvasMap, fontFilePath="DejaVuSansMono.ttf", fontSize=11): initialisation method + def __init__(self, inCanvasMap, fontFilePath="DejaVuSansMono.ttf", fontSize=11): + self.inCanvasMap = inCanvasMap self.outFontFilePath = fontFilePath; self.outFontSize = int(fontSize); self.outImgFont = ImageFont.truetype( \ self.outFontFilePath, self.outFontSize) @@ -130,7 +128,8 @@ class MiRCARTToPngFile: # # Entry point def main(*argv): - MiRCARTToPngFile(argv[1], *argv[3:]).export(argv[2]) + canvasStore = MiRCARTCanvasStore.MiRCARTCanvasStore(inFile=argv[1]) + MiRCARTToPngFile(canvasStore.outMap, *argv[3:]).export(argv[2]) if __name__ == "__main__": if ((len(sys.argv) - 1) < 2)\ or ((len(sys.argv) - 1) > 4): diff --git a/MiRCARTTool.py b/MiRCARTTool.py index 0dad5ad..ae91e6d 100644 --- a/MiRCARTTool.py +++ b/MiRCARTTool.py @@ -26,8 +26,8 @@ class MiRCARTTool(): """XXX""" parentCanvas = None - # {{{ onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): XXX - def onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): + # {{{ onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): XXX + def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): pass # }}} diff --git a/MiRCARTToolRect.py b/MiRCARTToolRect.py index b9e9fb2..71e226d 100644 --- a/MiRCARTToolRect.py +++ b/MiRCARTToolRect.py @@ -28,25 +28,19 @@ class MiRCARTToolRect(MiRCARTTool): """XXX""" # - # onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): XXX - def onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): + # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): XXX + def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): + brushColours = brushColours.copy() if isLeftDown: - return [[False, [[0, 0, \ - self.parentCanvas.mircFg, \ - self.parentCanvas.mircFg, " "]]], - [True, [[0, 0, \ - self.parentCanvas.mircFg, \ - self.parentCanvas.mircFg, " "]]]] + brushColours[1] = brushColours[0] + return [[False, [[[0, 0], brushColours, 0, " "]]], \ + [True, [[[0, 0], brushColours, 0, " "]]]] elif isRightDown: - return [[False, [[0, 0, \ - self.parentCanvas.mircBg, \ - self.parentCanvas.mircBg, " "]]], \ - [True, [[0, 0, \ - self.parentCanvas.mircBg, \ - self.parentCanvas.mircBg, " "]]]] + brushColours[0] = brushColours[1] + return [[False, [[[0, 0], brushColours, 0, " "]]], \ + [True, [[[0, 0], brushColours, 0, " "]]]] else: - return [[True, [[0, 0, \ - self.parentCanvas.mircFg, \ - self.parentCanvas.mircFg, " "]]]] + brushColours[1] = brushColours[0] + return [[True, [[[0, 0], brushColours, 0, " "]]]] # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/README.md b/README.md index 5785840..2795ff8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MiRCART.py -- mIRC art editor for Windows & Linux (WIP) -* Prerequisites on Windows: install Python v3.6.x[1] and wxPython v4.x.x w/ the following elevated command prompt command line: - `pip install wxPython` +* Prerequisites on Windows: install Python v3.6.x[1] and script dependencies w/ the following elevated command prompt command line: + `pip install requests urllib3 wxPython` * Prerequisites on Linux: python3 && python-wx{gtk2.8,tools} on Debian-family Linux distributions * Screenshot: ![Screenshot](https://github.com/lalbornoz/MiRCARTools/raw/master/MiRCART.png "Screenshot") From 6b67a713e5ba4f2c7bb406be06f8e8e335c3f48e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sun, 7 Jan 2018 23:49:57 +0100 Subject: [PATCH 077/148] MiRCART{CanvasStore,Frame}.py: implements export to Imgur (from bitmap via PNG.) --- MiRCARTCanvasStore.py | 46 ++++++++++++++++++----- MiRCARTFrame.py | 87 ++++++++++++++++++++++++++----------------- 2 files changed, 90 insertions(+), 43 deletions(-) diff --git a/MiRCARTCanvasStore.py b/MiRCARTCanvasStore.py index 8a65cd2..e41b35a 100644 --- a/MiRCARTCanvasStore.py +++ b/MiRCARTCanvasStore.py @@ -22,7 +22,7 @@ # SOFTWARE. # -import io +import io, os, tempfile try: import wx @@ -37,7 +37,7 @@ except ImportError: haveMiRCARTToPngFile = False try: - import requests, urllib.request + import base64, json, requests, urllib.request haveUrllib = True except ImportError: haveUrllib = False @@ -62,6 +62,32 @@ class MiRCARTCanvasStore(): PS_COLOUR_DIGIT0 = 2 PS_COLOUR_DIGIT1 = 3 + # {{{ _exportFileToImgur(self, apiKey, imgName, imgTitle, pathName): upload single PNG file to Imgur + def _exportFileToImgur(self, apiKey, imgName, imgTitle, pathName): + requestImageData = open(pathName, "rb").read() + requestData = { \ + "image": base64.b64encode(requestImageData), \ + "key": apiKey, \ + "name": imgName, \ + "title": imgTitle, \ + "type": "base64"} + requestHeaders = {"Authorization": "Client-ID " + apiKey} + responseHttp = requests.post( \ + "https://api.imgur.com/3/upload.json", \ + data=requestData, headers=requestHeaders) + responseDict = json.loads(responseHttp.text) + if responseHttp.status_code == 200: + return [200, responseDict.get("data").get("link")] + else: + return [responseHttp.status_code, ""] + # }}} + # {{{ _flipCellStateBit(self, cellState, bit): XXX + def _flipCellStateBit(self, cellState, bit): + if cellState & bit: + return cellState & ~bit + else: + return cellState | bit + # }}} # {{{ _parseCharAsColourSpec(self, colourSpec, curColours): XXX def _parseCharAsColourSpec(self, colourSpec, curColours): if len(colourSpec) > 0: @@ -74,18 +100,20 @@ class MiRCARTCanvasStore(): else: return (15, 1) # }}} - # {{{ _flipCellStateBit(self, cellState, bit): XXX - def _flipCellStateBit(self, cellState, bit): - if cellState & bit: - return cellState & ~bit - else: - return cellState | bit - # }}} # {{{ exportBitmapToPngFile(self, canvasBitmap, outPathName, outType): XXX def exportBitmapToPngFile(self, canvasBitmap, outPathName, outType): return canvasBitmap.ConvertToImage().SaveFile(outPathName, outType) # }}} + # {{{ exportBitmapToImgur(self, apiKey, canvasBitmap, imgName, imgTitle, imgType): XXX + def exportBitmapToImgur(self, apiKey, canvasBitmap, imgName, imgTitle, imgType): + tmpPathName = tempfile.mkstemp() + os.close(tmpPathName[0]) + canvasBitmap.ConvertToImage().SaveFile(tmpPathName[1], imgType) + imgurResult = self._exportFileToImgur(apiKey, imgName, imgTitle, tmpPathName[1]) + os.remove(tmpPathName[1]) + return imgurResult + # }}} # {{{ exportPastebin(self, apiDevKey, canvasMap, canvasSize, pasteName="", pastePrivate=0): XXX def exportPastebin(self, apiDevKey, canvasMap, canvasSize, pasteName="", pastePrivate=0): if haveUrllib: diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index fae9d0d..9c6870e 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -42,39 +42,41 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_SAVEAS = (0x103, TID_COMMAND, "Save As...", "Save &As...", wx.ART_FILE_SAVE_AS, None) CID_EXPORT_AS_PNG = (0x104, TID_COMMAND, "Export as PNG...", \ "Export as PN&G...", None, None) - CID_EXPORT_PASTEBIN = (0x105, TID_COMMAND, "Export to Pastebin...", \ + CID_EXPORT_IMGUR = (0x105, TID_COMMAND, "Export to Imgur...", \ + "Export to I&mgur...", None, None, haveUrllib) + CID_EXPORT_PASTEBIN = (0x106, TID_COMMAND, "Export to Pastebin...", \ "Export to Pasteb&in...", None, None, haveUrllib) - CID_EXIT = (0x106, TID_COMMAND, "Exit", "E&xit", None, None) - CID_UNDO = (0x107, TID_COMMAND, "Undo", "&Undo", wx.ART_UNDO, (wx.ACCEL_CTRL, ord("Z")), False) - CID_REDO = (0x108, TID_COMMAND, "Redo", "&Redo", wx.ART_REDO, (wx.ACCEL_CTRL, ord("Y")), False) - CID_CUT = (0x109, TID_COMMAND, "Cut", "Cu&t", wx.ART_CUT, None, False) - CID_COPY = (0x10a, TID_COMMAND, "Copy", "&Copy", wx.ART_COPY, None, False) - CID_PASTE = (0x10b, TID_COMMAND, "Paste", "&Paste", wx.ART_PASTE, None, False) - CID_DELETE = (0x10c, TID_COMMAND, "Delete", "De&lete", wx.ART_DELETE, None, False) - CID_INCRBRUSH = (0x10d, TID_COMMAND, "Increase brush size", \ + CID_EXIT = (0x107, TID_COMMAND, "Exit", "E&xit", None, None) + CID_UNDO = (0x108, TID_COMMAND, "Undo", "&Undo", wx.ART_UNDO, (wx.ACCEL_CTRL, ord("Z")), False) + CID_REDO = (0x109, TID_COMMAND, "Redo", "&Redo", wx.ART_REDO, (wx.ACCEL_CTRL, ord("Y")), False) + CID_CUT = (0x10a, TID_COMMAND, "Cut", "Cu&t", wx.ART_CUT, None, False) + CID_COPY = (0x10b, TID_COMMAND, "Copy", "&Copy", wx.ART_COPY, None, False) + CID_PASTE = (0x10c, TID_COMMAND, "Paste", "&Paste", wx.ART_PASTE, None, False) + CID_DELETE = (0x10d, TID_COMMAND, "Delete", "De&lete", wx.ART_DELETE, None, False) + CID_INCRBRUSH = (0x10e, TID_COMMAND, "Increase brush size", \ "&Increase brush size", wx.ART_PLUS, None) - CID_DECRBRUSH = (0x10e, TID_COMMAND, "Decrease brush size", \ + CID_DECRBRUSH = (0x10f, TID_COMMAND, "Decrease brush size", \ "&Decrease brush size", wx.ART_MINUS, None) - CID_SOLID_BRUSH = (0x10f, TID_SELECT, "Solid brush", "&Solid brush", None, None, True) - CID_RECT = (0x110, TID_SELECT, "Rectangle", "&Rectangle", None, None, True) - CID_CIRCLE = (0x111, TID_SELECT, "Circle", "&Circle", None, None, False) - CID_LINE = (0x112, TID_SELECT, "Line", "&Line", None, None, False) - CID_COLOUR00 = (0x113, TID_COMMAND, "Colour #00", "Colour #00", None, None) - CID_COLOUR01 = (0x114, TID_COMMAND, "Colour #01", "Colour #01", None, None) - CID_COLOUR02 = (0x115, TID_COMMAND, "Colour #02", "Colour #02", None, None) - CID_COLOUR03 = (0x116, TID_COMMAND, "Colour #03", "Colour #03", None, None) - CID_COLOUR04 = (0x117, TID_COMMAND, "Colour #04", "Colour #04", None, None) - CID_COLOUR05 = (0x118, TID_COMMAND, "Colour #05", "Colour #05", None, None) - CID_COLOUR06 = (0x119, TID_COMMAND, "Colour #06", "Colour #06", None, None) - CID_COLOUR07 = (0x11a, TID_COMMAND, "Colour #07", "Colour #07", None, None) - CID_COLOUR08 = (0x11b, TID_COMMAND, "Colour #08", "Colour #08", None, None) - CID_COLOUR09 = (0x11c, TID_COMMAND, "Colour #09", "Colour #09", None, None) - CID_COLOUR10 = (0x11d, TID_COMMAND, "Colour #10", "Colour #10", None, None) - CID_COLOUR11 = (0x11e, TID_COMMAND, "Colour #11", "Colour #11", None, None) - CID_COLOUR12 = (0x11f, TID_COMMAND, "Colour #12", "Colour #12", None, None) - CID_COLOUR13 = (0x120, TID_COMMAND, "Colour #13", "Colour #13", None, None) - CID_COLOUR14 = (0x121, TID_COMMAND, "Colour #14", "Colour #14", None, None) - CID_COLOUR15 = (0x122, TID_COMMAND, "Colour #15", "Colour #15", None, None) + CID_SOLID_BRUSH = (0x110, TID_SELECT, "Solid brush", "&Solid brush", None, None, True) + CID_RECT = (0x111, TID_SELECT, "Rectangle", "&Rectangle", None, None, True) + CID_CIRCLE = (0x112, TID_SELECT, "Circle", "&Circle", None, None, False) + CID_LINE = (0x113, TID_SELECT, "Line", "&Line", None, None, False) + CID_COLOUR00 = (0x114, TID_COMMAND, "Colour #00", "Colour #00", None, None) + CID_COLOUR01 = (0x115, TID_COMMAND, "Colour #01", "Colour #01", None, None) + CID_COLOUR02 = (0x116, TID_COMMAND, "Colour #02", "Colour #02", None, None) + CID_COLOUR03 = (0x117, TID_COMMAND, "Colour #03", "Colour #03", None, None) + CID_COLOUR04 = (0x118, TID_COMMAND, "Colour #04", "Colour #04", None, None) + CID_COLOUR05 = (0x119, TID_COMMAND, "Colour #05", "Colour #05", None, None) + CID_COLOUR06 = (0x11a, TID_COMMAND, "Colour #06", "Colour #06", None, None) + CID_COLOUR07 = (0x11b, TID_COMMAND, "Colour #07", "Colour #07", None, None) + CID_COLOUR08 = (0x11c, TID_COMMAND, "Colour #08", "Colour #08", None, None) + CID_COLOUR09 = (0x11d, TID_COMMAND, "Colour #09", "Colour #09", None, None) + CID_COLOUR10 = (0x11e, TID_COMMAND, "Colour #10", "Colour #10", None, None) + CID_COLOUR11 = (0x11f, TID_COMMAND, "Colour #11", "Colour #11", None, None) + CID_COLOUR12 = (0x120, TID_COMMAND, "Colour #12", "Colour #12", None, None) + CID_COLOUR13 = (0x121, TID_COMMAND, "Colour #13", "Colour #13", None, None) + CID_COLOUR14 = (0x122, TID_COMMAND, "Colour #14", "Colour #14", None, None) + CID_COLOUR15 = (0x123, TID_COMMAND, "Colour #15", "Colour #15", None, None) # }}} # {{{ Non-items NID_MENU_SEP = (0x200, TID_NOTHING) @@ -83,7 +85,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): # {{{ Menus MID_FILE = (0x300, TID_MENU, "File", "&File", ( \ CID_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_MENU_SEP, \ - CID_EXPORT_PASTEBIN, CID_EXPORT_AS_PNG, NID_MENU_SEP, \ + CID_EXPORT_AS_PNG, CID_EXPORT_IMGUR, CID_EXPORT_PASTEBIN, NID_MENU_SEP, \ CID_EXIT)) MID_EDIT = (0x301, TID_MENU, "Edit", "&Edit", ( \ CID_UNDO, CID_REDO, NID_MENU_SEP, \ @@ -164,17 +166,32 @@ class MiRCARTFrame(MiRCARTGeneralFrame): # {{{ canvasExportAsPng(self): XXX def canvasExportAsPng(self): - with wx.FileDialog(self, self.CID_SAVEAS[2], os.getcwd(), "", \ + with wx.FileDialog(self, self.CID_SAVEAS[2], os.getcwd(), "", \ "*.png", wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) as dialog: if dialog.ShowModal() == wx.ID_CANCEL: return False else: outPathName = dialog.GetPath() - self.panelCanvas.canvasStore.exportBitmapToPngFile( \ - self.panelCanvas.canvasBitmap, outPathName, \ + self.panelCanvas.canvasStore.exportBitmapToPngFile( \ + self.panelCanvas.canvasBitmap, outPathName, \ wx.BITMAP_TYPE_PNG) return True # }}} + # {{{ canvasExportImgur(self): XXX + def canvasExportImgur(self): + imgurResult = self.panelCanvas.canvasStore.exportBitmapToImgur( \ + "c9a6efb3d7932fd", self.panelCanvas.canvasBitmap, "", "", wx.BITMAP_TYPE_PNG) + if imgurResult[0] == 200: + if not wx.TheClipboard.IsOpened(): + wx.TheClipboard.Open() + wx.TheClipboard.SetData(wx.TextDataObject(imgurResult[1])) + wx.TheClipboard.Close() + wx.MessageBox("Exported to Imgur: " + imgurResult[1], \ + "Export to Imgur", wx.OK|wx.ICON_INFORMATION) + else: + wx.MessageBox("Failed to export to Imgur: " + imgurResult[1], \ + "Export to Imgur", wx.OK|wx.ICON_EXCLAMATION) + # }}} # {{{ canvasExportPastebin(self): XXX def canvasExportPastebin(self): pasteStatus, pasteResult = \ @@ -292,6 +309,8 @@ class MiRCARTFrame(MiRCARTGeneralFrame): self.canvasSaveAs() elif cid == self.CID_EXPORT_AS_PNG[0]: self.canvasExportAsPng() + elif cid == self.CID_EXPORT_IMGUR[0]: + self.canvasExportImgur() elif cid == self.CID_EXPORT_PASTEBIN[0]: self.canvasExportPastebin() elif cid == self.CID_EXIT[0]: From 54ce9975e2e8b5043f2baae6afe33971f30a3167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sun, 7 Jan 2018 23:55:26 +0100 Subject: [PATCH 078/148] MiRCARTFrame.py:MiRCARTFrame.canvas{Export{AsPng,Imgur,Pastebin},New,Open,Save}(): add wx.CURSOR_WAIT guards. --- MiRCARTFrame.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 9c6870e..5cd5321 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -172,15 +172,19 @@ class MiRCARTFrame(MiRCARTGeneralFrame): return False else: outPathName = dialog.GetPath() + self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) self.panelCanvas.canvasStore.exportBitmapToPngFile( \ self.panelCanvas.canvasBitmap, outPathName, \ wx.BITMAP_TYPE_PNG) + self.SetCursor(wx.Cursor(wx.NullCursor)) return True # }}} # {{{ canvasExportImgur(self): XXX def canvasExportImgur(self): + self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) imgurResult = self.panelCanvas.canvasStore.exportBitmapToImgur( \ "c9a6efb3d7932fd", self.panelCanvas.canvasBitmap, "", "", wx.BITMAP_TYPE_PNG) + self.SetCursor(wx.Cursor(wx.NullCursor)) if imgurResult[0] == 200: if not wx.TheClipboard.IsOpened(): wx.TheClipboard.Open() @@ -194,11 +198,13 @@ class MiRCARTFrame(MiRCARTGeneralFrame): # }}} # {{{ canvasExportPastebin(self): XXX def canvasExportPastebin(self): + self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) pasteStatus, pasteResult = \ self.panelCanvas.canvasStore.exportPastebin( \ "253ce2f0a45140ee0a44ca99aa49260", \ self.panelCanvas.canvasMap, \ self.panelCanvas.canvasSize) + self.SetCursor(wx.Cursor(wx.NullCursor)) if pasteStatus: if not wx.TheClipboard.IsOpened(): wx.TheClipboard.Open() @@ -220,10 +226,12 @@ class MiRCARTFrame(MiRCARTGeneralFrame): pass elif saveChanges == wx.ID_YES: self.canvasSave() + self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) if newCanvasSize == None: newCanvasSize = (100, 30) self.panelCanvas.canvasStore.importNew(newCanvasSize) self.canvasPathName = None + self.SetCursor(wx.Cursor(wx.NullCursor)) self._updateStatusBar(); self.onCanvasUpdate(); # }}} # {{{ canvasOpen(self): XXX @@ -242,8 +250,10 @@ class MiRCARTFrame(MiRCARTGeneralFrame): return False else: self.canvasPathName = dialog.GetPath() + self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) self.panelCanvas.canvasStore.importTextFile(self.canvasPathName) self.panelCanvas.canvasStore.importIntoPanel() + self.SetCursor(wx.Cursor(wx.NullCursor)) self._updateStatusBar(); self.onCanvasUpdate(); return True # }}} @@ -254,9 +264,11 @@ class MiRCARTFrame(MiRCARTGeneralFrame): return try: with open(self.canvasPathName, "w") as outFile: + self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) self.panelCanvas.canvasStore.exportTextFile( \ self.panelCanvas.canvasMap, \ self.panelCanvas.canvasSize, outFile) + self.SetCursor(wx.Cursor(wx.NullCursor)) return True except IOError as error: return False From 26937149fbbb3d700784266cbcbb79e65d562f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Mon, 8 Jan 2018 00:25:59 +0100 Subject: [PATCH 079/148] MiRCART{CanvasJournal,Frame,ToolRect}.py: implements variable brush size. --- MiRCARTCanvas.py | 1 + MiRCARTCanvasJournal.py | 5 ++++- MiRCARTFrame.py | 13 +++++++++---- MiRCARTToolRect.py | 14 +++++++++----- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index 0503889..cb09834 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -221,6 +221,7 @@ class MiRCARTCanvas(wx.Panel): super().__init__(parent, pos=canvasPos, \ size=[w*h for w,h in zip(canvasSize, cellSize)]) + self.SetDoubleBuffered(True) self.Bind(wx.EVT_CLOSE, self.onClose) self.Bind(wx.EVT_ENTER_WINDOW, self.onMouseWindowEvent) self.Bind(wx.EVT_LEAVE_WINDOW, self.onMouseWindowEvent) diff --git a/MiRCARTCanvasJournal.py b/MiRCARTCanvasJournal.py index 3b70dbc..de9511d 100644 --- a/MiRCARTCanvasJournal.py +++ b/MiRCARTCanvasJournal.py @@ -60,7 +60,10 @@ class MiRCARTCanvasJournal(): self._popTmp(eventDc, tmpDc) for patch in mapPatch[1]: absMapPoint = self._relMapPointToAbsMapPoint(patch[0], atPoint) - if mapPatchTmp: + if absMapPoint[0] >= self.parentCanvas.canvasSize[0] \ + or absMapPoint[1] >= self.parentCanvas.canvasSize[1]: + continue + elif mapPatchTmp: self._pushTmp(absMapPoint) self.parentCanvas.onJournalUpdate(mapPatchTmp, \ absMapPoint, patch, eventDc, tmpDc, atPoint) diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 5cd5321..368d9c0 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -340,9 +340,14 @@ class MiRCARTFrame(MiRCARTGeneralFrame): elif cid == self.CID_DELETE[0]: pass elif cid == self.CID_INCRBRUSH[0]: - pass - elif cid == self.CID_DECRBRUSH[0]: - pass + self.panelCanvas.brushSize = \ + [a+1 for a in self.panelCanvas.brushSize] + print(self.panelCanvas.brushSize) + elif cid == self.CID_DECRBRUSH[0] \ + and self.panelCanvas.brushSize != [0,0]: + self.panelCanvas.brushSize = \ + [a-1 for a in self.panelCanvas.brushSize] + print(self.panelCanvas.brushSize) elif cid == self.CID_SOLID_BRUSH[0]: pass elif cid == self.CID_RECT[0]: @@ -351,7 +356,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): pass elif cid == self.CID_LINE[0]: pass - elif cid >= self.CID_COLOUR00[0] \ + elif cid >= self.CID_COLOUR00[0] \ and cid <= self.CID_COLOUR15[0]: numColour = cid - self.CID_COLOUR00[0] if event.GetEventType() == wx.wxEVT_TOOL: diff --git a/MiRCARTToolRect.py b/MiRCARTToolRect.py index 71e226d..66a8864 100644 --- a/MiRCARTToolRect.py +++ b/MiRCARTToolRect.py @@ -33,14 +33,18 @@ class MiRCARTToolRect(MiRCARTTool): brushColours = brushColours.copy() if isLeftDown: brushColours[1] = brushColours[0] - return [[False, [[[0, 0], brushColours, 0, " "]]], \ - [True, [[[0, 0], brushColours, 0, " "]]]] elif isRightDown: brushColours[0] = brushColours[1] - return [[False, [[[0, 0], brushColours, 0, " "]]], \ - [True, [[[0, 0], brushColours, 0, " "]]]] else: brushColours[1] = brushColours[0] - return [[True, [[[0, 0], brushColours, 0, " "]]]] + brushPatches = [] + for brushRow in range(brushSize[1]): + for brushCol in range(brushSize[0] * 2): + brushPatches.append([[brushCol, brushRow], \ + brushColours, 0, " "]) + if isLeftDown or isRightDown: + return [[False, brushPatches], [True, brushPatches]] + else: + return [[True, brushPatches]] # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 From dddce0757bca3213e7cf16a81544200308331c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Mon, 8 Jan 2018 01:11:00 +0100 Subject: [PATCH 080/148] MiRCARTCanvas.py: disable double buffering. --- MiRCARTCanvas.py | 1 - 1 file changed, 1 deletion(-) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index cb09834..0503889 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -221,7 +221,6 @@ class MiRCARTCanvas(wx.Panel): super().__init__(parent, pos=canvasPos, \ size=[w*h for w,h in zip(canvasSize, cellSize)]) - self.SetDoubleBuffered(True) self.Bind(wx.EVT_CLOSE, self.onClose) self.Bind(wx.EVT_ENTER_WINDOW, self.onMouseWindowEvent) self.Bind(wx.EVT_LEAVE_WINDOW, self.onMouseWindowEvent) From e763dc8909173c0a4d265ff7ed18c2a4e48b960a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Mon, 8 Jan 2018 01:18:52 +0100 Subject: [PATCH 081/148] MiRCARTFrame.py:MiRCARTFrame.onFrameCommand(): don't decrease brush size below (1,1). MiRCARTFrame.py:MiRCARTFrame.onFrameCommand(): remove debugging print()s. --- MiRCARTFrame.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 368d9c0..23b2e9c 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -340,14 +340,13 @@ class MiRCARTFrame(MiRCARTGeneralFrame): elif cid == self.CID_DELETE[0]: pass elif cid == self.CID_INCRBRUSH[0]: - self.panelCanvas.brushSize = \ + self.panelCanvas.brushSize = \ [a+1 for a in self.panelCanvas.brushSize] - print(self.panelCanvas.brushSize) - elif cid == self.CID_DECRBRUSH[0] \ - and self.panelCanvas.brushSize != [0,0]: - self.panelCanvas.brushSize = \ + elif cid == self.CID_DECRBRUSH[0] \ + and self.panelCanvas.brushSize[0] > 1 \ + and self.panelCanvas.brushSize[1] > 1: + self.panelCanvas.brushSize = \ [a-1 for a in self.panelCanvas.brushSize] - print(self.panelCanvas.brushSize) elif cid == self.CID_SOLID_BRUSH[0]: pass elif cid == self.CID_RECT[0]: @@ -356,7 +355,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): pass elif cid == self.CID_LINE[0]: pass - elif cid >= self.CID_COLOUR00[0] \ + elif cid >= self.CID_COLOUR00[0] \ and cid <= self.CID_COLOUR15[0]: numColour = cid - self.CID_COLOUR00[0] if event.GetEventType() == wx.wxEVT_TOOL: From baa84ce859b03983f3069fbfffb1be52e85c9837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Mon, 8 Jan 2018 01:43:54 +0100 Subject: [PATCH 082/148] MiRCARTGeneralFrame.py, MiRCARTFrame.py: cleanup. --- MiRCARTFrame.py | 7 +++- MiRCARTGeneralFrame.py | 83 +++++++++++++++++++++--------------------- 2 files changed, 48 insertions(+), 42 deletions(-) diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 23b2e9c..06716d8 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -25,7 +25,7 @@ from MiRCARTCanvas import MiRCARTCanvas, haveUrllib from MiRCARTColours import MiRCARTColours from MiRCARTGeneralFrame import MiRCARTGeneralFrame, \ - TID_COMMAND, TID_MENU, TID_NOTHING, TID_SELECT, TID_TOOLBAR, TID_ACCELS + TID_ACCELS, TID_COMMAND, TID_LIST, TID_MENU, TID_NOTHING, TID_SELECT, TID_TOOLBAR import os, wx @@ -110,6 +110,11 @@ class MiRCARTFrame(MiRCARTGeneralFrame): AID_EDIT = (0x500, TID_ACCELS, ( \ CID_NEW, CID_OPEN, CID_SAVE, CID_UNDO, CID_REDO)) # }}} + # {{{ Lists + LID_ACCELS = (0x600, TID_LIST, (AID_EDIT)) + LID_MENUS = (0x601, TID_LIST, (MID_FILE, MID_EDIT, MID_TOOLS)) + LID_TOOLBARS = (0x602, TID_LIST, (BID_TOOLBAR)) + # }}} # {{{ _dialogSaveChanges(self) def _dialogSaveChanges(self): diff --git a/MiRCARTGeneralFrame.py b/MiRCARTGeneralFrame.py index 798af47..0c127e0 100644 --- a/MiRCARTGeneralFrame.py +++ b/MiRCARTGeneralFrame.py @@ -26,12 +26,13 @@ import os, wx # # Types -TID_COMMAND = (0x001) -TID_MENU = (0x002) -TID_NOTHING = (0x003) -TID_SELECT = (0x004) -TID_TOOLBAR = (0x005) -TID_ACCELS = (0x006) +TID_ACCELS = (0x001) +TID_COMMAND = (0x002) +TID_LIST = (0x003) +TID_MENU = (0x004) +TID_NOTHING = (0x005) +TID_SELECT = (0x006) +TID_TOOLBAR = (0x007) class MiRCARTGeneralFrame(wx.Frame): """XXX""" @@ -48,8 +49,9 @@ class MiRCARTGeneralFrame(wx.Frame): self.Bind(wx.EVT_MENU, handler, id=accelDescr[0]) return accelTableEntries # }}} - # {{{ _initMenus(self, menuBar, menusDescr, handler): XXX - def _initMenus(self, menuBar, menusDescr, handler): + # {{{ _initMenus(self, menusDescr, handler): XXX + def _initMenus(self, menusDescr, handler): + self.menuItemsById = {}; menuBar = wx.MenuBar(); for menuDescr in menusDescr: menuWindow = wx.Menu() for menuItem in menuDescr[4]: @@ -68,28 +70,33 @@ class MiRCARTGeneralFrame(wx.Frame): if len(menuItem) == 7: menuItemWindow.Enable(menuItem[6]) menuBar.Append(menuWindow, menuDescr[3]) + return menuBar # }}} - # {{{ _initToolBars(self, toolBar, toolBarsDescr, handler): XXX - def _initToolBars(self, toolBar, toolBarsDescr, handler): - for toolBarDescr in toolBarsDescr: - for toolBarItem in toolBarDescr[2]: - if toolBarItem == self.NID_TOOLBAR_SEP: - toolBar.AddSeparator() + # {{{ _initToolBars(self, toolBarsDescr, handler): XXX + def _initToolBars(self, toolBarsDescr, handler, panelSkin): + self.toolBarItemsById = {} + self.toolBar = wx.ToolBar(panelSkin, -1, \ + style=wx.HORIZONTAL|wx.TB_FLAT|wx.TB_NODIVIDER) + self.toolBar.SetToolBitmapSize((16,16)) + for toolBarItem in toolBarsDescr[2]: + if toolBarItem == self.NID_TOOLBAR_SEP: + self.toolBar.AddSeparator() + else: + if toolBarItem[4] != None: + toolBarItemIcon = wx.ArtProvider.GetBitmap( \ + toolBarItem[4], wx.ART_TOOLBAR, (16,16)) else: - if toolBarItem[4] != None: - toolBarItemIcon = wx.ArtProvider.GetBitmap( \ - toolBarItem[4], wx.ART_TOOLBAR, (16,16)) - else: - toolBarItemIcon = wx.ArtProvider.GetBitmap( \ - wx.ART_HELP, wx.ART_TOOLBAR, (16,16)) - toolBarItemWindow = self.toolBar.AddTool( \ - toolBarItem[0], toolBarItem[2], toolBarItemIcon) - self.toolBarItemsById[toolBarItem[0]] = toolBarItemWindow - if len(toolBarItem) == 7 \ - and toolBarItem[1] == TID_COMMAND: - toolBarItemWindow.Enable(toolBarItem[6]) - self.Bind(wx.EVT_TOOL, handler, toolBarItemWindow) - self.Bind(wx.EVT_TOOL_RCLICKED, handler, toolBarItemWindow) + toolBarItemIcon = wx.ArtProvider.GetBitmap( \ + wx.ART_HELP, wx.ART_TOOLBAR, (16,16)) + toolBarItemWindow = self.toolBar.AddTool( \ + toolBarItem[0], toolBarItem[2], toolBarItemIcon) + self.toolBarItemsById[toolBarItem[0]] = toolBarItemWindow + if len(toolBarItem) == 7 \ + and toolBarItem[1] == TID_COMMAND: + toolBarItemWindow.Enable(toolBarItem[6]) + self.Bind(wx.EVT_TOOL, handler, toolBarItemWindow) + self.Bind(wx.EVT_TOOL_RCLICKED, handler, toolBarItemWindow) + self.toolBar.Realize(); self.toolBar.Fit(); # }}} # {{{ onClose(self, event): XXX def onClose(self, event): @@ -107,23 +114,17 @@ class MiRCARTGeneralFrame(wx.Frame): panelSkin = wx.Panel(self, wx.ID_ANY) # Initialise menu bar, menus & menu items - self.menuItemsById = {}; menuBar = wx.MenuBar(); - self._initMenus(menuBar, \ - [self.MID_FILE, self.MID_EDIT, self.MID_TOOLS], + # Initialise toolbar & toolbar items + menuBar = self._initMenus(self.LID_MENUS[2], \ self.onFrameCommand) self.SetMenuBar(menuBar) - - # Initialise toolbar & toolbar items - self.toolBarItemsById = {} - self.toolBar = wx.ToolBar(panelSkin, -1, \ - style=wx.HORIZONTAL|wx.TB_FLAT|wx.TB_NODIVIDER) - self.toolBar.SetToolBitmapSize((16,16)) - self._initToolBars(self.toolBar, [self.BID_TOOLBAR], self.onFrameCommand) - self.toolBar.Realize(); self.toolBar.Fit(); + toolBar = self._initToolBars(self.LID_TOOLBARS[2], \ + self.onFrameCommand, panelSkin) # Initialise accelerators (hotkeys) - accelTable = wx.AcceleratorTable( \ - self._initAccelTable(self.AID_EDIT, self.onFrameCommand)) + accelTable = wx.AcceleratorTable( \ + self._initAccelTable(self.LID_ACCELS[2], \ + self.onFrameCommand)) self.SetAcceleratorTable(accelTable) # Initialise status bar From 330d4c78fee4ed96774185ecd212b483f193f81e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Mon, 8 Jan 2018 02:45:03 +0100 Subject: [PATCH 083/148] MiRCARTCanvas{,Journal}.py: fix {un,re}do regarding brush sizes >(1,1). --- MiRCARTCanvas.py | 10 +++++++--- MiRCARTCanvasJournal.py | 39 ++++++++++++++++++++++++--------------- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index 0503889..966136b 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -102,7 +102,6 @@ class MiRCARTCanvas(wx.Panel): patchOld[1:] = self._getMapCell(patchOld[0]) self._setMapCell(absMapPoint, *patch[1:]) self._drawPatch(patch, eventDc, tmpDc, atPoint) - self.parentFrame.onCanvasUpdate() if isInherit: return patchOld # }}} @@ -118,6 +117,7 @@ class MiRCARTCanvas(wx.Panel): event, mapPoint, self.brushColours, self.brushSize, \ event.Dragging(), event.LeftIsDown(), event.RightIsDown()) self.canvasJournal.merge(mapPatches, eventDc, tmpDc, mapPoint) + self.parentFrame.onCanvasUpdate() self.parentFrame.onCanvasMotion(event, mapPoint) # }}} # {{{ onMouseWindowEvent(self, event): XXX @@ -168,7 +168,9 @@ class MiRCARTCanvas(wx.Panel): # }}} # {{{ redo(self): XXX def redo(self): - return self.canvasJournal.redo() + result = self.canvasJournal.redo() + self.parentFrame.onCanvasUpdate() + return result # }}} # {{{ resize(self, newCanvasSize): XXX def resize(self, newCanvasSize): @@ -191,7 +193,9 @@ class MiRCARTCanvas(wx.Panel): # }}} # {{{ undo(self): XXX def undo(self): - return self.canvasJournal.undo() + result = self.canvasJournal.undo() + self.parentFrame.onCanvasUpdate() + return result # }}} # {{{ __del__(self): destructor method diff --git a/MiRCARTCanvasJournal.py b/MiRCARTCanvasJournal.py index de9511d..5bdfbbd 100644 --- a/MiRCARTCanvasJournal.py +++ b/MiRCARTCanvasJournal.py @@ -35,18 +35,23 @@ class MiRCARTCanvasJournal(): patch[0], patch, eventDc, tmpDc, (0, 0), True) self.patchesTmp = [] # }}} - # {{{ _pushTmp(self, atPoint, patch): XXX - def _pushTmp(self, absMapPoint): - self.patchesTmp.append([absMapPoint, None, None, None]) + # {{{ _pushTmp(self, atPoint): XXX + def _pushTmp(self, atPoint): + self.patchesTmp.append([atPoint, None, None, None]) # }}} - # {{{ _pushUndo(self, atPoint, patchUndo, patchRedo): XXX - def _pushUndo(self, atPoint, patchUndo, patchRedo): + # {{{ _pushUndo(self, atPoint, patches): XXX + def _pushUndo(self, atPoint, patches): if self.patchesUndoLevel > 0: del self.patchesUndo[0:self.patchesUndoLevel] self.patchesUndoLevel = 0 - absMapPoint = self._relMapPointToAbsMapPoint(patchUndo[0], atPoint) - self.patchesUndo.insert(0, [ \ - [absMapPoint, *patchUndo[1:]], [absMapPoint, *patchRedo[1:]]]) + patchesUndo = [] + for patch in patches: + absMapPoint = self._relMapPointToAbsMapPoint(patch[0][0], atPoint) + patchesUndo.append([ \ + [absMapPoint, *patch[0][1:]], \ + [absMapPoint, *patch[1][1:]]]) + if len(patchesUndo) > 0: + self.patchesUndo.insert(0, patchesUndo) # }}} # {{{ _relMapPointToAbsMapPoint(self, relMapPoint, atPoint): XXX def _relMapPointToAbsMapPoint(self, relMapPoint, atPoint): @@ -54,6 +59,7 @@ class MiRCARTCanvasJournal(): # }}} # {{{ merge(self, mapPatches, eventDc, tmpDc, atPoint): XXX def merge(self, mapPatches, eventDc, tmpDc, atPoint): + patchesUndo = [] for mapPatch in mapPatches: mapPatchTmp = mapPatch[0] if mapPatchTmp: @@ -71,15 +77,17 @@ class MiRCARTCanvasJournal(): patchUndo = \ self.parentCanvas.onJournalUpdate(mapPatchTmp, \ absMapPoint, patch, eventDc, tmpDc, atPoint, True) - self._pushUndo(atPoint, patchUndo, patch) + patchesUndo.append([patchUndo, patch]) + if len(patchesUndo) > 0: + self._pushUndo(atPoint, patchesUndo) # }}} # {{{ redo(self): XXX def redo(self): if self.patchesUndoLevel > 0: self.patchesUndoLevel -= 1 - redoPatch = self.patchesUndo[self.patchesUndoLevel][1] - self.parentCanvas.onJournalUpdate(False, \ - redoPatch[0], redoPatch, None, None, (0, 0)) + for patch in self.patchesUndo[self.patchesUndoLevel]: + self.parentCanvas.onJournalUpdate(False, \ + patch[1][0], patch[1], None, None, (0, 0)) return True else: return False @@ -97,10 +105,11 @@ class MiRCARTCanvasJournal(): # {{{ undo(self): XXX def undo(self): if self.patchesUndo[self.patchesUndoLevel] != None: - undoPatch = self.patchesUndo[self.patchesUndoLevel][0] + patches = self.patchesUndo[self.patchesUndoLevel] self.patchesUndoLevel += 1 - self.parentCanvas.onJournalUpdate(False, \ - undoPatch[0], undoPatch, None, None, (0, 0)) + for patch in patches: + self.parentCanvas.onJournalUpdate(False, \ + patch[0][0], patch[0], None, None, (0, 0)) return True else: return False From 7aecb6fd586c48345594795f4fb4c8a04beb847b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Mon, 8 Jan 2018 02:56:08 +0100 Subject: [PATCH 084/148] MiRCARTFrame.py: adds -<{+,-}> {in,de}crease brush size accelerators (hotkeys). --- MiRCARTFrame.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 06716d8..e377eb1 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -54,9 +54,9 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_PASTE = (0x10c, TID_COMMAND, "Paste", "&Paste", wx.ART_PASTE, None, False) CID_DELETE = (0x10d, TID_COMMAND, "Delete", "De&lete", wx.ART_DELETE, None, False) CID_INCRBRUSH = (0x10e, TID_COMMAND, "Increase brush size", \ - "&Increase brush size", wx.ART_PLUS, None) + "&Increase brush size", wx.ART_PLUS, (wx.ACCEL_CTRL, ord("+"))) CID_DECRBRUSH = (0x10f, TID_COMMAND, "Decrease brush size", \ - "&Decrease brush size", wx.ART_MINUS, None) + "&Decrease brush size", wx.ART_MINUS, (wx.ACCEL_CTRL, ord("-"))) CID_SOLID_BRUSH = (0x110, TID_SELECT, "Solid brush", "&Solid brush", None, None, True) CID_RECT = (0x111, TID_SELECT, "Rectangle", "&Rectangle", None, None, True) CID_CIRCLE = (0x112, TID_SELECT, "Circle", "&Circle", None, None, False) @@ -108,7 +108,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): # }}} # {{{ Accelerators (hotkeys) AID_EDIT = (0x500, TID_ACCELS, ( \ - CID_NEW, CID_OPEN, CID_SAVE, CID_UNDO, CID_REDO)) + CID_NEW, CID_OPEN, CID_SAVE, CID_UNDO, CID_REDO, CID_INCRBRUSH, CID_DECRBRUSH)) # }}} # {{{ Lists LID_ACCELS = (0x600, TID_LIST, (AID_EDIT)) From 1edb7cc626959c072565197b0b77da978a665f43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Mon, 8 Jan 2018 16:12:11 +0100 Subject: [PATCH 085/148] MiRCART{Canvas,Frame}.py: adds circle & line tools. MiRCARTTool{Circle,Line}.py: initial implementation. --- MiRCART.py | 3 +- MiRCARTCanvas.py | 21 +++++---- MiRCARTCanvasJournal.py | 28 +++++------ MiRCARTFrame.py | 25 ++++++---- MiRCARTToolCircle.py | 56 ++++++++++++++++++++++ MiRCARTToolLine.py | 100 ++++++++++++++++++++++++++++++++++++++++ MiRCARTToolRect.py | 4 +- 7 files changed, 199 insertions(+), 38 deletions(-) create mode 100644 MiRCARTToolCircle.py create mode 100644 MiRCARTToolLine.py diff --git a/MiRCART.py b/MiRCART.py index 28e9d36..c03e793 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -23,14 +23,13 @@ # from MiRCARTFrame import MiRCARTFrame -from MiRCARTToolRect import MiRCARTToolRect import sys, wx # # Entry point def main(*argv): wxApp = wx.App(False) - MiRCARTFrame(None, canvasTools=[MiRCARTToolRect]) + MiRCARTFrame(None) wxApp.MainLoop() if __name__ == "__main__": main(*sys.argv) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index 966136b..eb341dd 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -31,10 +31,11 @@ class MiRCARTCanvas(wx.Panel): """XXX""" parentFrame = None canvasPos = canvasSize = canvasWinSize = cellSize = None - canvasBitmap = canvasMap = canvasTools = None + canvasBitmap = canvasMap = None brushColours = brushPos = brushSize = None mircBrushes = mircPens = None canvasJournal = canvasStore = None + canvasCurTool = None # {{{ _initBrushesAndPens(self): XXX def _initBrushesAndPens(self): @@ -112,12 +113,12 @@ class MiRCARTCanvas(wx.Panel): tmpDc.SelectObject(self.canvasBitmap) eventPoint = event.GetLogicalPosition(eventDc) mapPoint = self._eventPointToMapPoint(eventPoint) - for tool in self.canvasTools: - mapPatches = tool.onMouseEvent( \ - event, mapPoint, self.brushColours, self.brushSize, \ - event.Dragging(), event.LeftIsDown(), event.RightIsDown()) - self.canvasJournal.merge(mapPatches, eventDc, tmpDc, mapPoint) - self.parentFrame.onCanvasUpdate() + tool = self.canvasCurTool + mapPatches = tool.onMouseEvent( \ + event, mapPoint, self.brushColours, self.brushSize, \ + event.Dragging(), event.LeftIsDown(), event.RightIsDown()) + self.canvasJournal.merge(mapPatches, eventDc, tmpDc, mapPoint) + self.parentFrame.onCanvasUpdate() self.parentFrame.onCanvasMotion(event, mapPoint) # }}} # {{{ onMouseWindowEvent(self, event): XXX @@ -211,17 +212,17 @@ class MiRCARTCanvas(wx.Panel): # }}} # - # _init__(self, parent, parentFrame, canvasPos, cellSize, canvasSize, canvasTools): initialisation method - def __init__(self, parent, parentFrame, canvasPos, canvasSize, canvasTools, cellSize): + # _init__(self, parent, parentFrame, canvasPos, canvasSize, cellSize): initialisation method + def __init__(self, parent, parentFrame, canvasPos, canvasSize, cellSize): self.parentFrame = parentFrame self.canvasPos = canvasPos; self.canvasSize = canvasSize; - self.canvasTools = [canvasTool(self) for canvasTool in canvasTools] self.cellSize = cellSize self.brushColours = [4, 1]; self._initBrushesAndPens(); self.brushPos = [0, 0]; self.brushSize = [1, 1]; self.canvasJournal = MiRCARTCanvasJournal(parentCanvas=self) self.canvasStore = MiRCARTCanvasStore(parentCanvas=self) + self.canvasCurTool = None super().__init__(parent, pos=canvasPos, \ size=[w*h for w,h in zip(canvasSize, cellSize)]) diff --git a/MiRCARTCanvasJournal.py b/MiRCARTCanvasJournal.py index 5bdfbbd..9ac34d2 100644 --- a/MiRCARTCanvasJournal.py +++ b/MiRCARTCanvasJournal.py @@ -46,17 +46,12 @@ class MiRCARTCanvasJournal(): self.patchesUndoLevel = 0 patchesUndo = [] for patch in patches: - absMapPoint = self._relMapPointToAbsMapPoint(patch[0][0], atPoint) - patchesUndo.append([ \ - [absMapPoint, *patch[0][1:]], \ - [absMapPoint, *patch[1][1:]]]) + patchesUndo.append([ \ + [patch[0], *patch[0][1:]], \ + [patch[0], *patch[1][1:]]]) if len(patchesUndo) > 0: self.patchesUndo.insert(0, patchesUndo) # }}} - # {{{ _relMapPointToAbsMapPoint(self, relMapPoint, atPoint): XXX - def _relMapPointToAbsMapPoint(self, relMapPoint, atPoint): - return [a+b for a,b in zip(atPoint, relMapPoint)] - # }}} # {{{ merge(self, mapPatches, eventDc, tmpDc, atPoint): XXX def merge(self, mapPatches, eventDc, tmpDc, atPoint): patchesUndo = [] @@ -65,18 +60,17 @@ class MiRCARTCanvasJournal(): if mapPatchTmp: self._popTmp(eventDc, tmpDc) for patch in mapPatch[1]: - absMapPoint = self._relMapPointToAbsMapPoint(patch[0], atPoint) - if absMapPoint[0] >= self.parentCanvas.canvasSize[0] \ - or absMapPoint[1] >= self.parentCanvas.canvasSize[1]: + if patch[0][0] >= self.parentCanvas.canvasSize[0] \ + or patch[0][1] >= self.parentCanvas.canvasSize[1]: continue elif mapPatchTmp: - self._pushTmp(absMapPoint) - self.parentCanvas.onJournalUpdate(mapPatchTmp, \ - absMapPoint, patch, eventDc, tmpDc, atPoint) + self._pushTmp(patch[0]) + self.parentCanvas.onJournalUpdate(mapPatchTmp, \ + patch[0], patch, eventDc, tmpDc, (0, 0)) else: - patchUndo = \ - self.parentCanvas.onJournalUpdate(mapPatchTmp, \ - absMapPoint, patch, eventDc, tmpDc, atPoint, True) + patchUndo = \ + self.parentCanvas.onJournalUpdate(mapPatchTmp, \ + patch[0], patch, eventDc, tmpDc, (0, 0), True) patchesUndo.append([patchUndo, patch]) if len(patchesUndo) > 0: self._pushUndo(atPoint, patchesUndo) diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index e377eb1..71372ce 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -26,13 +26,16 @@ from MiRCARTCanvas import MiRCARTCanvas, haveUrllib from MiRCARTColours import MiRCARTColours from MiRCARTGeneralFrame import MiRCARTGeneralFrame, \ TID_ACCELS, TID_COMMAND, TID_LIST, TID_MENU, TID_NOTHING, TID_SELECT, TID_TOOLBAR +from MiRCARTToolCircle import MiRCARTToolCircle +from MiRCARTToolLine import MiRCARTToolLine +from MiRCARTToolRect import MiRCARTToolRect import os, wx class MiRCARTFrame(MiRCARTGeneralFrame): """XXX""" panelCanvas = canvasPathName = None - canvasPos = canvasSize = canvasTools = cellSize = None + canvasPos = canvasSize = cellSize = None # {{{ Commands # Id Type Id Labels Icon bitmap Accelerator [Initial state] @@ -355,11 +358,17 @@ class MiRCARTFrame(MiRCARTGeneralFrame): elif cid == self.CID_SOLID_BRUSH[0]: pass elif cid == self.CID_RECT[0]: - pass + self.menuItemsById[cid].Check(True) + self.panelCanvas.canvasCurTool = \ + MiRCARTToolRect(self.panelCanvas) elif cid == self.CID_CIRCLE[0]: - pass + self.menuItemsById[cid].Check(True) + self.panelCanvas.canvasCurTool = \ + MiRCARTToolCircle(self.panelCanvas) elif cid == self.CID_LINE[0]: - pass + self.menuItemsById[cid].Check(True) + self.panelCanvas.canvasCurTool = \ + MiRCARTToolLine(self.panelCanvas) elif cid >= self.CID_COLOUR00[0] \ and cid <= self.CID_COLOUR15[0]: numColour = cid - self.CID_COLOUR00[0] @@ -376,16 +385,16 @@ class MiRCARTFrame(MiRCARTGeneralFrame): # }}} # - # __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), cellSize=(7, 14), canvasSize=(100, 30), canvasTools=[]): initialisation method - def __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), cellSize=(7, 14), canvasSize=(100, 30), canvasTools=[]): + # __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), canvasSize=(100, 30), cellSize=(7, 14)): initialisation method + def __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), canvasSize=(100, 30), cellSize=(7, 14)): panelSkin = super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) self._setPaletteToolBitmaps() self.canvasPos = canvasPos; self.cellSize = cellSize; self.canvasSize = canvasSize; self.canvasPathName = None - self.canvasTools = canvasTools self.panelCanvas = MiRCARTCanvas(panelSkin, parentFrame=self, \ canvasPos=self.canvasPos, canvasSize=self.canvasSize, \ - canvasTools=self.canvasTools, cellSize=self.cellSize) + cellSize=self.cellSize) + self.panelCanvas.canvasCurTool = MiRCARTToolRect(self.panelCanvas) self.canvasNew() # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTToolCircle.py b/MiRCARTToolCircle.py new file mode 100644 index 0000000..8218e85 --- /dev/null +++ b/MiRCARTToolCircle.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 +# +# MiRCARTToolCircle.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from MiRCARTTool import MiRCARTTool + +class MiRCARTToolCircle(MiRCARTTool): + """XXX""" + + # + # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): XXX + def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): + brushColours = brushColours.copy() + if isLeftDown: + brushColours[1] = brushColours[0] + elif isRightDown: + brushColours[0] = brushColours[1] + else: + brushColours[1] = brushColours[0] + brushPatches = [] + _brushSize = brushSize[0]*2 + originPoint = (_brushSize/2, _brushSize/2) + radius = _brushSize + for brushY in range(-radius, radius + 1): + for brushX in range(-radius, radius + 1): + if ((brushX**2)+(brushY**2) < (((radius**2)+radius)*0.8)): + brushPatches.append([ \ + [atPoint[0] + int(originPoint[0]+brushX), \ + atPoint[1] + int(originPoint[1]+brushY)], \ + brushColours, 0, " "]) + if isLeftDown or isRightDown: + return [[False, brushPatches], [True, brushPatches]] + else: + return [[True, brushPatches]] + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTToolLine.py b/MiRCARTToolLine.py new file mode 100644 index 0000000..18652d3 --- /dev/null +++ b/MiRCARTToolLine.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python3 +# +# MiRCARTToolLine.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from MiRCARTTool import MiRCARTTool + +class MiRCARTToolLine(MiRCARTTool): + """XXX""" + toolOriginPoint = toolState = None + + TS_NONE = 0 + TS_ORIGIN = 1 + + # {{{ _pointDelta(self, a, b): XXX + def _pointDelta(self, a, b): + return [a2-a1 for a1, a2 in zip(a, b)] + # }}} + # {{{ _pointSwap(self, a, b): XXX + def _pointSwap(self, a, b): + return [b, a] + # }}} + # {{{ _getLine(self, brushColours, originPoint, targetPoint): XXX + def _getLine(self, brushColours, originPoint, targetPoint): + originPoint = originPoint.copy(); targetPoint = targetPoint.copy(); + pointDelta = self._pointDelta(originPoint, targetPoint) + lineXSign = 1 if pointDelta[0] > 0 else -1; + lineYSign = 1 if pointDelta[1] > 0 else -1; + pointDelta = [abs(a) for a in pointDelta] + if pointDelta[0] > pointDelta[1]: + lineXX, lineXY, lineYX, lineYY = lineXSign, 0, 0, lineYSign + else: + pointDelta = [pointDelta[1], pointDelta[0]] + lineXX, lineXY, lineYX, lineYY = 0, lineYSign, lineXSign, 0 + lineD = 2 * pointDelta[1] - pointDelta[0]; lineY = 0; + linePatches = [] + for lineX in range(pointDelta[0] + 1): + linePatches.append([[ \ + originPoint[0] + lineX*lineXX + lineY*lineYX, \ + originPoint[1] + lineX*lineXY + lineY*lineYY], \ + brushColours, 0, " "]) + if lineD > 0: + lineD -= pointDelta[0]; lineY += 1; + lineD += pointDelta[1] + return linePatches + # }}} + + # + # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): XXX + def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): + brushColours = brushColours.copy() + if isLeftDown: + brushColours[1] = brushColours[0] + elif isRightDown: + brushColours[0] = brushColours[1] + else: + brushColours[1] = brushColours[0] + brushPatches = []; tmpPatches = []; + if self.toolState == self.TS_NONE: + if isLeftDown or isRightDown: + self.toolOriginPoint = list(atPoint) + self.toolState = self.TS_ORIGIN + tmpPatches.append([atPoint, brushColours, 0, " "]) + return [[True, tmpPatches]] + elif self.toolState == self.TS_ORIGIN: + targetPoint = list(atPoint) + originPoint = self.toolOriginPoint + brushPatches = self._getLine(brushColours, originPoint, targetPoint) + if isLeftDown or isRightDown: + self.toolState = self.TS_NONE + return [[False, brushPatches], [True, brushPatches]] + else: + return [[True, brushPatches]] + + # __init__(self, *args): initialisation method + def __init__(self, *args): + super().__init__(*args) + self.toolOriginPoint = None + self.toolState = self.TS_NONE + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTToolRect.py b/MiRCARTToolRect.py index 66a8864..d2452c5 100644 --- a/MiRCARTToolRect.py +++ b/MiRCARTToolRect.py @@ -40,7 +40,9 @@ class MiRCARTToolRect(MiRCARTTool): brushPatches = [] for brushRow in range(brushSize[1]): for brushCol in range(brushSize[0] * 2): - brushPatches.append([[brushCol, brushRow], \ + brushPatches.append([[ \ + atPoint[0] + brushCol, \ + atPoint[1] + brushRow], \ brushColours, 0, " "]) if isLeftDown or isRightDown: return [[False, brushPatches], [True, brushPatches]] From fa08cc52ae3fca330287fe60fc46d67d4c4e1554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Mon, 8 Jan 2018 17:47:58 +0100 Subject: [PATCH 086/148] MiRCART.png: updates screenshot. --- MiRCART.png | Bin 30019 -> 35691 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/MiRCART.png b/MiRCART.png index a803fefefcb79a42a9910309d7d87cb6e6205357..26cfcdf0a23fb17135c6c8066bd1bb9543941e20 100644 GIT binary patch literal 35691 zcmeFa2Ut_vwgzfJ5tQB(1Vp4a=_&%!l_E_+x{4HmgeJX2LArnlQUwG>K$;39geuac z7b!wQ?+)KM4jq*|bm)lNi6h|3$%6Vh@V~>3T1v8qa$C+$gTD}1$f(I2I`lF8$Tb=6Wgip3kwm{PLQzp0i$R=?tH4%MV)E4_MFUd@yB2>01r z&(rgK?Yx!buSK0!&?F$WyY`twyML|UL)XjNWnq56sQ-5VVC$Ca_mZrvlH&KyJw1D6 zVOwc$=t{RfO&YGxyh(;*r^6-JSIg9^6hpX*y%wxmNv>jUAf(qjb(wcnJZuF>EkAU{ z5PsxX4oCJ~ek?ux_T?wQde&c%%Lew6kHMF_w3$8TE_aX17NPHFn>-J`{lRcMM&QFh z?6EwXWojgQakL+}ZnytjGw3pMhj9bZdieyaP@hLv7_ z(*4am$EN01)LcmLOlf;RRkqrNg2~iM{zgfRHTIlZ*tCv#cE4q%V){3+x#{E+BG0&P zi%h3EW%oNG+dJM~F?|y&%x{e~gchVP-t2_S1v}nrDakP^HIgptm*le+?;b`t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pw!a1)+OET(tPU<}%PlHUqWbo~=K^U5#7k1UNwlx~(R1 zLwjElhs5k?n6}KH@Hgc+ITR6hjCCK4j2MQ%+u>c`2+l@j>-lmkjFn4g=CJZyo8W*R zW!?H0`}ChKjD_WfCoM`u@w{ujOt(LRu8QdpPNE>* z&IpbA&umM-&O0gS+E>USg#_1x4A+;g@VhI0{=KNsCV#yGlg0-HHF)U$!4)5=BInAI zjE@J4Z%J2EJQnRG8CY^*L>u>DgAWgNb>RVg*UN_m(6djDH)QlBuLi}9`mXW*TLWdU z;iq1Z};_fnj;l>dndqu6x_TRy!iM|D0cE8}R z*9#`XcNhAj&@Zm)e!kUpIs;7OY(4fMR|SbMT6MA9UZ_`prxZ=IvoN?y<^n?S^b-3Q z7bR?bu?ov|RXK4h`V?HE7q!)|YK%sO<}JKO@i5bJ`ceH$KZo6B@t1UV9F2MQh)2vZ zJaWJTcf?n(uJBE3C;|E+0sBbiX&Wny0JYrms|X zwGVSs+T4wbZ%bv`Kr*ypB7Hsdos?tO6<_gOKZEz-F2&?dmdv$ z+M`+n>#bMdOM_t%OV)#gVwXd4Fc0?&|EFP(-(T71lAq`=gC)e5A!e)r2gouTB5N+`%5jU^}OoA)7DmrR`p|Gy8r z#Mt8kRj3c)IwVX%P1(m#d}$Ab6%v o8hKw7AIkHUnI<2)L}YUM%HL}`aZ$Gqpbgt`Wi6%Dqi4MTACysPy8r+H From 9e3af62f975a070d02f49752564c1a332416e249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Mon, 8 Jan 2018 20:28:43 +0100 Subject: [PATCH 087/148] MiRCART{General,}Frame.py, assets/*.png: adds icons for tools. MiRCART{Frame,ToolText}.py: initial implementation of Text tool. --- MiRCARTFrame.py | 123 ++++++++++++++++++++++------------------- MiRCARTGeneralFrame.py | 37 +++++++++---- MiRCARTToolText.py | 52 +++++++++++++++++ assets/toolCircle.png | Bin 0 -> 360 bytes assets/toolLine.png | Bin 0 -> 371 bytes assets/toolRect.png | Bin 0 -> 220 bytes assets/toolText.png | Bin 0 -> 306 bytes 7 files changed, 144 insertions(+), 68 deletions(-) create mode 100644 MiRCARTToolText.py create mode 100644 assets/toolCircle.png create mode 100644 assets/toolLine.png create mode 100644 assets/toolRect.png create mode 100644 assets/toolText.png diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 71372ce..7a92ebb 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -29,6 +29,7 @@ from MiRCARTGeneralFrame import MiRCARTGeneralFrame, \ from MiRCARTToolCircle import MiRCARTToolCircle from MiRCARTToolLine import MiRCARTToolLine from MiRCARTToolRect import MiRCARTToolRect +from MiRCARTToolText import MiRCARTToolText import os, wx @@ -38,48 +39,51 @@ class MiRCARTFrame(MiRCARTGeneralFrame): canvasPos = canvasSize = cellSize = None # {{{ Commands - # Id Type Id Labels Icon bitmap Accelerator [Initial state] - CID_NEW = (0x100, TID_COMMAND, "New", "&New", wx.ART_NEW, (wx.ACCEL_CTRL, ord("N"))) - CID_OPEN = (0x101, TID_COMMAND, "Open", "&Open", wx.ART_FILE_OPEN, (wx.ACCEL_CTRL, ord("O"))) - CID_SAVE = (0x102, TID_COMMAND, "Save", "&Save", wx.ART_FILE_SAVE, (wx.ACCEL_CTRL, ord("S"))) - CID_SAVEAS = (0x103, TID_COMMAND, "Save As...", "Save &As...", wx.ART_FILE_SAVE_AS, None) - CID_EXPORT_AS_PNG = (0x104, TID_COMMAND, "Export as PNG...", \ - "Export as PN&G...", None, None) - CID_EXPORT_IMGUR = (0x105, TID_COMMAND, "Export to Imgur...", \ - "Export to I&mgur...", None, None, haveUrllib) - CID_EXPORT_PASTEBIN = (0x106, TID_COMMAND, "Export to Pastebin...", \ - "Export to Pasteb&in...", None, None, haveUrllib) - CID_EXIT = (0x107, TID_COMMAND, "Exit", "E&xit", None, None) - CID_UNDO = (0x108, TID_COMMAND, "Undo", "&Undo", wx.ART_UNDO, (wx.ACCEL_CTRL, ord("Z")), False) - CID_REDO = (0x109, TID_COMMAND, "Redo", "&Redo", wx.ART_REDO, (wx.ACCEL_CTRL, ord("Y")), False) - CID_CUT = (0x10a, TID_COMMAND, "Cut", "Cu&t", wx.ART_CUT, None, False) - CID_COPY = (0x10b, TID_COMMAND, "Copy", "&Copy", wx.ART_COPY, None, False) - CID_PASTE = (0x10c, TID_COMMAND, "Paste", "&Paste", wx.ART_PASTE, None, False) - CID_DELETE = (0x10d, TID_COMMAND, "Delete", "De&lete", wx.ART_DELETE, None, False) - CID_INCRBRUSH = (0x10e, TID_COMMAND, "Increase brush size", \ - "&Increase brush size", wx.ART_PLUS, (wx.ACCEL_CTRL, ord("+"))) - CID_DECRBRUSH = (0x10f, TID_COMMAND, "Decrease brush size", \ - "&Decrease brush size", wx.ART_MINUS, (wx.ACCEL_CTRL, ord("-"))) - CID_SOLID_BRUSH = (0x110, TID_SELECT, "Solid brush", "&Solid brush", None, None, True) - CID_RECT = (0x111, TID_SELECT, "Rectangle", "&Rectangle", None, None, True) - CID_CIRCLE = (0x112, TID_SELECT, "Circle", "&Circle", None, None, False) - CID_LINE = (0x113, TID_SELECT, "Line", "&Line", None, None, False) - CID_COLOUR00 = (0x114, TID_COMMAND, "Colour #00", "Colour #00", None, None) - CID_COLOUR01 = (0x115, TID_COMMAND, "Colour #01", "Colour #01", None, None) - CID_COLOUR02 = (0x116, TID_COMMAND, "Colour #02", "Colour #02", None, None) - CID_COLOUR03 = (0x117, TID_COMMAND, "Colour #03", "Colour #03", None, None) - CID_COLOUR04 = (0x118, TID_COMMAND, "Colour #04", "Colour #04", None, None) - CID_COLOUR05 = (0x119, TID_COMMAND, "Colour #05", "Colour #05", None, None) - CID_COLOUR06 = (0x11a, TID_COMMAND, "Colour #06", "Colour #06", None, None) - CID_COLOUR07 = (0x11b, TID_COMMAND, "Colour #07", "Colour #07", None, None) - CID_COLOUR08 = (0x11c, TID_COMMAND, "Colour #08", "Colour #08", None, None) - CID_COLOUR09 = (0x11d, TID_COMMAND, "Colour #09", "Colour #09", None, None) - CID_COLOUR10 = (0x11e, TID_COMMAND, "Colour #10", "Colour #10", None, None) - CID_COLOUR11 = (0x11f, TID_COMMAND, "Colour #11", "Colour #11", None, None) - CID_COLOUR12 = (0x120, TID_COMMAND, "Colour #12", "Colour #12", None, None) - CID_COLOUR13 = (0x121, TID_COMMAND, "Colour #13", "Colour #13", None, None) - CID_COLOUR14 = (0x122, TID_COMMAND, "Colour #14", "Colour #14", None, None) - CID_COLOUR15 = (0x123, TID_COMMAND, "Colour #15", "Colour #15", None, None) + # Id Type Id Labels Icon bitmap Accelerator [Initial state] + CID_NEW = [0x100, TID_COMMAND, "New", "&New", ["", wx.ART_NEW], [wx.ACCEL_CTRL, ord("N")]] + CID_OPEN = [0x101, TID_COMMAND, "Open", "&Open", ["", wx.ART_FILE_OPEN], [wx.ACCEL_CTRL, ord("O")]] + CID_SAVE = [0x102, TID_COMMAND, "Save", "&Save", ["", wx.ART_FILE_SAVE], [wx.ACCEL_CTRL, ord("S")]] + CID_SAVEAS = [0x103, TID_COMMAND, "Save As...", "Save &As...", ["", wx.ART_FILE_SAVE_AS], None] + CID_EXPORT_AS_PNG = [0x104, TID_COMMAND, "Export as PNG...", \ + "Export as PN&G...", None, None] + CID_EXPORT_IMGUR = [0x105, TID_COMMAND, "Export to Imgur...", \ + "Export to I&mgur...", None, None, haveUrllib] + CID_EXPORT_PASTEBIN = [0x106, TID_COMMAND, "Export to Pastebin...", \ + "Export to Pasteb&in...", None, None, haveUrllib] + CID_EXIT = [0x107, TID_COMMAND, "Exit", "E&xit", None, None] + CID_UNDO = [0x108, TID_COMMAND, "Undo", "&Undo", ["", wx.ART_UNDO], [wx.ACCEL_CTRL, ord("Z")], False] + CID_REDO = [0x109, TID_COMMAND, "Redo", "&Redo", ["", wx.ART_REDO], [wx.ACCEL_CTRL, ord("Y")], False] + CID_CUT = [0x10a, TID_COMMAND, "Cut", "Cu&t", ["", wx.ART_CUT], None, False] + CID_COPY = [0x10b, TID_COMMAND, "Copy", "&Copy", ["", wx.ART_COPY], None, False] + CID_PASTE = [0x10c, TID_COMMAND, "Paste", "&Paste", ["", wx.ART_PASTE], None, False] + CID_DELETE = [0x10d, TID_COMMAND, "Delete", "De&lete", ["", wx.ART_DELETE], None, False] + CID_INCRBRUSH = [0x10e, TID_COMMAND, "Increase brush size", \ + "&Increase brush size", ["", wx.ART_PLUS], [wx.ACCEL_CTRL, ord("+")]] + CID_DECRBRUSH = [0x10f, TID_COMMAND, "Decrease brush size", \ + "&Decrease brush size", ["", wx.ART_MINUS], [wx.ACCEL_CTRL, ord("-")]] + CID_SOLID_BRUSH = [0x110, TID_SELECT, "Solid brush", "&Solid brush", None, None, True] + + CID_RECT = [0x150, TID_SELECT, "Rectangle", "&Rectangle", ["toolRect.png"], [wx.ACCEL_CTRL, ord("R")], True] + CID_CIRCLE = [0x151, TID_SELECT, "Circle", "&Circle", ["toolCircle.png"], [wx.ACCEL_CTRL, ord("C")], False] + CID_LINE = [0x152, TID_SELECT, "Line", "&Line", ["toolLine.png"], [wx.ACCEL_CTRL, ord("L")], False] + CID_TEXT = [0x153, TID_SELECT, "Text", "&Text", ["toolText.png"], [wx.ACCEL_CTRL, ord("T")], False] + + CID_COLOUR00 = [0x1a0, TID_COMMAND, "Colour #00", "Colour #00", None, None] + CID_COLOUR01 = [0x1a1, TID_COMMAND, "Colour #01", "Colour #01", None, None] + CID_COLOUR02 = [0x1a2, TID_COMMAND, "Colour #02", "Colour #02", None, None] + CID_COLOUR03 = [0x1a3, TID_COMMAND, "Colour #03", "Colour #03", None, None] + CID_COLOUR04 = [0x1a4, TID_COMMAND, "Colour #04", "Colour #04", None, None] + CID_COLOUR05 = [0x1a5, TID_COMMAND, "Colour #05", "Colour #05", None, None] + CID_COLOUR06 = [0x1a6, TID_COMMAND, "Colour #06", "Colour #06", None, None] + CID_COLOUR07 = [0x1a7, TID_COMMAND, "Colour #07", "Colour #07", None, None] + CID_COLOUR08 = [0x1a8, TID_COMMAND, "Colour #08", "Colour #08", None, None] + CID_COLOUR09 = [0x1a9, TID_COMMAND, "Colour #09", "Colour #09", None, None] + CID_COLOUR10 = [0x1aa, TID_COMMAND, "Colour #10", "Colour #10", None, None] + CID_COLOUR11 = [0x1ab, TID_COMMAND, "Colour #11", "Colour #11", None, None] + CID_COLOUR12 = [0x1ac, TID_COMMAND, "Colour #12", "Colour #12", None, None] + CID_COLOUR13 = [0x1ad, TID_COMMAND, "Colour #13", "Colour #13", None, None] + CID_COLOUR14 = [0x1ae, TID_COMMAND, "Colour #14", "Colour #14", None, None] + CID_COLOUR15 = [0x1af, TID_COMMAND, "Colour #15", "Colour #15", None, None] # }}} # {{{ Non-items NID_MENU_SEP = (0x200, TID_NOTHING) @@ -95,7 +99,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_MENU_SEP, \ CID_INCRBRUSH, CID_DECRBRUSH, CID_SOLID_BRUSH)) MID_TOOLS = (0x302, TID_MENU, "Tools", "&Tools", ( \ - CID_RECT, CID_CIRCLE, CID_LINE)) + CID_RECT, CID_CIRCLE, CID_LINE, CID_TEXT)) # }}} # {{{ Toolbars BID_TOOLBAR = (0x400, TID_TOOLBAR, ( \ @@ -103,7 +107,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_UNDO, CID_REDO, NID_TOOLBAR_SEP, \ CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_TOOLBAR_SEP, \ CID_INCRBRUSH, CID_DECRBRUSH, CID_SOLID_BRUSH, NID_TOOLBAR_SEP, \ - CID_RECT, CID_CIRCLE, CID_LINE, NID_TOOLBAR_SEP, \ + CID_RECT, CID_CIRCLE, CID_LINE, CID_TEXT, NID_TOOLBAR_SEP, \ CID_COLOUR00, CID_COLOUR01, CID_COLOUR02, CID_COLOUR03, CID_COLOUR04, \ CID_COLOUR05, CID_COLOUR06, CID_COLOUR07, CID_COLOUR08, CID_COLOUR09, \ CID_COLOUR10, CID_COLOUR11, CID_COLOUR12, CID_COLOUR13, CID_COLOUR14, \ @@ -119,17 +123,8 @@ class MiRCARTFrame(MiRCARTGeneralFrame): LID_TOOLBARS = (0x602, TID_LIST, (BID_TOOLBAR)) # }}} - # {{{ _dialogSaveChanges(self) - def _dialogSaveChanges(self): - with wx.MessageDialog(self, \ - "Do you want to save changes to {}?".format( \ - self.canvasPathName), "MiRCART", \ - wx.CANCEL|wx.CANCEL_DEFAULT|wx.ICON_QUESTION|wx.YES_NO) as dialog: - dialogChoice = dialog.ShowModal() - return dialogChoice - # }}} - # {{{ _setPaletteToolBitmaps(self): XXX - def _setPaletteToolBitmaps(self): + # {{{ _initPaletteToolBitmaps(self): XXX + def _initPaletteToolBitmaps(self): paletteDescr = ( \ self.CID_COLOUR00, self.CID_COLOUR01, self.CID_COLOUR02, self.CID_COLOUR03, self.CID_COLOUR04, \ self.CID_COLOUR05, self.CID_COLOUR06, self.CID_COLOUR07, self.CID_COLOUR08, self.CID_COLOUR09, \ @@ -145,8 +140,16 @@ class MiRCARTFrame(MiRCARTGeneralFrame): toolBitmapDc.SetBackground(toolBitmapBrush) toolBitmapDc.SetPen(wx.Pen(wx.Colour(toolBitmapColour), 1)) toolBitmapDc.DrawRectangle(0, 0, 16, 16) - self.toolBar.SetToolNormalBitmap( \ - paletteDescr[numColour][0], toolBitmap) + paletteDescr[numColour][4] = ["", None, toolBitmap] + # }}} + # {{{ _dialogSaveChanges(self) + def _dialogSaveChanges(self): + with wx.MessageDialog(self, \ + "Do you want to save changes to {}?".format( \ + self.canvasPathName), "MiRCART", \ + wx.CANCEL|wx.CANCEL_DEFAULT|wx.ICON_QUESTION|wx.YES_NO) as dialog: + dialogChoice = dialog.ShowModal() + return dialogChoice # }}} # {{{ _updateStatusBar(self, showColours=None, showFileName=True, showPos=None): XXX def _updateStatusBar(self, showColours=True, showFileName=True, showPos=True): @@ -369,6 +372,10 @@ class MiRCARTFrame(MiRCARTGeneralFrame): self.menuItemsById[cid].Check(True) self.panelCanvas.canvasCurTool = \ MiRCARTToolLine(self.panelCanvas) + elif cid == self.CID_TEXT[0]: + self.menuItemsById[cid].Check(True) + self.panelCanvas.canvasCurTool = \ + MiRCARTToolText(self.panelCanvas) elif cid >= self.CID_COLOUR00[0] \ and cid <= self.CID_COLOUR15[0]: numColour = cid - self.CID_COLOUR00[0] @@ -387,8 +394,8 @@ class MiRCARTFrame(MiRCARTGeneralFrame): # # __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), canvasSize=(100, 30), cellSize=(7, 14)): initialisation method def __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), canvasSize=(100, 30), cellSize=(7, 14)): + self._initPaletteToolBitmaps() panelSkin = super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) - self._setPaletteToolBitmaps() self.canvasPos = canvasPos; self.cellSize = cellSize; self.canvasSize = canvasSize; self.canvasPathName = None self.panelCanvas = MiRCARTCanvas(panelSkin, parentFrame=self, \ diff --git a/MiRCARTGeneralFrame.py b/MiRCARTGeneralFrame.py index 0c127e0..7bdf00a 100644 --- a/MiRCARTGeneralFrame.py +++ b/MiRCARTGeneralFrame.py @@ -75,29 +75,45 @@ class MiRCARTGeneralFrame(wx.Frame): # {{{ _initToolBars(self, toolBarsDescr, handler): XXX def _initToolBars(self, toolBarsDescr, handler, panelSkin): self.toolBarItemsById = {} - self.toolBar = wx.ToolBar(panelSkin, -1, \ + self.toolBar = wx.ToolBar(panelSkin, -1, \ style=wx.HORIZONTAL|wx.TB_FLAT|wx.TB_NODIVIDER) self.toolBar.SetToolBitmapSize((16,16)) for toolBarItem in toolBarsDescr[2]: if toolBarItem == self.NID_TOOLBAR_SEP: self.toolBar.AddSeparator() else: - if toolBarItem[4] != None: - toolBarItemIcon = wx.ArtProvider.GetBitmap( \ - toolBarItem[4], wx.ART_TOOLBAR, (16,16)) - else: - toolBarItemIcon = wx.ArtProvider.GetBitmap( \ - wx.ART_HELP, wx.ART_TOOLBAR, (16,16)) - toolBarItemWindow = self.toolBar.AddTool( \ - toolBarItem[0], toolBarItem[2], toolBarItemIcon) + toolBarItemWindow = self.toolBar.AddTool( \ + toolBarItem[0], toolBarItem[2], toolBarItem[4][2]) self.toolBarItemsById[toolBarItem[0]] = toolBarItemWindow - if len(toolBarItem) == 7 \ + if len(toolBarItem) == 7 \ and toolBarItem[1] == TID_COMMAND: toolBarItemWindow.Enable(toolBarItem[6]) self.Bind(wx.EVT_TOOL, handler, toolBarItemWindow) self.Bind(wx.EVT_TOOL_RCLICKED, handler, toolBarItemWindow) self.toolBar.Realize(); self.toolBar.Fit(); # }}} + # {{{ _initToolBitmaps(self): XXX + def _initToolBitmaps(self, toolBarsDescr): + for toolBarItem in toolBarsDescr[2]: + if toolBarItem == self.NID_TOOLBAR_SEP: + continue + elif toolBarItem[4] == None: + toolBarItem[4] = ["", None, wx.ArtProvider.GetBitmap( \ + wx.ART_HELP, wx.ART_TOOLBAR, (16,16))] + elif toolBarItem[4][0] == "" \ + and toolBarItem[4][1] != None: + toolBarItem[4] = ["", None, wx.ArtProvider.GetBitmap( \ + toolBarItem[4][1], wx.ART_TOOLBAR, (16,16))] + elif toolBarItem[4][0] == "" \ + and toolBarItem[4][1] == None: + toolBarItem[4] = ["", None, toolBarItem[4][2]] + elif toolBarItem[4][0] != "": + toolBitmap = wx.Bitmap((16,16)) + toolBitmap.LoadFile( \ + os.path.join("assets", toolBarItem[4][0]), \ + wx.BITMAP_TYPE_ANY) + toolBarItem[4] = ["", None, toolBitmap] + # }}} # {{{ onClose(self, event): XXX def onClose(self, event): self.Destroy(); self.__del__(); @@ -118,6 +134,7 @@ class MiRCARTGeneralFrame(wx.Frame): menuBar = self._initMenus(self.LID_MENUS[2], \ self.onFrameCommand) self.SetMenuBar(menuBar) + self._initToolBitmaps(self.LID_TOOLBARS[2]) toolBar = self._initToolBars(self.LID_TOOLBARS[2], \ self.onFrameCommand, panelSkin) diff --git a/MiRCARTToolText.py b/MiRCARTToolText.py new file mode 100644 index 0000000..9fd18ab --- /dev/null +++ b/MiRCARTToolText.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 +# +# MiRCARTToolText.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from MiRCARTTool import MiRCARTTool + +class MiRCARTToolText(MiRCARTTool): + """XXX""" + + # + # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): XXX + def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): + brushColours = brushColours.copy() + if isLeftDown: + brushColours[1] = brushColours[0] + elif isRightDown: + brushColours[0] = brushColours[1] + else: + brushColours[1] = brushColours[0] + brushPatches = [] + for brushRow in range(brushSize[1]): + for brushCol in range(brushSize[0] * 2): + brushPatches.append([[ \ + atPoint[0] + brushCol, \ + atPoint[1] + brushRow], \ + brushColours, 0, " "]) + if isLeftDown or isRightDown: + return [[False, brushPatches], [True, brushPatches]] + else: + return [[True, brushPatches]] + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/assets/toolCircle.png b/assets/toolCircle.png new file mode 100644 index 0000000000000000000000000000000000000000..9e34f7288272bb8dda0b54fe26d13a6d1998b2a2 GIT binary patch literal 360 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJwwYY*EWF^-SBjA46*QEI!RIJkb!_}xPrETsHn{9MNE;64qwtby0}=Hk`)9_$SM6f zpEBLoBmKn|<9xN><^S_8xj1pm*67OC=vI>5(GcG9dSAqB7A4*tOl+!o3p{N+KbRJ4 zl?OI6Te!Wwtn$&qm^W)(ZQz;r2ZaqRX1?R9@YA!pS~R2EbaAHM%IH5c*FAV#xMPNI z@yWBiUpUrgS^oIKF*#H3=5dw!kfpm$hd*GH;8~XLx+gvN64PEczp&4;Z>C9oP|Tbx yWTJ1cBJ6rDfu%TwiFw1xu-V+%nqB{epYWbJq^No$J@+`!j|`r!elF{r5}E+A&w?)i literal 0 HcmV?d00001 diff --git a/assets/toolLine.png b/assets/toolLine.png new file mode 100644 index 0000000000000000000000000000000000000000..206b1042bc2237fa368625752e1647d764ec94d5 GIT binary patch literal 371 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJwwYY*EWF^J@#~Q46*QEdf_~mqoc_2kB|3n-NSg(Bgo9`({o0f)f&>Clcsol;u4$W z6d4hFf9Ld_%{%`+xw724_+9?2XC03%>NlFzC+6M?2%KVgF!KA^00FH=t7SKmm;ImV zD6Q4E%&JA1O+)F`zk0ibMUz$}b)0=0?GTZEhFMLkjqS==_L2$CPZZPhN+t_jIq>U7 zQm>Sg{>|rYw?$4qt}7OQC0UsLE%EW)IY%Y361b;)DEd5i{|C0PgEG@^hrhj>$^KDX zNmr-v5QpRoFk5?t`S%HC&hLM4Pn5moF|*Ns&Dr>f+4qZ|aODR1c;0SVmjU!HgQu&X J%Q~loCIHE-mH+?% literal 0 HcmV?d00001 diff --git a/assets/toolRect.png b/assets/toolRect.png new file mode 100644 index 0000000000000000000000000000000000000000..851cb4a2265a11b60255b40a28e2baf7e4b10430 GIT binary patch literal 220 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJwwYY*EWF^`FOfGhFJJ-?eXMdFyJ`y>%YH$wPx!|#%(O!&{DXWlJQt*7HB} zt7vcfz{mPfmg|tUNK3f}$NK<*dkYoz+;*Avo!^hMzw(L|$HLhCbJoNy0Gi9->FVdQ I&MBb@0EFE|ApigX literal 0 HcmV?d00001 diff --git a/assets/toolText.png b/assets/toolText.png new file mode 100644 index 0000000000000000000000000000000000000000..d27b9690570d46f88fbbdab0ea22ba7531fe2758 GIT binary patch literal 306 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJwwYY*EWF^E%J1646*QEI`JXbAp?PC_23r8SN!+?e`Sex__kV2b$eRTsa1{Zr=R}H zmF%qfRR7Y3c9S=Xy!#nHuDEiqJ-YMhtHTzTd^T2!{yTB% w_5wD3zM~oYboZp5X5K%k&34JdvQr Date: Tue, 9 Jan 2018 00:21:43 +0100 Subject: [PATCH 088/148] Initial release w/ circle, line, rectangle, and text tools. --- MiRCARTCanvas.py | 291 +++++++++++++++++----------------------- MiRCARTCanvasBackend.py | 153 +++++++++++++++++++++ MiRCARTCanvasJournal.py | 116 ++++++---------- MiRCARTFrame.py | 85 +++++++----- MiRCARTToPngFile.py | 2 +- MiRCARTTool.py | 6 +- MiRCARTToolRect.py | 5 +- MiRCARTToolText.py | 45 ++++--- 8 files changed, 413 insertions(+), 290 deletions(-) create mode 100644 MiRCARTCanvasBackend.py diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index eb341dd..a3c6642 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -22,6 +22,7 @@ # SOFTWARE. # +from MiRCARTCanvasBackend import MiRCARTCanvasBackend from MiRCARTCanvasJournal import MiRCARTCanvasJournal from MiRCARTCanvasStore import MiRCARTCanvasStore, haveMiRCARTToPngFile, haveUrllib from MiRCARTColours import MiRCARTColours @@ -30,208 +31,168 @@ import wx class MiRCARTCanvas(wx.Panel): """XXX""" parentFrame = None - canvasPos = canvasSize = canvasWinSize = cellSize = None - canvasBitmap = canvasMap = None + canvasMap = canvasPos = canvasSize = None brushColours = brushPos = brushSize = None - mircBrushes = mircPens = None - canvasJournal = canvasStore = None - canvasCurTool = None + canvasBackend = canvasCurTool = canvasJournal = canvasStore = None - # {{{ _initBrushesAndPens(self): XXX - def _initBrushesAndPens(self): - self.mircBrushes = [None for x in range(len(MiRCARTColours))] - self.mircPens = [None for x in range(len(MiRCARTColours))] - for mircColour in range(len(MiRCARTColours)): - self.mircBrushes[mircColour] = wx.Brush( \ - wx.Colour(MiRCARTColours[mircColour][0:4]), wx.BRUSHSTYLE_SOLID) - self.mircPens[mircColour] = wx.Pen( \ - wx.Colour(MiRCARTColours[mircColour][0:4]), 1) + # {{{ _commitPatch(self, patch): + def _commitPatch(self, patch): + self.canvasMap[patch[0][1]][patch[0][0]] = patch[1:] # }}} - # {{{ _drawPatch(self, patch, eventDc, tmpDc, atPoint): XXX - def _drawPatch(self, patch, eventDc, tmpDc, atPoint): - absPoint = self._relMapPointToAbsPoint(patch[0], atPoint) - if patch[3] == " ": - brushFg = self.mircBrushes[patch[1][1]] - brushBg = self.mircBrushes[patch[1][0]] - pen = self.mircPens[patch[1][1]] - else: - brushFg = self.mircBrushes[patch[1][0]] - brushBg = self.mircBrushes[patch[1][1]] - pen = self.mircPens[patch[1][0]] - for dc in (eventDc, tmpDc): - dc.SetBrush(brushFg); dc.SetBackground(brushBg); dc.SetPen(pen); - dc.DrawRectangle(*absPoint, *self.cellSize) - # }}} - # {{{ _eventPointToMapPoint(self, eventPoint): XXX - def _eventPointToMapPoint(self, eventPoint): - rectX = eventPoint.x - (eventPoint.x % self.cellSize[0]) - rectY = eventPoint.y - (eventPoint.y % self.cellSize[1]) - mapX = int(rectX / self.cellSize[0] if rectX else 0) - mapY = int(rectY / self.cellSize[1] if rectY else 0) - return (mapX, mapY) - # }}} - # {{{ _getMapCell(self, absMapPoint): XXX - def _getMapCell(self, absMapPoint): - return self.canvasMap[absMapPoint[1]][absMapPoint[0]] - # }}} - # {{{ _relMapPointToAbsPoint(self, relMapPoint, atPoint): XXX - def _relMapPointToAbsPoint(self, relMapPoint, atPoint): - return [(a+b)*c for a,b,c in zip(atPoint, relMapPoint, self.cellSize)] - # }}} - # {{{ _setMapCell(self, absMapPoint, colours, charAttrs, char): XXX - def _setMapCell(self, absMapPoint, colours, charAttrs, char): - self.canvasMap[absMapPoint[1]][absMapPoint[0]] = [colours, charAttrs, char] + # {{{ _dispatchInput(self, eventDc, patches, tmpDc): XXX + def _dispatchInput(self, eventDc, patches, tmpDc): + self.canvasBackend.drawCursorMaskWithJournal( \ + self.canvasJournal, eventDc, tmpDc) + cursorPatches = []; undoPatches = []; newPatches = []; + for patchDescr in patches: + patchIsCursor = patchDescr[0] + for patch in patchDescr[1]: + if self.canvasBackend.drawPatch(eventDc, patch, tmpDc) == False: + continue + else: + patchDeltaCell = self.canvasMap[patch[0][1]][patch[0][0]] + if patchIsCursor == True: + cursorPatches.append([list(patch[0]), *patchDeltaCell.copy()]) + else: + undoPatches.append([list(patch[0]), *patchDeltaCell.copy()]) + newPatches.append(patch) + self._commitPatch(patch) + if len(cursorPatches): + self.canvasJournal.pushCursor(cursorPatches) + if len(undoPatches): + self.canvasJournal.pushDeltas(undoPatches, newPatches) # }}} - # {{{ onClose(self, event): XXX - def onClose(self, event): - self.Destroy(); self.__del__(); + # {{{ onPanelClose(self, event): XXX + def onPanelClose(self, event): + self.Destroy() # }}} - # {{{ onJournalUpdate(self, isTmp, absMapPoint, patch, eventDc, tmpDc, atPoint): - def onJournalUpdate(self, isTmp, absMapPoint, patch, eventDc, tmpDc, atPoint, isInherit=False): - if eventDc == None: - eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); - if tmpDc == None: - tmpDc.SelectObject(self.canvasBitmap) - if isTmp == True: - if isInherit: - patch[1:] = self._getMapCell(patch[0]) - self._drawPatch(patch, eventDc, tmpDc, atPoint) + # {{{ onPanelKeyboardInput(self, event): XXX + def onPanelKeyboardInput(self, event): + eventDc, tmpDc = self.canvasBackend.getDeviceContexts(self) + tool = self.canvasCurTool; mapPoint = self.brushPos; + if event.GetModifiers() != wx.MOD_NONE: + event.Skip() else: - if isInherit: - patchOld = patch.copy() - patchOld[1:] = self._getMapCell(patchOld[0]) - self._setMapCell(absMapPoint, *patch[1:]) - self._drawPatch(patch, eventDc, tmpDc, atPoint) - if isInherit: - return patchOld + patches = tool.onKeyboardEvent( \ + event, mapPoint, self.brushColours, self.brushSize, \ + chr(event.GetUnicodeKey())) + if len(patches): + self._dispatchInput(eventDc, patches, tmpDc) + self.parentFrame.onCanvasUpdate() # }}} - # {{{ onMouseEvent(self, event): XXX - def onMouseEvent(self, event): - eventObject = event.GetEventObject() - eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); - tmpDc.SelectObject(self.canvasBitmap) - eventPoint = event.GetLogicalPosition(eventDc) - mapPoint = self._eventPointToMapPoint(eventPoint) + # {{{ onPanelMouseInput(self, event): XXX + def onPanelMouseInput(self, event): + eventDc, tmpDc = self.canvasBackend.getDeviceContexts(self) tool = self.canvasCurTool - mapPatches = tool.onMouseEvent( \ - event, mapPoint, self.brushColours, self.brushSize, \ + self.brushPos = mapPoint = \ + self.canvasBackend.xlateEventPoint(event, eventDc) + patches = tool.onMouseEvent( \ + event, mapPoint, self.brushColours, self.brushSize, \ event.Dragging(), event.LeftIsDown(), event.RightIsDown()) - self.canvasJournal.merge(mapPatches, eventDc, tmpDc, mapPoint) - self.parentFrame.onCanvasUpdate() + if len(patches): + self._dispatchInput(eventDc, patches, tmpDc) + self.parentFrame.onCanvasUpdate() self.parentFrame.onCanvasMotion(event, mapPoint) # }}} - # {{{ onMouseWindowEvent(self, event): XXX - def onMouseWindowEvent(self, event): - eventObject = event.GetEventObject() - eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); - tmpDc.SelectObject(self.canvasBitmap) - self.canvasJournal.resetCursor(eventDc, tmpDc) + # {{{ onPanelFocus(self, event): XXX + def onPanelFocus(self, event): + if event.GetEventType() == wx.wxEVT_LEAVE_WINDOW: + eventDc, tmpDc = \ + self.canvasBackend.getDeviceContexts(self) + self.canvasBackend.drawCursorMaskWithJournal( \ + self.canvasJournal, eventDc, tmpDc) self.parentFrame.onCanvasMotion(event) # }}} - # {{{ onPaint(self, event): XXX - def onPaint(self, event): - eventDc = wx.BufferedPaintDC(self, self.canvasBitmap) + # {{{ onPanelPaint(self, event): XXX + def onPanelPaint(self, event): + if self.canvasBackend.canvasBitmap != None: + eventDc = wx.BufferedPaintDC(self, self.canvasBackend.canvasBitmap) # }}} # {{{ onStoreUpdate(self, newCanvasSize, newCanvas=None): def onStoreUpdate(self, newCanvasSize, newCanvas=None): - if newCanvasSize != None: - self.resize(newCanvasSize) - self.canvasJournal.reset() - if newCanvas != None: - self.canvasMap = newCanvas.copy() - for numRow in range(self.canvasSize[1]): - numRowCols = len(self.canvasMap[numRow]) - if numRowCols < self.canvasSize[0]: - colsDelta = self.canvasSize[0] - numRowCols - self.canvasMap[numRow][self.canvasSize[0]:] = \ - [[(1, 1), 0, " "] for y in range(colsDelta)] - else: - del self.canvasMap[numRow][self.canvasSize[0]:] - else: - self.canvasMap = [[[(1, 1), 0, " "] \ - for x in range(self.canvasSize[0])] \ - for y in range(self.canvasSize[1])] - canvasWinSize = [a*b for a,b in zip(self.canvasSize, self.cellSize)] - if self.canvasBitmap != None: - self.canvasBitmap.Destroy() - self.canvasBitmap = wx.Bitmap(canvasWinSize) - eventDc = wx.ClientDC(self); tmpDc = wx.MemoryDC(); - tmpDc.SelectObject(self.canvasBitmap) + self.resize(newCanvasSize=newCanvasSize) + self.canvasBackend.reset(self.canvasSize, self.canvasBackend.cellSize) + self.canvasJournal.resetCursor(); self.canvasJournal.resetUndo(); + self.canvasMap = [[[(1, 1), 0, " "] \ + for x in range(self.canvasSize[0])] \ + for y in range(self.canvasSize[1])] + eventDc, tmpDc = self.canvasBackend.getDeviceContexts(self) for numRow in range(self.canvasSize[1]): for numCol in range(self.canvasSize[0]): - self.onJournalUpdate(False, \ - (numCol, numRow), \ - [(numCol, numRow), \ - *self.canvasMap[numRow][numCol]], \ - eventDc, tmpDc, (0, 0)) + if newCanvas != None \ + and numRow < len(newCanvas) \ + and numCol < len(newCanvas[numRow]): + self._commitPatch([ \ + [numCol, numRow], *newCanvas[numRow][numCol]]) + self.canvasBackend.drawPatch(eventDc, \ + ([numCol, numRow], \ + *self.canvasMap[numRow][numCol]), tmpDc) wx.SafeYield() # }}} - # {{{ redo(self): XXX - def redo(self): - result = self.canvasJournal.redo() + # {{{ popRedo(self): + def popRedo(self): + eventDc, tmpDc = self.canvasBackend.getDeviceContexts(self) + patches = self.canvasJournal.popRedo() + for patch in patches: + if self.canvasBackend.drawPatch(eventDc, patch, tmpDc) == False: + continue + else: + self._commitPatch(patch) self.parentFrame.onCanvasUpdate() - return result # }}} - # {{{ resize(self, newCanvasSize): XXX + # {{{ popUndo(self): + def popUndo(self): + eventDc, tmpDc = self.canvasBackend.getDeviceContexts(self) + patches = self.canvasJournal.popUndo() + for patch in patches: + if self.canvasBackend.drawPatch(eventDc, patch, tmpDc) == False: + continue + else: + self._commitPatch(patch) + self.parentFrame.onCanvasUpdate() + # }}} + # {{{ resize(self, newCanvasSize): def resize(self, newCanvasSize): if newCanvasSize != self.canvasSize: - self.SetSize(*self.canvasPos, \ - newCanvasSize[0] * self.cellSize[0], \ - newCanvasSize[1] * self.cellSize[1]) + winSize = [a*b for a,b in \ + zip(newCanvasSize, self.canvasBackend.cellSize)] + self.SetSize(*self.canvasPos, *winSize) for numRow in range(self.canvasSize[1]): for numNewCol in range(self.canvasSize[0], newCanvasSize[0]): - self.canvasMap[numRow].append([1, 1, " "]) + self.canvasMap[numRow].append([[1, 1], 0, " "]) for numNewRow in range(self.canvasSize[1], newCanvasSize[1]): self.canvasMap.append([]) for numNewCol in range(newCanvasSize[0]): - self.canvasMap[numNewRow].append([1, 1, " "]) + self.canvasMap[numNewRow].append([[1, 1], 0, " "]) self.canvasSize = newCanvasSize - canvasWinSize = ( \ - self.cellSize[0] * self.canvasSize[0], \ - self.cellSize[1] * self.canvasSize[1]) - self.canvasBitmap = wx.Bitmap(canvasWinSize) - # }}} - # {{{ undo(self): XXX - def undo(self): - result = self.canvasJournal.undo() + self.canvasBackend.reset(self.canvasSize, \ + self.canvasBackend.cellSize) self.parentFrame.onCanvasUpdate() - return result - # }}} - - # {{{ __del__(self): destructor method - def __del__(self): - if self.canvasBitmap != None: - self.canvasBitmap.Destroy(); self.canvasBitmap = None; - for brush in self.mircBrushes or []: - brush.Destroy() - self.mircBrushes = None - for pen in self.mircPens or []: - pen.Destroy() - self.mircPens = None # }}} # # _init__(self, parent, parentFrame, canvasPos, canvasSize, cellSize): initialisation method def __init__(self, parent, parentFrame, canvasPos, canvasSize, cellSize): - self.parentFrame = parentFrame - self.canvasPos = canvasPos; self.canvasSize = canvasSize; - self.cellSize = cellSize - - self.brushColours = [4, 1]; self._initBrushesAndPens(); - self.brushPos = [0, 0]; self.brushSize = [1, 1]; - self.canvasJournal = MiRCARTCanvasJournal(parentCanvas=self) - self.canvasStore = MiRCARTCanvasStore(parentCanvas=self) - self.canvasCurTool = None - - super().__init__(parent, pos=canvasPos, \ + super().__init__(parent, pos=canvasPos, \ size=[w*h for w,h in zip(canvasSize, cellSize)]) - self.Bind(wx.EVT_CLOSE, self.onClose) - self.Bind(wx.EVT_ENTER_WINDOW, self.onMouseWindowEvent) - self.Bind(wx.EVT_LEAVE_WINDOW, self.onMouseWindowEvent) - self.Bind(wx.EVT_LEFT_DOWN, self.onMouseEvent) - self.Bind(wx.EVT_MOTION, self.onMouseEvent) - self.Bind(wx.EVT_PAINT, self.onPaint) - self.Bind(wx.EVT_RIGHT_DOWN, self.onMouseEvent) + + self.parentFrame = parentFrame + self.canvasMap = None; self.canvasPos = canvasPos; self.canvasSize = canvasSize; + self.brushColours = [4, 1]; self.brushPos = [0, 0]; self.brushSize = [1, 1]; + self.canvasBackend = MiRCARTCanvasBackend(canvasSize, cellSize) + self.canvasCurTool = None + self.canvasJournal = MiRCARTCanvasJournal() + self.canvasStore = MiRCARTCanvasStore(parentCanvas=self) + + # Bind event handlers + self.Bind(wx.EVT_CLOSE, self.onPanelClose) + self.Bind(wx.EVT_ENTER_WINDOW, self.onPanelFocus) + self.Bind(wx.EVT_LEAVE_WINDOW, self.onPanelFocus) + self.parentFrame.Bind(wx.EVT_CHAR, self.onPanelKeyboardInput) + for eventType in( \ + wx.EVT_LEFT_DOWN, wx.EVT_MOTION, wx.EVT_RIGHT_DOWN): + self.Bind(eventType, self.onPanelMouseInput) + self.Bind(wx.EVT_PAINT, self.onPanelPaint) # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTCanvasBackend.py b/MiRCARTCanvasBackend.py new file mode 100644 index 0000000..b9381f9 --- /dev/null +++ b/MiRCARTCanvasBackend.py @@ -0,0 +1,153 @@ +#!/usr/bin/env python3 +# +# MiRCARTCanvasBackend.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from MiRCARTColours import MiRCARTColours +import wx + +class MiRCARTCanvasBackend(): + """XXX""" + _font = _brushes = _pens = None + canvasBitmap = cellSize = None + + # {{{ _drawBrushPatch(self, eventDc, patch, tmpDc): XXX + def _drawBrushPatch(self, eventDc, patch, tmpDc): + absPoint = self._xlatePoint(patch[0]) + brushFg = self._brushes[patch[1][1]] + brushBg = self._brushes[patch[1][0]] + pen = self._pens[patch[1][1]] + for dc in (eventDc, tmpDc): + dc.SetBrush(brushFg); dc.SetBackground(brushBg); dc.SetPen(pen); + dc.DrawRectangle(*absPoint, *self.cellSize) + # }}} + # {{{ _drawCharPatch(self, eventDc, patch, tmpDc): XXX + def _drawCharPatch(self, eventDc, patch, tmpDc): + absPoint = self._xlatePoint(patch[0]) + brushFg = self._brushes[patch[1][0]] + brushBg = self._brushes[patch[1][1]] + pen = self._pens[patch[1][1]] + for dc in (eventDc, tmpDc): + fontBitmap = wx.Bitmap(*self.cellSize) + fontDc = wx.MemoryDC(); fontDc.SelectObject(fontBitmap); + fontDc.SetTextForeground(wx.Colour(MiRCARTColours[patch[1][0]][0:4])) + fontDc.SetTextBackground(wx.Colour(MiRCARTColours[patch[1][1]][0:4])) + fontDc.SetBrush(brushBg); fontDc.SetBackground(brushBg); fontDc.SetPen(pen); + fontDc.SetFont(self._font) + fontDc.DrawRectangle(0, 0, *self.cellSize) + fontDc.DrawText(patch[3], 0, 0) + dc.Blit(*absPoint, *self.cellSize, fontDc, 0, 0) + # }}} + # {{{ _finiBrushesAndPens(self): XXX + def _finiBrushesAndPens(self): + for brush in self._brushes or []: + brush.Destroy() + self._brushes = None + for pen in self._pens or []: + pen.Destroy() + self._pens = None + # }}} + # {{{ _initBrushesAndPens(self): XXX + def _initBrushesAndPens(self): + self._brushes = [None for x in range(len(MiRCARTColours))] + self._pens = [None for x in range(len(MiRCARTColours))] + for mircColour in range(len(MiRCARTColours)): + self._brushes[mircColour] = wx.Brush( \ + wx.Colour(MiRCARTColours[mircColour][0:4]), wx.BRUSHSTYLE_SOLID) + self._pens[mircColour] = wx.Pen( \ + wx.Colour(MiRCARTColours[mircColour][0:4]), 1) + # }}} + # {{{ _xlatePoint(self, relMapPoint): XXX + def _xlatePoint(self, relMapPoint): + return [a*b for a,b in zip(relMapPoint, self.cellSize)] + # }}} + + # {{{ drawPatch(self, eventDc, patch, tmpDc): XXX + def drawPatch(self, eventDc, patch, tmpDc): + if patch[0][0] < self.canvasSize[0] \ + and patch[0][1] < self.canvasSize[1]: + if patch[3] == " ": + self._drawBrushPatch(eventDc, patch, tmpDc) + else: + self._drawCharPatch(eventDc, patch, tmpDc) + return True + else: + return False + # }}} + # {{{ drawCursorMaskWithJournal(self, canvasJournal, eventDc, tmpDc): XXX + def drawCursorMaskWithJournal(self, canvasJournal, eventDc, tmpDc): + for patch in canvasJournal.popCursor(): + self.drawPatch(eventDc, patch, tmpDc) + # }}} + # {{{ getDeviceContexts(self, parentWindow): XXX + def getDeviceContexts(self, parentWindow): + eventDc = wx.ClientDC(parentWindow); tmpDc = wx.MemoryDC(); + tmpDc.SelectObject(self.canvasBitmap) + return (eventDc, tmpDc) + # }}} + # {{{ reset(self, canvasSize, cellSize): + def reset(self, canvasSize, cellSize): + self.resize(canvasSize, cellSize) + # }}} + # {{{ resize(self, canvasSize, cellSize): + def resize(self, canvasSize, cellSize): + winSize = [a*b for a,b in zip(canvasSize, cellSize)] + if self.canvasBitmap == None: + self.canvasBitmap = wx.Bitmap(winSize) + else: + oldDc = wx.MemoryDC() + oldDc.SelectObject(self.canvasBitmap) + newDc = wx.MemoryDC() + newBitmap = wx.Bitmap(winSize) + newDc.SelectObject(newBitmap) + newDc.Blit(0, 0, *self.canvasBitmap.GetSize(), oldDc, 0, 0) + self.canvasBitmap = newBitmap + self.canvasSize = canvasSize; self.cellSize = cellSize; + self._font = wx.Font( \ + 8, \ + wx.FONTFAMILY_TELETYPE, \ + wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL) + # }}} + # {{{ xlateEventPoint(self, event, eventDc): XXX + def xlateEventPoint(self, event, eventDc): + eventPoint = event.GetLogicalPosition(eventDc) + rectX = eventPoint.x - (eventPoint.x % self.cellSize[0]) + rectY = eventPoint.y - (eventPoint.y % self.cellSize[1]) + mapX = int(rectX / self.cellSize[0] if rectX else 0) + mapY = int(rectY / self.cellSize[1] if rectY else 0) + return (mapX, mapY) + # }}} + + # {{{ __del__(self): destructor method + def __del__(self): + if self.canvasBitmap != None: + self.canvasBitmap.Destroy(); self.canvasBitmap = None; + self._finiBrushesAndPens() + # }}} + + # + # _init__(self, canvasSize, cellSize): initialisation method + def __init__(self, canvasSize, cellSize): + self._initBrushesAndPens() + self.reset(canvasSize, cellSize) + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTCanvasJournal.py b/MiRCARTCanvasJournal.py index 9ac34d2..17706e7 100644 --- a/MiRCARTCanvasJournal.py +++ b/MiRCARTCanvasJournal.py @@ -24,94 +24,58 @@ class MiRCARTCanvasJournal(): """XXX""" - parentCanvas = None - patchesTmp = patchesUndo = patchesUndoLevel = None + patchesCursor = patchesUndo = patchesUndoLevel = None - # {{{ _popTmp(self, eventDc, tmpDc): XXX - def _popTmp(self, eventDc, tmpDc): - if self.patchesTmp: - for patch in self.patchesTmp: - self.parentCanvas.onJournalUpdate(True, \ - patch[0], patch, eventDc, tmpDc, (0, 0), True) - self.patchesTmp = [] + # {{{ popCursor(self): XXX + def popCursor(self): + if len(self.patchesCursor): + patchesCursor = self.patchesCursor + self.patchesCursor = [] + return patchesCursor + else: + return [] # }}} - # {{{ _pushTmp(self, atPoint): XXX - def _pushTmp(self, atPoint): - self.patchesTmp.append([atPoint, None, None, None]) - # }}} - # {{{ _pushUndo(self, atPoint, patches): XXX - def _pushUndo(self, atPoint, patches): - if self.patchesUndoLevel > 0: - del self.patchesUndo[0:self.patchesUndoLevel] - self.patchesUndoLevel = 0 - patchesUndo = [] - for patch in patches: - patchesUndo.append([ \ - [patch[0], *patch[0][1:]], \ - [patch[0], *patch[1][1:]]]) - if len(patchesUndo) > 0: - self.patchesUndo.insert(0, patchesUndo) - # }}} - # {{{ merge(self, mapPatches, eventDc, tmpDc, atPoint): XXX - def merge(self, mapPatches, eventDc, tmpDc, atPoint): - patchesUndo = [] - for mapPatch in mapPatches: - mapPatchTmp = mapPatch[0] - if mapPatchTmp: - self._popTmp(eventDc, tmpDc) - for patch in mapPatch[1]: - if patch[0][0] >= self.parentCanvas.canvasSize[0] \ - or patch[0][1] >= self.parentCanvas.canvasSize[1]: - continue - elif mapPatchTmp: - self._pushTmp(patch[0]) - self.parentCanvas.onJournalUpdate(mapPatchTmp, \ - patch[0], patch, eventDc, tmpDc, (0, 0)) - else: - patchUndo = \ - self.parentCanvas.onJournalUpdate(mapPatchTmp, \ - patch[0], patch, eventDc, tmpDc, (0, 0), True) - patchesUndo.append([patchUndo, patch]) - if len(patchesUndo) > 0: - self._pushUndo(atPoint, patchesUndo) - # }}} - # {{{ redo(self): XXX - def redo(self): + # {{{ popRedo(self): XXX + def popRedo(self): if self.patchesUndoLevel > 0: self.patchesUndoLevel -= 1 - for patch in self.patchesUndo[self.patchesUndoLevel]: - self.parentCanvas.onJournalUpdate(False, \ - patch[1][0], patch[1], None, None, (0, 0)) - return True + patches = self.patchesUndo[self.patchesUndoLevel] + return patches[1] else: - return False + return [] # }}} - # {{{ reset(self): XXX - def reset(self): - self.patchesTmp = []; self.patchesUndo = [None]; self.patchesUndoLevel = 0; - # }}} - # {{{ resetCursor(self, eventDc, tmpDc): XXX - def resetCursor(self, eventDc, tmpDc): - if len(self.patchesTmp): - self._popTmp(eventDc, tmpDc) - self.patchesTmp = [] - # }}} - # {{{ undo(self): XXX - def undo(self): + # {{{ popUndo(self): XXX + def popUndo(self): if self.patchesUndo[self.patchesUndoLevel] != None: patches = self.patchesUndo[self.patchesUndoLevel] self.patchesUndoLevel += 1 - for patch in patches: - self.parentCanvas.onJournalUpdate(False, \ - patch[0][0], patch[0], None, None, (0, 0)) - return True + return patches[0] else: - return False + return [] + # }}} + # {{{ pushCursor(self, patches): XXX + def pushCursor(self, patches): + self.patchesCursor += patches + # }}} + # {{{ pushDeltas(self, undoPatches, redoPatches): XXX + def pushDeltas(self, undoPatches, redoPatches): + if self.patchesUndoLevel > 0: + del self.patchesUndo[0:self.patchesUndoLevel] + self.patchesUndoLevel = 0 + self.patchesUndo.insert(0, [undoPatches, redoPatches]) + # }}} + # {{{ resetCursor(self): XXX + def resetCursor(self): + self.patchesCursor = [] + # }}} + # {{{ resetUndo(self): XXX + def resetUndo(self): + self.patchesUndo = [None]; self.patchesUndoLevel = 0; # }}} # - # __init__(self, parentCanvas): initialisation method - def __init__(self, parentCanvas): - self.parentCanvas = parentCanvas; self.reset(); + # __init__(self): initialisation method + def __init__(self): + self.resetCursor(); self.resetUndo(); # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 7a92ebb..94f339e 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -36,7 +36,6 @@ import os, wx class MiRCARTFrame(MiRCARTGeneralFrame): """XXX""" panelCanvas = canvasPathName = None - canvasPos = canvasSize = cellSize = None # {{{ Commands # Id Type Id Labels Icon bitmap Accelerator [Initial state] @@ -57,11 +56,15 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_COPY = [0x10b, TID_COMMAND, "Copy", "&Copy", ["", wx.ART_COPY], None, False] CID_PASTE = [0x10c, TID_COMMAND, "Paste", "&Paste", ["", wx.ART_PASTE], None, False] CID_DELETE = [0x10d, TID_COMMAND, "Delete", "De&lete", ["", wx.ART_DELETE], None, False] - CID_INCRBRUSH = [0x10e, TID_COMMAND, "Increase brush size", \ + CID_INCR_CANVAS = [0x10e, TID_COMMAND, "Increase canvas size", \ + "&Increase canvas size", ["", wx.ART_PLUS], [wx.ACCEL_SHIFT, ord("+")]] + CID_DECR_CANVAS = [0x10f, TID_COMMAND, "Decrease brush size", \ + "&Decrease brush size", ["", wx.ART_MINUS], [wx.ACCEL_SHIFT, ord("-")]] + CID_INCR_BRUSH = [0x110, TID_COMMAND, "Increase brush size", \ "&Increase brush size", ["", wx.ART_PLUS], [wx.ACCEL_CTRL, ord("+")]] - CID_DECRBRUSH = [0x10f, TID_COMMAND, "Decrease brush size", \ + CID_DECR_BRUSH = [0x111, TID_COMMAND, "Decrease brush size", \ "&Decrease brush size", ["", wx.ART_MINUS], [wx.ACCEL_CTRL, ord("-")]] - CID_SOLID_BRUSH = [0x110, TID_SELECT, "Solid brush", "&Solid brush", None, None, True] + CID_SOLID_BRUSH = [0x112, TID_SELECT, "Solid brush", "&Solid brush", None, None, True] CID_RECT = [0x150, TID_SELECT, "Rectangle", "&Rectangle", ["toolRect.png"], [wx.ACCEL_CTRL, ord("R")], True] CID_CIRCLE = [0x151, TID_SELECT, "Circle", "&Circle", ["toolCircle.png"], [wx.ACCEL_CTRL, ord("C")], False] @@ -97,7 +100,8 @@ class MiRCARTFrame(MiRCARTGeneralFrame): MID_EDIT = (0x301, TID_MENU, "Edit", "&Edit", ( \ CID_UNDO, CID_REDO, NID_MENU_SEP, \ CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_MENU_SEP, \ - CID_INCRBRUSH, CID_DECRBRUSH, CID_SOLID_BRUSH)) + CID_INCR_CANVAS, CID_DECR_CANVAS, NID_MENU_SEP, \ + CID_INCR_BRUSH, CID_DECR_BRUSH, CID_SOLID_BRUSH)) MID_TOOLS = (0x302, TID_MENU, "Tools", "&Tools", ( \ CID_RECT, CID_CIRCLE, CID_LINE, CID_TEXT)) # }}} @@ -106,7 +110,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_TOOLBAR_SEP, \ CID_UNDO, CID_REDO, NID_TOOLBAR_SEP, \ CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_TOOLBAR_SEP, \ - CID_INCRBRUSH, CID_DECRBRUSH, CID_SOLID_BRUSH, NID_TOOLBAR_SEP, \ + CID_INCR_BRUSH, CID_DECR_BRUSH, NID_TOOLBAR_SEP, \ CID_RECT, CID_CIRCLE, CID_LINE, CID_TEXT, NID_TOOLBAR_SEP, \ CID_COLOUR00, CID_COLOUR01, CID_COLOUR02, CID_COLOUR03, CID_COLOUR04, \ CID_COLOUR05, CID_COLOUR06, CID_COLOUR07, CID_COLOUR08, CID_COLOUR09, \ @@ -115,7 +119,8 @@ class MiRCARTFrame(MiRCARTGeneralFrame): # }}} # {{{ Accelerators (hotkeys) AID_EDIT = (0x500, TID_ACCELS, ( \ - CID_NEW, CID_OPEN, CID_SAVE, CID_UNDO, CID_REDO, CID_INCRBRUSH, CID_DECRBRUSH)) + CID_NEW, CID_OPEN, CID_SAVE, CID_UNDO, CID_REDO, \ + CID_INCR_CANVAS, CID_INCR_BRUSH, CID_INCR_BRUSH, CID_DECR_BRUSH)) # }}} # {{{ Lists LID_ACCELS = (0x600, TID_LIST, (AID_EDIT)) @@ -177,15 +182,15 @@ class MiRCARTFrame(MiRCARTGeneralFrame): # {{{ canvasExportAsPng(self): XXX def canvasExportAsPng(self): - with wx.FileDialog(self, self.CID_SAVEAS[2], os.getcwd(), "", \ + with wx.FileDialog(self, self.CID_SAVEAS[2], os.getcwd(), "", \ "*.png", wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) as dialog: if dialog.ShowModal() == wx.ID_CANCEL: return False else: outPathName = dialog.GetPath() self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) - self.panelCanvas.canvasStore.exportBitmapToPngFile( \ - self.panelCanvas.canvasBitmap, outPathName, \ + self.panelCanvas.canvasStore.exportBitmapToPngFile( \ + self.panelCanvas.canvasBackend.canvasBitmap, outPathName, \ wx.BITMAP_TYPE_PNG) self.SetCursor(wx.Cursor(wx.NullCursor)) return True @@ -194,7 +199,8 @@ class MiRCARTFrame(MiRCARTGeneralFrame): def canvasExportImgur(self): self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) imgurResult = self.panelCanvas.canvasStore.exportBitmapToImgur( \ - "c9a6efb3d7932fd", self.panelCanvas.canvasBitmap, "", "", wx.BITMAP_TYPE_PNG) + "c9a6efb3d7932fd", self.panelCanvas.canvasBackend.canvasBitmap, \ + "", "", wx.BITMAP_TYPE_PNG) self.SetCursor(wx.Cursor(wx.NullCursor)) if imgurResult[0] == 200: if not wx.TheClipboard.IsOpened(): @@ -295,12 +301,12 @@ class MiRCARTFrame(MiRCARTGeneralFrame): return self.canvasSave() # }}} # {{{ onCanvasMotion(self, event): XXX - def onCanvasMotion(self, event, mapPoint=None): + def onCanvasMotion(self, event, atPoint=None): eventType = event.GetEventType() if eventType == wx.wxEVT_ENTER_WINDOW: - pass + self.SetFocus() elif eventType == wx.wxEVT_MOTION: - self._updateStatusBar(showPos=mapPoint) + self._updateStatusBar(showPos=atPoint) elif eventType == wx.wxEVT_LEAVE_WINDOW: pass # }}} @@ -339,9 +345,9 @@ class MiRCARTFrame(MiRCARTGeneralFrame): elif cid == self.CID_EXIT[0]: self.Close(True) elif cid == self.CID_UNDO[0]: - self.panelCanvas.undo() + self.panelCanvas.popUndo() elif cid == self.CID_REDO[0]: - self.panelCanvas.redo() + self.panelCanvas.popRedo() elif cid == self.CID_CUT[0]: pass elif cid == self.CID_COPY[0]: @@ -350,33 +356,52 @@ class MiRCARTFrame(MiRCARTGeneralFrame): pass elif cid == self.CID_DELETE[0]: pass - elif cid == self.CID_INCRBRUSH[0]: - self.panelCanvas.brushSize = \ + elif cid == self.CID_INCR_CANVAS[0] \ + or cid == self.CID_DECR_CANVAS[0]: + eventDc, tmpDc = self.panelCanvas.canvasBackend.getDeviceContexts(self) + if cid == self.CID_INCR_CANVAS[0]: + newCanvasSize = [a+1 for a in self.panelCanvas.canvasSize] + else: + newCanvasSize = [a-1 if a > 1 else a for a in self.panelCanvas.canvasSize] + self.panelCanvas.resize(newCanvasSize) + self.panelCanvas.canvasBackend.resize( \ + newCanvasSize, \ + self.panelCanvas.canvasBackend.cellSize) + for numRow in range(self.panelCanvas.canvasSize[1] - 1): + self.panelCanvas.canvasMap.append([[1, 1], 0, " "]) + self.panelCanvas.canvasMap.append([]) + for numCol in range(self.panelCanvas.canvasSize[0]): + self.panelCanvas.canvasMap[-1].append([[1, 1], 0, " "]) + self.panelCanvas.canvasBackend.drawPatch(eventDc, \ + ([numCol, self.panelCanvas.canvasSize[1] - 1], *[[1, 1], 0, " "]), tmpDc) + wx.SafeYield() + elif cid == self.CID_INCR_BRUSH[0]: + self.panelCanvas.brushSize = \ [a+1 for a in self.panelCanvas.brushSize] - elif cid == self.CID_DECRBRUSH[0] \ - and self.panelCanvas.brushSize[0] > 1 \ + elif cid == self.CID_DECR_BRUSH[0] \ + and self.panelCanvas.brushSize[0] > 1 \ and self.panelCanvas.brushSize[1] > 1: - self.panelCanvas.brushSize = \ + self.panelCanvas.brushSize = \ [a-1 for a in self.panelCanvas.brushSize] elif cid == self.CID_SOLID_BRUSH[0]: pass elif cid == self.CID_RECT[0]: self.menuItemsById[cid].Check(True) - self.panelCanvas.canvasCurTool = \ + self.panelCanvas.canvasCurTool = \ MiRCARTToolRect(self.panelCanvas) elif cid == self.CID_CIRCLE[0]: self.menuItemsById[cid].Check(True) - self.panelCanvas.canvasCurTool = \ + self.panelCanvas.canvasCurTool = \ MiRCARTToolCircle(self.panelCanvas) elif cid == self.CID_LINE[0]: self.menuItemsById[cid].Check(True) - self.panelCanvas.canvasCurTool = \ + self.panelCanvas.canvasCurTool = \ MiRCARTToolLine(self.panelCanvas) elif cid == self.CID_TEXT[0]: self.menuItemsById[cid].Check(True) - self.panelCanvas.canvasCurTool = \ + self.panelCanvas.canvasCurTool = \ MiRCARTToolText(self.panelCanvas) - elif cid >= self.CID_COLOUR00[0] \ + elif cid >= self.CID_COLOUR00[0] \ and cid <= self.CID_COLOUR15[0]: numColour = cid - self.CID_COLOUR00[0] if event.GetEventType() == wx.wxEVT_TOOL: @@ -392,15 +417,13 @@ class MiRCARTFrame(MiRCARTGeneralFrame): # }}} # - # __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), canvasSize=(100, 30), cellSize=(7, 14)): initialisation method - def __init__(self, parent, appSize=(800, 600), canvasPos=(25, 50), canvasSize=(100, 30), cellSize=(7, 14)): + # __init__(self, parent, appSize=(840, 630), canvasPos=(25, 50), canvasSize=(125, 35), cellSize=(7, 14)): initialisation method + def __init__(self, parent, appSize=(840, 630), canvasPos=(25, 50), canvasSize=(125, 35), cellSize=(7, 14)): self._initPaletteToolBitmaps() panelSkin = super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) - self.canvasPos = canvasPos; self.cellSize = cellSize; self.canvasSize = canvasSize; self.canvasPathName = None self.panelCanvas = MiRCARTCanvas(panelSkin, parentFrame=self, \ - canvasPos=self.canvasPos, canvasSize=self.canvasSize, \ - cellSize=self.cellSize) + canvasPos=canvasPos, canvasSize=canvasSize, cellSize=cellSize) self.panelCanvas.canvasCurTool = MiRCARTToolRect(self.panelCanvas) self.canvasNew() diff --git a/MiRCARTToPngFile.py b/MiRCARTToPngFile.py index cf6e7de..78ef788 100755 --- a/MiRCARTToPngFile.py +++ b/MiRCARTToPngFile.py @@ -24,7 +24,7 @@ import MiRCARTCanvasStore from PIL import Image, ImageDraw, ImageFont -import string, sys +import sys class MiRCARTToPngFile: """XXX""" diff --git a/MiRCARTTool.py b/MiRCARTTool.py index ae91e6d..be8758c 100644 --- a/MiRCARTTool.py +++ b/MiRCARTTool.py @@ -26,9 +26,13 @@ class MiRCARTTool(): """XXX""" parentCanvas = None + # {{{ onKeyboardEvent(self, event, atPoint, brushColours, brushSize, keyChar): + def onKeyboardEvent(self, event, atPoint, brushColours, brushSize, keyChar): + return () + # }}} # {{{ onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): XXX def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): - pass + return () # }}} # diff --git a/MiRCARTToolRect.py b/MiRCARTToolRect.py index d2452c5..a4e9662 100644 --- a/MiRCARTToolRect.py +++ b/MiRCARTToolRect.py @@ -37,9 +37,12 @@ class MiRCARTToolRect(MiRCARTTool): brushColours[0] = brushColours[1] else: brushColours[1] = brushColours[0] + brushSize = brushSize.copy() + if brushSize[0] > 1: + brushSize[0] *= 2 brushPatches = [] for brushRow in range(brushSize[1]): - for brushCol in range(brushSize[0] * 2): + for brushCol in range(brushSize[0]): brushPatches.append([[ \ atPoint[0] + brushCol, \ atPoint[1] + brushRow], \ diff --git a/MiRCARTToolText.py b/MiRCARTToolText.py index 9fd18ab..8f1be6d 100644 --- a/MiRCARTToolText.py +++ b/MiRCARTToolText.py @@ -23,30 +23,45 @@ # from MiRCARTTool import MiRCARTTool +import string class MiRCARTToolText(MiRCARTTool): """XXX""" + textColours = textPos = None + + # + # onKeyboardEvent(self, event, atPoint, brushColours, brushSize, keyChar): XXX + def onKeyboardEvent(self, event, atPoint, brushColours, brushSize, keyChar): + if not keyChar in string.printable: + return [] + else: + if self.textColours == None: + self.textColours = brushColours.copy() + if self.textPos == None: + self.textPos = list(atPoint) + patches = [[False, [[self.textPos, self.textColours, 0, keyChar]]]] + if self.textPos[0] < (self.parentCanvas.canvasSize[0] - 1): + self.textPos[0] += 1 + elif self.textPos[1] < (self.parentCanvas.canvasSize[1] - 1): + self.textPos[0] = 0 + self.textPos[1] += 1 + else: + self.textPos = [0, 0] + return patches # # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): XXX def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): - brushColours = brushColours.copy() if isLeftDown: - brushColours[1] = brushColours[0] + self.textColours = brushColours.copy() + self.textPos = list(atPoint) elif isRightDown: - brushColours[0] = brushColours[1] + self.textColours = [brushColours[1], brushColours[0]] + self.textPos = list(atPoint) else: - brushColours[1] = brushColours[0] - brushPatches = [] - for brushRow in range(brushSize[1]): - for brushCol in range(brushSize[0] * 2): - brushPatches.append([[ \ - atPoint[0] + brushCol, \ - atPoint[1] + brushRow], \ - brushColours, 0, " "]) - if isLeftDown or isRightDown: - return [[False, brushPatches], [True, brushPatches]] - else: - return [[True, brushPatches]] + if self.textColours == None: + self.textColours = brushColours.copy() + self.textPos = list(atPoint) + return [[True, [[self.textPos, self.textColours, 0, "_"]]]] # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 From cc64e955e90a7f5f088527b25706ef1e19331adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 9 Jan 2018 04:02:17 +0100 Subject: [PATCH 089/148] MiRCART.png: updates screenshot. MiRCARTCanvas.py:onPanelKeyboardInput(): only handle {no,shift}-modifier keyboard events. MiRCARTFrame.py: fix {de,in}crease canvas size accelerators (hotkeys.) --- MiRCART.png | Bin 35691 -> 43602 bytes MiRCARTCanvas.py | 4 +++- MiRCARTFrame.py | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/MiRCART.png b/MiRCART.png index 26cfcdf0a23fb17135c6c8066bd1bb9543941e20..8db9e9391678888bc477891c71e9622f2e83cb58 100644 GIT binary patch literal 43602 zcmdqJ2U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ventDc, tmpDc = self.canvasBackend.getDeviceContexts(self) tool = self.canvasCurTool; mapPoint = self.brushPos; - if event.GetModifiers() != wx.MOD_NONE: + keyModifiers = event.GetModifiers() + if keyModifiers != wx.MOD_NONE \ + and keyModifiers != wx.MOD_SHIFT: event.Skip() else: patches = tool.onKeyboardEvent( \ diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 94f339e..9d1f612 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -57,9 +57,9 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_PASTE = [0x10c, TID_COMMAND, "Paste", "&Paste", ["", wx.ART_PASTE], None, False] CID_DELETE = [0x10d, TID_COMMAND, "Delete", "De&lete", ["", wx.ART_DELETE], None, False] CID_INCR_CANVAS = [0x10e, TID_COMMAND, "Increase canvas size", \ - "&Increase canvas size", ["", wx.ART_PLUS], [wx.ACCEL_SHIFT, ord("+")]] - CID_DECR_CANVAS = [0x10f, TID_COMMAND, "Decrease brush size", \ - "&Decrease brush size", ["", wx.ART_MINUS], [wx.ACCEL_SHIFT, ord("-")]] + "I&ncrease canvas size", ["", wx.ART_PLUS], [wx.ACCEL_ALT, ord("+")]] + CID_DECR_CANVAS = [0x10f, TID_COMMAND, "Decrease canvas size", \ + "D&ecrease canvas size", ["", wx.ART_MINUS], [wx.ACCEL_ALT, ord("-")]] CID_INCR_BRUSH = [0x110, TID_COMMAND, "Increase brush size", \ "&Increase brush size", ["", wx.ART_PLUS], [wx.ACCEL_CTRL, ord("+")]] CID_DECR_BRUSH = [0x111, TID_COMMAND, "Decrease brush size", \ @@ -120,7 +120,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): # {{{ Accelerators (hotkeys) AID_EDIT = (0x500, TID_ACCELS, ( \ CID_NEW, CID_OPEN, CID_SAVE, CID_UNDO, CID_REDO, \ - CID_INCR_CANVAS, CID_INCR_BRUSH, CID_INCR_BRUSH, CID_DECR_BRUSH)) + CID_INCR_CANVAS, CID_DECR_CANVAS, CID_INCR_BRUSH, CID_DECR_BRUSH)) # }}} # {{{ Lists LID_ACCELS = (0x600, TID_LIST, (AID_EDIT)) From 674afe9bfaec0ba29dcd7ee3b43adc6da1b24730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 9 Jan 2018 05:07:04 +0100 Subject: [PATCH 090/148] MiRCARTCanvas.py: enable double buffering to eliminate brush flickering. --- MiRCARTCanvas.py | 1 + 1 file changed, 1 insertion(+) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index db8d440..b2e0021 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -178,6 +178,7 @@ class MiRCARTCanvas(wx.Panel): def __init__(self, parent, parentFrame, canvasPos, canvasSize, cellSize): super().__init__(parent, pos=canvasPos, \ size=[w*h for w,h in zip(canvasSize, cellSize)]) + self.SetDoubleBuffered(True) self.parentFrame = parentFrame self.canvasMap = None; self.canvasPos = canvasPos; self.canvasSize = canvasSize; From 45dae7798a6770aeaada8d4eebc4b9af65fc07a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 9 Jan 2018 21:19:14 +0100 Subject: [PATCH 091/148] MiRCARTGeneralFrame.py: prepend script execution directory when loading toolbar item bitmaps. --- MiRCARTGeneralFrame.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/MiRCARTGeneralFrame.py b/MiRCARTGeneralFrame.py index 7bdf00a..7274af5 100644 --- a/MiRCARTGeneralFrame.py +++ b/MiRCARTGeneralFrame.py @@ -22,7 +22,7 @@ # SOFTWARE. # -import os, wx +import os, sys, wx # # Types @@ -108,10 +108,11 @@ class MiRCARTGeneralFrame(wx.Frame): and toolBarItem[4][1] == None: toolBarItem[4] = ["", None, toolBarItem[4][2]] elif toolBarItem[4][0] != "": + toolBitmapPathName = os.path.dirname(sys.argv[0]) + toolBitmapPathName = os.path.join(toolBitmapPathName, \ + "assets", toolBarItem[4][0]) toolBitmap = wx.Bitmap((16,16)) - toolBitmap.LoadFile( \ - os.path.join("assets", toolBarItem[4][0]), \ - wx.BITMAP_TYPE_ANY) + toolBitmap.LoadFile(toolBitmapPathName, wx.BITMAP_TYPE_ANY) toolBarItem[4] = ["", None, toolBitmap] # }}} # {{{ onClose(self, event): XXX From 317ed41b139db50a984b518ff2f3c022956513ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 9 Jan 2018 21:37:58 +0100 Subject: [PATCH 092/148] MiRCARTCanvasBackend.py: only update device context brushes & pen if necessary. --- MiRCARTCanvasBackend.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/MiRCARTCanvasBackend.py b/MiRCARTCanvasBackend.py index b9381f9..34459db 100644 --- a/MiRCARTCanvasBackend.py +++ b/MiRCARTCanvasBackend.py @@ -28,6 +28,7 @@ import wx class MiRCARTCanvasBackend(): """XXX""" _font = _brushes = _pens = None + _lastBrush = _lastPen = None canvasBitmap = cellSize = None # {{{ _drawBrushPatch(self, eventDc, patch, tmpDc): XXX @@ -36,9 +37,9 @@ class MiRCARTCanvasBackend(): brushFg = self._brushes[patch[1][1]] brushBg = self._brushes[patch[1][0]] pen = self._pens[patch[1][1]] - for dc in (eventDc, tmpDc): - dc.SetBrush(brushFg); dc.SetBackground(brushBg); dc.SetPen(pen); - dc.DrawRectangle(*absPoint, *self.cellSize) + self._setBrushDc(brushBg, brushFg, (eventDc, tmpDc), pen) + eventDc.DrawRectangle(*absPoint, *self.cellSize) + tmpDc.DrawRectangle(*absPoint, *self.cellSize) # }}} # {{{ _drawCharPatch(self, eventDc, patch, tmpDc): XXX def _drawCharPatch(self, eventDc, patch, tmpDc): @@ -65,6 +66,7 @@ class MiRCARTCanvasBackend(): for pen in self._pens or []: pen.Destroy() self._pens = None + self._lastBrushBg = self._lastBrushFg = self._lastPen = None; # }}} # {{{ _initBrushesAndPens(self): XXX def _initBrushesAndPens(self): @@ -75,6 +77,22 @@ class MiRCARTCanvasBackend(): wx.Colour(MiRCARTColours[mircColour][0:4]), wx.BRUSHSTYLE_SOLID) self._pens[mircColour] = wx.Pen( \ wx.Colour(MiRCARTColours[mircColour][0:4]), 1) + self._lastBrushBg = self._lastBrushFg = self._lastPen = None; + # }}} + # {{{ _setBrushDc(self, brushBg, brushFg, dcList, pen): XXX + def _setBrushDc(self, brushBg, brushFg, dcList, pen): + if self._lastBrushBg != brushBg: + for dc in dcList: + dc.SetBackground(brushBg) + self._lastBrushBg = brushBg + if self._lastBrushFg != brushFg: + for dc in dcList: + dc.SetBrush(brushFg) + self._lastBrushFg = brushFg + if self._lastPen != pen: + for dc in dcList: + dc.SetPen(pen) + self._lastPen = pen # }}} # {{{ _xlatePoint(self, relMapPoint): XXX def _xlatePoint(self, relMapPoint): @@ -102,6 +120,7 @@ class MiRCARTCanvasBackend(): def getDeviceContexts(self, parentWindow): eventDc = wx.ClientDC(parentWindow); tmpDc = wx.MemoryDC(); tmpDc.SelectObject(self.canvasBitmap) + self._lastBrushBg = self._lastBrushFg = self._lastPen = None; return (eventDc, tmpDc) # }}} # {{{ reset(self, canvasSize, cellSize): From d3e67a7c18cde94e134ca3bcce47178164702bb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 9 Jan 2018 22:23:27 +0100 Subject: [PATCH 093/148] MiRCART{Canvas{,Backend},Frame}.py: replace MemoryDC() w/ BufferedDC(canvasBitmap). --- MiRCARTCanvas.py | 37 ++++++++++----------- MiRCARTCanvasBackend.py | 72 ++++++++++++++++++++--------------------- MiRCARTFrame.py | 4 +-- 3 files changed, 55 insertions(+), 58 deletions(-) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index b2e0021..c1855a3 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -39,15 +39,15 @@ class MiRCARTCanvas(wx.Panel): def _commitPatch(self, patch): self.canvasMap[patch[0][1]][patch[0][0]] = patch[1:] # }}} - # {{{ _dispatchInput(self, eventDc, patches, tmpDc): XXX - def _dispatchInput(self, eventDc, patches, tmpDc): + # {{{ _dispatchInput(self, eventDc, patches): XXX + def _dispatchInput(self, eventDc, patches): self.canvasBackend.drawCursorMaskWithJournal( \ - self.canvasJournal, eventDc, tmpDc) + self.canvasJournal, eventDc) cursorPatches = []; undoPatches = []; newPatches = []; for patchDescr in patches: patchIsCursor = patchDescr[0] for patch in patchDescr[1]: - if self.canvasBackend.drawPatch(eventDc, patch, tmpDc) == False: + if self.canvasBackend.drawPatch(eventDc, patch) == False: continue else: patchDeltaCell = self.canvasMap[patch[0][1]][patch[0][0]] @@ -69,7 +69,7 @@ class MiRCARTCanvas(wx.Panel): # }}} # {{{ onPanelKeyboardInput(self, event): XXX def onPanelKeyboardInput(self, event): - eventDc, tmpDc = self.canvasBackend.getDeviceContexts(self) + eventDc = self.canvasBackend.getDeviceContext(self) tool = self.canvasCurTool; mapPoint = self.brushPos; keyModifiers = event.GetModifiers() if keyModifiers != wx.MOD_NONE \ @@ -80,12 +80,12 @@ class MiRCARTCanvas(wx.Panel): event, mapPoint, self.brushColours, self.brushSize, \ chr(event.GetUnicodeKey())) if len(patches): - self._dispatchInput(eventDc, patches, tmpDc) + self._dispatchInput(eventDc, patches) self.parentFrame.onCanvasUpdate() # }}} # {{{ onPanelMouseInput(self, event): XXX def onPanelMouseInput(self, event): - eventDc, tmpDc = self.canvasBackend.getDeviceContexts(self) + eventDc = self.canvasBackend.getDeviceContext(self) tool = self.canvasCurTool self.brushPos = mapPoint = \ self.canvasBackend.xlateEventPoint(event, eventDc) @@ -93,23 +93,21 @@ class MiRCARTCanvas(wx.Panel): event, mapPoint, self.brushColours, self.brushSize, \ event.Dragging(), event.LeftIsDown(), event.RightIsDown()) if len(patches): - self._dispatchInput(eventDc, patches, tmpDc) + self._dispatchInput(eventDc, patches) self.parentFrame.onCanvasUpdate() self.parentFrame.onCanvasMotion(event, mapPoint) # }}} # {{{ onPanelFocus(self, event): XXX def onPanelFocus(self, event): if event.GetEventType() == wx.wxEVT_LEAVE_WINDOW: - eventDc, tmpDc = \ - self.canvasBackend.getDeviceContexts(self) + eventDc = self.canvasBackend.getDeviceContext(self) self.canvasBackend.drawCursorMaskWithJournal( \ - self.canvasJournal, eventDc, tmpDc) + self.canvasJournal, eventDc) self.parentFrame.onCanvasMotion(event) # }}} # {{{ onPanelPaint(self, event): XXX def onPanelPaint(self, event): - if self.canvasBackend.canvasBitmap != None: - eventDc = wx.BufferedPaintDC(self, self.canvasBackend.canvasBitmap) + self.canvasBackend.onPanelPaintEvent(self, event) # }}} # {{{ onStoreUpdate(self, newCanvasSize, newCanvas=None): def onStoreUpdate(self, newCanvasSize, newCanvas=None): @@ -119,7 +117,7 @@ class MiRCARTCanvas(wx.Panel): self.canvasMap = [[[(1, 1), 0, " "] \ for x in range(self.canvasSize[0])] \ for y in range(self.canvasSize[1])] - eventDc, tmpDc = self.canvasBackend.getDeviceContexts(self) + eventDc = self.canvasBackend.getDeviceContext(self) for numRow in range(self.canvasSize[1]): for numCol in range(self.canvasSize[0]): if newCanvas != None \ @@ -129,15 +127,15 @@ class MiRCARTCanvas(wx.Panel): [numCol, numRow], *newCanvas[numRow][numCol]]) self.canvasBackend.drawPatch(eventDc, \ ([numCol, numRow], \ - *self.canvasMap[numRow][numCol]), tmpDc) + *self.canvasMap[numRow][numCol])) wx.SafeYield() # }}} # {{{ popRedo(self): def popRedo(self): - eventDc, tmpDc = self.canvasBackend.getDeviceContexts(self) + eventDc = self.canvasBackend.getDeviceContext(self) patches = self.canvasJournal.popRedo() for patch in patches: - if self.canvasBackend.drawPatch(eventDc, patch, tmpDc) == False: + if self.canvasBackend.drawPatch(eventDc, patch) == False: continue else: self._commitPatch(patch) @@ -145,10 +143,10 @@ class MiRCARTCanvas(wx.Panel): # }}} # {{{ popUndo(self): def popUndo(self): - eventDc, tmpDc = self.canvasBackend.getDeviceContexts(self) + eventDc = self.canvasBackend.getDeviceContext(self) patches = self.canvasJournal.popUndo() for patch in patches: - if self.canvasBackend.drawPatch(eventDc, patch, tmpDc) == False: + if self.canvasBackend.drawPatch(eventDc, patch) == False: continue else: self._commitPatch(patch) @@ -178,7 +176,6 @@ class MiRCARTCanvas(wx.Panel): def __init__(self, parent, parentFrame, canvasPos, canvasSize, cellSize): super().__init__(parent, pos=canvasPos, \ size=[w*h for w,h in zip(canvasSize, cellSize)]) - self.SetDoubleBuffered(True) self.parentFrame = parentFrame self.canvasMap = None; self.canvasPos = canvasPos; self.canvasSize = canvasSize; diff --git a/MiRCARTCanvasBackend.py b/MiRCARTCanvasBackend.py index 34459db..192cc13 100644 --- a/MiRCARTCanvasBackend.py +++ b/MiRCARTCanvasBackend.py @@ -31,32 +31,30 @@ class MiRCARTCanvasBackend(): _lastBrush = _lastPen = None canvasBitmap = cellSize = None - # {{{ _drawBrushPatch(self, eventDc, patch, tmpDc): XXX - def _drawBrushPatch(self, eventDc, patch, tmpDc): + # {{{ _drawBrushPatch(self, eventDc, patch): XXX + def _drawBrushPatch(self, eventDc, patch): absPoint = self._xlatePoint(patch[0]) brushFg = self._brushes[patch[1][1]] brushBg = self._brushes[patch[1][0]] pen = self._pens[patch[1][1]] - self._setBrushDc(brushBg, brushFg, (eventDc, tmpDc), pen) + self._setBrushDc(brushBg, brushFg, eventDc, pen) eventDc.DrawRectangle(*absPoint, *self.cellSize) - tmpDc.DrawRectangle(*absPoint, *self.cellSize) # }}} - # {{{ _drawCharPatch(self, eventDc, patch, tmpDc): XXX - def _drawCharPatch(self, eventDc, patch, tmpDc): + # {{{ _drawCharPatch(self, eventDc, patch): XXX + def _drawCharPatch(self, eventDc, patch): absPoint = self._xlatePoint(patch[0]) brushFg = self._brushes[patch[1][0]] brushBg = self._brushes[patch[1][1]] pen = self._pens[patch[1][1]] - for dc in (eventDc, tmpDc): - fontBitmap = wx.Bitmap(*self.cellSize) - fontDc = wx.MemoryDC(); fontDc.SelectObject(fontBitmap); - fontDc.SetTextForeground(wx.Colour(MiRCARTColours[patch[1][0]][0:4])) - fontDc.SetTextBackground(wx.Colour(MiRCARTColours[patch[1][1]][0:4])) - fontDc.SetBrush(brushBg); fontDc.SetBackground(brushBg); fontDc.SetPen(pen); - fontDc.SetFont(self._font) - fontDc.DrawRectangle(0, 0, *self.cellSize) - fontDc.DrawText(patch[3], 0, 0) - dc.Blit(*absPoint, *self.cellSize, fontDc, 0, 0) + fontBitmap = wx.Bitmap(*self.cellSize) + fontDc = wx.MemoryDC(); fontDc.SelectObject(fontBitmap); + fontDc.SetTextForeground(wx.Colour(MiRCARTColours[patch[1][0]][0:4])) + fontDc.SetTextBackground(wx.Colour(MiRCARTColours[patch[1][1]][0:4])) + fontDc.SetBrush(brushBg); fontDc.SetBackground(brushBg); fontDc.SetPen(pen); + fontDc.SetFont(self._font) + fontDc.DrawRectangle(0, 0, *self.cellSize) + fontDc.DrawText(patch[3], 0, 0) + eventDc.Blit(*absPoint, *self.cellSize, fontDc, 0, 0) # }}} # {{{ _finiBrushesAndPens(self): XXX def _finiBrushesAndPens(self): @@ -79,19 +77,16 @@ class MiRCARTCanvasBackend(): wx.Colour(MiRCARTColours[mircColour][0:4]), 1) self._lastBrushBg = self._lastBrushFg = self._lastPen = None; # }}} - # {{{ _setBrushDc(self, brushBg, brushFg, dcList, pen): XXX - def _setBrushDc(self, brushBg, brushFg, dcList, pen): + # {{{ _setBrushDc(self, brushBg, brushFg, dc, pen): XXX + def _setBrushDc(self, brushBg, brushFg, dc, pen): if self._lastBrushBg != brushBg: - for dc in dcList: - dc.SetBackground(brushBg) + dc.SetBackground(brushBg) self._lastBrushBg = brushBg if self._lastBrushFg != brushFg: - for dc in dcList: - dc.SetBrush(brushFg) + dc.SetBrush(brushFg) self._lastBrushFg = brushFg if self._lastPen != pen: - for dc in dcList: - dc.SetPen(pen) + dc.SetPen(pen) self._lastPen = pen # }}} # {{{ _xlatePoint(self, relMapPoint): XXX @@ -99,29 +94,34 @@ class MiRCARTCanvasBackend(): return [a*b for a,b in zip(relMapPoint, self.cellSize)] # }}} - # {{{ drawPatch(self, eventDc, patch, tmpDc): XXX - def drawPatch(self, eventDc, patch, tmpDc): + # {{{ drawPatch(self, eventDc, patch): XXX + def drawPatch(self, eventDc, patch): if patch[0][0] < self.canvasSize[0] \ and patch[0][1] < self.canvasSize[1]: if patch[3] == " ": - self._drawBrushPatch(eventDc, patch, tmpDc) + self._drawBrushPatch(eventDc, patch) else: - self._drawCharPatch(eventDc, patch, tmpDc) + self._drawCharPatch(eventDc, patch) return True else: return False # }}} - # {{{ drawCursorMaskWithJournal(self, canvasJournal, eventDc, tmpDc): XXX - def drawCursorMaskWithJournal(self, canvasJournal, eventDc, tmpDc): + # {{{ drawCursorMaskWithJournal(self, canvasJournal, eventDc): XXX + def drawCursorMaskWithJournal(self, canvasJournal, eventDc): for patch in canvasJournal.popCursor(): - self.drawPatch(eventDc, patch, tmpDc) + self.drawPatch(eventDc, patch) # }}} - # {{{ getDeviceContexts(self, parentWindow): XXX - def getDeviceContexts(self, parentWindow): - eventDc = wx.ClientDC(parentWindow); tmpDc = wx.MemoryDC(); - tmpDc.SelectObject(self.canvasBitmap) + # {{{ getDeviceContext(self, parentWindow): XXX + def getDeviceContext(self, parentWindow): + eventDc = wx.BufferedDC( \ + wx.ClientDC(parentWindow), self.canvasBitmap) self._lastBrushBg = self._lastBrushFg = self._lastPen = None; - return (eventDc, tmpDc) + return eventDc + # }}} + # {{{ onPanelPaintEvent(self, panelWindow, panelEvent): XXX + def onPanelPaintEvent(self, panelWindow, panelEvent): + if self.canvasBitmap != None: + eventDc = wx.BufferedPaintDC(panelWindow, self.canvasBitmap) # }}} # {{{ reset(self, canvasSize, cellSize): def reset(self, canvasSize, cellSize): diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 9d1f612..ba280b6 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -358,7 +358,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): pass elif cid == self.CID_INCR_CANVAS[0] \ or cid == self.CID_DECR_CANVAS[0]: - eventDc, tmpDc = self.panelCanvas.canvasBackend.getDeviceContexts(self) + eventDc = self.panelCanvas.canvasBackend.getDeviceContext(self) if cid == self.CID_INCR_CANVAS[0]: newCanvasSize = [a+1 for a in self.panelCanvas.canvasSize] else: @@ -373,7 +373,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): for numCol in range(self.panelCanvas.canvasSize[0]): self.panelCanvas.canvasMap[-1].append([[1, 1], 0, " "]) self.panelCanvas.canvasBackend.drawPatch(eventDc, \ - ([numCol, self.panelCanvas.canvasSize[1] - 1], *[[1, 1], 0, " "]), tmpDc) + ([numCol, self.panelCanvas.canvasSize[1] - 1], *[[1, 1], 0, " "])) wx.SafeYield() elif cid == self.CID_INCR_BRUSH[0]: self.panelCanvas.brushSize = \ From bbec7d1eb105381c9cff7a70ec4155c43509fc28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 10 Jan 2018 00:25:42 +0100 Subject: [PATCH 094/148] MiRCARTCanvas{,Journal,Store}.py: dispatch patches from tool event handlers directly. MiRCARTTool{,Circle,Line,Rect,Text}.py: updated to new interface. --- MiRCARTCanvas.py | 173 ++++++++++++++++++---------------------- MiRCARTCanvasJournal.py | 11 ++- MiRCARTCanvasStore.py | 5 +- MiRCARTTool.py | 10 +-- MiRCARTToolCircle.py | 17 ++-- MiRCARTToolLine.py | 29 ++++--- MiRCARTToolRect.py | 18 ++--- MiRCARTToolText.py | 24 +++--- 8 files changed, 138 insertions(+), 149 deletions(-) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index c1855a3..ceef200 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -35,88 +35,79 @@ class MiRCARTCanvas(wx.Panel): brushColours = brushPos = brushSize = None canvasBackend = canvasCurTool = canvasJournal = canvasStore = None - # {{{ _commitPatch(self, patch): + # {{{ _commitPatch(self, patch): XXX def _commitPatch(self, patch): self.canvasMap[patch[0][1]][patch[0][0]] = patch[1:] # }}} - # {{{ _dispatchInput(self, eventDc, patches): XXX - def _dispatchInput(self, eventDc, patches): - self.canvasBackend.drawCursorMaskWithJournal( \ - self.canvasJournal, eventDc) - cursorPatches = []; undoPatches = []; newPatches = []; - for patchDescr in patches: - patchIsCursor = patchDescr[0] - for patch in patchDescr[1]: - if self.canvasBackend.drawPatch(eventDc, patch) == False: - continue - else: - patchDeltaCell = self.canvasMap[patch[0][1]][patch[0][0]] - if patchIsCursor == True: - cursorPatches.append([list(patch[0]), *patchDeltaCell.copy()]) - else: - undoPatches.append([list(patch[0]), *patchDeltaCell.copy()]) - newPatches.append(patch) - self._commitPatch(patch) - if len(cursorPatches): - self.canvasJournal.pushCursor(cursorPatches) - if len(undoPatches): - self.canvasJournal.pushDeltas(undoPatches, newPatches) + # {{{ _dispatchDeltaPatches(self, deltaPatches): XXX + def _dispatchDeltaPatches(self, deltaPatches): + eventDc = self.canvasBackend.getDeviceContext(self) + for patch in deltaPatches: + if self.canvasBackend.drawPatch(eventDc, patch): + self._commitPatch(patch) + self.parentFrame.onCanvasUpdate() + # }}} + # {{{ _dispatchPatch(self, eventDc, isCursor, patch): XXX + def _dispatchPatch(self, eventDc, isCursor, patch): + if not self._canvasDirtyCursor: + self.canvasBackend.drawCursorMaskWithJournal( \ + self.canvasJournal, eventDc) + self._canvasDirtyCursor = True + if self.canvasBackend.drawPatch(eventDc, patch): + patchDeltaCell = self.canvasMap[patch[0][1]][patch[0][0]] + patchDelta = [list(patch[0]), *patchDeltaCell.copy()] + if isCursor: + self.canvasJournal.pushCursor(patchDelta) + else: + if not self._canvasDirty: + self.canvasJournal.pushDeltas([], []) + self._canvasDirty = True + self.canvasJournal.updateCurrentDeltas(patchDelta, patch) + self._commitPatch(patch) # }}} # {{{ onPanelClose(self, event): XXX def onPanelClose(self, event): self.Destroy() # }}} - # {{{ onPanelKeyboardInput(self, event): XXX - def onPanelKeyboardInput(self, event): - eventDc = self.canvasBackend.getDeviceContext(self) - tool = self.canvasCurTool; mapPoint = self.brushPos; - keyModifiers = event.GetModifiers() - if keyModifiers != wx.MOD_NONE \ - and keyModifiers != wx.MOD_SHIFT: - event.Skip() - else: - patches = tool.onKeyboardEvent( \ - event, mapPoint, self.brushColours, self.brushSize, \ - chr(event.GetUnicodeKey())) - if len(patches): - self._dispatchInput(eventDc, patches) - self.parentFrame.onCanvasUpdate() - # }}} - # {{{ onPanelMouseInput(self, event): XXX - def onPanelMouseInput(self, event): + # {{{ onPanelInput(self, event): XXX + def onPanelInput(self, event): eventDc = self.canvasBackend.getDeviceContext(self) + eventType = event.GetEventType() + self._canvasDirty = self._canvasDirtyCursor = False tool = self.canvasCurTool - self.brushPos = mapPoint = \ - self.canvasBackend.xlateEventPoint(event, eventDc) - patches = tool.onMouseEvent( \ - event, mapPoint, self.brushColours, self.brushSize, \ - event.Dragging(), event.LeftIsDown(), event.RightIsDown()) - if len(patches): - self._dispatchInput(eventDc, patches) + if eventType == wx.wxEVT_CHAR: + mapPoint = self.brushPos + doSkip = tool.onKeyboardEvent( \ + event, mapPoint, self.brushColours, self.brushSize, \ + chr(event.GetUnicodeKey()), self._dispatchPatch, eventDc) + if doSkip: + event.Skip(); return; + else: + mapPoint = self.canvasBackend.xlateEventPoint(event, eventDc) + self.brushPos = mapPoint + tool.onMouseEvent( \ + event, mapPoint, self.brushColours, self.brushSize, \ + event.Dragging(), event.LeftIsDown(), event.RightIsDown(), \ + self._dispatchPatch, eventDc) + if self._canvasDirty: self.parentFrame.onCanvasUpdate() self.parentFrame.onCanvasMotion(event, mapPoint) # }}} - # {{{ onPanelFocus(self, event): XXX - def onPanelFocus(self, event): - if event.GetEventType() == wx.wxEVT_LEAVE_WINDOW: - eventDc = self.canvasBackend.getDeviceContext(self) - self.canvasBackend.drawCursorMaskWithJournal( \ - self.canvasJournal, eventDc) + # {{{ onPanelLeaveWindow(self, event): XXX + def onPanelLeaveWindow(self, event): + eventDc = self.canvasBackend.getDeviceContext(self) + self.canvasBackend.drawCursorMaskWithJournal( \ + self.canvasJournal, eventDc) self.parentFrame.onCanvasMotion(event) # }}} # {{{ onPanelPaint(self, event): XXX def onPanelPaint(self, event): self.canvasBackend.onPanelPaintEvent(self, event) # }}} - # {{{ onStoreUpdate(self, newCanvasSize, newCanvas=None): + # {{{ onStoreUpdate(self, newCanvasSize, newCanvas=None): XXX def onStoreUpdate(self, newCanvasSize, newCanvas=None): self.resize(newCanvasSize=newCanvasSize) - self.canvasBackend.reset(self.canvasSize, self.canvasBackend.cellSize) - self.canvasJournal.resetCursor(); self.canvasJournal.resetUndo(); - self.canvasMap = [[[(1, 1), 0, " "] \ - for x in range(self.canvasSize[0])] \ - for y in range(self.canvasSize[1])] eventDc = self.canvasBackend.getDeviceContext(self) for numRow in range(self.canvasSize[1]): for numCol in range(self.canvasSize[0]): @@ -130,45 +121,36 @@ class MiRCARTCanvas(wx.Panel): *self.canvasMap[numRow][numCol])) wx.SafeYield() # }}} - # {{{ popRedo(self): + # {{{ popRedo(self): XXX def popRedo(self): - eventDc = self.canvasBackend.getDeviceContext(self) - patches = self.canvasJournal.popRedo() - for patch in patches: - if self.canvasBackend.drawPatch(eventDc, patch) == False: - continue - else: - self._commitPatch(patch) - self.parentFrame.onCanvasUpdate() + self._dispatchDeltaPatches(self.canvasJournal.popRedo()) # }}} - # {{{ popUndo(self): + # {{{ popUndo(self): XXX def popUndo(self): - eventDc = self.canvasBackend.getDeviceContext(self) - patches = self.canvasJournal.popUndo() - for patch in patches: - if self.canvasBackend.drawPatch(eventDc, patch) == False: - continue - else: - self._commitPatch(patch) - self.parentFrame.onCanvasUpdate() + self._dispatchDeltaPatches(self.canvasJournal.popUndo()) # }}} - # {{{ resize(self, newCanvasSize): + # {{{ resize(self, newCanvasSize): XXX def resize(self, newCanvasSize): if newCanvasSize != self.canvasSize: - winSize = [a*b for a,b in \ - zip(newCanvasSize, self.canvasBackend.cellSize)] - self.SetSize(*self.canvasPos, *winSize) - for numRow in range(self.canvasSize[1]): - for numNewCol in range(self.canvasSize[0], newCanvasSize[0]): - self.canvasMap[numRow].append([[1, 1], 0, " "]) - for numNewRow in range(self.canvasSize[1], newCanvasSize[1]): - self.canvasMap.append([]) - for numNewCol in range(newCanvasSize[0]): - self.canvasMap[numNewRow].append([[1, 1], 0, " "]) + if self.canvasMap == None: + self.canvasMap = [[[(1, 1), 0, " "] \ + for x in range(self.canvasSize[0])] \ + for y in range(self.canvasSize[1])] + else: + for numRow in range(self.canvasSize[1]): + for numNewCol in range(self.canvasSize[0], newCanvasSize[0]): + self.canvasMap[numRow].append([[1, 1], 0, " "]) + for numNewRow in range(self.canvasSize[1], newCanvasSize[1]): + self.canvasMap.append([]) + for numNewCol in range(newCanvasSize[0]): + self.canvasMap[numNewRow].append([[1, 1], 0, " "]) self.canvasSize = newCanvasSize - self.canvasBackend.reset(self.canvasSize, \ - self.canvasBackend.cellSize) - self.parentFrame.onCanvasUpdate() + self.SetSize(*self.canvasPos, \ + *[a*b for a,b in zip(self.canvasSize, \ + self.canvasBackend.cellSize)]) + self.canvasBackend.reset(self.canvasSize, self.canvasBackend.cellSize) + self.canvasJournal.resetCursor(); self.canvasJournal.resetUndo(); + self.parentFrame.onCanvasUpdate() # }}} # @@ -187,12 +169,11 @@ class MiRCARTCanvas(wx.Panel): # Bind event handlers self.Bind(wx.EVT_CLOSE, self.onPanelClose) - self.Bind(wx.EVT_ENTER_WINDOW, self.onPanelFocus) - self.Bind(wx.EVT_LEAVE_WINDOW, self.onPanelFocus) - self.parentFrame.Bind(wx.EVT_CHAR, self.onPanelKeyboardInput) + self.Bind(wx.EVT_LEAVE_WINDOW, self.onPanelLeaveWindow) + self.parentFrame.Bind(wx.EVT_CHAR, self.onPanelInput) for eventType in( \ wx.EVT_LEFT_DOWN, wx.EVT_MOTION, wx.EVT_RIGHT_DOWN): - self.Bind(eventType, self.onPanelMouseInput) + self.Bind(eventType, self.onPanelInput) self.Bind(wx.EVT_PAINT, self.onPanelPaint) # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTCanvasJournal.py b/MiRCARTCanvasJournal.py index 17706e7..d487a60 100644 --- a/MiRCARTCanvasJournal.py +++ b/MiRCARTCanvasJournal.py @@ -55,14 +55,16 @@ class MiRCARTCanvasJournal(): # }}} # {{{ pushCursor(self, patches): XXX def pushCursor(self, patches): - self.patchesCursor += patches + self.patchesCursor.append(patches) # }}} # {{{ pushDeltas(self, undoPatches, redoPatches): XXX def pushDeltas(self, undoPatches, redoPatches): if self.patchesUndoLevel > 0: del self.patchesUndo[0:self.patchesUndoLevel] self.patchesUndoLevel = 0 - self.patchesUndo.insert(0, [undoPatches, redoPatches]) + deltaItem = [undoPatches, redoPatches] + self.patchesUndo.insert(0, deltaItem) + return deltaItem # }}} # {{{ resetCursor(self): XXX def resetCursor(self): @@ -72,6 +74,11 @@ class MiRCARTCanvasJournal(): def resetUndo(self): self.patchesUndo = [None]; self.patchesUndoLevel = 0; # }}} + # {{{ updateCurrentDeltas(self, undoPatches, redoPatches): XXX + def updateCurrentDeltas(self, undoPatches, redoPatches): + self.patchesUndo[0][0].append(undoPatches) + self.patchesUndo[0][1].append(redoPatches) + # }}} # # __init__(self): initialisation method diff --git a/MiRCARTCanvasStore.py b/MiRCARTCanvasStore.py index e41b35a..79b609e 100644 --- a/MiRCARTCanvasStore.py +++ b/MiRCARTCanvasStore.py @@ -235,7 +235,10 @@ class MiRCARTCanvasStore(): # }}} # {{{ importNew(self, newCanvasSize=None): XXX def importNew(self, newCanvasSize=None): - self.parentCanvas.onStoreUpdate(newCanvasSize) + newMap = [[[(1, 1), 0, " "] \ + for x in range(self.parentCanvas.canvasSize[0])] \ + for y in range(self.parentCanvas.canvasSize[1])] + self.parentCanvas.onStoreUpdate(newCanvasSize, newMap) # }}} # diff --git a/MiRCARTTool.py b/MiRCARTTool.py index be8758c..4798ebf 100644 --- a/MiRCARTTool.py +++ b/MiRCARTTool.py @@ -26,12 +26,12 @@ class MiRCARTTool(): """XXX""" parentCanvas = None - # {{{ onKeyboardEvent(self, event, atPoint, brushColours, brushSize, keyChar): - def onKeyboardEvent(self, event, atPoint, brushColours, brushSize, keyChar): - return () + # {{{ onKeyboardEvent(self, event, atPoint, brushColours, brushSize, keyChar, dispatchFn, eventDc): + def onKeyboardEvent(self, event, atPoint, brushColours, brushSize, keyChar, dispatchFn, eventDc): + return True # }}} - # {{{ onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): XXX - def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): + # {{{ onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): XXX + def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): return () # }}} diff --git a/MiRCARTToolCircle.py b/MiRCARTToolCircle.py index 8218e85..52497e3 100644 --- a/MiRCARTToolCircle.py +++ b/MiRCARTToolCircle.py @@ -28,8 +28,8 @@ class MiRCARTToolCircle(MiRCARTTool): """XXX""" # - # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): XXX - def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): + # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): XXX + def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): brushColours = brushColours.copy() if isLeftDown: brushColours[1] = brushColours[0] @@ -37,20 +37,19 @@ class MiRCARTToolCircle(MiRCARTTool): brushColours[0] = brushColours[1] else: brushColours[1] = brushColours[0] - brushPatches = [] _brushSize = brushSize[0]*2 originPoint = (_brushSize/2, _brushSize/2) radius = _brushSize for brushY in range(-radius, radius + 1): for brushX in range(-radius, radius + 1): if ((brushX**2)+(brushY**2) < (((radius**2)+radius)*0.8)): - brushPatches.append([ \ + patch = [ \ [atPoint[0] + int(originPoint[0]+brushX), \ atPoint[1] + int(originPoint[1]+brushY)], \ - brushColours, 0, " "]) - if isLeftDown or isRightDown: - return [[False, brushPatches], [True, brushPatches]] - else: - return [[True, brushPatches]] + brushColours, 0, " "] + if isLeftDown or isRightDown: + dispatchFn(eventDc, False, patch); dispatchFn(eventDc, True, patch); + else: + dispatchFn(eventDc, True, patch) # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTToolLine.py b/MiRCARTToolLine.py index 18652d3..3180d0d 100644 --- a/MiRCARTToolLine.py +++ b/MiRCARTToolLine.py @@ -39,8 +39,8 @@ class MiRCARTToolLine(MiRCARTTool): def _pointSwap(self, a, b): return [b, a] # }}} - # {{{ _getLine(self, brushColours, originPoint, targetPoint): XXX - def _getLine(self, brushColours, originPoint, targetPoint): + # {{{ _getLine(self, brushColours, eventDc, isCursor, originPoint, targetPoint, dispatchFn): XXX + def _getLine(self, brushColours, eventDc, isCursor, originPoint, targetPoint, dispatchFn): originPoint = originPoint.copy(); targetPoint = targetPoint.copy(); pointDelta = self._pointDelta(originPoint, targetPoint) lineXSign = 1 if pointDelta[0] > 0 else -1; @@ -52,21 +52,23 @@ class MiRCARTToolLine(MiRCARTTool): pointDelta = [pointDelta[1], pointDelta[0]] lineXX, lineXY, lineYX, lineYY = 0, lineYSign, lineXSign, 0 lineD = 2 * pointDelta[1] - pointDelta[0]; lineY = 0; - linePatches = [] for lineX in range(pointDelta[0] + 1): - linePatches.append([[ \ + patch = [[ \ originPoint[0] + lineX*lineXX + lineY*lineYX, \ originPoint[1] + lineX*lineXY + lineY*lineYY], \ - brushColours, 0, " "]) + brushColours, 0, " "] + if isCursor: + dispatchFn(eventDc, False, patch); dispatchFn(eventDc, True, patch); + else: + dispatchFn(eventDc, True, patch) if lineD > 0: lineD -= pointDelta[0]; lineY += 1; lineD += pointDelta[1] - return linePatches # }}} # - # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): XXX - def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): + # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): XXX + def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): brushColours = brushColours.copy() if isLeftDown: brushColours[1] = brushColours[0] @@ -74,22 +76,19 @@ class MiRCARTToolLine(MiRCARTTool): brushColours[0] = brushColours[1] else: brushColours[1] = brushColours[0] - brushPatches = []; tmpPatches = []; if self.toolState == self.TS_NONE: if isLeftDown or isRightDown: self.toolOriginPoint = list(atPoint) self.toolState = self.TS_ORIGIN - tmpPatches.append([atPoint, brushColours, 0, " "]) - return [[True, tmpPatches]] + dispatchFn(eventDc, True, [atPoint, brushColours, 0, " "]) elif self.toolState == self.TS_ORIGIN: targetPoint = list(atPoint) originPoint = self.toolOriginPoint - brushPatches = self._getLine(brushColours, originPoint, targetPoint) + self._getLine(brushColours, eventDc, \ + isLeftDown or isRightDown, \ + originPoint, targetPoint, dispatchFn) if isLeftDown or isRightDown: self.toolState = self.TS_NONE - return [[False, brushPatches], [True, brushPatches]] - else: - return [[True, brushPatches]] # __init__(self, *args): initialisation method def __init__(self, *args): diff --git a/MiRCARTToolRect.py b/MiRCARTToolRect.py index a4e9662..a1455a3 100644 --- a/MiRCARTToolRect.py +++ b/MiRCARTToolRect.py @@ -28,8 +28,8 @@ class MiRCARTToolRect(MiRCARTTool): """XXX""" # - # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): XXX - def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): + # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): XXX + def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): brushColours = brushColours.copy() if isLeftDown: brushColours[1] = brushColours[0] @@ -40,16 +40,12 @@ class MiRCARTToolRect(MiRCARTTool): brushSize = brushSize.copy() if brushSize[0] > 1: brushSize[0] *= 2 - brushPatches = [] for brushRow in range(brushSize[1]): for brushCol in range(brushSize[0]): - brushPatches.append([[ \ - atPoint[0] + brushCol, \ - atPoint[1] + brushRow], \ - brushColours, 0, " "]) - if isLeftDown or isRightDown: - return [[False, brushPatches], [True, brushPatches]] - else: - return [[True, brushPatches]] + patch = [[atPoint[0] + brushCol, atPoint[1] + brushRow],brushColours, 0, " "] + if isLeftDown or isRightDown: + dispatchFn(eventDc, False, patch); dispatchFn(eventDc, True, patch); + else: + dispatchFn(eventDc, True, patch) # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTToolText.py b/MiRCARTToolText.py index 8f1be6d..ca1386a 100644 --- a/MiRCARTToolText.py +++ b/MiRCARTToolText.py @@ -23,23 +23,27 @@ # from MiRCARTTool import MiRCARTTool -import string +import string, wx class MiRCARTToolText(MiRCARTTool): """XXX""" textColours = textPos = None # - # onKeyboardEvent(self, event, atPoint, brushColours, brushSize, keyChar): XXX - def onKeyboardEvent(self, event, atPoint, brushColours, brushSize, keyChar): - if not keyChar in string.printable: - return [] + # onKeyboardEvent(self, event, atPoint, brushColours, brushSize, keyChar, dispatchFn, eventDc): XXX + def onKeyboardEvent(self, event, atPoint, brushColours, brushSize, keyChar, dispatchFn, eventDc): + keyModifiers = event.GetModifiers() + if keyModifiers != wx.MOD_NONE \ + and keyModifiers != wx.MOD_SHIFT: + return True + elif not keyChar in string.printable: + return True else: if self.textColours == None: self.textColours = brushColours.copy() if self.textPos == None: self.textPos = list(atPoint) - patches = [[False, [[self.textPos, self.textColours, 0, keyChar]]]] + dispatchFn(eventDc, False, [self.textPos, self.textColours, 0, keyChar]) if self.textPos[0] < (self.parentCanvas.canvasSize[0] - 1): self.textPos[0] += 1 elif self.textPos[1] < (self.parentCanvas.canvasSize[1] - 1): @@ -47,11 +51,11 @@ class MiRCARTToolText(MiRCARTTool): self.textPos[1] += 1 else: self.textPos = [0, 0] - return patches + return False # - # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): XXX - def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown): + # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): XXX + def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): if isLeftDown: self.textColours = brushColours.copy() self.textPos = list(atPoint) @@ -62,6 +66,6 @@ class MiRCARTToolText(MiRCARTTool): if self.textColours == None: self.textColours = brushColours.copy() self.textPos = list(atPoint) - return [[True, [[self.textPos, self.textColours, 0, "_"]]]] + dispatchFn(eventDc, True, [self.textPos, self.textColours, 0, "_"]) # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 From 36b9a5eb82d0e67db058776d5ac84e28d1a45be2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 10 Jan 2018 00:48:13 +0100 Subject: [PATCH 095/148] MiRCARTCanvas{Export,Import}Store.py: split from MiRCARTCanvasStore.py. IrcMiRCARTBot.py, MiRCART{Canvas,Frame,ToPngFile}.py: updated. --- IrcMiRCARTBot.py | 4 +- MiRCARTCanvas.py | 9 +- MiRCARTCanvasExportStore.py | 128 ++++++++++++++++++ ...vasStore.py => MiRCARTCanvasImportStore.py | 102 +------------- MiRCARTFrame.py | 16 +-- MiRCARTToPngFile.py | 4 +- 6 files changed, 148 insertions(+), 115 deletions(-) create mode 100644 MiRCARTCanvasExportStore.py rename MiRCARTCanvasStore.py => MiRCARTCanvasImportStore.py (60%) diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index b943f23..9977488 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -27,7 +27,7 @@ import os, sys, time import json import IrcClient import requests, urllib.request -from MiRCARTCanvasStore import MiRCARTCanvasStore +from MiRCARTCanvasImportStore import MiRCARTCanvasImportStore from MiRCARTToPngFile import MiRCARTToPngFile class IrcMiRCARTBot(IrcClient.IrcClient): @@ -141,7 +141,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): self.queue("PRIVMSG", message[2], "4/!\\ Unknown URL type specified!") return - canvasStore = MiRCARTCanvasStore(inFile=asciiTmpFilePath) + canvasStore = MiRCARTCanvasImportStore(inFile=asciiTmpFilePath) MiRCARTToPngFile(canvasStore.outMap, "DejaVuSansMono.ttf", 11).export(imgTmpFilePath) imgurResponse = self._uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") if imgurResponse[0] == 200: diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index ceef200..0ad4ff2 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -24,7 +24,8 @@ from MiRCARTCanvasBackend import MiRCARTCanvasBackend from MiRCARTCanvasJournal import MiRCARTCanvasJournal -from MiRCARTCanvasStore import MiRCARTCanvasStore, haveMiRCARTToPngFile, haveUrllib +from MiRCARTCanvasExportStore import MiRCARTCanvasExportStore, haveMiRCARTToPngFile, haveUrllib +from MiRCARTCanvasImportStore import MiRCARTCanvasImportStore from MiRCARTColours import MiRCARTColours import wx @@ -33,7 +34,8 @@ class MiRCARTCanvas(wx.Panel): parentFrame = None canvasMap = canvasPos = canvasSize = None brushColours = brushPos = brushSize = None - canvasBackend = canvasCurTool = canvasJournal = canvasStore = None + canvasBackend = canvasCurTool = canvasJournal = None + canvasExportStore = canvasImportStore = None # {{{ _commitPatch(self, patch): XXX def _commitPatch(self, patch): @@ -165,7 +167,8 @@ class MiRCARTCanvas(wx.Panel): self.canvasBackend = MiRCARTCanvasBackend(canvasSize, cellSize) self.canvasCurTool = None self.canvasJournal = MiRCARTCanvasJournal() - self.canvasStore = MiRCARTCanvasStore(parentCanvas=self) + self.canvasExportStore = MiRCARTCanvasExportStore(parentCanvas=self) + self.canvasImportStore = MiRCARTCanvasImportStore(parentCanvas=self) # Bind event handlers self.Bind(wx.EVT_CLOSE, self.onPanelClose) diff --git a/MiRCARTCanvasExportStore.py b/MiRCARTCanvasExportStore.py new file mode 100644 index 0000000..e7c520d --- /dev/null +++ b/MiRCARTCanvasExportStore.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python3 +# +# MiRCARTCanvasExportStore.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +import io, os, tempfile + +try: + from MiRCARTToPngFile import MiRCARTToPngFile + haveMiRCARTToPngFile = True +except ImportError: + haveMiRCARTToPngFile = False + +try: + import base64, json, requests, urllib.request + haveUrllib = True +except ImportError: + haveUrllib = False + +class MiRCARTCanvasExportStore(): + """XXX""" + parentCanvas = None + + # {{{ _exportFileToImgur(self, apiKey, imgName, imgTitle, pathName): upload single PNG file to Imgur + def _exportFileToImgur(self, apiKey, imgName, imgTitle, pathName): + requestImageData = open(pathName, "rb").read() + requestData = { \ + "image": base64.b64encode(requestImageData), \ + "key": apiKey, \ + "name": imgName, \ + "title": imgTitle, \ + "type": "base64"} + requestHeaders = {"Authorization": "Client-ID " + apiKey} + responseHttp = requests.post( \ + "https://api.imgur.com/3/upload.json", \ + data=requestData, headers=requestHeaders) + responseDict = json.loads(responseHttp.text) + if responseHttp.status_code == 200: + return [200, responseDict.get("data").get("link")] + else: + return [responseHttp.status_code, ""] + # }}} + + # {{{ exportBitmapToPngFile(self, canvasBitmap, outPathName, outType): XXX + def exportBitmapToPngFile(self, canvasBitmap, outPathName, outType): + return canvasBitmap.ConvertToImage().SaveFile(outPathName, outType) + # }}} + # {{{ exportBitmapToImgur(self, apiKey, canvasBitmap, imgName, imgTitle, imgType): XXX + def exportBitmapToImgur(self, apiKey, canvasBitmap, imgName, imgTitle, imgType): + tmpPathName = tempfile.mkstemp() + os.close(tmpPathName[0]) + canvasBitmap.ConvertToImage().SaveFile(tmpPathName[1], imgType) + imgurResult = self._exportFileToImgur(apiKey, imgName, imgTitle, tmpPathName[1]) + os.remove(tmpPathName[1]) + return imgurResult + # }}} + # {{{ exportPastebin(self, apiDevKey, canvasMap, canvasSize, pasteName="", pastePrivate=0): XXX + def exportPastebin(self, apiDevKey, canvasMap, canvasSize, pasteName="", pastePrivate=0): + if haveUrllib: + outFile = io.StringIO() + self.exportTextFile(canvasMap, canvasSize, outFile) + requestData = { \ + "api_dev_key": apiDevKey, \ + "api_option": "paste", \ + "api_paste_code": outFile.getvalue().encode(), \ + "api_paste_name": pasteName, \ + "api_paste_private": pastePrivate} + responseHttp = requests.post("https://pastebin.com/api/api_post.php", \ + data=requestData) + if responseHttp.status_code == 200: + if responseHttp.text.startswith("http"): + return (True, responseHttp.text) + else: + return (False, responseHttp.text) + else: + return (False, str(responseHttp.status_code)) + else: + return (False, "missing requests and/or urllib3 module(s)") + # }}} + # {{{ exportPngFile(self, canvasMap, outPathName): XXX + def exportPngFile(self, canvasMap, outPathName): + if haveMiRCARTToPngFile: + MiRCARTToPngFile(canvasMap).export(outPathName) + return True + else: + return False + # }}} + # {{{ exportTextFile(self, canvasMap, canvasSize, outFile): XXX + def exportTextFile(self, canvasMap, canvasSize, outFile): + for canvasRow in range(canvasSize[1]): + canvasLastColours = [] + for canvasCol in range(canvasSize[0]): + canvasColColours = canvasMap[canvasRow][canvasCol][0] + canvasColText = canvasMap[canvasRow][canvasCol][2] + if canvasColColours != canvasLastColours: + canvasLastColours = canvasColColours + outFile.write("\x03" + \ + str(canvasColColours[0]) + \ + "," + str(canvasColColours[1])) + outFile.write(canvasColText) + outFile.write("\n") + # }}} + + # + # __init__(self, parentCanvas): initialisation method + def __init__(self, parentCanvas): + self.parentCanvas = parentCanvas + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTCanvasStore.py b/MiRCARTCanvasImportStore.py similarity index 60% rename from MiRCARTCanvasStore.py rename to MiRCARTCanvasImportStore.py index 79b609e..6bce3bf 100644 --- a/MiRCARTCanvasStore.py +++ b/MiRCARTCanvasImportStore.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# MiRCARTCanvasStore.py -- XXX +# MiRCARTCanvasImportStore.py -- XXX # Copyright (c) 2018 Lucio Andrés Illanes Albornoz # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -22,27 +22,7 @@ # SOFTWARE. # -import io, os, tempfile - -try: - import wx - haveWx = True -except ImportError: - haveWx = False - -try: - from MiRCARTToPngFile import MiRCARTToPngFile - haveMiRCARTToPngFile = True -except ImportError: - haveMiRCARTToPngFile = False - -try: - import base64, json, requests, urllib.request - haveUrllib = True -except ImportError: - haveUrllib = False - -class MiRCARTCanvasStore(): +class MiRCARTCanvasImportStore(): """XXX""" inFile = inSize = outMap = None parentCanvas = None @@ -62,25 +42,6 @@ class MiRCARTCanvasStore(): PS_COLOUR_DIGIT0 = 2 PS_COLOUR_DIGIT1 = 3 - # {{{ _exportFileToImgur(self, apiKey, imgName, imgTitle, pathName): upload single PNG file to Imgur - def _exportFileToImgur(self, apiKey, imgName, imgTitle, pathName): - requestImageData = open(pathName, "rb").read() - requestData = { \ - "image": base64.b64encode(requestImageData), \ - "key": apiKey, \ - "name": imgName, \ - "title": imgTitle, \ - "type": "base64"} - requestHeaders = {"Authorization": "Client-ID " + apiKey} - responseHttp = requests.post( \ - "https://api.imgur.com/3/upload.json", \ - data=requestData, headers=requestHeaders) - responseDict = json.loads(responseHttp.text) - if responseHttp.status_code == 200: - return [200, responseDict.get("data").get("link")] - else: - return [responseHttp.status_code, ""] - # }}} # {{{ _flipCellStateBit(self, cellState, bit): XXX def _flipCellStateBit(self, cellState, bit): if cellState & bit: @@ -101,65 +62,6 @@ class MiRCARTCanvasStore(): return (15, 1) # }}} - # {{{ exportBitmapToPngFile(self, canvasBitmap, outPathName, outType): XXX - def exportBitmapToPngFile(self, canvasBitmap, outPathName, outType): - return canvasBitmap.ConvertToImage().SaveFile(outPathName, outType) - # }}} - # {{{ exportBitmapToImgur(self, apiKey, canvasBitmap, imgName, imgTitle, imgType): XXX - def exportBitmapToImgur(self, apiKey, canvasBitmap, imgName, imgTitle, imgType): - tmpPathName = tempfile.mkstemp() - os.close(tmpPathName[0]) - canvasBitmap.ConvertToImage().SaveFile(tmpPathName[1], imgType) - imgurResult = self._exportFileToImgur(apiKey, imgName, imgTitle, tmpPathName[1]) - os.remove(tmpPathName[1]) - return imgurResult - # }}} - # {{{ exportPastebin(self, apiDevKey, canvasMap, canvasSize, pasteName="", pastePrivate=0): XXX - def exportPastebin(self, apiDevKey, canvasMap, canvasSize, pasteName="", pastePrivate=0): - if haveUrllib: - outFile = io.StringIO() - self.exportTextFile(canvasMap, canvasSize, outFile) - requestData = { \ - "api_dev_key": apiDevKey, \ - "api_option": "paste", \ - "api_paste_code": outFile.getvalue().encode(), \ - "api_paste_name": pasteName, \ - "api_paste_private": pastePrivate} - responseHttp = requests.post("https://pastebin.com/api/api_post.php", \ - data=requestData) - if responseHttp.status_code == 200: - if responseHttp.text.startswith("http"): - return (True, responseHttp.text) - else: - return (False, responseHttp.text) - else: - return (False, str(responseHttp.status_code)) - else: - return (False, "missing requests and/or urllib3 module(s)") - # }}} - # {{{ exportPngFile(self, canvasMap, outPathName): XXX - def exportPngFile(self, canvasMap, outPathName): - if haveMiRCARTToPngFile: - MiRCARTToPngFile(canvasMap).export(outPathName) - return True - else: - return False - # }}} - # {{{ exportTextFile(self, canvasMap, canvasSize, outFile): XXX - def exportTextFile(self, canvasMap, canvasSize, outFile): - for canvasRow in range(canvasSize[1]): - canvasLastColours = [] - for canvasCol in range(canvasSize[0]): - canvasColColours = canvasMap[canvasRow][canvasCol][0] - canvasColText = canvasMap[canvasRow][canvasCol][2] - if canvasColColours != canvasLastColours: - canvasLastColours = canvasColColours - outFile.write("\x03" + \ - str(canvasColColours[0]) + \ - "," + str(canvasColColours[1])) - outFile.write(canvasColText) - outFile.write("\n") - # }}} # {{{ importIntoPanel(self): XXX def importIntoPanel(self): self.parentCanvas.onStoreUpdate(self.inSize, self.outMap) diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index ba280b6..bf8b2c9 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -189,7 +189,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): else: outPathName = dialog.GetPath() self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) - self.panelCanvas.canvasStore.exportBitmapToPngFile( \ + self.panelCanvas.canvasExportStore.exportBitmapToPngFile( \ self.panelCanvas.canvasBackend.canvasBitmap, outPathName, \ wx.BITMAP_TYPE_PNG) self.SetCursor(wx.Cursor(wx.NullCursor)) @@ -198,8 +198,8 @@ class MiRCARTFrame(MiRCARTGeneralFrame): # {{{ canvasExportImgur(self): XXX def canvasExportImgur(self): self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) - imgurResult = self.panelCanvas.canvasStore.exportBitmapToImgur( \ - "c9a6efb3d7932fd", self.panelCanvas.canvasBackend.canvasBitmap, \ + imgurResult = self.panelCanvas.canvasExportStore.exportBitmapToImgur( \ + "c9a6efb3d7932fd", self.panelCanvas.canvasBackend.canvasBitmap, \ "", "", wx.BITMAP_TYPE_PNG) self.SetCursor(wx.Cursor(wx.NullCursor)) if imgurResult[0] == 200: @@ -217,7 +217,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): def canvasExportPastebin(self): self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) pasteStatus, pasteResult = \ - self.panelCanvas.canvasStore.exportPastebin( \ + self.panelCanvas.canvasExportStore.exportPastebin( \ "253ce2f0a45140ee0a44ca99aa49260", \ self.panelCanvas.canvasMap, \ self.panelCanvas.canvasSize) @@ -246,7 +246,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) if newCanvasSize == None: newCanvasSize = (100, 30) - self.panelCanvas.canvasStore.importNew(newCanvasSize) + self.panelCanvas.canvasImportStore.importNew(newCanvasSize) self.canvasPathName = None self.SetCursor(wx.Cursor(wx.NullCursor)) self._updateStatusBar(); self.onCanvasUpdate(); @@ -268,8 +268,8 @@ class MiRCARTFrame(MiRCARTGeneralFrame): else: self.canvasPathName = dialog.GetPath() self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) - self.panelCanvas.canvasStore.importTextFile(self.canvasPathName) - self.panelCanvas.canvasStore.importIntoPanel() + self.panelCanvas.canvasImportStore.importTextFile(self.canvasPathName) + self.panelCanvas.canvasImportStore.importIntoPanel() self.SetCursor(wx.Cursor(wx.NullCursor)) self._updateStatusBar(); self.onCanvasUpdate(); return True @@ -282,7 +282,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): try: with open(self.canvasPathName, "w") as outFile: self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) - self.panelCanvas.canvasStore.exportTextFile( \ + self.panelCanvas.canvasExportStore.exportTextFile( \ self.panelCanvas.canvasMap, \ self.panelCanvas.canvasSize, outFile) self.SetCursor(wx.Cursor(wx.NullCursor)) diff --git a/MiRCARTToPngFile.py b/MiRCARTToPngFile.py index 78ef788..ed76ccc 100755 --- a/MiRCARTToPngFile.py +++ b/MiRCARTToPngFile.py @@ -22,7 +22,7 @@ # SOFTWARE. # -import MiRCARTCanvasStore +import MiRCARTCanvasImportStore from PIL import Image, ImageDraw, ImageFont import sys @@ -128,7 +128,7 @@ class MiRCARTToPngFile: # # Entry point def main(*argv): - canvasStore = MiRCARTCanvasStore.MiRCARTCanvasStore(inFile=argv[1]) + canvasStore = MiRCARTCanvasImportStore.MiRCARTCanvasImportStore(inFile=argv[1]) MiRCARTToPngFile(canvasStore.outMap, *argv[3:]).export(argv[2]) if __name__ == "__main__": if ((len(sys.argv) - 1) < 2)\ From 7abd7679d29f3eae81a088ea3a531c002850bd1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 10 Jan 2018 02:30:32 +0100 Subject: [PATCH 096/148] MiRCARTCanvasInterface.py: split from MiRCARTCanvas.py. MiRCART{Canvas,{,General}Frame}.py: updated. --- MiRCARTCanvas.py | 32 ++-- MiRCARTCanvasBackend.py | 4 +- MiRCARTCanvasInterface.py | 272 +++++++++++++++++++++++++++++ MiRCARTFrame.py | 349 +++++++------------------------------- MiRCARTGeneralFrame.py | 69 ++++---- 5 files changed, 385 insertions(+), 341 deletions(-) create mode 100644 MiRCARTCanvasInterface.py diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index 0ad4ff2..5de4b44 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -26,7 +26,7 @@ from MiRCARTCanvasBackend import MiRCARTCanvasBackend from MiRCARTCanvasJournal import MiRCARTCanvasJournal from MiRCARTCanvasExportStore import MiRCARTCanvasExportStore, haveMiRCARTToPngFile, haveUrllib from MiRCARTCanvasImportStore import MiRCARTCanvasImportStore -from MiRCARTColours import MiRCARTColours +from MiRCARTCanvasInterface import MiRCARTCanvasInterface import wx class MiRCARTCanvas(wx.Panel): @@ -34,8 +34,9 @@ class MiRCARTCanvas(wx.Panel): parentFrame = None canvasMap = canvasPos = canvasSize = None brushColours = brushPos = brushSize = None - canvasBackend = canvasCurTool = canvasJournal = None + canvasBackend = canvasJournal = None canvasExportStore = canvasImportStore = None + canvasInterface = None # {{{ _commitPatch(self, patch): XXX def _commitPatch(self, patch): @@ -47,7 +48,7 @@ class MiRCARTCanvas(wx.Panel): for patch in deltaPatches: if self.canvasBackend.drawPatch(eventDc, patch): self._commitPatch(patch) - self.parentFrame.onCanvasUpdate() + self.parentFrame.onUndoUpdate() # }}} # {{{ _dispatchPatch(self, eventDc, isCursor, patch): XXX def _dispatchPatch(self, eventDc, isCursor, patch): @@ -72,12 +73,16 @@ class MiRCARTCanvas(wx.Panel): def onPanelClose(self, event): self.Destroy() # }}} + # {{{ onPanelEnterWindow(self, event): XXX + def onPanelEnterWindow(self, event): + self.parentFrame.SetFocus() + # }}} # {{{ onPanelInput(self, event): XXX def onPanelInput(self, event): eventDc = self.canvasBackend.getDeviceContext(self) eventType = event.GetEventType() self._canvasDirty = self._canvasDirtyCursor = False - tool = self.canvasCurTool + tool = self.canvasInterface.canvasTool if eventType == wx.wxEVT_CHAR: mapPoint = self.brushPos doSkip = tool.onKeyboardEvent( \ @@ -93,15 +98,15 @@ class MiRCARTCanvas(wx.Panel): event.Dragging(), event.LeftIsDown(), event.RightIsDown(), \ self._dispatchPatch, eventDc) if self._canvasDirty: - self.parentFrame.onCanvasUpdate() - self.parentFrame.onCanvasMotion(event, mapPoint) + self.parentFrame.onUndoUpdate() + if eventType == wx.wxEVT_MOTION: + self.parentFrame.onStatusBarUpdate(showPos=mapPoint) # }}} # {{{ onPanelLeaveWindow(self, event): XXX def onPanelLeaveWindow(self, event): eventDc = self.canvasBackend.getDeviceContext(self) self.canvasBackend.drawCursorMaskWithJournal( \ self.canvasJournal, eventDc) - self.parentFrame.onCanvasMotion(event) # }}} # {{{ onPanelPaint(self, event): XXX def onPanelPaint(self, event): @@ -123,14 +128,6 @@ class MiRCARTCanvas(wx.Panel): *self.canvasMap[numRow][numCol])) wx.SafeYield() # }}} - # {{{ popRedo(self): XXX - def popRedo(self): - self._dispatchDeltaPatches(self.canvasJournal.popRedo()) - # }}} - # {{{ popUndo(self): XXX - def popUndo(self): - self._dispatchDeltaPatches(self.canvasJournal.popUndo()) - # }}} # {{{ resize(self, newCanvasSize): XXX def resize(self, newCanvasSize): if newCanvasSize != self.canvasSize: @@ -152,7 +149,7 @@ class MiRCARTCanvas(wx.Panel): self.canvasBackend.cellSize)]) self.canvasBackend.reset(self.canvasSize, self.canvasBackend.cellSize) self.canvasJournal.resetCursor(); self.canvasJournal.resetUndo(); - self.parentFrame.onCanvasUpdate() + self.parentFrame.onUndoUpdate() # }}} # @@ -165,13 +162,14 @@ class MiRCARTCanvas(wx.Panel): self.canvasMap = None; self.canvasPos = canvasPos; self.canvasSize = canvasSize; self.brushColours = [4, 1]; self.brushPos = [0, 0]; self.brushSize = [1, 1]; self.canvasBackend = MiRCARTCanvasBackend(canvasSize, cellSize) - self.canvasCurTool = None self.canvasJournal = MiRCARTCanvasJournal() self.canvasExportStore = MiRCARTCanvasExportStore(parentCanvas=self) self.canvasImportStore = MiRCARTCanvasImportStore(parentCanvas=self) + self.canvasInterface = MiRCARTCanvasInterface(self, parentFrame) # Bind event handlers self.Bind(wx.EVT_CLOSE, self.onPanelClose) + self.Bind(wx.EVT_ENTER_WINDOW, self.onPanelEnterWindow) self.Bind(wx.EVT_LEAVE_WINDOW, self.onPanelLeaveWindow) self.parentFrame.Bind(wx.EVT_CHAR, self.onPanelInput) for eventType in( \ diff --git a/MiRCARTCanvasBackend.py b/MiRCARTCanvasBackend.py index 192cc13..154b0ca 100644 --- a/MiRCARTCanvasBackend.py +++ b/MiRCARTCanvasBackend.py @@ -97,7 +97,9 @@ class MiRCARTCanvasBackend(): # {{{ drawPatch(self, eventDc, patch): XXX def drawPatch(self, eventDc, patch): if patch[0][0] < self.canvasSize[0] \ - and patch[0][1] < self.canvasSize[1]: + and patch[0][0] >= 0 \ + and patch[0][1] < self.canvasSize[1] \ + and patch[0][1] >= 0: if patch[3] == " ": self._drawBrushPatch(eventDc, patch) else: diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py new file mode 100644 index 0000000..105b2fd --- /dev/null +++ b/MiRCARTCanvasInterface.py @@ -0,0 +1,272 @@ +#!/usr/bin/env python3 +# +# MiRCARTCanvasInterface.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from MiRCARTToolCircle import MiRCARTToolCircle +from MiRCARTToolLine import MiRCARTToolLine +from MiRCARTToolRect import MiRCARTToolRect +from MiRCARTToolText import MiRCARTToolText + +import os, wx + +class MiRCARTCanvasInterface(): + """XXX""" + parentCanvas = parentFrame = canvasPathName = canvasTool = None + + # {{{ _dialogSaveChanges(self) + def _dialogSaveChanges(self): + with wx.MessageDialog(self.parentCanvas, \ + "Do you want to save changes to {}?".format( \ + self.canvasPathName), "MiRCART", \ + wx.CANCEL|wx.CANCEL_DEFAULT|wx.ICON_QUESTION|wx.YES_NO) as dialog: + dialogChoice = dialog.ShowModal() + return dialogChoice + # }}} + # {{{ _updateCanvasSize(self, newCanvasSize): XXX + def _updateCanvasSize(self, newCanvasSize): + eventDc = self.parentCanvas.canvasBackend.getDeviceContext(self.parentCanvas) + self.parentCanvas.resize(newCanvasSize) + self.parentCanvas.canvasBackend.resize( \ + newCanvasSize, \ + self.parentCanvas.canvasBackend.cellSize) + for numRow in range(self.parentCanvas.canvasSize[1] - 1): + self.parentCanvas.canvasMap.append([[1, 1], 0, " "]) + self.parentCanvas.canvasMap.append([]) + for numCol in range(self.parentCanvas.canvasSize[0]): + self.parentCanvas.canvasMap[-1].append([[1, 1], 0, " "]) + self.parentCanvas.canvasBackend.drawPatch(eventDc, \ + ([numCol, self.parentCanvas.canvasSize[1] - 1], *[[1, 1], 0, " "])) + wx.SafeYield() + # }}} + + # {{{ canvasBrushSolid(self, event): XXX + def canvasBrushSolid(self, event): + pass + # }}} + # {{{ canvasColour(self, event, numColour): XXX + def canvasColour(self, event, numColour): + if event.GetEventType() == wx.wxEVT_TOOL: + self.parentCanvas.brushColours[0] = numColour + elif event.GetEventType() == wx.wxEVT_TOOL_RCLICKED: + self.parentCanvas.brushColours[1] = numColour + self.parentFrame.onStatusBarUpdate() + # }}} + # {{{ canvasCopy(self, event): XXX + def canvasCopy(self, event): + pass + # }}} + # {{{ canvasCut(self, event): XXX + def canvasCut(self, event): + pass + # }}} + # {{{ canvasDecrBrush(self, event): XXX + def canvasDecrBrush(self, event): + if self.parentCanvas.brushSize[0] > 1 \ + and self.parentCanvas.brushSize[1] > 1: + self.parentCanvas.brushSize = \ + [a-1 for a in self.parentCanvas.brushSize] + # }}} + # {{{ canvasDecrCanvas(self, event): XXX + def canvasDecrCanvas(self, event): + newCanvasSize = [a-1 if a > 1 else a for a in self.parentCanvas.canvasSize] + self._updateCanvasSize(newCanvasSize) + # }}} + # {{{ canvasDelete(self, event): XXX + def canvasDelete(self, event): + pass + # }}} + # {{{ canvasExit(self, event): XXX + def canvasExit(self, event): + self.parentFrame.Close(True) + # }}} + # {{{ canvasExportAsPng(self, event): XXX + def canvasExportAsPng(self, event): + with wx.FileDialog(self, "Save As...", os.getcwd(), "", \ + "*.png", wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) as dialog: + if dialog.ShowModal() == wx.ID_CANCEL: + return False + else: + outPathName = dialog.GetPath() + self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) + self.parentCanvas.canvasExportStore.exportBitmapToPngFile( \ + self.parentCanvas.canvasBackend.canvasBitmap, outPathName, \ + wx.BITMAP_TYPE_PNG) + self.SetCursor(wx.Cursor(wx.NullCursor)) + return True + # }}} + # {{{ canvasExportImgur(self, event): XXX + def canvasExportImgur(self, event): + self.parentCanvas.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) + imgurResult = self.parentCanvas.canvasExportStore.exportBitmapToImgur( \ + "c9a6efb3d7932fd", self.parentCanvas.canvasBackend.canvasBitmap, \ + "", "", wx.BITMAP_TYPE_PNG) + self.parentCanvas.SetCursor(wx.Cursor(wx.NullCursor)) + if imgurResult[0] == 200: + if not wx.TheClipboard.IsOpened(): + wx.TheClipboard.Open() + wx.TheClipboard.SetData(wx.TextDataObject(imgurResult[1])) + wx.TheClipboard.Close() + wx.MessageBox("Exported to Imgur: " + imgurResult[1], \ + "Export to Imgur", wx.OK|wx.ICON_INFORMATION) + else: + wx.MessageBox("Failed to export to Imgur: " + imgurResult[1], \ + "Export to Imgur", wx.OK|wx.ICON_EXCLAMATION) + # }}} + # {{{ canvasExportPastebin(self, event): XXX + def canvasExportPastebin(self, event): + self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) + pasteStatus, pasteResult = \ + self.parentCanvas.canvasExportStore.exportPastebin( \ + "253ce2f0a45140ee0a44ca99aa49260", \ + self.parentCanvas.canvasMap, \ + self.parentCanvas.canvasSize) + self.SetCursor(wx.Cursor(wx.NullCursor)) + if pasteStatus: + if not wx.TheClipboard.IsOpened(): + wx.TheClipboard.Open() + wx.TheClipboard.SetData(wx.TextDataObject(pasteResult)) + wx.TheClipboard.Close() + wx.MessageBox("Exported to Pastebin: " + pasteResult, \ + "Export to Pastebin", wx.OK|wx.ICON_INFORMATION) + else: + wx.MessageBox("Failed to export to Pastebin: " + pasteResult, \ + "Export to Pastebin", wx.OK|wx.ICON_EXCLAMATION) + # }}} + # {{{ canvasIncrBrush(self, event): XXX + def canvasIncrBrush(self, event): + self.parentCanvas.brushSize = \ + [a+1 for a in self.parentCanvas.brushSize] + # }}} + # {{{ canvasIncrCanvas(self, event): XXX + def canvasIncrCanvas(self, event): + newCanvasSize = [a+1 for a in self.parentCanvas.canvasSize] + self._updateCanvasSize(newCanvasSize) + # }}} + # {{{ canvasNew(self, event, newCanvasSize=None): XXX + def canvasNew(self, event, newCanvasSize=None): + if self.canvasPathName != None: + saveChanges = self._dialogSaveChanges() + if saveChanges == wx.ID_CANCEL: + return + elif saveChanges == wx.ID_NO: + pass + elif saveChanges == wx.ID_YES: + self.canvasSave() + self.parentCanvas.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) + if newCanvasSize == None: + newCanvasSize = (100, 30) + self.parentCanvas.canvasImportStore.importNew(newCanvasSize) + self.canvasPathName = None + self.parentCanvas.SetCursor(wx.Cursor(wx.NullCursor)) + self.parentFrame.onStatusBarUpdate() + self.parentFrame.onUndoUpdate() + # }}} + # {{{ canvasOpen(self, event): XXX + def canvasOpen(self, event): + if self.canvasPathName != None: + saveChanges = self._dialogSaveChanges() + if saveChanges == wx.ID_CANCEL: + return + elif saveChanges == wx.ID_NO: + pass + elif saveChanges == wx.ID_YES: + self.canvasSave() + with wx.FileDialog(self.parentCanvas, "Open", os.getcwd(), "", \ + "*.txt", wx.FD_OPEN) as dialog: + if dialog.ShowModal() == wx.ID_CANCEL: + return False + else: + self.canvasPathName = dialog.GetPath() + self.parentCanvas.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) + self.parentCanvas.canvasImportStore.importTextFile(self.canvasPathName) + self.parentCanvas.canvasImportStore.importIntoPanel() + self.parentCanvas.SetCursor(wx.Cursor(wx.NullCursor)) + self.parentFrame.onStatusBarUpdate(showFileName=self.canvasPathName) + self.parentFrame.onUndoUpdate() + return True + # }}} + # {{{ canvasPaste(self, event): XXX + def canvasPaste(self, event): + pass + # }}} + # {{{ canvasRedo(self, event): XXX + def canvasRedo(self, event): + self.parentCanvas._dispatchDeltaPatches( \ + self.parentCanvas.canvasJournal.popRedo()) + # }}} + # {{{ canvasSave(self, event): XXX + def canvasSave(self, event): + if self.canvasPathName == None: + if self.canvasSaveAs(event) == False: + return + try: + with open(self.canvasPathName, "w") as outFile: + self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) + self.parentCanvas.canvasExportStore.exportTextFile( \ + self.parentCanvas.canvasMap, \ + self.parentCanvas.canvasSize, outFile) + self.SetCursor(wx.Cursor(wx.NullCursor)) + return True + except IOError as error: + return False + # }}} + # {{{ canvasSaveAs(self, event): XXX + def canvasSaveAs(self, event): + with wx.FileDialog(self.parentCanvas, "Save As", os.getcwd(), "", \ + "*.txt", wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) as dialog: + if dialog.ShowModal() == wx.ID_CANCEL: + return False + else: + self.canvasPathName = dialog.GetPath() + return self.canvasSave(event) + # }}} + # {{{ canvasToolCircle(self, event): XXX + def canvasToolCircle(self, event): + self.canvasTool = MiRCARTToolCircle(self.parentCanvas) + # }}} + # {{{ canvasToolLine(self, event): XXX + def canvasToolLine(self, event): + self.canvasTool = MiRCARTToolLine(self.parentCanvas) + # }}} + # {{{ canvasToolRect(self, event): XXX + def canvasToolRect(self, event): + self.canvasTool = MiRCARTToolRect(self.parentCanvas) + # }}} + # {{{ canvasToolText(self, event): XXX + def canvasToolText(self, event): + self.canvasTool = MiRCARTToolText(self.parentCanvas) + # }}} + # {{{ canvasUndo(self, event): XXX + def canvasUndo(self, event): + self.parentCanvas._dispatchDeltaPatches( \ + self.parentCanvas.canvasJournal.popUndo()) + # }}} + + # + # __init__(self, parentCanvas, parentFrame): + def __init__(self, parentCanvas, parentFrame): + self.parentCanvas = parentCanvas; self.parentFrame = parentFrame; + self.canvasPathName = None + self.canvasToolRect(None) + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index bf8b2c9..1d7b3be 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -23,74 +23,68 @@ # from MiRCARTCanvas import MiRCARTCanvas, haveUrllib +from MiRCARTCanvasInterface import MiRCARTCanvasInterface from MiRCARTColours import MiRCARTColours -from MiRCARTGeneralFrame import MiRCARTGeneralFrame, \ - TID_ACCELS, TID_COMMAND, TID_LIST, TID_MENU, TID_NOTHING, TID_SELECT, TID_TOOLBAR -from MiRCARTToolCircle import MiRCARTToolCircle -from MiRCARTToolLine import MiRCARTToolLine -from MiRCARTToolRect import MiRCARTToolRect -from MiRCARTToolText import MiRCARTToolText - +from MiRCARTGeneralFrame import MiRCARTGeneralFrame, \ + TID_ACCELS, TID_COMMAND, TID_LIST, TID_MENU, TID_NOTHING, TID_SELECT, TID_TOOLBAR, \ + NID_MENU_SEP, NID_TOOLBAR_SEP + import os, wx class MiRCARTFrame(MiRCARTGeneralFrame): """XXX""" - panelCanvas = canvasPathName = None + panelCanvas = None # {{{ Commands # Id Type Id Labels Icon bitmap Accelerator [Initial state] - CID_NEW = [0x100, TID_COMMAND, "New", "&New", ["", wx.ART_NEW], [wx.ACCEL_CTRL, ord("N")]] - CID_OPEN = [0x101, TID_COMMAND, "Open", "&Open", ["", wx.ART_FILE_OPEN], [wx.ACCEL_CTRL, ord("O")]] - CID_SAVE = [0x102, TID_COMMAND, "Save", "&Save", ["", wx.ART_FILE_SAVE], [wx.ACCEL_CTRL, ord("S")]] - CID_SAVEAS = [0x103, TID_COMMAND, "Save As...", "Save &As...", ["", wx.ART_FILE_SAVE_AS], None] + CID_NEW = [0x100, TID_COMMAND, "New", "&New", ["", wx.ART_NEW], [wx.ACCEL_CTRL, ord("N")], None, MiRCARTCanvasInterface.canvasNew] + CID_OPEN = [0x101, TID_COMMAND, "Open", "&Open", ["", wx.ART_FILE_OPEN], [wx.ACCEL_CTRL, ord("O")], None, MiRCARTCanvasInterface.canvasOpen] + CID_SAVE = [0x102, TID_COMMAND, "Save", "&Save", ["", wx.ART_FILE_SAVE], [wx.ACCEL_CTRL, ord("S")], None, MiRCARTCanvasInterface.canvasSave] + CID_SAVEAS = [0x103, TID_COMMAND, "Save As...", "Save &As...", ["", wx.ART_FILE_SAVE_AS], None, None, MiRCARTCanvasInterface.canvasSaveAs] CID_EXPORT_AS_PNG = [0x104, TID_COMMAND, "Export as PNG...", \ - "Export as PN&G...", None, None] + "Export as PN&G...", None, None, None, MiRCARTCanvasInterface.canvasExportAsPng] CID_EXPORT_IMGUR = [0x105, TID_COMMAND, "Export to Imgur...", \ - "Export to I&mgur...", None, None, haveUrllib] + "Export to I&mgur...", None, None, haveUrllib, MiRCARTCanvasInterface.canvasExportImgur] CID_EXPORT_PASTEBIN = [0x106, TID_COMMAND, "Export to Pastebin...", \ - "Export to Pasteb&in...", None, None, haveUrllib] - CID_EXIT = [0x107, TID_COMMAND, "Exit", "E&xit", None, None] - CID_UNDO = [0x108, TID_COMMAND, "Undo", "&Undo", ["", wx.ART_UNDO], [wx.ACCEL_CTRL, ord("Z")], False] - CID_REDO = [0x109, TID_COMMAND, "Redo", "&Redo", ["", wx.ART_REDO], [wx.ACCEL_CTRL, ord("Y")], False] - CID_CUT = [0x10a, TID_COMMAND, "Cut", "Cu&t", ["", wx.ART_CUT], None, False] - CID_COPY = [0x10b, TID_COMMAND, "Copy", "&Copy", ["", wx.ART_COPY], None, False] - CID_PASTE = [0x10c, TID_COMMAND, "Paste", "&Paste", ["", wx.ART_PASTE], None, False] - CID_DELETE = [0x10d, TID_COMMAND, "Delete", "De&lete", ["", wx.ART_DELETE], None, False] + "Export to Pasteb&in...", None, None, haveUrllib, MiRCARTCanvasInterface.canvasExportPastebin] + CID_EXIT = [0x107, TID_COMMAND, "Exit", "E&xit", None, None, None, MiRCARTCanvasInterface.canvasExit] + CID_UNDO = [0x108, TID_COMMAND, "Undo", "&Undo", ["", wx.ART_UNDO], [wx.ACCEL_CTRL, ord("Z")], False, MiRCARTCanvasInterface.canvasUndo] + CID_REDO = [0x109, TID_COMMAND, "Redo", "&Redo", ["", wx.ART_REDO], [wx.ACCEL_CTRL, ord("Y")], False, MiRCARTCanvasInterface.canvasRedo] + CID_CUT = [0x10a, TID_COMMAND, "Cut", "Cu&t", ["", wx.ART_CUT], None, False, MiRCARTCanvasInterface.canvasCut] + CID_COPY = [0x10b, TID_COMMAND, "Copy", "&Copy", ["", wx.ART_COPY], None, False, MiRCARTCanvasInterface.canvasCopy] + CID_PASTE = [0x10c, TID_COMMAND, "Paste", "&Paste", ["", wx.ART_PASTE], None, False, MiRCARTCanvasInterface.canvasPaste] + CID_DELETE = [0x10d, TID_COMMAND, "Delete", "De&lete", ["", wx.ART_DELETE], None, False, MiRCARTCanvasInterface.canvasDelete] CID_INCR_CANVAS = [0x10e, TID_COMMAND, "Increase canvas size", \ - "I&ncrease canvas size", ["", wx.ART_PLUS], [wx.ACCEL_ALT, ord("+")]] + "I&ncrease canvas size", ["", wx.ART_PLUS], [wx.ACCEL_ALT, ord("+")], None, MiRCARTCanvasInterface.canvasIncrCanvas] CID_DECR_CANVAS = [0x10f, TID_COMMAND, "Decrease canvas size", \ - "D&ecrease canvas size", ["", wx.ART_MINUS], [wx.ACCEL_ALT, ord("-")]] + "D&ecrease canvas size", ["", wx.ART_MINUS], [wx.ACCEL_ALT, ord("-")], None, MiRCARTCanvasInterface.canvasDecrCanvas] CID_INCR_BRUSH = [0x110, TID_COMMAND, "Increase brush size", \ - "&Increase brush size", ["", wx.ART_PLUS], [wx.ACCEL_CTRL, ord("+")]] + "&Increase brush size", ["", wx.ART_PLUS], [wx.ACCEL_CTRL, ord("+")], None, MiRCARTCanvasInterface.canvasIncrBrush] CID_DECR_BRUSH = [0x111, TID_COMMAND, "Decrease brush size", \ - "&Decrease brush size", ["", wx.ART_MINUS], [wx.ACCEL_CTRL, ord("-")]] - CID_SOLID_BRUSH = [0x112, TID_SELECT, "Solid brush", "&Solid brush", None, None, True] + "&Decrease brush size", ["", wx.ART_MINUS], [wx.ACCEL_CTRL, ord("-")], None, MiRCARTCanvasInterface.canvasDecrBrush] + CID_SOLID_BRUSH = [0x112, TID_SELECT, "Solid brush", "&Solid brush", None, None, True, MiRCARTCanvasInterface.canvasBrushSolid] - CID_RECT = [0x150, TID_SELECT, "Rectangle", "&Rectangle", ["toolRect.png"], [wx.ACCEL_CTRL, ord("R")], True] - CID_CIRCLE = [0x151, TID_SELECT, "Circle", "&Circle", ["toolCircle.png"], [wx.ACCEL_CTRL, ord("C")], False] - CID_LINE = [0x152, TID_SELECT, "Line", "&Line", ["toolLine.png"], [wx.ACCEL_CTRL, ord("L")], False] - CID_TEXT = [0x153, TID_SELECT, "Text", "&Text", ["toolText.png"], [wx.ACCEL_CTRL, ord("T")], False] + CID_RECT = [0x150, TID_SELECT, "Rectangle", "&Rectangle", ["toolRect.png"], [wx.ACCEL_CTRL, ord("R")], True, MiRCARTCanvasInterface.canvasToolRect] + CID_CIRCLE = [0x151, TID_SELECT, "Circle", "&Circle", ["toolCircle.png"], [wx.ACCEL_CTRL, ord("C")], False, MiRCARTCanvasInterface.canvasToolCircle] + CID_LINE = [0x152, TID_SELECT, "Line", "&Line", ["toolLine.png"], [wx.ACCEL_CTRL, ord("L")], False, MiRCARTCanvasInterface.canvasToolLine] + CID_TEXT = [0x153, TID_SELECT, "Text", "&Text", ["toolText.png"], [wx.ACCEL_CTRL, ord("T")], False, MiRCARTCanvasInterface.canvasToolText] - CID_COLOUR00 = [0x1a0, TID_COMMAND, "Colour #00", "Colour #00", None, None] - CID_COLOUR01 = [0x1a1, TID_COMMAND, "Colour #01", "Colour #01", None, None] - CID_COLOUR02 = [0x1a2, TID_COMMAND, "Colour #02", "Colour #02", None, None] - CID_COLOUR03 = [0x1a3, TID_COMMAND, "Colour #03", "Colour #03", None, None] - CID_COLOUR04 = [0x1a4, TID_COMMAND, "Colour #04", "Colour #04", None, None] - CID_COLOUR05 = [0x1a5, TID_COMMAND, "Colour #05", "Colour #05", None, None] - CID_COLOUR06 = [0x1a6, TID_COMMAND, "Colour #06", "Colour #06", None, None] - CID_COLOUR07 = [0x1a7, TID_COMMAND, "Colour #07", "Colour #07", None, None] - CID_COLOUR08 = [0x1a8, TID_COMMAND, "Colour #08", "Colour #08", None, None] - CID_COLOUR09 = [0x1a9, TID_COMMAND, "Colour #09", "Colour #09", None, None] - CID_COLOUR10 = [0x1aa, TID_COMMAND, "Colour #10", "Colour #10", None, None] - CID_COLOUR11 = [0x1ab, TID_COMMAND, "Colour #11", "Colour #11", None, None] - CID_COLOUR12 = [0x1ac, TID_COMMAND, "Colour #12", "Colour #12", None, None] - CID_COLOUR13 = [0x1ad, TID_COMMAND, "Colour #13", "Colour #13", None, None] - CID_COLOUR14 = [0x1ae, TID_COMMAND, "Colour #14", "Colour #14", None, None] - CID_COLOUR15 = [0x1af, TID_COMMAND, "Colour #15", "Colour #15", None, None] - # }}} - # {{{ Non-items - NID_MENU_SEP = (0x200, TID_NOTHING) - NID_TOOLBAR_SEP = (0x201, TID_NOTHING) + CID_COLOUR00 = [0x1a0, TID_COMMAND, "Colour #00", "Colour #00", None, None, None, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR01 = [0x1a1, TID_COMMAND, "Colour #01", "Colour #01", None, None, None, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR02 = [0x1a2, TID_COMMAND, "Colour #02", "Colour #02", None, None, None, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR03 = [0x1a3, TID_COMMAND, "Colour #03", "Colour #03", None, None, None, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR04 = [0x1a4, TID_COMMAND, "Colour #04", "Colour #04", None, None, None, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR05 = [0x1a5, TID_COMMAND, "Colour #05", "Colour #05", None, None, None, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR06 = [0x1a6, TID_COMMAND, "Colour #06", "Colour #06", None, None, None, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR07 = [0x1a7, TID_COMMAND, "Colour #07", "Colour #07", None, None, None, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR08 = [0x1a8, TID_COMMAND, "Colour #08", "Colour #08", None, None, None, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR09 = [0x1a9, TID_COMMAND, "Colour #09", "Colour #09", None, None, None, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR10 = [0x1aa, TID_COMMAND, "Colour #10", "Colour #10", None, None, None, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR11 = [0x1ab, TID_COMMAND, "Colour #11", "Colour #11", None, None, None, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR12 = [0x1ac, TID_COMMAND, "Colour #12", "Colour #12", None, None, None, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR13 = [0x1ad, TID_COMMAND, "Colour #13", "Colour #13", None, None, None, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR14 = [0x1ae, TID_COMMAND, "Colour #14", "Colour #14", None, None, None, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR15 = [0x1af, TID_COMMAND, "Colour #15", "Colour #15", None, None, None, MiRCARTCanvasInterface.canvasColour] # }}} # {{{ Menus MID_FILE = (0x300, TID_MENU, "File", "&File", ( \ @@ -147,23 +141,25 @@ class MiRCARTFrame(MiRCARTGeneralFrame): toolBitmapDc.DrawRectangle(0, 0, 16, 16) paletteDescr[numColour][4] = ["", None, toolBitmap] # }}} - # {{{ _dialogSaveChanges(self) - def _dialogSaveChanges(self): - with wx.MessageDialog(self, \ - "Do you want to save changes to {}?".format( \ - self.canvasPathName), "MiRCART", \ - wx.CANCEL|wx.CANCEL_DEFAULT|wx.ICON_QUESTION|wx.YES_NO) as dialog: - dialogChoice = dialog.ShowModal() - return dialogChoice + + # {{{ onInput(self, event): XXX + def onInput(self, event): + eventId = event.GetId() + if eventId >= self.CID_COLOUR00[0] \ + and eventId <= self.CID_COLOUR15[0]: + numColour = eventId - self.CID_COLOUR00[0] + self.itemsById[eventId][7](self.panelCanvas.canvasInterface, event, numColour) + else: + self.itemsById[eventId][7](self.panelCanvas.canvasInterface, event) # }}} - # {{{ _updateStatusBar(self, showColours=None, showFileName=True, showPos=None): XXX - def _updateStatusBar(self, showColours=True, showFileName=True, showPos=True): + # {{{ onStatusBarUpdate(self, showColours=None, showFileName=True, showPos=None): XXX + def onStatusBarUpdate(self, showColours=True, showFileName=True, showPos=True): if showColours == True: showColours = self.panelCanvas.brushColours if showPos == True: showPos = self.panelCanvas.brushPos if showFileName == True: - showFileName = self.canvasPathName + showFileName = self.panelCanvas.canvasInterface.canvasPathName textItems = [] if showPos != None: textItems.append("X: {:03d} Y: {:03d}".format( \ @@ -179,139 +175,8 @@ class MiRCARTFrame(MiRCARTGeneralFrame): os.path.basename(showFileName))) self.statusBar.SetStatusText(" | ".join(textItems)) # }}} - - # {{{ canvasExportAsPng(self): XXX - def canvasExportAsPng(self): - with wx.FileDialog(self, self.CID_SAVEAS[2], os.getcwd(), "", \ - "*.png", wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) as dialog: - if dialog.ShowModal() == wx.ID_CANCEL: - return False - else: - outPathName = dialog.GetPath() - self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) - self.panelCanvas.canvasExportStore.exportBitmapToPngFile( \ - self.panelCanvas.canvasBackend.canvasBitmap, outPathName, \ - wx.BITMAP_TYPE_PNG) - self.SetCursor(wx.Cursor(wx.NullCursor)) - return True - # }}} - # {{{ canvasExportImgur(self): XXX - def canvasExportImgur(self): - self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) - imgurResult = self.panelCanvas.canvasExportStore.exportBitmapToImgur( \ - "c9a6efb3d7932fd", self.panelCanvas.canvasBackend.canvasBitmap, \ - "", "", wx.BITMAP_TYPE_PNG) - self.SetCursor(wx.Cursor(wx.NullCursor)) - if imgurResult[0] == 200: - if not wx.TheClipboard.IsOpened(): - wx.TheClipboard.Open() - wx.TheClipboard.SetData(wx.TextDataObject(imgurResult[1])) - wx.TheClipboard.Close() - wx.MessageBox("Exported to Imgur: " + imgurResult[1], \ - "Export to Imgur", wx.OK|wx.ICON_INFORMATION) - else: - wx.MessageBox("Failed to export to Imgur: " + imgurResult[1], \ - "Export to Imgur", wx.OK|wx.ICON_EXCLAMATION) - # }}} - # {{{ canvasExportPastebin(self): XXX - def canvasExportPastebin(self): - self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) - pasteStatus, pasteResult = \ - self.panelCanvas.canvasExportStore.exportPastebin( \ - "253ce2f0a45140ee0a44ca99aa49260", \ - self.panelCanvas.canvasMap, \ - self.panelCanvas.canvasSize) - self.SetCursor(wx.Cursor(wx.NullCursor)) - if pasteStatus: - if not wx.TheClipboard.IsOpened(): - wx.TheClipboard.Open() - wx.TheClipboard.SetData(wx.TextDataObject(pasteResult)) - wx.TheClipboard.Close() - wx.MessageBox("Exported to Pastebin: " + pasteResult, \ - "Export to Pastebin", wx.OK|wx.ICON_INFORMATION) - else: - wx.MessageBox("Failed to export to Pastebin: " + pasteResult, \ - "Export to Pastebin", wx.OK|wx.ICON_EXCLAMATION) - # }}} - # {{{ canvasNew(self, newCanvasSize=None): XXX - def canvasNew(self, newCanvasSize=None): - if self.canvasPathName != None: - saveChanges = self._dialogSaveChanges() - if saveChanges == wx.ID_CANCEL: - return - elif saveChanges == wx.ID_NO: - pass - elif saveChanges == wx.ID_YES: - self.canvasSave() - self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) - if newCanvasSize == None: - newCanvasSize = (100, 30) - self.panelCanvas.canvasImportStore.importNew(newCanvasSize) - self.canvasPathName = None - self.SetCursor(wx.Cursor(wx.NullCursor)) - self._updateStatusBar(); self.onCanvasUpdate(); - # }}} - # {{{ canvasOpen(self): XXX - def canvasOpen(self): - if self.canvasPathName != None: - saveChanges = self._dialogSaveChanges() - if saveChanges == wx.ID_CANCEL: - return - elif saveChanges == wx.ID_NO: - pass - elif saveChanges == wx.ID_YES: - self.canvasSave() - with wx.FileDialog(self, self.CID_OPEN[2], os.getcwd(), "", \ - "*.txt", wx.FD_OPEN) as dialog: - if dialog.ShowModal() == wx.ID_CANCEL: - return False - else: - self.canvasPathName = dialog.GetPath() - self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) - self.panelCanvas.canvasImportStore.importTextFile(self.canvasPathName) - self.panelCanvas.canvasImportStore.importIntoPanel() - self.SetCursor(wx.Cursor(wx.NullCursor)) - self._updateStatusBar(); self.onCanvasUpdate(); - return True - # }}} - # {{{ canvasSave(self): XXX - def canvasSave(self): - if self.canvasPathName == None: - if self.canvasSaveAs() == False: - return - try: - with open(self.canvasPathName, "w") as outFile: - self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) - self.panelCanvas.canvasExportStore.exportTextFile( \ - self.panelCanvas.canvasMap, \ - self.panelCanvas.canvasSize, outFile) - self.SetCursor(wx.Cursor(wx.NullCursor)) - return True - except IOError as error: - return False - # }}} - # {{{ canvasSaveAs(self): XXX - def canvasSaveAs(self): - with wx.FileDialog(self, self.CID_SAVEAS[2], os.getcwd(), "", \ - "*.txt", wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) as dialog: - if dialog.ShowModal() == wx.ID_CANCEL: - return False - else: - self.canvasPathName = dialog.GetPath() - return self.canvasSave() - # }}} - # {{{ onCanvasMotion(self, event): XXX - def onCanvasMotion(self, event, atPoint=None): - eventType = event.GetEventType() - if eventType == wx.wxEVT_ENTER_WINDOW: - self.SetFocus() - elif eventType == wx.wxEVT_MOTION: - self._updateStatusBar(showPos=atPoint) - elif eventType == wx.wxEVT_LEAVE_WINDOW: - pass - # }}} - # {{{ onCanvasUpdate(self): XXX - def onCanvasUpdate(self): + # {{{ onUndoUpdate(self): XXX + def onUndoUpdate(self): if self.panelCanvas.canvasJournal.patchesUndo[self.panelCanvas.canvasJournal.patchesUndoLevel] != None: self.menuItemsById[self.CID_UNDO[0]].Enable(True) self.toolBar.EnableTool(self.CID_UNDO[0], True) @@ -325,106 +190,14 @@ class MiRCARTFrame(MiRCARTGeneralFrame): self.menuItemsById[self.CID_REDO[0]].Enable(False) self.toolBar.EnableTool(self.CID_REDO[0], False) # }}} - # {{{ onFrameCommand(self, event): XXX - def onFrameCommand(self, event): - cid = event.GetId() - if cid == self.CID_NEW[0]: - self.canvasNew() - elif cid == self.CID_OPEN[0]: - self.canvasOpen() - elif cid == self.CID_SAVE[0]: - self.canvasSave() - elif cid == self.CID_SAVEAS[0]: - self.canvasSaveAs() - elif cid == self.CID_EXPORT_AS_PNG[0]: - self.canvasExportAsPng() - elif cid == self.CID_EXPORT_IMGUR[0]: - self.canvasExportImgur() - elif cid == self.CID_EXPORT_PASTEBIN[0]: - self.canvasExportPastebin() - elif cid == self.CID_EXIT[0]: - self.Close(True) - elif cid == self.CID_UNDO[0]: - self.panelCanvas.popUndo() - elif cid == self.CID_REDO[0]: - self.panelCanvas.popRedo() - elif cid == self.CID_CUT[0]: - pass - elif cid == self.CID_COPY[0]: - pass - elif cid == self.CID_PASTE[0]: - pass - elif cid == self.CID_DELETE[0]: - pass - elif cid == self.CID_INCR_CANVAS[0] \ - or cid == self.CID_DECR_CANVAS[0]: - eventDc = self.panelCanvas.canvasBackend.getDeviceContext(self) - if cid == self.CID_INCR_CANVAS[0]: - newCanvasSize = [a+1 for a in self.panelCanvas.canvasSize] - else: - newCanvasSize = [a-1 if a > 1 else a for a in self.panelCanvas.canvasSize] - self.panelCanvas.resize(newCanvasSize) - self.panelCanvas.canvasBackend.resize( \ - newCanvasSize, \ - self.panelCanvas.canvasBackend.cellSize) - for numRow in range(self.panelCanvas.canvasSize[1] - 1): - self.panelCanvas.canvasMap.append([[1, 1], 0, " "]) - self.panelCanvas.canvasMap.append([]) - for numCol in range(self.panelCanvas.canvasSize[0]): - self.panelCanvas.canvasMap[-1].append([[1, 1], 0, " "]) - self.panelCanvas.canvasBackend.drawPatch(eventDc, \ - ([numCol, self.panelCanvas.canvasSize[1] - 1], *[[1, 1], 0, " "])) - wx.SafeYield() - elif cid == self.CID_INCR_BRUSH[0]: - self.panelCanvas.brushSize = \ - [a+1 for a in self.panelCanvas.brushSize] - elif cid == self.CID_DECR_BRUSH[0] \ - and self.panelCanvas.brushSize[0] > 1 \ - and self.panelCanvas.brushSize[1] > 1: - self.panelCanvas.brushSize = \ - [a-1 for a in self.panelCanvas.brushSize] - elif cid == self.CID_SOLID_BRUSH[0]: - pass - elif cid == self.CID_RECT[0]: - self.menuItemsById[cid].Check(True) - self.panelCanvas.canvasCurTool = \ - MiRCARTToolRect(self.panelCanvas) - elif cid == self.CID_CIRCLE[0]: - self.menuItemsById[cid].Check(True) - self.panelCanvas.canvasCurTool = \ - MiRCARTToolCircle(self.panelCanvas) - elif cid == self.CID_LINE[0]: - self.menuItemsById[cid].Check(True) - self.panelCanvas.canvasCurTool = \ - MiRCARTToolLine(self.panelCanvas) - elif cid == self.CID_TEXT[0]: - self.menuItemsById[cid].Check(True) - self.panelCanvas.canvasCurTool = \ - MiRCARTToolText(self.panelCanvas) - elif cid >= self.CID_COLOUR00[0] \ - and cid <= self.CID_COLOUR15[0]: - numColour = cid - self.CID_COLOUR00[0] - if event.GetEventType() == wx.wxEVT_TOOL: - self.panelCanvas.brushColours[0] = numColour - elif event.GetEventType() == wx.wxEVT_TOOL_RCLICKED: - self.panelCanvas.brushColours[1] = numColour - self._updateStatusBar() - # }}} - # {{{ __del__(self): destructor method - def __del__(self): - if self.panelCanvas != None: - self.panelCanvas.Close(); self.panelCanvas = None; - # }}} # # __init__(self, parent, appSize=(840, 630), canvasPos=(25, 50), canvasSize=(125, 35), cellSize=(7, 14)): initialisation method def __init__(self, parent, appSize=(840, 630), canvasPos=(25, 50), canvasSize=(125, 35), cellSize=(7, 14)): self._initPaletteToolBitmaps() panelSkin = super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) - self.canvasPathName = None self.panelCanvas = MiRCARTCanvas(panelSkin, parentFrame=self, \ canvasPos=canvasPos, canvasSize=canvasSize, cellSize=cellSize) - self.panelCanvas.canvasCurTool = MiRCARTToolRect(self.panelCanvas) - self.canvasNew() + self.panelCanvas.canvasInterface.canvasNew(None) # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTGeneralFrame.py b/MiRCARTGeneralFrame.py index 7274af5..75afc7c 100644 --- a/MiRCARTGeneralFrame.py +++ b/MiRCARTGeneralFrame.py @@ -34,68 +34,77 @@ TID_NOTHING = (0x005) TID_SELECT = (0x006) TID_TOOLBAR = (0x007) +# +# Non-items +NID_MENU_SEP = (0x200, TID_NOTHING) +NID_TOOLBAR_SEP = (0x201, TID_NOTHING) + class MiRCARTGeneralFrame(wx.Frame): """XXX""" - menuItemsById = toolBarItemsById = None + itemsById = menuItemsById = toolBarItemsById = None statusBar = toolBar = None - # {{{ _initAccelTable(self, accelsDescr, handler): XXX - def _initAccelTable(self, accelsDescr, handler): + # {{{ _initAccelTable(self, accelsDescr): XXX + def _initAccelTable(self, accelsDescr): accelTableEntries = [wx.AcceleratorEntry() for n in range(len(accelsDescr[2]))] for numAccel in range(len(accelsDescr[2])): accelDescr = accelsDescr[2][numAccel] if accelDescr[5] != None: + self.itemsById[accelDescr[0]] = accelDescr accelTableEntries[numAccel].Set(*accelDescr[5], accelDescr[0]) - self.Bind(wx.EVT_MENU, handler, id=accelDescr[0]) + self.Bind(wx.EVT_MENU, self.onInput, id=accelDescr[0]) return accelTableEntries # }}} - # {{{ _initMenus(self, menusDescr, handler): XXX - def _initMenus(self, menusDescr, handler): + # {{{ _initMenus(self, menusDescr): XXX + def _initMenus(self, menusDescr): self.menuItemsById = {}; menuBar = wx.MenuBar(); for menuDescr in menusDescr: menuWindow = wx.Menu() for menuItem in menuDescr[4]: - if menuItem == self.NID_MENU_SEP: + if menuItem == NID_MENU_SEP: menuWindow.AppendSeparator() elif menuItem[1] == TID_SELECT: + self.itemsById[menuItem[0]] = menuItem menuItemWindow = menuWindow.AppendRadioItem(menuItem[0], menuItem[3], menuItem[2]) self.menuItemsById[menuItem[0]] = menuItemWindow - self.Bind(wx.EVT_MENU, handler, menuItemWindow) - if len(menuItem) == 7: + self.Bind(wx.EVT_MENU, self.onInput, menuItemWindow) + if menuItem[6] != None: menuItemWindow.Check(menuItem[6]) else: + self.itemsById[menuItem[0]] = menuItem menuItemWindow = menuWindow.Append(menuItem[0], menuItem[3], menuItem[2]) self.menuItemsById[menuItem[0]] = menuItemWindow - self.Bind(wx.EVT_MENU, handler, menuItemWindow) - if len(menuItem) == 7: + self.Bind(wx.EVT_MENU, self.onInput, menuItemWindow) + if menuItem[6] != None: menuItemWindow.Enable(menuItem[6]) menuBar.Append(menuWindow, menuDescr[3]) return menuBar # }}} - # {{{ _initToolBars(self, toolBarsDescr, handler): XXX - def _initToolBars(self, toolBarsDescr, handler, panelSkin): + # {{{ _initToolBars(self, toolBarsDescr, panelSkin): XXX + def _initToolBars(self, toolBarsDescr, panelSkin): self.toolBarItemsById = {} self.toolBar = wx.ToolBar(panelSkin, -1, \ style=wx.HORIZONTAL|wx.TB_FLAT|wx.TB_NODIVIDER) self.toolBar.SetToolBitmapSize((16,16)) for toolBarItem in toolBarsDescr[2]: - if toolBarItem == self.NID_TOOLBAR_SEP: + if toolBarItem == NID_TOOLBAR_SEP: self.toolBar.AddSeparator() else: + self.itemsById[toolBarItem[0]] = toolBarItem toolBarItemWindow = self.toolBar.AddTool( \ toolBarItem[0], toolBarItem[2], toolBarItem[4][2]) self.toolBarItemsById[toolBarItem[0]] = toolBarItemWindow - if len(toolBarItem) == 7 \ + if toolBarItem[6] != None \ and toolBarItem[1] == TID_COMMAND: toolBarItemWindow.Enable(toolBarItem[6]) - self.Bind(wx.EVT_TOOL, handler, toolBarItemWindow) - self.Bind(wx.EVT_TOOL_RCLICKED, handler, toolBarItemWindow) + self.Bind(wx.EVT_TOOL, self.onInput, toolBarItemWindow) + self.Bind(wx.EVT_TOOL_RCLICKED, self.onInput, toolBarItemWindow) self.toolBar.Realize(); self.toolBar.Fit(); # }}} - # {{{ _initToolBitmaps(self): XXX + # {{{ _initToolBitmaps(self, toolBarsDescr): XXX def _initToolBitmaps(self, toolBarsDescr): for toolBarItem in toolBarsDescr[2]: - if toolBarItem == self.NID_TOOLBAR_SEP: + if toolBarItem == NID_TOOLBAR_SEP: continue elif toolBarItem[4] == None: toolBarItem[4] = ["", None, wx.ArtProvider.GetBitmap( \ @@ -115,42 +124,32 @@ class MiRCARTGeneralFrame(wx.Frame): toolBitmap.LoadFile(toolBitmapPathName, wx.BITMAP_TYPE_ANY) toolBarItem[4] = ["", None, toolBitmap] # }}} - # {{{ onClose(self, event): XXX - def onClose(self, event): - self.Destroy(); self.__del__(); - # }}} - # {{{ onFrameCommand(self, event): XXX - def onFrameCommand(self, event): + # {{{ onInput(self, event): XXX + def onInput(self, event): pass # }}} # # __init__(self, *args, **kwargs): initialisation method def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) + super().__init__(*args, **kwargs); self.itemsById = {}; panelSkin = wx.Panel(self, wx.ID_ANY) # Initialise menu bar, menus & menu items # Initialise toolbar & toolbar items - menuBar = self._initMenus(self.LID_MENUS[2], \ - self.onFrameCommand) + menuBar = self._initMenus(self.LID_MENUS[2]) self.SetMenuBar(menuBar) self._initToolBitmaps(self.LID_TOOLBARS[2]) - toolBar = self._initToolBars(self.LID_TOOLBARS[2], \ - self.onFrameCommand, panelSkin) + toolBar = self._initToolBars(self.LID_TOOLBARS[2], panelSkin) # Initialise accelerators (hotkeys) accelTable = wx.AcceleratorTable( \ - self._initAccelTable(self.LID_ACCELS[2], \ - self.onFrameCommand)) + self._initAccelTable(self.LID_ACCELS[2])) self.SetAcceleratorTable(accelTable) # Initialise status bar self.statusBar = self.CreateStatusBar() - # Bind event handlers - self.Bind(wx.EVT_CLOSE, self.onClose) - # Set focus on & show window self.SetFocus(); self.Show(True); From 1b00bb3b2f6b78c1c9b065fadb8c1cafa4d4184c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 10 Jan 2018 04:23:54 +0100 Subject: [PATCH 097/148] MiRCART{Canvas{,Interface},Frame}.py: merge on{StatusBar,Undo}Update() into onCanvasUpdate(). MiRCARTCanvas{Frame,Interface}.py: adds canvas{De,In}crCanvas{Height,Width}() & CID_*. MiRCARTCanvasFrame.py:onCanvasUpdate(): updated. --- MiRCARTCanvas.py | 10 +-- MiRCARTCanvasInterface.py | 42 ++++++++---- MiRCARTFrame.py | 132 +++++++++++++++++++++----------------- 3 files changed, 107 insertions(+), 77 deletions(-) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index 5de4b44..6a3f73e 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -48,7 +48,7 @@ class MiRCARTCanvas(wx.Panel): for patch in deltaPatches: if self.canvasBackend.drawPatch(eventDc, patch): self._commitPatch(patch) - self.parentFrame.onUndoUpdate() + self.parentFrame.onCanvasUpdate(newUndoLevel=self.canvasJournal.patchesUndoLevel) # }}} # {{{ _dispatchPatch(self, eventDc, isCursor, patch): XXX def _dispatchPatch(self, eventDc, isCursor, patch): @@ -98,9 +98,10 @@ class MiRCARTCanvas(wx.Panel): event.Dragging(), event.LeftIsDown(), event.RightIsDown(), \ self._dispatchPatch, eventDc) if self._canvasDirty: - self.parentFrame.onUndoUpdate() + self.parentFrame.onCanvasUpdate(newCellPos=self.brushPos, \ + newUndoLevel=self.canvasJournal.patchesUndoLevel) if eventType == wx.wxEVT_MOTION: - self.parentFrame.onStatusBarUpdate(showPos=mapPoint) + self.parentFrame.onCanvasUpdate(newCellPos=mapPoint) # }}} # {{{ onPanelLeaveWindow(self, event): XXX def onPanelLeaveWindow(self, event): @@ -149,7 +150,7 @@ class MiRCARTCanvas(wx.Panel): self.canvasBackend.cellSize)]) self.canvasBackend.reset(self.canvasSize, self.canvasBackend.cellSize) self.canvasJournal.resetCursor(); self.canvasJournal.resetUndo(); - self.parentFrame.onUndoUpdate() + self.parentFrame.onCanvasUpdate(newUndoLevel=-1) # }}} # @@ -161,6 +162,7 @@ class MiRCARTCanvas(wx.Panel): self.parentFrame = parentFrame self.canvasMap = None; self.canvasPos = canvasPos; self.canvasSize = canvasSize; self.brushColours = [4, 1]; self.brushPos = [0, 0]; self.brushSize = [1, 1]; + self.parentFrame.onCanvasUpdate(newColours=self.brushColours) self.canvasBackend = MiRCARTCanvasBackend(canvasSize, cellSize) self.canvasJournal = MiRCARTCanvasJournal() self.canvasExportStore = MiRCARTCanvasExportStore(parentCanvas=self) diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index 105b2fd..6b60b67 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -69,7 +69,7 @@ class MiRCARTCanvasInterface(): self.parentCanvas.brushColours[0] = numColour elif event.GetEventType() == wx.wxEVT_TOOL_RCLICKED: self.parentCanvas.brushColours[1] = numColour - self.parentFrame.onStatusBarUpdate() + self.parentFrame.onCanvasUpdate(newColours=self.parentCanvas.brushColours) # }}} # {{{ canvasCopy(self, event): XXX def canvasCopy(self, event): @@ -86,10 +86,19 @@ class MiRCARTCanvasInterface(): self.parentCanvas.brushSize = \ [a-1 for a in self.parentCanvas.brushSize] # }}} - # {{{ canvasDecrCanvas(self, event): XXX - def canvasDecrCanvas(self, event): - newCanvasSize = [a-1 if a > 1 else a for a in self.parentCanvas.canvasSize] - self._updateCanvasSize(newCanvasSize) + # {{{ canvasDecrCanvasHeight(self, event): XXX + def canvasDecrCanvasHeight(self, event): + if self.parentCanvas.canvasSize[1] > 1: + self._updateCanvasSize([ \ + self.parentCanvas.canvasSize[0], \ + self.parentCanvas.canvasSize[1]-1]) + # }}} + # {{{ canvasDecrCanvasWidth(self, event): XXX + def canvasDecrCanvasWidth(self, event): + if self.parentCanvas.canvasSize[0] > 1: + self._updateCanvasSize([ \ + self.parentCanvas.canvasSize[0]-1, \ + self.parentCanvas.canvasSize[1]]) # }}} # {{{ canvasDelete(self, event): XXX def canvasDelete(self, event): @@ -157,10 +166,17 @@ class MiRCARTCanvasInterface(): self.parentCanvas.brushSize = \ [a+1 for a in self.parentCanvas.brushSize] # }}} - # {{{ canvasIncrCanvas(self, event): XXX - def canvasIncrCanvas(self, event): - newCanvasSize = [a+1 for a in self.parentCanvas.canvasSize] - self._updateCanvasSize(newCanvasSize) + # {{{ canvasIncrCanvasHeight(self, event): XXX + def canvasIncrCanvasHeight(self, event): + self._updateCanvasSize([ \ + self.parentCanvas.canvasSize[0], \ + self.parentCanvas.canvasSize[1]+1]) + # }}} + # {{{ canvasIncrCanvasWidth(self, event): XXX + def canvasIncrCanvasWidth(self, event): + self._updateCanvasSize([ \ + self.parentCanvas.canvasSize[0]+1, \ + self.parentCanvas.canvasSize[1]]) # }}} # {{{ canvasNew(self, event, newCanvasSize=None): XXX def canvasNew(self, event, newCanvasSize=None): @@ -178,8 +194,8 @@ class MiRCARTCanvasInterface(): self.parentCanvas.canvasImportStore.importNew(newCanvasSize) self.canvasPathName = None self.parentCanvas.SetCursor(wx.Cursor(wx.NullCursor)) - self.parentFrame.onStatusBarUpdate() - self.parentFrame.onUndoUpdate() + self.parentFrame.onCanvasUpdate( \ + newPathName="", newUndoLevel=-1) # }}} # {{{ canvasOpen(self, event): XXX def canvasOpen(self, event): @@ -201,8 +217,8 @@ class MiRCARTCanvasInterface(): self.parentCanvas.canvasImportStore.importTextFile(self.canvasPathName) self.parentCanvas.canvasImportStore.importIntoPanel() self.parentCanvas.SetCursor(wx.Cursor(wx.NullCursor)) - self.parentFrame.onStatusBarUpdate(showFileName=self.canvasPathName) - self.parentFrame.onUndoUpdate() + self.parentFrame.onCanvasUpdate( \ + newPathName=self.canvasPathName, newUndoLevel=-1) return True # }}} # {{{ canvasPaste(self, event): XXX diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 1d7b3be..4a76177 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -34,6 +34,7 @@ import os, wx class MiRCARTFrame(MiRCARTGeneralFrame): """XXX""" panelCanvas = None + lastCellPos = lastColours = lastPathName = lastUndoLevel = None # {{{ Commands # Id Type Id Labels Icon bitmap Accelerator [Initial state] @@ -54,15 +55,19 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_COPY = [0x10b, TID_COMMAND, "Copy", "&Copy", ["", wx.ART_COPY], None, False, MiRCARTCanvasInterface.canvasCopy] CID_PASTE = [0x10c, TID_COMMAND, "Paste", "&Paste", ["", wx.ART_PASTE], None, False, MiRCARTCanvasInterface.canvasPaste] CID_DELETE = [0x10d, TID_COMMAND, "Delete", "De&lete", ["", wx.ART_DELETE], None, False, MiRCARTCanvasInterface.canvasDelete] - CID_INCR_CANVAS = [0x10e, TID_COMMAND, "Increase canvas size", \ - "I&ncrease canvas size", ["", wx.ART_PLUS], [wx.ACCEL_ALT, ord("+")], None, MiRCARTCanvasInterface.canvasIncrCanvas] - CID_DECR_CANVAS = [0x10f, TID_COMMAND, "Decrease canvas size", \ - "D&ecrease canvas size", ["", wx.ART_MINUS], [wx.ACCEL_ALT, ord("-")], None, MiRCARTCanvasInterface.canvasDecrCanvas] - CID_INCR_BRUSH = [0x110, TID_COMMAND, "Increase brush size", \ - "&Increase brush size", ["", wx.ART_PLUS], [wx.ACCEL_CTRL, ord("+")], None, MiRCARTCanvasInterface.canvasIncrBrush] - CID_DECR_BRUSH = [0x111, TID_COMMAND, "Decrease brush size", \ + CID_INCRW_CANVAS = [0x10e, TID_COMMAND, "Increase canvas width", \ + "Increase canvas &width", ["", wx.ART_PLUS], [wx.ACCEL_ALT, ord("D")], None, MiRCARTCanvasInterface.canvasIncrCanvasWidth] + CID_DECRW_CANVAS = [0x10f, TID_COMMAND, "Decrease canvas width", \ + "Decrease canvas w&idth", ["", wx.ART_MINUS], [wx.ACCEL_ALT, ord("A")], None, MiRCARTCanvasInterface.canvasDecrCanvasWidth] + CID_INCRH_CANVAS = [0x110, TID_COMMAND, "Increase canvas height", \ + "Increase canvas &height", ["", wx.ART_PLUS], [wx.ACCEL_ALT, ord("S")], None, MiRCARTCanvasInterface.canvasIncrCanvasHeight] + CID_DECRH_CANVAS = [0x111, TID_COMMAND, "Decrease canvas height", \ + "Decrease canvas h&eight", ["", wx.ART_MINUS], [wx.ACCEL_ALT, ord("W")], None, MiRCARTCanvasInterface.canvasDecrCanvasHeight] + CID_INCR_BRUSH = [0x112, TID_COMMAND, "Increase brush size", \ + "I&ncrease brush size", ["", wx.ART_PLUS], [wx.ACCEL_CTRL, ord("+")], None, MiRCARTCanvasInterface.canvasIncrBrush] + CID_DECR_BRUSH = [0x113, TID_COMMAND, "Decrease brush size", \ "&Decrease brush size", ["", wx.ART_MINUS], [wx.ACCEL_CTRL, ord("-")], None, MiRCARTCanvasInterface.canvasDecrBrush] - CID_SOLID_BRUSH = [0x112, TID_SELECT, "Solid brush", "&Solid brush", None, None, True, MiRCARTCanvasInterface.canvasBrushSolid] + CID_SOLID_BRUSH = [0x114, TID_SELECT, "Solid brush", "&Solid brush", None, None, True, MiRCARTCanvasInterface.canvasBrushSolid] CID_RECT = [0x150, TID_SELECT, "Rectangle", "&Rectangle", ["toolRect.png"], [wx.ACCEL_CTRL, ord("R")], True, MiRCARTCanvasInterface.canvasToolRect] CID_CIRCLE = [0x151, TID_SELECT, "Circle", "&Circle", ["toolCircle.png"], [wx.ACCEL_CTRL, ord("C")], False, MiRCARTCanvasInterface.canvasToolCircle] @@ -87,34 +92,35 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_COLOUR15 = [0x1af, TID_COMMAND, "Colour #15", "Colour #15", None, None, None, MiRCARTCanvasInterface.canvasColour] # }}} # {{{ Menus - MID_FILE = (0x300, TID_MENU, "File", "&File", ( \ - CID_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_MENU_SEP, \ - CID_EXPORT_AS_PNG, CID_EXPORT_IMGUR, CID_EXPORT_PASTEBIN, NID_MENU_SEP, \ + MID_FILE = (0x300, TID_MENU, "File", "&File", ( \ + CID_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_MENU_SEP, \ + CID_EXPORT_AS_PNG, CID_EXPORT_IMGUR, CID_EXPORT_PASTEBIN, NID_MENU_SEP, \ CID_EXIT)) - MID_EDIT = (0x301, TID_MENU, "Edit", "&Edit", ( \ - CID_UNDO, CID_REDO, NID_MENU_SEP, \ - CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_MENU_SEP, \ - CID_INCR_CANVAS, CID_DECR_CANVAS, NID_MENU_SEP, \ + MID_EDIT = (0x301, TID_MENU, "Edit", "&Edit", ( \ + CID_UNDO, CID_REDO, NID_MENU_SEP, \ + CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_MENU_SEP, \ + CID_INCRW_CANVAS, CID_DECRW_CANVAS, CID_INCRH_CANVAS, CID_DECRH_CANVAS, NID_MENU_SEP, \ CID_INCR_BRUSH, CID_DECR_BRUSH, CID_SOLID_BRUSH)) - MID_TOOLS = (0x302, TID_MENU, "Tools", "&Tools", ( \ + MID_TOOLS = (0x302, TID_MENU, "Tools", "&Tools", ( \ CID_RECT, CID_CIRCLE, CID_LINE, CID_TEXT)) # }}} # {{{ Toolbars - BID_TOOLBAR = (0x400, TID_TOOLBAR, ( \ - CID_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_TOOLBAR_SEP, \ - CID_UNDO, CID_REDO, NID_TOOLBAR_SEP, \ - CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_TOOLBAR_SEP, \ - CID_INCR_BRUSH, CID_DECR_BRUSH, NID_TOOLBAR_SEP, \ - CID_RECT, CID_CIRCLE, CID_LINE, CID_TEXT, NID_TOOLBAR_SEP, \ - CID_COLOUR00, CID_COLOUR01, CID_COLOUR02, CID_COLOUR03, CID_COLOUR04, \ - CID_COLOUR05, CID_COLOUR06, CID_COLOUR07, CID_COLOUR08, CID_COLOUR09, \ - CID_COLOUR10, CID_COLOUR11, CID_COLOUR12, CID_COLOUR13, CID_COLOUR14, \ + BID_TOOLBAR = (0x400, TID_TOOLBAR, ( \ + CID_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_TOOLBAR_SEP, \ + CID_UNDO, CID_REDO, NID_TOOLBAR_SEP, \ + CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_TOOLBAR_SEP, \ + CID_INCR_BRUSH, CID_DECR_BRUSH, NID_TOOLBAR_SEP, \ + CID_RECT, CID_CIRCLE, CID_LINE, CID_TEXT, NID_TOOLBAR_SEP, \ + CID_COLOUR00, CID_COLOUR01, CID_COLOUR02, CID_COLOUR03, CID_COLOUR04, \ + CID_COLOUR05, CID_COLOUR06, CID_COLOUR07, CID_COLOUR08, CID_COLOUR09, \ + CID_COLOUR10, CID_COLOUR11, CID_COLOUR12, CID_COLOUR13, CID_COLOUR14, \ CID_COLOUR15)) # }}} # {{{ Accelerators (hotkeys) - AID_EDIT = (0x500, TID_ACCELS, ( \ - CID_NEW, CID_OPEN, CID_SAVE, CID_UNDO, CID_REDO, \ - CID_INCR_CANVAS, CID_DECR_CANVAS, CID_INCR_BRUSH, CID_DECR_BRUSH)) + AID_EDIT = (0x500, TID_ACCELS, ( \ + CID_NEW, CID_OPEN, CID_SAVE, CID_UNDO, CID_REDO, \ + CID_INCRW_CANVAS, CID_DECRW_CANVAS, CID_INCRH_CANVAS, CID_DECRH_CANVAS, \ + CID_INCR_BRUSH, CID_DECR_BRUSH)) # }}} # {{{ Lists LID_ACCELS = (0x600, TID_LIST, (AID_EDIT)) @@ -152,43 +158,49 @@ class MiRCARTFrame(MiRCARTGeneralFrame): else: self.itemsById[eventId][7](self.panelCanvas.canvasInterface, event) # }}} - # {{{ onStatusBarUpdate(self, showColours=None, showFileName=True, showPos=None): XXX - def onStatusBarUpdate(self, showColours=True, showFileName=True, showPos=True): - if showColours == True: - showColours = self.panelCanvas.brushColours - if showPos == True: - showPos = self.panelCanvas.brushPos - if showFileName == True: - showFileName = self.panelCanvas.canvasInterface.canvasPathName + # {{{ onCanvasUpdate(self, newCellPos=None, newColours=None, newPathName=None, newUndoLevel=None): XXX + def onCanvasUpdate(self, newCellPos=None, newColours=None, newPathName=None, newUndoLevel=None): + if newCellPos != None: + self.lastCellPos = newCellPos + if newColours != None: + self.lastColours = newColours + if newPathName != None: + self.lastPathName = newPathName + if newUndoLevel != None: + self.lastUndoLevel = newUndoLevel textItems = [] - if showPos != None: + if self.lastCellPos != None: textItems.append("X: {:03d} Y: {:03d}".format( \ - showPos[0], showPos[1])) - if showColours != None: + *self.lastCellPos)) + if self.lastColours != None: textItems.append("FG: {:02d}, BG: {:02d}".format( \ - showColours[0],showColours[1])) + *self.lastColours)) textItems.append("{} on {}".format( \ - MiRCARTColours[showColours[0]][4], \ - MiRCARTColours[showColours[1]][4])) - if showFileName != None: - textItems.append("Current file: {}".format( \ - os.path.basename(showFileName))) + MiRCARTColours[self.lastColours[0]][4], \ + MiRCARTColours[self.lastColours[1]][4])) + if self.lastPathName != None: + if self.lastPathName != "": + basePathName = os.path.basename(self.lastPathName) + textItems.append("Current file: {}".format(basePathName)) + self.SetTitle("{} - MiRCART".format(basePathName)) + else: + self.SetTitle("MiRCART") + if self.lastUndoLevel != None: + textItems.append("Undo level: {}".format(self.lastUndoLevel)) self.statusBar.SetStatusText(" | ".join(textItems)) - # }}} - # {{{ onUndoUpdate(self): XXX - def onUndoUpdate(self): - if self.panelCanvas.canvasJournal.patchesUndo[self.panelCanvas.canvasJournal.patchesUndoLevel] != None: - self.menuItemsById[self.CID_UNDO[0]].Enable(True) - self.toolBar.EnableTool(self.CID_UNDO[0], True) - else: - self.menuItemsById[self.CID_UNDO[0]].Enable(False) - self.toolBar.EnableTool(self.CID_UNDO[0], False) - if self.panelCanvas.canvasJournal.patchesUndoLevel > 0: - self.menuItemsById[self.CID_REDO[0]].Enable(True) - self.toolBar.EnableTool(self.CID_REDO[0], True) - else: - self.menuItemsById[self.CID_REDO[0]].Enable(False) - self.toolBar.EnableTool(self.CID_REDO[0], False) + if self.lastUndoLevel != None: + if self.lastUndoLevel >= 0: + self.menuItemsById[self.CID_UNDO[0]].Enable(True) + self.toolBar.EnableTool(self.CID_UNDO[0], True) + else: + self.menuItemsById[self.CID_UNDO[0]].Enable(False) + self.toolBar.EnableTool(self.CID_UNDO[0], False) + if self.lastUndoLevel > 0: + self.menuItemsById[self.CID_REDO[0]].Enable(True) + self.toolBar.EnableTool(self.CID_REDO[0], True) + else: + self.menuItemsById[self.CID_REDO[0]].Enable(False) + self.toolBar.EnableTool(self.CID_REDO[0], False) # }}} # From b91ba78abd82459573938de023229906a3bb8763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 10 Jan 2018 04:31:20 +0100 Subject: [PATCH 098/148] MiRCARTToolText.py: fix non-US ASCII character handling. --- MiRCARTToolText.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MiRCARTToolText.py b/MiRCARTToolText.py index ca1386a..ebb58fb 100644 --- a/MiRCARTToolText.py +++ b/MiRCARTToolText.py @@ -23,7 +23,7 @@ # from MiRCARTTool import MiRCARTTool -import string, wx +import wx class MiRCARTToolText(MiRCARTTool): """XXX""" @@ -36,8 +36,6 @@ class MiRCARTToolText(MiRCARTTool): if keyModifiers != wx.MOD_NONE \ and keyModifiers != wx.MOD_SHIFT: return True - elif not keyChar in string.printable: - return True else: if self.textColours == None: self.textColours = brushColours.copy() From 08fcfa3290b64aec7717e3c380cdc95960b605a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 10 Jan 2018 04:36:39 +0100 Subject: [PATCH 099/148] MiRCART{Canvas,Frame}.py: include canvas width and height in status bar. --- MiRCARTCanvas.py | 3 ++- MiRCARTFrame.py | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index 6a3f73e..a00e5d7 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -150,7 +150,8 @@ class MiRCARTCanvas(wx.Panel): self.canvasBackend.cellSize)]) self.canvasBackend.reset(self.canvasSize, self.canvasBackend.cellSize) self.canvasJournal.resetCursor(); self.canvasJournal.resetUndo(); - self.parentFrame.onCanvasUpdate(newUndoLevel=-1) + self.parentFrame.onCanvasUpdate( \ + newSize=self.canvasSize, newUndoLevel=-1) # }}} # diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 4a76177..3cf26e9 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -34,7 +34,7 @@ import os, wx class MiRCARTFrame(MiRCARTGeneralFrame): """XXX""" panelCanvas = None - lastCellPos = lastColours = lastPathName = lastUndoLevel = None + lastCellPos = lastColours = lastPathName = lastSize = lastUndoLevel = None # {{{ Commands # Id Type Id Labels Icon bitmap Accelerator [Initial state] @@ -158,20 +158,24 @@ class MiRCARTFrame(MiRCARTGeneralFrame): else: self.itemsById[eventId][7](self.panelCanvas.canvasInterface, event) # }}} - # {{{ onCanvasUpdate(self, newCellPos=None, newColours=None, newPathName=None, newUndoLevel=None): XXX - def onCanvasUpdate(self, newCellPos=None, newColours=None, newPathName=None, newUndoLevel=None): + # {{{ onCanvasUpdate(self, newCellPos=None, newColours=None, newPathName=None, newSize=None, newUndoLevel=None): XXX + def onCanvasUpdate(self, newCellPos=None, newColours=None, newPathName=None, newSize=None, newUndoLevel=None): if newCellPos != None: self.lastCellPos = newCellPos if newColours != None: self.lastColours = newColours if newPathName != None: self.lastPathName = newPathName + if newSize != None: + self.lastSize = newSize if newUndoLevel != None: self.lastUndoLevel = newUndoLevel textItems = [] if self.lastCellPos != None: textItems.append("X: {:03d} Y: {:03d}".format( \ *self.lastCellPos)) + if self.lastSize != None: + textItems.append("W: {:03d} H: {:03d}".format(*self.lastSize)) if self.lastColours != None: textItems.append("FG: {:02d}, BG: {:02d}".format( \ *self.lastColours)) From 7acb234404aaa375756a434915164dd26335892e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 10 Jan 2018 04:44:13 +0100 Subject: [PATCH 100/148] MiRCARTToolLine.py: honour brush size. --- MiRCARTToolLine.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/MiRCARTToolLine.py b/MiRCARTToolLine.py index 3180d0d..aeabc43 100644 --- a/MiRCARTToolLine.py +++ b/MiRCARTToolLine.py @@ -39,8 +39,8 @@ class MiRCARTToolLine(MiRCARTTool): def _pointSwap(self, a, b): return [b, a] # }}} - # {{{ _getLine(self, brushColours, eventDc, isCursor, originPoint, targetPoint, dispatchFn): XXX - def _getLine(self, brushColours, eventDc, isCursor, originPoint, targetPoint, dispatchFn): + # {{{ _getLine(self, brushColours, brushSize, eventDc, isCursor, originPoint, targetPoint, dispatchFn): XXX + def _getLine(self, brushColours, brushSize, eventDc, isCursor, originPoint, targetPoint, dispatchFn): originPoint = originPoint.copy(); targetPoint = targetPoint.copy(); pointDelta = self._pointDelta(originPoint, targetPoint) lineXSign = 1 if pointDelta[0] > 0 else -1; @@ -53,14 +53,15 @@ class MiRCARTToolLine(MiRCARTTool): lineXX, lineXY, lineYX, lineYY = 0, lineYSign, lineXSign, 0 lineD = 2 * pointDelta[1] - pointDelta[0]; lineY = 0; for lineX in range(pointDelta[0] + 1): - patch = [[ \ - originPoint[0] + lineX*lineXX + lineY*lineYX, \ - originPoint[1] + lineX*lineXY + lineY*lineYY], \ - brushColours, 0, " "] - if isCursor: - dispatchFn(eventDc, False, patch); dispatchFn(eventDc, True, patch); - else: - dispatchFn(eventDc, True, patch) + for brushStep in range(brushSize[0]): + patch = [[ \ + originPoint[0] + lineX*lineXX + lineY*lineYX + brushStep, \ + originPoint[1] + lineX*lineXY + lineY*lineYY], \ + brushColours, 0, " "] + if isCursor: + dispatchFn(eventDc, False, patch); dispatchFn(eventDc, True, patch); + else: + dispatchFn(eventDc, True, patch) if lineD > 0: lineD -= pointDelta[0]; lineY += 1; lineD += pointDelta[1] @@ -84,8 +85,8 @@ class MiRCARTToolLine(MiRCARTTool): elif self.toolState == self.TS_ORIGIN: targetPoint = list(atPoint) originPoint = self.toolOriginPoint - self._getLine(brushColours, eventDc, \ - isLeftDown or isRightDown, \ + self._getLine(brushColours, brushSize, \ + eventDc, isLeftDown or isRightDown, \ originPoint, targetPoint, dispatchFn) if isLeftDown or isRightDown: self.toolState = self.TS_NONE From 62ff843d03ac8251e4d317b48c3c4c5ba1de0e04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 10 Jan 2018 05:00:52 +0100 Subject: [PATCH 101/148] MiRCART{Canvas{,Interface},Frame}.py: remove undo level & show brush size in status bar. --- MiRCARTCanvas.py | 3 ++- MiRCARTCanvasInterface.py | 2 ++ MiRCARTFrame.py | 18 +++++++++++------- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index a00e5d7..7c4c67e 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -163,7 +163,8 @@ class MiRCARTCanvas(wx.Panel): self.parentFrame = parentFrame self.canvasMap = None; self.canvasPos = canvasPos; self.canvasSize = canvasSize; self.brushColours = [4, 1]; self.brushPos = [0, 0]; self.brushSize = [1, 1]; - self.parentFrame.onCanvasUpdate(newColours=self.brushColours) + self.parentFrame.onCanvasUpdate( \ + newBrushSize=self.brushSize, newColours=self.brushColours) self.canvasBackend = MiRCARTCanvasBackend(canvasSize, cellSize) self.canvasJournal = MiRCARTCanvasJournal() self.canvasExportStore = MiRCARTCanvasExportStore(parentCanvas=self) diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index 6b60b67..1b3b8cb 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -85,6 +85,7 @@ class MiRCARTCanvasInterface(): and self.parentCanvas.brushSize[1] > 1: self.parentCanvas.brushSize = \ [a-1 for a in self.parentCanvas.brushSize] + self.parentFrame.onCanvasUpdate(newBrushSize=self.parentCanvas.brushSize) # }}} # {{{ canvasDecrCanvasHeight(self, event): XXX def canvasDecrCanvasHeight(self, event): @@ -165,6 +166,7 @@ class MiRCARTCanvasInterface(): def canvasIncrBrush(self, event): self.parentCanvas.brushSize = \ [a+1 for a in self.parentCanvas.brushSize] + self.parentFrame.onCanvasUpdate(newBrushSize=self.parentCanvas.brushSize) # }}} # {{{ canvasIncrCanvasHeight(self, event): XXX def canvasIncrCanvasHeight(self, event): diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 3cf26e9..e2278b5 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -34,7 +34,7 @@ import os, wx class MiRCARTFrame(MiRCARTGeneralFrame): """XXX""" panelCanvas = None - lastCellPos = lastColours = lastPathName = lastSize = lastUndoLevel = None + lastBrushSize = lastCellPos = lastColours = lastPathName = lastSize = lastUndoLevel = None # {{{ Commands # Id Type Id Labels Icon bitmap Accelerator [Initial state] @@ -158,8 +158,10 @@ class MiRCARTFrame(MiRCARTGeneralFrame): else: self.itemsById[eventId][7](self.panelCanvas.canvasInterface, event) # }}} - # {{{ onCanvasUpdate(self, newCellPos=None, newColours=None, newPathName=None, newSize=None, newUndoLevel=None): XXX - def onCanvasUpdate(self, newCellPos=None, newColours=None, newPathName=None, newSize=None, newUndoLevel=None): + # {{{ onCanvasUpdate(self, newBrushSize=None, newCellPos=None, newColours=None, newPathName=None, newSize=None, newUndoLevel=None): XXX + def onCanvasUpdate(self, newBrushSize=None, newCellPos=None, newColours=None, newPathName=None, newSize=None, newUndoLevel=None): + if newBrushSize != None: + self.lastBrushSize = newBrushSize if newCellPos != None: self.lastCellPos = newCellPos if newColours != None: @@ -175,22 +177,24 @@ class MiRCARTFrame(MiRCARTGeneralFrame): textItems.append("X: {:03d} Y: {:03d}".format( \ *self.lastCellPos)) if self.lastSize != None: - textItems.append("W: {:03d} H: {:03d}".format(*self.lastSize)) + textItems.append("W: {:03d} H: {:03d}".format( \ + *self.lastSize)) + if self.lastBrushSize != None: + textItems.append("Brush: {:02d}x{:02d}".format( \ + *self.lastBrushSize)) if self.lastColours != None: textItems.append("FG: {:02d}, BG: {:02d}".format( \ *self.lastColours)) textItems.append("{} on {}".format( \ MiRCARTColours[self.lastColours[0]][4], \ MiRCARTColours[self.lastColours[1]][4])) - if self.lastPathName != None: + if self.lastPathName != None: if self.lastPathName != "": basePathName = os.path.basename(self.lastPathName) textItems.append("Current file: {}".format(basePathName)) self.SetTitle("{} - MiRCART".format(basePathName)) else: self.SetTitle("MiRCART") - if self.lastUndoLevel != None: - textItems.append("Undo level: {}".format(self.lastUndoLevel)) self.statusBar.SetStatusText(" | ".join(textItems)) if self.lastUndoLevel != None: if self.lastUndoLevel >= 0: From b486d3966ec3e8ef7a0ecc5b6ed2c75cca7c9819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 10 Jan 2018 05:05:59 +0100 Subject: [PATCH 102/148] MiRCART{CanvasInterface,Frame,Tool*}.py: include current tool name in status bar text. --- MiRCARTCanvasInterface.py | 4 ++++ MiRCARTFrame.py | 10 +++++++--- MiRCARTToolCircle.py | 1 + MiRCARTToolLine.py | 1 + MiRCARTToolRect.py | 1 + MiRCARTToolText.py | 1 + 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index 1b3b8cb..4b32b3c 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -261,18 +261,22 @@ class MiRCARTCanvasInterface(): # {{{ canvasToolCircle(self, event): XXX def canvasToolCircle(self, event): self.canvasTool = MiRCARTToolCircle(self.parentCanvas) + self.parentFrame.onCanvasUpdate(newToolName=self.canvasTool.name) # }}} # {{{ canvasToolLine(self, event): XXX def canvasToolLine(self, event): self.canvasTool = MiRCARTToolLine(self.parentCanvas) + self.parentFrame.onCanvasUpdate(newToolName=self.canvasTool.name) # }}} # {{{ canvasToolRect(self, event): XXX def canvasToolRect(self, event): self.canvasTool = MiRCARTToolRect(self.parentCanvas) + self.parentFrame.onCanvasUpdate(newToolName=self.canvasTool.name) # }}} # {{{ canvasToolText(self, event): XXX def canvasToolText(self, event): self.canvasTool = MiRCARTToolText(self.parentCanvas) + self.parentFrame.onCanvasUpdate(newToolName=self.canvasTool.name) # }}} # {{{ canvasUndo(self, event): XXX def canvasUndo(self, event): diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index e2278b5..8a92dbf 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -34,7 +34,7 @@ import os, wx class MiRCARTFrame(MiRCARTGeneralFrame): """XXX""" panelCanvas = None - lastBrushSize = lastCellPos = lastColours = lastPathName = lastSize = lastUndoLevel = None + lastBrushSize = lastCellPos = lastColours = lastPathName = lastSize = lastToolName = lastUndoLevel = None # {{{ Commands # Id Type Id Labels Icon bitmap Accelerator [Initial state] @@ -158,8 +158,8 @@ class MiRCARTFrame(MiRCARTGeneralFrame): else: self.itemsById[eventId][7](self.panelCanvas.canvasInterface, event) # }}} - # {{{ onCanvasUpdate(self, newBrushSize=None, newCellPos=None, newColours=None, newPathName=None, newSize=None, newUndoLevel=None): XXX - def onCanvasUpdate(self, newBrushSize=None, newCellPos=None, newColours=None, newPathName=None, newSize=None, newUndoLevel=None): + # {{{ onCanvasUpdate(self, newBrushSize=None, newCellPos=None, newColours=None, newPathName=None, newSize=None, newToolName=None, newUndoLevel=None): XXX + def onCanvasUpdate(self, newBrushSize=None, newCellPos=None, newColours=None, newPathName=None, newSize=None, newToolName=None, newUndoLevel=None): if newBrushSize != None: self.lastBrushSize = newBrushSize if newCellPos != None: @@ -170,6 +170,8 @@ class MiRCARTFrame(MiRCARTGeneralFrame): self.lastPathName = newPathName if newSize != None: self.lastSize = newSize + if newToolName != None: + self.lastToolName = newToolName if newUndoLevel != None: self.lastUndoLevel = newUndoLevel textItems = [] @@ -195,6 +197,8 @@ class MiRCARTFrame(MiRCARTGeneralFrame): self.SetTitle("{} - MiRCART".format(basePathName)) else: self.SetTitle("MiRCART") + if self.lastToolName != None: + textItems.append("Current tool: {}".format(self.lastToolName)) self.statusBar.SetStatusText(" | ".join(textItems)) if self.lastUndoLevel != None: if self.lastUndoLevel >= 0: diff --git a/MiRCARTToolCircle.py b/MiRCARTToolCircle.py index 52497e3..0fc5fb7 100644 --- a/MiRCARTToolCircle.py +++ b/MiRCARTToolCircle.py @@ -26,6 +26,7 @@ from MiRCARTTool import MiRCARTTool class MiRCARTToolCircle(MiRCARTTool): """XXX""" + name = "Circle" # # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): XXX diff --git a/MiRCARTToolLine.py b/MiRCARTToolLine.py index aeabc43..d22f1ad 100644 --- a/MiRCARTToolLine.py +++ b/MiRCARTToolLine.py @@ -26,6 +26,7 @@ from MiRCARTTool import MiRCARTTool class MiRCARTToolLine(MiRCARTTool): """XXX""" + name = "Line" toolOriginPoint = toolState = None TS_NONE = 0 diff --git a/MiRCARTToolRect.py b/MiRCARTToolRect.py index a1455a3..d4250ba 100644 --- a/MiRCARTToolRect.py +++ b/MiRCARTToolRect.py @@ -26,6 +26,7 @@ from MiRCARTTool import MiRCARTTool class MiRCARTToolRect(MiRCARTTool): """XXX""" + name = "Rectangle" # # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): XXX diff --git a/MiRCARTToolText.py b/MiRCARTToolText.py index ebb58fb..a3eb686 100644 --- a/MiRCARTToolText.py +++ b/MiRCARTToolText.py @@ -27,6 +27,7 @@ import wx class MiRCARTToolText(MiRCARTTool): """XXX""" + name = "Text" textColours = textPos = None # From f20174037ca145e522f0701b99607e60576901e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 10 Jan 2018 14:51:25 +0100 Subject: [PATCH 103/148] MiRCART{Canvas{,Interface},Frame}.py: use dict() to cache canvas state in Frame. --- MiRCARTCanvas.py | 12 +++---- MiRCARTCanvasInterface.py | 19 ++++++----- MiRCARTFrame.py | 67 ++++++++++++++++----------------------- 3 files changed, 42 insertions(+), 56 deletions(-) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index 7c4c67e..eef5348 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -48,7 +48,7 @@ class MiRCARTCanvas(wx.Panel): for patch in deltaPatches: if self.canvasBackend.drawPatch(eventDc, patch): self._commitPatch(patch) - self.parentFrame.onCanvasUpdate(newUndoLevel=self.canvasJournal.patchesUndoLevel) + self.parentFrame.onCanvasUpdate(undoLevel=self.canvasJournal.patchesUndoLevel) # }}} # {{{ _dispatchPatch(self, eventDc, isCursor, patch): XXX def _dispatchPatch(self, eventDc, isCursor, patch): @@ -98,10 +98,10 @@ class MiRCARTCanvas(wx.Panel): event.Dragging(), event.LeftIsDown(), event.RightIsDown(), \ self._dispatchPatch, eventDc) if self._canvasDirty: - self.parentFrame.onCanvasUpdate(newCellPos=self.brushPos, \ - newUndoLevel=self.canvasJournal.patchesUndoLevel) + self.parentFrame.onCanvasUpdate(cellPos=self.brushPos, \ + undoLevel=self.canvasJournal.patchesUndoLevel) if eventType == wx.wxEVT_MOTION: - self.parentFrame.onCanvasUpdate(newCellPos=mapPoint) + self.parentFrame.onCanvasUpdate(cellPos=mapPoint) # }}} # {{{ onPanelLeaveWindow(self, event): XXX def onPanelLeaveWindow(self, event): @@ -151,7 +151,7 @@ class MiRCARTCanvas(wx.Panel): self.canvasBackend.reset(self.canvasSize, self.canvasBackend.cellSize) self.canvasJournal.resetCursor(); self.canvasJournal.resetUndo(); self.parentFrame.onCanvasUpdate( \ - newSize=self.canvasSize, newUndoLevel=-1) + size=self.canvasSize, undoLevel=-1) # }}} # @@ -164,7 +164,7 @@ class MiRCARTCanvas(wx.Panel): self.canvasMap = None; self.canvasPos = canvasPos; self.canvasSize = canvasSize; self.brushColours = [4, 1]; self.brushPos = [0, 0]; self.brushSize = [1, 1]; self.parentFrame.onCanvasUpdate( \ - newBrushSize=self.brushSize, newColours=self.brushColours) + brushSize=self.brushSize, colours=self.brushColours) self.canvasBackend = MiRCARTCanvasBackend(canvasSize, cellSize) self.canvasJournal = MiRCARTCanvasJournal() self.canvasExportStore = MiRCARTCanvasExportStore(parentCanvas=self) diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index 4b32b3c..371adc7 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -69,7 +69,7 @@ class MiRCARTCanvasInterface(): self.parentCanvas.brushColours[0] = numColour elif event.GetEventType() == wx.wxEVT_TOOL_RCLICKED: self.parentCanvas.brushColours[1] = numColour - self.parentFrame.onCanvasUpdate(newColours=self.parentCanvas.brushColours) + self.parentFrame.onCanvasUpdate(colours=self.parentCanvas.brushColours) # }}} # {{{ canvasCopy(self, event): XXX def canvasCopy(self, event): @@ -85,7 +85,7 @@ class MiRCARTCanvasInterface(): and self.parentCanvas.brushSize[1] > 1: self.parentCanvas.brushSize = \ [a-1 for a in self.parentCanvas.brushSize] - self.parentFrame.onCanvasUpdate(newBrushSize=self.parentCanvas.brushSize) + self.parentFrame.onCanvasUpdate(brushSize=self.parentCanvas.brushSize) # }}} # {{{ canvasDecrCanvasHeight(self, event): XXX def canvasDecrCanvasHeight(self, event): @@ -166,7 +166,7 @@ class MiRCARTCanvasInterface(): def canvasIncrBrush(self, event): self.parentCanvas.brushSize = \ [a+1 for a in self.parentCanvas.brushSize] - self.parentFrame.onCanvasUpdate(newBrushSize=self.parentCanvas.brushSize) + self.parentFrame.onCanvasUpdate(brushSize=self.parentCanvas.brushSize) # }}} # {{{ canvasIncrCanvasHeight(self, event): XXX def canvasIncrCanvasHeight(self, event): @@ -196,8 +196,7 @@ class MiRCARTCanvasInterface(): self.parentCanvas.canvasImportStore.importNew(newCanvasSize) self.canvasPathName = None self.parentCanvas.SetCursor(wx.Cursor(wx.NullCursor)) - self.parentFrame.onCanvasUpdate( \ - newPathName="", newUndoLevel=-1) + self.parentFrame.onCanvasUpdate(pathName="", undoLevel=-1) # }}} # {{{ canvasOpen(self, event): XXX def canvasOpen(self, event): @@ -220,7 +219,7 @@ class MiRCARTCanvasInterface(): self.parentCanvas.canvasImportStore.importIntoPanel() self.parentCanvas.SetCursor(wx.Cursor(wx.NullCursor)) self.parentFrame.onCanvasUpdate( \ - newPathName=self.canvasPathName, newUndoLevel=-1) + pathName=self.canvasPathName, undoLevel=-1) return True # }}} # {{{ canvasPaste(self, event): XXX @@ -261,22 +260,22 @@ class MiRCARTCanvasInterface(): # {{{ canvasToolCircle(self, event): XXX def canvasToolCircle(self, event): self.canvasTool = MiRCARTToolCircle(self.parentCanvas) - self.parentFrame.onCanvasUpdate(newToolName=self.canvasTool.name) + self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasToolLine(self, event): XXX def canvasToolLine(self, event): self.canvasTool = MiRCARTToolLine(self.parentCanvas) - self.parentFrame.onCanvasUpdate(newToolName=self.canvasTool.name) + self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasToolRect(self, event): XXX def canvasToolRect(self, event): self.canvasTool = MiRCARTToolRect(self.parentCanvas) - self.parentFrame.onCanvasUpdate(newToolName=self.canvasTool.name) + self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasToolText(self, event): XXX def canvasToolText(self, event): self.canvasTool = MiRCARTToolText(self.parentCanvas) - self.parentFrame.onCanvasUpdate(newToolName=self.canvasTool.name) + self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasUndo(self, event): XXX def canvasUndo(self, event): diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 8a92dbf..5ad1732 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -33,8 +33,7 @@ import os, wx class MiRCARTFrame(MiRCARTGeneralFrame): """XXX""" - panelCanvas = None - lastBrushSize = lastCellPos = lastColours = lastPathName = lastSize = lastToolName = lastUndoLevel = None + panelCanvas = None; lastPanelState = {}; # {{{ Commands # Id Type Id Labels Icon bitmap Accelerator [Initial state] @@ -159,55 +158,43 @@ class MiRCARTFrame(MiRCARTGeneralFrame): self.itemsById[eventId][7](self.panelCanvas.canvasInterface, event) # }}} # {{{ onCanvasUpdate(self, newBrushSize=None, newCellPos=None, newColours=None, newPathName=None, newSize=None, newToolName=None, newUndoLevel=None): XXX - def onCanvasUpdate(self, newBrushSize=None, newCellPos=None, newColours=None, newPathName=None, newSize=None, newToolName=None, newUndoLevel=None): - if newBrushSize != None: - self.lastBrushSize = newBrushSize - if newCellPos != None: - self.lastCellPos = newCellPos - if newColours != None: - self.lastColours = newColours - if newPathName != None: - self.lastPathName = newPathName - if newSize != None: - self.lastSize = newSize - if newToolName != None: - self.lastToolName = newToolName - if newUndoLevel != None: - self.lastUndoLevel = newUndoLevel + def onCanvasUpdate(self, **kwargs): + self.lastPanelState.update(kwargs) textItems = [] - if self.lastCellPos != None: - textItems.append("X: {:03d} Y: {:03d}".format( \ - *self.lastCellPos)) - if self.lastSize != None: - textItems.append("W: {:03d} H: {:03d}".format( \ - *self.lastSize)) - if self.lastBrushSize != None: - textItems.append("Brush: {:02d}x{:02d}".format( \ - *self.lastBrushSize)) - if self.lastColours != None: - textItems.append("FG: {:02d}, BG: {:02d}".format( \ - *self.lastColours)) - textItems.append("{} on {}".format( \ - MiRCARTColours[self.lastColours[0]][4], \ - MiRCARTColours[self.lastColours[1]][4])) - if self.lastPathName != None: - if self.lastPathName != "": - basePathName = os.path.basename(self.lastPathName) + if "cellPos" in self.lastPanelState: + textItems.append("X: {:03d} Y: {:03d}".format( \ + *self.lastPanelState["cellPos"])) + if "size" in self.lastPanelState: + textItems.append("W: {:03d} H: {:03d}".format( \ + *self.lastPanelState["size"])) + if "brushSize" in self.lastPanelState: + textItems.append("Brush: {:02d}x{:02d}".format( \ + *self.lastPanelState["brushSize"])) + if "colours" in self.lastPanelState: + textItems.append("FG: {:02d}, BG: {:02d}".format( \ + *self.lastPanelState["colours"])) + textItems.append("{} on {}".format( \ + MiRCARTColours[self.lastPanelState["colours"][0]][4], \ + MiRCARTColours[self.lastPanelState["colours"][1]][4])) + if "pathName" in self.lastPanelState: + if self.lastPanelState["pathName"] != "": + basePathName = os.path.basename(self.lastPanelState["pathName"]) textItems.append("Current file: {}".format(basePathName)) self.SetTitle("{} - MiRCART".format(basePathName)) else: self.SetTitle("MiRCART") - if self.lastToolName != None: - textItems.append("Current tool: {}".format(self.lastToolName)) + if "toolName" in self.lastPanelState: + textItems.append("Current tool: {}".format( \ + self.lastPanelState["toolName"])) self.statusBar.SetStatusText(" | ".join(textItems)) - if self.lastUndoLevel != None: - if self.lastUndoLevel >= 0: + if "undoLevel" in self.lastPanelState: + if self.lastPanelState["undoLevel"] >= 0: self.menuItemsById[self.CID_UNDO[0]].Enable(True) self.toolBar.EnableTool(self.CID_UNDO[0], True) else: self.menuItemsById[self.CID_UNDO[0]].Enable(False) self.toolBar.EnableTool(self.CID_UNDO[0], False) - if self.lastUndoLevel > 0: + if self.lastPanelState["undoLevel"] > 0: self.menuItemsById[self.CID_REDO[0]].Enable(True) self.toolBar.EnableTool(self.CID_REDO[0], True) else: From 2330eb8c694712980cb38ad2bfea8278a5a584f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 10 Jan 2018 14:53:35 +0100 Subject: [PATCH 104/148] MiRCARTToolLine.py: correctly cache colours on first click. --- MiRCARTToolLine.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MiRCARTToolLine.py b/MiRCARTToolLine.py index d22f1ad..fe14df7 100644 --- a/MiRCARTToolLine.py +++ b/MiRCARTToolLine.py @@ -27,7 +27,7 @@ from MiRCARTTool import MiRCARTTool class MiRCARTToolLine(MiRCARTTool): """XXX""" name = "Line" - toolOriginPoint = toolState = None + toolColours = toolOriginPoint = toolState = None TS_NONE = 0 TS_ORIGIN = 1 @@ -80,21 +80,25 @@ class MiRCARTToolLine(MiRCARTTool): brushColours[1] = brushColours[0] if self.toolState == self.TS_NONE: if isLeftDown or isRightDown: + self.toolColours = brushColours self.toolOriginPoint = list(atPoint) self.toolState = self.TS_ORIGIN dispatchFn(eventDc, True, [atPoint, brushColours, 0, " "]) elif self.toolState == self.TS_ORIGIN: targetPoint = list(atPoint) originPoint = self.toolOriginPoint - self._getLine(brushColours, brushSize, \ - eventDc, isLeftDown or isRightDown, \ + self._getLine(self.toolColours, brushSize, \ + eventDc, isLeftDown or isRightDown, \ originPoint, targetPoint, dispatchFn) if isLeftDown or isRightDown: + self.toolColours = None + self.toolOriginPoint = None self.toolState = self.TS_NONE # __init__(self, *args): initialisation method def __init__(self, *args): super().__init__(*args) + self.toolColours = None self.toolOriginPoint = None self.toolState = self.TS_NONE From cd9a81dbf42b85a1fbf3d98b5bb3785f8bb8986f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 10 Jan 2018 15:04:59 +0100 Subject: [PATCH 105/148] MiRCART{anvas{,ImportStore,Interface},Frame}.py: pass & initialise from default canvas position, size, and cell size. --- MiRCARTCanvas.py | 15 +++++++++------ MiRCARTCanvasImportStore.py | 6 +++--- MiRCARTCanvasInterface.py | 2 +- MiRCARTFrame.py | 8 +++++--- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index eef5348..03b3b93 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -32,6 +32,7 @@ import wx class MiRCARTCanvas(wx.Panel): """XXX""" parentFrame = None + defaultCanvasPos = defaultCanvasSize = defaultCellSize = None canvasMap = canvasPos = canvasSize = None brushColours = brushPos = brushSize = None canvasBackend = canvasJournal = None @@ -155,17 +156,19 @@ class MiRCARTCanvas(wx.Panel): # }}} # - # _init__(self, parent, parentFrame, canvasPos, canvasSize, cellSize): initialisation method - def __init__(self, parent, parentFrame, canvasPos, canvasSize, cellSize): - super().__init__(parent, pos=canvasPos, \ - size=[w*h for w,h in zip(canvasSize, cellSize)]) + # _init__(self, parent, parentFrame, defaultCanvasPos, defaultCanvasSize, defaultCellSize): initialisation method + def __init__(self, parent, parentFrame, defaultCanvasPos, defaultCanvasSize, defaultCellSize): + super().__init__(parent, pos=defaultCanvasPos, \ + size=[w*h for w,h in zip(defaultCanvasSize, defaultCellSize)]) self.parentFrame = parentFrame - self.canvasMap = None; self.canvasPos = canvasPos; self.canvasSize = canvasSize; + self.canvasMap = None + self.canvasPos = defaultCanvasPos; self.canvasSize = defaultCanvasSize; + self.defaultCanvasPos = defaultCanvasPos; self.defaultCanvasSize = defaultCanvasSize; self.brushColours = [4, 1]; self.brushPos = [0, 0]; self.brushSize = [1, 1]; self.parentFrame.onCanvasUpdate( \ brushSize=self.brushSize, colours=self.brushColours) - self.canvasBackend = MiRCARTCanvasBackend(canvasSize, cellSize) + self.canvasBackend = MiRCARTCanvasBackend(defaultCanvasSize, defaultCellSize) self.canvasJournal = MiRCARTCanvasJournal() self.canvasExportStore = MiRCARTCanvasExportStore(parentCanvas=self) self.canvasImportStore = MiRCARTCanvasImportStore(parentCanvas=self) diff --git a/MiRCARTCanvasImportStore.py b/MiRCARTCanvasImportStore.py index 6bce3bf..9dc2c54 100644 --- a/MiRCARTCanvasImportStore.py +++ b/MiRCARTCanvasImportStore.py @@ -137,9 +137,9 @@ class MiRCARTCanvasImportStore(): # }}} # {{{ importNew(self, newCanvasSize=None): XXX def importNew(self, newCanvasSize=None): - newMap = [[[(1, 1), 0, " "] \ - for x in range(self.parentCanvas.canvasSize[0])] \ - for y in range(self.parentCanvas.canvasSize[1])] + newMap = [[[[1, 1], 0, " "] \ + for x in range(newCanvasSize[0])] \ + for y in range(newCanvasSize[1])] self.parentCanvas.onStoreUpdate(newCanvasSize, newMap) # }}} diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index 371adc7..e1b0395 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -192,7 +192,7 @@ class MiRCARTCanvasInterface(): self.canvasSave() self.parentCanvas.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) if newCanvasSize == None: - newCanvasSize = (100, 30) + newCanvasSize = list(self.parentCanvas.defaultCanvasSize) self.parentCanvas.canvasImportStore.importNew(newCanvasSize) self.canvasPathName = None self.parentCanvas.SetCursor(wx.Cursor(wx.NullCursor)) diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 5ad1732..eab5234 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -203,12 +203,14 @@ class MiRCARTFrame(MiRCARTGeneralFrame): # }}} # - # __init__(self, parent, appSize=(840, 630), canvasPos=(25, 50), canvasSize=(125, 35), cellSize=(7, 14)): initialisation method - def __init__(self, parent, appSize=(840, 630), canvasPos=(25, 50), canvasSize=(125, 35), cellSize=(7, 14)): + # __init__(self, parent, appSize=(840, 630), defaultCanvasPos=(25, 50), defaultCanvasSize=(100, 30), defaultCellSize=(7, 14)): initialisation method + def __init__(self, parent, appSize=(840, 630), defaultCanvasPos=(25, 50), defaultCanvasSize=(100, 30), defaultCellSize=(7, 14)): self._initPaletteToolBitmaps() panelSkin = super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) self.panelCanvas = MiRCARTCanvas(panelSkin, parentFrame=self, \ - canvasPos=canvasPos, canvasSize=canvasSize, cellSize=cellSize) + defaultCanvasPos=defaultCanvasPos, \ + defaultCanvasSize=defaultCanvasSize, \ + defaultCellSize=defaultCellSize) self.panelCanvas.canvasInterface.canvasNew(None) # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 From 7e7df8a31c7cc741088ca9e3b1f8b47bde6cdeb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 10 Jan 2018 15:56:17 +0100 Subject: [PATCH 106/148] MiRCART{CanvasInterface,Frame}.py: adds clone & move (selection) tools. MiRCARTTool{Clone,Move}Select.py: initial implementation. assets/tool{Clone,Move}.png: added. MiRCART.png: updated. --- MiRCART.png | Bin 43602 -> 40512 bytes MiRCARTCanvasInterface.py | 12 ++++ MiRCARTFrame.py | 47 +++++++------- MiRCARTToolSelect.py | 129 ++++++++++++++++++++++++++++++++++++++ MiRCARTToolSelectClone.py | 60 ++++++++++++++++++ MiRCARTToolSelectMove.py | 61 ++++++++++++++++++ assets/toolClone.png | Bin 0 -> 287 bytes assets/toolMove.png | Bin 0 -> 303 bytes 8 files changed, 287 insertions(+), 22 deletions(-) create mode 100644 MiRCARTToolSelect.py create mode 100644 MiRCARTToolSelectClone.py create mode 100644 MiRCARTToolSelectMove.py create mode 100644 assets/toolClone.png create mode 100644 assets/toolMove.png diff --git a/MiRCART.png b/MiRCART.png index 8db9e9391678888bc477891c71e9622f2e83cb58..9150d4f92fc2b274ae376043593878c0cf8fe69d 100644 GIT binary patch literal 40512 zcmbrm2Ut^Uvo;)c+Yn`o1(9Z>H|bKNC?LItUZe!1E4_u_R%C+|>7A&QkWixZj*3!3 zQ>t{8gqTnwp@a}1{|fGX-gDmb?*IF*|H~yNt37MwnP+D1nYkyiMh03ZSuV1GK%kS_ zckh^hK!;p`zxHECfIUUHQBL6PfWL{BI;e7hn+RBNrXVPO0CgS%G# zAkeAz%)bNYgmj`np!`woJGab2?3ZTPBF+ZqZ!xIl=7*O~-+#k?@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R?3GlFVgy(27*BMUAe zH)duUa`JJ^VYeiC^#{YpmUK+yNqlrFSB=wSFHD<$gsDsx1itGJ*EK$Z$xR>7Dkjz( z63vec3Lm&_x^~oH?B%Kti%8xgps-ZLM$Oi{Ld&hBlhd5?(y$1M&5m31KE_HE>WRwE zcecw!dD$7`wt4z`#Waqu1?*b&P`1r8q($Bp1Ac=-y%}e&w{$3O_E^h zYq#w2h>r9(_1$Xns;}ZbMpJ{r`zk$R+Bg0R?)iVe24LK)YGHAE_Q40)HQuS zNQQV0Yd#LoQ7yC_s&2(A7bPtxH=8y{e{()984!evb{Zo~bSz%Q(EZE+W$~(vf#aZe z!0Pd)Cl*^P77lV>1n{kNyE$mZr{A@SiRwlr$?qk{zS5Ghljl`N7pS&9y?)W#$4-xF zeO@9ZUcE$RomYQGAE_nKdn?3;^_7-$U4*Lx=@F_l-05vS z29aY^tQKSGGixb3HyHHVs%u%)u2$}9>0dUq>Ij{#)rk!EEoP4M?BU%Ajg1gr6)Ltw zDqhN_8K6`FuaXv*7l^etrioL@YqYk^71~Ho(V$1?YU%dg>>sgh#E<#-E?#!G__3C% z%YcPE+Mt@IN6Kn$`Ws5H9IaRJn*M?fU!Ke`tye|aGo5z4t}^H%4jr?945cS&NliKK zfYRIZ78EM4?l(pZNoN7Aqr$+%gmsEaoci_<{x&Q9it(mINNq$Cp2|)B(ojqXN=}%g z-Iq$ELZQ_S4Hbd3*2jxR$g$}X8F+iW*tQM&C(G814^8@82zS{Iox|gLw&~7TT%2seOin(&IW;!+{8z3c+YgW#u8tA(+P;ET$GOh!!y^%p z$)jQ%-}k7QZBry)>$6MauchA~PUAQ84t>z_F{AhT(Y9dLdS{Bg zka zT3~A)8LEx;26upllPWjaZ*aSWE`1H;$aJvM`p_%R<_rSTG>?7sqHJMHJGOGu_Vox=T`ETthrwo! z*3ffu(@pPRBimmTE?7tQmU2a6 +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from MiRCARTTool import MiRCARTTool + +class MiRCARTToolSelect(MiRCARTTool): + """XXX""" + toolColours = toolRect = toolState = None + toolLastAtPoint = None + toolSelectMap = None + srcRect = None + + TS_NONE = 0 + TS_ORIGIN = 1 + TS_TARGET = 2 + + # {{{ _drawSelectRect(self, rect, dispatchFn, eventDc): XXX + def _drawSelectRect(self, rect, dispatchFn, eventDc): + rectFrame = [ \ + [rect[0][0]-1, rect[0][1]-1], \ + [rect[1][0]+1, rect[1][1]+1]] + if rectFrame[0][0] > rectFrame[1][0]: + rectFrame[0][0], rectFrame[1][0] = \ + rectFrame[1][0], rectFrame[0][0] + if rectFrame[0][1] > rectFrame[1][1]: + rectFrame[0][1], rectFrame[1][1] = \ + rectFrame[1][1], rectFrame[0][1] + curColours = [0, 0] + for rectX in range(rectFrame[0][0], rectFrame[1][0]+1): + if curColours == [0, 0]: + curColours = [1, 1] + else: + curColours = [0, 0] + dispatchFn(eventDc, True, \ + [[rectX, rectFrame[0][1]], curColours, 0, " "]) + dispatchFn(eventDc, True, \ + [[rectX, rectFrame[1][1]], curColours, 0, " "]) + for rectY in range(rectFrame[0][1], rectFrame[1][1]+1): + if curColours == [0, 0]: + curColours = [1, 1] + else: + curColours = [0, 0] + dispatchFn(eventDc, True, \ + [[rectFrame[0][0], rectY], curColours, 0, " "]) + dispatchFn(eventDc, True, \ + [[rectFrame[1][0], rectY], curColours, 0, " "]) + # }}} + + # + # onSelectEvent(self, event, atPoint, selectRect, brushColours, brushSize, isLeftDown, isRightDown, dispatchFn, eventDc): XXX + def onSelectEvent(self, event, atPoint, selectRect, brushColours, brushSize, isLeftDown, isRightDown, dispatchFn, eventDc): + pass + + # + # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): XXX + def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): + if self.toolState == self.TS_NONE: + if isLeftDown or isRightDown: + self.toolColours = [0, 1] + self.toolRect = [list(atPoint), []] + self.toolState = self.TS_ORIGIN + else: + dispatchFn(eventDc, True, \ + [list(atPoint), brushColours.copy(), 0, " "]) + elif self.toolState == self.TS_ORIGIN: + self.toolRect[1] = list(atPoint) + if isLeftDown or isRightDown: + if self.toolRect[0][0] > self.toolRect[1][0]: + self.toolRect[0][0], self.toolRect[1][0] = \ + self.toolRect[1][0], self.toolRect[0][0] + if self.toolRect[0][1] > self.toolRect[1][1]: + self.toolRect[0][1], self.toolRect[1][1] = \ + self.toolRect[1][1], self.toolRect[0][1] + self.srcRect = self.toolRect[0] + self.toolLastAtPoint = list(atPoint) + self.toolState = self.TS_TARGET + self.toolSelectMap = [] + for numRow in range((self.toolRect[1][1] - self.toolRect[0][1]) + 1): + self.toolSelectMap.append([]) + for numCol in range((self.toolRect[1][0] - self.toolRect[0][0]) + 1): + rectY = self.toolRect[0][1] + numRow + rectX = self.toolRect[0][0] + numCol + self.toolSelectMap[numRow].append( \ + self.parentCanvas.canvasMap[rectY][rectX]) + self._drawSelectRect(self.toolRect, dispatchFn, eventDc) + elif self.toolState == self.TS_TARGET: + if isRightDown: + self.onSelectEvent(event, atPoint, self.toolRect, \ + brushColours, brushSize, isLeftDown, isRightDown, \ + dispatchFn, eventDc) + self.toolColours = None + self.toolRect = None + self.toolState = self.TS_NONE + else: + self.onSelectEvent(event, atPoint, self.toolRect, \ + brushColours, brushSize, isLeftDown, isRightDown, \ + dispatchFn, eventDc) + + # __init__(self, *args): initialisation method + def __init__(self, *args): + super().__init__(*args) + self.toolColours = None + self.toolRect = None + self.toolState = self.TS_NONE + self.toolLastAtPoint = None + self.toolSelectMap = None + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTToolSelectClone.py b/MiRCARTToolSelectClone.py new file mode 100644 index 0000000..14c6024 --- /dev/null +++ b/MiRCARTToolSelectClone.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 +# +# MiRCARTToolSelectClone.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from MiRCARTToolSelect import MiRCARTToolSelect + +class MiRCARTToolSelectClone(MiRCARTToolSelect): + """XXX""" + name = "Clone selection" + + # + # onSelectEvent(self, event, atPoint, selectRect, brushColours, brushSize, isLeftDown, isRightDown, dispatchFn, eventDc): XXX + def onSelectEvent(self, event, atPoint, selectRect, brushColours, brushSize, isLeftDown, isRightDown, dispatchFn, eventDc): + if isLeftDown: + atPoint = list(atPoint) + disp = [atPoint[0]-self.toolLastAtPoint[0], \ + atPoint[1]-self.toolLastAtPoint[1]] + self.toolLastAtPoint = atPoint + newToolRect = [ \ + [selectRect[0][0]+disp[0], selectRect[0][1]+disp[1]], \ + [selectRect[1][0]+disp[0], selectRect[1][1]+disp[1]]] + isCursor = True + elif isRightDown: + disp = [0, 0] + newToolRect = selectRect.copy() + isCursor = False + else: + disp = [0, 0] + newToolRect = selectRect.copy() + isCursor = True + for numRow in range(len(self.toolSelectMap)): + for numCol in range(len(self.toolSelectMap[numRow])): + cellOld = self.toolSelectMap[numRow][numCol] + rectY = selectRect[0][1] + numRow + rectX = selectRect[0][0] + numCol + dispatchFn(eventDc, isCursor, [[rectX+disp[0], rectY+disp[1]], *cellOld]) + self._drawSelectRect(newToolRect, dispatchFn, eventDc) + self.toolRect = newToolRect + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTToolSelectMove.py b/MiRCARTToolSelectMove.py new file mode 100644 index 0000000..520f4de --- /dev/null +++ b/MiRCARTToolSelectMove.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 +# +# MiRCARTToolSelectMove.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from MiRCARTToolSelect import MiRCARTToolSelect + +class MiRCARTToolSelectMove(MiRCARTToolSelect): + """XXX""" + name = "Move selection" + + # + # onSelectEvent(self, event, atPoint, selectRect, brushColours, brushSize, isLeftDown, isRightDown, dispatchFn, eventDc): XXX + def onSelectEvent(self, event, atPoint, selectRect, brushColours, brushSize, isLeftDown, isRightDown, dispatchFn, eventDc): + if isLeftDown: + atPoint = list(atPoint) + disp = [atPoint[0]-self.toolLastAtPoint[0], \ + atPoint[1]-self.toolLastAtPoint[1]] + self.toolLastAtPoint = atPoint + newToolRect = [ \ + [selectRect[0][0]+disp[0], selectRect[0][1]+disp[1]], \ + [selectRect[1][0]+disp[0], selectRect[1][1]+disp[1]]] + isCursor = True + elif isRightDown: + disp = [0, 0] + newToolRect = selectRect.copy() + isCursor = False + else: + disp = [0, 0] + newToolRect = selectRect.copy() + isCursor = True + for numRow in range(len(self.toolSelectMap)): + for numCol in range(len(self.toolSelectMap[numRow])): + cellOld = self.toolSelectMap[numRow][numCol] + rectY = selectRect[0][1] + numRow + rectX = selectRect[0][0] + numCol + dispatchFn(eventDc, isCursor, [[self.srcRect[0] + numCol, self.srcRect[1] + numRow], [1, 1], 0, " "]) + dispatchFn(eventDc, isCursor, [[rectX+disp[0], rectY+disp[1]], *cellOld]) + self._drawSelectRect(newToolRect, dispatchFn, eventDc) + self.toolRect = newToolRect + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/assets/toolClone.png b/assets/toolClone.png new file mode 100644 index 0000000000000000000000000000000000000000..fe6d1b5d9b26b85e9cbc688a3d77128343f6a5c2 GIT binary patch literal 287 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=Dh+L6~vJ#O${~LCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33JwwYY*EXd970vN< zaSXBWUmA3q_pk$x*VTXNjqmmc9Y4V#emgz*%?@9Aj~5LM`#1F%{!5asJDgn5kiF+-Th(VuQv{7wJyBmlh6oOymp!;gTe~DWM4fy^C_; literal 0 HcmV?d00001 diff --git a/assets/toolMove.png b/assets/toolMove.png new file mode 100644 index 0000000000000000000000000000000000000000..cd6d372b6f3c97ca1319c4694c5fa4f2091c1887 GIT binary patch literal 303 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=Dh+L6~vJ#O${~LCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33JwwYY*EXd96|M1f zaSXBWUmE1ecgTT9o2k(C(V74IkBILme8A{D$8(K}Z>X5}HH*BQ(&%Fn^&3t1KfHD0 zVAlQ?g9dYJ{X>&qHhKi>s<+J*MqsO;T^lShc0mbP;fh;B}T7*ffDnv(|#Wk z)xXbNJj3GFOULEYmu`5bp{Bu8!Ty6waMQln1sukQYS`aZyQOz^-nrs@Z8no^TI2L1 vMj8JX&eIfTpT&CBe|O=J*0nz^kAGrIjoKXYspG9T(A^B4u6{1-oD!M Date: Wed, 10 Jan 2018 19:20:35 +0100 Subject: [PATCH 107/148] MiRCARTToolSelectMove.py: clear source region prior to moving. --- MiRCARTToolSelectMove.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MiRCARTToolSelectMove.py b/MiRCARTToolSelectMove.py index 520f4de..7412062 100644 --- a/MiRCARTToolSelectMove.py +++ b/MiRCARTToolSelectMove.py @@ -48,12 +48,15 @@ class MiRCARTToolSelectMove(MiRCARTToolSelect): disp = [0, 0] newToolRect = selectRect.copy() isCursor = True + for numRow in range(len(self.toolSelectMap)): + for numCol in range(len(self.toolSelectMap[numRow])): + dispatchFn(eventDc, isCursor, [[self.srcRect[0] + numCol, \ + self.srcRect[1] + numRow], [1, 1], 0, " "]) for numRow in range(len(self.toolSelectMap)): for numCol in range(len(self.toolSelectMap[numRow])): cellOld = self.toolSelectMap[numRow][numCol] rectY = selectRect[0][1] + numRow rectX = selectRect[0][0] + numCol - dispatchFn(eventDc, isCursor, [[self.srcRect[0] + numCol, self.srcRect[1] + numRow], [1, 1], 0, " "]) dispatchFn(eventDc, isCursor, [[rectX+disp[0], rectY+disp[1]], *cellOld]) self._drawSelectRect(newToolRect, dispatchFn, eventDc) self.toolRect = newToolRect From 4ce163d9060244c80ad46fd3141bbc17e0f5d61e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 10 Jan 2018 21:28:15 +0100 Subject: [PATCH 108/148] MiRCARTCanvas.py:MiRCARTCanvas.resize(): call SetSize() w/o changing position. MiRCARTCanvas.py:MiRCARTCanvas.resize(): call SetMinSize() in addition to SetSize(). MiRCARTCanvas.py:MiRCARTCanvas.resize(): call Layout() on canvas panel window and its parents. MiRCARTCanvasInterface.py: always call SetCursor() w/ self.parentCanvas. MiRCARTFrame.py: moves colour toolbar items to separate toolbar. MiRCARTFrame.py:MiRCARTFrame.__init__(): add canvas panel to and initialise sizer. MiRCARTGeneralFrame.py: adds support for multiple toolbars via vertical box sizer. --- MiRCARTCanvas.py | 11 +++++++--- MiRCARTCanvasInterface.py | 22 ++++++++++---------- MiRCARTFrame.py | 42 ++++++++++++++++++++++++--------------- MiRCARTGeneralFrame.py | 37 ++++++++++++++++++++++++---------- 4 files changed, 71 insertions(+), 41 deletions(-) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index 03b3b93..90df9d3 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -146,9 +146,14 @@ class MiRCARTCanvas(wx.Panel): for numNewCol in range(newCanvasSize[0]): self.canvasMap[numNewRow].append([[1, 1], 0, " "]) self.canvasSize = newCanvasSize - self.SetSize(*self.canvasPos, \ - *[a*b for a,b in zip(self.canvasSize, \ - self.canvasBackend.cellSize)]) + newWinSize = [a*b for a,b in \ + zip(self.canvasSize, self.canvasBackend.cellSize)] + self.SetMinSize(newWinSize) + self.SetSize(wx.DefaultCoord, wx.DefaultCoord, *newWinSize) + curWindow = self + while curWindow != None: + curWindow.Layout() + curWindow = curWindow.GetParent() self.canvasBackend.reset(self.canvasSize, self.canvasBackend.cellSize) self.canvasJournal.resetCursor(); self.canvasJournal.resetUndo(); self.parentFrame.onCanvasUpdate( \ diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index 6bf0b57..9900b6e 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -119,18 +119,18 @@ class MiRCARTCanvasInterface(): return False else: outPathName = dialog.GetPath() - self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) + self.parentCanvas.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) self.parentCanvas.canvasExportStore.exportBitmapToPngFile( \ self.parentCanvas.canvasBackend.canvasBitmap, outPathName, \ wx.BITMAP_TYPE_PNG) - self.SetCursor(wx.Cursor(wx.NullCursor)) + self.parentCanvas.SetCursor(wx.Cursor(wx.NullCursor)) return True # }}} # {{{ canvasExportImgur(self, event): XXX def canvasExportImgur(self, event): self.parentCanvas.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) imgurResult = self.parentCanvas.canvasExportStore.exportBitmapToImgur( \ - "c9a6efb3d7932fd", self.parentCanvas.canvasBackend.canvasBitmap, \ + "c9a6efb3d7932fd", self.parentCanvas.canvasBackend.canvasBitmap, \ "", "", wx.BITMAP_TYPE_PNG) self.parentCanvas.SetCursor(wx.Cursor(wx.NullCursor)) if imgurResult[0] == 200: @@ -138,21 +138,21 @@ class MiRCARTCanvasInterface(): wx.TheClipboard.Open() wx.TheClipboard.SetData(wx.TextDataObject(imgurResult[1])) wx.TheClipboard.Close() - wx.MessageBox("Exported to Imgur: " + imgurResult[1], \ + wx.MessageBox("Exported to Imgur: " + imgurResult[1], \ "Export to Imgur", wx.OK|wx.ICON_INFORMATION) else: - wx.MessageBox("Failed to export to Imgur: " + imgurResult[1], \ + wx.MessageBox("Failed to export to Imgur: " + imgurResult[1], \ "Export to Imgur", wx.OK|wx.ICON_EXCLAMATION) # }}} # {{{ canvasExportPastebin(self, event): XXX def canvasExportPastebin(self, event): - self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) + self.parentCanvas.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) pasteStatus, pasteResult = \ - self.parentCanvas.canvasExportStore.exportPastebin( \ + self.parentCanvas.canvasExportStore.exportPastebin( \ "253ce2f0a45140ee0a44ca99aa49260", \ - self.parentCanvas.canvasMap, \ + self.parentCanvas.canvasMap, \ self.parentCanvas.canvasSize) - self.SetCursor(wx.Cursor(wx.NullCursor)) + self.parentCanvas.SetCursor(wx.Cursor(wx.NullCursor)) if pasteStatus: if not wx.TheClipboard.IsOpened(): wx.TheClipboard.Open() @@ -240,11 +240,11 @@ class MiRCARTCanvasInterface(): return try: with open(self.canvasPathName, "w") as outFile: - self.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) + self.parentCanvas.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) self.parentCanvas.canvasExportStore.exportTextFile( \ self.parentCanvas.canvasMap, \ self.parentCanvas.canvasSize, outFile) - self.SetCursor(wx.Cursor(wx.NullCursor)) + self.parentCanvas.SetCursor(wx.Cursor(wx.NullCursor)) return True except IOError as error: return False diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 1fe1115..d4e9735 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -27,7 +27,7 @@ from MiRCARTCanvasInterface import MiRCARTCanvasInterface from MiRCARTColours import MiRCARTColours from MiRCARTGeneralFrame import MiRCARTGeneralFrame, \ TID_ACCELS, TID_COMMAND, TID_LIST, TID_MENU, TID_NOTHING, TID_SELECT, TID_TOOLBAR, \ - NID_MENU_SEP, NID_TOOLBAR_SEP + NID_MENU_SEP, NID_TOOLBAR_HSEP, NID_TOOLBAR_VSEP import os, wx @@ -107,11 +107,12 @@ class MiRCARTFrame(MiRCARTGeneralFrame): # }}} # {{{ Toolbars BID_TOOLBAR = (0x400, TID_TOOLBAR, ( \ - CID_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_TOOLBAR_SEP, \ - CID_UNDO, CID_REDO, NID_TOOLBAR_SEP, \ - CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_TOOLBAR_SEP, \ - CID_INCR_BRUSH, CID_DECR_BRUSH, NID_TOOLBAR_SEP, \ - CID_RECT, CID_CIRCLE, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT, NID_TOOLBAR_SEP, \ + CID_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_TOOLBAR_HSEP, \ + CID_UNDO, CID_REDO, NID_TOOLBAR_HSEP, \ + CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_TOOLBAR_HSEP, \ + CID_INCR_BRUSH, CID_DECR_BRUSH, NID_TOOLBAR_HSEP, \ + CID_RECT, CID_CIRCLE, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT, \ + NID_TOOLBAR_VSEP, \ CID_COLOUR00, CID_COLOUR01, CID_COLOUR02, CID_COLOUR03, CID_COLOUR04, \ CID_COLOUR05, CID_COLOUR06, CID_COLOUR07, CID_COLOUR08, CID_COLOUR09, \ CID_COLOUR10, CID_COLOUR11, CID_COLOUR12, CID_COLOUR13, CID_COLOUR14, \ @@ -193,27 +194,36 @@ class MiRCARTFrame(MiRCARTGeneralFrame): if "undoLevel" in self.lastPanelState: if self.lastPanelState["undoLevel"] >= 0: self.menuItemsById[self.CID_UNDO[0]].Enable(True) - self.toolBar.EnableTool(self.CID_UNDO[0], True) + toolBar = self.toolBarItemsById[self.CID_UNDO[0]].GetToolBar() + toolBar.EnableTool(self.CID_UNDO[0], True) else: self.menuItemsById[self.CID_UNDO[0]].Enable(False) - self.toolBar.EnableTool(self.CID_UNDO[0], False) + toolBar = self.toolBarItemsById[self.CID_UNDO[0]].GetToolBar() + toolBar.EnableTool(self.CID_UNDO[0], False) if self.lastPanelState["undoLevel"] > 0: self.menuItemsById[self.CID_REDO[0]].Enable(True) - self.toolBar.EnableTool(self.CID_REDO[0], True) + toolBar = self.toolBarItemsById[self.CID_REDO[0]].GetToolBar() + toolBar.EnableTool(self.CID_REDO[0], True) else: self.menuItemsById[self.CID_REDO[0]].Enable(False) - self.toolBar.EnableTool(self.CID_REDO[0], False) + toolBar = self.toolBarItemsById[self.CID_REDO[0]].GetToolBar() + toolBar.EnableTool(self.CID_REDO[0], False) # }}} # - # __init__(self, parent, appSize=(840, 630), defaultCanvasPos=(25, 50), defaultCanvasSize=(100, 30), defaultCellSize=(7, 14)): initialisation method - def __init__(self, parent, appSize=(840, 630), defaultCanvasPos=(25, 50), defaultCanvasSize=(100, 30), defaultCellSize=(7, 14)): + # __init__(self, parent, appSize=(840, 630), defaultCanvasPos=(0, 75), defaultCanvasSize=(100, 30), defaultCellSize=(7, 14)): initialisation method + def __init__(self, parent, appSize=(840, 630), defaultCanvasPos=(0, 75), defaultCanvasSize=(100, 30), defaultCellSize=(7, 14)): self._initPaletteToolBitmaps() - panelSkin = super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) - self.panelCanvas = MiRCARTCanvas(panelSkin, parentFrame=self, \ - defaultCanvasPos=defaultCanvasPos, \ - defaultCanvasSize=defaultCanvasSize, \ + self.panelSkin = super().__init__(parent, wx.ID_ANY, "MiRCART", size=appSize) + self.panelCanvas = MiRCARTCanvas(self.panelSkin, parentFrame=self, \ + defaultCanvasPos=defaultCanvasPos, \ + defaultCanvasSize=defaultCanvasSize, \ defaultCellSize=defaultCellSize) self.panelCanvas.canvasInterface.canvasNew(None) + self.sizerSkin.AddSpacer(5) + self.sizerSkin.Add(self.panelCanvas, wx.ALL|wx.EXPAND) + self.panelSkin.SetSizer(self.sizerSkin) + self.panelSkin.SetAutoLayout(1) + self.sizerSkin.Fit(self.panelSkin) # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/MiRCARTGeneralFrame.py b/MiRCARTGeneralFrame.py index 75afc7c..baf3355 100644 --- a/MiRCARTGeneralFrame.py +++ b/MiRCARTGeneralFrame.py @@ -37,12 +37,14 @@ TID_TOOLBAR = (0x007) # # Non-items NID_MENU_SEP = (0x200, TID_NOTHING) -NID_TOOLBAR_SEP = (0x201, TID_NOTHING) +NID_TOOLBAR_HSEP = (0x201, TID_NOTHING) +NID_TOOLBAR_VSEP = (0x202, TID_NOTHING) class MiRCARTGeneralFrame(wx.Frame): """XXX""" itemsById = menuItemsById = toolBarItemsById = None - statusBar = toolBar = None + statusBar = toolBars = None + panelSkin = sizerSkin = None # {{{ _initAccelTable(self, accelsDescr): XXX def _initAccelTable(self, accelsDescr): @@ -83,28 +85,41 @@ class MiRCARTGeneralFrame(wx.Frame): # {{{ _initToolBars(self, toolBarsDescr, panelSkin): XXX def _initToolBars(self, toolBarsDescr, panelSkin): self.toolBarItemsById = {} - self.toolBar = wx.ToolBar(panelSkin, -1, \ - style=wx.HORIZONTAL|wx.TB_FLAT|wx.TB_NODIVIDER) - self.toolBar.SetToolBitmapSize((16,16)) + self.sizerSkin = wx.BoxSizer(wx.VERTICAL) + self.toolBars = [None]; numToolBar = 0; for toolBarItem in toolBarsDescr[2]: - if toolBarItem == NID_TOOLBAR_SEP: - self.toolBar.AddSeparator() + if self.toolBars[numToolBar] == None: + self.toolBars[numToolBar] = \ + wx.ToolBar(panelSkin, -1, \ + style=wx.HORIZONTAL|wx.TB_FLAT|wx.TB_NODIVIDER) + self.toolBars[numToolBar].SetToolBitmapSize((16,16)) + if toolBarItem == NID_TOOLBAR_HSEP: + self.toolBars[numToolBar].AddSeparator() + elif toolBarItem == NID_TOOLBAR_VSEP: + numToolBar += 1; self.toolBars.append(None); else: self.itemsById[toolBarItem[0]] = toolBarItem - toolBarItemWindow = self.toolBar.AddTool( \ - toolBarItem[0], toolBarItem[2], toolBarItem[4][2]) + toolBarItemWindow = \ + self.toolBars[numToolBar].AddTool( \ + toolBarItem[0], toolBarItem[2], \ + toolBarItem[4][2]) self.toolBarItemsById[toolBarItem[0]] = toolBarItemWindow if toolBarItem[6] != None \ and toolBarItem[1] == TID_COMMAND: toolBarItemWindow.Enable(toolBarItem[6]) self.Bind(wx.EVT_TOOL, self.onInput, toolBarItemWindow) self.Bind(wx.EVT_TOOL_RCLICKED, self.onInput, toolBarItemWindow) - self.toolBar.Realize(); self.toolBar.Fit(); + for numToolBar in range(len(self.toolBars)): + self.sizerSkin.Add( \ + self.toolBars[numToolBar], 0, wx.ALIGN_LEFT, 4) + self.toolBars[numToolBar].Realize() + self.toolBars[numToolBar].Fit() # }}} # {{{ _initToolBitmaps(self, toolBarsDescr): XXX def _initToolBitmaps(self, toolBarsDescr): for toolBarItem in toolBarsDescr[2]: - if toolBarItem == NID_TOOLBAR_SEP: + if toolBarItem == NID_TOOLBAR_HSEP \ + or toolBarItem == NID_TOOLBAR_VSEP: continue elif toolBarItem[4] == None: toolBarItem[4] = ["", None, wx.ArtProvider.GetBitmap( \ From 325ae6883f24c3e5a7894609fe7bc3bfe50210db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 10 Jan 2018 22:16:48 +0100 Subject: [PATCH 109/148] MiRCARTFrame.py: add canvas panel window to sizer w/ border width 14. --- MiRCARTFrame.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index d4e9735..95665f0 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -221,7 +221,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): defaultCellSize=defaultCellSize) self.panelCanvas.canvasInterface.canvasNew(None) self.sizerSkin.AddSpacer(5) - self.sizerSkin.Add(self.panelCanvas, wx.ALL|wx.EXPAND) + self.sizerSkin.Add(self.panelCanvas, 0, wx.ALL|wx.EXPAND, 14) self.panelSkin.SetSizer(self.sizerSkin) self.panelSkin.SetAutoLayout(1) self.sizerSkin.Fit(self.panelSkin) From 426c1f990fbb00f2efc26abd773b4e964215ea52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 10 Jan 2018 22:31:52 +0100 Subject: [PATCH 110/148] MiRCARTGeneralFrame.py: add toolbar windows to sizer w/ border width 3. --- MiRCARTGeneralFrame.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MiRCARTGeneralFrame.py b/MiRCARTGeneralFrame.py index baf3355..978b89f 100644 --- a/MiRCARTGeneralFrame.py +++ b/MiRCARTGeneralFrame.py @@ -111,7 +111,7 @@ class MiRCARTGeneralFrame(wx.Frame): self.Bind(wx.EVT_TOOL_RCLICKED, self.onInput, toolBarItemWindow) for numToolBar in range(len(self.toolBars)): self.sizerSkin.Add( \ - self.toolBars[numToolBar], 0, wx.ALIGN_LEFT, 4) + self.toolBars[numToolBar], 0, wx.ALL|wx.ALIGN_LEFT, 3) self.toolBars[numToolBar].Realize() self.toolBars[numToolBar].Fit() # }}} From 24de84093d06e4251758e9e14f800764a39059e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 00:26:46 +0100 Subject: [PATCH 111/148] MiRCART{CanvasInterface,Frame}.py: adds (flood) fill tool. MiRCARTToolFill.py: initial implementation. assets/toolFill.png: added. --- MiRCARTCanvasInterface.py | 6 +++++ MiRCARTFrame.py | 15 ++++++----- MiRCARTToolFill.py | 53 ++++++++++++++++++++++++++++++++++++++ assets/toolFill.png | Bin 0 -> 527 bytes 4 files changed, 67 insertions(+), 7 deletions(-) create mode 100644 MiRCARTToolFill.py create mode 100644 assets/toolFill.png diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index 9900b6e..9cc77ce 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -23,6 +23,7 @@ # from MiRCARTToolCircle import MiRCARTToolCircle +from MiRCARTToolFill import MiRCARTToolFill from MiRCARTToolLine import MiRCARTToolLine from MiRCARTToolSelectClone import MiRCARTToolSelectClone from MiRCARTToolSelectMove import MiRCARTToolSelectMove @@ -264,6 +265,11 @@ class MiRCARTCanvasInterface(): self.canvasTool = MiRCARTToolCircle(self.parentCanvas) self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} + # {{{ canvasToolFill(self, event): XXX + def canvasToolFill(self, event): + self.canvasTool = MiRCARTToolFill(self.parentCanvas) + self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) + # }}} # {{{ canvasToolLine(self, event): XXX def canvasToolLine(self, event): self.canvasTool = MiRCARTToolLine(self.parentCanvas) diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 95665f0..e357e48 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -70,10 +70,11 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_RECT = [0x150, TID_SELECT, "Rectangle", "&Rectangle", ["toolRect.png"], [wx.ACCEL_CTRL, ord("R")], True, MiRCARTCanvasInterface.canvasToolRect] CID_CIRCLE = [0x151, TID_SELECT, "Circle", "&Circle", ["toolCircle.png"], [wx.ACCEL_CTRL, ord("C")], False, MiRCARTCanvasInterface.canvasToolCircle] - CID_LINE = [0x152, TID_SELECT, "Line", "&Line", ["toolLine.png"], [wx.ACCEL_CTRL, ord("L")], False, MiRCARTCanvasInterface.canvasToolLine] - CID_TEXT = [0x153, TID_SELECT, "Text", "&Text", ["toolText.png"], [wx.ACCEL_CTRL, ord("T")], False, MiRCARTCanvasInterface.canvasToolText] - CID_CLONE_SELECT = [0x154, TID_SELECT, "Clone", "Cl&one", ["toolClone.png"], [wx.ACCEL_CTRL, ord("E")], False, MiRCARTCanvasInterface.canvasToolSelectClone] - CID_MOVE_SELECT = [0x155, TID_SELECT, "Move", "&Move", ["toolMove.png"], [wx.ACCEL_CTRL, ord("M")], False, MiRCARTCanvasInterface.canvasToolSelectMove] + CID_FILL = [0x152, TID_SELECT, "Fill", "&Fill", ["toolFill.png"], [wx.ACCEL_CTRL, ord("F")], False, MiRCARTCanvasInterface.canvasToolFill] + CID_LINE = [0x153, TID_SELECT, "Line", "&Line", ["toolLine.png"], [wx.ACCEL_CTRL, ord("L")], False, MiRCARTCanvasInterface.canvasToolLine] + CID_TEXT = [0x154, TID_SELECT, "Text", "&Text", ["toolText.png"], [wx.ACCEL_CTRL, ord("T")], False, MiRCARTCanvasInterface.canvasToolText] + CID_CLONE_SELECT = [0x155, TID_SELECT, "Clone", "Cl&one", ["toolClone.png"], [wx.ACCEL_CTRL, ord("E")], False, MiRCARTCanvasInterface.canvasToolSelectClone] + CID_MOVE_SELECT = [0x156, TID_SELECT, "Move", "&Move", ["toolMove.png"], [wx.ACCEL_CTRL, ord("M")], False, MiRCARTCanvasInterface.canvasToolSelectMove] CID_COLOUR00 = [0x1a0, TID_COMMAND, "Colour #00", "Colour #00", None, None, None, MiRCARTCanvasInterface.canvasColour] CID_COLOUR01 = [0x1a1, TID_COMMAND, "Colour #01", "Colour #01", None, None, None, MiRCARTCanvasInterface.canvasColour] @@ -103,7 +104,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_INCRW_CANVAS, CID_DECRW_CANVAS, CID_INCRH_CANVAS, CID_DECRH_CANVAS, NID_MENU_SEP, \ CID_INCR_BRUSH, CID_DECR_BRUSH, CID_SOLID_BRUSH)) MID_TOOLS = (0x302, TID_MENU, "Tools", "&Tools", ( \ - CID_RECT, CID_CIRCLE, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT)) + CID_RECT, CID_CIRCLE, CID_FILL, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT)) # }}} # {{{ Toolbars BID_TOOLBAR = (0x400, TID_TOOLBAR, ( \ @@ -111,7 +112,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_UNDO, CID_REDO, NID_TOOLBAR_HSEP, \ CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_TOOLBAR_HSEP, \ CID_INCR_BRUSH, CID_DECR_BRUSH, NID_TOOLBAR_HSEP, \ - CID_RECT, CID_CIRCLE, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT, \ + CID_RECT, CID_CIRCLE, CID_FILL, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT, \ NID_TOOLBAR_VSEP, \ CID_COLOUR00, CID_COLOUR01, CID_COLOUR02, CID_COLOUR03, CID_COLOUR04, \ CID_COLOUR05, CID_COLOUR06, CID_COLOUR07, CID_COLOUR08, CID_COLOUR09, \ @@ -123,7 +124,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_NEW, CID_OPEN, CID_SAVE, CID_UNDO, CID_REDO, \ CID_INCRW_CANVAS, CID_DECRW_CANVAS, CID_INCRH_CANVAS, CID_DECRH_CANVAS, \ CID_INCR_BRUSH, CID_DECR_BRUSH, \ - CID_RECT, CID_CIRCLE, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT)) + CID_RECT, CID_CIRCLE, CID_FILL, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT)) # }}} # {{{ Lists LID_ACCELS = (0x600, TID_LIST, (AID_EDIT)) diff --git a/MiRCARTToolFill.py b/MiRCARTToolFill.py new file mode 100644 index 0000000..3a7ef22 --- /dev/null +++ b/MiRCARTToolFill.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# +# MiRCARTToolFill.py -- XXX +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from MiRCARTTool import MiRCARTTool + +class MiRCARTToolFill(MiRCARTTool): + """XXX""" + name = "Fill" + + # + # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): XXX + def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): + pointStack = [list(atPoint)] + if isLeftDown or isRightDown: + if isRightDown: + brushColours = [brushColours[1], brushColours[0]] + while len(pointStack) > 0: + point = pointStack.pop() + pointCell = self.parentCanvas.canvasMap[point[1]][point[0]] + if pointCell[0][1] == brushColours[1]: + dispatchFn(eventDc, False, [point.copy(), \ + [brushColours[0], brushColours[0]], 0, " "]) + if point[0] > 0: + pointStack.append([point[0] - 1, point[1]]) + if point[0] < (self.parentCanvas.canvasSize[0] - 1): + pointStack.append([point[0] + 1, point[1]]) + if point[1] > 0: + pointStack.append([point[0], point[1] - 1]) + if point[1] < (self.parentCanvas.canvasSize[1] - 1): + pointStack.append([point[0], point[1] + 1]) + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 diff --git a/assets/toolFill.png b/assets/toolFill.png new file mode 100644 index 0000000000000000000000000000000000000000..54b87375fee3affffea33f859879b0b1a91bbf55 GIT binary patch literal 527 zcmV+q0`UEbP)N2bZe?^J zG%heMF*(%MvSa`N0gOpRK~y+Tg_1!_0znvt_XqS3`Uyg}ZguWbM>`aBtxH`+=(4yJ zDISatD~KYof~?`8z(n?t)Is#1C@8U|EQX=%Li7XP<{Q{$)^+XheDlpaI}ba|NC4JS zsZ`jodW~?KV=;6|r_*c*<|0%M8QWs$BFi##U1x1@&4tPyBO-=`s;Y>^VsIR1t%S2a?Go+iW49*HJ8L zTtK(rN@lZJK*Gz>r3E=zf@wM^m7bByJwTRk(CKuL$z)&{h9{X$r#^{vs=Q1WiaXnf!PX`V%@%wfYn)ks=3=AV}a! zOw;~XG9HgnC=?)V?%soN1+HW`{0^10+iiBVEZ-wtt8Hv--SLTtrfKN+zXFna{RQF^ z=S9AK^8yiijlG`bNp#)dS1o?y+pr2nQMjbp9I&gES>#{$O~RlDMJ(q4q(AFc0+ZY6 ReRBW+002ovPDHLkV1jBW;cEZ@ literal 0 HcmV?d00001 From 8a015008463cae77571133c28f427fd84ac784a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 00:31:25 +0100 Subject: [PATCH 112/148] MiRCART.png: updated. --- MiRCART.png | Bin 40512 -> 52285 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/MiRCART.png b/MiRCART.png index 9150d4f92fc2b274ae376043593878c0cf8fe69d..fff39a2214a4ea8c2cd33e83fa5254b7bdf2fa76 100644 GIT binary patch literal 52285 zcmeFZ3pkW(+dte|ZM0WQnMx=XtE3^j2$M=yA(ccnGo?ayL$(uURunPClA=se6d}9p z88b-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UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 00:45:40 +0100 Subject: [PATCH 113/148] MiRCARTGeneralFrame.py: show accelerators (hotkeys) in menus. --- MiRCARTGeneralFrame.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/MiRCARTGeneralFrame.py b/MiRCARTGeneralFrame.py index 978b89f..d294b12 100644 --- a/MiRCARTGeneralFrame.py +++ b/MiRCARTGeneralFrame.py @@ -42,18 +42,20 @@ NID_TOOLBAR_VSEP = (0x202, TID_NOTHING) class MiRCARTGeneralFrame(wx.Frame): """XXX""" - itemsById = menuItemsById = toolBarItemsById = None + accelItemsById = itemsById = menuItemsById = toolBarItemsById = None statusBar = toolBars = None panelSkin = sizerSkin = None # {{{ _initAccelTable(self, accelsDescr): XXX def _initAccelTable(self, accelsDescr): accelTableEntries = [wx.AcceleratorEntry() for n in range(len(accelsDescr[2]))] + self.accelItemsById = {} for numAccel in range(len(accelsDescr[2])): accelDescr = accelsDescr[2][numAccel] if accelDescr[5] != None: self.itemsById[accelDescr[0]] = accelDescr accelTableEntries[numAccel].Set(*accelDescr[5], accelDescr[0]) + self.accelItemsById[accelDescr[0]] = accelTableEntries[numAccel] self.Bind(wx.EVT_MENU, self.onInput, id=accelDescr[0]) return accelTableEntries # }}} @@ -68,6 +70,8 @@ class MiRCARTGeneralFrame(wx.Frame): elif menuItem[1] == TID_SELECT: self.itemsById[menuItem[0]] = menuItem menuItemWindow = menuWindow.AppendRadioItem(menuItem[0], menuItem[3], menuItem[2]) + if menuItem[5] != None: + menuItemWindow.SetAccel(self.accelItemsById[menuItem[0]]) self.menuItemsById[menuItem[0]] = menuItemWindow self.Bind(wx.EVT_MENU, self.onInput, menuItemWindow) if menuItem[6] != None: @@ -75,6 +79,8 @@ class MiRCARTGeneralFrame(wx.Frame): else: self.itemsById[menuItem[0]] = menuItem menuItemWindow = menuWindow.Append(menuItem[0], menuItem[3], menuItem[2]) + if menuItem[5] != None: + menuItemWindow.SetAccel(self.accelItemsById[menuItem[0]]) self.menuItemsById[menuItem[0]] = menuItemWindow self.Bind(wx.EVT_MENU, self.onInput, menuItemWindow) if menuItem[6] != None: @@ -150,6 +156,11 @@ class MiRCARTGeneralFrame(wx.Frame): super().__init__(*args, **kwargs); self.itemsById = {}; panelSkin = wx.Panel(self, wx.ID_ANY) + # Initialise accelerators (hotkeys) + accelTable = wx.AcceleratorTable( \ + self._initAccelTable(self.LID_ACCELS[2])) + self.SetAcceleratorTable(accelTable) + # Initialise menu bar, menus & menu items # Initialise toolbar & toolbar items menuBar = self._initMenus(self.LID_MENUS[2]) @@ -157,11 +168,6 @@ class MiRCARTGeneralFrame(wx.Frame): self._initToolBitmaps(self.LID_TOOLBARS[2]) toolBar = self._initToolBars(self.LID_TOOLBARS[2], panelSkin) - # Initialise accelerators (hotkeys) - accelTable = wx.AcceleratorTable( \ - self._initAccelTable(self.LID_ACCELS[2])) - self.SetAcceleratorTable(accelTable) - # Initialise status bar self.statusBar = self.CreateStatusBar() From d8f8f4754356a942e343885cfa2a5128d3bfd7f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 00:59:07 +0100 Subject: [PATCH 114/148] MiRCARTCanvasInterface.py: sync menu item state when selecting tool. --- MiRCARTCanvasInterface.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index 9cc77ce..1e29ff1 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -263,36 +263,43 @@ class MiRCARTCanvasInterface(): # {{{ canvasToolCircle(self, event): XXX def canvasToolCircle(self, event): self.canvasTool = MiRCARTToolCircle(self.parentCanvas) + self.parentFrame.menuItemsById[self.parentFrame.CID_CIRCLE[0]].Check(True) self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasToolFill(self, event): XXX def canvasToolFill(self, event): self.canvasTool = MiRCARTToolFill(self.parentCanvas) + self.parentFrame.menuItemsById[self.parentFrame.CID_FILL[0]].Check(True) self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasToolLine(self, event): XXX def canvasToolLine(self, event): self.canvasTool = MiRCARTToolLine(self.parentCanvas) + self.parentFrame.menuItemsById[self.parentFrame.CID_LINE[0]].Check(True) self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasToolSelectClone(self, event): XXX def canvasToolSelectClone(self, event): self.canvasTool = MiRCARTToolSelectClone(self.parentCanvas) + self.parentFrame.menuItemsById[self.parentFrame.CID_CLONE_SELECT[0]].Check(True) self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasToolSelectMove(self, event): XXX def canvasToolSelectMove(self, event): self.canvasTool = MiRCARTToolSelectMove(self.parentCanvas) + self.parentFrame.menuItemsById[self.parentFrame.CID_MOVE_SELECT[0]].Check(True) self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasToolRect(self, event): XXX def canvasToolRect(self, event): self.canvasTool = MiRCARTToolRect(self.parentCanvas) + self.parentFrame.menuItemsById[self.parentFrame.CID_RECT[0]].Check(True) self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasToolText(self, event): XXX def canvasToolText(self, event): self.canvasTool = MiRCARTToolText(self.parentCanvas) + self.parentFrame.menuItemsById[self.parentFrame.CID_TEXT[0]].Check(True) self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasUndo(self, event): XXX From 321ec8ffd99a464e82fb681f52d132264f2dd9b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 01:09:00 +0100 Subject: [PATCH 115/148] assets/tool{Clone,Move}.png: updated. --- assets/toolClone.png | Bin 287 -> 227 bytes assets/toolMove.png | Bin 303 -> 213 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/assets/toolClone.png b/assets/toolClone.png index fe6d1b5d9b26b85e9cbc688a3d77128343f6a5c2..ea358d3606cf23f08883ff55b51e618922a4b8ce 100644 GIT binary patch delta 138 zcmV;50CoSL0^lepsav0xJ#*69ZGfN6_)LrYOsm=`a}&YmOu1!W#<7f98qb6BSP$^ZZW07*qoM6N<$g4Yu}&j0`b delta 199 zcmV;&0672S0iObpJPN@801m+cxRGn^kwz$goJmAMR5(wiQriu~KnzON{%3*izf#A@ z2p8LDQ|!1+A4uqcfWNYgG5%s3e#2vMf_E*b(CH2sC{rQU z%LHWQgBi+Hh|L}K!KcWuVMFw>gP6Gb%OhqQ+YVv^!hs<{>aPzN$fpC5$HqLw1jHLM zNWD2=W*&$md`xxxP+QutL0C}p)MfJv+wgOaWe1#Z!Ax{&&^rJC002ovPDHLkV1mI0 BUuggU diff --git a/assets/toolMove.png b/assets/toolMove.png index cd6d372b6f3c97ca1319c4694c5fa4f2091c1887..c52a274a42fe54c305d694acea7d12938b2ad228 100644 GIT binary patch delta 124 zcmV-?0E7Rp0@VSKJPN=701m(bYSxJfkwz$IQb|NXR5(wyjzJ0lAP5Bg|EG;4O=>|c zJPa-)E)p|;0cC|9B<81Lp@J`gvI3M5{U6LSgx_0+avhxL-gAizz6{C=P)789pe5NU eS;H$(=3yGb9l2xh{s&|L0000}0j~m(JPN@801m+cxRGn^kwz$gtVu*cR5(wiQb`WNKnyDaaYf?H|G&f+ zxN+bCL!3#hBu!NoOV&7UY;{}47=N)fzv0^0!D_#RFn~8ZFT#`QgYXW$S5UnQ?sNr; z;GKn6h`P5`phNI*+hBxTE{~uh1IEiv@L?zSnWLCE+UY^3m!+`gC?+TjcnA0j5wgBQ zU7!dv!h8qrdq!u9iQLpf)|&zyW`UQ)GHCyyo+%Rtng!KQyK(r1t@$~}@&;vEvsChk R?Mnav002ovPDHLkV1gK1V)Fn1 From b0794ccaf9d63d24936b01cae52eaede749de34f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 01:12:55 +0100 Subject: [PATCH 116/148] MiRCARTCanvasInterface.py: prompt to save changes on exit given non-None canvasPathName. --- MiRCARTCanvasInterface.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index 1e29ff1..8818170 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -110,6 +110,14 @@ class MiRCARTCanvasInterface(): # }}} # {{{ canvasExit(self, event): XXX def canvasExit(self, event): + if self.canvasPathName != None: + saveChanges = self._dialogSaveChanges() + if saveChanges == wx.ID_CANCEL: + return + elif saveChanges == wx.ID_NO: + pass + elif saveChanges == wx.ID_YES: + self.canvasSave() self.parentFrame.Close(True) # }}} # {{{ canvasExportAsPng(self, event): XXX From 77eb660f350a095c287ddf647acdd8b1891b3718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 01:18:50 +0100 Subject: [PATCH 117/148] MiRCART.py: import argv[1] into canvas if specified. --- MiRCART.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MiRCART.py b/MiRCART.py index c03e793..d7bd121 100755 --- a/MiRCART.py +++ b/MiRCART.py @@ -29,7 +29,13 @@ import sys, wx # Entry point def main(*argv): wxApp = wx.App(False) - MiRCARTFrame(None) + appFrame = MiRCARTFrame(None) + if len(argv) > 1 \ + and len(argv[1]) > 0: + appFrame.panelCanvas.canvasInterface.canvasPathName = argv[1] + appFrame.panelCanvas.canvasImportStore.importTextFile(argv[1]) + appFrame.panelCanvas.canvasImportStore.importIntoPanel() + appFrame.onCanvasUpdate(pathName=argv[1], undoLevel=-1) wxApp.MainLoop() if __name__ == "__main__": main(*sys.argv) From 1a9c08a3fd44b8032ad1aa0b2e8fa1315e54d5cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 01:52:53 +0100 Subject: [PATCH 118/148] MiRCARTCanvasInterface.py:_updateCanvasSize(): reimplement (fixes [WASD] bugs.) --- MiRCARTCanvasInterface.py | 40 ++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index 8818170..7cc2d4a 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -48,17 +48,39 @@ class MiRCARTCanvasInterface(): # {{{ _updateCanvasSize(self, newCanvasSize): XXX def _updateCanvasSize(self, newCanvasSize): eventDc = self.parentCanvas.canvasBackend.getDeviceContext(self.parentCanvas) + oldCanvasSize = self.parentCanvas.canvasSize self.parentCanvas.resize(newCanvasSize) - self.parentCanvas.canvasBackend.resize( \ - newCanvasSize, \ + self.parentCanvas.canvasBackend.resize( \ + newCanvasSize, \ self.parentCanvas.canvasBackend.cellSize) - for numRow in range(self.parentCanvas.canvasSize[1] - 1): - self.parentCanvas.canvasMap.append([[1, 1], 0, " "]) - self.parentCanvas.canvasMap.append([]) - for numCol in range(self.parentCanvas.canvasSize[0]): - self.parentCanvas.canvasMap[-1].append([[1, 1], 0, " "]) - self.parentCanvas.canvasBackend.drawPatch(eventDc, \ - ([numCol, self.parentCanvas.canvasSize[1] - 1], *[[1, 1], 0, " "])) + if (newCanvasSize[1] - oldCanvasSize[1]) < 0: + for numRowOff in range(1, (oldCanvasSize[1] - newCanvasSize[1]) + 1): + numRow = oldCanvasSize[1] - numRowOff + del self.parentCanvas.canvasMap[numRow] + else: + for numRowOff in range(oldCanvasSize[1] - newCanvasSize[1]): + numRow = oldCanvasSize[1] + numRowOff + self.parentCanvas.canvasMap.append(None) + self.parentCanvas.canvasMap[numRow] = \ + [[[1, 1], 0, " "]] * oldCanvasSize[0] + self.parentCanvas.canvasBackend.drawPatch( \ + eventDc, \ + [[numCol, numRow], *[[1, 1], 0, " "]]) + if (newCanvasSize[0] - oldCanvasSize[0]) < 0: + for numRow in range(newCanvasSize[1]): + for numColOff in range(1, (oldCanvasSize[0] - newCanvasSize[0]) + 1): + numCol = oldCanvasSize[0] - numColOff + del self.parentCanvas.canvasMap[numRow][numCol] + else: + for numRow in range(newCanvasSize[1]): + for numColOff in range(newCanvasSize[0] - oldCanvasSize[0]): + numCol = oldCanvasSize[0] + numColOff + self.parentCanvas.canvasMap[numRow].append(None) + self.parentCanvas.canvasMap[numRow][numCol] = \ + [[1, 1], 0, " "] + self.parentCanvas.canvasBackend.drawPatch( \ + eventDc, \ + [[numCol, numRow], *[[1, 1], 0, " "]]) wx.SafeYield() # }}} From 390dae6b8dd6647aa76d745a4dc901129c399e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 01:56:28 +0100 Subject: [PATCH 119/148] MiRCARTToolFill.py: set qualifying colour from current cell. --- MiRCARTToolFill.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MiRCARTToolFill.py b/MiRCARTToolFill.py index 3a7ef22..9235275 100644 --- a/MiRCARTToolFill.py +++ b/MiRCARTToolFill.py @@ -32,13 +32,14 @@ class MiRCARTToolFill(MiRCARTTool): # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): XXX def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): pointStack = [list(atPoint)] + testColour = self.parentCanvas.canvasMap[atPoint[1]][atPoint[0]][0][1] if isLeftDown or isRightDown: if isRightDown: brushColours = [brushColours[1], brushColours[0]] while len(pointStack) > 0: point = pointStack.pop() pointCell = self.parentCanvas.canvasMap[point[1]][point[0]] - if pointCell[0][1] == brushColours[1]: + if pointCell[0][1] == testColour: dispatchFn(eventDc, False, [point.copy(), \ [brushColours[0], brushColours[0]], 0, " "]) if point[0] > 0: From ca0f76360f069d9b47e2e57f6ca53544b80cc71a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 01:59:43 +0100 Subject: [PATCH 120/148] MiRCARTCanvasInterface.py:_updateCanvasSize(): hide cursor before resizing. --- MiRCARTCanvasInterface.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index 7cc2d4a..df12494 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -48,6 +48,8 @@ class MiRCARTCanvasInterface(): # {{{ _updateCanvasSize(self, newCanvasSize): XXX def _updateCanvasSize(self, newCanvasSize): eventDc = self.parentCanvas.canvasBackend.getDeviceContext(self.parentCanvas) + self.parentCanvas.canvasBackend.drawCursorMaskWithJournal( \ + self.parentCanvas.canvasJournal, eventDc) oldCanvasSize = self.parentCanvas.canvasSize self.parentCanvas.resize(newCanvasSize) self.parentCanvas.canvasBackend.resize( \ From 0342f6626d496a0cd8e53785e059368e81d17f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 02:06:09 +0100 Subject: [PATCH 121/148] MiRCARTToolFill.py: don't process cells more than once. --- MiRCARTToolFill.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/MiRCARTToolFill.py b/MiRCARTToolFill.py index 9235275..c1adc8c 100644 --- a/MiRCARTToolFill.py +++ b/MiRCARTToolFill.py @@ -31,7 +31,7 @@ class MiRCARTToolFill(MiRCARTTool): # # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): XXX def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): - pointStack = [list(atPoint)] + pointStack = [list(atPoint)]; pointsDone = []; testColour = self.parentCanvas.canvasMap[atPoint[1]][atPoint[0]][0][1] if isLeftDown or isRightDown: if isRightDown: @@ -40,15 +40,17 @@ class MiRCARTToolFill(MiRCARTTool): point = pointStack.pop() pointCell = self.parentCanvas.canvasMap[point[1]][point[0]] if pointCell[0][1] == testColour: - dispatchFn(eventDc, False, [point.copy(), \ - [brushColours[0], brushColours[0]], 0, " "]) - if point[0] > 0: - pointStack.append([point[0] - 1, point[1]]) - if point[0] < (self.parentCanvas.canvasSize[0] - 1): - pointStack.append([point[0] + 1, point[1]]) - if point[1] > 0: - pointStack.append([point[0], point[1] - 1]) - if point[1] < (self.parentCanvas.canvasSize[1] - 1): - pointStack.append([point[0], point[1] + 1]) + if not point in pointsDone: + dispatchFn(eventDc, False, [point.copy(), \ + [brushColours[0], brushColours[0]], 0, " "]) + if point[0] > 0: + pointStack.append([point[0] - 1, point[1]]) + if point[0] < (self.parentCanvas.canvasSize[0] - 1): + pointStack.append([point[0] + 1, point[1]]) + if point[1] > 0: + pointStack.append([point[0], point[1] - 1]) + if point[1] < (self.parentCanvas.canvasSize[1] - 1): + pointStack.append([point[0], point[1] + 1]) + pointsDone += [point] # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 From fe5e45318754a8c71022111a93e8dcf29d149751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 02:10:33 +0100 Subject: [PATCH 122/148] MiRCARTCanvas.py:MiRCARTCanvas.onPanelInput(): clip mapPoint to canvasSize. --- MiRCARTCanvas.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index 90df9d3..0d5912c 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -93,6 +93,9 @@ class MiRCARTCanvas(wx.Panel): event.Skip(); return; else: mapPoint = self.canvasBackend.xlateEventPoint(event, eventDc) + if mapPoint[0] >= self.canvasSize[0] \ + or mapPoint[1] >= self.canvasSize[1]: + return self.brushPos = mapPoint tool.onMouseEvent( \ event, mapPoint, self.brushColours, self.brushSize, \ From e336730d80f377236a9a681e57b5da9aa064b089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 02:34:32 +0100 Subject: [PATCH 123/148] MiRCART{CanvasInterface,{,General}Frame}.py: add & sync {tools,colour selection} toolbar items as radio tools. --- MiRCARTCanvasInterface.py | 14 ++++++++++++++ MiRCARTFrame.py | 32 ++++++++++++++++---------------- MiRCARTGeneralFrame.py | 18 +++++++++++++----- 3 files changed, 43 insertions(+), 21 deletions(-) diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index df12494..c9f932b 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -296,42 +296,56 @@ class MiRCARTCanvasInterface(): def canvasToolCircle(self, event): self.canvasTool = MiRCARTToolCircle(self.parentCanvas) self.parentFrame.menuItemsById[self.parentFrame.CID_CIRCLE[0]].Check(True) + toolBar = self.parentFrame.toolBarItemsById[self.parentFrame.CID_CIRCLE[0]].GetToolBar() + toolBar.ToggleTool(self.parentFrame.CID_CIRCLE[0], True) self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasToolFill(self, event): XXX def canvasToolFill(self, event): self.canvasTool = MiRCARTToolFill(self.parentCanvas) self.parentFrame.menuItemsById[self.parentFrame.CID_FILL[0]].Check(True) + toolBar = self.parentFrame.toolBarItemsById[self.parentFrame.CID_FILL[0]].GetToolBar() + toolBar.ToggleTool(self.parentFrame.CID_FILL[0], True) self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasToolLine(self, event): XXX def canvasToolLine(self, event): self.canvasTool = MiRCARTToolLine(self.parentCanvas) self.parentFrame.menuItemsById[self.parentFrame.CID_LINE[0]].Check(True) + toolBar = self.parentFrame.toolBarItemsById[self.parentFrame.CID_LINE[0]].GetToolBar() + toolBar.ToggleTool(self.parentFrame.CID_LINE[0], True) self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasToolSelectClone(self, event): XXX def canvasToolSelectClone(self, event): self.canvasTool = MiRCARTToolSelectClone(self.parentCanvas) self.parentFrame.menuItemsById[self.parentFrame.CID_CLONE_SELECT[0]].Check(True) + toolBar = self.parentFrame.toolBarItemsById[self.parentFrame.CID_CLONE_SELECT[0]].GetToolBar() + toolBar.ToggleTool(self.parentFrame.CID_CLONE_SELECT[0], True) self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasToolSelectMove(self, event): XXX def canvasToolSelectMove(self, event): self.canvasTool = MiRCARTToolSelectMove(self.parentCanvas) self.parentFrame.menuItemsById[self.parentFrame.CID_MOVE_SELECT[0]].Check(True) + toolBar = self.parentFrame.toolBarItemsById[self.parentFrame.CID_MOVE_SELECT[0]].GetToolBar() + toolBar.ToggleTool(self.parentFrame.CID_MOVE_SELECT[0], True) self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasToolRect(self, event): XXX def canvasToolRect(self, event): self.canvasTool = MiRCARTToolRect(self.parentCanvas) self.parentFrame.menuItemsById[self.parentFrame.CID_RECT[0]].Check(True) + toolBar = self.parentFrame.toolBarItemsById[self.parentFrame.CID_RECT[0]].GetToolBar() + toolBar.ToggleTool(self.parentFrame.CID_RECT[0], True) self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasToolText(self, event): XXX def canvasToolText(self, event): self.canvasTool = MiRCARTToolText(self.parentCanvas) self.parentFrame.menuItemsById[self.parentFrame.CID_TEXT[0]].Check(True) + toolBar = self.parentFrame.toolBarItemsById[self.parentFrame.CID_TEXT[0]].GetToolBar() + toolBar.ToggleTool(self.parentFrame.CID_TEXT[0], True) self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name) # }}} # {{{ canvasUndo(self, event): XXX diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index e357e48..6c199aa 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -76,22 +76,22 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_CLONE_SELECT = [0x155, TID_SELECT, "Clone", "Cl&one", ["toolClone.png"], [wx.ACCEL_CTRL, ord("E")], False, MiRCARTCanvasInterface.canvasToolSelectClone] CID_MOVE_SELECT = [0x156, TID_SELECT, "Move", "&Move", ["toolMove.png"], [wx.ACCEL_CTRL, ord("M")], False, MiRCARTCanvasInterface.canvasToolSelectMove] - CID_COLOUR00 = [0x1a0, TID_COMMAND, "Colour #00", "Colour #00", None, None, None, MiRCARTCanvasInterface.canvasColour] - CID_COLOUR01 = [0x1a1, TID_COMMAND, "Colour #01", "Colour #01", None, None, None, MiRCARTCanvasInterface.canvasColour] - CID_COLOUR02 = [0x1a2, TID_COMMAND, "Colour #02", "Colour #02", None, None, None, MiRCARTCanvasInterface.canvasColour] - CID_COLOUR03 = [0x1a3, TID_COMMAND, "Colour #03", "Colour #03", None, None, None, MiRCARTCanvasInterface.canvasColour] - CID_COLOUR04 = [0x1a4, TID_COMMAND, "Colour #04", "Colour #04", None, None, None, MiRCARTCanvasInterface.canvasColour] - CID_COLOUR05 = [0x1a5, TID_COMMAND, "Colour #05", "Colour #05", None, None, None, MiRCARTCanvasInterface.canvasColour] - CID_COLOUR06 = [0x1a6, TID_COMMAND, "Colour #06", "Colour #06", None, None, None, MiRCARTCanvasInterface.canvasColour] - CID_COLOUR07 = [0x1a7, TID_COMMAND, "Colour #07", "Colour #07", None, None, None, MiRCARTCanvasInterface.canvasColour] - CID_COLOUR08 = [0x1a8, TID_COMMAND, "Colour #08", "Colour #08", None, None, None, MiRCARTCanvasInterface.canvasColour] - CID_COLOUR09 = [0x1a9, TID_COMMAND, "Colour #09", "Colour #09", None, None, None, MiRCARTCanvasInterface.canvasColour] - CID_COLOUR10 = [0x1aa, TID_COMMAND, "Colour #10", "Colour #10", None, None, None, MiRCARTCanvasInterface.canvasColour] - CID_COLOUR11 = [0x1ab, TID_COMMAND, "Colour #11", "Colour #11", None, None, None, MiRCARTCanvasInterface.canvasColour] - CID_COLOUR12 = [0x1ac, TID_COMMAND, "Colour #12", "Colour #12", None, None, None, MiRCARTCanvasInterface.canvasColour] - CID_COLOUR13 = [0x1ad, TID_COMMAND, "Colour #13", "Colour #13", None, None, None, MiRCARTCanvasInterface.canvasColour] - CID_COLOUR14 = [0x1ae, TID_COMMAND, "Colour #14", "Colour #14", None, None, None, MiRCARTCanvasInterface.canvasColour] - CID_COLOUR15 = [0x1af, TID_COMMAND, "Colour #15", "Colour #15", None, None, None, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR00 = [0x1a0, TID_SELECT, "Colour #00", "Colour #00", None, None, True, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR01 = [0x1a1, TID_SELECT, "Colour #01", "Colour #01", None, None, False, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR02 = [0x1a2, TID_SELECT, "Colour #02", "Colour #02", None, None, False, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR03 = [0x1a3, TID_SELECT, "Colour #03", "Colour #03", None, None, False, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR04 = [0x1a4, TID_SELECT, "Colour #04", "Colour #04", None, None, False, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR05 = [0x1a5, TID_SELECT, "Colour #05", "Colour #05", None, None, False, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR06 = [0x1a6, TID_SELECT, "Colour #06", "Colour #06", None, None, False, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR07 = [0x1a7, TID_SELECT, "Colour #07", "Colour #07", None, None, False, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR08 = [0x1a8, TID_SELECT, "Colour #08", "Colour #08", None, None, False, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR09 = [0x1a9, TID_SELECT, "Colour #09", "Colour #09", None, None, False, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR10 = [0x1aa, TID_SELECT, "Colour #10", "Colour #10", None, None, False, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR11 = [0x1ab, TID_SELECT, "Colour #11", "Colour #11", None, None, False, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR12 = [0x1ac, TID_SELECT, "Colour #12", "Colour #12", None, None, False, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR13 = [0x1ad, TID_SELECT, "Colour #13", "Colour #13", None, None, False, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR14 = [0x1ae, TID_SELECT, "Colour #14", "Colour #14", None, None, False, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR15 = [0x1af, TID_SELECT, "Colour #15", "Colour #15", None, None, False, MiRCARTCanvasInterface.canvasColour] # }}} # {{{ Menus MID_FILE = (0x300, TID_MENU, "File", "&File", ( \ diff --git a/MiRCARTGeneralFrame.py b/MiRCARTGeneralFrame.py index d294b12..ea53385 100644 --- a/MiRCARTGeneralFrame.py +++ b/MiRCARTGeneralFrame.py @@ -103,20 +103,28 @@ class MiRCARTGeneralFrame(wx.Frame): self.toolBars[numToolBar].AddSeparator() elif toolBarItem == NID_TOOLBAR_VSEP: numToolBar += 1; self.toolBars.append(None); + elif toolBarItem[1] == TID_SELECT: + self.itemsById[toolBarItem[0]] = toolBarItem + toolBarItemWindow = \ + self.toolBars[numToolBar].AddRadioTool( \ + toolBarItem[0], toolBarItem[2], toolBarItem[4][2]) + self.toolBarItemsById[toolBarItem[0]] = toolBarItemWindow + if toolBarItem[6] != None: + toolBarItemWindow.Toggle(toolBarItem[6]) + self.Bind(wx.EVT_TOOL, self.onInput, toolBarItemWindow) + self.Bind(wx.EVT_TOOL_RCLICKED, self.onInput, toolBarItemWindow) else: self.itemsById[toolBarItem[0]] = toolBarItem toolBarItemWindow = \ self.toolBars[numToolBar].AddTool( \ - toolBarItem[0], toolBarItem[2], \ - toolBarItem[4][2]) + toolBarItem[0], toolBarItem[2], toolBarItem[4][2]) self.toolBarItemsById[toolBarItem[0]] = toolBarItemWindow - if toolBarItem[6] != None \ - and toolBarItem[1] == TID_COMMAND: + if toolBarItem[6] != None: toolBarItemWindow.Enable(toolBarItem[6]) self.Bind(wx.EVT_TOOL, self.onInput, toolBarItemWindow) self.Bind(wx.EVT_TOOL_RCLICKED, self.onInput, toolBarItemWindow) for numToolBar in range(len(self.toolBars)): - self.sizerSkin.Add( \ + self.sizerSkin.Add( \ self.toolBars[numToolBar], 0, wx.ALL|wx.ALIGN_LEFT, 3) self.toolBars[numToolBar].Realize() self.toolBars[numToolBar].Fit() From cafb53b28346be1dfc6311fe75d47c644406d7ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 02:37:20 +0100 Subject: [PATCH 124/148] MiRCARTFrame.py: adds exit accelerator (hotkey) X. --- MiRCARTFrame.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 6c199aa..05dbeb8 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -47,7 +47,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): "Export to I&mgur...", None, None, haveUrllib, MiRCARTCanvasInterface.canvasExportImgur] CID_EXPORT_PASTEBIN = [0x106, TID_COMMAND, "Export to Pastebin...", \ "Export to Pasteb&in...", None, None, haveUrllib, MiRCARTCanvasInterface.canvasExportPastebin] - CID_EXIT = [0x107, TID_COMMAND, "Exit", "E&xit", None, None, None, MiRCARTCanvasInterface.canvasExit] + CID_EXIT = [0x107, TID_COMMAND, "Exit", "E&xit", None, [wx.ACCEL_CTRL, ord("X")], None, MiRCARTCanvasInterface.canvasExit] CID_UNDO = [0x108, TID_COMMAND, "Undo", "&Undo", ["", wx.ART_UNDO], [wx.ACCEL_CTRL, ord("Z")], False, MiRCARTCanvasInterface.canvasUndo] CID_REDO = [0x109, TID_COMMAND, "Redo", "&Redo", ["", wx.ART_REDO], [wx.ACCEL_CTRL, ord("Y")], False, MiRCARTCanvasInterface.canvasRedo] CID_CUT = [0x10a, TID_COMMAND, "Cut", "Cu&t", ["", wx.ART_CUT], None, False, MiRCARTCanvasInterface.canvasCut] @@ -121,7 +121,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): # }}} # {{{ Accelerators (hotkeys) AID_EDIT = (0x500, TID_ACCELS, ( \ - CID_NEW, CID_OPEN, CID_SAVE, CID_UNDO, CID_REDO, \ + CID_NEW, CID_OPEN, CID_SAVE, CID_EXIT, CID_UNDO, CID_REDO, \ CID_INCRW_CANVAS, CID_DECRW_CANVAS, CID_INCRH_CANVAS, CID_DECRH_CANVAS, \ CID_INCR_BRUSH, CID_DECR_BRUSH, \ CID_RECT, CID_CIRCLE, CID_FILL, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT)) From 25a0a696f670fd2e1267406d5c90bc1ea3ba181a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 02:49:53 +0100 Subject: [PATCH 125/148] MiRCARTFrame.py: add {in,de}crease {height,width} toolbar items. assets/tool{De,In}crCanvas{H,W}.png: added. --- MiRCARTFrame.py | 9 +++++---- assets/toolDecrCanvasH.png | Bin 0 -> 271 bytes assets/toolDecrCanvasW.png | Bin 0 -> 250 bytes assets/toolIncrCanvasH.png | Bin 0 -> 236 bytes assets/toolIncrCanvasW.png | Bin 0 -> 232 bytes 5 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 assets/toolDecrCanvasH.png create mode 100644 assets/toolDecrCanvasW.png create mode 100644 assets/toolIncrCanvasH.png create mode 100644 assets/toolIncrCanvasW.png diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 05dbeb8..7def5e7 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -55,13 +55,13 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_PASTE = [0x10c, TID_COMMAND, "Paste", "&Paste", ["", wx.ART_PASTE], None, False, MiRCARTCanvasInterface.canvasPaste] CID_DELETE = [0x10d, TID_COMMAND, "Delete", "De&lete", ["", wx.ART_DELETE], None, False, MiRCARTCanvasInterface.canvasDelete] CID_INCRW_CANVAS = [0x10e, TID_COMMAND, "Increase canvas width", \ - "Increase canvas &width", ["", wx.ART_PLUS], [wx.ACCEL_ALT, ord("D")], None, MiRCARTCanvasInterface.canvasIncrCanvasWidth] + "Increase canvas &width", ["toolIncrCanvasW.png"], [wx.ACCEL_ALT, ord("D")], None, MiRCARTCanvasInterface.canvasIncrCanvasWidth] CID_DECRW_CANVAS = [0x10f, TID_COMMAND, "Decrease canvas width", \ - "Decrease canvas w&idth", ["", wx.ART_MINUS], [wx.ACCEL_ALT, ord("A")], None, MiRCARTCanvasInterface.canvasDecrCanvasWidth] + "Decrease canvas w&idth", ["toolDecrCanvasW.png"], [wx.ACCEL_ALT, ord("A")], None, MiRCARTCanvasInterface.canvasDecrCanvasWidth] CID_INCRH_CANVAS = [0x110, TID_COMMAND, "Increase canvas height", \ - "Increase canvas &height", ["", wx.ART_PLUS], [wx.ACCEL_ALT, ord("S")], None, MiRCARTCanvasInterface.canvasIncrCanvasHeight] + "Increase canvas &height", ["toolIncrCanvasH.png"], [wx.ACCEL_ALT, ord("S")], None, MiRCARTCanvasInterface.canvasIncrCanvasHeight] CID_DECRH_CANVAS = [0x111, TID_COMMAND, "Decrease canvas height", \ - "Decrease canvas h&eight", ["", wx.ART_MINUS], [wx.ACCEL_ALT, ord("W")], None, MiRCARTCanvasInterface.canvasDecrCanvasHeight] + "Decrease canvas h&eight", ["toolDecrCanvasH.png"], [wx.ACCEL_ALT, ord("W")], None, MiRCARTCanvasInterface.canvasDecrCanvasHeight] CID_INCR_BRUSH = [0x112, TID_COMMAND, "Increase brush size", \ "I&ncrease brush size", ["", wx.ART_PLUS], [wx.ACCEL_CTRL, ord("+")], None, MiRCARTCanvasInterface.canvasIncrBrush] CID_DECR_BRUSH = [0x113, TID_COMMAND, "Decrease brush size", \ @@ -112,6 +112,7 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_UNDO, CID_REDO, NID_TOOLBAR_HSEP, \ CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_TOOLBAR_HSEP, \ CID_INCR_BRUSH, CID_DECR_BRUSH, NID_TOOLBAR_HSEP, \ + CID_INCRW_CANVAS, CID_DECRW_CANVAS, CID_INCRH_CANVAS, CID_DECRH_CANVAS, NID_TOOLBAR_HSEP, \ CID_RECT, CID_CIRCLE, CID_FILL, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT, \ NID_TOOLBAR_VSEP, \ CID_COLOUR00, CID_COLOUR01, CID_COLOUR02, CID_COLOUR03, CID_COLOUR04, \ diff --git a/assets/toolDecrCanvasH.png b/assets/toolDecrCanvasH.png new file mode 100644 index 0000000000000000000000000000000000000000..6b372738c70ceac3d8eb7dfb8d14e1aecd9592be GIT binary patch literal 271 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DkxK$!8B)5ZfpLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33JwwYY*EXd974>+! zIEGmGFYR&UJ8ZzgGTE#>PV4Fa`KlXC-$_jfUOmmNEiyrP;(m>%T#*jFdB<*KyxuVX zqwcMsKkrW{>1_KR!l!NFJkO=}!O|NO-&N0Jk=?NCQ1O`pW=H0I0v~0J?>HQ3Ja0X9 zyXYK6|3!8iwE2Om?{#mJ_#gJT@_bM4Hoo7IkvclkOJf#J*{^(?HHWADxK5Y(A)vb$ NJYD@<);T3K0RX`gV}t+z literal 0 HcmV?d00001 diff --git a/assets/toolDecrCanvasW.png b/assets/toolDecrCanvasW.png new file mode 100644 index 0000000000000000000000000000000000000000..64e964b41c9004f4b29f1a2f3d913cd380de3c9a GIT binary patch literal 250 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DkxK$!8B)5ZfpLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33JwwYY*EXd96_tCs zIEGmGFYO8BYcSw&?zKO*;=8@xI&PoFT^6d9o|PrDU7m=C^f^4`h-+@SY6GAX7(8A5T-G@yGywpyLR4%3 literal 0 HcmV?d00001 diff --git a/assets/toolIncrCanvasH.png b/assets/toolIncrCanvasH.png new file mode 100644 index 0000000000000000000000000000000000000000..157c81aaea85d69d2dbd72735fe95810ac6ed72a GIT binary patch literal 236 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DkxK$!8B)5ZfpLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33JwwYY*EXd96=iz5 zIEGmGukDHEJD|Y9viJYel@sz#t&Z3tFMMZWs=!6Tm2U)EHC}7w%n;0o|7i1W(tPbj z9$jzl@wt6`&M0F0W4f%Y%L-Nz8!%%B>y9(Vfp6pvG|krrYY=o@d}hfeXRZCtkC`es W*5-#79$yQzl)=;0&t;ucLK6UCCs9ZM literal 0 HcmV?d00001 diff --git a/assets/toolIncrCanvasW.png b/assets/toolIncrCanvasW.png new file mode 100644 index 0000000000000000000000000000000000000000..6790bfc4babf737cd7a644743ccb6e1109550703 GIT binary patch literal 232 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DkxL735kHCP2GC|TkfQ4*Y=R#Ki=l*&+$n3-3imzP?iV4`QBXJ~ol+NKnsqEt^8 z#}EturM--N2NXD%|NdV-b4J3F5{nrpC3iCM3I1fAD!O8g!&1ZkxX&kxTfG+VJ-{aT zCb%g=h>aIWS)63!)#|<0l+%#9Z^xfy3H{t!Ev&08n#?z(+i&xjw&9GZ?212qJ?vA? Wtj!nQwL= Date: Thu, 11 Jan 2018 03:02:18 +0100 Subject: [PATCH 126/148] MiRCARTFrame.py: initially select red (4) colour toolbar item. --- MiRCARTFrame.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 7def5e7..9ac8738 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -76,11 +76,11 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_CLONE_SELECT = [0x155, TID_SELECT, "Clone", "Cl&one", ["toolClone.png"], [wx.ACCEL_CTRL, ord("E")], False, MiRCARTCanvasInterface.canvasToolSelectClone] CID_MOVE_SELECT = [0x156, TID_SELECT, "Move", "&Move", ["toolMove.png"], [wx.ACCEL_CTRL, ord("M")], False, MiRCARTCanvasInterface.canvasToolSelectMove] - CID_COLOUR00 = [0x1a0, TID_SELECT, "Colour #00", "Colour #00", None, None, True, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR00 = [0x1a0, TID_SELECT, "Colour #00", "Colour #00", None, None, False, MiRCARTCanvasInterface.canvasColour] CID_COLOUR01 = [0x1a1, TID_SELECT, "Colour #01", "Colour #01", None, None, False, MiRCARTCanvasInterface.canvasColour] CID_COLOUR02 = [0x1a2, TID_SELECT, "Colour #02", "Colour #02", None, None, False, MiRCARTCanvasInterface.canvasColour] CID_COLOUR03 = [0x1a3, TID_SELECT, "Colour #03", "Colour #03", None, None, False, MiRCARTCanvasInterface.canvasColour] - CID_COLOUR04 = [0x1a4, TID_SELECT, "Colour #04", "Colour #04", None, None, False, MiRCARTCanvasInterface.canvasColour] + CID_COLOUR04 = [0x1a4, TID_SELECT, "Colour #04", "Colour #04", None, None, True, MiRCARTCanvasInterface.canvasColour] CID_COLOUR05 = [0x1a5, TID_SELECT, "Colour #05", "Colour #05", None, None, False, MiRCARTCanvasInterface.canvasColour] CID_COLOUR06 = [0x1a6, TID_SELECT, "Colour #06", "Colour #06", None, None, False, MiRCARTCanvasInterface.canvasColour] CID_COLOUR07 = [0x1a7, TID_SELECT, "Colour #07", "Colour #07", None, None, False, MiRCARTCanvasInterface.canvasColour] From 67a824779e5b146556a8794250ea3b10b1436032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 21:28:53 +0100 Subject: [PATCH 127/148] IrcMiRCARTBot.py: include black-on-black border around map. IrcMiRCARTBot.py: normalise imported map. --- IrcMiRCARTBot.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index 9977488..b028c43 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -142,6 +142,17 @@ class IrcMiRCARTBot(IrcClient.IrcClient): return canvasStore = MiRCARTCanvasImportStore(inFile=asciiTmpFilePath) + numRowCols = 0 + for numRow in range(len(canvasStore.outMap)): + numRowCols = max(numRowCols, len(canvasStore.outMap[numRow])) + for numRow in range(len(canvasStore.outMap)): + if len(canvasStore.outMap[numRow]) != numRowCols: + for numColOff in range(numRowCols - len(canvasStore.outMap[numRow])): + canvasStore.outMap[numRow].append([[1, 1], 0, " "]) + canvasStore.outMap[numRow].insert(0, [[1, 1], 0, " "]) + canvasStore.outMap[numRow].append([[1, 1], 0, " "]) + canvasStore.outMap.insert(0, [[[1, 1], 0, " "]] * len(canvasStore.outMap[0])) + canvasStore.outMap.append([[[1, 1], 0, " "]] * len(canvasStore.outMap[0])) MiRCARTToPngFile(canvasStore.outMap, "DejaVuSansMono.ttf", 11).export(imgTmpFilePath) imgurResponse = self._uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") if imgurResponse[0] == 200: From 154d2b32a56518b47210bedb7c32216ebe4c3c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 23:13:46 +0100 Subject: [PATCH 128/148] MiRCARTCanvasImportStore.py:_parseCharAsColourSpec(): correctly process mIRC colour control code sequences specifying one single colour. MiRCARTToPngFile.py:export(): fix indentation. --- MiRCARTCanvasImportStore.py | 2 +- MiRCARTToPngFile.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MiRCARTCanvasImportStore.py b/MiRCARTCanvasImportStore.py index 9dc2c54..9150ea8 100644 --- a/MiRCARTCanvasImportStore.py +++ b/MiRCARTCanvasImportStore.py @@ -57,7 +57,7 @@ class MiRCARTCanvasImportStore(): return (int(colourSpec[0] or curColours[0]), \ int(colourSpec[1])) elif len(colourSpec) == 1: - return (int(colourSpec[0]), curColours[0]) + return (int(colourSpec[0]), curColours[1]) else: return (15, 1) # }}} diff --git a/MiRCARTToPngFile.py b/MiRCARTToPngFile.py index ed76ccc..de875b0 100755 --- a/MiRCARTToPngFile.py +++ b/MiRCARTToPngFile.py @@ -97,7 +97,7 @@ class MiRCARTToPngFile: else: if inCurCell[2] != " ": outColours[0] = self._ColourMapNormal[inCurCell[0][0]] - outColours[1] = self._ColourMapNormal[inCurCell[0][1]] + outColours[1] = self._ColourMapNormal[inCurCell[0][1]] outImgDraw.rectangle((*outCurPos, \ outCurPos[0] + self.outImgFontSize[0], \ outCurPos[1] + self.outImgFontSize[1]), \ From 4a093c25a70c710e5d1b87cde7a459a82aff7c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 23:22:02 +0100 Subject: [PATCH 129/148] =?UTF-8?q?MiRCARTToPngFile.py:export():=20treat?= =?UTF-8?q?=20`=E2=96=88'=20as=20whitespace=20w/=20inverse=20colours.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MiRCARTToPngFile.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/MiRCARTToPngFile.py b/MiRCARTToPngFile.py index de875b0..a5f6a12 100755 --- a/MiRCARTToPngFile.py +++ b/MiRCARTToPngFile.py @@ -92,17 +92,27 @@ class MiRCARTToPngFile: outColours = [0, 0] if inCurCell[1] & 0x02: if inCurCell[2] != " ": - outColours[0] = self._ColourMapBold[inCurCell[0][0]] - outColours[1] = self._ColourMapBold[inCurCell[0][1]] + if inCurCell[2] == "█": + outColours[1] = self._ColourMapBold[inCurCell[0][0]] + else: + outColours[0] = self._ColourMapBold[inCurCell[0][0]] + outColours[1] = self._ColourMapBold[inCurCell[0][1]] + else: + outColours[1] = self._ColourMapBold[inCurCell[0][1]] else: if inCurCell[2] != " ": - outColours[0] = self._ColourMapNormal[inCurCell[0][0]] - outColours[1] = self._ColourMapNormal[inCurCell[0][1]] + if inCurCell[2] == "█": + outColours[1] = self._ColourMapNormal[inCurCell[0][0]] + else: + outColours[0] = self._ColourMapNormal[inCurCell[0][0]] + outColours[1] = self._ColourMapNormal[inCurCell[0][1]] + else: + outColours[1] = self._ColourMapNormal[inCurCell[0][1]] outImgDraw.rectangle((*outCurPos, \ outCurPos[0] + self.outImgFontSize[0], \ outCurPos[1] + self.outImgFontSize[1]), \ fill=(*outColours[1], 255)) - if inCurCell[2] != " " \ + if not inCurCell[2] in " █" \ and outColours[0] != outColours[1]: # XXX implement italic outImgDraw.text(outCurPos, \ From d6f72e17f7b1d649514c6258e63490a05f19ece5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 23:26:36 +0100 Subject: [PATCH 130/148] MiRCART{CanvasInterface,Frame}.py: complete set of {brush,canvas} size operations. assets/tool{De,In}cr{Brush,Canvas}{H{,W},W}.png: added/updated. --- MiRCARTCanvasInterface.py | 48 ++++++++++++++++++++++++++++-------- MiRCARTFrame.py | 43 +++++++++++++++++++++----------- assets/toolDecrBrushH.png | Bin 0 -> 271 bytes assets/toolDecrBrushHW.png | Bin 0 -> 277 bytes assets/toolDecrBrushW.png | Bin 0 -> 250 bytes assets/toolDecrCanvasH.png | Bin 271 -> 265 bytes assets/toolDecrCanvasHW.png | Bin 0 -> 289 bytes assets/toolDecrCanvasW.png | Bin 250 -> 249 bytes assets/toolIncrBrushH.png | Bin 0 -> 236 bytes assets/toolIncrBrushHW.png | Bin 0 -> 290 bytes assets/toolIncrBrushW.png | Bin 0 -> 232 bytes assets/toolIncrCanvasH.png | Bin 236 -> 246 bytes assets/toolIncrCanvasHW.png | Bin 0 -> 282 bytes assets/toolIncrCanvasW.png | Bin 232 -> 236 bytes 14 files changed, 67 insertions(+), 24 deletions(-) create mode 100644 assets/toolDecrBrushH.png create mode 100644 assets/toolDecrBrushHW.png create mode 100644 assets/toolDecrBrushW.png create mode 100644 assets/toolDecrCanvasHW.png create mode 100644 assets/toolIncrBrushH.png create mode 100644 assets/toolIncrBrushHW.png create mode 100644 assets/toolIncrBrushW.png create mode 100644 assets/toolIncrCanvasHW.png diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index c9f932b..c95a524 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -106,12 +106,21 @@ class MiRCARTCanvasInterface(): def canvasCut(self, event): pass # }}} - # {{{ canvasDecrBrush(self, event): XXX - def canvasDecrBrush(self, event): - if self.parentCanvas.brushSize[0] > 1 \ - and self.parentCanvas.brushSize[1] > 1: - self.parentCanvas.brushSize = \ - [a-1 for a in self.parentCanvas.brushSize] + # {{{ canvasDecrBrushHeight(self, event): XXX + def canvasDecrBrushHeight(self, event): + if self.parentCanvas.brushSize[1] > 1: + self.parentCanvas.brushSize[1] -= 1 + self.parentFrame.onCanvasUpdate(brushSize=self.parentCanvas.brushSize) + # }}} + # {{{ canvasDecrBrushHeightWidth(self, event): XXX + def canvasDecrBrushHeightWidth(self, event): + self.canvasDecrBrushHeight(event) + self.canvasDecrBrushWidth(event) + # }}} + # {{{ canvasDecrBrushWidth(self, event): XXX + def canvasDecrBrushWidth(self, event): + if self.parentCanvas.brushSize[0] > 1: + self.parentCanvas.brushSize[0] -= 1 self.parentFrame.onCanvasUpdate(brushSize=self.parentCanvas.brushSize) # }}} # {{{ canvasDecrCanvasHeight(self, event): XXX @@ -121,6 +130,11 @@ class MiRCARTCanvasInterface(): self.parentCanvas.canvasSize[0], \ self.parentCanvas.canvasSize[1]-1]) # }}} + # {{{ canvasDecrCanvasHeightWidth(self, event): XXX + def canvasDecrCanvasHeightWidth(self, event): + self.canvasDecrCanvasHeight(event) + self.canvasDecrCanvasWidth(event) + # }}} # {{{ canvasDecrCanvasWidth(self, event): XXX def canvasDecrCanvasWidth(self, event): if self.parentCanvas.canvasSize[0] > 1: @@ -197,10 +211,19 @@ class MiRCARTCanvasInterface(): wx.MessageBox("Failed to export to Pastebin: " + pasteResult, \ "Export to Pastebin", wx.OK|wx.ICON_EXCLAMATION) # }}} - # {{{ canvasIncrBrush(self, event): XXX - def canvasIncrBrush(self, event): - self.parentCanvas.brushSize = \ - [a+1 for a in self.parentCanvas.brushSize] + # {{{ canvasIncrBrushHeight(self, event): XXX + def canvasIncrBrushHeight(self, event): + self.parentCanvas.brushSize[1] += 1 + self.parentFrame.onCanvasUpdate(brushSize=self.parentCanvas.brushSize) + # }}} + # {{{ canvasIncrBrushHeightWidth(self, event): XXX + def canvasIncrBrushHeightWidth(self, event): + self.canvasIncrBrushHeight(event) + self.canvasIncrBrushWidth(event) + # }}} + # {{{ canvasIncrBrushWidth(self, event): XXX + def canvasIncrBrushWidth(self, event): + self.parentCanvas.brushSize[0] += 1 self.parentFrame.onCanvasUpdate(brushSize=self.parentCanvas.brushSize) # }}} # {{{ canvasIncrCanvasHeight(self, event): XXX @@ -209,6 +232,11 @@ class MiRCARTCanvasInterface(): self.parentCanvas.canvasSize[0], \ self.parentCanvas.canvasSize[1]+1]) # }}} + # {{{ canvasIncrCanvasHeightWidth(self, event): XXX + def canvasIncrCanvasHeightWidth(self, event): + self.canvasIncrCanvasHeight(event) + self.canvasIncrCanvasWidth(event) + # }}} # {{{ canvasIncrCanvasWidth(self, event): XXX def canvasIncrCanvasWidth(self, event): self._updateCanvasSize([ \ diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 9ac8738..3a3d3bf 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -55,18 +55,30 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_PASTE = [0x10c, TID_COMMAND, "Paste", "&Paste", ["", wx.ART_PASTE], None, False, MiRCARTCanvasInterface.canvasPaste] CID_DELETE = [0x10d, TID_COMMAND, "Delete", "De&lete", ["", wx.ART_DELETE], None, False, MiRCARTCanvasInterface.canvasDelete] CID_INCRW_CANVAS = [0x10e, TID_COMMAND, "Increase canvas width", \ - "Increase canvas &width", ["toolIncrCanvasW.png"], [wx.ACCEL_ALT, ord("D")], None, MiRCARTCanvasInterface.canvasIncrCanvasWidth] + "Increase canvas width", ["toolIncrCanvasW.png"], None, None, MiRCARTCanvasInterface.canvasIncrCanvasWidth] CID_DECRW_CANVAS = [0x10f, TID_COMMAND, "Decrease canvas width", \ - "Decrease canvas w&idth", ["toolDecrCanvasW.png"], [wx.ACCEL_ALT, ord("A")], None, MiRCARTCanvasInterface.canvasDecrCanvasWidth] + "Decrease canvas width", ["toolDecrCanvasW.png"], None, None, MiRCARTCanvasInterface.canvasDecrCanvasWidth] CID_INCRH_CANVAS = [0x110, TID_COMMAND, "Increase canvas height", \ - "Increase canvas &height", ["toolIncrCanvasH.png"], [wx.ACCEL_ALT, ord("S")], None, MiRCARTCanvasInterface.canvasIncrCanvasHeight] + "Increase canvas height", ["toolIncrCanvasH.png"], None, None, MiRCARTCanvasInterface.canvasIncrCanvasHeight] CID_DECRH_CANVAS = [0x111, TID_COMMAND, "Decrease canvas height", \ - "Decrease canvas h&eight", ["toolDecrCanvasH.png"], [wx.ACCEL_ALT, ord("W")], None, MiRCARTCanvasInterface.canvasDecrCanvasHeight] - CID_INCR_BRUSH = [0x112, TID_COMMAND, "Increase brush size", \ - "I&ncrease brush size", ["", wx.ART_PLUS], [wx.ACCEL_CTRL, ord("+")], None, MiRCARTCanvasInterface.canvasIncrBrush] - CID_DECR_BRUSH = [0x113, TID_COMMAND, "Decrease brush size", \ - "&Decrease brush size", ["", wx.ART_MINUS], [wx.ACCEL_CTRL, ord("-")], None, MiRCARTCanvasInterface.canvasDecrBrush] - CID_SOLID_BRUSH = [0x114, TID_SELECT, "Solid brush", "&Solid brush", None, None, True, MiRCARTCanvasInterface.canvasBrushSolid] + "Decrease canvas height", ["toolDecrCanvasH.png"], None, None, MiRCARTCanvasInterface.canvasDecrCanvasHeight] + CID_INCRHW_CANVAS = [0x112, TID_COMMAND, "Increase canvas size", \ + "Increase canvas size", ["toolIncrCanvasHW.png"], None, None, MiRCARTCanvasInterface.canvasIncrCanvasHeightWidth] + CID_DECRHW_CANVAS = [0x113, TID_COMMAND, "Decrease canvas size", \ + "Decrease canvas size", ["toolDecrCanvasHW.png"], None, None, MiRCARTCanvasInterface.canvasDecrCanvasHeightWidth] + CID_INCRW_BRUSH = [0x114, TID_COMMAND, "Increase brush width", \ + "Increase brush width", ["toolIncrBrushW.png"], None, None, MiRCARTCanvasInterface.canvasIncrBrushWidth] + CID_DECRW_BRUSH = [0x115, TID_COMMAND, "Decrease brush width", \ + "Decrease brush width", ["toolDecrBrushW.png"], None, None, MiRCARTCanvasInterface.canvasDecrBrushWidth] + CID_INCRH_BRUSH = [0x116, TID_COMMAND, "Increase brush height", \ + "Increase brush height", ["toolIncrBrushH.png"], None, None, MiRCARTCanvasInterface.canvasIncrBrushHeight] + CID_DECRH_BRUSH = [0x117, TID_COMMAND, "Decrease brush height", \ + "Decrease brush height", ["toolDecrBrushH.png"], None, None, MiRCARTCanvasInterface.canvasDecrBrushHeight] + CID_INCRHW_BRUSH = [0x118, TID_COMMAND, "Increase brush size", \ + "Increase brush size", ["toolIncrBrushHW.png"], None, None, MiRCARTCanvasInterface.canvasIncrBrushHeightWidth] + CID_DECRHW_BRUSH = [0x119, TID_COMMAND, "Decrease brush size", \ + "Decrease brush size", ["toolDecrBrushHW.png"], None, None, MiRCARTCanvasInterface.canvasDecrBrushHeightWidth] + CID_SOLID_BRUSH = [0x11a, TID_SELECT, "Solid brush", "Solid brush", None, None, True, MiRCARTCanvasInterface.canvasBrushSolid] CID_RECT = [0x150, TID_SELECT, "Rectangle", "&Rectangle", ["toolRect.png"], [wx.ACCEL_CTRL, ord("R")], True, MiRCARTCanvasInterface.canvasToolRect] CID_CIRCLE = [0x151, TID_SELECT, "Circle", "&Circle", ["toolCircle.png"], [wx.ACCEL_CTRL, ord("C")], False, MiRCARTCanvasInterface.canvasToolCircle] @@ -102,7 +114,10 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_UNDO, CID_REDO, NID_MENU_SEP, \ CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_MENU_SEP, \ CID_INCRW_CANVAS, CID_DECRW_CANVAS, CID_INCRH_CANVAS, CID_DECRH_CANVAS, NID_MENU_SEP, \ - CID_INCR_BRUSH, CID_DECR_BRUSH, CID_SOLID_BRUSH)) + CID_INCRHW_CANVAS, CID_DECRHW_CANVAS, NID_MENU_SEP, \ + CID_INCRW_BRUSH, CID_DECRW_BRUSH, CID_INCRH_BRUSH, CID_DECRH_BRUSH, NID_MENU_SEP, \ + CID_INCRHW_BRUSH, CID_DECRHW_BRUSH, NID_MENU_SEP, \ + CID_SOLID_BRUSH)) MID_TOOLS = (0x302, TID_MENU, "Tools", "&Tools", ( \ CID_RECT, CID_CIRCLE, CID_FILL, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT)) # }}} @@ -111,20 +126,20 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_TOOLBAR_HSEP, \ CID_UNDO, CID_REDO, NID_TOOLBAR_HSEP, \ CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_TOOLBAR_HSEP, \ - CID_INCR_BRUSH, CID_DECR_BRUSH, NID_TOOLBAR_HSEP, \ CID_INCRW_CANVAS, CID_DECRW_CANVAS, CID_INCRH_CANVAS, CID_DECRH_CANVAS, NID_TOOLBAR_HSEP, \ + CID_INCRHW_CANVAS, CID_DECRHW_CANVAS, NID_TOOLBAR_HSEP, \ CID_RECT, CID_CIRCLE, CID_FILL, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT, \ NID_TOOLBAR_VSEP, \ CID_COLOUR00, CID_COLOUR01, CID_COLOUR02, CID_COLOUR03, CID_COLOUR04, \ CID_COLOUR05, CID_COLOUR06, CID_COLOUR07, CID_COLOUR08, CID_COLOUR09, \ CID_COLOUR10, CID_COLOUR11, CID_COLOUR12, CID_COLOUR13, CID_COLOUR14, \ - CID_COLOUR15)) + CID_COLOUR15, NID_TOOLBAR_HSEP, \ + CID_INCRW_BRUSH, CID_DECRW_BRUSH, CID_INCRH_BRUSH, CID_DECRH_BRUSH, NID_TOOLBAR_HSEP, \ + CID_INCRHW_BRUSH, CID_DECRHW_BRUSH)) # }}} # {{{ Accelerators (hotkeys) AID_EDIT = (0x500, TID_ACCELS, ( \ CID_NEW, CID_OPEN, CID_SAVE, CID_EXIT, CID_UNDO, CID_REDO, \ - CID_INCRW_CANVAS, CID_DECRW_CANVAS, CID_INCRH_CANVAS, CID_DECRH_CANVAS, \ - CID_INCR_BRUSH, CID_DECR_BRUSH, \ CID_RECT, CID_CIRCLE, CID_FILL, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT)) # }}} # {{{ Lists diff --git a/assets/toolDecrBrushH.png b/assets/toolDecrBrushH.png new file mode 100644 index 0000000000000000000000000000000000000000..6b372738c70ceac3d8eb7dfb8d14e1aecd9592be GIT binary patch literal 271 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DkxK$!8B)5ZfpLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33JwwYY*EXd974>+! zIEGmGFYR&UJ8ZzgGTE#>PV4Fa`KlXC-$_jfUOmmNEiyrP;(m>%T#*jFdB<*KyxuVX zqwcMsKkrW{>1_KR!l!NFJkO=}!O|NO-&N0Jk=?NCQ1O`pW=H0I0v~0J?>HQ3Ja0X9 zyXYK6|3!8iwE2Om?{#mJ_#gJT@_bM4Hoo7IkvclkOJf#J*{^(?HHWADxK5Y(A)vb$ NJYD@<);T3K0RX`gV}t+z literal 0 HcmV?d00001 diff --git a/assets/toolDecrBrushHW.png b/assets/toolDecrBrushHW.png new file mode 100644 index 0000000000000000000000000000000000000000..b5c14cab292f3c54f7e4ca27ef5d452646aa4102 GIT binary patch literal 277 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DjGL736~_k^`TLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33JwwYY*EXd96;1MV zaSXBWU)y_-@2~-f^XAg_IJK|;>&==O`X(<-nfyy7*g#EpYnVnt{_?_t8@E@QpS$zk z#NpX$Nv3vVMU^d!4Sw#PB$_mDu5*k0hGUA{63ad0f8JX>@tgeJ-weXWOvhBKvW4xw ziEzn92^d_d&H}MtEo*FVy0LkU#l6>w)?pTNPI65=s~s6>Ab-Z|?ETQw>@(G#r^?M@ R)B(DV!PC{xWt~$(698I$W1Rp1 literal 0 HcmV?d00001 diff --git a/assets/toolDecrBrushW.png b/assets/toolDecrBrushW.png new file mode 100644 index 0000000000000000000000000000000000000000..64e964b41c9004f4b29f1a2f3d913cd380de3c9a GIT binary patch literal 250 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DkxK$!8B)5ZfpLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33JwwYY*EXd96_tCs zIEGmGFYO8BYcSw&?zKO*;=8@xI&PoFT^6d9o|PrDU7m=C^f^4`h-+@SY6GAX7(8A5T-G@yGywpyLR4%3 literal 0 HcmV?d00001 diff --git a/assets/toolDecrCanvasH.png b/assets/toolDecrCanvasH.png index 6b372738c70ceac3d8eb7dfb8d14e1aecd9592be..1ea55ef3699cd94dedc187666d5852c949a77999 100644 GIT binary patch delta 177 zcmV;i08amp0*L~UJPN%401mwYNBfYikwz$ghDk(0R5(wij7tu{AP7Y5XVFcQ-v6?e zG2jQ0XiM^R7zP4W{7HyZc$P5_=-va_W`T`_cpjXE9{(Q5bU~v>9mENtX43~Q0!OmX zGyedzg_;*b%vxKhc`?LPJ?bHD2sN8Nun{|inw5po&pMU#mEQ&NB*gRJEOcwuy$7-! fOADHO;5#9{-ZT(D8=bp~00000NkvXXu0mjfAel?w delta 183 zcmV;o07(Cd0*?ZaJPN)501mzZ>O!%=kwz$gj7da6R5(wij6n{=FbD*bHiup+<^P{0 zur=-)kW;IcMuu5n6Oq3t!lvI6;>1s;*b z3=DjGK$vmro+3}6pk#?_L`iUdT1k0gQ7S`0VrE{6US4X6f{C7io}uNHYnxJlispH` zIEGmGZ=DdxcgTRp+1jB)Ugcf=%}M5SCX_|Dn@m_4XKXtA zaY=dMg~=W~6MA;4v|sm7X?r-2XG3(;S|6FlA1y7bKOXy3?8w#FK5^28r@CAbWk2UL zah`p>`(bL$rX70ktz}+ny#J#wJ}vNIltSDD+n4hf%I~#Q&bHk+HIrXP?v9e+Qzwoc hW=e+g?2)ge%tJPN%401mwYNBfYikwz$gc1c7*R5(wyj8O`JFbqS7KO*Y=k2_mP zN7tx$)yh>$?-$M?82!c z$=nvKfd0sELA*VqY-f6%5%bN!@fa#F!*oW>cZQk%_KdP*&d>_pQ|bk?trJIU2~~Ft P00000NkvXXu0mjf`36Sc delta 162 zcmV;T0A2t20r~-uJPN)501mzZ>O!%=kwz$gcS%G+R5(wij8P7NFbG49KgOu{KQ68d zOo6&MC3#7Cbelxv7gUZw!lvI6;>1s;*b z3=DkxK$!8B)5ZfpLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33JwwYY*EXd96=iz5 zIEGmGukDHEJD|Y9viJYel@sz#t&Z3tFMMZWs=!6Tm2U)EHC}7w%n;0o|7i1W(tPbj z9$jzl@wt6`&M0F0W4f%Y%L-Nz8!%%B>y9(Vfp6pvG|krrYY=o@d}hfeXRZCtkC`es W*5-#79$yQzl)=;0&t;ucLK6UCCs9ZM literal 0 HcmV?d00001 diff --git a/assets/toolIncrBrushHW.png b/assets/toolIncrBrushHW.png new file mode 100644 index 0000000000000000000000000000000000000000..34f3a41458da9ff15f619a2ae06c72a7081d565f GIT binary patch literal 290 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DjGL736~_k^`TLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33JwwYY*EXd970vf_ zaSXBWU)y(^>#zZj^X}7!=M_oZ8$K==iX-qnPr!h6)IT%GM~FKr7`EE_K67(WsUb*v`_z$-{5VV z&%<8*q3xjSLdWa6{J*$7-t!%vW_Z|f#q9PXPsR!N=008!@m%SjQVRobd?C=J|8fDL g;#$+6S>^s__|kqizrE;%GSI0Ep00i_>zopr0C^Q|mjD0& literal 0 HcmV?d00001 diff --git a/assets/toolIncrBrushW.png b/assets/toolIncrBrushW.png new file mode 100644 index 0000000000000000000000000000000000000000..6790bfc4babf737cd7a644743ccb6e1109550703 GIT binary patch literal 232 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DkxL735kHCP2GC|TkfQ4*Y=R#Ki=l*&+$n3-3imzP?iV4`QBXJ~ol+NKnsqEt^8 z#}EturM--N2NXD%|NdV-b4J3F5{nrpC3iCM3I1fAD!O8g!&1ZkxX&kxTfG+VJ-{aT zCb%g=h>aIWS)63!)#|<0l+%#9Z^xfy3H{t!Ev&08n#?z(+i&xjw&9GZ?212qJ?vA? Wtj!nQwL=M%9u{#6d+00009 M07*qoM6N<$g6gqKc>n+a delta 147 zcmeyy_=a(U4c9&f2EKiaubeg>nCPZam+9%^7-HeSwkMkJfC2~0-v3KiPRKj8I%12w z@STaN0v82Wz7c5Ec&(K)Log%$qs_ZX^R*XwbiKL9=l1bAqloQ~>9VpeD_BKrz>FQN xJI)vfzL7i7G+!I6LC|&anI)T?we~wdW~$&=n;%|yd@TbIc)I$ztaD0e0su1SJ^TOw diff --git a/assets/toolIncrCanvasHW.png b/assets/toolIncrCanvasHW.png new file mode 100644 index 0000000000000000000000000000000000000000..4002cc8bd198d614cb9a4f65d268aec5107f8796 GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DjGK$vmro+3}6pk#?_L`iUdT1k0gQ7S`0VrE{6US4X6f{C7io}uNHYnxJlil%$I zIEGmGFAd`4Yf#{E<~{bmUgCOWLBoqHYO>b5*qR+D)ETKT`mq-2D?UG$snEd@W}%d# zDll1+$z#cz>5k{R4<38AR&t&48NF|{z|jfF`G5CrmOB#Qn?c9+xoVbBa%;E@)95O XgTe~DWM4fdjwwf literal 0 HcmV?d00001 diff --git a/assets/toolIncrCanvasW.png b/assets/toolIncrCanvasW.png index 6790bfc4babf737cd7a644743ccb6e1109550703..48f8053c6a218392aa207d1a6f2e008344bdb116 100644 GIT binary patch delta 147 zcmaFC_=a(U4c9&f2EKiaubeg>nCPZam+9%^7-HeSwTF@GfB^^d-~Y?!Hi@m3y45SX zZpq2ONr&YXr!Bs2`oBJ*$z?}&8;HnjKlGs2Iq}1*2Qw4|-_2SGB8nyNPdw+FdPaEn zey(bnV7m{8J|B6v{LtwieIbP0l+XkKe~d*9 delta 143 zcmV;A0C4~80q6mcJPN-601m$aI0aKAkwz$bWl2OqR5(wijR6k8AP58f|EHOlV5D?7 zn8_Kr0uB-R1(g-3tU#qPk6!c1bA?Kyy}$+$>{EhR5(W+IQ-V0j1`R5W)`Dz+Wxlxl xreKc?Due~AID$8@XFs+`maxnf9jN?{j0cp=t#1{&xElZf002ovPDHLkV1m<)Iqm=e From ea9f82709918791dbbc3981f0ee8a2e11aee4e4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 23:27:57 +0100 Subject: [PATCH 131/148] MiRCARTColours.py: fix permission bits. --- MiRCARTColours.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 MiRCARTColours.py diff --git a/MiRCARTColours.py b/MiRCARTColours.py old mode 100755 new mode 100644 From 0724c8086835e3379e55a0c77f23f3d5bf3e5e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sat, 20 Jan 2018 09:17:52 +0100 Subject: [PATCH 132/148] MiRCARTCanvasImportStore.py: correctly process ^C, sequences. MiRCARTToPngFile.py: fix {bold,underline} processing. --- MiRCARTCanvasImportStore.py | 19 ++++++++++++++----- MiRCARTToPngFile.py | 28 +++++++++++++++------------- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/MiRCARTCanvasImportStore.py b/MiRCARTCanvasImportStore.py index 9150ea8..e35b4a9 100644 --- a/MiRCARTCanvasImportStore.py +++ b/MiRCARTCanvasImportStore.py @@ -53,10 +53,12 @@ class MiRCARTCanvasImportStore(): def _parseCharAsColourSpec(self, colourSpec, curColours): if len(colourSpec) > 0: colourSpec = colourSpec.split(",") - if len(colourSpec) == 2: + if len(colourSpec) == 2 \ + and len(colourSpec[1]) > 0: return (int(colourSpec[0] or curColours[0]), \ int(colourSpec[1])) - elif len(colourSpec) == 1: + elif len(colourSpec) == 1 \ + or len(colourSpec[1]) == 0: return (int(colourSpec[0]), curColours[1]) else: return (15, 1) @@ -108,9 +110,16 @@ class MiRCARTCanvasImportStore(): or inParseState == self._ParseState.PS_COLOUR_DIGIT1: if inChar == "," \ and inParseState == self._ParseState.PS_COLOUR_DIGIT0: - inCurCol += 1 - inCurColourDigits = 0; inCurColourSpec += inChar; - inParseState = self._ParseState.PS_COLOUR_DIGIT1 + if (inCurCol + 1) < inMaxCol \ + and not inLine[inCurCol + 1] in set("0123456789"): + inCurColours = self._parseCharAsColourSpec( \ + inCurColourSpec, inCurColours) + inCurColourDigits = 0; inCurColourSpec = ""; + inParseState = self._ParseState.PS_CHAR + else: + inCurCol += 1 + inCurColourDigits = 0; inCurColourSpec += inChar; + inParseState = self._ParseState.PS_COLOUR_DIGIT1 elif inChar in set("0123456789") \ and inCurColourDigits == 0: inCurCol += 1 diff --git a/MiRCARTToPngFile.py b/MiRCARTToPngFile.py index a5f6a12..16661b8 100755 --- a/MiRCARTToPngFile.py +++ b/MiRCARTToPngFile.py @@ -71,13 +71,12 @@ class MiRCARTToPngFile: [187, 187, 187], # Light Grey ] # }}} - # {{{ _drawUnderline(self, curPos, fontSize, imgDraw): XXX - def _drawUnderLine(self, curPos, fontSize, imgDraw): - imgDraw.line( \ - (curPos[0], \ - curPos[1] + (fontSize[1] - 2)), \ - (curPos[0] + fontSize[0], \ - curPos[1] + (fontSize[1] - 2)), fill=outColours[0]) + # {{{ _drawUnderline(self, curPos, fontSize, imgDraw, fillColour): XXX + def _drawUnderLine(self, curPos, fontSize, imgDraw, fillColour): + imgDraw.line( \ + xy=(curPos[0], curPos[1] + (fontSize[1] - 2), \ + curPos[0] + fontSize[0], curPos[1] + (fontSize[1] - 2)), \ + fill=fillColour) # }}} # {{{ export(self, outFilePath): XXX def export(self, outFilePath): @@ -90,15 +89,15 @@ class MiRCARTToPngFile: for inCurCol in range(len(self.inCanvasMap[inCurRow])): inCurCell = self.inCanvasMap[inCurRow][inCurCol] outColours = [0, 0] - if inCurCell[1] & 0x02: + if inCurCell[1] & MiRCARTCanvasImportStore.MiRCARTCanvasImportStore._CellState.CS_BOLD: if inCurCell[2] != " ": if inCurCell[2] == "█": - outColours[1] = self._ColourMapBold[inCurCell[0][0]] + outColours[1] = self._ColourMapNormal[inCurCell[0][0]] else: outColours[0] = self._ColourMapBold[inCurCell[0][0]] - outColours[1] = self._ColourMapBold[inCurCell[0][1]] + outColours[1] = self._ColourMapNormal[inCurCell[0][1]] else: - outColours[1] = self._ColourMapBold[inCurCell[0][1]] + outColours[1] = self._ColourMapNormal[inCurCell[0][1]] else: if inCurCell[2] != " ": if inCurCell[2] == "█": @@ -117,8 +116,11 @@ class MiRCARTToPngFile: # XXX implement italic outImgDraw.text(outCurPos, \ inCurCell[2], (*outColours[0], 255), self.outImgFont) - if inCurCell[1] & 0x1f: - self._drawUnderLine(curPos, self.outImgFontSize, outImgDraw) + if inCurCell[1] & MiRCARTCanvasImportStore.MiRCARTCanvasImportStore._CellState.CS_UNDERLINE: + outColours[0] = self._ColourMapNormal[inCurCell[0][0]] + self._drawUnderLine(outCurPos, \ + self.outImgFontSize, \ + outImgDraw, (*outColours[0], 255)) outCurPos[0] += self.outImgFontSize[0]; outCurPos[0] = 0 outCurPos[1] += self.outImgFontSize[1] From 7192b66805658b1802f9efce559f193a926a4863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Mon, 22 Jan 2018 21:06:46 +0100 Subject: [PATCH 133/148] IrcClient.py:connect(): create file from socket w/ errors="replace" to prevent UnicodeDecodeErrors. --- IrcClient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IrcClient.py b/IrcClient.py index 1d8647a..4891027 100644 --- a/IrcClient.py +++ b/IrcClient.py @@ -52,7 +52,7 @@ class IrcClient: self.close(); return False; else: select.select([], [self.clientSocket.fileno()], []) - self.clientSocketFile = self.clientSocket.makefile(encoding="utf-8") + self.clientSocketFile = self.clientSocket.makefile(encoding="utf-8", errors="replace") self.clientQueue = [] self.queue("NICK", self.clientNick) self.queue("USER", self.clientIdent, "0", "0", self.clientGecos) From 55b88412c921d01817ce0f5dda46b5a7eb72d764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 25 Jan 2018 15:02:09 +0100 Subject: [PATCH 134/148] MiRCARTCanvas.py:resize(): clean up & fix. MiRCARTCanvasInterface.py:_updateCanvasSize(): merged into ...Canvas.resize(). MiRCARTCanvasInterface.py:canvas{De,In}crCanvas{Height,Width}(): directly call ...Canvas.resize(). --- MiRCARTCanvas.py | 50 +++++++++++++++++++++++++------------ MiRCARTCanvasInterface.py | 52 +++++---------------------------------- 2 files changed, 40 insertions(+), 62 deletions(-) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index 0d5912c..c62e853 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -137,30 +137,48 @@ class MiRCARTCanvas(wx.Panel): def resize(self, newCanvasSize): if newCanvasSize != self.canvasSize: if self.canvasMap == None: - self.canvasMap = [[[(1, 1), 0, " "] \ - for x in range(self.canvasSize[0])] \ - for y in range(self.canvasSize[1])] + self.canvasMap = []; oldCanvasSize = [0, 0]; else: - for numRow in range(self.canvasSize[1]): - for numNewCol in range(self.canvasSize[0], newCanvasSize[0]): - self.canvasMap[numRow].append([[1, 1], 0, " "]) - for numNewRow in range(self.canvasSize[1], newCanvasSize[1]): - self.canvasMap.append([]) - for numNewCol in range(newCanvasSize[0]): - self.canvasMap[numNewRow].append([[1, 1], 0, " "]) - self.canvasSize = newCanvasSize - newWinSize = [a*b for a,b in \ - zip(self.canvasSize, self.canvasBackend.cellSize)] + oldCanvasSize = self.canvasSize + deltaCanvasSize = [b-a for a,b in zip(oldCanvasSize, newCanvasSize)] + + newWinSize = [a*b for a,b in zip(newCanvasSize, self.canvasBackend.cellSize)] self.SetMinSize(newWinSize) self.SetSize(wx.DefaultCoord, wx.DefaultCoord, *newWinSize) curWindow = self while curWindow != None: curWindow.Layout() curWindow = curWindow.GetParent() - self.canvasBackend.reset(self.canvasSize, self.canvasBackend.cellSize) + + self.canvasBackend.resize(newCanvasSize, self.canvasBackend.cellSize) + eventDc = self.canvasBackend.getDeviceContext(self) self.canvasJournal.resetCursor(); self.canvasJournal.resetUndo(); - self.parentFrame.onCanvasUpdate( \ - size=self.canvasSize, undoLevel=-1) + + if deltaCanvasSize[0] < 0: + for numRow in range(oldCanvasSize[1]): + del self.canvasMap[numRow][-1:(deltaCanvasSize[0]-1):-1] + else: + for numRow in range(oldCanvasSize[1]): + self.canvasMap[numRow].extend( \ + [[[1, 1], 0, " "]] * deltaCanvasSize[0]) + for numNewCol in range(oldCanvasSize[0], newCanvasSize[0]): + self.canvasBackend.drawPatch( \ + eventDc, [[numNewCol, numRow], \ + *self.canvasMap[numRow][-1]]) + if deltaCanvasSize[1] < 0: + del self.canvasMap[-1:(deltaCanvasSize[1]-1):-1] + else: + for numNewRow in range(oldCanvasSize[1], newCanvasSize[1]): + self.canvasMap.extend( \ + [[[[1, 1], 0, " "]] * newCanvasSize[0]]) + for numNewCol in range(newCanvasSize[0]): + self.canvasBackend.drawPatch( \ + eventDc, [[numNewCol, numNewRow], \ + *self.canvasMap[-1][-1]]) + + self.canvasSize = newCanvasSize + wx.SafeYield() + self.parentFrame.onCanvasUpdate(size=newCanvasSize, undoLevel=-1) # }}} # diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index c95a524..11313aa 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -45,46 +45,6 @@ class MiRCARTCanvasInterface(): dialogChoice = dialog.ShowModal() return dialogChoice # }}} - # {{{ _updateCanvasSize(self, newCanvasSize): XXX - def _updateCanvasSize(self, newCanvasSize): - eventDc = self.parentCanvas.canvasBackend.getDeviceContext(self.parentCanvas) - self.parentCanvas.canvasBackend.drawCursorMaskWithJournal( \ - self.parentCanvas.canvasJournal, eventDc) - oldCanvasSize = self.parentCanvas.canvasSize - self.parentCanvas.resize(newCanvasSize) - self.parentCanvas.canvasBackend.resize( \ - newCanvasSize, \ - self.parentCanvas.canvasBackend.cellSize) - if (newCanvasSize[1] - oldCanvasSize[1]) < 0: - for numRowOff in range(1, (oldCanvasSize[1] - newCanvasSize[1]) + 1): - numRow = oldCanvasSize[1] - numRowOff - del self.parentCanvas.canvasMap[numRow] - else: - for numRowOff in range(oldCanvasSize[1] - newCanvasSize[1]): - numRow = oldCanvasSize[1] + numRowOff - self.parentCanvas.canvasMap.append(None) - self.parentCanvas.canvasMap[numRow] = \ - [[[1, 1], 0, " "]] * oldCanvasSize[0] - self.parentCanvas.canvasBackend.drawPatch( \ - eventDc, \ - [[numCol, numRow], *[[1, 1], 0, " "]]) - if (newCanvasSize[0] - oldCanvasSize[0]) < 0: - for numRow in range(newCanvasSize[1]): - for numColOff in range(1, (oldCanvasSize[0] - newCanvasSize[0]) + 1): - numCol = oldCanvasSize[0] - numColOff - del self.parentCanvas.canvasMap[numRow][numCol] - else: - for numRow in range(newCanvasSize[1]): - for numColOff in range(newCanvasSize[0] - oldCanvasSize[0]): - numCol = oldCanvasSize[0] + numColOff - self.parentCanvas.canvasMap[numRow].append(None) - self.parentCanvas.canvasMap[numRow][numCol] = \ - [[1, 1], 0, " "] - self.parentCanvas.canvasBackend.drawPatch( \ - eventDc, \ - [[numCol, numRow], *[[1, 1], 0, " "]]) - wx.SafeYield() - # }}} # {{{ canvasBrushSolid(self, event): XXX def canvasBrushSolid(self, event): @@ -126,8 +86,8 @@ class MiRCARTCanvasInterface(): # {{{ canvasDecrCanvasHeight(self, event): XXX def canvasDecrCanvasHeight(self, event): if self.parentCanvas.canvasSize[1] > 1: - self._updateCanvasSize([ \ - self.parentCanvas.canvasSize[0], \ + self.parentCanvas.resize([ \ + self.parentCanvas.canvasSize[0], \ self.parentCanvas.canvasSize[1]-1]) # }}} # {{{ canvasDecrCanvasHeightWidth(self, event): XXX @@ -138,8 +98,8 @@ class MiRCARTCanvasInterface(): # {{{ canvasDecrCanvasWidth(self, event): XXX def canvasDecrCanvasWidth(self, event): if self.parentCanvas.canvasSize[0] > 1: - self._updateCanvasSize([ \ - self.parentCanvas.canvasSize[0]-1, \ + self.parentCanvas.resize([ \ + self.parentCanvas.canvasSize[0]-1, \ self.parentCanvas.canvasSize[1]]) # }}} # {{{ canvasDelete(self, event): XXX @@ -228,7 +188,7 @@ class MiRCARTCanvasInterface(): # }}} # {{{ canvasIncrCanvasHeight(self, event): XXX def canvasIncrCanvasHeight(self, event): - self._updateCanvasSize([ \ + self.parentCanvas.resize([ \ self.parentCanvas.canvasSize[0], \ self.parentCanvas.canvasSize[1]+1]) # }}} @@ -239,7 +199,7 @@ class MiRCARTCanvasInterface(): # }}} # {{{ canvasIncrCanvasWidth(self, event): XXX def canvasIncrCanvasWidth(self, event): - self._updateCanvasSize([ \ + self.parentCanvas.resize([ \ self.parentCanvas.canvasSize[0]+1, \ self.parentCanvas.canvasSize[1]]) # }}} From 0e8de3b4ddabdda6c21eddd9f7734945fc8b59d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 25 Jan 2018 15:04:37 +0100 Subject: [PATCH 135/148] MiRCARTCanvasInterface.py:canvasSave(): fix call parameters. --- MiRCARTCanvasInterface.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index 11313aa..e099537 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -115,7 +115,7 @@ class MiRCARTCanvasInterface(): elif saveChanges == wx.ID_NO: pass elif saveChanges == wx.ID_YES: - self.canvasSave() + self.canvasSave(event) self.parentFrame.Close(True) # }}} # {{{ canvasExportAsPng(self, event): XXX @@ -212,7 +212,7 @@ class MiRCARTCanvasInterface(): elif saveChanges == wx.ID_NO: pass elif saveChanges == wx.ID_YES: - self.canvasSave() + self.canvasSave(event) self.parentCanvas.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) if newCanvasSize == None: newCanvasSize = list(self.parentCanvas.defaultCanvasSize) @@ -230,7 +230,7 @@ class MiRCARTCanvasInterface(): elif saveChanges == wx.ID_NO: pass elif saveChanges == wx.ID_YES: - self.canvasSave() + self.canvasSave(event) with wx.FileDialog(self.parentCanvas, "Open", os.getcwd(), "", \ "*.txt", wx.FD_OPEN) as dialog: if dialog.ShowModal() == wx.ID_CANCEL: From 85cbffbadb843c6c46e42a754753d7181c89615a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 26 Jan 2018 17:45:04 +0100 Subject: [PATCH 136/148] Fixes memory leaks on {re,un}do state mutation & resize-related operations. MiRCARTCanvas.py:__del__(): delete canvasMap w/ clear(). MiRCARTCanvasBackend.py:resize(): delete old canvasBitmap w/ Destroy(). MiRCARTCanvasJournal.py:reset{Cursor,Undo}(): delete patches{Cursor,Undo} w/ clear(). MiRCARTCanvasJournal.py:__del__(): provided explicitly to call reset{Cursor,Undo}(). MiRCARTFrame.py:__del__(): provided explicitly to delete panelCanvas. --- MiRCARTCanvas.py | 8 +++++++- MiRCARTCanvasBackend.py | 5 +++-- MiRCARTCanvasJournal.py | 9 +++++++++ MiRCARTFrame.py | 6 ++++++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index c62e853..b75af72 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -181,8 +181,14 @@ class MiRCARTCanvas(wx.Panel): self.parentFrame.onCanvasUpdate(size=newCanvasSize, undoLevel=-1) # }}} + # {{{ __del__(self): destructor method + def __del__(self): + if self.canvasMap != None: + self.canvasMap.clear(); self.canvasMap = None; + # }}} + # - # _init__(self, parent, parentFrame, defaultCanvasPos, defaultCanvasSize, defaultCellSize): initialisation method + # __init__(self, parent, parentFrame, defaultCanvasPos, defaultCanvasSize, defaultCellSize): initialisation method def __init__(self, parent, parentFrame, defaultCanvasPos, defaultCanvasSize, defaultCellSize): super().__init__(parent, pos=defaultCanvasPos, \ size=[w*h for w,h in zip(defaultCanvasSize, defaultCellSize)]) diff --git a/MiRCARTCanvasBackend.py b/MiRCARTCanvasBackend.py index 154b0ca..f7b20e2 100644 --- a/MiRCARTCanvasBackend.py +++ b/MiRCARTCanvasBackend.py @@ -141,7 +141,8 @@ class MiRCARTCanvasBackend(): newBitmap = wx.Bitmap(winSize) newDc.SelectObject(newBitmap) newDc.Blit(0, 0, *self.canvasBitmap.GetSize(), oldDc, 0, 0) - self.canvasBitmap = newBitmap + oldDc.SelectObject(wx.NullBitmap) + self.canvasBitmap.Destroy(); self.canvasBitmap = newBitmap; self.canvasSize = canvasSize; self.cellSize = cellSize; self._font = wx.Font( \ 8, \ @@ -166,7 +167,7 @@ class MiRCARTCanvasBackend(): # }}} # - # _init__(self, canvasSize, cellSize): initialisation method + # __init__(self, canvasSize, cellSize): initialisation method def __init__(self, canvasSize, cellSize): self._initBrushesAndPens() self.reset(canvasSize, cellSize) diff --git a/MiRCARTCanvasJournal.py b/MiRCARTCanvasJournal.py index d487a60..6bbaa81 100644 --- a/MiRCARTCanvasJournal.py +++ b/MiRCARTCanvasJournal.py @@ -68,10 +68,14 @@ class MiRCARTCanvasJournal(): # }}} # {{{ resetCursor(self): XXX def resetCursor(self): + if self.patchesCursor != None: + self.patchesCursor.clear() self.patchesCursor = [] # }}} # {{{ resetUndo(self): XXX def resetUndo(self): + if self.patchesUndo != None: + self.patchesUndo.clear() self.patchesUndo = [None]; self.patchesUndoLevel = 0; # }}} # {{{ updateCurrentDeltas(self, undoPatches, redoPatches): XXX @@ -80,6 +84,11 @@ class MiRCARTCanvasJournal(): self.patchesUndo[0][1].append(redoPatches) # }}} + # {{{ __del__(self): destructor method + def __del__(self): + self.resetCursor(); self.resetUndo(); + # }}} + # # __init__(self): initialisation method def __init__(self): diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 3a3d3bf..4c929dc 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -227,6 +227,12 @@ class MiRCARTFrame(MiRCARTGeneralFrame): toolBar.EnableTool(self.CID_REDO[0], False) # }}} + # {{{ __del__(self): destructor method + def __del__(self): + if self.panelCanvas != None: + del self.panelCanvas; self.panelCanvas = None; + # }}} + # # __init__(self, parent, appSize=(840, 630), defaultCanvasPos=(0, 75), defaultCanvasSize=(100, 30), defaultCellSize=(7, 14)): initialisation method def __init__(self, parent, appSize=(840, 630), defaultCanvasPos=(0, 75), defaultCanvasSize=(100, 30), defaultCellSize=(7, 14)): From 7475f7108d3bd067bc15ca8a385ec737f1b67f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 26 Jan 2018 22:38:28 +0100 Subject: [PATCH 137/148] IrcMiRCARTBot.py:_uploadToImgur(): prevent file object leak via `with' barrier. MiRCARTCanvasExportStore.py:_exportFileToImgur(): prevent file object leak via `with' barrier. --- IrcMiRCARTBot.py | 3 ++- MiRCARTCanvasExportStore.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index b028c43..304cd97 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -180,7 +180,8 @@ class IrcMiRCARTBot(IrcClient.IrcClient): # }}} # {{{ _uploadToImgur(self, imgFilePath, imgName, imgTitle, apiKey): Upload single file to Imgur def _uploadToImgur(self, imgFilePath, imgName, imgTitle, apiKey): - requestImageData = open(imgFilePath, "rb").read() + with open(imgFilePath, "rb") as requestImage: + requestImageData = requestImage.read() requestData = { \ "image": base64.b64encode(requestImageData), \ "key": apiKey, \ diff --git a/MiRCARTCanvasExportStore.py b/MiRCARTCanvasExportStore.py index e7c520d..f8e7035 100644 --- a/MiRCARTCanvasExportStore.py +++ b/MiRCARTCanvasExportStore.py @@ -42,7 +42,8 @@ class MiRCARTCanvasExportStore(): # {{{ _exportFileToImgur(self, apiKey, imgName, imgTitle, pathName): upload single PNG file to Imgur def _exportFileToImgur(self, apiKey, imgName, imgTitle, pathName): - requestImageData = open(pathName, "rb").read() + with open(pathName, "rb") as requestImage: + requestImageData = requestImage.read() requestData = { \ "image": base64.b64encode(requestImageData), \ "key": apiKey, \ From b4a71505ffa68757931f633baf511f7863682e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 30 Jan 2018 11:17:35 +0100 Subject: [PATCH 138/148] Reduce memory usage by folding nested patch {coordinate,colour} list(s). --- MiRCARTCanvas.py | 20 +++++++++---------- MiRCARTCanvasBackend.py | 38 ++++++++++++++++++------------------- MiRCARTCanvasImportStore.py | 6 +++--- MiRCARTToolCircle.py | 6 +++--- MiRCARTToolFill.py | 8 ++++---- MiRCARTToolLine.py | 8 ++++---- MiRCARTToolRect.py | 2 +- MiRCARTToolSelect.py | 10 +++++----- MiRCARTToolSelectClone.py | 2 +- MiRCARTToolSelectMove.py | 6 +++--- MiRCARTToolText.py | 4 ++-- 11 files changed, 55 insertions(+), 55 deletions(-) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index b75af72..a66cc43 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -41,7 +41,7 @@ class MiRCARTCanvas(wx.Panel): # {{{ _commitPatch(self, patch): XXX def _commitPatch(self, patch): - self.canvasMap[patch[0][1]][patch[0][0]] = patch[1:] + self.canvasMap[patch[1]][patch[0]] = patch[2:] # }}} # {{{ _dispatchDeltaPatches(self, deltaPatches): XXX def _dispatchDeltaPatches(self, deltaPatches): @@ -58,8 +58,8 @@ class MiRCARTCanvas(wx.Panel): self.canvasJournal, eventDc) self._canvasDirtyCursor = True if self.canvasBackend.drawPatch(eventDc, patch): - patchDeltaCell = self.canvasMap[patch[0][1]][patch[0][0]] - patchDelta = [list(patch[0]), *patchDeltaCell.copy()] + patchDeltaCell = self.canvasMap[patch[1]][patch[0]] + patchDelta = [*patch[0:2], *patchDeltaCell] if isCursor: self.canvasJournal.pushCursor(patchDelta) else: @@ -127,10 +127,10 @@ class MiRCARTCanvas(wx.Panel): and numRow < len(newCanvas) \ and numCol < len(newCanvas[numRow]): self._commitPatch([ \ - [numCol, numRow], *newCanvas[numRow][numCol]]) + numCol, numRow, *newCanvas[numRow][numCol]]) self.canvasBackend.drawPatch(eventDc, \ - ([numCol, numRow], \ - *self.canvasMap[numRow][numCol])) + [numCol, numRow, \ + *self.canvasMap[numRow][numCol]]) wx.SafeYield() # }}} # {{{ resize(self, newCanvasSize): XXX @@ -160,20 +160,20 @@ class MiRCARTCanvas(wx.Panel): else: for numRow in range(oldCanvasSize[1]): self.canvasMap[numRow].extend( \ - [[[1, 1], 0, " "]] * deltaCanvasSize[0]) + [[1, 1, 0, " "]] * deltaCanvasSize[0]) for numNewCol in range(oldCanvasSize[0], newCanvasSize[0]): self.canvasBackend.drawPatch( \ - eventDc, [[numNewCol, numRow], \ + eventDc, [numNewCol, numRow, \ *self.canvasMap[numRow][-1]]) if deltaCanvasSize[1] < 0: del self.canvasMap[-1:(deltaCanvasSize[1]-1):-1] else: for numNewRow in range(oldCanvasSize[1], newCanvasSize[1]): self.canvasMap.extend( \ - [[[[1, 1], 0, " "]] * newCanvasSize[0]]) + [[[1, 1, 0, " "]] * newCanvasSize[0]]) for numNewCol in range(newCanvasSize[0]): self.canvasBackend.drawPatch( \ - eventDc, [[numNewCol, numNewRow], \ + eventDc, [numNewCol, numNewRow, \ *self.canvasMap[-1][-1]]) self.canvasSize = newCanvasSize diff --git a/MiRCARTCanvasBackend.py b/MiRCARTCanvasBackend.py index f7b20e2..9cf918f 100644 --- a/MiRCARTCanvasBackend.py +++ b/MiRCARTCanvasBackend.py @@ -33,27 +33,27 @@ class MiRCARTCanvasBackend(): # {{{ _drawBrushPatch(self, eventDc, patch): XXX def _drawBrushPatch(self, eventDc, patch): - absPoint = self._xlatePoint(patch[0]) - brushFg = self._brushes[patch[1][1]] - brushBg = self._brushes[patch[1][0]] - pen = self._pens[patch[1][1]] + absPoint = self._xlatePoint(patch) + brushFg = self._brushes[patch[3]] + brushBg = self._brushes[patch[2]] + pen = self._pens[patch[3]] self._setBrushDc(brushBg, brushFg, eventDc, pen) eventDc.DrawRectangle(*absPoint, *self.cellSize) # }}} # {{{ _drawCharPatch(self, eventDc, patch): XXX def _drawCharPatch(self, eventDc, patch): - absPoint = self._xlatePoint(patch[0]) - brushFg = self._brushes[patch[1][0]] - brushBg = self._brushes[patch[1][1]] - pen = self._pens[patch[1][1]] + absPoint = self._xlatePoint(patch) + brushFg = self._brushes[patch[2]] + brushBg = self._brushes[patch[3]] + pen = self._pens[patch[3]] fontBitmap = wx.Bitmap(*self.cellSize) fontDc = wx.MemoryDC(); fontDc.SelectObject(fontBitmap); - fontDc.SetTextForeground(wx.Colour(MiRCARTColours[patch[1][0]][0:4])) - fontDc.SetTextBackground(wx.Colour(MiRCARTColours[patch[1][1]][0:4])) + fontDc.SetTextForeground(wx.Colour(MiRCARTColours[patch[2]][0:4])) + fontDc.SetTextBackground(wx.Colour(MiRCARTColours[patch[3]][0:4])) fontDc.SetBrush(brushBg); fontDc.SetBackground(brushBg); fontDc.SetPen(pen); fontDc.SetFont(self._font) fontDc.DrawRectangle(0, 0, *self.cellSize) - fontDc.DrawText(patch[3], 0, 0) + fontDc.DrawText(patch[5], 0, 0) eventDc.Blit(*absPoint, *self.cellSize, fontDc, 0, 0) # }}} # {{{ _finiBrushesAndPens(self): XXX @@ -89,18 +89,18 @@ class MiRCARTCanvasBackend(): dc.SetPen(pen) self._lastPen = pen # }}} - # {{{ _xlatePoint(self, relMapPoint): XXX - def _xlatePoint(self, relMapPoint): - return [a*b for a,b in zip(relMapPoint, self.cellSize)] + # {{{ _xlatePoint(self, patch): XXX + def _xlatePoint(self, patch): + return [a*b for a,b in zip(patch[0:2], self.cellSize)] # }}} # {{{ drawPatch(self, eventDc, patch): XXX def drawPatch(self, eventDc, patch): - if patch[0][0] < self.canvasSize[0] \ - and patch[0][0] >= 0 \ - and patch[0][1] < self.canvasSize[1] \ - and patch[0][1] >= 0: - if patch[3] == " ": + if patch[0] < self.canvasSize[0] \ + and patch[0] >= 0 \ + and patch[1] < self.canvasSize[1] \ + and patch[1] >= 0: + if patch[5] == " ": self._drawBrushPatch(eventDc, patch) else: self._drawCharPatch(eventDc, patch) diff --git a/MiRCARTCanvasImportStore.py b/MiRCARTCanvasImportStore.py index e35b4a9..2714e0f 100644 --- a/MiRCARTCanvasImportStore.py +++ b/MiRCARTCanvasImportStore.py @@ -105,7 +105,7 @@ class MiRCARTCanvasImportStore(): inCellState, self._CellState.CS_UNDERLINE) else: inRowCols += 1 - outMap[inCurRow].append((inCurColours, inCellState, inChar)) + outMap[inCurRow].append([*inCurColours, inCellState, inChar]) elif inParseState == self._ParseState.PS_COLOUR_DIGIT0 \ or inParseState == self._ParseState.PS_COLOUR_DIGIT1: if inChar == "," \ @@ -146,8 +146,8 @@ class MiRCARTCanvasImportStore(): # }}} # {{{ importNew(self, newCanvasSize=None): XXX def importNew(self, newCanvasSize=None): - newMap = [[[[1, 1], 0, " "] \ - for x in range(newCanvasSize[0])] \ + newMap = [[[1, 1, 0, " "] \ + for x in range(newCanvasSize[0])] \ for y in range(newCanvasSize[1])] self.parentCanvas.onStoreUpdate(newCanvasSize, newMap) # }}} diff --git a/MiRCARTToolCircle.py b/MiRCARTToolCircle.py index 0fc5fb7..9249b69 100644 --- a/MiRCARTToolCircle.py +++ b/MiRCARTToolCircle.py @@ -45,9 +45,9 @@ class MiRCARTToolCircle(MiRCARTTool): for brushX in range(-radius, radius + 1): if ((brushX**2)+(brushY**2) < (((radius**2)+radius)*0.8)): patch = [ \ - [atPoint[0] + int(originPoint[0]+brushX), \ - atPoint[1] + int(originPoint[1]+brushY)], \ - brushColours, 0, " "] + atPoint[0] + int(originPoint[0]+brushX), \ + atPoint[1] + int(originPoint[1]+brushY), \ + *brushColours, 0, " "] if isLeftDown or isRightDown: dispatchFn(eventDc, False, patch); dispatchFn(eventDc, True, patch); else: diff --git a/MiRCARTToolFill.py b/MiRCARTToolFill.py index c1adc8c..00675e0 100644 --- a/MiRCARTToolFill.py +++ b/MiRCARTToolFill.py @@ -32,17 +32,17 @@ class MiRCARTToolFill(MiRCARTTool): # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): XXX def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): pointStack = [list(atPoint)]; pointsDone = []; - testColour = self.parentCanvas.canvasMap[atPoint[1]][atPoint[0]][0][1] + testColour = self.parentCanvas.canvasMap[atPoint[1]][atPoint[0]][0:2] if isLeftDown or isRightDown: if isRightDown: brushColours = [brushColours[1], brushColours[0]] while len(pointStack) > 0: point = pointStack.pop() pointCell = self.parentCanvas.canvasMap[point[1]][point[0]] - if pointCell[0][1] == testColour: + if pointCell[0:2] == testColour: if not point in pointsDone: - dispatchFn(eventDc, False, [point.copy(), \ - [brushColours[0], brushColours[0]], 0, " "]) + dispatchFn(eventDc, False, [*point, \ + brushColours[0], brushColours[0], 0, " "]) if point[0] > 0: pointStack.append([point[0] - 1, point[1]]) if point[0] < (self.parentCanvas.canvasSize[0] - 1): diff --git a/MiRCARTToolLine.py b/MiRCARTToolLine.py index fe14df7..d70143e 100644 --- a/MiRCARTToolLine.py +++ b/MiRCARTToolLine.py @@ -55,10 +55,10 @@ class MiRCARTToolLine(MiRCARTTool): lineD = 2 * pointDelta[1] - pointDelta[0]; lineY = 0; for lineX in range(pointDelta[0] + 1): for brushStep in range(brushSize[0]): - patch = [[ \ + patch = [ \ originPoint[0] + lineX*lineXX + lineY*lineYX + brushStep, \ - originPoint[1] + lineX*lineXY + lineY*lineYY], \ - brushColours, 0, " "] + originPoint[1] + lineX*lineXY + lineY*lineYY, \ + *brushColours, 0, " "] if isCursor: dispatchFn(eventDc, False, patch); dispatchFn(eventDc, True, patch); else: @@ -83,7 +83,7 @@ class MiRCARTToolLine(MiRCARTTool): self.toolColours = brushColours self.toolOriginPoint = list(atPoint) self.toolState = self.TS_ORIGIN - dispatchFn(eventDc, True, [atPoint, brushColours, 0, " "]) + dispatchFn(eventDc, True, [*atPoint, *brushColours, 0, " "]) elif self.toolState == self.TS_ORIGIN: targetPoint = list(atPoint) originPoint = self.toolOriginPoint diff --git a/MiRCARTToolRect.py b/MiRCARTToolRect.py index d4250ba..66c0094 100644 --- a/MiRCARTToolRect.py +++ b/MiRCARTToolRect.py @@ -43,7 +43,7 @@ class MiRCARTToolRect(MiRCARTTool): brushSize[0] *= 2 for brushRow in range(brushSize[1]): for brushCol in range(brushSize[0]): - patch = [[atPoint[0] + brushCol, atPoint[1] + brushRow],brushColours, 0, " "] + patch = [atPoint[0] + brushCol, atPoint[1] + brushRow, *brushColours, 0, " "] if isLeftDown or isRightDown: dispatchFn(eventDc, False, patch); dispatchFn(eventDc, True, patch); else: diff --git a/MiRCARTToolSelect.py b/MiRCARTToolSelect.py index 68f5539..3084776 100644 --- a/MiRCARTToolSelect.py +++ b/MiRCARTToolSelect.py @@ -53,18 +53,18 @@ class MiRCARTToolSelect(MiRCARTTool): else: curColours = [0, 0] dispatchFn(eventDc, True, \ - [[rectX, rectFrame[0][1]], curColours, 0, " "]) + [rectX, rectFrame[0][1], *curColours, 0, " "]) dispatchFn(eventDc, True, \ - [[rectX, rectFrame[1][1]], curColours, 0, " "]) + [rectX, rectFrame[1][1], *curColours, 0, " "]) for rectY in range(rectFrame[0][1], rectFrame[1][1]+1): if curColours == [0, 0]: curColours = [1, 1] else: curColours = [0, 0] dispatchFn(eventDc, True, \ - [[rectFrame[0][0], rectY], curColours, 0, " "]) + [rectFrame[0][0], rectY, *curColours, 0, " "]) dispatchFn(eventDc, True, \ - [[rectFrame[1][0], rectY], curColours, 0, " "]) + [rectFrame[1][0], rectY, *curColours, 0, " "]) # }}} # @@ -82,7 +82,7 @@ class MiRCARTToolSelect(MiRCARTTool): self.toolState = self.TS_ORIGIN else: dispatchFn(eventDc, True, \ - [list(atPoint), brushColours.copy(), 0, " "]) + [*atPoint, *brushColours, 0, " "]) elif self.toolState == self.TS_ORIGIN: self.toolRect[1] = list(atPoint) if isLeftDown or isRightDown: diff --git a/MiRCARTToolSelectClone.py b/MiRCARTToolSelectClone.py index 14c6024..3d2a5d5 100644 --- a/MiRCARTToolSelectClone.py +++ b/MiRCARTToolSelectClone.py @@ -53,7 +53,7 @@ class MiRCARTToolSelectClone(MiRCARTToolSelect): cellOld = self.toolSelectMap[numRow][numCol] rectY = selectRect[0][1] + numRow rectX = selectRect[0][0] + numCol - dispatchFn(eventDc, isCursor, [[rectX+disp[0], rectY+disp[1]], *cellOld]) + dispatchFn(eventDc, isCursor, [rectX+disp[0], rectY+disp[1], *cellOld]) self._drawSelectRect(newToolRect, dispatchFn, eventDc) self.toolRect = newToolRect diff --git a/MiRCARTToolSelectMove.py b/MiRCARTToolSelectMove.py index 7412062..134826c 100644 --- a/MiRCARTToolSelectMove.py +++ b/MiRCARTToolSelectMove.py @@ -50,14 +50,14 @@ class MiRCARTToolSelectMove(MiRCARTToolSelect): isCursor = True for numRow in range(len(self.toolSelectMap)): for numCol in range(len(self.toolSelectMap[numRow])): - dispatchFn(eventDc, isCursor, [[self.srcRect[0] + numCol, \ - self.srcRect[1] + numRow], [1, 1], 0, " "]) + dispatchFn(eventDc, isCursor, [self.srcRect[0] + numCol, \ + self.srcRect[1] + numRow, 1, 1, 0, " "]) for numRow in range(len(self.toolSelectMap)): for numCol in range(len(self.toolSelectMap[numRow])): cellOld = self.toolSelectMap[numRow][numCol] rectY = selectRect[0][1] + numRow rectX = selectRect[0][0] + numCol - dispatchFn(eventDc, isCursor, [[rectX+disp[0], rectY+disp[1]], *cellOld]) + dispatchFn(eventDc, isCursor, [rectX+disp[0], rectY+disp[1], *cellOld]) self._drawSelectRect(newToolRect, dispatchFn, eventDc) self.toolRect = newToolRect diff --git a/MiRCARTToolText.py b/MiRCARTToolText.py index a3eb686..8026eba 100644 --- a/MiRCARTToolText.py +++ b/MiRCARTToolText.py @@ -42,7 +42,7 @@ class MiRCARTToolText(MiRCARTTool): self.textColours = brushColours.copy() if self.textPos == None: self.textPos = list(atPoint) - dispatchFn(eventDc, False, [self.textPos, self.textColours, 0, keyChar]) + dispatchFn(eventDc, False, [*self.textPos, *self.textColours, 0, keyChar]) if self.textPos[0] < (self.parentCanvas.canvasSize[0] - 1): self.textPos[0] += 1 elif self.textPos[1] < (self.parentCanvas.canvasSize[1] - 1): @@ -65,6 +65,6 @@ class MiRCARTToolText(MiRCARTTool): if self.textColours == None: self.textColours = brushColours.copy() self.textPos = list(atPoint) - dispatchFn(eventDc, True, [self.textPos, self.textColours, 0, "_"]) + dispatchFn(eventDc, True, [*self.textPos, *self.textColours, 0, "_"]) # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 From 5f0328d1d28bdf8044485939d1339a0c80c25724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 30 Jan 2018 20:34:02 +0100 Subject: [PATCH 139/148] {IrcMiRCARTBot,MiRCARTToPngFile}.py: reduce memory usage by folding nested patch {coordinate,colour} list(s). Followup to . --- IrcMiRCARTBot.py | 10 +++++----- MiRCARTToPngFile.py | 34 +++++++++++++++++----------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index 304cd97..f4499ff 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -148,11 +148,11 @@ class IrcMiRCARTBot(IrcClient.IrcClient): for numRow in range(len(canvasStore.outMap)): if len(canvasStore.outMap[numRow]) != numRowCols: for numColOff in range(numRowCols - len(canvasStore.outMap[numRow])): - canvasStore.outMap[numRow].append([[1, 1], 0, " "]) - canvasStore.outMap[numRow].insert(0, [[1, 1], 0, " "]) - canvasStore.outMap[numRow].append([[1, 1], 0, " "]) - canvasStore.outMap.insert(0, [[[1, 1], 0, " "]] * len(canvasStore.outMap[0])) - canvasStore.outMap.append([[[1, 1], 0, " "]] * len(canvasStore.outMap[0])) + canvasStore.outMap[numRow].append([1, 1, 0, " "]) + canvasStore.outMap[numRow].insert(0, [1, 1, 0, " "]) + canvasStore.outMap[numRow].append([1, 1, 0, " "]) + canvasStore.outMap.insert(0, [[1, 1, 0, " "]] * len(canvasStore.outMap[0])) + canvasStore.outMap.append([[1, 1, 0, " "]] * len(canvasStore.outMap[0])) MiRCARTToPngFile(canvasStore.outMap, "DejaVuSansMono.ttf", 11).export(imgTmpFilePath) imgurResponse = self._uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") if imgurResponse[0] == 200: diff --git a/MiRCARTToPngFile.py b/MiRCARTToPngFile.py index 16661b8..922fb4f 100755 --- a/MiRCARTToPngFile.py +++ b/MiRCARTToPngFile.py @@ -89,35 +89,35 @@ class MiRCARTToPngFile: for inCurCol in range(len(self.inCanvasMap[inCurRow])): inCurCell = self.inCanvasMap[inCurRow][inCurCol] outColours = [0, 0] - if inCurCell[1] & MiRCARTCanvasImportStore.MiRCARTCanvasImportStore._CellState.CS_BOLD: - if inCurCell[2] != " ": - if inCurCell[2] == "█": - outColours[1] = self._ColourMapNormal[inCurCell[0][0]] + if inCurCell[2] & MiRCARTCanvasImportStore.MiRCARTCanvasImportStore._CellState.CS_BOLD: + if inCurCell[3] != " ": + if inCurCell[3] == "█": + outColours[1] = self._ColourMapNormal[inCurCell[0]] else: - outColours[0] = self._ColourMapBold[inCurCell[0][0]] - outColours[1] = self._ColourMapNormal[inCurCell[0][1]] + outColours[0] = self._ColourMapBold[inCurCell[0]] + outColours[1] = self._ColourMapNormal[inCurCell[1]] else: - outColours[1] = self._ColourMapNormal[inCurCell[0][1]] + outColours[1] = self._ColourMapNormal[inCurCell[1]] else: - if inCurCell[2] != " ": - if inCurCell[2] == "█": - outColours[1] = self._ColourMapNormal[inCurCell[0][0]] + if inCurCell[3] != " ": + if inCurCell[3] == "█": + outColours[1] = self._ColourMapNormal[inCurCell[0]] else: - outColours[0] = self._ColourMapNormal[inCurCell[0][0]] - outColours[1] = self._ColourMapNormal[inCurCell[0][1]] + outColours[0] = self._ColourMapNormal[inCurCell[0]] + outColours[1] = self._ColourMapNormal[inCurCell[1]] else: - outColours[1] = self._ColourMapNormal[inCurCell[0][1]] + outColours[1] = self._ColourMapNormal[inCurCell[1]] outImgDraw.rectangle((*outCurPos, \ outCurPos[0] + self.outImgFontSize[0], \ outCurPos[1] + self.outImgFontSize[1]), \ fill=(*outColours[1], 255)) - if not inCurCell[2] in " █" \ + if not inCurCell[3] in " █" \ and outColours[0] != outColours[1]: # XXX implement italic outImgDraw.text(outCurPos, \ - inCurCell[2], (*outColours[0], 255), self.outImgFont) - if inCurCell[1] & MiRCARTCanvasImportStore.MiRCARTCanvasImportStore._CellState.CS_UNDERLINE: - outColours[0] = self._ColourMapNormal[inCurCell[0][0]] + inCurCell[3], (*outColours[0], 255), self.outImgFont) + if inCurCell[2] & MiRCARTCanvasImportStore.MiRCARTCanvasImportStore._CellState.CS_UNDERLINE: + outColours[0] = self._ColourMapNormal[inCurCell[0]] self._drawUnderLine(outCurPos, \ self.outImgFontSize, \ outImgDraw, (*outColours[0], 255)) From cbc12828e5a641cf2babbfd6c2cdf5900a089255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 1 May 2018 23:30:36 +0200 Subject: [PATCH 140/148] MiRCARTCanonicalise.py: canonicalise mIRC art {from,to} file (for munki.) --- MiRCARTCanonicalise.py | 60 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 MiRCARTCanonicalise.py diff --git a/MiRCARTCanonicalise.py b/MiRCARTCanonicalise.py new file mode 100755 index 0000000..0e8a647 --- /dev/null +++ b/MiRCARTCanonicalise.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 +# +# MiRCARTCanonicalise.py -- canonicalise mIRC art {from,to} file (for munki) +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +from MiRCARTCanvasImportStore import MiRCARTCanvasImportStore +import sys + +def canonicalise(inPathName): + canvasStore = MiRCARTCanvasImportStore(inPathName) + inMap = canvasStore.outMap.copy(); del canvasStore; + with open(inPathName, "w+") as outFile: + lastAttribs = MiRCARTCanvasImportStore._CellState.CS_NONE + lastColours = None + for inCurRow in range(len(inMap)): + for inCurCol in range(len(inMap[inCurRow])): + inCurCell = inMap[inCurRow][inCurCol] + if lastAttribs != inCurCell[2]: + if inCurCell[2] & MiRCARTCanvasImportStore._CellState.CS_BOLD: + print("\u0002", end="", file=outFile) + if inCurCell[2] & MiRCARTCanvasImportStore._CellState.CS_UNDERLINE: + print("\u001f", end="", file=outFile) + lastAttribs = inCurCell[2] + if lastColours == None or lastColours != inCurCell[:2]: + print("\u0003{:02d},{:02d}{}".format(*inCurCell[:2], inCurCell[3]), end="", file=outFile) + lastColours = inCurCell[:2] + else: + print(inCurCell[3], end="", file=outFile) + print("\n", end="", file=outFile) + +# +# Entry point +def main(*argv): + canonicalise(argv[1]) +if __name__ == "__main__": + if (len(sys.argv) - 1) != 1: + print("usage: {} ".format(sys.argv[0]), file=sys.stderr) + else: + main(*sys.argv) + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 From e5ef8503c68ad1bddf95f7129a7168d0e567d577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 2 May 2018 17:08:45 +0200 Subject: [PATCH 141/148] MiRCARTCheckLineLengths.sh: check mIRC art line lengths. --- MiRCARTCheckLineLengths.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 MiRCARTCheckLineLengths.sh diff --git a/MiRCARTCheckLineLengths.sh b/MiRCARTCheckLineLengths.sh new file mode 100755 index 0000000..17702cf --- /dev/null +++ b/MiRCARTCheckLineLengths.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# +# MiRCARTCheckLineLengths.py -- check mIRC art line lengths +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +for FNAME in "${@}"; do + FNAME_LINES="$(wc -l "${FNAME}" | awk '{print $1}')"; + for FNAME_LINE in $(seq "${FNAME_LINES}"); do + printf "%-5d %-5d %s\n" \ + "$(sed -n "${FNAME_LINE}p" "${FNAME}" | wc -c)" \ + "${FNAME_LINE}" "${FNAME}"; + done; +done | sort -nk1; + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 From 19b29d17144409bbbba38b327467e00204ab276c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 24 May 2018 08:52:20 +0200 Subject: [PATCH 142/148] IrcMiRCARTBot.py, MiRCARTCanvasInterface.py: remove Imgur API key from repository (via aaa, alghazi, amomp, anji, arab, astra, astra`, biobag, biobag__, bj0rn, blomp, boomp, bromp, brr, butts, buttvomit, c003y, Caku, chomp, chrono_, cooey, CosbyX, darkmage_, dboard, dehuman, dOm3r, eddb, efukt, ep^, er, era, eraser, erratic, erratic_, gnomp, gromp, interdom3, JEWS, kobach, l1tup, Lions, lul, lulz, lulzee, lulzy, Matthew, MercyX, moomp, mr_vile, muff, munki, n0v, nk9k, ooomp, OVH, pcap, pinchy, plop, pngbot, poccri, poomp, promp, pump-, pumpbull, pyrex, rain, rObOtNiK, rondito, scd, SEEEEN, Shapes, snadge, spidy, spinsane, spoke, spomp, stomp, TACO, tetedupet, toohighto, tromp, twomp, vap0r, vapor, venus, virtuald, vixen, whomp, wreathman, wromp, yoomp, z0z0, zen_, and zoomp.) --- .gitignore | 1 + IrcMiRCARTBot.py | 4 +++- MiRCARTCanvas.py | 2 ++ MiRCARTCanvasInterface.py | 5 +++-- MiRCARTImgurApiKey.py.template | 28 ++++++++++++++++++++++++++++ 5 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 MiRCARTImgurApiKey.py.template diff --git a/.gitignore b/.gitignore index 7a00c01..04ad9ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +MiRCARTImgurApiKey.py __pycache__/ *.sw[op] diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index f4499ff..170d3ee 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -28,12 +28,14 @@ import json import IrcClient import requests, urllib.request from MiRCARTCanvasImportStore import MiRCARTCanvasImportStore +from MiRCARTImgurApiKey import MiRCARTImgurApiKey from MiRCARTToPngFile import MiRCARTToPngFile class IrcMiRCARTBot(IrcClient.IrcClient): """IRC<->MiRC2png bot""" clientChannelLastMessage = clientChannelOps = clientChannel = None clientChannelRejoin = None + imgurApiKey = MiRCARTImgurApiKey.imgurApiKey # {{{ ContentTooLargeException(Exception): Raised by _urlretrieveReportHook() given download size > 1 MB class ContentTooLargeException(Exception): @@ -154,7 +156,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): canvasStore.outMap.insert(0, [[1, 1, 0, " "]] * len(canvasStore.outMap[0])) canvasStore.outMap.append([[1, 1, 0, " "]] * len(canvasStore.outMap[0])) MiRCARTToPngFile(canvasStore.outMap, "DejaVuSansMono.ttf", 11).export(imgTmpFilePath) - imgurResponse = self._uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", "c9a6efb3d7932fd") + imgurResponse = self._uploadToImgur(imgTmpFilePath, "MiRCART image", "MiRCART image", self.imgurApiKey) if imgurResponse[0] == 200: self._log("Uploaded as: {}".format(imgurResponse[1])) self.queue("PRIVMSG", message[2], "8/!\\ Uploaded as: {}".format(imgurResponse[1])) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index a66cc43..8c9c2c5 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -27,6 +27,7 @@ from MiRCARTCanvasJournal import MiRCARTCanvasJournal from MiRCARTCanvasExportStore import MiRCARTCanvasExportStore, haveMiRCARTToPngFile, haveUrllib from MiRCARTCanvasImportStore import MiRCARTCanvasImportStore from MiRCARTCanvasInterface import MiRCARTCanvasInterface +from MiRCARTImgurApiKey import MiRCARTImgurApiKey import wx class MiRCARTCanvas(wx.Panel): @@ -38,6 +39,7 @@ class MiRCARTCanvas(wx.Panel): canvasBackend = canvasJournal = None canvasExportStore = canvasImportStore = None canvasInterface = None + imgurApiKey = MiRCARTImgurApiKey.imgurApiKey # {{{ _commitPatch(self, patch): XXX def _commitPatch(self, patch): diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index e099537..33de616 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -34,6 +34,7 @@ import os, wx class MiRCARTCanvasInterface(): """XXX""" + imgurApiKey = None parentCanvas = parentFrame = canvasPathName = canvasTool = None # {{{ _dialogSaveChanges(self) @@ -136,8 +137,8 @@ class MiRCARTCanvasInterface(): # {{{ canvasExportImgur(self, event): XXX def canvasExportImgur(self, event): self.parentCanvas.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) - imgurResult = self.parentCanvas.canvasExportStore.exportBitmapToImgur( \ - "c9a6efb3d7932fd", self.parentCanvas.canvasBackend.canvasBitmap, \ + imgurResult = self.parentCanvas.canvasExportStore.exportBitmapToImgur( \ + self.imgurApiKey, self.parentCanvas.canvasBackend.canvasBitmap, \ "", "", wx.BITMAP_TYPE_PNG) self.parentCanvas.SetCursor(wx.Cursor(wx.NullCursor)) if imgurResult[0] == 200: diff --git a/MiRCARTImgurApiKey.py.template b/MiRCARTImgurApiKey.py.template new file mode 100644 index 0000000..6580ac7 --- /dev/null +++ b/MiRCARTImgurApiKey.py.template @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +# +# MiRCARTImgurApiKey.py -- melp? +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +class MiRCARTImgurApiKey(object): + imgurApiKey = None + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 From 7011dc91dd94e28a49990861fefd59428ecb41f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 24 May 2018 08:59:00 +0200 Subject: [PATCH 143/148] IrcMiRCARTBot.py:_dispatchPrivmsg(): lower rate limit to once every 5 seconds (via aaa, alghazi, amomp, anji, arab, astra, astra`, biobag, biobag__, bj0rn, blomp, boomp, bromp, brr, butts, buttvomit, c003y, Caku, chomp, chrono_, cooey, CosbyX, darkmage_, dboard, deh uman, dOm3r, eddb, efukt, ep^, er, era, eraser, erratic, erratic_, gnomp, gromp, interdom3, JEWS, kobach, l1tup, Lions, lul, lulz, lulzee, lulzy, Matthew, MercyX, moomp, mr_vile, muff, munki, n0v, nk9k, ooomp, OVH, pcap, pinchy, plop, pngbot, poccri, poomp, promp, pump-, pu mpbull, pyrex, rain, rObOtNiK, rondito, scd, SEEEEN, Shapes, snadge, spidy, spinsane, spoke, spomp, stomp, TACO, tetedupet, toohighto, tromp, twomp, vap0r, vapor, venus, virtuald, vixen, whomp, wreathman, wromp, yoomp, z0z0, zen_, and zoomp.) --- IrcMiRCARTBot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index 170d3ee..4244c89 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -110,7 +110,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): def _dispatchPrivmsg(self, message): if message[2].lower() == self.clientChannel.lower() \ and message[3].startswith("!pngbot "): - if (int(time.time()) - self.clientLastMessage) < 30: + if (int(time.time()) - self.clientLastMessage) < 5: self._log("Ignoring request on {} from {} due to rate limit: {}".format(message[2].lower(), message[0], message[3])) return elif message[0].split("!")[0].lower() not in self.clientChannelOps: From 5f99672c08c92a9900ee06969bb33bcf1723ee00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sun, 17 Jun 2018 09:45:00 +0200 Subject: [PATCH 144/148] MiRCARTCanonicalise.py: correctly reset last{Attribs,Colours} on each new row (fixes issue #1.) --- MiRCARTCanonicalise.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MiRCARTCanonicalise.py b/MiRCARTCanonicalise.py index 0e8a647..afda9b4 100755 --- a/MiRCARTCanonicalise.py +++ b/MiRCARTCanonicalise.py @@ -29,9 +29,9 @@ def canonicalise(inPathName): canvasStore = MiRCARTCanvasImportStore(inPathName) inMap = canvasStore.outMap.copy(); del canvasStore; with open(inPathName, "w+") as outFile: - lastAttribs = MiRCARTCanvasImportStore._CellState.CS_NONE - lastColours = None for inCurRow in range(len(inMap)): + lastAttribs = MiRCARTCanvasImportStore._CellState.CS_NONE + lastColours = None for inCurCol in range(len(inMap[inCurRow])): inCurCell = inMap[inCurRow][inCurCol] if lastAttribs != inCurCell[2]: From e7b63248662d375b7fda6f8ff3adcf196c84745d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 21 Jun 2018 09:04:22 +0200 Subject: [PATCH 145/148] IrcMiRCARTBot.py:_dispatchPrivmsg(): print message from website if upload fails. IrcMiRCARTBot.py:_uploadToImgur(): additionally return responseHttp.text on failure. --- IrcMiRCARTBot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index 4244c89..9bd7003 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -163,7 +163,9 @@ class IrcMiRCARTBot(IrcClient.IrcClient): self.clientLastMessage = int(time.time()) else: self._log("Upload failed with HTTP status code {}".format(imgurResponse[0])) + self._log("Message from website: {}".format(imgurResponse[1])) self.queue("PRIVMSG", message[2], "4/!\\ Upload failed with HTTP status code {}!".format(imgurResponse[0])) + self.queue("PRIVMSG", message[2], "4/!\\ Message from website: {}".format(imgurResponse[1])) if os.path.isfile(asciiTmpFilePath): os.remove(asciiTmpFilePath) if os.path.isfile(imgTmpFilePath): @@ -197,7 +199,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient): if responseHttp.status_code == 200: return [200, responseDict.get("data").get("link")] else: - return [responseHttp.status_code] + return [responseHttp.status_code, responseHttp.text] # }}} # {{{ _urlretrieveReportHook(count, blockSize, totalSize): Limit downloads to 1 MB def _urlretrieveReportHook(count, blockSize, totalSize): From 6593aa594ed3a5a919afba4acb414c15df313a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 22 Jun 2018 11:38:47 +0200 Subject: [PATCH 146/148] MiRCARTCanvasImportStore.py:importTextFile(): correctly open() pathName w/ encoding="utf-8" (via munki.) --- MiRCARTCanvasImportStore.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MiRCARTCanvasImportStore.py b/MiRCARTCanvasImportStore.py index 2714e0f..a070b27 100644 --- a/MiRCARTCanvasImportStore.py +++ b/MiRCARTCanvasImportStore.py @@ -70,7 +70,7 @@ class MiRCARTCanvasImportStore(): # }}} # {{{ importTextFile(self, pathName): XXX def importTextFile(self, pathName): - self.inFile = open(pathName, "r") + self.inFile = open(pathName, "r", encoding="utf-8") self.inSize = self.outMap = None; inCurColourSpec = ""; inCurRow = -1; inLine = self.inFile.readline() From 85d260835bd2dec61d649a54316db1d6a30ae72b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 26 Jun 2018 15:39:29 +0200 Subject: [PATCH 147/148] MiRCARTToPngFiles.sh: added. --- MiRCARTToPngFiles.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 MiRCARTToPngFiles.sh diff --git a/MiRCARTToPngFiles.sh b/MiRCARTToPngFiles.sh new file mode 100755 index 0000000..53e17b1 --- /dev/null +++ b/MiRCARTToPngFiles.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# +# MiRCARTToPngFiles.sh -- convert ASCII(s) w/ mIRC control codes to monospaced PNG(s) (for EFnet #MiRCART) +# Copyright (c) 2018 Lucio Andrés Illanes Albornoz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +for FNAME in "${@}"; do + ./MiRCARTToPngFile.py "${FNAME}" "${FNAME%.txt}.png"; +done; + +# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 From fd8c9a42679f954f67f98850dcf2f42e40c162ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 28 Jun 2018 18:18:48 +0200 Subject: [PATCH 148/148] IrcMiRCARTBot.py: adds optional -[46] force IPv[46] flag. --- IrcClient.py | 10 ++++++---- IrcMiRCARTBot.py | 30 +++++++++++++++++++----------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/IrcClient.py b/IrcClient.py index 4891027..ba1d2ec 100644 --- a/IrcClient.py +++ b/IrcClient.py @@ -38,12 +38,14 @@ class IrcClient: self.clientSocket.close() self.clientSocket = self.clientSocketFile = None; # }}} - # {{{ connect(self, timeout=None): Connect to server and register w/ optional timeout - def connect(self, timeout=None): - self.clientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + # {{{ connect(self, preferFamily=socket.AF_INET, timeout=None): Connect to server and register w/ optional timeout + def connect(self, preferFamily=socket.AF_INET, timeout=None): + gaiInfo = socket.getaddrinfo(self.serverHname, self.serverPort, + preferFamily, socket.SOCK_STREAM, socket.IPPROTO_TCP) + self.clientSocket = socket.socket(*gaiInfo[0][:3]) self.clientSocket.setblocking(0) try: - self.clientSocket.connect((self.serverHname, int(self.serverPort))) + self.clientSocket.connect(gaiInfo[0][4]) except BlockingIOError: pass if timeout: diff --git a/IrcMiRCARTBot.py b/IrcMiRCARTBot.py index 9bd7003..1c1f7e3 100755 --- a/IrcMiRCARTBot.py +++ b/IrcMiRCARTBot.py @@ -22,8 +22,9 @@ # SOFTWARE. # +from getopt import getopt, GetoptError import base64 -import os, sys, time +import os, socket, sys, time import json import IrcClient import requests, urllib.request @@ -206,10 +207,10 @@ class IrcMiRCARTBot(IrcClient.IrcClient): if (totalSize > pow(2,20)): raise IrcMiRCARTBot.ContentTooLargeException # }}} - # {{{ connect(self, timeout=None): Connect to server and (re)initialise w/ optional timeout - def connect(self, timeout=None): + # {{{ connect(self, preferFamily=0, timeout=None): Connect to server and (re)initialise w/ optional timeout + def connect(self, preferFamily=0, timeout=None): self._log("Connecting to {}:{}...".format(self.serverHname, self.serverPort)) - if super().connect(timeout): + if super().connect(preferFamily=preferFamily, timeout=timeout): self._log("Connected to {}:{}.".format(self.serverHname, self.serverPort)) self._log("Registering on {}:{} as {}, {}, {}...".format(self.serverHname, self.serverPort, self.clientNick, self.clientIdent, self.clientGecos)) self.clientLastMessage = 0; self.clientChannelOps = []; @@ -255,18 +256,25 @@ class IrcMiRCARTBot(IrcClient.IrcClient): # # Entry point -def main(*argv): - _IrcMiRCARTBot = IrcMiRCARTBot(*argv[1:]) +def main(optdict, *argv): + _IrcMiRCARTBot = IrcMiRCARTBot(*argv) while True: - if _IrcMiRCARTBot.connect(15): + if "-4" in optdict: + preferFamily = socket.AF_INET + elif "-6" in optdict: + preferFamily = socket.AF_INET6 + else: + preferFamily = 0 + if _IrcMiRCARTBot.connect(preferFamily=preferFamily, timeout=15): _IrcMiRCARTBot.dispatch() _IrcMiRCARTBot.close() time.sleep(15) if __name__ == "__main__": - if ((len(sys.argv) - 1) < 1)\ - or ((len(sys.argv) - 1) > 4): - print("usage: {} " \ + optlist, argv = getopt(sys.argv[1:], "46") + optdict = dict(optlist) + if len(argv) < 1 or len(argv) > 4: + print("usage: {} [-4|-6] " \ " " \ "[] " \ "[] " \ @@ -274,6 +282,6 @@ if __name__ == "__main__": "[] " \ "[] ".format(sys.argv[0]), file=sys.stderr) else: - main(*sys.argv) + main(optdict, *argv) # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120