Advertisement
Guest User

theme.h

a guest
Oct 10th, 2011
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.22 KB | None | 0 0
  1. /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
  2.  
  3. /* Metacity Theme Rendering */
  4.  
  5. /*
  6.  * Copyright (C) 2001 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., 59 Temple Place - Suite 330, Boston, MA
  21.  * 02111-1307, USA.
  22.  */
  23.  
  24. #ifndef META_THEME_H
  25. #define META_THEME_H
  26.  
  27. #include <glib.h>
  28. #include <meta/common.h>
  29.  
  30. typedef enum
  31. {
  32.   META_BUTTON_STATE_NORMAL,
  33.   META_BUTTON_STATE_PRESSED,
  34.   META_BUTTON_STATE_PRELIGHT,
  35.   META_BUTTON_STATE_LAST
  36. } MetaButtonState;
  37.  
  38. typedef enum
  39. {
  40.   /* Ordered so that background is drawn first */
  41.   META_BUTTON_TYPE_LEFT_LEFT_BACKGROUND,
  42.   META_BUTTON_TYPE_LEFT_MIDDLE_BACKGROUND,
  43.   META_BUTTON_TYPE_LEFT_RIGHT_BACKGROUND,
  44.   META_BUTTON_TYPE_LEFT_SINGLE_BACKGROUND,
  45.   META_BUTTON_TYPE_RIGHT_LEFT_BACKGROUND,
  46.   META_BUTTON_TYPE_RIGHT_MIDDLE_BACKGROUND,
  47.   META_BUTTON_TYPE_RIGHT_RIGHT_BACKGROUND,
  48.   META_BUTTON_TYPE_RIGHT_SINGLE_BACKGROUND,
  49.   META_BUTTON_TYPE_CLOSE,
  50.   META_BUTTON_TYPE_MAXIMIZE,
  51.   META_BUTTON_TYPE_MINIMIZE,
  52.   META_BUTTON_TYPE_MENU,
  53.   META_BUTTON_TYPE_SHADE,
  54.   META_BUTTON_TYPE_ABOVE,
  55.   META_BUTTON_TYPE_STICK,
  56.   META_BUTTON_TYPE_UNSHADE,
  57.   META_BUTTON_TYPE_UNABOVE,
  58.   META_BUTTON_TYPE_UNSTICK,
  59.   META_BUTTON_TYPE_LAST
  60. } MetaButtonType;
  61.  
  62. /**
  63.  * MetaTheme:
  64.  *
  65.  */
  66. typedef struct _MetaTheme MetaTheme;
  67.  
  68. MetaTheme* meta_theme_get_current (void);
  69. void       meta_theme_set_current (const char *name,
  70.                                    gboolean    force_reload);
  71.  
  72. MetaTheme* meta_theme_new      (void);
  73. void       meta_theme_free     (MetaTheme *theme);
  74. gboolean   meta_theme_validate (MetaTheme *theme,
  75.                                 GError   **error);
  76.  
  77. MetaTheme* meta_theme_load (const char *theme_name,
  78.                             GError    **err);
  79.                            
  80. void meta_theme_draw_frame (MetaTheme              *theme,
  81.                             GtkWidget              *widget,
  82.                             cairo_t                *cr,
  83.                             MetaFrameType           type,
  84.                             MetaFrameFlags          flags,
  85.                             int                     client_width,
  86.                             int                     client_height,
  87.                             PangoLayout            *title_layout,
  88.                             int                     text_height,
  89.                             const MetaButtonLayout *button_layout,
  90.                             MetaButtonState         button_states[META_BUTTON_TYPE_LAST],
  91.                             GdkPixbuf              *mini_icon,
  92.                             GdkPixbuf              *icon);
  93.  
  94. #endif
  95.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement