Code

Merge from trunk
[inkscape.git] / src / ui / dialog / filedialogimpl-win32.cpp
index 4a2cc879d4d1c1f7312225a9a2a6ccb2c240d570..0f3672f25a678614eccf7ff3483dae791ad139ff 100644 (file)
@@ -61,7 +61,7 @@ namespace Dialog
 
 const int PreviewWidening = 150;
 const char PreviewWindowClassName[] = "PreviewWnd";
-const unsigned long MaxPreviewFileSize = 1344; // kB
+const unsigned long MaxPreviewFileSize = 10240; // kB
 
 #define IDC_SHOW_PREVIEW    1000
 
@@ -193,11 +193,11 @@ void FileOpenDialogImplWin32::createFilterMenu()
     ustring all_inkscape_files_filter, all_image_files_filter, all_vectors_filter, all_bitmaps_filter;
     Filter all_files, all_inkscape_files, all_image_files, all_vectors, all_bitmaps;
 
-    const gchar *all_files_filter_name = N_("All Files");
-    const gchar *all_inkscape_files_filter_name = N_("All Inkscape Files");
-    const gchar *all_image_files_filter_name = N_("All Images");
-    const gchar *all_vectors_filter_name = N_("All Vectors");
-    const gchar *all_bitmaps_filter_name = N_("All Bitmaps");
+    const gchar *all_files_filter_name = _("All Files");
+    const gchar *all_inkscape_files_filter_name = _("All Inkscape Files");
+    const gchar *all_image_files_filter_name = _("All Images");
+    const gchar *all_vectors_filter_name = _("All Vectors");
+    const gchar *all_bitmaps_filter_name = _("All Bitmaps");
 
     // Calculate the amount of memory required
     int filter_count = 5;       // 5 - one for each filter type
@@ -454,15 +454,15 @@ UINT_PTR CALLBACK FileOpenDialogImplWin32::GetOpenFileName_hookproc(
             pImpl = (FileOpenDialogImplWin32*)ofn->lCustData;
 
             // Subclass the parent
-            pImpl->_base_window_proc = (WNDPROC)GetWindowLongPtr(hParentWnd, GWL_WNDPROC);
-            SetWindowLongPtr(hParentWnd, GWL_WNDPROC, (LONG_PTR)file_dialog_subclass_proc);
+            pImpl->_base_window_proc = (WNDPROC)GetWindowLongPtr(hParentWnd, GWLP_WNDPROC);
+            SetWindowLongPtr(hParentWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(file_dialog_subclass_proc));
 
             // Add a button to the toolbar
             pImpl->_toolbar_wnd = FindWindowEx(hParentWnd, NULL, "ToolbarWindow32", NULL);
 
             pImpl->_show_preview_button_bitmap = LoadBitmap(
                 hInstance, MAKEINTRESOURCE(IDC_SHOW_PREVIEW));
-            TBADDBITMAP tbAddBitmap = {NULL, (UINT)pImpl->_show_preview_button_bitmap};
+            TBADDBITMAP tbAddBitmap = {NULL, reinterpret_cast<UINT_PTR>(pImpl->_show_preview_button_bitmap)};
             const int iBitmapIndex = SendMessage(pImpl->_toolbar_wnd,
                 TB_ADDBITMAP, 1, (LPARAM)&tbAddBitmap);
 
@@ -887,7 +887,7 @@ bool FileOpenDialogImplWin32::set_svg_preview()
 
     gchar *utf8string = g_utf16_to_utf8((const gunichar2*)_path_string,
         _MAX_PATH, NULL, NULL, NULL);
-    Document *svgDoc = sp_document_new (utf8string, true);
+    SPDocument *svgDoc = sp_document_new (utf8string, true);
     g_free(utf8string);
 
     // Check the document loaded properly
@@ -1373,10 +1373,10 @@ void FileOpenDialogImplWin32::render_preview()
     if(_preview_bitmap_image)    // Is the image a pixbuf?
     {
         // Set the transformation
-        const Matrix matrix = {
+        const Cairo::Matrix matrix(
             scaleFactor, 0,
             0, scaleFactor,
-            svgX, svgY };
+            svgX, svgY);
         context->set_matrix (matrix);
 
         // Render the image
@@ -1497,8 +1497,10 @@ FileSaveDialogImplWin32::FileSaveDialogImplWin32(Gtk::Window &parent,
             FileDialogType fileTypes,
             const char *title,
             const Glib::ustring &/*default_key*/,
-            const char *docTitle) :
-    FileDialogBaseWin32(parent, dir, title, fileTypes, "dialogs.save_as"),
+            const char *docTitle,
+            const Inkscape::Extension::FileSaveMethod save_method) :
+    FileDialogBaseWin32(parent, dir, title, fileTypes,
+                        (save_method == Inkscape::Extension::FILE_SAVE_METHOD_SAVE_COPY) ? "dialogs.save_copy" :  "dialogs.save_as"),
         _title_label(NULL),
         _title_edit(NULL)
 {