From 2871969e66f508312db09c0029b4902bc040d7b1 Mon Sep 17 00:00:00 2001 From: Qball Cow Date: Fri, 16 Oct 2009 12:26:17 +0200 Subject: [PATCH] Adapt to gmpc-vala-build change --- Makefile.am | 8 +- vapi/gmpc-extras.vapi | 242 ++++++++++++++++++++++++++++++++++++++++ vapi/gmpc-paned-size-group.vapi | 10 -- vapi/gmpc-plugin.vapi | 49 -------- vapi/gmpc.vapi | 37 ++++-- 5 files changed, 279 insertions(+), 67 deletions(-) create mode 100644 vapi/gmpc-extras.vapi delete mode 100644 vapi/gmpc-paned-size-group.vapi delete mode 100644 vapi/gmpc-plugin.vapi diff --git a/Makefile.am b/Makefile.am index f25f2ce..1bc82f1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,7 +4,7 @@ plugindir=${libdir}/gmpc/plugins/ plugin_LTLIBRARIES = mmkeysplugin.la INCLUDES = -DG_LOG_DOMAIN=\"MMKeysPlugin\" -mmkeysplugin_la_VALAFLAGS= --pkg=dbus-glib-1 --pkg=gtk+-2.0 --pkg=glib-2.0 --pkg=libmpd --pkg=gmpc --pkg=gmpc-paned-size-group --pkg=gmpc-plugin --basedir=$(top_builddir) --vapidir=$(top_srcdir)/vapi/ --target-glib=2.16 +mmkeysplugin_la_VALAFLAGS= --pkg=dbus-glib-1 --pkg=gtk+-2.0 --pkg=glib-2.0 --pkg=libmpd --pkg=gmpc --pkg=gmpc-extras --basedir=$(top_builddir) --vapidir=$(top_srcdir)/vapi/ --target-glib=2.16 mmkeysplugin_la_SOURCES= \ mmkeys.vala @@ -12,3 +12,9 @@ mmkeysplugin_la_SOURCES= \ mmkeysplugin_la_LIBADD= @modules_LIBS@ mmkeysplugin_la_CFLAGS= @modules_CFLAGS@ -Wall -Wmissing-declarations mmkeysplugin_la_LDFLAGS= -module -avoid-version + +EXTRA_DIST=\ + vapi/gmpc.vapi\ + vapi/libmpd.vapi\ + vapi/gmpc-extras.vapi + diff --git a/vapi/gmpc-extras.vapi b/vapi/gmpc-extras.vapi new file mode 100644 index 0000000..64ea6a0 --- /dev/null +++ b/vapi/gmpc-extras.vapi @@ -0,0 +1,242 @@ +/* gmpc-extra.vapi generated by valac, do not modify. */ + +[CCode (cprefix = "Gmpc", lower_case_cprefix = "gmpc_")] +namespace Gmpc { + [CCode (cprefix = "GmpcEasy", lower_case_cprefix = "gmpc_easy_")] + namespace Easy { + [CCode (cheader_filename = "gmpc-extras.h")] + public class Command : Gmpc.Plugin.Base { + [CCode (cheader_filename = "gmpc-extras.h")] + public delegate void Callback (void* data, string param); + public Command (); + public uint add_entry (string name, string pattern, string hint, Gmpc.Easy.Command.Callback* callback, void* userdata); + public override bool get_enabled (); + public override unowned string get_name (); + public override unowned int[] get_version (); + public static void help_window (void* data, string? param); + public static void help_window_destroy (Gtk.Dialog window, int response); + public void popup (); + public override void set_enabled (bool state); + } + } + [CCode (cprefix = "GmpcFavorites", lower_case_cprefix = "gmpc_favorites_")] + namespace Favorites { + [CCode (cheader_filename = "gmpc-extras.h")] + public class Button : Gtk.EventBox { + public Button (); + public void set_song (MPD.Song? song); + } + } + [CCode (cprefix = "GmpcListstore", lower_case_cprefix = "gmpc_liststore_")] + namespace Liststore { + [CCode (cheader_filename = "gmpc-extras.h")] + public class Sort : Gtk.ListStore, Gtk.TreeDragSource, Gtk.TreeDragDest { + public Sort (); + } + } + [CCode (cprefix = "GmpcMenuItem", lower_case_cprefix = "gmpc_menu_item_")] + namespace MenuItem { + [CCode (cheader_filename = "gmpc-extras.h")] + public class Rating : Gtk.MenuItem { + public Gtk.VBox hbox; + public Gmpc.Rating rating; + public Rating (MPD.Server server, MPD.Song song); + public int get_rating (); + } + } + [CCode (cprefix = "GmpcMetaData", lower_case_cprefix = "gmpc_meta_data_")] + namespace MetaData { + [CCode (cheader_filename = "gmpc-extras.h")] + public class EditWindow : Gtk.Window { + public EditWindow (MPD.Song song, Gmpc.MetaData.Type type); + public void b_cancel (); + public void callback (void* handle, string? plugin_name, GLib.List? list); + public void destroy_popup (Gtk.Button button); + public void image_downloaded (Gmpc.AsyncDownload.Handle handle, Gmpc.AsyncDownload.Status status); + public void refresh_query (Gtk.Button button); + public void store_image (Gmpc.AsyncDownload.Handle handle, Gmpc.AsyncDownload.Status status); + } + } + [CCode (cprefix = "GmpcMpdData", lower_case_cprefix = "gmpc_mpd_data_")] + namespace MpdData { + [CCode (cprefix = "GmpcMpdDataTreeview", lower_case_cprefix = "gmpc_mpd_data_treeview_")] + namespace Treeview { + [CCode (cheader_filename = "gmpc-extras.h")] + public class Tooltip : Gtk.Window { + public Gmpc.MetaData.Type mtype; + public string? request_artist; + public Tooltip (Gtk.TreeView pw, Gmpc.MetaData.Type type); + } + } + } + [CCode (cprefix = "GmpcPlugin", lower_case_cprefix = "gmpc_plugin_")] + namespace Plugin { + [CCode (cheader_filename = "gmpc-extras.h")] + public abstract class Base : GLib.Object { + public int id; + public string path; + public int plugin_type; + public weak string translation_domain; + public Base (); + public virtual bool get_enabled (); + public abstract unowned string get_name (); + public abstract unowned int[] get_version (); + public virtual void save_yourself (); + public virtual void set_enabled (bool state); + } + [CCode (cheader_filename = "gmpc-extras.h")] + public class DatabaseUpdateTracker : Gmpc.Plugin.Base { + public int[] version; + public DatabaseUpdateTracker (); + public override unowned string get_name (); + public override unowned int[] get_version (); + } + [CCode (cheader_filename = "gmpc-extras.h")] + public class MetadataPrefetcher : Gmpc.Plugin.Base { + public int[] version; + public MetadataPrefetcher (); + public override unowned string get_name (); + public override unowned int[] get_version (); + } + [CCode (cheader_filename = "gmpc-extras.h")] + public class Mockup : Gmpc.Plugin.Base, Gmpc.Plugin.BrowserIface { + public const int[] version; + public Mockup (); + public override unowned string get_name (); + public override unowned int[] get_version (); + public override void save_yourself (); + public override void set_enabled (bool state); + } + [CCode (cheader_filename = "gmpc-extras.h")] + public interface BrowserIface : Gmpc.Plugin.Base { + public abstract void browser_add (Gtk.Widget category_tree); + public virtual int browser_add_go_menu (Gtk.Menu menu); + public virtual int browser_option_menu (Gtk.Menu menu); + public abstract void browser_selected (Gtk.Container container); + public abstract void browser_unselected (Gtk.Container container); + } + [CCode (cheader_filename = "gmpc-extras.h")] + public interface MetaDataIface : Gmpc.Plugin.Base { + public abstract void get_data (MPD.Song song, Gmpc.MetaData.Type type, Gmpc.Plugin.MetaDataCallback callback); + public abstract int get_priority (); + public abstract void set_priority (int priority); + } + [CCode (cheader_filename = "gmpc-extras.h")] + public interface PreferencesIface : Gmpc.Plugin.Base { + public abstract void preferences_pane_construct (Gtk.Container container); + public abstract void preferences_pane_destroy (Gtk.Container container); + } + [CCode (cheader_filename = "gmpc-extras.h")] + public interface SongListIface : Gmpc.Plugin.Base { + public abstract int song_list (Gtk.Widget tree, Gtk.Menu menu); + } + [CCode (cheader_filename = "gmpc-extras.h")] + public interface ToolMenuIface : Gmpc.Plugin.Base { + public abstract int tool_menu_integration (Gtk.Menu menu); + } + [CCode (cheader_filename = "gmpc-extras.h")] + public delegate void MetaDataCallback (GLib.List list); + } + [CCode (cprefix = "GmpcSong", lower_case_cprefix = "gmpc_song_")] + namespace Song { + [CCode (cheader_filename = "gmpc-extras.h")] + public class Links : Gtk.Frame { + [CCode (cprefix = "GMPC_SONG_LINKS_TYPE_", cheader_filename = "gmpc-extras.h")] + public enum Type { + ARTIST, + ALBUM, + SONG + } + public Links (Gmpc.Song.Links.Type type, MPD.Song song); + } + } + [CCode (cprefix = "GmpcUrlFetching", lower_case_cprefix = "gmpc_url_fetching_")] + namespace UrlFetching { + [CCode (cheader_filename = "gmpc-extras.h")] + public class Gui : GLib.Object { + [CCode (cheader_filename = "gmpc-extras.h")] + public delegate void ParseUrl (Gmpc.UrlFetching.Gui gui, string url); + [CCode (cheader_filename = "gmpc-extras.h")] + public delegate bool ValidateUrl (Gmpc.UrlFetching.Gui gui, string url); + public Gui (Gmpc.UrlFetching.Gui.ParseUrl parse_callback, Gmpc.UrlFetching.Gui.ValidateUrl validate_callback, GLib.DestroyNotify destroy_cb); + public void set_completed (); + public void set_error (string error_message); + public void set_processing (); + public void set_progress (double progress); + } + } + [CCode (cprefix = "GmpcWidget", lower_case_cprefix = "gmpc_widget_")] + namespace Widget { + [CCode (cheader_filename = "gmpc-extras.h")] + public class More : Gtk.Frame { + public More (string unique_id, string markup, Gtk.Widget child); + } + [CCode (cheader_filename = "gmpc-extras.h")] + public class SimilarArtist : Gtk.Table { + public SimilarArtist (MPD.Server server, MPD.Song song); + public Gtk.Widget new_artist_button (string artist, bool in_db); + } + [CCode (cheader_filename = "gmpc-extras.h")] + public class SimilarSongs : Gtk.Alignment { + public SimilarSongs (MPD.Song song); + public void update (); + } + } + [CCode (cheader_filename = "gmpc-extras.h")] + public class Connection : GLib.Object { + public Connection (); + public signal void connection_changed (MPD.Server mi, int connect); + public signal void status_changed (MPD.Server mi, MPD.Status.Changed what); + } + [CCode (cheader_filename = "gmpc-extras.h")] + public class Image : Gtk.EventBox { + public Image (); + public void clear_pixbuf (); + public void set_pixbuf (Gdk.Pixbuf buf, bool border); + public string? text { get; set; } + } + [CCode (cheader_filename = "gmpc-extras.h")] + public class MetadataBrowser : Gmpc.Plugin.Base, Gmpc.Plugin.BrowserIface, Gmpc.Plugin.PreferencesIface { + public const int[] version; + public MetadataBrowser (); + public override unowned string get_name (); + public override unowned int[] get_version (); + public Gtk.Widget metadata_box_show_song (MPD.Song song, bool show_controls); + public override void save_yourself (); + public void select_browser (Gtk.TreeView? tree); + public void set_album (string artist, string album); + public void set_artist (string artist); + public void set_song (MPD.Song song); + } + [CCode (cheader_filename = "gmpc-extras.h")] + public class PanedSizeGroup : GLib.Object { + public PanedSizeGroup (); + public void add_paned (Gtk.Paned paned); + } + [CCode (cheader_filename = "gmpc-extras.h")] + public class Progress : Gtk.HBox { + public bool _hide_text; + public Progress (); + public void set_time (uint total, uint current); + public bool hide_text { get; set; } + } + [CCode (cheader_filename = "gmpc-extras.h")] + public class Rating : Gtk.Frame { + public Gtk.EventBox event_box; + public Rating (MPD.Server server, MPD.Song song); + public bool button_press_event_callback (Gtk.EventBox wid, Gdk.EventButton event); + public void set_rating (int rating); + public void update (); + } + [CCode (cheader_filename = "gmpc-extras.h")] + public class TestPlugin : Gmpc.Plugin.Base, Gmpc.Plugin.ToolMenuIface, Gmpc.Plugin.SongListIface { + public const int[] version; + public TestPlugin (); + public override bool get_enabled (); + public override unowned string get_name (); + public override unowned int[] get_version (); + public void menu_activated_album (Gtk.MenuItem item); + public override void save_yourself (); + public override void set_enabled (bool state); + } +} diff --git a/vapi/gmpc-paned-size-group.vapi b/vapi/gmpc-paned-size-group.vapi deleted file mode 100644 index 75bcea1..0000000 --- a/vapi/gmpc-paned-size-group.vapi +++ /dev/null @@ -1,10 +0,0 @@ -/* gmpc-paned-size-group.vapi generated by valac, do not modify. */ - -[CCode (cprefix = "Gmpc", lower_case_cprefix = "gmpc_")] -namespace Gmpc { - [CCode (cheader_filename = "gmpc-paned-size-group.h")] - public class PanedSizeGroup : GLib.Object { - public void add_paned (Gtk.Paned paned); - public PanedSizeGroup (); - } -} diff --git a/vapi/gmpc-plugin.vapi b/vapi/gmpc-plugin.vapi deleted file mode 100644 index 297ae1a..0000000 --- a/vapi/gmpc-plugin.vapi +++ /dev/null @@ -1,49 +0,0 @@ -/* gmpc-plugin.vapi generated by valac, do not modify. */ - -[CCode (cprefix = "Gmpc", lower_case_cprefix = "gmpc_")] -namespace Gmpc { - [CCode (cprefix = "GmpcPlugin", lower_case_cprefix = "gmpc_plugin_")] - namespace Plugin { - [CCode (cheader_filename = "gmpc-plugin.h")] - public abstract class Base : GLib.Object { - public int id; - public string path; - public int plugin_type; - public weak string translation_domain; - public virtual bool get_enabled (); - public abstract unowned string get_name (); - public abstract unowned int[] get_version (); - public virtual void save_yourself (); - public virtual void set_enabled (bool state); - } - [CCode (cheader_filename = "gmpc-plugin.h")] - public interface BrowserIface : Gmpc.Plugin.Base { - public abstract void browser_add (Gtk.Widget category_tree); - public virtual int browser_add_go_menu (Gtk.Menu menu); - public virtual int browser_option_menu (Gtk.Menu menu); - public abstract void browser_selected (Gtk.Container container); - public abstract void browser_unselected (Gtk.Container container); - } - [CCode (cheader_filename = "gmpc-plugin.h")] - public interface MetaDataIface : Gmpc.Plugin.Base { - public abstract void get_data (MPD.Song song, Gmpc.MetaData.Type type, Gmpc.Plugin.MetaDataCallback callback); - public abstract int get_priority (); - public abstract void set_priority (int priority); - } - [CCode (cheader_filename = "gmpc-plugin.h")] - public interface PreferencesIface : Gmpc.Plugin.Base { - public abstract void preferences_pane_construct (Gtk.Container container); - public abstract void preferences_pane_destroy (Gtk.Container container); - } - [CCode (cheader_filename = "gmpc-plugin.h")] - public interface SongListIface : Gmpc.Plugin.Base { - public abstract int song_list (Gtk.Widget tree, Gtk.Menu menu); - } - [CCode (cheader_filename = "gmpc-plugin.h")] - public interface ToolMenuIface : Gmpc.Plugin.Base { - public abstract int tool_menu_integration (Gtk.Menu menu); - } - [CCode (cheader_filename = "gmpc-plugin.h")] - public delegate void MetaDataCallback (GLib.List list); - } -} diff --git a/vapi/gmpc.vapi b/vapi/gmpc.vapi index 8f0b44c..5e14a53 100644 --- a/vapi/gmpc.vapi +++ b/vapi/gmpc.vapi @@ -16,6 +16,9 @@ namespace Gmpc { [CCode (cname = "gmw", cheader_filename="main.h")] static MetaWatcher metawatcher; + [CCode (cname = "gmpc_profiles", cheader_filename="plugin.h")] + static Profiles profiles; + [CCode (cheader_filename="gmpc-meta-watcher.h")] public class MetaWatcher { signal void data_changed(MPD.Song song, Gmpc.MetaData.Type type, Gmpc.MetaData.Result result,MetaData.Item met); @@ -26,11 +29,6 @@ namespace Gmpc { } - [CCode (cheader_filename="gmpc-connection.h")] - public class Connection { - signal void connection_changed(MPD.Server server, int connect); - signal void status_changed (MPD.Server server, MPD.Status.Changed what); - } namespace MetaData { @@ -49,7 +47,9 @@ namespace Gmpc { [Immutable] [CCode (free_function="meta_data_free")] public class Item { - public Gmpc.MetaData.Type type; + [CCode (cname="meta_data_new")] + public Item (); + public Gmpc.MetaData.Type type; public weak string plugin_name; public int size; public Gmpc.MetaData.ContentType content_type; @@ -135,6 +135,8 @@ namespace Gmpc { [CCode (cname="gmpc_metaimage_set_hide_on_na")] public void set_hide_on_na(bool hide); + [CCode (cname="gmpc_metaimage_set_scale_up")] + public void set_scale_up(bool scale); } [CCode ( cname="GmpcStatsLabel", cheader_filename="gmpc-stats-label.h")] @@ -160,6 +162,7 @@ namespace Gmpc { public TextView(Type type); [CCode (cname="gmpc_meta_text_view_query_text_from_song")] public void query_from_song(MPD.Song song); + public bool force_ro; } } @@ -241,6 +244,8 @@ namespace Gmpc { [Compact] [Immutable] public class Settings { + [CCode (cname="cfg_get_single_value_as_string_with_default", cheader_filename="config1.h")] + public string get_string_with_default(string class, string key, string value); [CCode (cname="cfg_get_single_value_as_int_with_default", cheader_filename="config1.h")] public int get_int_with_default(string class, string key, int value); [CCode (cname="cfg_set_single_value_as_int", cheader_filename="config1.h")] @@ -252,6 +257,10 @@ namespace Gmpc { public void colorshift_pixbuf(Gdk.Pixbuf dest, Gdk.Pixbuf src, int shift); [CCode (cname="misc_header_expose_event",cheader_filename="misc.h")] public bool misc_header_expose_event(Gtk.Widget widget, Gdk.EventExpose event); + + + [CCode (cname="format_time_real", cheader_filename="misc.h")] + public string format_time(ulong seconds, string pre); } /* Browser */ @@ -277,6 +286,9 @@ namespace Gmpc { namespace Playlist3 { [CCode (cname="playlist3_get_category_tree_view")] public unowned Gtk.TreeView get_category_tree_view(); + + [CCode (cname="main_window_add_status_icon")] + public void add_status_icon(Gtk.Widget widget); } /* objects */ @@ -284,7 +296,7 @@ namespace Gmpc { [CCode (chader_filename="gmpc-mpddata-treeview.h",cname="GmpcMpdDataTreeview")] public class TreeView : Gtk.TreeView { [CCode (cname="gmpc_mpddata_treeview_new")] - TreeView(string name, bool sort, Gtk.TreeModel model); + public TreeView(string name, bool sort, Gtk.TreeModel model); [CCode (cname="gmpc_mpddata_treeview_enable_click_fix")] public void enable_click_fix(); [CCode (cname="gmpc_mpddata_treeview_right_mouse_intergration")] @@ -319,4 +331,15 @@ namespace Gmpc { [CCode (cname="submenu_for_song")] public void submenu_for_song(Gtk.Widget menu, MPD.Song song); } + + [CCode (cheader_filename="gmpc-profiles.h")] + [Compact] + [Immutable] + class Profiles { + [CCode (cname="gmpc_profiles_get_current",cheader_filename="gmpc-profiles.h")] + public string? get_current_id(); + public void set_db_update_time(string id, int value); + public int get_db_update_time(string id); + + } } -- 2.11.4.GIT