Kaydet (Commit) 0f972e94 authored tarafından Mathias Hasselmann's avatar Mathias Hasselmann Kaydeden (comit) Caolán McNamara

Show LibreOffice controls in Glade's tool palette

Glade didn't show any LibreOffice controls in its tool palette
because the catalog didn't have any glade-widget-group element.
This adds a XSLT script to automatically generate such element.

A better version of the script would create separate groups for
each module/namespace, but currently I have no idea how to do
this with libxslt, as it doesn't provide fn::distinct-values().

Change-Id: Iaa3e4b0471b58c48838e000e6d78a73b0c6a4bd3
Reviewed-on: https://gerrit.libreoffice.org/2724Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst d6e752d5
# -*- 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,extras/glade))
#
# Rules
#
$(call gb_CustomTarget_get_workdir,extras/source/glade)/libreoffice-catalog.xml : \
$(SRCDIR)/extras/source/glade/libreoffice-catalog.xml.in \
$(SRCDIR)/extras/source/glade/makewidgetgroup.xslt \
| $(call gb_ExternalExecutable_get_dependencies,xsltproc)
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),XSLT,4)
$(call gb_Helper_abbreviate_dirs, \
$(call gb_ExternalExecutable_get_command,xsltproc) --nonet \
-o $@ $(SRCDIR)/extras/source/glade/makewidgetgroup.xslt $< \
)
# vim: set noet sw=4 ts=4:
......@@ -12,6 +12,7 @@ $(eval $(call gb_Module_Module,extras))
$(eval $(call gb_Module_add_targets,extras,\
AllLangZip_autotextshare \
CustomTarget_autocorr \
CustomTarget_glade \
Package_fonts \
Package_glade \
Package_labels \
......
......@@ -7,7 +7,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_Package_Package,extras_glade,$(SRCDIR)/extras/source/glade))
$(eval $(call gb_Package_Package,extras_glade,$(call gb_CustomTarget_get_workdir,extras/source/glade)))
$(eval $(call gb_Package_add_file,extras_glade,pck/libreoffice-catalog.xml,libreoffice-catalog.xml))
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
* 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8"/>
<!-- work arround apparently broken output indenting in libxslt -->
<xsl:param name="indent" select="' '"/>
<xsl:template match="/glade-catalog">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<xsl:text>&#10;</xsl:text>
<xsl:value-of select="$indent"/>
<glade-widget-group name="libreoffice" title="LibreOffice">
<xsl:text>&#10;</xsl:text>
<xsl:for-each select="//glade-widget-class">
<xsl:value-of select="concat($indent,$indent)"/>
<glade-widget-class-ref name="{@name}"/>
<xsl:text>&#10;</xsl:text>
</xsl:for-each>
<xsl:value-of select="$indent"/>
</glade-widget-group>
<xsl:text>&#10;</xsl:text>
</xsl:copy>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
</xsl:template>
</xsl:stylesheet>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment