From 78234602ceb6aaaff9996240b388be12fcff968f Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Tue, 27 Nov 2012 21:11:18 +0100 Subject: LibreLogo integration (extension -> normal code) While efforts have been made to make LibreLogo work with Python 3.3, there are still a few bugs, for example large Logo programs do not run correctly and Translate button does not work. Bugfixing is in progress. Change-Id: I4227ff86084f51047861897189d2317322296139 --- librelogo/Configuration_librelogo.mk | 20 -- librelogo/CustomTarget_librelogo.mk | 43 +++ librelogo/Extension_librelogo.mk | 46 --- librelogo/Module_librelogo.mk | 4 +- librelogo/Zip_librelogo.mk | 49 +++ librelogo/source/LibreLogo/LibreLogo.py | 267 +++++++------- librelogo/source/LibreLogoDummy.py | 24 -- librelogo/source/META-INF/manifest.xml | 9 - librelogo/source/README | 43 --- librelogo/source/description-en-US.txt | 1 - librelogo/source/description.xml | 20 -- librelogo/source/help/en-US/LibreLogo.xhp | 397 --------------------- librelogo/source/help/en-US/help.tree | 18 - librelogo/source/pythonpath/librelogodummy_path.py | 13 - .../registry/data/org/openoffice/Office/Addons.xcu | 286 --------------- .../Office/UI/StartModuleWindowState.xcu | 28 -- .../org/openoffice/Office/UI/WriterWindowState.xcu | 28 -- officecfg/Configuration_officecfg.mk | 1 + .../registry/data/org/openoffice/Office/Addons.xcu | 286 +++++++++++++++ .../org/openoffice/Office/UI/WriterWindowState.xcu | 14 + postprocess/packregistry/makefile.mk | 1 + scp2/source/python/file_python.scp | 9 + scp2/source/python/module_python.scp | 1 + 23 files changed, 545 insertions(+), 1063 deletions(-) delete mode 100644 librelogo/Configuration_librelogo.mk create mode 100644 librelogo/CustomTarget_librelogo.mk delete mode 100644 librelogo/Extension_librelogo.mk create mode 100644 librelogo/Zip_librelogo.mk delete mode 100644 librelogo/source/LibreLogoDummy.py delete mode 100644 librelogo/source/META-INF/manifest.xml delete mode 100644 librelogo/source/README delete mode 100644 librelogo/source/description-en-US.txt delete mode 100644 librelogo/source/description.xml delete mode 100644 librelogo/source/help/en-US/LibreLogo.xhp delete mode 100644 librelogo/source/help/en-US/help.tree delete mode 100644 librelogo/source/pythonpath/librelogodummy_path.py delete mode 100644 librelogo/source/registry/data/org/openoffice/Office/Addons.xcu delete mode 100644 librelogo/source/registry/data/org/openoffice/Office/UI/StartModuleWindowState.xcu delete mode 100644 librelogo/source/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu create mode 100644 officecfg/registry/data/org/openoffice/Office/Addons.xcu diff --git a/librelogo/Configuration_librelogo.mk b/librelogo/Configuration_librelogo.mk deleted file mode 100644 index cf2e6f45271d..000000000000 --- a/librelogo/Configuration_librelogo.mk +++ /dev/null @@ -1,20 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_Configuration_Configuration,librelogo,nodeliver)) - -$(eval $(call gb_Configuration_use_configuration,librelogo,registry)) - -$(eval $(call gb_Configuration_add_localized_datas,librelogo,librelogo/source/registry/data,\ - org/openoffice/Office/Addons.xcu \ - org/openoffice/Office/UI/StartModuleWindowState.xcu \ - org/openoffice/Office/UI/WriterWindowState.xcu \ -)) - -# vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/librelogo/CustomTarget_librelogo.mk b/librelogo/CustomTarget_librelogo.mk new file mode 100644 index 000000000000..903ca8ab5081 --- /dev/null +++ b/librelogo/CustomTarget_librelogo.mk @@ -0,0 +1,43 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_CustomTarget_CustomTarget,librelogo/locproperties)) + +librelogo_DIR := $(call gb_CustomTarget_get_workdir,librelogo/locproperties) + +ifneq ($(strip $(gb_WITH_LANG)),) +librelogo_LANGS := $(subst -,_,$(filter-out qtz,$(filter-out en-US,$(gb_WITH_LANG)))) +librelogo_LOCPROPERTIES := $(foreach lang,$(librelogo_LANGS),$(librelogo_DIR)/LibreLogo_$(lang).properties) +else +librelogo_LOCPROPERTIES := +endif + +librelogo_PROPMERGETARGET := $(call gb_Executable_get_target_for_build,propex) +librelogo_PROPMERGECOMMAND := $(gb_Helper_set_ld_path) $(librelogo_PROPMERGETARGET) + +$(call gb_CustomTarget_get_target,librelogo/locproperties) : $(librelogo_LOCPROPERTIES) + +$(librelogo_DIR)/LibreLogo_%.properties : \ + $(SRCDIR)/librelogo/source/pythonpath/LibreLogo_en_US.properties \ + | $(librelogo_DIR)/.dir + $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRP,1) + $(call gb_Helper_abbreviate_dirs, \ + LANG=$(subst _,-,$(subst $(librelogo_DIR)/LibreLogo_,,$(subst .properties,,$@))) && \ + MERGEINPUT=`$(gb_MKTEMP)` && \ + echo $(gb_POLOCATION)/$${LANG}/librelogo/source/pythonpath.po > $${MERGEINPUT} && \ + $(librelogo_PROPMERGECOMMAND) \ + -p librelogo \ + -i $< \ + -o $@ \ + -m $${MERGEINPUT} \ + -l $${LANG} && \ + rm -rf $${MERGEINPUT} \ + ) + +# vim:set shiftwidth=4 tabstop=4 noexpandtab: diff --git a/librelogo/Extension_librelogo.mk b/librelogo/Extension_librelogo.mk deleted file mode 100644 index 8f525c3d449b..000000000000 --- a/librelogo/Extension_librelogo.mk +++ /dev/null @@ -1,46 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_Extension_Extension,librelogo,librelogo/source)) - -$(eval $(call gb_Extension_add_files,librelogo,icons,\ - $(SRCDIR)/librelogo/source/icons/lc_arrowshapes.circular-arrow.png \ - $(SRCDIR)/librelogo/source/icons/lc_arrowshapes.circular-leftarrow.png \ - $(SRCDIR)/librelogo/source/icons/lc_arrowshapes.down-arrow.png \ - $(SRCDIR)/librelogo/source/icons/lc_arrowshapes.up-arrow.png \ - $(SRCDIR)/librelogo/source/icons/lc_basicstop.png \ - $(SRCDIR)/librelogo/source/icons/lc_editglossary.png \ - $(SRCDIR)/librelogo/source/icons/lc_navigationbarleft.png \ - $(SRCDIR)/librelogo/source/icons/lc_newdoc.png \ - $(SRCDIR)/librelogo/source/icons/lc_runbasic.png \ - $(SRCDIR)/librelogo/source/icons/sc_arrowshapes.circular-arrow.png \ - $(SRCDIR)/librelogo/source/icons/sc_arrowshapes.circular-leftarrow.png \ - $(SRCDIR)/librelogo/source/icons/sc_arrowshapes.down-arrow.png \ - $(SRCDIR)/librelogo/source/icons/sc_arrowshapes.up-arrow.png \ - $(SRCDIR)/librelogo/source/icons/sc_basicstop.png \ - $(SRCDIR)/librelogo/source/icons/sc_editglossary.png \ - $(SRCDIR)/librelogo/source/icons/sc_navigationbarleft.png \ - $(SRCDIR)/librelogo/source/icons/sc_newdoc.png \ - $(SRCDIR)/librelogo/source/icons/sc_runbasic.png \ -)) - -$(eval $(call gb_Extension_add_file,librelogo,LibreLogoDummy.py,$(SRCDIR)/librelogo/source/LibreLogoDummy.py)) -$(eval $(call gb_Extension_add_file,librelogo,pythonpath/librelogodummy_path.py,$(SRCDIR)/librelogo/source/pythonpath/librelogodummy_path.py)) -$(eval $(call gb_Extension_add_file,librelogo,LibreLogo/LibreLogo.py,$(SRCDIR)/librelogo/source/LibreLogo/LibreLogo.py)) -$(eval $(call gb_Extension_add_file,librelogo,Addons.xcu,$(call gb_XcuFile_for_extension,librelogo/source/registry/data/org/openoffice/Office/Addons.xcu))) -$(eval $(call gb_Extension_add_file,librelogo,Office/UI/StartModuleWindowState.xcu,$(call gb_XcuFile_for_extension,librelogo/source/registry/data/org/openoffice/Office/UI/StartModuleWindowState.xcu))) -$(eval $(call gb_Extension_add_file,librelogo,Office/UI/WriterWindowState.xcu,$(call gb_XcuFile_for_extension,librelogo/source/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu))) - -$(eval $(call gb_Extension_localize_properties,librelogo,pythonpath/LibreLogo_en_US.properties,$(SRCDIR)/librelogo/source/pythonpath/LibreLogo_en_US.properties)) - -$(eval $(call gb_Extension_add_helpfile,librelogo,$(SRCDIR)/librelogo/source/help/en-US,org.openoffice.comp.pyuno.LibreLogo/LibreLogo.xhp,LibreLogo.xhp)) - -$(eval $(call gb_Extension_add_helptreefile,librelogo,$(SRCDIR)/librelogo/source/help/en-US,help.tree,help.tree,org.openoffice.comp.pyuno.LibreLogo)) - -# vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/librelogo/Module_librelogo.mk b/librelogo/Module_librelogo.mk index 6db9719138a0..caa4cf96efb0 100644 --- a/librelogo/Module_librelogo.mk +++ b/librelogo/Module_librelogo.mk @@ -13,8 +13,8 @@ ifneq ($(DISABLE_SCRIPTING),TRUE) ifneq ($(DISABLE_PYTHON),TRUE) $(eval $(call gb_Module_add_targets,librelogo,\ - Configuration_librelogo \ - Extension_librelogo \ + CustomTarget_librelogo \ + Zip_librelogo \ )) endif diff --git a/librelogo/Zip_librelogo.mk b/librelogo/Zip_librelogo.mk new file mode 100644 index 000000000000..617d0fd2ef8d --- /dev/null +++ b/librelogo/Zip_librelogo.mk @@ -0,0 +1,49 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Zip_Zip,LibreLogo,$(WORKDIR)/Zip/LibreLogo)) + +$(eval $(call gb_Zip_add_file,LibreLogo,python/LibreLogo/LibreLogo.py,\ + $(SRCDIR)/librelogo/source/LibreLogo/LibreLogo.py \ +)) + +$(eval $(call gb_Zip_add_file,LibreLogo,python/LibreLogo/LibreLogo_en_US.properties,\ + $(SRCDIR)/librelogo/source/pythonpath/LibreLogo_en_US.properties \ +)) + +librelogo_LANGS := $(subst -,_,$(filter-out qtz,$(filter-out en-US,$(gb_WITH_LANG)))) + +$(eval $(foreach lang,$(librelogo_LANGS),\ + $(call gb_Zip_add_file,LibreLogo,python/LibreLogo/LibreLogo_$(lang).properties,\ + $(call gb_CustomTarget_get_workdir,librelogo/locproperties)/LibreLogo_$(lang).properties))) + +$(eval $(foreach icon,\ + lc_arrowshapes.circular-arrow.png \ + lc_arrowshapes.circular-leftarrow.png \ + lc_arrowshapes.down-arrow.png \ + lc_arrowshapes.up-arrow.png \ + lc_basicstop.png \ + lc_editglossary.png \ + lc_navigationbarleft.png \ + lc_newdoc.png \ + lc_runbasic.png \ + sc_arrowshapes.circular-arrow.png \ + sc_arrowshapes.circular-leftarrow.png \ + sc_arrowshapes.down-arrow.png \ + sc_arrowshapes.up-arrow.png \ + sc_basicstop.png \ + sc_editglossary.png \ + sc_navigationbarleft.png \ + sc_newdoc.png \ + sc_runbasic.png, \ + $(call gb_Zip_add_file,LibreLogo,python/LibreLogo/icons/$(icon),\ + $(SRCDIR)/librelogo/source/icons/$(icon) \ +))) + +# vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/librelogo/source/LibreLogo/LibreLogo.py b/librelogo/source/LibreLogo/LibreLogo.py index db697bd7a022..4fe0c92c8c14 100644 --- a/librelogo/source/LibreLogo/LibreLogo.py +++ b/librelogo/source/LibreLogo/LibreLogo.py @@ -7,12 +7,23 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # +from __future__ import unicode_literals import sys, os, uno, unohelper import re, random, traceback, itertools import threading, time as __time__ -ctx = uno.getComponentContext() -__lngpath__ = re.sub("[\w_.]*$", "", ctx.ServiceManager.createInstanceWithContext("org.openoffice.LibreLogo.LibreLogoDummy", ctx).get_path()) # instead of PackageInformationProvider, see #115393# +try: + unicode +except: + unicode, long = str, int # support python 3 + +urebootstrap = os.environ["URE_BOOTSTRAP"] +if "vnd.sun.star.pathname" in urebootstrap: + __lngpath__ = re.sub("^vnd.sun.star.pathname:(.*)program(/|\\)fundamental([.]ini|rc)$", "\\1", urebootstrap) +else: + __lngpath__ = unohelper.fileUrlToSystemPath(re.sub("program/(fundamental.ini|fundamentalrc)$", "", urebootstrap)) +__lngpath__ = __lngpath__ + "share/Scripts/python/LibreLogo/".replace("/", os.sep) +print (__lngpath__) __translang__ = "cz|de|dk|en_US|es|fr|hu|it|nl|no|pl|pt|ru|se|sl" # FIXME supported languages for language guessing, expand this list, according to the localizations __lng__ = {} __docs__ = {} @@ -125,7 +136,7 @@ def __l12n__(lng): return __lng__[lng] except: try: - __lng__[lng] = dict([[i.split("=")[0].strip(), i.split("=")[1].strip().decode("unicode-escape")] for i in open(__lngpath__ + "LibreLogo_" + lng + ".properties", 'r').readlines() if "=" in i]) + __lng__[lng] = dict([[i.decode("unicode-escape").split("=")[0].strip(), i.decode("unicode-escape").split("=")[1].strip()] for i in open(__lngpath__ + "LibreLogo_" + lng + ".properties", 'rb').readlines() if b"=" in i]) return __lng__[lng] except: return None @@ -208,7 +219,7 @@ def Input(s): # dispose the dialog controlContainer.dispose() return inputtext - except Exception, e: + except Exception as e: __trace__() def __string__(s, decimal = None): # convert decimal sign, localized BOOL and SET @@ -257,10 +268,10 @@ def Random(r): return list(r)[int(random.random() * len(r))] def to_ascii(s): - return s.encode("unicode-escape").replace("\u", "__u__").replace(r"\x", "__x__") + return s.encode("unicode-escape").decode("utf-8").replace("\\u", "__u__").replace(r"\x", "__x__") def to_unicode(s): - return s.replace("__x__", r"\x").replace("__u__", "\u").decode("unicode-escape") + return bytes(s.replace("__x__", r"\x").replace("__u__", "\\u"), "ascii").decode("unicode-escape") def __trace__(): if 'PYUNO_LOGLEVEL' in os.environ: @@ -281,7 +292,7 @@ def __translate__(arg = None): # detect language text = _.doc.getText().getString() # remove comments and strings - text = re.sub(r"[ ]*;[^\n]*", "", re.sub(ur"['„“‘«»「][^\n'”“‘’«»」]*['”“‘’«»」]", "", re.sub(r"^[ \t]*[;#][^\n]*", "", text))) + text = re.sub(r"[ ]*;[^\n]*", "", re.sub(r"['„“‘«»「][^\n'”“‘’«»」]*['”“‘’«»」]", "", re.sub(r"^[ \t]*[;#][^\n]*", "", text))) text = " ".join(set(re.findall("(?u)\w+", text)) - set(re.findall("(?u)\w*\d+\w*", text))).lower() # only words ctx = uno.getComponentContext() guess = ctx.ServiceManager.createInstanceWithContext("com.sun.star.linguistic2.LanguageGuessing", ctx) @@ -309,15 +320,15 @@ def __translate__(arg = None): in2 = __l12n__(_.lng)['IN'].split("|")[0].upper() if in1[0] == '-' and in2[0] != '-': # "for x y-in" -> "for x in y" exception += ['IN'] - text = re.sub(ur"(?ui)\b((?:%s) +:?\w+) +([^\n]+)(?:%s) +(?=[[] |[[]\n)" % (lang['FOR'], in1), "\\1 %s \\2 " % in2, text) - text = re.sub(ur"(?ui)(:?\b\w+|[[][^[\n]*])\b(?:%s)\b" % in1, "%s \\1" % in2, text) + text = re.sub(r"(?ui)\b((?:%s) +:?\w+) +([^\n]+)(?:%s) +(?=[[] |[[]\n)" % (lang['FOR'], in1), "\\1 %s \\2 " % in2, text) + text = re.sub(r"(?ui)(:?\b\w+|[[][^[\n]*])\b(?:%s)\b" % in1, "%s \\1" % in2, text) elif in1[0] != '-' and in2[0] == '-': # "for x in y" -> "for x y-in" exception += ['IN'] - text = re.sub(ur"(?ui)(?<=\n)((?:%s)\b +:?\w+) +(?:%s) +([^\n]+?) +(?=[[] |[[]\n)" % (lang['FOR'], in1), "\\1 \\2%s " % in2, text) - text = re.sub(ur"(?ui)(? 20000: - if MessageBox(_.doc.CurrentController.Frame.ContainerWindow, __l12n__(_.lng)['ERR_NOTAPROGRAM'], __l12n__(_.lng)['LIBRELOGO'], "querybox", __YES_NO_CANCEL__) <> 2: + if MessageBox(_.doc.CurrentController.Frame.ContainerWindow, __l12n__(_.lng)['ERR_NOTAPROGRAM'], __l12n__(_.lng)['LIBRELOGO'], "querybox", __YES_NO_CANCEL__) != 2: with __lock__: __thread__ = None return None @@ -718,7 +729,7 @@ def __draw__(d): def __zoom__(): z = _.doc.CurrentController.getViewSettings().ZoomValue - if z <> _.zoomvalue: + if z != _.zoomvalue: _.zoomvalue = z return True return False @@ -742,7 +753,7 @@ def __go__(shapename, n, dot = False, preciseAngle = -1): dx = n * sin((pi/180)*(max(turtle.RotateAngle, preciseAngle)/100)) dy = n * cos((pi/180)*(max(turtle.RotateAngle, preciseAngle)/100)) turtle.setPosition(__Point__(pos.X + dx / __MM10_TO_TWIP__, pos.Y + dy / __MM10_TO_TWIP__)) - if (_.pencolor <> _.oldlc or _.pensize <> _.oldlw or _.linestyle <> _.oldls or _.linejoint <> _.oldlj): + if (_.pencolor != _.oldlc or _.pensize != _.oldlw or _.linestyle != _.oldls or _.linejoint != _.oldlj): __removeshape__(__ACTUAL__) shape = None else: @@ -851,7 +862,7 @@ def point(): _.pen, _.linestyle = oldpen, oldstyle def __boxshape__(shapetype, l): - if type(l) <> type([]): # default for circle and square + if type(l) != type([]): # default for circle and square l = [l, l] turtle = __getshape__(__TURTLE__) shape = __draw__(shapetype + "Shape") @@ -1144,111 +1155,111 @@ def __loadlang__(lang, a): repcount = a['REPCOUNT'].split('|')[0] loopi = itertools.count() loop = lambda r: "%(i)s = 1\n%(orig)s%(j)s = %(i)s\n%(i)s += 1\n" % \ - { "i": repcount + str(loopi.next()), "j": repcount, "orig": re.sub( ur"(?ui)(?])=(?!=)", "==", r.group(0))], # = -> ==, XXX x = y = 1? - [ur"(?<=\n)(for\b :?\w+) ([^\n]+)(?<=\w|]|}|\))(?=-|:)(?:%s)\b" % a['IN'], "\\1 in \\2"], # "for x y-in" -> "for x in y" - [ur"(:?\b\w+|[[][^[\n]*])\b(?:%s)\b" % a['IN'], "in \\1"], # "x y-in" -> "x in y" - [ur"(? /1.0, but not with // - [ur"\b([0-9]+([,.][0-9]+)?)(%s)\b" % a['HOUR'], "\\1*30"], # 12h = 12*30° - [ur"(?<=\d)(%s)" % a['DEG'], ""], # 1° -> 1 - [ur"(? (1 + sqrt(x)) - [ur"(?<=[-*/=+,]) ?\n\)(\w+)\(", "\\1()"], # read attributes, eg. x = fillcolor - [ur"(?<=return) ?\n\)(\w+)\(", "\\1()"], # return + user function - [ur"(?<=(?:Print|label)\() ?\n\)(\w+)\(", "\\1()\n"] # Print/label + user function + [r"(?])=(?!=)", "==", r.group(0))], # = -> ==, XXX x = y = 1? + [r"(?<=\n)(for\b :?\w+) ([^\n]+)(?<=\w|]|}|\))(?=-|:)(?:%s)\b" % a['IN'], "\\1 in \\2"], # "for x y-in" -> "for x in y" + [r"(:?\b\w+|[[][^[\n]*])\b(?:%s)\b" % a['IN'], "in \\1"], # "x y-in" -> "x in y" + [r"(? /1.0, but not with // + [r"\b([0-9]+([,.][0-9]+)?)(%s)\b" % a['HOUR'], "\\1*30"], # 12h = 12*30° + [r"(?<=\d)(%s)" % a['DEG'], ""], # 1° -> 1 + [r"(? (1 + sqrt(x)) + [r"(?<=[-*/=+,]) ?\n\)(\w+)\(", "\\1()"], # read attributes, eg. x = fillcolor + [r"(?<=return) ?\n\)(\w+)\(", "\\1()"], # return + user function + [r"(?<=(?:Print|label)\() ?\n\)(\w+)\(", "\\1()\n"] # Print/label + user function ] def __concatenation__(r): # keep line positions with extra line breaks @@ -1278,7 +1289,7 @@ def __compil__(s): rmsp = re.compile(r"[ ]*([=+*/]|==|<=|>=|<>|!=|-[ ]+)[ ]*") chsp = re.compile(r"[ \t]+") chch = re.compile(r"(?u)(? 0: globs = "global %s" % ", ".join(subnames) # search user functions (function calls with two or more arguments need explicite Python parentheses) - functions += [ re.findall("(?u)\w+",i[0])[0] for i in re.findall(ur"""(?iu)(?<=__def__ )([^\n]*)\n # beginning of a procedure + functions += [ re.findall("(?u)\w+",i[0])[0] for i in re.findall(r"""(?iu)(?<=__def__ )([^\n]*)\n # beginning of a procedure (?:[^\n]*(? 0: - s = re.sub(ur"(? - - - - - - - - \ No newline at end of file diff --git a/librelogo/source/README b/librelogo/source/README deleted file mode 100644 index ffe5ea0a1611..000000000000 --- a/librelogo/source/README +++ /dev/null @@ -1,43 +0,0 @@ -LibreOffice Logo 0.2 RC2 - -License: GNU LGPL & GPL, MPL - -Home page: http://www.numbertext.org/logo - -(c) László Németh (nemeth at numbertextdotorg) - -FSF.hu Foundation, http://www.fsf.hu - -Icons copyright: OpenOffice.org/LibreOffice - -Introduction -============ - -LibreLogo is a Logo-like programming language with interactive vectorgraphics for education and DTP - -- presentation: http://www.numbertext.org/logo/librelogo.pdf -- basic Logo syntax for back compability with educational Logo systems -- interactive vectorgraphics in LibreOffice Writer -- native commands (easily translatable) -- Python data structures (list, tuple, set, dictionary) and other Python features - -Usage -===== - -See Logo in LibreOffice Help and http://www.numbertext.org/logo for documentation. - -Translation -=========== - -create your_language_id.lng in LibreOffice/ based on en.lng. - -Compilation: - -python make.py - -Development -=========== - -LibreLogo uses the PyUNO scripting framework, so Addons.xcu URLs depend from the -full name of the package. Modify them according to the package name with the -version number. diff --git a/librelogo/source/description-en-US.txt b/librelogo/source/description-en-US.txt deleted file mode 100644 index 6e9566518da8..000000000000 --- a/librelogo/source/description-en-US.txt +++ /dev/null @@ -1 +0,0 @@ -Programming language and environment for education, graphic design and desktop publishing. Usage: View→Toolbars→Logo toolbar in Writer. See Logo in LibreOffice Help. diff --git a/librelogo/source/description.xml b/librelogo/source/description.xml deleted file mode 100644 index 6711d7806ccb..000000000000 --- a/librelogo/source/description.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - LibreLogo - - - - László Németh - Németh László - - - - - - - - diff --git a/librelogo/source/help/en-US/LibreLogo.xhp b/librelogo/source/help/en-US/LibreLogo.xhp deleted file mode 100644 index 33dc2cc14d16..000000000000 --- a/librelogo/source/help/en-US/LibreLogo.xhp +++ /dev/null @@ -1,397 +0,0 @@ - - - - - - - - - - - -LibreLogo -Logo -Turtle graphics - - -LibreLogo -LibreLogo is a simple, native, Logo-like programming environment with turtle vector graphics for teaching of computing (programming and word processing), DTP and graphic design. See http://www.numbertext.org/logo/librelogo.pdf. -LibreLogo toolbar -The LibreLogo toolbar (View » Toolbars » Logo) contains turtle moving, program run and stop, home and clear screen and syntax highlighting/translating icons and an input bar (command line). -Turtle moving icons -They are equivalents of the Logo commands “FORWARD 10”, “BACK 10”, “LEFT 15”, “RIGHT 15”. Clicking on one of the icons will also focus the turtle shape scrolling the page to its position. -Program run and start -Click on the icon “run” to execute the text of the Writer document as a LibreLogo program. -Click on the icon “stop” to stop the program execution. -Home -Click on the icon “home” to reset the position and settings of the turtle. -Clear screen -Click on the icon “clear screen” to remove the drawing objects of the document. -Command line -Hit Enter in the command line to execute its content. To stop the program use the icon “stop”. -Hold down the Enter to repeat the command line, for example, on the following command sequence: - FORWARD 200 LEFT 89
-To reset the command line click triple in it or press Ctrl-A to select the previous commands, and type the new commands. -Syntax highlighting/Translating -It expands and upper case Logo commands in the Writer document. Change the language of the document (Tools » Options » Language Settings » Languages » Western) and click on this icon to translate the Logo program to the selected language. -Program editing -LibreLogo drawings and programs use the same Writer document. The LibreLogo canvas is on the first page of the Writer document. You can insert a page break before the LibreLogo programs and set the zoom/font size for a comfortable two page layout for LibreLogo programming: left (first) page is the canvas, right (second) page is for the LibreLogo programs. -LibreLogo programming language -LibreLogo is a native, easily localisable, Logo-like programming language. It is back-compatible with the older Logo systems in the case of the simple Logo programs used in education, eg. - TO triangle :size
 REPEAT 3 [
   FORWARD :size
   LEFT 120
 ]
 END
 
 triangle 10 triangle 100 triangle 200
