cssparser: Remove unused functions

This commit is contained in:
Benjamin Otte 2019-03-22 17:23:30 +01:00
parent 5638882dca
commit 73760e5835
2 changed files with 0 additions and 122 deletions

View File

@ -202,23 +202,6 @@ _gtk_css_parser_error (GtkCssParser *parser,
_gtk_css_parser_take_error (parser, error); _gtk_css_parser_take_error (parser, error);
} }
void
_gtk_css_parser_error_full (GtkCssParser *parser,
GtkCssProviderError code,
const char *format,
...)
{
GError *error;
va_list args;
va_start (args, format);
error = g_error_new_valist (GTK_CSS_PROVIDER_ERROR,
code, format, args);
va_end (args);
_gtk_css_parser_take_error (parser, error);
}
static gboolean static gboolean
gtk_css_parser_new_line (GtkCssParser *parser) gtk_css_parser_new_line (GtkCssParser *parser)
{ {
@ -758,71 +741,6 @@ gtk_css_dimension_value_parse (GtkCssParser *parser,
return gtk_css_dimension_value_new (value, unit); return gtk_css_dimension_value_new (value, unit);
} }
/* XXX: we should introduce GtkCssLenght that deals with
* different kind of units */
gboolean
_gtk_css_parser_try_length (GtkCssParser *parser,
int *value)
{
if (!_gtk_css_parser_try_int (parser, value))
return FALSE;
/* FIXME: _try_uint skips spaces while the
* spec forbids them
*/
_gtk_css_parser_try (parser, "px", TRUE);
return TRUE;
}
gboolean
_gtk_css_parser_try_enum (GtkCssParser *parser,
GType enum_type,
int *value)
{
GEnumClass *enum_class;
gboolean result;
const char *start;
char *str;
g_return_val_if_fail (GTK_IS_CSS_PARSER (parser), FALSE);
g_return_val_if_fail (value != NULL, FALSE);
result = FALSE;
enum_class = g_type_class_ref (enum_type);
start = parser->data;
str = _gtk_css_parser_try_ident (parser, TRUE);
if (str == NULL)
return FALSE;
if (enum_class->n_values)
{
GEnumValue *enum_value;
for (enum_value = enum_class->values; enum_value->value_name; enum_value++)
{
if (enum_value->value_nick &&
g_ascii_strcasecmp (str, enum_value->value_nick) == 0)
{
*value = enum_value->value;
result = TRUE;
break;
}
}
}
g_free (str);
g_type_class_unref (enum_class);
if (!result)
parser->data = start;
return result;
}
gboolean gboolean
_gtk_css_parser_try_hash_color (GtkCssParser *parser, _gtk_css_parser_try_hash_color (GtkCssParser *parser,
GdkRGBA *rgba) GdkRGBA *rgba)
@ -1017,36 +935,6 @@ gtk_css_parser_resync_internal (GtkCssParser *parser,
} while (*parser->data); } while (*parser->data);
} }
char *
_gtk_css_parser_read_value (GtkCssParser *parser)
{
const char *start;
char *result;
g_return_val_if_fail (GTK_IS_CSS_PARSER (parser), NULL);
start = parser->data;
/* This needs to be done better */
gtk_css_parser_resync_internal (parser, TRUE, FALSE, '}');
result = g_strndup (start, parser->data - start);
if (result)
{
g_strchomp (result);
if (result[0] == 0)
{
g_free (result);
result = NULL;
}
}
if (result == NULL)
_gtk_css_parser_error (parser, "Expected a property value");
return result;
}
void void
_gtk_css_parser_resync (GtkCssParser *parser, _gtk_css_parser_resync (GtkCssParser *parser,
gboolean sync_at_semicolon, gboolean sync_at_semicolon,

View File

@ -39,10 +39,6 @@ void _gtk_css_parser_take_error (GtkCssParser *parser
void _gtk_css_parser_error (GtkCssParser *parser, void _gtk_css_parser_error (GtkCssParser *parser,
const char *format, const char *format,
...) G_GNUC_PRINTF (2, 3); ...) G_GNUC_PRINTF (2, 3);
void _gtk_css_parser_error_full (GtkCssParser *parser,
GtkCssProviderError code,
const char *format,
...) G_GNUC_PRINTF (3, 4);
guint _gtk_css_parser_get_line (GtkCssParser *parser); guint _gtk_css_parser_get_line (GtkCssParser *parser);
guint _gtk_css_parser_get_position (GtkCssParser *parser); guint _gtk_css_parser_get_position (GtkCssParser *parser);
@ -80,17 +76,11 @@ gboolean _gtk_css_parser_try_uint (GtkCssParser *parser
guint *value); guint *value);
gboolean _gtk_css_parser_try_double (GtkCssParser *parser, gboolean _gtk_css_parser_try_double (GtkCssParser *parser,
gdouble *value); gdouble *value);
gboolean _gtk_css_parser_try_length (GtkCssParser *parser,
int *value);
gboolean _gtk_css_parser_try_enum (GtkCssParser *parser,
GType enum_type,
int *value);
gboolean _gtk_css_parser_try_hash_color (GtkCssParser *parser, gboolean _gtk_css_parser_try_hash_color (GtkCssParser *parser,
GdkRGBA *rgba); GdkRGBA *rgba);
gboolean _gtk_css_parser_has_number (GtkCssParser *parser); gboolean _gtk_css_parser_has_number (GtkCssParser *parser);
char * _gtk_css_parser_read_string (GtkCssParser *parser); char * _gtk_css_parser_read_string (GtkCssParser *parser);
char * _gtk_css_parser_read_value (GtkCssParser *parser);
GFile * _gtk_css_parser_read_url (GtkCssParser *parser); GFile * _gtk_css_parser_read_url (GtkCssParser *parser);
void _gtk_css_parser_skip_whitespace (GtkCssParser *parser); void _gtk_css_parser_skip_whitespace (GtkCssParser *parser);