OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_GTK_CHROME_GTK_FRAME_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_CHROME_GTK_FRAME_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <gdk/gdk.h> |
| 10 #include <gtk/gtkwindow.h> |
| 11 |
| 12 G_BEGIN_DECLS |
| 13 |
| 14 // This file declares two subclasses of GtkWindow for easier gtk+ theme |
| 15 // integration. |
| 16 // |
| 17 // The first is "MetaFrames," which is (was?) the name of a gobject class in |
| 18 // the metacity window manager. To actually get at those values, we need to |
| 19 // have an object whose gobject class name string matches the definitions in |
| 20 // the gtkrc file. MetaFrames derives from GtkWindow. |
| 21 // |
| 22 // Metaframes can not be instantiated. It has no constructor; instantiate |
| 23 // ChromeGtkFrame instead. |
| 24 typedef struct _MetaFrames MetaFrames; |
| 25 typedef struct _MetaFramesClass MetaFramesClass; |
| 26 |
| 27 struct _MetaFrames { |
| 28 GtkWindow window; |
| 29 }; |
| 30 |
| 31 struct _MetaFramesClass { |
| 32 GtkWindowClass parent_class; |
| 33 }; |
| 34 |
| 35 |
| 36 // The second is ChromeGtkFrame, which defines a number of optional style |
| 37 // properties so theme authors can control how chromium appears in gtk-theme |
| 38 // mode. It derives from MetaFrames in chrome so older themes that declare a |
| 39 // MetaFrames theme will still work. New themes should target this class. |
| 40 typedef struct _ChromeGtkFrame ChromeGtkFrame; |
| 41 typedef struct _ChromeGtkFrameClass ChromeGtkFrameClass; |
| 42 |
| 43 struct _ChromeGtkFrame { |
| 44 MetaFrames frames; |
| 45 }; |
| 46 |
| 47 struct _ChromeGtkFrameClass { |
| 48 MetaFramesClass frames_class; |
| 49 }; |
| 50 |
| 51 // Creates a GtkWindow object the the class name "ChromeGtkFrame". |
| 52 GtkWidget* chrome_gtk_frame_new(); |
| 53 |
| 54 G_END_DECLS |
| 55 |
| 56 #endif // CHROME_BROWSER_UI_GTK_CHROME_GTK_FRAME_H_ |
OLD | NEW |