-Differences from the Logo programming language - - - List members are comma separated: POSITION [0, 0] - - - Program blocks and lists are different - - - - - Program blocks need space or new line at parenthesization: REPEAT 10 [ forward 10 left 36 ] - - - Lists need close parenthesization: POSITION [0, 0], and not POSITION [ 0, 0 ] - - - - - 1-line function declarations have not supported yet (TO and END need new lines). - - -Other features of LibreLogo - - - The colon is optional before the variable names. -  TO triangle size
   REPEAT 3 [ FORWARD size LEFT 120 ]
 END
-
- - String notation supports also orthographical and Python syntax. -  PRINT "word ; original Logo syntax
 PRINT “Arbitrary text.” ; orthography, Writer
 PRINT 'Arbitrary text.' ; Python syntax
-
- - Python list and string handling -  PRINT “text”[2] ; print “x”
 PRINT “text”[1:3] ; print “ex”
-
- - Python-like FOR loop - - - Python-like variable declaration: -  x = 15
 PRINT x
-
- - There are no extra query functions: -  PRINT FILLCOLOR
 p = POSITION
 PRINT p
 REPEAT 10 [ POSITION ANY POSITION p ]
-
- - Alternative parenthesization in function calls -  TO star size color
 FILLCOLOR color
 REPEAT 5 [ LEFT 72 FORWARD size RIGHT 144 FORWARD size ]
 FILL
 END
 
 star 100 “red”
 star (100, “green”)
 star(100, “blue”)
