Utility functions

Utility functions — Miscellaneous utility functions

Synopsis

gboolean            meta_is_verbose                     (void);
void                meta_set_verbose                    (gboolean setting);
gboolean            meta_is_debugging                   (void);
void                meta_set_debugging                  (gboolean setting);
gboolean            meta_is_syncing                     (void);
void                meta_set_syncing                    (gboolean setting);
void                meta_set_replace_current_wm         (gboolean setting);
void                meta_debug_spew_real                (const char *format,
                                                         ...);
void                meta_verbose_real                   (const char *format,
                                                         ...);
void                meta_bug                            (const char *format,
                                                         ...);
void                meta_warning                        (const char *format,
                                                         ...);
void                meta_fatal                          (const char *format,
                                                         ...);
enum                MetaDebugTopic;
void                meta_topic_real                     (MetaDebugTopic topic,
                                                         const char *format,
                                                         ...);
void                meta_add_verbose_topic              (MetaDebugTopic topic);
void                meta_remove_verbose_topic           (MetaDebugTopic topic);
void                meta_push_no_msg_prefix             (void);
void                meta_pop_no_msg_prefix              (void);
gint                meta_unsigned_long_equal            (gconstpointer v1,
                                                         gconstpointer v2);
guint               meta_unsigned_long_hash             (gconstpointer v);
void                meta_print_backtrace                (void);
const char *        meta_frame_type_to_string           (MetaFrameType type);
const char *        meta_gravity_to_string              (int gravity);
#define             _                                   (x)
#define             N_                                  (x)
char *              meta_g_utf8_strndup                 (const gchar *src,
                                                         gsize n);
void                meta_free_gslist_and_elements       (GSList *list_to_deep_free);
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 int transient_for,
                                                         GSList *columns,
                                                         GSList *entries);
#define             meta_debug_spew
#define             meta_verbose
#define             meta_topic
enum                MetaLaterType;
guint               meta_later_add                      (MetaLaterType when,
                                                         GSourceFunc func,
                                                         gpointer data,
                                                         GDestroyNotify notify);
void                meta_later_remove                   (guint later_id);

Description

Details

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);

meta_set_syncing ()

void                meta_set_syncing                    (gboolean setting);

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,
                                                         ...);

enum MetaDebugTopic

typedef enum {
  META_DEBUG_VERBOSE         = -1,
  META_DEBUG_FOCUS           = 1 << 0,
  META_DEBUG_WORKAREA        = 1 << 1,
  META_DEBUG_STACK           = 1 << 2,
  META_DEBUG_THEMES          = 1 << 3,
  META_DEBUG_SM              = 1 << 4,
  META_DEBUG_EVENTS          = 1 << 5,
  META_DEBUG_WINDOW_STATE    = 1 << 6,
  META_DEBUG_WINDOW_OPS      = 1 << 7,
  META_DEBUG_GEOMETRY        = 1 << 8,
  META_DEBUG_PLACEMENT       = 1 << 9,
  META_DEBUG_PING            = 1 << 10,
  META_DEBUG_XINERAMA        = 1 << 11,
  META_DEBUG_KEYBINDINGS     = 1 << 12,
  META_DEBUG_SYNC            = 1 << 13,
  META_DEBUG_ERRORS          = 1 << 14,
  META_DEBUG_STARTUP         = 1 << 15,
  META_DEBUG_PREFS           = 1 << 16,
  META_DEBUG_GROUPS          = 1 << 17,
  META_DEBUG_RESIZING        = 1 << 18,
  META_DEBUG_SHAPES          = 1 << 19,
  META_DEBUG_COMPOSITOR      = 1 << 20,
  META_DEBUG_EDGE_RESISTANCE = 1 << 21
} MetaDebugTopic;

META_DEBUG_VERBOSE

META_DEBUG_FOCUS

META_DEBUG_WORKAREA

META_DEBUG_STACK

META_DEBUG_THEMES

META_DEBUG_SM

META_DEBUG_EVENTS

META_DEBUG_WINDOW_STATE

META_DEBUG_WINDOW_OPS

META_DEBUG_GEOMETRY

META_DEBUG_PLACEMENT

META_DEBUG_PING

META_DEBUG_XINERAMA

META_DEBUG_KEYBINDINGS

META_DEBUG_SYNC

META_DEBUG_ERRORS

META_DEBUG_STARTUP

META_DEBUG_PREFS

META_DEBUG_GROUPS

META_DEBUG_RESIZING

META_DEBUG_SHAPES

META_DEBUG_COMPOSITOR

META_DEBUG_EDGE_RESISTANCE


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.

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.

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_print_backtrace ()

void                meta_print_backtrace                (void);

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.

Returns :

the string value

meta_gravity_to_string ()

const char *        meta_gravity_to_string              (int gravity);

_()

#define _(x) dgettext (GETTEXT_PACKAGE, x)

N_()

#define N_(x) x

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);

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 int transient_for,
                                                         GSList *columns,
                                                         GSList *entries);

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

typedef enum {
  META_LATER_RESIZE,
  META_LATER_BEFORE_REDRAW,
  META_LATER_IDLE
} MetaLaterType;

META_LATER_RESIZE

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

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)

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.

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()

later_id :

the integer ID returned from meta_later_add()