[metacity] move MetaFrameBorders to libmetacity
- From: Alberts MuktupÄvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] move MetaFrameBorders to libmetacity
- Date: Thu, 28 Jan 2016 16:10:28 +0000 (UTC)
commit 636cee54d4ad58cd5ca4ed698d8e237c1887c69f
Author: Alberts MuktupÄvels <alberts muktupavels gmail com>
Date: Thu Jan 28 17:15:44 2016 +0200
move MetaFrameBorders to libmetacity
libmetacity/Makefile.am | 3 ++
libmetacity/meta-frame-borders.c | 29 ++++++++++++++++++++++++
libmetacity/meta-frame-borders.h | 42 +++++++++++++++++++++++++++++++++++
src/compositor/compositor-xrender.c | 1 +
src/core/constraints.c | 1 +
src/core/display.c | 1 +
src/include/common.h | 17 --------------
src/include/frame.h | 1 +
src/include/ui.h | 1 +
src/ui/theme.c | 9 -------
src/ui/theme.h | 1 +
11 files changed, 80 insertions(+), 26 deletions(-)
---
diff --git a/libmetacity/Makefile.am b/libmetacity/Makefile.am
index 1f82c1d..14187b4 100644
--- a/libmetacity/Makefile.am
+++ b/libmetacity/Makefile.am
@@ -8,6 +8,8 @@ libmetacity_la_SOURCES = \
meta-color-private.h \
meta-color-spec.c \
meta-color-spec.h \
+ meta-frame-borders.c \
+ meta-frame-borders.h \
meta-gradient.c \
meta-gradient.h \
meta-gradient-private.h \
@@ -49,6 +51,7 @@ libmetacity_includedir = $(includedir)/metacity/libmetacity
libmetacity_include_HEADERS = \
meta-color.h \
meta-color-spec.h \
+ meta-frame-borders.h \
meta-gradient.h \
meta-gradient-spec.h \
meta-theme.h \
diff --git a/libmetacity/meta-frame-borders.c b/libmetacity/meta-frame-borders.c
new file mode 100644
index 0000000..603ae85
--- /dev/null
+++ b/libmetacity/meta-frame-borders.c
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2001 Havoc Pennington
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include "meta-frame-borders.h"
+
+void
+meta_frame_borders_clear (MetaFrameBorders *self)
+{
+ self->visible.top = self->invisible.top = self->total.top = 0;
+ self->visible.bottom = self->invisible.bottom = self->total.bottom = 0;
+ self->visible.left = self->invisible.left = self->total.left = 0;
+ self->visible.right = self->invisible.right = self->total.right = 0;
+}
diff --git a/libmetacity/meta-frame-borders.h b/libmetacity/meta-frame-borders.h
new file mode 100644
index 0000000..71df5e8
--- /dev/null
+++ b/libmetacity/meta-frame-borders.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2001 Havoc Pennington
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef META_FRAME_BORDERS_H
+#define META_FRAME_BORDERS_H
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+typedef struct
+{
+ /* The frame border is made up of two pieces - an inner visible portion
+ * and an outer portion that is invisible but responds to events.
+ */
+ GtkBorder visible;
+ GtkBorder invisible;
+
+ /* For convenience, we have a "total" border which is equal to the sum
+ * of the two borders above. */
+ GtkBorder total;
+} MetaFrameBorders;
+
+void meta_frame_borders_clear (MetaFrameBorders *self);
+
+G_END_DECLS
+
+#endif
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index 3545408..402b268 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -32,6 +32,7 @@
#include <unistd.h>
#include <gdk/gdk.h>
+#include <libmetacity/meta-frame-borders.h>
#include <cairo/cairo-xlib.h>
#include "display.h"
diff --git a/src/core/constraints.c b/src/core/constraints.c
index 167958c..0f284ea 100644
--- a/src/core/constraints.c
+++ b/src/core/constraints.c
@@ -27,6 +27,7 @@
#include "place.h"
#include "prefs.h"
+#include <libmetacity/meta-frame-borders.h>
#include <stdlib.h>
#include <math.h>
diff --git a/src/core/display.c b/src/core/display.c
index 9fd9d5e..5c262d9 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -46,6 +46,7 @@
#include "bell.h"
#include "effects.h"
#include "compositor.h"
+#include <libmetacity/meta-frame-borders.h>
#include <X11/Xatom.h>
#include <X11/cursorfont.h>
#ifdef HAVE_SOLARIS_XINERAMA
diff --git a/src/include/common.h b/src/include/common.h
index 65ea0f7..1f25241 100644
--- a/src/include/common.h
+++ b/src/include/common.h
@@ -262,23 +262,6 @@ struct _MetaButtonLayout
gboolean right_buttons_has_spacer[MAX_BUTTONS_PER_CORNER];
};
-typedef struct _MetaFrameBorders MetaFrameBorders;
-struct _MetaFrameBorders
-{
- /* The frame border is made up of two pieces - an inner visible portion
- * and an outer portion that is invisible but responds to events.
- */
- GtkBorder visible;
- GtkBorder invisible;
-
- /* For convenience, we have a "total" border which is equal to the sum
- * of the two borders above. */
- GtkBorder total;
-};
-
-/* sets all dimensions to zero */
-void meta_frame_borders_clear (MetaFrameBorders *self);
-
/* should investigate changing these to whatever most apps use */
#define META_ICON_WIDTH 96
#define META_ICON_HEIGHT 96
diff --git a/src/include/frame.h b/src/include/frame.h
index 5a0ae25..30e59a6 100644
--- a/src/include/frame.h
+++ b/src/include/frame.h
@@ -21,6 +21,7 @@
#define META_FRAME_H
#include <X11/Xlib.h>
+#include <libmetacity/meta-frame-borders.h>
#include "common.h"
#include "types.h"
diff --git a/src/include/ui.h b/src/include/ui.h
index d85446f..bf154ec 100644
--- a/src/include/ui.h
+++ b/src/include/ui.h
@@ -29,6 +29,7 @@
#include <cairo.h>
#include <glib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <libmetacity/meta-frame-borders.h>
/* This is between GTK_PRIORITY_RESIZE (+10) and GDK_PRIORITY_REDRAW (+20) */
#define META_PRIORITY_RESIZE (G_PRIORITY_HIGH_IDLE + 15)
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 6499b31..a58eb54 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -5658,12 +5658,3 @@ meta_theme_earliest_version_with_button (MetaButtonType type)
return 1000;
}
}
-
-void
-meta_frame_borders_clear (MetaFrameBorders *self)
-{
- self->visible.top = self->invisible.top = self->total.top = 0;
- self->visible.bottom = self->invisible.bottom = self->total.bottom = 0;
- self->visible.left = self->invisible.left = self->total.left = 0;
- self->visible.right = self->invisible.right = self->total.right = 0;
-}
diff --git a/src/ui/theme.h b/src/ui/theme.h
index 581a304..caf4e05 100644
--- a/src/ui/theme.h
+++ b/src/ui/theme.h
@@ -24,6 +24,7 @@
#include "common.h"
#include <gtk/gtk.h>
+#include <libmetacity/meta-frame-borders.h>
#include <libmetacity/meta-theme.h>
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]