#!/usr/bin/env python3 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-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/. # """ Script to generate LibreOffice bash_completion file for the main applications """ import argparse import sys MASTERDOCS = ["sxg", "odm", "sgl"] BASEDOCS = ["odb"] CALCDOCS = ["sxc", "stc", "dif", "dbf", "xls", "xlw", "xlt", "rtf", "sdc", "vor", "slk", "txt", "htm", "html", "wk1", "wks", "123", "xml", "ods", "ots", "fods", "csv", "xlsb", "xlsm", "xlsx", "xltm", "xltx"] DRAWDOCS = ["sxd", "std", "dxf", "emf", "eps", "met", "pct", "sgf", "sgv", "sda", "sdd", "vor", "svm", "wmf", "bmp", "gif", "jpg", "jpeg", "jfif", "fif", "jpe", "pcd", "pcx", "pgm", "png", "ppm", "psd", "ras", "tga", "tif", "tiff", "xbm", "xpm", "odg", "otg", "fodg", "odc", "odi", "sds", "wpg", "svg", "vdx", "vsd", "vsdm", "vsdx"] IMPRESSDOCS = ["sxi", "sti", "ppt", "pps", "pot", "sxd", "sda", "sdd", "sdp", "vor", "cgm", "odp", "otp", "fodp", "ppsm", "ppsx", "pptm", "pptx", "potm", "potx"] MATHDOCS = ["sxm", "smf", "mml", "odf"] WEBDOCS = ["htm", "html", "stw", "txt", "vor", "oth"] WRITERDOCS = ["doc", "dot", "rtf", "sxw", "stw", "sdw", "vor", "txt", "htm?", "xml", "wp", "wpd", "wps", "odt", "ott", "fodt", "docm", "docx", "dotm", "dotx"] TEMPLATES = ["stw", "dot", "vor", "stc", "xlt", "sti", "pot", "std", "stw", "dotm", "dotx", "potm", "potx", "xltm", "xltx"] ALLDOCS = MASTERDOCS + BASEDOCS + CALCDOCS + DRAWDOCS + IMPRESSDOCS + MATHDOCS + WEBDOCS + WRITERDOCS + TEMPLATES EXTENSIONS = ["oxt"] class App(object): def __init__(self, name, compat_name, suffix_list): self.name = name self.compat_name = compat_name self.suffix_list = suffix_list class SetAppCompatName(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): setattr(namespace, self.dest, True) for app in APPS.values(): app.name = app.compat_name class SetAppName(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): APPS[self.dest].name = values # default names of lowrappers # use "" for name if you want to disable any wrapper APPS = { 'office': App("libreoffice", 'openoffice', ALLDOCS), # libreoffice should contain all 'office_short': App("loffice", 'ooffice', ALLDOCS), # libreoffice should contain all 'master': App("", '', MASTERDOCS), 'base': App("lobase", 'oobase', BASEDOCS), 'calc': App("localc", 'oocalc', CALCDOCS), 'draw': App("lodraw", 'oodraw', DRAWDOCS), 'impress': App("loimpress", 'ooimpress', IMPRESSDOCS), 'math': App("lomath", 'oomath', MATHDOCS), 'template': App("lofromtemplate", 'oofromtemplate', TEMPLATES), 'unopkg': App("unopkg", 'unopkg', EXTENSIONS), # unopkg is a standalone tool 'web': App("loweb", 'ooweb', WEBDOCS), 'writer': App("lowriter", 'oowriter', WRITERDOCS + MASTERDOCS) } def check_open(filename, mode): try: with open(filename, mode): pass except OSError as e: mode = 'reading' if mode == 'r' else 'writing' sys.exit("Error: can't open %s for %s: %s" % (filename, mode, e)) def print_app_suffixes_check(out, app): if not app.suffix_list: sys.exit('Error: No suffix defined for %s' % app.name) suffix_str = '|'.join(['%s|%s' % (s, s.upper()) for s in app.suffix_list]) out.write(" %s)\t\te=\'!*.+(%s)\' ;;\n" % (app.name, suffix_str)) def print_suffixes_check(out): for app in APPS.values(): if not app.name: # skip the disabled wrapper continue print_app_suffixes_check(out, app) def main(): parser = argparse.ArgumentParser(description='Script to Generate bash completion for LO wrappers', epilog='The other options allows to redefine the wrapper names.\n' 'The value "" can be used to disable any wrapper.', formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('input_file') parser.add_argument('output_file') parser.add_argument('--binsuffix', metavar='suffix', help='defines a suffix that is added after each wrapper') parser.add_argument('--compat-oowrappers', metavar='', nargs=0, action=SetAppCompatName, default=False, help='set wrapper names to the old default oo* wrapper names') for app in APPS: parser.add_argument('--%s' % app, metavar='wrapper_name', action=SetAppName) args = parser.parse_args() check_open(args.input_file, 'r') check_open(args.output_file, 'w') # add binsuffix if args.binsuffix: for app in APPS.values(): if app.name: app.name += args.binsuffix if args.compat_oowrappers: office_shell_function = '_ooexp_' else: office_shell_function = '_loexp_' # the last app will be printed without the final backslash apps_to_print = ' \\\n'.join(['\t\t\t\t\t%s' % app.name for app in APPS.values() if app.name]) with open(args.input_file, 'r') as in_fh, open(args.output_file, 'w') as out_fh: for line in in_fh: line = line.replace('@OFFICE_SHELL_FUNCTION@', office_shell_function) if '@BASH_COMPLETION_SUFFIXES_CHECKS@' in line: print_suffixes_check(out_fh) elif '@BASH_COMPLETION_OOO_APPS@' in line: if not apps_to_print: sys.exit('Error: No LO wrapper was selected') out_fh.write('%s\n' % apps_to_print) else: out_fh.write(line) if __name__ == '__main__': main() # vim: set shiftwidth=4 softtabstop=4 expandtab: eoffice-7-3+backports'>distro/lhm/libreoffice-7-3+backports LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/sfx2/source/sidebar/SidebarDockingWindow.cxx
AgeCommit message (Collapse)Author
2019-08-06LOK: sd: fix unit-tests and add a couple simple onesAshod Nakashian
Change-Id: I6b8f13bf9cb609a86b85135ceb96f865451b59ac Reviewed-on: https://gerrit.libreoffice.org/77071 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-08-02-Werror,-Wunused-private-fieldStephan Bergmann
Change-Id: Icdb749d46249ea29badbe523320b17312e077684 Reviewed-on: https://gerrit.libreoffice.org/76811 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-01LOK: support sidebars in writer and calcAshod Nakashian
[ Miklos: added code to release LOK notifiers in SfxWorkWindow::DeleteControllers_Impl() during shutdown. ] Reviewed-on: https://gerrit.libreoffice.org/71843 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com> (cherry picked from commit 5ddf630222241bec4deda56d10992c35ae4efe06) Change-Id: I3a3bd1fb6922e435599f604328f558be60594729 Reviewed-on: https://gerrit.libreoffice.org/76556 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-26sfx: LOK: notify clients of the sidebar stateAshod Nakashian
Change-Id: I35b174c3a5e302ce52ee4063fa71d47feffab624 Reviewed-on: https://gerrit.libreoffice.org/73520 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-26LOK: sidebar: publish notifications to the correct viewAshod Nakashian
The ViewShell, which represents the view in question and therefore which view gets the window notifications, is incorrect when the sidebar is first created upon creating/attaching a new view. This leads us to a workaround to make sure that we publish notifications to the correct view. We also have to hide the sidebar instead of closing because the workaround wouldn't work when re-creating the sidebar on an existing view. See comments in code. Change-Id: I9d3be901688291b04d634b68e1e20c7add77381f Reviewed-on: https://gerrit.libreoffice.org/73516 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-26LOK: sidebar: release LOKNotifier on destructionAshod Nakashian
And enable sidebar routing only while we have a valid SidebarController instance (i.e. not disposed). Change-Id: I665f934f762c0ce9efdce5489ec9babe006376a8 Reviewed-on: https://gerrit.libreoffice.org/73512 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-26LOK: sidebar: enable only for Impress in LOKAshod Nakashian
Change-Id: Idb361164db9ea8681b45fe99608d2cb5690db161 Reviewed-on: https://gerrit.libreoffice.org/73511 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-26LOK: sidebar: send close notification on disposing sidebarAshod Nakashian
Change-Id: Ia8f197d07ba4b6a089571e9ca23b4697d04e7734 Reviewed-on: https://gerrit.libreoffice.org/73510 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-26sfx2: LOK: route the parent sidebar window instead of the deckAshod Nakashian
Change-Id: I0269a67c637afbc63a81405918f620009e681ff6 Reviewed-on: https://gerrit.libreoffice.org/73508 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-30Don't pass escape key event to SfxDockingWindow from sidebarJim Raykowski
...docking window Missed this in recent rework concerning key input events in SidebarDockingWindow, tdf#125525 Allow shortcut keys from sidebar docking window. Change-Id: I53906251918874d2613795cb06a3e6ef07509bd8 Reviewed-on: https://gerrit.libreoffice.org/73192 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2019-05-28tdf#125525 Allow shortcut keys from sidebar docking windowJim Raykowski
Fix for tdf#115434 prevents key presses being passed through to document window from the sidebar docking window. This patch only prevents left, right, down, up, page down/up, home, end, backspace, delete, insert and return keys from being passed. Change-Id: I97ab60a214cb9910f526a475f3134784728b7d9a Reviewed-on: https://gerrit.libreoffice.org/73073 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2019-04-05tdf#42949 Fix IWYU warnings in include/sfx2/sidebar/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ic2bd25bcbcc7f5fb6e29ced70fddb74385b5fb2f Reviewed-on: https://gerrit.libreoffice.org/70077 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-25tdf#42949 Fix IWYU warnings in include/sfx2/[a-D]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I444cb71bc3d045072a4b1f9eed279ed7e425a0d4 Reviewed-on: https://gerrit.libreoffice.org/69481 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-12-20tdf#42949 Fix IWYU warnings in include/vcl/[t-u]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib32ea54a3fa690a0722fa75ddb4121ec78c0b64f Reviewed-on: https://gerrit.libreoffice.org/65386 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-10-28Fix Sidebar docking key regressionJim Raykowski
Add back Ctrl+Shift+F10 undocking/docking handling. This regression was introduced by me in tdf#115434 Fix key press misbehaviors in sidebar. Change-Id: I29a563b2eb96be8a6b346454fddc1605dbc4aba6 Reviewed-on: https://gerrit.libreoffice.org/62268 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2018-10-10Unhardcode sidebar used customizable key bindingsJim Raykowski
Change-Id: Ia3bc171e2c9805955394fac274de382c3f87d35f Reviewed-on: https://gerrit.libreoffice.org/61564 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-05tdf#85850 Pass CTRL+F5 event in sidebar to parent classesJim Raykowski
Change-Id: I86e1fba17402d0a5f06d7942cf0733b0f2c924ba Reviewed-on: https://gerrit.libreoffice.org/61276 Tested-by: Jenkins Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com> Tested-by: Heiko Tietze <tietze.heiko@gmail.com>
2018-08-29tdf#102031 Expand collapsed deck when sidebar docking window gets focusJim Raykowski
SidebarDockingWindow::GetFocus hides focus when deck is in collapsed state so request open deck before setting focus to deck/panel title Change-Id: I7d7f6d940a3722eb02e6356c069c4d9df9642326 Reviewed-on: https://gerrit.libreoffice.org/58712 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-06-19tdf#101915 make F11 close the sidebar when focus is in sidebarJim Raykowski
...style list panel Change-Id: I034ba4310cd0942aad0a2e6f807213e14327e7b4 Reviewed-on: https://gerrit.libreoffice.org/55969 Reviewed-by: V Stuart Foote <vstuart.foote@utsa.edu> Tested-by: Jenkins Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com> Tested-by: Heiko Tietze <tietze.heiko@gmail.com>
2018-05-03coverity#1435275 Uninitialized scalar fieldCaolán McNamara
Change-Id: I5a488d11565166c4143bd8992f40cb776906cb2b Reviewed-on: https://gerrit.libreoffice.org/53804 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-04-28Enable undocking of sidebar by dragging a deck gripKatarina Behrens
Change-Id: I59d15b4c61045bfd97dd937e6f383652db33fd8f Reviewed-on: https://gerrit.libreoffice.org/53496 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2018-04-24Prep mouse event handler to indicate dragging startedKatarina Behrens
Change-Id: Icdb865e511047b166767ca9e87e808c308ad7643 Reviewed-on: https://gerrit.libreoffice.org/53324 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2018-03-29tdf#116680 fix sidebar can't undockJim Raykowski
Change-Id: Ic3d198488de6d0420dbdb8fb7dbfb0335556e108 Reviewed-on: https://gerrit.libreoffice.org/52047 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-27tdf#115786: Fix reopening undocked sidebarKatarina Behrens
while trying hard to keep tdf#88241 fixed. Had to introduce yet another bool variable as now that previously active sidebar deck is remembered (= it is visible when floating window opens) it's impossible to tell whether sidebar was already opened or not Change-Id: If2c9edfa2f9beb400537b106d3094f256b0cc183 Reviewed-on: https://gerrit.libreoffice.org/51866 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2018-02-05tdf#115434 Fix key press misbehaviors in sidebarJim Raykowski
This patch also is for tdf#98505 and tdf#84657 Change-Id: I6bc125ace035b2c8126f013a63bcc9498b06e08c Reviewed-on: https://gerrit.libreoffice.org/49219 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>