1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 
3 /* Metacity theme preview widget */
4 
5 /*
6  * Copyright (C) 2002 Havoc Pennington
7  *
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.
12  *
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.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street - Suite 500, Boston, MA
21  * 02110-1335, USA.
22  */
23 
24 #include <config.h>
25 
26 #include <meta/common.h>
27 #include <meta/theme.h>
28 #include <gtk/gtk.h>
29 
30 #ifndef META_PREVIEW_WIDGET_H
31 #define META_PREVIEW_WIDGET_H
32 
33 #define META_TYPE_PREVIEW			 (meta_preview_get_type ())
34 #define META_PREVIEW(obj)			 (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_PREVIEW, MetaPreview))
35 #define META_PREVIEW_CLASS(klass)		 (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_PREVIEW, MetaPreviewClass))
36 #define META_IS_PREVIEW(obj)		 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_PREVIEW))
37 #define META_IS_PREVIEW_CLASS(klass)	 (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_PREVIEW))
38 #define META_PREVIEW_GET_CLASS(obj)         (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_PREVIEW, MetaPreviewClass))
39 
40 typedef struct _MetaPreview	MetaPreview;
41 typedef struct _MetaPreviewClass	MetaPreviewClass;
42 
43 struct _MetaPreview
44 {
45   GtkBin bin;
46 
47   MetaTheme *theme;
48   char *title;
49   MetaFrameType type;
50   MetaFrameFlags flags;
51 
52   PangoLayout *layout;
53   int text_height;
54 
55   MetaFrameBorders borders;
56   guint            borders_cached : 1;
57 
58   MetaButtonLayout button_layout;
59 };
60 
61 struct _MetaPreviewClass
62 {
63   GtkBinClass parent_class;
64 };
65 
66 
67 GType    meta_preview_get_type (void) G_GNUC_CONST;
68 GtkWidget* meta_preview_new	 (void);
69 
70 void meta_preview_set_theme         (MetaPreview            *preview,
71                                      MetaTheme              *theme);
72 void meta_preview_set_title         (MetaPreview            *preview,
73                                      const char             *title);
74 void meta_preview_set_frame_type    (MetaPreview            *preview,
75                                      MetaFrameType           type);
76 void meta_preview_set_frame_flags   (MetaPreview            *preview,
77                                      MetaFrameFlags          flags);
78 void meta_preview_set_button_layout (MetaPreview            *preview,
79                                      const MetaButtonLayout *button_layout);
80 
81 cairo_region_t * meta_preview_get_clip_region (MetaPreview *preview,
82                                                gint         new_window_width,
83                                                gint         new_window_height);
84 
85 #endif
86