plug-ins/imagemap/imap_misc.[ch] plug-ins/imagemap/imap_selection.[ch]

2004-12-13  Maurits Rijk  <m.rijk@chello.nl>

	* plug-ins/imagemap/imap_misc.[ch]
	* plug-ins/imagemap/imap_selection.[ch]
	* plug-ins/imagemap/imap_toolbar.[ch]
	* plug-ins/imagemap/imap_tools.[ch]: removed need for
	GTK_DISABLE_DEPRECATED. Looking at #149157 next...
This commit is contained in:
Maurits Rijk 2004-12-13 21:41:35 +00:00 committed by Maurits Rijk
parent f21cde69a0
commit eadf6f3cbb
8 changed files with 69 additions and 56 deletions

View File

@ -1,3 +1,13 @@
2004-12-13 Maurits Rijk <m.rijk@chello.nl>
* plug-ins/imagemap/imap_misc.[ch]
* plug-ins/imagemap/imap_selection.[ch]
* plug-ins/imagemap/imap_toolbar.[ch]
* plug-ins/imagemap/imap_tools.[ch]: removed need for
GTK_DISABLE_DEPRECATED. Looking at #149157 next...
2004-12-13 Bill Skaggs <weskaggs@primate.ucdavis.edu>
2004-12-13 Sven Neumann <sven@gimp.org>
* app/tools/gimpcroptool.c: don't show the Crop tool window if

View File

@ -23,27 +23,45 @@
#include "config.h"
#ifdef __GNUC__
#warning GTK_DISABLE_DEPRECATED
#endif
#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "imap_main.h"
#include "imap_misc.h"
static GtkWidget*
make_toolbar_icon (GtkWidget *toolbar, GtkToolItem *item,
const char *identifier, const char *tooltip,
void (*callback)(GtkWidget*, gpointer), gpointer udata)
{
static GtkTooltips *tips;
if (!tips)
{
tips = gtk_tooltips_new ();
}
gtk_tool_item_set_tooltip (item, tips, tooltip, identifier);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
gtk_widget_show (GTK_WIDGET (item));
return GTK_WIDGET (item);
}
void
toolbar_add_space (GtkWidget *toolbar)
{
GtkToolItem *item = gtk_separator_tool_item_new ();
gtk_separator_tool_item_set_draw (GTK_SEPARATOR_TOOL_ITEM (item), FALSE);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
gtk_widget_show (GTK_WIDGET (item));
}
GtkWidget*
make_toolbar_stock_icon(GtkWidget *toolbar, const gchar *stock_id,
const char *identifier, const char *tooltip,
void (*callback)(GtkWidget*, gpointer), gpointer udata)
{
GtkWidget *iconw;
iconw = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_SMALL_TOOLBAR);
return gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
identifier, tooltip, NULL, iconw,
GTK_SIGNAL_FUNC(callback), udata);
GtkToolItem *item = gtk_tool_button_new_from_stock (stock_id);
g_signal_connect (item, "clicked", G_CALLBACK (callback), udata);
return make_toolbar_icon (toolbar, item, identifier, tooltip,
callback, udata);
}
GtkWidget*
@ -53,12 +71,12 @@ make_toolbar_radio_icon(GtkWidget *toolbar, const gchar *stock_id,
void (*callback)(GtkWidget*, gpointer),
gpointer udata)
{
GtkWidget *iconw = gtk_image_new_from_stock(stock_id,
GTK_ICON_SIZE_SMALL_TOOLBAR);
return gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
GTK_TOOLBAR_CHILD_RADIOBUTTON, prev,
identifier, tooltip, NULL, iconw,
GTK_SIGNAL_FUNC(callback), udata);
GtkToolItem *item =
gtk_radio_tool_button_new_with_stock_from_widget
(GTK_RADIO_TOOL_BUTTON (prev), stock_id);
g_signal_connect (item, "toggled", G_CALLBACK (callback), udata);
return make_toolbar_icon (toolbar, item, identifier, tooltip,
callback, udata);
}
GtkWidget*
@ -67,12 +85,10 @@ make_toolbar_toggle_icon(GtkWidget *toolbar, const gchar *stock_id,
void (*callback)(GtkWidget*, gpointer),
gpointer udata)
{
GtkWidget *iconw = gtk_image_new_from_stock(stock_id,
GTK_ICON_SIZE_SMALL_TOOLBAR);
return gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL,
identifier, tooltip, NULL, iconw,
GTK_SIGNAL_FUNC(callback), udata);
GtkToolItem *item = gtk_toggle_tool_button_new_from_stock (stock_id);
g_signal_connect (item, "toggled", G_CALLBACK (callback), udata);
return make_toolbar_icon (toolbar, item, identifier, tooltip,
callback, udata);
}
static Alert_t*

