Commit 63177de7 authored by Simon Budig's avatar Simon Budig Committed by Simon Budig

new callbacks to convert the current vector to the selection.

2004-03-20  Simon Budig  <simon@gimp.org>

	* app/gui/select-commands.[ch]: new callbacks to convert the
	current vector to the selection.

	* app/gui/image-menu.c: hook it into the menu. Default shortcut
	is Shift+V.
parent c4c19933
2004-03-20 Simon Budig <simon@gimp.org>
* app/gui/select-commands.[ch]: new callbacks to convert the
current vector to the selection.
* app/gui/image-menu.c: hook it into the menu. Default shortcut
is Shift+V.
2004-03-20 Sven Neumann <sven@gimp.org>
* app/text/gimptextlayer.c (gimp_text_layer_set): use the same
......@@ -27,6 +27,7 @@
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpchannel-select.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpimage-qmask.h"
......@@ -132,6 +133,26 @@ select_none_cmd_callback (GtkWidget *widget,
gimp_image_flush (gimage);
}
void
select_from_vectors_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpVectors *vectors;
return_if_no_image (gimage, data);
vectors = gimp_image_get_active_vectors (gimage);
if (!vectors)
return;
gimp_channel_select_vectors (gimp_image_get_mask (gimage),
_("Path to Selection"),
vectors,
GIMP_CHANNEL_OP_REPLACE,
TRUE, FALSE, 0, 0);
gimp_image_flush (gimage);
}
void
select_float_cmd_callback (GtkWidget *widget,
gpointer data)
......
......@@ -26,6 +26,8 @@ void select_all_cmd_callback (GtkWidget *widget,
gpointer data);
void select_none_cmd_callback (GtkWidget *widget,
gpointer data);
void select_from_vectors_cmd_callback (GtkWidget *widget,
gpointer data);
void select_float_cmd_callback (GtkWidget *widget,
gpointer data);
void select_feather_cmd_callback (GtkWidget *widget,
......
......@@ -289,6 +289,11 @@ GimpItemFactoryEntry image_menu_entries[] =
"<StockItem>", GIMP_STOCK_INVERT },
NULL,
GIMP_HELP_SELECTION_INVERT, NULL },
{ { N_("/Select/Fr_om Path"), "<shift>V",
select_from_vectors_cmd_callback, 0,
"<StockItem>", GIMP_STOCK_SELECTION_REPLACE },
NULL,
GIMP_HELP_SELECTION_NONE, NULL },
{ { N_("/Select/_Float"), "<control><shift>L",
select_float_cmd_callback, 0,
"<StockItem>", GIMP_STOCK_FLOATING_SELECTION },
......@@ -1502,6 +1507,7 @@ image_menu_update (GtkItemFactory *item_factory,
SET_SENSITIVE ("/Select/All", lp);
SET_SENSITIVE ("/Select/None", lp && sel);
SET_SENSITIVE ("/Select/Invert", lp && sel);
SET_SENSITIVE ("/Select/From Path", lp && vectors);
SET_SENSITIVE ("/Select/Float", lp && sel);
if (display_items)
......
......@@ -27,6 +27,7 @@
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpchannel-select.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpimage-qmask.h"
......@@ -132,6 +133,26 @@ select_none_cmd_callback (GtkWidget *widget,
gimp_image_flush (gimage);
}
void
select_from_vectors_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpVectors *vectors;
return_if_no_image (gimage, data);
vectors = gimp_image_get_active_vectors (gimage);
if (!vectors)
return;
gimp_channel_select_vectors (gimp_image_get_mask (gimage),
_("Path to Selection"),
vectors,
GIMP_CHANNEL_OP_REPLACE,
TRUE, FALSE, 0, 0);
gimp_image_flush (gimage);
}
void
select_float_cmd_callback (GtkWidget *widget,
gpointer data)
......
......@@ -26,6 +26,8 @@ void select_all_cmd_callback (GtkWidget *widget,
gpointer data);
void select_none_cmd_callback (GtkWidget *widget,
gpointer data);
void select_from_vectors_cmd_callback (GtkWidget *widget,
gpointer data);
void select_float_cmd_callback (GtkWidget *widget,
gpointer data);
void select_feather_cmd_callback (GtkWidget *widget,
......
......@@ -289,6 +289,11 @@ GimpItemFactoryEntry image_menu_entries[] =
"<StockItem>", GIMP_STOCK_INVERT },
NULL,
GIMP_HELP_SELECTION_INVERT, NULL },
{ { N_("/Select/Fr_om Path"), "<shift>V",
select_from_vectors_cmd_callback, 0,
"<StockItem>", GIMP_STOCK_SELECTION_REPLACE },
NULL,
GIMP_HELP_SELECTION_NONE, NULL },
{ { N_("/Select/_Float"), "<control><shift>L",
select_float_cmd_callback, 0,
"<StockItem>", GIMP_STOCK_FLOATING_SELECTION },
......@@ -1502,6 +1507,7 @@ image_menu_update (GtkItemFactory *item_factory,
SET_SENSITIVE ("/Select/All", lp);
SET_SENSITIVE ("/Select/None", lp && sel);
SET_SENSITIVE ("/Select/Invert", lp && sel);
SET_SENSITIVE ("/Select/From Path", lp && vectors);
SET_SENSITIVE ("/Select/Float", lp && sel);
if (display_items)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment