Blame libmetacity/meta-frame-layout-private.h

Packit 5e0819
/*
Packit 5e0819
 * Copyright (C) 2001 Havoc Pennington
Packit 5e0819
 * Copyright (C) 2016 Alberts Muktupāvels
Packit 5e0819
 *
Packit 5e0819
 * This program is free software: you can redistribute it and/or modify
Packit 5e0819
 * it under the terms of the GNU General Public License as published by
Packit 5e0819
 * the Free Software Foundation, either version 2 of the License, or
Packit 5e0819
 * (at your option) any later version.
Packit 5e0819
 *
Packit 5e0819
 * This program is distributed in the hope that it will be useful,
Packit 5e0819
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 5e0819
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Packit 5e0819
 * GNU General Public License for more details.
Packit 5e0819
 *
Packit 5e0819
 * You should have received a copy of the GNU General Public License
Packit 5e0819
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
Packit 5e0819
 */
Packit 5e0819
Packit 5e0819
#ifndef META_FRAME_LAYOUT_PRIVATE_H
Packit 5e0819
#define META_FRAME_LAYOUT_PRIVATE_H
Packit 5e0819
Packit 5e0819
#include <gtk/gtk.h>
Packit 5e0819
Packit 5e0819
G_BEGIN_DECLS
Packit 5e0819
Packit 5e0819
typedef struct _MetaFrameLayout MetaFrameLayout;
Packit 5e0819
Packit 5e0819
/**
Packit 5e0819
 * Whether a button's size is calculated from the area around it (aspect
Packit 5e0819
 * sizing) or is given as a fixed height and width in pixels (fixed sizing).
Packit 5e0819
 *
Packit 5e0819
 * \bug This could be done away with; see the comment at the top of
Packit 5e0819
 * MetaFrameLayout.
Packit 5e0819
 */
Packit 5e0819
typedef enum
Packit 5e0819
{
Packit 5e0819
  META_BUTTON_SIZING_ASPECT,
Packit 5e0819
  META_BUTTON_SIZING_FIXED,
Packit 5e0819
  META_BUTTON_SIZING_LAST
Packit 5e0819
} MetaButtonSizing;
Packit 5e0819
Packit 5e0819
/**
Packit 5e0819
 * Various parameters used to calculate the geometry of a frame.
Packit 5e0819
 * They are used inside a MetaFrameStyle.
Packit 5e0819
 * This corresponds closely to the <frame_geometry> tag in a theme file.
Packit 5e0819
 *
Packit 5e0819
 * \bug button_sizing isn't really necessary, because we could easily say
Packit 5e0819
 * that if button_aspect is zero, the height and width are fixed values.
Packit 5e0819
 * This would also mean that MetaButtonSizing didn't need to exist, and
Packit 5e0819
 * save code.
Packit 5e0819
 **/
