2019-09-01 14:34:00 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
#
|
2019-09-03 16:58:50 +00:00
|
|
|
# roar.py -- mIRC art editor for Windows & Linux
|
2019-09-01 14:34:00 +00:00
|
|
|
# Copyright (c) 2018, 2019 Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de>
|
|
|
|
#
|
|
|
|
|
|
|
|
import os, sys
|
2019-09-03 13:48:52 +00:00
|
|
|
[sys.path.append(os.path.join(os.getcwd(), path)) for path in \
|
Implements merged object tool & flip operators.
assets/images/toolObject.png: added.
liboperators/Operator{,Flip{Horizontal,Vertical}}.py: initial implementation.
libroar/RoarCanvasCommands.py: adds RoarCanvasCommandsOperators.
libroar/RoarCanvasCommandsOperators.py: initial implementation.
libroar/Roar{CanvasCommands{,Tools},Client}.py: replaces ToolSelect{Clone,Move} w/ ToolObject.
libroar/RoarCanvasWindow.py:RoarCanvasWindowDropTarget.OnDropText(): update ToolObject() invocation.
libroar/RoarCanvasWindow.py:{applyTool,onMouseInput}(): pass keyModifiers to Tool.onMouseEvent().
libroar/RoarCanvasWindow.py:applyTool(): only switch back to lastTool if current object tool contains an external object.
libroar/RoarCanvasWindow.py:onLeaveWindow(): disable hiding cursor for now.
libtools/Tool{,Circle,Fill,Line,Rect,Text}.py:onMouseEvent(): update type signature.
libtools/Tool{Object,Select{,Clone,Move}}.py: merged into libtools/ToolObject.py.
roar.py: add liboperators to sys.path[].
assets/text/TODO: updated.
2019-09-15 09:06:25 +00:00
|
|
|
["libcanvas", "libgui", "libroar", "librtl", "liboperators", "libtools"]]
|
2019-09-01 14:34:00 +00:00
|
|
|
|
2019-09-10 08:14:12 +00:00
|
|
|
from RoarClient import RoarClient
|
2019-09-14 13:16:57 +00:00
|
|
|
from RtlPlatform import getLocalConfPathName
|
2019-09-01 14:34:00 +00:00
|
|
|
import wx
|
|
|
|
|
|
|
|
#
|
|
|
|
# Entry point
|
|
|
|
def main(*argv):
|
2019-09-14 13:16:57 +00:00
|
|
|
localConfDirName = getLocalConfPathName()
|
|
|
|
if not os.path.exists(localConfDirName):
|
2020-01-14 20:21:49 +00:00
|
|
|
os.makedirs(localConfDirName)
|
2019-09-10 08:14:12 +00:00
|
|
|
wxApp, roarClient = wx.App(False), RoarClient(None)
|
2019-09-14 09:21:40 +00:00
|
|
|
argv0, argv = argv[0], argv[1:]
|
2019-10-24 19:14:00 +00:00
|
|
|
roarClient.canvasPanel.commands._recentDirLoad(); roarClient.canvasPanel.commands._recentLoad();
|
2019-09-14 08:52:05 +00:00
|
|
|
if len(argv) >= 1:
|
2019-09-14 09:21:40 +00:00
|
|
|
if (len(argv) >= 2) and (argv[1].endswith(".lst")):
|
|
|
|
roarClient.assetsWindow._load_list(argv[1])
|
|
|
|
roarClient.canvasPanel.commands.canvasPathName = argv[0]
|
2019-09-28 17:45:45 +00:00
|
|
|
roarClient.canvasPanel._snapshotsReset()
|
2019-09-14 09:21:40 +00:00
|
|
|
rc, error = roarClient.canvasPanel.canvas.importStore.importTextFile(argv[0])
|
2019-09-06 08:29:45 +00:00
|
|
|
if rc:
|
2019-09-23 17:55:31 +00:00
|
|
|
roarClient.canvasPanel.update(roarClient.canvasPanel.canvas.importStore.inSize, False, roarClient.canvasPanel.canvas.importStore.outMap, dirty=False)
|
2019-09-14 09:21:40 +00:00
|
|
|
roarClient.canvasPanel.commands.update(pathName=argv[0], undoLevel=-1)
|
2019-10-24 19:14:00 +00:00
|
|
|
roarClient.canvasPanel.commands._recentPush(argv[0])
|
2019-10-01 19:34:42 +00:00
|
|
|
roarClient.canvasPanel.commands.canvasTool(roarClient.canvasPanel.commands.canvasTool, 1)(None)
|
2019-09-06 08:29:45 +00:00
|
|
|
else:
|
|
|
|
print("error: {}".format(error), file=sys.stderr)
|
2019-10-01 19:34:42 +00:00
|
|
|
else:
|
|
|
|
roarClient.canvasPanel.commands.canvasNew(None)
|
|
|
|
roarClient.canvasPanel.commands.canvasTool(roarClient.canvasPanel.commands.canvasTool, 1)(None)
|
2019-09-01 14:34:00 +00:00
|
|
|
wxApp.MainLoop()
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main(*sys.argv)
|
|
|
|
|
|
|
|
# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120
|