context-menu.cpp revision b1e21a347e133d91e2156592d5ea399cd28494f5
/*
* 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 "context-menu.h"
#include "desktop.h"
#include "document.h"
#include "message-stack.h"
#include "preferences.h"
#include "ui/dialog/dialog-manager.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 "dialogs/text-edit.h"
#include "dialogs/spellcheck.h"
#include "ui/dialog/object-attributes.h"
#include "ui/dialog/object-properties.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);
/* 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);
}
{
}
{
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;
/* Link dialog */
w = gtk_menu_item_new_with_mnemonic(_("Image _Properties..."));
gtk_widget_show(w);
gtk_menu_shell_append(GTK_MENU_SHELL(m), w);
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 );
}
}
{
}
static gchar* getImageEditorName() {
}
if (!value) {
}
return value;
}
{
#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 {
}
//printf("##Command line: %s\n", cmdline.c_str());
&errThing);
if ( errThing ) {
errThing = 0;
}
}
/* 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 :