1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
3
/* Metacity window frame manager widget */
6
* Copyright (C) 2001 Havoc Pennington
8
* This program is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public License as
10
* published by the Free Software Foundation; either version 2 of the
11
* License, or (at your option) any later version.
13
* This program is distributed in the hope that it will be useful, but
14
* WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, see <http://www.gnu.org/licenses/>.
27
#include <meta/common.h>
28
#include <meta/types.h>
29
#include "theme-private.h"
34
META_FRAME_CONTROL_NONE,
35
META_FRAME_CONTROL_TITLE,
36
META_FRAME_CONTROL_DELETE,
37
META_FRAME_CONTROL_MENU,
38
META_FRAME_CONTROL_APPMENU,
39
META_FRAME_CONTROL_MINIMIZE,
40
META_FRAME_CONTROL_MAXIMIZE,
41
META_FRAME_CONTROL_UNMAXIMIZE,
42
META_FRAME_CONTROL_RESIZE_SE,
43
META_FRAME_CONTROL_RESIZE_S,
44
META_FRAME_CONTROL_RESIZE_SW,
45
META_FRAME_CONTROL_RESIZE_N,
46
META_FRAME_CONTROL_RESIZE_NE,
47
META_FRAME_CONTROL_RESIZE_NW,
48
META_FRAME_CONTROL_RESIZE_W,
49
META_FRAME_CONTROL_RESIZE_E,
50
META_FRAME_CONTROL_CLIENT_AREA
53
/* This is one widget that manages all the window frames
57
#define META_TYPE_FRAMES (meta_frames_get_type ())
58
#define META_FRAMES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_FRAMES, MetaFrames))
59
#define META_FRAMES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_FRAMES, MetaFramesClass))
60
#define META_IS_FRAMES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_FRAMES))
61
#define META_IS_FRAMES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_FRAMES))
62
#define META_FRAMES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_FRAMES, MetaFramesClass))
64
typedef struct _MetaFrames MetaFrames;
65
typedef struct _MetaFramesClass MetaFramesClass;
70
MetaWindow *meta_window;
73
MetaStyleInfo *style_info;
74
MetaFrameLayout *cache_layout;
75
PangoLayout *text_layout;
77
char *title; /* NULL once we have a layout */
78
guint maybe_ignore_leave_notify : 1;
80
/* FIXME get rid of this, it can just be in the MetaFrames struct */
81
MetaFrameControl prelit_control;
82
MetaButtonState button_state;
88
GtkWindow parent_instance;
90
GHashTable *text_heights;
94
MetaStyleInfo *normal_style;
95
GHashTable *style_variants;
97
MetaGrabOp current_grab_op;
98
MetaUIFrame *grab_frame;
104
struct _MetaFramesClass
106
GtkWindowClass parent_class;
110
GType meta_frames_get_type (void) G_GNUC_CONST;
112
MetaFrames *meta_frames_new (void);
114
MetaUIFrame * meta_frames_manage_window (MetaFrames *frames,
115
MetaWindow *meta_window,
119
void meta_ui_frame_unmanage (MetaUIFrame *frame);
121
void meta_ui_frame_set_title (MetaUIFrame *frame,
124
void meta_ui_frame_update_style (MetaUIFrame *frame);
126
void meta_ui_frame_get_borders (MetaUIFrame *frame,
127
MetaFrameBorders *borders);
129
cairo_region_t * meta_ui_frame_get_bounds (MetaUIFrame *frame);
131
void meta_ui_frame_get_mask (MetaUIFrame *frame,
134
void meta_ui_frame_move_resize (MetaUIFrame *frame,
135
int x, int y, int width, int height);
137
void meta_ui_frame_queue_draw (MetaUIFrame *frame);
139
gboolean meta_ui_frame_handle_event (MetaUIFrame *frame, const ClutterEvent *event);