summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2187178)
raw | patch | inline | side by side (parent: 2187178)
author | joncruz <joncruz@users.sourceforge.net> | |
Wed, 18 Mar 2009 09:15:48 +0000 (09:15 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Wed, 18 Mar 2009 09:15:48 +0000 (09:15 +0000) |
src/interface.cpp | patch | blob | history |
diff --git a/src/interface.cpp b/src/interface.cpp
index 8379cd0e23c9e48aa9ea1fe7091f87a902e5355c..164b66f3388213c7e8eaf2960bd9870c82d84942 100644 (file)
--- a/src/interface.cpp
+++ b/src/interface.cpp
gtk_widget_show(GTK_WIDGET(vw));
if (editable) {
- g_object_set_data(G_OBJECT(vw), "window", win);
+ g_object_set_data(G_OBJECT(vw), "window", win);
- SPDesktopWidget *desktop_widget = reinterpret_cast<SPDesktopWidget*>(vw);
- SPDesktop* desktop = desktop_widget->desktop;
+ SPDesktopWidget *desktop_widget = reinterpret_cast<SPDesktopWidget*>(vw);
+ SPDesktop* desktop = desktop_widget->desktop;
- desktop_widget->window = win;
+ desktop_widget->window = win;
win->set_data("desktop", desktop);
win->set_data("desktopwidget", desktop_widget);
win->signal_delete_event().connect(sigc::mem_fun(*(SPDesktop*)vw->view, &SPDesktop::onDeleteUI));
- win->signal_window_state_event().connect(sigc::mem_fun(*desktop, &SPDesktop::onWindowStateEvent));
- win->signal_focus_in_event().connect(sigc::mem_fun(*desktop_widget, &SPDesktopWidget::onFocusInEvent));
+ win->signal_window_state_event().connect(sigc::mem_fun(*desktop, &SPDesktop::onWindowStateEvent));
+ win->signal_focus_in_event().connect(sigc::mem_fun(*desktop_widget, &SPDesktopWidget::onFocusInEvent));
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
gint prefs_geometry =
(2==prefs->getInt("/options/savewindowgeometry/value", 0));
if (prefs_geometry) {
sp_ui_menu_append_check_item_from_verb(m, view, _("Commands Bar"), _("Show or hide the Commands bar (under the menu)"), "commands",
checkitem_toggled, checkitem_update, 0);
sp_ui_menu_append_check_item_from_verb(m, view, _("Snap controls Bar"), _("Show or hide the snapping controls"), "snaptoolbox",
- checkitem_toggled, checkitem_update, 0);
+ checkitem_toggled, checkitem_update, 0);
sp_ui_menu_append_check_item_from_verb(m, view, _("Tool Controls Bar"), _("Show or hide the Tool Controls bar"), "toppanel",
checkitem_toggled, checkitem_update, 0);
sp_ui_menu_append_check_item_from_verb(m, view, _("_Toolbox"), _("Show or hide the main toolbox (on the left)"), "toolbox",
GtkWidget *mbar = gtk_menu_bar_new();
#ifdef GDK_WINDOWING_QUARTZ
- ige_mac_menu_set_menu_bar(GTK_MENU_SHELL(mbar));
+ ige_mac_menu_set_menu_bar(GTK_MENU_SHELL(mbar));
#endif
sp_ui_build_dyn_menus(inkscape_get_menus(INKSCAPE), mbar, view);
#ifdef GDK_WINDOWING_QUARTZ
- return NULL;
+ return NULL;
#else
return mbar;
#endif
colorspec = ""; // TODO check if this is sufficient
} else if ( color.getType() == eek::ColorDef::NONE ) {
colorspec = "none";
- } else {
+ } else {
gchar* tmp = g_strdup_printf("#%02x%02x%02x", color.getR(), color.getG(), color.getB());
colorspec = tmp;
g_free(tmp);
Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc);
Inkscape::XML::Node *newImage = xml_doc->createElement("svg:image");
gchar *atom_name = gdk_atom_name(data->type);
-
+
// this formula taken from Glib docs
guint needed_size = data->length * 4 / 3 + data->length * 4 / (3 * 72) + 7;
needed_size += 5 + 8 + strlen(atom_name); // 5 bytes for data:, 8 for ;base64,
-
+
gchar *buffer = (gchar *) g_malloc(needed_size), *buf_work = buffer;
buf_work += g_sprintf(buffer, "data:%s;base64,", atom_name);
-
+
gint state = 0, save = 0;
g_base64_encode_step(data->data, data->length, TRUE, buf_work, &state, &save);
g_base64_encode_close(TRUE, buf_work, &state, &save);