interfaces: clean up

Remove deprecated bits
Fix FIXMES
Indent
Add padding
This commit is contained in:
Wim Taymans 2011-11-11 18:49:09 +01:00
parent 40be2eec9f
commit 7fb914d5b6
14 changed files with 107 additions and 197 deletions

View file

@ -28,7 +28,6 @@
G_BEGIN_DECLS
/* FIXME 0.11: remove all CLASS bits, this is an interface */
#define GST_TYPE_COLOR_BALANCE \
(gst_color_balance_get_type ())
#define GST_COLOR_BALANCE(obj) \
@ -38,7 +37,7 @@ G_BEGIN_DECLS
#define GST_COLOR_BALANCE_GET_INTERFACE(inst) \
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_COLOR_BALANCE, GstColorBalanceInterface))
#define GST_COLOR_BALANCE_TYPE(klass) (klass->balance_type)
#define GST_COLOR_BALANCE_TYPE(iface) (iface->balance_type)
typedef struct _GstColorBalance GstColorBalance;
typedef struct _GstColorBalanceInterface GstColorBalanceInterface;
@ -63,7 +62,7 @@ typedef enum
/**
* GstColorBalanceInterface:
* @klass: the parent interface
* @iface: the parent interface
* @balance_type: implementation type
* @list_channels: list handled channels
* @set_value: set a channel value
@ -73,7 +72,7 @@ typedef enum
* Color-balance interface.
*/
struct _GstColorBalanceInterface {
GTypeInterface klass;
GTypeInterface iface;
GstColorBalanceType balance_type;

View file

@ -55,11 +55,14 @@ struct _GstColorBalanceChannel {
gchar *label;
gint min_value;
gint max_value;
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
};
/**
* GstColorBalanceChannelClass:
* @parent: the parent interface
* @parent: the parent class
* @value_changed: default handler for value changed notification
*
* Color-balance channel class.

View file

@ -53,20 +53,6 @@
/* FIXME 0.11: check if we need to add API for sometimes-supportedness
* (aka making up for GstImplementsInterface removal) */
#ifndef GST_DISABLE_DEPRECATED
enum
{
SIGNAL_MUTE_TOGGLED,
SIGNAL_RECORD_TOGGLED,
SIGNAL_VOLUME_CHANGED,
SIGNAL_OPTION_CHANGED,
LAST_SIGNAL
};
static guint gst_mixer_signals[LAST_SIGNAL] = { 0 };
#endif
static void gst_mixer_class_init (GstMixerInterface * iface);
GType
@ -97,44 +83,6 @@ gst_mixer_get_type (void)
static void
gst_mixer_class_init (GstMixerInterface * iface)
{
#ifndef GST_DISABLE_DEPRECATED
static gboolean initialized = FALSE;
/* signals (deprecated) */
if (!initialized) {
gst_mixer_signals[SIGNAL_RECORD_TOGGLED] =
g_signal_new ("record-toggled",
GST_TYPE_MIXER, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstMixerInterface, record_toggled),
NULL, NULL,
gst_interfaces_marshal_VOID__OBJECT_BOOLEAN, G_TYPE_NONE, 2,
GST_TYPE_MIXER_TRACK, G_TYPE_BOOLEAN);
gst_mixer_signals[SIGNAL_MUTE_TOGGLED] =
g_signal_new ("mute-toggled",
GST_TYPE_MIXER, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstMixerInterface, mute_toggled),
NULL, NULL,
gst_interfaces_marshal_VOID__OBJECT_BOOLEAN, G_TYPE_NONE, 2,
GST_TYPE_MIXER_TRACK, G_TYPE_BOOLEAN);
gst_mixer_signals[SIGNAL_VOLUME_CHANGED] =
g_signal_new ("volume-changed",
GST_TYPE_MIXER, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstMixerInterface, volume_changed),
NULL, NULL,
gst_interfaces_marshal_VOID__OBJECT_POINTER, G_TYPE_NONE, 2,
GST_TYPE_MIXER_TRACK, G_TYPE_POINTER);
gst_mixer_signals[SIGNAL_OPTION_CHANGED] =
g_signal_new ("option-changed",
GST_TYPE_MIXER, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstMixerInterface, option_changed),
NULL, NULL,
gst_interfaces_marshal_VOID__OBJECT_STRING, G_TYPE_NONE, 2,
GST_TYPE_MIXER_OPTIONS, G_TYPE_STRING);
initialized = TRUE;
}
#endif
iface->mixer_type = GST_MIXER_SOFTWARE;
/* default virtual functions */

