summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extras/source/glade/libreoffice-catalog.xml.in3
-rw-r--r--include/svx/graphctl.hxx1
-rw-r--r--sd/AllLangResTarget_sd.mk1
-rw-r--r--sd/UIConfig_sdraw.mk1
-rw-r--r--sd/inc/helpids.h2
-rw-r--r--sd/source/ui/dlg/vectdlg.cxx114
-rw-r--r--sd/source/ui/dlg/vectdlg.src206
-rw-r--r--sd/source/ui/inc/vectdlg.hrc47
-rw-r--r--sd/source/ui/inc/vectdlg.hxx36
-rw-r--r--sd/uiconfig/sdraw/ui/vectorize.ui383
-rw-r--r--svx/source/dialog/graphctl.cxx29
11 files changed, 486 insertions, 337 deletions
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index 83946db41228..a9c74e6d96b2 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -353,6 +353,9 @@
<glade-widget-class title="Rectangle Control" name="svxlo-SvxRectCtl"
generic-name="Rectangle Control" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
+ <glade-widget-class title="Graph Control" name="svxlo-GraphCtrl"
+ generic-name="Graph Control" parent="GtkDrawingArea"
+ icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="Frame Direction ListBox" name="svxlo-FrameDirectionListBox"
generic-name="FrameDirectionListBox" parent="GtkComboBox"
icon-name="widget-gtk-combobox"/>
diff --git a/include/svx/graphctl.hxx b/include/svx/graphctl.hxx
index 26fca7eb507b..ee183bbb8dd8 100644
--- a/include/svx/graphctl.hxx
+++ b/include/svx/graphctl.hxx
@@ -81,6 +81,7 @@ protected:
public:
GraphCtrl( Window* pParent, const ResId& rResId );
+ GraphCtrl( Window* pParent, WinBits nStyle );
~GraphCtrl();
void SetWinStyle( WinBits nWinBits );
diff --git a/sd/AllLangResTarget_sd.mk b/sd/AllLangResTarget_sd.mk
index 45d874e5efa2..8385a4913428 100644
--- a/sd/AllLangResTarget_sd.mk
+++ b/sd/AllLangResTarget_sd.mk
@@ -49,7 +49,6 @@ $(eval $(call gb_SrsTarget_add_files,sd/res,\
sd/source/ui/dlg/PaneDockingWindow.src \
sd/source/ui/dlg/sdpreslt.src \
sd/source/ui/dlg/tpaction.src \
- sd/source/ui/dlg/vectdlg.src \
sd/source/ui/slideshow/slideshow.src \
sd/source/ui/view/DocumentRenderer.src \
))
diff --git a/sd/UIConfig_sdraw.mk b/sd/UIConfig_sdraw.mk
index 228a4d7173c0..5f8ce2280289 100644
--- a/sd/UIConfig_sdraw.mk
+++ b/sd/UIConfig_sdraw.mk
@@ -81,6 +81,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/sdraw,\
sd/uiconfig/sdraw/ui/paranumberingtab \
sd/uiconfig/sdraw/ui/printeroptions \
sd/uiconfig/sdraw/ui/tabledesigndialog \
+ sd/uiconfig/sdraw/ui/vectorize \
))
# vim: set noet sw=4 ts=4:
diff --git a/sd/inc/helpids.h b/sd/inc/helpids.h
index 1bab9f85ecca..ff670351da46 100644
--- a/sd/inc/helpids.h
+++ b/sd/inc/helpids.h
@@ -155,8 +155,6 @@
#define HID_SD_TABLE_DESIGN "SD_HID_SD_TABLE_DESIGN"
#define HID_SD_ANNOTATIONS "SD_HID_SD_ANNOTATIONS"
-#define HID_VECTORIZE_DLG "SD_HID_VECTORIZE_DLG"
-
#define HID_MN_SUB_GRAPHIC "SD_HID_MN_SUB_GRAPHIC"
#define HID_MN_SUB_FIELD "SD_HID_MN_SUB_FIELD"
#define HID_MN_SUB_TEMPLATES "SD_HID_MN_SUB_TEMPLATES"
diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx
index de8ce7c2a0b0..5abbec90594d 100644
--- a/sd/source/ui/dlg/vectdlg.cxx
+++ b/sd/source/ui/dlg/vectdlg.cxx
@@ -26,49 +26,45 @@
#include "sdmod.hxx"
#include "sdiocmpt.hxx"
#include "vectdlg.hxx"
-#include "vectdlg.hrc"
#include <vcl/bmpacc.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/metaact.hxx>
#define VECTORIZE_MAX_EXTENT 512
-SdVectorizeDlg::SdVectorizeDlg(
- Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell ) :
- ModalDialog ( pParent, SdResId( DLG_VECTORIZE ) ),
- mpDocSh ( pDocShell ),
- aGrpSettings ( this, SdResId( GRP_SETTINGS ) ),
- aFtLayers ( this, SdResId( FT_LAYERS ) ),
- aNmLayers ( this, SdResId( NM_LAYERS ) ),
- aFtReduce ( this, SdResId( FT_REDUCE ) ),
- aMtReduce ( this, SdResId( MT_REDUCE ) ),
- aFtFillHoles ( this, SdResId( FT_FILLHOLES ) ),
- aMtFillHoles ( this, SdResId( MT_FILLHOLES ) ),
- aCbFillHoles ( this, SdResId( CB_FILLHOLES ) ),
- aFtOriginal ( this, SdResId( FT_ORIGINAL ) ),
- aBmpWin ( this, SdResId( CTL_BMP ) ),
- aFtVectorized ( this, SdResId( FT_VECTORIZED ) ),
- aMtfWin ( this, SdResId( CTL_WMF ) ),
- aGrpPrgs ( this, SdResId( GRP_PRGS ) ),
- aPrgs ( this, SdResId( WND_PRGS ) ),
- aBtnOK ( this, SdResId( BTN_OK ) ),
- aBtnCancel ( this, SdResId( BTN_CANCEL ) ),
- aBtnHelp ( this, SdResId( BTN_HELP ) ),
- aBtnPreview ( this, SdResId( BTN_PREVIEW ) ),
- aBmp ( rBmp )
+SdVectorizeDlg::SdVectorizeDlg(Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell)
+ : ModalDialog(pParent, "VectorizeDialog", "modules/sdraw/ui/vectorize.ui")
+ , mpDocSh(pDocShell)
+ , aBmp(rBmp)
{
- FreeResource();
-
- aBtnPreview.SetClickHdl( LINK( this, SdVectorizeDlg, ClickPreviewHdl ) );
- aBtnOK.SetClickHdl( LINK( this, SdVectorizeDlg, ClickOKHdl ) );
- aNmLayers.SetModifyHdl( LINK( this, SdVectorizeDlg, ModifyHdl ) );
- aMtReduce.SetModifyHdl( LINK( this, SdVectorizeDlg, ModifyHdl ) );
- aMtFillHoles.SetModifyHdl( LINK( this, SdVectorizeDlg, ModifyHdl ) );
- aCbFillHoles.SetToggleHdl( LINK( this, SdVectorizeDlg, ToggleHdl ) );
+ get(m_pNmLayers, "colors");
+ get(m_pMtReduce, "points");
+ get(m_pCbFillHoles, "fillholes");
+ get(m_pFtFillHoles, "tilesft");
+ get(m_pMtFillHoles, "tiles");
+ get(m_pBmpWin, "source");
+ get(m_pMtfWin, "vectorized");
+
+ Size aSize(LogicToPixel(Size(92, 100), MAP_APPFONT));
+ m_pBmpWin->set_width_request(aSize.Width());
+ m_pMtfWin->set_width_request(aSize.Width());
+ m_pBmpWin->set_height_request(aSize.Height());
+ m_pMtfWin->set_height_request(aSize.Height());
+
+ get(m_pPrgs, "progressbar");
+ get(m_pBtnPreview, "preview");
+ get(m_pBtnOK, "ok");
+
+ m_pBtnPreview->SetClickHdl( LINK( this, SdVectorizeDlg, ClickPreviewHdl ) );
+ m_pBtnOK->SetClickHdl( LINK( this, SdVectorizeDlg, ClickOKHdl ) );
+ m_pNmLayers->SetModifyHdl( LINK( this, SdVectorizeDlg, ModifyHdl ) );
+ m_pMtReduce->SetModifyHdl( LINK( this, SdVectorizeDlg, ModifyHdl ) );
+ m_pMtFillHoles->SetModifyHdl( LINK( this, SdVectorizeDlg, ModifyHdl ) );
+ m_pCbFillHoles->SetToggleHdl( LINK( this, SdVectorizeDlg, ToggleHdl ) );
// disable 3D border
- aBmpWin.SetBorderStyle(WINDOW_BORDER_MONO);
- aMtfWin.SetBorderStyle(WINDOW_BORDER_MONO);
+ m_pBmpWin->SetBorderStyle(WINDOW_BORDER_MONO);
+ m_pMtfWin->SetBorderStyle(WINDOW_BORDER_MONO);
LoadSettings();
InitPreviewBmp();
@@ -110,11 +106,11 @@ Rectangle SdVectorizeDlg::GetRect( const Size& rDispSize, const Size& rBmpSize )
void SdVectorizeDlg::InitPreviewBmp()
{
- const Rectangle aRect( GetRect( aBmpWin.GetSizePixel(), aBmp.GetSizePixel() ) );
+ const Rectangle aRect( GetRect( m_pBmpWin->GetSizePixel(), aBmp.GetSizePixel() ) );
aPreviewBmp = aBmp;
aPreviewBmp.Scale( aRect.GetSize() );
- aBmpWin.SetGraphic( aPreviewBmp );
+ m_pBmpWin->SetGraphic( aPreviewBmp );
}
Bitmap SdVectorizeDlg::GetPreparedBitmap( Bitmap& rBmp, Fraction& rScale )
@@ -131,7 +127,7 @@ Bitmap SdVectorizeDlg::GetPreparedBitmap( Bitmap& rBmp, Fraction& rScale )
else
rScale = Fraction( 1, 1 );
- aNew.ReduceColors( (sal_uInt16) aNmLayers.GetValue(), BMP_REDUCE_SIMPLE );
+ aNew.ReduceColors( (sal_uInt16) m_pNmLayers->GetValue(), BMP_REDUCE_SIMPLE );
return aNew;
}
@@ -139,7 +135,7 @@ Bitmap SdVectorizeDlg::GetPreparedBitmap( Bitmap& rBmp, Fraction& rScale )
void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf )
{
mpDocSh->SetWaitCursor( sal_True );
- aPrgs.SetValue( 0 );
+ m_pPrgs->SetValue( 0 );
Fraction aScale;
Bitmap aTmp( GetPreparedBitmap( rBmp, aScale ) );
@@ -147,9 +143,9 @@ void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf )
if( !!aTmp )
{
const Link aPrgsHdl( LINK( this, SdVectorizeDlg, ProgressHdl ) );
- aTmp.Vectorize( rMtf, (sal_uInt8) aMtReduce.GetValue(), BMP_VECTORIZE_OUTER | BMP_VECTORIZE_REDUCE_EDGES, &aPrgsHdl );
+ aTmp.Vectorize( rMtf, (sal_uInt8) m_pMtReduce->GetValue(), BMP_VECTORIZE_OUTER | BMP_VECTORIZE_REDUCE_EDGES, &aPrgsHdl );
- if( aCbFillHoles.IsChecked() )
+ if( m_pCbFillHoles->IsChecked() )
{
GDIMetaFile aNewMtf;
BitmapReadAccess* pRAcc = aTmp.AcquireReadAccess();
@@ -158,8 +154,8 @@ void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf )
{
const long nWidth = pRAcc->Width();
const long nHeight = pRAcc->Height();
- const long nTileX = static_cast<long>(aMtFillHoles.GetValue());
- const long nTileY = static_cast<long>(aMtFillHoles.GetValue());
+ const long nTileX = static_cast<long>(m_pMtFillHoles->GetValue());
+ const long nTileY = static_cast<long>(m_pMtFillHoles->GetValue());
const long nCountX = nWidth / nTileX;
const long nCountY = nHeight / nTileY;
const long nRestX = nWidth % nTileX;
@@ -205,7 +201,7 @@ void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf )
}
}
- aPrgs.SetValue( 0 );
+ m_pPrgs->SetValue( 0 );
mpDocSh->SetWaitCursor( sal_False );
}
@@ -251,22 +247,22 @@ void SdVectorizeDlg::AddTile( BitmapReadAccess* pRAcc, GDIMetaFile& rMtf,
IMPL_LINK( SdVectorizeDlg, ProgressHdl, void*, pData )
{
- aPrgs.SetValue( (sal_uInt16)(sal_uLong) pData );
+ m_pPrgs->SetValue( (sal_uInt16)(sal_uLong) pData );
return 0L;
}
IMPL_LINK_NOARG(SdVectorizeDlg, ClickPreviewHdl)
{
Calculate( aBmp, aMtf );
- aMtfWin.SetGraphic( aMtf );
- aBtnPreview.Disable();
+ m_pMtfWin->SetGraphic( aMtf );
+ m_pBtnPreview->Disable();
return 0L;
}
IMPL_LINK_NOARG(SdVectorizeDlg, ClickOKHdl)
{
- if( aBtnPreview.IsEnabled() )
+ if( m_pBtnPreview->IsEnabled() )
Calculate( aBmp, aMtf );
SaveSettings();
@@ -279,13 +275,13 @@ IMPL_LINK( SdVectorizeDlg, ToggleHdl, CheckBox*, pCb )
{
if( pCb->IsChecked() )
{
- aFtFillHoles.Enable();
- aMtFillHoles.Enable();
+ m_pFtFillHoles->Enable();
+ m_pMtFillHoles->Enable();
}
else
{
- aFtFillHoles.Disable();
- aMtFillHoles.Disable();
+ m_pFtFillHoles->Disable();
+ m_pMtFillHoles->Disable();
}
ModifyHdl( NULL );
@@ -295,7 +291,7 @@ IMPL_LINK( SdVectorizeDlg, ToggleHdl, CheckBox*, pCb )
IMPL_LINK_NOARG(SdVectorizeDlg, ModifyHdl)
{
- aBtnPreview.Enable();
+ m_pBtnPreview->Enable();
return 0L;
}
@@ -322,12 +318,12 @@ void SdVectorizeDlg::LoadSettings()
bFillHoles = sal_False;
}
- aNmLayers.SetValue( nLayers );
- aMtReduce.SetValue( nReduce );
- aMtFillHoles.SetValue( nFillHoles );
- aCbFillHoles.Check( bFillHoles );
+ m_pNmLayers->SetValue( nLayers );
+ m_pMtReduce->SetValue( nReduce );
+ m_pMtFillHoles->SetValue( nFillHoles );
+ m_pCbFillHoles->Check( bFillHoles );
- ToggleHdl( &aCbFillHoles );
+ ToggleHdl(m_pCbFillHoles);
}
void SdVectorizeDlg::SaveSettings() const
@@ -339,8 +335,8 @@ void SdVectorizeDlg::SaveSettings() const
if( xOStm.Is() )
{
SdIOCompat aCompat( *xOStm, STREAM_WRITE, 1 );
- *xOStm << (sal_uInt16) aNmLayers.GetValue() << (sal_uInt16) aMtReduce.GetValue();
- *xOStm << (sal_uInt16) aMtFillHoles.GetValue() << aCbFillHoles.IsChecked();
+ *xOStm << (sal_uInt16) m_pNmLayers->GetValue() << (sal_uInt16) m_pMtReduce->GetValue();
+ *xOStm << (sal_uInt16) m_pMtFillHoles->GetValue() << m_pCbFillHoles->IsChecked();
}
}
diff --git a/sd/source/ui/dlg/vectdlg.src b/sd/source/ui/dlg/vectdlg.src
deleted file mode 100644
index f95ea8c8a66f..000000000000
--- a/sd/source/ui/dlg/vectdlg.src
+++ /dev/null
@@ -1,206 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-
-#include "app.hrc"
-#include "vectdlg.hrc"
-#include "helpids.h"
-
-ModalDialog DLG_VECTORIZE
-{
- HelpID = HID_VECTORIZE_DLG;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 200, 237 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
-
- Text [ en-US ] = "Convert to Polygon" ;
-
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 144 , 6 );
- Size = MAP_APPFONT ( 50 , 14 );
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
-
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 144 , 23 );
- Size = MAP_APPFONT ( 50 , 14 );
- TabStop = TRUE ;
- };
-
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 144 , 43 );
- Size = MAP_APPFONT ( 50 , 14 );
- TabStop = TRUE ;
- };
-
- PushButton BTN_PREVIEW
- {
- HelpID = "sd:PushButton:DLG_VECTORIZE:BTN_PREVIEW";
- Pos = MAP_APPFONT ( 144 , 63 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Preview" ;
- };
-
- FixedLine GRP_SETTINGS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 132 , 8 ) ;
- Text [ en-US ] = "Settings" ;
- };
-
- FixedText FT_LAYERS
- {
- Pos = MAP_APPFONT ( 12 , 14 );
- Size = MAP_APPFONT ( 79 , 12 );
- Text [ en-US ] = "Number of colors:";
- };
-
- NumericField NM_LAYERS
- {
- HelpID = "sd:NumericField:DLG_VECTORIZE:NM_LAYERS";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 92 , 14 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 8;
- Maximum = 32 ;
- StrictFormat = TRUE ;
- First = 8;
- Last = 32 ;
- SpinSize = 1 ;
- };
-
- FixedText FT_REDUCE
- {
- Pos = MAP_APPFONT ( 12 , 29 );
- Size = MAP_APPFONT ( 79 , 12 );
- Text [ en-US ] = "Point reduction:";
- };
-
- MetricField MT_REDUCE
- {
- HelpID = "sd:MetricField:DLG_VECTORIZE:MT_REDUCE";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 92 , 29 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0;
- Maximum = 32 ;
- StrictFormat = TRUE ;
- First = 0;
- Last = 32 ;
- SpinSize = 1 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText [ en-US ] = " Pixel" ;
- };
-
- CheckBox CB_FILLHOLES
- {
- HelpID = "sd:CheckBox:DLG_VECTORIZE:CB_FILLHOLES";
- Pos = MAP_APPFONT ( 12 , 44 ) ;
- Size = MAP_APPFONT ( 79 , 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Fill holes:";
- };
-
- FixedText FT_FILLHOLES
- {
- Pos = MAP_APPFONT ( 12 , 59 );
- Size = MAP_APPFONT ( 79 , 12 );
- Text [ en-US ] = "Tile size:";
- };
-
- MetricField MT_FILLHOLES
- {
- HelpID = "sd:MetricField:DLG_VECTORIZE:MT_FILLHOLES";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 92 , 59 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 8;
- Maximum = 128;
- StrictFormat = TRUE ;
- First = 8;
- Last = 128;
- SpinSize = 1;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText [ en-US ] = " Pixel" ;
- };
-
- FixedText FT_ORIGINAL
- {
- Pos = MAP_APPFONT ( 6 , 87 );
- Size = MAP_APPFONT ( 92 , 12 );
- Text [ en-US ] = "Source picture:";
- };
-
- Control CTL_BMP
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6, 98 ) ;
- Size = MAP_APPFONT ( 92, 100 ) ;
- Text [ en-US ] = "Source picture" ;
- };
-
- FixedText FT_VECTORIZED
- {
- Pos = MAP_APPFONT ( 101 , 87 );
- Size = MAP_APPFONT ( 92 , 12 );
- Text [ en-US ] = "Vectorized image:";
- };
-
- Control CTL_WMF
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 101, 98 ) ;
- Size = MAP_APPFONT ( 93, 100 ) ;
- Text [ en-US ] = "Vectorized image" ;
- };
-
- FixedText GRP_PRGS
- {
- Pos = MAP_APPFONT ( 6, 204 );
- Size = MAP_APPFONT( 188, 8 );
- Text [ en-US ] = "Progress";
- };
-
- Window WND_PRGS
- {
- Border = TRUE ;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 6, 215 ) ;
- Size = MAP_APPFONT ( 188, 10 ) ;
- Text [ en-US ] = "Progress" ;
- };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/vectdlg.hrc b/sd/source/ui/inc/vectdlg.hrc
deleted file mode 100644
index 2ea70d2d6083..000000000000
--- a/sd/source/ui/inc/vectdlg.hrc
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#define DLG_VECTORIZE 654
-
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-
-#define BTN_PREVIEW 1
-
-#define GRP_SETTINGS 1
-#define GRP_PRGS 2
-
-#define CTL_BMP 1
-#define CTL_WMF 2
-#define WND_PRGS 3
-
-#define FT_LAYERS 1
-#define FT_REDUCE 3
-#define FT_FILLHOLES 4
-#define FT_ORIGINAL 5
-#define FT_VECTORIZED 6
-
-#define NM_LAYERS 1
-#define MT_REDUCE 3
-#define MT_FILLHOLES 4
-
-#define CB_FILLHOLES 1
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/vectdlg.hxx b/sd/source/ui/inc/vectdlg.hxx
index f05422f2b8c4..3429dfd73cf9 100644
--- a/sd/source/ui/inc/vectdlg.hxx
+++ b/sd/source/ui/inc/vectdlg.hxx
@@ -43,28 +43,20 @@ class DrawDocShell;
class SdVectorizeDlg : public ModalDialog
{
::sd::DrawDocShell * mpDocSh;
- FixedLine aGrpSettings;
- FixedText aFtLayers;
- NumericField aNmLayers;
- FixedText aFtReduce;
- MetricField aMtReduce;
- FixedText aFtFillHoles;
- MetricField aMtFillHoles;
- CheckBox aCbFillHoles;
-
- FixedText aFtOriginal;
- GraphCtrl aBmpWin;
-
- FixedText aFtVectorized;
- GraphCtrl aMtfWin;
-
- FixedText aGrpPrgs;
- ProgressBar aPrgs;
-
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
- PushButton aBtnPreview;
+ NumericField* m_pNmLayers;
+ MetricField* m_pMtReduce;
+ FixedText* m_pFtFillHoles;
+ MetricField* m_pMtFillHoles;
+ CheckBox* m_pCbFillHoles;
+
+ GraphCtrl* m_pBmpWin;
+
+ GraphCtrl* m_pMtfWin;
+
+ ProgressBar* m_pPrgs;
+
+ OKButton* m_pBtnOK;
+ PushButton* m_pBtnPreview;
Bitmap aBmp;
Bitmap aPreviewBmp;
diff --git a/sd/uiconfig/sdraw/ui/vectorize.ui b/sd/uiconfig/sdraw/ui/vectorize.ui
new file mode 100644
index 000000000000..63058aef0cd7
--- /dev/null
+++ b/sd/uiconfig/sdraw/ui/vectorize.ui
@@ -0,0 +1,383 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <!-- interface-requires LibreOffice 1.0 -->
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="lower">8</property>
+ <property name="upper">32</property>
+ <property name="value">8</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="adjustment2">
+ <property name="upper">32</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="adjustment3">
+ <property name="lower">8</property>
+ <property name="upper">128</property>
+ <property name="value">8</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkDialog" id="VectorizeDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Convert to Polygon</property>
+ <property name="window_position">mouse</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Number of colors:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">colors</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="colors">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="invisible_char_set">True</property>
+ <property name="adjustment">adjustment1</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Point reduction:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">points:0px</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="points:0px">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="invisible_char_set">True</property>
+ <property name="adjustment">adjustment2</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="tilesft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">12</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Tile size:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">tiles:0px</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="tiles:0px">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="invisible_char_set">True</property>
+ <property name="adjustment">adjustment3</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="fillholes">
+ <property name="label" translatable="yes">_Fill holes:</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Settings</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="preview">
+ <property name="label">Preview</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Source image:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">tiles:0px</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Vectorized image:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">tiles:0px</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="svxlo-GraphCtrl" id="source:border">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="svxlo-GraphCtrl" id="vectorized:border">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Progress</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">progressbar</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkProgressBar" id="progressbar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">ok</action-widget>
+ <action-widget response="0">cancel</action-widget>
+ <action-widget response="0">preview</action-widget>
+ <action-widget response="0">help</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx
index c4fa12b48667..4fc18b71cbeb 100644
--- a/svx/source/dialog/graphctl.cxx
+++ b/svx/source/dialog/graphctl.cxx
@@ -74,6 +74,35 @@ GraphCtrl::GraphCtrl( Window* pParent, const ResId& rResId ) :
EnableRTL( sal_False );
}
+GraphCtrl::GraphCtrl( Window* pParent, WinBits nStyle ) :
+ Control ( pParent, nStyle ),
+ aMap100 ( MAP_100TH_MM ),
+ nWinStyle ( 0 ),
+ eObjKind ( OBJ_NONE ),
+ nPolyEdit ( 0 ),
+ bEditMode ( sal_False ),
+ bSdrMode ( sal_False ),
+ bAnim ( sal_False ),
+ mpAccContext ( NULL ),
+ pModel ( NULL ),
+ pView ( NULL )
+{
+ pUserCall = new GraphCtrlUserCall( *this );
+ aUpdateTimer.SetTimeout( 500 );
+ aUpdateTimer.SetTimeoutHdl( LINK( this, GraphCtrl, UpdateHdl ) );
+ aUpdateTimer.Start();
+ EnableRTL( sal_False );
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeGraphCtrl(Window *pParent, VclBuilder::stringmap &rMap)
+{
+ WinBits nWinStyle = 0;
+ OString sBorder = VclBuilder::extractCustomProperty(rMap);
+ if (!sBorder.isEmpty())
+ nWinStyle |= WB_BORDER;
+ return new GraphCtrl(pParent, nWinStyle);
+}
+
GraphCtrl::~GraphCtrl()
{
if( mpAccContext )