diff --git a/src/interface.cpp b/src/interface.cpp
index f7a2bc47fd799b4ff903dcf6c389c5cd5101df74..0259ecb6602dd52d7f62c0f53e5a7cded9f1d31e 100644 (file)
--- a/src/interface.cpp
+++ b/src/interface.cpp
#include "event-context.h"
#include "gradient-drag.h"
+// Include Mac OS X menu synchronization on native OSX build
+#ifdef GDK_WINDOWING_QUARTZ
+#include "ige-mac-menu.h"
+#endif
+
using Inkscape::IO::StringOutputStream;
using Inkscape::IO::Base64OutputStream;
} ui_drop_target_info;
static GtkTargetEntry ui_drop_target_entries [] = {
- {"text/uri-list", 0, URI_LIST},
- {"image/svg+xml", 0, SVG_XML_DATA},
- {"image/svg", 0, SVG_DATA},
- {"image/png", 0, PNG_DATA},
- {"image/jpeg", 0, JPEG_DATA},
+ {(gchar *)"text/uri-list", 0, URI_LIST },
+ {(gchar *)"image/svg+xml", 0, SVG_XML_DATA },
+ {(gchar *)"image/svg", 0, SVG_DATA },
+ {(gchar *)"image/png", 0, PNG_DATA },
+ {(gchar *)"image/jpeg", 0, JPEG_DATA },
#if ENABLE_MAGIC_COLORS
- {"application/x-inkscape-color", 0, APP_X_INKY_COLOR},
+ {(gchar *)"application/x-inkscape-color", 0, APP_X_INKY_COLOR},
#endif // ENABLE_MAGIC_COLORS
- {"application/x-color", 0, APP_X_COLOR}
+ {(gchar *)"application/x-color", 0, APP_X_COLOR }
};
static GtkTargetEntry *completeDropTargets = 0;
Gtk::Window *win = Inkscape::UI::window_new("", TRUE);
+ gtk_container_add(GTK_CONTAINER(win->gobj()), GTK_WIDGET(vw));
+ gtk_widget_show(GTK_WIDGET(vw));
+
if (editable) {
g_object_set_data(G_OBJECT(vw), "window", win);
desktop_widget->window = win;
- /* fixme: doesn't allow making window any smaller than this */
- win->set_default_size(640, 480);
-
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));
-
+
gint prefs_geometry =
(2==prefs_get_int_attribute("options.savewindowgeometry", "value", 0));
if (prefs_geometry) {
gtk_window_set_policy(GTK_WINDOW(win->gobj()), TRUE, TRUE, TRUE);
}
- gtk_container_add(GTK_CONTAINER(win->gobj()), GTK_WIDGET(vw));
- gtk_widget_show(GTK_WIDGET(vw));
-
if ( completeDropTargets == 0 || completeDropTargetsCount == 0 )
{
std::vector<gchar*> types;
{
GtkWidget *mbar = gtk_menu_bar_new();
+#ifdef GDK_WINDOWING_QUARTZ
+ 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;
+#else
return mbar;
+#endif
}
static void leave_group(GtkMenuItem *, SPDesktop *desktop) {
Path *livarot_path = Path_for_item(item, true, true);
livarot_path->ConvertWithBackData(0.04);
- NR::Maybe<Path::cut_position> position = get_nearest_position_on_Path(livarot_path, button_doc);
+ boost::optional<Path::cut_position> position = get_nearest_position_on_Path(livarot_path, button_doc);
if (position) {
NR::Point nearest = get_point_on_Path(livarot_path, position->piece, position->t);
NR::Point delta = nearest - button_doc;
( !SP_OBJECT_STYLE(item)->stroke.isNone() ?
desktop->current_zoom() *
SP_OBJECT_STYLE (item)->stroke_width.computed *
- sp_item_i2d_affine (item).expansion() * 0.5
+ NR::expansion(sp_item_i2d_affine(item)) * 0.5
: 0.0)
+ prefs_get_int_attribute_limited("options.dragtolerance", "value", 0, 0, 100);
int const saved_pref = prefs_get_int_attribute("options.transform", "pattern", 1);
prefs_set_int_attribute("options.transform", "pattern", 1);
sp_document_ensure_up_to_date(sp_desktop_document(desktop));
- NR::Maybe<NR::Rect> sel_bbox = selection->bounds();
+ boost::optional<NR::Rect> sel_bbox = selection->bounds();
if (sel_bbox) {
NR::Point m( desktop->point() - sel_bbox->midpoint() );
sp_selection_move_relative(selection, m);