2010-03-04 22:00:30 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
|
|
|
* Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2010-03-04 22:00:30 +00:00
|
|
|
*/
|
|
|
|
|
2012-12-28 14:57:34 +00:00
|
|
|
#ifndef __GTK_STYLE_CONTEXT_H__
|
|
|
|
#define __GTK_STYLE_CONTEXT_H__
|
|
|
|
|
2010-12-02 22:45:14 +00:00
|
|
|
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
|
|
|
#error "Only <gtk/gtk.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2019-04-10 16:40:50 +00:00
|
|
|
#include <gtk/css/gtkcss.h>
|
|
|
|
|
2012-03-03 18:22:22 +00:00
|
|
|
#include <gtk/gtkborder.h>
|
2010-03-13 10:15:42 +00:00
|
|
|
#include <gtk/gtkstyleprovider.h>
|
2012-03-03 18:22:22 +00:00
|
|
|
#include <gtk/gtktypes.h>
|
2010-03-04 22:00:30 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define GTK_TYPE_STYLE_CONTEXT (gtk_style_context_get_type ())
|
|
|
|
#define GTK_STYLE_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_STYLE_CONTEXT, GtkStyleContext))
|
|
|
|
#define GTK_STYLE_CONTEXT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GTK_TYPE_STYLE_CONTEXT, GtkStyleContextClass))
|
|
|
|
#define GTK_IS_STYLE_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_STYLE_CONTEXT))
|
|
|
|
#define GTK_IS_STYLE_CONTEXT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GTK_TYPE_STYLE_CONTEXT))
|
|
|
|
#define GTK_STYLE_CONTEXT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_STYLE_CONTEXT, GtkStyleContextClass))
|
|
|
|
|
2010-10-20 17:52:50 +00:00
|
|
|
typedef struct _GtkStyleContextClass GtkStyleContextClass;
|
2010-03-04 22:00:30 +00:00
|
|
|
|
2010-10-20 17:52:50 +00:00
|
|
|
struct _GtkStyleContext
|
2010-03-04 22:00:30 +00:00
|
|
|
{
|
|
|
|
GObject parent_object;
|
|
|
|
};
|
|
|
|
|
2010-10-20 17:52:50 +00:00
|
|
|
struct _GtkStyleContextClass
|
2010-03-04 22:00:30 +00:00
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
2010-09-11 10:18:26 +00:00
|
|
|
|
|
|
|
void (* changed) (GtkStyleContext *context);
|
2011-01-25 21:29:00 +00:00
|
|
|
|
|
|
|
/* Padding for future expansion */
|
|
|
|
void (*_gtk_reserved1) (void);
|
|
|
|
void (*_gtk_reserved2) (void);
|
|
|
|
void (*_gtk_reserved3) (void);
|
|
|
|
void (*_gtk_reserved4) (void);
|
2010-03-04 22:00:30 +00:00
|
|
|
};
|
|
|
|
|
2014-10-20 11:32:42 +00:00
|
|
|
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-03-04 22:00:30 +00:00
|
|
|
GType gtk_style_context_get_type (void) G_GNUC_CONST;
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-10-31 01:35:21 +00:00
|
|
|
void gtk_style_context_add_provider_for_display (GdkDisplay *display,
|
|
|
|
GtkStyleProvider *provider,
|
|
|
|
guint priority);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-10-31 01:35:21 +00:00
|
|
|
void gtk_style_context_remove_provider_for_display (GdkDisplay *display,
|
|
|
|
GtkStyleProvider *provider);
|
2010-09-11 10:42:35 +00:00
|
|
|
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-03-04 22:00:30 +00:00
|
|
|
void gtk_style_context_add_provider (GtkStyleContext *context,
|
|
|
|
GtkStyleProvider *provider,
|
|
|
|
guint priority);
|
|
|
|
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-03-04 22:00:30 +00:00
|
|
|
void gtk_style_context_remove_provider (GtkStyleContext *context,
|
|
|
|
GtkStyleProvider *provider);
|
|
|
|
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-07-03 18:53:50 +00:00
|
|
|
void gtk_style_context_save (GtkStyleContext *context);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-07-03 18:53:50 +00:00
|
|
|
void gtk_style_context_restore (GtkStyleContext *context);
|
|
|
|
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-03-10 00:02:46 +00:00
|
|
|
void gtk_style_context_set_state (GtkStyleContext *context,
|
|
|
|
GtkStateFlags flags);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-03-10 00:02:46 +00:00
|
|
|
GtkStateFlags gtk_style_context_get_state (GtkStyleContext *context);
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-06-27 16:21:41 +00:00
|
|
|
void gtk_style_context_set_scale (GtkStyleContext *context,
|
2020-07-24 13:54:49 +00:00
|
|
|
int scale);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-07-24 13:54:49 +00:00
|
|
|
int gtk_style_context_get_scale (GtkStyleContext *context);
|
2013-06-27 16:21:41 +00:00
|
|
|
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-10-20 17:02:41 +00:00
|
|
|
void gtk_style_context_add_class (GtkStyleContext *context,
|
2020-07-24 18:40:36 +00:00
|
|
|
const char *class_name);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-10-20 17:02:41 +00:00
|
|
|
void gtk_style_context_remove_class (GtkStyleContext *context,
|
2020-07-24 18:40:36 +00:00
|
|
|
const char *class_name);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-10-20 17:02:41 +00:00
|
|
|
gboolean gtk_style_context_has_class (GtkStyleContext *context,
|
2020-07-24 18:40:36 +00:00
|
|
|
const char *class_name);
|
2010-03-20 12:02:20 +00:00
|
|
|
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-10-31 01:35:21 +00:00
|
|
|
void gtk_style_context_set_display (GtkStyleContext *context,
|
|
|
|
GdkDisplay *display);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-10-31 01:35:21 +00:00
|
|
|
GdkDisplay *gtk_style_context_get_display (GtkStyleContext *context);
|
2010-07-03 11:17:35 +00:00
|
|
|
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-12-09 22:55:33 +00:00
|
|
|
gboolean gtk_style_context_lookup_color (GtkStyleContext *context,
|
2020-07-24 18:40:36 +00:00
|
|
|
const char *color_name,
|
2010-12-09 22:55:33 +00:00
|
|
|
GdkRGBA *color);
|
2010-06-27 17:37:34 +00:00
|
|
|
|
2010-12-02 22:41:24 +00:00
|
|
|
/* Some helper functions to retrieve most common properties */
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-12-02 22:41:24 +00:00
|
|
|
void gtk_style_context_get_color (GtkStyleContext *context,
|
|
|
|
GdkRGBA *color);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-12-02 22:41:24 +00:00
|
|
|
void gtk_style_context_get_border (GtkStyleContext *context,
|
|
|
|
GtkBorder *border);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-12-02 22:41:24 +00:00
|
|
|
void gtk_style_context_get_padding (GtkStyleContext *context,
|
|
|
|
GtkBorder *padding);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-12-02 22:41:24 +00:00
|
|
|
void gtk_style_context_get_margin (GtkStyleContext *context,
|
|
|
|
GtkBorder *margin);
|
2010-08-19 20:35:42 +00:00
|
|
|
|
2015-12-28 06:09:54 +00:00
|
|
|
typedef enum {
|
|
|
|
GTK_STYLE_CONTEXT_PRINT_NONE = 0,
|
|
|
|
GTK_STYLE_CONTEXT_PRINT_RECURSE = 1 << 0,
|
2020-01-14 00:18:31 +00:00
|
|
|
GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE = 1 << 1,
|
|
|
|
GTK_STYLE_CONTEXT_PRINT_SHOW_CHANGE = 1 << 2
|
2015-12-28 06:09:54 +00:00
|
|
|
} GtkStyleContextPrintFlags;
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2015-12-28 06:09:54 +00:00
|
|
|
char * gtk_style_context_to_string (GtkStyleContext *context,
|
|
|
|
GtkStyleContextPrintFlags flags);
|
|
|
|
|
2022-09-24 01:54:15 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkStyleContext, g_object_unref)
|
|
|
|
|
2010-03-04 22:00:30 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GTK_STYLE_CONTEXT_H__ */
|