[tracker/libtracker-miner: 2/3] Add TrackerMinerCrawler boilerplate, make TrackerMinerTest inherit from it.
- From: Carlos Garnacho <carlosg src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/libtracker-miner: 2/3] Add TrackerMinerCrawler boilerplate, make TrackerMinerTest inherit from it.
- Date: Fri, 31 Jul 2009 10:05:29 +0000 (UTC)
commit 0f34441cdffa10cd3cf091005f9682dd2963f46d
Author: Carlos Garnacho <carlos lanedo com>
Date: Thu Jul 30 14:59:13 2009 +0200
Add TrackerMinerCrawler boilerplate, make TrackerMinerTest inherit from it.
src/libtracker-miner/Makefile.am | 15 +++--
src/libtracker-miner/tracker-miner-crawler.c | 71 ++++++++++++++++++++++++++
src/libtracker-miner/tracker-miner-crawler.h | 54 +++++++++++++++++++
src/libtracker-miner/tracker-miner-test.c | 2 +-
src/libtracker-miner/tracker-miner-test.h | 4 +-
5 files changed, 137 insertions(+), 9 deletions(-)
---
diff --git a/src/libtracker-miner/Makefile.am b/src/libtracker-miner/Makefile.am
index d79a6fe..08b181c 100644
--- a/src/libtracker-miner/Makefile.am
+++ b/src/libtracker-miner/Makefile.am
@@ -22,14 +22,17 @@ libtracker_minerincludedir=$(includedir)/tracker-$(TRACKER_API_VERSION)/libtrack
libtracker_miner_LTLIBRARIES = libtracker-miner.la
libtracker_miner_la_SOURCES = \
- tracker-dbus.c \
- tracker-dbus.h \
+ tracker-dbus.c \
+ tracker-dbus.h \
tracker-miner-dbus.h \
- tracker-miner.c \
- tracker-miner.h
+ tracker-miner.c \
+ tracker-miner.h \
+ tracker-miner-crawler.c \
+ tracker-miner-crawler.h
-libtracker_minerinclude_HEADERS = \
- tracker-miner.h
+libtracker_minerinclude_HEADERS = \
+ tracker-miner.h \
+ tracker-miner-crawler.h
libtracker_miner_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
diff --git a/src/libtracker-miner/tracker-miner-crawler.c b/src/libtracker-miner/tracker-miner-crawler.c
new file mode 100644
index 0000000..1c3bed8
--- /dev/null
+++ b/src/libtracker-miner/tracker-miner-crawler.c
@@ -0,0 +1,71 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2006, Mr Jamie McCracken (jamiemcc gnome org)
+ * Copyright (C) 2008, Nokia
+
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * 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 for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "tracker-miner-crawler.h"
+
+#define TRACKER_MINER_CRAWLER_GET_PRIVATE (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_MINER_CRAWLER, TrackerMinerCrawlerPrivate))
+
+typedef struct TrackerMinerCrawlerPrivate TrackerMinerCrawlerPrivate;
+
+struct TrackerMinerCrawlerPrivate {
+};
+
+static void tracker_miner_crawler_finalize (GObject *object);
+
+static void tracker_miner_crawler_started (TrackerMiner *miner);
+
+
+G_DEFINE_ABSTRACT_TYPE (TrackerMinerCrawler, tracker_miner_crawler, TRACKER_TYPE_MINER)
+
+static void
+tracker_miner_crawler_class_init (TrackerMinerCrawlerClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ TrackerMinerClass *miner_class = TRACKER_MINER_CLASS (klass);
+
+ object_class->finalize = tracker_miner_crawler_finalize;
+
+ miner_class->started = tracker_miner_crawler_started;
+
+ /*
+ miner_class->stopped = tracker_miner_crawler_stopped;
+ miner_class->paused = tracker_miner_crawler_paused;
+ miner_class->resumed = tracker_miner_crawler_resumed;
+ */
+
+ g_type_class_add_private (object_class, sizeof (TrackerMinerCrawlerPrivate));
+}
+
+static void
+tracker_miner_crawler_init (TrackerMinerCrawler *miner)
+{
+}
+
+static void
+tracker_miner_crawler_finalize (GObject *object)
+{
+ G_OBJECT_CLASS (tracker_miner_crawler_parent_class)->finalize (object);
+}
+
+static void
+tracker_miner_crawler_started (TrackerMiner *miner)
+{
+}
diff --git a/src/libtracker-miner/tracker-miner-crawler.h b/src/libtracker-miner/tracker-miner-crawler.h
new file mode 100644
index 0000000..f72f270
--- /dev/null
+++ b/src/libtracker-miner/tracker-miner-crawler.h
@@ -0,0 +1,54 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2006, Mr Jamie McCracken (jamiemcc gnome org)
+ * Copyright (C) 2008, Nokia
+
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * 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 for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __TRACKER_MINER_CRAWLER_H__
+#define __TRACKER_MINER_CRAWLER_H__
+
+#include "tracker-miner.h"
+
+G_BEGIN_DECLS
+
+#define TRACKER_TYPE_MINER_CRAWLER (tracker_miner_crawler_get_type())
+#define TRACKER_MINER_CRAWLER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TRACKER_TYPE_MINER_CRAWLER, TrackerMinerCrawler))
+#define TRACKER_MINER_CRAWLER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), TRACKER_TYPE_MINER_CRAWLER, TrackerMinerCrawlerClass))
+#define TRACKER_IS_MINER_CRAWLER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TRACKER_TYPE_MINER_CRAWLER))
+#define TRACKER_IS_MINER_CRAWLER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), TRACKER_TYPE_MINER_CRAWLER))
+#define TRACKER_MINER_CRAWLER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TRACKER_TYPE_MINER_CRAWLER, TrackerMinerCrawlerClass))
+
+typedef struct TrackerMinerCrawler TrackerMinerCrawler;
+typedef struct TrackerMinerCrawlerClass TrackerMinerCrawlerClass;
+
+struct TrackerMinerCrawler {
+ TrackerMiner parent_instance;
+ gpointer _priv;
+};
+
+struct TrackerMinerCrawlerClass {
+ TrackerMinerClass parent_class;
+};
+
+
+GType tracker_miner_crawler_get_type (void) G_GNUC_CONST;
+
+
+G_END_DECLS
+
+#endif /* __TRACKER_MINER_CRAWLER_H__ */
diff --git a/src/libtracker-miner/tracker-miner-test.c b/src/libtracker-miner/tracker-miner-test.c
index da9518d..a2571d8 100644
--- a/src/libtracker-miner/tracker-miner-test.c
+++ b/src/libtracker-miner/tracker-miner-test.c
@@ -20,7 +20,7 @@
#include "tracker-miner-test.h"
-G_DEFINE_TYPE (TrackerMinerTest, tracker_miner_test, TRACKER_TYPE_MINER)
+G_DEFINE_TYPE (TrackerMinerTest, tracker_miner_test, TRACKER_TYPE_MINER_CRAWLER)
static void
tracker_miner_test_class_init (TrackerMinerTestClass *klass)
diff --git a/src/libtracker-miner/tracker-miner-test.h b/src/libtracker-miner/tracker-miner-test.h
index a36676c..8f55dfa 100644
--- a/src/libtracker-miner/tracker-miner-test.h
+++ b/src/libtracker-miner/tracker-miner-test.h
@@ -37,11 +37,11 @@ typedef struct TrackerMinerTest TrackerMinerTest;
typedef struct TrackerMinerTestClass TrackerMinerTestClass;
struct TrackerMinerTest {
- TrackerMiner parent_instance;
+ TrackerMinerCrawler parent_instance;
};
struct TrackerMinerTestClass {
- TrackerMinerClass parent_class;
+ TrackerMinerCrawlerClass parent_class;
};
GType tracker_miner_test_get_type (void) G_GNUC_CONST;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]