Packit 5e0819
struct _MetaFrameLayout
Packit 5e0819
{
Packit 5e0819
  gint refcount;
Packit 5e0819
Packit 5e0819
  struct {
Packit 5e0819
    /** Border/padding of the entire frame */
Packit 5e0819
    GtkBorder frame_border;
Packit 5e0819
Packit 5e0819
    /** Shadow border used in invisible resize area */
Packit 5e0819
    GtkBorder shadow_border;
Packit 5e0819
Packit 5e0819
    /** Border/padding of the titlebar region */
Packit 5e0819
    GtkBorder titlebar_border;
Packit 5e0819
    /** Border/padding of titlebar buttons */
Packit 5e0819
Packit 5e0819
    /** Size of images in buttons */
Packit 5e0819
    guint icon_size;
Packit 5e0819
Packit 5e0819
    /** Space between titlebar elements */
Packit 5e0819
    guint titlebar_spacing;
Packit 5e0819
Packit 5e0819
    /** Margin of title */
Packit 5e0819
    GtkBorder title_margin;
Packit 5e0819
    /** Margin of titlebar buttons */
Packit 5e0819
    GtkBorder button_margin;
Packit 5e0819
Packit 5e0819
    /** Min size of titlebar region */
Packit 5e0819
    GtkRequisition titlebar_min_size;
Packit 5e0819
    /** Min size of titlebar buttons */
Packit 5e0819
    GtkRequisition button_min_size;
Packit 5e0819
  } gtk;
Packit 5e0819
Packit 5e0819
  struct {
Packit 5e0819
    /** Size of left side */
Packit 5e0819
    gint left_width;
Packit 5e0819
    /** Size of right side */
Packit 5e0819
    gint right_width;
Packit 5e0819
    /** Size of bottom side */
Packit 5e0819
    gint bottom_height;
Packit 5e0819
Packit 5e0819
    /** Border of blue title region
Packit 5e0819
     * \bug (blue?!)
Packit 5e0819
     **/
Packit 5e0819
    GtkBorder title_border;
Packit 5e0819
Packit 5e0819
    /** Extra height for inside of title region, above the font height */
Packit 5e0819
    int title_vertical_pad;
Packit 5e0819
Packit 5e0819
    /** Right indent of buttons from edges of frame */
Packit 5e0819
    int right_titlebar_edge;
Packit 5e0819
    /** Left indent of buttons from edges of frame */
Packit 5e0819
    int left_titlebar_edge;
Packit 5e0819
Packit 5e0819
    /**
Packit 5e0819
     * Sizing rule of buttons, either META_BUTTON_SIZING_ASPECT
Packit 5e0819
     * (in which case button_aspect will be honoured, and
Packit 5e0819
     * button_width and button_height set from it), or
Packit 5e0819
     * META_BUTTON_SIZING_FIXED (in which case we read the width
Packit 5e0819
     * and height directly).
Packit 5e0819
     */
Packit 5e0819
    MetaButtonSizing button_sizing;
Packit 5e0819
Packit 5e0819
    /**
Packit 5e0819
     * Ratio of height/width. Honoured only if
Packit 5e0819
     * button_sizing==META_BUTTON_SIZING_ASPECT.
Packit 5e0819
     * Otherwise we figure out the height from the button_border.
Packit 5e0819
     */
Packit 5e0819
    double button_aspect;
Packit 5e0819
Packit 5e0819
    /** Width of a button; set even when we are using aspect sizing */
Packit 5e0819
    gint button_width;
Packit 5e0819
Packit 5e0819
    /** Height of a button; set even when we are using aspect sizing */
Packit 5e0819
    gint button_height;
Packit 5e0819
  } metacity;
Packit 5e0819
Packit 5e0819
  /** Invisible resize area border */
Packit 5e0819
  GtkBorder invisible_resize_border;
Packit 5e0819
Packit 5e0819
  /** Space around buttons */
Packit 5e0819
  GtkBorder button_border;
Packit 5e0819
Packit 5e0819
  /** scale factor for title text */
Packit 5e0819
  double title_scale;
Packit 5e0819
Packit 5e0819
  /** Whether title text will be displayed */
Packit 5e0819
  guint has_title : 1;
Packit 5e0819
Packit 5e0819
  /** Whether we should hide the buttons */
Packit 5e0819
  guint hide_buttons : 1;
Packit 5e0819
Packit 5e0819
  /** Radius of the top left-hand corner; 0 if not rounded */
Packit 5e0819
  guint top_left_corner_rounded_radius;
Packit 5e0819
  /** Radius of the top right-hand corner; 0 if not rounded */
Packit 5e0819
  guint top_right_corner_rounded_radius;
Packit 5e0819
  /** Radius of the bottom left-hand corner; 0 if not rounded */
Packit 5e0819
  guint bottom_left_corner_rounded_radius;
Packit 5e0819
  /** Radius of the bottom right-hand corner; 0 if not rounded */
Packit 5e0819
  guint bottom_right_corner_rounded_radius;
Packit 5e0819
};
Packit 5e0819
Packit 5e0819
G_GNUC_INTERNAL
Packit 5e0819
MetaFrameLayout *meta_frame_layout_new      (void);
Packit 5e0819
Packit 5e0819
G_GNUC_INTERNAL
Packit 5e0819
MetaFrameLayout *meta_frame_layout_copy     (const MetaFrameLayout  *src);
Packit 5e0819
Packit 5e0819
G_GNUC_INTERNAL
Packit 5e0819
void             meta_frame_layout_ref      (MetaFrameLayout        *layout);
Packit 5e0819
Packit 5e0819
G_GNUC_INTERNAL
Packit 5e0819
void             meta_frame_layout_unref    (MetaFrameLayout        *layout);
Packit 5e0819
Packit 5e0819
G_GNUC_INTERNAL
Packit 5e0819
gboolean         meta_frame_layout_validate (const MetaFrameLayout  *layout,
Packit 5e0819
                                             GError                **error);
Packit 5e0819
Packit 5e0819
G_END_DECLS
Packit 5e0819
Packit 5e0819
#endif