Utility functions

Utility functions — Miscellaneous utility functions

Types and Values

Description

Functions

meta_is_verbose ()

gboolean
meta_is_verbose (void);

meta_set_verbose ()

void
meta_set_verbose (gboolean setting);

meta_is_debugging ()

gboolean
meta_is_debugging (void);

meta_set_debugging ()

void
meta_set_debugging (gboolean setting);

meta_is_syncing ()

gboolean
meta_is_syncing (void);

Returns whether X synchronisation is currently enabled.

FIXME: This is *only* called by meta_display_open(), but by that time we have already turned syncing on or off on startup, and we don't have any way to do so while Mutter is running, so it's rather pointless.

Returns

TRUE if we must wait for events whenever we send X requests; FALSE otherwise.


meta_set_syncing ()

void
meta_set_syncing (gboolean setting);

A handy way to turn on synchronisation on or off for every display.

Parameters

setting

whether to turn syncing on or off

 

meta_set_replace_current_wm ()

void
meta_set_replace_current_wm (gboolean setting);

meta_debug_spew_real ()

void
meta_debug_spew_real (const char *format,
                      ...);

meta_verbose_real ()

void
meta_verbose_real (const char *format,
                   ...);

meta_bug ()

void
meta_bug (const char *format,
          ...);

meta_warning ()

void
meta_warning (const char *format,
              ...);

meta_fatal ()

void
meta_fatal (const char *format,
            ...);

meta_topic_real ()

void
meta_topic_real (MetaDebugTopic topic,
                 const char *format,
                 ...);

meta_add_verbose_topic ()

void
meta_add_verbose_topic (MetaDebugTopic topic);

Ensure log messages for the given topic topic will be printed.

Parameters

topic

Topic for which logging will be started

 

meta_remove_verbose_topic ()

void
meta_remove_verbose_topic (MetaDebugTopic topic);

Stop printing log messages for the given topic topic . Note that this method does not stack with meta_add_verbose_topic(); i.e. if two calls to meta_add_verbose_topic() for the same topic are made, one call to meta_remove_verbose_topic() will remove it.

Parameters

topic

Topic for which logging will be stopped

 

meta_push_no_msg_prefix ()

void
meta_push_no_msg_prefix (void);

meta_pop_no_msg_prefix ()

void
meta_pop_no_msg_prefix (void);

meta_unsigned_long_equal ()

gint
meta_unsigned_long_equal (gconstpointer v1,
                          gconstpointer v2);

meta_unsigned_long_hash ()

guint
meta_unsigned_long_hash (gconstpointer v);

meta_frame_type_to_string ()

const char *
meta_frame_type_to_string (MetaFrameType type);

Converts a frame type enum value to the name string that would appear in the theme definition file.

Parameters

type

a MetaFrameType

 

Returns

the string value


meta_gravity_to_string ()

const char *
meta_gravity_to_string (int gravity);

meta_g_utf8_strndup ()

char *
meta_g_utf8_strndup (const gchar *src,
                     gsize n);

meta_free_gslist_and_elements ()

void
meta_free_gslist_and_elements (GSList *list_to_deep_free);

Parameters

list_to_deep_free

list to deep free

 

meta_show_dialog ()

GPid
meta_show_dialog (const char *type,
                  const char *message,
                  const char *timeout,
                  const char *display,
                  const char *ok_text,
                  const char *cancel_text,
                  const char *icon_name,
                  const int transient_for,
                  GSList *columns,
                  GSList *entries);

Parameters

type

type of dialog

 

message

message

 

timeout

timeout

 

display

display

 

ok_text

text for Ok button

 

cancel_text

text for Cancel button

 

icon_name

icon name

 

transient_for

window XID of parent

 

columns

columns

 

entries

entries

 

meta_later_add ()

guint
meta_later_add (MetaLaterType when,
                GSourceFunc func,
                gpointer data,
                GDestroyNotify notify);

Sets up a callback to be called at some later time. when determines the particular later occasion at which it is called. This is much like g_idle_add(), except that the functions interact properly with clutter event handling. If a "later" function is added from a clutter event handler, and is supposed to be run before the stage is redrawn, it will be run before that redraw of the stage, not the next one.

Parameters

when

enumeration value determining the phase at which to run the callback

 

func

callback to run later

 

data

data to pass to the callback

 

notify

function to call to destroy data when it is no longer in use, or NULL

 

Returns

an integer ID (guaranteed to be non-zero) that can be used to cancel the callback and prevent it from being run.


meta_later_remove ()

void
meta_later_remove (guint later_id);

Removes a callback added with meta_later_add()

Parameters

later_id

the integer ID returned from meta_later_add()

 

Types and Values

enum MetaDebugTopic

Members

META_DEBUG_VERBOSE

verbose logging

 

META_DEBUG_FOCUS

focus

 

META_DEBUG_WORKAREA

workarea

 

META_DEBUG_STACK

stack

 

META_DEBUG_THEMES

themes

 

META_DEBUG_SM

session management

 

META_DEBUG_EVENTS

events

 

META_DEBUG_WINDOW_STATE

window state

 

META_DEBUG_WINDOW_OPS

window operations

 

META_DEBUG_GEOMETRY

geometry

 

META_DEBUG_PLACEMENT

window placement

 

META_DEBUG_PING

ping

 

META_DEBUG_XINERAMA

Xinerama

 

META_DEBUG_KEYBINDINGS

keybindings

 

META_DEBUG_SYNC

sync

 

META_DEBUG_ERRORS

errors

 

META_DEBUG_STARTUP

startup

 

META_DEBUG_PREFS

preferences

 

META_DEBUG_GROUPS

groups

 

META_DEBUG_RESIZING

resizing

 

META_DEBUG_SHAPES

shapes

 

META_DEBUG_COMPOSITOR

compositor

 

META_DEBUG_EDGE_RESISTANCE

edge resistance

 

META_DEBUG_DBUS

   

meta_debug_spew

#define meta_debug_spew meta_debug_spew_real

meta_verbose

#define meta_verbose    meta_verbose_real

meta_topic

#define meta_topic      meta_topic_real

enum MetaLaterType

Members

META_LATER_RESIZE

call in a resize processing phase that is done before GTK+ repainting (including window borders) is done.

 

META_LATER_CALC_SHOWING

used by Mutter to compute which windows should be mapped

 

META_LATER_CHECK_FULLSCREEN

used by Mutter to see if there's a fullscreen window

 

META_LATER_SYNC_STACK

used by Mutter to send it's idea of the stacking order to the server

 

META_LATER_BEFORE_REDRAW

call before the stage is redrawn

 

META_LATER_IDLE

call at a very low priority (can be blocked by running animations or redrawing applications)