vcl/unx/gtk4/a11y.cxx | 32 ++++++++++++++++---------------- vcl/unx/gtk4/a11y.hxx | 24 ++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 16 deletions(-)
New commits: commit a4ccde0b12faad14836de9582f6f9afad95eaa6d Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Wed May 17 10:19:21 2023 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Wed May 17 15:46:58 2023 +0200 Silence loplugin:external and lopluign:unreffun in (WIP?) a11y.cxx for now Change-Id: Iea207bca4fee57e8c7dd5d307ccd42efc0dd2542 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151866 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx index 09526114cae5..33f1a97ff594 100644 --- a/vcl/unx/gtk4/a11y.cxx +++ b/vcl/unx/gtk4/a11y.cxx @@ -14,6 +14,8 @@ #include <unx/gtk/gtkframe.hxx> #include <gtk/gtk.h> +#include "a11y.hxx" + #if GTK_CHECK_VERSION(4, 9, 0) #define OOO_TYPE_FIXED (ooo_fixed_get_type()) @@ -156,8 +158,6 @@ static css::uno::Reference<css::accessibility::XAccessible> get_uno_accessible(G return pWindow->GetAccessible(); } -GType lo_accessible_get_type(); - #define LO_TYPE_ACCESSIBLE (lo_accessible_get_type()) #define LO_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LO_TYPE_ACCESSIBLE, LoAccessible)) // #define LO_IS_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LO_TYPE_ACCESSIBLE)) diff --git a/vcl/unx/gtk4/a11y.hxx b/vcl/unx/gtk4/a11y.hxx new file mode 100644 index 000000000000..0ae854737bd6 --- /dev/null +++ b/vcl/unx/gtk4/a11y.hxx @@ -0,0 +1,24 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#pragma once + +#include <gtk/gtk.h> + +//TODO: Silence various loplugin:external and lopluign:unreffun in (WIP?) a11y.cxx for now: +struct LoAccessible; +struct LoAccessibleClass; +struct OOoFixed; +struct OOoFixedClass; +static inline gpointer lo_accessible_get_instance_private(LoAccessible*); +GType lo_accessible_get_type(); +static inline gpointer ooo_fixed_get_instance_private(OOoFixed*); +GtkWidget* ooo_fixed_new(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ commit 1d40c4253ece649882b312139e47b65bdff8ab5a Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Wed May 17 10:04:15 2023 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Wed May 17 15:46:50 2023 +0200 Avoid loplugin:unreffun > vcl/unx/gtk4/a11y.cxx:295:1: error: redundant function redeclaration [loplugin:unreffun] > G_DEFINE_TYPE_WITH_CODE(LoAccessible, lo_accessible, G_TYPE_OBJECT, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /usr/include/glib-2.0/gobject/gtype.h:1730:56: note: expanded from macro 'G_DEFINE_TYPE_WITH_CODE' > #define G_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, 0) {_C_;} _G_DEFINE_TYPE_EXTENDED_END() > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /usr/include/glib-2.0/gobject/gtype.h:2213:3: note: expanded from macro '_G_DEFINE_TYPE_EXTENDED_BEGIN' > _G_DEFINE_TYPE_EXTENDED_BEGIN_PRE(TypeName, type_name, TYPE_PARENT) \ > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /usr/include/glib-2.0/gobject/gtype.h:2160:17: note: expanded from macro '_G_DEFINE_TYPE_EXTENDED_BEGIN_PRE' > static void type_name##_class_init (TypeName##Class *klass); \ > ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > <scratch space>:47:1: note: expanded from here > lo_accessible_class_init > ^ > vcl/unx/gtk4/a11y.cxx:236:13: note: previous declaration is here [loplugin:unreffun] > static void lo_accessible_class_init(LoAccessibleClass* klass) > ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I22bad5cf5e546d3a4dff4c1de3b3bb06638d1200 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151865 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx index be0c3904783a..09526114cae5 100644 --- a/vcl/unx/gtk4/a11y.cxx +++ b/vcl/unx/gtk4/a11y.cxx @@ -233,20 +233,6 @@ static void lo_accessible_set_property(GObject* object, guint property_id, const } } -static void lo_accessible_class_init(LoAccessibleClass* klass) -{ - GObjectClass* object_class = G_OBJECT_CLASS(klass); - - // object_class->finalize = lo_accessible_finalize; - // object_class->dispose = lo_accessible_dispose; - object_class->get_property = lo_accessible_get_property; - object_class->set_property = lo_accessible_set_property; - // object_class->constructed = lo_accessible_constructed; - - // g_object_class_install_properties(object_class, LAST_CHILD_PROP, lo_accessible_props); - g_object_class_override_property(object_class, PROP_ACCESSIBLE_ROLE, "accessible-role"); -} - static GtkAccessible* lo_accessible_get_accessible_parent(GtkAccessible* accessible) { LoAccessible* lo_accessible = LO_ACCESSIBLE(accessible); @@ -295,6 +281,20 @@ static void lo_accessible_accessible_init(GtkAccessibleInterface* iface) G_DEFINE_TYPE_WITH_CODE(LoAccessible, lo_accessible, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE(GTK_TYPE_ACCESSIBLE, lo_accessible_accessible_init)) +static void lo_accessible_class_init(LoAccessibleClass* klass) +{ + GObjectClass* object_class = G_OBJECT_CLASS(klass); + + // object_class->finalize = lo_accessible_finalize; + // object_class->dispose = lo_accessible_dispose; + object_class->get_property = lo_accessible_get_property; + object_class->set_property = lo_accessible_set_property; + // object_class->constructed = lo_accessible_constructed; + + // g_object_class_install_properties(object_class, LAST_CHILD_PROP, lo_accessible_props); + g_object_class_override_property(object_class, PROP_ACCESSIBLE_ROLE, "accessible-role"); +} + static LoAccessible* lo_accessible_new(GdkDisplay* pDisplay, GtkAccessible* pParent, const css::uno::Reference<css::accessibility::XAccessible>& rAccessible)