[mutter/wayland] Fix regression in mutter-wayland translations



commit 7b537d6b8fcea1effaa2da596a437a2261c8e11e
Author: Giovanni Campagna <gcampagn redhat com>
Date:   Wed Sep 11 10:18:53 2013 +0200

    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

 src/Makefile.am                  |    1 +
 src/compositor/compositor.c      |    1 +
 src/compositor/meta-background.c |    1 +
 src/compositor/plugins/default.c |    9 ++++-----
 src/core/bell.c                  |    1 +
 src/core/core.c                  |    1 +
 src/core/delete.c                |    2 +-
 src/core/display.c               |    2 +-
 src/core/keybindings.c           |    2 +-
 src/core/main.c                  |    2 +-
 src/core/monitor.c               |    2 +-
 src/core/mutter.c                |    1 +
 src/core/prefs.c                 |    2 +-
 src/core/screen.c                |    2 +-
 src/core/session.c               |    1 +
 src/core/util-private.h          |   37 +++++++++++++++++++++++++++++++++++++
 src/core/util.c                  |    2 +-
 src/core/window-props.c          |    1 +
 src/core/window.c                |    2 +-
 src/core/xprops.c                |    2 +-
 src/meta/util.h                  |    6 ------
 src/ui/menu.c                    |    2 +-
 src/ui/metaaccellabel.c          |    2 +-
 src/ui/resizepopup.c             |    2 +-
 src/ui/theme-parser.c            |    2 +-
 src/ui/theme.c                   |    2 +-
 26 files changed, 64 insertions(+), 26 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 442ad27..7126ee8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -153,6 +153,7 @@ libmutter_wayland_la_SOURCES =                      \
        core/stack-tracker.h                    \
        core/util.c                             \
        meta/util.h                             \
+       core/util-private.h                     \
        core/window-props.c                     \
        core/window-props.h                     \
        core/window.c                           \
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index a17218c..bd3bb30 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -84,6 +84,7 @@
 #include "meta-window-group.h"
 #include "window-private.h" /* to check window->hidden */
 #include "display-private.h" /* for meta_display_lookup_x_window() */
+#include "util-private.h"
 #include "meta-wayland-private.h"
 #include "meta-wayland-pointer.h"
 #include "meta-wayland-keyboard.h"
diff --git a/src/compositor/meta-background.c b/src/compositor/meta-background.c
index 6eee159..244602c 100644
--- a/src/compositor/meta-background.c
+++ b/src/compositor/meta-background.c
@@ -37,6 +37,7 @@
 #include "mutter-enum-types.h"
 #include <meta/errors.h>
 #include <meta/meta-background.h>
+#include "util-private.h"
 #include "meta-background-actor-private.h"
 
 #define FRAGMENT_SHADER_DECLARATIONS                                           \
diff --git a/src/compositor/plugins/default.c b/src/compositor/plugins/default.c
index 404302c..b6cccf1 100644
--- a/src/compositor/plugins/default.c
+++ b/src/compositor/plugins/default.c
@@ -21,15 +21,14 @@
  * 02111-1307, USA.
  */
 
+#include <config.h>
+
 #include <meta/meta-plugin.h>
 #include <meta/window.h>
-#include <meta/util.h>
 #include <meta/meta-background-group.h>
 #include <meta/meta-background-actor.h>
-
-#include <libintl.h>
-#define _(x) dgettext (GETTEXT_PACKAGE, x)
-#define N_(x) x
+#include <meta/util.h>
+#include <glib/gi18n-lib.h>
 
 #include <clutter/clutter.h>
 #include <gmodule.h>
diff --git a/src/core/bell.c b/src/core/bell.c
index 9d7dc7a..5b40c2e 100644
--- a/src/core/bell.c
+++ b/src/core/bell.c
@@ -53,6 +53,7 @@
 #include "bell.h"
 #include "screen-private.h"
 #include "window-private.h"
+#include "util-private.h"
 #include <meta/prefs.h>
 #include <meta/compositor.h>
 #ifdef HAVE_LIBCANBERRA
