+all: cinaest libimdb-plugin.so
+
cinaest_SOURCES = \
src/main.vala \
src/movie.vala \
cinaest: ${cinaest_SOURCES}
valac -o $@ ${cinaest_VALAFLAGS} ${cinaest_SOURCES}
-.PHONY: clean
+imdb_plugin_SOURCES = \
+ src/movie.vala \
+ src/plugin-interface.vala \
+ src/plugins/imdb-plugin.vala
+
+imdb_plugin_CSOURCES = \
+ src/plugins/imdb-plugin.c
+
+imdb_plugin_VALAFLAGS = --vapidir ./vapi --pkg hildon-1
+imdb_plugin_CFLAGS = -shared -fPIC `pkg-config --cflags hildon-1`
+imdb_plugin_LDADD = `pkg-config --cflags hildon-1`
+
+libimdb-plugin.so: ${imdb_plugin_SOURCES}
+ valac -C ${imdb_plugin_VALAFLAGS} ${imdb_plugin_SOURCES}
+ gcc -o $@ ${imdb_plugin_CFLAGS} ${imdb_plugin_LDADD} ${imdb_plugin_CSOURCES}
+
+.PHONY: all clean
clean:
- rm -f cinaest
+ rm -f cinaest libimdb-plugin.so src/*.c src/plugins/*.c
--- /dev/null
+/* This file is part of Cinaest.
+ *
+ * Copyright (C) 2009 Philipp Zabel
+ *
+ * Cinaest 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Cinaest 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 Cinaest. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+using Hildon;
+
+class IMDbPlugin : Plugin {
+ public override void hello (Gtk.Window window) {
+ string filename = Path.build_filename (Environment.get_user_cache_dir(),
+ "cinaest", "imdb.db", null);
+ stdout.printf ("IMDb Plugin Loaded. Cache Db: %s\n", filename);
+
+ if (!FileUtils.test (filename, FileTest.EXISTS)) {
+ var note = new Note.confirmation (window, "There is no local copy of the Internet Movie Database (IMDb). Download it now?\n\nThis can be started later from the Settings dialog.");
+
+ note.run ();
+ note.destroy ();
+ }
+ }
+
+ public override void get_movies (string filter, Plugin.ReceiveMovieFunction callback, int limit) {
+ }
+
+ public override void add_movie (Movie movie) {
+ }
+}
+
+[ModuleInit]
+public Type register_plugin () {
+ // types are registered automatically
+ return typeof (IMDbPlugin);
+}