Back to index

unity  6.0.0
DebugDBusInterface.h
Go to the documentation of this file.
00001 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
00002 /*
00003  * Copyright (C) 2010 Canonical Ltd
00004  *
00005  * This program is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License version 3 as
00007  * published by the Free Software Foundation.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  *
00017  * Authored by: Alex Launi <alex.launi@canonical.com>
00018  */
00019 
00020 #include <gio/gio.h>
00021 
00022 #ifndef _DEBUG_DBUS_INTERFACE_H
00023 #define _DEBUG_DBUS_INTERFACE_H
00024 
00025 class CompScreen;
00026 
00027 namespace unity
00028 {
00029 extern const std::string DBUS_BUS_NAME;
00030 
00031 namespace debug
00032 {
00033 class Introspectable;
00034 std::list<Introspectable*> GetIntrospectableNodesFromQuery(std::string const& query, Introspectable *tree_root);
00035 
00036 class DebugDBusInterface
00037 {
00038 public:
00039   DebugDBusInterface(Introspectable* introspectable);
00040   ~DebugDBusInterface();
00041 
00042 private:
00043   /* methods */
00044   static void OnBusAcquired(GDBusConnection* connection, const gchar* name, gpointer data);
00045   static void OnNameAcquired(GDBusConnection* connection, const gchar* name, gpointer data);
00046   static void OnNameLost(GDBusConnection* connection, const gchar* name, gpointer data);
00047   static void HandleDBusMethodCall(GDBusConnection* connection,
00048                                    const gchar* sender,
00049                                    const gchar* object_path,
00050                                    const gchar* interface_name,
00051                                    const gchar* method_name,
00052                                    GVariant* parameters,
00053                                    GDBusMethodInvocation* invocation,
00054                                    gpointer user_data);
00055   static const char* DBUS_DEBUG_OBJECT_PATH;
00056   static const gchar introspection_xml[];
00057   static GDBusInterfaceVTable interface_vtable;
00058 
00059   static GVariant* BuildFakeReturn();
00060 
00061   /* members */
00062   guint           _owner_id;
00063 };
00064 }
00065 }
00066 
00067 #endif /* _DEBUG_DBUS_INTERFACE_H */