Commit 32e41f95 authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

libmetacity-private: don't include common.h

parent 4e9843d9
......@@ -14,6 +14,8 @@ libmetacity_la_SOURCES = \
meta-color-spec.h \
meta-frame-borders.c \
meta-frame-borders.h \
meta-frame-flags.h \
meta-frame-type.h \
meta-gradient.c \
meta-gradient.h \
meta-gradient-private.h \
......@@ -58,6 +60,8 @@ libmetacity_include_HEADERS = \
meta-color.h \
meta-color-spec.h \
meta-frame-borders.h \
meta-frame-flags.h \
meta-frame-type.h \
meta-gradient.h \
meta-gradient-spec.h \
meta-theme.h \
......
/*
* 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_FLAGS_H
#define META_FRAME_FLAGS_H
#include <glib.h>
G_BEGIN_DECLS
typedef enum
{
META_FRAME_ALLOWS_DELETE = 1 << 0,
META_FRAME_ALLOWS_MENU = 1 << 1,
META_FRAME_ALLOWS_APPMENU = 1 << 2,
META_FRAME_ALLOWS_MINIMIZE = 1 << 3,
META_FRAME_ALLOWS_MAXIMIZE = 1 << 4,
META_FRAME_ALLOWS_VERTICAL_RESIZE = 1 << 5,
META_FRAME_ALLOWS_HORIZONTAL_RESIZE = 1 << 6,
META_FRAME_HAS_FOCUS = 1 << 7,
META_FRAME_SHADED = 1 << 8,
META_FRAME_STUCK = 1 << 9,
META_FRAME_MAXIMIZED = 1 << 10,
META_FRAME_ALLOWS_SHADE = 1 << 11,
META_FRAME_ALLOWS_MOVE = 1 << 12,
META_FRAME_FULLSCREEN = 1 << 13,
META_FRAME_IS_FLASHING = 1 << 14,
META_FRAME_ABOVE = 1 << 15,
META_FRAME_TILED_LEFT = 1 << 16,
META_FRAME_TILED_RIGHT = 1 << 17
} MetaFrameFlags;
G_END_DECLS
#endif
/*
* 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_TYPE_H
#define META_FRAME_TYPE_H
#include <glib.h>
G_BEGIN_DECLS
typedef enum
{
META_FRAME_TYPE_NORMAL,
META_FRAME_TYPE_DIALOG,
META_FRAME_TYPE_MODAL_DIALOG,
META_FRAME_TYPE_UTILITY,
META_FRAME_TYPE_MENU,
META_FRAME_TYPE_BORDER,
META_FRAME_TYPE_ATTACHED,
META_FRAME_TYPE_LAST
} MetaFrameType;
G_END_DECLS
#endif
......@@ -130,7 +130,6 @@ libmetacity_private_la_LIBADD = @METACITY_LIBS@ $(top_builddir)/libmetacity/lib
libmetacityincludedir = $(includedir)/metacity/metacity-private
libmetacityinclude_HEADERS = \
include/common.h \
ui/theme.h
metacity_theme_viewer_SOURCES= \
......
......@@ -1121,7 +1121,7 @@ button_layout_equal (const MetaButtonLayout *a,
int i;
i = 0;
while (i < MAX_BUTTONS_PER_CORNER)
while (i < META_BUTTON_FUNCTION_LAST)
{
if (a->left_buttons[i] != b->left_buttons[i])
return FALSE;
......
......@@ -30,32 +30,9 @@
#include <X11/Xlib.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <libmetacity/meta-button-layout.h>
typedef struct _MetaResizePopup MetaResizePopup;
typedef enum
{
META_FRAME_ALLOWS_DELETE = 1 << 0,
META_FRAME_ALLOWS_MENU = 1 << 1,
META_FRAME_ALLOWS_APPMENU = 1 << 2,
META_FRAME_ALLOWS_MINIMIZE = 1 << 3,
META_FRAME_ALLOWS_MAXIMIZE = 1 << 4,
META_FRAME_ALLOWS_VERTICAL_RESIZE = 1 << 5,
META_FRAME_ALLOWS_HORIZONTAL_RESIZE = 1 << 6,
META_FRAME_HAS_FOCUS = 1 << 7,
META_FRAME_SHADED = 1 << 8,
META_FRAME_STUCK = 1 << 9,
META_FRAME_MAXIMIZED = 1 << 10,
META_FRAME_ALLOWS_SHADE = 1 << 11,
META_FRAME_ALLOWS_MOVE = 1 << 12,
META_FRAME_FULLSCREEN = 1 << 13,
META_FRAME_IS_FLASHING = 1 << 14,
META_FRAME_ABOVE = 1 << 15,
META_FRAME_TILED_LEFT = 1 << 16,
META_FRAME_TILED_RIGHT = 1 << 17
} MetaFrameFlags;
typedef enum
{
META_MENU_OP_NONE = 0,
......@@ -165,18 +142,6 @@ typedef enum
} MetaCursor;
typedef enum
{
META_FRAME_TYPE_NORMAL,
META_FRAME_TYPE_DIALOG,
META_FRAME_TYPE_MODAL_DIALOG,
META_FRAME_TYPE_UTILITY,
META_FRAME_TYPE_MENU,
META_FRAME_TYPE_BORDER,
META_FRAME_TYPE_ATTACHED,
META_FRAME_TYPE_LAST
} MetaFrameType;
typedef enum
{
/* Create gratuitous divergence from regular
......@@ -229,8 +194,6 @@ typedef enum
META_SIDE_BOTTOM = META_DIRECTION_BOTTOM
} MetaSide;
#define MAX_BUTTONS_PER_CORNER META_BUTTON_FUNCTION_LAST
/* should investigate changing these to whatever most apps use */
#define META_ICON_WIDTH 96
#define META_ICON_HEIGHT 96
......
......@@ -26,6 +26,7 @@
/* This header is a "common" one between the UI and core side */
#include "common.h"
#include "types.h"
#include <libmetacity/meta-button-layout.h>
#include <pango/pango-font.h>
#include <gdesktop-enums.h>
......
......@@ -30,6 +30,8 @@
#include <glib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <libmetacity/meta-frame-borders.h>
#include <libmetacity/meta-frame-flags.h>
#include <libmetacity/meta-frame-type.h>
/* This is between GTK_PRIORITY_RESIZE (+10) and GDK_PRIORITY_REDRAW (+20) */
#define META_PRIORITY_RESIZE (G_PRIORITY_HIGH_IDLE + 15)
......
......@@ -71,7 +71,7 @@ meta_preview_init (MetaPreview *preview)
gtk_widget_set_has_window (GTK_WIDGET (preview), FALSE);
i = 0;
while (i < MAX_BUTTONS_PER_CORNER)
while (i < META_BUTTON_FUNCTION_LAST)
{
preview->button_layout.left_buttons[i] = META_BUTTON_FUNCTION_LAST;
preview->button_layout.right_buttons[i] = META_BUTTON_FUNCTION_LAST;
......
......@@ -43,9 +43,9 @@
* we have a special case for the "no buttons on either side" case.
*/
#ifndef ALLOW_DUPLICATE_BUTTONS
#define BUTTON_LAYOUT_COMBINATIONS (MAX_BUTTONS_PER_CORNER + 1 + 1)
#define BUTTON_LAYOUT_COMBINATIONS (META_BUTTON_FUNCTION_LAST + 1 + 1)
#else
#define BUTTON_LAYOUT_COMBINATIONS ((MAX_BUTTONS_PER_CORNER+1)*(MAX_BUTTONS_PER_CORNER+1))
#define BUTTON_LAYOUT_COMBINATIONS ((META_BUTTON_FUNCTION_LAST+1)*(META_BUTTON_FUNCTION_LAST+1))
#endif
enum
......@@ -660,7 +660,7 @@ init_layouts (void)
int j;
j = 0;
while (j < MAX_BUTTONS_PER_CORNER)
while (j < META_BUTTON_FUNCTION_LAST)
{
different_layouts[i].left_buttons[j] = META_BUTTON_FUNCTION_LAST;
different_layouts[i].right_buttons[j] = META_BUTTON_FUNCTION_LAST;
......@@ -671,7 +671,7 @@ init_layouts (void)
#ifndef ALLOW_DUPLICATE_BUTTONS
i = 0;
while (i <= MAX_BUTTONS_PER_CORNER)
while (i <= META_BUTTON_FUNCTION_LAST)
{
int j;
......@@ -681,7 +681,7 @@ init_layouts (void)
different_layouts[i].right_buttons[j] = (MetaButtonFunction) j;
++j;
}
while (j < MAX_BUTTONS_PER_CORNER)
while (j < META_BUTTON_FUNCTION_LAST)
{
different_layouts[i].left_buttons[j-i] = (MetaButtonFunction) j;
++j;
......@@ -704,23 +704,23 @@ init_layouts (void)
left = 0;
i = 0;
while (left < MAX_BUTTONS_PER_CORNER)
while (left < META_BUTTON_FUNCTION_LAST)
{
int right;
right = 0;
while (right < MAX_BUTTONS_PER_CORNER)
while (right < META_BUTTON_FUNCTION_LAST)
{
int j;
static MetaButtonFunction left_functions[MAX_BUTTONS_PER_CORNER] = {
static MetaButtonFunction left_functions[META_BUTTON_FUNCTION_LAST] = {
META_BUTTON_FUNCTION_MENU,
META_BUTTON_FUNCTION_MINIMIZE,
META_BUTTON_FUNCTION_MAXIMIZE,
META_BUTTON_FUNCTION_CLOSE
};
static MetaButtonFunction right_functions[MAX_BUTTONS_PER_CORNER] = {
static MetaButtonFunction right_functions[META_BUTTON_FUNCTION_LAST] = {
META_BUTTON_FUNCTION_MINIMIZE,
META_BUTTON_FUNCTION_MAXIMIZE,
META_BUTTON_FUNCTION_CLOSE,
......@@ -1055,7 +1055,7 @@ run_theme_benchmark (void)
layout = create_title_layout (widget);
i = 0;
while (i < MAX_BUTTONS_PER_CORNER)
while (i < META_BUTTON_FUNCTION_LAST)
{
button_layout.left_buttons[i] = META_BUTTON_FUNCTION_LAST;
button_layout.right_buttons[i] = META_BUTTON_FUNCTION_LAST;
......
......@@ -589,8 +589,8 @@ rect_for_function (MetaFrameGeometry *fgeom,
}
static gboolean
strip_button (MetaButtonSpace *func_rects[MAX_BUTTONS_PER_CORNER],
GdkRectangle *bg_rects[MAX_BUTTONS_PER_CORNER],
strip_button (MetaButtonSpace *func_rects[META_BUTTON_FUNCTION_LAST],
GdkRectangle *bg_rects[META_BUTTON_FUNCTION_LAST],
int *n_rects,
MetaButtonSpace *to_strip)
{
......@@ -777,12 +777,12 @@ meta_frame_layout_calc_geometry (MetaFrameLayout *layout,
/* the left/right rects in order; the max # of rects
* is the number of button functions
*/
MetaButtonSpace *left_func_rects[MAX_BUTTONS_PER_CORNER];
MetaButtonSpace *right_func_rects[MAX_BUTTONS_PER_CORNER];
GdkRectangle *left_bg_rects[MAX_BUTTONS_PER_CORNER];
gboolean left_buttons_has_spacer[MAX_BUTTONS_PER_CORNER];
GdkRectangle *right_bg_rects[MAX_BUTTONS_PER_CORNER];
gboolean right_buttons_has_spacer[MAX_BUTTONS_PER_CORNER];
MetaButtonSpace *left_func_rects[META_BUTTON_FUNCTION_LAST];
MetaButtonSpace *right_func_rects[META_BUTTON_FUNCTION_LAST];
GdkRectangle *left_bg_rects[META_BUTTON_FUNCTION_LAST];
gboolean left_buttons_has_spacer[META_BUTTON_FUNCTION_LAST];
GdkRectangle *right_bg_rects[META_BUTTON_FUNCTION_LAST];
gboolean right_buttons_has_spacer[META_BUTTON_FUNCTION_LAST];
meta_frame_layout_sync_with_style (layout, style_info, flags, theme);
......@@ -843,7 +843,7 @@ meta_frame_layout_calc_geometry (MetaFrameLayout *layout,
if (!layout->hide_buttons)
{
/* Try to fill in rects */
for (i = 0; i < MAX_BUTTONS_PER_CORNER && button_layout->left_buttons[i] != META_BUTTON_FUNCTION_LAST; i++)
for (i = 0; i < META_BUTTON_FUNCTION_LAST && button_layout->left_buttons[i] != META_BUTTON_FUNCTION_LAST; i++)
{
left_func_rects[n_left] = rect_for_function (fgeom, flags,
button_layout->left_buttons[i],
......@@ -858,7 +858,7 @@ meta_frame_layout_calc_geometry (MetaFrameLayout *layout,
}
}
for (i = 0; i < MAX_BUTTONS_PER_CORNER && button_layout->right_buttons[i] != META_BUTTON_FUNCTION_LAST; i++)
for (i = 0; i < META_BUTTON_FUNCTION_LAST && button_layout->right_buttons[i] != META_BUTTON_FUNCTION_LAST; i++)
{
right_func_rects[n_right] = rect_for_function (fgeom, flags,
button_layout->right_buttons[i],
......@@ -874,7 +874,7 @@ meta_frame_layout_calc_geometry (MetaFrameLayout *layout,
}
}
for (i = 0; i < MAX_BUTTONS_PER_CORNER; i++)
for (i = 0; i < META_BUTTON_FUNCTION_LAST; i++)
{
left_bg_rects[i] = NULL;
right_bg_rects[i] = NULL;
......
......@@ -22,9 +22,11 @@
#ifndef THEME_H
#define THEME_H
#include "common.h"
#include <gtk/gtk.h>
#include <libmetacity/meta-button-layout.h>
#include <libmetacity/meta-frame-borders.h>
#include <libmetacity/meta-frame-flags.h>
#include <libmetacity/meta-frame-type.h>
#include <libmetacity/meta-theme.h>
/**
......@@ -85,7 +87,7 @@ struct _MetaFrameGeometry
MetaButtonSpace unabove_rect;
MetaButtonSpace unstick_rect;
#define MAX_MIDDLE_BACKGROUNDS (MAX_BUTTONS_PER_CORNER - 2)
#define MAX_MIDDLE_BACKGROUNDS (META_BUTTON_FUNCTION_LAST - 2)
GdkRectangle left_left_background;
GdkRectangle left_middle_backgrounds[MAX_MIDDLE_BACKGROUNDS];
GdkRectangle left_right_background;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment