aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am23
-rw-r--r--tests/dummy-indicator-entry-func.c123
2 files changed, 145 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f11a9d1..9d16748 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -14,7 +14,8 @@ lib_LTLIBRARIES = \
libdummy-indicator-blank.la \
libdummy-indicator-null.la \
libdummy-indicator-signaler.la \
- libdummy-indicator-simple.la
+ libdummy-indicator-simple.la \
+ libdummy-indicator-entry-func.la
DBUS_RUNNER=dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf
XVFB_RUN=". $(srcdir)/run-xvfb.sh"
@@ -162,6 +163,26 @@ libdummy_indicator_simple_la_LDFLAGS = \
-avoid-version
#############################
+# Dummy Indicator Entry Func
+#############################
+
+libdummy_indicator_entry_func_la_SOURCES = \
+ dummy-indicator-entry-func.c
+
+libdummy_indicator_entry_func_la_CFLAGS = \
+ -Wall -Werror \
+ $(LIBINDICATOR_CFLAGS) -I$(top_srcdir)
+
+libdummy_indicator_entry_func_la_LIBADD = \
+ $(LIBINDICATOR_LIBS) \
+ -L$(top_builddir)/libindicator/.libs \
+ $(INDICATOR_LIB)
+
+libdummy_indicator_entry_func_la_LDFLAGS = \
+ -module \
+ -avoid-version
+
+#############################
# Service Shutdown Timeout
#############################
diff --git a/tests/dummy-indicator-entry-func.c b/tests/dummy-indicator-entry-func.c
new file mode 100644
index 0000000..7271e86
--- /dev/null
+++ b/tests/dummy-indicator-entry-func.c
@@ -0,0 +1,123 @@
+/*
+Test for libindicator
+
+Copyright 2012 Canonical Ltd.
+
+Authors:
+ Ted Gould <ted@canonical.com>
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+version 3.0 as published by the Free Software Foundation.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License version 3.0 for more details.
+
+You should have received a copy of the GNU General Public
+License along with this library. If not, see
+<http://www.gnu.org/licenses/>.
+*/
+
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include "libindicator/indicator.h"
+#include "libindicator/indicator-object.h"
+
+#define DUMMY_INDICATOR_ENTRY_FUNC_TYPE (dummy_indicator_entry_func_get_type ())
+#define DUMMY_INDICATOR_ENTRY_FUNC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DUMMY_INDICATOR_ENTRY_FUNC_TYPE, DummyIndicatorEntryFunc))
+#define DUMMY_INDICATOR_ENTRY_FUNC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DUMMY_INDICATOR_ENTRY_FUNC_TYPE, DummyIndicatorEntryFuncClass))
+#define IS_DUMMY_INDICATOR_ENTRY_FUNC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DUMMY_INDICATOR_ENTRY_FUNC_TYPE))
+#define IS_DUMMY_INDICATOR_ENTRY_FUNC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DUMMY_INDICATOR_ENTRY_FUNC_TYPE))
+#define DUMMY_INDICATOR_ENTRY_FUNC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DUMMY_INDICATOR_ENTRY_FUNC_TYPE, DummyIndicatorEntryFuncClass))
+
+typedef struct _DummyIndicatorEntryFunc DummyIndicatorEntryFunc;
+typedef struct _DummyIndicatorEntryFuncClass DummyIndicatorEntryFuncClass;
+
+struct _DummyIndicatorEntryFuncClass {
+ IndicatorObjectClass parent_class;
+};
+
+struct _DummyIndicatorEntryFunc {
+ IndicatorObject parent;
+};
+
+GType dummy_indicator_entry_func_get_type (void);
+
+INDICATOR_SET_VERSION
+INDICATOR_SET_TYPE(DUMMY_INDICATOR_ENTRY_FUNC_TYPE)
+
+
+GtkLabel *
+get_label (IndicatorObject * io)
+{
+ return NULL;
+}
+
+GtkImage *
+get_icon (IndicatorObject * io)
+{
+ return NULL;
+}
+
+GtkMenu *
+get_menu (IndicatorObject * io)
+{
+ return NULL;
+}
+const gchar *
+get_accessible_desc (IndicatorObject * io)
+{
+ return NULL;
+}
+
+static void dummy_indicator_entry_func_class_init (DummyIndicatorEntryFuncClass *klass);
+static void dummy_indicator_entry_func_init (DummyIndicatorEntryFunc *self);
+static void dummy_indicator_entry_func_dispose (GObject *object);
+static void dummy_indicator_entry_func_finalize (GObject *object);
+
+G_DEFINE_TYPE (DummyIndicatorEntryFunc, dummy_indicator_entry_func, INDICATOR_OBJECT_TYPE);
+
+static void
+dummy_indicator_entry_func_class_init (DummyIndicatorEntryFuncClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->dispose = dummy_indicator_entry_func_dispose;
+ object_class->finalize = dummy_indicator_entry_func_finalize;
+
+ IndicatorObjectClass * io_class = INDICATOR_OBJECT_CLASS(klass);
+
+ io_class->get_label = get_label;
+ io_class->get_image = get_icon;
+ io_class->get_menu = get_menu;
+ io_class->get_accessible_desc = get_accessible_desc;
+
+ return;
+}
+
+static void
+dummy_indicator_entry_func_init (DummyIndicatorEntryFunc *self)
+{
+
+ return;
+}
+
+static void
+dummy_indicator_entry_func_dispose (GObject *object)
+{
+
+ G_OBJECT_CLASS (dummy_indicator_entry_func_parent_class)->dispose (object);
+ return;
+}
+
+static void
+dummy_indicator_entry_func_finalize (GObject *object)
+{
+
+ G_OBJECT_CLASS (dummy_indicator_entry_func_parent_class)->finalize (object);
+ return;
+}