diff --git a/src/core/core.c b/src/core/core.c
index 9d799d6..382c8f0 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -29,6 +29,7 @@
 #include "workspace-private.h"
 #include <meta/prefs.h>
 #include <meta/errors.h>
+#include "util-private.h"
 
 /* Looks up the MetaWindow representing the frame of the given X window.
  * Used as a helper function by a bunch of the functions below.
diff --git a/src/core/delete.c b/src/core/delete.c
index ded5dd4..bd4e96e 100644
--- a/src/core/delete.c
+++ b/src/core/delete.c
@@ -25,7 +25,7 @@
 #define _XOPEN_SOURCE /* for kill() */
 
 #include <config.h>
-#include <meta/util.h>
+#include "util-private.h"
 #include "window-private.h"
 #include <meta/errors.h>
 #include <meta/workspace.h>
diff --git a/src/core/display.c b/src/core/display.c
index 7a287b8..74a2bb0 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -34,7 +34,7 @@
 
 #include <config.h>
 #include "display-private.h"
-#include <meta/util.h>
+#include "util-private.h"
 #include <meta/main.h>
 #include "screen-private.h"
 #include "window-private.h"
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 5b8be79..ac06252 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -42,7 +42,7 @@
 #include "frame.h"
 #include "place.h"
 #include <meta/prefs.h>
-#include <meta/util.h>
+#include "util-private.h"
 
 #include <X11/keysym.h>
 #include <string.h>
diff --git a/src/core/main.c b/src/core/main.c
index 8ff90ec..735474c 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -48,7 +48,7 @@
 
 #include <config.h>
 #include <meta/main.h>
-#include <meta/util.h>
+#include "util-private.h"
 #include "display-private.h"
 #include <meta/errors.h>
 #include "ui.h"
diff --git a/src/core/monitor.c b/src/core/monitor.c
index f9dffa6..0877f4b 100644
--- a/src/core/monitor.c
+++ b/src/core/monitor.c
@@ -33,7 +33,7 @@
 #include <clutter/clutter.h>
 
 #include <meta/main.h>
-#include <meta/util.h>
+#include "util-private.h"
 #include <meta/errors.h>
 #include "monitor-private.h"
 
diff --git a/src/core/mutter.c b/src/core/mutter.c
index 3216726..08f833b 100644
--- a/src/core/mutter.c
+++ b/src/core/mutter.c
@@ -25,6 +25,7 @@
 
 #include <meta/main.h>
 #include <meta/util.h>
+#include <glib/gi18n-lib.h>
 #include "meta-plugin-manager.h"
 
 #include <glib.h>
diff --git a/src/core/prefs.c b/src/core/prefs.c
index f2bc7f2..a5f24d1 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -31,7 +31,7 @@
 #include <config.h>
 #include <meta/prefs.h>
 #include "ui.h"
-#include <meta/util.h>
+#include "util-private.h"
 #include "meta-plugin-manager.h"
 #include <glib.h>
 #include <gio/gio.h>
diff --git a/src/core/screen.c b/src/core/screen.c
index 11776b9..9df2e4c 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -33,7 +33,7 @@
 #include <config.h>
 #include "screen-private.h"
 #include <meta/main.h>
-#include <meta/util.h>
+#include "util-private.h"
 #include <meta/errors.h>
 #include "window-private.h"
 #include "frame.h"
diff --git a/src/core/session.c b/src/core/session.c
index 41f360f..e6ac140 100644
--- a/src/core/session.c
+++ b/src/core/session.c
@@ -25,6 +25,7 @@
 
 #include <config.h>
 
+#include "util-private.h"
 #include "session.h"
 #include <X11/Xatom.h>
 
diff --git a/src/core/util-private.h b/src/core/util-private.h
new file mode 100644
index 0000000..6f25806
--- /dev/null
+++ b/src/core/util-private.h
@@ -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
diff --git a/src/core/util.c b/src/core/util.c
index d501460..5079637 100644
--- a/src/core/util.c
+++ b/src/core/util.c
@@ -31,7 +31,7 @@
 
 #include <config.h>
 #include <meta/common.h>