View File

@ -3,7 +3,7 @@
*
* Generates clickable image maps.
*
* Copyright (C) 1998-2003 Maurits Rijk lpeek.mrijk@consunet.nl
* Copyright (C) 1998-2004 Maurits Rijk m.rijk@chello.nl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -24,6 +24,7 @@
#ifndef _IMAP_MISC_H
#define _IMAP_MISC_H
void toolbar_add_space (GtkWidget *toolbar);
GtkWidget *make_toolbar_stock_icon(GtkWidget *toolbar, const gchar *stock_id,
const char *identifier,
const char *tooltip,

View File

@ -25,11 +25,6 @@
#include <stdio.h>
#ifdef __GNUC__
#warning GTK_DISABLE_DEPRECATED
#endif
#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
@ -177,11 +172,11 @@ make_selection_toolbar(Selection_t *data)
"MoveDown", _("Move Down"),
selection_command,
&data->cmd_move_down);
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
toolbar_add_space(toolbar);
data->edit = make_toolbar_stock_icon(toolbar, GTK_STOCK_PROPERTIES,
"Edit", _("Edit"), selection_command,
&data->cmd_edit);
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
toolbar_add_space(toolbar);
data->remove = make_toolbar_stock_icon(toolbar, GTK_STOCK_DELETE, "Delete",
_("Delete"), selection_command,
&data->cmd_delete);

View File

