summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2019-04-10 18:40:50 +0200
committerBenjamin Otte <otte@redhat.com>2019-04-12 19:34:28 +0200
commit2e0a56665a85421e6be947274b2d513ac142993c (patch)
tree947eb87da38be176927c9e5625a3283251162379
parent76826cfa2f37a2cd005c1ead26facef2fb6526a5 (diff)
downloadgtk+-2e0a56665a85421e6be947274b2d513ac142993c.tar.gz
css: Move gtkcsssection.[ch] into gtk/css
-rw-r--r--gtk/css/gtkcss.h1
-rw-r--r--gtk/css/gtkcsssection.c (renamed from gtk/gtkcsssection.c)21
-rw-r--r--gtk/css/gtkcsssection.h (renamed from gtk/gtkcsssection.h)7
-rw-r--r--gtk/css/meson.build2
-rw-r--r--gtk/gtk.h1
-rw-r--r--gtk/gtkcsslookupprivate.h4
-rw-r--r--gtk/gtkcssprovider.c13
-rw-r--r--gtk/gtkcssprovider.h2
-rw-r--r--gtk/gtkcssstyle.c1
-rw-r--r--gtk/gtkcssstyleprivate.h2
-rw-r--r--gtk/gtkstylecontext.h3
-rw-r--r--gtk/inspector/css-node-tree.c5
-rw-r--r--gtk/meson.build2
13 files changed, 35 insertions, 29 deletions
diff --git a/gtk/css/gtkcss.h b/gtk/css/gtkcss.h
index 343244c2c3..fbbc8d42a8 100644
--- a/gtk/css/gtkcss.h
+++ b/gtk/css/gtkcss.h
@@ -34,6 +34,7 @@
#include <gtk/css/gtkcssenumtypes.h>
#include <gtk/css/gtkcsserror.h>
#include <gtk/css/gtkcsslocation.h>
+#include <gtk/css/gtkcsssection.h>
#undef __GTK_CSS_H_INSIDE__
diff --git a/gtk/gtkcsssection.c b/gtk/css/gtkcsssection.c
index 3134666796..f3981603f8 100644
--- a/gtk/gtkcsssection.c
+++ b/gtk/css/gtkcsssection.c
@@ -20,7 +20,6 @@
#include "gtkcsssection.h"
#include "gtkcssparserprivate.h"
-#include "gtkprivate.h"
struct _GtkCssSection
{
@@ -52,9 +51,9 @@ gtk_css_section_new (GFile *file,
{
GtkCssSection *result;
- gtk_internal_return_val_if_fail (file == NULL || G_IS_FILE (file), NULL);
- gtk_internal_return_val_if_fail (start != NULL, NULL);
- gtk_internal_return_val_if_fail (end != NULL, NULL);
+ g_return_val_if_fail (file == NULL || G_IS_FILE (file), NULL);
+ g_return_val_if_fail (start != NULL, NULL);
+ g_return_val_if_fail (end != NULL, NULL);
result = g_slice_new0 (GtkCssSection);
@@ -78,7 +77,7 @@ gtk_css_section_new (GFile *file,
GtkCssSection *
gtk_css_section_ref (GtkCssSection *section)
{
- gtk_internal_return_val_if_fail (section != NULL, NULL);
+ g_return_val_if_fail (section != NULL, NULL);
section->ref_count += 1;
@@ -95,7 +94,7 @@ gtk_css_section_ref (GtkCssSection *section)
void
gtk_css_section_unref (GtkCssSection *section)
{
- gtk_internal_return_if_fail (section != NULL);
+ g_return_if_fail (section != NULL);
section->ref_count -= 1;
if (section->ref_count > 0)
@@ -126,7 +125,7 @@ gtk_css_section_unref (GtkCssSection *section)
GtkCssSection *
gtk_css_section_get_parent (const GtkCssSection *section)
{
- gtk_internal_return_val_if_fail (section != NULL, NULL);
+ g_return_val_if_fail (section != NULL, NULL);
return section->parent;
}
@@ -145,7 +144,7 @@ gtk_css_section_get_parent (const GtkCssSection *section)
GFile *
gtk_css_section_get_file (const GtkCssSection *section)
{
- gtk_internal_return_val_if_fail (section != NULL, NULL);
+ g_return_val_if_fail (section != NULL, NULL);
return section->file;
}
@@ -162,7 +161,7 @@ gtk_css_section_get_file (const GtkCssSection *section)
const GtkCssLocation *
gtk_css_section_get_start_location (const GtkCssSection *section)
{
- gtk_internal_return_val_if_fail (section != NULL, NULL);
+ g_return_val_if_fail (section != NULL, NULL);
return &section->start_location;
}
@@ -179,7 +178,7 @@ gtk_css_section_get_start_location (const GtkCssSection *section)
const GtkCssLocation *
gtk_css_section_get_end_location (const GtkCssSection *section)
{
- gtk_internal_return_val_if_fail (section != NULL, NULL);
+ g_return_val_if_fail (section != NULL, NULL);
return &section->end_location;
}
@@ -245,7 +244,7 @@ gtk_css_section_to_string (const GtkCssSection *section)
{
GString *string;
- gtk_internal_return_val_if_fail (section != NULL, NULL);
+ g_return_val_if_fail (section != NULL, NULL);
string = g_string_new (NULL);
gtk_css_section_print (section, string);
diff --git a/gtk/gtkcsssection.h b/gtk/css/gtkcsssection.h
index fbca82105b..4367376152 100644
--- a/gtk/gtkcsssection.h
+++ b/gtk/css/gtkcsssection.h
@@ -18,8 +18,13 @@
#ifndef __GTK_CSS_SECTION_H__
#define __GTK_CSS_SECTION_H__
+#if !defined (__GTK_CSS_H_INSIDE__) && !defined (GTK_CSS_COMPILATION)
+#error "Only <gtk/css/gtkcss.h> can be included directly."
+#endif
+
#include <gio/gio.h>
-#include <gtk/css/gtkcss.h>
+#include <gdk/gdkversionmacros.h>
+#include <gtk/css/gtkcsslocation.h>
G_BEGIN_DECLS
diff --git a/gtk/css/meson.build b/gtk/css/meson.build
index 18480ed88c..e97360f174 100644
--- a/gtk/css/meson.build
+++ b/gtk/css/meson.build
@@ -1,6 +1,7 @@
gtk_css_public_sources = files([
'gtkcsslocation.c',
'gtkcsserror.c',
+ 'gtkcsssection.c',
])
gtk_css_private_sources = files([
@@ -12,6 +13,7 @@ gtk_css_public_headers = files([
'gtkcssenums.h',
'gtkcsserror.h',
'gtkcsslocation.h',
+ 'gtkcsssection.h',
])
install_headers(gtk_css_public_headers, 'gtkcss.h', subdir: 'gtk-4.0/gtk/css')
diff --git a/gtk/gtk.h b/gtk/gtk.h
index 9358fcd517..477cf4e496 100644
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
@@ -84,7 +84,6 @@
#include <gtk/gtkcomboboxtext.h>
#include <gtk/gtkcontainer.h>
#include <gtk/gtkcssprovider.h>
-#include <gtk/gtkcsssection.h>
#include <gtk/gtkcustomlayout.h>
#include <gtk/gtkdebug.h>
#include <gtk/gtkdialog.h>
diff --git a/gtk/gtkcsslookupprivate.h b/gtk/gtkcsslookupprivate.h
index ca4094d940..5c8bbc96f1 100644
--- a/gtk/gtkcsslookupprivate.h
+++ b/gtk/gtkcsslookupprivate.h
@@ -19,9 +19,11 @@
#define __GTK_CSS_LOOKUP_PRIVATE_H__
#include <glib-object.h>
+
#include "gtk/gtkbitmaskprivate.h"
#include "gtk/gtkcssstaticstyleprivate.h"
-#include "gtk/gtkcsssection.h"
+
+#include "gtk/css/gtkcsssection.h"
G_BEGIN_DECLS
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 59ce98701e..865a357952 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -17,12 +17,6 @@
#include "config.h"
-#include <string.h>
-#include <stdlib.h>
-
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <cairo-gobject.h>
-
#include "gtkcssproviderprivate.h"
#include "gtkbitmaskprivate.h"
@@ -30,7 +24,6 @@
#include "gtkcsscolorvalueprivate.h"
#include "gtkcsskeyframesprivate.h"
#include "gtkcssparserprivate.h"
-#include "gtkcsssection.h"
#include "gtkcssselectorprivate.h"
#include "gtkcssshorthandpropertyprivate.h"
#include "gtksettingsprivate.h"
@@ -45,6 +38,12 @@
#include "gtkintl.h"
#include "gtkversion.h"
+#include <string.h>
+#include <stdlib.h>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <cairo-gobject.h>
+
/**
* SECTION:gtkcssprovider
* @Short_description: CSS-like styling for widgets
diff --git a/gtk/gtkcssprovider.h b/gtk/gtkcssprovider.h
index 4f6bac5cf1..9f05714173 100644
--- a/gtk/gtkcssprovider.h
+++ b/gtk/gtkcssprovider.h
@@ -19,7 +19,7 @@
#define __GTK_CSS_PROVIDER_H__
#include <gio/gio.h>
-#include <gtk/gtkcsssection.h>
+#include <gtk/css/gtkcss.h>
G_BEGIN_DECLS
diff --git a/gtk/gtkcssstyle.c b/gtk/gtkcssstyle.c
index 89f4a102a1..02fc1abc95 100644
--- a/gtk/gtkcssstyle.c
+++ b/gtk/gtkcssstyle.c
@@ -29,7 +29,6 @@
#include "gtkcssinitialvalueprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcssrgbavalueprivate.h"
-#include "gtkcsssection.h"
#include "gtkcssshorthandpropertyprivate.h"
#include "gtkcssstringvalueprivate.h"
#include "gtkcssfontfeaturesvalueprivate.h"
diff --git a/gtk/gtkcssstyleprivate.h b/gtk/gtkcssstyleprivate.h
index a17dc4203f..ae0947f169 100644
--- a/gtk/gtkcssstyleprivate.h
+++ b/gtk/gtkcssstyleprivate.h
@@ -21,9 +21,9 @@
#define __GTK_CSS_STYLE_PRIVATE_H__
#include <glib-object.h>
+#include <gtk/css/gtkcss.h>
#include "gtk/gtkbitmaskprivate.h"
-#include "gtk/gtkcsssection.h"
#include "gtk/gtkcssvalueprivate.h"
G_BEGIN_DECLS
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index f489db9152..81b153f2b2 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -22,8 +22,9 @@
#error "Only <gtk/gtk.h> can be included directly."
#endif
+#include <gtk/css/gtkcss.h>
+
#include <gtk/gtkborder.h>
-#include <gtk/gtkcsssection.h>
#include <gtk/gtkstyleprovider.h>
#include <gtk/gtktypes.h>
diff --git a/gtk/inspector/css-node-tree.c b/gtk/inspector/css-node-tree.c
index a6d6a202bc..d1983a2825 100644
--- a/gtk/inspector/css-node-tree.c
+++ b/gtk/inspector/css-node-tree.c
@@ -21,7 +21,6 @@
*/
#include "config.h"
-#include <glib/gi18n-lib.h>
#include "css-node-tree.h"
#include "prop-editor.h"
@@ -33,7 +32,6 @@
#include "gtk/gtkwidgetprivate.h"
#include "gtkcssproviderprivate.h"
#include "gtkcssstylepropertyprivate.h"
-#include "gtkcsssection.h"
#include "gtkcssstyleprivate.h"
#include "gtkcssvalueprivate.h"
#include "gtkcssselectorprivate.h"
@@ -45,6 +43,9 @@
#include "gtkmodelbutton.h"
#include "gtkstack.h"
+#include <glib/gi18n-lib.h>
+#include <gtk/css/gtkcss.h>
+
enum {
COLUMN_NODE_NAME,
COLUMN_NODE_VISIBLE,
diff --git a/gtk/meson.build b/gtk/meson.build
index 7ee01c2ff0..76fef838f5 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -201,7 +201,6 @@ gtk_public_sources = files([
'gtkcomposetable.c',
'gtkcontainer.c',
'gtkcssprovider.c',
- 'gtkcsssection.c',
'gtkdialog.c',
'gtkdnd.c',
'gtkdragdest.c',
@@ -459,7 +458,6 @@ gtk_public_headers = files([
'gtkcomboboxtext.h',
'gtkcontainer.h',
'gtkcssprovider.h',
- 'gtkcsssection.h',
'gtkcustomlayout.h',
'gtkdebug.h',
'gtkdialog.h',