View file

@ -29,8 +29,6 @@
G_BEGIN_DECLS
/* FIXME 0.11: remove all CLASS bits, this is an interface */
#define GST_TYPE_MIXER \
(gst_mixer_get_type ())
#define GST_MIXER(obj) \
@ -40,7 +38,7 @@ G_BEGIN_DECLS
#define GST_MIXER_GET_INTERFACE(inst) \
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_MIXER, GstMixerInterface))
#define GST_MIXER_TYPE(klass) (klass->mixer_type)
#define GST_MIXER_TYPE(iface) (iface->mixer_type)
typedef struct _GstMixer GstMixer;
typedef struct _GstMixerInterface GstMixerInterface;
@ -113,7 +111,7 @@ typedef enum
} GstMixerFlags;
struct _GstMixerInterface {
GTypeInterface klass;
GTypeInterface iface;
GstMixerType mixer_type;
@ -133,39 +131,16 @@ struct _GstMixerInterface {
void (* set_record) (GstMixer *mixer,
GstMixerTrack *track,
gboolean record);
#ifndef GST_DISABLE_DEPRECATED
/* signals (deprecated) */
void (* mute_toggled) (GstMixer *mixer,
GstMixerTrack *channel,
gboolean mute);
void (* record_toggled) (GstMixer *mixer,
GstMixerTrack *channel,
gboolean record);
void (* volume_changed) (GstMixer *mixer,
GstMixerTrack *channel,
gint *volumes);
#else
gpointer padding1[3];
#endif /* not GST_DISABLE_DEPRECATED */
void (* set_option) (GstMixer *mixer,
void (* set_option) (GstMixer *mixer,
GstMixerOptions *opts,
gchar *value);
const gchar * (* get_option) (GstMixer *mixer,
const gchar * (* get_option) (GstMixer *mixer,
GstMixerOptions *opts);
#ifndef GST_DISABLE_DEPRECATED
void (* option_changed) (GstMixer *mixer,
GstMixerOptions *opts,
gchar *option);
#else
gpointer padding2;
#endif /* not GST_DISABLE_DEPRECATED */
GstMixerFlags (* get_mixer_flags) (GstMixer *mixer);
/*< private >*/
gpointer _gst_reserved[GST_PADDING-1];
gpointer _gst_reserved[GST_PADDING];
};
GType gst_mixer_get_type (void);

View file

@ -67,22 +67,16 @@ struct _GstMixerOptions {
/**
* GstMixerOptionsClass:
* @parent: the parent interface
* @parent: the parent class
* @get_values: Optional implementation of gst_mixer_options_get_values().
* (Since: 0.10.18)
*/
struct _GstMixerOptionsClass {
GstMixerTrackClass parent;
#ifdef GST_MIXER_NEED_DEPRECATED
/* signals */
void (* option_changed) (GstMixerOptions *opts,
gchar *value);
#endif /* GST_MIXER_NEED_DEPRECATED */
GList * (* get_values) (GstMixerOptions *opts);
gpointer _gst_reserved[GST_PADDING-1];
gpointer _gst_reserved[GST_PADDING];
};
GType gst_mixer_options_get_type (void);

View file

@ -75,21 +75,19 @@ G_BEGIN_DECLS
* Mixer track flags.
*/
typedef enum {
GST_MIXER_TRACK_INPUT = (1<<0),
GST_MIXER_TRACK_OUTPUT = (1<<1),
GST_MIXER_TRACK_MUTE = (1<<2),
GST_MIXER_TRACK_RECORD = (1<<3),
GST_MIXER_TRACK_MASTER = (1<<4),
GST_MIXER_TRACK_SOFTWARE = (1<<5),
GST_MIXER_TRACK_NO_RECORD = (1<<6),
GST_MIXER_TRACK_NO_MUTE = (1<<7),
GST_MIXER_TRACK_WHITELIST = (1<<8),
GST_MIXER_TRACK_READONLY = (1<<9),
GST_MIXER_TRACK_WRITEONLY = (1<<10)
GST_MIXER_TRACK_INPUT = (1 << 0),
GST_MIXER_TRACK_OUTPUT = (1 << 1),
GST_MIXER_TRACK_MUTE = (1 << 2),
GST_MIXER_TRACK_RECORD = (1 << 3),
GST_MIXER_TRACK_MASTER = (1 << 4),
GST_MIXER_TRACK_SOFTWARE = (1 << 5),
GST_MIXER_TRACK_NO_RECORD = (1 << 6),
GST_MIXER_TRACK_NO_MUTE = (1 << 7),
GST_MIXER_TRACK_WHITELIST = (1 << 8),
GST_MIXER_TRACK_READABLE = (1 << 9),
GST_MIXER_TRACK_WRITABLE = (1 << 10)
} GstMixerTrackFlags;
/* FIXME 0.11: READONLY/WRITEONLY -> READABLE/WRITABLE etc. */
#define GST_MIXER_TRACK_HAS_FLAG(channel, flag) \
((channel)->flags & flag)
@ -101,29 +99,18 @@ struct _GstMixerTrack {
gchar *label;
/* FIXME 0.11: flags should be guint32 */
GstMixerTrackFlags flags;
gint num_channels;
gint min_volume;
gint max_volume;
/* FIXME 0.11: add padding */
gpointer _gst_reserved[GST_PADDING];
};
struct _GstMixerTrackClass {
GObjectClass parent;
#ifdef GST_MIXER_NEED_DEPRECATED
/* signals (deprecated) */
void (* mute_toggled) (GstMixerTrack *channel,
gboolean mute);
void (* record_toggled) (GstMixerTrack *channel,
gboolean record);
void (* volume_changed) (GstMixerTrack *channel,
gint *volumes);
#endif /* GST_MIXER_NEED_DEPRECATED */
gpointer _gst_reserved[GST_PADDING];
};

View file

@ -41,13 +41,13 @@ typedef struct _GstNavigationInterface GstNavigationInterface;
/**
* GstNavigationInterface:
* @g_iface: the parent interface
* @iface: the parent interface
* @send_event: sending a navigation event
*
* Color-balance interface.
*/
struct _GstNavigationInterface {
GTypeInterface g_iface;
GTypeInterface iface;
/* virtual functions */
void (*send_event) (GstNavigation *navigation, GstStructure *structure);
@ -155,20 +155,20 @@ typedef enum
GstNavigationQueryType gst_navigation_query_get_type (GstQuery *query);
GstQuery *gst_navigation_query_new_commands (void);
void gst_navigation_query_set_commands (GstQuery *query, gint n_cmds, ...);
void gst_navigation_query_set_commandsv (GstQuery *query, gint n_cmds,
GstNavigationCommand *cmds);
gboolean gst_navigation_query_parse_commands_length (GstQuery *query,
guint *n_cmds);
gboolean gst_navigation_query_parse_commands_nth (GstQuery *query, guint nth,
GstNavigationCommand *cmd);
GstQuery * gst_navigation_query_new_commands (void);
void gst_navigation_query_set_commands (GstQuery *query, gint n_cmds, ...);
void gst_navigation_query_set_commandsv (GstQuery *query, gint n_cmds,
GstNavigationCommand *cmds);
gboolean gst_navigation_query_parse_commands_length (GstQuery *query,
guint *n_cmds);
gboolean gst_navigation_query_parse_commands_nth (GstQuery *query, guint nth,
GstNavigationCommand *cmd);
GstQuery *gst_navigation_query_new_angles (void);
void gst_navigation_query_set_angles (GstQuery *query, guint cur_angle,
guint n_angles);
gboolean gst_navigation_query_parse_angles (GstQuery *query, guint *cur_angle,
guint *n_angles);
GstQuery * gst_navigation_query_new_angles (void);
void gst_navigation_query_set_angles (GstQuery *query, guint cur_angle,
guint n_angles);
gboolean gst_navigation_query_parse_angles (GstQuery *query, guint *cur_angle,
guint *n_angles);
/* Element messages */
/**
@ -198,19 +198,19 @@ typedef enum {
GstNavigationMessageType gst_navigation_message_get_type (GstMessage *message);
GstMessage *gst_navigation_message_new_mouse_over (GstObject *src,
gboolean active);
gboolean gst_navigation_message_parse_mouse_over (GstMessage *message,
gboolean *active);
GstMessage * gst_navigation_message_new_mouse_over (GstObject *src,
gboolean active);
gboolean gst_navigation_message_parse_mouse_over (GstMessage *message,
gboolean *active);
GstMessage *gst_navigation_message_new_commands_changed (GstObject *src);
GstMessage * gst_navigation_message_new_commands_changed (GstObject *src);
GstMessage *gst_navigation_message_new_angles_changed (GstObject *src,
guint cur_angle,
guint n_angles);
gboolean gst_navigation_message_parse_angles_changed (GstMessage *message,
guint *cur_angle,
guint *n_angles);
GstMessage * gst_navigation_message_new_angles_changed (GstObject *src,
guint cur_angle,
guint n_angles);
gboolean gst_navigation_message_parse_angles_changed (GstMessage *message,
guint *cur_angle,
guint *n_angles);
/* event parsing functions */
/**
@ -248,25 +248,26 @@ typedef enum {
GST_NAVIGATION_EVENT_COMMAND = 6
} GstNavigationEventType;
GstNavigationEventType gst_navigation_event_get_type (GstEvent *event);
gboolean gst_navigation_event_parse_key_event (GstEvent *event,
const gchar **key);
gboolean gst_navigation_event_parse_mouse_button_event (GstEvent *event,
gint *button, gdouble *x, gdouble *y);
gboolean gst_navigation_event_parse_mouse_move_event (GstEvent *event,
gdouble *x, gdouble *y);
gboolean gst_navigation_event_parse_command (GstEvent *event,
GstNavigationCommand *command);
GstNavigationEventType gst_navigation_event_get_type (GstEvent *event);
gboolean gst_navigation_event_parse_key_event (GstEvent *event,
const gchar **key);
gboolean gst_navigation_event_parse_mouse_button_event (GstEvent *event,
gint *button, gdouble *x, gdouble *y);
gboolean gst_navigation_event_parse_mouse_move_event (GstEvent *event,
gdouble *x, gdouble *y);
gboolean gst_navigation_event_parse_command (GstEvent *event,
GstNavigationCommand *command);
/* interface virtual function wrappers */
void gst_navigation_send_event (GstNavigation *navigation,
GstStructure *structure);
void gst_navigation_send_key_event (GstNavigation *navigation,
const char *event, const char *key);
void gst_navigation_send_mouse_event (GstNavigation *navigation,
const char *event, int button, double x, double y);
void gst_navigation_send_command (GstNavigation *navigation,
GstNavigationCommand command);
void gst_navigation_send_event (GstNavigation *navigation,
GstStructure *structure);
void gst_navigation_send_key_event (GstNavigation *navigation,
const char *event, const char *key);
void gst_navigation_send_mouse_event (GstNavigation *navigation,
const char *event, int button, double x, double y);
void gst_navigation_send_command (GstNavigation *navigation,
GstNavigationCommand command);
G_END_DECLS

View file

@ -45,7 +45,7 @@ typedef struct _GstPropertyProbeInterface GstPropertyProbeInterface;
/**
* GstPropertyProbeInterface:
* @klass: parent interface type.
* @iface: parent interface type.
* @probe_needed: default signal handler
* @get_properties: virtual method to get list of probable properties
* @needs_probe: virtual method to tell if probe need update
@ -55,7 +55,7 @@ typedef struct _GstPropertyProbeInterface GstPropertyProbeInterface;
* #GstPropertyProbe interface.
*/
struct _GstPropertyProbeInterface {
GTypeInterface klass;
GTypeInterface iface;
/* signals */
void (*probe_needed) (GstPropertyProbe *probe,

View file

@ -41,7 +41,7 @@ typedef struct _GstStreamVolume GstStreamVolume;
typedef struct _GstStreamVolumeInterface GstStreamVolumeInterface;
struct _GstStreamVolumeInterface {
GTypeInterface parent;
GTypeInterface iface;
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
@ -58,7 +58,7 @@ struct _GstStreamVolumeInterface {
*
* Formulas to convert from a linear to a cubic or dB volume are
* cbrt(val) and 20 * log10 (val).
*
*
* Since: 0.10.25
*/
typedef enum {

View file

@ -29,8 +29,6 @@
G_BEGIN_DECLS
/* FIXME 0.11: remove all CLASS bits, this is an interface */
#define GST_TYPE_TUNER \
(gst_tuner_get_type ())
#define GST_TUNER(obj) \
@ -45,7 +43,7 @@ typedef struct _GstTunerInterface GstTunerInterface;
/**
* GstTunerInterface:
* @klass: the parent interface
* @iface: the parent interface
* @list_channels: list available channels
* @set_channel: set to a channel
* @get_channel: return the current channel
@ -63,7 +61,7 @@ typedef struct _GstTunerInterface GstTunerInterface;
* Tuner interface.
*/
struct _GstTunerInterface {
GTypeInterface klass;
GTypeInterface iface;
/* virtual functions */
const GList * (* list_channels) (GstTuner *tuner);

View file

@ -49,7 +49,7 @@ typedef struct _GstTunerChannelClass GstTunerChannelClass;
* @GST_TUNER_CHANNEL_FREQUENCY: The channel has a frequency setting
* and signal strength.
* @GST_TUNER_CHANNEL_AUDIO: The channel carries audio.
*
*
* An enumeration for flags indicating the available capabilities
* of a #GstTunerChannel.
*/
@ -64,7 +64,7 @@ typedef enum {
* GST_TUNER_CHANNEL_HAS_FLAG:
* @channel: A #GstTunerChannel
* @flag: The flag to check for
*
*
* Macro to check if the given flag is set on a channel
*/
#define GST_TUNER_CHANNEL_HAS_FLAG(channel, flag) \
@ -91,6 +91,9 @@ struct _GstTunerChannel {
gulong max_frequency;
gint min_signal;
gint max_signal;
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
};
struct _GstTunerChannelClass {

View file

@ -52,6 +52,8 @@ struct _GstTunerNorm {
/*< public >*/
gchar *label;
GValue framerate;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstTunerNormClass {

View file

@ -46,7 +46,7 @@ typedef struct _GstVideoOrientationInterface GstVideoOrientationInterface;
/**
* GstVideoOrientationInterface:
* @parent: parent interface type.
* @iface: parent interface type.
* @get_hflip: virtual method to get horizontal flipping state
* @get_vflip: virtual method to get vertical flipping state
* @get_hcenter: virtual method to get horizontal centering state
@ -59,7 +59,7 @@ typedef struct _GstVideoOrientationInterface GstVideoOrientationInterface;
* #GstVideoOrientationInterface interface.
*/
struct _GstVideoOrientationInterface {
GTypeInterface parent;
GTypeInterface iface;
/* FIXME 0.11: fix awkward API? add some kind of get_supported flags thing
* and then just return booleans/int from all vfuncs requiring the caller

View file

@ -45,7 +45,7 @@ typedef struct _GstVideoOverlayInterface GstVideoOverlayInterface;
/**
* GstVideoOverlayInterface:
* @interface: parent interface type.
* @iface: parent interface type.
* @expose: virtual method to handle expose events
* @handle_events: virtual method to handle events
* @set_render_rectangle: virtual method to set the render rectangle
@ -54,45 +54,45 @@ typedef struct _GstVideoOverlayInterface GstVideoOverlayInterface;
* #GstVideoOverlay interface
*/
struct _GstVideoOverlayInterface {
GTypeInterface interface;
GTypeInterface iface;
/* virtual functions */
void (* expose) (GstVideoOverlay *overlay);
void (*expose) (GstVideoOverlay *overlay);
void (* handle_events) (GstVideoOverlay *overlay, gboolean handle_events);
void (*handle_events) (GstVideoOverlay *overlay, gboolean handle_events);
void (* set_render_rectangle) (GstVideoOverlay *overlay,
gint x, gint y,
gint width, gint height);
void (*set_render_rectangle) (GstVideoOverlay *overlay,
gint x, gint y,
gint width, gint height);
void (* set_window_handle) (GstVideoOverlay *overlay, guintptr handle);
void (*set_window_handle) (GstVideoOverlay *overlay, guintptr handle);
};
GType gst_video_overlay_get_type (void);
/* virtual function wrappers */
gboolean gst_video_overlay_set_render_rectangle (GstVideoOverlay * overlay,
gint x,
gint y,
gint width,
gint height);
gboolean gst_video_overlay_set_render_rectangle (GstVideoOverlay * overlay,
gint x,
gint y,
gint width,
gint height);
void gst_video_overlay_expose (GstVideoOverlay * overlay);
void gst_video_overlay_expose (GstVideoOverlay * overlay);
void gst_video_overlay_handle_events (GstVideoOverlay * overlay,
gboolean handle_events);
void gst_video_overlay_handle_events (GstVideoOverlay * overlay,
gboolean handle_events);
void gst_video_overlay_set_window_handle (GstVideoOverlay * overlay,
guintptr handle);
void gst_video_overlay_set_window_handle (GstVideoOverlay * overlay,
guintptr handle);
/* public methods to dispatch bus messages */
void gst_video_overlay_got_window_handle (GstVideoOverlay * overlay,
guintptr handle);
void gst_video_overlay_got_window_handle (GstVideoOverlay * overlay,
guintptr handle);
void gst_video_overlay_prepare_window_handle (GstVideoOverlay * overlay);
void gst_video_overlay_prepare_window_handle (GstVideoOverlay * overlay);
gboolean gst_is_video_overlay_prepare_window_handle_message (GstMessage * msg);
gboolean gst_is_video_overlay_prepare_window_handle_message (GstMessage * msg);
G_END_DECLS