@ -23,11 +23,6 @@
#include "config.h"
#ifdef __GNUC__
#warning GTK_DISABLE_DEPRECATED
#endif
#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "imap_main.h"
@ -107,12 +102,12 @@ make_toolbar(GtkWidget *main_vbox, GtkWidget *window)
_("Open"), toolbar_command, &data->cmd_open);
make_toolbar_stock_icon(toolbar, GTK_STOCK_SAVE, "Save",
_("Save"), toolbar_command, &data->cmd_save);
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
toolbar_add_space(toolbar);
make_toolbar_stock_icon(toolbar, GTK_STOCK_PREFERENCES, "Preferences",
_("Preferences"), toolbar_command,
&data->cmd_preferences);
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
toolbar_add_space(toolbar);
data->undo = make_toolbar_stock_icon(toolbar, GTK_STOCK_UNDO, "Undo",
_("Undo"), toolbar_command,
&data->cmd_undo);
@ -123,7 +118,7 @@ make_toolbar(GtkWidget *main_vbox, GtkWidget *window)
gtk_widget_set_sensitive(data->redo, FALSE);
command_list_add_update_cb(command_list_changed, data);
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
toolbar_add_space(toolbar);
data->cut = make_toolbar_stock_icon(toolbar, GTK_STOCK_CUT, "Cut",
_("Cut"), toolbar_command, &data->cmd_cut);
gtk_widget_set_sensitive(data->cut, FALSE);
@ -137,7 +132,7 @@ make_toolbar(GtkWidget *main_vbox, GtkWidget *window)
paste_buffer_add_add_cb(paste_buffer_added, (gpointer) paste);
paste_buffer_add_remove_cb(paste_buffer_removed, (gpointer) paste);
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
toolbar_add_space(toolbar);
data->zoom_in = make_toolbar_stock_icon(toolbar, GTK_STOCK_ZOOM_IN,
"ZoomIn", _("Zoom in"),
toolbar_command,
@ -147,11 +142,11 @@ make_toolbar(GtkWidget *main_vbox, GtkWidget *window)
_("Zoom out"), toolbar_command,
&data->cmd_zoom_out);
gtk_widget_set_sensitive(data->zoom_out, FALSE);
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
toolbar_add_space(toolbar);
make_toolbar_stock_icon(toolbar, IMAP_STOCK_MAP_INFO, "EditMapInfo",
_("Edit map info"), toolbar_command,
&data->cmd_edit_map_info);
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
toolbar_add_space(toolbar);
data->to_front = make_toolbar_stock_icon(toolbar, IMAP_STOCK_TO_FRONT,
"ToFront", _("Move To Front"),
toolbar_command,
@ -162,7 +157,7 @@ make_toolbar(GtkWidget *main_vbox, GtkWidget *window)
_("Send To Back"), toolbar_command,
&data->cmd_send_to_back);
gtk_widget_set_sensitive(data->to_back, FALSE);
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
toolbar_add_space(toolbar);
data->grid = make_toolbar_toggle_icon(toolbar, GIMP_STOCK_GRID, "Grid",
_("Grid"), toolbar_command,
@ -185,5 +180,6 @@ void
toolbar_set_grid(ToolBar_t *toolbar, gboolean active)
{
_command_lock = TRUE;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toolbar->grid), active);
gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (toolbar->grid),
active);
}

View File

@ -3,7 +3,7 @@
*
* Generates clickable image maps.
*
* Copyright (C) 1998-1999 Maurits Rijk lpeek.mrijk@consunet.nl
* Copyright (C) 1998-2004 Maurits Rijk m.rijk@chello.nl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -23,11 +23,6 @@
#include "config.h"
#ifdef __GNUC__
#warning GTK_DISABLE_DEPRECATED
#endif
#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "imap_circle.h"
@ -81,6 +76,7 @@ arrow_clicked(GtkWidget *widget, gpointer data)
}
}
#ifdef _NOT_READY_YET_
static void
fuzzy_select_clicked(GtkWidget *widget, gpointer data)
{
@ -88,12 +84,11 @@ fuzzy_select_clicked(GtkWidget *widget, gpointer data)
_callback_lock = FALSE;
} else {
set_fuzzy_select_func();
/*
menu_select_fuzzy_select();
popup_select_fuzzy_select();
*/
}
}
#endif
static void
rectangle_clicked(GtkWidget *widget, gpointer data)
@ -169,12 +164,12 @@ make_tools(GtkWidget *window)
_tools.circle, _("Polygon"),
_("Define Polygon area"),
polygon_clicked, NULL);
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
toolbar_add_space(toolbar);
_tools.edit = make_toolbar_stock_icon(toolbar, GTK_STOCK_PROPERTIES,
_("Edit"),
_("Edit selected area info"), tools_command,
&_tools.cmd_edit);
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
toolbar_add_space(toolbar);
_tools.delete = make_toolbar_stock_icon(toolbar, GTK_STOCK_DELETE,
_("Delete"),
_("Delete selected area"), tools_command,
@ -192,7 +187,7 @@ static void
tools_select(GtkWidget *widget)
{
_callback_lock = TRUE;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (widget), TRUE);
gtk_widget_grab_focus(widget);
}

View File

@ -3,7 +3,7 @@
*
* Generates clickable image maps.
*
* Copyright (C) 1998-2002 Maurits Rijk lpeek.mrijk@consunet.nl
* Copyright (C) 1998-2004 Maurits Rijk m.rijk@chello.nl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by