Commit 89a0a894 authored by Tim Janik's avatar Tim Janik Committed by Tim Janik
Browse files

removed gtk_signal_init() compat define.

Sun Feb  4 07:55:17 2001  Tim Janik  <timj@gtk.org>

        * gtk/gtksignal.h: removed gtk_signal_init() compat define.

        * gtk/gtktypeutils.[hc]: gtk_tpye_init() take an additional argument
        GTypeDebugFlags debug_flags and pass it on to g_type_init ();
        deprecated this function.

        * gdk/gdk.c (gdk_init_check): call g_type_init () with 0 as
        argument.

Sun Feb  4 07:45:45 2001  Tim Janik  <timj@gtk.org>

        * gtk/gtkdebug.h: nuke GTK_DEBUG_OBJECTS and GTK_DEBUG_SIGNALS.

Sun Feb  4 07:59:57 2001  Tim Janik  <timj@gtk.org>

        * gdk-pixbuf.h: DOH! don't include glib/gobject.h but glib-object.h,
        we finally need the gobject->gruntime rename.

        * *.c: scratched calls to g_type_init(), there's simply no point in
        doing that, use gtk_init().
parent f2ceb1c4
Sun Feb 4 07:55:17 2001 Tim Janik <timj@gtk.org>
* gtk/gtksignal.h: removed gtk_signal_init() compat define.
* gtk/gtktypeutils.[hc]: gtk_tpye_init() take an additional argument
GTypeDebugFlags debug_flags and pass it on to g_type_init ();
deprecated this function.
* gdk/gdk.c (gdk_init_check): call g_type_init () with 0 as
argument.
Sun Feb 4 07:45:45 2001 Tim Janik <timj@gtk.org>
* gtk/gtkdebug.h: nuke GTK_DEBUG_OBJECTS and GTK_DEBUG_SIGNALS.
2001-02-03 Havoc Pennington <hp@pobox.com> 2001-02-03 Havoc Pennington <hp@pobox.com>
* gtk/gtktextbtree.c (_gtk_text_btree_tag): Fix bug reported by * gtk/gtktextbtree.c (_gtk_text_btree_tag): Fix bug reported by
......
Sun Feb 4 07:55:17 2001 Tim Janik <timj@gtk.org>
* gtk/gtksignal.h: removed gtk_signal_init() compat define.
* gtk/gtktypeutils.[hc]: gtk_tpye_init() take an additional argument
GTypeDebugFlags debug_flags and pass it on to g_type_init ();
deprecated this function.
* gdk/gdk.c (gdk_init_check): call g_type_init () with 0 as
argument.
Sun Feb 4 07:45:45 2001 Tim Janik <timj@gtk.org>
* gtk/gtkdebug.h: nuke GTK_DEBUG_OBJECTS and GTK_DEBUG_SIGNALS.
2001-02-03 Havoc Pennington <hp@pobox.com> 2001-02-03 Havoc Pennington <hp@pobox.com>
* gtk/gtktextbtree.c (_gtk_text_btree_tag): Fix bug reported by * gtk/gtktextbtree.c (_gtk_text_btree_tag): Fix bug reported by
......
Sun Feb 4 07:55:17 2001 Tim Janik <timj@gtk.org>
* gtk/gtksignal.h: removed gtk_signal_init() compat define.
* gtk/gtktypeutils.[hc]: gtk_tpye_init() take an additional argument
GTypeDebugFlags debug_flags and pass it on to g_type_init ();
deprecated this function.
* gdk/gdk.c (gdk_init_check): call g_type_init () with 0 as
argument.
Sun Feb 4 07:45:45 2001 Tim Janik <timj@gtk.org>
* gtk/gtkdebug.h: nuke GTK_DEBUG_OBJECTS and GTK_DEBUG_SIGNALS.
2001-02-03 Havoc Pennington <hp@pobox.com> 2001-02-03 Havoc Pennington <hp@pobox.com>
* gtk/gtktextbtree.c (_gtk_text_btree_tag): Fix bug reported by * gtk/gtktextbtree.c (_gtk_text_btree_tag): Fix bug reported by
......
Sun Feb 4 07:55:17 2001 Tim Janik <timj@gtk.org>
* gtk/gtksignal.h: removed gtk_signal_init() compat define.
* gtk/gtktypeutils.[hc]: gtk_tpye_init() take an additional argument
GTypeDebugFlags debug_flags and pass it on to g_type_init ();
deprecated this function.
* gdk/gdk.c (gdk_init_check): call g_type_init () with 0 as
argument.
Sun Feb 4 07:45:45 2001 Tim Janik <timj@gtk.org>
* gtk/gtkdebug.h: nuke GTK_DEBUG_OBJECTS and GTK_DEBUG_SIGNALS.
2001-02-03 Havoc Pennington <hp@pobox.com> 2001-02-03 Havoc Pennington <hp@pobox.com>
* gtk/gtktextbtree.c (_gtk_text_btree_tag): Fix bug reported by * gtk/gtktextbtree.c (_gtk_text_btree_tag): Fix bug reported by
......
Sun Feb 4 07:55:17 2001 Tim Janik <timj@gtk.org>
* gtk/gtksignal.h: removed gtk_signal_init() compat define.
* gtk/gtktypeutils.[hc]: gtk_tpye_init() take an additional argument
GTypeDebugFlags debug_flags and pass it on to g_type_init ();
deprecated this function.
* gdk/gdk.c (gdk_init_check): call g_type_init () with 0 as
argument.
Sun Feb 4 07:45:45 2001 Tim Janik <timj@gtk.org>
* gtk/gtkdebug.h: nuke GTK_DEBUG_OBJECTS and GTK_DEBUG_SIGNALS.
2001-02-03 Havoc Pennington <hp@pobox.com> 2001-02-03 Havoc Pennington <hp@pobox.com>
* gtk/gtktextbtree.c (_gtk_text_btree_tag): Fix bug reported by * gtk/gtktextbtree.c (_gtk_text_btree_tag): Fix bug reported by
......
Sun Feb 4 07:55:17 2001 Tim Janik <timj@gtk.org>
* gtk/gtksignal.h: removed gtk_signal_init() compat define.
* gtk/gtktypeutils.[hc]: gtk_tpye_init() take an additional argument
GTypeDebugFlags debug_flags and pass it on to g_type_init ();
deprecated this function.
* gdk/gdk.c (gdk_init_check): call g_type_init () with 0 as
argument.
Sun Feb 4 07:45:45 2001 Tim Janik <timj@gtk.org>
* gtk/gtkdebug.h: nuke GTK_DEBUG_OBJECTS and GTK_DEBUG_SIGNALS.
2001-02-03 Havoc Pennington <hp@pobox.com> 2001-02-03 Havoc Pennington <hp@pobox.com>
* gtk/gtktextbtree.c (_gtk_text_btree_tag): Fix bug reported by * gtk/gtktextbtree.c (_gtk_text_btree_tag): Fix bug reported by
......
Sun Feb 4 07:55:17 2001 Tim Janik <timj@gtk.org>
* gtk/gtksignal.h: removed gtk_signal_init() compat define.
* gtk/gtktypeutils.[hc]: gtk_tpye_init() take an additional argument
GTypeDebugFlags debug_flags and pass it on to g_type_init ();
deprecated this function.
* gdk/gdk.c (gdk_init_check): call g_type_init () with 0 as
argument.
Sun Feb 4 07:45:45 2001 Tim Janik <timj@gtk.org>
* gtk/gtkdebug.h: nuke GTK_DEBUG_OBJECTS and GTK_DEBUG_SIGNALS.
2001-02-03 Havoc Pennington <hp@pobox.com> 2001-02-03 Havoc Pennington <hp@pobox.com>
* gtk/gtktextbtree.c (_gtk_text_btree_tag): Fix bug reported by * gtk/gtktextbtree.c (_gtk_text_btree_tag): Fix bug reported by
......
Sun Feb 4 07:59:57 2001 Tim Janik <timj@gtk.org>
* gdk-pixbuf.h: DOH! don't include glib/gobject.h but glib-object.h,
we finally need the gobject->gruntime rename.
* *.c: scratched calls to g_type_init(), there's simply no point in
doing that, use gtk_init().
2001-02-01 Havoc Pennington <hp@pobox.com> 2001-02-01 Havoc Pennington <hp@pobox.com>
* gdk-pixbuf-loader.c, gdk-pixbuf-loader.h: rename "private" field * gdk-pixbuf-loader.c, gdk-pixbuf-loader.h: rename "private" field
......
...@@ -50,8 +50,6 @@ gdk_pixbuf_animation_get_type (void) ...@@ -50,8 +50,6 @@ gdk_pixbuf_animation_get_type (void)
0, /* n_preallocs */ 0, /* n_preallocs */
(GInstanceInitFunc) NULL, (GInstanceInitFunc) NULL,
}; };
g_type_init ();
object_type = g_type_register_static (G_TYPE_OBJECT, object_type = g_type_register_static (G_TYPE_OBJECT,
"GdkPixbufAnimation", "GdkPixbufAnimation",
...@@ -458,13 +456,9 @@ gdk_pixbuf_frame_get_type (void) ...@@ -458,13 +456,9 @@ gdk_pixbuf_frame_get_type (void)
static GType our_type = 0; static GType our_type = 0;
if (our_type == 0) if (our_type == 0)
{ our_type = g_boxed_type_register_static ("GdkPixbufFrame",
g_type_init (); gdk_pixbuf_frame_copy,
gdk_pixbuf_frame_free);
our_type = g_boxed_type_register_static ("GdkPixbufFrame",
gdk_pixbuf_frame_copy,
gdk_pixbuf_frame_free);
}
return our_type; return our_type;
} }
...@@ -93,8 +93,6 @@ gdk_pixbuf_loader_get_type (void) ...@@ -93,8 +93,6 @@ gdk_pixbuf_loader_get_type (void)
0, /* n_preallocs */ 0, /* n_preallocs */
(GInstanceInitFunc) gdk_pixbuf_loader_init (GInstanceInitFunc) gdk_pixbuf_loader_init
}; };
g_type_init ();
loader_type = g_type_register_static (G_TYPE_OBJECT, loader_type = g_type_register_static (G_TYPE_OBJECT,
"GdkPixbufLoader", "GdkPixbufLoader",
......
...@@ -53,8 +53,6 @@ gdk_pixbuf_get_type (void) ...@@ -53,8 +53,6 @@ gdk_pixbuf_get_type (void)
0, /* n_preallocs */ 0, /* n_preallocs */
(GInstanceInitFunc) NULL, (GInstanceInitFunc) NULL,
}; };
g_type_init ();
object_type = g_type_register_static (G_TYPE_OBJECT, object_type = g_type_register_static (G_TYPE_OBJECT,
"GdkPixbuf", "GdkPixbuf",
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <glib.h> #include <glib.h>
#include <gdk-pixbuf/gdk-pixbuf-features.h> #include <gdk-pixbuf/gdk-pixbuf-features.h>
#include <gobject/gobject.h> #include <glib-object.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
......
...@@ -323,7 +323,7 @@ gdk_init_check (int *argc, ...@@ -323,7 +323,7 @@ gdk_init_check (int *argc,
GDK_NOTE (MISC, g_message ("progname: \"%s\"", g_get_prgname ())); GDK_NOTE (MISC, g_message ("progname: \"%s\"", g_get_prgname ()));
g_type_init (); g_type_init (0);
result = _gdk_windowing_init_check (argc_orig, argv_orig); result = _gdk_windowing_init_check (argc_orig, argv_orig);
......
...@@ -140,6 +140,7 @@ gtk_public_h_sources = @STRIP_BEGIN@ \ ...@@ -140,6 +140,7 @@ gtk_public_h_sources = @STRIP_BEGIN@ \
gtkradiomenuitem.h \ gtkradiomenuitem.h \
gtkrange.h \ gtkrange.h \
gtkrc.h \ gtkrc.h \
gtkrcdata.h \
gtkruler.h \ gtkruler.h \
gtkscale.h \ gtkscale.h \
gtkscrollbar.h \ gtkscrollbar.h \
...@@ -298,6 +299,7 @@ gtk_c_sources = @STRIP_BEGIN@ \ ...@@ -298,6 +299,7 @@ gtk_c_sources = @STRIP_BEGIN@ \
gtkrange.c \ gtkrange.c \
gtkrbtree.c \ gtkrbtree.c \
gtkrc.c \ gtkrc.c \
gtkrcdata.c \
gtkruler.c \ gtkruler.c \
gtkscale.c \ gtkscale.c \
gtkscrollbar.c \ gtkscrollbar.c \
......
...@@ -116,6 +116,7 @@ ...@@ -116,6 +116,7 @@
#include <gtk/gtkradiomenuitem.h> #include <gtk/gtkradiomenuitem.h>
#include <gtk/gtkrange.h> #include <gtk/gtkrange.h>
#include <gtk/gtkrc.h> #include <gtk/gtkrc.h>
#include <gtk/gtkrcdata.h>
#include <gtk/gtkruler.h> #include <gtk/gtkruler.h>
#include <gtk/gtkscale.h> #include <gtk/gtkscale.h>
#include <gtk/gtkscrollbar.h> #include <gtk/gtkscrollbar.h>
......
...@@ -32,14 +32,12 @@ extern "C" { ...@@ -32,14 +32,12 @@ extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
typedef enum { typedef enum {
GTK_DEBUG_OBJECTS = 1 << 0, GTK_DEBUG_MISC = 1 << 0,
GTK_DEBUG_MISC = 1 << 1, GTK_DEBUG_DND = 1 << 1,
GTK_DEBUG_SIGNALS = 1 << 2, GTK_DEBUG_PLUGSOCKET = 1 << 2,
GTK_DEBUG_DND = 1 << 3, GTK_DEBUG_TEXT = 1 << 3,
GTK_DEBUG_PLUGSOCKET = 1 << 4, GTK_DEBUG_TREE = 1 << 4,
GTK_DEBUG_TEXT = 1 << 5, GTK_DEBUG_UPDATES = 1 << 5
GTK_DEBUG_TREE = 1 << 6,
GTK_DEBUG_UPDATES = 1 << 7
} GtkDebugFlag; } GtkDebugFlag;
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
#include "gtkthemes.h" #include "gtkthemes.h"
#include "gtkintl.h" #include "gtkintl.h"
#include "gtkiconfactory.h" #include "gtkiconfactory.h"
#include "gtkrcdata.h"
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
#include <io.h> #include <io.h>
...@@ -101,6 +102,8 @@ static void gtk_rc_parse_any (const gchar *input_nam ...@@ -101,6 +102,8 @@ static void gtk_rc_parse_any (const gchar *input_nam
const gchar *input_string); const gchar *input_string);
static guint gtk_rc_parse_statement (GScanner *scanner); static guint gtk_rc_parse_statement (GScanner *scanner);
static guint gtk_rc_parse_style (GScanner *scanner); static guint gtk_rc_parse_style (GScanner *scanner);
static guint gtk_rc_parse_assignment (GScanner *scanner,
const gchar *var_name);
static guint gtk_rc_parse_bg (GScanner *scanner, static guint gtk_rc_parse_bg (GScanner *scanner,
GtkRcStyle *style); GtkRcStyle *style);
static guint gtk_rc_parse_fg (GScanner *scanner, static guint gtk_rc_parse_fg (GScanner *scanner,
...@@ -566,9 +569,9 @@ gtk_rc_init (void) ...@@ -566,9 +569,9 @@ gtk_rc_init (void)
gint i, j; gint i, j;
static gboolean initted = FALSE; static gboolean initialized = FALSE;
if (!initted) if (!initialized)
{ {
gint length; gint length;
gchar *locale; gchar *locale;
...@@ -579,8 +582,7 @@ gtk_rc_init (void) ...@@ -579,8 +582,7 @@ gtk_rc_init (void)
#else #else
locale = setlocale (LC_CTYPE, NULL); locale = setlocale (LC_CTYPE, NULL);
#endif #endif
initialized = TRUE;
initted = TRUE;
pixmap_path[0] = NULL; pixmap_path[0] = NULL;
module_path[0] = NULL; module_path[0] = NULL;
...@@ -628,8 +630,14 @@ gtk_rc_init (void) ...@@ -628,8 +630,14 @@ gtk_rc_init (void)
g_free (normalized_locale); g_free (normalized_locale);
} }
/* setup global rc-file variables */
gtk_rc_data_install_property (g_param_spec_int ("mouse-timeout", NULL, NULL,
0, 1000, 0,
G_PARAM_READABLE | G_PARAM_WRITABLE));
} }
g_object_freeze_notify (G_OBJECT (gtk_rc_data_get_global ()));
i = 0; i = 0;
while (gtk_rc_default_files[i] != NULL) while (gtk_rc_default_files[i] != NULL)
{ {
...@@ -649,6 +657,11 @@ gtk_rc_init (void) ...@@ -649,6 +657,11 @@ gtk_rc_init (void)
gtk_rc_parse (gtk_rc_default_files[i]); gtk_rc_parse (gtk_rc_default_files[i]);
i++; i++;
} }
/* setup global rc-file variables after the fact */
gtk_rc_data_install_property (g_param_spec_float ("foo-number", NULL, NULL,
-10000, 10000, 0,
G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_thaw_notify (G_OBJECT (gtk_rc_data_get_global ()));
} }
void void
...@@ -1535,54 +1548,119 @@ gtk_rc_parse_statement (GScanner *scanner) ...@@ -1535,54 +1548,119 @@ gtk_rc_parse_statement (GScanner *scanner)
guint token; guint token;
token = g_scanner_peek_next_token (scanner); token = g_scanner_peek_next_token (scanner);
switch (token) switch (token)
{ {
gboolean is_varname;
gchar *p;
case GTK_RC_TOKEN_INCLUDE: case GTK_RC_TOKEN_INCLUDE:
token = g_scanner_get_next_token (scanner); token = g_scanner_get_next_token (scanner);
if (token != GTK_RC_TOKEN_INCLUDE) if (token != GTK_RC_TOKEN_INCLUDE)
return GTK_RC_TOKEN_INCLUDE; return GTK_RC_TOKEN_INCLUDE;
token = g_scanner_get_next_token (scanner); token = g_scanner_get_next_token (scanner);
if (token != G_TOKEN_STRING) if (token != G_TOKEN_STRING)
return G_TOKEN_STRING; return G_TOKEN_STRING;
gtk_rc_parse_file (scanner->value.v_string, FALSE); gtk_rc_parse_file (scanner->value.v_string, FALSE);
return G_TOKEN_NONE; return G_TOKEN_NONE;
case GTK_RC_TOKEN_STYLE: case GTK_RC_TOKEN_STYLE:
return gtk_rc_parse_style (scanner); return gtk_rc_parse_style (scanner);
case GTK_RC_TOKEN_BINDING: case GTK_RC_TOKEN_BINDING:
return gtk_binding_parse_binding (scanner); return gtk_binding_parse_binding (scanner);
case GTK_RC_TOKEN_PIXMAP_PATH: case GTK_RC_TOKEN_PIXMAP_PATH:
return gtk_rc_parse_pixmap_path (scanner); return gtk_rc_parse_pixmap_path (scanner);
case GTK_RC_TOKEN_WIDGET: case GTK_RC_TOKEN_WIDGET:
return gtk_rc_parse_path_pattern (scanner); return gtk_rc_parse_path_pattern (scanner);
case GTK_RC_TOKEN_WIDGET_CLASS: case GTK_RC_TOKEN_WIDGET_CLASS:
return gtk_rc_parse_path_pattern (scanner); return gtk_rc_parse_path_pattern (scanner);
case GTK_RC_TOKEN_CLASS: case GTK_RC_TOKEN_CLASS:
return gtk_rc_parse_path_pattern (scanner); return gtk_rc_parse_path_pattern (scanner);
case GTK_RC_TOKEN_MODULE_PATH: case GTK_RC_TOKEN_MODULE_PATH:
return gtk_rc_parse_module_path (scanner); return gtk_rc_parse_module_path (scanner);
case GTK_RC_TOKEN_IM_MODULE_PATH: case GTK_RC_TOKEN_IM_MODULE_PATH:
return gtk_rc_parse_im_module_path (scanner); return gtk_rc_parse_im_module_path (scanner);
case GTK_RC_TOKEN_IM_MODULE_FILE: case GTK_RC_TOKEN_IM_MODULE_FILE:
return gtk_rc_parse_im_module_file (scanner); return gtk_rc_parse_im_module_file (scanner);
case G_TOKEN_IDENTIFIER:
is_varname = strchr (G_CSET_a_2_z "_", scanner->next_value.v_identifier[0]) != NULL;
for (p = scanner->next_value.v_identifier + 1; *p && is_varname; p++)
is_varname &= strchr (G_CSET_a_2_z G_CSET_DIGITS "_-", *p) != NULL;
if (is_varname)
{
gchar *name;
g_scanner_get_next_token (scanner); /* eat identifier */
name = g_strdup (scanner->value.v_identifier);
token = gtk_rc_parse_assignment (scanner, name);
g_free (name);
return token;
}
/* fall through */
default: default:
g_scanner_get_next_token (scanner); g_scanner_get_next_token (scanner);
return /* G_TOKEN_SYMBOL */ GTK_RC_TOKEN_STYLE; return /* G_TOKEN_SYMBOL */ GTK_RC_TOKEN_STYLE;
} }
} }
static guint
gtk_rc_parse_assignment (GScanner *scanner,
const gchar *var_name)
{
guint token;
gboolean negate = FALSE;
gchar *location;
if (g_scanner_get_next_token (scanner) != '=')
return '=';
token = g_scanner_get_next_token (scanner);
if (token == '-')
{
negate = TRUE;
token = g_scanner_get_next_token (scanner);
if (token != G_TOKEN_FLOAT &&
token != G_TOKEN_INT)
return G_TOKEN_INT;
}
location = g_strdup_printf ("%s:%u", scanner->input_name, scanner->line);
switch (token)
{
case G_TOKEN_INT:
gtk_rc_data_set_long_property (var_name,
negate ? -scanner->value.v_int : scanner->value.v_int,
location);
break;
case G_TOKEN_FLOAT:
gtk_rc_data_set_double_property (var_name,
negate ? -scanner->value.v_float : scanner->value.v_float,
location);
break;
case G_TOKEN_STRING:
gtk_rc_data_set_string_property (var_name,
scanner->value.v_string,
location);
break;
default:
return G_TOKEN_INT;
}
g_free (location);
return G_TOKEN_NONE;
}
static guint static guint
gtk_rc_parse_style (GScanner *scanner) gtk_rc_parse_style (GScanner *scanner)
{ {
......
...@@ -91,22 +91,24 @@ struct _GtkRcStyleClass ...@@ -91,22 +91,24 @@ struct _GtkRcStyleClass
* g_object_new (G_OBJECT_TYPE (style), NULL); * g_object_new (G_OBJECT_TYPE (style), NULL);
* should work in most cases. * should work in most cases.
*/ */
GtkRcStyle *(*clone) (GtkRcStyle *rc_style); GtkRcStyle * (*clone) (GtkRcStyle *rc_style);
/* Fill in engine specific parts of GtkRcStyle by parsing contents /* Fill in engine specific parts of GtkRcStyle by parsing contents
* of brackets. Returns G_TOKEN_NONE if succesful, otherwise returns * of brackets. Returns G_TOKEN_NONE if succesful, otherwise returns
* the token it expected but didn't get. * the token it expected but didn't get.
*/ */
guint (*parse) (GtkRcStyle *rc_style, GScanner *scanner); guint (*parse) (GtkRcStyle *rc_style,
GScanner *scanner);
/* Combine RC style data from src into dest. If overriden, this /* Combine RC style data from src into dest. If overriden, this
* function should chain to the parent. * function should chain to the parent.
*/ */
void (*merge) (GtkRcStyle *dest, GtkRcStyle *src); void (*merge) (GtkRcStyle *dest,
GtkRcStyle *src);
/* Create an empty style suitable to this RC style /* Create an empty style suitable to this RC style
*/ */
GtkStyle *(*create_style) (GtkRcStyle *rc_style); GtkStyle * (*create_style) (GtkRcStyle *rc_style);
}; };
void gtk_rc_init (void); void gtk_rc_init (void);
......
/* GTK - The GIMP Toolkit
* Copyright (C) 2000 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public