Commit 8d371c19 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

added a private tooltip to the ops_buttons structure. Removed

1999-10-30  Michael Natterer  <mitch@gimp.org>

	* app/ops_buttons.[ch]: added a private tooltip to the
	ops_buttons structure. Removed ops_buttons_set_insensitive().

	* app/channels_dialog.c
	* app/layers_dialog.c
	* app/paths_dialog.c
	* app/lc_dialog.c: let the ops button's private tips point at the
	already existing help pages. Minor fixes.
parent b3144e7c
1999-10-30 Michael Natterer <mitch@gimp.org>
* app/ops_buttons.[ch]: added a private tooltip to the
ops_buttons structure. Removed ops_buttons_set_insensitive().
* app/channels_dialog.c
* app/layers_dialog.c
* app/paths_dialog.c
* app/lc_dialog.c: let the ops button's private tips point at the
already existing help pages. Minor fixes.
1999-10-30 Michael Natterer <mitch@gimp.org>
* app_procs.c
......
......@@ -185,22 +185,34 @@ static OpsButtonCallback to_selection_ext_callbacks[] =
static OpsButton channels_ops_buttons[] =
{
{ new_xpm, channels_dialog_new_channel_callback, NULL,
N_("New Channel"), NULL, 0 },
N_("New Channel"),
"channels/dialogs/new_channel.html",
NULL, 0 },
{ raise_xpm, channels_dialog_raise_channel_callback, NULL,
N_("Raise Channel"), NULL, 0 },
N_("Raise Channel"),
"channels/raise_channel.html",
NULL, 0 },
{ lower_xpm, channels_dialog_lower_channel_callback, NULL,
N_("Lower Channel"), NULL, 0 },
N_("Lower Channel"),
"channels/lower_channel.html",
NULL, 0 },
{ duplicate_xpm, channels_dialog_duplicate_channel_callback, NULL,
N_("Duplicate Channel"), NULL, 0 },
N_("Duplicate Channel"),
"channels/duplicate_channel.html",
NULL, 0 },
{ toselection_xpm, channels_dialog_channel_to_sel_callback,
to_selection_ext_callbacks,
N_("Channel to Selection \n"
"<Shift> Add "
"<Ctrl> Subtract "
"<Shift><Ctrl> Intersect"), NULL, 0 },
"<Shift><Ctrl> Intersect"),
"channels/channel_to_selection.html",
NULL, 0 },
{ delete_xpm, channels_dialog_delete_channel_callback, NULL,
N_("Delete Channel"), NULL, 0 },
{ NULL, NULL, NULL, NULL, NULL, 0 }
N_("Delete Channel"),
"channels/delete_channel.html",
NULL, 0 },
{ NULL, NULL, NULL, NULL, NULL, NULL, 0 }
};
/* dnd structures */
......@@ -233,7 +245,7 @@ static guint n_component_targets = (sizeof (component_target_table) /
/**************************************/
GtkWidget *
channels_dialog_create ()
channels_dialog_create (void)
{
GtkWidget *vbox;
GtkWidget *button_box;
......@@ -341,7 +353,7 @@ channels_dialog_create ()
}
void
channels_dialog_free ()
channels_dialog_free (void)
{
ChannelWidget *cw;
GSList *list;
......@@ -463,7 +475,7 @@ channels_dialog_update (GimpImage* gimage)
}
void
channels_dialog_flush ()
channels_dialog_flush (void)
{
ChannelWidget *cw;
GImage *gimage;
......@@ -544,13 +556,11 @@ channels_dialog_flush ()
}
void
channels_dialog_clear ()
channels_dialog_clear (void)
{
if (!channelsD)
return;
ops_button_box_set_insensitive (channels_ops_buttons);
suspend_gimage_notify++;
gtk_list_clear_items (GTK_LIST (channelsD->channel_list), 0, -1);
suspend_gimage_notify--;
......@@ -559,7 +569,7 @@ channels_dialog_clear ()
}
static void
channels_dialog_preview_extents ()
channels_dialog_preview_extents (void)
{
GImage *gimage;
......@@ -591,7 +601,7 @@ channels_dialog_preview_extents ()
}
static void
channels_dialog_set_menu_sensitivity ()
channels_dialog_set_menu_sensitivity (void)
{
ChannelWidget *cw;
gint fs_sens;
......
......@@ -185,22 +185,34 @@ static OpsButtonCallback to_selection_ext_callbacks[] =
static OpsButton channels_ops_buttons[] =
{
{ new_xpm, channels_dialog_new_channel_callback, NULL,
N_("New Channel"), NULL, 0 },
N_("New Channel"),
"channels/dialogs/new_channel.html",
NULL, 0 },
{ raise_xpm, channels_dialog_raise_channel_callback, NULL,
N_("Raise Channel"), NULL, 0 },
N_("Raise Channel"),
"channels/raise_channel.html",
NULL, 0 },
{ lower_xpm, channels_dialog_lower_channel_callback, NULL,
N_("Lower Channel"), NULL, 0 },
N_("Lower Channel"),
"channels/lower_channel.html",
NULL, 0 },
{ duplicate_xpm, channels_dialog_duplicate_channel_callback, NULL,
N_("Duplicate Channel"), NULL, 0 },
N_("Duplicate Channel"),
"channels/duplicate_channel.html",
NULL, 0 },
{ toselection_xpm, channels_dialog_channel_to_sel_callback,
to_selection_ext_callbacks,
N_("Channel to Selection \n"
"<Shift> Add "
"<Ctrl> Subtract "
"<Shift><Ctrl> Intersect"), NULL, 0 },
"<Shift><Ctrl> Intersect"),
"channels/channel_to_selection.html",
NULL, 0 },
{ delete_xpm, channels_dialog_delete_channel_callback, NULL,
N_("Delete Channel"), NULL, 0 },
{ NULL, NULL, NULL, NULL, NULL, 0 }
N_("Delete Channel"),
"channels/delete_channel.html",
NULL, 0 },
{ NULL, NULL, NULL, NULL, NULL, NULL, 0 }
};
/* dnd structures */
......@@ -233,7 +245,7 @@ static guint n_component_targets = (sizeof (component_target_table) /
/**************************************/
GtkWidget *
channels_dialog_create ()
channels_dialog_create (void)
{
GtkWidget *vbox;
GtkWidget *button_box;
......@@ -341,7 +353,7 @@ channels_dialog_create ()
}
void
channels_dialog_free ()
channels_dialog_free (void)
{
ChannelWidget *cw;
GSList *list;
......@@ -463,7 +475,7 @@ channels_dialog_update (GimpImage* gimage)
}
void
channels_dialog_flush ()
channels_dialog_flush (void)
{
ChannelWidget *cw;
GImage *gimage;
......@@ -544,13 +556,11 @@ channels_dialog_flush ()
}
void
channels_dialog_clear ()
channels_dialog_clear (void)
{
if (!channelsD)
return;
ops_button_box_set_insensitive (channels_ops_buttons);
suspend_gimage_notify++;
gtk_list_clear_items (GTK_LIST (channelsD->channel_list), 0, -1);
suspend_gimage_notify--;
......@@ -559,7 +569,7 @@ channels_dialog_clear ()
}
static void
channels_dialog_preview_extents ()
channels_dialog_preview_extents (void)
{
GImage *gimage;
......@@ -591,7 +601,7 @@ channels_dialog_preview_extents ()
}
static void
channels_dialog_set_menu_sensitivity ()
channels_dialog_set_menu_sensitivity (void)
{
ChannelWidget *cw;
gint fs_sens;
......
......@@ -260,20 +260,32 @@ static OpsButtonCallback lower_layers_ext_callbacks[] =
static OpsButton layers_ops_buttons[] =
{
{ new_xpm, layers_dialog_new_layer_callback, NULL,
N_("New Layer"), NULL, 0 },
N_("New Layer"),
"layers/dialogs/new_layer.html",
NULL, 0 },
{ raise_xpm, layers_dialog_raise_layer_callback, raise_layers_ext_callbacks,
N_("Raise Layer \n"
"<Shift> To Top"), NULL, 0 },
"<Shift> To Top"),
"layers/stack/stack.html#raise_layer",
NULL, 0 },
{ lower_xpm, layers_dialog_lower_layer_callback, lower_layers_ext_callbacks,
N_("Lower Layer \n"
"<Shift> To Bottom"), NULL, 0 },
"<Shift> To Bottom"),
"layers/stack/stack.html#lower_layer",
NULL, 0 },
{ duplicate_xpm, layers_dialog_duplicate_layer_callback, NULL,
N_("Duplicate Layer"), NULL, 0 },
N_("Duplicate Layer"),
"layers/duplicate_layer.html",
NULL, 0 },
{ anchor_xpm, layers_dialog_anchor_layer_callback, NULL,
N_("Anchor Layer"), NULL, 0 },
N_("Anchor Layer"),
"layers/anchor_layer.html",
NULL, 0 },
{ delete_xpm, layers_dialog_delete_layer_callback, NULL,
N_("Delete Layer"), NULL, 0 },
{ NULL, NULL, NULL, NULL, NULL, 0 }
N_("Delete Layer"),
"layers/delete_layer.html",
NULL, 0 },
{ NULL, NULL, NULL, NULL, NULL, NULL, 0 }
};
/* dnd structures */
......@@ -305,7 +317,7 @@ static guint n_trashcan_targets = (sizeof (trashcan_target_table) /
/************************************/
GtkWidget *
layers_dialog_create ()
layers_dialog_create (void)
{
GtkWidget *vbox;
GtkWidget *util_box;
......@@ -458,7 +470,7 @@ layers_dialog_create ()
}
void
layers_dialog_free ()
layers_dialog_free (void)
{
LayerWidget *lw;
GSList *list;
......@@ -565,7 +577,7 @@ layers_dialog_update (GimpImage* gimage)
}
void
layers_dialog_flush ()
layers_dialog_flush (void)
{
GImage *gimage;
Layer *layer;
......@@ -646,15 +658,13 @@ layers_dialog_flush ()
}
void
layers_dialog_clear ()
layers_dialog_clear (void)
{
ops_button_box_set_insensitive (layers_ops_buttons);
if (! layersD)
return;
/* Make sure the gimage is not notified of this change */
suspend_gimage_notify++;
gtk_list_clear_items (GTK_LIST (layersD->layer_list), 0, -1);
suspend_gimage_notify--;
layersD->gimage = NULL;
......@@ -900,7 +910,7 @@ render_fs_preview (GtkWidget *widget,
/*************************************/
static void
layers_dialog_preview_extents ()
layers_dialog_preview_extents (void)
{
GImage *gimage;
......@@ -933,7 +943,7 @@ layers_dialog_preview_extents ()
}
static void
layers_dialog_set_menu_sensitivity ()
layers_dialog_set_menu_sensitivity (void)
{
gint fs; /* floating sel */
gint ac; /* active channel */
......@@ -952,7 +962,7 @@ layers_dialog_set_menu_sensitivity ()
if (! layersD)
return;
if ((layer = (layersD->active_layer)) != NULL)
if ((layer = (layersD->active_layer)) != NULL)
lm = (layer->mask) ? TRUE : FALSE;
else
lm = FALSE;
......
......@@ -165,26 +165,52 @@ static OpsButtonCallback to_path_ext_callbacks[] =
static OpsButton paths_ops_buttons[] =
{
{ new_xpm, paths_dialog_new_path_callback, NULL, N_("New Path"), NULL, 0 },
{ duplicate_xpm, paths_dialog_dup_path_callback, NULL, N_("Duplicate Path"), NULL, 0 },
{ toselection_xpm, paths_dialog_path_to_sel_callback, NULL, N_("Path to Selection"), NULL, 0 },
{ topath_xpm, paths_dialog_sel_to_path_callback, to_path_ext_callbacks, N_("Selection to Path"), NULL, 0 },
{ penstroke_xpm, paths_dialog_stroke_path_callback, NULL, N_("Stroke Path"), NULL, 0 },
{ delete_xpm, paths_dialog_delete_path_callback, NULL, N_("Delete Path"), NULL, 0 },
{ NULL, NULL, NULL, NULL, NULL, 0 }
{ new_xpm, paths_dialog_new_path_callback, NULL,
N_("New Path"),
"paths/new_path.html",
NULL, 0 },
{ duplicate_xpm, paths_dialog_dup_path_callback, NULL,
N_("Duplicate Path"),
"paths/duplicate_path.html",
NULL, 0 },
{ toselection_xpm, paths_dialog_path_to_sel_callback, NULL,
N_("Path to Selection"),
"paths/path_to_selection.html",
NULL, 0 },
{ topath_xpm, paths_dialog_sel_to_path_callback, to_path_ext_callbacks,
N_("Selection to Path"),
"paths/selection_to_path.html",
NULL, 0 },
{ penstroke_xpm, paths_dialog_stroke_path_callback, NULL,
N_("Stroke Path"),
"paths/stroke_path.html",
NULL, 0 },
{ delete_xpm, paths_dialog_delete_path_callback, NULL,
N_("Delete Path"),
"paths/delete_path.html",
NULL, 0 },
{ NULL, NULL, NULL, NULL, NULL, NULL, 0 }
};
static OpsButton point_ops_buttons[] =
{
{ pennorm_xpm, paths_dialog_new_point_callback, NULL, N_("New Point"), NULL, 0 },
{ penadd_xpm, paths_dialog_add_point_callback, NULL, N_("Add Point"), NULL, 0 },
{ pendel_xpm, paths_dialog_delete_point_callback, NULL, N_("Delete Point"), NULL, 0 },
{ penedit_xpm, paths_dialog_edit_point_callback, NULL, N_("Edit Point"), NULL, 0 },
{ NULL, NULL, NULL, NULL, NULL, 0 }
{ pennorm_xpm, paths_dialog_new_point_callback, NULL,
N_("New Point"), NULL,
NULL, 0 },
{ penadd_xpm, paths_dialog_add_point_callback, NULL,
N_("Add Point"), NULL,
NULL, 0 },
{ pendel_xpm, paths_dialog_delete_point_callback, NULL,
N_("Delete Point"), NULL,
NULL, 0 },
{ penedit_xpm, paths_dialog_edit_point_callback, NULL,
N_("Edit Point"), NULL,
NULL, 0 },
{ NULL, NULL, NULL, NULL, NULL, NULL, 0 }
};
static void
paths_dialog_set_menu_sensitivity ()
paths_dialog_set_menu_sensitivity (void)
{
gboolean gimage = FALSE; /* is there a gimage */
gboolean pp = FALSE; /* paths present */
......@@ -748,7 +774,7 @@ void paths_add_path (PATHP bzp,
if(!GTK_WIDGET_REALIZED(paths_dialog->vbox))
gtk_widget_realize(paths_dialog->vbox);
paths_dialog_preview_extents();
paths_dialog_preview_extents ();
if(preview_size)
{
......@@ -2511,11 +2537,11 @@ paths_transform_do_undo (GimpImage *gimage,
}
/* Force selection .. it may have changed */
if(bezier_tool_selected() && paths_dialog->current_path_list)
if (bezier_tool_selected () && paths_dialog->current_path_list)
{
gtk_clist_select_row(GTK_CLIST(paths_dialog->paths_list),
paths_dialog->current_path_list->last_selected_row,
1);
gtk_clist_select_row (GTK_CLIST (paths_dialog->paths_list),
paths_dialog->current_path_list->last_selected_row,
1);
}
}
}
......@@ -3076,19 +3102,18 @@ paths_delete_path (GimpImage *gimage,
plp->bz_paths = g_slist_remove(plp->bz_paths,tlist->data);
/* If now empty free everything up */
if(!plp->bz_paths || g_slist_length(plp->bz_paths) == 0)
if (!plp->bz_paths || g_slist_length(plp->bz_paths) == 0)
{
gtk_signal_disconnect(GTK_OBJECT (plp->gimage),
plp->sig_id);
gimp_image_set_paths(plp->gimage,NULL);
pathimagelist_free(plp);
gtk_signal_disconnect (GTK_OBJECT (plp->gimage), plp->sig_id);
gimp_image_set_paths (plp->gimage, NULL);
pathimagelist_free (plp);
}
/* Redisplay if required */
if(paths_dialog && paths_dialog->gimage == gimage)
if (paths_dialog && paths_dialog->gimage == gimage)
{
paths_dialog->current_path_list = NULL;
paths_dialog_flush();
paths_dialog_flush ();
}
return TRUE;
......
......@@ -260,20 +260,32 @@ static OpsButtonCallback lower_layers_ext_callbacks[] =
static OpsButton layers_ops_buttons[] =
{
{ new_xpm, layers_dialog_new_layer_callback, NULL,
N_("New Layer"), NULL, 0 },
N_("New Layer"),
"layers/dialogs/new_layer.html",
NULL, 0 },
{ raise_xpm, layers_dialog_raise_layer_callback, raise_layers_ext_callbacks,
N_("Raise Layer \n"
"<Shift> To Top"), NULL, 0 },
"<Shift> To Top"),
"layers/stack/stack.html#raise_layer",
NULL, 0 },
{ lower_xpm, layers_dialog_lower_layer_callback, lower_layers_ext_callbacks,
N_("Lower Layer \n"
"<Shift> To Bottom"), NULL, 0 },
"<Shift> To Bottom"),
"layers/stack/stack.html#lower_layer",
NULL, 0 },
{ duplicate_xpm, layers_dialog_duplicate_layer_callback, NULL,
N_("Duplicate Layer"), NULL, 0 },
N_("Duplicate Layer"),
"layers/duplicate_layer.html",
NULL, 0 },
{ anchor_xpm, layers_dialog_anchor_layer_callback, NULL,
N_("Anchor Layer"), NULL, 0 },
N_("Anchor Layer"),
"layers/anchor_layer.html",
NULL, 0 },
{ delete_xpm, layers_dialog_delete_layer_callback, NULL,
N_("Delete Layer"), NULL, 0 },
{ NULL, NULL, NULL, NULL, NULL, 0 }
N_("Delete Layer"),
"layers/delete_layer.html",
NULL, 0 },
{ NULL, NULL, NULL, NULL, NULL, NULL, 0 }
};
/* dnd structures */
......@@ -305,7 +317,7 @@ static guint n_trashcan_targets = (sizeof (trashcan_target_table) /
/************************************/
GtkWidget *
layers_dialog_create ()
layers_dialog_create (void)
{
GtkWidget *vbox;
GtkWidget *util_box;
......@@ -458,7 +470,7 @@ layers_dialog_create ()
}
void
layers_dialog_free ()
layers_dialog_free (void)
{
LayerWidget *lw;
GSList *list;
......@@ -565,7 +577,7 @@ layers_dialog_update (GimpImage* gimage)
}
void
layers_dialog_flush ()
layers_dialog_flush (void)
{
GImage *gimage;
Layer *layer;
......@@ -646,15 +658,13 @@ layers_dialog_flush ()
}
void
layers_dialog_clear ()
layers_dialog_clear (void)
{
ops_button_box_set_insensitive (layers_ops_buttons);
if (! layersD)
return;
/* Make sure the gimage is not notified of this change */
suspend_gimage_notify++;
gtk_list_clear_items (GTK_LIST (layersD->layer_list), 0, -1);
suspend_gimage_notify--;
layersD->gimage = NULL;
......@@ -900,7 +910,7 @@ render_fs_preview (GtkWidget *widget,
/*************************************/
static void
layers_dialog_preview_extents ()
layers_dialog_preview_extents (void)
{
GImage *gimage;
......@@ -933,7 +943,7 @@ layers_dialog_preview_extents ()
}
static void
layers_dialog_set_menu_sensitivity ()
layers_dialog_set_menu_sensitivity (void)
{
gint fs; /* floating sel */
gint ac; /* active channel */
......@@ -952,7 +962,7 @@ layers_dialog_set_menu_sensitivity ()
if (! layersD)
return;
if ((layer = (layersD->active_layer)) != NULL)
if ((layer = (layersD->active_layer)) != NULL)
lm = (layer->mask) ? TRUE : FALSE;
else
lm = FALSE;
......
......@@ -32,11 +32,7 @@
#include "session.h"
#include "libgimp/gimpintl.h"
#define GRAD_CHECK_SIZE_SM 4
#define GRAD_CHECK_DARK (1.0 / 3.0)
#define GRAD_CHECK_LIGHT (2.0 / 3.0)
#include "libgimp/gimplimits.h"
#define MENU_THUMBNAIL_WIDTH 24
#define MENU_THUMBNAIL_HEIGHT 24
......@@ -52,11 +48,10 @@ static void lc_dialog_destroy_cb (GimpImage *, gpointer);
static void lc_dialog_change_image (GimpContext *, GimpImage *,
gpointer);
static void lc_dialog_help_func (gpointer);
static void lc_dialog_image_menu_preview_update_cb (GtkWidget *,gpointer);
static void lc_dialog_fill_preview_with_thumb(GtkWidget *,
GimpImage *,
gint ,
gint );
static void lc_dialog_image_menu_preview_update_cb (GtkWidget *, gpointer);
static void lc_dialog_fill_preview_with_thumb (GtkWidget *, GimpImage *,
gint, gint);
/* FIXME: move these to a better place */
......@@ -79,7 +74,7 @@ lc_dialog_create (GimpImage* gimage)
GtkWidget *button;
GtkWidget *label;
GtkWidget *separator;
int default_index;
gint default_index;
if (lc_dialog)
{
......@@ -224,7 +219,7 @@ lc_dialog_create (GimpImage* gimage)
}
void
lc_dialog_free ()
lc_dialog_free (void)
{
if (lc_dialog == NULL)
return;
......@@ -241,17 +236,17 @@ lc_dialog_free ()
}
void
lc_dialog_rebuild (int new_preview_size)
lc_dialog_rebuild (gint new_preview_size)
{
GimpImage* gimage;
int flag;
gboolean flag;
gimage = NULL;
flag = 0;
flag = FALSE;
if (lc_dialog)
{
flag = 1;
flag = TRUE;
gimage = lc_dialog->gimage;
/* Unregister the dialog */
dialog_unregister (lc_dialog->shell);
......@@ -266,7 +261,7 @@ lc_dialog_rebuild (int new_preview_size)
}
void
lc_dialog_flush ()
lc_dialog_flush (void)
{
if (! lc_dialog || lc_dialog->gimage == NULL)
return;
......@@ -279,41 +274,45 @@ lc_dialog_flush ()
static gint
image_menu_preview_update_do (GimpImage *gimage)
{
if(lc_dialog)
if (lc_dialog)
{
gtk_container_foreach (GTK_CONTAINER (lc_dialog->image_menu),
lc_dialog_image_menu_preview_update_cb, (gpointer)gimage);
lc_dialog_image_menu_preview_update_cb,