-
-
-LibreLogo commands -Basic syntax -Case sensitivity -Commands, color constants are case insensitive: - PRINT “Hello, World!”
 print “Hello, World, again!”
-Variable names are case sensitive: - a = 5
 A = 7
 PRINT a
 PRINT A
-Program lines -Lines of a LibreLogo program are paragraphs in the LibreOffice Writer document. A program line can contain multiple commands: - PRINT “Hello, World!” PRINT “LibreLogo”
-Comments -Lines or line parts are comments from a semicolon to the end of the line (paragraph): - ; some comments
 PRINT 5 * 5 ; some comments
-Break program lines to multiple paragraphs -It’s possible to break a program line for more paragraphs using the character tilde at the end of the line: - PRINT “This is a very long ” + ~
       “warning message”
-Turtle moving -FORWARD (fd) - FORWARD 10 ; move forward 10pt (1pt = 1/72 inch)
 FORWARD 10pt ; see above
 FORWARD 0.5in ; move forward 0.5 inch (1 inch = 2.54 cm)
 FORWARD 1" ; see above
 FD 1mm
 FD 1cm
-BACK (bk) - BACK 10 ; move back 10pt
-LEFT (lt) - LEFT 90 ; turn counterclockwise 90 degrees
 LEFT 90° ; see above
 LT 3h ; see above (clock position)
 LT any ; turn to a random position
