Commit 91879548 authored by W. Michael Petullo's avatar W. Michael Petullo

Some work related to GObject introspection (there is a lot of work remaining)

Signed-off-by: W. Michael Petullo's avatarW. Michael Petullo <mike@flyn.org>
parent 1da947bf
......@@ -18,6 +18,10 @@ Documentation:
= Mid term =====================================================================
Fix callbacks so that they do not provide a gpointer (see service-added
callback). They need to provide a proper GObject type (e.g., a new
DMAPMdnsBrowserService type) so that Python/GObject introspection works.
Noah: Comment purpose of each source file and describe interfaces, using test
programs as examples (Note: wait on doxygen vs. gtk-doc decision.
......
......@@ -37,6 +37,8 @@ AM_PROG_CC_STDC
AC_HEADER_STDC
AC_PROG_LIBTOOL
GOBJECT_INTROSPECTION_CHECK([1.30.0])
GTK_DOC_CHECK(1.0)
AC_CONFIG_MACRO_DIR(m4)
......
Name: libdmapsharing
Version: 2.9.23
Version: 2.9.24
Release: 1%{?dist}
License: LGPLv2+
Source: http://www.flyn.org/projects/libdmapsharing/%{name}-%{version}.tar.gz
URL: http://www.flyn.org/projects/libdmapsharing/
Summary: A DMAP client and server library
Group: Development/Libraries
BuildRequires: pkgconfig, glib2-devel, libsoup-devel >= 2.32
BuildRequires: pkgconfig, glib2-devel, libsoup-devel >= 2.32 gobject-introspection-devel
BuildRequires: avahi-glib-devel, gdk-pixbuf2-devel, gstreamer1-plugins-base-devel
%description
......@@ -15,6 +15,7 @@ DAAP and DPAP.
%files
%{_libdir}/libdmapsharing-3.0.so.*
%{_libdir}/girepository-1.0/DMAP*.typelib
%doc AUTHORS COPYING ChangeLog NEWS README
......@@ -32,6 +33,7 @@ other resources needed for developing applications using libdmapsharing.
%{_libdir}/pkgconfig/libdmapsharing-3.0.pc
%{_includedir}/libdmapsharing-3.0/
%{_libdir}/libdmapsharing-3.0.so
%{_datadir}/gir-1.0/DMAP*.gir
%{_datadir}/gtk-doc/html/libdmapsharing-3.0
%prep
......@@ -50,6 +52,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libdmapsharing-3.0.la
%postun -p /sbin/ldconfig
%changelog
* Sat Nov 23 2013 W. Michael Petullo <mike[@]flyn.org> - 2.9.24-1
- new upstream version
* Fri Jul 05 2013 W. Michael Petullo <mike[@]flyn.org> - 2.9.18-1
- new upstream version
......
......@@ -60,6 +60,7 @@ libdmapsharing_3_0_la_CFLAGS = \
libdmapsharing_3_0_la_LDFLAGS = \
-version-info @SO_VERSION@ \
$(CHECK_LIBS) \
$(GLIB_LIBS) \
$(GTHREAD_LIBS) \
$(GOBJECT_LIBS) \
......@@ -135,4 +136,32 @@ dmap-enums.c: $(libdmapsharinginclude_headers) Makefile dmap-enums.h
CLEANFILES = $(BUILT_SOURCES)
if HAVE_INTROSPECTION
include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS = --symbol-prefix=dmap --add-include-path=$(srcdir) --warn-all
INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
introspection_sources = $(libdmapsharinginclude_HEADERS) $(libdmapsharinginclude_SOURCES)
DMAP-3.0.gir: libdmapsharing-3.0.la
DMAP_3_0_gir_INCLUDES = GObject-2.0 Soup-2.4
DMAP_3_0_gir_CFLAGS = \
$(INCLUDES) \
$(libdmapsharing_3_0_la_CFLAGS)
DMAP_3_0_gir_LIBS = \
libdmapsharing-3.0.la
DMAP_3_0_gir_FILES = $(introspection_sources)
INTROSPECTION_GIRS += DMAP-3.0.gir
girdir = $(datadir)/gir-1.0
gir_DATA = $(INTROSPECTION_GIRS)
typelibdir = $(libdir)/girepository-1.0
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif
EXTRA_DIST = dmap-marshal.list
......@@ -185,7 +185,7 @@ daap_share_message_add_standard_headers (DMAPShare * share,
SoupMessage * message)
{
soup_message_headers_append (message->response_headers, "DMAP-Server",
"libdmapsharing" VERSION);
"libdmapsharing" "VERSION");
}
#define DMAP_VERSION 2.0
......
......@@ -91,13 +91,13 @@ struct _DACPPlayerIface
GType dacp_player_get_type (void);
/**
* dacp_player_now_playing_record
* dacp_player_now_playing_record:
* @player: a player
*/
DAAPRecord *dacp_player_now_playing_record (DACPPlayer * player);
/**
* dacp_player_now_playing_artwork
* dacp_player_now_playing_artwork:
* @player: a player
* @width: width
* @height: height
......@@ -106,37 +106,37 @@ guchar *dacp_player_now_playing_artwork (DACPPlayer * player,
guint width, guint height);
/**
* dacp_player_play_pause
* dacp_player_play_pause:
* @player: a player
*/
void dacp_player_play_pause (DACPPlayer * player);
/**
* dacp_player_pause
* dacp_player_pause:
* @player: a player
*/
void dacp_player_pause (DACPPlayer * player);
/**
* dacp_player_next_item
* dacp_player_next_item:
* @player: a player
*/
void dacp_player_next_item (DACPPlayer * player);
/**
* dacp_player_now_prev_item
* dacp_player_now_prev_item:
* @player: a player
*/
void dacp_player_prev_item (DACPPlayer * player);
/**
* dacp_player_cue_clear
* dacp_player_cue_clear:
* @player: a player
*/
void dacp_player_cue_clear (DACPPlayer * player);
/**
* dacp_player_cue_play
* dacp_player_cue_play:
* @player: a player
* @records : a list of records
* @index: an index
......
......@@ -167,7 +167,7 @@ SoupMessage *dmap_connection_build_message (DMAPConnection * connection,
gint req_id, gboolean send_close);
/**
* dmap_connection_authenticate_message
* dmap_connection_authenticate_message:
* @connection: A #DMAPConnection
* @session: A #SoupSession
* @message: A #SoupMessage
......
......@@ -103,7 +103,7 @@ DMAPContainerRecord *dmap_container_db_lookup_by_id (DMAPContainerDb * db,
/**
* dmap_container_db_foreach:
* @db: A container database.
* @fn: The function to apply to each record in the database.
* @func: The function to apply to each record in the database.
* @data: User data to pass to the function.
*
* Apply a function to each record in a container database.
......
......@@ -268,7 +268,7 @@ apply_filter (gpointer id, DMAPRecord * record, gpointer data)
for (list = fd->filter_def; list != NULL; list = list->next) {
for (filter = list->data; filter != NULL;
filter = filter->next) {
FilterDefinition *def = filter->data;
DMAPDbFilterDefinition *def = filter->data;
const gchar *property_name;
query_key = def->key;
......
......@@ -79,12 +79,12 @@ struct _DMAPDbIface
typedef const char *(*RecordGetValueFunc) (DMAPRecord * record);
typedef struct FilterDefinition
typedef struct DMAPDbFilterDefinition
{
gchar *key;
gchar *value;
gboolean negate;
} FilterDefinition;
} DMAPDbFilterDefinition;
GType dmap_db_get_type (void);
......@@ -104,7 +104,7 @@ GType dmap_db_get_type (void);
guint dmap_db_add (DMAPDb * db, DMAPRecord * record);
/**
* dmap_db_add:
* dmap_db_add_with_id:
* @db: A media database.
* @record: A database record.
* @id: A database record ID.
......@@ -165,7 +165,7 @@ guint dmap_db_lookup_id_by_location (const DMAPDb * db,
/**
* dmap_db_foreach:
* @db: A media database.
* @fn: The function to apply to each record in the database.
* @func: The function to apply to each record in the database.
* @data: User data to pass to the function.
*
* Apply a function to each record in a media database.
......
......@@ -181,5 +181,13 @@ G_CONST_RETURN GSList *dmap_mdns_browser_get_services (DMAPMdnsBrowser *
DMAPMdnsBrowserServiceType dmap_mdns_browser_get_service_type (DMAPMdnsBrowser
* browser);
/**
* DMAPMdnsBrowser::service-added:
* @browser: the #DMAPMdnsBrowser which received the signal.
* @service: #DMAPMdnsBrowserService
*
* Emitted each time a service becomes available to @browser
*/
G_END_DECLS
#endif
......@@ -49,7 +49,7 @@ G_BEGIN_DECLS
#define IS_DMAP_RECORD(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), \
DMAP_TYPE_RECORD))
/**
* DAAP_RECORD_GET_INTERFACE:
* DMAP_RECORD_GET_INTERFACE:
* @o: a #DAAPRecord instance.
*
* Get the class structure associated to a #DAAPRecord instance.
......
......@@ -1295,7 +1295,7 @@ _dmap_share_build_filter (gchar * filterstr)
gboolean negate;
gint parentheses_count;
gint quotes_count;
FilterDefinition *def;
DMAPDbFilterDefinition *def;
GSList *list = NULL;
GSList *filter = NULL;
......@@ -1419,11 +1419,11 @@ _dmap_share_build_filter (gchar * filterstr)
} else if (value != NULL && *next_char != '!') {
// If we won't accept this character, we are ending a
// query key or value, so we should save them in a new
// FilterDefinition. If is_value is TRUE, we will still
// DMAPDbFilterDefinition. If is_value is TRUE, we will still
// parse the query value, so we must keep our def around.
// Otherwise, save it in the list of filters.
if (!def) {
def = g_new0 (FilterDefinition, 1);
def = g_new0 (DMAPDbFilterDefinition, 1);
}
if (is_key) {
def->key = value->str;
......@@ -1468,8 +1468,8 @@ _dmap_share_build_filter (gchar * filterstr)
for (ptr1 = list; ptr1 != NULL; ptr1 = ptr1->next) {
for (ptr2 = ptr1->data; ptr2 != NULL; ptr2 = ptr2->next) {
g_debug ("%s = %s",
((FilterDefinition *) ptr2->data)->key,
((FilterDefinition *) ptr2->data)->value);
((DMAPDbFilterDefinition *) ptr2->data)->key,
((DMAPDbFilterDefinition *) ptr2->data)->value);
}
}
......@@ -1483,7 +1483,7 @@ dmap_share_free_filter (GSList * filter)
for (ptr1 = filter; ptr1 != NULL; ptr1 = ptr1->next) {
for (ptr2 = ptr1->data; ptr2 != NULL; ptr2 = ptr2->next) {
g_free (((FilterDefinition *) ptr2->data)->value);
g_free (((DMAPDbFilterDefinition *) ptr2->data)->value);
g_free (ptr2->data);
}
}
......
......@@ -191,7 +191,7 @@ dpap_share_message_add_standard_headers (DMAPShare * share,
SoupMessage * message)
{
soup_message_headers_append (message->response_headers, "DPAP-Server",
"libdmapsharing" VERSION);
"libdmapsharing" "VERSION");
}
#define DMAP_VERSION 2.0
......
dnl -*- mode: autoconf -*-
dnl Copyright 2009 Johan Dahlin
dnl
dnl This file is free software; the author(s) gives unlimited
dnl permission to copy and/or distribute it, with or without
dnl modifications, as long as this notice is preserved.
dnl
# serial 1
m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
[
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
dnl enable/disable introspection
m4_if([$2], [require],
[dnl
enable_introspection=yes
],[dnl
AC_ARG_ENABLE(introspection,
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
[Enable introspection for this build]),,
[enable_introspection=auto])
])dnl
AC_MSG_CHECKING([for gobject-introspection])
dnl presence/version checking
AS_CASE([$enable_introspection],
[no], [dnl
found_introspection="no (disabled, use --enable-introspection to enable)"
],dnl
[yes],[dnl
PKG_CHECK_EXISTS([gobject-introspection-1.0],,
AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
found_introspection=yes,
AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
],dnl
[auto],[dnl
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
dnl Canonicalize enable_introspection
enable_introspection=$found_introspection
],dnl
[dnl
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
])dnl
AC_MSG_RESULT([$found_introspection])
INTROSPECTION_SCANNER=
INTROSPECTION_COMPILER=
INTROSPECTION_GENERATE=
INTROSPECTION_GIRDIR=
INTROSPECTION_TYPELIBDIR=
if test "x$found_introspection" = "xyes"; then
INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
fi
AC_SUBST(INTROSPECTION_SCANNER)
AC_SUBST(INTROSPECTION_COMPILER)
AC_SUBST(INTROSPECTION_GENERATE)
AC_SUBST(INTROSPECTION_GIRDIR)
AC_SUBST(INTROSPECTION_TYPELIBDIR)
AC_SUBST(INTROSPECTION_CFLAGS)
AC_SUBST(INTROSPECTION_LIBS)
AC_SUBST(INTROSPECTION_MAKEFILE)
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
])
dnl Usage:
dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
[
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
])
dnl Usage:
dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
[
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
])
......@@ -95,7 +95,7 @@ private class ValaDPAPRecord : GLib.Object, DMAP.Record, DPAP.Record {
GLib.error ("read not implemented");
}
public unowned DMAP.Record set_from_blob (GLib.ByteArray blob) {
public unowned bool set_from_blob (GLib.ByteArray blob) {
GLib.error ("set_from_blob not implemented");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment