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