-RIGHT (rt) - RIGHT 90 ; turn clockwise 90 degrees
-PENUP (pu) - PENUP ; turtle will move without drawing
-PENDOWN (pd) - PENDOWN ; turtle will move with drawing
-POSITION (pos) - POSITION [0, 0] ; turn and move to the top-left corner
 POSITION PAGESIZE ; turn and move to the bottom-right corner
 POSITION [PAGESIZE[0], 0] ; turn and move to the top-right corner
 POSITION ANY ; turn and move to a random position
-HEADING (seth) - HEADING 0 ; turn north
 HEADING 12h ; see above
 HEADING ANY ; turn to a random position
-Other turtle commands -HIDETURTLE (ht) - HIDETURTLE ; hide turtle (until the showturtle command)
-SHOWTURTLE (st) - SHOWTURTLE ; show turtle
-HOME - HOME ; reset initial turtle settings and position
-CLEARSCREEN (cs) - CLEARSCREEN ; remove drawing objects of the document
-FILL and CLOSE - FILL ; close and fill the actual line shape
 CLOSE ; close the actual line shape
-Pen settings -PENSIZE (ps) - PENSIZE 100 ; line width is 100 points
 PENSIZE ANY ; equivalent of PENSIZE RANDOM 10
-PENCOLOR/PENCOLOUR (pc) - PENCOLOR “red” ; set red pen color (by color name, see color constants)
 PENCOLOR [255, 255, 0] ; set yellow color (RGB list)
 PENCOLOR 0xffff00 ; set yellow color (hexa code)
 PENCOLOR 0 ; set black color (0x000000)
 PENCOLOR ANY ; random color
 PENCOLOR [5] ; set red color (by color identifier, see color constants)
 PENCOLOR “invisible” ; invisible pen color for shapes without visible outline
 PENCOLOR “~red” ; set random red color
