Files
libreoffice/vcl/source/window/syswin.cxx

1039 lines
32 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes (at least) relevant parts of: linecap: Reintegrating finished LineCap feature Patch contributed by Regina Henschel http://svn.apache.org/viewvc?view=revision&revision=1232507 Patches contributed by Sven Jacobi impress212: #i81610# fixed animation export http://svn.apache.org/viewvc?view=revision&revision=1167620 impress212: drawinglayer gbuild environment changes http://svn.apache.org/viewvc?view=revision&revision=1167627 http://svn.apache.org/viewvc?view=revision&revision=1167628 impress212: DffPropSet -> minor code improvements, removing table http://svn.apache.org/viewvc?view=revision&revision=1167634 impress212: #158494# fixed excel import (text rotation) http://svn.apache.org/viewvc?view=revision&revision=1167638 Patches contributed by Armin Le Grand Svg: Reintegrated Svg replacement from /branches/alg/svgreplavement http://svn.apache.org/viewvc?view=revision&revision=1220836 #118728# changed indentifying definitions for Svg file detection http://svn.apache.org/viewvc?view=revision&revision=1229961 #118838# LineGeometry creation for complicated cases optimized to create single Polygons http://svn.apache.org/viewvc?view=revision&revision=1236232 #119176# corrected file type detection for SVG for svg files without xml header http://svn.apache.org/viewvc?view=revision&revision=1309445 #118728# Extended Svg file detection http://svn.apache.org/viewvc?view=revision&revision=1230531 #118529# solve break converters and convert commands for OLEs and images http://svn.apache.org/viewvc?view=revision&revision=1186168 svg: added WaE changes from branch svgreplacement to trunc http://svn.apache.org/viewvc?view=revision&revision=1222974 svg: corrected missing member initialization http://svn.apache.org/viewvc?view=revision&revision=1226134 fix for #118525#: Using primitives for chart sub-geometry visualisation http://svn.apache.org/viewvc?view=revision&revision=1226879 #118898# Adapted ImpGraphic::ImplGetBitmap to correctly convert metafiles to bitmapEx ... http://svn.apache.org/viewvc?view=revision&revision=1293316 fix for #118525#: removed no longer used variable maOriginalMapMode, one more exception eliminated http://svn.apache.org/viewvc?view=revision&revision=1227097 #16758# Added buffering to the VDev usages of the VclProcessor2D derivates... http://svn.apache.org/viewvc?view=revision&revision=1229521 #116758# Secured VDev buffer device to Vcl deinit http://svn.apache.org/viewvc?view=revision&revision=1230574 #116758# added remembering allocated VDevs for VDevBuffer to be able to also delete these when vcl goes down; it should never happen, but You never know http://svn.apache.org/viewvc?view=revision&revision=1230927 #118730# Changed SvgClipPathNode to use MaskPrimitive2D for primitive representation instead of TransparencePrimitive2D http://svn.apache.org/viewvc?view=revision&revision=1231198 #118822# secured 3D geometry creation (slices) by subdividing the 2D source polyPolygon early http://svn.apache.org/viewvc?view=revision&revision=1234749 #118829# enhanced Svg gradient quality, obstacles avoided http://svn.apache.org/viewvc?view=revision&revision=1235361 #118834# Unified usage of TextBreakupHelper as single tooling class for i18n text primitive breakup http://svn.apache.org/viewvc?view=revision&revision=1236110 #118853# added square pixel size limit to conversion of TransparencePrimitive2D to Metafile action http://svn.apache.org/viewvc?view=revision&revision=1237656 #118824# coreccted mirroring and boundrect when the graphicmanager is used for bitmap output http://svn.apache.org/viewvc?view=revision&revision=1240097 #115092# Corrected VclProcessor2D::RenderPolygonStrokePrimitive2D for various optimization scenarios http://svn.apache.org/viewvc?view=revision&revision=1241434 #118783# Corrected errors in ID strings, corrected Svg line/fill export, corrected polygon close state http://svn.apache.org/viewvc?view=revision&revision=1232006 #118796# corrected null-pointer usage in SVG text exporter http://svn.apache.org/viewvc?view=revision&revision=1240262 #118729# Use GraphicStreamUrl and GraphicUrl to allow multi image import with linked graphics, too http://svn.apache.org/viewvc?view=revision&revision=1229962 #118898# corrected error in GDIMetaFile::GetBoundRect in handling MetaFloatTransparentAction http://svn.apache.org/viewvc?view=revision&revision=1293349 #118855# Corrected handling of possibly created empty clipRegions after PolyPolygon clipping http://svn.apache.org/viewvc?view=revision&revision=1237725 #115962# Better (but not yet optimal, see comments in task) handling of MetaFloatTransparentAction in PDF export http://svn.apache.org/viewvc?view=revision&revision=1241078 IP clearance: #118466# This patch removes librsvg, libcroco, libgsf, ... http://svn.apache.org/viewvc?view=revision&revision=1200879 118779# Added svg content streaming in/out to ImpGraphic stream operators http://svn.apache.org/viewvc?view=revision&revision=1231908 linecap: correctons for WaE and mac drawing http://svn.apache.org/viewvc?view=revision&revision=1232793 svg: uses current system Dpi for Svg replacement image creation http://svn.apache.org/viewvc?view=revision&revision=1233948 Patches contributed by Mathias Bauer (and others) gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394326 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1397315 http://svn.apache.org/viewvc?view=revision&revision=1394326 Remove duplicate header includes. cws mba34issues01: #i117720#: convert assertion into warning http://svn.apache.org/viewvc?view=revision&revision=1172352 118485 - Styles for OLEs are not saved. Submitted by Armin Le Grand. http://svn.apache.org/viewvc?view=revision&revision=1182166 cws mba34issues01: #i117714#: remove assertion http://svn.apache.org/viewvc?view=revision&revision=1172357 Patch contributed by Jurgen Schmidt add some additional checks to ensure proper reading operations http://svn.apache.org/viewvc?view=revision&revision=1209022 mostly prefer our stream / bounds checking work. Patches contributed by Herbert Duerr #i118816# add clarifying comment regarding Font::*Color*() methods http://svn.apache.org/viewvc?view=revision&revision=1233833 extend macro->string handling for empty strings http://svn.apache.org/viewvc?view=revision&revision=1175801 avoid magic constants for SALCOLOR_NONE http://svn.apache.org/viewvc?view=revision&revision=1177543 initialize slant properly in ImplFontMetricData constructor (author=iorsh) http://svn.apache.org/viewvc?view=revision&revision=1177551 #i118675# make check for extension updates more stable http://svn.apache.org/viewvc?view=revision&revision=1214797 #a118617# remove VBasicEventListener.dll binary There are no known users depending on its CLSID http://svn.apache.org/viewvc?view=revision&revision=1203697 Patches contributed by Ariel Constenla-Haile Fix build breaker on Linux/gcc http://svn.apache.org/viewvc?view=revision&revision=1221104 Fix crash when trying to instantiate css.graphic.GraphicRasterizer_RSVG http://svn.apache.org/viewvc?view=revision&revision=1215559 Patches contributed by Oliver-Rainer Wittmann sw34bf06: #i117962# - method <SwFlyFrm::IsPaint(..)> - consider instances of <SwFlyDrawObj> http://svn.apache.org/viewvc?view=revision&revision=1172120 sw34bf06: #i117783# - Writer's implementation of XPagePrintable - apply print settings to new printing routines http://svn.apache.org/viewvc?view=revision&revision=1172115 gnumake4 work variously from Hans-Joachim Lankenau http://svn.apache.org/viewvc?view=revision&revision=1397315 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1396782 http://svn.apache.org/viewvc?view=revision&revision=1394707 plus some amount of re-splitting of legacy headers. Patch contributed by Pavel Janik WaE: Remove unused variables. http://svn.apache.org/viewvc?view=revision&revision=1230697 Patches contributed by Takashi Ono mingwport35: i#117795: MinGW port fix for vcl2gnumake http://svn.apache.org/viewvc?view=revision&revision=1172091 mingwport35: i#117795: MinGW port fix for vcl2gnumake http://svn.apache.org/viewvc?view=revision&revision=1172091 Patch contributed by Christian Lippka impress212: #i98044# re enable Text menu for outline and title shapes http://svn.apache.org/viewvc?view=revision&revision=1167639 Patch contributed by Andre Fischer 118674: Made category B code optional and disabled by default. http://svn.apache.org/viewvc?view=revision&revision=1215131 118881: Ignore empty paragraphs after bullets. http://svn.apache.org/viewvc?view=revision&revision=1296205 Patches contributed by Philipp Lohmann ooo340fixes: #i117780# use rtl allocator http://svn.apache.org/viewvc?view=revision&revision=1172087 ooo34gsl02: #i117807# fix an off by one error (index actually inside the pfb section header) http://svn.apache.org/viewvc?view=revision&revision=1167576 various cleanups, related compilation fixes, warning cleanups, re-working of obsolete stl template pieces to use boost instead, changed string classes, re-adapt KDE about data, about dialog, fixing warnings, and other fixes & improvements. Disable svg import / render for about/ branding code-paths for now. Restore full icon theme set. Remove OS/2 conditionals and sources. Remove conflicting gtk/full-screen monitors support. Retain existing svg rasterizer files - temporarily disabled. Standardize stringificaiton and fixup dllpostfix issues. Rename SvgGradientHelper::== to equalTo to avoid overloading issues. Use the flat GdiPlus API for LineCaps calls.
2012-10-09 12:22:23 +01:00
/*
* This file is part of the LibreOffice project.
2000-09-18 16:07:07 +00:00
*
re-base on ALv2 code. Includes (at least) relevant parts of: linecap: Reintegrating finished LineCap feature Patch contributed by Regina Henschel http://svn.apache.org/viewvc?view=revision&revision=1232507 Patches contributed by Sven Jacobi impress212: #i81610# fixed animation export http://svn.apache.org/viewvc?view=revision&revision=1167620 impress212: drawinglayer gbuild environment changes http://svn.apache.org/viewvc?view=revision&revision=1167627 http://svn.apache.org/viewvc?view=revision&revision=1167628 impress212: DffPropSet -> minor code improvements, removing table http://svn.apache.org/viewvc?view=revision&revision=1167634 impress212: #158494# fixed excel import (text rotation) http://svn.apache.org/viewvc?view=revision&revision=1167638 Patches contributed by Armin Le Grand Svg: Reintegrated Svg replacement from /branches/alg/svgreplavement http://svn.apache.org/viewvc?view=revision&revision=1220836 #118728# changed indentifying definitions for Svg file detection http://svn.apache.org/viewvc?view=revision&revision=1229961 #118838# LineGeometry creation for complicated cases optimized to create single Polygons http://svn.apache.org/viewvc?view=revision&revision=1236232 #119176# corrected file type detection for SVG for svg files without xml header http://svn.apache.org/viewvc?view=revision&revision=1309445 #118728# Extended Svg file detection http://svn.apache.org/viewvc?view=revision&revision=1230531 #118529# solve break converters and convert commands for OLEs and images http://svn.apache.org/viewvc?view=revision&revision=1186168 svg: added WaE changes from branch svgreplacement to trunc http://svn.apache.org/viewvc?view=revision&revision=1222974 svg: corrected missing member initialization http://svn.apache.org/viewvc?view=revision&revision=1226134 fix for #118525#: Using primitives for chart sub-geometry visualisation http://svn.apache.org/viewvc?view=revision&revision=1226879 #118898# Adapted ImpGraphic::ImplGetBitmap to correctly convert metafiles to bitmapEx ... http://svn.apache.org/viewvc?view=revision&revision=1293316 fix for #118525#: removed no longer used variable maOriginalMapMode, one more exception eliminated http://svn.apache.org/viewvc?view=revision&revision=1227097 #16758# Added buffering to the VDev usages of the VclProcessor2D derivates... http://svn.apache.org/viewvc?view=revision&revision=1229521 #116758# Secured VDev buffer device to Vcl deinit http://svn.apache.org/viewvc?view=revision&revision=1230574 #116758# added remembering allocated VDevs for VDevBuffer to be able to also delete these when vcl goes down; it should never happen, but You never know http://svn.apache.org/viewvc?view=revision&revision=1230927 #118730# Changed SvgClipPathNode to use MaskPrimitive2D for primitive representation instead of TransparencePrimitive2D http://svn.apache.org/viewvc?view=revision&revision=1231198 #118822# secured 3D geometry creation (slices) by subdividing the 2D source polyPolygon early http://svn.apache.org/viewvc?view=revision&revision=1234749 #118829# enhanced Svg gradient quality, obstacles avoided http://svn.apache.org/viewvc?view=revision&revision=1235361 #118834# Unified usage of TextBreakupHelper as single tooling class for i18n text primitive breakup http://svn.apache.org/viewvc?view=revision&revision=1236110 #118853# added square pixel size limit to conversion of TransparencePrimitive2D to Metafile action http://svn.apache.org/viewvc?view=revision&revision=1237656 #118824# coreccted mirroring and boundrect when the graphicmanager is used for bitmap output http://svn.apache.org/viewvc?view=revision&revision=1240097 #115092# Corrected VclProcessor2D::RenderPolygonStrokePrimitive2D for various optimization scenarios http://svn.apache.org/viewvc?view=revision&revision=1241434 #118783# Corrected errors in ID strings, corrected Svg line/fill export, corrected polygon close state http://svn.apache.org/viewvc?view=revision&revision=1232006 #118796# corrected null-pointer usage in SVG text exporter http://svn.apache.org/viewvc?view=revision&revision=1240262 #118729# Use GraphicStreamUrl and GraphicUrl to allow multi image import with linked graphics, too http://svn.apache.org/viewvc?view=revision&revision=1229962 #118898# corrected error in GDIMetaFile::GetBoundRect in handling MetaFloatTransparentAction http://svn.apache.org/viewvc?view=revision&revision=1293349 #118855# Corrected handling of possibly created empty clipRegions after PolyPolygon clipping http://svn.apache.org/viewvc?view=revision&revision=1237725 #115962# Better (but not yet optimal, see comments in task) handling of MetaFloatTransparentAction in PDF export http://svn.apache.org/viewvc?view=revision&revision=1241078 IP clearance: #118466# This patch removes librsvg, libcroco, libgsf, ... http://svn.apache.org/viewvc?view=revision&revision=1200879 118779# Added svg content streaming in/out to ImpGraphic stream operators http://svn.apache.org/viewvc?view=revision&revision=1231908 linecap: correctons for WaE and mac drawing http://svn.apache.org/viewvc?view=revision&revision=1232793 svg: uses current system Dpi for Svg replacement image creation http://svn.apache.org/viewvc?view=revision&revision=1233948 Patches contributed by Mathias Bauer (and others) gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394326 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1397315 http://svn.apache.org/viewvc?view=revision&revision=1394326 Remove duplicate header includes. cws mba34issues01: #i117720#: convert assertion into warning http://svn.apache.org/viewvc?view=revision&revision=1172352 118485 - Styles for OLEs are not saved. Submitted by Armin Le Grand. http://svn.apache.org/viewvc?view=revision&revision=1182166 cws mba34issues01: #i117714#: remove assertion http://svn.apache.org/viewvc?view=revision&revision=1172357 Patch contributed by Jurgen Schmidt add some additional checks to ensure proper reading operations http://svn.apache.org/viewvc?view=revision&revision=1209022 mostly prefer our stream / bounds checking work. Patches contributed by Herbert Duerr #i118816# add clarifying comment regarding Font::*Color*() methods http://svn.apache.org/viewvc?view=revision&revision=1233833 extend macro->string handling for empty strings http://svn.apache.org/viewvc?view=revision&revision=1175801 avoid magic constants for SALCOLOR_NONE http://svn.apache.org/viewvc?view=revision&revision=1177543 initialize slant properly in ImplFontMetricData constructor (author=iorsh) http://svn.apache.org/viewvc?view=revision&revision=1177551 #i118675# make check for extension updates more stable http://svn.apache.org/viewvc?view=revision&revision=1214797 #a118617# remove VBasicEventListener.dll binary There are no known users depending on its CLSID http://svn.apache.org/viewvc?view=revision&revision=1203697 Patches contributed by Ariel Constenla-Haile Fix build breaker on Linux/gcc http://svn.apache.org/viewvc?view=revision&revision=1221104 Fix crash when trying to instantiate css.graphic.GraphicRasterizer_RSVG http://svn.apache.org/viewvc?view=revision&revision=1215559 Patches contributed by Oliver-Rainer Wittmann sw34bf06: #i117962# - method <SwFlyFrm::IsPaint(..)> - consider instances of <SwFlyDrawObj> http://svn.apache.org/viewvc?view=revision&revision=1172120 sw34bf06: #i117783# - Writer's implementation of XPagePrintable - apply print settings to new printing routines http://svn.apache.org/viewvc?view=revision&revision=1172115 gnumake4 work variously from Hans-Joachim Lankenau http://svn.apache.org/viewvc?view=revision&revision=1397315 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1396782 http://svn.apache.org/viewvc?view=revision&revision=1394707 plus some amount of re-splitting of legacy headers. Patch contributed by Pavel Janik WaE: Remove unused variables. http://svn.apache.org/viewvc?view=revision&revision=1230697 Patches contributed by Takashi Ono mingwport35: i#117795: MinGW port fix for vcl2gnumake http://svn.apache.org/viewvc?view=revision&revision=1172091 mingwport35: i#117795: MinGW port fix for vcl2gnumake http://svn.apache.org/viewvc?view=revision&revision=1172091 Patch contributed by Christian Lippka impress212: #i98044# re enable Text menu for outline and title shapes http://svn.apache.org/viewvc?view=revision&revision=1167639 Patch contributed by Andre Fischer 118674: Made category B code optional and disabled by default. http://svn.apache.org/viewvc?view=revision&revision=1215131 118881: Ignore empty paragraphs after bullets. http://svn.apache.org/viewvc?view=revision&revision=1296205 Patches contributed by Philipp Lohmann ooo340fixes: #i117780# use rtl allocator http://svn.apache.org/viewvc?view=revision&revision=1172087 ooo34gsl02: #i117807# fix an off by one error (index actually inside the pfb section header) http://svn.apache.org/viewvc?view=revision&revision=1167576 various cleanups, related compilation fixes, warning cleanups, re-working of obsolete stl template pieces to use boost instead, changed string classes, re-adapt KDE about data, about dialog, fixing warnings, and other fixes & improvements. Disable svg import / render for about/ branding code-paths for now. Restore full icon theme set. Remove OS/2 conditionals and sources. Remove conflicting gtk/full-screen monitors support. Retain existing svg rasterizer files - temporarily disabled. Standardize stringificaiton and fixup dllpostfix issues. Rename SvgGradientHelper::== to equalTo to avoid overloading issues. Use the flat GdiPlus API for LineCaps calls.
2012-10-09 12:22:23 +01:00
* 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/.
2000-09-18 16:07:07 +00:00
*
re-base on ALv2 code. Includes (at least) relevant parts of: linecap: Reintegrating finished LineCap feature Patch contributed by Regina Henschel http://svn.apache.org/viewvc?view=revision&revision=1232507 Patches contributed by Sven Jacobi impress212: #i81610# fixed animation export http://svn.apache.org/viewvc?view=revision&revision=1167620 impress212: drawinglayer gbuild environment changes http://svn.apache.org/viewvc?view=revision&revision=1167627 http://svn.apache.org/viewvc?view=revision&revision=1167628 impress212: DffPropSet -> minor code improvements, removing table http://svn.apache.org/viewvc?view=revision&revision=1167634 impress212: #158494# fixed excel import (text rotation) http://svn.apache.org/viewvc?view=revision&revision=1167638 Patches contributed by Armin Le Grand Svg: Reintegrated Svg replacement from /branches/alg/svgreplavement http://svn.apache.org/viewvc?view=revision&revision=1220836 #118728# changed indentifying definitions for Svg file detection http://svn.apache.org/viewvc?view=revision&revision=1229961 #118838# LineGeometry creation for complicated cases optimized to create single Polygons http://svn.apache.org/viewvc?view=revision&revision=1236232 #119176# corrected file type detection for SVG for svg files without xml header http://svn.apache.org/viewvc?view=revision&revision=1309445 #118728# Extended Svg file detection http://svn.apache.org/viewvc?view=revision&revision=1230531 #118529# solve break converters and convert commands for OLEs and images http://svn.apache.org/viewvc?view=revision&revision=1186168 svg: added WaE changes from branch svgreplacement to trunc http://svn.apache.org/viewvc?view=revision&revision=1222974 svg: corrected missing member initialization http://svn.apache.org/viewvc?view=revision&revision=1226134 fix for #118525#: Using primitives for chart sub-geometry visualisation http://svn.apache.org/viewvc?view=revision&revision=1226879 #118898# Adapted ImpGraphic::ImplGetBitmap to correctly convert metafiles to bitmapEx ... http://svn.apache.org/viewvc?view=revision&revision=1293316 fix for #118525#: removed no longer used variable maOriginalMapMode, one more exception eliminated http://svn.apache.org/viewvc?view=revision&revision=1227097 #16758# Added buffering to the VDev usages of the VclProcessor2D derivates... http://svn.apache.org/viewvc?view=revision&revision=1229521 #116758# Secured VDev buffer device to Vcl deinit http://svn.apache.org/viewvc?view=revision&revision=1230574 #116758# added remembering allocated VDevs for VDevBuffer to be able to also delete these when vcl goes down; it should never happen, but You never know http://svn.apache.org/viewvc?view=revision&revision=1230927 #118730# Changed SvgClipPathNode to use MaskPrimitive2D for primitive representation instead of TransparencePrimitive2D http://svn.apache.org/viewvc?view=revision&revision=1231198 #118822# secured 3D geometry creation (slices) by subdividing the 2D source polyPolygon early http://svn.apache.org/viewvc?view=revision&revision=1234749 #118829# enhanced Svg gradient quality, obstacles avoided http://svn.apache.org/viewvc?view=revision&revision=1235361 #118834# Unified usage of TextBreakupHelper as single tooling class for i18n text primitive breakup http://svn.apache.org/viewvc?view=revision&revision=1236110 #118853# added square pixel size limit to conversion of TransparencePrimitive2D to Metafile action http://svn.apache.org/viewvc?view=revision&revision=1237656 #118824# coreccted mirroring and boundrect when the graphicmanager is used for bitmap output http://svn.apache.org/viewvc?view=revision&revision=1240097 #115092# Corrected VclProcessor2D::RenderPolygonStrokePrimitive2D for various optimization scenarios http://svn.apache.org/viewvc?view=revision&revision=1241434 #118783# Corrected errors in ID strings, corrected Svg line/fill export, corrected polygon close state http://svn.apache.org/viewvc?view=revision&revision=1232006 #118796# corrected null-pointer usage in SVG text exporter http://svn.apache.org/viewvc?view=revision&revision=1240262 #118729# Use GraphicStreamUrl and GraphicUrl to allow multi image import with linked graphics, too http://svn.apache.org/viewvc?view=revision&revision=1229962 #118898# corrected error in GDIMetaFile::GetBoundRect in handling MetaFloatTransparentAction http://svn.apache.org/viewvc?view=revision&revision=1293349 #118855# Corrected handling of possibly created empty clipRegions after PolyPolygon clipping http://svn.apache.org/viewvc?view=revision&revision=1237725 #115962# Better (but not yet optimal, see comments in task) handling of MetaFloatTransparentAction in PDF export http://svn.apache.org/viewvc?view=revision&revision=1241078 IP clearance: #118466# This patch removes librsvg, libcroco, libgsf, ... http://svn.apache.org/viewvc?view=revision&revision=1200879 118779# Added svg content streaming in/out to ImpGraphic stream operators http://svn.apache.org/viewvc?view=revision&revision=1231908 linecap: correctons for WaE and mac drawing http://svn.apache.org/viewvc?view=revision&revision=1232793 svg: uses current system Dpi for Svg replacement image creation http://svn.apache.org/viewvc?view=revision&revision=1233948 Patches contributed by Mathias Bauer (and others) gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394326 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1397315 http://svn.apache.org/viewvc?view=revision&revision=1394326 Remove duplicate header includes. cws mba34issues01: #i117720#: convert assertion into warning http://svn.apache.org/viewvc?view=revision&revision=1172352 118485 - Styles for OLEs are not saved. Submitted by Armin Le Grand. http://svn.apache.org/viewvc?view=revision&revision=1182166 cws mba34issues01: #i117714#: remove assertion http://svn.apache.org/viewvc?view=revision&revision=1172357 Patch contributed by Jurgen Schmidt add some additional checks to ensure proper reading operations http://svn.apache.org/viewvc?view=revision&revision=1209022 mostly prefer our stream / bounds checking work. Patches contributed by Herbert Duerr #i118816# add clarifying comment regarding Font::*Color*() methods http://svn.apache.org/viewvc?view=revision&revision=1233833 extend macro->string handling for empty strings http://svn.apache.org/viewvc?view=revision&revision=1175801 avoid magic constants for SALCOLOR_NONE http://svn.apache.org/viewvc?view=revision&revision=1177543 initialize slant properly in ImplFontMetricData constructor (author=iorsh) http://svn.apache.org/viewvc?view=revision&revision=1177551 #i118675# make check for extension updates more stable http://svn.apache.org/viewvc?view=revision&revision=1214797 #a118617# remove VBasicEventListener.dll binary There are no known users depending on its CLSID http://svn.apache.org/viewvc?view=revision&revision=1203697 Patches contributed by Ariel Constenla-Haile Fix build breaker on Linux/gcc http://svn.apache.org/viewvc?view=revision&revision=1221104 Fix crash when trying to instantiate css.graphic.GraphicRasterizer_RSVG http://svn.apache.org/viewvc?view=revision&revision=1215559 Patches contributed by Oliver-Rainer Wittmann sw34bf06: #i117962# - method <SwFlyFrm::IsPaint(..)> - consider instances of <SwFlyDrawObj> http://svn.apache.org/viewvc?view=revision&revision=1172120 sw34bf06: #i117783# - Writer's implementation of XPagePrintable - apply print settings to new printing routines http://svn.apache.org/viewvc?view=revision&revision=1172115 gnumake4 work variously from Hans-Joachim Lankenau http://svn.apache.org/viewvc?view=revision&revision=1397315 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1396782 http://svn.apache.org/viewvc?view=revision&revision=1394707 plus some amount of re-splitting of legacy headers. Patch contributed by Pavel Janik WaE: Remove unused variables. http://svn.apache.org/viewvc?view=revision&revision=1230697 Patches contributed by Takashi Ono mingwport35: i#117795: MinGW port fix for vcl2gnumake http://svn.apache.org/viewvc?view=revision&revision=1172091 mingwport35: i#117795: MinGW port fix for vcl2gnumake http://svn.apache.org/viewvc?view=revision&revision=1172091 Patch contributed by Christian Lippka impress212: #i98044# re enable Text menu for outline and title shapes http://svn.apache.org/viewvc?view=revision&revision=1167639 Patch contributed by Andre Fischer 118674: Made category B code optional and disabled by default. http://svn.apache.org/viewvc?view=revision&revision=1215131 118881: Ignore empty paragraphs after bullets. http://svn.apache.org/viewvc?view=revision&revision=1296205 Patches contributed by Philipp Lohmann ooo340fixes: #i117780# use rtl allocator http://svn.apache.org/viewvc?view=revision&revision=1172087 ooo34gsl02: #i117807# fix an off by one error (index actually inside the pfb section header) http://svn.apache.org/viewvc?view=revision&revision=1167576 various cleanups, related compilation fixes, warning cleanups, re-working of obsolete stl template pieces to use boost instead, changed string classes, re-adapt KDE about data, about dialog, fixing warnings, and other fixes & improvements. Disable svg import / render for about/ branding code-paths for now. Restore full icon theme set. Remove OS/2 conditionals and sources. Remove conflicting gtk/full-screen monitors support. Retain existing svg rasterizer files - temporarily disabled. Standardize stringificaiton and fixup dllpostfix issues. Rename SvgGradientHelper::== to equalTo to avoid overloading issues. Use the flat GdiPlus API for LineCaps calls.
2012-10-09 12:22:23 +01:00
* This file incorporates work covered by the following license notice:
2000-09-18 16:07:07 +00:00
*
re-base on ALv2 code. Includes (at least) relevant parts of: linecap: Reintegrating finished LineCap feature Patch contributed by Regina Henschel http://svn.apache.org/viewvc?view=revision&revision=1232507 Patches contributed by Sven Jacobi impress212: #i81610# fixed animation export http://svn.apache.org/viewvc?view=revision&revision=1167620 impress212: drawinglayer gbuild environment changes http://svn.apache.org/viewvc?view=revision&revision=1167627 http://svn.apache.org/viewvc?view=revision&revision=1167628 impress212: DffPropSet -> minor code improvements, removing table http://svn.apache.org/viewvc?view=revision&revision=1167634 impress212: #158494# fixed excel import (text rotation) http://svn.apache.org/viewvc?view=revision&revision=1167638 Patches contributed by Armin Le Grand Svg: Reintegrated Svg replacement from /branches/alg/svgreplavement http://svn.apache.org/viewvc?view=revision&revision=1220836 #118728# changed indentifying definitions for Svg file detection http://svn.apache.org/viewvc?view=revision&revision=1229961 #118838# LineGeometry creation for complicated cases optimized to create single Polygons http://svn.apache.org/viewvc?view=revision&revision=1236232 #119176# corrected file type detection for SVG for svg files without xml header http://svn.apache.org/viewvc?view=revision&revision=1309445 #118728# Extended Svg file detection http://svn.apache.org/viewvc?view=revision&revision=1230531 #118529# solve break converters and convert commands for OLEs and images http://svn.apache.org/viewvc?view=revision&revision=1186168 svg: added WaE changes from branch svgreplacement to trunc http://svn.apache.org/viewvc?view=revision&revision=1222974 svg: corrected missing member initialization http://svn.apache.org/viewvc?view=revision&revision=1226134 fix for #118525#: Using primitives for chart sub-geometry visualisation http://svn.apache.org/viewvc?view=revision&revision=1226879 #118898# Adapted ImpGraphic::ImplGetBitmap to correctly convert metafiles to bitmapEx ... http://svn.apache.org/viewvc?view=revision&revision=1293316 fix for #118525#: removed no longer used variable maOriginalMapMode, one more exception eliminated http://svn.apache.org/viewvc?view=revision&revision=1227097 #16758# Added buffering to the VDev usages of the VclProcessor2D derivates... http://svn.apache.org/viewvc?view=revision&revision=1229521 #116758# Secured VDev buffer device to Vcl deinit http://svn.apache.org/viewvc?view=revision&revision=1230574 #116758# added remembering allocated VDevs for VDevBuffer to be able to also delete these when vcl goes down; it should never happen, but You never know http://svn.apache.org/viewvc?view=revision&revision=1230927 #118730# Changed SvgClipPathNode to use MaskPrimitive2D for primitive representation instead of TransparencePrimitive2D http://svn.apache.org/viewvc?view=revision&revision=1231198 #118822# secured 3D geometry creation (slices) by subdividing the 2D source polyPolygon early http://svn.apache.org/viewvc?view=revision&revision=1234749 #118829# enhanced Svg gradient quality, obstacles avoided http://svn.apache.org/viewvc?view=revision&revision=1235361 #118834# Unified usage of TextBreakupHelper as single tooling class for i18n text primitive breakup http://svn.apache.org/viewvc?view=revision&revision=1236110 #118853# added square pixel size limit to conversion of TransparencePrimitive2D to Metafile action http://svn.apache.org/viewvc?view=revision&revision=1237656 #118824# coreccted mirroring and boundrect when the graphicmanager is used for bitmap output http://svn.apache.org/viewvc?view=revision&revision=1240097 #115092# Corrected VclProcessor2D::RenderPolygonStrokePrimitive2D for various optimization scenarios http://svn.apache.org/viewvc?view=revision&revision=1241434 #118783# Corrected errors in ID strings, corrected Svg line/fill export, corrected polygon close state http://svn.apache.org/viewvc?view=revision&revision=1232006 #118796# corrected null-pointer usage in SVG text exporter http://svn.apache.org/viewvc?view=revision&revision=1240262 #118729# Use GraphicStreamUrl and GraphicUrl to allow multi image import with linked graphics, too http://svn.apache.org/viewvc?view=revision&revision=1229962 #118898# corrected error in GDIMetaFile::GetBoundRect in handling MetaFloatTransparentAction http://svn.apache.org/viewvc?view=revision&revision=1293349 #118855# Corrected handling of possibly created empty clipRegions after PolyPolygon clipping http://svn.apache.org/viewvc?view=revision&revision=1237725 #115962# Better (but not yet optimal, see comments in task) handling of MetaFloatTransparentAction in PDF export http://svn.apache.org/viewvc?view=revision&revision=1241078 IP clearance: #118466# This patch removes librsvg, libcroco, libgsf, ... http://svn.apache.org/viewvc?view=revision&revision=1200879 118779# Added svg content streaming in/out to ImpGraphic stream operators http://svn.apache.org/viewvc?view=revision&revision=1231908 linecap: correctons for WaE and mac drawing http://svn.apache.org/viewvc?view=revision&revision=1232793 svg: uses current system Dpi for Svg replacement image creation http://svn.apache.org/viewvc?view=revision&revision=1233948 Patches contributed by Mathias Bauer (and others) gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394326 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1397315 http://svn.apache.org/viewvc?view=revision&revision=1394326 Remove duplicate header includes. cws mba34issues01: #i117720#: convert assertion into warning http://svn.apache.org/viewvc?view=revision&revision=1172352 118485 - Styles for OLEs are not saved. Submitted by Armin Le Grand. http://svn.apache.org/viewvc?view=revision&revision=1182166 cws mba34issues01: #i117714#: remove assertion http://svn.apache.org/viewvc?view=revision&revision=1172357 Patch contributed by Jurgen Schmidt add some additional checks to ensure proper reading operations http://svn.apache.org/viewvc?view=revision&revision=1209022 mostly prefer our stream / bounds checking work. Patches contributed by Herbert Duerr #i118816# add clarifying comment regarding Font::*Color*() methods http://svn.apache.org/viewvc?view=revision&revision=1233833 extend macro->string handling for empty strings http://svn.apache.org/viewvc?view=revision&revision=1175801 avoid magic constants for SALCOLOR_NONE http://svn.apache.org/viewvc?view=revision&revision=1177543 initialize slant properly in ImplFontMetricData constructor (author=iorsh) http://svn.apache.org/viewvc?view=revision&revision=1177551 #i118675# make check for extension updates more stable http://svn.apache.org/viewvc?view=revision&revision=1214797 #a118617# remove VBasicEventListener.dll binary There are no known users depending on its CLSID http://svn.apache.org/viewvc?view=revision&revision=1203697 Patches contributed by Ariel Constenla-Haile Fix build breaker on Linux/gcc http://svn.apache.org/viewvc?view=revision&revision=1221104 Fix crash when trying to instantiate css.graphic.GraphicRasterizer_RSVG http://svn.apache.org/viewvc?view=revision&revision=1215559 Patches contributed by Oliver-Rainer Wittmann sw34bf06: #i117962# - method <SwFlyFrm::IsPaint(..)> - consider instances of <SwFlyDrawObj> http://svn.apache.org/viewvc?view=revision&revision=1172120 sw34bf06: #i117783# - Writer's implementation of XPagePrintable - apply print settings to new printing routines http://svn.apache.org/viewvc?view=revision&revision=1172115 gnumake4 work variously from Hans-Joachim Lankenau http://svn.apache.org/viewvc?view=revision&revision=1397315 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1396782 http://svn.apache.org/viewvc?view=revision&revision=1394707 plus some amount of re-splitting of legacy headers. Patch contributed by Pavel Janik WaE: Remove unused variables. http://svn.apache.org/viewvc?view=revision&revision=1230697 Patches contributed by Takashi Ono mingwport35: i#117795: MinGW port fix for vcl2gnumake http://svn.apache.org/viewvc?view=revision&revision=1172091 mingwport35: i#117795: MinGW port fix for vcl2gnumake http://svn.apache.org/viewvc?view=revision&revision=1172091 Patch contributed by Christian Lippka impress212: #i98044# re enable Text menu for outline and title shapes http://svn.apache.org/viewvc?view=revision&revision=1167639 Patch contributed by Andre Fischer 118674: Made category B code optional and disabled by default. http://svn.apache.org/viewvc?view=revision&revision=1215131 118881: Ignore empty paragraphs after bullets. http://svn.apache.org/viewvc?view=revision&revision=1296205 Patches contributed by Philipp Lohmann ooo340fixes: #i117780# use rtl allocator http://svn.apache.org/viewvc?view=revision&revision=1172087 ooo34gsl02: #i117807# fix an off by one error (index actually inside the pfb section header) http://svn.apache.org/viewvc?view=revision&revision=1167576 various cleanups, related compilation fixes, warning cleanups, re-working of obsolete stl template pieces to use boost instead, changed string classes, re-adapt KDE about data, about dialog, fixing warnings, and other fixes & improvements. Disable svg import / render for about/ branding code-paths for now. Restore full icon theme set. Remove OS/2 conditionals and sources. Remove conflicting gtk/full-screen monitors support. Retain existing svg rasterizer files - temporarily disabled. Standardize stringificaiton and fixup dllpostfix issues. Rename SvgGradientHelper::== to equalTo to avoid overloading issues. Use the flat GdiPlus API for LineCaps calls.
2012-10-09 12:22:23 +01:00
* 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 .
*/
2000-09-18 16:07:07 +00:00
#include <sal/config.h>
#include <cstdlib>
2000-09-18 16:07:07 +00:00
#include <tools/debug.hxx>
#include <vcl/svapp.hxx>
#include <vcl/menu.hxx>
#include <vcl/event.hxx>
#include <vcl/syswin.hxx>
#include <vcl/taskpanelist.hxx>
#include <vcl/unowrap.hxx>
2000-09-18 16:07:07 +00:00
2011-06-22 00:49:30 +01:00
#include <rtl/strbuf.hxx>
#include <salframe.hxx>
#include <svdata.hxx>
#include <brdwin.hxx>
#include <window.h>
2001-02-05 08:45:05 +00:00
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
2000-09-18 16:07:07 +00:00
class SystemWindow::ImplData
{
public:
ImplData();
~ImplData();
TaskPaneList* mpTaskPaneList;
Size maMaxOutSize;
OUString maRepresentedURL;
Link maCloseHdl;
};
SystemWindow::ImplData::ImplData()
{
mpTaskPaneList = NULL;
maMaxOutSize = Size( SHRT_MAX, SHRT_MAX );
}
SystemWindow::ImplData::~ImplData()
{
if( mpTaskPaneList )
delete mpTaskPaneList;
}
2000-09-18 16:07:07 +00:00
SystemWindow::SystemWindow( WindowType nType ) :
Window( nType )
{
mpImplData = new ImplData;
mpWindowImpl->mbSysWin = true;
mpWindowImpl->mnActivateMode = ACTIVATE_MODE_GRABFOCUS;
2000-09-18 16:07:07 +00:00
mpMenuBar = NULL;
mbPinned = false;
mbRollUp = false;
mbRollFunc = false;
mbDockBtn = false;
mbHideBtn = false;
mbSysChild = false;
2000-09-18 16:07:07 +00:00
mnMenuBarMode = MENUBAR_MODE_NORMAL;
mnIcon = 0;
}
SystemWindow::~SystemWindow()
{
delete mpImplData;
mpImplData = NULL;
2000-09-18 16:07:07 +00:00
}
2000-09-18 16:07:07 +00:00
bool SystemWindow::Notify( NotifyEvent& rNEvt )
2000-09-18 16:07:07 +00:00
{
// capture KeyEvents for menu handling
2000-09-18 16:07:07 +00:00
if ( rNEvt.GetType() == EVENT_KEYINPUT )
{
MenuBar* pMBar = mpMenuBar;
if ( !pMBar && ( GetType() == WINDOW_FLOATINGWINDOW ) )
{
2002-03-21 17:35:44 +00:00
Window* pWin = ImplGetFrameWindow()->ImplGetWindow();
if( pWin && pWin->IsSystemWindow() )
pMBar = ((SystemWindow*)pWin)->GetMenuBar();
2000-09-18 16:07:07 +00:00
}
if ( pMBar && pMBar->ImplHandleKeyEvent( *rNEvt.GetKeyEvent(), false ) )
return true;
2000-09-18 16:07:07 +00:00
}
return Window::Notify( rNEvt );
}
2000-09-18 16:07:07 +00:00
bool SystemWindow::PreNotify( NotifyEvent& rNEvt )
2002-02-15 07:38:55 +00:00
{
// capture KeyEvents for taskpane cycling
if ( rNEvt.GetType() == EVENT_KEYINPUT )
{
2002-03-14 07:51:18 +00:00
if( rNEvt.GetKeyEvent()->GetKeyCode().GetCode() == KEY_F6 &&
2002-05-23 08:43:15 +00:00
rNEvt.GetKeyEvent()->GetKeyCode().IsMod1() &&
!rNEvt.GetKeyEvent()->GetKeyCode().IsShift() )
{
2002-03-14 07:51:18 +00:00
// Ctrl-F6 goes directly to the document
2002-05-06 12:15:07 +00:00
GrabFocusToDocument();
return true;
2002-03-14 07:51:18 +00:00
}
else
{
TaskPaneList *pTList = mpImplData->mpTaskPaneList;
2002-03-14 07:51:18 +00:00
if( !pTList && ( GetType() == WINDOW_FLOATINGWINDOW ) )
{
2002-03-21 17:35:44 +00:00
Window* pWin = ImplGetFrameWindow()->ImplGetWindow();
if( pWin && pWin->IsSystemWindow() )
pTList = ((SystemWindow*)pWin)->mpImplData->mpTaskPaneList;
2002-03-14 07:51:18 +00:00
}
if( !pTList )
{
// search topmost system window which is the one to handle dialog/toolbar cycling
SystemWindow *pSysWin = this;
Window *pWin = this;
while( pWin )
{
pWin = pWin->GetParent();
if( pWin && pWin->IsSystemWindow() )
pSysWin = (SystemWindow*) pWin;
}
pTList = pSysWin->mpImplData->mpTaskPaneList;
}
2002-03-14 07:51:18 +00:00
if( pTList && pTList->HandleKeyEvent( *rNEvt.GetKeyEvent() ) )
return true;
}
}
2002-02-15 07:38:55 +00:00
return Window::PreNotify( rNEvt );
}
2002-02-15 07:38:55 +00:00
TaskPaneList* SystemWindow::GetTaskPaneList()
{
if( mpImplData->mpTaskPaneList )
return mpImplData->mpTaskPaneList ;
else
{
mpImplData->mpTaskPaneList = new TaskPaneList();
MenuBar* pMBar = mpMenuBar;
if ( !pMBar && ( GetType() == WINDOW_FLOATINGWINDOW ) )
{
2002-03-21 17:35:44 +00:00
Window* pWin = ImplGetFrameWindow()->ImplGetWindow();
if ( pWin && pWin->IsSystemWindow() )
pMBar = ((SystemWindow*)pWin)->GetMenuBar();
}
if( pMBar )
mpImplData->mpTaskPaneList->AddWindow( pMBar->ImplGetWindow() );
return mpImplData->mpTaskPaneList;
}
}
bool SystemWindow::Close()
2000-09-18 16:07:07 +00:00
{
2001-11-27 08:52:58 +00:00
ImplDelData aDelData;
ImplAddDel( &aDelData );
ImplCallEventListeners( VCLEVENT_WINDOW_CLOSE );
if ( aDelData.IsDead() )
return false;
2001-11-27 08:52:58 +00:00
ImplRemoveDel( &aDelData );
if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() )
return false;
2000-09-18 16:07:07 +00:00
// Is Window not closeable, ignore close
Window* pBorderWin = ImplGetBorderWindow();
WinBits nStyle;
if ( pBorderWin )
nStyle = pBorderWin->GetStyle();
else
nStyle = GetStyle();
if ( !(nStyle & WB_CLOSEABLE) )
return false;
2000-09-18 16:07:07 +00:00
Hide();
return true;
2000-09-18 16:07:07 +00:00
}
2000-09-18 16:07:07 +00:00
void SystemWindow::TitleButtonClick( sal_uInt16 )
2000-09-18 16:07:07 +00:00
{
}
2000-09-18 16:07:07 +00:00
void SystemWindow::Pin()
{
}
2000-09-18 16:07:07 +00:00
void SystemWindow::Roll()
{
}
2000-09-18 16:07:07 +00:00
void SystemWindow::Resizing( Size& )
{
}
2000-09-18 16:07:07 +00:00
void SystemWindow::SetRepresentedURL( const OUString& i_rURL )
{
bool bChanged = (i_rURL != mpImplData->maRepresentedURL);
mpImplData->maRepresentedURL = i_rURL;
if ( !mbSysChild && bChanged )
{
const Window* pWindow = this;
while ( pWindow->mpWindowImpl->mpBorderWindow )
pWindow = pWindow->mpWindowImpl->mpBorderWindow;
if ( pWindow->mpWindowImpl->mbFrame )
pWindow->mpWindowImpl->mpFrame->SetRepresentedURL( i_rURL );
}
}
void SystemWindow::SetIcon( sal_uInt16 nIcon )
{
if ( mnIcon == nIcon )
return;
mnIcon = nIcon;
if ( !mbSysChild )
{
const Window* pWindow = this;
while ( pWindow->mpWindowImpl->mpBorderWindow )
pWindow = pWindow->mpWindowImpl->mpBorderWindow;
if ( pWindow->mpWindowImpl->mbFrame )
pWindow->mpWindowImpl->mpFrame->SetIcon( nIcon );
}
}
void SystemWindow::EnableSaveBackground( bool bSave )
2000-09-18 16:07:07 +00:00
{
if( ImplGetSVData()->maWinData.mbNoSaveBackground )
bSave = false;
2000-09-18 16:07:07 +00:00
Window* pWindow = this;
while ( pWindow->mpWindowImpl->mpBorderWindow )
pWindow = pWindow->mpWindowImpl->mpBorderWindow;
if ( pWindow->mpWindowImpl->mbOverlapWin && !pWindow->mpWindowImpl->mbFrame )
2000-09-18 16:07:07 +00:00
{
pWindow->mpWindowImpl->mpOverlapData->mbSaveBack = bSave;
2000-09-18 16:07:07 +00:00
if ( !bSave )
pWindow->ImplDeleteOverlapBackground();
}
}
2000-09-18 16:07:07 +00:00
bool SystemWindow::IsSaveBackgroundEnabled() const
2000-09-18 16:07:07 +00:00
{
const Window* pWindow = this;
while ( pWindow->mpWindowImpl->mpBorderWindow )
pWindow = pWindow->mpWindowImpl->mpBorderWindow;
if ( pWindow->mpWindowImpl->mpOverlapData )
return pWindow->mpWindowImpl->mpOverlapData->mbSaveBack;
2000-09-18 16:07:07 +00:00
else
return false;
2000-09-18 16:07:07 +00:00
}
2000-09-18 16:07:07 +00:00
void SystemWindow::ShowTitleButton( sal_uInt16 nButton, bool bVisible )
2000-09-18 16:07:07 +00:00
{
if ( nButton == TITLE_BUTTON_DOCKING )
{
if ( mbDockBtn != bVisible )
{
mbDockBtn = bVisible;
if ( mpWindowImpl->mpBorderWindow )
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetDockButton( bVisible );
2000-09-18 16:07:07 +00:00
}
}
else if ( nButton == TITLE_BUTTON_HIDE )
2000-09-18 16:07:07 +00:00
{
if ( mbHideBtn != bVisible )
{
mbHideBtn = bVisible;
if ( mpWindowImpl->mpBorderWindow )
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetHideButton( bVisible );
2000-09-18 16:07:07 +00:00
}
}
else if ( nButton == TITLE_BUTTON_MENU )
{
if ( mpWindowImpl->mpBorderWindow )
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuButton( bVisible );
}
else
return;
2000-09-18 16:07:07 +00:00
}
2000-09-18 16:07:07 +00:00
bool SystemWindow::IsTitleButtonVisible( sal_uInt16 nButton ) const
2000-09-18 16:07:07 +00:00
{
if ( nButton == TITLE_BUTTON_DOCKING )
return mbDockBtn;
else /* if ( nButton == TITLE_BUTTON_HIDE ) */
return mbHideBtn;
}
2000-09-18 16:07:07 +00:00
void SystemWindow::SetPin( bool bPin )
2000-09-18 16:07:07 +00:00
{
if ( bPin != mbPinned )
2000-09-18 16:07:07 +00:00
{
mbPinned = bPin;
if ( mpWindowImpl->mpBorderWindow )
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetPin( bPin );
2000-09-18 16:07:07 +00:00
}
}
2000-09-18 16:07:07 +00:00
void SystemWindow::RollUp()
{
if ( !mbRollUp )
{
maOrgSize = GetOutputSizePixel();
mbRollFunc = true;
2000-09-18 16:07:07 +00:00
Size aSize = maRollUpOutSize;
if ( !aSize.Width() )
aSize.Width() = GetOutputSizePixel().Width();
mbRollUp = true;
if ( mpWindowImpl->mpBorderWindow )
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( true, aSize );
2000-09-18 16:07:07 +00:00
else
SetOutputSizePixel( aSize );
mbRollFunc = false;
2000-09-18 16:07:07 +00:00
}
}
2000-09-18 16:07:07 +00:00
void SystemWindow::RollDown()
{
if ( mbRollUp )
{
mbRollUp = false;
if ( mpWindowImpl->mpBorderWindow )
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( false, maOrgSize );
2000-09-18 16:07:07 +00:00
else
SetOutputSizePixel( maOrgSize );
}
}
2000-09-18 16:07:07 +00:00
void SystemWindow::SetMinOutputSizePixel( const Size& rSize )
{
maMinOutSize = rSize;
if ( mpWindowImpl->mpBorderWindow )
{
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMinOutputSize( rSize.Width(), rSize.Height() );
if ( mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame )
mpWindowImpl->mpBorderWindow->mpWindowImpl->mpFrame->SetMinClientSize( rSize.Width(), rSize.Height() );
}
else if ( mpWindowImpl->mbFrame )
mpWindowImpl->mpFrame->SetMinClientSize( rSize.Width(), rSize.Height() );
}
void SystemWindow::SetMaxOutputSizePixel( const Size& rSize )
{
Size aSize( rSize );
if( aSize.Width() > SHRT_MAX || aSize.Width() <= 0 )
aSize.Width() = SHRT_MAX;
if( aSize.Height() > SHRT_MAX || aSize.Height() <= 0 )
aSize.Height() = SHRT_MAX;
mpImplData->maMaxOutSize = aSize;
if ( mpWindowImpl->mpBorderWindow )
{
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMaxOutputSize( aSize.Width(), aSize.Height() );
if ( mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame )
mpWindowImpl->mpBorderWindow->mpWindowImpl->mpFrame->SetMaxClientSize( aSize.Width(), aSize.Height() );
}
else if ( mpWindowImpl->mbFrame )
mpWindowImpl->mpFrame->SetMaxClientSize( aSize.Width(), aSize.Height() );
}
const Size& SystemWindow::GetMaxOutputSizePixel() const
{
return mpImplData->maMaxOutSize;
}
Size SystemWindow::GetResizeOutputSizePixel() const
{
Size aSize = GetOutputSizePixel();
if ( aSize.Width() < maMinOutSize.Width() )
aSize.Width() = maMinOutSize.Width();
if ( aSize.Height() < maMinOutSize.Height() )
aSize.Height() = maMinOutSize.Height();
return aSize;
2000-09-18 16:07:07 +00:00
}
2000-09-18 16:07:07 +00:00
2011-06-22 00:49:30 +01:00
static void ImplWindowStateFromStr(WindowStateData& rData,
const OString& rStr)
{
sal_uLong nValidMask = 0;
2011-06-22 00:49:30 +01:00
sal_Int32 nIndex = 0;
OString aTokenStr;
2011-06-22 00:49:30 +01:00
aTokenStr = rStr.getToken(0, ',', nIndex);
if (!aTokenStr.isEmpty())
{
2011-06-22 00:49:30 +01:00
rData.SetX(aTokenStr.toInt32());
if( rData.GetX() > -16384 && rData.GetX() < 16384 )
nValidMask |= WINDOWSTATE_MASK_X;
else
rData.SetX( 0 );
}
else
rData.SetX( 0 );
2011-06-22 00:49:30 +01:00
aTokenStr = rStr.getToken(0, ',', nIndex);
if (!aTokenStr.isEmpty())
{
2011-06-22 00:49:30 +01:00
rData.SetY(aTokenStr.toInt32());
if( rData.GetY() > -16384 && rData.GetY() < 16384 )
nValidMask |= WINDOWSTATE_MASK_Y;
else
rData.SetY( 0 );
}
else
rData.SetY( 0 );
2011-06-22 00:49:30 +01:00
aTokenStr = rStr.getToken(0, ',', nIndex);
if (!aTokenStr.isEmpty())
{
2011-06-22 00:49:30 +01:00
rData.SetWidth(aTokenStr.toInt32());
if( rData.GetWidth() > 0 && rData.GetWidth() < 16384 )
nValidMask |= WINDOWSTATE_MASK_WIDTH;
else
rData.SetWidth( 0 );
}
else
rData.SetWidth( 0 );
2011-06-22 00:49:30 +01:00
aTokenStr = rStr.getToken(0, ';', nIndex);
if (!aTokenStr.isEmpty())
{
2011-06-22 00:49:30 +01:00
rData.SetHeight(aTokenStr.toInt32());
if( rData.GetHeight() > 0 && rData.GetHeight() < 16384 )
nValidMask |= WINDOWSTATE_MASK_HEIGHT;
else
rData.SetHeight( 0 );
}
else
rData.SetHeight( 0 );
2011-06-22 00:49:30 +01:00
aTokenStr = rStr.getToken(0, ';', nIndex);
if (!aTokenStr.isEmpty())
{
// #94144# allow Minimize again, should be masked out when read from configuration
// 91625 - ignore Minimize
2011-06-22 00:49:30 +01:00
sal_uInt32 nState = (sal_uInt32)aTokenStr.toInt32();
//nState &= ~(WINDOWSTATE_STATE_MINIMIZED);
rData.SetState( nState );
nValidMask |= WINDOWSTATE_MASK_STATE;
}
else
rData.SetState( 0 );
// read maximized pos/size
2011-06-22 00:49:30 +01:00
aTokenStr = rStr.getToken(0, ',', nIndex);
if (!aTokenStr.isEmpty())
{
2011-06-22 00:49:30 +01:00
rData.SetMaximizedX(aTokenStr.toInt32());
if( rData.GetMaximizedX() > -16384 && rData.GetMaximizedX() < 16384 )
nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_X;
else
rData.SetMaximizedX( 0 );
}
else
rData.SetMaximizedX( 0 );
2011-06-22 00:49:30 +01:00
aTokenStr = rStr.getToken(0, ',', nIndex);
if (!aTokenStr.isEmpty())
{
2011-06-22 00:49:30 +01:00
rData.SetMaximizedY(aTokenStr.toInt32());
if( rData.GetMaximizedY() > -16384 && rData.GetMaximizedY() < 16384 )
nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_Y;
else
rData.SetMaximizedY( 0 );
}
else
rData.SetMaximizedY( 0 );
2011-06-22 00:49:30 +01:00
aTokenStr = rStr.getToken(0, ',', nIndex);
if (!aTokenStr.isEmpty())
{
2011-06-22 00:49:30 +01:00
rData.SetMaximizedWidth(aTokenStr.toInt32());
if( rData.GetMaximizedWidth() > 0 && rData.GetMaximizedWidth() < 16384 )
nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_WIDTH;
else
rData.SetMaximizedWidth( 0 );
}
else
rData.SetMaximizedWidth( 0 );
2011-06-22 00:49:30 +01:00
aTokenStr = rStr.getToken(0, ';', nIndex);
if (!aTokenStr.isEmpty())
{
2011-06-22 00:49:30 +01:00
rData.SetMaximizedHeight(aTokenStr.toInt32());
if( rData.GetMaximizedHeight() > 0 && rData.GetMaximizedHeight() < 16384 )
nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_HEIGHT;
else
rData.SetMaximizedHeight( 0 );
}
else
rData.SetMaximizedHeight( 0 );
// mark valid fields
rData.SetMask( nValidMask );
}
static OString ImplWindowStateToStr(const WindowStateData& rData)
{
sal_uLong nValidMask = rData.GetMask();
if ( !nValidMask )
return OString();
2011-06-22 00:49:30 +01:00
OStringBuffer rStrBuf;
if ( nValidMask & WINDOWSTATE_MASK_X )
2011-06-22 10:38:44 +01:00
rStrBuf.append(static_cast<sal_Int32>(rData.GetX()));
2011-06-22 00:49:30 +01:00
rStrBuf.append(',');
if ( nValidMask & WINDOWSTATE_MASK_Y )
2011-06-22 10:38:44 +01:00
rStrBuf.append(static_cast<sal_Int32>(rData.GetY()));
2011-06-22 00:49:30 +01:00
rStrBuf.append(',');
if ( nValidMask & WINDOWSTATE_MASK_WIDTH )
2011-06-22 00:49:30 +01:00
rStrBuf.append(static_cast<sal_Int32>(rData.GetWidth()));
rStrBuf.append(',');
if ( nValidMask & WINDOWSTATE_MASK_HEIGHT )
2011-06-22 00:49:30 +01:00
rStrBuf.append(static_cast<sal_Int32>(rData.GetHeight()));
rStrBuf.append( ';' );
if ( nValidMask & WINDOWSTATE_MASK_STATE )
{
// #94144# allow Minimize again, should be masked out when read from configuration
// 91625 - ignore Minimize
2011-06-22 00:49:30 +01:00
sal_uInt32 nState = rData.GetState();
rStrBuf.append(static_cast<sal_Int32>(nState));
}
2011-06-22 00:49:30 +01:00
rStrBuf.append(';');
if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_X )
2011-06-22 10:38:44 +01:00
rStrBuf.append(static_cast<sal_Int32>(rData.GetMaximizedX()));
2011-06-22 00:49:30 +01:00
rStrBuf.append(',');
if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_Y )
2011-06-22 10:38:44 +01:00
rStrBuf.append(static_cast<sal_Int32>(rData.GetMaximizedY()));
2011-06-22 00:49:30 +01:00
rStrBuf.append( ',' );
if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_WIDTH )
2011-06-22 00:49:30 +01:00
rStrBuf.append(static_cast<sal_Int32>(rData.GetMaximizedWidth()));
rStrBuf.append(',');
if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_HEIGHT )
2011-06-22 00:49:30 +01:00
rStrBuf.append(static_cast<sal_Int32>(rData.GetMaximizedHeight()));
rStrBuf.append(';');
return rStrBuf.makeStringAndClear();
}
void SystemWindow::ImplMoveToScreen( long& io_rX, long& io_rY, long i_nWidth, long i_nHeight, Window* i_pConfigureWin )
{
Rectangle aScreenRect;
if( !Application::IsUnifiedDisplay() )
aScreenRect = Application::GetScreenPosSizePixel( GetScreenNumber() );
else
{
aScreenRect = Application::GetScreenPosSizePixel( 0 );
for( unsigned int i = 1; i < Application::GetScreenCount(); i++ )
aScreenRect.Union( Application::GetScreenPosSizePixel( i ) );
}
// unfortunately most of the time width and height are not really known
if( i_nWidth < 1 )
i_nWidth = 50;
if( i_nHeight < 1 )
i_nHeight = 50;
// check left border
bool bMove = false;
if( io_rX + i_nWidth < aScreenRect.Left() )
{
bMove = true;
io_rX = aScreenRect.Left();
}
// check right border
if( io_rX > aScreenRect.Right() - i_nWidth )
{
bMove = true;
io_rX = aScreenRect.Right() - i_nWidth;
}
// check top border
if( io_rY + i_nHeight < aScreenRect.Top() )
{
bMove = true;
io_rY = aScreenRect.Top();
}
// check bottom border
if( io_rY > aScreenRect.Bottom() - i_nHeight )
{
bMove = true;
io_rY = aScreenRect.Bottom() - i_nHeight;
}
Window* pParent = i_pConfigureWin->GetParent();
if( bMove && pParent )
{
// calculate absolute screen pos here, since that is what is contained in WindowState
Point aParentAbsPos( pParent->OutputToAbsoluteScreenPixel( Point(0,0) ) );
Size aParentSizePixel( pParent->GetOutputSizePixel() );
Point aPos( (aParentSizePixel.Width() - i_nWidth) / 2,
(aParentSizePixel.Height() - i_nHeight) / 2 );
io_rX = aParentAbsPos.X() + aPos.X();
io_rY = aParentAbsPos.Y() + aPos.Y();
}
}
void SystemWindow::SetWindowStateData( const WindowStateData& rData )
{
sal_uLong nValidMask = rData.GetMask();
if ( !nValidMask )
return;
if ( mbSysChild )
return;
Window* pWindow = this;
while ( pWindow->mpWindowImpl->mpBorderWindow )
pWindow = pWindow->mpWindowImpl->mpBorderWindow;
if ( pWindow->mpWindowImpl->mbFrame )
{
sal_uLong nState = rData.GetState();
SalFrameState aState;
aState.mnMask = rData.GetMask();
aState.mnX = rData.GetX();
aState.mnY = rData.GetY();
aState.mnWidth = rData.GetWidth();
aState.mnHeight = rData.GetHeight();
if( rData.GetMask() & (WINDOWSTATE_MASK_WIDTH|WINDOWSTATE_MASK_HEIGHT) )
{
// #i43799# adjust window state sizes if a minimial output size was set
// otherwise the frame and the client might get different sizes
if( maMinOutSize.Width() > aState.mnWidth )
aState.mnWidth = maMinOutSize.Width();
if( maMinOutSize.Height() > aState.mnHeight )
aState.mnHeight = maMinOutSize.Height();
}
aState.mnMaximizedX = rData.GetMaximizedX();
aState.mnMaximizedY = rData.GetMaximizedY();
aState.mnMaximizedWidth = rData.GetMaximizedWidth();
aState.mnMaximizedHeight = rData.GetMaximizedHeight();
// #94144# allow Minimize again, should be masked out when read from configuration
// 91625 - ignore Minimize
//nState &= ~(WINDOWSTATE_STATE_MINIMIZED);
aState.mnState = nState & WINDOWSTATE_STATE_SYSTEMMASK;
2002-11-12 09:52:50 +00:00
// normalize window positions onto screen
ImplMoveToScreen( aState.mnX, aState.mnY, aState.mnWidth, aState.mnHeight, pWindow );
ImplMoveToScreen( aState.mnMaximizedX, aState.mnMaximizedY, aState.mnMaximizedWidth, aState.mnMaximizedHeight, pWindow );
2002-11-12 09:52:50 +00:00
// #96568# avoid having multiple frames at the same screen location
// do the check only if not maximized
if( !((rData.GetMask() & WINDOWSTATE_MASK_STATE) && (nState & WINDOWSTATE_STATE_MAXIMIZED)) )
if( rData.GetMask() & (WINDOWSTATE_MASK_POS|WINDOWSTATE_MASK_WIDTH|WINDOWSTATE_MASK_HEIGHT) )
2002-11-12 09:52:50 +00:00
{
Rectangle aDesktop = GetDesktopRectPixel();
ImplSVData *pSVData = ImplGetSVData();
Window *pWin = pSVData->maWinData.mpFirstFrame;
bool bWrapped = false;
while( pWin )
2002-11-12 09:52:50 +00:00
{
2010-08-30 14:08:45 +02:00
if( !pWin->ImplIsRealParentPath( this ) && ( pWin != this ) &&
pWin->ImplGetWindow()->IsTopWindow() && pWin->mpWindowImpl->mbReallyVisible )
2002-11-12 09:52:50 +00:00
{
SalFrameGeometry g = pWin->mpWindowImpl->mpFrame->GetGeometry();
if( std::abs(g.nX-aState.mnX) < 2 && std::abs(g.nY-aState.mnY) < 5 )
2002-11-12 09:52:50 +00:00
{
long displacement = g.nTopDecoration ? g.nTopDecoration : 20;
if( (unsigned long) (aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > (unsigned long) aDesktop.Right() ||
(unsigned long) (aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > (unsigned long) aDesktop.Bottom() )
{
// displacing would leave screen
aState.mnX = g.nLeftDecoration ? g.nLeftDecoration : 10; // should result in (0,0)
aState.mnY = displacement;
if( bWrapped ||
(unsigned long) (aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > (unsigned long) aDesktop.Right() ||
(unsigned long) (aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > (unsigned long) aDesktop.Bottom() )
break; // further displacement not possible -> break
// avoid endless testing
bWrapped = true;
}
else
{
// displace
aState.mnX += displacement;
aState.mnY += displacement;
}
pWin = pSVData->maWinData.mpFirstFrame; // check new pos again
2002-11-12 09:52:50 +00:00
}
}
pWin = pWin->mpWindowImpl->mpFrameData->mpNextFrame;
2002-11-12 09:52:50 +00:00
}
}
mpWindowImpl->mpFrame->SetWindowState( &aState );
// do a synchronous resize for layout reasons
// but use rData only when the window is not to be maximized (#i38089#)
// otherwise we have no useful size information
if( (rData.GetMask() & WINDOWSTATE_MASK_STATE) && (nState & WINDOWSTATE_STATE_MAXIMIZED) )
{
// query maximized size from frame
SalFrameGeometry aGeometry = mpWindowImpl->mpFrame->GetGeometry();
// but use it only if it is different from the restore size (rData)
// as currently only on windows the exact size of a maximized window
// can be computed without actually showing the window
if( aGeometry.nWidth != rData.GetWidth() || aGeometry.nHeight != rData.GetHeight() )
ImplHandleResize( pWindow, aGeometry.nWidth, aGeometry.nHeight );
}
else
if( rData.GetMask() & (WINDOWSTATE_MASK_WIDTH|WINDOWSTATE_MASK_HEIGHT) )
ImplHandleResize( pWindow, aState.mnWidth, aState.mnHeight ); // #i43799# use aState and not rData, see above
}
else
{
sal_uInt16 nPosSize = 0;
if ( nValidMask & WINDOWSTATE_MASK_X )
nPosSize |= WINDOW_POSSIZE_X;
if ( nValidMask & WINDOWSTATE_MASK_Y )
nPosSize |= WINDOW_POSSIZE_Y;
if ( nValidMask & WINDOWSTATE_MASK_WIDTH )
nPosSize |= WINDOW_POSSIZE_WIDTH;
if ( nValidMask & WINDOWSTATE_MASK_HEIGHT )
nPosSize |= WINDOW_POSSIZE_HEIGHT;
2001-11-23 11:39:27 +00:00
if( IsRollUp() )
RollDown();
long nX = rData.GetX();
long nY = rData.GetY();
long nWidth = rData.GetWidth();
long nHeight = rData.GetHeight();
const SalFrameGeometry& rGeom = pWindow->mpWindowImpl->mpFrame->GetGeometry();
if( nX < 0 )
nX = 0;
if( nX + nWidth > (long) rGeom.nWidth )
nX = rGeom.nWidth - nWidth;
if( nY < 0 )
nY = 0;
if( nY + nHeight > (long) rGeom.nHeight )
nY = rGeom.nHeight - nHeight;
setPosSizePixel( nX, nY, nWidth, nHeight, nPosSize );
maOrgSize = Size( nWidth, nHeight );
// 91625 - ignore Minimize
if ( nValidMask & WINDOWSTATE_MASK_STATE )
{
sal_uLong nState = rData.GetState();
if ( nState & WINDOWSTATE_STATE_ROLLUP )
RollUp();
else
RollDown();
}
}
}
void SystemWindow::GetWindowStateData( WindowStateData& rData ) const
{
sal_uLong nValidMask = rData.GetMask();
if ( !nValidMask )
return;
if ( mbSysChild )
return;
const Window* pWindow = this;
while ( pWindow->mpWindowImpl->mpBorderWindow )
pWindow = pWindow->mpWindowImpl->mpBorderWindow;
if ( pWindow->mpWindowImpl->mbFrame )
{
SalFrameState aState;
aState.mnMask = 0xFFFFFFFF;
if ( mpWindowImpl->mpFrame->GetWindowState( &aState ) )
{
if ( nValidMask & WINDOWSTATE_MASK_X )
rData.SetX( aState.mnX );
if ( nValidMask & WINDOWSTATE_MASK_Y )
rData.SetY( aState.mnY );
if ( nValidMask & WINDOWSTATE_MASK_WIDTH )
rData.SetWidth( aState.mnWidth );
if ( nValidMask & WINDOWSTATE_MASK_HEIGHT )
rData.SetHeight( aState.mnHeight );
if ( aState.mnMask & WINDOWSTATE_MASK_MAXIMIZED_X )
{
rData.SetMaximizedX( aState.mnMaximizedX );
nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_X;
}
if ( aState.mnMask & WINDOWSTATE_MASK_MAXIMIZED_Y )
{
rData.SetMaximizedY( aState.mnMaximizedY );
nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_Y;
}
if ( aState.mnMask & WINDOWSTATE_MASK_MAXIMIZED_WIDTH )
{
rData.SetMaximizedWidth( aState.mnMaximizedWidth );
nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_WIDTH;
}
if ( aState.mnMask & WINDOWSTATE_MASK_MAXIMIZED_HEIGHT )
{
rData.SetMaximizedHeight( aState.mnMaximizedHeight );
nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_HEIGHT;
}
if ( nValidMask & WINDOWSTATE_MASK_STATE )
{
// #94144# allow Minimize again, should be masked out when read from configuration
// 91625 - ignore Minimize
if ( !(nValidMask&WINDOWSTATE_MASK_MINIMIZED) )
aState.mnState &= ~(WINDOWSTATE_STATE_MINIMIZED);
rData.SetState( aState.mnState );
}
rData.SetMask( nValidMask );
}
else
rData.SetMask( 0 );
}
else
{
Point aPos = GetPosPixel();
Size aSize = GetSizePixel();
sal_uLong nState = 0;
if ( IsRollUp() )
{
aSize.Height() += maOrgSize.Height();
nState |= WINDOWSTATE_STATE_ROLLUP;
}
if ( nValidMask & WINDOWSTATE_MASK_X )
rData.SetX( aPos.X() );
if ( nValidMask & WINDOWSTATE_MASK_Y )
rData.SetY( aPos.Y() );
if ( nValidMask & WINDOWSTATE_MASK_WIDTH )
rData.SetWidth( aSize.Width() );
if ( nValidMask & WINDOWSTATE_MASK_HEIGHT )
rData.SetHeight( aSize.Height() );
if ( nValidMask & WINDOWSTATE_MASK_STATE )
rData.SetState( nState );
}
}
void SystemWindow::SetWindowState(const OString& rStr)
{
2011-06-22 00:49:30 +01:00
if (rStr.isEmpty())
return;
WindowStateData aData;
ImplWindowStateFromStr( aData, rStr );
SetWindowStateData( aData );
}
OString SystemWindow::GetWindowState( sal_uLong nMask ) const
{
WindowStateData aData;
aData.SetMask( nMask );
GetWindowStateData( aData );
2011-06-22 00:49:30 +01:00
return ImplWindowStateToStr(aData);
}
2000-09-18 16:07:07 +00:00
void SystemWindow::SetMenuBar( MenuBar* pMenuBar )
{
if ( mpMenuBar != pMenuBar )
{
MenuBar* pOldMenuBar = mpMenuBar;
Window* pOldWindow = NULL;
Window* pNewWindow=NULL;
2000-09-18 16:07:07 +00:00
mpMenuBar = pMenuBar;
if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) )
2000-09-18 16:07:07 +00:00
{
if ( pOldMenuBar )
pOldWindow = pOldMenuBar->ImplGetWindow();
else
pOldWindow = NULL;
if ( pOldWindow )
{
ImplCallEventListeners( VCLEVENT_WINDOW_MENUBARREMOVED, (void*) pOldMenuBar );
pOldWindow->SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >() );
}
2000-09-18 16:07:07 +00:00
if ( pMenuBar )
{
DBG_ASSERT( !pMenuBar->pWindow, "SystemWindow::SetMenuBar() - MenuBars can only set in one SystemWindow at time" );
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarWindow( pNewWindow = MenuBar::ImplCreate( mpWindowImpl->mpBorderWindow, pOldWindow, pMenuBar ) );
ImplCallEventListeners( VCLEVENT_WINDOW_MENUBARADDED, (void*) pMenuBar );
2000-09-18 16:07:07 +00:00
}
else
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarWindow( NULL );
2000-09-18 16:07:07 +00:00
ImplToBottomChild();
if ( pOldMenuBar )
{
bool bDelete = (pMenuBar == 0) ? true : false;
if( bDelete && pOldWindow )
{
if( mpImplData->mpTaskPaneList )
mpImplData->mpTaskPaneList->RemoveWindow( pOldWindow );
}
MenuBar::ImplDestroy( pOldMenuBar, bDelete );
if( bDelete )
pOldWindow = NULL; // will be deleted in MenuBar::ImplDestroy,
}
}
else
{
if( pMenuBar )
pNewWindow = pMenuBar->ImplGetWindow();
if( pOldMenuBar )
pOldWindow = pOldMenuBar->ImplGetWindow();
}
// update taskpane list to make menubar accessible
if( mpImplData->mpTaskPaneList )
{
if( pOldWindow )
mpImplData->mpTaskPaneList->RemoveWindow( pOldWindow );
if( pNewWindow )
mpImplData->mpTaskPaneList->AddWindow( pNewWindow );
2000-09-18 16:07:07 +00:00
}
}
}
2000-09-18 16:07:07 +00:00
void SystemWindow::SetMenuBarMode( sal_uInt16 nMode )
2000-09-18 16:07:07 +00:00
{
if ( mnMenuBarMode != nMode )
{
mnMenuBarMode = nMode;
if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) )
2000-09-18 16:07:07 +00:00
{
if ( nMode == MENUBAR_MODE_HIDE )
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( true );
2000-09-18 16:07:07 +00:00
else
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( false );
2000-09-18 16:07:07 +00:00
}
}
}
bool SystemWindow::ImplIsInTaskPaneList( Window* pWin )
{
if( mpImplData && mpImplData->mpTaskPaneList )
return mpImplData->mpTaskPaneList->IsInList( pWin );
return false;
}
unsigned int SystemWindow::GetScreenNumber() const
{
return mpWindowImpl->mpFrame->maGeometry.nDisplayScreenNumber;
}
void SystemWindow::SetScreenNumber(unsigned int nDisplayScreen)
{
mpWindowImpl->mpFrame->SetScreenNumber( nDisplayScreen );
}
void SystemWindow::SetApplicationID(const OUString &rApplicationID)
{
mpWindowImpl->mpFrame->SetApplicationID( rApplicationID );
}
void SystemWindow::SetCloseHdl(const Link& rLink)
{
mpImplData->maCloseHdl = rLink;
}
const Link& SystemWindow::GetCloseHdl() const
{
return mpImplData->maCloseHdl;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */