1
0
Fork 0

2.0: Remove deprecated API from clutter-main.c

This commit is contained in:
Emmanuele Bassi 2012-08-24 08:33:03 +01:00
parent 0e1a651a1a
commit 0c5e99429f

View file

@ -459,28 +459,6 @@ clutter_config_read (void)
g_free (config_path);
}
/**
* clutter_get_show_fps:
*
* Returns whether Clutter should print out the frames per second on the
* console. You can enable this setting either using the
* <literal>CLUTTER_SHOW_FPS</literal> environment variable or passing
* the <literal>--clutter-show-fps</literal> command line argument. *
*
* Return value: %TRUE if Clutter should show the FPS.
*
* Since: 0.4
*
* Deprecated: 1.10: This function does not do anything. Use the environment
* variable or the configuration file to determine whether Clutter should
* print out the FPS counter on the console.
*/
gboolean
clutter_get_show_fps (void)
{
return FALSE;
}
gboolean
_clutter_context_get_show_fps (void)
{
@ -529,88 +507,6 @@ clutter_disable_accessibility (void)
clutter_enable_accessibility = FALSE;
}
/**
* clutter_redraw:
*
* Forces a redraw of the entire stage. Applications should never use this
* function, but queue a redraw using clutter_actor_queue_redraw().
*
* This function should only be used by libraries integrating Clutter from
* within another toolkit.
*
* Deprecated: 1.10: Use clutter_stage_ensure_redraw() instead.
*/
void
clutter_redraw (ClutterStage *stage)
{
g_return_if_fail (CLUTTER_IS_STAGE (stage));
clutter_stage_ensure_redraw (stage);
}
/**
* clutter_set_motion_events_enabled:
* @enable: %TRUE to enable per-actor motion events
*
* Sets whether per-actor motion events should be enabled or not on
* all #ClutterStage<!-- -->s managed by Clutter.
*
* If @enable is %FALSE the following events will not work:
* <itemizedlist>
* <listitem><para>ClutterActor::motion-event, unless on the
* #ClutterStage</para></listitem>
* <listitem><para>ClutterActor::enter-event</para></listitem>
* <listitem><para>ClutterActor::leave-event</para></listitem>
* </itemizedlist>
*
* Since: 0.6
*
* Deprecated: 1.8: Use clutter_stage_set_motion_events_enabled() instead.
*/
void
clutter_set_motion_events_enabled (gboolean enable)
{
ClutterStageManager *stage_manager;
ClutterMainContext *context;
const GSList *l;
enable = !!enable;
context = _clutter_context_get_default ();
if (context->motion_events_per_actor == enable)
return;
/* store the flag for later query and for newly created stages */
context->motion_events_per_actor = enable;
/* propagate the change to all stages */
stage_manager = clutter_stage_manager_get_default ();
for (l = clutter_stage_manager_peek_stages (stage_manager);
l != NULL;
l = l->next)
{
clutter_stage_set_motion_events_enabled (l->data, enable);
}
}
/**
* clutter_get_motion_events_enabled:
*
* Gets whether the per-actor motion events are enabled.
*
* Return value: %TRUE if the motion events are enabled
*
* Since: 0.6
*
* Deprecated: 1.8: Use clutter_stage_get_motion_events_enabled() instead.
*/
gboolean
clutter_get_motion_events_enabled (void)
{
return _clutter_context_get_motion_events_enabled ();
}
ClutterActor *
_clutter_get_actor_by_id (ClutterStage *stage,
guint32 actor_id)
@ -991,29 +887,6 @@ clutter_main (void)
CLUTTER_TIMER_STOP (uprof_get_mainloop_context (), mainloop_timer);
}
/**
* clutter_threads_init:
*
* Initialises the Clutter threading mechanism, so that Clutter API can be
* called by multiple threads, using clutter_threads_enter() and
* clutter_threads_leave() to mark the critical sections.
*
* You must call g_thread_init() before this function.
*
* This function must be called before clutter_init().
*
* It is safe to call this function multiple times.
*
* Since: 0.4
*
* Deprecated: 1.10: This function does not do anything. Threading support
* is initialized when Clutter is initialized.
*/
void
clutter_threads_init (void)
{
}
/**
* clutter_threads_set_lock_functions: (skip)
* @enter_fn: function called when aquiring the Clutter main lock
@ -1315,60 +1188,6 @@ _clutter_threads_release_lock (void)
(* clutter_threads_unlock) ();
}
/**
* clutter_threads_enter:
*
* Locks the Clutter thread lock.
*
* Since: 0.4
*
* Deprecated: 1.12: This function should not be used by application
* code; marking critical sections is not portable on various
* platforms. Instead of acquiring the Clutter lock, schedule UI
* updates from the main loop using clutter_threads_add_idle() or
* clutter_threads_add_timeout().
*/
void
clutter_threads_enter (void)
{
_clutter_threads_acquire_lock ();
}
/**
* clutter_threads_leave:
*
* Unlocks the Clutter thread lock.
*
* Since: 0.4
*
* Deprecated: 1.12: This function should not be used by application
* code; marking critical sections is not portable on various
* platforms. Instead of acquiring the Clutter lock, schedule UI
* updates from the main loop using clutter_threads_add_idle() or
* clutter_threads_add_timeout().
*/
void
clutter_threads_leave (void)
{
_clutter_threads_release_lock ();
}
/**
* clutter_get_debug_enabled:
*
* Check if Clutter has debugging enabled.
*
* Return value: %FALSE
*
* Deprecated: 1.10: This function does not do anything.
*/
gboolean
clutter_get_debug_enabled (void)
{
return FALSE;
}
void
_clutter_context_lock (void)
{
@ -1478,36 +1297,6 @@ _clutter_context_get_default (void)
return retval;
}
/**
* clutter_get_timestamp:
*
* Returns the approximate number of microseconds passed since Clutter was
* intialised.
*
* This function shdould not be used by application code.
*
* The output of this function depends on whether Clutter was configured to
* enable its debugging code paths, so it's less useful than intended.
*
* Since Clutter 1.10, this function is an alias to g_get_monotonic_time()
* if Clutter was configured to enable the debugging code paths.
*
* Return value: Number of microseconds since clutter_init() was called, or
* zero if Clutter was not configured with debugging code paths.
*
* Deprecated: 1.10: Use #GTimer or g_get_monotonic_time() for a proper
* timing source
*/
gulong
clutter_get_timestamp (void)
{
#ifdef CLUTTER_ENABLE_DEBUG
return (gulong) g_get_monotonic_time ();
#else
return 0L;
#endif
}
static gboolean
clutter_arg_direction_cb (const char *key,
const char *value,
@ -2826,25 +2615,6 @@ _clutter_process_event (ClutterEvent *event)
context->current_event = g_slist_delete_link (context->current_event, context->current_event);
}
/**
* clutter_get_actor_by_gid:
* @id_: a #ClutterActor unique id.
*
* Retrieves the #ClutterActor with @id_.
*
* Return value: (transfer none): the actor with the passed id or %NULL.
* The returned actor does not have its reference count increased.
*
* Since: 0.6
*
* Deprecated: 1.8: The id is not used any longer.
*/
ClutterActor *
clutter_get_actor_by_gid (guint32 id_)
{
return _clutter_get_actor_by_id (NULL, id_);
}
void
clutter_base_init (void)
{
@ -2886,24 +2656,6 @@ clutter_get_default_frame_rate (void)
return context->frame_rate;
}
/**
* clutter_set_default_frame_rate:
* @frames_per_sec: the new default frame rate
*
* Sets the default frame rate. This frame rate will be used to limit
* the number of frames drawn if Clutter is not able to synchronize
* with the vertical refresh rate of the display. When synchronization
* is possible, this value is ignored.
*
* Since: 0.6
*
* Deprecated: 1.10: This function does not do anything any more.
*/
void
clutter_set_default_frame_rate (guint frames_per_sec)
{
}
static void
on_grab_actor_destroy (ClutterActor *actor,
ClutterInputDevice *device)
@ -3116,57 +2868,6 @@ clutter_input_device_get_grabbed_actor (ClutterInputDevice *device)
return NULL;
}
/**
* clutter_grab_pointer_for_device:
* @actor: a #ClutterActor
* @id_: a device id, or -1
*
* Grabs all the pointer events coming from the device @id for @actor.
*
* If @id is -1 then this function is equivalent to clutter_grab_pointer().
*
* Since: 0.8
*
* Deprecated: 1.10: Use clutter_input_device_grab() instead.
*/
void
clutter_grab_pointer_for_device (ClutterActor *actor,
gint id_)
{
ClutterDeviceManager *manager;
ClutterInputDevice *dev;
g_return_if_fail (actor == NULL || CLUTTER_IS_ACTOR (actor));
/* essentially a global grab */
if (id_ == -1)
{
if (actor == NULL)
clutter_ungrab_pointer ();
else
clutter_grab_pointer (actor);
return;
}
manager = clutter_device_manager_get_default ();
if (manager == NULL)
return;
dev = clutter_device_manager_get_device (manager, id_);
if (dev == NULL)
return;
if (dev->device_type != CLUTTER_POINTER_DEVICE)
return;
if (actor == NULL)
clutter_input_device_ungrab (dev);
else
clutter_input_device_grab (dev, actor);
}
/**
* clutter_ungrab_pointer:
*
@ -3180,32 +2881,6 @@ clutter_ungrab_pointer (void)
clutter_grab_pointer (NULL);
}
/**
* clutter_ungrab_pointer_for_device:
* @id_: a device id
*
* Removes an existing grab of the pointer events for device @id_.
*
* Since: 0.8
*
* Deprecated: 1.10: Use clutter_input_device_ungrab() instead.
*/
void
clutter_ungrab_pointer_for_device (gint id_)
{
ClutterDeviceManager *manager;
ClutterInputDevice *device;
manager = clutter_device_manager_get_default ();
if (manager == NULL)
return;
device = clutter_device_manager_get_device (manager, id_);
if (device != NULL)
clutter_input_device_ungrab (device);
}
/**
* clutter_get_pointer_grab:
*
@ -3305,175 +2980,6 @@ clutter_get_keyboard_grab (void)
return context->keyboard_grab_actor;
}
/**
* clutter_clear_glyph_cache:
*
* Clears the internal cache of glyphs used by the Pango
* renderer. This will free up some memory and GL texture
* resources. The cache will be automatically refilled as more text is
* drawn.
*
* Since: 0.8
*
* Deprecated: 1.10: Use clutter_get_font_map() and
* cogl_pango_font_map_clear_glyph_cache() instead.
*/
void
clutter_clear_glyph_cache (void)
{
CoglPangoFontMap *font_map;
font_map = clutter_context_get_pango_fontmap ();
cogl_pango_font_map_clear_glyph_cache (font_map);
}
/**
* clutter_set_font_flags:
* @flags: The new flags
*
* Sets the font quality options for subsequent text rendering
* operations.
*
* Using mipmapped textures will improve the quality for scaled down
* text but will use more texture memory.
*
* Enabling hinting improves text quality for static text but may
* introduce some artifacts if the text is animated.
*
* Since: 1.0
*
* Deprecated: 1.10: Use clutter_backend_set_font_options() and the
* #cairo_font_option_t API.
*/
void
clutter_set_font_flags (ClutterFontFlags flags)
{
ClutterMainContext *context = _clutter_context_get_default ();
CoglPangoFontMap *font_map;
ClutterFontFlags old_flags, changed_flags;
const cairo_font_options_t *font_options;
cairo_font_options_t *new_font_options;
cairo_hint_style_t hint_style;
gboolean use_mipmapping;
ClutterBackend *backend;
backend = clutter_get_default_backend ();
font_map = clutter_context_get_pango_fontmap ();
font_options = clutter_backend_get_font_options (backend);
old_flags = 0;
if (cogl_pango_font_map_get_use_mipmapping (font_map))
old_flags |= CLUTTER_FONT_MIPMAPPING;
hint_style = cairo_font_options_get_hint_style (font_options);
if (hint_style != CAIRO_HINT_STYLE_DEFAULT &&
hint_style != CAIRO_HINT_STYLE_NONE)
old_flags |= CLUTTER_FONT_HINTING;
if (old_flags == flags)
return;
new_font_options = cairo_font_options_copy (font_options);
/* Only set the font options that have actually changed so we don't
override a detailed setting from the backend */
changed_flags = old_flags ^ flags;
if ((changed_flags & CLUTTER_FONT_MIPMAPPING))
{
use_mipmapping = (changed_flags & CLUTTER_FONT_MIPMAPPING) != 0;
cogl_pango_font_map_set_use_mipmapping (font_map, use_mipmapping);
}
if ((changed_flags & CLUTTER_FONT_HINTING))
{
hint_style = (flags & CLUTTER_FONT_HINTING)
? CAIRO_HINT_STYLE_FULL
: CAIRO_HINT_STYLE_NONE;
cairo_font_options_set_hint_style (new_font_options, hint_style);
}
clutter_backend_set_font_options (backend, new_font_options);
cairo_font_options_destroy (new_font_options);
/* update the default pango context, if any */
if (context->pango_context != NULL)
update_pango_context (backend, context->pango_context);
}
/**
* clutter_get_font_flags:
*
* Gets the current font flags for rendering text. See
* clutter_set_font_flags().
*
* Return value: The font flags
*
* Since: 1.0
*
* Deprecated: 1.10: Use clutter_backend_get_font_options() and the
* #cairo_font_options_t API.
*/
ClutterFontFlags
clutter_get_font_flags (void)
{
CoglPangoFontMap *font_map = NULL;
const cairo_font_options_t *font_options;
ClutterFontFlags flags = 0;
cairo_hint_style_t hint_style;
font_map = clutter_context_get_pango_fontmap ();
if (cogl_pango_font_map_get_use_mipmapping (font_map))
flags |= CLUTTER_FONT_MIPMAPPING;
font_options =
clutter_backend_get_font_options (clutter_get_default_backend ());
hint_style = cairo_font_options_get_hint_style (font_options);
if (hint_style != CAIRO_HINT_STYLE_DEFAULT &&
hint_style != CAIRO_HINT_STYLE_NONE)
flags |= CLUTTER_FONT_HINTING;
return flags;
}
/**
* clutter_get_input_device_for_id:
* @id_: the unique id for a device
*
* Retrieves the #ClutterInputDevice from its @id_. This is a convenience
* wrapper for clutter_device_manager_get_device() and it is functionally
* equivalent to:
*
* |[
* ClutterDeviceManager *manager;
* ClutterInputDevice *device;
*
* manager = clutter_device_manager_get_default ();
* device = clutter_device_manager_get_device (manager, id);
* ]|
*
* Return value: (transfer none): a #ClutterInputDevice, or %NULL
*
* Since: 0.8
*
* Deprecated: 1.10: Use clutter_device_manager_get_device() instead.
*/
ClutterInputDevice *
clutter_get_input_device_for_id (gint id_)
{
ClutterDeviceManager *manager;
manager = clutter_device_manager_get_default ();
if (manager == NULL)
return NULL;
return clutter_device_manager_get_device (manager, id_);
}
/**
* clutter_get_font_map:
*