-PENJOINT/LINEJOINT - PENJOINT “rounded” ; rounded line joint (default)
 PENJOINT “miter” ; sharp line joint
 PENJOINT “bevel” ; bevel line joint
 PENJOINT “none” ; without line joint
-PENSTYLE - PENSTYLE “solid” ; solid line (default)
 PENSTYLE “dotted” ; dotted line
 PENSTYLE “dashed” ; dashed line
 
 ; custom dot–dash pattern specified by a list with the following arguments:
 ; – number of the neighbouring dots
 ; – length of a dot
 ; – number of the neighbouring dashes
 ; – length of a dash
 ; – distance of the dots/dashes
 ; – type (optional):
 ;   0 = dots are rectangles (default)
 ;   2 = dots are squares (lengths and distances are relative to the pensize)
 
 PENSTYLE [3, 1mm, 2, 4mm, 2mm, 2] ; ...––...––...––
-Fill settings -FILLCOLOR/FILLCOLOUR (fc) - FILLCOLOR “blue” ; fill with blue color, see also PENCOLOR
 FILLCOLOR “invisible” CIRCLE 10 ; unfilled circle
-FILLSTYLE - FILLSTYLE 0 ; fill without hatches (default)
 FILLSTYLE 1 ; black single hatches (horizontal)
 FILLSTYLE 2 ; black single hatches (45 degrees)
 FILLSTYLE 3 ; black single hatches (-45 degrees)
 FILLSTYLE 4 ; black single hatches (vertical)
 FILLSTYLE 5 ; red crossed hatches (45 degrees)
 FILLSTYLE 6 ; red crossed hatches (0 degrees)
 FILLSTYLE 7 ; blue crossed hatches (45 degrees)
 FILLSTYLE 8 ; blue crossed hatches (0 degrees)
 FILLSTYLE 9 ; blue triple crossed
 FILLSTYLE 10 ; black wide single hatches (45 degrees)
 
 ; custom hatches specified by a list with the following arguments:
 ; – style (1 = single, 2 = double, 3 = triple hatching)
 ; – color
 ; – distance
 ; – degree
 
 FILLSTYLE [2, “green”, 3pt, 15°] ; green crossed hatches (15 degrees)
-Drawing objects -CIRCLE - CIRCLE 100 ; draw a circle shape (diameter = 100pt)
-ELLIPSE - ELLIPSE [50, 100] ; draw an ellipse with 50 and 100 diameters
 ELLIPSE [50, 100, 2h, 12h] ; draw an elliptical sector (from 2h clock position to 12h)
 ELLIPSE [50, 100, 2h, 12h, 2]  ; draw an elliptical segment
 ELLIPSE [50, 100, 2h, 12h, 3]  ; draw an elliptical arc
