From 50d4fbe43b3d7f345e6b66e440181c8b7026018a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Fri, 14 Jun 2024 23:23:15 +0200 Subject: [PATCH] clapper: Properly export external API symbols --- src/lib/clapper/clapper-audio-stream.h | 10 ++++ src/lib/clapper/clapper-feature.h | 3 ++ src/lib/clapper/clapper-marker.h | 8 +++ src/lib/clapper/clapper-media-item.h | 12 +++++ src/lib/clapper/clapper-player.h | 50 +++++++++++++++++++ src/lib/clapper/clapper-queue.h | 25 ++++++++++ src/lib/clapper/clapper-stream-list.h | 8 +++ src/lib/clapper/clapper-stream.h | 4 ++ src/lib/clapper/clapper-subtitle-stream.h | 5 ++ src/lib/clapper/clapper-threaded-object.h | 4 ++ src/lib/clapper/clapper-timeline.h | 6 +++ src/lib/clapper/clapper-video-stream.h | 9 ++++ src/lib/clapper/clapper.h | 4 ++ .../features/discoverer/clapper-discoverer.h | 6 +++ .../clapper/features/mpris/clapper-mpris.h | 8 +++ .../clapper/features/server/clapper-server.h | 12 +++++ src/lib/clapper/meson.build | 24 ++++++++- src/lib/shared/clapper-api-visibility.h.in | 45 +++++++++++++++++ 18 files changed, 241 insertions(+), 2 deletions(-) create mode 100644 src/lib/shared/clapper-api-visibility.h.in diff --git a/src/lib/clapper/clapper-audio-stream.h b/src/lib/clapper/clapper-audio-stream.h index bde0f11a..7efc4835 100644 --- a/src/lib/clapper/clapper-audio-stream.h +++ b/src/lib/clapper/clapper-audio-stream.h @@ -25,6 +25,8 @@ #include #include + +#include #include G_BEGIN_DECLS @@ -32,20 +34,28 @@ G_BEGIN_DECLS #define CLAPPER_TYPE_AUDIO_STREAM (clapper_audio_stream_get_type()) #define CLAPPER_AUDIO_STREAM_CAST(obj) ((ClapperAudioStream *)(obj)) +CLAPPER_API G_DECLARE_FINAL_TYPE (ClapperAudioStream, clapper_audio_stream, CLAPPER, AUDIO_STREAM, ClapperStream) +CLAPPER_API gchar * clapper_audio_stream_get_codec (ClapperAudioStream *stream); +CLAPPER_API guint clapper_audio_stream_get_bitrate (ClapperAudioStream *stream); +CLAPPER_API gchar * clapper_audio_stream_get_sample_format (ClapperAudioStream *stream); +CLAPPER_API gint clapper_audio_stream_get_sample_rate (ClapperAudioStream *stream); +CLAPPER_API gint clapper_audio_stream_get_channels (ClapperAudioStream *stream); +CLAPPER_API gchar * clapper_audio_stream_get_lang_code (ClapperAudioStream *stream); +CLAPPER_API gchar * clapper_audio_stream_get_lang_name (ClapperAudioStream *stream); G_END_DECLS diff --git a/src/lib/clapper/clapper-feature.h b/src/lib/clapper/clapper-feature.h index 05590d9f..d6bb8f2a 100644 --- a/src/lib/clapper/clapper-feature.h +++ b/src/lib/clapper/clapper-feature.h @@ -27,6 +27,8 @@ #include #include #include + +#include #include #include @@ -35,6 +37,7 @@ G_BEGIN_DECLS #define CLAPPER_TYPE_FEATURE (clapper_feature_get_type()) #define CLAPPER_FEATURE_CAST(obj) ((ClapperFeature *)(obj)) +CLAPPER_API G_DECLARE_DERIVABLE_TYPE (ClapperFeature, clapper_feature, CLAPPER, FEATURE, GstObject) /** diff --git a/src/lib/clapper/clapper-marker.h b/src/lib/clapper/clapper-marker.h index 49398479..cf091867 100644 --- a/src/lib/clapper/clapper-marker.h +++ b/src/lib/clapper/clapper-marker.h @@ -26,6 +26,8 @@ #include #include #include + +#include #include G_BEGIN_DECLS @@ -36,6 +38,7 @@ G_BEGIN_DECLS /* NOTE: #ClapperMarker are immutable objects that cannot be derived, * otherwise #ClapperFeaturesManager would not be able to announce media * item changed caused by changes within them */ +CLAPPER_API G_DECLARE_FINAL_TYPE (ClapperMarker, clapper_marker, CLAPPER, MARKER, GstObject) /** @@ -45,14 +48,19 @@ G_DECLARE_FINAL_TYPE (ClapperMarker, clapper_marker, CLAPPER, MARKER, GstObject) */ #define CLAPPER_MARKER_NO_END ((gdouble) -1) // Needs a cast from int, otherwise GIR is generated incorrectly +CLAPPER_API ClapperMarker * clapper_marker_new (ClapperMarkerType marker_type, const gchar *title, gdouble start, gdouble end); +CLAPPER_API ClapperMarkerType clapper_marker_get_marker_type (ClapperMarker *marker); +CLAPPER_API const gchar * clapper_marker_get_title (ClapperMarker *marker); +CLAPPER_API gdouble clapper_marker_get_start (ClapperMarker *marker); +CLAPPER_API gdouble clapper_marker_get_end (ClapperMarker *marker); G_END_DECLS diff --git a/src/lib/clapper/clapper-media-item.h b/src/lib/clapper/clapper-media-item.h index 16b6441a..631d2f2c 100644 --- a/src/lib/clapper/clapper-media-item.h +++ b/src/lib/clapper/clapper-media-item.h @@ -28,6 +28,7 @@ #include #include +#include #include G_BEGIN_DECLS @@ -35,26 +36,37 @@ G_BEGIN_DECLS #define CLAPPER_TYPE_MEDIA_ITEM (clapper_media_item_get_type()) #define CLAPPER_MEDIA_ITEM_CAST(obj) ((ClapperMediaItem *)(obj)) +CLAPPER_API G_DECLARE_FINAL_TYPE (ClapperMediaItem, clapper_media_item, CLAPPER, MEDIA_ITEM, GstObject) +CLAPPER_API ClapperMediaItem * clapper_media_item_new (const gchar *uri); +CLAPPER_API ClapperMediaItem * clapper_media_item_new_from_file (GFile *file); +CLAPPER_API guint clapper_media_item_get_id (ClapperMediaItem *item); +CLAPPER_API const gchar * clapper_media_item_get_uri (ClapperMediaItem *item); +CLAPPER_API void clapper_media_item_set_suburi (ClapperMediaItem *item, const gchar *suburi); +CLAPPER_API gchar * clapper_media_item_get_suburi (ClapperMediaItem *item); +CLAPPER_API gchar * clapper_media_item_get_title (ClapperMediaItem *item); +CLAPPER_API gchar * clapper_media_item_get_container_format (ClapperMediaItem *item); +CLAPPER_API gdouble clapper_media_item_get_duration (ClapperMediaItem *item); +CLAPPER_API ClapperTimeline * clapper_media_item_get_timeline (ClapperMediaItem *item); G_END_DECLS diff --git a/src/lib/clapper/clapper-player.h b/src/lib/clapper/clapper-player.h index d5b62264..1c14c453 100644 --- a/src/lib/clapper/clapper-player.h +++ b/src/lib/clapper/clapper-player.h @@ -26,6 +26,8 @@ #include #include #include + +#include #include #include #include @@ -37,100 +39,148 @@ G_BEGIN_DECLS #define CLAPPER_TYPE_PLAYER (clapper_player_get_type()) #define CLAPPER_PLAYER_CAST(obj) ((ClapperPlayer *)(obj)) +CLAPPER_API G_DECLARE_FINAL_TYPE (ClapperPlayer, clapper_player, CLAPPER, PLAYER, ClapperThreadedObject) +CLAPPER_API ClapperPlayer * clapper_player_new (void); +CLAPPER_API ClapperQueue * clapper_player_get_queue (ClapperPlayer *player); +CLAPPER_API ClapperStreamList * clapper_player_get_video_streams (ClapperPlayer *player); +CLAPPER_API ClapperStreamList * clapper_player_get_audio_streams (ClapperPlayer *player); +CLAPPER_API ClapperStreamList * clapper_player_get_subtitle_streams (ClapperPlayer *player); +CLAPPER_API void clapper_player_set_autoplay (ClapperPlayer *player, gboolean enabled); +CLAPPER_API gboolean clapper_player_get_autoplay (ClapperPlayer *player); +CLAPPER_API gdouble clapper_player_get_position (ClapperPlayer *player); +CLAPPER_API ClapperPlayerState clapper_player_get_state (ClapperPlayer *player); +CLAPPER_API void clapper_player_set_mute (ClapperPlayer *player, gboolean mute); +CLAPPER_API gboolean clapper_player_get_mute (ClapperPlayer *player); +CLAPPER_API void clapper_player_set_volume (ClapperPlayer *player, gdouble volume); +CLAPPER_API gdouble clapper_player_get_volume (ClapperPlayer *player); +CLAPPER_API void clapper_player_set_speed (ClapperPlayer *player, gdouble speed); +CLAPPER_API gdouble clapper_player_get_speed (ClapperPlayer *player); +CLAPPER_API void clapper_player_set_video_sink (ClapperPlayer *player, GstElement *element); +CLAPPER_API GstElement * clapper_player_get_video_sink (ClapperPlayer *player); +CLAPPER_API void clapper_player_set_audio_sink (ClapperPlayer *player, GstElement *element); +CLAPPER_API GstElement * clapper_player_get_audio_sink (ClapperPlayer *player); +CLAPPER_API void clapper_player_set_video_filter (ClapperPlayer *player, GstElement *element); +CLAPPER_API GstElement * clapper_player_get_video_filter (ClapperPlayer *player); +CLAPPER_API void clapper_player_set_audio_filter (ClapperPlayer *player, GstElement *element); +CLAPPER_API GstElement * clapper_player_get_audio_filter (ClapperPlayer *player); +CLAPPER_API GstElement * clapper_player_get_current_video_decoder (ClapperPlayer *player); +CLAPPER_API GstElement * clapper_player_get_current_audio_decoder (ClapperPlayer *player); +CLAPPER_API void clapper_player_set_video_enabled (ClapperPlayer *player, gboolean enabled); +CLAPPER_API gboolean clapper_player_get_video_enabled (ClapperPlayer *player); +CLAPPER_API void clapper_player_set_audio_enabled (ClapperPlayer *player, gboolean enabled); +CLAPPER_API gboolean clapper_player_get_audio_enabled (ClapperPlayer *player); +CLAPPER_API void clapper_player_set_subtitles_enabled (ClapperPlayer *player, gboolean enabled); +CLAPPER_API gboolean clapper_player_get_subtitles_enabled (ClapperPlayer *player); +CLAPPER_API void clapper_player_set_download_dir (ClapperPlayer *player, const gchar *path); +CLAPPER_API gchar * clapper_player_get_download_dir (ClapperPlayer *player); +CLAPPER_API void clapper_player_set_download_enabled (ClapperPlayer *player, gboolean enabled); +CLAPPER_API gboolean clapper_player_get_download_enabled (ClapperPlayer *player); +CLAPPER_API void clapper_player_set_audio_offset (ClapperPlayer *player, gdouble offset); +CLAPPER_API gdouble clapper_player_get_audio_offset (ClapperPlayer *player); +CLAPPER_API void clapper_player_set_subtitle_offset (ClapperPlayer *player, gdouble offset); +CLAPPER_API gdouble clapper_player_get_subtitle_offset (ClapperPlayer *player); +CLAPPER_API void clapper_player_set_subtitle_font_desc (ClapperPlayer *player, const gchar *font_desc); +CLAPPER_API gchar * clapper_player_get_subtitle_font_desc (ClapperPlayer *player); +CLAPPER_API void clapper_player_play (ClapperPlayer *player); +CLAPPER_API void clapper_player_pause (ClapperPlayer *player); +CLAPPER_API void clapper_player_stop (ClapperPlayer *player); +CLAPPER_API void clapper_player_seek (ClapperPlayer *player, gdouble position); +CLAPPER_API void clapper_player_seek_custom (ClapperPlayer *player, gdouble position, ClapperPlayerSeekMethod method); +CLAPPER_API void clapper_player_add_feature (ClapperPlayer *player, ClapperFeature *feature); G_END_DECLS diff --git a/src/lib/clapper/clapper-queue.h b/src/lib/clapper/clapper-queue.h index 162c236d..f72d9497 100644 --- a/src/lib/clapper/clapper-queue.h +++ b/src/lib/clapper/clapper-queue.h @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -35,6 +36,7 @@ G_BEGIN_DECLS #define CLAPPER_TYPE_QUEUE (clapper_queue_get_type()) #define CLAPPER_QUEUE_CAST(obj) ((ClapperQueue *)(obj)) +CLAPPER_API G_DECLARE_FINAL_TYPE (ClapperQueue, clapper_queue, CLAPPER, QUEUE, GstObject) /** @@ -44,50 +46,73 @@ G_DECLARE_FINAL_TYPE (ClapperQueue, clapper_queue, CLAPPER, QUEUE, GstObject) */ #define CLAPPER_QUEUE_INVALID_POSITION ((guint) 0xffffffff) +CLAPPER_API void clapper_queue_add_item (ClapperQueue *queue, ClapperMediaItem *item); +CLAPPER_API void clapper_queue_insert_item (ClapperQueue *queue, ClapperMediaItem *item, gint index); +CLAPPER_API void clapper_queue_reposition_item (ClapperQueue *queue, ClapperMediaItem *item, gint index); +CLAPPER_API void clapper_queue_remove_item (ClapperQueue *queue, ClapperMediaItem *item); +CLAPPER_API void clapper_queue_remove_index (ClapperQueue *queue, guint index); +CLAPPER_API ClapperMediaItem * clapper_queue_steal_index (ClapperQueue *queue, guint index); +CLAPPER_API void clapper_queue_clear (ClapperQueue *queue); +CLAPPER_API gboolean clapper_queue_select_item (ClapperQueue *queue, ClapperMediaItem *item); +CLAPPER_API gboolean clapper_queue_select_index (ClapperQueue *queue, guint index); +CLAPPER_API gboolean clapper_queue_select_next_item (ClapperQueue *queue); +CLAPPER_API gboolean clapper_queue_select_previous_item (ClapperQueue *queue); +CLAPPER_API ClapperMediaItem * clapper_queue_get_item (ClapperQueue *queue, guint index); +CLAPPER_API ClapperMediaItem * clapper_queue_get_current_item (ClapperQueue *queue); +CLAPPER_API guint clapper_queue_get_current_index (ClapperQueue *queue); +CLAPPER_API gboolean clapper_queue_item_is_current (ClapperQueue *queue, ClapperMediaItem *item); +CLAPPER_API gboolean clapper_queue_find_item (ClapperQueue *queue, ClapperMediaItem *item, guint *index); +CLAPPER_API guint clapper_queue_get_n_items (ClapperQueue *queue); +CLAPPER_API void clapper_queue_set_progression_mode (ClapperQueue *queue, ClapperQueueProgressionMode mode); +CLAPPER_API ClapperQueueProgressionMode clapper_queue_get_progression_mode (ClapperQueue *queue); +CLAPPER_API void clapper_queue_set_gapless (ClapperQueue *queue, gboolean gapless); +CLAPPER_API gboolean clapper_queue_get_gapless (ClapperQueue *queue); +CLAPPER_API void clapper_queue_set_instant (ClapperQueue *queue, gboolean instant); +CLAPPER_API gboolean clapper_queue_get_instant (ClapperQueue *queue); G_END_DECLS diff --git a/src/lib/clapper/clapper-stream-list.h b/src/lib/clapper/clapper-stream-list.h index 5c6f8159..e19430f8 100644 --- a/src/lib/clapper/clapper-stream-list.h +++ b/src/lib/clapper/clapper-stream-list.h @@ -27,6 +27,7 @@ #include #include +#include #include G_BEGIN_DECLS @@ -34,6 +35,7 @@ G_BEGIN_DECLS #define CLAPPER_TYPE_STREAM_LIST (clapper_stream_list_get_type()) #define CLAPPER_STREAM_LIST_CAST(obj) ((ClapperStreamList *)(obj)) +CLAPPER_API G_DECLARE_FINAL_TYPE (ClapperStreamList, clapper_stream_list, CLAPPER, STREAM_LIST, GstObject) /** @@ -43,16 +45,22 @@ G_DECLARE_FINAL_TYPE (ClapperStreamList, clapper_stream_list, CLAPPER, STREAM_LI */ #define CLAPPER_STREAM_LIST_INVALID_POSITION ((guint) 0xffffffff) +CLAPPER_API gboolean clapper_stream_list_select_stream (ClapperStreamList *list, ClapperStream *stream); +CLAPPER_API gboolean clapper_stream_list_select_index (ClapperStreamList *list, guint index); +CLAPPER_API ClapperStream * clapper_stream_list_get_stream (ClapperStreamList *list, guint index); +CLAPPER_API ClapperStream * clapper_stream_list_get_current_stream (ClapperStreamList *list); +CLAPPER_API guint clapper_stream_list_get_current_index (ClapperStreamList *list); +CLAPPER_API guint clapper_stream_list_get_n_streams (ClapperStreamList *list); G_END_DECLS diff --git a/src/lib/clapper/clapper-stream.h b/src/lib/clapper/clapper-stream.h index 14369533..627d87e3 100644 --- a/src/lib/clapper/clapper-stream.h +++ b/src/lib/clapper/clapper-stream.h @@ -27,6 +27,7 @@ #include #include +#include #include G_BEGIN_DECLS @@ -34,6 +35,7 @@ G_BEGIN_DECLS #define CLAPPER_TYPE_STREAM (clapper_stream_get_type()) #define CLAPPER_STREAM_CAST(obj) ((ClapperStream *)(obj)) +CLAPPER_API G_DECLARE_DERIVABLE_TYPE (ClapperStream, clapper_stream, CLAPPER, STREAM, GstObject) struct _ClapperStreamClass @@ -58,8 +60,10 @@ struct _ClapperStreamClass gpointer padding[4]; }; +CLAPPER_API ClapperStreamType clapper_stream_get_stream_type (ClapperStream *stream); +CLAPPER_API gchar * clapper_stream_get_title (ClapperStream *stream); G_END_DECLS diff --git a/src/lib/clapper/clapper-subtitle-stream.h b/src/lib/clapper/clapper-subtitle-stream.h index ee3c7520..1dd27b95 100644 --- a/src/lib/clapper/clapper-subtitle-stream.h +++ b/src/lib/clapper/clapper-subtitle-stream.h @@ -25,6 +25,8 @@ #include #include + +#include #include G_BEGIN_DECLS @@ -32,10 +34,13 @@ G_BEGIN_DECLS #define CLAPPER_TYPE_SUBTITLE_STREAM (clapper_subtitle_stream_get_type()) #define CLAPPER_SUBTITLE_STREAM_CAST(obj) ((ClapperSubtitleStream *)(obj)) +CLAPPER_API G_DECLARE_FINAL_TYPE (ClapperSubtitleStream, clapper_subtitle_stream, CLAPPER, SUBTITLE_STREAM, ClapperStream) +CLAPPER_API gchar * clapper_subtitle_stream_get_lang_code (ClapperSubtitleStream *stream); +CLAPPER_API gchar * clapper_subtitle_stream_get_lang_name (ClapperSubtitleStream *stream); G_END_DECLS diff --git a/src/lib/clapper/clapper-threaded-object.h b/src/lib/clapper/clapper-threaded-object.h index 3b1ee8a1..5accb7f3 100644 --- a/src/lib/clapper/clapper-threaded-object.h +++ b/src/lib/clapper/clapper-threaded-object.h @@ -27,11 +27,14 @@ #include #include +#include + G_BEGIN_DECLS #define CLAPPER_TYPE_THREADED_OBJECT (clapper_threaded_object_get_type()) #define CLAPPER_THREADED_OBJECT_CAST(obj) ((ClapperThreadedObject *)(obj)) +CLAPPER_API G_DECLARE_DERIVABLE_TYPE (ClapperThreadedObject, clapper_threaded_object, CLAPPER, THREADED_OBJECT, GstObject) /** @@ -68,6 +71,7 @@ struct _ClapperThreadedObjectClass gpointer padding[4]; }; +CLAPPER_API GMainContext * clapper_threaded_object_get_context (ClapperThreadedObject *threaded_object); G_END_DECLS diff --git a/src/lib/clapper/clapper-timeline.h b/src/lib/clapper/clapper-timeline.h index 1906d531..6e56d5e2 100644 --- a/src/lib/clapper/clapper-timeline.h +++ b/src/lib/clapper/clapper-timeline.h @@ -27,6 +27,7 @@ #include #include +#include #include G_BEGIN_DECLS @@ -34,14 +35,19 @@ G_BEGIN_DECLS #define CLAPPER_TYPE_TIMELINE (clapper_timeline_get_type()) #define CLAPPER_TIMELINE_CAST(obj) ((ClapperTimeline *)(obj)) +CLAPPER_API G_DECLARE_FINAL_TYPE (ClapperTimeline, clapper_timeline, CLAPPER, TIMELINE, GstObject) +CLAPPER_API gboolean clapper_timeline_insert_marker (ClapperTimeline *timeline, ClapperMarker *marker); +CLAPPER_API void clapper_timeline_remove_marker (ClapperTimeline *timeline, ClapperMarker *marker); +CLAPPER_API ClapperMarker * clapper_timeline_get_marker (ClapperTimeline *timeline, guint index); +CLAPPER_API guint clapper_timeline_get_n_markers (ClapperTimeline *timeline); G_END_DECLS diff --git a/src/lib/clapper/clapper-video-stream.h b/src/lib/clapper/clapper-video-stream.h index 8fff48a1..f9607024 100644 --- a/src/lib/clapper/clapper-video-stream.h +++ b/src/lib/clapper/clapper-video-stream.h @@ -25,6 +25,8 @@ #include #include + +#include #include G_BEGIN_DECLS @@ -32,18 +34,25 @@ G_BEGIN_DECLS #define CLAPPER_TYPE_VIDEO_STREAM (clapper_video_stream_get_type()) #define CLAPPER_VIDEO_STREAM_CAST(obj) ((ClapperVideoStream *)(obj)) +CLAPPER_API G_DECLARE_FINAL_TYPE (ClapperVideoStream, clapper_video_stream, CLAPPER, VIDEO_STREAM, ClapperStream) +CLAPPER_API gchar * clapper_video_stream_get_codec (ClapperVideoStream *stream); +CLAPPER_API gint clapper_video_stream_get_width (ClapperVideoStream *stream); +CLAPPER_API gint clapper_video_stream_get_height (ClapperVideoStream *stream); +CLAPPER_API gdouble clapper_video_stream_get_fps (ClapperVideoStream *stream); +CLAPPER_API guint clapper_video_stream_get_bitrate (ClapperVideoStream *stream); +CLAPPER_API gchar * clapper_video_stream_get_pixel_format (ClapperVideoStream *stream); G_END_DECLS diff --git a/src/lib/clapper/clapper.h b/src/lib/clapper/clapper.h index 9f1dac71..62c9e524 100644 --- a/src/lib/clapper/clapper.h +++ b/src/lib/clapper/clapper.h @@ -21,6 +21,8 @@ #define __CLAPPER_INSIDE__ +#include + #include #include @@ -52,8 +54,10 @@ G_BEGIN_DECLS +CLAPPER_API void clapper_init (int *argc, char **argv[]); +CLAPPER_API gboolean clapper_init_check (int *argc, char **argv[]); G_END_DECLS diff --git a/src/lib/clapper/features/discoverer/clapper-discoverer.h b/src/lib/clapper/features/discoverer/clapper-discoverer.h index 7840455b..31da1364 100644 --- a/src/lib/clapper/features/discoverer/clapper-discoverer.h +++ b/src/lib/clapper/features/discoverer/clapper-discoverer.h @@ -25,6 +25,8 @@ #include #include + +#include #include G_BEGIN_DECLS @@ -32,12 +34,16 @@ G_BEGIN_DECLS #define CLAPPER_TYPE_DISCOVERER (clapper_discoverer_get_type()) #define CLAPPER_DISCOVERER_CAST(obj) ((ClapperDiscoverer *)(obj)) +CLAPPER_API G_DECLARE_FINAL_TYPE (ClapperDiscoverer, clapper_discoverer, CLAPPER, DISCOVERER, ClapperFeature) +CLAPPER_API ClapperDiscoverer * clapper_discoverer_new (void); +CLAPPER_API void clapper_discoverer_set_discovery_mode (ClapperDiscoverer *discoverer, ClapperDiscovererDiscoveryMode mode); +CLAPPER_API ClapperDiscovererDiscoveryMode clapper_discoverer_get_discovery_mode (ClapperDiscoverer *discoverer); G_END_DECLS diff --git a/src/lib/clapper/features/mpris/clapper-mpris.h b/src/lib/clapper/features/mpris/clapper-mpris.h index 1a34f2cb..7950538f 100644 --- a/src/lib/clapper/features/mpris/clapper-mpris.h +++ b/src/lib/clapper/features/mpris/clapper-mpris.h @@ -26,6 +26,8 @@ #include #include #include + +#include #include G_BEGIN_DECLS @@ -33,16 +35,22 @@ G_BEGIN_DECLS #define CLAPPER_TYPE_MPRIS (clapper_mpris_get_type()) #define CLAPPER_MPRIS_CAST(obj) ((ClapperMpris *)(obj)) +CLAPPER_API G_DECLARE_FINAL_TYPE (ClapperMpris, clapper_mpris, CLAPPER, MPRIS, ClapperFeature) +CLAPPER_API ClapperMpris * clapper_mpris_new (const gchar *own_name, const gchar *identity, const gchar *desktop_entry); +CLAPPER_API void clapper_mpris_set_queue_controllable (ClapperMpris *mpris, gboolean controllable); +CLAPPER_API gboolean clapper_mpris_get_queue_controllable (ClapperMpris *mpris); +CLAPPER_API void clapper_mpris_set_fallback_art_url (ClapperMpris *mpris, const gchar *art_url); +CLAPPER_API gchar * clapper_mpris_get_fallback_art_url (ClapperMpris *mpris); G_END_DECLS diff --git a/src/lib/clapper/features/server/clapper-server.h b/src/lib/clapper/features/server/clapper-server.h index ffc10dcf..c9535cf3 100644 --- a/src/lib/clapper/features/server/clapper-server.h +++ b/src/lib/clapper/features/server/clapper-server.h @@ -25,6 +25,8 @@ #include #include + +#include #include G_BEGIN_DECLS @@ -32,24 +34,34 @@ G_BEGIN_DECLS #define CLAPPER_TYPE_SERVER (clapper_server_get_type()) #define CLAPPER_SERVER_CAST(obj) ((ClapperServer *)(obj)) +CLAPPER_API G_DECLARE_FINAL_TYPE (ClapperServer, clapper_server, CLAPPER, SERVER, ClapperFeature) +CLAPPER_API ClapperServer * clapper_server_new (void); +CLAPPER_API void clapper_server_set_enabled (ClapperServer *server, gboolean enabled); +CLAPPER_API gboolean clapper_server_get_enabled (ClapperServer *server); +CLAPPER_API gboolean clapper_server_get_running (ClapperServer *server); +CLAPPER_API void clapper_server_set_port (ClapperServer *server, guint port); +CLAPPER_API guint clapper_server_get_port (ClapperServer *server); +CLAPPER_API guint clapper_server_get_current_port (ClapperServer *server); +CLAPPER_API void clapper_server_set_queue_controllable (ClapperServer *server, gboolean controllable); +CLAPPER_API gboolean clapper_server_get_queue_controllable (ClapperServer *server); G_END_DECLS diff --git a/src/lib/clapper/meson.build b/src/lib/clapper/meson.build index 94e3aad7..87f053cd 100644 --- a/src/lib/clapper/meson.build +++ b/src/lib/clapper/meson.build @@ -1,5 +1,6 @@ clapper_dep = dependency('', required: false) clapper_option = get_option('clapper') +clapper_headers_dir = join_paths(includedir, clapper_api_name, 'clapper') build_clapper = false clapper_pkg_reqs = [ @@ -37,6 +38,19 @@ foreach dep : clapper_deps endif endforeach +visibility_conf = configuration_data() + +visibility_conf.set( + 'CLAPPER_API', + 'CLAPPER', +) + +clapper_visibility_header = configure_file( + input: '../shared/clapper-api-visibility.h.in', + output: 'clapper-visibility.h', + configuration: visibility_conf, +) + version_conf = configuration_data() version_conf.set( @@ -56,8 +70,6 @@ version_conf.set( version_array[2].to_int(), ) -clapper_headers_dir = join_paths(includedir, clapper_api_name, 'clapper') - clapper_version_header = configure_file( input: 'clapper-version.h.in', output: 'clapper-version.h', @@ -87,6 +99,7 @@ clapper_headers = [ 'clapper-utils.h', 'clapper-video-stream.h', clapper_version_header, + clapper_visibility_header, ] clapper_sources = [ 'clapper.c', @@ -115,11 +128,17 @@ clapper_c_args = [ '-DGST_USE_UNSTABLE_API', ] +if get_option('default_library') == 'static' + clapper_c_args += ['-DCLAPPER_STATIC_COMPILATION'] +endif + subdir('features') clapper_enums = gnome.mkenums_simple( 'clapper-enum-types', sources: clapper_headers, + decorator: 'CLAPPER_API', + header_prefix: '#include ', identifier_prefix: 'Clapper', symbol_prefix: 'clapper', install_header: true, @@ -212,6 +231,7 @@ clapper_dep = declare_dependency( include_directories: clapper_conf_inc, dependencies: clapper_deps + clapper_features_deps, sources: [ + clapper_visibility_header, clapper_version_header, clapper_features_availability_header, clapper_enums[1], diff --git a/src/lib/shared/clapper-api-visibility.h.in b/src/lib/shared/clapper-api-visibility.h.in new file mode 100644 index 00000000..4a02dde5 --- /dev/null +++ b/src/lib/shared/clapper-api-visibility.h.in @@ -0,0 +1,45 @@ +/* Clapper API Visibility + * Copyright (C) 2024 Rafał Dzięgiel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#pragma once + +#if !defined(__@CLAPPER_API@_INSIDE__) && !defined(@CLAPPER_API@_COMPILATION) +#error "This header file can not be included directly." +#endif + +#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(@CLAPPER_API@_STATIC_COMPILATION) +#define _@CLAPPER_API@_EXPORT __declspec(dllexport) extern +#define _@CLAPPER_API@_IMPORT __declspec(dllimport) extern +#elif __GNUC__ >= 4 +#define _@CLAPPER_API@_EXPORT __attribute__((visibility("default"))) extern +#define _@CLAPPER_API@_IMPORT extern +#else +#define _@CLAPPER_API@_EXPORT extern +#define _@CLAPPER_API@_IMPORT extern +#endif + +#if defined(@CLAPPER_API@_COMPILATION) +#define _@CLAPPER_API@_VISIBILITY _@CLAPPER_API@_EXPORT +#else +#define _@CLAPPER_API@_VISIBILITY _@CLAPPER_API@_IMPORT +#endif + +#define @CLAPPER_API@_API _@CLAPPER_API@_VISIBILITY +#define @CLAPPER_API@_DEPRECATED G_DEPRECATED _@CLAPPER_API@_VISIBILITY +#define @CLAPPER_API@_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _@CLAPPER_API@_VISIBILITY