Fix regression in mutter-wayland translations

Switching meta/util.h to gi18n.h was wrong, mutter is a library
and needs gi18n-lib.h, but that cannot be included from a public
header (since it depends on config.h or command line options),
so split util.h into a public and a private part.

https://bugzilla.gnome.org/show_bug.cgi?id=707897
This commit is contained in:
Giovanni Campagna 2013-09-11 10:18:53 +02:00
parent 4494888b82
commit 7b537d6b8f
26 changed files with 64 additions and 26 deletions

View File

@ -153,6 +153,7 @@ libmutter_wayland_la_SOURCES = \
core/stack-tracker.h \ core/stack-tracker.h \
core/util.c \ core/util.c \
meta/util.h \ meta/util.h \
core/util-private.h \
core/window-props.c \ core/window-props.c \
core/window-props.h \ core/window-props.h \
core/window.c \ core/window.c \

View File

@ -84,6 +84,7 @@
#include "meta-window-group.h" #include "meta-window-group.h"
#include "window-private.h" /* to check window->hidden */ #include "window-private.h" /* to check window->hidden */
#include "display-private.h" /* for meta_display_lookup_x_window() */ #include "display-private.h" /* for meta_display_lookup_x_window() */
#include "util-private.h"
#include "meta-wayland-private.h" #include "meta-wayland-private.h"
#include "meta-wayland-pointer.h" #include "meta-wayland-pointer.h"
#include "meta-wayland-keyboard.h" #include "meta-wayland-keyboard.h"

View File

@ -37,6 +37,7 @@
#include "mutter-enum-types.h" #include "mutter-enum-types.h"
#include <meta/errors.h> #include <meta/errors.h>
#include <meta/meta-background.h> #include <meta/meta-background.h>
#include "util-private.h"
#include "meta-background-actor-private.h" #include "meta-background-actor-private.h"
#define FRAGMENT_SHADER_DECLARATIONS \ #define FRAGMENT_SHADER_DECLARATIONS \

View File

@ -21,15 +21,14 @@
* 02111-1307, USA. * 02111-1307, USA.
*/ */
#include <config.h>
#include <meta/meta-plugin.h> #include <meta/meta-plugin.h>
#include <meta/window.h> #include <meta/window.h>
#include <meta/util.h>
#include <meta/meta-background-group.h> #include <meta/meta-background-group.h>
#include <meta/meta-background-actor.h> #include <meta/meta-background-actor.h>
#include <meta/util.h>
#include <libintl.h> #include <glib/gi18n-lib.h>
#define _(x) dgettext (GETTEXT_PACKAGE, x)
#define N_(x) x
#include <clutter/clutter.h> #include <clutter/clutter.h>
#include <gmodule.h> #include <gmodule.h>

View File

@ -53,6 +53,7 @@
#include "bell.h" #include "bell.h"
#include "screen-private.h" #include "screen-private.h"
#include "window-private.h" #include "window-private.h"
#include "util-private.h"
#include <meta/prefs.h> #include <meta/prefs.h>
#include <meta/compositor.h> #include <meta/compositor.h>
#ifdef HAVE_LIBCANBERRA #ifdef HAVE_LIBCANBERRA

View File

@ -29,6 +29,7 @@
#include "workspace-private.h" #include "workspace-private.h"
#include <meta/prefs.h> #include <meta/prefs.h>
#include <meta/errors.h> #include <meta/errors.h>
#include "util-private.h"
/* Looks up the MetaWindow representing the frame of the given X window. /* Looks up the MetaWindow representing the frame of the given X window.
* Used as a helper function by a bunch of the functions below. * Used as a helper function by a bunch of the functions below.

View File

@ -25,7 +25,7 @@
#define _XOPEN_SOURCE /* for kill() */ #define _XOPEN_SOURCE /* for kill() */
#include <config.h> #include <config.h>
#include <meta/util.h> #include "util-private.h"
#include "window-private.h" #include "window-private.h"
#include <meta/errors.h> #include <meta/errors.h>
#include <meta/workspace.h> #include <meta/workspace.h>

View File

@ -34,7 +34,7 @@
#include <config.h> #include <config.h>
#include "display-private.h" #include "display-private.h"
#include <meta/util.h> #include "util-private.h"
#include <meta/main.h> #include <meta/main.h>
#include "screen-private.h" #include "screen-private.h"
#include "window-private.h" #include "window-private.h"

View File

@ -42,7 +42,7 @@
#include "frame.h" #include "frame.h"
#include "place.h" #include "place.h"
#include <meta/prefs.h> #include <meta/prefs.h>
#include <meta/util.h> #include "util-private.h"
#include <X11/keysym.h> #include <X11/keysym.h>
#include <string.h> #include <string.h>

View File

@ -48,7 +48,7 @@
#include <config.h> #include <config.h>
#include <meta/main.h> #include <meta/main.h>
#include <meta/util.h> #include "util-private.h"
#include "display-private.h" #include "display-private.h"
#include <meta/errors.h> #include <meta/errors.h>
#include "ui.h" #include "ui.h"

View File

@ -33,7 +33,7 @@
#include <clutter/clutter.h> #include <clutter/clutter.h>
#include <meta/main.h> #include <meta/main.h>
#include <meta/util.h> #include "util-private.h"
#include <meta/errors.h> #include <meta/errors.h>
#include "monitor-private.h" #include "monitor-private.h"

View File

@ -25,6 +25,7 @@
#include <meta/main.h> #include <meta/main.h>
#include <meta/util.h> #include <meta/util.h>
#include <glib/gi18n-lib.h>
#include "meta-plugin-manager.h" #include "meta-plugin-manager.h"
#include <glib.h> #include <glib.h>

View File

