2019-09-01 10:34:00 -04:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
#
|
2019-09-03 12:58:50 -04:00
|
|
|
# roar.py -- mIRC art editor for Windows & Linux
|
2019-09-01 10:34:00 -04:00
|
|
|
# Copyright (c) 2018, 2019 Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de>
|
|
|
|
#
|
|
|
|
|
|
|
|
import os, sys
|
2019-09-03 09:48:52 -04: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 05:06:25 -04:00
|
|
|
["libcanvas", "libgui", "libroar", "librtl", "liboperators", "libtools"]]
|
2019-09-01 10:34:00 -04:00
|
|
|
|
2019-09-10 04:14:12 -04:00
|
|
|
from RoarClient import RoarClient
|
2019-09-14 09:16:57 -04:00
|
|
|
from RtlPlatform import getLocalConfPathName
|
2019-09-01 10:34:00 -04:00
|
|
|
import wx
|
|
|
|
|
|
|
|
#
|
|
|
|
# Entry point
|
|
|
|
def main(*argv):
|
2019-09-14 09:16:57 -04:00
|
|
|
localConfDirName = getLocalConfPathName()
|
|
|
|
if not os.path.exists(localConfDirName):
|
|
|
|
os.makedirs(localConfirName)
|
2019-09-10 04:14:12 -04:00
|
|
|
wxApp, roarClient = wx.App(False), RoarClient(None)
|
2019-09-14 05:21:40 -04:00
|
|
|
argv0, argv = argv[0], argv[1:]
|
2019-09-24 09:10:34 -04:00
|
|
|
roarClient.canvasPanel.commands._loadLastDir(); roarClient.canvasPanel.commands._loadRecent();
|
2019-09-14 04:52:05 -04:00
|
|
|
if len(argv) >= 1:
|
2019-09-14 05:21:40 -04:00
|
|
|
if (len(argv) >= 2) and (argv[1].endswith(".lst")):
|
|
|
|
roarClient.assetsWindow._load_list(argv[1])
|
|
|
|
roarClient.canvasPanel.commands.canvasPathName = argv[0]
|
|
|
|
rc, error = roarClient.canvasPanel.canvas.importStore.importTextFile(argv[0])
|
2019-09-06 04:29:45 -04:00
|
|
|
if rc:
|
2019-09-23 13:55:31 -04:00
|
|
|
roarClient.canvasPanel.update(roarClient.canvasPanel.canvas.importStore.inSize, False, roarClient.canvasPanel.canvas.importStore.outMap, dirty=False)
|
2019-09-14 05:21:40 -04:00
|
|
|
roarClient.canvasPanel.commands.update(pathName=argv[0], undoLevel=-1)
|
2019-09-14 09:16:57 -04:00
|
|
|
roarClient.canvasPanel.commands._pushRecent(argv[0])
|
2019-09-06 04:29:45 -04:00
|
|
|
else:
|
|
|
|
print("error: {}".format(error), file=sys.stderr)
|
2019-09-01 10:34:00 -04:00
|
|
|
wxApp.MainLoop()
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main(*sys.argv)
|
|
|
|
|
|
|
|
# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120
|