From 60e308e60a623bd45b7a30aa7f538ee6ed3d42cb Mon Sep 17 00:00:00 2001 From: Dmitriy Shilin Date: Sat, 12 Jan 2019 06:04:39 -0800 Subject: tdf#107792 vcl/win: move scoped_gdi.hxx to vcl/inc/win Change-Id: Id08a98d31673cfa9b701e7efdaefd94d24a93807 Reviewed-on: https://gerrit.libreoffice.org/66214 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- vcl/inc/win/scoped_gdi.hxx | 42 ++++++++++++++++++++++++++++++++++++++++++ vcl/win/gdi/gdiimpl.cxx | 2 +- vcl/win/gdi/scoped_gdi.hxx | 42 ------------------------------------------ vcl/win/gdi/winlayout.cxx | 2 +- 4 files changed, 44 insertions(+), 44 deletions(-) create mode 100644 vcl/inc/win/scoped_gdi.hxx delete mode 100644 vcl/win/gdi/scoped_gdi.hxx (limited to 'vcl') diff --git a/vcl/inc/win/scoped_gdi.hxx b/vcl/inc/win/scoped_gdi.hxx new file mode 100644 index 000000000000..80fbea8b4463 --- /dev/null +++ b/vcl/inc/win/scoped_gdi.hxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#ifndef INCLUDED_VCL_INC_WIN_SCOPED_GDI_HXX +#define INCLUDED_VCL_INC_WIN_SCOPED_GDI_HXX + +#include +#include + +#include + +struct HBRUSHDeleter +{ + using pointer = HBRUSH; + void operator()(HBRUSH hBrush) { DeleteBrush(hBrush); } +}; + +struct HRGNDeleter +{ + using pointer = HRGN; + void operator()(HRGN hRgn) { DeleteRegion(hRgn); } +}; + +struct HDCDeleter +{ + using pointer = HDC; + void operator()(HDC hDC) { DeleteDC(hDC); } +}; + +using ScopedHBRUSH = std::unique_ptr; +using ScopedHRGN = std::unique_ptr; +using ScopedHDC = std::unique_ptr; + +#endif // INCLUDED_VCL_INC_WIN_SCOPED_GDI_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx index 1bb39b84cd2e..ec7682b14899 100644 --- a/vcl/win/gdi/gdiimpl.cxx +++ b/vcl/win/gdi/gdiimpl.cxx @@ -20,7 +20,6 @@ #include #include "gdiimpl.hxx" -#include "scoped_gdi.hxx" #include #include @@ -33,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/vcl/win/gdi/scoped_gdi.hxx b/vcl/win/gdi/scoped_gdi.hxx deleted file mode 100644 index b5a66d9d3698..000000000000 --- a/vcl/win/gdi/scoped_gdi.hxx +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * 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/. - */ - -#ifndef INCLUDED_VCL_WIN_GDI_SCOPED_GDI_HXX -#define INCLUDED_VCL_WIN_GDI_SCOPED_GDI_HXX - -#include -#include - -#include - -struct HBRUSHDeleter -{ - using pointer = HBRUSH; - void operator()(HBRUSH hBrush) { DeleteBrush(hBrush); } -}; - -struct HRGNDeleter -{ - using pointer = HRGN; - void operator()(HRGN hRgn) { DeleteRegion(hRgn); } -}; - -struct HDCDeleter -{ - using pointer = HDC; - void operator()(HDC hDC) { DeleteDC(hDC); } -}; - -using ScopedHBRUSH = std::unique_ptr; -using ScopedHRGN = std::unique_ptr; -using ScopedHDC = std::unique_ptr; - -#endif // INCLUDED_VCL_WIN_GDI_SCOPED_GDI_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index f5e2c025e965..ebaf2f1be2d6 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -35,10 +35,10 @@ #include #include +#include #include #include -#include "scoped_gdi.hxx" #include #include -- cgit