Adjust to GtkAboutDialog API changes.

Thu Aug 12 21:02:57 2004  Matthias Clasen  <maclas@gmx.de>

	* demos/gtk-demo/appwindow.c (about_cb): Adjust to GtkAboutDialog API changes.

	* gtk/gtkaboutdialog.h:
	* gtk/gtkaboutdialog.c (gtk_about_dialog_set_email_hook):
	(gtk_about_dialog_set_url_hook): Add callback data and destroy notify
	for language bindings.  (#149999, Olivier Andrieu)
This commit is contained in:
Matthias Clasen 2004-08-13 01:10:38 +00:00 committed by Matthias Clasen
parent e4ec4f3710
commit ff8c35e557
7 changed files with 74 additions and 18 deletions

View File

@ -1,3 +1,12 @@
Thu Aug 12 21:02:57 2004 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/appwindow.c (about_cb): Adjust to GtkAboutDialog API changes.
* gtk/gtkaboutdialog.h:
* gtk/gtkaboutdialog.c (gtk_about_dialog_set_email_hook):
(gtk_about_dialog_set_url_hook): Add callback data and destroy notify
for language bindings. (#149999, Olivier Andrieu)
2004-08-12 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilesystem.c: Underscore-prefix gtk_file_system_module_get_type().

View File

@ -1,3 +1,12 @@
Thu Aug 12 21:02:57 2004 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/appwindow.c (about_cb): Adjust to GtkAboutDialog API changes.
* gtk/gtkaboutdialog.h:
* gtk/gtkaboutdialog.c (gtk_about_dialog_set_email_hook):
(gtk_about_dialog_set_url_hook): Add callback data and destroy notify
for language bindings. (#149999, Olivier Andrieu)
2004-08-12 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilesystem.c: Underscore-prefix gtk_file_system_module_get_type().

View File

@ -1,3 +1,12 @@
Thu Aug 12 21:02:57 2004 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/appwindow.c (about_cb): Adjust to GtkAboutDialog API changes.
* gtk/gtkaboutdialog.h:
* gtk/gtkaboutdialog.c (gtk_about_dialog_set_email_hook):
(gtk_about_dialog_set_url_hook): Add callback data and destroy notify
for language bindings. (#149999, Olivier Andrieu)
2004-08-12 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilesystem.c: Underscore-prefix gtk_file_system_module_get_type().

View File

@ -1,3 +1,12 @@
Thu Aug 12 21:02:57 2004 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/appwindow.c (about_cb): Adjust to GtkAboutDialog API changes.
* gtk/gtkaboutdialog.h:
* gtk/gtkaboutdialog.c (gtk_about_dialog_set_email_hook):
(gtk_about_dialog_set_url_hook): Add callback data and destroy notify
for language bindings. (#149999, Olivier Andrieu)
2004-08-12 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilesystem.c: Underscore-prefix gtk_file_system_module_get_type().

View File

@ -126,8 +126,8 @@ about_cb (GtkAction *action,
g_object_unref (pixbuf);
}
gtk_about_dialog_set_email_hook (activate_email);
gtk_about_dialog_set_url_hook (activate_url);
gtk_about_dialog_set_email_hook (activate_email, NULL, NULL);
gtk_about_dialog_set_url_hook (activate_url, NULL, NULL);
gtk_show_about_dialog (GTK_WINDOW (window),
"name", "GTK+ Code Demos",
"version", "2.4.3",

View File

@ -155,7 +155,12 @@ static void display_license_dialog (GtkWidget
static GtkAboutDialogActivateLinkFunc activate_email_hook = NULL;
static gpointer activate_email_hook_data = NULL;
static GDestroyNotify activate_email_hook_destroy = NULL;
static GtkAboutDialogActivateLinkFunc activate_url_hook = NULL;
static gpointer activate_url_hook_data = NULL;
static GDestroyNotify activate_url_hook_destroy = NULL;
G_DEFINE_TYPE (GtkAboutDialog, gtk_about_dialog, GTK_TYPE_DIALOG);
@ -1284,7 +1289,7 @@ activate_url (GtkWidget *widget,
gchar *url = g_object_get_data (G_OBJECT (widget), "url");
if (activate_url_hook != NULL)
(* activate_url_hook) (about, url);
(* activate_url_hook) (about, url, activate_url_hook_data);
}
static void
@ -1349,13 +1354,13 @@ follow_if_link (GtkAboutDialog *about,
if (email != NULL && activate_email_hook != NULL)
{
(* activate_email_hook) (about, email);
(* activate_email_hook) (about, email, activate_email_hook_data);
break;
}
if (url != NULL && activate_url_hook != NULL)
{
(* activate_url_hook) (about, url);
(* activate_url_hook) (about, url, activate_url_hook_data);
break;
}
}
@ -1523,7 +1528,6 @@ add_credits_page (GtkAboutDialog *about,
gchar *q0, *q1, *q2, *r1, *r2;
GtkWidget *sw, *view;
GtkTextBuffer *buffer;
GtkStyle *style;
gboolean linkify_email, linkify_urls;
GdkColor *style_link_color;
GdkColor link_color = { 0, 0, 0, 0xffff };
@ -1789,6 +1793,8 @@ gtk_about_dialog_new (void)
/**
* gtk_about_dialog_set_email_hook:
* @func: a function to call when an email link is activated.
* @data: data to pass to @func
* @destroy: #GDestroyNotify for @data
*
* Installs a global function to be called whenever the user activates an
* email link in an about dialog.
@ -1798,13 +1804,20 @@ gtk_about_dialog_new (void)
* Since: 2.6
*/
GtkAboutDialogActivateLinkFunc
gtk_about_dialog_set_email_hook (GtkAboutDialogActivateLinkFunc func)
gtk_about_dialog_set_email_hook (GtkAboutDialogActivateLinkFunc func,
gpointer data,
GDestroyNotify destroy)
{
GtkAboutDialogActivateLinkFunc old;
if (activate_email_hook_destroy != NULL)
(* activate_email_hook_destroy) (activate_url_hook_data);
old = activate_email_hook;
activate_email_hook = func;
activate_email_hook_data = data;
activate_email_hook_destroy = destroy;
return old;
}
@ -1812,6 +1825,8 @@ gtk_about_dialog_set_email_hook (GtkAboutDialogActivateLinkFunc func)
/**
* gtk_about_dialog_set_url_hook:
* @func: a function to call when a URL link is activated.
* @data: data to pass to @func
* @destroy: #GDestroyNotify for @data
*
* Installs a global function to be called whenever the user activates a
* URL link in an about dialog.
@ -1821,13 +1836,20 @@ gtk_about_dialog_set_email_hook (GtkAboutDialogActivateLinkFunc func)
* Since: 2.6
*/
GtkAboutDialogActivateLinkFunc
gtk_about_dialog_set_url_hook (GtkAboutDialogActivateLinkFunc func)
gtk_about_dialog_set_url_hook (GtkAboutDialogActivateLinkFunc func,
gpointer data,
GDestroyNotify destroy)
{
GtkAboutDialogActivateLinkFunc old;
if (activate_url_hook_destroy != NULL)
(* activate_url_hook_destroy) (activate_email_hook_data);
old = activate_url_hook;
activate_url_hook = func;
activate_url_hook_data = data;
activate_url_hook_destroy = destroy;
return old;
}
@ -1882,10 +1904,3 @@ gtk_show_about_dialog (GtkWindow *parent,
gtk_window_present (GTK_WINDOW (dialog));
}

View File

@ -102,10 +102,15 @@ void gtk_about_dialog_set_logo (GtkAboutDialog
GdkPixbuf *logo);
typedef void (* GtkAboutDialogActivateLinkFunc) (GtkAboutDialog *about,
const gchar *link);
const gchar *link,
gpointer data);
GtkAboutDialogActivateLinkFunc gtk_about_dialog_set_email_hook (GtkAboutDialogActivateLinkFunc func);
GtkAboutDialogActivateLinkFunc gtk_about_dialog_set_url_hook (GtkAboutDialogActivateLinkFunc func);
GtkAboutDialogActivateLinkFunc gtk_about_dialog_set_email_hook (GtkAboutDialogActivateLinkFunc func,
gpointer data,
GDestroyNotify destroy);
GtkAboutDialogActivateLinkFunc gtk_about_dialog_set_url_hook (GtkAboutDialogActivateLinkFunc func,
gpointer data,
GDestroyNotify destroy);
G_END_DECLS