[vlc-commits] lib: merge event_internal.h into event.c
Rémi Denis-Courmont
git at videolan.org
Wed Aug 5 20:31:27 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Aug 5 20:18:30 2015 +0300| [b80a4563a2bf24348d30fb0ed88014ca2c3dc305] | committer: Rémi Denis-Courmont
lib: merge event_internal.h into event.c
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b80a4563a2bf24348d30fb0ed88014ca2c3dc305
---
lib/Makefile.am | 1 -
lib/event.c | 75 +++++++++++++++++++++++++++++++++---
lib/event_internal.h | 103 --------------------------------------------------
3 files changed, 70 insertions(+), 109 deletions(-)
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 32b344d..a32260d 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -32,7 +32,6 @@ lib_LTLIBRARIES = libvlc.la
libvlc_la_SOURCES = \
libvlc_internal.h \
- event_internal.h \
media_internal.h \
media_list_internal.h \
media_player_internal.h \
diff --git a/lib/event.c b/lib/event.c
index d848cf0..5a37f15 100644
--- a/lib/event.c
+++ b/lib/event.c
@@ -26,14 +26,79 @@
# include "config.h"
#endif
-#define LIBVLC_EVENT_TYPES_KEEP_DEFINE
-#include <vlc/libvlc.h>
-
-#include "libvlc_internal.h"
-#include "event_internal.h"
#include <assert.h>
#include <errno.h>
+#include <vlc/libvlc.h>
+#include "libvlc_internal.h"
+
+#include <vlc_common.h>
+
+/*
+ * Event Handling
+ */
+
+/* Example usage
+ *
+ * struct libvlc_cool_object_t
+ * {
+ * ...
+ * libvlc_event_manager_t * p_event_manager;
+ * ...
+ * }
+ *
+ * libvlc_my_cool_object_new()
+ * {
+ * ...
+ * p_self->p_event_manager = libvlc_event_manager_new( p_self )
+ * libvlc_event_manager_register_event_type(p_self->p_event_manager,
+ * libvlc_MyCoolObjectDidSomething, p_e)
+ * ...
+ * }
+ *
+ * libvlc_my_cool_object_release()
+ * {
+ * ...
+ * libvlc_event_manager_release( p_self->p_event_manager );
+ * ...
+ * }
+ *
+ * libvlc_my_cool_object_do_something()
+ * {
+ * ...
+ * libvlc_event_t event;
+ * event.type = libvlc_MyCoolObjectDidSomething;
+ * event.u.my_cool_object_did_something.what_it_did = kSomething;
+ * libvlc_event_send( p_self->p_event_manager, &event );
+ * }
+ * */
+
+typedef struct libvlc_event_listener_t
+{
+ libvlc_event_type_t event_type;
+ void * p_user_data;
+ libvlc_callback_t pf_callback;
+} libvlc_event_listener_t;
+
+typedef struct libvlc_event_manager_t
+{
+ void * p_obj;
+ vlc_array_t listeners_groups;
+ vlc_mutex_t object_lock;
+ vlc_mutex_t event_sending_lock;
+} libvlc_event_sender_t;
+
+
+static inline bool
+listeners_are_equal( libvlc_event_listener_t * listener1,
+ libvlc_event_listener_t * listener2 )
+{
+ return listener1->event_type == listener2->event_type &&
+ listener1->pf_callback == listener2->pf_callback &&
+ listener1->p_user_data == listener2->p_user_data;
+}
+
+
typedef struct libvlc_event_listeners_group_t
{
libvlc_event_type_t event_type;
diff --git a/lib/event_internal.h b/lib/event_internal.h
deleted file mode 100644
index 9164228..0000000
--- a/lib/event_internal.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*****************************************************************************
- * event_internal.h : Definition of opaque structures for libvlc exported API
- * Also contains some internal utility functions
- *****************************************************************************
- * Copyright (C) 2005-2009 VLC authors and VideoLAN
- * $Id$
- *
- * Authors: Clément Stenac <zorglub at videolan.org>
- *
- * This program 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 program 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 program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef _LIBVLC_EVENT_H
-#define _LIBVLC_EVENT_H 1
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vlc/libvlc_structures.h>
-#include <vlc/libvlc.h>
-#include <vlc/libvlc_events.h>
-
-#include <vlc_common.h>
-
-
-/*
- * Event Handling
- */
-
-/* Example usage
- *
- * struct libvlc_cool_object_t
- * {
- * ...
- * libvlc_event_manager_t * p_event_manager;
- * ...
- * }
- *
- * libvlc_my_cool_object_new()
- * {
- * ...
- * p_self->p_event_manager = libvlc_event_manager_new( p_self )
- * libvlc_event_manager_register_event_type(p_self->p_event_manager,
- * libvlc_MyCoolObjectDidSomething, p_e)
- * ...
- * }
- *
- * libvlc_my_cool_object_release()
- * {
- * ...
- * libvlc_event_manager_release( p_self->p_event_manager );
- * ...
- * }
- *
- * libvlc_my_cool_object_do_something()
- * {
- * ...
- * libvlc_event_t event;
- * event.type = libvlc_MyCoolObjectDidSomething;
- * event.u.my_cool_object_did_something.what_it_did = kSomething;
- * libvlc_event_send( p_self->p_event_manager, &event );
- * }
- * */
-
-typedef struct libvlc_event_listener_t
-{
- libvlc_event_type_t event_type;
- void * p_user_data;
- libvlc_callback_t pf_callback;
-} libvlc_event_listener_t;
-
-typedef struct libvlc_event_manager_t
-{
- void * p_obj;
- vlc_array_t listeners_groups;
- vlc_mutex_t object_lock;
- vlc_mutex_t event_sending_lock;
-} libvlc_event_sender_t;
-
-
-static inline bool
-listeners_are_equal( libvlc_event_listener_t * listener1,
- libvlc_event_listener_t * listener2 )
-{
- return listener1->event_type == listener2->event_type &&
- listener1->pf_callback == listener2->pf_callback &&
- listener1->p_user_data == listener2->p_user_data;
-}
-
-#endif
More information about the vlc-commits
mailing list