@ -31,7 +31,7 @@
#include <config.h> #include <config.h>
#include <meta/prefs.h> #include <meta/prefs.h>
#include "ui.h" #include "ui.h"
#include <meta/util.h> #include "util-private.h"
#include "meta-plugin-manager.h" #include "meta-plugin-manager.h"
#include <glib.h> #include <glib.h>
#include <gio/gio.h> #include <gio/gio.h>

View File

@ -33,7 +33,7 @@
#include <config.h> #include <config.h>
#include "screen-private.h" #include "screen-private.h"
#include <meta/main.h> #include <meta/main.h>
#include <meta/util.h> #include "util-private.h"
#include <meta/errors.h> #include <meta/errors.h>
#include "window-private.h" #include "window-private.h"
#include "frame.h" #include "frame.h"

View File

@ -25,6 +25,7 @@
#include <config.h> #include <config.h>
#include "util-private.h"
#include "session.h" #include "session.h"
#include <X11/Xatom.h> #include <X11/Xatom.h>

37
src/core/util-private.h Normal file
View File

@ -0,0 +1,37 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* Mutter utilities */
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2005 Elijah Newren
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef META_UTIL_PRIVATE_H
#define META_UTIL_PRIVATE_H
#include <meta/util.h>
#include <glib/gi18n-lib.h>
void meta_set_verbose (gboolean setting);
void meta_set_debugging (gboolean setting);
void meta_set_syncing (gboolean setting);
void meta_set_replace_current_wm (gboolean setting);
void meta_set_is_wayland_compositor (gboolean setting);
#endif

View File

@ -31,7 +31,7 @@
#include <config.h> #include <config.h>
#include <meta/common.h> #include <meta/common.h>
#include <meta/util.h> #include "util-private.h"
#include <meta/main.h> #include <meta/main.h>
#include <clutter/clutter.h> /* For clutter_threads_add_repaint_func() */ #include <clutter/clutter.h> /* For clutter_threads_add_repaint_func() */

View File

@ -48,6 +48,7 @@
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include "util-private.h"
#ifndef HOST_NAME_MAX #ifndef HOST_NAME_MAX
/* Solaris headers apparently don't define this so do so manually; #326745 */ /* Solaris headers apparently don't define this so do so manually; #326745 */

View File

@ -32,7 +32,7 @@
#include "window-private.h" #include "window-private.h"
#include "boxes-private.h" #include "boxes-private.h"
#include "edge-resistance.h" #include "edge-resistance.h"
#include <meta/util.h> #include "util-private.h"
#include "frame.h" #include "frame.h"
#include <meta/errors.h> #include <meta/errors.h>
#include "workspace-private.h" #include "workspace-private.h"

View File

@ -83,7 +83,7 @@ from The Open Group.
#include <config.h> #include <config.h>
#include "xprops.h" #include "xprops.h"
#include <meta/errors.h> #include <meta/errors.h>
#include <meta/util.h> #include "util-private.h"
#include "async-getprop.h" #include "async-getprop.h"
#include "ui.h" #include "ui.h"
#include "mutter-Xatomtype.h" #include "mutter-Xatomtype.h"

View File

@ -27,19 +27,13 @@
#include <glib.h> #include <glib.h>
#include <glib-object.h> #include <glib-object.h>
#include <glib/gi18n.h>
#include <meta/common.h> #include <meta/common.h>
gboolean meta_is_verbose (void); gboolean meta_is_verbose (void);
void meta_set_verbose (gboolean setting);
gboolean meta_is_debugging (void); gboolean meta_is_debugging (void);
void meta_set_debugging (gboolean setting);
gboolean meta_is_syncing (void); gboolean meta_is_syncing (void);
void meta_set_syncing (gboolean setting);
void meta_set_replace_current_wm (gboolean setting);
gboolean meta_is_wayland_compositor (void); gboolean meta_is_wayland_compositor (void);
void meta_set_is_wayland_compositor (gboolean setting);
void meta_debug_spew_real (const char *format, void meta_debug_spew_real (const char *format,
...) G_GNUC_PRINTF (1, 2); ...) G_GNUC_PRINTF (1, 2);

View File

@ -28,7 +28,7 @@
#include <string.h> #include <string.h>
#include "menu.h" #include "menu.h"
#include <meta/main.h> #include <meta/main.h>
#include <meta/util.h> #include "util-private.h"
#include "core.h" #include "core.h"
#include "metaaccellabel.h" #include "metaaccellabel.h"
#include "ui.h" #include "ui.h"

View File

@ -35,7 +35,7 @@
#include "metaaccellabel.h" #include "metaaccellabel.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <string.h> #include <string.h>
#include <meta/util.h> #include "util-private.h"
static void meta_accel_label_destroy (GtkWidget *object); static void meta_accel_label_destroy (GtkWidget *object);
static void meta_accel_label_finalize (GObject *object); static void meta_accel_label_finalize (GObject *object);

View File

@ -23,7 +23,7 @@
#include <config.h> #include <config.h>
#include "resizepopup.h" #include "resizepopup.h"
#include <meta/util.h> #include "util-private.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkx.h> #include <gdk/gdkx.h>

View File

@ -23,7 +23,7 @@
#include <config.h> #include <config.h>
#include "theme-private.h" #include "theme-private.h"
#include <meta/util.h> #include "util-private.h"
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -39,7 +39,7 @@
#include <config.h> #include <config.h>
#include "theme-private.h" #include "theme-private.h"
#include "frames.h" /* for META_TYPE_FRAMES */ #include "frames.h" /* for META_TYPE_FRAMES */
#include <meta/util.h> #include "util-private.h"
#include <meta/gradient.h> #include <meta/gradient.h>
#include <meta/prefs.h> #include <meta/prefs.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>