2010-10-18 15:34:08 -04:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
/*
|
|
|
|
* MetaWindowShape
|
|
|
|
*
|
|
|
|
* Extracted invariant window shape
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2014-01-11 20:42:06 -05:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2010-10-18 15:34:08 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __META_WINDOW_SHAPE_H__
|
|
|
|
#define __META_WINDOW_SHAPE_H__
|
|
|
|
|
|
|
|
#include <cairo.h>
|
2015-07-06 03:02:13 -04:00
|
|
|
#include <glib-object.h>
|
|
|
|
|
2019-01-22 21:25:35 -05:00
|
|
|
#include <meta/common.h>
|
|
|
|
|
|
|
|
META_EXPORT
|
2015-07-06 03:29:23 -04:00
|
|
|
GType meta_window_shape_get_type (void) G_GNUC_CONST;
|
2010-10-18 15:34:08 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* MetaWindowShape:
|
|
|
|
* #MetaWindowShape represents a 9-sliced region with borders on all sides that
|
|
|
|
* are unscaled, and a constant central region that is scaled. For example,
|
|
|
|
* the regions representing two windows that are rounded rectangles,
|
|
|
|
* with the same corner radius but different sizes, have the
|
|
|
|
* same MetaWindowShape.
|
|
|
|
*
|
|
|
|
* #MetaWindowShape is designed to be used as part of a hash table key, so has
|
|
|
|
* efficient hash and equal functions.
|
|
|
|
*/
|
|
|
|
typedef struct _MetaWindowShape MetaWindowShape;
|
|
|
|
|
2019-01-22 21:25:35 -05:00
|
|
|
META_EXPORT
|
2010-10-18 15:34:08 -04:00
|
|
|
MetaWindowShape * meta_window_shape_new (cairo_region_t *region);
|
2019-01-22 21:25:35 -05:00
|
|
|
|
|
|
|
META_EXPORT
|
2010-10-18 15:34:08 -04:00
|
|
|
MetaWindowShape * meta_window_shape_ref (MetaWindowShape *shape);
|
2019-01-22 21:25:35 -05:00
|
|
|
|
|
|
|
META_EXPORT
|
2010-10-18 15:34:08 -04:00
|
|
|
void meta_window_shape_unref (MetaWindowShape *shape);
|
2019-01-22 21:25:35 -05:00
|
|
|
|
|
|
|
META_EXPORT
|
2010-10-18 15:34:08 -04:00
|
|
|
guint meta_window_shape_hash (MetaWindowShape *shape);
|
2019-01-22 21:25:35 -05:00
|
|
|
|
|
|
|
META_EXPORT
|
2010-10-18 15:34:08 -04:00
|
|
|
gboolean meta_window_shape_equal (MetaWindowShape *shape_a,
|
|
|
|
MetaWindowShape *shape_b);
|
2019-01-22 21:25:35 -05:00
|
|
|
|
|
|
|
META_EXPORT
|
2010-10-18 15:34:08 -04:00
|
|
|
void meta_window_shape_get_borders (MetaWindowShape *shape,
|
|
|
|
int *border_top,
|
|
|
|
int *border_right,
|
|
|
|
int *border_bottom,
|
|
|
|
int *border_left);
|
2019-01-22 21:25:35 -05:00
|
|
|
|
|
|
|
META_EXPORT
|
2010-10-18 15:34:08 -04:00
|
|
|
cairo_region_t *meta_window_shape_to_region (MetaWindowShape *shape,
|
|
|
|
int center_width,
|
|
|
|
int center_height);
|
|
|
|
|
|
|
|
#endif /* __META_WINDOW_SHAPE_H __*/
|
|
|
|
|