~ubuntu-branches/ubuntu/wily/mutter/wily

« back to all changes in this revision

Viewing changes to src/meta/util.h

  • Committer: Bazaar Package Importer
  • Author(s): Rico Tzschichholz
  • Date: 2011-04-10 22:27:59 UTC
  • mfrom: (0.7.1 upstream) (0.3.20 experimental)
  • Revision ID: james.westby@ubuntu.com-20110410222759-o6n1i5p0unsti44n
Tags: 3.0.0-0ubuntu1
* New upstream release

* Merge with debian experimental (LP: #742458), remaining changes:
  + debian/patches/03_link_gles2.patch: Link to clutter-glx-1.0
    explicitily at the end of link flags, to bring in libGLESv2 on armel.
* debian/control.in:
  + rename gir package to gir1.2-mutter-3.0
* debian/libmutter0.symbols:
  + updated
* debian/patches:
  + fix 03_link_gles2.patch 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 
2
 
 
3
/* Mutter utilities */
 
4
 
 
5
/* 
 
6
 * Copyright (C) 2001 Havoc Pennington
 
7
 * Copyright (C) 2005 Elijah Newren
 
8
 * 
 
9
 * This program is free software; you can redistribute it and/or
 
10
 * modify it under the terms of the GNU General Public License as
 
11
 * published by the Free Software Foundation; either version 2 of the
 
12
 * License, or (at your option) any later version.
 
13
 *
 
14
 * This program is distributed in the hope that it will be useful, but
 
15
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
17
 * General Public License for more details.
 
18
 * 
 
19
 * You should have received a copy of the GNU General Public License
 
20
 * along with this program; if not, write to the Free Software
 
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
22
 * 02111-1307, USA.
 
23
 */
 
24
 
 
25
#ifndef META_UTIL_H
 
26
#define META_UTIL_H
 
27
 
 
28
#include <glib.h>
 
29
#include <glib-object.h>
 
30
 
 
31
#include <meta/common.h>
 
32
 
 
33
gboolean meta_is_verbose  (void);
 
34
void     meta_set_verbose (gboolean setting);
 
35
gboolean meta_is_debugging (void);
 
36
void     meta_set_debugging (gboolean setting);
 
37
gboolean meta_is_syncing (void);
 
38
void     meta_set_syncing (gboolean setting);
 
39
void     meta_set_replace_current_wm (gboolean setting);
 
40
 
 
41
void meta_debug_spew_real (const char *format,
 
42
                           ...) G_GNUC_PRINTF (1, 2);
 
43
void meta_verbose_real    (const char *format,
 
44
                           ...) G_GNUC_PRINTF (1, 2);
 
45
 
 
46
void meta_bug        (const char *format,
 
47
                      ...) G_GNUC_PRINTF (1, 2);
 
48
void meta_warning    (const char *format,
 
49
                      ...) G_GNUC_PRINTF (1, 2);
 
50
void meta_fatal      (const char *format,
 
51
                      ...) G_GNUC_PRINTF (1, 2);
 
52
 
 
53
typedef enum
 
54
{
 
55
  META_DEBUG_VERBOSE         = -1,
 
56
  META_DEBUG_FOCUS           = 1 << 0,
 
57
  META_DEBUG_WORKAREA        = 1 << 1,
 
58
  META_DEBUG_STACK           = 1 << 2,
 
59
  META_DEBUG_THEMES          = 1 << 3,
 
60
  META_DEBUG_SM              = 1 << 4,
 
61
  META_DEBUG_EVENTS          = 1 << 5,
 
62
  META_DEBUG_WINDOW_STATE    = 1 << 6,
 
63
  META_DEBUG_WINDOW_OPS      = 1 << 7,
 
64
  META_DEBUG_GEOMETRY        = 1 << 8,
 
65
  META_DEBUG_PLACEMENT       = 1 << 9,
 
66
  META_DEBUG_PING            = 1 << 10,
 
67
  META_DEBUG_XINERAMA        = 1 << 11,
 
68
  META_DEBUG_KEYBINDINGS     = 1 << 12,
 
69
  META_DEBUG_SYNC            = 1 << 13,
 
70
  META_DEBUG_ERRORS          = 1 << 14,
 
71
  META_DEBUG_STARTUP         = 1 << 15,
 
72
  META_DEBUG_PREFS           = 1 << 16,
 
73
  META_DEBUG_GROUPS          = 1 << 17,
 
74
  META_DEBUG_RESIZING        = 1 << 18,
 
75
  META_DEBUG_SHAPES          = 1 << 19,
 
76
  META_DEBUG_COMPOSITOR      = 1 << 20,
 
77
  META_DEBUG_EDGE_RESISTANCE = 1 << 21
 
78
} MetaDebugTopic;
 
79
 
 
80
void meta_topic_real      (MetaDebugTopic topic,
 
81
                           const char    *format,
 
82
                           ...) G_GNUC_PRINTF (2, 3);
 
83
void meta_add_verbose_topic    (MetaDebugTopic topic);
 
84
void meta_remove_verbose_topic (MetaDebugTopic topic);
 
85
 
 
86
void meta_push_no_msg_prefix (void);
 
87
void meta_pop_no_msg_prefix  (void);
 
88
 
 
89
gint  meta_unsigned_long_equal (gconstpointer v1,
 
90
                                gconstpointer v2);
 
91
guint meta_unsigned_long_hash  (gconstpointer v);
 
92
 
 
93
void meta_print_backtrace (void);
 
94
 
 
95
const char* meta_frame_type_to_string (MetaFrameType type);
 
96
const char* meta_gravity_to_string (int gravity);
 
97
 
 
98
#include <libintl.h>
 
99
#define _(x) dgettext (GETTEXT_PACKAGE, x)
 
100
#define N_(x) x
 
101
 
 
102
char* meta_g_utf8_strndup (const gchar *src, gsize n);
 
103
 
 
104
void  meta_free_gslist_and_elements (GSList *list_to_deep_free);
 
105
 
 
106
GPid meta_show_dialog (const char *type,
 
107
                       const char *message,
 
108
                       const char *timeout,
 
109
                       const char *display,
 
110
                       const char *ok_text,
 
111
                       const char *cancel_text,
 
112
                       const int transient_for,
 
113
                       GSList *columns,
 
114
                       GSList *entries);
 
115
 
 
116
/* To disable verbose mode, we make these functions into no-ops */
 
117
#ifdef WITH_VERBOSE_MODE
 
118
 
 
119
#define meta_debug_spew meta_debug_spew_real
 
120
#define meta_verbose    meta_verbose_real
 
121
#define meta_topic      meta_topic_real
 
122
 
 
123
#else
 
124
 
 
125
#  ifdef G_HAVE_ISO_VARARGS
 
126
#    define meta_debug_spew(...)
 
127
#    define meta_verbose(...)
 
128
#    define meta_topic(...)
 
129
#  elif defined(G_HAVE_GNUC_VARARGS)
 
130
#    define meta_debug_spew(format...)
 
131
#    define meta_verbose(format...)
 
132
#    define meta_topic(format...)
 
133
#  else
 
134
#    error "This compiler does not support varargs macros and thus verbose mode can't be disabled meaningfully"
 
135
#  endif
 
136
 
 
137
#endif /* !WITH_VERBOSE_MODE */
 
138
 
 
139
/**
 
140
 * MetaLaterType:
 
141
 * @META_LATER_RESIZE: call in a resize processing phase that is done
 
142
 *   before GTK+ repainting (including window borders) is done.
 
143
 * @META_LATER_BEFORE_REDRAW: call before the stage is redrawn
 
144
 * @META_LATER_IDLE: call at a very low priority (can be blocked
 
145
 *    by running animations or redrawing applications)
 
146
 **/
 
147
typedef enum {
 
148
  META_LATER_RESIZE,
 
149
  META_LATER_BEFORE_REDRAW,
 
150
  META_LATER_IDLE
 
151
} MetaLaterType;
 
152
 
 
153
guint meta_later_add    (MetaLaterType  when,
 
154
                         GSourceFunc    func,
 
155
                         gpointer       data,
 
156
                         GDestroyNotify notify);
 
157
void  meta_later_remove (guint          later_id);
 
158
 
 
159
#endif /* META_UTIL_H */
 
160
 
 
161