[glibmm] Gio: Derive all interfaces directly from Glib::Interface
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] Gio: Derive all interfaces directly from Glib::Interface
- Date: Tue, 25 Jul 2017 16:48:11 +0000 (UTC)
commit 9eacb8ca7b3a7c5600fea6abdd018ab980c2163b
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Tue Jul 25 18:45:58 2017 +0200
Gio: Derive all interfaces directly from Glib::Interface
* gio/src/dbusactiongroup.hg: Implement ActionGroup.
* gio/src/fileicon.hg: Implement Icon.
* gio/src/loadableicon.[ccg|hg]:
* gio/src/networkmonitor.hg:
* gio/src/remoteactiongroup.hg: Derive directly from Glib::Interface.
* gio/src/pollableinputstream.hg:
* gio/src/pollableoutputstream.hg: Fix a comment.
A subclass of GInterface can't be derived from another subclass of GInterface.
Correspondingly, an interface in glibmm shall be derived directly from
Glib::Interface, and not from a subclass of Glib::Interface. Bug 776537
gio/src/dbusactiongroup.hg | 3 ++-
gio/src/fileicon.hg | 5 ++---
gio/src/loadableicon.ccg | 1 -
gio/src/loadableicon.hg | 11 ++++-------
gio/src/networkmonitor.hg | 8 ++++----
gio/src/pollableinputstream.hg | 9 +++++----
gio/src/pollableoutputstream.hg | 9 +++++----
gio/src/remoteactiongroup.hg | 10 ++++------
8 files changed, 26 insertions(+), 30 deletions(-)
---
diff --git a/gio/src/dbusactiongroup.hg b/gio/src/dbusactiongroup.hg
index ecd72ad..991e106 100644
--- a/gio/src/dbusactiongroup.hg
+++ b/gio/src/dbusactiongroup.hg
@@ -39,9 +39,10 @@ _GMMPROC_EXTRA_NAMESPACE(DBus)
* @newin{2,32}
*/
class ActionGroup
-: public Glib::Object, public Gio::RemoteActionGroup
+: public Glib::Object, public Gio::ActionGroup, public Gio::RemoteActionGroup
{
_CLASS_GOBJECT(ActionGroup, GDBusActionGroup, G_DBUS_ACTION_GROUP, Glib::Object, GObject)
+ _IMPLEMENTS_INTERFACE(Gio::ActionGroup)
_IMPLEMENTS_INTERFACE(Gio::RemoteActionGroup)
protected:
diff --git a/gio/src/fileicon.hg b/gio/src/fileicon.hg
index 35d1a7a..f3ac97a 100644
--- a/gio/src/fileicon.hg
+++ b/gio/src/fileicon.hg
@@ -1,5 +1,3 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
/* Copyright (C) 2007 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
@@ -34,10 +32,11 @@ namespace Gio
*/
class FileIcon
: public Glib::Object,
- //Already derived by LoadableIcon: public Icon,
+ public Icon,
public LoadableIcon
{
_CLASS_GOBJECT(FileIcon, GFileIcon, G_FILE_ICON, Glib::Object, GObject)
+ _IMPLEMENTS_INTERFACE(Icon)
_IMPLEMENTS_INTERFACE(LoadableIcon)
protected:
diff --git a/gio/src/loadableicon.ccg b/gio/src/loadableicon.ccg
index 9ccc741..f39c6e4 100644
--- a/gio/src/loadableicon.ccg
+++ b/gio/src/loadableicon.ccg
@@ -19,7 +19,6 @@
#include <gio/gio.h>
#include <glibmm/error.h>
-#include <giomm/private/icon_p.h>
#include "slot_async.h"
namespace Gio
diff --git a/gio/src/loadableicon.hg b/gio/src/loadableicon.hg
index 134d93e..a49b8c2 100644
--- a/gio/src/loadableicon.hg
+++ b/gio/src/loadableicon.hg
@@ -1,5 +1,3 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
/* Copyright (C) 2007 The giomm Development Team
*
* This library is free software; you can redistribute it and/or
@@ -17,12 +15,11 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <giomm/icon.h>
+#include <glibmm/interface.h>
#include <giomm/inputstream.h>
-#include <giomm/icon.h>
_DEFS(giomm,gio)
-_PINCLUDE(giomm/private/icon_p.h)
+_PINCLUDE(glibmm/private/interface_p.h)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GLoadableIconIface GLoadableIconIface;
@@ -35,9 +32,9 @@ namespace Gio
*
* @newin{2,16}
*/
-class LoadableIcon : public Icon
+class LoadableIcon : public Glib::Interface
{
- _CLASS_INTERFACE(LoadableIcon, GLoadableIcon, G_LOADABLE_ICON, GLoadableIconIface, Icon, GIcon)
+ _CLASS_INTERFACE(LoadableIcon, GLoadableIcon, G_LOADABLE_ICON, GLoadableIconIface)
public:
/**
diff --git a/gio/src/networkmonitor.hg b/gio/src/networkmonitor.hg
index ca84559..df55fda 100644
--- a/gio/src/networkmonitor.hg
+++ b/gio/src/networkmonitor.hg
@@ -15,14 +15,14 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <giomm/initable.h>
+#include <glibmm/interface.h>
#include <giomm/asyncresult.h>
#include <giomm/cancellable.h>
#include <giomm/socketconnectable.h>
#include <gio/gio.h>
_DEFS(giomm,gio)
-_PINCLUDE(giomm/private/initable_p.h)
+_PINCLUDE(glibmm/private/interface_p.h)
_PINCLUDE(gio/gio.h)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -39,9 +39,9 @@ _WRAP_ENUM(NetworkConnectivity, GNetworkConnectivity, NO_GTYPE)
*
* @newin{2,44}
*/
-class NetworkMonitor : public Initable
+class NetworkMonitor : public Glib::Interface
{
- _CLASS_INTERFACE(NetworkMonitor, GNetworkMonitor, G_NETWORK_MONITOR, GNetworkMonitorInterface, Initable,
GInitable)
+ _CLASS_INTERFACE(NetworkMonitor, GNetworkMonitor, G_NETWORK_MONITOR, GNetworkMonitorInterface)
public:
_WRAP_METHOD(static Glib::RefPtr<NetworkMonitor> get_default(), g_network_monitor_get_default, newin
"2,44")
diff --git a/gio/src/pollableinputstream.hg b/gio/src/pollableinputstream.hg
index ada354d..9c5aa21 100644
--- a/gio/src/pollableinputstream.hg
+++ b/gio/src/pollableinputstream.hg
@@ -30,10 +30,11 @@ namespace Gio
class Cancellable;
-// GPollableInputStream requires GInputStream, but Gio::PollableInputStream
-// can't be derived from Gio::InputStream, because Gio::InputStream is a
-// Glib::Object. Gio::LoadableIcon is a different case. It can be derived from
-// Gio::Icon, because both are interfaces.
+// GPollableInputStream requires GInputStream (a GObject), but Gio::PollableInputStream
+// shall not be derived from Gio::InputStream, like the Gio::Tls[Client|Server]Connection
+// interfaces are derived from Gio::TlsConnection. The unusual Gio::TlsConnection class
+// hierarchy is possible only because no subclass of Glib::Object implements
+// Gio::Tls[Client|Server]Connection.
// See https://bugzilla.gnome.org/show_bug.cgi?id=776537
/** PollableInputStream - Interface for pollable input streams.
diff --git a/gio/src/pollableoutputstream.hg b/gio/src/pollableoutputstream.hg
index 23a127c..881a92d 100644
--- a/gio/src/pollableoutputstream.hg
+++ b/gio/src/pollableoutputstream.hg
@@ -30,10 +30,11 @@ namespace Gio
class Cancellable;
-// GPollableOutputStream requires GOutputStream, but Gio::PollableOutputStream
-// can't be derived from Gio::OutputStream, because Gio::OutputStream is a
-// Glib::Object. Gio::LoadableIcon is a different case. It can be derived from
-// Gio::Icon, because both are interfaces.
+// GPollableOutputStream requires GOutputStream (a GObject), but Gio::PollableOutputStream
+// shall not be derived from Gio::OutputStream, like the Gio::Tls[Client|Server]Connection
+// interfaces are derived from Gio::TlsConnection. The unusual Gio::TlsConnection class
+// hierarchy is possible only because no subclass of Glib::Object implements
+// Gio::Tls[Client|Server]Connection.
// See https://bugzilla.gnome.org/show_bug.cgi?id=776537
/** PollableOutputStream - Interface for pollable output streams.
diff --git a/gio/src/remoteactiongroup.hg b/gio/src/remoteactiongroup.hg
index 57ec71d..74d094e 100644
--- a/gio/src/remoteactiongroup.hg
+++ b/gio/src/remoteactiongroup.hg
@@ -1,5 +1,3 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
/* Copyright (C) 2012 The giomm Development Team
*
* This library is free software; you can redistribute it and/or
@@ -17,10 +15,10 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <giomm/actiongroup.h>
+#include <glibmm/interface.h>
_DEFS(giomm,gio)
-_PINCLUDE(giomm/private/actiongroup_p.h)
+_PINCLUDE(glibmm/private/interface_p.h)
_PINCLUDE(gio/gio.h)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -51,9 +49,9 @@ namespace Gio
* platform data for action invocations that arrive by way of D-Bus.
* @newin{2,32}
*/
-class RemoteActionGroup : public ActionGroup
+class RemoteActionGroup : public Glib::Interface
{
- _CLASS_INTERFACE(RemoteActionGroup, GRemoteActionGroup, G_REMOTE_ACTION_GROUP,
GRemoteActionGroupInterface, ActionGroup, GActionGroup)
+ _CLASS_INTERFACE(RemoteActionGroup, GRemoteActionGroup, G_REMOTE_ACTION_GROUP, GRemoteActionGroupInterface)
public:
_WRAP_METHOD(void activate_action(const Glib::ustring& action_name, const Glib::VariantBase& parameter,
const Glib::VariantBase& platform_data), g_remote_action_group_activate_action_full)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]