-SQUARE - SQUARE 100 ; draw a square shape (size = 100pt)
-RECTANGLE - RECTANGLE [50, 100] ; draw a rectange shape (50×100pt)
 RECTANGLE [50, 100, 50] ; draw a rectangle 
-POINT - POINT ; draw a point with size and color of the pen
-LABEL - LABEL “text” ; print text in the turte position
 LABEL 'text' ; see above
 LABEL "text ; see above (only for single words)
-TEXT - CIRCLE 10 TEXT “text” ; set text of the actual drawing object
-Font settings -FONTCOLOR/FONTCOLOUR - FONTCOLOR “green” ; set font color
-FONTFAMILY - FONTFAMILY “Linux Libertine G” ; set font (family)
 FONTFAMILY “Linux Libertine G:smcp=1” ; set also font feature (small caps)
 FONTFAMILY “Linux Libertine G:smcp=1&onum=1” ; small caps + old figures
-FONTSIZE - FONTSIZE 12 ; set 12pt
-FONTWEIGHT - FONTWEIGHT “bold” ; set bold font
 FONTWEIGHT “normal” ; set normal weight
-FONTSTYLE - FONTSTYLE “italic” ; set italic variant
 FONTSTYLE “normal” ; set normal variant
-PICTURE (pic) -PICTURE is for - - - shape grouping; - - - starting new line shapes; - - - keeping the consistency of positions and line shapes at the left border. - - -Shape grouping - ; PICTURE [ LibreLogo_commands ]
 PICTURE [ FORWARD 100 CIRCLE 100 ] ; tree-like grouped shape
-See also “Group” in LibreOffice Writer Help. - TO tree location
   PENUP POSITION location HEADING 0 PENDOWN
   PICTURE [ FORWARD 100 CIRCLE 100 ] ; tree-like grouped shape
 END
 
 PICTURE [ tree [30, 50] tree [100, 50] ] ; grouped shapes in a grouped shape
-Starting new line shapes - PICTURE ; start a new line shape
 FORWARD 10 PICTURE FORWARD 10 ; two line shapes
-Consistency at the left border -Use picture to keep the consistency of positions and line shapes at the left border of Writer: - PICTURE [ CIRCLE 20 POSITION [-100, 100] CIRCLE 20 ]
-Loops -REPEAT - ; REPEAT number [ commands ]
 
 REPEAT 10 [ FORWARD 10 LEFT 45 CIRCLE 10 ] ; repeat 10 times
- ; number is optional
 
 REPEAT [ POSITION ANY ] ; endless loop
-REPCOUNT -Loop variable (also in the FOR and WHILE loops). - REPEAT 100 [ FORWARD REPCOUNT LEFT 90 ]
-FOR IN -Loop for the list elements: - FOR i IN [1, 5, 7, 9, 11] [
   FORWARD i
   LEFT 90
 ]
-Loop for the characters of a character sequence: - FOR i IN “text” [
   LABEL i
   FORWARD 10
 ]
-WHILE - WHILE TRUE [ POSITION ANY ] ; endless loop
 WHILE REPCOUNT <= 10 [ FORWARD 50 LEFT 36 ] ; as REPEAT 10 [ ... ]
-BREAK -Stop the loop. - REPEAT [ ; endless loop
   POSITION ANY
   IF REPCOUNT = 100 [ BREAK ]  ; equivalent of the REPEAT 100 [ ... ]
 ]
-CONTINUE -Jump into the next iteration of the loop. - REPEAT 100 [
   POSITION ANY
   IF REPCOUNT % 2 <> 0 [ CONTINUE ]
   CIRCLE 10 ; draw circles on every 2nd positions
 ]
-Conditions -IF - ; IF condition [ true block ]
 ; IF condition [ true block ] [ false block ]
 
 IF a < 10 [ PRINT “Small” ]
 IF a < 10 [ PRINT “Small” ] [ PRINT “Big” ]
-AND, OR, NOT -Logical operators. - IF a < 10 AND NOT a < 5 [ PRINT “5, 6, 7, 8 or 9” ]
-Subroutines -TO, END -New word (or procedure). - TO triangle
   REPEAT [ FORWARD 100 RIGHT 120 ] FILL
 END
 
 REPEAT 10 [ triangle PENUP POSITION ANY PENDOWN ]
-OUTPUT -Return value of the function. - TO randomletter
   OUTPUT RANDOM “qwertzuiopasdfghjklyxcvbnm”
 END
 
 PRINT randomletter + randomletter + randomletter ; print 3-letter random character sequence
-STOP -Return from the procedure. - TO example number
   IF number < 0 [ STOP ]
   PRINT SQRT number ; print square root
 ]
 
 example 100
 example -1 ; without output and error
 example 25
-Default variables -ANY -Default random value of colors, etc. - PENCOLOR ANY ; random pen color
-TRUE -Logical value. - WHILE TRUE [ POSITION ANY ] ; endless loop
 PRINT TRUE ; print true
-FALSE -Logical value. - WHILE NOT FALSE [ POSITION ANY ] ; endless loop
 PRINT FALSE ; print false
-PAGESIZE - PRINT PAGESIZE ; print list of the page sizes in points, eg. [595.30, 841.89]
-PI/π - PRINT PI ; print 3.14159265359
-Input/Output -PRINT - PRINT “text” ; print “text” in a dialog box
 PRINT 5 + 10 ; print 15
-INPUT - PRINT INPUT “Input value?” ; ask and print a string by a query dialog box
 PRINT FLOAT (INPUT “First number?”) + FLOAT (INPUT “Second number?”) ; simple calculator
-SLEEP - SLEEP 1000 ; wait for 1000 ms (1 sec)
-GLOBAL -Set global variables used in procedures. - GLOBAL about
 about = “LibreLogo”
 
 TO example
   PRINT about
   GLOBAL about ; when we want to add a new value
   about = “new value for the global variable”
 END
 
 example
 PRINT about
-Functions -RANDOM - PRINT RANDOM 100 ; random float number (0 <= x < 100)
 PRINT RANDOM “text” ; random letter of the “text”
 PRINT RANDOM [1, 2] ; random list element (1 or 2)
-INT - PRINT INT 3.8 ; print 3 (integer part of 3.8)
 PRINT INT RANDOM 100 ; random integer number (0 <= x < 100)
 PRINT INT “7” ; convert the string parameter to integer
-FLOAT - ; convert the string parameter to float number
 PRINT 2 * FLOAT “5.5” ; print 11.0
-STR - ; convert the number parameter to string
 PRINT “Result: ” + STR 5 ; print “Result: 5”
 PRINT 10 * STR 5 ; print 5555555555
-SQRT - PRINT SQRT 100 ; print 10, square root of 100
-SIN - PRINT SIN 90 * PI/180 ; print 1.0 (sinus of 90° in radians)
-COS - PRINT COS 0 * PI/180 ; print 1.0 (sinus of 0° in radians)
-ROUND - PRINT ROUND 3.8 ; print 4 (rounding 3.8)
 PRINT ROUND RANDOM 100 ; random integer number (0 <= x <= 100)