-#include <meta/util.h>
+#include "util-private.h"
 #include <meta/main.h>
 
 #include <clutter/clutter.h> /* For clutter_threads_add_repaint_func() */
diff --git a/src/core/window-props.c b/src/core/window-props.c
index 73452cc..8efead0 100644
--- a/src/core/window-props.c
+++ b/src/core/window-props.c
@@ -48,6 +48,7 @@
 #include <X11/Xatom.h>
 #include <unistd.h>
 #include <string.h>
+#include "util-private.h"
 
 #ifndef HOST_NAME_MAX
 /* Solaris headers apparently don't define this so do so manually; #326745 */
diff --git a/src/core/window.c b/src/core/window.c
index 199799d..79da230 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -32,7 +32,7 @@
 #include "window-private.h"
 #include "boxes-private.h"
 #include "edge-resistance.h"
-#include <meta/util.h>
+#include "util-private.h"
 #include "frame.h"
 #include <meta/errors.h>
 #include "workspace-private.h"
diff --git a/src/core/xprops.c b/src/core/xprops.c
index ac31659..a387f3e 100644
--- a/src/core/xprops.c
+++ b/src/core/xprops.c
@@ -83,7 +83,7 @@ from The Open Group.
 #include <config.h>
 #include "xprops.h"
 #include <meta/errors.h>
-#include <meta/util.h>
+#include "util-private.h"
 #include "async-getprop.h"
 #include "ui.h"
 #include "mutter-Xatomtype.h"
diff --git a/src/meta/util.h b/src/meta/util.h
index ed29b08..091f4f9 100644
--- a/src/meta/util.h
+++ b/src/meta/util.h
@@ -27,19 +27,13 @@
 
 #include <glib.h>
 #include <glib-object.h>
-#include <glib/gi18n.h>
 
 #include <meta/common.h>
 
 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);
 gboolean meta_is_wayland_compositor (void);
-void     meta_set_is_wayland_compositor (gboolean setting);
 
 void meta_debug_spew_real (const char *format,
                            ...) G_GNUC_PRINTF (1, 2);
diff --git a/src/ui/menu.c b/src/ui/menu.c
index ccad1c9..34ceeb7 100644
--- a/src/ui/menu.c
+++ b/src/ui/menu.c
@@ -28,7 +28,7 @@
 #include <string.h>
 #include "menu.h"
 #include <meta/main.h>
-#include <meta/util.h>
+#include "util-private.h"
 #include "core.h"
 #include "metaaccellabel.h"
 #include "ui.h"
diff --git a/src/ui/metaaccellabel.c b/src/ui/metaaccellabel.c
index 2f9cb62..affec99 100644
--- a/src/ui/metaaccellabel.c
+++ b/src/ui/metaaccellabel.c
@@ -35,7 +35,7 @@
 #include "metaaccellabel.h"
 #include <gtk/gtk.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_finalize     (GObject             *object);
diff --git a/src/ui/resizepopup.c b/src/ui/resizepopup.c
index a4ae00b..bcce02d 100644
--- a/src/ui/resizepopup.c
+++ b/src/ui/resizepopup.c
@@ -23,7 +23,7 @@
 
 #include <config.h>
 #include "resizepopup.h"
-#include <meta/util.h>
+#include "util-private.h"
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
 
diff --git a/src/ui/theme-parser.c b/src/ui/theme-parser.c
index 0e93aef..00942b0 100644
--- a/src/ui/theme-parser.c
+++ b/src/ui/theme-parser.c
@@ -23,7 +23,7 @@
 
 #include <config.h>
 #include "theme-private.h"
-#include <meta/util.h>
+#include "util-private.h"
 #include <string.h>
 #include <stdlib.h>
 
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 665f871..17eee47 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -39,7 +39,7 @@
 #include <config.h>
 #include "theme-private.h"
 #include "frames.h" /* for META_TYPE_FRAMES */
-#include <meta/util.h>
+#include "util-private.h"
 #include <meta/gradient.h>
 #include <meta/prefs.h>
 #include <gtk/gtk.h>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]