interface.cpp revision e42e6130e1aca183d24c4e696c9fae555c49beaa
2521N/A#define __SP_INTERFACE_C__
#ifdef HAVE_CONFIG_H
# include "config.h"
#include "inkscape-private.h"
#include "prefs-utils.h"
#include "path-prefix.h"
#include "shortcuts.h"
#include "document.h"
#include "desktop-handles.h"
#include "file.h"
#include "interface.h"
#include "desktop.h"
#include "object-ui.h"
#include "selection.h"
#include "selection-chemistry.h"
#include "svg-view-widget.h"
#include "widgets/desktop-widget.h"
#include "sp-item-group.h"
#include "sp-namedview.h"
#include "helper/gnome-utils.h"
#include "io/stringstream.h"
#include "io/base64stream.h"
#include "dialogs/dialog-events.h"
#include "message-context.h"
#if ENABLE_LCMS
#include "lcms.h"
#include "display/sp-canvas.h"
#include "color.h"
#include "svg/svg-color.h"
#include "desktop-style.h"
#include "style.h"
#if ENABLE_LCMS
static int completeDropTargetsCount = 0;
#define ENTRIES_SIZE(n) sizeof(n)/sizeof(n[0])
unsigned int sensitive,
void *data);
{NULL},
NULL,
if (editable) {
static_cast<GtkWindow*>((void*)w);
if (editable) {
while ( list ) {
for ( i = 0; typesXX[i]; i++ ) {
for ( int i = 0; i < (int)nui_drop_target_entries; i++ ) {
pos++;
NULL);
gtk_widget_show(w);
if (!document) return;
if (!document) return;
sp_ui_close_all(void)
while (SP_ACTIVE_DESKTOP) {
return FALSE;
return TRUE;
static gint
Inkscape::UI::View::View *view = static_cast<Inkscape::UI::View::View*> (g_object_get_data(G_OBJECT(object), "view"));
Inkscape::UI::View::View *view = static_cast<Inkscape::UI::View::View*> (g_object_get_data(G_OBJECT(object), "view"));
static GtkWidget *
if (stock) {
} else if (label) {
if (callback) {
return item;
static gchar const *
/* TODO: Compare with the definition of gtk_accel_label_refetch in gtk/gtkaccellabel.c (or
gchar *p = c;
&& (p < end))
if (p < end) {
unsigned int shortcut;
gchar *s;
if (!action)
if (shortcut) {
static GtkWidget *
sp_ui_menu_append_item_from_verb(GtkMenu *menu, Inkscape::Verb *verb, Inkscape::UI::View::View *view, bool radio = false, GSList *group = NULL)
unsigned int shortcut;
if (shortcut) {
if (radio) {
if (radio) {
nr_active_object_add_listener((NRActiveObject *)action, (NRObjectEventVector *)&menu_item_event_vector, sizeof(SPActionEventVector), item);
return item;
Inkscape::UI::View::View *view = (Inkscape::UI::View::View *) g_object_get_data(G_OBJECT(menuitem), "view");
static gboolean
Inkscape::UI::View::View *view = (Inkscape::UI::View::View *) g_object_get_data(G_OBJECT(menuitem), "view");
g_signal_handlers_block_by_func(G_OBJECT(menuitem), (gpointer)(GCallback)checkitem_toggled, user_data);
g_signal_handlers_unblock_by_func(G_OBJECT(menuitem), (gpointer)(GCallback)checkitem_toggled, user_data);
return FALSE;
sp_ui_menu_append_check_item_from_verb(GtkMenu *menu, Inkscape::UI::View::View *view, gchar const *label, gchar const *tip, gchar const *pref,
unsigned int shortcut = 0;
if (verb) {
nr_active_object_add_listener((NRActiveObject *)action, (NRObjectEventVector *)&menu_item_event_vector, sizeof(SPActionEventVector), item);
g_signal_connect( G_OBJECT(item), "select", G_CALLBACK(sp_ui_menu_select), (gpointer) (action ? action->tip : tip));
if (dir) {
continue; // skip default.*.svg (i.e. default.svg and translations) - it's in the menu already
if (view) {
if (recent) {
//sp_ui_menu_append_check_item_from_verb(m, view, _("_Menu"), _("Show or hide the menu bar"), "menu",
sp_ui_menu_append_check_item_from_verb(m, view, _("Commands Bar"), _("Show or hide the Commands bar (under the menu)"), "commands",
sp_ui_menu_append_check_item_from_verb(m, view, _("Tool Controls Bar"), _("Show or hide the Tool Controls bar"), "toppanel",
sp_ui_menu_append_check_item_from_verb(m, view, _("_Toolbox"), _("Show or hide the main toolbox (on the left)"), "toolbox",
sp_ui_menu_append_check_item_from_verb(m, view, _("_Statusbar"), _("Show or hide the statusbar (at the bottom of the window)"), "statusbar",
sp_ui_menu_append_check_item_from_verb(m, view, _("_Palette"), _("Show or hide the color palette"), "panels",
if (!strcmp(menu_pntr->attribute("name"), "Effects") && !prefs_get_int_attribute("extensions", "show-effects-menu", 0)) {
return mbar;
GtkWidget *m;
m = gtk_menu_new();
if (item) {
if (item) {
gtk_widget_show(w);
gtk_widget_show(w);
switch (info) {
#if ENABLE_LCMS
case APP_X_INKY_COLOR:
int destX = 0;
int destY = 0;
if ( item )
bool updatePerformed = false;
str = 0;
updatePerformed = true;
if ( !updatePerformed ) {
if ( srgbProf ) {
case APP_X_COLOR:
int destX = 0;
int destY = 0;
if ( item )
case SVG_DATA:
case SVG_XML_DATA: {
case URI_LIST: {
case PNG_DATA:
case JPEG_DATA:
case IMAGE_DATA: {
GdkPixbufLoader *loader = gdk_pixbuf_loader_new_with_mime_type( gdk_atom_name(data->type), &error );
if ( loader ) {
if ( pbuf ) {
if (!list)
if (filename) {
if (!doc) return;
NULL,
NULL);
text = g_strdup_printf(_("The file %s already exists. Do you want to overwrite that file with the current document?"), filename);
return return_value;