-ABS - PRINT ABS -10 ; print 10, absolute value of -10
-COUNT - PRINT COUNT “text” ; print 4, character count of “text”
 PRINT COUNT [1, 2, 3] ; print 3, size of the list
-SET - ; Convert list to Python set
 PRINT SET [4, 5, 6, 6] ; print {4, 5, 6}
 PRINT SET [4, 5, 6, 6] | SET [4, 1, 9] ; print {1, 4, 5, 6, 9}, union
 PRINT SET [4, 5, 6, 6] & SET [4, 1, 9] ; print {4}, intersection
 PRINT SET ([4, 5, 6, 6]) - SET [4, 1, 9] ; print {5, 6}, difference
 PRINT SET [4, 5, 6, 6] ^ SET [4, 1, 9] ; print {1, 5, 6, 9}, symmetric difference  
-RANGE - ; Python-like list generation
 PRINT RANGE 10 ; print [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
 PRINT RANGE 3 10 ; print [3, 4, 5, 6, 7, 8, 9]
 PRINT RANGE 3 10 3 ; print [3, 6, 9]
 
 FOR i in RANGE 10 50 10 [ ; loop for [10, 20, 30, 40]
   FORWARD i
   LEFT 90
 ]
-LIST - ; remove the repeating elements of a list using set and list conversion
 PRINT LIST (SET [1, 3, 5, 5, 2, 1]) ; print [1, 3, 5, 2]
-TUPLE -Conversion to Python tuple (non-modifiable list) - PRINT TUPLE [4, 5]
-SORTED -It returns with a sorted list. - PRINT SORTED [5, 1, 3, 4] ; print [1, 3, 4, 5]
-SUB -Substitue character sequences using regex (regular expression) patterns. - PRINT SUB (“t”, “T”, “text”) ; print “Text”, replacing “t” with “T”
 PRINT SUB (“(.)”, “\\1\\1”, “text”) ; print “tteexxtt”, doubling every characters
-SEARCH -Search character sequences patterns using regex patterns. - IF SEARCH (“\w”, word) [ PRINT “Letter in the word.” ]
-FINDALL -Find all character sequences in the input string matching the given regex pattern. - PRINT FINDALL(“\w+”, “Dogs, cats.”) ; print [“Dogs”, “cats”], the list of the words.
-MIN - PRINT MIN [1, 2, 3] ; print 1, the lowest element of the list
-MAX - PRINT MAX [1, 2, 3] ; print 3, the greatest element of the list
-Color constants - PENCOLOR “SILVER” ; set by name
 PENCOLOR [1] ; set by identifiers
 PENCOLOR “~SILVER” ; random silver color
 
- -Identifier -Name - -0 -BLACK - -1 -SILVER - -2 -GRAY/GREY - -3 -WHITE - -4 -MAROON - -5 -RED - -6 -PURPLE - -7 -FUCHSIA/MAGENTA - -8 -GREEN - -9 -LIME - -10 -OLIVE - -11 -YELLOW - -12 -NAVY - -13 -BLUE - -14 -TEAL - -15 -AQUA - -16 -PINK - -17 -TOMATO - -18 -ORANGE - -19 -GOLD - -20 -VIOLET - -21 -SKYBLUE - -22 -CHOCOLATE - -23 -BROWN - -24 -INVISIBLE -
-
diff --git a/librelogo/source/help/en-US/help.tree b/librelogo/source/help/en-US/help.tree deleted file mode 100644 index 10d79ef2958a..000000000000 --- a/librelogo/source/help/en-US/help.tree +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - LibreLogo - - - diff --git a/librelogo/source/pythonpath/librelogodummy_path.py b/librelogo/source/pythonpath/librelogodummy_path.py deleted file mode 100644 index 3ab8495ecc1f..000000000000 --- a/librelogo/source/pythonpath/librelogodummy_path.py +++ /dev/null @@ -1,13 +0,0 @@ -# -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -import uno, re, sys, os, traceback -def get_path(): - return os.path.join(os.path.dirname(sys.modules[__name__].__file__), __name__ + ".py") - -# vim: set noet sw=4 ts=4: diff --git a/librelogo/source/registry/data/org/openoffice/Office/Addons.xcu b/librelogo/source/registry/data/org/openoffice/Office/Addons.xcu deleted file mode 100644 index 3f608d7302a1..000000000000 --- a/librelogo/source/registry/data/org/openoffice/Office/Addons.xcu +++ /dev/null @@ -1,286 +0,0 @@ - - - - - - - - - - - com.sun.star.text.TextDocument - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$goforward?language=Python&location=user:uno_packages - - - Forward - - - _self - - - - - com.sun.star.text.TextDocument - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$gobackward?language=Python&location=user:uno_packages - - - Back - - - _self - - - - - com.sun.star.text.TextDocument - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$left?language=Python&location=user:uno_packages - - - Left - - - _self - - - - - com.sun.star.text.TextDocument - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$right?language=Python&location=user:uno_packages - - - Right - - - _self - - - - - com.sun.star.text.TextDocument - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$run?language=Python&location=user:uno_packages - - - Start (the program in the Writer document) - - - _self - - - - - com.sun.star.text.TextDocument - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$stop?language=Python&location=user:uno_packages - - - Stop - - - _self - - - - - com.sun.star.text.TextDocument - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$home?language=Python&location=user:uno_packages - - - Home - - - _self - - - - - com.sun.star.text.TextDocument - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$clearscreen?language=Python&location=user:uno_packages - - - Clear screen - - - _self - - - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$commandline?language=Python&location=user:uno_packages - - - Logo command line (press F1 here for help) - - - _self - - - com.sun.star.text.TextDocument - - - Editfield - - - 300 - - - - - com.sun.star.text.TextDocument - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$__translate__?language=Python&location=user:uno_packages - - - Uppercase commands, also translate them to the language of the document - - - _self - - - - - - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$goforward?language=Python&location=user:uno_packages - - - - %origin%/icons/sc_arrowshapes.up-arrow.png - - - %origin%/icons/lc_arrowshapes.up-arrow.png - - - - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$gobackward?language=Python&location=user:uno_packages - - - - %origin%/icons/sc_arrowshapes.down-arrow.png - - - %origin%/icons/lc_arrowshapes.down-arrow.png - - - - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$left?language=Python&location=user:uno_packages - - - - %origin%/icons/sc_arrowshapes.circular-leftarrow.png - - - %origin%/icons/lc_arrowshapes.circular-leftarrow.png - - - - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$right?language=Python&location=user:uno_packages - - - - %origin%/icons/sc_arrowshapes.circular-arrow.png - - - %origin%/icons/lc_arrowshapes.circular-arrow.png - - - - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$run?language=Python&location=user:uno_packages - - - - %origin%/icons/sc_runbasic.png - - - %origin%/icons/lc_runbasic.png - - - - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$stop?language=Python&location=user:uno_packages - - - - %origin%/icons/sc_basicstop.png - - - %origin%/icons/lc_basicstop.png - - - - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$home?language=Python&location=user:uno_packages - - - - %origin%/icons/sc_navigationbarleft.png - - - %origin%/icons/lc_navigationbarleft.png - - - - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$clearscreen?language=Python&location=user:uno_packages - - - - %origin%/icons/sc_newdoc.png - - - %origin%/icons/lc_newdoc.png - - - - - - vnd.sun.star.script:librelogo.oxt|LibreLogo|LibreLogo.py$__translate__?language=Python&location=user:uno_packages - - - - %origin%/icons/sc_editglossary.png - - - %origin%/icons/lc_editglossary.png - - - - - - - - diff --git a/librelogo/source/registry/data/org/openoffice/Office/UI/StartModuleWindowState.xcu b/librelogo/source/registry/data/org/openoffice/Office/UI/StartModuleWindowState.xcu deleted file mode 100644 index 96e63938d634..000000000000 --- a/librelogo/source/registry/data/org/openoffice/Office/UI/StartModuleWindowState.xcu +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - Logo - - - false - - - false - - - - - diff --git a/librelogo/source/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu b/librelogo/source/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu deleted file mode 100644 index 8d87c561d0c2..000000000000 --- a/librelogo/source/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - Logo - - - false - - - false - - - - - diff --git a/officecfg/Configuration_officecfg.mk b/officecfg/Configuration_officecfg.mk index df9b30aa97a4..eec1221563b6 100644 --- a/officecfg/Configuration_officecfg.mk +++ b/officecfg/Configuration_officecfg.mk @@ -123,6 +123,7 @@ $(eval $(call gb_Configuration_add_spool_langpack,registry,officecfg/registry/da $(eval $(call gb_Configuration_add_localized_datas,registry,officecfg/registry/data,\ org/openoffice/Setup.xcu \ org/openoffice/Office/Accelerators.xcu \ + org/openoffice/Office/Addons.xcu \ org/openoffice/Office/Common.xcu \ org/openoffice/Office/SFX.xcu \ org/openoffice/Office/DataAccess.xcu \ diff --git a/officecfg/registry/data/org/openoffice/Office/Addons.xcu b/officecfg/registry/data/org/openoffice/Office/Addons.xcu new file mode 100644 index 000000000000..bd1326362736 --- /dev/null +++ b/officecfg/registry/data/org/openoffice/Office/Addons.xcu @@ -0,0 +1,286 @@ + + + + + + + + + + + com.sun.star.text.TextDocument + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$goforward?language=Python&location=share + + + Forward + + + _self + + + + + com.sun.star.text.TextDocument + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$gobackward?language=Python&location=share + + + Back + + + _self + + + + + com.sun.star.text.TextDocument + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$left?language=Python&location=share + + + Left + + + _self + + + + + com.sun.star.text.TextDocument + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$right?language=Python&location=share + + + Right + + + _self + + + + + com.sun.star.text.TextDocument + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$run?language=Python&location=share + + + Start (the program in the Writer document) + + + _self + + + + + com.sun.star.text.TextDocument + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$stop?language=Python&location=share + + + Stop + + + _self + + + + + com.sun.star.text.TextDocument + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$home?language=Python&location=share + + + Home + + + _self + + + + + com.sun.star.text.TextDocument + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$clearscreen?language=Python&location=share + + + Clear screen + + + _self + + + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$commandline?language=Python&location=share + + + Logo command line (press F1 here for help) + + + _self + + + com.sun.star.text.TextDocument + + + Editfield + + + 300 + + + + + com.sun.star.text.TextDocument + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$__translate__?language=Python&location=share + + + Uppercase commands, also translate them to the language of the document + + + _self + + + + + + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$goforward?language=Python&location=share + + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/sc_arrowshapes.up-arrow.png + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/lc_arrowshapes.up-arrow.png + + + + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$gobackward?language=Python&location=share + + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/sc_arrowshapes.down-arrow.png + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/lc_arrowshapes.down-arrow.png + + + + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$left?language=Python&location=share + + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/sc_arrowshapes.circular-leftarrow.png + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/lc_arrowshapes.circular-leftarrow.png + + + + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$right?language=Python&location=share + + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/sc_arrowshapes.circular-arrow.png + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/lc_arrowshapes.circular-arrow.png + + + + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$run?language=Python&location=share + + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/sc_runbasic.png + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/lc_runbasic.png + + + + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$stop?language=Python&location=share + + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/sc_basicstop.png + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/lc_basicstop.png + + + + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$home?language=Python&location=share + + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/sc_navigationbarleft.png + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/lc_navigationbarleft.png + + + + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$clearscreen?language=Python&location=share + + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/sc_newdoc.png + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/lc_newdoc.png + + + + + + vnd.sun.star.script:LibreLogo|LibreLogo.py$__translate__?language=Python&location=share + + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/sc_editglossary.png + + + vnd.sun.star.expand:$BRAND_BASE_DIR/share/Scripts/python/LibreLogo/icons/lc_editglossary.png + + + + + + + + diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu index 9db69aa701aa..da2fe9e52e12 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu @@ -720,6 +720,20 @@ true + + + Logo + + + false + + + false + + + false + + diff --git a/postprocess/packregistry/makefile.mk b/postprocess/packregistry/makefile.mk index 7061d801d2be..5877fe6f9c63 100644 --- a/postprocess/packregistry/makefile.mk +++ b/postprocess/packregistry/makefile.mk @@ -213,6 +213,7 @@ MY_FILES_main = \ $(MY_XCU)/Inet.xcu \ $(MY_XCU)/Interaction.xcu \ $(MY_XCU)/Office/Accelerators.xcu \ + $(MY_XCU)/Office/Addons.xcu \ $(MY_XCU)/Office/Calc.xcu \ $(MY_XCU)/Office/Canvas.xcu \ $(MY_XCU)/Office/Common.xcu \ diff --git a/scp2/source/python/file_python.scp b/scp2/source/python/file_python.scp index fc4db23883c1..3b05cfe1d398 100644 --- a/scp2/source/python/file_python.scp +++ b/scp2/source/python/file_python.scp @@ -136,6 +136,15 @@ File gid_File_Scripts_Python Name = "ScriptsPython.zip"; End +//LibreLogo turtle graphics + +File gid_File_LibreLogo + TXT_FILE_BODY; + Styles = (ARCHIVE); + Dir = gid_Dir_Share_Scripts; + Name = "LibreLogo.zip"; +End + // Scripting Framework Python configuration settings File gid_File_Share_Registry_Pyuno_Xcd diff --git a/scp2/source/python/module_python.scp b/scp2/source/python/module_python.scp index 629a864ad82a..b56305825c41 100644 --- a/scp2/source/python/module_python.scp +++ b/scp2/source/python/module_python.scp @@ -57,6 +57,7 @@ Module gid_Module_Optional_Pyuno gid_File_Lib_Python_So, gid_File_Lib_Python3_So, gid_File_Scripts_Python, + gid_File_LibreLogo, gid_File_Share_Registry_Pyuno_Xcd); Unixlinks = (gid_Unixlink_Python_Headers, gid_Unixlink_Python_LibreOfficePython, -- cgit