diff options
author | Benjamin Otte <otte@redhat.com> | 2015-12-12 02:02:04 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-12-12 02:16:04 +0100 |
commit | 971a277419800fbcaa9dafa8bb68fdb19d866aee (patch) | |
tree | 0ce504568b8718d82d87da6045a39ea0a497be1a /gtk/gtkcssstylechangeprivate.h | |
parent | 0ad259a178f5172364c3acce41f8d5cde0f571c6 (diff) | |
download | gtk+-971a277419800fbcaa9dafa8bb68fdb19d866aee.tar.gz |
cssnode: Change style-changed signal
Instead of having old and new style, now have a GtkCssStyleChange opaque
object that will compute the changes you are interested in for you.
This simplifies change signal handlers quite a bit and avoids lots of
repeated computation in every signal handler.
Diffstat (limited to 'gtk/gtkcssstylechangeprivate.h')
-rw-r--r-- | gtk/gtkcssstylechangeprivate.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/gtk/gtkcssstylechangeprivate.h b/gtk/gtkcssstylechangeprivate.h new file mode 100644 index 0000000000..2fb2aa3c70 --- /dev/null +++ b/gtk/gtkcssstylechangeprivate.h @@ -0,0 +1,51 @@ +/* GTK - The GIMP Toolkit + * Copyright (C) 2015 Benjamin Otte <otte@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 + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __GTK_CSS_STYLE_CHANGE_PRIVATE_H__ +#define __GTK_CSS_STYLE_CHANGE_PRIVATE_H__ + +#include "gtkcssstyleprivate.h" + +G_BEGIN_DECLS + +typedef struct _GtkCssStyleChange GtkCssStyleChange; + +struct _GtkCssStyleChange { + GtkCssStyle *old_style; + GtkCssStyle *new_style; + + guint n_compared; + + GtkCssAffects affects; + guint has_change :1; +}; + +void gtk_css_style_change_init (GtkCssStyleChange *change, + GtkCssStyle *old_style, + GtkCssStyle *new_style); +void gtk_css_style_change_finish (GtkCssStyleChange *change); + +GtkCssStyle * gtk_css_style_change_get_old_style (GtkCssStyleChange *change); +GtkCssStyle * gtk_css_style_change_get_new_style (GtkCssStyleChange *change); + +gboolean gtk_css_style_change_has_change (GtkCssStyleChange *change); +gboolean gtk_css_style_change_affects (GtkCssStyleChange *change, + GtkCssAffects affects); + +G_END_DECLS + +#endif /* __GTK_CSS_STYLE_CHANGE_PRIVATE_H__ */ |