context-menu.cpp revision c9518a09f2070bfd0ae3e717de9e91dd6c52479c
/*
* Unser-interface related object extension
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Jon A. Cruz <jon@joncruz.org>
* Abhishek Sharma
*
* This code is in public domain
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "ui/dialog/dialog-manager.h"
#include "context-menu.h"
#include "desktop.h"
#include "document.h"
#include "document-undo.h"
#include "inkscape.h"
#include "message-stack.h"
#include "preferences.h"
#include "verbs.h"
#include "selection-chemistry.h"
using Inkscape::DocumentUndo;
/* Append object-specific part to context menu */
{
}
}
/* Implementation */
#include "selection.h"
#include "selection-chemistry.h"
#include "sp-anchor.h"
#include "sp-clippath.h"
#include "sp-image.h"
#include "sp-mask.h"
#include "sp-path.h"
#include "sp-text.h"
#include "desktop-handles.h"
#include "ui/dialog/object-attributes.h"
#include "ui/dialog/object-properties.h"
#include "ui/dialog/spellcheck.h"
{
if (!t2m) {
}
handler = (void (*)(SPObject*, SPDesktop*, GtkMenu*))g_hash_table_lookup(t2m, GUINT_TO_POINTER(type));
}
/* SPItem */
/* Generate context menu item section */
{
GtkWidget *w;
/* Item dialog */
w = gtk_menu_item_new_with_mnemonic(_("_Object Properties..."));
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
/* Separator */
w = gtk_menu_item_new();
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
/* Select item */
w = gtk_menu_item_new_with_mnemonic(_("_Select This"));
} else {
}
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
/* Select same fill and stroke */
w = gtk_menu_item_new_with_mnemonic(_("_Select Same Fill and Stroke"));
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
/* Create link */
w = gtk_menu_item_new_with_mnemonic(_("_Create Link"));
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
/* Set mask */
w = gtk_menu_item_new_with_mnemonic(_("Set Mask"));
if ((item && item->mask_ref && item->mask_ref->getObject()) || (item->clip_ref && item->clip_ref->getObject())) {
} else {
}
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
/* Release mask */
w = gtk_menu_item_new_with_mnemonic(_("Release Mask"));
} else {
}
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
/* Set Clip */
w = gtk_menu_item_new_with_mnemonic(_("Set _Clip"));
if ((item && item->mask_ref && item->mask_ref->getObject()) || (item->clip_ref && item->clip_ref->getObject())) {
} else {
}
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
/* Release Clip */
w = gtk_menu_item_new_with_mnemonic(_("Release C_lip"));
} else {
}
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
}
{
// sp_item_dialog();
}
{
sp_selection_set_mask(desktop, false, false);
}
{
sp_selection_unset_mask(desktop, false);
}
{
sp_selection_set_mask(desktop, true, false);
}
{
sp_selection_unset_mask(desktop, true);
}
{
}
{
sp_select_same_fill_stroke(desktop, true, true);
}
{
item->deleteObject(false);
_("Create link"));
}
/* SPGroup */
{
GtkWidget *w;
/* "Ungroup" */
w = gtk_menu_item_new_with_mnemonic(_("_Ungroup"));
gtk_widget_show(w);
}
{
}
/* SPAnchor */
{
GtkWidget *w;
/* Link dialog */
w = gtk_menu_item_new_with_mnemonic(_("Link _Properties..."));
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
/* Select item */
w = gtk_menu_item_new_with_mnemonic(_("_Follow Link"));
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
/* Reset transformations */
w = gtk_menu_item_new_with_mnemonic(_("_Remove Link"));
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
}
{
}
{
/* shell out to an external browser here */
}
{
}
/* Image */
{
GtkWidget *w;
/* Image properties */
w = gtk_menu_item_new_with_mnemonic(_("Image _Properties..."));
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
/* Edit externally */
w = gtk_menu_item_new_with_mnemonic(_("Edit Externally..."));
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
gtk_widget_set_sensitive( w, FALSE );
}
/* Embed image */
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
gtk_widget_set_sensitive( w, FALSE );
}
}
/* Extract image */
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
gtk_widget_set_sensitive( w, FALSE );
}
}
}
/* Image Properties entry */
{
}
static gchar* getImageEditorName() {
}
if (!value) {
}
return value;
}
/* Edit Externally entry */
{
}
#ifdef WIN32
// g_spawn_command_line_sync parsing is done according to Unix shell rules,
// not Windows command interpreter rules. Thus we need to enclose the
// executable path with sigle quotes.
if ( index >= 0 ) {
} else {
// Enclose the whole command line if no executable path can be extracted.
}
#endif
// URI to filename conversion
} else {
}
} else if (SP_ACTIVE_DOCUMENT->getBase()) {
} else {
}
}
//g_warning("##Command line: %s\n", cmdline.c_str());
&errThing);
if ( errThing ) {
errThing = 0;
}
}
/* Embed Image entry */
{
}
if (verb) {
if (action) {
}
}
}
/* Extract Image entry */
{
}
if (verb) {
if (action) {
}
}
}
/* Fill and Stroke entry */
{
}
}
/* SPShape */
{
GtkWidget *w;
/* Item dialog */
w = gtk_menu_item_new_with_mnemonic(_("_Fill and Stroke..."));
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
}
/* Edit Text entry */
{
}
}
/* Spellcheck entry */
{
}
}
/* SPText */
{
GtkWidget *w;
/* Fill and Stroke dialog */
w = gtk_menu_item_new_with_mnemonic(_("_Fill and Stroke..."));
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
/* Edit Text dialog */
w = gtk_menu_item_new_with_mnemonic(_("_Text and Font..."));
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
/* Spellcheck dialog */
w = gtk_menu_item_new_with_mnemonic(_("Check Spellin_g..."));
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :