summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-07-21 18:56:16 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-07-21 18:56:16 +0200
commita233dac0653f3f3054f7ad2da114ed989747e89a (patch)
treebf1e11438321c06125a94308649c496648061ccb /vcl
parentacb6133d89abe071108577f821d7eaa381378879 (diff)
parente5647de7dd26775e45af24f11ac4f82a5518bd9e (diff)
resyncing to master
Diffstat (limited to 'vcl')
-rw-r--r--vcl/Library_desktop_detector.mk6
-rw-r--r--vcl/Library_vcl.mk145
-rw-r--r--vcl/Library_vclplug_gen.mk23
-rw-r--r--vcl/Library_vclplug_gtk.mk6
-rw-r--r--vcl/Library_vclplug_gtk3.mk6
-rw-r--r--vcl/Library_vclplug_kde.mk6
-rw-r--r--vcl/Library_vclplug_kde4.mk6
-rw-r--r--vcl/Library_vclplug_svp.mk6
-rw-r--r--vcl/StaticLibrary_vclmain.mk15
-rw-r--r--vcl/aqua/source/a11y/aqua11yactionwrapper.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11yfactory.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11yrolehelper.mm7
-rw-r--r--vcl/aqua/source/a11y/aqua11yselectionwrapper.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ytablewrapper.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ytextwrapper.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11yutil.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11yvaluewrapper.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapper.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperbutton.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappercombobox.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappergroup.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperlist.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperradiogroup.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperrow.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperscrollarea.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperscrollbar.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappersplitter.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperstatictext.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappertabgroup.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappertextarea.mm3
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappertoolbar.mm3
-rw-r--r--[-rwxr-xr-x]vcl/aqua/source/app/salnstimer.mm2
-rw-r--r--[-rwxr-xr-x]vcl/aqua/source/app/vclnsapp.mm6
-rw-r--r--vcl/aqua/source/gdi/aquaprintaccessoryview.mm3
-rw-r--r--[-rwxr-xr-x]vcl/aqua/source/gdi/aquaprintview.mm3
-rw-r--r--vcl/aqua/source/gdi/salatslayout.cxx2
-rw-r--r--vcl/aqua/source/gdi/salbmp.cxx2
-rw-r--r--[-rwxr-xr-x]vcl/aqua/source/window/salframeview.mm2
-rw-r--r--[-rwxr-xr-x]vcl/aqua/source/window/salnsmenu.mm2
-rw-r--r--vcl/inc/android/svsys.h36
-rw-r--r--vcl/inc/impgraph.hxx2
-rw-r--r--vcl/inc/ios/iosvcltypes.h37
-rw-r--r--vcl/inc/ios/salbmp.h117
-rw-r--r--vcl/inc/ios/salcolorutils.hxx46
-rw-r--r--vcl/inc/ios/saldata.hxx126
-rw-r--r--vcl/inc/ios/salframe.h208
-rw-r--r--vcl/inc/ios/salframeview.h144
-rw-r--r--vcl/inc/ios/salgdi.h401
-rw-r--r--vcl/inc/ios/salinst.h199
-rw-r--r--vcl/inc/ios/salmathutils.hxx90
-rw-r--r--vcl/inc/ios/salmenu.h122
-rw-r--r--vcl/inc/ios/salnstimer.h43
-rw-r--r--vcl/inc/ios/salobj.h86
-rw-r--r--vcl/inc/ios/salprn.h173
-rw-r--r--vcl/inc/ios/salsys.h56
-rw-r--r--vcl/inc/ios/saltimer.h54
-rw-r--r--vcl/inc/ios/saluimenu.h62
-rw-r--r--vcl/inc/ios/salvd.h79
-rw-r--r--vcl/inc/ios/svsys.h36
-rw-r--r--vcl/inc/ios/vcluiapp.h53
-rw-r--r--vcl/inc/list.h3
-rw-r--r--vcl/inc/sallayout.hxx1
-rw-r--r--vcl/inc/saltimer.hxx3
-rw-r--r--vcl/inc/svsys.h7
-rw-r--r--vcl/inc/unx/Xproto.h3
-rw-r--r--vcl/inc/unx/gtk/gtkdata.hxx3
-rw-r--r--vcl/inc/unx/gtk/gtkframe.hxx1
-rw-r--r--vcl/inc/unx/gtk/gtkgdi.hxx3
-rw-r--r--vcl/inc/unx/headless/svpbmp.hxx (renamed from vcl/unx/headless/svpbmp.hxx)0
-rw-r--r--vcl/inc/unx/headless/svpdummies.hxx (renamed from vcl/unx/headless/svpdummies.hxx)0
-rw-r--r--vcl/inc/unx/headless/svpelement.hxx (renamed from vcl/unx/headless/svpelement.hxx)0
-rw-r--r--vcl/inc/unx/headless/svpframe.hxx (renamed from vcl/unx/headless/svpframe.hxx)0
-rw-r--r--vcl/inc/unx/headless/svpgdi.hxx (renamed from vcl/unx/headless/svpgdi.hxx)0
-rw-r--r--vcl/inc/unx/headless/svpinst.hxx (renamed from vcl/unx/headless/svpinst.hxx)0
-rw-r--r--vcl/inc/unx/headless/svpprn.hxx (renamed from vcl/unx/headless/svpprn.hxx)0
-rw-r--r--vcl/inc/unx/headless/svppspgraphics.hxx (renamed from vcl/unx/headless/svppspgraphics.hxx)0
-rw-r--r--vcl/inc/unx/headless/svpvd.hxx (renamed from vcl/unx/headless/svpvd.hxx)0
-rw-r--r--vcl/inc/unx/salbmp.h248
-rw-r--r--vcl/inc/unx/saldata.hxx3
-rw-r--r--vcl/inc/unx/saldisp.hxx7
-rw-r--r--vcl/inc/unx/x11_cursors/salcursors.h3
-rw-r--r--vcl/inc/vcl/accel.hxx16
-rw-r--r--vcl/inc/vcl/animate.hxx151
-rw-r--r--vcl/inc/vcl/bitmap.hxx2
-rw-r--r--vcl/inc/vcl/canvastools.hxx5
-rw-r--r--vcl/inc/vcl/displayconnectiondispatch.hxx3
-rw-r--r--vcl/inc/vcl/field.hxx19
-rw-r--r--vcl/inc/vcl/fontmanager.hxx2
-rw-r--r--vcl/inc/vcl/gdimtf.hxx2
-rw-r--r--vcl/inc/vcl/graph.hxx4
-rw-r--r--vcl/inc/vcl/graphictools.hxx12
-rw-r--r--vcl/inc/vcl/help.hxx2
-rw-r--r--vcl/inc/vcl/image.hxx3
-rw-r--r--vcl/inc/vcl/outdev.hxx23
-rw-r--r--vcl/inc/vcl/ppdparser.hxx10
-rw-r--r--vcl/inc/vcl/print.hxx6
-rw-r--r--vcl/inc/vcl/quickselectionengine.hxx3
-rw-r--r--vcl/inc/vcl/rendergraphic.hxx3
-rw-r--r--vcl/inc/vcl/rendergraphicrasterizer.hxx3
-rw-r--r--vcl/inc/vcl/settings.hxx1
-rw-r--r--vcl/inc/vcl/strhelper.hxx14
-rw-r--r--vcl/inc/vcl/svapp.hxx54
-rw-r--r--vcl/inc/vcl/svgread.hxx2
-rw-r--r--vcl/inc/vcl/syschild.hxx1
-rw-r--r--vcl/inc/vcl/sysdata.hxx23
-rw-r--r--vcl/inc/vcl/syswin.hxx8
-rw-r--r--vcl/inc/vcl/tabctrl.hxx3
-rw-r--r--vcl/inc/vcl/taskpanelist.hxx1
-rw-r--r--vcl/inc/vcl/threadex.hxx18
-rw-r--r--vcl/inc/vcl/throbber.hxx2
-rw-r--r--vcl/inc/vcl/toolbox.hxx31
-rw-r--r--vcl/inc/vcl/wall.hxx3
-rw-r--r--vcl/inc/vcl/window.hxx1
-rw-r--r--[-rwxr-xr-x]vcl/inc/win/salbmp.h0
-rw-r--r--vcl/inc/win/saldata.hxx2
-rw-r--r--[-rwxr-xr-x]vcl/inc/win/salframe.h0
-rw-r--r--[-rwxr-xr-x]vcl/inc/win/salmenu.h0
-rw-r--r--[-rwxr-xr-x]vcl/inc/win/salnativewidgets.h0
-rw-r--r--[-rwxr-xr-x]vcl/inc/win/salobj.h0
-rw-r--r--[-rwxr-xr-x]vcl/inc/win/salprn.h3
-rw-r--r--[-rwxr-xr-x]vcl/inc/win/salsys.h0
-rw-r--r--[-rwxr-xr-x]vcl/inc/win/saltimer.h0
-rw-r--r--[-rwxr-xr-x]vcl/inc/win/salvd.h0
-rw-r--r--[-rwxr-xr-x]vcl/inc/win/wincomp.hxx0
-rw-r--r--vcl/ios/source/app/saldata.cxx128
-rw-r--r--vcl/ios/source/app/salinst.cxx828
-rw-r--r--vcl/ios/source/app/salnstimer.mm59
-rw-r--r--vcl/ios/source/app/salsys.cxx253
-rw-r--r--vcl/ios/source/app/saltimer.cxx104
-rw-r--r--vcl/ios/source/app/vcluiapp.mm101
-rw-r--r--vcl/null/printerinfomanager.cxx51
-rw-r--r--vcl/prj/build.lst2
-rw-r--r--vcl/source/app/help.cxx28
-rw-r--r--vcl/source/app/settings.cxx40
-rw-r--r--vcl/source/app/svapp.cxx147
-rw-r--r--vcl/source/app/svdata.cxx17
-rw-r--r--vcl/source/app/svmainhook.cxx78
-rw-r--r--vcl/source/components/factory.cxx11
-rw-r--r--vcl/source/components/makefile.mk55
-rw-r--r--vcl/source/components/rasterizer_rsvg.cxx139
-rw-r--r--vcl/source/components/stringmirror.cxx3
-rw-r--r--vcl/source/control/field2.cxx210
-rw-r--r--vcl/source/control/quickselectionengine.cxx3
-rw-r--r--vcl/source/control/tabctrl.cxx30
-rw-r--r--vcl/source/control/throbber.cxx3
-rw-r--r--vcl/source/fontsubset/cff.cxx15
-rw-r--r--vcl/source/fontsubset/gsub.cxx4
-rw-r--r--vcl/source/fontsubset/list.c33
-rw-r--r--vcl/source/gdi/animate.cxx283
-rw-r--r--vcl/source/gdi/cvtsvm.cxx10
-rw-r--r--vcl/source/gdi/gdimtf.cxx1
-rw-r--r--vcl/source/gdi/graph.cxx7
-rw-r--r--vcl/source/gdi/graphictools.cxx20
-rw-r--r--vcl/source/gdi/image.cxx39
-rw-r--r--vcl/source/gdi/impgraph.cxx7
-rwxr-xr-xvcl/source/gdi/makefile.mk127
-rw-r--r--vcl/source/gdi/metaact.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx3
-rw-r--r--vcl/source/gdi/print.cxx66
-rw-r--r--vcl/source/gdi/print2.cxx43
-rw-r--r--vcl/source/gdi/print3.cxx4
-rw-r--r--vcl/source/gdi/region.cxx28
-rw-r--r--vcl/source/gdi/rendergraphic.cxx3
-rw-r--r--vcl/source/gdi/rendergraphicrasterizer.cxx3
-rw-r--r--vcl/source/gdi/sallayout.cxx85
-rw-r--r--vcl/source/gdi/svgread.cxx3
-rw-r--r--vcl/source/gdi/wall.cxx42
-rw-r--r--vcl/source/helper/canvastools.cxx17
-rw-r--r--vcl/source/helper/strhelper.cxx29
-rw-r--r--vcl/source/helper/threadex.cxx40
-rw-r--r--vcl/source/salmain/salmain.cxx2
-rw-r--r--vcl/source/window/accel.cxx273
-rw-r--r--vcl/source/window/dndlcon.cxx30
-rw-r--r--vcl/source/window/floatwin.cxx17
-rw-r--r--vcl/source/window/menu.cxx2
-rw-r--r--[-rwxr-xr-x]vcl/source/window/syschild.cxx13
-rw-r--r--vcl/source/window/syswin.cxx169
-rw-r--r--vcl/source/window/taskpanelist.cxx35
-rw-r--r--[-rwxr-xr-x]vcl/source/window/toolbox.cxx209
-rw-r--r--vcl/source/window/toolbox2.cxx182
-rw-r--r--[-rwxr-xr-x]vcl/source/window/window.cxx22
-rw-r--r--vcl/source/window/window2.cxx5
-rw-r--r--vcl/source/window/window4.cxx2
-rw-r--r--vcl/source/window/wpropset.cxx3
-rw-r--r--[-rwxr-xr-x]vcl/source/window/wrkwin.cxx0
-rw-r--r--vcl/unx/generic/app/i18n_xkb.cxx34
-rw-r--r--vcl/unx/generic/app/keysymnames.cxx6
-rw-r--r--vcl/unx/generic/app/saldisp.cxx40
-rw-r--r--vcl/unx/generic/app/wmadaptor.cxx30
-rw-r--r--vcl/unx/generic/fontmanager/fontcache.cxx121
-rw-r--r--vcl/unx/generic/fontmanager/fontconfig.cxx722
-rw-r--r--vcl/unx/generic/fontmanager/fontmanager.cxx81
-rw-r--r--vcl/unx/generic/gdi/salbmp.cxx320
-rw-r--r--vcl/unx/generic/gdi/salgdi3.cxx325
-rw-r--r--vcl/unx/generic/gdi/salprnpsp.cxx20
-rw-r--r--vcl/unx/generic/plugadapt/salplug.cxx2
-rw-r--r--vcl/unx/generic/printer/cupsmgr.cxx2
-rw-r--r--vcl/unx/generic/printer/jobdata.cxx69
-rw-r--r--vcl/unx/generic/printer/ppdparser.cxx45
-rw-r--r--vcl/unx/generic/printer/printerinfomanager.cxx41
-rw-r--r--vcl/unx/generic/printergfx/common_gfx.cxx2
-rw-r--r--vcl/unx/generic/printergfx/printerjob.cxx11
-rw-r--r--vcl/unx/generic/window/salframe.cxx2
-rw-r--r--vcl/unx/gtk/a11y/atkutil.cxx136
-rw-r--r--vcl/unx/gtk/app/gtkdata.cxx75
-rw-r--r--vcl/unx/gtk/app/gtksys.cxx25
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx13
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atkaction.cxx3
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atkbridge.cxx3
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atkcomponent.cxx3
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atkeditabletext.cxx3
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atkfactory.cxx3
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atkhypertext.cxx3
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atkimage.cxx3
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atklistener.cxx3
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atkregistry.cxx3
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atkselection.cxx3
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atktable.cxx3
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atktext.cxx3
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atktextattributes.cxx3
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atkutil.cxx3
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atkvalue.cxx3
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atkwindow.cxx3
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx3
-rw-r--r--vcl/unx/gtk3/app/gtk3gtkdata.cxx3
-rw-r--r--vcl/unx/gtk3/app/gtk3gtkinst.cxx3
-rw-r--r--vcl/unx/gtk3/app/gtk3gtksys.cxx3
-rw-r--r--vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx6
-rw-r--r--vcl/unx/gtk3/window/gtk3gtkframe.cxx3
-rw-r--r--vcl/unx/gtk3/window/gtk3gtkobject.cxx3
-rw-r--r--vcl/unx/headless/svpbmp.cxx2
-rw-r--r--vcl/unx/headless/svpdummies.cxx4
-rw-r--r--vcl/unx/headless/svpelement.cxx8
-rw-r--r--vcl/unx/headless/svpframe.cxx6
-rw-r--r--vcl/unx/headless/svpgdi.cxx6
-rw-r--r--vcl/unx/headless/svpinst.cxx10
-rw-r--r--vcl/unx/headless/svpprn.cxx6
-rw-r--r--vcl/unx/headless/svppspgraphics.cxx12
-rw-r--r--vcl/unx/headless/svptext.cxx6
-rw-r--r--vcl/unx/headless/svpvd.cxx4
-rw-r--r--vcl/unx/kde4/KDESalFrame.cxx2
-rwxr-xr-xvcl/util/makefile.mk465
-rw-r--r--vcl/vcl.android.component43
-rw-r--r--vcl/vcl.ios.component43
-rw-r--r--vcl/vcl.macosx.component2
-rw-r--r--vcl/vcl.unx.component2
-rw-r--r--vcl/vcl.windows.component2
-rw-r--r--[-rwxr-xr-x]vcl/win/source/app/saldata.cxx0
-rw-r--r--[-rwxr-xr-x]vcl/win/source/app/salinfo.cxx0
-rw-r--r--vcl/win/source/app/salinst.cxx19
-rw-r--r--[-rwxr-xr-x]vcl/win/source/app/salshl.cxx0
-rw-r--r--[-rwxr-xr-x]vcl/win/source/app/saltimer.cxx7
-rw-r--r--[-rwxr-xr-x]vcl/win/source/gdi/salbmp.cxx0
-rw-r--r--vcl/win/source/gdi/salgdi_gdiplus.cxx104
-rw-r--r--vcl/win/source/gdi/salprn.cxx754
-rw-r--r--[-rwxr-xr-x]vcl/win/source/gdi/salvd.cxx0
-rw-r--r--vcl/win/source/gdi/winlayout.cxx6
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/salsrc.rc167
-rw-r--r--vcl/win/source/window/salframe.cxx195
-rw-r--r--[-rwxr-xr-x]vcl/win/source/window/salobj.cxx0
-rw-r--r--vcl/workben/makefile.mk4
-rw-r--r--vcl/workben/svdem.cxx2
-rw-r--r--vcl/workben/vcldemo.cxx2
267 files changed, 6094 insertions, 5365 deletions
diff --git a/vcl/Library_desktop_detector.mk b/vcl/Library_desktop_detector.mk
index 8d4654c4e0b6..3673218468aa 100644
--- a/vcl/Library_desktop_detector.mk
+++ b/vcl/Library_desktop_detector.mk
@@ -36,7 +36,6 @@ $(eval $(call gb_Library_set_include,desktop_detector,\
-I$(realpath $(SRCDIR)/vcl/inc) \
-I$(realpath $(SRCDIR)/vcl/inc/pch) \
-I$(SRCDIR)/solenv/inc \
- -I$(OUTDIR)/inc/offuh \
-I$(OUTDIR)/inc \
))
@@ -44,6 +43,11 @@ $(eval $(call gb_Library_add_defs,desktop_detector,\
-DDESKTOP_DETECTOR_IMPLEMENTATION \
))
+$(eval $(call gb_Library_add_api,desktop_detector,\
+ offapi \
+ udkapi \
+))
+
$(eval $(call gb_Library_add_linked_libs,desktop_detector,\
vcl \
tl \
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index fb7ab96aada3..7ca41baa4b62 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -31,6 +31,10 @@ ifeq ($(OS),MACOSX)
$(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.macosx))
else ifeq ($(OS),WNT)
$(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.windows))
+else ifeq ($(GUIBASE),android)
+$(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.android,vcl/vcl))
+else ifeq ($(OS),IOS)
+$(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.ios,vcl/vcl))
else
$(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.unx))
endif
@@ -38,18 +42,23 @@ endif
$(eval $(call gb_Library_add_package_headers,vcl,vcl_inc))
$(eval $(call gb_Library_add_package_headers,vcl,vcl_afmhash))
+ifeq ($(OS)$(COM),WNTGCC)
+WINEINCLUDE=-I$(OUTDIR)/inc/external/wine
+endif
+
$(eval $(call gb_Library_set_include,vcl,\
$$(INCLUDE) \
-I$(realpath $(SRCDIR)/vcl/inc) \
-I$(realpath $(SRCDIR)/vcl/inc/pch) \
-I$(SRCDIR)/solenv/inc \
- -I$(OUTDIR)/inc/offuh \
-I$(OUTDIR)/inc \
+ $(WINEINCLUDE) \
-I$(WORKDIR)/CustomTarget/vcl/unx/generic/fontmanager \
))
ifeq ($(GUIBASE),unx)
$(eval $(call gb_Library_set_include,vcl,\
$$(INCLUDE) \
+ $$(FONTCONFIG_CFLAGS) \
$$(FREETYPE_CFLAGS) \
))
endif
@@ -60,6 +69,11 @@ $(eval $(call gb_Library_add_defs,vcl,\
-DDLLPOSTFIX=$(subst $(or $(gb_Library_DLLEXT),$(gb_Library_PLAINEXT)),,$(gb_Library_OOOEXT)) \
))
+$(eval $(call gb_Library_add_api,vcl,\
+ offapi \
+ udkapi \
+))
+
$(eval $(call gb_Library_add_linked_libs,vcl,\
tl \
utl \
@@ -82,21 +96,10 @@ $(call gb_Library_use_externals,vcl,\
icuuc \
)
-ifeq ($(GUIBASE),unx)
-$(eval $(call gb_Library_add_linked_libs,vcl,\
- freetype \
-))
-endif
-
ifeq ($(GUIBASE),aqua)
$(eval $(call gb_Library_add_cxxflags,vcl,\
$(gb_OBJCXXFLAGS) \
))
-ifeq ($(ENABLE_CAIRO),TRUE)
-$(eval $(call gb_Library_add_defs,vcl,\
- -DCAIRO \
-))
-endif
$(eval $(call gb_Library_add_objcxxobjects,vcl,\
vcl/aqua/source/a11y/aqua11yactionwrapper \
vcl/aqua/source/a11y/aqua11ycomponentwrapper \
@@ -172,18 +175,12 @@ $(eval $(call gb_Library_add_defs,vcl,\
-DSAL_DLLPOSTFIX=\"$(gb_Library_OOOEXT)\" \
-D_XSALSET_LIBNAME=\"$(call gb_Library_get_runtime_filename,spa)\" \
))
-## handle fontconfig
-ifneq ($(ENABLE_FONTCONFIG),)
-$(eval $(call gb_Library_add_defs,vcl,\
- -DENABLE_FONTCONFIG \
-))
## handle CUPS
ifneq ($(ENABLE_CUPS),)
$(eval $(call gb_Library_add_defs,vcl,\
-DENABLE_CUPS \
))
endif
-endif
$(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/glyphs/gcach_ftyp \
vcl/source/glyphs/gcach_layout \
@@ -202,6 +199,19 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
))
endif
+ifeq ($(GUIBASE),android)
+$(eval $(call gb_Library_set_defs,vcl,\
+ $$(DEFS) \
+ -DSAL_DLLPREFIX=\"$(gb_Library_SYSPRE)\" \
+ -DSAL_DLLPOSTFIX=\"$(gb_Library_OOOEXT)\" \
+ -D_XSALSET_LIBNAME=\"$(call gb_Library_get_runtime_filename,spa)\" \
+))
+$(eval $(call gb_Library_add_exception_objects,vcl,\
+ vcl/unx/generic/plugadapt/salplug \
+ vcl/null/printerinfomanager \
+))
+endif
+
ifeq ($(OS),WNT)
$(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/win/source/app/saldata \
@@ -225,7 +235,23 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
))
$(eval $(call gb_Library_add_nativeres,vcl,src))
+endif
+ifeq ($(GUIBASE),cocoatouch)
+$(eval $(call gb_Library_set_cxxflags,vcl,\
+ $$(CXXFLAGS) \
+ $$(OBJCXXFLAGS) \
+))
+$(eval $(call gb_Library_add_objcxxobjects,vcl,\
+ vcl/ios/source/app/salnstimer \
+ vcl/ios/source/app/vcluiapp \
+))
+$(eval $(call gb_Library_add_exception_objects,vcl,\
+ vcl/ios/source/app/saldata \
+ vcl/ios/source/app/salinst \
+ vcl/ios/source/app/salsys \
+ vcl/ios/source/app/saltimer \
+))
endif
$(eval $(call gb_Library_add_cobjects,vcl,\
@@ -256,7 +282,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/components/dtranscomp \
vcl/source/components/factory \
vcl/source/components/fontident \
- vcl/source/components/rasterizer_rsvg \
vcl/source/components/stringmirror \
vcl/source/control/button \
vcl/source/control/combobox \
@@ -362,7 +387,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/helper/strhelper \
vcl/source/helper/threadex \
vcl/source/helper/xconnection \
- vcl/source/salmain/salmain \
vcl/source/window/abstdlg \
vcl/source/window/accel \
vcl/source/window/accmgr \
@@ -411,7 +435,11 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/window/wpropset \
vcl/source/window/wrkwin \
))
-
+ifneq ($(OS),IOS)
+$(eval $(call gb_Library_add_exception_objects,vcl,\
+ vcl/source/salmain/salmain \
+))
+endif
## handle Graphite
ifneq ($(ENABLE_GRAPHITE),)
# add defines, graphite sources for all platforms
@@ -438,6 +466,62 @@ endif
$(call gb_Library_use_external,vcl,graphite)
endif
+## handle Cairo
+ifneq ($(ENABLE_LIBRSVG),NO)
+
+$(eval $(call gb_Library_add_exception_objects,vcl,\
+ vcl/source/components/rasterizer_rsvg \
+))
+
+$(eval $(call gb_Library_set_defs,vcl,\
+ $$(DEFS) \
+ -DENABLE_LIBRSVG \
+))
+ifeq ($(SYSTEM_CAIRO),YES)
+$(eval $(call gb_Library_set_cxxflags,vcl,\
+ $$(CXXFLAGS) \
+ $$(CAIRO_CFLAGS) \
+ -DSYSTEM_CAIRO \
+))
+
+# CAIRO_LIBS contains both -L and -l options. Thes sets LDFLAGS which
+# goes early into the linking command line before the object files. So
+# on platforms where libraries are searched for symbols undefined at
+# that point as they occur on the command line, it is pointless to
+# search the cairo library at that point as no references to cairo
+# entries have been read from object files yet.
+$(eval $(call gb_Library_set_ldflags,vcl,\
+ $$(LDFLAGS) \
+ $$(CAIRO_LIBS) \
+))
+
+# Thus we also need to add cairo to the list of linked libs. These go
+# after the object files on the linking command line.
+$(eval $(call gb_Library_add_linked_libs,vcl,\
+ cairo \
+))
+
+else
+$(eval $(call gb_Library_add_linked_libs,vcl,\
+ cairo \
+))
+ifeq ($(OS),LINUX)
+$(eval $(call gb_Library_add_linked_libs,vcl,\
+ freetype \
+ fontconfig \
+))
+endif
+endif
+endif
+
+ifeq ($(GUIBASE),unx)
+$(eval $(call gb_Library_set_ldflags,vcl,\
+ $$(LDFLAGS) \
+ $$(FONTCONFIG_LIBS) \
+ $$(FREETYPE_LIBS) \
+))
+endif
+
ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_linked_libs,vcl,\
dl \
@@ -471,9 +555,16 @@ $(eval $(call gb_Library_add_libs,vcl,\
endif
ifeq ($(OS),WNT)
+ifeq ($(COM),MSC)
$(eval $(call gb_Library_add_ldflags,vcl,\
/ENTRY:LibMain@12 \
))
+endif
+ifeq ($(COM),GCC)
+$(eval $(call gb_Library_set_ldflags,vcl,\
+ $$(LDFLAGS) \
+))
+endif
$(eval $(call gb_Library_add_linked_libs,vcl,\
advapi32 \
gdi32 \
@@ -483,7 +574,7 @@ $(eval $(call gb_Library_add_linked_libs,vcl,\
mpr \
msimg32 \
msvcrt \
- oldnames \
+ $(gb_Library_win32_OLDNAMES) \
ole32 \
shell32 \
user32 \
@@ -492,4 +583,14 @@ $(eval $(call gb_Library_add_linked_libs,vcl,\
winspool \
))
endif
+
+ifeq ($(GUIBASE),cocoatouch)
+$(eval $(call gb_Library_set_ldflags,vcl,\
+ $$(LDFLAGS) \
+ -framework UIKit \
+ -framework CoreFoundation \
+))
+endif
+
+
# vim: set noet sw=4 ts=4:
diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk
index 95428ae53853..819d9ce8c301 100644
--- a/vcl/Library_vclplug_gen.mk
+++ b/vcl/Library_vclplug_gen.mk
@@ -32,10 +32,14 @@ $(eval $(call gb_Library_set_include,vclplug_gen,\
-I$(SRCDIR)/vcl/inc \
-I$(SRCDIR)/vcl/inc/pch \
-I$(SRCDIR)/solenv/inc \
- -I$(OUTDIR)/inc/offuh \
-I$(OUTDIR)/inc \
))
+$(eval $(call gb_Library_add_api,vclplug_gen,\
+ offapi \
+ udkapi \
+))
+
$(eval $(call gb_Library_add_linked_libs,vclplug_gen,\
vcl \
tl \
@@ -63,6 +67,22 @@ $(call gb_Library_use_externals,vclplug_gen,\
icuuc \
)
+))
+$(eval $(call gb_Library_set_ldflags,vclplug_gen,\
+ $$(LDFLAGS) \
+ $$(CAIRO_LIBS) \
+))
+else
+$(eval $(call gb_Library_set_cxxflags,vclplug_gen,\
+ $$(CXXFLAGS) \
+ $$(FONTCONFIG_CFLAGS) \
+ $$(FREETYPE_CFLAGS) \
+))
+$(eval $(call gb_Library_add_linked_libs,vclplug_gen,\
+ cairo \
+))
+endif
+
$(eval $(call gb_Library_add_exception_objects,vclplug_gen,\
vcl/unx/generic/app/i18n_cb \
vcl/unx/generic/app/i18n_ic \
@@ -117,7 +137,6 @@ $(eval $(call gb_Library_add_defs,vclplug_gen,\
-DVCLPLUG_GEN_IMPLEMENTATION \
))
-
## handle RandR
ifneq ($(ENABLE_RANDR),)
$(eval $(call gb_Library_add_defs,vclplug_gen,\
diff --git a/vcl/Library_vclplug_gtk.mk b/vcl/Library_vclplug_gtk.mk
index cf4ac762022c..d9674f03cb8e 100644
--- a/vcl/Library_vclplug_gtk.mk
+++ b/vcl/Library_vclplug_gtk.mk
@@ -32,7 +32,6 @@ $(eval $(call gb_Library_set_include,vclplug_gtk,\
-I$(SRCDIR)/vcl/inc \
-I$(SRCDIR)/vcl/inc/pch \
-I$(SRCDIR)/solenv/inc \
- -I$(OUTDIR)/inc/offuh \
-I$(OUTDIR)/inc \
))
@@ -59,6 +58,11 @@ $(eval $(call gb_Library_add_libs,vclplug_gtk,\
))
endif
+$(eval $(call gb_Library_add_api,vclplug_gtk,\
+ offapi \
+ udkapi \
+))
+
$(eval $(call gb_Library_add_libs,vclplug_gtk,\
$$(GTK_LIBS) \
$$(GTHREAD_LIBS) \
diff --git a/vcl/Library_vclplug_gtk3.mk b/vcl/Library_vclplug_gtk3.mk
index 83fb8306468d..587d69376500 100644
--- a/vcl/Library_vclplug_gtk3.mk
+++ b/vcl/Library_vclplug_gtk3.mk
@@ -32,7 +32,6 @@ $(eval $(call gb_Library_set_include,vclplug_gtk3,\
-I$(SRCDIR)/vcl/inc \
-I$(SRCDIR)/vcl/inc/pch \
-I$(SRCDIR)/solenv/inc \
- -I$(OUTDIR)/inc/offuh \
-I$(OUTDIR)/inc \
))
@@ -47,6 +46,11 @@ $(eval $(call gb_Library_set_defs,vclplug_gtk3,\
-DVERSION=\"$(UPD)$(LAST_MINOR)\" \
))
+$(eval $(call gb_Library_add_api,vclplug_gtk3,\
+ offapi \
+ udkapi \
+))
+
ifneq ($(ENABLE_DBUS),)
$(eval $(call gb_Library_set_include,vclplug_gtk3,\
$$(INCLUDE) \
diff --git a/vcl/Library_vclplug_kde.mk b/vcl/Library_vclplug_kde.mk
index ddc429180528..e4586b8a108b 100644
--- a/vcl/Library_vclplug_kde.mk
+++ b/vcl/Library_vclplug_kde.mk
@@ -32,7 +32,6 @@ $(eval $(call gb_Library_set_include,vclplug_kde,\
-I$(SRCDIR)/vcl/inc \
-I$(SRCDIR)/vcl/inc/pch \
-I$(SRCDIR)/solenv/inc \
- -I$(OUTDIR)/inc/offuh \
-I$(OUTDIR)/inc \
))
@@ -45,6 +44,11 @@ $(eval $(call gb_Library_add_defs,vclplug_kde,\
-DVCLPLUG_KDE_IMPLEMENTATION \
))
+$(eval $(call gb_Library_add_api,vclplug_kde,\
+ offapi \
+ udkapi \
+))
+
$(eval $(call gb_Library_add_libs,vclplug_kde,\
$$(KDE_LIBS) \
))
diff --git a/vcl/Library_vclplug_kde4.mk b/vcl/Library_vclplug_kde4.mk
index 25695d9d5a33..bbc64aabcbdc 100644
--- a/vcl/Library_vclplug_kde4.mk
+++ b/vcl/Library_vclplug_kde4.mk
@@ -34,7 +34,6 @@ $(eval $(call gb_Library_set_include,vclplug_kde4,\
-I$(SRCDIR)/vcl/inc \
-I$(SRCDIR)/vcl/inc/pch \
-I$(SRCDIR)/solenv/inc \
- -I$(OUTDIR)/inc/offuh \
-I$(OUTDIR)/inc \
-I$(WORKDIR)/CustomTarget/vcl/unx/kde4 \
))
@@ -48,6 +47,11 @@ $(eval $(call gb_Library_add_defs,vclplug_kde4,\
-DVCLPLUG_KDE4_IMPLEMENTATION \
))
+$(eval $(call gb_Library_add_api,vclplug_kde4,\
+ offapi \
+ udkapi \
+))
+
$(eval $(call gb_Library_add_libs,vclplug_kde4,\
$$(KDE4_LIBS) \
))
diff --git a/vcl/Library_vclplug_svp.mk b/vcl/Library_vclplug_svp.mk
index 7df8f4790a17..7616e6c06025 100644
--- a/vcl/Library_vclplug_svp.mk
+++ b/vcl/Library_vclplug_svp.mk
@@ -32,7 +32,6 @@ $(eval $(call gb_Library_set_include,vclplug_svp,\
-I$(SRCDIR)/vcl/inc \
-I$(SRCDIR)/vcl/inc/pch \
-I$(SRCDIR)/solenv/inc \
- -I$(OUTDIR)/inc/offuh \
-I$(OUTDIR)/inc \
))
@@ -40,6 +39,11 @@ $(eval $(call gb_Library_add_defs,vclplug_svp,\
-DVCLPLUG_SVP_IMPLEMENTATION \
))
+$(eval $(call gb_Library_add_api,vclplug_svp,\
+ offapi \
+ udkapi \
+))
+
$(eval $(call gb_Library_add_linked_libs,vclplug_svp,\
vcl \
vclplug_gen \
diff --git a/vcl/StaticLibrary_vclmain.mk b/vcl/StaticLibrary_vclmain.mk
index 044ce10ca40c..4c313f88b082 100644
--- a/vcl/StaticLibrary_vclmain.mk
+++ b/vcl/StaticLibrary_vclmain.mk
@@ -27,15 +27,26 @@
$(eval $(call gb_StaticLibrary_StaticLibrary,vclmain))
+ifeq ($(OS),IOS)
+$(eval $(call gb_StaticLibrary_set_cxxflags,vclmain,\
+ $$(CXXFLAGS) \
+ -x objective-c++ -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 \
+))
+endif
+
$(eval $(call gb_StaticLibrary_set_include,vclmain,\
$$(INCLUDE) \
-I$(realpath $(SRCDIR)/vcl/inc) \
-I$(realpath $(SRCDIR)/vcl/inc/pch) \
-I$(SRCDIR)/solenv/inc \
- -I$(OUTDIR)/inc/offuh \
-I$(OUTDIR)/inc \
))
+$(eval $(call gb_StaticLibrary_add_api,vclmain,\
+ offapi \
+ udkapi \
+))
+
$(eval $(call gb_StaticLibrary_add_exception_objects,vclmain,\
vcl/source/salmain/salmain \
))
@@ -45,7 +56,7 @@ $(eval $(call gb_StaticLibrary_add_exception_objects,vclmain,\
# Instead of this evil linking of an object from $(OUTDIR)
define StaticLibrary_salmain_hack
$(call gb_StaticLibrary_get_target,vclmain) : $(OUTDIR)/lib/$(1)
-$$(eval $$(call gb_Deliver_add_deliverable,$(OUTDIR)/lib/$(1),$(call gb_CxxObject_get_target,vcl/source/salmain/salmain)))
+$$(eval $$(call gb_Deliver_add_deliverable,$(OUTDIR)/lib/$(1),$(call gb_CxxObject_get_target,vcl/source/salmain/salmain),$(OUTDIR)/lib/$(1)))
$(OUTDIR)/lib/$(1) : $(call gb_CxxObject_get_target,vcl/source/salmain/salmain)
$$(call gb_Deliver_deliver,$$<,$$@)
diff --git a/vcl/aqua/source/a11y/aqua11yactionwrapper.mm b/vcl/aqua/source/a11y/aqua11yactionwrapper.mm
index e49ad251faad..d0f8ca91c73d 100644
--- a/vcl/aqua/source/a11y/aqua11yactionwrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11yactionwrapper.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,3 +83,5 @@
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm
index c66e7c3d8515..0f50dad02c0e 100644
--- a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -108,3 +109,5 @@ using namespace ::com::sun::star::uno;
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11yfactory.mm b/vcl/aqua/source/a11y/aqua11yfactory.mm
index 41b66d19e578..944a8e9ea90a 100644
--- a/vcl/aqua/source/a11y/aqua11yfactory.mm
+++ b/vcl/aqua/source/a11y/aqua11yfactory.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -198,3 +199,5 @@ static bool enabled = false;
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11yrolehelper.mm b/vcl/aqua/source/a11y/aqua11yrolehelper.mm
index cfc052e96beb..e989f38f4a1b 100644
--- a/vcl/aqua/source/a11y/aqua11yrolehelper.mm
+++ b/vcl/aqua/source/a11y/aqua11yrolehelper.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,6 +43,10 @@ using namespace ::com::sun::star::uno;
+(id)simpleMapNativeRoleFrom: (XAccessibleContext *) accessibleContext {
id nativeRole = nil;
+
+ if (accessibleContext == NULL)
+ return nativeRole;
+
switch( accessibleContext -> getAccessibleRole() ) {
#define MAP(a,b) \
case a: nativeRole = b; break
@@ -272,3 +277,5 @@ using namespace ::com::sun::star::uno;
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm b/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm
index 5b8d604f3b1a..960afb384caa 100644
--- a/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -94,3 +95,5 @@ using namespace ::com::sun::star::uno;
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ytablewrapper.mm b/vcl/aqua/source/a11y/aqua11ytablewrapper.mm
index 110cb42ffee7..47b766df2223 100644
--- a/vcl/aqua/source/a11y/aqua11ytablewrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ytablewrapper.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -210,3 +211,5 @@ using namespace ::com::sun::star::uno;
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
index 2122f56e9565..5a4628edb76e 100644
--- a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -254,3 +255,5 @@ using namespace ::rtl;
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ytextwrapper.mm b/vcl/aqua/source/a11y/aqua11ytextwrapper.mm
index d956d2beb0b7..cb6fae77a7a9 100644
--- a/vcl/aqua/source/a11y/aqua11ytextwrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ytextwrapper.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -299,3 +300,5 @@ using namespace ::rtl;
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11yutil.mm b/vcl/aqua/source/a11y/aqua11yutil.mm
index 74de0a19aa41..b244f1f67855 100644
--- a/vcl/aqua/source/a11y/aqua11yutil.mm
+++ b/vcl/aqua/source/a11y/aqua11yutil.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,3 +53,5 @@ using namespace ::com::sun::star::awt;
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm b/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm
index fb257921b13e..fc10d44058d8 100644
--- a/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,3 +94,5 @@ using namespace ::com::sun::star::uno;
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ywrapper.mm b/vcl/aqua/source/a11y/aqua11ywrapper.mm
index bf8de98c3318..2376111eb427 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrapper.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1145,3 +1146,5 @@ Reference < XAccessibleContext > hitTestRunner ( com::sun::star::awt::Point poin
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperbutton.mm b/vcl/aqua/source/a11y/aqua11ywrapperbutton.mm
index e51ceff14af9..dd9b95901d13 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperbutton.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrapperbutton.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,3 +61,5 @@
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm
index 6bf2aa2f8340..1c70d774d0eb 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,3 +65,5 @@
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm b/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm
index 6f8e9d05d112..1fd7468f8858 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -161,3 +162,5 @@ using namespace ::com::sun::star::uno;
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ywrappergroup.mm b/vcl/aqua/source/a11y/aqua11ywrappergroup.mm
index 536cc9bba8eb..f3e1dcf769c5 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappergroup.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrappergroup.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,3 +56,5 @@
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperlist.mm b/vcl/aqua/source/a11y/aqua11ywrapperlist.mm
index d70679ed6966..9c7f5f6fe932 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperlist.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrapperlist.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,3 +47,5 @@ using namespace ::com::sun::star::accessibility;
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm
index 4c1e9047d65e..af4fda68a86e 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,3 +64,5 @@
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperradiogroup.mm b/vcl/aqua/source/a11y/aqua11ywrapperradiogroup.mm
index 52e71620ceed..47668005376a 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperradiogroup.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrapperradiogroup.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,3 +47,5 @@
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperrow.mm b/vcl/aqua/source/a11y/aqua11ywrapperrow.mm
index 0fd65fd01365..8ecd37aafc1c 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperrow.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrapperrow.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,3 +56,5 @@
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperscrollarea.mm b/vcl/aqua/source/a11y/aqua11ywrapperscrollarea.mm
index 8a481b64926d..7c9c6f12fc63 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperscrollarea.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrapperscrollarea.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -83,3 +84,5 @@
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperscrollbar.mm b/vcl/aqua/source/a11y/aqua11ywrapperscrollbar.mm
index 42b67b739602..5087ae5e3f3e 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperscrollbar.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrapperscrollbar.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,3 +50,5 @@ using namespace ::com::sun::star::accessibility;
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ywrappersplitter.mm b/vcl/aqua/source/a11y/aqua11ywrappersplitter.mm
index 37821f25e423..96f8c6413cc9 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappersplitter.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrappersplitter.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,3 +47,5 @@ using namespace ::com::sun::star::accessibility;
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperstatictext.mm b/vcl/aqua/source/a11y/aqua11ywrapperstatictext.mm
index d5afe0962904..d280264a36bd 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperstatictext.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrapperstatictext.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,3 +55,5 @@
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ywrappertabgroup.mm b/vcl/aqua/source/a11y/aqua11ywrappertabgroup.mm
index fb4e66ad9b90..09fa3d2b6947 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappertabgroup.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrappertabgroup.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,3 +49,5 @@
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ywrappertextarea.mm b/vcl/aqua/source/a11y/aqua11ywrappertextarea.mm
index a90fe7ae28aa..074b6d84d427 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappertextarea.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrappertextarea.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,3 +47,5 @@
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11ywrappertoolbar.mm b/vcl/aqua/source/a11y/aqua11ywrappertoolbar.mm
index 29ddaf540266..636be7b2fd32 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappertoolbar.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrappertoolbar.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,3 +49,5 @@
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/app/salnstimer.mm b/vcl/aqua/source/app/salnstimer.mm
index f44c3d698f73..d78a3ae8462e 100755..100644
--- a/vcl/aqua/source/app/salnstimer.mm
+++ b/vcl/aqua/source/app/salnstimer.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,3 +56,4 @@
}
@end
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm
index fc4945e1e184..2424d373b24e 100755..100644
--- a/vcl/aqua/source/app/vclnsapp.mm
+++ b/vcl/aqua/source/app/vclnsapp.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,6 +58,10 @@
}
@end
+// If you wonder how this VCL_NSApplication stuff works, one thing you
+// might have missed is that the NSPrincipalClass property in
+// desktop/macosx/Info.plist has the value VCL_NSApplication.
+
@implementation VCL_NSApplication
-(void)sendEvent:(NSEvent*)pEvent
{
@@ -520,3 +525,4 @@
@end
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
index 2bb67dcc1940..abe314f27f8f 100644
--- a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
+++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1389,3 +1390,5 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/gdi/aquaprintview.mm b/vcl/aqua/source/gdi/aquaprintview.mm
index 692435fc00f0..a7a527a9289b 100755..100644
--- a/vcl/aqua/source/gdi/aquaprintview.mm
+++ b/vcl/aqua/source/gdi/aquaprintview.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,3 +83,5 @@
mpController->printFilteredPage( nPage-1 );
}
@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx
index 94022b763a03..1c193378b9cf 100644
--- a/vcl/aqua/source/gdi/salatslayout.cxx
+++ b/vcl/aqua/source/gdi/salatslayout.cxx
@@ -1043,7 +1043,6 @@ bool ATSLayout::GetDeltaY() const
if( mpDeltaY != NULL )
return true;
-#if 1
if( !maATSULayout )
return false;
@@ -1069,7 +1068,6 @@ bool ATSLayout::GetDeltaY() const
mpDeltaY = NULL;
return false;
}
-#endif
return true;
}
diff --git a/vcl/aqua/source/gdi/salbmp.cxx b/vcl/aqua/source/gdi/salbmp.cxx
index bfb15f0a8076..6afad341e5b0 100644
--- a/vcl/aqua/source/gdi/salbmp.cxx
+++ b/vcl/aqua/source/gdi/salbmp.cxx
@@ -871,7 +871,6 @@ bool AquaSalBitmap::GetSystemData( BitmapSystemData& rData )
{
bRet = true;
-#ifdef CAIRO
if ((CGBitmapContextGetBitsPerPixel(mxGraphicContext) == 32) &&
(CGBitmapContextGetBitmapInfo(mxGraphicContext) & kCGBitmapByteOrderMask) != kCGBitmapByteOrder32Host) {
/**
@@ -904,7 +903,6 @@ bool AquaSalBitmap::GetSystemData( BitmapSystemData& rData )
CGImageRelease( xImage );
mxGraphicContext = mxGraphicContextNew;
}
-#endif
rData.rImageContext = (void *) mxGraphicContext;
rData.mnWidth = mnWidth;
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index ade5594ec667..54ebe8090f1c 100755..100644
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*n***********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1728,3 +1729,4 @@ private:
@end
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/window/salnsmenu.mm b/vcl/aqua/source/window/salnsmenu.mm
index b86caa49d870..c2f182773ce6 100755..100644
--- a/vcl/aqua/source/window/salnsmenu.mm
+++ b/vcl/aqua/source/window/salnsmenu.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -213,3 +214,4 @@
@end
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/android/svsys.h b/vcl/inc/android/svsys.h
new file mode 100644
index 000000000000..9dabc7187400
--- /dev/null
+++ b/vcl/inc/android/svsys.h
@@ -0,0 +1,36 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is Tor Lillqvist <tml@iki.fi>
+ * Portions created by the Initial Developer are Copyright (C) 2011 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef _VCL_ANDROID_SVSYS_H
+#define _VCL_ANDROID_SVSYS_H
+
+
+// ?
+
+#endif // _VCL_ANDROID_SVSYS_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index 6b6bce184770..592f6a73c050 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -144,8 +144,6 @@ private:
sal_uLong ImplGetAnimationLoopCount() const;
void ImplResetAnimationLoopCount();
- List* ImplGetAnimationInfoList() const;
-
private:
GraphicReader* ImplGetContext();
diff --git a/vcl/inc/ios/iosvcltypes.h b/vcl/inc/ios/iosvcltypes.h
new file mode 100644
index 000000000000..820547b6a013
--- /dev/null
+++ b/vcl/inc/ios/iosvcltypes.h
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is Tor Lillqvist <tml@iki.fi>
+ * Portions created by the Initial Developer are Copyright (C) 2011 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef _IOSVCLTYPES_H
+#define _IOSVCLTYPES_H
+
+#include "premac.h"
+#import <UIKit/UIKit.h>
+#include "postmac.h"
+
+#endif _IOSVCLTYPES_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salbmp.h b/vcl/inc/ios/salbmp.h
new file mode 100644
index 000000000000..0c3e1468b154
--- /dev/null
+++ b/vcl/inc/ios/salbmp.h
@@ -0,0 +1,117 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+************************************************************************/
+
+#ifndef _SV_SALBMP_H
+#define _SV_SALBMP_H
+
+#include "tools/gen.hxx"
+
+#include "basebmp/bitmapdevice.hxx"
+
+#include "vcl/salbtype.hxx"
+
+#include "ios/salgdi.h"
+
+#include "saldata.hxx"
+#include "salinst.hxx"
+#include "salvd.hxx"
+#include "salbmp.hxx"
+
+#include "salcolorutils.hxx"
+
+
+// --------------
+// - SalBitmap -
+// --------------
+
+struct BitmapBuffer;
+class BitmapColor;
+class BitmapPalette;
+class IosSalVirtualDevice;
+class IosSalGraphics;
+
+class IosSalBitmap : public SalBitmap
+{
+public:
+ CGContextRef mxGraphicContext;
+ mutable CGImageRef mxCachedImage;
+ BitmapPalette maPalette;
+ basebmp::RawMemorySharedArray maUserBuffer;
+ basebmp::RawMemorySharedArray maContextBuffer;
+ sal_uInt16 mnBits;
+ int mnWidth;
+ int mnHeight;
+ sal_uInt32 mnBytesPerRow;
+
+public:
+ IosSalBitmap();
+ virtual ~IosSalBitmap();
+
+public:
+
+ // SalBitmap methods
+ bool Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
+ bool Create( const SalBitmap& rSalBmp );
+ bool Create( const SalBitmap& rSalBmp, SalGraphics* pGraphics );
+ bool Create( const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount );
+ virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
+ Size& rSize,
+ bool bMask = false );
+
+ void Destroy();
+
+ Size GetSize() const;
+ sal_uInt16 GetBitCount() const;
+
+ BitmapBuffer *AcquireBuffer( bool bReadOnly );
+ void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
+
+ bool GetSystemData( BitmapSystemData& rData );
+
+private:
+ // quartz helper
+ bool CreateContext();
+ void DestroyContext();
+ bool AllocateUserData();
+
+ void ConvertBitmapData( sal_uInt32 nWidth, sal_uInt32 nHeight,
+ sal_uInt16 nDestBits, sal_uInt32 nDestBytesPerRow, const BitmapPalette& rDestPalette, sal_uInt8* pDestData,
+ sal_uInt16 nSrcBits, sal_uInt32 nSrcBytesPerRow, const BitmapPalette& rSrcPalette, sal_uInt8* pSrcData );
+
+public:
+ bool Create( CGLayerRef xLayer, int nBitCount, int nX, int nY, int nWidth, int nHeight, bool bMirrorVert = true );
+
+public:
+ CGImageRef CreateWithMask( const IosSalBitmap& rMask, int nX, int nY, int nWidth, int nHeight ) const;
+ CGImageRef CreateColorMask( int nX, int nY, int nWidth, int nHeight, SalColor nMaskColor ) const;
+ CGImageRef CreateCroppedImage( int nX, int nY, int nWidth, int nHeight ) const;
+};
+
+#endif // _SV_SALBMP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salcolorutils.hxx b/vcl/inc/ios/salcolorutils.hxx
new file mode 100644
index 000000000000..d6db5f839e04
--- /dev/null
+++ b/vcl/inc/ios/salcolorutils.hxx
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALCOLORUTILS_HXX
+#define _SV_SALCOLORUTILS_HXX
+
+#include "vcl/salbtype.hxx"
+#include "vcl/salgtype.hxx"
+#include "salmathutils.hxx"
+
+// ------------------------------------------------------------------
+
+SalColor GetSalColor( const float* pQuartzColor );
+
+void SetSalColor( const SalColor& rColor, float* pQuartzColor );
+
+// ------------------------------------------------------------------
+
+#endif // _SV_SALCOLORUTILS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/saldata.hxx b/vcl/inc/ios/saldata.hxx
new file mode 100644
index 000000000000..764264e42462
--- /dev/null
+++ b/vcl/inc/ios/saldata.hxx
@@ -0,0 +1,126 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALDATA_HXX
+#define _SV_SALDATA_HXX
+
+#include "premac.h"
+#include <UIKit/UIKit.h>
+#include "postmac.h"
+
+#include "com/sun/star/uno/Reference.hxx"
+
+#include "vcl/ptrstyle.hxx"
+
+#include "svdata.hxx"
+#include "salwtype.hxx"
+
+#include <list>
+#include <vector>
+#include <map>
+#include <boost/unordered_set.hpp>
+
+#include <cstdio>
+#include <cstdarg>
+
+class IosSalInstance;
+class SalObject;
+class SalFrame;
+class SalVirtualDevice;
+class SalPrinter;
+class SystemFontList;
+
+// ------------------
+// - Some constants -
+// ------------------
+
+#define SAL_CLIPRECT_COUNT 16
+
+#define VER_TIGER 0x1040
+#define VER_LEOPARD 0x1050
+
+// -----------
+// - SalData -
+// -----------
+
+class IosSalFrame;
+struct FrameHash : public boost::hash<sal_IntPtr>
+{
+ size_t operator()(const IosSalFrame* frame) const
+ { return boost::hash<sal_IntPtr>::operator()( reinterpret_cast<const sal_IntPtr>(frame) ); }
+};
+
+struct SalData
+{
+
+ SALTIMERPROC mpTimerProc; // timer callback proc
+ IosSalInstance *mpFirstInstance; // pointer of first instance
+ std::list<IosSalFrame*> maFrames; // pointer of first frame
+ boost::unordered_set<const IosSalFrame*,FrameHash> maFrameCheck; // for fast check of frame existance
+ SalObject *mpFirstObject; // pointer of first object window
+ SalVirtualDevice *mpFirstVD; // first VirDev
+ SalPrinter *mpFirstPrinter; // first printing printer
+ SystemFontList *mpFontList;
+
+ CGColorSpaceRef mxRGBSpace;
+ CGColorSpaceRef mxGraySpace;
+ CGColorSpaceRef mxP50Space;
+ CGPatternRef mxP50Pattern;
+
+ std::vector< UIMenuItem* > maFallbackMenu;
+
+ static oslThreadKey s_aAutoReleaseKey;
+
+ SInt32 mnSystemVersion; // Store System Version
+
+ long mnDPIX; // #i100617# read DPI only once per office life
+ long mnDPIY; // #i100617# read DPI only once per office life
+
+ com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
+ mxClipboard;
+
+ SalData();
+ ~SalData();
+
+ static void ensureThreadAutoreleasePool();
+ static void drainThreadAutoreleasePool();
+};
+
+inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = (void*)pData; }
+inline SalData *GetSalData() { return (SalData*)ImplGetSVData()->mpSalData; }
+inline SalData *GetAppSalData() { return (SalData*)ImplGetAppSVData()->mpSalData; }
+
+// --- Prototypes ---
+
+sal_Bool ImplSalYieldMutexTryToAcquire();
+void ImplSalYieldMutexAcquire();
+void ImplSalYieldMutexRelease();
+
+#endif // _SV_SALDATA_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salframe.h b/vcl/inc/ios/salframe.h
new file mode 100644
index 000000000000..14761fe36ebd
--- /dev/null
+++ b/vcl/inc/ios/salframe.h
@@ -0,0 +1,208 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALFRAME_H
+#define _SV_SALFRAME_H
+
+#include "vcl/sysdata.hxx"
+
+#include "ios/salmenu.h"
+#include "ios/saldata.hxx"
+#include "ios/iosvcltypes.h"
+
+#include "salframe.hxx"
+
+#include <vector>
+#include <utility>
+#include <stdexcept>
+
+#include <boost/shared_ptr.hpp>
+
+class IosSalGraphics;
+class IosSalFrame;
+class IosSalTimer;
+class IosSalInstance;
+class IosSalMenu;
+class IosBlinker;
+
+typedef struct SalFrame::SalPointerState SalPointerState;
+
+// ----------------
+// - IosSalFrame -
+// ----------------
+
+class IosSalFrame : public SalFrame
+{
+public:
+ UIWindow* mpWindow;
+ UIView* mpView;
+ CGRect maScreenRect; // for mirroring purposes
+ IosSalGraphics* mpGraphics;
+ IosSalFrame* mpParent;
+ SystemEnvData maSysData;
+ int mnMinWidth; // min. client width in pixels
+ int mnMinHeight; // min. client height in pixels
+ int mnMaxWidth; // max. client width in pixels
+ int mnMaxHeight; // max. client height in pixels
+ CGRect maFullScreenRect; // old window size when in FullScreen
+ bool mbGraphics:1; // is Graphics used?
+ bool mbShown:1;
+ bool mbInitShow:1;
+ bool mbPresentation:1;
+
+ sal_uLong mnStyle;
+ unsigned int mnStyleMask; // our style mask from UIWindow creation
+
+ sal_uLong mnLastEventTime;
+ unsigned int mnLastModifierFlags;
+ IosSalMenu* mpMenu;
+
+ SalExtStyle mnExtStyle; // currently document frames are marked this way
+
+ PointerStyle mePointerStyle; // currently active pointer style
+
+ CGMutablePathRef mrClippingPath; // used for "shaping"
+ std::vector< CGRect > maClippingRects;
+
+ std::list<IosBlinker*> maBlinkers;
+
+ Rectangle maInvalidRect;
+
+ sal_uLong mnICOptions;
+
+ boost::shared_ptr< Timer > mpActivityTimer; // Timer to prevent system sleep during presentation
+public:
+ /** Constructor
+
+ Creates a system window and connects this frame with it.
+
+ @throws std::runtime_error in case window creation fails
+ */
+ IosSalFrame( SalFrame* pParent, sal_uLong salFrameStyle );
+
+ virtual ~IosSalFrame();
+
+ virtual SalGraphics* GetGraphics();
+ virtual void ReleaseGraphics( SalGraphics* pGraphics );
+ virtual sal_Bool PostEvent( void* pData );
+ virtual void SetTitle( const XubString& rTitle );
+ virtual void SetIcon( sal_uInt16 nIcon );
+ virtual void SetRepresentedURL( const rtl::OUString& );
+ virtual void SetMenu( SalMenu* pSalMenu );
+ virtual void DrawMenuBar();
+ virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False );
+ virtual void Enable( sal_Bool bEnable );
+ virtual void SetMinClientSize( long nWidth, long nHeight );
+ virtual void SetMaxClientSize( long nWidth, long nHeight );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
+ virtual void GetClientSize( long& rWidth, long& rHeight );
+ virtual void GetWorkArea( Rectangle& rRect );
+ virtual SalFrame* GetParent() const;
+ virtual void SetWindowState( const SalFrameState* pState );
+ virtual sal_Bool GetWindowState( SalFrameState* pState );
+ virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay );
+ virtual void StartPresentation( sal_Bool bStart );
+ virtual void SetAlwaysOnTop( sal_Bool bOnTop );
+ virtual void ToTop( sal_uInt16 nFlags );
+ virtual void SetPointer( PointerStyle ePointerStyle );
+ virtual void CaptureMouse( sal_Bool bMouse );
+ virtual void SetPointerPos( long nX, long nY );
+ virtual void Flush( void );
+ virtual void Flush( const Rectangle& );
+ virtual void Sync();
+ virtual void SetInputContext( SalInputContext* pContext );
+ virtual void EndExtTextInput( sal_uInt16 nFlags );
+ virtual String GetKeyName( sal_uInt16 nKeyCode );
+ virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode );
+ virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
+ virtual LanguageType GetInputLanguage();
+ virtual SalBitmap* SnapShot();
+ virtual void UpdateSettings( AllSettings& rSettings );
+ virtual void Beep( SoundType eSoundType );
+ virtual const SystemEnvData* GetSystemData() const;
+ virtual SalPointerState GetPointerState();
+ virtual SalIndicatorState GetIndicatorState();
+ virtual void SimulateKeyPress( sal_uInt16 nKeyCode );
+ virtual void SetParent( SalFrame* pNewParent );
+ virtual bool SetPluginParent( SystemParentData* pNewParent );
+ virtual void SetExtendedFrameStyle( SalExtStyle );
+ virtual void SetBackgroundBitmap( SalBitmap* );
+ virtual void SetScreenNumber(unsigned int);
+ virtual void SetApplicationID( const rtl::OUString &rApplicationID );
+
+ // shaped system windows
+ // set clip region to none (-> rectangular windows, normal state)
+ virtual void ResetClipRegion();
+ // start setting the clipregion consisting of nRects rectangles
+ virtual void BeginSetClipRegion( sal_uLong nRects );
+ // add a rectangle to the clip region
+ virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
+ // done setting up the clipregion
+ virtual void EndSetClipRegion();
+
+ virtual void SetClientSize( long nWidth, long nHeight );
+
+ void UpdateFrameGeometry();
+
+ // trigger painting of the window
+ void SendPaintEvent( const Rectangle* pRect = NULL );
+
+ static bool isAlive( const IosSalFrame* pFrame )
+ { return GetSalData()->maFrameCheck.find( pFrame ) != GetSalData()->maFrameCheck.end(); }
+
+ static IosSalFrame* GetCaptureFrame() { return s_pCaptureFrame; }
+
+ UIWindow* getWindow() const { return mpWindow; }
+ UIView* getView() const { return mpView; }
+ unsigned int getStyleMask() const { return mnStyleMask; }
+
+ void getResolution( long& o_rDPIX, long& o_rDPIY );
+
+ CGMutablePathRef getClipPath() const { return mrClippingPath; }
+
+ // called by VCL_UIApplication to indicate screen settings have changed
+ void screenParametersChanged();
+
+ private: // methods
+ /** do things on initial show (like centering on parent or on screen)
+ */
+ void initShow();
+
+ void initWindowAndView();
+
+ private: // data
+ static IosSalFrame* s_pCaptureFrame;
+
+ // make IosSalFrame non copyable
+ IosSalFrame( const IosSalFrame& );
+ IosSalFrame& operator=(const IosSalFrame&);
+};
+
+#endif // _SV_SALFRAME_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salframeview.h b/vcl/inc/ios/salframeview.h
new file mode 100644
index 000000000000..e631209c7b7f
--- /dev/null
+++ b/vcl/inc/ios/salframeview.h
@@ -0,0 +1,144 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _VCL_SALFRAMEVIEW_H
+#define _VCL_SALFRAMEVIEW_H
+
+@interface SalFrameWindow : UIWindow
+{
+ IosSalFrame* mpFrame;
+ id mDraggingDestinationHandler;
+}
+-(id)initWithSalFrame: (IosSalFrame*)pFrame;
+-(BOOL)canBecomeKeyWindow;
+-(void)displayIfNeeded;
+-(void)becomeKeyWindow;
+-(void)resignKeyWindow;
+-(IosSalFrame*)getSalFrame;
+@end
+
+@interface SalFrameView : UIView <UITextInput>
+{
+ IosSalFrame* mpFrame;
+
+ // for UITextInput
+ UIEvent* mpLastEvent;
+ BOOL mbNeedSpecialKeyHandle;
+ BOOL mbInKeyInput;
+ BOOL mbKeyHandled;
+ NSRange mMarkedRange;
+ NSRange mSelectedRange;
+ id mDraggingDestinationHandler;
+ UIEvent* mpLastSuperEvent;
+
+ NSTimeInterval mfLastMagnifyTime;
+ float mfMagnifyDeltaSum;
+}
+-(id)initWithSalFrame: (IosSalFrame*)pFrame;
+-(IosSalFrame*)getSalFrame;
+-(BOOL)acceptsFirstResponder;
+-(BOOL)isOpaque;
+-(void)drawRect: (CGRect)aRect;
+-(void)magnifyWithEvent: (UIEvent*)pEvent;
+-(void)rotateWithEvent: (UIEvent*)pEvent;
+-(void)swipeWithEvent: (UIEvent*)pEvent;
+-(void)keyDown: (UIEvent*)pEvent;
+-(void)flagsChanged: (UIEvent*)pEvent;
+-(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar;
+-(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod;
+-(BOOL)sendKeyToFrameDirect: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod;
+-(BOOL)sendSingleCharacter:(UIEvent*)pEvent;
+-(BOOL)handleKeyDownException:(UIEvent*)pEvent;
+-(void)clearLastEvent;
+/*
+ text action methods
+*/
+-(void)insertText:(id)aString;
+-(void)insertTab: (id)aSender;
+-(void)insertBacktab: (id)aSender;
+-(void)moveLeft: (id)aSender;
+-(void)moveLeftAndModifySelection: (id)aSender;
+-(void)moveBackwardAndModifySelection: (id)aSender;
+-(void)moveRight: (id)aSender;
+-(void)moveRightAndModifySelection: (id)aSender;
+-(void)moveForwardAndModifySelection: (id)aSender;
+-(void)moveUp: (id)aSender;
+-(void)moveDown: (id)aSender;
+-(void)moveWordBackward: (id)aSender;
+-(void)moveWordBackwardAndModifySelection: (id)aSender;
+-(void)moveWordLeftAndModifySelection: (id)aSender;
+-(void)moveWordForward: (id)aSender;
+-(void)moveWordForwardAndModifySelection: (id)aSender;
+-(void)moveWordRightAndModifySelection: (id)aSender;
+-(void)moveToEndOfLine: (id)aSender;
+-(void)moveToRightEndOfLine: (id)aSender;
+-(void)moveToLeftEndOfLine: (id)aSender;
+-(void)moveToEndOfLineAndModifySelection: (id)aSender;
+-(void)moveToRightEndOfLineAndModifySelection: (id)aSender;
+-(void)moveToLeftEndOfLineAndModifySelection: (id)aSender;
+-(void)moveToBeginningOfLine: (id)aSender;
+-(void)moveToBeginningOfLineAndModifySelection: (id)aSender;
+-(void)moveToEndOfParagraph: (id)aSender;
+-(void)moveToEndOfParagraphAndModifySelection: (id)aSender;
+-(void)moveToBeginningOfParagraph: (id)aSender;
+-(void)moveToBeginningOfParagraphAndModifySelection: (id)aSender;
+-(void)moveParagraphForward: (id)aSender;
+-(void)moveParagraphForwardAndModifySelection: (id)aSender;
+-(void)moveParagraphBackward: (id)aSender;
+-(void)moveParagraphBackwardAndModifySelection: (id)aSender;
+-(void)moveToEndOfDocument: (id)aSender;
+-(void)scrollToEndOfDocument: (id)aSender;
+-(void)moveToEndOfDocumentAndModifySelection: (id)aSender;
+-(void)moveToBeginningOfDocument: (id)aSender;
+-(void)scrollToBeginningOfDocument: (id)aSender;
+-(void)moveToBeginningOfDocumentAndModifySelection: (id)aSender;
+-(void)insertNewline: (id)aSender;
+-(void)deleteBackward: (id)aSender;
+-(void)deleteForward: (id)aSender;
+-(void)cancelOperation: (id)aSender;
+-(void)deleteBackwardByDecomposingPreviousCharacter: (id)aSender;
+-(void)deleteWordBackward: (id)aSender;
+-(void)deleteWordForward: (id)aSender;
+-(void)deleteToBeginningOfLine: (id)aSender;
+-(void)deleteToEndOfLine: (id)aSender;
+-(void)deleteToBeginningOfParagraph: (id)aSender;
+-(void)deleteToEndOfParagraph: (id)aSender;
+-(void)insertLineBreak: (id)aSender;
+-(void)insertParagraphSeparator: (id)aSender;
+-(void)selectWord: (id)aSender;
+-(void)selectLine: (id)aSender;
+-(void)selectParagraph: (id)aSender;
+-(void)selectAll: (id)aSender;
+-(void)noop: (id)aSender;
+-(id)parentAttribute;
+-(UIView *)viewElementForParent;
+@end
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salgdi.h b/vcl/inc/ios/salgdi.h
new file mode 100644
index 000000000000..51ef49219e9a
--- /dev/null
+++ b/vcl/inc/ios/salgdi.h
@@ -0,0 +1,401 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALGDI_H
+#define _SV_SALGDI_H
+
+#include "basegfx/polygon/b2dpolypolygon.hxx"
+
+#include "ios/iosvcltypes.h"
+#include <vcl/fontcapabilities.hxx>
+
+#include "outfont.hxx"
+#include "salgdi.hxx"
+
+#include <vector>
+
+class IosSalFrame;
+class IosSalBitmap;
+class ImplDevFontAttributes;
+
+class CGRect;
+
+// mac specific physically available font face
+class ImplIosFontData : public ImplFontData
+{
+public:
+ ImplIosFontData( const ImplDevFontAttributes&, NSString * );
+
+ virtual ~ImplIosFontData();
+
+ virtual ImplFontData* Clone() const;
+ virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const;
+ virtual sal_IntPtr GetFontId() const;
+
+ const ImplFontCharMap* GetImplFontCharMap() const;
+ bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
+ bool HasChar( sal_uInt32 cChar ) const;
+
+ void ReadOs2Table() const;
+ void ReadIosCmapEncoding() const;
+ bool HasCJKSupport() const;
+
+private:
+ mutable const ImplFontCharMap* mpCharMap;
+ mutable vcl::FontCapabilities maFontCapabilities;
+ mutable bool mbOs2Read; // true if OS2-table related info is valid
+ mutable bool mbHasOs2Table;
+ mutable bool mbCmapEncodingRead; // true if cmap encoding of Ios font is read
+ mutable bool mbHasCJKSupport; // #i78970# CJK fonts need extra leading
+ mutable bool mbFontCapabilitiesRead;
+};
+
+// abstracting quartz color instead of having to use an CGFloat[] array
+class RGBAColor
+{
+public:
+ RGBAColor( SalColor );
+ RGBAColor( float fRed, float fGreen, float fBlue, float fAlpha ); //NOTUSEDYET
+ const float* AsArray() const { return &mfRed; }
+ bool IsVisible() const { return (mfAlpha > 0); }
+ void SetAlpha( float fAlpha ) { mfAlpha = fAlpha; }
+private:
+ float mfRed, mfGreen, mfBlue, mfAlpha;
+};
+
+// -------------------
+// - IosSalGraphics -
+// -------------------
+class IosSalGraphics : public SalGraphics
+{
+protected:
+ IosSalFrame* mpFrame;
+ CGLayerRef mxLayer; // Quartz graphics layer
+ CGContextRef mrContext; // Quartz drawing context
+ class XorEmulation* mpXorEmulation;
+ int mnXorMode; // 0: off 1: on 2: invert only
+ int mnWidth;
+ int mnHeight;
+ int mnBitmapDepth; // zero unless bitmap
+ /// device resolution of this graphics
+ long mnRealDPIX;
+ long mnRealDPIY;
+ /// some graphics implementations (e.g. IosSalInfoPrinter) scale
+ /// everything down by a factor (see SetupPrinterGraphics for details)
+ /// so we have to compensate for it with the inverse factor
+ double mfFakeDPIScale;
+
+ /// path representing current clip region
+ CGMutablePathRef mxClipPath;
+
+ /// Drawing colors
+ /// pen color RGBA
+ RGBAColor maLineColor;
+ /// brush color RGBA
+ RGBAColor maFillColor;
+
+ // Device Font settings
+ const ImplIosFontData* mpIosFontData;
+ /// <1.0: font is squeezed, >1.0 font is stretched, else 1.0
+ float mfFontStretch;
+ /// allows text to be rendered without antialiasing
+ bool mbNonAntialiasedText;
+
+ // Graphics types
+
+ /// is this a printer graphics
+ bool mbPrinter;
+ /// is this a virtual device graphics
+ bool mbVirDev;
+ /// is this a window graphics
+ bool mbWindow;
+
+public:
+ IosSalGraphics();
+ virtual ~IosSalGraphics();
+
+ bool IsPenVisible() const { return maLineColor.IsVisible(); }
+ bool IsBrushVisible() const { return maFillColor.IsVisible(); }
+
+ void SetWindowGraphics( IosSalFrame* pFrame );
+ void SetPrinterGraphics( CGContextRef, long nRealDPIX, long nRealDPIY, double fFakeScale );
+ void SetVirDevGraphics( CGLayerRef, CGContextRef, int nBitDepth = 0 );
+
+ void initResolution( UIWindow* );
+ void copyResolution( IosSalGraphics& );
+ void updateResolution();
+
+ bool IsWindowGraphics() const { return mbWindow; }
+ bool IsPrinterGraphics() const { return mbPrinter; }
+ bool IsVirDevGraphics() const { return mbVirDev; }
+ IosSalFrame* getGraphicsFrame() const { return mpFrame; }
+ void setGraphicsFrame( IosSalFrame* pFrame ) { mpFrame = pFrame; }
+
+ void ImplDrawPixel( long nX, long nY, const RGBAColor& ); // helper to draw single pixels
+
+ bool CheckContext();
+ void UpdateWindow( CGRect& ); // delivered in NSView coordinates
+ void RefreshRect( const CGRect& );
+ void RefreshRect(float lX, float lY, float lWidth, float lHeight);
+
+ void SetState();
+ void UnsetState();
+ // InvalidateContext does an UnsetState and sets mrContext to 0
+ void InvalidateContext();
+
+ virtual bool setClipRegion( const Region& );
+
+ // draw --> LineColor and FillColor and RasterOp and ClipRegion
+ virtual void drawPixel( long nX, long nY );
+ virtual void drawPixel( long nX, long nY, SalColor nSalColor );
+ virtual void drawLine( long nX1, long nY1, long nX2, long nY2 );
+ virtual void drawRect( long nX, long nY, long nWidth, long nHeight );
+ virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry );
+ virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry );
+ virtual void drawPolyPolygon( sal_uLong nPoly, const sal_uLong* pPoints, PCONSTSALPOINT* pPtAry );
+ virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
+ virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry );
+ virtual sal_Bool drawPolyPolygonBezier( sal_uLong nPoly, const sal_uLong* pPoints, const SalPoint* const* pPtAry, const sal_uInt8* const* pFlgAry );
+ virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin );
+
+ // CopyArea --> No RasterOp, but ClipRegion
+ virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
+ long nSrcHeight, sal_uInt16 nFlags );
+
+ // CopyBits and DrawBitmap --> RasterOp and ClipRegion
+ // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
+ virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics );
+ virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap );
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
+ const SalBitmap& rSalBitmap,
+ SalColor nTransparentColor );
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
+ const SalBitmap& rSalBitmap,
+ const SalBitmap& rTransparentBitmap );
+ virtual void drawMask( const SalTwoRect* pPosAry,
+ const SalBitmap& rSalBitmap,
+ SalColor nMaskColor );
+
+ virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
+ virtual SalColor getPixel( long nX, long nY );
+
+ // invert --> ClipRegion (only Windows or VirDevs)
+ virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags);
+ virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+
+ virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize );
+
+ virtual bool drawAlphaBitmap( const SalTwoRect&,
+ const SalBitmap& rSourceBitmap,
+ const SalBitmap& rAlphaBitmap );
+
+ virtual bool drawAlphaRect( long nX, long nY, long nWidth,
+ long nHeight, sal_uInt8 nTransparency );
+
+ CGPoint* makeCGptArray(sal_uLong nPoints, const SalPoint* pPtAry);
+ // native widget rendering methods that require mirroring
+ virtual sal_Bool hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ const Point& aPos, sal_Bool& rIsInside );
+ virtual sal_Bool drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ ControlState nState, const ImplControlValue& aValue,
+ const rtl::OUString& aCaption );
+ virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ ControlState nState, const ImplControlValue& aValue,
+ const rtl::OUString& aCaption );
+ virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+ const ImplControlValue& aValue, const rtl::OUString& aCaption,
+ Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
+
+ // get device resolution
+ virtual void GetResolution( long& rDPIX, long& rDPIY );
+ // get the depth of the device
+ virtual sal_uInt16 GetBitCount() const;
+ // get the width of the device
+ virtual long GetGraphicsWidth() const;
+
+ // set the clip region to empty
+ virtual void ResetClipRegion();
+
+ // set the line color to transparent (= don't draw lines)
+ virtual void SetLineColor();
+ // set the line color to a specific color
+ virtual void SetLineColor( SalColor nSalColor );
+ // set the fill color to transparent (= don't fill)
+ virtual void SetFillColor();
+ // set the fill color to a specific color, shapes will be
+ // filled accordingly
+ virtual void SetFillColor( SalColor nSalColor );
+ // enable/disable XOR drawing
+ virtual void SetXORMode( bool bSet, bool bInvertOnly );
+ // set line color for raster operations
+ virtual void SetROPLineColor( SalROPColor nROPColor );
+ // set fill color for raster operations
+ virtual void SetROPFillColor( SalROPColor nROPColor );
+ // set the text color to a specific color
+ virtual void SetTextColor( SalColor nSalColor );
+ // set the font
+ virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
+ // get the current font's etrics
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
+ // get kernign pairs of the current font
+ // return only PairCount if (pKernPairs == NULL)
+ virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
+ // get the repertoire of the current font
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
+ virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
+ // graphics must fill supplied font list
+ virtual void GetDevFontList( ImplDevFontList* );
+ // graphics should call ImplAddDevFontSubstitute on supplied
+ // OutputDevice for all its device specific preferred font substitutions
+ virtual void GetDevFontSubstList( OutputDevice* );
+ virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
+ // CreateFontSubset: a method to get a subset of glyhps of a font
+ // inside a new valid font file
+ // returns TRUE if creation of subset was successfull
+ // parameters: rToFile: contains a osl file URL to write the subset to
+ // pFont: describes from which font to create a subset
+ // pGlyphIDs: the glyph ids to be extracted
+ // pEncoding: the character code corresponding to each glyph
+ // pWidths: the advance widths of the correspoding glyphs (in PS font units)
+ // nGlyphs: the number of glyphs
+ // rInfo: additional outgoing information
+ // implementation note: encoding 0 with glyph id 0 should be added implicitly
+ // as "undefined character"
+ virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
+ const ImplFontData* pFont,
+ long* pGlyphIDs,
+ sal_uInt8* pEncoding,
+ sal_Int32* pWidths,
+ int nGlyphs,
+ FontSubsetInfo& rInfo // out parameter
+ );
+
+ // GetFontEncodingVector: a method to get the encoding map Unicode
+ // to font encoded character; this is only used for type1 fonts and
+ // may return NULL in case of unknown encoding vector
+ // if ppNonEncoded is set and non encoded characters (that is type1
+ // glyphs with only a name) exist it is set to the corresponding
+ // map for non encoded glyphs; the encoding vector contains -1
+ // as encoding for these cases
+ virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded );
+
+ // GetEmbedFontData: gets the font data for a font marked
+ // embeddable by GetDevFontList or NULL in case of error
+ // parameters: pFont: describes the font in question
+ // pWidths: the widths of all glyphs from char code 0 to 255
+ // pWidths MUST support at least 256 members;
+ // rInfo: additional outgoing information
+ // pDataLen: out parameter, contains the byte length of the returned buffer
+ virtual const void* GetEmbedFontData( const ImplFontData*,
+ const sal_Ucs* pUnicodes,
+ sal_Int32* pWidths,
+ FontSubsetInfo& rInfo,
+ long* pDataLen );
+ // frees the font data again
+ virtual void FreeEmbedFontData( const void* pData, long nDataLen );
+
+ virtual void GetGlyphWidths( const ImplFontData*,
+ bool bVertical,
+ Int32Vector& rWidths,
+ Ucs2UIntMap& rUnicodeEnc );
+
+ virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& );
+ virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& );
+
+ virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
+ virtual void DrawServerFontLayout( const ServerFontLayout& );
+ virtual bool supportsOperation( OutDevSupportType ) const;
+
+ // Query the platform layer for control support
+ virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
+
+ virtual SystemGraphicsData GetGraphicsData() const;
+ virtual SystemFontData GetSysFontData( int /* nFallbacklevel */ ) const;
+
+private:
+ // differences between VCL, Quartz and kHiThemeOrientation coordinate systems
+ // make some graphics seem to be vertically-mirrored from a VCL perspective
+ bool IsFlipped() const { return mbWindow; }
+
+ void ApplyXorContext();
+ void Pattern50Fill();
+ UInt32 getState( ControlState nState );
+ UInt32 getTrackState( ControlState nState );
+};
+
+class XorEmulation
+{
+public:
+ XorEmulation();
+ /*final*/ ~XorEmulation();
+
+ void SetTarget( int nWidth, int nHeight, int nBitmapDepth, CGContextRef, CGLayerRef );
+ bool UpdateTarget();
+ void Enable() { mbIsEnabled = true; }
+ void Disable() { mbIsEnabled = false; }
+ bool IsEnabled() const { return mbIsEnabled; }
+ CGContextRef GetTargetContext() const { return mxTargetContext; }
+ CGContextRef GetMaskContext() const { return (mbIsEnabled ? mxMaskContext : NULL); }
+
+private:
+ CGLayerRef mxTargetLayer;
+ CGContextRef mxTargetContext;
+ CGContextRef mxMaskContext;
+ CGContextRef mxTempContext;
+ sal_uLong* mpMaskBuffer;
+ sal_uLong* mpTempBuffer;
+ int mnBufferLongs;
+ bool mbIsEnabled;
+};
+
+
+// --- some trivial inlines
+
+inline void IosSalGraphics::RefreshRect( const CGRect& rRect )
+{
+ RefreshRect( rRect.origin.x, rRect.origin.y, rRect.size.width, rRect.size.height );
+}
+
+inline RGBAColor::RGBAColor( SalColor nSalColor )
+: mfRed( SALCOLOR_RED(nSalColor) * (1.0/255))
+, mfGreen( SALCOLOR_GREEN(nSalColor) * (1.0/255))
+, mfBlue( SALCOLOR_BLUE(nSalColor) * (1.0/255))
+, mfAlpha( 1.0 ) // opaque
+{}
+
+inline RGBAColor::RGBAColor( float fRed, float fGreen, float fBlue, float fAlpha )
+: mfRed( fRed )
+, mfGreen( fGreen )
+, mfBlue( fBlue )
+, mfAlpha( fAlpha )
+{}
+
+#endif // _SV_SALGDI_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salinst.h b/vcl/inc/ios/salinst.h
new file mode 100644
index 000000000000..9983804bf665
--- /dev/null
+++ b/vcl/inc/ios/salinst.h
@@ -0,0 +1,199 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALINST_H
+#define _SV_SALINST_H
+
+#include "osl/mutex.hxx"
+#include "osl/thread.hxx"
+#include "osl/conditn.h"
+#include <vcl/solarmutex.hxx>
+
+#include "ios/iosvcltypes.h"
+
+#include "salinst.hxx"
+
+#include <list>
+
+class IosSalFrame;
+class ApplicationEvent;
+class Image;
+
+// -----------------
+// - SalYieldMutex -
+// -----------------
+
+class SalYieldMutex : public vcl::SolarMutexObject
+{
+ sal_uLong mnCount;
+ oslThreadIdentifier mnThreadId;
+
+public:
+ SalYieldMutex();
+ virtual void acquire();
+ virtual void release();
+ virtual sal_Bool tryToAcquire();
+ sal_uLong GetAcquireCount() const { return mnCount; }
+ oslThreadIdentifier GetThreadId() const { return mnThreadId; }
+};
+
+#define YIELD_GUARD osl::SolarGuard aGuard( GetSalData()->mpFirstInstance->GetYieldMutex() )
+
+
+// -------------------
+// - SalInstanceData -
+// -------------------
+
+//struct SalInstanceData
+//{
+//public:
+//};
+
+// ------------------
+// - IosSalInstance -
+// ------------------
+
+class IosSalInstance : public SalInstance
+{
+ struct SalUserEvent
+ {
+ IosSalFrame* mpFrame;
+ void* mpData;
+ sal_uInt16 mnType;
+
+ SalUserEvent( IosSalFrame* pFrame, void* pData, sal_uInt16 nType ) :
+ mpFrame( pFrame ), mpData( pData ), mnType( nType )
+ {}
+ };
+
+public:
+ SalYieldMutex* mpSalYieldMutex;
+ rtl::OUString maDefaultPrinter;
+ oslThreadIdentifier maMainThread;
+ bool mbWaitingYield;
+ int mnActivePrintJobs;
+ std::list< SalUserEvent > maUserEvents;
+ oslMutex maUserEventListMutex;
+ oslCondition maWaitingYieldCond;
+
+ typedef std::list<const ApplicationEvent*> AppEventList;
+ static AppEventList aAppEventList;
+
+public:
+ IosSalInstance();
+ virtual ~IosSalInstance();
+
+ virtual SalSystem* CreateSystem();
+ virtual void DestroySystem(SalSystem*);
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
+ virtual void DestroyFrame( SalFrame* pFrame );
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
+ virtual void DestroyObject( SalObject* pObject );
+ virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
+ long nDX, long nDY,
+ sal_uInt16 nBitCount, const SystemGraphicsData *pData );
+ virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
+
+ virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
+ ImplJobSetup* pSetupData );
+ virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter );
+ virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter );
+ virtual void DestroyPrinter( SalPrinter* pPrinter );
+ virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList );
+ virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
+ virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
+ virtual String GetDefaultPrinter();
+ virtual SalTimer* CreateSalTimer();
+ virtual SalI18NImeStatus* CreateI18NImeStatus();
+ virtual SalSystem* CreateSalSystem();
+ virtual SalBitmap* CreateSalBitmap();
+ virtual osl::SolarMutex* GetYieldMutex();
+ virtual sal_uLong ReleaseYieldMutex();
+ virtual void AcquireYieldMutex( sal_uLong nCount );
+ virtual bool CheckYieldMutex();
+ virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
+ virtual bool AnyInput( sal_uInt16 nType );
+ virtual SalMenu* CreateMenu( sal_Bool bMenuBar, Menu* pVCLMenu );
+ virtual void DestroyMenu( SalMenu* );
+ virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
+ virtual void DestroyMenuItem( SalMenuItem* );
+ virtual SalSession* CreateSalSession();
+ virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
+ virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
+ virtual void SetEventCallback( void* pInstance, bool(*pCallback)(void*,void*,int) );
+ virtual void SetErrorEventCallback( void* pInstance, bool(*pCallback)(void*,void*,int) );
+
+ // dtrans implementation
+ virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
+ CreateClipboard( const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& i_rArguments );
+ virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDragSource();
+ virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDropTarget();
+
+ void wakeupYield();
+
+ public:
+ friend class IosSalFrame;
+
+ void PostUserEvent( IosSalFrame* pFrame, sal_uInt16 nType, void* pData );
+ void delayedSettingsChanged( bool bInvalidate );
+
+ bool isUIAppThread() const;
+
+ void startedPrintJob() { mnActivePrintJobs++; }
+ void endedPrintJob() { mnActivePrintJobs--; }
+
+ // event subtypes for NSApplicationDefined events
+ static const short AppExecuteSVMain = 0x7fff;
+ static const short AppEndLoopEvent = 1;
+ static const short AppStartTimerEvent = 10;
+ static const short AppleRemoteEvent = 15;
+ static const short YieldWakeupEvent = 20;
+};
+
+// helper class: inverted solar guard
+class YieldMutexReleaser
+{
+ sal_uLong mnCount;
+ public:
+ YieldMutexReleaser();
+ ~YieldMutexReleaser();
+};
+
+// helper class
+rtl::OUString GetOUString( CFStringRef );
+rtl::OUString GetOUString( NSString* );
+CFStringRef CreateCFString( const rtl::OUString& );
+NSString* CreateNSString( const rtl::OUString& );
+
+CGImageRef CreateCGImage( const Image& );
+UIImage* CreateUIImage( const Image& );
+
+#endif // _SV_SALINST_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salmathutils.hxx b/vcl/inc/ios/salmathutils.hxx
new file mode 100644
index 000000000000..e81f68e46b0b
--- /dev/null
+++ b/vcl/inc/ios/salmathutils.hxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALMATHUTILS_HXX
+#define _SV_SALMATHUTILS_HXX
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// ------------------------------------------------------------------
+//
+// Structures
+//
+// ------------------------------------------------------------------
+
+// LRectCoor is an abreviation for rectangular coordinates
+// represented as long integers
+
+struct LRectCoor
+{
+ long x;
+ long y;
+ long z;
+};
+
+// ------------------------------------------------------------------
+//
+// Type Definitions
+//
+// ------------------------------------------------------------------
+
+// LRectCoorVec is an abreviation for vectors in rectangular
+// coordinates represented as long integers
+
+typedef struct LRectCoor LRectCoor;
+typedef LRectCoor *LRectCoorVector;
+typedef LRectCoorVector *LRectCoorTensor;
+
+// ------------------------------------------------------------------
+//
+// Function Headers
+//
+// ------------------------------------------------------------------
+
+void CSwap ( char &rX, char &rY );
+void UCSwap ( unsigned char &rX, unsigned char &rY );
+void SSwap ( short &rX, short &rY );
+void USSwap ( unsigned short &rX, unsigned short &rY );
+void LSwap ( long &rX, long &rY );
+void ULSwap ( unsigned long &rX, unsigned long &rY );
+
+// ------------------------------------------------------------------
+
+unsigned long Euclidian2Norm ( const LRectCoorVector pVec );
+
+// ------------------------------------------------------------------
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _SV_SALMATHUTILS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salmenu.h b/vcl/inc/ios/salmenu.h
new file mode 100644
index 000000000000..3f143ac1d976
--- /dev/null
+++ b/vcl/inc/ios/salmenu.h
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALMENU_H
+#define _SV_SALMENU_H
+
+#include "premac.h"
+#include <UIKit/UIKit.h>
+#include "postmac.h"
+
+#include "salmenu.hxx"
+
+#include <vector>
+
+class IosSalFrame;
+class IosSalMenuItem;
+
+class IosSalMenu : public SalMenu
+{
+ std::vector< IosSalMenuItem* > maItems;
+
+public: // for OOStatusView
+ struct MenuBarButtonEntry
+ {
+ SalMenuButtonItem maButton;
+ UIImage* mpUIImage; // cached image
+ NSString* mpToolTipString;
+
+ MenuBarButtonEntry() : mpUIImage( nil ), mpToolTipString( nil ) {}
+ MenuBarButtonEntry( const SalMenuButtonItem& i_rItem )
+ : maButton( i_rItem), mpUIImage( nil ), mpToolTipString( nil ) {}
+ };
+private:
+ std::vector< MenuBarButtonEntry > maButtons;
+
+ MenuBarButtonEntry* findButtonItem( sal_uInt16 i_nItemId );
+ void releaseButtonEntry( MenuBarButtonEntry& i_rEntry );
+ static void statusLayout();
+public:
+ IosSalMenu( bool bMenuBar );
+ virtual ~IosSalMenu();
+
+ virtual sal_Bool VisibleMenuBar(); // must return TRUE to actually DISPLAY native menu bars
+ // otherwise only menu messages are processed (eg, OLE on Windows)
+
+ virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos );
+ virtual void RemoveItem( unsigned nPos );
+ virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos );
+ virtual void SetFrame( const SalFrame* pFrame );
+ virtual void CheckItem( unsigned nPos, sal_Bool bCheck );
+ virtual void EnableItem( unsigned nPos, sal_Bool bEnable );
+ virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText );
+ virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage);
+ virtual void GetSystemMenuData( SystemMenuData* pData );
+ virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, sal_uLong nFlags);
+ virtual bool AddMenuBarButton( const SalMenuButtonItem& );
+ virtual void RemoveMenuBarButton( sal_uInt16 nId );
+ virtual Rectangle GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame* i_pReferenceFrame );
+
+ int getItemIndexByPos( sal_uInt16 nPos ) const;
+ const IosSalFrame* getFrame() const;
+
+ void setMainMenu();
+ static void unsetMainMenu();
+ static void setDefaultMenu();
+ static void enableMainMenu( bool bEnable );
+ static void addFallbackMenuItem( UIMenuItem* NewItem );
+ static void removeFallbackMenuItem( UIMenuItem* pOldItem );
+
+ const std::vector< MenuBarButtonEntry >& getButtons() const { return maButtons; }
+
+ bool mbMenuBar; // true - Menubar, false - Menu
+ UIMenuController* mpMenu;
+ Menu* mpVCLMenu; // the corresponding vcl Menu object
+ const IosSalFrame* mpFrame; // the frame to dispatch the menu events to
+ IosSalMenu* mpParentSalMenu; // the parent menu that contains us (and perhaps has a frame)
+
+ static const IosSalMenu* pCurrentMenuBar;
+
+};
+
+class IosSalMenuItem : public SalMenuItem
+{
+public:
+ IosSalMenuItem( const SalItemParams* );
+ virtual ~IosSalMenuItem();
+
+ sal_uInt16 mnId; // Item ID
+ Menu* mpVCLMenu; // VCL Menu into which this MenuItem is inserted
+ IosSalMenu* mpParentMenu; // The menu in which this menu item is inserted
+ IosSalMenu* mpSubMenu; // Sub menu of this item (if defined)
+ UIMenuItem* mpMenuItem; // The UIMenuItem
+};
+
+#endif // _SV_SALMENU_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salnstimer.h b/vcl/inc/ios/salnstimer.h
new file mode 100644
index 000000000000..cf98276747ee
--- /dev/null
+++ b/vcl/inc/ios/salnstimer.h
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _VCL_SALNSTIMER_H
+#define _VCL_SALNSTIMER_H
+
+#include "premac.h"
+#include <Foundation/Foundation.h>
+#include "postmac.h"
+
+@interface TimerCallbackCaller : NSObject
+{
+}
+-(void)timerElapsed:(NSTimer*)pTimer;
+@end
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salobj.h b/vcl/inc/ios/salobj.h
new file mode 100644
index 000000000000..3203a0d46e93
--- /dev/null
+++ b/vcl/inc/ios/salobj.h
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALOBJ_H
+#define _SV_SALOBJ_H
+
+#include "vcl/sysdata.hxx"
+#include "salobj.hxx"
+
+class IosSalFrame;
+class IosSalObject;
+
+
+// -----------------
+// - SalObjectData -
+// -----------------
+
+struct SalObjectData
+{
+};
+
+class IosSalObject : public SalObject
+{
+public:
+ IosSalFrame* mpFrame; // parent frame
+ SystemEnvData maSysData;
+
+ long mnClipX;
+ long mnClipY;
+ long mnClipWidth;
+ long mnClipHeight;
+ bool mbClip;
+
+ long mnX;
+ long mnY;
+ long mnWidth;
+ long mnHeight;
+
+ void setClippedPosSize();
+
+ IosSalObject( IosSalFrame* pFrame );
+ virtual ~IosSalObject();
+
+ virtual void ResetClipRegion();
+ virtual sal_uInt16 GetClipRegionType();
+ virtual void BeginSetClipRegion( sal_uLong nRects );
+ virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
+ virtual void EndSetClipRegion();
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight );
+ virtual void Show( sal_Bool bVisible );
+ virtual void Enable( sal_Bool nEnable );
+ virtual void GrabFocus();
+ virtual void SetBackground();
+ virtual void SetBackground( SalColor nSalColor );
+ virtual const SystemEnvData* GetSystemData() const;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
+};
+
+#endif // _SV_SALOBJ_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salprn.h b/vcl/inc/ios/salprn.h
new file mode 100644
index 000000000000..cd90a0f881df
--- /dev/null
+++ b/vcl/inc/ios/salprn.h
@@ -0,0 +1,173 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALPRN_H
+#define _SV_SALPRN_H
+
+#include "ios/iosvcltypes.h"
+
+#include "salprn.hxx"
+
+#include <boost/shared_array.hpp>
+
+
+// ---------------------
+// - IosSalInfoPrinter -
+// ---------------------
+
+class IosSalGraphics;
+
+class IosSalInfoPrinter : public SalInfoPrinter
+{
+ /// Printer graphics
+ IosSalGraphics* mpGraphics;
+ /// is Graphics used
+ bool mbGraphics;
+ /// job active ?
+ bool mbJob;
+
+ UIPrintFormatter* mpPrinter;
+ /// cocoa print info object
+ UIPrintInfo* mpPrintInfo;
+
+ /// FIXME: get real printer context for infoprinter if possible
+ /// fake context for info printer
+ /// graphics context for Quartz 2D
+ CGContextRef mrContext;
+ /// memory for graphics bitmap context for querying metrics
+ boost::shared_array< sal_uInt8 > maContextMemory;
+
+ // since changes to UIPrintInfo during a job are ignored
+ // we have to care for some settings ourselves
+ // currently we do this for orientation;
+ // really needed however is a solution for paper formats
+ Orientation mePageOrientation;
+
+ int mnStartPageOffsetX;
+ int mnStartPageOffsetY;
+ sal_Int32 mnCurPageRangeStart;
+ sal_Int32 mnCurPageRangeCount;
+
+ public:
+ IosSalInfoPrinter( const SalPrinterQueueInfo& pInfo );
+ virtual ~IosSalInfoPrinter();
+
+ void SetupPrinterGraphics( CGContextRef i_xContext ) const;
+
+ virtual SalGraphics* GetGraphics();
+ virtual void ReleaseGraphics( SalGraphics* i_pGraphics );
+ virtual sal_Bool Setup( SalFrame* i_pFrame, ImplJobSetup* i_pSetupData );
+ virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData );
+ virtual sal_Bool SetData( sal_uLong i_nFlags, ImplJobSetup* i_pSetupData );
+ virtual void GetPageInfo( const ImplJobSetup* i_pSetupData,
+ long& o_rOutWidth, long& o_rOutHeight,
+ long& o_rPageOffX, long& o_rPageOffY,
+ long& o_rPageWidth, long& o_rPageHeight );
+ virtual sal_uLong GetCapabilities( const ImplJobSetup* i_pSetupData, sal_uInt16 i_nType );
+ virtual sal_uLong GetPaperBinCount( const ImplJobSetup* i_pSetupData );
+ virtual String GetPaperBinName( const ImplJobSetup* i_pSetupData, sal_uLong i_nPaperBin );
+ virtual void InitPaperFormats( const ImplJobSetup* i_pSetupData );
+ virtual int GetLandscapeAngle( const ImplJobSetup* i_pSetupData );
+
+ // the artificial separation between InfoPrinter and Printer
+ // is not really useful for us
+ // so let's make IosSalPrinter just a forwarder to IosSalInfoPrinter
+ // and concentrate the real work in one class
+ // implement pull model print system
+ sal_Bool StartJob( const String* i_pFileName,
+ const String& rJobName,
+ const String& i_rAppName,
+ ImplJobSetup* i_pSetupData,
+ vcl::PrinterController& i_rController );
+ sal_Bool EndJob();
+ sal_Bool AbortJob();
+ SalGraphics* StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData );
+ sal_Bool EndPage();
+ sal_uLong GetErrorCode() const;
+
+ UIPrintInfo* getPrintInfo() const { return mpPrintInfo; }
+ void setStartPageOffset( int nOffsetX, int nOffsetY ) { mnStartPageOffsetX = nOffsetX; mnStartPageOffsetY = nOffsetY; }
+ sal_Int32 getCurPageRangeStart() const { return mnCurPageRangeStart; }
+ sal_Int32 getCurPageRangeCount() const { return mnCurPageRangeCount; }
+
+ // match width/height against known paper formats, possibly switching orientation
+ const PaperInfo* matchPaper( long i_nWidth, long i_nHeight, Orientation& o_rOrientation ) const;
+ void setPaperSize( long i_nWidth, long i_nHeight, Orientation i_eSetOrientation );
+
+ private:
+ IosSalInfoPrinter( const IosSalInfoPrinter& );
+ IosSalInfoPrinter& operator=(const IosSalInfoPrinter&);
+};
+
+// -----------------
+// - IosSalPrinter -
+// -----------------
+
+class IosSalPrinter : public SalPrinter
+{
+ IosSalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter
+ public:
+ IosSalPrinter( IosSalInfoPrinter* i_pInfoPrinter );
+ virtual ~IosSalPrinter();
+
+ virtual sal_Bool StartJob( const XubString* i_pFileName,
+ const XubString& i_rJobName,
+ const XubString& i_rAppName,
+ sal_uLong i_nCopies,
+ bool i_bCollate,
+ bool i_bDirect,
+ ImplJobSetup* i_pSetupData );
+ // implement pull model print system
+ virtual sal_Bool StartJob( const String* i_pFileName,
+ const String& rJobName,
+ const String& i_rAppName,
+ ImplJobSetup* i_pSetupData,
+ vcl::PrinterController& i_rListener );
+
+ virtual sal_Bool EndJob();
+ virtual sal_Bool AbortJob();
+ virtual SalGraphics* StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData );
+ virtual sal_Bool EndPage();
+ virtual sal_uLong GetErrorCode();
+
+ private:
+ IosSalPrinter( const IosSalPrinter& );
+ IosSalPrinter& operator=(const IosSalPrinter&);
+};
+
+const double fPtTo100thMM = 35.27777778;
+
+inline int PtTo10Mu( double nPoints ) { return (int)(((nPoints)*fPtTo100thMM)+0.5); }
+
+inline double TenMuToPt( double nUnits ) { return floor(((nUnits)/fPtTo100thMM)+0.5); }
+
+
+
+#endif // _SV_SALPRN_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salsys.h b/vcl/inc/ios/salsys.h
new file mode 100644
index 000000000000..e586c8dfb356
--- /dev/null
+++ b/vcl/inc/ios/salsys.h
@@ -0,0 +1,56 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALSYS_H
+#define _SV_SALSYS_H
+
+#include "salsys.hxx"
+
+class VCL_DLLPUBLIC IosSalSystem : public SalSystem
+{
+public:
+ IosSalSystem() {}
+ virtual ~IosSalSystem();
+
+ // get info about the display
+ virtual unsigned int GetDisplayScreenCount();
+ virtual bool IsMultiDisplay();
+ virtual unsigned int GetDefaultDisplayNumber();
+ virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen );
+ virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen );
+
+ virtual rtl::OUString GetScreenName( unsigned int nScreen );
+ virtual int ShowNativeMessageBox( const String& rTitle,
+ const String& rMessage,
+ int nButtonCombination,
+ int nDefaultButton);
+};
+
+#endif // _SV_SALSYS_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/saltimer.h b/vcl/inc/ios/saltimer.h
new file mode 100644
index 000000000000..b5974219437d
--- /dev/null
+++ b/vcl/inc/ios/saltimer.h
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+************************************************************************/
+
+#ifndef _SV_SALTIMER_H
+#define _SV_SALTIMER_H
+
+#include "premac.h"
+#include <Foundation/Foundation.h>
+#include "postmac.h"
+
+#include "saltimer.hxx"
+
+class IosSalTimer : public SalTimer
+{
+ public:
+
+ IosSalTimer();
+ virtual ~IosSalTimer();
+
+ void Start( sal_uLong nMS );
+ void Stop();
+
+ static NSTimer* pRunningTimer;
+ static bool bDispatchTimer;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/saluimenu.h b/vcl/inc/ios/saluimenu.h
new file mode 100644
index 000000000000..ef54daa2d631
--- /dev/null
+++ b/vcl/inc/ios/saluimenu.h
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _VCL_SALUIMENU_H
+#define _VCL_SALUIMENU_H
+
+class IosSalMenu;
+class IosSalMenuItem;
+
+@interface SalUIMenu : UIMenuController
+{
+ /* Caution: SalNSMenu instances occasionally are binary copied
+ in IosSalMenu::ShowNativePopupMenu. If any members are added,
+ please take this into account !
+ */
+ IosSalMenu* mpMenu;
+}
+-(id)initWithMenu: (IosSalMenu*)pMenu;
+-(void)menuNeedsUpdate: (UIMenuController*)pMenu;
+-(void)setSalMenu: (IosSalMenu*)pMenu;
+@end
+
+@interface SalUIMenuItem : UIMenuItem
+{
+ /* Caution: SalUIMenuItem instances occasionally are binary copied
+ in IosSalMenu::ShowNativePopupMenu. If any members are added,
+ please take this into account !
+ */
+ IosSalMenuItem* mpMenuItem;
+}
+-(id)initWithMenuItem: (IosSalMenuItem*)pMenuItem;
+-(void)menuItemTriggered: (id)aSender;
+@end
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salvd.h b/vcl/inc/ios/salvd.h
new file mode 100644
index 000000000000..e116c5c45bab
--- /dev/null
+++ b/vcl/inc/ios/salvd.h
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALVD_H
+#define _SV_SALVD_H
+
+#include "ios/salcolorutils.hxx"
+#include "ios/salgdi.h"
+
+#include "salvd.hxx"
+
+#if PRAGMA_ONCE
+ #pragma once
+#endif
+
+struct SalVirDevData
+{
+};
+
+typedef struct SalVirDevData SalVirDevData;
+typedef SalVirDevData *SalVirDevDataPtr;
+typedef SalVirDevDataPtr *SalVirDevDataHandle;
+
+// =======================================================================
+
+class IosSalGraphics;
+
+class IosSalVirtualDevice : public SalVirtualDevice
+{
+private:
+ bool mbGraphicsUsed; // is Graphics used
+ bool mbForeignContext; // is mxContext from outside VCL
+ CGContextRef mxBitmapContext;
+ int mnBitmapDepth;
+ CGLayerRef mxLayer; // Quartz layer
+ IosSalGraphics* mpGraphics; // current VirDev graphics
+
+ void Destroy();
+
+public:
+ IosSalVirtualDevice( IosSalGraphics* pGraphic, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData );
+ virtual ~IosSalVirtualDevice();
+
+ virtual SalGraphics* GetGraphics();
+ virtual void ReleaseGraphics( SalGraphics* pGraphics );
+ virtual sal_Bool SetSize( long nNewDX, long nNewDY );
+ virtual void GetSize( long& rWidth, long& rHeight );
+};
+
+// =======================================================================
+
+#endif // _SV_SALVD_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/svsys.h b/vcl/inc/ios/svsys.h
new file mode 100644
index 000000000000..a8edcab96eef
--- /dev/null
+++ b/vcl/inc/ios/svsys.h
@@ -0,0 +1,36 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is Tor Lillqvist <tml@iki.fi>
+ * Portions created by the Initial Developer are Copyright (C) 2011 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef _VCL_IOS_SVSYS_H
+#define _VCL_IOS_SVSYS_H
+
+
+// ?
+
+#endif // _VCL_IOS_SVSYS_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/vcluiapp.h b/vcl/inc/ios/vcluiapp.h
new file mode 100644
index 000000000000..df4a01ead0de
--- /dev/null
+++ b/vcl/inc/ios/vcluiapp.h
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _VCL_VCLUIAPP_H
+#define _VCL_VCLUIAPP_H
+
+#include "premac.h"
+#include "UIKit/UIKit.h"
+#include "postmac.h"
+
+class IosSalFrame;
+
+// our very own application
+@interface VCL_UIApplication : UIApplication
+{
+}
+-(void)sendEvent:(UIEvent*)pEvent;
+-(void)sendSuperEvent:(UIEvent*)pEvent;
+-(BOOL)application: (UIApplication*) app openFile: (NSString*)file;
+-(void)application: (UIApplication*) app openFiles: (NSArray*)files;
+-(void)applicationWillTerminate: (UIApplication *) app;
+-(void)addFallbackMenuItem: (UIMenuItem*)pNewItem;
+-(void)removeFallbackMenuItem: (UIMenuItem*)pOldItem;
+@end
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/list.h b/vcl/inc/list.h
index 78c7edce2839..34e9cee266b1 100644
--- a/vcl/inc/list.h
+++ b/vcl/inc/list.h
@@ -66,8 +66,6 @@ extern "C"
int listAtLast(list);
int listPosition(list); /* Expensive! */
#endif
-/*- search */
- int listFind(list, void *); /* Returns true/false */
/*- positioning functions */
/*- return the number of elements by which the current position in the list changes */
@@ -75,7 +73,6 @@ extern "C"
int listSkipForward(list, int n);
int listToFirst(list);
int listToLast(list);
- int listPositionAt(list, int n); /* Expensive! */
/*- adding and removing elements */
list listAppend(list, void *);
diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx
index b91185769b27..9c727a895581 100644
--- a/vcl/inc/sallayout.hxx
+++ b/vcl/inc/sallayout.hxx
@@ -149,7 +149,6 @@ sal_UCS4 GetVerticalChar( sal_UCS4 );
// #i80090# GetMirroredChar also needed outside vcl, moved to svapp.hxx
// VCL_DLLPUBLIC sal_UCS4 GetMirroredChar( sal_UCS4 );
sal_UCS4 GetLocalizedChar( sal_UCS4, LanguageType );
-VCL_PLUGIN_PUBLIC const char* GetAutofallback( sal_UCS4 ) ;
// -------------
// - SalLayout -
diff --git a/vcl/inc/saltimer.hxx b/vcl/inc/saltimer.hxx
index 38dd20e69ff3..11a90dc24bf1 100644
--- a/vcl/inc/saltimer.hxx
+++ b/vcl/inc/saltimer.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,3 +68,5 @@ public:
};
#endif // _SV_SALTIMER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/svsys.h b/vcl/inc/svsys.h
index df0b58c548ca..0976282bc898 100644
--- a/vcl/inc/svsys.h
+++ b/vcl/inc/svsys.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,9 +35,15 @@
#include "aqua/svsys.h"
#elif defined OS2
#include "os2/svsys.h"
+#elif defined IOS
+#include "ios/svsys.h"
+#elif defined ANDROID
+#include "android/svsys.h"
#else
#include "unx/svsys.h"
#endif
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/unx/Xproto.h b/vcl/inc/unx/Xproto.h
index 804b3ffa98cc..b6db98dbfe15 100644
--- a/vcl/inc/unx/Xproto.h
+++ b/vcl/inc/unx/Xproto.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,3 +48,5 @@
#include <tools/postx.h>
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx
index 307a3f2b3e01..24860b8f80df 100644
--- a/vcl/inc/unx/gtk/gtkdata.hxx
+++ b/vcl/inc/unx/gtk/gtkdata.hxx
@@ -93,9 +93,8 @@ class GtkSalDisplay : public SalDisplay
GdkDisplay* m_pGdkDisplay;
GdkCursor *m_aCursors[ POINTER_COUNT ];
bool m_bStartupCompleted;
- std::vector< int > m_aXineramaScreenIndexMap;
- GdkCursor* getFromXPM( const unsigned char *pBitmap, const unsigned char *pMask,
+ GdkCursor* getFromXBM( const unsigned char *pBitmap, const unsigned char *pMask,
int nWidth, int nHeight, int nXHot, int nYHot );
public:
GtkSalDisplay( GdkDisplay* pDisplay );
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 6caf39dc9644..78aea06017a8 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -30,6 +30,7 @@
#define _VCL_GTKFRAME_HXX
#include <tools/prex.h>
+#include <cairo/cairo.h>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx
index 41e500c49027..83d4aa827da9 100644
--- a/vcl/inc/unx/gtk/gtkgdi.hxx
+++ b/vcl/inc/unx/gtk/gtkgdi.hxx
@@ -39,6 +39,8 @@
#if GTK_CHECK_VERSION(3,0,0)
+#include <unx/headless/svpgdi.hxx>
+
// Disabled for gtk3 - use legacy theming code
#define GTK_GRAPHICS_DISABLED
class GtkSalFrame;
@@ -46,7 +48,6 @@ class GtkSalGraphics : public X11SalGraphics {
public:
GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow );
};
-
#else
class GtkSalGraphics : public X11SalGraphics
diff --git a/vcl/unx/headless/svpbmp.hxx b/vcl/inc/unx/headless/svpbmp.hxx
index b3adb3b9951f..b3adb3b9951f 100644
--- a/vcl/unx/headless/svpbmp.hxx
+++ b/vcl/inc/unx/headless/svpbmp.hxx
diff --git a/vcl/unx/headless/svpdummies.hxx b/vcl/inc/unx/headless/svpdummies.hxx
index bc46e9b22f70..bc46e9b22f70 100644
--- a/vcl/unx/headless/svpdummies.hxx
+++ b/vcl/inc/unx/headless/svpdummies.hxx
diff --git a/vcl/unx/headless/svpelement.hxx b/vcl/inc/unx/headless/svpelement.hxx
index c7f647cf3a03..c7f647cf3a03 100644
--- a/vcl/unx/headless/svpelement.hxx
+++ b/vcl/inc/unx/headless/svpelement.hxx
diff --git a/vcl/unx/headless/svpframe.hxx b/vcl/inc/unx/headless/svpframe.hxx
index e57381780f61..e57381780f61 100644
--- a/vcl/unx/headless/svpframe.hxx
+++ b/vcl/inc/unx/headless/svpframe.hxx
diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/inc/unx/headless/svpgdi.hxx
index 8291a3c2f7bc..8291a3c2f7bc 100644
--- a/vcl/unx/headless/svpgdi.hxx
+++ b/vcl/inc/unx/headless/svpgdi.hxx
diff --git a/vcl/unx/headless/svpinst.hxx b/vcl/inc/unx/headless/svpinst.hxx
index 6fcafe0c7f66..6fcafe0c7f66 100644
--- a/vcl/unx/headless/svpinst.hxx
+++ b/vcl/inc/unx/headless/svpinst.hxx
diff --git a/vcl/unx/headless/svpprn.hxx b/vcl/inc/unx/headless/svpprn.hxx
index f7e6a671f4b3..f7e6a671f4b3 100644
--- a/vcl/unx/headless/svpprn.hxx
+++ b/vcl/inc/unx/headless/svpprn.hxx
diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/inc/unx/headless/svppspgraphics.hxx
index 1ce9109918d5..1ce9109918d5 100644
--- a/vcl/unx/headless/svppspgraphics.hxx
+++ b/vcl/inc/unx/headless/svppspgraphics.hxx
diff --git a/vcl/unx/headless/svpvd.hxx b/vcl/inc/unx/headless/svpvd.hxx
index 211cf36846f9..211cf36846f9 100644
--- a/vcl/unx/headless/svpvd.hxx
+++ b/vcl/inc/unx/headless/svpvd.hxx
diff --git a/vcl/inc/unx/salbmp.h b/vcl/inc/unx/salbmp.h
index a389195308d3..0fa69ae5a72f 100644
--- a/vcl/inc/unx/salbmp.h
+++ b/vcl/inc/unx/salbmp.h
@@ -36,6 +36,7 @@
#include <unx/saldisp.hxx>
#include <salbmp.hxx>
#include <vclpluginapi.h>
+#include <list>
struct BitmapBuffer;
class BitmapPalette;
@@ -51,80 +52,118 @@ class VCLPLUG_GEN_PUBLIC X11SalBitmap : public SalBitmap
{
private:
- static BitmapBuffer* ImplCreateDIB( const Size& rSize,
- sal_uInt16 nBitCount,
- const BitmapPalette& rPal );
- static BitmapBuffer* ImplCreateDIB( Drawable aDrawable,
- int nScreen,
- long nDrawableDepth,
- long nX, long nY,
- long nWidth, long nHeight,
- bool bGrey );
+ static BitmapBuffer* ImplCreateDIB(
+ const Size& rSize,
+ sal_uInt16 nBitCount,
+ const BitmapPalette& rPal
+ );
+
+ static BitmapBuffer* ImplCreateDIB(
+ Drawable aDrawable,
+ int nScreen,
+ long nDrawableDepth,
+ long nX,
+ long nY,
+ long nWidth,
+ long nHeight,
+ bool bGrey
+ );
public:
static ImplSalBitmapCache* mpCache;
- static sal_uIntPtr mnCacheInstCount;
+ static sal_uIntPtr mnCacheInstCount;
static void ImplCreateCache();
static void ImplDestroyCache();
void ImplRemovedFromCache();
bool SnapShot (Display* pDisplay, XLIB_Window hWindow);
- bool ImplCreateFromXImage( Display* pDisplay,
- XLIB_Window hWindow,
- int nScreen,
- XImage* pImage);
+ bool ImplCreateFromXImage(
+ Display* pDisplay,
+ XLIB_Window hWindow,
+ int nScreen,
+ XImage* pImage
+ );
private:
-
BitmapBuffer* mpDIB;
ImplSalDDB* mpDDB;
bool mbGrey;
public:
- SAL_DLLPRIVATE bool ImplCreateFromDrawable( Drawable aDrawable,
- int nScreen,
- long nDrawableDepth,
- long nX, long nY,
- long nWidth, long nHeight );
-
- SAL_DLLPRIVATE XImage* ImplCreateXImage( SalDisplay* pSalDisp,
- int nScreen, long nDepth,
- const SalTwoRect& rTwoRect ) const;
-
- SAL_DLLPRIVATE ImplSalDDB* ImplGetDDB( Drawable, int nScreen, long nDrawableDepth,
- const SalTwoRect& ) const;
- void ImplDraw( Drawable aDrawable, int nScreen, long nDrawableDepth,
- const SalTwoRect& rTwoRect, const GC& rGC ) const;
+ SAL_DLLPRIVATE bool ImplCreateFromDrawable(
+ Drawable aDrawable,
+ int nScreen,
+ long nDrawableDepth,
+ long nX,
+ long nY,
+ long nWidth,
+ long nHeight
+ );
+
+ SAL_DLLPRIVATE XImage* ImplCreateXImage(
+ SalDisplay* pSalDisp,
+ int nScreen,
+ long nDepth,
+ const SalTwoRect& rTwoRect
+ ) const;
+
+ SAL_DLLPRIVATE ImplSalDDB* ImplGetDDB(
+ Drawable,
+ int nScreen,
+ long nDrawableDepth,
+ const SalTwoRect&
+ ) const;
+
+ void ImplDraw(
+ Drawable aDrawable,
+ int nScreen,
+ long nDrawableDepth,
+ const SalTwoRect& rTwoRect,
+ const GC& rGC
+ ) const;
public:
- X11SalBitmap();
- virtual ~X11SalBitmap();
+ X11SalBitmap();
+ virtual ~X11SalBitmap();
// overload pure virtual methods
- virtual bool Create( const Size& rSize,
- sal_uInt16 nBitCount,
- const BitmapPalette& rPal );
- virtual bool Create( const SalBitmap& rSalBmp );
- virtual bool Create( const SalBitmap& rSalBmp,
- SalGraphics* pGraphics );
- virtual bool Create( const SalBitmap& rSalBmp,
- sal_uInt16 nNewBitCount );
- virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
+ virtual bool Create(
+ const Size& rSize,
+ sal_uInt16 nBitCount,
+ const BitmapPalette& rPal
+ );
+
+ virtual bool Create( const SalBitmap& rSalBmp );
+ virtual bool Create(
+ const SalBitmap& rSalBmp,
+ SalGraphics* pGraphics
+ );
+
+ virtual bool Create(
+ const SalBitmap& rSalBmp,
+ sal_uInt16 nNewBitCount
+ );
+
+ virtual bool Create(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XBitmapCanvas
+ > xBitmapCanvas,
Size& rSize,
- bool bMask = false );
+ bool bMask = false
+ );
- virtual void Destroy();
+ virtual void Destroy();
- virtual Size GetSize() const;
+ virtual Size GetSize() const;
virtual sal_uInt16 GetBitCount() const;
- virtual BitmapBuffer* AcquireBuffer( bool bReadOnly );
- virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
- virtual bool GetSystemData( BitmapSystemData& rData );
+ virtual BitmapBuffer* AcquireBuffer( bool bReadOnly );
+ virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
+ virtual bool GetSystemData( BitmapSystemData& rData );
};
// --------------
@@ -142,49 +181,81 @@ private:
ImplSalDDB() {}
- static void ImplDraw( Drawable aSrcDrawable, long nSrcDrawableDepth,
- Drawable aDstDrawable, long nDstDrawableDepth,
- long nSrcX, long nSrcY,
- long nDestWidth, long nDestHeight,
- long nDestX, long nDestY, const GC& rGC );
+ static void ImplDraw(
+ Drawable aSrcDrawable,
+ long nSrcDrawableDepth,
+ Drawable aDstDrawable,
+ long nDstDrawableDepth,
+ long nSrcX,
+ long nSrcY,
+ long nDestWidth,
+ long nDestHeight,
+ long nDestX,
+ long nDestY,
+ const GC& rGC
+ );
public:
- ImplSalDDB( XImage* pImage,
- Drawable aDrawable, int nScreen,
- const SalTwoRect& rTwoRect );
- ImplSalDDB( Drawable aDrawable,
- int nScreen,
- long nDrawableDepth,
- long nX, long nY, long nWidth, long nHeight );
- ImplSalDDB( Display* pDisplay,
- XLIB_Window hWindow,
- int nScreen,
- XImage* pImage);
+ ImplSalDDB(
+ XImage* pImage,
+ Drawable aDrawable,
+ int nScreen,
+ const SalTwoRect& rTwoRect
+ );
+
+ ImplSalDDB(
+ Drawable aDrawable,
+ int nScreen,
+ long nDrawableDepth,
+ long nX,
+ long nY,
+ long nWidth,
+ long nHeight
+ );
+
+ ImplSalDDB(
+ Display* pDisplay,
+ XLIB_Window hWindow,
+ int nScreen,
+ XImage* pImage
+ );
+
~ImplSalDDB();
Pixmap ImplGetPixmap() const { return maPixmap; }
long ImplGetWidth() const { return maTwoRect.mnDestWidth; }
long ImplGetHeight() const { return maTwoRect.mnDestHeight; }
long ImplGetDepth() const { return mnDepth; }
- sal_uIntPtr ImplGetMemSize() const { return( ( maTwoRect.mnDestWidth * maTwoRect.mnDestHeight * mnDepth ) >> 3 ); }
+ sal_uIntPtr ImplGetMemSize() const
+ {
+ return( ( maTwoRect.mnDestWidth * maTwoRect.mnDestHeight * mnDepth ) >> 3 );
+ }
int ImplGetScreen() const { return mnScreen; }
bool ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const;
- void ImplDraw( Drawable aDrawable, long nDrawableDepth,
- const SalTwoRect& rTwoRect, const GC& rGC ) const;
+
+ void ImplDraw(
+ Drawable aDrawable,
+ long nDrawableDepth,
+ const SalTwoRect& rTwoRect,
+ const GC& rGC
+ ) const;
};
// ----------------------
// - ImplSalBitmapCache -
// ----------------------
+struct ImplBmpObj;
+
class ImplSalBitmapCache
{
private:
+ typedef ::std::list< ImplBmpObj* > BmpList_impl;
- List maBmpList;
- sal_uIntPtr mnTotalSize;
+ BmpList_impl maBmpList;
+ sal_uIntPtr mnTotalSize;
public:
@@ -198,47 +269,4 @@ public:
#endif // _SV_SALBMP_HXX
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/unx/saldata.hxx b/vcl/inc/unx/saldata.hxx
index 7bce61cc9ce7..825c148cfa1f 100644
--- a/vcl/inc/unx/saldata.hxx
+++ b/vcl/inc/unx/saldata.hxx
@@ -46,7 +46,8 @@ class SalPrinter;
// -=-= typedefs -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#if defined LINUX || defined NETBSD || defined AIX || \
- defined FREEBSD || defined OPENBSD || defined DRAGONFLY
+ defined FREEBSD || defined OPENBSD || defined DRAGONFLY || \
+ defined ANDROID
#include <pthread.h>
#else
typedef unsigned int pthread_t;
diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx
index 6687762c1e9d..194e050df2b0 100644
--- a/vcl/inc/unx/saldisp.hxx
+++ b/vcl/inc/unx/saldisp.hxx
@@ -372,7 +372,7 @@ protected:
KeySym nShiftKeySym_; // first shift modifier
KeySym nCtrlKeySym_; // first control modifier
KeySym nMod1KeySym_; // first mod1 modifier
- ByteString m_aKeyboardName;
+ rtl::OString m_aKeyboardName;
vcl_sal::WMAdaptor* m_pWMAdaptor;
DtIntegrator* m_pDtIntegrator;
@@ -420,8 +420,9 @@ public:
bool DispatchInternalEvent();
void PrintInfo() const;
- void PrintEvent( const ByteString &rComment,
- XEvent *pEvent ) const;
+#ifdef DBG_UTIL
+ void DbgPrintDisplayEvent(const char *pComment, XEvent *pEvent) const;
+#endif
void Beep() const;
diff --git a/vcl/inc/unx/x11_cursors/salcursors.h b/vcl/inc/unx/x11_cursors/salcursors.h
index e0d34e122336..6af2c111fb57 100644
--- a/vcl/inc/unx/x11_cursors/salcursors.h
+++ b/vcl/inc/unx/x11_cursors/salcursors.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -160,3 +161,5 @@
#include "unx/x11_cursors/tblselsw_mask.h"
#include "unx/x11_cursors/paintbrush_curs.h"
#include "unx/x11_cursors/paintbrush_mask.h"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/accel.hxx b/vcl/inc/vcl/accel.hxx
index a7bf623cb20a..79109e08cd4c 100644
--- a/vcl/inc/vcl/accel.hxx
+++ b/vcl/inc/vcl/accel.hxx
@@ -83,9 +83,6 @@ public:
void InsertItem( sal_uInt16 nItemId, const KeyCode& rKeyCode );
void InsertItem( const ResId& rResId );
- void RemoveItem( sal_uInt16 nItemId );
- void RemoveItem( const KeyCode rKeyCode );
- void Clear();
sal_uInt16 GetCurItemId() const { return mnCurId; }
const KeyCode& GetCurKeyCode() const { return maCurKeyCode; }
@@ -94,22 +91,9 @@ public:
sal_uInt16 GetItemCount() const;
sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
- KeyCode GetItemKeyCode( sal_uInt16 nPos ) const;
- sal_uInt16 GetItemId( const KeyCode& rKeyCode ) const;
KeyCode GetKeyCode( sal_uInt16 nItemId ) const;
- sal_Bool IsIdValid( sal_uInt16 nItemId ) const;
- sal_Bool IsKeyCodeValid( const KeyCode rKeyCode ) const;
- sal_Bool Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat = 0 );
- void SetAccel( sal_uInt16 nItemId, Accelerator* pAccel );
Accelerator* GetAccel( sal_uInt16 nItemId ) const;
- void SetAccel( const KeyCode rKeyCode, Accelerator* pAccel );
- Accelerator* GetAccel( const KeyCode rKeyCode ) const;
-
- void EnableItem( sal_uInt16 nItemId, sal_Bool bEnable = sal_True );
- sal_Bool IsItemEnabled( sal_uInt16 nItemId ) const;
- void EnableItem( const KeyCode rKeyCode, sal_Bool bEnable = sal_True );
- sal_Bool IsItemEnabled( const KeyCode rKeyCode ) const;
void SetHelpText( const XubString& rHelpText ) { maHelpStr = rHelpText; }
const XubString& GetHelpText() const { return maHelpStr; }
diff --git a/vcl/inc/vcl/animate.hxx b/vcl/inc/vcl/animate.hxx
index e53a51e0e932..956f63f330f8 100644
--- a/vcl/inc/vcl/animate.hxx
+++ b/vcl/inc/vcl/animate.hxx
@@ -71,20 +71,25 @@ struct VCL_DLLPUBLIC AnimationBitmap
Size aSizePix;
long nWait;
Disposal eDisposal;
- sal_Bool bUserInput;
+ sal_Bool bUserInput;
AnimationBitmap() {}
- AnimationBitmap( const BitmapEx& rBmpEx, const Point& rPosPix,
- const Size& rSizePix, long _nWait = 0L,
- Disposal _eDisposal = DISPOSE_NOT ) :
- aBmpEx ( rBmpEx ),
- aPosPix ( rPosPix ),
- aSizePix ( rSizePix ),
- nWait ( _nWait ),
- eDisposal ( _eDisposal ),
- bUserInput ( sal_False ) {}
-
- sal_Bool operator==( const AnimationBitmap& rAnimBmp ) const
+ AnimationBitmap(
+ const BitmapEx& rBmpEx,
+ const Point& rPosPix,
+ const Size& rSizePix,
+ long _nWait = 0L,
+ Disposal _eDisposal = DISPOSE_NOT
+ ) :
+ aBmpEx ( rBmpEx ),
+ aPosPix ( rPosPix ),
+ aSizePix ( rSizePix ),
+ nWait ( _nWait ),
+ eDisposal ( _eDisposal ),
+ bUserInput ( sal_False )
+ {}
+
+ sal_Bool operator==( const AnimationBitmap& rAnimBmp ) const
{
return( rAnimBmp.aBmpEx == aBmpEx &&
rAnimBmp.aPosPix == aPosPix &&
@@ -94,9 +99,10 @@ struct VCL_DLLPUBLIC AnimationBitmap
rAnimBmp.bUserInput == bUserInput );
}
- sal_Bool operator!=( const AnimationBitmap& rAnimBmp ) const { return !( *this == rAnimBmp ); }
+ sal_Bool operator!=( const AnimationBitmap& rAnimBmp ) const
+ { return !( *this == rAnimBmp ); }
- sal_Bool IsEqual( const AnimationBitmap& rAnimBmp ) const
+ sal_Bool IsEqual( const AnimationBitmap& rAnimBmp ) const
{
return( rAnimBmp.aPosPix == aPosPix &&
rAnimBmp.aSizePix == aSizePix &&
@@ -106,7 +112,7 @@ struct VCL_DLLPUBLIC AnimationBitmap
rAnimBmp.aBmpEx.IsEqual( aBmpEx ) );
}
- sal_uLong GetChecksum() const;
+ sal_uLong GetChecksum() const;
};
// -------------------
@@ -125,8 +131,8 @@ struct AInfo
OutputDevice* pOutDev;
void* pViewData;
long nExtraData;
- sal_Bool bWithSize;
- sal_Bool bPause;
+ sal_Bool bWithSize;
+ sal_Bool bPause;
AInfo() : pOutDev( NULL ),
pViewData( NULL ),
@@ -139,28 +145,31 @@ struct AInfo
// - AnimationBitmap -
// -------------------
+class ImplAnimView;
+typedef ::std::vector< AnimationBitmap* > AnimationBitmapList_impl;
+typedef ::std::vector< ImplAnimView* > AnimViewList_impl;
+
class VCL_DLLPUBLIC Animation
{
- SAL_DLLPRIVATE static sal_uLong mnAnimCount;
+ SAL_DLLPRIVATE static sal_uLong mnAnimCount;
- List maList;
- List maAInfoList;
+ AnimationBitmapList_impl maList;
+ AnimViewList_impl maViewList;
Link maNotifyLink;
BitmapEx maBitmapEx;
Timer maTimer;
Size maGlobalSize;
- List* mpViewList;
void* mpExtraData;
long mnLoopCount;
long mnLoops;
- long mnPos;
+ size_t mnPos;
Disposal meLastDisposal;
CycleMode meCycleMode;
- sal_Bool mbFirst;
- sal_Bool mbIsInAnimation;
- sal_Bool mbWithSize;
- sal_Bool mbLoopTerminated;
- sal_Bool mbIsWaiting;
+ sal_Bool mbFirst;
+ sal_Bool mbIsInAnimation;
+ sal_Bool mbWithSize;
+ sal_Bool mbLoopTerminated;
+ sal_Bool mbIsWaiting;
SAL_DLLPRIVATE void ImplRestartTimer( sal_uLong nTimeout );
@@ -170,7 +179,7 @@ public:
SAL_DLLPRIVATE static void ImplIncAnimCount() { mnAnimCount++; }
SAL_DLLPRIVATE static void ImplDecAnimCount() { mnAnimCount--; }
- SAL_DLLPRIVATE sal_uLong ImplGetCurPos() const { return mnPos; }
+ SAL_DLLPRIVATE sal_uLong ImplGetCurPos() const { return mnPos; }
public:
@@ -179,28 +188,36 @@ public:
~Animation();
Animation& operator=( const Animation& rAnimation );
- sal_Bool operator==( const Animation& rAnimation ) const;
- sal_Bool operator!=( const Animation& rAnimation ) const { return !(*this==rAnimation); }
-
- sal_Bool IsEqual( const Animation& rAnimation ) const;
+ sal_Bool operator==( const Animation& rAnimation ) const;
+ sal_Bool operator!=( const Animation& rAnimation ) const
+ { return !(*this==rAnimation); }
- sal_Bool IsEmpty() const;
+ sal_Bool IsEmpty() const;
void SetEmpty();
void Clear();
- sal_Bool Start( OutputDevice* pOutDev, const Point& rDestPt, long nExtraData = 0,
- OutputDevice* pFirstFrameOutDev = NULL );
- sal_Bool Start( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz, long nExtraData = 0,
- OutputDevice* pFirstFrameOutDev = NULL );
+ sal_Bool Start(
+ OutputDevice* pOutDev,
+ const Point& rDestPt,
+ long nExtraData = 0,
+ OutputDevice* pFirstFrameOutDev = NULL
+ );
+ sal_Bool Start(
+ OutputDevice* pOutDev,
+ const Point& rDestPt,
+ const Size& rDestSz,
+ long nExtraData = 0,
+ OutputDevice* pFirstFrameOutDev = NULL
+ );
void Stop( OutputDevice* pOutDev = NULL, long nExtraData = 0 );
void Draw( OutputDevice* pOutDev, const Point& rDestPt ) const;
void Draw( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz ) const;
- sal_Bool IsInAnimation() const { return mbIsInAnimation; }
- sal_Bool IsTransparent() const;
- sal_Bool IsTerminated() const { return mbLoopTerminated; }
+ sal_Bool IsInAnimation() const { return mbIsInAnimation; }
+ sal_Bool IsTransparent() const;
+ sal_Bool IsTerminated() const { return mbLoopTerminated; }
const Size& GetDisplaySizePixel() const { return maGlobalSize; }
void SetDisplaySizePixel( const Size& rSize ) { maGlobalSize = rSize; }
@@ -208,7 +225,7 @@ public:
const BitmapEx& GetBitmapEx() const { return maBitmapEx; }
void SetBitmapEx( const BitmapEx& rBmpEx ) { maBitmapEx = rBmpEx; }
- sal_uLong GetLoopCount() const { return mnLoopCount; }
+ sal_uLong GetLoopCount() const { return mnLoopCount; }
void SetLoopCount( const sal_uLong nLoopCount );
void ResetLoopCount();
@@ -218,36 +235,40 @@ public:
void SetNotifyHdl( const Link& rLink ) { maNotifyLink = rLink; }
const Link& GetNotifyHdl() const { return maNotifyLink; }
- sal_uInt16 Count() const { return (sal_uInt16) maList.Count(); }
- sal_Bool Insert( const AnimationBitmap& rAnimationBitmap );
+ size_t Count() const { return maList.size(); }
+ sal_Bool Insert( const AnimationBitmap& rAnimationBitmap );
const AnimationBitmap& Get( sal_uInt16 nAnimation ) const;
void Replace( const AnimationBitmap& rNewAnimationBmp, sal_uInt16 nAnimation );
- List* GetAInfoList() { return &maAInfoList; }
- sal_uLong GetSizeBytes() const;
- sal_uLong GetChecksum() const;
+ sal_uLong GetSizeBytes() const;
+ sal_uLong GetChecksum() const;
public:
- sal_Bool Convert( BmpConversion eConversion );
- sal_Bool ReduceColors( sal_uInt16 nNewColorCount,
- BmpReduce eReduce = BMP_REDUCE_SIMPLE );
- sal_Bool Invert();
- sal_Bool Mirror( sal_uLong nMirrorFlags );
- sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX );
- sal_Bool Adjust( short nLuminancePercent = 0,
- short nContrastPercent = 0,
- short nChannelRPercent = 0,
- short nChannelGPercent = 0,
- short nChannelBPercent = 0,
- double fGamma = 1.0,
- sal_Bool bInvert = sal_False );
- sal_Bool Filter( BmpFilter eFilter,
- const BmpFilterParam* pFilterParam = NULL,
- const Link* pProgress = NULL );
-
- friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, Animation& rAnimation );
- friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const Animation& rAnimation );
+ sal_Bool Convert( BmpConversion eConversion );
+ sal_Bool ReduceColors(
+ sal_uInt16 nNewColorCount,
+ BmpReduce eReduce = BMP_REDUCE_SIMPLE
+ );
+ sal_Bool Invert();
+ sal_Bool Mirror( sal_uLong nMirrorFlags );
+ sal_Bool Adjust(
+ short nLuminancePercent = 0,
+ short nContrastPercent = 0,
+ short nChannelRPercent = 0,
+ short nChannelGPercent = 0,
+ short nChannelBPercent = 0,
+ double fGamma = 1.0,
+ sal_Bool bInvert = sal_False
+ );
+ sal_Bool Filter(
+ BmpFilter eFilter,
+ const BmpFilterParam* pFilterParam = NULL,
+ const Link* pProgress = NULL
+ );
+
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, Animation& rAnimation );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const Animation& rAnimation );
};
#endif // _SV_ANIMATE_HXX
diff --git a/vcl/inc/vcl/bitmap.hxx b/vcl/inc/vcl/bitmap.hxx
index e25bb482f53c..a6ff3129fada 100644
--- a/vcl/inc/vcl/bitmap.hxx
+++ b/vcl/inc/vcl/bitmap.hxx
@@ -234,7 +234,7 @@ struct BitmapSystemData
#if defined( WNT )
void* pDIB; // device independent byte buffer
void* pDDB; // if not NULL then this is actually an HBITMAP
- #elif defined( QUARTZ )
+ #elif defined( QUARTZ ) || defined( IOS )
void* rImageContext; //Image context (CGContextRef)
#else
void* aPixmap;
diff --git a/vcl/inc/vcl/canvastools.hxx b/vcl/inc/vcl/canvastools.hxx
index e82d397a92f0..ce6c7bcafe68 100644
--- a/vcl/inc/vcl/canvastools.hxx
+++ b/vcl/inc/vcl/canvastools.hxx
@@ -144,11 +144,6 @@ namespace vcl
::BitmapEx VCL_DLLPUBLIC bitmapExFromXBitmap( const ::com::sun::star::uno::Reference<
::com::sun::star::rendering::XIntegerReadOnlyBitmap >& xInputBitmap );
- /** get a unique identifier for identification in XUnoTunnel interface
- */
- enum TunnelIdentifierType { Id_BitmapEx = 0 };
- const com::sun::star::uno::Sequence< sal_Int8 > VCL_DLLPUBLIC getTunnelIdentifier( TunnelIdentifierType eType );
-
// Color conversions (vcl/tools Color <-> canvas standard color space)
// ===================================================================
diff --git a/vcl/inc/vcl/displayconnectiondispatch.hxx b/vcl/inc/vcl/displayconnectiondispatch.hxx
index fea1d0b7cba9..0804c9111153 100644
--- a/vcl/inc/vcl/displayconnectiondispatch.hxx
+++ b/vcl/inc/vcl/displayconnectiondispatch.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,3 +51,5 @@ protected:
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/field.hxx b/vcl/inc/vcl/field.hxx
index fd0ce90cb0d7..4af5e1a6128b 100644
--- a/vcl/inc/vcl/field.hxx
+++ b/vcl/inc/vcl/field.hxx
@@ -111,7 +111,7 @@ public:
class VCL_DLLPUBLIC PatternFormatter : public FormatterBase
{
private:
- ByteString maEditMask;
+ rtl::OString m_aEditMask;
XubString maFieldString;
XubString maLiteralMask;
sal_uInt16 mnFormatFlags;
@@ -122,7 +122,8 @@ protected:
PatternFormatter();
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE void ImplSetMask( const ByteString& rEditMask, const XubString& rLiteralMask );
+ SAL_DLLPRIVATE void ImplSetMask(const rtl::OString& rEditMask,
+ const XubString& rLiteralMask);
SAL_DLLPRIVATE sal_Bool ImplIsSameMask() const { return mbSameMask; }
SAL_DLLPRIVATE sal_Bool& ImplGetInPattKeyInput() { return mbInPattKeyInput; }
@@ -131,9 +132,8 @@ public:
virtual void Reformat();
- void SetMask( const ByteString& rEditMask,
- const XubString& rLiteralMask );
- const ByteString& GetEditMask() const { return maEditMask; }
+ void SetMask(const rtl::OString& rEditMask, const XubString& rLiteralMask );
+ const rtl::OString& GetEditMask() const { return m_aEditMask; }
const XubString& GetLiteralMask() const { return maLiteralMask; }
void SetFormatFlags( sal_uInt16 nFlags ) { mnFormatFlags = nFlags; }
@@ -475,8 +475,6 @@ public:
void SetTime( const Time& rNewTime );
void SetUserTime( const Time& rNewTime );
Time GetTime() const;
- Time GetRealTime() const;
- sal_Bool IsTimeModified() const;
void SetEmptyTime() { FormatterBase::SetEmptyFieldValue(); }
sal_Bool IsEmptyTime() const { return FormatterBase::IsEmptyFieldValue(); }
Time GetCorrectedTime() const { return maCorrectedTime; }
@@ -866,7 +864,6 @@ class VCL_DLLPUBLIC TimeBox : public ComboBox, public TimeFormatter
{
public:
TimeBox( Window* pParent, WinBits nWinStyle );
- TimeBox( Window* pParent, const ResId& rResId );
~TimeBox();
virtual long PreNotify( NotifyEvent& rNEvt );
@@ -876,12 +873,6 @@ public:
virtual void Modify();
virtual void ReformatAll();
-
- void InsertTime( const Time& rTime, sal_uInt16 nPos = COMBOBOX_APPEND );
- void RemoveTime( const Time& rTime );
- using TimeFormatter::GetTime;
- Time GetTime( sal_uInt16 nPos ) const;
- sal_uInt16 GetTimePos( const Time& rTime ) const;
};
#endif // _SV_FIELD_HXX
diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
index 145c4d0a2169..467297668b5a 100644
--- a/vcl/inc/vcl/fontmanager.hxx
+++ b/vcl/inc/vcl/fontmanager.hxx
@@ -333,7 +333,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
void getFontAttributesFromXLFD( PrintFont* pFont, const std::list< rtl::OString >& rXLFDs ) const;
- bool analyzeFontFile( int nDirID, const rtl::OString& rFileName, const std::list< rtl::OString >& rXLFDs, std::list< PrintFont* >& rNewFonts ) const;
+ bool analyzeFontFile( int nDirID, const rtl::OString& rFileName, const std::list< rtl::OString >& rXLFDs, std::list< PrintFont* >& rNewFonts, const char *pFormat=NULL ) const;
rtl::OUString convertTrueTypeName( void* pNameRecord ) const; // actually a NameRecord* formt font subsetting code
void analyzeTrueTypeFamilyName( void* pTTFont, std::list< rtl::OUString >& rnames ) const; // actually a TrueTypeFont* from font subsetting code
bool analyzeTrueTypeFile( PrintFont* pFont ) const;
diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx
index 86f8dc5cbc77..e15a536ced0f 100644
--- a/vcl/inc/vcl/gdimtf.hxx
+++ b/vcl/inc/vcl/gdimtf.hxx
@@ -291,4 +291,4 @@ MetaCommentAction* makePluggableRendererAction( const rtl::OUString& rRendererSe
#endif // _SV_GDIMTF_HXX
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/graph.hxx b/vcl/inc/vcl/graph.hxx
index 61da922acce6..2ca801cfb97b 100644
--- a/vcl/inc/vcl/graph.hxx
+++ b/vcl/inc/vcl/graph.hxx
@@ -178,8 +178,6 @@ public:
sal_uLong GetAnimationLoopCount() const;
void ResetAnimationLoopCount();
- List* GetAnimationInfoList() const;
-
sal_uLong GetChecksum() const;
public:
@@ -222,4 +220,4 @@ public:
#endif // _SV_GRAPH_HXX
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/graphictools.hxx b/vcl/inc/vcl/graphictools.hxx
index edd29ab9db01..333c9163d57a 100644
--- a/vcl/inc/vcl/graphictools.hxx
+++ b/vcl/inc/vcl/graphictools.hxx
@@ -424,18 +424,6 @@ public:
void setHatchType ( HatchType aHatchType );
/// Set color used for drawing the hatch
void setHatchColor ( Color aHatchColor );
- /// Set type of gradient used
- void setGradientType ( GradientType aGradType );
- /// Set start color of the gradient
- void setGradient1stColor ( Color aColor );
- /// Set end color of the gradient
- void setGradient2ndColor ( Color aColor );
- /** Set the numbers of steps to render the gradient.
-
- @param aCount
- The step count. gradientStepsInfinite means use infinitely many.
- */
- void setGradientStepCount( int aCount );
/// Set the texture graphic used
void setGraphic ( const Graphic& rGraphic );
diff --git a/vcl/inc/vcl/help.hxx b/vcl/inc/vcl/help.hxx
index ce7d1baf4fd6..54cdea8ccb25 100644
--- a/vcl/inc/vcl/help.hxx
+++ b/vcl/inc/vcl/help.hxx
@@ -86,14 +86,12 @@ public:
static void EnableContextHelp();
static void DisableContextHelp();
static sal_Bool IsContextHelpEnabled();
- static sal_Bool StartContextHelp();
static void EnableExtHelp();
static void DisableExtHelp();
static sal_Bool IsExtHelpEnabled();
static sal_Bool StartExtHelp();
static sal_Bool EndExtHelp();
- static sal_Bool IsExtHelpActive();
static void EnableBalloonHelp();
static void DisableBalloonHelp();
diff --git a/vcl/inc/vcl/image.hxx b/vcl/inc/vcl/image.hxx
index d536d6bd03d7..301af44bead9 100644
--- a/vcl/inc/vcl/image.hxx
+++ b/vcl/inc/vcl/image.hxx
@@ -87,9 +87,6 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > GetXGraphic() const;
Image GetColorTransformedImage( ImageColorTransform eColorTransform ) const;
- static void GetColorTransformArrays( ImageColorTransform eColorTransform, Color*& rpSrcColor, Color*& rpDstColor, sal_uLong& rColorCount );
-
- void Invert();
sal_Bool operator!() const { return( !mpImplData ? true : false ); }
Image& operator=( const Image& rImage );
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index b0d694c5e75e..78c7ad938d1a 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -282,6 +282,9 @@ class VirtualDevice;
class Printer;
class ImplFontSelectData;
class ImplFontMetricData;
+class VCLXGraphics;
+
+typedef ::std::vector< VCLXGraphics* > VCLXGraphicsList_impl;
const char* ImplDbgCheckOutputDevice( const void* pObj );
@@ -305,17 +308,17 @@ private:
mutable SalGraphics* mpGraphics;
mutable OutputDevice* mpPrevGraphics;
mutable OutputDevice* mpNextGraphics;
- GDIMetaFile* mpMetaFile;
+ GDIMetaFile* mpMetaFile;
mutable ImplFontEntry* mpFontEntry;
mutable ImplFontCache* mpFontCache;
mutable ImplDevFontList* mpFontList;
mutable ImplGetDevFontList* mpGetDevFontList;
mutable ImplGetDevSizeList* mpGetDevSizeList;
- ImplObjStack* mpObjStack;
- ImplOutDevData* mpOutDevData;
- List* mpUnoGraphicsList;
- vcl::PDFWriterImpl* mpPDFWriter;
- vcl::ExtOutDevData* mpExtOutDevData;
+ ImplObjStack* mpObjStack;
+ ImplOutDevData* mpOutDevData;
+ VCLXGraphicsList_impl* mpUnoGraphicsList;
+ vcl::PDFWriterImpl* mpPDFWriter;
+ vcl::ExtOutDevData* mpExtOutDevData;
// TEMP TEMP TEMP
VirtualDevice* mpAlphaVDev;
@@ -1141,8 +1144,12 @@ public:
::com::sun::star::rendering::XCanvas > GetCanvas() const;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > CreateUnoGraphics();
- List* GetUnoGraphicsList() const { return mpUnoGraphicsList; }
- List* CreateUnoGraphicsList() { mpUnoGraphicsList = new List; return mpUnoGraphicsList; }
+ VCLXGraphicsList_impl* GetUnoGraphicsList() const { return mpUnoGraphicsList; }
+ VCLXGraphicsList_impl* CreateUnoGraphicsList()
+ {
+ mpUnoGraphicsList = new VCLXGraphicsList_impl();
+ return mpUnoGraphicsList;
+ }
static void BeginFontSubstitution();
static void EndFontSubstitution();
diff --git a/vcl/inc/vcl/ppdparser.hxx b/vcl/inc/vcl/ppdparser.hxx
index 7082c020c7a2..474d847e2607 100644
--- a/vcl/inc/vcl/ppdparser.hxx
+++ b/vcl/inc/vcl/ppdparser.hxx
@@ -186,12 +186,12 @@ private:
PPDParser( const String& rFile );
~PPDParser();
- void parseOrderDependency( const ByteString& rLine );
- void parseOpenUI( const ByteString& rLine );
- void parseConstraint( const ByteString& rLine );
- void parse( std::list< ByteString >& rLines );
+ void parseOrderDependency(const rtl::OString& rLine);
+ void parseOpenUI(const rtl::OString& rLine);
+ void parseConstraint(const rtl::OString& rLine);
+ void parse( std::list< rtl::OString >& rLines );
- String handleTranslation( const ByteString& i_rString, bool i_bIsGlobalized );
+ String handleTranslation(const rtl::OString& i_rString, bool i_bIsGlobalized);
static void scanPPDDir( const String& rDir );
static void initPPDFiles();
diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx
index 182258aeb3c1..120198328e49 100644
--- a/vcl/inc/vcl/print.hxx
+++ b/vcl/inc/vcl/print.hxx
@@ -265,14 +265,12 @@ private:
SAL_DLLPRIVATE void ImplUpdatePageData();
SAL_DLLPRIVATE void ImplUpdateFontList();
SAL_DLLPRIVATE void ImplFindPaperFormatForUserSize( JobSetup&, bool bMatchNearest );
- DECL_DLLPRIVATE_LINK( ImplDestroyPrinterAsync, void* );
SAL_DLLPRIVATE bool StartJob( const rtl::OUString& rJobName, boost::shared_ptr<vcl::PrinterController>& );
static SAL_DLLPRIVATE sal_uLong ImplSalPrinterErrorCodeToVCL( sal_uLong nError );
private:
- SAL_DLLPRIVATE void ImplEndPrint();
SAL_DLLPRIVATE sal_Bool EndJob();
SAL_DLLPRIVATE Printer( const Printer& rPrinter );
SAL_DLLPRIVATE Printer& operator =( const Printer& rPrinter );
@@ -281,7 +279,6 @@ public:
SAL_DLLPRIVATE void ImplEndPage();
public:
void DrawGradientEx( OutputDevice* pOut, const Rectangle& rRect, const Gradient& rGradient );
- void DrawGradientEx( OutputDevice* pOut, const PolyPolygon& rPolyPoly, const Gradient& rGradient );
protected:
@@ -290,7 +287,6 @@ protected:
public:
Printer();
- Printer( const Window* pWindow );
Printer( const JobSetup& rJobSetup );
Printer( const QueueInfo& rQueueInfo );
Printer( const XubString& rPrinterName );
@@ -329,7 +325,6 @@ public:
sal_Bool SetOrientation( Orientation eOrient );
Orientation GetOrientation() const;
- DuplexMode GetDuplexMode() const;
sal_Bool SetDuplexMode( DuplexMode );
// returns the angle that a landscape page will be turned counterclockwise
// wrt to portrait. The return value may be only valid for
@@ -363,7 +358,6 @@ public:
sal_Bool IsPrinting() const { return mbPrinting; }
- sal_Bool AbortJob();
const XubString& GetCurJobName() const { return maJobName; }
sal_uInt16 GetCurPage() const { return mnCurPage; }
sal_Bool IsJobActive() const { return mbJobActive; }
diff --git a/vcl/inc/vcl/quickselectionengine.hxx b/vcl/inc/vcl/quickselectionengine.hxx
index f70736428010..d3dc157d2c6c 100644
--- a/vcl/inc/vcl/quickselectionengine.hxx
+++ b/vcl/inc/vcl/quickselectionengine.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -93,3 +94,5 @@ namespace vcl
//........................................................................
#endif // VCL_QUICKSELECTIONENGINE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/rendergraphic.hxx b/vcl/inc/vcl/rendergraphic.hxx
index 0a0f475decd6..bee2abf4f6f1 100644
--- a/vcl/inc/vcl/rendergraphic.hxx
+++ b/vcl/inc/vcl/rendergraphic.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -122,3 +123,5 @@ namespace vcl
}
#endif // _SV_RENDERHRAPHIC_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/rendergraphicrasterizer.hxx b/vcl/inc/vcl/rendergraphicrasterizer.hxx
index f2166b03ffb3..0f564a635beb 100644
--- a/vcl/inc/vcl/rendergraphicrasterizer.hxx
+++ b/vcl/inc/vcl/rendergraphicrasterizer.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -109,3 +110,5 @@ namespace vcl
}
#endif // _SV_RENDERGRAPHICRASTERIZER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/settings.hxx b/vcl/inc/vcl/settings.hxx
index 0ade4c63f295..2494f4fa5d08 100644
--- a/vcl/inc/vcl/settings.hxx
+++ b/vcl/inc/vcl/settings.hxx
@@ -713,7 +713,6 @@ public:
{ CopyData(); mpData->mnHighContrast = bHighContrast; }
sal_Bool GetHighContrastMode() const
{ return (sal_Bool) mpData->mnHighContrast; }
- sal_Bool IsHighContrastBlackAndWhite() const;
void SetUseSystemUIFonts( sal_Bool bUseSystemUIFonts )
{ CopyData(); mpData->mnUseSystemUIFonts = bUseSystemUIFonts; }
sal_Bool GetUseSystemUIFonts() const
diff --git a/vcl/inc/vcl/strhelper.hxx b/vcl/inc/vcl/strhelper.hxx
index 450139b0ba14..62e4fc072bdd 100644
--- a/vcl/inc/vcl/strhelper.hxx
+++ b/vcl/inc/vcl/strhelper.hxx
@@ -38,17 +38,17 @@
namespace psp {
String VCL_DLLPUBLIC GetCommandLineToken( int, const String& );
-ByteString VCL_DLLPUBLIC GetCommandLineToken( int, const ByteString& );
+rtl::OString VCL_DLLPUBLIC GetCommandLineToken(int, const rtl::OString&);
// gets one token of a unix command line style string
// doublequote, singlequote and singleleftquote protect their respective
// contents
int VCL_DLLPUBLIC GetCommandLineTokenCount( const String& );
-int VCL_DLLPUBLIC GetCommandLineTokenCount( const ByteString& );
+int VCL_DLLPUBLIC GetCommandLineTokenCount(const rtl::OString&);
// returns number of tokens (zero if empty or whitespace only)
String VCL_DLLPUBLIC WhitespaceToSpace( const String&, sal_Bool bProtect = sal_True );
-ByteString VCL_DLLPUBLIC WhitespaceToSpace( const ByteString&, sal_Bool bProtect = sal_True );
+rtl::OString VCL_DLLPUBLIC WhitespaceToSpace(const rtl::OString&, sal_Bool bProtect = sal_True);
// returns a string with multiple adjacent occurrences of whitespace
// converted to a single space. if bProtect is sal_True (nonzero), then
// doublequote, singlequote and singleleftquote protect their respective
@@ -58,14 +58,12 @@ ByteString VCL_DLLPUBLIC WhitespaceToSpace( const ByteString&, sal_Bool bProtect
// parses the first double in the string; decimal is '.' only
inline double VCL_DLLPUBLIC StringToDouble( const String& rStr )
{
- rtl_math_ConversionStatus eStatus;
- return rtl::math::stringToDouble( rStr, sal_Unicode('.'), sal_Unicode(0), &eStatus, NULL);
+ return rtl::math::stringToDouble(rStr, sal_Unicode('.'), sal_Unicode(0));
}
-inline double VCL_DLLPUBLIC StringToDouble( const ByteString& rStr )
+inline double VCL_DLLPUBLIC StringToDouble(const rtl::OString& rStr)
{
- rtl_math_ConversionStatus eStatus;
- return rtl::math::stringToDouble( rtl::OStringToOUString( rStr, osl_getThreadTextEncoding() ), sal_Unicode('.'), sal_Unicode(0), &eStatus, NULL);
+ return rtl::math::stringToDouble(rStr, '.', static_cast<sal_Char>(0));
}
// fills a character buffer with the string representation of a double
diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx
index 85e902161a48..b233a3c07c03 100644
--- a/vcl/inc/vcl/svapp.hxx
+++ b/vcl/inc/vcl/svapp.hxx
@@ -161,14 +161,12 @@ inline sal_Bool ApplicationAddress::IsConnectToSame( const ApplicationAddress& r
#define APPEVENT_OPEN_STRING "Open"
#define APPEVENT_PRINT_STRING "Print"
-#define APPEVENT_DISKINSERT_STRING "DiskInsert"
-#define APPEVENT_SAVEDOCUMENTS_STRING "SaveDocuments"
class VCL_DLLPUBLIC ApplicationEvent
{
private:
UniString aSenderAppName; // Absender Applikationsname
- ByteString aEvent; // Event
+ rtl::OString m_aEvent; // Event
UniString aData; // Uebertragene Daten
ApplicationAddress aAppAddr; // Absender Addresse
@@ -176,57 +174,29 @@ public:
ApplicationEvent() {}
ApplicationEvent( const UniString& rSenderAppName,
const ApplicationAddress& rAppAddr,
- const ByteString& rEvent,
+ const rtl::OString& rEvent,
const UniString& rData );
const UniString& GetSenderAppName() const { return aSenderAppName; }
- const ByteString& GetEvent() const { return aEvent; }
+ const rtl::OString& GetEvent() const { return m_aEvent; }
const UniString& GetData() const { return aData; }
const ApplicationAddress& GetAppAddress() const { return aAppAddr; }
- sal_Bool IsOpenEvent() const;
- sal_Bool IsPrintEvent() const;
- sal_Bool IsDiskInsertEvent() const;
-
sal_uInt16 GetParamCount() const { return aData.GetTokenCount( APPEVENT_PARAM_DELIMITER ); }
UniString GetParam( sal_uInt16 nParam ) const { return aData.GetToken( nParam, APPEVENT_PARAM_DELIMITER ); }
};
inline ApplicationEvent::ApplicationEvent( const UniString& rSenderAppName,
const ApplicationAddress& rAppAddr,
- const ByteString& rEvent,
+ const rtl::OString& rEvent,
const UniString& rData ) :
aSenderAppName( rSenderAppName ),
- aEvent( rEvent ),
+ m_aEvent( rEvent ),
aData( rData ),
aAppAddr( rAppAddr )
{
}
-inline sal_Bool ApplicationEvent::IsOpenEvent() const
-{
- if ( aEvent.Equals( APPEVENT_OPEN_STRING ))
- return sal_True;
- else
- return sal_False;
-}
-
-inline sal_Bool ApplicationEvent::IsPrintEvent() const
-{
- if ( aEvent.Equals( APPEVENT_PRINT_STRING ))
- return sal_True;
- else
- return sal_False;
-}
-
-inline sal_Bool ApplicationEvent::IsDiskInsertEvent() const
-{
- if ( aEvent.Equals( APPEVENT_DISKINSERT_STRING ))
- return sal_True;
- else
- return sal_False;
-}
-
class VCL_DLLPUBLIC PropertyHandler
{
public:
@@ -262,8 +232,6 @@ public:
virtual void InitFinished();
virtual void DeInit();
- static void InitAppRes( const ResId& rResId );
-
static sal_uInt16 GetCommandLineParamCount();
static XubString GetCommandLineParam( sal_uInt16 nParam );
static const XubString& GetAppFileName();
@@ -286,7 +254,6 @@ public:
static sal_Bool IsInMain();
static sal_Bool IsInExecute();
- static sal_Bool IsShutDown();
static sal_Bool IsInModalMode();
static sal_uInt16 GetModalModeCount();
@@ -294,7 +261,6 @@ public:
static sal_Bool AnyInput( sal_uInt16 nType = INPUT_ANY );
static sal_uLong GetLastInputInterval();
static sal_Bool IsUICaptured();
- static sal_Bool IsUserActive( sal_uInt16 nTest = USERACTIVE_ALL );
virtual void SystemSettingsChanging( AllSettings& rSettings,
Window* pFrame );
@@ -387,16 +353,11 @@ public:
static sal_Bool InsertAccel( Accelerator* pAccel );
static void RemoveAccel( Accelerator* pAccel );
- static void FlushAccel();
static sal_Bool CallAccel( const KeyCode& rKeyCode, sal_uInt16 nRepeat = 0 );
- static sal_uLong AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData = NULL );
- static void RemoveHotKey( sal_uLong nId );
static sal_uLong AddEventHook( VCLEventHookProc pProc, void* pData = NULL );
static void RemoveEventHook( sal_uLong nId );
static long CallEventHooks( NotifyEvent& rEvt );
- static long CallPreNotify( NotifyEvent& rEvt );
- static long CallEvent( NotifyEvent& rEvt );
static void SetHelp( Help* pHelp = NULL );
static Help* GetHelp();
@@ -409,7 +370,6 @@ public:
static sal_uLong GetReservedKeyCodeCount();
static const KeyCode* GetReservedKeyCode( sal_uLong i );
- static String GetReservedKeyCodeDescription( sal_uLong i );
static void SetDefDialogParent( Window* pWindow );
static Window* GetDefDialogParent();
@@ -421,9 +381,7 @@ public:
static sal_uInt16 GetSystemWindowMode();
static void SetDialogScaleX( short nScale );
- static short GetDialogScaleX();
- static void SetFontPath( const String& rPath );
static const String& GetFontPath();
static UniqueItemId CreateUniqueId();
@@ -438,8 +396,6 @@ public:
static void SetFilterHdl( const Link& rLink );
static const Link& GetFilterHdl();
- static sal_Bool IsAccessibilityEnabled();
-
static void EnableHeadlessMode( sal_Bool bEnable = sal_True );
static sal_Bool IsHeadlessModeEnabled();
diff --git a/vcl/inc/vcl/svgread.hxx b/vcl/inc/vcl/svgread.hxx
index 4427198eeb5a..cf4f8008c7ef 100644
--- a/vcl/inc/vcl/svgread.hxx
+++ b/vcl/inc/vcl/svgread.hxx
@@ -80,4 +80,4 @@ namespace vcl
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/syschild.hxx b/vcl/inc/vcl/syschild.hxx
index 275e41312f17..3a55d0b45a2c 100644
--- a/vcl/inc/vcl/syschild.hxx
+++ b/vcl/inc/vcl/syschild.hxx
@@ -63,7 +63,6 @@ public:
// per default systemchildwindows erase their background for better plugin support
// however, this might not always be required
void EnableEraseBackground( sal_Bool bEnable = sal_True );
- sal_Bool IsEraseBackgroundEnabled();
void SetForwardKey( sal_Bool bEnable );
// return the platform specific handle/id of this window;
// in case the flag bUseJava is set, a java compatible overlay window
diff --git a/vcl/inc/vcl/sysdata.hxx b/vcl/inc/vcl/sysdata.hxx
index cab614841e1d..b5daf28e579d 100644
--- a/vcl/inc/vcl/sysdata.hxx
+++ b/vcl/inc/vcl/sysdata.hxx
@@ -41,6 +41,18 @@ typedef struct CGLayer *CGLayerRef;
class NSView;
#endif
#endif
+
+#ifdef IOS
+typedef struct CGFont *CGFontRef;
+typedef struct CGContext *CGContextRef;
+typedef struct CGLayer *CGLayerRef;
+#ifdef __OBJC__
+@class UIView;
+#else
+class UIView;
+#endif
+#endif
+
#if defined( WNT )
#include <windef.h>
#endif
@@ -56,6 +68,8 @@ struct SystemEnvData
HWND hWnd; // the window hwnd
#elif defined( QUARTZ )
NSView* pView; // the cocoa (NSView *) implementing this object
+#elif defined( IOS )
+ UIView* pView; // the CocoaTouch (UIView *) implementing this object
#elif defined( UNX )
void* pDisplay; // the relevant display connection
long aWindow; // the window of the object
@@ -84,6 +98,8 @@ struct SystemParentData
HWND hWnd; // the window hwnd
#elif defined( QUARTZ )
NSView* pView; // the cocoa (NSView *) implementing this object
+#elif defined( IOS )
+ UIView* pView; // the CocoaTouch (UIView *) implementing this object
#elif defined( UNX )
long aWindow; // the window of the object
bool bXEmbedSupport:1; // decides whether the object in question
@@ -116,8 +132,8 @@ struct SystemGraphicsData
unsigned long nSize; // size in bytes of this structure
#if defined( WNT )
HDC hDC; // handle to a device context
-#elif defined( QUARTZ )
- CGContextRef rCGContext; // QUARTZ graphic context
+#elif defined( QUARTZ ) || defined( IOS )
+ CGContextRef rCGContext; // CoreGraphics graphic context
#elif defined( UNX )
void* pDisplay; // the relevant display connection
long hDrawable; // a drawable
@@ -139,6 +155,7 @@ struct SystemWindowData
unsigned long nSize; // size in bytes of this structure
#if defined( WNT ) // meaningless on Windows
#elif defined( QUARTZ ) // meaningless on Mac OS X / Quartz
+#elif defined( IOS ) // and maybe on iOS, too, then
#elif defined( UNX )
void* pVisual; // the visual to be used
#endif
@@ -169,6 +186,8 @@ struct SystemFontData
HFONT hFont; // native font object
#elif defined( QUARTZ )
void* aATSUFontID; // native font object
+#elif defined( IOS )
+ CGFontRef rFont; // native font object
#elif defined( UNX )
void* nFontId; // native font id
int nFontFlags; // native font flags
diff --git a/vcl/inc/vcl/syswin.hxx b/vcl/inc/vcl/syswin.hxx
index 0fd2fd8d1512..19cce93d44dd 100644
--- a/vcl/inc/vcl/syswin.hxx
+++ b/vcl/inc/vcl/syswin.hxx
@@ -204,10 +204,6 @@ public:
// for systems like MacOSX which can display the URL a document is loaded from
// separately from the window title
void SetRepresentedURL( const rtl::OUString& );
- const rtl::OUString& GetRepresentedURL() const;
-
- void SetZLevel( sal_uInt8 nLevel );
- sal_uInt8 GetZLevel() const;
void EnableSaveBackground( sal_Bool bSave = sal_True );
sal_Bool IsSaveBackgroundEnabled() const;
@@ -231,8 +227,8 @@ public:
const Size& GetMaxOutputSizePixel() const;
Size GetResizeOutputSizePixel() const;
- void SetWindowState( const ByteString& rStr );
- ByteString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const;
+ void SetWindowState(const rtl::OString& rStr);
+ rtl::OString GetWindowState(sal_uLong nMask = WINDOWSTATE_MASK_ALL) const;
void SetMenuBar( MenuBar* pMenuBar );
MenuBar* GetMenuBar() const { return mpMenuBar; }
diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx
index c6525138f73b..380fb2e70883 100644
--- a/vcl/inc/vcl/tabctrl.hxx
+++ b/vcl/inc/vcl/tabctrl.hxx
@@ -158,7 +158,6 @@ public:
void SetTabPage( sal_uInt16 nPageId, TabPage* pPage );
TabPage* GetTabPage( sal_uInt16 nPageId ) const;
- sal_uInt16 GetTabPageResId( sal_uInt16 nPageId ) const;
void SetPageText( sal_uInt16 nPageId, const XubString& rText );
XubString GetPageText( sal_uInt16 nPageId ) const;
@@ -166,11 +165,9 @@ public:
void SetHelpText( sal_uInt16 nPageId, const XubString& rText );
const XubString& GetHelpText( sal_uInt16 nPageId ) const;
- void SetHelpId( sal_uInt16 nPageId, const rtl::OString& rHelpId );
rtl::OString GetHelpId( sal_uInt16 nPageId ) const;
void SetPageImage( sal_uInt16 nPageId, const Image& rImage );
- const Image* GetPageImage( sal_uInt16 nPageId ) const;
void SetHelpText( const XubString& rText )
{ Control::SetHelpText( rText ); }
diff --git a/vcl/inc/vcl/taskpanelist.hxx b/vcl/inc/vcl/taskpanelist.hxx
index 102f755554f2..9042169e9898 100644
--- a/vcl/inc/vcl/taskpanelist.hxx
+++ b/vcl/inc/vcl/taskpanelist.hxx
@@ -37,7 +37,6 @@
class VCL_DLLPUBLIC TaskPaneList
{
::std::vector<Window *> mTaskPanes;
- Window *FindNextPane( Window *pWindow, sal_Bool bForward = sal_True );
Window *FindNextFloat( Window *pWindow, sal_Bool bForward = sal_True );
Window *FindNextSplitter( Window *pWindow, sal_Bool bForward = sal_True );
diff --git a/vcl/inc/vcl/threadex.hxx b/vcl/inc/vcl/threadex.hxx
index 429b43e6ac7c..c5333d847fa1 100644
--- a/vcl/inc/vcl/threadex.hxx
+++ b/vcl/inc/vcl/threadex.hxx
@@ -39,24 +39,6 @@
namespace vcl
{
- class VCL_DLLPUBLIC ThreadExecutor
- {
- oslThread m_aThread;
- oslCondition m_aFinish;
- long m_nReturn;
-
- #ifdef THREADEX_IMPLEMENTATION
- public:
- SAL_DLLPRIVATE static void SAL_CALL worker( void* );
- #endif
- public:
- ThreadExecutor();
- virtual ~ThreadExecutor();
-
- virtual long doIt() = 0;
- long execute();
- };
-
class VCL_DLLPUBLIC SolarThreadExecutor
{
oslCondition m_aStart;
diff --git a/vcl/inc/vcl/throbber.hxx b/vcl/inc/vcl/throbber.hxx
index ce45631d2fda..4cbd6dcdbce2 100644
--- a/vcl/inc/vcl/throbber.hxx
+++ b/vcl/inc/vcl/throbber.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99,3 +100,4 @@ private:
#endif // VCL_THROBBER_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx
index 5badbc2d13bd..dd482c610d95 100644
--- a/vcl/inc/vcl/toolbox.hxx
+++ b/vcl/inc/vcl/toolbox.hxx
@@ -265,8 +265,6 @@ private:
using Window::ImplInvalidate;
SAL_DLLPRIVATE void ImplInvalidate( sal_Bool bNewCalc = sal_False, sal_Bool bFullPaint = sal_False );
SAL_DLLPRIVATE void ImplUpdateItem( sal_uInt16 nIndex = 0xFFFF );
- SAL_DLLPRIVATE void ImplStartCustomizeMode();
- SAL_DLLPRIVATE void ImplEndCustomizeMode();
SAL_DLLPRIVATE const XubString& ImplConvertMenuString( const XubString& rStr );
SAL_DLLPRIVATE sal_Bool ImplHandleMouseMove( const MouseEvent& rMEvt, sal_Bool bRepeat = sal_False );
SAL_DLLPRIVATE sal_Bool ImplHandleMouseButtonUp( const MouseEvent& rMEvt, sal_Bool bCancel = sal_False );
@@ -274,7 +272,6 @@ private:
SAL_DLLPRIVATE sal_Bool ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle = sal_False );
SAL_DLLPRIVATE sal_uInt16 ImplGetItemLine( ImplToolItem* pCurrentItem );
SAL_DLLPRIVATE ImplToolItem* ImplGetFirstValidItem( sal_uInt16 nLine );
- SAL_DLLPRIVATE ImplToolItem* ImplGetLastValidItem( sal_uInt16 nLine );
SAL_DLLPRIVATE sal_Bool ImplOpenItem( KeyCode aKeyCode );
SAL_DLLPRIVATE sal_Bool ImplActivateItem( KeyCode aKeyCode );
SAL_DLLPRIVATE void ImplShowFocus();
@@ -332,9 +329,6 @@ public:
static SAL_DLLPRIVATE void ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, sal_Bool bBlack, sal_Bool bColTransform,
sal_Bool bLeft = sal_False, sal_Bool bTop = sal_False,
long nSize = 6 );
- static SAL_DLLPRIVATE void SetToolArrowClipregion( ToolBox* pBox, long nX, long nY,
- sal_Bool bLeft = sal_False, sal_Bool bTop = sal_False,
- long nSize = 6 );
static SAL_DLLPRIVATE void ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight );
static SAL_DLLPRIVATE sal_uInt16 ImplCountLineBreaks( const ToolBox *pThis );
SAL_DLLPRIVATE ImplToolBoxPrivateData* ImplGetToolBoxPrivateData() const { return mpData; }
@@ -401,12 +395,9 @@ public:
sal_uInt16 nPixSize = 0 );
void InsertBreak( sal_uInt16 nPos = TOOLBOX_APPEND );
void RemoveItem( sal_uInt16 nPos );
- void MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos = TOOLBOX_APPEND );
void CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId,
sal_uInt16 nNewPos = TOOLBOX_APPEND );
- void CopyItems( const ToolBox& rToolBox );
void Clear();
- void RecalcItems();
const ImageList& GetImageList() const { return maImageList; }
void SetImageList( const ImageList& rImageList );
@@ -429,7 +420,6 @@ public:
// Used to enable/disable scrolling one page at a time for toolbar
void SetPageScroll( sal_Bool b );
- sal_Bool GetPageScroll();
void SetNextToolBox( const XubString& rStr );
const XubString& GetNextToolBox() const { return maNextToolBoxStr; }
@@ -442,14 +432,12 @@ public:
sal_uInt16 GetItemId( const Point& rPos ) const;
Rectangle GetItemRect( sal_uInt16 nItemId ) const;
Rectangle GetItemPosRect( sal_uInt16 nPos ) const;
- Rectangle GetItemDropDownRect( sal_uInt16 nItemId ) const;
Rectangle GetItemPosDropDownRect( sal_uInt16 nPos ) const;
// retrieves the optimal position to place a popup window for this item (subtoolbar or dropdown)
Point GetItemPopupPosition( sal_uInt16 nItemId, const Size& rSize ) const;
Rectangle GetScrollRect() const;
- Rectangle GetMenubuttonRect() const;
sal_uInt16 GetCurItemId() const { return mnCurItemId; }
sal_uInt16 GetDownItemId() const { return mnDownItemId; }
sal_uInt16 GetClicks() const { return mnMouseClicks; }
@@ -464,11 +452,7 @@ public:
void SetItemImage( sal_uInt16 nItemId, const Image& rImage );
Image GetItemImage( sal_uInt16 nItemId ) const;
void SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 );
- long GetItemImageAngle( sal_uInt16 nItemId ) const;
void SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror );
- sal_Bool GetItemImageMirrorMode( sal_uInt16 ) const;
- void SetItemHighImage( sal_uInt16 nItemId, const Image& rImage );
- Image GetItemHighImage( sal_uInt16 nItemId ) const;
void SetItemText( sal_uInt16 nItemId, const XubString& rText );
const XubString& GetItemText( sal_uInt16 nItemId ) const;
void SetItemWindow( sal_uInt16 nItemId, Window* pNewWindow );
@@ -479,7 +463,6 @@ public:
void EndSelection();
void SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease = sal_True );
- sal_Bool IsItemDown( sal_uInt16 nItemId ) const;
void SetItemState( sal_uInt16 nItemId, TriState eState );
TriState GetItemState( sal_uInt16 nItemId ) const;
@@ -552,14 +535,8 @@ public:
void EnableCustomize( sal_Bool bEnable = sal_True );
sal_Bool IsCustomize() { return mbCustomize; }
- void StartCustomize( const Rectangle& rRect, void* pData = NULL );
- void SetCustomizeMode( sal_Bool );
sal_Bool IsInCustomizeMode() const { return mbCustomizeMode; }
- static void StartCustomizeMode();
- static void EndCustomizeMode();
- static sal_Bool IsCustomizeMode();
-
void SetHelpText( const XubString& rText )
{ DockingWindow::SetHelpText( rText ); }
const XubString& GetHelpText() const
@@ -600,7 +577,6 @@ public:
PopupMenu* GetMenu() const;
void UpdateCustomMenu();
void SetMenuButtonHdl( const Link& rLink );
- const Link& GetMenuButtonHdl() const;
// open custommenu
void ExecuteCustomMenu();
@@ -625,13 +601,6 @@ public:
// -1 is returned if no character is at that point
// if an index is found the corresponding item id is filled in (else 0)
long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const;
- // returns the number of portions in the result of GetDisplayText()
- long GetTextCount() const;
- // returns the interval [start,end] of text portion nText
- // returns [-1,-1] for an invalid text number
- Pair GetTextStartEnd( long nText ) const;
- // returns the item id for text portion nText or 0 if nText is invalid
- sal_uInt16 GetDisplayItemId( long nText ) const;
const Size& GetDefaultImageSize() const;
void ChangeHighlight( sal_uInt16 nPos );
diff --git a/vcl/inc/vcl/wall.hxx b/vcl/inc/vcl/wall.hxx
index 66a2a11038ed..f85d58c1200f 100644
--- a/vcl/inc/vcl/wall.hxx
+++ b/vcl/inc/vcl/wall.hxx
@@ -112,17 +112,14 @@ public:
WallpaperStyle GetStyle() const;
void SetBitmap( const BitmapEx& rBitmap );
- void SetBitmap();
BitmapEx GetBitmap() const;
sal_Bool IsBitmap() const;
void SetGradient( const Gradient& rGradient );
- void SetGradient();
Gradient GetGradient() const;
sal_Bool IsGradient() const;
void SetRect( const Rectangle& rRect );
- void SetRect();
Rectangle GetRect() const;
sal_Bool IsRect() const;
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index df82b7870854..8cc7bfd0894f 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -914,7 +914,6 @@ public:
void SetFakeFocus( bool bFocus );
sal_Bool IsCompoundControl() const;
- sal_Bool HasCompoundControlFocus() const;
static sal_uIntPtr SaveFocus();
static sal_Bool EndSaveFocus( sal_uIntPtr nSaveId, sal_Bool bRestore = sal_True );
diff --git a/vcl/inc/win/salbmp.h b/vcl/inc/win/salbmp.h
index 5cf92bcf3591..5cf92bcf3591 100755..100644
--- a/vcl/inc/win/salbmp.h
+++ b/vcl/inc/win/salbmp.h
diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx
index ca0a19f4361a..ba9068628c8c 100644
--- a/vcl/inc/win/saldata.hxx
+++ b/vcl/inc/win/saldata.hxx
@@ -162,8 +162,6 @@ struct SalShlData
UINT mnWheelScrollChars; // WheelScrollChars
UINT mnWheelMsgId; // Wheel-Message-Id fuer W95
BOOL mbWXP; // Windows XP
- BOOL mbWPrinter; // true: use unicode printer functions
- // false: use anis compat printer functions
OSVERSIONINFO maVersionInfo;
};
diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h
index e62d60196a1e..e62d60196a1e 100755..100644
--- a/vcl/inc/win/salframe.h
+++ b/vcl/inc/win/salframe.h
diff --git a/vcl/inc/win/salmenu.h b/vcl/inc/win/salmenu.h
index 99239d7b8191..99239d7b8191 100755..100644
--- a/vcl/inc/win/salmenu.h
+++ b/vcl/inc/win/salmenu.h
diff --git a/vcl/inc/win/salnativewidgets.h b/vcl/inc/win/salnativewidgets.h
index 33ba8de4ba87..33ba8de4ba87 100755..100644
--- a/vcl/inc/win/salnativewidgets.h
+++ b/vcl/inc/win/salnativewidgets.h
diff --git a/vcl/inc/win/salobj.h b/vcl/inc/win/salobj.h
index 068d65a611f2..068d65a611f2 100755..100644
--- a/vcl/inc/win/salobj.h
+++ b/vcl/inc/win/salobj.h
diff --git a/vcl/inc/win/salprn.h b/vcl/inc/win/salprn.h
index 6b399f99f971..80399d5eb3e9 100755..100644
--- a/vcl/inc/win/salprn.h
+++ b/vcl/inc/win/salprn.h
@@ -37,15 +37,12 @@
// WNT3
#define SAL_DRIVERDATA_SYSSIGN ((sal_uIntPtr)0x574E5433)
-#define SAL_DRIVERDATA_VERSION_A 1
-#define SAL_DRIVERDATA_VERSION_W 2
#pragma pack( 1 )
struct SalDriverData
{
sal_uIntPtr mnSysSignature;
- sal_uInt16 mnVersion;
sal_uInt16 mnDriverOffset;
BYTE maDriverData[1];
};
diff --git a/vcl/inc/win/salsys.h b/vcl/inc/win/salsys.h
index 6f133b57d15f..6f133b57d15f 100755..100644
--- a/vcl/inc/win/salsys.h
+++ b/vcl/inc/win/salsys.h
diff --git a/vcl/inc/win/saltimer.h b/vcl/inc/win/saltimer.h
index d408e099eaaf..d408e099eaaf 100755..100644
--- a/vcl/inc/win/saltimer.h
+++ b/vcl/inc/win/saltimer.h
diff --git a/vcl/inc/win/salvd.h b/vcl/inc/win/salvd.h
index 0f213ed5a6f3..0f213ed5a6f3 100755..100644
--- a/vcl/inc/win/salvd.h
+++ b/vcl/inc/win/salvd.h
diff --git a/vcl/inc/win/wincomp.hxx b/vcl/inc/win/wincomp.hxx
index 6e20eb8e16e5..6e20eb8e16e5 100755..100644
--- a/vcl/inc/win/wincomp.hxx
+++ b/vcl/inc/win/wincomp.hxx
diff --git a/vcl/ios/source/app/saldata.cxx b/vcl/ios/source/app/saldata.cxx
new file mode 100644
index 000000000000..f292b6fae585
--- /dev/null
+++ b/vcl/ios/source/app/saldata.cxx
@@ -0,0 +1,128 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"
+
+#include "ios/saldata.hxx"
+#include "ios/saluimenu.h"
+#include "ios/salinst.h"
+
+oslThreadKey SalData::s_aAutoReleaseKey = 0;
+
+static void SAL_CALL releasePool( void* pPool )
+{
+ if( pPool )
+ [(NSAutoreleasePool*)pPool release];
+}
+
+SalData::SalData()
+:
+ mpTimerProc( NULL ),
+ mpFirstInstance( NULL ),
+ mpFirstObject( NULL ),
+ mpFirstVD( NULL ),
+ mpFirstPrinter( NULL ),
+ mpFontList( NULL ),
+ mxRGBSpace( CGColorSpaceCreateDeviceRGB( ) ),
+ mxGraySpace( CGColorSpaceCreateDeviceGray( ) ),
+ mxP50Space( NULL ),
+ mxP50Pattern( NULL ),
+ mnSystemVersion( VER_TIGER ),
+ mnDPIX( 0 ),
+ mnDPIY( 0 )
+{
+ if( s_aAutoReleaseKey == 0 )
+ s_aAutoReleaseKey = osl_createThreadKey( releasePool );
+}
+
+SalData::~SalData()
+{
+ CGPatternRelease( mxP50Pattern );
+ CGColorSpaceRelease( mxP50Space );
+ CGColorSpaceRelease( mxRGBSpace );
+ CGColorSpaceRelease( mxGraySpace );
+ if( s_aAutoReleaseKey )
+ {
+ // release the last pool
+ NSAutoreleasePool* pPool = nil;
+ pPool = reinterpret_cast<NSAutoreleasePool*>( osl_getThreadKeyData( s_aAutoReleaseKey ) );
+ if( pPool )
+ {
+ osl_setThreadKeyData( s_aAutoReleaseKey, NULL );
+ [pPool release];
+ }
+
+ osl_destroyThreadKey( s_aAutoReleaseKey );
+ s_aAutoReleaseKey = 0;
+ }
+}
+
+void SalData::ensureThreadAutoreleasePool()
+{
+ NSAutoreleasePool* pPool = nil;
+ if( s_aAutoReleaseKey )
+ {
+ pPool = reinterpret_cast<NSAutoreleasePool*>( osl_getThreadKeyData( s_aAutoReleaseKey ) );
+ if( ! pPool )
+ {
+ pPool = [[NSAutoreleasePool alloc] init];
+ osl_setThreadKeyData( s_aAutoReleaseKey, pPool );
+ }
+ }
+ else
+ {
+ OSL_FAIL( "no autorelease key" );
+ }
+}
+
+void SalData::drainThreadAutoreleasePool()
+{
+ NSAutoreleasePool* pPool = nil;
+ if( s_aAutoReleaseKey )
+ {
+ pPool = reinterpret_cast<NSAutoreleasePool*>( osl_getThreadKeyData( s_aAutoReleaseKey ) );
+ if( pPool )
+ {
+ // osl_setThreadKeyData( s_aAutoReleaseKey, NULL );
+ // [pPool release];
+ [pPool drain];
+ }
+ else
+ {
+ pPool = [[NSAutoreleasePool alloc] init];
+ osl_setThreadKeyData( s_aAutoReleaseKey, pPool );
+ }
+ }
+ else
+ {
+ OSL_FAIL( "no autorelease key" );
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/ios/source/app/salinst.cxx b/vcl/ios/source/app/salinst.cxx
new file mode 100644
index 000000000000..b4c944cd31a4
--- /dev/null
+++ b/vcl/ios/source/app/salinst.cxx
@@ -0,0 +1,828 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"
+
+#include <stdio.h>
+
+#include "tools/fsys.hxx"
+#include "tools/getprocessworkingdir.hxx"
+#include <tools/solarmutex.hxx>
+
+#include "osl/process.h"
+
+#include "rtl/ustrbuf.hxx"
+
+#include "vcl/svapp.hxx"
+#include "vcl/window.hxx"
+#include "vcl/timer.hxx"
+#include "vcl/solarmutex.hxx"
+
+#include "ios/saldata.hxx"
+#include "ios/salinst.h"
+#include "ios/salframe.h"
+#include "ios/salobj.h"
+#include "ios/salsys.h"
+#include "ios/salvd.h"
+#include "ios/salbmp.h"
+#include "ios/salprn.h"
+#include "ios/saltimer.h"
+#include "ios/vcluiapp.h"
+
+#include "print.h"
+#include "impbmp.hxx"
+#include "salimestatus.hxx"
+
+#include <comphelper/processfactory.hxx>
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uri/XExternalUriReferenceTranslator.hpp>
+#include <com/sun/star/uri/ExternalUriReferenceTranslator.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+using namespace std;
+using namespace ::com::sun::star;
+
+extern sal_Bool ImplSVMain();
+
+static int* gpnInit = 0;
+static bool bNoSVMain = true;
+static bool bLeftMain = false;
+// -----------------------------------------------------------------------
+
+class IosDelayedSettingsChanged : public Timer
+{
+ bool mbInvalidate;
+ public:
+ IosDelayedSettingsChanged( bool bInvalidate ) :
+ mbInvalidate( bInvalidate )
+ {
+ }
+
+ virtual void Timeout()
+ {
+ SalData* pSalData = GetSalData();
+ if( ! pSalData->maFrames.empty() )
+ pSalData->maFrames.front()->CallCallback( SALEVENT_SETTINGSCHANGED, NULL );
+
+ if( mbInvalidate )
+ {
+ for( std::list< IosSalFrame* >::iterator it = pSalData->maFrames.begin();
+ it != pSalData->maFrames.end(); ++it )
+ {
+ if( (*it)->mbShown )
+ (*it)->SendPaintEvent( NULL );
+ }
+ }
+ Stop();
+ delete this;
+ }
+};
+
+void IosSalInstance::delayedSettingsChanged( bool bInvalidate )
+{
+ osl::SolarGuard aGuard( *mpSalYieldMutex );
+ IosDelayedSettingsChanged* pTimer = new IosDelayedSettingsChanged( bInvalidate );
+ pTimer->SetTimeout( 50 );
+ pTimer->Start();
+}
+
+
+// the AppEventList must be available before any SalData/SalInst/etc. objects are ready
+typedef std::list<const ApplicationEvent*> AppEventList;
+AppEventList IosSalInstance::aAppEventList;
+
+// initialize the VCL_UIApplication object
+static void initUIApp()
+{
+ [VCL_UIApplication sharedApplication];
+
+ SalData::ensureThreadAutoreleasePool();
+}
+
+sal_Bool ImplSVMainHook( int * pnInit )
+{
+ gpnInit = pnInit;
+
+ bNoSVMain = false;
+ initUIApp();
+
+ char* pArgv[] = { "main", NULL };
+ UIApplicationMain( 1, pArgv, NULL, NULL );
+
+ return TRUE; // indicate that ImplSVMainHook is implemented
+}
+
+// =======================================================================
+
+void SalAbort( const XubString& rErrorText )
+{
+ if( !rErrorText.Len() )
+ fprintf( stderr, "Application Error " );
+ else
+ fprintf( stderr, "%s ",
+ ByteString( rErrorText, gsl_getSystemTextEncoding() ).GetBuffer() );
+ abort();
+}
+
+// -----------------------------------------------------------------------
+
+void InitSalData()
+{
+ SalData *pSalData = new SalData;
+ SetSalData( pSalData );
+}
+
+// -----------------------------------------------------------------------
+
+const ::rtl::OUString& SalGetDesktopEnvironment()
+{
+ static OUString aDesktopEnvironment(RTL_CONSTASCII_USTRINGPARAM( "CocoaTouch" ));
+ return aDesktopEnvironment;
+}
+
+// -----------------------------------------------------------------------
+
+void DeInitSalData()
+{
+ SalData *pSalData = GetSalData();
+ delete pSalData;
+ SetSalData( NULL );
+}
+
+// -----------------------------------------------------------------------
+
+void InitSalMain()
+{
+ rtl::OUString urlWorkDir;
+ rtl_uString *sysWorkDir = NULL;
+ if (tools::getProcessWorkingDir(urlWorkDir))
+ {
+ oslFileError err2 = osl_getSystemPathFromFileURL(urlWorkDir.pData, &sysWorkDir);
+ if (err2 == osl_File_E_None)
+ {
+ ByteString aPath( getenv( "PATH" ) );
+ ByteString aResPath( getenv( "STAR_RESOURCEPATH" ) );
+ ByteString aCmdPath( OUStringToOString(OUString(sysWorkDir), RTL_TEXTENCODING_UTF8).getStr() );
+ ByteString aTmpPath;
+ // Get absolute path of command's directory
+ if ( aCmdPath.Len() ) {
+ DirEntry aCmdDirEntry( aCmdPath );
+ aCmdDirEntry.ToAbs();
+ aCmdPath = ByteString( aCmdDirEntry.GetPath().GetFull(), RTL_TEXTENCODING_ASCII_US );
+ }
+ // Assign to PATH environment variable
+ if ( aCmdPath.Len() )
+ {
+ aTmpPath = ByteString( "PATH=" );
+ aTmpPath += aCmdPath;
+ if ( aPath.Len() )
+ aTmpPath += ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US );
+ aTmpPath += aPath;
+ putenv( (char*)aTmpPath.GetBuffer() );
+ }
+ // Assign to STAR_RESOURCEPATH environment variable
+ if ( aCmdPath.Len() )
+ {
+ aTmpPath = ByteString( "STAR_RESOURCEPATH=" );
+ aTmpPath += aCmdPath;
+ if ( aResPath.Len() )
+ aTmpPath += ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US );
+ aTmpPath += aResPath;
+ putenv( (char*)aTmpPath.GetBuffer() );
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void DeInitSalMain()
+{
+}
+
+// =======================================================================
+
+SalYieldMutex::SalYieldMutex()
+{
+ mnCount = 0;
+ mnThreadId = 0;
+}
+
+void SalYieldMutex::acquire()
+{
+ SolarMutexObject::acquire();
+ mnThreadId = osl::Thread::getCurrentIdentifier();
+ mnCount++;
+}
+
+void SalYieldMutex::release()
+{
+ if ( mnThreadId == osl::Thread::getCurrentIdentifier() )
+ {
+ if ( mnCount == 1 )
+ mnThreadId = 0;
+ mnCount--;
+ }
+ SolarMutexObject::release();
+}
+
+sal_Bool SalYieldMutex::tryToAcquire()
+{
+ if ( SolarMutexObject::tryToAcquire() )
+ {
+ mnThreadId = osl::Thread::getCurrentIdentifier();
+ mnCount++;
+ return sal_True;
+ }
+ else
+ return sal_False;
+}
+
+// -----------------------------------------------------------------------
+
+// some convenience functions regarding the yield mutex, aka solar mutex
+
+sal_Bool ImplSalYieldMutexTryToAcquire()
+{
+ IosSalInstance* pInst = (IosSalInstance*) GetSalData()->mpFirstInstance;
+ if ( pInst )
+ return pInst->mpSalYieldMutex->tryToAcquire();
+ else
+ return FALSE;
+}
+
+void ImplSalYieldMutexAcquire()
+{
+ IosSalInstance* pInst = (IosSalInstance*) GetSalData()->mpFirstInstance;
+ if ( pInst )
+ pInst->mpSalYieldMutex->acquire();
+}
+
+void ImplSalYieldMutexRelease()
+{
+ IosSalInstance* pInst = (IosSalInstance*) GetSalData()->mpFirstInstance;
+ if ( pInst )
+ pInst->mpSalYieldMutex->release();
+}
+
+// =======================================================================
+
+SalInstance* CreateSalInstance()
+{
+ // this is the case for not using SVMain
+ // not so good
+ if( bNoSVMain )
+ initUIApp();
+
+ SalData* pSalData = GetSalData();
+ DBG_ASSERT( pSalData->mpFirstInstance == NULL, "more than one instance created" );
+ IosSalInstance* pInst = new IosSalInstance;
+
+ // init instance (only one instance in this version !!!)
+ pSalData->mpFirstInstance = pInst;
+ // this one is for outside IosSalInstance::Yield
+ SalData::ensureThreadAutoreleasePool();
+ // no focus rects on NWF ios
+ ImplGetSVData()->maNWFData.mbNoFocusRects = true;
+ ImplGetSVData()->maNWFData.mbNoBoldTabFocus = true;
+ ImplGetSVData()->maNWFData.mbNoActiveTabTextRaise = true;
+ ImplGetSVData()->maNWFData.mbCenteredTabs = true;
+ ImplGetSVData()->maNWFData.mbProgressNeedsErase = true;
+ ImplGetSVData()->maNWFData.mbCheckBoxNeedsErase = true;
+ ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset = 10;
+ ImplGetSVData()->maGDIData.mbNoXORClipping = true;
+ ImplGetSVData()->maWinData.mbNoSaveBackground = true;
+
+ return pInst;
+}
+
+// -----------------------------------------------------------------------
+
+void DestroySalInstance( SalInstance* pInst )
+{
+ delete pInst;
+}
+
+// -----------------------------------------------------------------------
+
+IosSalInstance::IosSalInstance()
+{
+ mpSalYieldMutex = new SalYieldMutex;
+ mpSalYieldMutex->acquire();
+ ::tools::SolarMutex::SetSolarMutex( mpSalYieldMutex );
+ maMainThread = osl::Thread::getCurrentIdentifier();
+ mbWaitingYield = false;
+ maUserEventListMutex = osl_createMutex();
+ mnActivePrintJobs = 0;
+ maWaitingYieldCond = osl_createCondition();
+}
+
+// -----------------------------------------------------------------------
+
+IosSalInstance::~IosSalInstance()
+{
+ ::tools::SolarMutex::SetSolarMutex( 0 );
+ mpSalYieldMutex->release();
+ delete mpSalYieldMutex;
+ osl_destroyMutex( maUserEventListMutex );
+ osl_destroyCondition( maWaitingYieldCond );
+}
+
+// -----------------------------------------------------------------------
+
+void IosSalInstance::wakeupYield()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void IosSalInstance::PostUserEvent( IosSalFrame* pFrame, sal_uInt16 nType, void* pData )
+{
+ osl_acquireMutex( maUserEventListMutex );
+ maUserEvents.push_back( SalUserEvent( pFrame, pData, nType ) );
+ osl_releaseMutex( maUserEventListMutex );
+
+ // notify main loop that an event has arrived
+ wakeupYield();
+}
+
+// -----------------------------------------------------------------------
+
+osl::SolarMutex* IosSalInstance::GetYieldMutex()
+{
+ return mpSalYieldMutex;
+}
+
+// -----------------------------------------------------------------------
+
+sal_uLong IosSalInstance::ReleaseYieldMutex()
+{
+ SalYieldMutex* pYieldMutex = mpSalYieldMutex;
+ if ( pYieldMutex->GetThreadId() ==
+ osl::Thread::getCurrentIdentifier() )
+ {
+ sal_uLong nCount = pYieldMutex->GetAcquireCount();
+ sal_uLong n = nCount;
+ while ( n )
+ {
+ pYieldMutex->release();
+ n--;
+ }
+
+ return nCount;
+ }
+ else
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+void IosSalInstance::AcquireYieldMutex( sal_uLong nCount )
+{
+ SalYieldMutex* pYieldMutex = mpSalYieldMutex;
+ while ( nCount )
+ {
+ pYieldMutex->acquire();
+ nCount--;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+bool IosSalInstance::CheckYieldMutex()
+{
+ bool bRet = true;
+
+ SalYieldMutex* pYieldMutex = mpSalYieldMutex;
+ if ( pYieldMutex->GetThreadId() != osl::Thread::getCurrentIdentifier())
+ {
+ bRet = false;
+ }
+
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
+bool IosSalInstance::isUIAppThread() const
+{
+ return osl::Thread::getCurrentIdentifier() == maMainThread;
+}
+
+// -----------------------------------------------------------------------
+
+class ReleasePoolHolder
+{
+ NSAutoreleasePool* mpPool;
+ public:
+ ReleasePoolHolder() : mpPool( [[NSAutoreleasePool alloc] init] ) {}
+ ~ReleasePoolHolder() { [mpPool release]; }
+};
+
+void IosSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
+{
+ // ensure that the per thread autorelease pool is top level and
+ // will therefore not be destroyed by cocoa implicitly
+ SalData::ensureThreadAutoreleasePool();
+
+ // NSAutoreleasePool documentation suggests we should have
+ // an own pool for each yield level
+ ReleasePoolHolder aReleasePool;
+
+ // Release all locks so that we don't deadlock when we pull pending
+ // events from the event queue
+ bool bDispatchUser = true;
+ while( bDispatchUser )
+ {
+ sal_uLong nCount = ReleaseYieldMutex();
+
+ // get one user event
+ osl_acquireMutex( maUserEventListMutex );
+ SalUserEvent aEvent( NULL, NULL, 0 );
+ if( ! maUserEvents.empty() )
+ {
+ aEvent = maUserEvents.front();
+ maUserEvents.pop_front();
+ }
+ else
+ bDispatchUser = false;
+ osl_releaseMutex( maUserEventListMutex );
+
+ AcquireYieldMutex( nCount );
+
+ // dispatch it
+ if( aEvent.mpFrame && IosSalFrame::isAlive( aEvent.mpFrame ) )
+ {
+ aEvent.mpFrame->CallCallback( aEvent.mnType, aEvent.mpData );
+ osl_setCondition( maWaitingYieldCond );
+ // return if only one event is asked for
+ if( ! bHandleAllCurrentEvents )
+ return;
+ }
+ }
+
+ // handle event queue
+ // events mye be only handled in the thread the app was created
+ if( mnActivePrintJobs == 0 )
+ {
+ // we need to be woken up by a cocoa-event
+ // if a user event should be posted by the event handling below
+ bool bOldWaitingYield = mbWaitingYield;
+ mbWaitingYield = bWait;
+
+ mbWaitingYield = bOldWaitingYield;
+
+ // collect update rectangles
+ const std::list< IosSalFrame* > rFrames( GetSalData()->maFrames );
+ for( std::list< IosSalFrame* >::const_iterator it = rFrames.begin(); it != rFrames.end(); ++it )
+ {
+ if( (*it)->mbShown && ! (*it)->maInvalidRect.IsEmpty() )
+ {
+ (*it)->Flush( (*it)->maInvalidRect );
+ (*it)->maInvalidRect.SetEmpty();
+ }
+ }
+ osl_setCondition( maWaitingYieldCond );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+bool IosSalInstance::AnyInput( sal_uInt16 nType )
+{
+ if( nType & INPUT_APPEVENT )
+ {
+ if( ! aAppEventList.empty() )
+ return true;
+ if( nType == INPUT_APPEVENT )
+ return false;
+ }
+
+ if( nType & INPUT_TIMER )
+ {
+ if( IosSalTimer::pRunningTimer )
+ {
+ NSDate* pDt = [IosSalTimer::pRunningTimer fireDate];
+ if( pDt && [pDt timeIntervalSinceNow] < 0 )
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+// -----------------------------------------------------------------------
+
+SalFrame* IosSalInstance::CreateChildFrame( SystemParentData*, sal_uLong /*nSalFrameStyle*/ )
+{
+ return NULL;
+}
+
+// -----------------------------------------------------------------------
+
+SalFrame* IosSalInstance::CreateFrame( SalFrame* pParent, sal_uLong nSalFrameStyle )
+{
+ SalData::ensureThreadAutoreleasePool();
+
+ SalFrame* pFrame = new IosSalFrame( pParent, nSalFrameStyle );
+ return pFrame;
+}
+
+// -----------------------------------------------------------------------
+
+void IosSalInstance::DestroyFrame( SalFrame* pFrame )
+{
+ delete pFrame;
+}
+
+// -----------------------------------------------------------------------
+
+SalObject* IosSalInstance::CreateObject( SalFrame* pParent, SystemWindowData* /* pWindowData */, sal_Bool /* bShow */ )
+{
+ // SystemWindowData is meaningless on Mac OS X
+ IosSalObject *pObject = NULL;
+
+ if ( pParent )
+ pObject = new IosSalObject( static_cast<IosSalFrame*>(pParent) );
+
+ return pObject;
+}
+
+// -----------------------------------------------------------------------
+
+void IosSalInstance::DestroyObject( SalObject* pObject )
+{
+ delete ( pObject );
+}
+
+SalSystem* IosSalInstance::CreateSystem()
+{
+ return new IosSalSystem();
+}
+
+// -----------------------------------------------------------------------
+
+void IosSalInstance::DestroySystem( SalSystem* pSystem )
+{
+ delete pSystem;
+}
+
+// -----------------------------------------------------------------------
+
+void IosSalInstance::SetEventCallback( void*, bool(*)(void*,void*,int) )
+{
+}
+
+// -----------------------------------------------------------------------
+
+void IosSalInstance::SetErrorEventCallback( void*, bool(*)(void*,void*,int) )
+{
+}
+
+// -----------------------------------------------------------------------
+
+void* IosSalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes )
+{
+ rReturnedBytes = 1;
+ rReturnedType = AsciiCString;
+ return (void*)"";
+}
+
+// We need to re-encode file urls because osl_getFileURLFromSystemPath converts
+// to UTF-8 before encoding non ascii characters, which is not what other apps expect.
+static rtl::OUString translateToExternalUrl(const rtl::OUString& internalUrl)
+{
+ rtl::OUString extUrl;
+
+ uno::Reference< lang::XMultiServiceFactory > sm = comphelper::getProcessServiceFactory();
+ if (sm.is())
+ {
+ uno::Reference< beans::XPropertySet > pset;
+ sm->queryInterface( getCppuType( &pset )) >>= pset;
+ if (pset.is())
+ {
+ uno::Reference< uno::XComponentContext > context;
+ static const rtl::OUString DEFAULT_CONTEXT( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) );
+ pset->getPropertyValue(DEFAULT_CONTEXT) >>= context;
+ if (context.is())
+ extUrl = uri::ExternalUriReferenceTranslator::create(context)->translateToExternal(internalUrl);
+ }
+ }
+ return extUrl;
+}
+
+// #i104525# many versions of OSX have problems with some URLs:
+// when an app requests OSX to add one of these URLs to the "Recent Items" list
+// then this app gets killed (TextEdit, Preview, etc. and also OOo)
+static bool isDangerousUrl( const rtl::OUString& rUrl )
+{
+ // use a heuristic that detects all known cases since there is no official comment
+ // on the exact impact and root cause of the OSX bug
+ const int nLen = rUrl.getLength();
+ const sal_Unicode* p = rUrl.getStr();
+ for( int i = 0; i < nLen-3; ++i, ++p ) {
+ if( p[0] != '%' )
+ continue;
+ // escaped percent?
+ if( (p[1] == '2') && (p[2] == '5') )
+ return true;
+ // escapes are considered to be UTF-8 encoded
+ // => check for invalid UTF-8 leading byte
+ if( (p[1] != 'f') && (p[1] != 'F') )
+ continue;
+ int cLowNibble = p[2];
+ if( (cLowNibble >= '0' ) && (cLowNibble <= '9'))
+ return false;
+ if( cLowNibble >= 'a' )
+ cLowNibble -= 'a' - 'A';
+ if( (cLowNibble < 'A') || (cLowNibble >= 'C'))
+ return true;
+ }
+
+ return false;
+}
+
+void IosSalInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& /*rMimeType*/)
+{
+}
+
+// -----------------------------------------------------------------------
+
+SalTimer* IosSalInstance::CreateSalTimer()
+{
+ return new IosSalTimer();
+}
+
+// -----------------------------------------------------------------------
+
+SalSystem* IosSalInstance::CreateSalSystem()
+{
+ return new IosSalSystem();
+}
+
+// -----------------------------------------------------------------------
+
+SalBitmap* IosSalInstance::CreateSalBitmap()
+{
+ return new IosSalBitmap();
+}
+
+// -----------------------------------------------------------------------
+
+SalSession* IosSalInstance::CreateSalSession()
+{
+ return NULL;
+}
+
+// -----------------------------------------------------------------------
+
+// YieldMutexReleaser
+YieldMutexReleaser::YieldMutexReleaser() : mnCount( 0 )
+{
+ SalData* pSalData = GetSalData();
+ if( ! pSalData->mpFirstInstance->isUIAppThread() )
+ {
+ SalData::ensureThreadAutoreleasePool();
+ mnCount = pSalData->mpFirstInstance->ReleaseYieldMutex();
+ }
+}
+
+YieldMutexReleaser::~YieldMutexReleaser()
+{
+ if( mnCount != 0 )
+ GetSalData()->mpFirstInstance->AcquireYieldMutex( mnCount );
+}
+
+//////////////////////////////////////////////////////////////
+rtl::OUString GetOUString( CFStringRef rStr )
+{
+ if( rStr == 0 )
+ return rtl::OUString();
+ CFIndex nLength = CFStringGetLength( rStr );
+ if( nLength == 0 )
+ return rtl::OUString();
+ const UniChar* pConstStr = CFStringGetCharactersPtr( rStr );
+ if( pConstStr )
+ return rtl::OUString( pConstStr, nLength );
+ UniChar* pStr = reinterpret_cast<UniChar*>( rtl_allocateMemory( sizeof(UniChar)*nLength ) );
+ CFRange aRange = { 0, nLength };
+ CFStringGetCharacters( rStr, aRange, pStr );
+ rtl::OUString aRet( pStr, nLength );
+ rtl_freeMemory( pStr );
+ return aRet;
+}
+
+rtl::OUString GetOUString( NSString* pStr )
+{
+ if( ! pStr )
+ return rtl::OUString();
+ int nLen = [pStr length];
+ if( nLen == 0 )
+ return rtl::OUString();
+
+ rtl::OUStringBuffer aBuf( nLen+1 );
+ aBuf.setLength( nLen );
+ [pStr getCharacters: const_cast<sal_Unicode*>(aBuf.getStr())];
+ return aBuf.makeStringAndClear();
+}
+
+CFStringRef CreateCFString( const rtl::OUString& rStr )
+{
+ return CFStringCreateWithCharacters(kCFAllocatorDefault, rStr.getStr(), rStr.getLength() );
+}
+
+NSString* CreateNSString( const rtl::OUString& rStr )
+{
+ return [[NSString alloc] initWithCharacters: rStr.getStr() length: rStr.getLength()];
+}
+
+CGImageRef CreateCGImage( const Image& rImage )
+{
+ BitmapEx aBmpEx( rImage.GetBitmapEx() );
+ Bitmap aBmp( aBmpEx.GetBitmap() );
+
+ if( ! aBmp || ! aBmp.ImplGetImpBitmap() )
+ return NULL;
+
+ // simple case, no transparency
+ IosSalBitmap* pSalBmp = static_cast<IosSalBitmap*>(aBmp.ImplGetImpBitmap()->ImplGetSalBitmap());
+
+ if( ! pSalBmp )
+ return NULL;
+
+ CGImageRef xImage = NULL;
+ if( ! (aBmpEx.IsAlpha() || aBmpEx.IsTransparent() ) )
+ xImage = pSalBmp->CreateCroppedImage( 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight );
+ else if( aBmpEx.IsAlpha() )
+ {
+ AlphaMask aAlphaMask( aBmpEx.GetAlpha() );
+ Bitmap aMask( aAlphaMask.GetBitmap() );
+ IosSalBitmap* pMaskBmp = static_cast<IosSalBitmap*>(aMask.ImplGetImpBitmap()->ImplGetSalBitmap());
+ if( pMaskBmp )
+ xImage = pSalBmp->CreateWithMask( *pMaskBmp, 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight );
+ else
+ xImage = pSalBmp->CreateCroppedImage( 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight );
+ }
+ else if( aBmpEx.GetTransparentType() == TRANSPARENT_BITMAP )
+ {
+ Bitmap aMask( aBmpEx.GetMask() );
+ IosSalBitmap* pMaskBmp = static_cast<IosSalBitmap*>(aMask.ImplGetImpBitmap()->ImplGetSalBitmap());
+ if( pMaskBmp )
+ xImage = pSalBmp->CreateWithMask( *pMaskBmp, 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight );
+ else
+ xImage = pSalBmp->CreateCroppedImage( 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight );
+ }
+ else if( aBmpEx.GetTransparentType() == TRANSPARENT_COLOR )
+ {
+ Color aTransColor( aBmpEx.GetTransparentColor() );
+ SalColor nTransColor = MAKE_SALCOLOR( aTransColor.GetRed(), aTransColor.GetGreen(), aTransColor.GetBlue() );
+ xImage = pSalBmp->CreateColorMask( 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight, nTransColor );
+ }
+
+ return xImage;
+}
+
+UIImage* CreateNSImage( const Image& rImage )
+{
+ CGImageRef xImage = CreateCGImage( rImage );
+
+ if( ! xImage )
+ return nil;
+
+ Size aSize( rImage.GetSizePixel() );
+ UIImage* pImage = [[UIImage alloc] initWithCGImage: xImage];
+ CGImageRelease( xImage );
+
+ return pImage;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/ios/source/app/salnstimer.mm b/vcl/ios/source/app/salnstimer.mm
new file mode 100644
index 000000000000..05445110d8ba
--- /dev/null
+++ b/vcl/ios/source/app/salnstimer.mm
@@ -0,0 +1,59 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"
+
+#include "ios/saltimer.h"
+#include "ios/salnstimer.h"
+#include "ios/salinst.h"
+#include "ios/saldata.hxx"
+
+#include "svdata.hxx"
+
+@implementation TimerCallbackCaller
+-(void)timerElapsed:(NSTimer*)pTimer
+{
+ (void)pTimer;
+ ImplSVData* pSVData = ImplGetSVData();
+ if( IosSalTimer::bDispatchTimer )
+ {
+ if( pSVData->mpSalTimer )
+ {
+ YIELD_GUARD;
+ pSVData->mpSalTimer->CallCallback();
+
+ // NSTimer does not end nextEventMatchingMask of NSApplication
+ // so we need to wakeup a waiting Yield to inform it something happened
+ GetSalData()->mpFirstInstance->wakeupYield();
+ }
+ }
+}
+@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/ios/source/app/salsys.cxx b/vcl/ios/source/app/salsys.cxx
new file mode 100644
index 000000000000..1baf357d85a9
--- /dev/null
+++ b/vcl/ios/source/app/salsys.cxx
@@ -0,0 +1,253 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"
+
+#include "tools/rc.hxx"
+
+#include "rtl/ustrbuf.hxx"
+
+#include "vcl/button.hxx"
+
+#include "ios/salsys.h"
+#include "ios/saldata.hxx"
+#include "ios/salinst.h"
+
+#include "svids.hrc"
+
+using ::rtl::OUString;
+
+// =======================================================================
+
+IosSalSystem::~IosSalSystem()
+{
+}
+
+unsigned int IosSalSystem::GetDisplayScreenCount()
+{
+ NSArray* pScreens = [UIScreen screens];
+ return pScreens ? [pScreens count] : 1;
+}
+
+bool IosSalSystem::IsMultiDisplay()
+{
+ return false;
+}
+
+unsigned int IosSalSystem::GetDefaultDisplayNumber()
+{
+ return 0;
+}
+
+Rectangle IosSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
+{
+ NSArray* pScreens = [UIScreen screens];
+ Rectangle aRet;
+ UIScreen* pScreen = nil;
+ if( pScreens && nScreen < [pScreens count] )
+ pScreen = [pScreens objectAtIndex: nScreen];
+ else
+ pScreen = [UIScreen mainScreen];
+
+ if( pScreen )
+ {
+ CGRect aFrame = pScreen.bounds;
+ aRet = Rectangle( Point( static_cast<long int>(aFrame.origin.x), static_cast<long int>(aFrame.origin.y) ),
+ Size( static_cast<long int>(aFrame.size.width), static_cast<long int>(aFrame.size.height) ) );
+ }
+ return aRet;
+}
+
+Rectangle IosSalSystem::GetDisplayWorkAreaPosSizePixel( unsigned int nScreen )
+{
+ NSArray* pScreens = [UIScreen screens];
+ Rectangle aRet;
+ UIScreen* pScreen = nil;
+ if( pScreens && nScreen < [pScreens count] )
+ pScreen = [pScreens objectAtIndex: nScreen];
+ else
+ pScreen = [UIScreen mainScreen];
+
+ if( pScreen )
+ {
+ CGRect aFrame = pScreen.applicationFrame;
+ aRet = Rectangle( Point( static_cast<long int>(aFrame.origin.x), static_cast<long int>(aFrame.origin.y) ),
+ Size( static_cast<long int>(aFrame.size.width), static_cast<long int>(aFrame.size.height) ) );
+ }
+ return aRet;
+}
+
+rtl::OUString IosSalSystem::GetScreenName( unsigned int nScreen )
+{
+ NSArray* pScreens = [UIScreen screens];
+ OUString aRet;
+ if( nScreen < [pScreens count] )
+ {
+ ResMgr* pMgr = ImplGetResMgr();
+ if( pMgr )
+ {
+ String aScreenName( ResId( SV_MAC_SCREENNNAME, *pMgr ) );
+ aScreenName.SearchAndReplaceAllAscii( "%d", String::CreateFromInt32( nScreen ) );
+ aRet = aScreenName;
+ }
+ }
+ return aRet;
+}
+
+static NSString* getStandardString( int nButtonId )
+{
+ rtl::OUString aText( Button::GetStandardText( nButtonId ) );
+ if( ! aText.getLength() ) // this is for bad cases, we might be missing the vcl resource
+ {
+ switch( nButtonId )
+ {
+ case BUTTON_OK: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OK" ) );break;
+ case BUTTON_ABORT: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) );break;
+ case BUTTON_CANCEL: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cancel" ) );break;
+ case BUTTON_RETRY: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Retry" ) );break;
+ case BUTTON_YES: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Yes" ) );break;
+ case BUTTON_NO : aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "No" ) );break;
+ }
+ }
+ return aText.getLength() ? CreateNSString( aText) : nil;
+}
+
+@interface MessageboxDelegate : NSObject <UIAlertViewDelegate>
+{
+ int *_resultPtr;
+}
+- (id)initWithResultPtr:(int *)resultPtr;
+- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;
+@end
+
+@implementation MessageboxDelegate
+- (id)initWithResultPtr:(int *)resultPtr
+{
+ _resultPtr = resultPtr;
+ return [super init];
+}
+
+- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
+{
+ *_resultPtr = buttonIndex;
+}
+@end
+
+int IosSalSystem::ShowNativeMessageBox( const String& rTitle,
+ const String& rMessage,
+ int nButtonCombination,
+ int nDefaultButton)
+{
+ NSString* pTitle = CreateNSString( rTitle );
+ NSString* pMessage = CreateNSString( rMessage );
+
+ struct id_entry
+ {
+ int nCombination;
+ int nDefaultButton;
+ int nTextIds[3];
+ } aButtonIds[] =
+ {
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, { BUTTON_OK, -1, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, { BUTTON_OK, BUTTON_CANCEL, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_OK, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT, { BUTTON_ABORT, BUTTON_IGNORE, BUTTON_RETRY } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY, { BUTTON_RETRY, BUTTON_IGNORE, BUTTON_ABORT } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE, { BUTTON_IGNORE, BUTTON_IGNORE, BUTTON_ABORT } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES, { BUTTON_YES, BUTTON_NO, BUTTON_CANCEL } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO, { BUTTON_NO, BUTTON_YES, BUTTON_CANCEL } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_YES, BUTTON_NO } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES, { BUTTON_YES, BUTTON_NO, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO, { BUTTON_NO, BUTTON_YES, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY, { BUTTON_RETRY, BUTTON_CANCEL, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_RETRY, -1 } }
+ };
+
+ NSString* pDefText = nil;
+ NSString* pAltText = nil;
+ NSString* pOthText = nil;
+
+ unsigned int nC;
+ for( nC = 0; nC < sizeof(aButtonIds)/sizeof(aButtonIds[0]); nC++ )
+ {
+ if( aButtonIds[nC].nCombination == nButtonCombination )
+ {
+ if( aButtonIds[nC].nDefaultButton == nDefaultButton )
+ {
+ if( aButtonIds[nC].nTextIds[0] != -1 )
+ pDefText = getStandardString( aButtonIds[nC].nTextIds[0] );
+ if( aButtonIds[nC].nTextIds[1] != -1 )
+ pAltText = getStandardString( aButtonIds[nC].nTextIds[1] );
+ if( aButtonIds[nC].nTextIds[2] != -1 )
+ pOthText = getStandardString( aButtonIds[nC].nTextIds[2] );
+ break;
+ }
+ }
+ }
+
+ int nResult = 1; // ???
+ // How to do the delegate when this is C++?
+ MessageboxDelegate *delegate = [[MessageboxDelegate alloc] initWithResultPtr: &nResult];
+ UIAlertView *view = [[UIAlertView alloc] initWithTitle: pTitle message: pMessage delegate: delegate
+ cancelButtonTitle: @"Cancel" otherButtonTitles: nil];
+ [view show];
+ [view dealloc];
+ [delegate dealloc];
+
+ if( pTitle )
+ [pTitle release];
+ if( pMessage )
+ [pMessage release];
+ if( pDefText )
+ [pDefText release];
+ if( pAltText )
+ [pAltText release];
+ if( pOthText )
+ [pOthText release];
+
+ int nRet = 0;
+ if( nC < sizeof(aButtonIds)/sizeof(aButtonIds[0]) && nResult >= 1 && nResult <= 3 )
+ {
+ int nPressed = aButtonIds[nC].nTextIds[nResult-1];
+ switch( nPressed )
+ {
+ case BUTTON_NO: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO; break;
+ case BUTTON_YES: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES; break;
+ case BUTTON_OK: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK; break;
+ case BUTTON_CANCEL: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL; break;
+ case BUTTON_ABORT: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT; break;
+ case BUTTON_RETRY: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY; break;
+ case BUTTON_IGNORE: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE; break;
+ }
+ }
+
+ return nRet;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/ios/source/app/saltimer.cxx b/vcl/ios/source/app/saltimer.cxx
new file mode 100644
index 000000000000..69401ea502d7
--- /dev/null
+++ b/vcl/ios/source/app/saltimer.cxx
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"
+
+#include "ios/saltimer.h"
+#include "ios/salnstimer.h"
+#include "ios/saldata.hxx"
+#include "ios/salframe.h"
+#include "ios/salinst.h"
+
+// =======================================================================
+
+NSTimer* IosSalTimer::pRunningTimer = nil;
+bool IosSalTimer::bDispatchTimer = false;
+
+
+void ImplSalStartTimer( sal_uLong nMS )
+{
+ SalData* pSalData = GetSalData();
+ if( pSalData->mpFirstInstance->isUIAppThread() )
+ {
+ IosSalTimer::bDispatchTimer = true;
+ NSTimeInterval aTI = double(nMS)/1000.0;
+ if( IosSalTimer::pRunningTimer != nil )
+ {
+ if( [IosSalTimer::pRunningTimer timeInterval] == aTI )
+ // set new fire date
+ [IosSalTimer::pRunningTimer setFireDate: [NSDate dateWithTimeIntervalSinceNow: aTI]];
+ else
+ {
+ [IosSalTimer::pRunningTimer invalidate];
+ IosSalTimer::pRunningTimer = nil;
+ }
+ }
+ if( IosSalTimer::pRunningTimer == nil )
+ {
+ IosSalTimer::pRunningTimer = [NSTimer scheduledTimerWithTimeInterval: aTI
+ target: [[[TimerCallbackCaller alloc] init] autorelease]
+ selector: @selector(timerElapsed:)
+ userInfo: nil
+ repeats: YES];
+ }
+ }
+ else
+ {
+ SalData::ensureThreadAutoreleasePool();
+ // post an event so we can get into the main thread
+ // ???
+ }
+}
+
+void ImplSalStopTimer()
+{
+ IosSalTimer::bDispatchTimer = false;
+}
+
+IosSalTimer::IosSalTimer( )
+{
+}
+
+IosSalTimer::~IosSalTimer()
+{
+ ImplSalStopTimer();
+}
+
+void IosSalTimer::Start( sal_uLong nMS )
+{
+ ImplSalStartTimer( nMS );
+}
+
+void IosSalTimer::Stop()
+{
+ ImplSalStopTimer();
+}
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/ios/source/app/vcluiapp.mm b/vcl/ios/source/app/vcluiapp.mm
new file mode 100644
index 000000000000..e40d8a7eb792
--- /dev/null
+++ b/vcl/ios/source/app/vcluiapp.mm
@@ -0,0 +1,101 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+ // MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"
+
+#include "rtl/ustrbuf.hxx"
+
+#include "vcl/window.hxx"
+#include "vcl/svapp.hxx"
+#include "vcl/cmdevt.hxx"
+
+#include "ios/vcluiapp.h"
+#include "ios/salinst.h"
+#include "ios/saldata.hxx"
+#include "ios/salframe.h"
+#include "ios/salframeview.h"
+
+#include "impimagetree.hxx"
+
+@implementation VCL_UIApplication
+-(void)sendEvent:(UIEvent*)pEvent
+{
+ UIEventType eType = [pEvent type];
+ [super sendEvent: pEvent];
+}
+
+-(void)sendSuperEvent:(UIEvent*)pEvent
+{
+ [super sendEvent: pEvent];
+}
+
+-(BOOL)application: (UIApplication*)app openFile: (NSString*)pFile
+{
+ (void)app;
+ const rtl::OUString aFile( GetOUString( pFile ) );
+ return YES;
+}
+
+-(void)application: (UIApplication*) app openFiles: (NSArray*)files
+{
+ (void)app;
+ rtl::OUStringBuffer aFileList( 256 );
+
+ NSEnumerator* it = [files objectEnumerator];
+ NSString* pFile = nil;
+
+ while( (pFile = [it nextObject]) != nil )
+ {
+ const rtl::OUString aFile( GetOUString( pFile ) );
+ }
+
+ if( aFileList.getLength() )
+ {
+ // we have no back channel here, we have to assume success, in which case
+ // replyToOpenOrPrint does not need to be called according to documentation
+ // [app replyToOpenOrPrint: NSApplicationDelegateReplySuccess];
+ const ApplicationEvent* pAppEvent = new ApplicationEvent( String(), ApplicationAddress(),
+ APPEVENT_OPEN_STRING, aFileList.makeStringAndClear() );
+ IosSalInstance::aAppEventList.push_back( pAppEvent );
+ }
+}
+
+-(void)addFallbackMenuItem: (UIMenuItem*)pNewItem
+{
+ IosSalMenu::addFallbackMenuItem( pNewItem );
+}
+
+-(void)removeFallbackMenuItem: (UIMenuItem*)pItem
+{
+ IosSalMenu::removeFallbackMenuItem( pItem );
+}
+
+@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/null/printerinfomanager.cxx b/vcl/null/printerinfomanager.cxx
new file mode 100644
index 000000000000..7361606c35b3
--- /dev/null
+++ b/vcl/null/printerinfomanager.cxx
@@ -0,0 +1,51 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"
+
+#include "vcl/printerinfomanager.hxx"
+
+#include "unx/saldata.hxx"
+
+using namespace psp;
+using namespace osl;
+
+using ::rtl::OUString;
+using ::rtl::OString;
+using ::rtl::OStringToOUString;
+using ::rtl::OUStringHash;
+
+void PrinterInfoManager::release()
+{
+ SalData* pSalData = GetSalData();
+ delete pSalData->m_pPIManager;
+ pSalData->m_pPIManager = NULL;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst
index 9e0ccdba440b..29b3a4031e86 100644
--- a/vcl/prj/build.lst
+++ b/vcl/prj/build.lst
@@ -1,4 +1,4 @@
-vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools l10ntools icc cpputools svl LIBXSLT:libxslt NULL
+vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools DESKTOP:l10ntools icc DESKTOP:cpputools svl LIBXSLT:libxslt CAIRO:cairo NULL
vc vcl usr1 - all vc_mkout NULL
vc vcl\prj nmake - all vc_prj NULL
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 75bab1a29694..3db6bcc841bf 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -112,27 +112,6 @@ sal_Bool Help::IsContextHelpEnabled()
// -----------------------------------------------------------------------
-sal_Bool Help::StartContextHelp()
-{
- ImplSVData* pSVData = ImplGetSVData();
-
- if ( pSVData->maHelpData.mbContextHelp )
- {
- Window* pWindow = pSVData->maWinData.mpFocusWin;
- if ( pWindow )
- {
- Point aMousePos = pWindow->OutputToScreenPixel( pWindow->GetPointerPosPixel() );
- HelpEvent aHelpEvent( aMousePos, HELPMODE_CONTEXT );
- pWindow->RequestHelp( aHelpEvent );
- return sal_True;
- }
- }
-
- return sal_False;
-}
-
-// -----------------------------------------------------------------------
-
void Help::EnableExtHelp()
{
ImplGetSVData()->maHelpData.mbExtHelp = sal_True;
@@ -191,13 +170,6 @@ sal_Bool Help::EndExtHelp()
// -----------------------------------------------------------------------
-sal_Bool Help::IsExtHelpActive()
-{
- return ImplGetSVData()->maHelpData.mbExtHelpMode;
-}
-
-// -----------------------------------------------------------------------
-
void Help::EnableBalloonHelp()
{
ImplGetSVData()->maHelpData.mbBalloonHelp = sal_True;
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 9ffb8bc373da..1683faf1613a 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -964,46 +964,6 @@ inline sal_Bool ImplIsBackOrWhite( const Color& rColor )
return ( nLuminance < 8 ) || ( nLuminance > 250 );
}
-sal_Bool StyleSettings::IsHighContrastBlackAndWhite() const
-{
- sal_Bool bBWOnly = sal_True;
-
- // Only use B&W if fully B&W, like on GNOME.
- // Some colors like CheckedColor and HighlightColor are not B&W in Windows Standard HC Black,
- // and we don't want to be B&W then, so check these color first, very probably not B&W.
-
- // Unfortunately, GNOME uses a very very dark color (0x000033) instead of BLACK (0x000000)
-
- if ( !ImplIsBackOrWhite( GetFaceColor() ) )
- bBWOnly = sal_False;
- else if ( !ImplIsBackOrWhite( GetHighlightTextColor() ) )
- bBWOnly = sal_False;
- else if ( !ImplIsBackOrWhite( GetWindowColor() ) )
- bBWOnly = sal_False;
- else if ( !ImplIsBackOrWhite( GetWindowTextColor() ) )
- bBWOnly = sal_False;
- else if ( !ImplIsBackOrWhite( GetButtonTextColor() ) )
- bBWOnly = sal_False;
- else if ( !ImplIsBackOrWhite( GetButtonTextColor() ) )
- bBWOnly = sal_False;
- else if ( !ImplIsBackOrWhite( GetGroupTextColor() ) )
- bBWOnly = sal_False;
- else if ( !ImplIsBackOrWhite( GetLabelTextColor() ) )
- bBWOnly = sal_False;
- else if ( !ImplIsBackOrWhite( GetDialogColor() ) )
- bBWOnly = sal_False;
- else if ( !ImplIsBackOrWhite( GetFieldColor() ) )
- bBWOnly = sal_False;
- else if ( !ImplIsBackOrWhite( GetMenuColor() ) )
- bBWOnly = sal_False;
- else if ( !ImplIsBackOrWhite( GetMenuBarColor() ) )
- bBWOnly = sal_False;
- else if ( !ImplIsBackOrWhite( GetMenuHighlightColor() ) )
- bBWOnly = sal_False;
-
- return bBWOnly;
-}
-
// -----------------------------------------------------------------------
sal_Bool StyleSettings::operator ==( const StyleSettings& rSet ) const
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index fe536addac98..9d54803f7f3b 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -241,12 +241,6 @@ Application::~Application()
// -----------------------------------------------------------------------
-void Application::InitAppRes( const ResId& )
-{
-}
-
-// -----------------------------------------------------------------------
-
sal_Bool Application::QueryExit()
{
WorkWindow* pAppWin = ImplGetSVData()->maWinData.mpAppWin;
@@ -417,18 +411,6 @@ const KeyCode* Application::GetReservedKeyCode( sal_uLong i )
return &ImplReservedKeys::get()->first[i].mKeyCode;
}
-String Application::GetReservedKeyCodeDescription( sal_uLong i )
-{
- ResMgr* pResMgr = ImplGetResMgr();
- if( ! pResMgr )
- return String();
- ImplReservedKey *pImplReservedKeys = ImplReservedKeys::get()->first;
- if( i >= GetReservedKeyCodeCount() || ! pImplReservedKeys[i].mnResId )
- return String();
- else
- return String( ResId( pImplReservedKeys[i].mnResId, *pResMgr ) );
-}
-
// -----------------------------------------------------------------------
void Application::Execute()
@@ -561,13 +543,6 @@ sal_Bool Application::IsInExecute()
// -----------------------------------------------------------------------
-sal_Bool Application::IsShutDown()
-{
- return ImplGetSVData()->maAppData.mbAppQuit;
-}
-
-// -----------------------------------------------------------------------
-
sal_Bool Application::IsInModalMode()
{
return (ImplGetSVData()->maAppData.mnModalMode != 0);
@@ -621,34 +596,6 @@ sal_Bool Application::IsUICaptured()
// -----------------------------------------------------------------------
-sal_Bool Application::IsUserActive( sal_uInt16 nTest )
-{
- if ( nTest & (USERACTIVE_MOUSEDRAG | USERACTIVE_INPUT) )
- {
- if ( IsUICaptured() )
- return sal_True;
- }
-
- if ( nTest & USERACTIVE_INPUT )
- {
- if ( GetLastInputInterval() < 500 )
- return sal_True;
-
- if ( AnyInput( INPUT_KEYBOARD ) )
- return sal_True;
- }
-
- if ( nTest & USERACTIVE_MODALDIALOG )
- {
- if ( ImplGetSVData()->maAppData.mnModalDialog )
- return sal_True;
- }
-
- return sal_False;
-}
-
-// -----------------------------------------------------------------------
-
void Application::SystemSettingsChanging( AllSettings& /*rSettings*/,
Window* /*pFrame*/ )
{
@@ -1465,16 +1412,6 @@ void Application::RemoveAccel( Accelerator* pAccel )
// -----------------------------------------------------------------------
-void Application::FlushAccel()
-{
- ImplSVData* pSVData = ImplGetSVData();
-
- if ( pSVData->maAppData.mpAccelMgr )
- pSVData->maAppData.mpAccelMgr->FlushAccel();
-}
-
-// -----------------------------------------------------------------------
-
sal_Bool Application::CallAccel( const KeyCode& rKeyCode, sal_uInt16 nRepeat )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -1547,13 +1484,6 @@ void Application::SetDialogScaleX( short nScale )
// -----------------------------------------------------------------------
-short Application::GetDialogScaleX()
-{
- return ImplGetSVData()->maAppData.mnDialogScaleX;
-}
-
-// -----------------------------------------------------------------------
-
void Application::SetDefDialogParent( Window* pWindow )
{
ImplGetSVData()->maWinData.mpDefDialogParent = pWindow;
@@ -1675,19 +1605,6 @@ const String& Application::GetFontPath()
// -----------------------------------------------------------------------
-void Application::SetFontPath( const String& rPath )
-{
- ImplSVData* pSVData = ImplGetSVData();
-
- // if it doesn't exist create a new one
- if( !pSVData->maAppData.mpFontPath )
- pSVData->maAppData.mpFontPath = new String( rPath );
- else
- *(pSVData->maAppData.mpFontPath) = rPath;
-}
-
-// -----------------------------------------------------------------------
-
UniqueItemId Application::CreateUniqueId()
{
ImplSVData* pSVData = ImplGetSVData();
@@ -1813,47 +1730,6 @@ void ImplFreeHotKeyData()
// -----------------------------------------------------------------------
-sal_uIntPtr Application::AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData )
-{
- ImplSVData* pSVData = ImplGetSVData();
- ImplHotKey* pHotKeyData = new ImplHotKey;
- pHotKeyData->mpUserData = pData;
- pHotKeyData->maKeyCode = rKeyCode;
- pHotKeyData->maLink = rLink;
- pHotKeyData->mpNext = pSVData->maAppData.mpFirstHotKey;
- pSVData->maAppData.mpFirstHotKey = pHotKeyData;
- return (sal_uIntPtr)pHotKeyData;
-}
-
-// -----------------------------------------------------------------------
-
-void Application::RemoveHotKey( sal_uIntPtr nId )
-{
- ImplSVData* pSVData = ImplGetSVData();
- ImplHotKey* pFindHotKeyData = (ImplHotKey*)nId;
- ImplHotKey* pPrevHotKeyData = NULL;
- ImplHotKey* pHotKeyData = pSVData->maAppData.mpFirstHotKey;
- while ( pHotKeyData )
- {
- if ( pHotKeyData == pFindHotKeyData )
- {
- if ( pPrevHotKeyData )
- pPrevHotKeyData->mpNext = pFindHotKeyData->mpNext;
- else
- pSVData->maAppData.mpFirstHotKey = pFindHotKeyData->mpNext;
- delete pFindHotKeyData;
- break;
- }
-
- pPrevHotKeyData = pHotKeyData;
- pHotKeyData = pHotKeyData->mpNext;
- }
-
- DBG_ASSERT( pHotKeyData, "Application::RemoveHotKey() - HotKey is not added" );
-}
-
-// -----------------------------------------------------------------------
-
void ImplFreeEventHookData()
{
ImplSVData* pSVData = ImplGetSVData();
@@ -1931,20 +1807,6 @@ long Application::CallEventHooks( NotifyEvent& rEvt )
// -----------------------------------------------------------------------
-long Application::CallPreNotify( NotifyEvent& rEvt )
-{
- return ImplCallPreNotify( rEvt );
-}
-
-// -----------------------------------------------------------------------
-
-long Application::CallEvent( NotifyEvent& rEvt )
-{
- return ImplCallEvent( rEvt );
-}
-
-// -----------------------------------------------------------------------
-
const LocaleDataWrapper& Application::GetAppLocaleDataWrapper()
{
return GetSettings().GetLocaleDataWrapper();
@@ -2020,11 +1882,6 @@ void Application::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const r
pSVData->mpDefInst->AddToRecentDocumentList(rFileUrl, rMimeType);
}
-sal_Bool Application::IsAccessibilityEnabled()
-{
- return sal_False;
-}
-
sal_Bool InitAccessBridge( sal_Bool bShowCancel, sal_Bool &rCancelled )
{
sal_Bool bRet = true;
@@ -2067,13 +1924,9 @@ void Application::Property( ApplicationProperty& rProp )
void Application::SetPropertyHandler( PropertyHandler* p )
{
- if ( pHandler )
- delete pHandler;
pHandler = p;
}
-
-
void Application::AppEvent( const ApplicationEvent& /*rAppEvent*/ )
{
}
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index 7648dbbae75c..10f7e50d9aad 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -410,8 +410,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
return bSuccess;
}
-
- catch(::com::sun::star::java::JavaNotConfiguredException e)
+ catch (const ::com::sun::star::java::JavaNotConfiguredException&)
{
ResMgr *pResMgr = ImplGetResMgr();
if( bErrorMessage && bAllowCancel && pResMgr )
@@ -435,8 +434,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
return false;
}
-
- catch(::com::sun::star::java::JavaVMCreationFailureException e)
+ catch (const ::com::sun::star::java::JavaVMCreationFailureException&)
{
ResMgr *pResMgr = ImplGetResMgr();
if( bErrorMessage && bAllowCancel && pResMgr )
@@ -460,8 +458,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
return false;
}
-
- catch(::com::sun::star::java::MissingJavaRuntimeException e)
+ catch (const ::com::sun::star::java::MissingJavaRuntimeException&)
{
ResMgr *pResMgr = ImplGetResMgr();
if( bErrorMessage && bAllowCancel && pResMgr )
@@ -485,8 +482,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
return false;
}
-
- catch(::com::sun::star::java::JavaDisabledException e)
+ catch (const ::com::sun::star::java::JavaDisabledException&)
{
ResMgr *pResMgr = ImplGetResMgr();
if( bErrorMessage && bAllowCancel && pResMgr )
@@ -510,9 +506,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
return false;
}
-
-
- catch(::com::sun::star::uno::RuntimeException e)
+ catch (const ::com::sun::star::uno::RuntimeException& e)
{
ResMgr *pResMgr = ImplGetResMgr();
if( bErrorMessage && pResMgr )
@@ -564,7 +558,6 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
return false;
}
-
catch (...)
{
return false;
diff --git a/vcl/source/app/svmainhook.cxx b/vcl/source/app/svmainhook.cxx
index dd446125a7aa..47c3854a2987 100644
--- a/vcl/source/app/svmainhook.cxx
+++ b/vcl/source/app/svmainhook.cxx
@@ -31,89 +31,13 @@
#include <tools/tools.h>
#ifndef MACOSX
+// MacOSX implementation of ImplSVMainHook is in aqua/source/app/salinst.cxx
sal_Bool ImplSVMainHook( int * )
{
return sal_False; // indicate that ImplSVMainHook is not implemented
}
-#else
-// MACOSX cocoa implementation of ImplSVMainHook is in aqua/source/app/salinst.cxx
-#ifndef QUARTZ // MACOSX (X11) needs the CFRunLoop()
-#include <osl/thread.h>
-#include <premac.h>
-#include <CoreFoundation/CoreFoundation.h>
-#include <postmac.h>
-#include <unistd.h>
-
-extern sal_Bool ImplSVMain();
-
-// ============================================================================
-
-
-static void SourceContextCallBack( void *pInfo )
-{
-}
-
-struct ThreadContext
-{
- int* pRet;
- CFRunLoopRef* pRunLoopRef;
-};
-
-static void RunSVMain(void *pData)
-{
- ThreadContext* tcx = reinterpret_cast<ThreadContext*>(pData);
-
- // busy waiting (ok in this case) until the run loop is
- // running
- while (!CFRunLoopIsWaiting(*tcx->pRunLoopRef))
- usleep(100);
-
- *tcx->pRet = ImplSVMain();
-
- // Force exit since some JVMs won't shutdown when only exit() is invoked
- _exit( 0 );
-}
-
-sal_Bool ImplSVMainHook( int *pnInit )
-{
- // Mac OS X requires that any Cocoa code have a CFRunLoop started in the
- // primordial thread. Since all of the AWT classes in Java 1.4 and higher
- // are written in Cocoa, we need to start the CFRunLoop here and run
- // ImplSVMain() in a secondary thread.
- // See http://developer.apple.com/samplecode/simpleJavaLauncher/listing3.html
- // for further details and an example
-
- CFRunLoopRef runLoopRef = CFRunLoopGetCurrent();
- ThreadContext tcx;
- tcx.pRet = pnInit; // the return value
- tcx.pRunLoopRef = &runLoopRef;
- oslThread hThreadID = osl_createThread(RunSVMain, &tcx);
-
- // Start the CFRunLoop
- CFRunLoopSourceContext aSourceContext;
- aSourceContext.version = 0;
- aSourceContext.info = NULL;
- aSourceContext.retain = NULL;
- aSourceContext.release = NULL;
- aSourceContext.copyDescription = NULL;
- aSourceContext.equal = NULL;
- aSourceContext.hash = NULL;
- aSourceContext.schedule = NULL;
- aSourceContext.cancel = NULL;
- aSourceContext.perform = &SourceContextCallBack;
- CFRunLoopSourceRef aSourceRef = CFRunLoopSourceCreate(NULL, 0, &aSourceContext);
- CFRunLoopAddSource(runLoopRef, aSourceRef, kCFRunLoopCommonModes);
- CFRunLoopRun();
-
- osl_joinWithThread( hThreadID );
- osl_destroyThread( hThreadID );
-
- return sal_True; // indicate that ImplSVMainHook is implemented
-}
-
-#endif // MACOSX
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/components/factory.cxx b/vcl/source/components/factory.cxx
index 04b0e122cbce..9701e83e886a 100644
--- a/vcl/source/components/factory.cxx
+++ b/vcl/source/components/factory.cxx
@@ -83,14 +83,7 @@ namespace rsvg
extern "C" {
- VCL_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment(
- const sal_Char** ppEnvTypeName,
- uno_Environment** /*ppEnv*/ )
- {
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
- }
-
- VCL_DLLPUBLIC void* SAL_CALL component_getFactory(
+ VCL_DLLPUBLIC void* SAL_CALL vcl_component_getFactory(
const sal_Char* pImplementationName,
void* pXUnoSMgr,
void* /*pXUnoKey*/
@@ -144,12 +137,14 @@ extern "C" {
xMgr, vcl::DropTarget_getImplementationName(), vcl::DropTarget_createInstance,
vcl::DropTarget_getSupportedServiceNames() );
}
+#ifdef ENABLE_LIBRSVG
else if( vcl::rsvg::Rasterizer_getImplementationName().equalsAscii( pImplementationName ) )
{
xFactory = ::cppu::createSingleFactory(
xMgr, vcl::rsvg::Rasterizer_getImplementationName(), vcl::rsvg::Rasterizer_createInstance,
vcl::rsvg::Rasterizer_getSupportedServiceNames() );
}
+#endif
if( xFactory.is() )
{
xFactory->acquire();
diff --git a/vcl/source/components/makefile.mk b/vcl/source/components/makefile.mk
deleted file mode 100644
index 41f21bfa3749..000000000000
--- a/vcl/source/components/makefile.mk
+++ /dev/null
@@ -1,55 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=vcl
-TARGET=components
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile2.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/display.obj \
- $(SLO)$/dtranscomp.obj \
- $(SLO)$/fontident.obj \
- $(SLO)$/stringmirror.obj \
- $(SLO)$/rasterizer_rsvg.obj \
- $(SLO)$/factory.obj
-
-EXCEPTIONSFILES= $(SLO)$/rasterizer_rsvg.obj
-
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-.INCLUDE : $(PRJ)$/util$/target.pmk
diff --git a/vcl/source/components/rasterizer_rsvg.cxx b/vcl/source/components/rasterizer_rsvg.cxx
index 006b30b28e28..ef0d5f82e937 100644
--- a/vcl/source/components/rasterizer_rsvg.cxx
+++ b/vcl/source/components/rasterizer_rsvg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,23 +38,25 @@
#include <cppuhelper/implbase2.hxx>
#include <osl/module.h>
+#ifdef SYSTEM_CAIRO
+#include <cairo.h>
+#else
+#include <cairo/cairo.h>
+#endif
+
#include <vector>
#if defined MACOSX
#define VCL_RSVG_GOBJECT_LIBNAME "libgobject-2.0.0.dylib"
- #define VCL_RSVG_CAIRO_LIBNAME "libcairo.2.dylib"
#define VCL_RSVG_LIBRSVG_LIBNAME "librsvg-2.2.dylib"
#elif defined UNX
#define VCL_RSVG_GOBJECT_LIBNAME "libgobject-2.0.so"
- #define VCL_RSVG_CAIRO_LIBNAME "libcairo.so"
#define VCL_RSVG_LIBRSVG_LIBNAME "librsvg-2.so"
#elif defined WNT
#define VCL_RSVG_GOBJECT_LIBNAME "gobjectlo.dll"
- #define VCL_RSVG_CAIRO_LIBNAME "cairo.dll"
#define VCL_RSVG_LIBRSVG_LIBNAME "librsvg-2-2.dll"
#else
#define VCL_RSVG_GOBJECT_LIBNAME "nogobjectlib"
- #define VCL_RSVG_CAIRO_LIBNAME "nocairolib"
#define VCL_RSVG_LIBRSVG_LIBNAME "nolibrsvglib"
#endif
@@ -72,18 +75,6 @@ typedef void* gpointer;
struct GError;
-enum cairo_format_t { CAIRO_FORMAT_ARGB32 = 0 };
-enum cairo_status_t { CAIRO_STATUS_SUCCESS = 0 };
-
-struct cairo_surface_t;
-struct cairo_t;
-struct cairo_matrix_t
-{
- double xx; double yx;
- double xy; double yy;
- double x0; double y0;
-};
-
struct RsvgHandle;
struct RsvgDimensionData
{
@@ -126,30 +117,12 @@ public:
static LibraryWrapper& get();
- bool isValid() const { return( ( mpGObjectLib != NULL ) && ( mpCairoLib != NULL ) && ( mpRSVGLib != NULL ) ); }
+ bool isValid() const { return( ( mpGObjectLib != NULL ) && ( mpRSVGLib != NULL ) ); }
// G-Object
gpointer g_object_unref( gpointer pointer ) { return( (*mp_g_object_unref)( pointer ) ); };
// LibRSVG
-
- // Cairo
- cairo_surface_t* image_surface_create( cairo_format_t format, int width, int height ) { return( (*mp_image_surface_create)( format, width, height ) ); }
- void surface_destroy( cairo_surface_t* surface ) { (*mp_surface_destroy)( surface ); }
- cairo_status_t surface_status( cairo_surface_t* surface ) { return( (*mp_surface_status)( surface ) ); }
- cairo_t* create( cairo_surface_t* surface ) { return( (*mp_create)( surface ) ); }
- void destroy( cairo_t* cairo ) { (*mp_destroy )( cairo ); }
- void matrix_init_identity( cairo_matrix_t* matrix ){ (*mp_matrix_init_identity)( matrix ); }
- void matrix_translate( cairo_matrix_t* matrix, double nx, double ny ) { (*mp_matrix_translate)( matrix, nx, ny ); }
- void matrix_scale( cairo_matrix_t* matrix, double sx, double sy ) {( *mp_matrix_scale )( matrix, sx, sy ); }
- void matrix_rotate( cairo_matrix_t* matrix, double radians ) { ( *mp_matrix_rotate )( matrix, radians ); }
- void transform( cairo_t* cairo, cairo_matrix_t *matrix ) { (*mp_transform)( cairo, matrix ); }
- unsigned char* image_surface_get_data(cairo_surface_t* surface) { return( (*mp_image_surface_get_data)( surface ) ); }
- int image_surface_get_width(cairo_surface_t* surface) { return( (*mp_image_surface_get_width)( surface ) ); }
- int image_surface_get_height(cairo_surface_t* surface) { return( (*mp_image_surface_get_height)( surface ) ); }
- int image_surface_get_stride(cairo_surface_t* surface) { return( (*mp_image_surface_get_stride)( surface ) ); }
-
- // LibRSVG
void rsvg_init() { (*mp_rsvg_init)(); }
RsvgHandle* rsvg_handle_new_from_data( const guint8* data, gsize size, GError** error) { return( (*mp_rsvg_handle_new_from_data)( data, size, error ) ); }
gboolean rsvg_handle_close( RsvgHandle* handle, GError** error ) { return( (*mp_rsvg_handle_close)( handle, error ) ); }
@@ -164,28 +137,11 @@ private:
private:
oslModule mpGObjectLib;
- oslModule mpCairoLib;
oslModule mpRSVGLib;
// GObject
gpointer (*mp_g_object_unref)( gpointer );
- // Cairo
- cairo_surface_t* (*mp_image_surface_create)(cairo_format_t,int,int);
- void (*mp_surface_destroy )(cairo_surface_t*);
- cairo_status_t (*mp_surface_status)(cairo_surface_t*);
- cairo_t* (*mp_create)(cairo_surface_t*);
- void (*mp_destroy)(cairo_t*);
- void (*mp_matrix_init_identity)(cairo_matrix_t*);
- void (*mp_matrix_translate)( cairo_matrix_t*, double, double);
- void (*mp_matrix_scale )( cairo_matrix_t*, double, double);
- void (*mp_matrix_rotate)( cairo_matrix_t*, double);
- void (*mp_transform)( cairo_t*, cairo_matrix_t*);
- unsigned char* (*mp_image_surface_get_data)( cairo_surface_t* );
- int (*mp_image_surface_get_width)(cairo_surface_t* surface);
- int (*mp_image_surface_get_height)(cairo_surface_t* surface);
- int (*mp_image_surface_get_stride)(cairo_surface_t* surface);
-
// LibRSVG
void (*mp_rsvg_init)( void );
RsvgHandle* (*mp_rsvg_handle_new_from_data)( const guint8*, gsize, GError** );
@@ -211,11 +167,9 @@ LibraryWrapper& LibraryWrapper::get()
LibraryWrapper::LibraryWrapper() :
mpGObjectLib( NULL ),
- mpCairoLib( NULL ),
mpRSVGLib( NULL )
{
const ::rtl::OUString aGObjectLibName( RTL_CONSTASCII_USTRINGPARAM( VCL_RSVG_GOBJECT_LIBNAME ) );
- const ::rtl::OUString aCairoLibName( RTL_CONSTASCII_USTRINGPARAM( VCL_RSVG_CAIRO_LIBNAME ) );
const ::rtl::OUString aRSVGLibName( RTL_CONSTASCII_USTRINGPARAM( VCL_RSVG_LIBRSVG_LIBNAME ) );
bool bCont = true;
@@ -235,47 +189,6 @@ LibraryWrapper::LibraryWrapper() :
}
}
- // Cairo
- if( bCont && ( NULL != ( mpCairoLib = osl_loadModule( aCairoLibName.pData, SAL_LOADMODULE_DEFAULT ) ) ||
- NULL != ( mpCairoLib = osl_loadModuleRelative( (oslGenericFunction)LibraryWrapper::get,
- aCairoLibName.pData, SAL_LOADMODULE_DEFAULT ) )
- ) )
- {
- mp_image_surface_create = ( cairo_surface_t* (*)( cairo_format_t, int, int ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_image_surface_create" );
- mp_surface_destroy = ( void (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_surface_destroy" );
- mp_surface_status = ( cairo_status_t (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_surface_status" );
- mp_create = ( cairo_t* (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_create" );
- mp_destroy = ( void (*)( cairo_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_destroy" );
- mp_matrix_init_identity = ( void (*)( cairo_matrix_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_init_identity" );
- mp_matrix_translate = ( void (*)( cairo_matrix_t*, double, double ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_translate" );
- mp_matrix_scale = ( void (*)( cairo_matrix_t*, double, double ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_scale" );
- mp_matrix_rotate = ( void (*)( cairo_matrix_t*, double ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_rotate" );
- mp_transform = ( void (*)( cairo_t*, cairo_matrix_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_transform" );
- mp_image_surface_get_data = ( unsigned char* (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_image_surface_get_data" );
- mp_image_surface_get_width = ( int (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_image_surface_get_width" );
- mp_image_surface_get_height = ( int (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_image_surface_get_height" );
- mp_image_surface_get_stride = ( int (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_image_surface_get_stride" );
-
- if( !( mp_image_surface_create &&
- mp_surface_destroy &&
- mp_surface_status &&
- mp_create &&
- mp_destroy &&
- mp_matrix_init_identity &&
- mp_matrix_translate &&
- mp_matrix_scale &&
- mp_matrix_rotate &&
- mp_transform &&
- mp_image_surface_get_data &&
- mp_image_surface_get_width &&
- mp_image_surface_get_height &&
- mp_image_surface_get_stride ) )
- {
- OSL_TRACE( "not all needed symbols were found in cairo library" );
- bCont = false;
- }
- }
-
// LibRSVG
if( bCont && ( NULL != ( mpRSVGLib = osl_loadModule( aRSVGLibName.pData, SAL_LOADMODULE_DEFAULT ) ) ||
NULL != ( mpRSVGLib = osl_loadModuleRelative( (oslGenericFunction)LibraryWrapper::get,
@@ -302,10 +215,9 @@ LibraryWrapper::LibraryWrapper() :
}
OSL_ENSURE( mpGObjectLib, "g-object library could not be loaded" );
- OSL_ENSURE( mpCairoLib, "cairo library could not be loaded" );
OSL_ENSURE( mpRSVGLib, "librsvg library could not be loaded" );
- bCont = bCont && mpGObjectLib != NULL && mpCairoLib != NULL && mpRSVGLib != NULL;
+ bCont = bCont && mpGObjectLib != NULL && mpRSVGLib != NULL;
// unload all libraries in case of failure
if( !bCont )
@@ -316,12 +228,6 @@ LibraryWrapper::LibraryWrapper() :
mpRSVGLib = NULL;
}
- if( mpCairoLib )
- {
- osl_unloadModule( mpCairoLib );
- mpCairoLib = NULL;
- }
-
if( mpGObjectLib )
{
osl_unloadModule( mpGObjectLib );
@@ -426,11 +332,10 @@ void Rasterizer::implFreeRsvgHandle()
uno::Reference< graphic::XGraphic > Rasterizer::implGetXGraphicFromSurface( cairo_surface_t* pSurface ) const
{
- LibraryWrapper& rLib = LibraryWrapper::get();
- unsigned char* pData = rLib.image_surface_get_data( pSurface );
- const sal_Int32 nWidth = rLib.image_surface_get_width( pSurface );
- const sal_Int32 nHeight =rLib.image_surface_get_height( pSurface );
- const sal_Int32 nStride = rLib.image_surface_get_stride( pSurface );
+ unsigned char* pData = cairo_image_surface_get_data( pSurface );
+ const sal_Int32 nWidth = cairo_image_surface_get_width( pSurface );
+ const sal_Int32 nHeight = cairo_image_surface_get_height( pSurface );
+ const sal_Int32 nStride = cairo_image_surface_get_stride( pSurface );
uno::Reference< graphic::XGraphic > xRet;
@@ -563,31 +468,31 @@ uno::Reference< graphic::XGraphic > SAL_CALL Rasterizer::rasterize( ::sal_uInt32
if( mpRsvgHandle && rLib.isValid() && nWidth && nHeight && mnDefaultWidth && mnDefaultHeight )
{
- cairo_surface_t* pSurface = rLib.image_surface_create( CAIRO_FORMAT_ARGB32, nWidth, nHeight );
+ cairo_surface_t* pSurface = cairo_image_surface_create( CAIRO_FORMAT_ARGB32, nWidth, nHeight );
- if( pSurface && ( CAIRO_STATUS_SUCCESS == rLib.surface_status( pSurface ) ) )
+ if( pSurface && ( CAIRO_STATUS_SUCCESS == cairo_surface_status( pSurface ) ) )
{
- cairo_t* pCr = rLib.create( pSurface );
+ cairo_t* pCr = cairo_create( pSurface );
if( pCr )
{
cairo_matrix_t aMatrix;
- rLib.matrix_init_identity( &aMatrix );
- rLib.matrix_scale( &aMatrix,
+ cairo_matrix_init_identity( &aMatrix );
+ cairo_matrix_scale( &aMatrix,
static_cast< double >( nWidth ) / mnDefaultWidth,
static_cast< double >( nHeight ) / mnDefaultHeight );
- rLib.transform( pCr, &aMatrix );
+ cairo_transform( pCr, &aMatrix );
if( rLib.rsvg_handle_render_cairo( mpRsvgHandle, pCr ) )
{
xRet = implGetXGraphicFromSurface( pSurface );
}
- rLib.destroy( pCr );
+ cairo_destroy( pCr );
}
- rLib.surface_destroy( pSurface );
+ cairo_surface_destroy( pSurface );
OSL_ENSURE( xRet.is(), "SVG *not* rendered successfully" );
}
}
@@ -638,3 +543,5 @@ uno::Reference< uno::XInterface > SAL_CALL Rasterizer_createInstance( const uno:
} // namespace rsvg
} // namespace vcl
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/components/stringmirror.cxx b/vcl/source/components/stringmirror.cxx
index 78806914a7c4..70bf44b568d0 100644
--- a/vcl/source/components/stringmirror.cxx
+++ b/vcl/source/components/stringmirror.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121,3 +122,5 @@ Sequence< OUString > SAL_CALL StringMirror::getSupportedServiceNames() throw (Ru
}
} // namespace vcl
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 69a3fdbdce9d..4929a8bfa01a 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -241,11 +241,11 @@ static int ImplKommaPointCharEqual( xub_Unicode c1, xub_Unicode c2 )
// -----------------------------------------------------------------------
static XubString ImplPatternReformat( const XubString& rStr,
- const ByteString& rEditMask,
+ const rtl::OString& rEditMask,
const XubString& rLiteralMask,
sal_uInt16 nFormatFlags )
{
- if ( !rEditMask.Len() )
+ if (rEditMask.isEmpty())
return rStr;
XubString aStr = rStr;
@@ -258,14 +258,14 @@ static XubString ImplPatternReformat( const XubString& rStr,
xub_StrLen i = 0;
xub_StrLen n;
- while ( i < rEditMask.Len() )
+ while ( i < rEditMask.getLength() )
{
if ( nStrIndex >= aStr.Len() )
break;
cChar = aStr.GetChar(nStrIndex);
cLiteral = rLiteralMask.GetChar(i);
- cMask = rEditMask.GetChar(i);
+ cMask = rEditMask[i];
// Aktuelle Position ein Literal
if ( cMask == EDITMASK_LITERAL )
@@ -281,11 +281,11 @@ static XubString ImplPatternReformat( const XubString& rStr,
// Dies ist dann der Fall, wenn es nicht in das Muster
// des naechsten nicht Literal-Zeichens passt
n = i+1;
- while ( n < rEditMask.Len() )
+ while ( n < rEditMask.getLength() )
{
- if ( rEditMask.GetChar(n) != EDITMASK_LITERAL )
+ if ( rEditMask[n] != EDITMASK_LITERAL )
{
- if ( !ImplIsPatternChar( cChar, rEditMask.GetChar(n) ) )
+ if ( !ImplIsPatternChar( cChar, rEditMask[n] ) )
nStrIndex++;
break;
}
@@ -318,9 +318,9 @@ static XubString ImplPatternReformat( const XubString& rStr,
if ( nFormatFlags & PATTERN_FORMAT_EMPTYLITERALS )
{
n = i;
- while ( n < rEditMask.Len() )
+ while ( n < rEditMask.getLength() )
{
- if ( rEditMask.GetChar( n ) == EDITMASK_LITERAL )
+ if ( rEditMask[n] == EDITMASK_LITERAL )
{
if ( ImplKommaPointCharEqual( cChar, rLiteralMask.GetChar( n ) ) )
i = n+1;
@@ -346,7 +346,7 @@ static XubString ImplPatternReformat( const XubString& rStr,
// -----------------------------------------------------------------------
-static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask,
+static void ImplPatternMaxPos( const XubString rStr, const rtl::OString& rEditMask,
sal_uInt16 nFormatFlags, sal_Bool bSameMask,
sal_uInt16 nCursorPos, sal_uInt16& rPos )
{
@@ -360,7 +360,7 @@ static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask
{
while ( nMaxPos )
{
- if ( (rEditMask.GetChar(nMaxPos-1) != EDITMASK_LITERAL) &&
+ if ( (rEditMask[nMaxPos-1] != EDITMASK_LITERAL) &&
(rStr.GetChar(nMaxPos-1) != ' ') )
break;
nMaxPos--;
@@ -369,9 +369,9 @@ static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask
// Wenn wir vor einem Literal stehen, dann solange weitersuchen,
// bis erste Stelle nach Literal
xub_StrLen nTempPos = nMaxPos;
- while ( nTempPos < rEditMask.Len() )
+ while ( nTempPos < rEditMask.getLength() )
{
- if ( rEditMask.GetChar(nTempPos) != EDITMASK_LITERAL )
+ if ( rEditMask[nTempPos] != EDITMASK_LITERAL )
{
nMaxPos = nTempPos;
break;
@@ -390,7 +390,7 @@ static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask
// -----------------------------------------------------------------------
static void ImplPatternProcessStrictModify( Edit* pEdit,
- const ByteString& rEditMask,
+ const rtl::OString& rEditMask,
const XubString& rLiteralMask,
sal_uInt16 nFormatFlags, sal_Bool bSameMask )
{
@@ -403,14 +403,14 @@ static void ImplPatternProcessStrictModify( Edit* pEdit,
xub_StrLen nMaxLen = aText.Len();
while ( i < nMaxLen )
{
- if ( (rEditMask.GetChar( i ) != EDITMASK_LITERAL) &&
+ if ( (rEditMask[i] != EDITMASK_LITERAL) &&
(aText.GetChar( i ) != ' ') )
break;
i++;
}
// Alle Literalzeichen beibehalten
- while ( i && (rEditMask.GetChar( i ) == EDITMASK_LITERAL) )
+ while ( i && (rEditMask[i] == EDITMASK_LITERAL) )
i--;
aText.Erase( 0, i );
}
@@ -442,14 +442,14 @@ static void ImplPatternProcessStrictModify( Edit* pEdit,
// -----------------------------------------------------------------------
-static xub_StrLen ImplPatternLeftPos( const ByteString& rEditMask, xub_StrLen nCursorPos )
+static xub_StrLen ImplPatternLeftPos(const rtl::OString& rEditMask, xub_StrLen nCursorPos)
{
// Vorheriges Zeichen suchen, was kein Literal ist
xub_StrLen nNewPos = nCursorPos;
xub_StrLen nTempPos = nNewPos;
while ( nTempPos )
{
- if ( rEditMask.GetChar(nTempPos-1) != EDITMASK_LITERAL )
+ if ( rEditMask[nTempPos-1] != EDITMASK_LITERAL )
{
nNewPos = nTempPos-1;
break;
@@ -461,16 +461,16 @@ static xub_StrLen ImplPatternLeftPos( const ByteString& rEditMask, xub_StrLen nC
// -----------------------------------------------------------------------
-static xub_StrLen ImplPatternRightPos( const XubString& rStr, const ByteString& rEditMask,
+static xub_StrLen ImplPatternRightPos( const XubString& rStr, const rtl::OString& rEditMask,
sal_uInt16 nFormatFlags, sal_Bool bSameMask,
xub_StrLen nCursorPos )
{
// Naechstes Zeichen suchen, was kein Literal ist
xub_StrLen nNewPos = nCursorPos;
xub_StrLen nTempPos = nNewPos;
- while ( nTempPos < rEditMask.Len() )
+ while ( nTempPos < rEditMask.getLength() )
{
- if ( rEditMask.GetChar(nTempPos+1) != EDITMASK_LITERAL )
+ if ( rEditMask[nTempPos+1] != EDITMASK_LITERAL )
{
nNewPos = nTempPos+1;
break;
@@ -484,14 +484,14 @@ static xub_StrLen ImplPatternRightPos( const XubString& rStr, const ByteString&
// -----------------------------------------------------------------------
static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
- const ByteString& rEditMask,
+ const rtl::OString& rEditMask,
const XubString& rLiteralMask,
sal_Bool bStrictFormat,
sal_uInt16 nFormatFlags,
sal_Bool bSameMask,
sal_Bool& rbInKeyInput )
{
- if ( !rEditMask.Len() || !bStrictFormat )
+ if ( rEditMask.isEmpty() || !bStrictFormat )
return sal_False;
Selection aOldSel = pEdit->GetSelection();
@@ -533,8 +533,8 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
{
// Home ist Position des ersten nicht literalen Zeichens
nNewPos = 0;
- while ( (nNewPos < rEditMask.Len()) &&
- (rEditMask.GetChar(nNewPos) == EDITMASK_LITERAL) )
+ while ( (nNewPos < rEditMask.getLength()) &&
+ (rEditMask[nNewPos] == EDITMASK_LITERAL) )
nNewPos++;
// Home sollte nicht nach rechts wandern
if ( nCursorPos < nNewPos )
@@ -548,9 +548,9 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
else if ( nKeyCode == KEY_END )
{
// End ist die Position des letzten nicht literalen Zeichens
- nNewPos = rEditMask.Len();
+ nNewPos = rEditMask.getLength();
while ( nNewPos &&
- (rEditMask.GetChar(nNewPos-1) == EDITMASK_LITERAL) )
+ (rEditMask[nNewPos-1] == EDITMASK_LITERAL) )
nNewPos--;
// Hier nehmen wir Selectionsanfang als minimum, da falls durch
// Focus alles selektiert ist, ist eine kleine Position schon
@@ -601,7 +601,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
{
if ( bSameMask )
{
- if ( rEditMask.GetChar( nNewPos ) != EDITMASK_LITERAL )
+ if ( rEditMask[nNewPos] != EDITMASK_LITERAL )
aStr.Erase( nNewPos, 1 );
}
else
@@ -647,9 +647,9 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
aSel.Justify();
nNewPos = (xub_StrLen)aSel.Min();
- if ( nNewPos < rEditMask.Len() )
+ if ( nNewPos < rEditMask.getLength() )
{
- xub_Unicode cPattChar = ImplPatternChar( cChar, rEditMask.GetChar(nNewPos) );
+ xub_Unicode cPattChar = ImplPatternChar( cChar, rEditMask[nNewPos] );
if ( cPattChar )
cChar = cPattChar;
else
@@ -661,17 +661,17 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
// nicht dazu fuehren, das der Anwender dann da steht, wo
// er nicht stehen wollte.
if ( nNewPos &&
- (rEditMask.GetChar(nNewPos-1) != EDITMASK_LITERAL) &&
+ (rEditMask[nNewPos-1] != EDITMASK_LITERAL) &&
!aSel.Len() )
{
// Naechstes Zeichen suchen, was kein Literal ist
nTempPos = nNewPos;
- while ( nTempPos < rEditMask.Len() )
+ while ( nTempPos < rEditMask.getLength() )
{
- if ( rEditMask.GetChar(nTempPos) == EDITMASK_LITERAL )
+ if ( rEditMask[nTempPos] == EDITMASK_LITERAL )
{
// Gilt nur, wenn ein Literalzeichen vorhanden
- if ( (rEditMask.GetChar(nTempPos+1) != EDITMASK_LITERAL ) &&
+ if ( (rEditMask[nTempPos+1] != EDITMASK_LITERAL ) &&
ImplKommaPointCharEqual( cChar, rLiteralMask.GetChar(nTempPos) ) )
{
nTempPos++;
@@ -705,7 +705,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
while ( n && (n > nNewPos) )
{
if ( (aStr.GetChar( n-1 ) != ' ') &&
- ((n > rEditMask.Len()) || (rEditMask.GetChar(n-1) != EDITMASK_LITERAL)) )
+ ((n > rEditMask.getLength()) || (rEditMask[n-1] != EDITMASK_LITERAL)) )
break;
n--;
@@ -715,14 +715,14 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( aSel.Len() )
aStr.Erase( (xub_StrLen)aSel.Min(), (xub_StrLen)aSel.Len() );
- if ( aStr.Len() < rEditMask.Len() )
+ if ( aStr.Len() < rEditMask.getLength() )
{
// String evtl. noch bis Cursor-Position erweitern
if ( aStr.Len() < nNewPos )
aStr += rLiteralMask.Copy( aStr.Len(), nNewPos-aStr.Len() );
if ( nNewPos < aStr.Len() )
aStr.Insert( cChar, nNewPos );
- else if ( nNewPos < rEditMask.Len() )
+ else if ( nNewPos < rEditMask.getLength() )
aStr += cChar;
aStr = ImplPatternReformat( aStr, rEditMask, rLiteralMask, nFormatFlags );
}
@@ -740,7 +740,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( nNewPos < aStr.Len() )
aStr.SetChar( nNewPos, cChar );
- else if ( nNewPos < rEditMask.Len() )
+ else if ( nNewPos < rEditMask.getLength() )
aStr += cChar;
}
@@ -764,19 +764,19 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
// -----------------------------------------------------------------------
-void PatternFormatter::ImplSetMask( const ByteString& rEditMask,
- const XubString& rLiteralMask )
+void PatternFormatter::ImplSetMask(const rtl::OString& rEditMask,
+ const XubString& rLiteralMask)
{
- maEditMask = rEditMask;
+ m_aEditMask = rEditMask;
maLiteralMask = rLiteralMask;
mbSameMask = sal_True;
- if ( maEditMask.Len() != maLiteralMask.Len() )
+ if ( m_aEditMask.getLength() != maLiteralMask.Len() )
{
- if ( maEditMask.Len() < maLiteralMask.Len() )
- maLiteralMask.Erase( maEditMask.Len() );
+ if ( m_aEditMask.getLength() < maLiteralMask.Len() )
+ maLiteralMask.Erase(m_aEditMask.getLength());
else
- maLiteralMask.Expand( maEditMask.Len(), ' ' );
+ maLiteralMask.Expand(m_aEditMask.getLength(), ' ');
}
// StrictModus erlaubt nur Input-Mode, wenn als Maske nur
@@ -785,9 +785,9 @@ void PatternFormatter::ImplSetMask( const ByteString& rEditMask,
// nicht zugelassen sind
xub_StrLen i = 0;
sal_Char c = 0;
- while ( i < rEditMask.Len() )
+ while ( i < rEditMask.getLength() )
{
- sal_Char cTemp = rEditMask.GetChar( i );
+ sal_Char cTemp = rEditMask[i];
if ( cTemp != EDITMASK_LITERAL )
{
if ( (cTemp == EDITMASK_ALLCHAR) ||
@@ -830,7 +830,7 @@ PatternFormatter::PatternFormatter()
void PatternFormatter::ImplLoadRes( const ResId& rResId )
{
- ByteString aEditMask;
+ rtl::OString aEditMask;
XubString aLiteralMask;
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
@@ -841,7 +841,10 @@ void PatternFormatter::ImplLoadRes( const ResId& rResId )
SetStrictFormat( (sal_Bool)pMgr->ReadShort() );
if ( PATTERNFORMATTER_EDITMASK & nMask )
- aEditMask = ByteString( pMgr->ReadString(), RTL_TEXTENCODING_ASCII_US );
+ {
+ aEditMask = rtl::OUStringToOString(pMgr->ReadString(),
+ RTL_TEXTENCODING_ASCII_US);
+ }
if ( PATTERNFORMATTER_LITTERALMASK & nMask )
aLiteralMask = pMgr->ReadString();
@@ -859,7 +862,7 @@ PatternFormatter::~PatternFormatter()
// -----------------------------------------------------------------------
-void PatternFormatter::SetMask( const ByteString& rEditMask,
+void PatternFormatter::SetMask( const rtl::OString& rEditMask,
const XubString& rLiteralMask )
{
ImplSetMask( rEditMask, rLiteralMask );
@@ -885,7 +888,7 @@ XubString PatternFormatter::GetString() const
if ( !GetField() )
return ImplGetSVEmptyStr();
else
- return ImplPatternReformat( GetField()->GetText(), maEditMask, maLiteralMask, mnFormatFlags );
+ return ImplPatternReformat( GetField()->GetText(), m_aEditMask, maLiteralMask, mnFormatFlags );
}
// -----------------------------------------------------------------------
@@ -894,7 +897,7 @@ void PatternFormatter::Reformat()
{
if ( GetField() )
{
- ImplSetText( ImplPatternReformat( GetField()->GetText(), maEditMask, maLiteralMask, mnFormatFlags ) );
+ ImplSetText( ImplPatternReformat( GetField()->GetText(), m_aEditMask, maLiteralMask, mnFormatFlags ) );
if ( !mbSameMask && IsStrictFormat() && !GetField()->IsReadOnly() )
GetField()->SetInsertMode( sal_False );
}
@@ -3047,35 +3050,6 @@ Time TimeFormatter::GetTime() const
// -----------------------------------------------------------------------
-Time TimeFormatter::GetRealTime() const
-{
- Time aTime( 0, 0, 0 );
-
- if ( GetField() )
- {
- sal_Bool bAllowMailformed = ImplAllowMalformedInput();
- if ( !ImplTimeGetValue( GetField()->GetText(), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper(), !bAllowMailformed ) )
- if ( bAllowMailformed )
- aTime = GetInvalidTime();
- }
-
- return aTime;
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool TimeFormatter::IsTimeModified() const
-{
- if ( ImplGetEmptyFieldValue() )
- return !IsEmptyTime();
- else if ( GetTime() != maFieldTime )
- return sal_True;
- else
- return sal_False;
-}
-
-// -----------------------------------------------------------------------
-
void TimeFormatter::Reformat()
{
if ( !GetField() )
@@ -3320,26 +3294,6 @@ TimeBox::TimeBox( Window* pParent, WinBits nWinStyle ) :
// -----------------------------------------------------------------------
-TimeBox::TimeBox( Window* pParent, const ResId& rResId ) :
- ComboBox( WINDOW_TIMEBOX )
-{
- rResId.SetRT( RSC_TIMEBOX );
- WinBits nStyle = ImplInitRes( rResId );
- ComboBox::ImplInit( pParent, nStyle );
- SetField( this );
- SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, sal_False, sal_False ) );
- ComboBox::ImplLoadRes( rResId );
- ResMgr* pMgr = rResId.GetResMgr();
- if( pMgr )
- TimeFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *pMgr ) );
- Reformat();
-
- if ( !(nStyle & WB_HIDE) )
- Show();
-}
-
-// -----------------------------------------------------------------------
-
TimeBox::~TimeBox()
{
}
@@ -3411,58 +3365,4 @@ void TimeBox::ReformatAll()
SetUpdateMode( sal_True );
}
-// -----------------------------------------------------------------------
-
-void TimeBox::InsertTime( const Time& rTime, sal_uInt16 nPos )
-{
- Time aTime = rTime;
- if ( aTime > GetMax() )
- aTime = GetMax();
- else if ( aTime < GetMin() )
- aTime = GetMin();
-
- sal_Bool bSec = sal_False;
- sal_Bool b100Sec = sal_False;
- if ( GetFormat() == TIMEF_SEC )
- bSec = sal_True;
- if ( GetFormat() == TIMEF_100TH_SEC || GetFormat() == TIMEF_SEC_CS )
- bSec = b100Sec = sal_True;
- ComboBox::InsertEntry( ImplGetLocaleDataWrapper().getTime( aTime, bSec, b100Sec ), nPos );
-}
-
-// -----------------------------------------------------------------------
-
-void TimeBox::RemoveTime( const Time& rTime )
-{
- sal_Bool bSec = sal_False;
- sal_Bool b100Sec = sal_False;
- if ( GetFormat() == TIMEF_SEC )
- bSec = sal_True;
- if ( GetFormat() == TIMEF_100TH_SEC || TIMEF_SEC_CS )
- bSec = b100Sec = sal_True;
- ComboBox::RemoveEntry( ImplGetLocaleDataWrapper().getTime( rTime, bSec, b100Sec ) );
-}
-
-// -----------------------------------------------------------------------
-
-Time TimeBox::GetTime( sal_uInt16 nPos ) const
-{
- Time aTime( 0, 0, 0 );
- ImplTimeGetValue( ComboBox::GetEntry( nPos ), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper() );
- return aTime;
-}
-
-// -----------------------------------------------------------------------
-
-sal_uInt16 TimeBox::GetTimePos( const Time& rTime ) const
-{
- sal_Bool bSec = sal_False;
- sal_Bool b100Sec = sal_False;
- if ( GetFormat() == TIMEF_SEC )
- bSec = sal_True;
- if ( GetFormat() == TIMEF_100TH_SEC || TIMEF_SEC_CS )
- bSec = b100Sec = sal_True;
- return ComboBox::GetEntryPos( ImplGetLocaleDataWrapper().getTime( rTime, bSec, b100Sec ) );
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/quickselectionengine.cxx b/vcl/source/control/quickselectionengine.cxx
index 2d32393bf79a..ee479d27ab20 100644
--- a/vcl/source/control/quickselectionengine.cxx
+++ b/vcl/source/control/quickselectionengine.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -181,3 +182,5 @@ namespace vcl
//........................................................................
} // namespace vcl
//........................................................................
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 765907721ed6..7bdd0d3af0bf 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -1981,18 +1981,6 @@ TabPage* TabControl::GetTabPage( sal_uInt16 nPageId ) const
// -----------------------------------------------------------------------
-sal_uInt16 TabControl::GetTabPageResId( sal_uInt16 nPageId ) const
-{
- ImplTabItem* pItem = ImplGetItem( nPageId );
-
- if ( pItem )
- return pItem->mnTabPageResId;
- else
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
void TabControl::SetPageText( sal_uInt16 nPageId, const XubString& rText )
{
ImplTabItem* pItem = ImplGetItem( nPageId );
@@ -2059,16 +2047,6 @@ const XubString& TabControl::GetHelpText( sal_uInt16 nPageId ) const
// -----------------------------------------------------------------------
-void TabControl::SetHelpId( sal_uInt16 nPageId, const rtl::OString& rHelpId )
-{
- ImplTabItem* pItem = ImplGetItem( nPageId );
-
- if ( pItem )
- pItem->maHelpId = rHelpId;
-}
-
-// -----------------------------------------------------------------------
-
rtl::OString TabControl::GetHelpId( sal_uInt16 nPageId ) const
{
rtl::OString aRet;
@@ -2097,14 +2075,6 @@ void TabControl::SetPageImage( sal_uInt16 i_nPageId, const Image& i_rImage )
// -----------------------------------------------------------------------
-const Image* TabControl::GetPageImage( sal_uInt16 i_nPageId ) const
-{
- const ImplTabItem* pItem = ImplGetItem( i_nPageId );
- return pItem ? &pItem->maTabImage : NULL;
-}
-
-// -----------------------------------------------------------------------
-
Rectangle TabControl::GetCharacterBounds( sal_uInt16 nPageId, long nIndex ) const
{
Rectangle aRet;
diff --git a/vcl/source/control/throbber.cxx b/vcl/source/control/throbber.cxx
index a55fdb3eb379..4aa456c1ddcf 100644
--- a/vcl/source/control/throbber.cxx
+++ b/vcl/source/control/throbber.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -323,3 +324,5 @@ IMPL_LINK( Throbber, TimeOutHdl, void*, EMPTYARG )
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index eed5a9e1ac07..b6516fcc624b 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -1868,7 +1868,6 @@ const char* CffSubsetterContext::getGlyphName( int nGlyphIndex)
class Type1Emitter
{
public:
- explicit Type1Emitter( const char* pOutFileName, bool bPfbSubset = true);
explicit Type1Emitter( FILE* pOutFile, bool bPfbSubset = true);
/*virtual*/ ~Type1Emitter( void);
void setSubsetName( const char* );
@@ -1895,20 +1894,6 @@ public:
// --------------------------------------------------------------------
-Type1Emitter::Type1Emitter( const char* pPfbFileName, bool bPfbSubset)
-: mpFileOut( NULL)
-, mbCloseOutfile( true)
-, mnEECryptR( 55665) // default eexec seed, TODO: mnEECryptSeed
-, mpPtr( maBuffer)
-, mbPfbSubset( bPfbSubset)
-, mnHexLineCol( 0)
-{
- mpFileOut = fopen( pPfbFileName, "wb");
- maSubsetName[0] = '\0';
-}
-
-// --------------------------------------------------------------------
-
Type1Emitter::Type1Emitter( FILE* pOutFile, bool bPfbSubset)
: mpFileOut( pOutFile)
, mbCloseOutfile( false)
diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx
index da0d84cec089..7dcdc42e88f4 100644
--- a/vcl/source/fontsubset/gsub.cxx
+++ b/vcl/source/fontsubset/gsub.cxx
@@ -162,7 +162,7 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
}
}
- if( !aFeatureIndexList.size() )
+ if( aFeatureIndexList.empty() )
return true;
UshortList aLookupIndexList;
@@ -318,7 +318,7 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
}
// now apply the glyph substitutions that have been collected in this subtable
- if( aSubstVector.size() > 0 )
+ if( !aSubstVector.empty() )
{
GlyphSubstitution* pGSubstitution = new GlyphSubstitution;
pTTFile->pGSubstitution = (void*)pGSubstitution;
diff --git a/vcl/source/fontsubset/list.c b/vcl/source/fontsubset/list.c
index def5faa7b553..8b0b0f827a20 100644
--- a/vcl/source/fontsubset/list.c
+++ b/vcl/source/fontsubset/list.c
@@ -140,24 +140,6 @@ int listIsEmpty(list this)
return this->aCount == 0;
}
-int listFind(list this, void *el)
-{
- lnode *ptr;
- assert(this != 0);
-
- ptr = this->head;
-
- while (ptr) {
- if (ptr->value == el) {
- this->cptr = ptr;
- return 1;
- }
- ptr = ptr->next;
- }
-
- return 0;
-}
-
int listNext(list this)
{
return listSkipForward(this, 1);
@@ -201,21 +183,6 @@ int listToLast(list this)
return 0;
}
-int listPositionAt(list this, int n) /*- returns the actual position number */
-{
- int m = 0;
- assert(this != 0);
-
- this->cptr = this->head;
- while (n != 0) {
- if (this->cptr->next == 0) break;
- this->cptr = this->cptr->next;
- n--;
- m++;
- }
- return m;
-}
-
list listAppend(list this, void *el)
{
assert(this != 0);
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index 63d0010bd5d2..9dcbce01ffaf 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -100,7 +100,6 @@ Animation::Animation() :
{
DBG_CTOR( Animation, NULL );
maTimer.SetTimeoutHdl( LINK( this, Animation, ImplTimeoutHdl ) );
- mpViewList = new List;
}
// -----------------------------------------------------------------------
@@ -117,11 +116,10 @@ Animation::Animation( const Animation& rAnimation ) :
{
DBG_CTOR( Animation, NULL );
- for( long i = 0, nCount = rAnimation.maList.Count(); i < nCount; i++ )
- maList.Insert( new AnimationBitmap( *(AnimationBitmap*) rAnimation.maList.GetObject( i ) ), LIST_APPEND );
+ for( size_t i = 0, nCount = rAnimation.maList.size(); i < nCount; i++ )
+ maList.push_back( new AnimationBitmap( *rAnimation.maList[ i ] ) );
maTimer.SetTimeoutHdl( LINK( this, Animation, ImplTimeoutHdl ) );
- mpViewList = new List;
mnLoops = mbLoopTerminated ? 0 : mnLoopCount;
}
@@ -134,13 +132,11 @@ Animation::~Animation()
if( mbIsInAnimation )
Stop();
- for( void* pStepBmp = maList.First(); pStepBmp; pStepBmp = maList.Next() )
- delete (AnimationBitmap*) pStepBmp;
+ for( size_t i = 0, n = maList.size(); i < n; ++i )
+ delete maList[ i ];
- for( void* pView = mpViewList->First(); pView; pView = mpViewList->Next() )
- delete (ImplAnimView*) pView;
-
- delete mpViewList;
+ for( size_t i = 0, n = maViewList.size(); i < n; ++i )
+ delete maViewList[ i ];
}
// -----------------------------------------------------------------------
@@ -149,8 +145,8 @@ Animation& Animation::operator=( const Animation& rAnimation )
{
Clear();
- for( long i = 0, nCount = rAnimation.maList.Count(); i < nCount; i++ )
- maList.Insert( new AnimationBitmap( *(AnimationBitmap*) rAnimation.maList.GetObject( i ) ), LIST_APPEND );
+ for( size_t i = 0, nCount = rAnimation.maList.size(); i < nCount; i++ )
+ maList.push_back( new AnimationBitmap( *rAnimation.maList[ i ] ) );
maGlobalSize = rAnimation.maGlobalSize;
maBitmapEx = rAnimation.maBitmapEx;
@@ -168,20 +164,20 @@ Animation& Animation::operator=( const Animation& rAnimation )
sal_Bool Animation::operator==( const Animation& rAnimation ) const
{
- const sal_uLong nCount = maList.Count();
- sal_Bool bRet = sal_False;
+ const size_t nCount = maList.size();
+ sal_Bool bRet = sal_False;
- if( rAnimation.maList.Count() == nCount &&
- rAnimation.maBitmapEx == maBitmapEx &&
- rAnimation.maGlobalSize == maGlobalSize &&
- rAnimation.meCycleMode == meCycleMode )
+ if( rAnimation.maList.size() == nCount
+ && rAnimation.maBitmapEx == maBitmapEx
+ && rAnimation.maGlobalSize == maGlobalSize
+ && rAnimation.meCycleMode == meCycleMode
+ )
{
bRet = sal_True;
- for( sal_uLong n = 0; n < nCount; n++ )
+ for( size_t n = 0; n < nCount; n++ )
{
- if( ( *(AnimationBitmap*) maList.GetObject( n ) ) !=
- ( *(AnimationBitmap*) rAnimation.maList.GetObject( n ) ) )
+ if( ( *maList[ n ] ) != ( *rAnimation.maList[ n ] ) )
{
bRet = sal_False;
break;
@@ -194,29 +190,9 @@ sal_Bool Animation::operator==( const Animation& rAnimation ) const
// ------------------------------------------------------------------
-sal_Bool Animation::IsEqual( const Animation& rAnimation ) const
-{
- const sal_uLong nCount = maList.Count();
- sal_Bool bRet = sal_False;
-
- if( rAnimation.maList.Count() == nCount &&
- rAnimation.maBitmapEx.IsEqual( maBitmapEx ) &&
- rAnimation.maGlobalSize == maGlobalSize &&
- rAnimation.meCycleMode == meCycleMode )
- {
- for( sal_uLong n = 0; ( n < nCount ) && !bRet; n++ )
- if( ( (AnimationBitmap*) maList.GetObject( n ) )->IsEqual( *(AnimationBitmap*) rAnimation.maList.GetObject( n ) ) )
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-// ------------------------------------------------------------------
-
sal_Bool Animation::IsEmpty() const
{
- return( maBitmapEx.IsEmpty() && !maList.Count() );
+ return( maBitmapEx.IsEmpty() && maList.empty() );
}
// ------------------------------------------------------------------
@@ -228,13 +204,13 @@ void Animation::SetEmpty()
maGlobalSize = Size();
maBitmapEx.SetEmpty();
- for( void* pStepBmp = maList.First(); pStepBmp; pStepBmp = maList.Next() )
- delete (AnimationBitmap*) pStepBmp;
- maList.Clear();
+ for( size_t i = 0, n = maList.size(); i < n; ++i )
+ delete maList[ i ];
+ maList.clear();
- for( void* pView = mpViewList->First(); pView; pView = mpViewList->Next() )
- delete (ImplAnimView*) pView;
- mpViewList->Clear();
+ for( size_t i = 0, n = maViewList.size(); i < n; ++i )
+ delete maViewList[ i ];
+ maViewList.clear();
}
// -----------------------------------------------------------------------
@@ -256,11 +232,13 @@ sal_Bool Animation::IsTransparent() const
// ersetzt werden soll, muessen wir 'transparent' sein, um
// richtig dargestellt zu werden, da die Appl. aus Optimierungsgruenden
// kein Invalidate auf nicht-transp. Grafiken ausfuehren
- for( long i = 0, nCount = maList.Count(); i < nCount; i++ )
+ for( size_t i = 0, nCount = maList.size(); i < nCount; i++ )
{
- const AnimationBitmap* pAnimBmp = (AnimationBitmap*) maList.GetObject( i );
+ const AnimationBitmap* pAnimBmp = maList[ i ];
- if( DISPOSE_BACK == pAnimBmp->eDisposal && Rectangle( pAnimBmp->aPosPix, pAnimBmp->aSizePix ) != aRect )
+ if( DISPOSE_BACK == pAnimBmp->eDisposal
+ && Rectangle( pAnimBmp->aPosPix, pAnimBmp->aSizePix ) != aRect
+ )
{
bRet = sal_True;
break;
@@ -279,9 +257,9 @@ sal_uLong Animation::GetSizeBytes() const
{
sal_uLong nSizeBytes = GetBitmapEx().GetSizeBytes();
- for( long i = 0, nCount = maList.Count(); i < nCount; i++ )
+ for( size_t i = 0, nCount = maList.size(); i < nCount; i++ )
{
- const AnimationBitmap* pAnimBmp = (AnimationBitmap*) maList.GetObject( i );
+ const AnimationBitmap* pAnimBmp = maList[ i ];
nSizeBytes += pAnimBmp->aBmpEx.GetSizeBytes();
}
@@ -295,7 +273,7 @@ sal_uLong Animation::GetChecksum() const
SVBT32 aBT32;
sal_uInt32 nCrc = GetBitmapEx().GetChecksum();
- UInt32ToSVBT32( maList.Count(), aBT32 );
+ UInt32ToSVBT32( maList.size(), aBT32 );
nCrc = rtl_crc32( nCrc, aBT32, 4 );
UInt32ToSVBT32( maGlobalSize.Width(), aBT32 );
@@ -307,9 +285,9 @@ sal_uLong Animation::GetChecksum() const
UInt32ToSVBT32( (long) meCycleMode, aBT32 );
nCrc = rtl_crc32( nCrc, aBT32, 4 );
- for( long i = 0, nCount = maList.Count(); i < nCount; i++ )
+ for( size_t i = 0, nCount = maList.size(); i < nCount; i++ )
{
- UInt32ToSVBT32( ( (AnimationBitmap*) maList.GetObject( i ) )->GetChecksum(), aBT32 );
+ UInt32ToSVBT32( maList[ i ]->GetChecksum(), aBT32 );
nCrc = rtl_crc32( nCrc, aBT32, 4 );
}
@@ -331,16 +309,19 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size&
{
sal_Bool bRet = sal_False;
- if( maList.Count() )
+ if( !maList.empty() )
{
- if( ( pOut->GetOutDevType() == OUTDEV_WINDOW ) && !mbLoopTerminated &&
- ( ANIMATION_TIMEOUT_ON_CLICK != ( (AnimationBitmap*) maList.GetObject( mnPos ) )->nWait ) )
+ if( ( pOut->GetOutDevType() == OUTDEV_WINDOW )
+ && !mbLoopTerminated
+ && ( ANIMATION_TIMEOUT_ON_CLICK != maList[ mnPos ]->nWait )
+ )
{
ImplAnimView* pView;
ImplAnimView* pMatch = NULL;
- for( pView = (ImplAnimView*) mpViewList->First(); pView; pView = (ImplAnimView*) mpViewList->Next() )
+ for( size_t i = 0; i < maViewList.size(); ++i )
{
+ pView = maViewList[ i ];
if( pView->ImplMatches( pOut, nExtraData ) )
{
if( pView->ImplGetOutPos() == rDestPt &&
@@ -351,7 +332,8 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size&
}
else
{
- delete (ImplAnimView*) mpViewList->Remove( pView );
+ delete maViewList[ i ];
+ maViewList.erase( maViewList.begin() + i );
pView = NULL;
}
@@ -359,7 +341,7 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size&
}
}
- if( !mpViewList->Count() )
+ if( maViewList.empty() )
{
maTimer.Stop();
mbIsInAnimation = sal_False;
@@ -367,11 +349,11 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size&
}
if( !pMatch )
- mpViewList->Insert( new ImplAnimView( this, pOut, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev ), LIST_APPEND );
+ maViewList.push_back( new ImplAnimView( this, pOut, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev ) );
if( !mbIsInAnimation )
{
- ImplRestartTimer( ( (AnimationBitmap*) maList.GetObject( mnPos ) )->nWait );
+ ImplRestartTimer( maList[ mnPos ]->nWait );
mbIsInAnimation = sal_True;
}
}
@@ -388,20 +370,21 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size&
void Animation::Stop( OutputDevice* pOut, long nExtraData )
{
- ImplAnimView* pView = (ImplAnimView*) mpViewList->First();
-
- while( pView )
+ for( size_t i = 0; i < maViewList.size(); )
{
+
+
+ ImplAnimView* pView = maViewList[ i ];
if( pView->ImplMatches( pOut, nExtraData ) )
{
- delete (ImplAnimView*) mpViewList->Remove( pView );
- pView = (ImplAnimView*) mpViewList->GetCurObject();
+ delete pView;
+ maViewList.erase( maViewList.begin() + i );
}
else
- pView = (ImplAnimView*) mpViewList->Next();
+ i++;
}
- if( !mpViewList->Count() )
+ if( maViewList.empty() )
{
maTimer.Stop();
mbIsInAnimation = sal_False;
@@ -419,19 +402,21 @@ void Animation::Draw( OutputDevice* pOut, const Point& rDestPt ) const
void Animation::Draw( OutputDevice* pOut, const Point& rDestPt, const Size& rDestSz ) const
{
- const sal_uLong nCount = maList.Count();
+ const size_t nCount = maList.size();
if( nCount )
{
- AnimationBitmap* pObj = (AnimationBitmap*) maList.GetObject( Min( mnPos, (long) nCount - 1L ) );
+ AnimationBitmap* pObj = maList[ Min( mnPos, nCount - 1 ) ];
- if( pOut->GetConnectMetaFile() || ( pOut->GetOutDevType() == OUTDEV_PRINTER ) )
- ( (AnimationBitmap*) maList.GetObject( 0 ) )->aBmpEx.Draw( pOut, rDestPt, rDestSz );
+ if( pOut->GetConnectMetaFile()
+ || ( pOut->GetOutDevType() == OUTDEV_PRINTER )
+ )
+ maList[ 0 ]->aBmpEx.Draw( pOut, rDestPt, rDestSz );
else if( ANIMATION_TIMEOUT_ON_CLICK == pObj->nWait )
pObj->aBmpEx.Draw( pOut, rDestPt, rDestSz );
else
{
- const sal_uLong nOldPos = mnPos;
+ const size_t nOldPos = mnPos;
( (Animation*) this )->mnPos = mbLoopTerminated ? ( nCount - 1UL ) : mnPos;
delete new ImplAnimView( (Animation*) this, pOut, rDestPt, rDestSz, 0 );
( (Animation*) this )->mnPos = nOldPos;
@@ -448,35 +433,38 @@ void Animation::ImplRestartTimer( sal_uLong nTimeout )
}
// -----------------------------------------------------------------------
+typedef ::std::vector< AInfo* > AInfoList_impl;
IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
{
- const sal_uLong nAnimCount = maList.Count();
+ const size_t nAnimCount = maList.size();
+ AInfoList_impl aAInfoList;
if( nAnimCount )
{
ImplAnimView* pView;
- sal_Bool bGlobalPause = sal_True;
+ sal_Bool bGlobalPause = sal_True;
if( maNotifyLink.IsSet() )
{
AInfo* pAInfo;
// create AInfo-List
- for( pView = (ImplAnimView*) mpViewList->First(); pView; pView = (ImplAnimView*) mpViewList->Next() )
- maAInfoList.Insert( pView->ImplCreateAInfo() );
+ for( size_t i = 0, n = maViewList.size(); i < n; ++i )
+ aAInfoList.push_back( maViewList[ i ]->ImplCreateAInfo() );
maNotifyLink.Call( this );
// set view state from AInfo structure
- for( pAInfo = (AInfo*) maAInfoList.First(); pAInfo; pAInfo = (AInfo*) maAInfoList.Next() )
+ for( size_t i = 0, n = aAInfoList.size(); i < n; ++i )
{
+ pAInfo = aAInfoList[ i ];
if( !pAInfo->pViewData )
{
pView = new ImplAnimView( this, pAInfo->pOutDev,
pAInfo->aStartOrg, pAInfo->aStartSize, pAInfo->nExtraData );
- mpViewList->Insert( pView, LIST_APPEND );
+ maViewList.push_back( pView );
}
else
pView = (ImplAnimView*) pAInfo->pViewData;
@@ -486,18 +474,18 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
}
// delete AInfo structures
- for( pAInfo = (AInfo*) maAInfoList.First(); pAInfo; pAInfo = (AInfo*) maAInfoList.Next() )
- delete (AInfo*) pAInfo;
- maAInfoList.Clear();
+ for( size_t i = 0, n = aAInfoList.size(); i < n; ++i )
+ delete aAInfoList[ i ];
+ aAInfoList.clear();
// delete all unmarked views and reset marked state
- pView = (ImplAnimView*) mpViewList->First();
- while( pView )
+ for( size_t i = 0; i < maViewList.size(); )
{
+ pView = maViewList[ i ];
if( !pView->ImplIsMarked() )
{
- delete (ImplAnimView*) mpViewList->Remove( pView );
- pView = (ImplAnimView*) mpViewList->GetCurObject();
+ delete pView;
+ maViewList.erase( maViewList.begin() + i );
}
else
{
@@ -505,20 +493,20 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
bGlobalPause = sal_False;
pView->ImplSetMarked( sal_False );
- pView = (ImplAnimView*) mpViewList->Next();
+ i++;
}
}
}
else
bGlobalPause = sal_False;
- if( !mpViewList->Count() )
+ if( maViewList.empty() )
Stop();
else if( bGlobalPause )
ImplRestartTimer( 10 );
else
{
- AnimationBitmap* pStepBmp = (AnimationBitmap*) maList.GetObject( ++mnPos );
+ AnimationBitmap* pStepBmp = (++mnPos < maList.size()) ? maList[ mnPos ] : NULL;
if( !pStepBmp )
{
@@ -527,7 +515,7 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
Stop();
mbLoopTerminated = sal_True;
mnPos = nAnimCount - 1UL;
- maBitmapEx = ( (AnimationBitmap*) maList.GetObject( mnPos ) )->aBmpEx;
+ maBitmapEx = maList[ mnPos ]->aBmpEx;
return 0L;
}
else
@@ -536,7 +524,7 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
mnLoops--;
mnPos = 0;
- pStepBmp = (AnimationBitmap*) maList.GetObject( mnPos );
+ pStepBmp = maList[ mnPos ];
}
}
@@ -544,22 +532,22 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
// marked; in this case remove view, because area of output
// lies out of display area of window; mark state is
// set from view itself
- pView = (ImplAnimView*) mpViewList->First();
- while( pView )
+ for( size_t i = 0; i < maViewList.size(); )
{
+ pView = maViewList[ i ];
pView->ImplDraw( mnPos );
if( pView->ImplIsMarked() )
{
- delete (ImplAnimView*) mpViewList->Remove( pView );
- pView = (ImplAnimView*) mpViewList->GetCurObject();
+ delete pView;
+ maViewList.erase( maViewList.begin() + i );
}
else
- pView = (ImplAnimView*) mpViewList->Next();
+ i++;
}
// stop or restart timer
- if( !mpViewList->Count() )
+ if( maViewList.empty() )
Stop();
else
ImplRestartTimer( pStepBmp->nWait );
@@ -583,10 +571,10 @@ sal_Bool Animation::Insert( const AnimationBitmap& rStepBmp )
Rectangle aGlobalRect( aPoint, maGlobalSize );
maGlobalSize = aGlobalRect.Union( Rectangle( rStepBmp.aPosPix, rStepBmp.aSizePix ) ).GetSize();
- maList.Insert( new AnimationBitmap( rStepBmp ), LIST_APPEND );
+ maList.push_back( new AnimationBitmap( rStepBmp ) );
// zunaechst nehmen wir die erste BitmapEx als Ersatz-BitmapEx
- if( maList.Count() == 1 )
+ if( maList.size() == 1 )
maBitmapEx = rStepBmp.aBmpEx;
bRet = sal_True;
@@ -599,24 +587,33 @@ sal_Bool Animation::Insert( const AnimationBitmap& rStepBmp )
const AnimationBitmap& Animation::Get( sal_uInt16 nAnimation ) const
{
- DBG_ASSERT( ( nAnimation < maList.Count() ), "No object at this position" );
- return *(AnimationBitmap*) maList.GetObject( nAnimation );
+ DBG_ASSERT( ( nAnimation < maList.size() ), "No object at this position" );
+ return *maList[ nAnimation ];
}
// -----------------------------------------------------------------------
void Animation::Replace( const AnimationBitmap& rNewAnimationBitmap, sal_uInt16 nAnimation )
{
- DBG_ASSERT( ( nAnimation < maList.Count() ), "No object at this position" );
+ DBG_ASSERT( ( nAnimation < maList.size() ), "No object at this position" );
- delete (AnimationBitmap*) maList.Replace( new AnimationBitmap( rNewAnimationBitmap ), nAnimation );
+ delete maList[ nAnimation ];
+ maList[ nAnimation ] = new AnimationBitmap( rNewAnimationBitmap );
// Falls wir an erster Stelle einfuegen,
// muessen wir natuerlich auch,
// auch die Ersatzdarstellungs-BitmapEx
// aktualisieren;
- if ( ( !nAnimation && ( !mbLoopTerminated || ( maList.Count() == 1 ) ) ) ||
- ( ( nAnimation == maList.Count() - 1 ) && mbLoopTerminated ) )
+ if ( ( !nAnimation
+ && ( !mbLoopTerminated
+ || ( maList.size() == 1 )
+ )
+ )
+ ||
+ ( ( nAnimation == maList.size() - 1 )
+ && mbLoopTerminated
+ )
+ )
{
maBitmapEx = rNewAnimationBitmap.aBmpEx;
}
@@ -646,12 +643,12 @@ sal_Bool Animation::Convert( BmpConversion eConversion )
sal_Bool bRet;
- if( !IsInAnimation() && maList.Count() )
+ if( !IsInAnimation() && !maList.empty() )
{
bRet = sal_True;
- for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
- bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Convert( eConversion );
+ for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i )
+ bRet = maList[ i ]->aBmpEx.Convert( eConversion );
maBitmapEx.Convert( eConversion );
}
@@ -669,12 +666,12 @@ sal_Bool Animation::ReduceColors( sal_uInt16 nNewColorCount, BmpReduce eReduce )
sal_Bool bRet;
- if( !IsInAnimation() && maList.Count() )
+ if( !IsInAnimation() && !maList.empty() )
{
bRet = sal_True;
- for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
- bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.ReduceColors( nNewColorCount, eReduce );
+ for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i )
+ bRet = maList[ i ]->aBmpEx.ReduceColors( nNewColorCount, eReduce );
maBitmapEx.ReduceColors( nNewColorCount, eReduce );
}
@@ -692,12 +689,12 @@ sal_Bool Animation::Invert()
sal_Bool bRet;
- if( !IsInAnimation() && maList.Count() )
+ if( !IsInAnimation() && !maList.empty() )
{
bRet = sal_True;
- for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
- bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Invert();
+ for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i )
+ bRet = maList[ i ]->aBmpEx.Invert();
maBitmapEx.Invert();
}
@@ -715,16 +712,15 @@ sal_Bool Animation::Mirror( sal_uLong nMirrorFlags )
sal_Bool bRet;
- if( !IsInAnimation() && maList.Count() )
+ if( !IsInAnimation() && !maList.empty() )
{
bRet = sal_True;
if( nMirrorFlags )
{
- for( AnimationBitmap* pStepBmp = (AnimationBitmap*) maList.First();
- pStepBmp && bRet;
- pStepBmp = (AnimationBitmap*) maList.Next() )
+ for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i )
{
+ AnimationBitmap* pStepBmp = maList[ i ];
if( ( bRet = pStepBmp->aBmpEx.Mirror( nMirrorFlags ) ) == sal_True )
{
if( nMirrorFlags & BMP_MIRROR_HORZ )
@@ -746,29 +742,6 @@ sal_Bool Animation::Mirror( sal_uLong nMirrorFlags )
// -----------------------------------------------------------------------
-sal_Bool Animation::Dither( sal_uLong nDitherFlags )
-{
- DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
-
- sal_Bool bRet;
-
- if( !IsInAnimation() && maList.Count() )
- {
- bRet = sal_True;
-
- for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
- bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Dither( nDitherFlags );
-
- maBitmapEx.Dither( nDitherFlags );
- }
- else
- bRet = sal_False;
-
- return bRet;
-}
-
-// -----------------------------------------------------------------------
-
sal_Bool Animation::Adjust( short nLuminancePercent, short nContrastPercent,
short nChannelRPercent, short nChannelGPercent, short nChannelBPercent,
double fGamma, sal_Bool bInvert )
@@ -777,15 +750,19 @@ sal_Bool Animation::Adjust( short nLuminancePercent, short nContrastPercent,
sal_Bool bRet;
- if( !IsInAnimation() && maList.Count() )
+ if( !IsInAnimation() && !maList.empty() )
{
bRet = sal_True;
- for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
+ for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i )
{
- bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Adjust( nLuminancePercent, nContrastPercent,
- nChannelRPercent, nChannelGPercent, nChannelBPercent,
- fGamma, bInvert );
+ bRet = maList[ i ]->aBmpEx.Adjust( nLuminancePercent,
+ nContrastPercent,
+ nChannelRPercent,
+ nChannelGPercent,
+ nChannelBPercent,
+ fGamma, bInvert
+ );
}
maBitmapEx.Adjust( nLuminancePercent, nContrastPercent,
@@ -806,12 +783,12 @@ sal_Bool Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterPara
sal_Bool bRet;
- if( !IsInAnimation() && maList.Count() )
+ if( !IsInAnimation() && !maList.empty() )
{
bRet = sal_True;
- for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
- bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Filter( eFilter, pFilterParam, pProgress );
+ for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i )
+ bRet = maList[ i ]->aBmpEx.Filter( eFilter, pFilterParam, pProgress );
maBitmapEx.Filter( eFilter, pFilterParam, pProgress );
}
@@ -830,7 +807,7 @@ SvStream& operator<<( SvStream& rOStm, const Animation& rAnimation )
if( nCount )
{
const ByteString aDummyStr;
- const sal_uInt32 nDummy32 = 0UL;
+ const sal_uInt32 nDummy32 = 0UL;
// Falls keine BitmapEx gesetzt wurde, schreiben wir
// einfach die erste Bitmap der Animation
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index 21f977a45396..193c066b1d98 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -41,6 +41,7 @@
#include <vcl/lineinfo.hxx>
#include <vcl/salbtype.hxx>
#include <vcl/cvtsvm.hxx>
+#include <rtl/strbuf.hxx>
// -----------
// - Defines -
@@ -2431,10 +2432,11 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
#ifdef DBG_UTIL
default:
{
- ByteString aStr( "Missing implementation for Action#: " );
- aStr += ByteString::CreateFromInt32( pAction->GetType() );
- aStr += '!';
- OSL_FAIL( aStr.GetBuffer() );
+ rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM(
+ "Missing implementation for Action#: "));
+ aStr.append(static_cast<sal_Int32>(pAction->GetType()));
+ aStr.append('!');
+ OSL_FAIL(aStr.getStr());
}
break;
#endif
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 984386028cdc..30740176d676 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -254,6 +254,7 @@ size_t ImpLabelList::ImplGetLabelPos( const String& rLabelName )
// ---------------
GDIMetaFile::GDIMetaFile() :
+ nCurrentActionElement( 0 ),
aPrefSize ( 1, 1 ),
pPrev ( NULL ),
pNext ( NULL ),
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index eb22d31937df..8fa11e969aa8 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -662,13 +662,6 @@ void Graphic::ResetAnimationLoopCount()
// ------------------------------------------------------------------------
-List* Graphic::GetAnimationInfoList() const
-{
- return mpImpGraphic->ImplGetAnimationInfoList();
-}
-
-// ------------------------------------------------------------------------
-
GraphicReader* Graphic::GetContext()
{
return mpImpGraphic->ImplGetContext();
diff --git a/vcl/source/gdi/graphictools.cxx b/vcl/source/gdi/graphictools.cxx
index 2e20a3639790..251261d0943e 100644
--- a/vcl/source/gdi/graphictools.cxx
+++ b/vcl/source/gdi/graphictools.cxx
@@ -675,26 +675,6 @@ void SvtGraphicFill::setHatchColor( Color aHatchColor )
maHatchColor = aHatchColor;
}
-void SvtGraphicFill::setGradientType( GradientType aGradType )
-{
- maGradientType = aGradType;
-}
-
-void SvtGraphicFill::setGradient1stColor( Color aColor )
-{
- maGradient1stColor = aColor;
-}
-
-void SvtGraphicFill::setGradient2ndColor( Color aColor )
-{
- maGradient2ndColor = aColor;
-}
-
-void SvtGraphicFill::setGradientStepCount( int aCount )
-{
- maGradientStepCount = aCount;
-}
-
void SvtGraphicFill::setGraphic( const Graphic& rGraphic )
{
maFillGraphic = rGraphic;
diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx
index 18f927e5b0ff..f587bc29d2e9 100644
--- a/vcl/source/gdi/image.cxx
+++ b/vcl/source/gdi/image.cxx
@@ -276,45 +276,6 @@ uno::Reference< graphic::XGraphic > Image::GetXGraphic() const
// -----------------------------------------------------------------------
-void Image::Invert()
-{
- BitmapEx aInvertedBmp( GetBitmapEx() );
- aInvertedBmp.Invert();
- *this = aInvertedBmp;
-}
-
-// -----------------------------------------------------------------------
-
-void Image::GetColorTransformArrays( ImageColorTransform eColorTransform,
- Color*& rpSrcColor, Color*& rpDstColor, sal_uLong& rColorCount )
-{
- if( IMAGECOLORTRANSFORM_HIGHCONTRAST == eColorTransform )
- {
- rpSrcColor = new Color[ 4 ];
- rpDstColor = new Color[ 4 ];
- rColorCount = 4;
-
- rpSrcColor[ 0 ] = Color( COL_BLACK );
- rpDstColor[ 0 ] = Color( COL_WHITE );
-
- rpSrcColor[ 1 ] = Color( COL_WHITE );
- rpDstColor[ 1 ] = Color( COL_BLACK );
-
- rpSrcColor[ 2 ] = Color( COL_BLUE );
- rpDstColor[ 2 ] = Color( COL_WHITE );
-
- rpSrcColor[ 3 ] = Color( COL_LIGHTBLUE );
- rpDstColor[ 3 ] = Color( COL_WHITE );
- }
- else
- {
- rpSrcColor = rpDstColor = NULL;
- rColorCount = 0;
- }
-}
-
-// -----------------------------------------------------------------------
-
Image& Image::operator=( const Image& rImage )
{
DBG_CHKTHIS( Image, NULL );
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 9d995f361329..bd457f3fda22 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -928,13 +928,6 @@ void ImpGraphic::ImplResetAnimationLoopCount()
// ------------------------------------------------------------------------
-List* ImpGraphic::ImplGetAnimationInfoList() const
-{
- return( mpAnimation ? mpAnimation->GetAInfoList() : NULL );
-}
-
-// ------------------------------------------------------------------------
-
GraphicReader* ImpGraphic::ImplGetContext()
{
return mpContext;
diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk
deleted file mode 100755
index e124dc343eba..000000000000
--- a/vcl/source/gdi/makefile.mk
+++ /dev/null
@@ -1,127 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=vcl
-TARGET=gdi
-
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-.INCLUDE : $(PRJ)$/util$/makefile2.pmk
-
-.IF "$(COM)"=="ICC"
-CDEFS+=-D_STD_NO_NAMESPACE -D_VOS_NO_NAMESPACE -D_UNO_NO_NAMESPACE
-.ENDIF
-.IF "$(ENABLE_GRAPHITE)" == "TRUE"
-CDEFS+=-DENABLE_GRAPHITE
-.IF "$(SYSTEM_GRAPHITE)" != "YES"
-CDEFS+=-DGR2_STATIC
-.ENDIF
-.ENDIF
-
-# --- Files --------------------------------------------------------
-
-EXCEPTIONSFILES= $(SLO)$/salmisc.obj \
- $(SLO)$/animate.obj \
- $(SLO)$/base14.obj \
- $(SLO)$/bitmap.obj \
- $(SLO)$/bitmap2.obj \
- $(SLO)$/bitmapex.obj \
- $(SLO)$/bmpconv.obj \
- $(SLO)$/configsettings.obj \
- $(SLO)$/cvtgrf.obj \
- $(SLO)$/cvtsvm.obj \
- $(SLO)$/gdimtf.obj \
- $(SLO)$/gfxlink.obj \
- $(SLO)$/graph.obj \
- $(SLO)$/graphictools.obj \
- $(SLO)$/image.obj \
- $(SLO)$/imagerepository.obj \
- $(SLO)$/impanmvw.obj \
- $(SLO)$/impgraph.obj \
- $(SLO)$/impimage.obj \
- $(SLO)$/impimagetree.obj \
- $(SLO)$/impvect.obj \
- $(SLO)$/jobset.obj \
- $(SLO)$/lineinfo.obj \
- $(SLO)$/metaact.obj \
- $(SLO)$/metric.obj \
- $(SLO)$/oldprintadaptor.obj \
- $(SLO)$/outdev.obj \
- $(SLO)$/outdev2.obj \
- $(SLO)$/outdev3.obj \
- $(SLO)$/outdev4.obj \
- $(SLO)$/outdev5.obj \
- $(SLO)$/outdev6.obj \
- $(SLO)$/outdevnative.obj \
- $(SLO)$/outmap.obj \
- $(SLO)$/pdfextoutdevdata.obj \
- $(SLO)$/pdffontcache.obj\
- $(SLO)$/pdfwriter.obj \
- $(SLO)$/pdfwriter_impl.obj \
- $(SLO)$/pdfwriter_impl2.obj \
- $(SLO)$/pngread.obj \
- $(SLO)$/pngwrite.obj \
- $(SLO)$/print.obj \
- $(SLO)$/print2.obj \
- $(SLO)$/print3.obj \
- $(SLO)$/rendergraphic.obj \
- $(SLO)$/rendergraphicrasterizer.obj \
- $(SLO)$/salgdilayout.obj \
- $(SLO)$/sallayout.obj \
- $(SLO)$/salnativewidgets-none.obj \
- $(SLO)$/svgread.obj \
- $(SLO)$/textlayout.obj \
- $(SLO)$/virdev.obj \
- $(SLO)$/wall.obj
-
-SLOFILES= $(EXCEPTIONSFILES) \
- $(SLO)$/bitmap3.obj \
- $(SLO)$/bitmap4.obj \
- $(SLO)$/alpha.obj \
- $(SLO)$/bmpacc.obj \
- $(SLO)$/bmpacc2.obj \
- $(SLO)$/bmpacc3.obj \
- $(SLO)$/bmpfast.obj \
- $(SLO)$/font.obj \
- $(SLO)$/gradient.obj \
- $(SLO)$/hatch.obj \
- $(SLO)$/impbmp.obj \
- $(SLO)$/mapmod.obj \
- $(SLO)$/octree.obj \
- $(SLO)$/regband.obj \
- $(SLO)$/region.obj \
- $(SLO)$/extoutdevdata.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 2ffa3c68e4f7..32c4a589f54d 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -4409,4 +4409,4 @@ void MetaRenderGraphicAction::Read( SvStream& rIStm, ImplMetaReadData* )
rIStm >> maRenderGraphic >> maPoint >> maSize >> mfRotateAngle >> mfShearAngleX >> mfShearAngleY;
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index c1fd5a8c6ca5..0569de5e3464 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2050,3 +2051,5 @@ void PDFWriterImpl::writeG4Stream( BitmapReadAccess* i_pBitmap )
rtl_freeMemory( pFirstRefLine );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 4c9461fbcb97..440da9c5bb56 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -667,14 +667,6 @@ Printer::Printer()
// -----------------------------------------------------------------------
-Printer::Printer( const Window* pWindow )
-{
- ImplInitData();
- ImplInitDisplay( pWindow );
-}
-
-// -----------------------------------------------------------------------
-
Printer::Printer( const JobSetup& rJobSetup ) :
maJobSetup( rJobSetup )
{
@@ -1336,13 +1328,6 @@ const PaperInfo& Printer::GetPaperInfo( int nPaper ) const
// -----------------------------------------------------------------------
-DuplexMode Printer::GetDuplexMode() const
-{
- return maJobSetup.ImplGetConstData()->meDuplexMode;
-}
-
-// -----------------------------------------------------------------------
-
sal_Bool Printer::SetDuplexMode( DuplexMode eDuplex )
{
if ( mbInPrintPage )
@@ -1455,25 +1440,6 @@ sal_uLong Printer::ImplSalPrinterErrorCodeToVCL( sal_uLong nError )
// -----------------------------------------------------------------------
-void Printer::ImplEndPrint()
-{
- mbPrinting = sal_False;
- mnCurPrintPage = 0;
- maJobName.Erase();
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( Printer, ImplDestroyPrinterAsync, void*, pSalPrinter )
-{
- SalPrinter* pPrinter = (SalPrinter*)pSalPrinter;
- ImplSVData* pSVData = ImplGetSVData();
- pSVData->mpDefInst->DestroyPrinter( pPrinter );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
sal_Bool Printer::EndJob()
{
sal_Bool bRet = sal_False;
@@ -1510,38 +1476,6 @@ sal_Bool Printer::EndJob()
// -----------------------------------------------------------------------
-sal_Bool Printer::AbortJob()
-{
- // Wenn wir einen Queue-Printer haben, kann man diesen noch mit
- // AbortJob() abbrechen, solange dieser noch am Drucken ist
- if ( !IsJobActive() && !IsPrinting() )
- return sal_False;
-
- mbJobActive = sal_False;
- mbInPrintPage = sal_False;
- mpJobGraphics = NULL;
-
- if ( mpPrinter )
- {
- mbPrinting = sal_False;
- mnCurPage = 0;
- mnCurPrintPage = 0;
- maJobName.Erase();
-
- ImplReleaseGraphics();
- mbDevOutput = sal_False;
- mpPrinter->AbortJob();
- Application::PostUserEvent( LINK( this, Printer, ImplDestroyPrinterAsync ), mpPrinter );
- mpPrinter = NULL;
-
- return sal_True;
- }
-
- return sal_False;
-}
-
-// -----------------------------------------------------------------------
-
void Printer::ImplStartPage()
{
if ( !IsJobActive() )
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index 42ef64a48289..2001968c60e8 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -1580,47 +1580,4 @@ void Printer::DrawGradientEx( OutputDevice* pOut, const Rectangle& rRect, const
pOut->DrawGradient( rRect, rGradient );
}
-// -----------------------------------------------------------------------------
-
-void Printer::DrawGradientEx( OutputDevice* pOut, const PolyPolygon& rPolyPoly, const Gradient& rGradient )
-{
- const PrinterOptions& rPrinterOptions = GetPrinterOptions();
-
- if( rPrinterOptions.IsReduceGradients() )
- {
- if( PRINTER_GRADIENT_STRIPES == rPrinterOptions.GetReducedGradientMode() )
- {
- if( !rGradient.GetSteps() || ( rGradient.GetSteps() > rPrinterOptions.GetReducedGradientStepCount() ) )
- {
- Gradient aNewGradient( rGradient );
-
- aNewGradient.SetSteps( rPrinterOptions.GetReducedGradientStepCount() );
- pOut->DrawGradient( rPolyPoly, aNewGradient );
- }
- else
- pOut->DrawGradient( rPolyPoly, rGradient );
- }
- else
- {
- const Color& rStartColor = rGradient.GetStartColor();
- const Color& rEndColor = rGradient.GetEndColor();
- const long nR = ( ( (long) rStartColor.GetRed() * rGradient.GetStartIntensity() ) / 100L +
- ( (long) rEndColor.GetRed() * rGradient.GetEndIntensity() ) / 100L ) >> 1;
- const long nG = ( ( (long) rStartColor.GetGreen() * rGradient.GetStartIntensity() ) / 100L +
- ( (long) rEndColor.GetGreen() * rGradient.GetEndIntensity() ) / 100L ) >> 1;
- const long nB = ( ( (long) rStartColor.GetBlue() * rGradient.GetStartIntensity() ) / 100L +
- ( (long) rEndColor.GetBlue() * rGradient.GetEndIntensity() ) / 100L ) >> 1;
- const Color aColor( (sal_uInt8) nR, (sal_uInt8) nG, (sal_uInt8) nB );
-
- pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
- pOut->SetLineColor( aColor );
- pOut->SetFillColor( aColor );
- pOut->DrawPolyPolygon( rPolyPoly );
- pOut->Pop();
- }
- }
- else
- pOut->DrawGradient( rPolyPoly, rGradient );
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 61a40af43bdd..dfe5bfb2aa73 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -250,7 +250,7 @@ static rtl::OUString queryFile( Printer* pPrinter )
// add arbitrary files
xFilterMgr->appendFilter( String( VclResId( SV_STDTEXT_ALLFILETYPES ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.*" ) ) );
}
- catch( lang::IllegalArgumentException )
+ catch (const lang::IllegalArgumentException&)
{
DBG_ERRORFILE( "caught IllegalArgumentException when registering filter\n" );
}
@@ -460,7 +460,7 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr
makeAny( sal_True ) );
}
}
- catch( std::bad_alloc& )
+ catch (const std::bad_alloc&)
{
}
}
diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx
index 3992b774630d..e4c1a3a7c4f7 100644
--- a/vcl/source/gdi/region.cxx
+++ b/vcl/source/gdi/region.cxx
@@ -382,34 +382,6 @@ const char* ImplDbgTestRegion( const void* pObj )
return NULL;
}
-void TraceBands (const ImplRegionBand* pFirstBand)
-{
- int nBandIndex (0);
- const ImplRegionBand* pBand = pFirstBand;
- while (pBand != NULL)
- {
- OSL_TRACE(" band %d %d->%d : ", nBandIndex++,
- pBand->mnYTop, pBand->mnYBottom);
-
- ImplRegionBandPoint* pPoint = pBand->mpFirstBandPoint;
- while (pPoint != NULL)
- {
- OSL_TRACE(" %d ", pPoint->mnX);
- pPoint = pPoint->mpNextBandPoint;
- }
- OSL_TRACE(" | ");
-
- ImplRegionBandSep* pSep = pBand->mpFirstSep;
- while (pSep != NULL)
- {
- OSL_TRACE(" %d->%d ", pSep->mnXLeft, pSep->mnXRight);
- pSep = pSep->mpNextSep;
- }
- OSL_TRACE("\n");
-
- pBand = pBand->mpNextBand;
- }
-}
#endif
// =======================================================================
diff --git a/vcl/source/gdi/rendergraphic.cxx b/vcl/source/gdi/rendergraphic.cxx
index 10b6064cc57c..79771163fa2d 100644
--- a/vcl/source/gdi/rendergraphic.cxx
+++ b/vcl/source/gdi/rendergraphic.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -238,3 +239,5 @@ void RenderGraphic::ImplGetDefaults() const
}
} // VCL
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/rendergraphicrasterizer.cxx b/vcl/source/gdi/rendergraphicrasterizer.cxx
index 29c9863335b3..4c70d866245b 100644
--- a/vcl/source/gdi/rendergraphicrasterizer.cxx
+++ b/vcl/source/gdi/rendergraphicrasterizer.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -398,3 +399,5 @@ void RenderGraphicRasterizer::ImplUpdateCache( const RenderGraphicRasterizer& rR
}
} // VCL
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 9679170df9b9..8b04476a1bea 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -159,91 +159,6 @@ VCL_DLLPUBLIC sal_UCS4 GetMirroredChar( sal_UCS4 nChar )
// -----------------------------------------------------------------------
-// Get simple approximations for unicodes
-const char* GetAutofallback( sal_UCS4 nChar )
-{
- const char* pStr = NULL;
- switch( nChar )
- {
- case 0x01C0:
- case 0x2223:
- case 0x2758:
- pStr = "|"; break;
- case 0x02DC:
- pStr = "~"; break;
- case 0x037E:
- pStr = ";"; break;
- case 0x2000:
- case 0x2001:
- case 0x2002:
- case 0x2003:
- case 0x2004:
- case 0x2005:
- case 0x2006:
- case 0x2007:
- case 0x2008:
- case 0x2009:
- case 0x200A:
- case 0x202F:
- pStr = " "; break;
- case 0x2010:
- case 0x2011:
- case 0x2012:
- case 0x2013:
- case 0x2014:
- pStr = "-"; break;
- case 0x2015:
- pStr = "--"; break;
- case 0x2016:
- pStr = "||"; break;
- case 0x2017:
- pStr = "_"; break;
- case 0x2018:
- case 0x2019:
- case 0x201B:
- pStr = "\'"; break;
- case 0x201A:
- pStr = ","; break;
- case 0x201C:
- case 0x201D:
- case 0x201E:
- case 0x201F:
- case 0x2033:
- pStr = "\""; break;
- case 0x2039:
- pStr = "<"; break;
- case 0x203A:
- pStr = ">"; break;
- case 0x203C:
- pStr = "!!"; break;
- case 0x203D:
- pStr = "?"; break;
- case 0x2044:
- case 0x2215:
- pStr = "/"; break;
- case 0x2048:
- pStr = "?!"; break;
- case 0x2049:
- pStr = "!?"; break;
- case 0x2216:
- pStr = "\\"; break;
- case 0x2217:
- pStr = "*"; break;
- case 0x2236:
- pStr = ":"; break;
- case 0x2264:
- pStr = "<="; break;
- case 0x2265:
- pStr = "<="; break;
- case 0x2303:
- pStr = "^"; break;
- }
-
- return pStr;
-}
-
-// -----------------------------------------------------------------------
-
sal_UCS4 GetLocalizedChar( sal_UCS4 nChar, LanguageType eLang )
{
// currently only conversion from ASCII digits is interesting
diff --git a/vcl/source/gdi/svgread.cxx b/vcl/source/gdi/svgread.cxx
index 554cfa804b1b..0573f924e277 100644
--- a/vcl/source/gdi/svgread.cxx
+++ b/vcl/source/gdi/svgread.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -129,3 +130,5 @@ namespace vcl
}
} // namespace vcl
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx
index a24d3b0cbd66..5529d9c06232 100644
--- a/vcl/source/gdi/wall.cxx
+++ b/vcl/source/gdi/wall.cxx
@@ -366,20 +366,6 @@ void Wallpaper::SetBitmap( const BitmapEx& rBitmap )
// -----------------------------------------------------------------------
-void Wallpaper::SetBitmap()
-{
- DBG_CHKTHIS( Wallpaper, NULL );
-
- if ( mpImplWallpaper->mpBitmap )
- {
- ImplMakeUnique();
- delete mpImplWallpaper->mpBitmap;
- mpImplWallpaper->mpBitmap = NULL;
- }
-}
-
-// -----------------------------------------------------------------------
-
BitmapEx Wallpaper::GetBitmap() const
{
DBG_CHKTHIS( Wallpaper, NULL );
@@ -422,20 +408,6 @@ void Wallpaper::SetGradient( const Gradient& rGradient )
// -----------------------------------------------------------------------
-void Wallpaper::SetGradient()
-{
- DBG_CHKTHIS( Wallpaper, NULL );
-
- if ( mpImplWallpaper->mpGradient )
- {
- ImplMakeUnique();
- delete mpImplWallpaper->mpGradient;
- mpImplWallpaper->mpGradient = NULL;
- }
-}
-
-// -----------------------------------------------------------------------
-
Gradient Wallpaper::GetGradient() const
{
DBG_CHKTHIS( Wallpaper, NULL );
@@ -504,20 +476,6 @@ void Wallpaper::SetRect( const Rectangle& rRect )
// -----------------------------------------------------------------------
-void Wallpaper::SetRect()
-{
- DBG_CHKTHIS( Wallpaper, NULL );
-
- if ( mpImplWallpaper->mpRect )
- {
- ImplMakeUnique( sal_False );
- delete mpImplWallpaper->mpRect;
- mpImplWallpaper->mpRect = NULL;
- }
-}
-
-// -----------------------------------------------------------------------
-
Rectangle Wallpaper::GetRect() const
{
DBG_CHKTHIS( Wallpaper, NULL );
diff --git a/vcl/source/helper/canvastools.cxx b/vcl/source/helper/canvastools.cxx
index ac8e658f7bd8..7b152938744b 100644
--- a/vcl/source/helper/canvastools.cxx
+++ b/vcl/source/helper/canvastools.cxx
@@ -185,23 +185,6 @@ namespace vcl
//---------------------------------------------------------------------------------------
- const uno::Sequence< sal_Int8 > getTunnelIdentifier( TunnelIdentifierType eType )
- {
- static boost::unordered_map< int, uno::Sequence< sal_Int8 > > aIds;
- boost::unordered_map< int, uno::Sequence< sal_Int8 > >::iterator it =
- aIds.find( eType );
- if( it == aIds.end() )
- {
- uno::Sequence< sal_Int8 > aNewId( 16 );
- rtl_createUuid( (sal_uInt8*)aNewId.getArray(), NULL, sal_True );
- aIds[ eType ] = aNewId;
- it = aIds.find( eType );
- }
- return it->second;
- }
-
- //---------------------------------------------------------------------------------------
-
namespace
{
inline bool operator==( const rendering::IntegerBitmapLayout& rLHS,
diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx
index c8b5cc7fbf22..c192431e87e6 100644
--- a/vcl/source/helper/strhelper.cxx
+++ b/vcl/source/helper/strhelper.cxx
@@ -173,15 +173,15 @@ String GetCommandLineToken( int nToken, const String& rLine )
return aRet;
}
-ByteString GetCommandLineToken( int nToken, const ByteString& rLine )
+rtl::OString GetCommandLineToken(int nToken, const rtl::OString& rLine)
{
- int nLen = rLine.Len();
- if( ! nLen )
- return ByteString();
+ sal_Int32 nLen = rLine.getLength();
+ if (!nLen)
+ return rLine;
int nActualToken = 0;
char* pBuffer = (char*)alloca( nLen + 1 );
- const char* pRun = rLine.GetBuffer();
+ const char* pRun = rLine.getStr();
char* pLeap = NULL;
while( *pRun && nActualToken <= nToken )
@@ -275,13 +275,13 @@ int GetCommandLineTokenCount( const String& rLine )
return nTokenCount;
}
-int GetCommandLineTokenCount( const ByteString& rLine )
+int GetCommandLineTokenCount(const rtl::OString& rLine)
{
- if( ! rLine.Len() )
+ if (rLine.isEmpty())
return 0;
int nTokenCount = 0;
- const char *pRun = rLine.GetBuffer();
+ const char *pRun = rLine.getStr();
while( *pRun )
@@ -383,14 +383,14 @@ String WhitespaceToSpace( const String& rLine, sal_Bool bProtect )
return aRet;
}
-ByteString WhitespaceToSpace( const ByteString& rLine, sal_Bool bProtect )
+rtl::OString WhitespaceToSpace(const rtl::OString& rLine, sal_Bool bProtect)
{
- int nLen = rLine.Len();
- if( ! nLen )
- return ByteString();
+ sal_Int32 nLen = rLine.getLength();
+ if (!nLen)
+ return rLine;
char *pBuffer = (char*)alloca( nLen + 1 );
- const char *pRun = rLine.GetBuffer();
+ const char *pRun = rLine.getStr();
char *pLeap = pBuffer;
while( *pRun )
@@ -436,8 +436,7 @@ ByteString WhitespaceToSpace( const ByteString& rLine, sal_Bool bProtect )
if( *pLeap == ' ' )
*pLeap = 0;
- ByteString aRet( *pBuffer == ' ' ? pBuffer+1 : pBuffer );
- return aRet;
+ return rtl::OString(*pBuffer == ' ' ? pBuffer+1 : pBuffer);
}
} // namespace
diff --git a/vcl/source/helper/threadex.cxx b/vcl/source/helper/threadex.cxx
index ad351410e2c2..f0db5e3a372f 100644
--- a/vcl/source/helper/threadex.cxx
+++ b/vcl/source/helper/threadex.cxx
@@ -35,46 +35,6 @@
using namespace vcl;
-ThreadExecutor::ThreadExecutor()
-{
- m_aFinish = osl_createCondition();
- m_aThread = NULL;
-}
-
-ThreadExecutor::~ThreadExecutor()
-{
- osl_destroyCondition( m_aFinish );
- if( m_aThread )
- osl_destroyThread( m_aThread );
-}
-
-extern "C"
-{
- static void call_worker( void* pInstance )
- {
- ThreadExecutor::worker( pInstance );
- }
-}
-
-void ThreadExecutor::worker( void* pInstance )
-{
- ThreadExecutor* pThis = ((ThreadExecutor*)pInstance);
- pThis->m_nReturn = pThis->doIt();
- osl_setCondition( pThis->m_aFinish );
-}
-
-long ThreadExecutor::execute()
-{
- osl_resetCondition( m_aFinish );
- if( m_aThread )
- osl_destroyThread( m_aThread ), m_aThread = NULL;
- m_aThread = osl_createThread( call_worker, this );
- while( ! osl_checkCondition( m_aFinish ) )
- Application::Reschedule();
- return m_nReturn;
-}
-
-
SolarThreadExecutor::SolarThreadExecutor()
:m_nReturn( 0 )
,m_bTimeout( false )
diff --git a/vcl/source/salmain/salmain.cxx b/vcl/source/salmain/salmain.cxx
index 80e853b3b654..0c3adf887023 100644
--- a/vcl/source/salmain/salmain.cxx
+++ b/vcl/source/salmain/salmain.cxx
@@ -36,7 +36,7 @@
#include "salinst.hxx"
-SAL_IMPLEMENT_MAIN() {
+SAL_IMPLEMENT_MAIN_WITH_GUI() {
tools::extendApplicationEnvironment();
return SVMain();
}
diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx
index 525c8ad5a76a..3fb5aabc4a35 100644
--- a/vcl/source/window/accel.cxx
+++ b/vcl/source/window/accel.cxx
@@ -410,85 +410,6 @@ void Accelerator::InsertItem( const ResId& rResId )
// -----------------------------------------------------------------------
-void Accelerator::RemoveItem( sal_uInt16 nItemId )
-{
- DBG_CHKTHIS( Accelerator, NULL );
-
- // Aus der Id-Liste entfernen
- sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
- if ( nIndex != ACCELENTRY_NOTFOUND )
- {
- sal_uInt16 nItemCount = GetItemCount();
- do
- {
- ImplAccelEntry* pEntry = ( nIndex < mpData->maIdList.size() ) ? mpData->maIdList[ nIndex ] : NULL;
- if ( pEntry && pEntry->mnId == nItemId )
- {
- mpData->maKeyTable.Remove( pEntry->maKeyCode.GetFullKeyCode() );
-
- ImplAccelList::iterator it = mpData->maIdList.begin();
- ::std::advance( it, nIndex );
- mpData->maIdList.erase( it );
-
- // AutoResAccel zerstoeren
- if ( pEntry->mpAutoAccel )
- delete pEntry->mpAutoAccel;
-
- delete pEntry;
- }
- else
- break;
- }
- while ( nIndex < nItemCount );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void Accelerator::RemoveItem( const KeyCode rKeyCode )
-{
- DBG_CHKTHIS( Accelerator, NULL );
-
- ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode );
- if ( pEntry )
- {
- // Aus der Id-Liste entfernen
- sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), pEntry->mnId );
- sal_uInt16 nItemCount = GetItemCount();
- do
- {
- if ( mpData->maIdList[ nIndex ] == pEntry )
- break;
- nIndex++;
- }
- while ( nIndex < nItemCount );
-
- mpData->maKeyTable.Remove( rKeyCode.GetFullKeyCode() );
-
- ImplAccelList::iterator it = mpData->maIdList.begin();
- ::std::advance( it, nIndex );
- mpData->maIdList.erase( it );
-
- // AutoResAccel zerstoeren
- if ( pEntry->mpAutoAccel )
- delete pEntry->mpAutoAccel;
-
- delete pEntry;
- }
-}
-
-// -----------------------------------------------------------------------
-
-void Accelerator::Clear()
-{
- DBG_CHKTHIS( Accelerator, NULL );
-
- ImplDeleteData();
- mpData->maKeyTable.Clear();
-}
-
-// -----------------------------------------------------------------------
-
sal_uInt16 Accelerator::GetItemCount() const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -498,45 +419,6 @@ sal_uInt16 Accelerator::GetItemCount() const
// -----------------------------------------------------------------------
-sal_uInt16 Accelerator::GetItemId( sal_uInt16 nPos ) const
-{
- DBG_CHKTHIS( Accelerator, NULL );
-
- ImplAccelEntry* pEntry = ( nPos < mpData->maIdList.size() ) ? mpData->maIdList[ nPos ] : NULL;
- if ( pEntry )
- return pEntry->mnId;
- else
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-KeyCode Accelerator::GetItemKeyCode( sal_uInt16 nPos ) const
-{
- DBG_CHKTHIS( Accelerator, NULL );
-
- ImplAccelEntry* pEntry = ( nPos < mpData->maIdList.size() ) ? mpData->maIdList[ nPos ] : NULL;
- if ( pEntry )
- return pEntry->maKeyCode;
- else
- return KeyCode();
-}
-
-// -----------------------------------------------------------------------
-
-sal_uInt16 Accelerator::GetItemId( const KeyCode& rKeyCode ) const
-{
- DBG_CHKTHIS( Accelerator, NULL );
-
- ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode );
- if ( pEntry )
- return pEntry->mnId;
- else
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
KeyCode Accelerator::GetKeyCode( sal_uInt16 nItemId ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -550,76 +432,15 @@ KeyCode Accelerator::GetKeyCode( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-sal_Bool Accelerator::IsIdValid( sal_uInt16 nItemId ) const
-{
- DBG_CHKTHIS( Accelerator, NULL );
-
- sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
- return (nIndex != ACCELENTRY_NOTFOUND);
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const
-{
- DBG_CHKTHIS( Accelerator, NULL );
-
- ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode );
- return (pEntry != NULL);
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool Accelerator::Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat )
+sal_uInt16 Accelerator::GetItemId( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode );
+ ImplAccelEntry* pEntry = ( nPos < mpData->maIdList.size() ) ? mpData->maIdList[ nPos ] : NULL;
if ( pEntry )
- {
- if ( pEntry->mbEnabled )
- {
- sal_Bool bDel = sal_False;
- mnCurId = pEntry->mnId;
- maCurKeyCode = rKeyCode;
- mnCurRepeat = nRepeat;
- mpDel = &bDel;
- Select();
- if ( !bDel )
- {
- mnCurId = 0;
- maCurKeyCode = KeyCode();
- mnCurRepeat = 0;
- }
-
- return sal_True;
- }
- }
-
- return sal_False;
-}
-
-// -----------------------------------------------------------------------
-
-void Accelerator::SetAccel( sal_uInt16 nItemId, Accelerator* pAccel )
-{
- DBG_CHKTHIS( Accelerator, NULL );
-
- sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
- if ( nIndex != ACCELENTRY_NOTFOUND )
- {
- sal_uInt16 nItemCount = GetItemCount();
- do
- {
- ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ];
- if ( pEntry->mnId != nItemId )
- break;
-
- pEntry->mpAccel = pAccel;
- nIndex++;
- }
- while ( nIndex < nItemCount );
- }
+ return pEntry->mnId;
+ else
+ return 0;
}
// -----------------------------------------------------------------------
@@ -637,90 +458,6 @@ Accelerator* Accelerator::GetAccel( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-void Accelerator::SetAccel( const KeyCode rKeyCode, Accelerator* pAccel )
-{
- DBG_CHKTHIS( Accelerator, NULL );
-
- ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode );
- if ( pEntry )
- pEntry->mpAccel = pAccel;
-}
-
-// -----------------------------------------------------------------------
-
-Accelerator* Accelerator::GetAccel( const KeyCode rKeyCode ) const
-{
- DBG_CHKTHIS( Accelerator, NULL );
-
- ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode );
- if ( pEntry )
- return pEntry->mpAccel;
- else
- return sal_False;
-}
-
-// -----------------------------------------------------------------------
-
-void Accelerator::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable )
-{
- DBG_CHKTHIS( Accelerator, NULL );
-
- sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
- if ( nIndex != ACCELENTRY_NOTFOUND )
- {
- sal_uInt16 nItemCount = GetItemCount();
- do
- {
- ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ];
- if ( pEntry->mnId != nItemId )
- break;
-
- pEntry->mbEnabled = bEnable;
- nIndex++;
- }
- while ( nIndex < nItemCount );
- }
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool Accelerator::IsItemEnabled( sal_uInt16 nItemId ) const
-{
- DBG_CHKTHIS( Accelerator, NULL );
-
- sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
- if ( nIndex != ACCELENTRY_NOTFOUND )
- return mpData->maIdList[ nIndex ]->mbEnabled;
- else
- return sal_False;
-}
-
-// -----------------------------------------------------------------------
-
-void Accelerator::EnableItem( const KeyCode rKeyCode, sal_Bool bEnable )
-{
- DBG_CHKTHIS( Accelerator, NULL );
-
- ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode );
- if ( pEntry )
- pEntry->mbEnabled = bEnable;
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const
-{
- DBG_CHKTHIS( Accelerator, NULL );
-
- ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode );
- if ( pEntry )
- return pEntry->mbEnabled;
- else
- return sal_False;
-}
-
-// -----------------------------------------------------------------------
-
Accelerator& Accelerator::operator=( const Accelerator& rAccel )
{
DBG_CHKTHIS( Accelerator, NULL );
diff --git a/vcl/source/window/dndlcon.cxx b/vcl/source/window/dndlcon.cxx
index 977e8611e70a..08c8e4d24c3b 100644
--- a/vcl/source/window/dndlcon.cxx
+++ b/vcl/source/window/dndlcon.cxx
@@ -193,8 +193,7 @@ sal_uInt32 DNDListenerContainer::fireDropEvent( const Reference< XDropTargetDrop
nRet++;
}
}
-
- catch( RuntimeException )
+ catch (const RuntimeException&)
{
pContainer->removeInterface( xElement );
}
@@ -209,8 +208,7 @@ sal_uInt32 DNDListenerContainer::fireDropEvent( const Reference< XDropTargetDrop
{
context->rejectDrop();
}
-
- catch( RuntimeException exc )
+ catch (const RuntimeException&)
{
}
}
@@ -253,8 +251,7 @@ sal_uInt32 DNDListenerContainer::fireDragExitEvent()
nRet++;
}
}
-
- catch( RuntimeException )
+ catch (const RuntimeException&)
{
pContainer->removeInterface( xElement );
}
@@ -305,8 +302,7 @@ sal_uInt32 DNDListenerContainer::fireDragOverEvent( const Reference< XDropTarget
nRet++;
}
}
-
- catch( RuntimeException )
+ catch (const RuntimeException&)
{
pContainer->removeInterface( xElement );
}
@@ -321,8 +317,7 @@ sal_uInt32 DNDListenerContainer::fireDragOverEvent( const Reference< XDropTarget
{
context->rejectDrag();
}
-
- catch( RuntimeException exc )
+ catch (const RuntimeException&)
{
}
}
@@ -373,8 +368,7 @@ sal_uInt32 DNDListenerContainer::fireDragEnterEvent( const Reference< XDropTarge
nRet++;
}
}
-
- catch( RuntimeException )
+ catch (const RuntimeException&)
{
pContainer->removeInterface( xElement );
}
@@ -389,8 +383,7 @@ sal_uInt32 DNDListenerContainer::fireDragEnterEvent( const Reference< XDropTarge
{
context->rejectDrag();
}
-
- catch( RuntimeException exc )
+ catch (const RuntimeException&)
{
}
}
@@ -440,8 +433,7 @@ sal_uInt32 DNDListenerContainer::fireDropActionChangedEvent( const Reference< XD
nRet++;
}
}
-
- catch( RuntimeException )
+ catch (const RuntimeException&)
{
pContainer->removeInterface( xElement );
}
@@ -456,8 +448,7 @@ sal_uInt32 DNDListenerContainer::fireDropActionChangedEvent( const Reference< XD
{
context->rejectDrag();
}
-
- catch( RuntimeException exc )
+ catch (const RuntimeException&)
{
}
}
@@ -502,8 +493,7 @@ sal_uInt32 DNDListenerContainer::fireDragGestureEvent( sal_Int8 dragAction, sal_
nRet++;
}
}
-
- catch( RuntimeException )
+ catch (const RuntimeException&)
{
pContainer->removeInterface( xElement );
}
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 118c60f214cc..72847ab17bc7 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -697,13 +697,22 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags )
// so they can be compared across different frames
// !!! rRect is expected to be in screen coordinates of the parent frame window !!!
maFloatRect = rRect;
- if( GetParent()->ImplHasMirroredGraphics() )
+
+ Window *pReference = GetParent();
+
+ // compare coordinates in absolute screen coordinates
+ // Keep in sync with FloatingWindow::ImplFloatHitTest, e.g. fdo#33509
+ if( pReference->ImplHasMirroredGraphics() )
{
- maFloatRect.SetPos( GetParent()->ScreenToOutputPixel( rRect.TopLeft() ) );
- maFloatRect = GetParent()->ImplOutputToUnmirroredAbsoluteScreenPixel( maFloatRect );
+ if(!pReference->IsRTLEnabled() )
+ // --- RTL --- re-mirror back to get device coordiantes
+ pReference->ImplReMirror(maFloatRect);
+
+ maFloatRect.SetPos(pReference->ScreenToOutputPixel(maFloatRect.TopLeft()));
+ maFloatRect = pReference->ImplOutputToUnmirroredAbsoluteScreenPixel(maFloatRect);
}
else
- maFloatRect.SetPos( GetParent()->OutputToAbsoluteScreenPixel( GetParent()->ScreenToOutputPixel( rRect.TopLeft() ) ) );
+ maFloatRect.SetPos(pReference->OutputToAbsoluteScreenPixel(pReference->ScreenToOutputPixel(rRect.TopLeft())));
maFloatRect.Left() -= 2;
maFloatRect.Top() -= 2;
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index d4e16ed6c121..9e47d34716cb 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -156,7 +156,7 @@ struct MenuItemData
pSalMenuItem ( NULL )
{}
~MenuItemData();
- bool HasCheck()
+ bool HasCheck() const
{
return bChecked || ( nBits & ( MIB_RADIOCHECK | MIB_CHECKABLE | MIB_AUTOCHECK ) );
}
diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx
index 341d7f3bfff8..1de33b56b15b 100755..100644
--- a/vcl/source/window/syschild.cxx
+++ b/vcl/source/window/syschild.cxx
@@ -198,16 +198,6 @@ void SystemChildWindow::EnableEraseBackground( sal_Bool bEnable )
// -----------------------------------------------------------------------
-sal_Bool SystemChildWindow::IsEraseBackgroundEnabled()
-{
- if ( mpWindowImpl->mpSysObj )
- return mpWindowImpl->mpSysObj->IsEraseBackgroundEnabled();
- else
- return sal_False;
-}
-
-// -----------------------------------------------------------------------
-
void SystemChildWindow::ImplTestJavaException( void* pEnv )
{
#ifdef SOLAR_JAVA
@@ -260,6 +250,9 @@ sal_IntPtr SystemChildWindow::GetParentWindowHandle( sal_Bool bUseJava )
// FIXME: this is wrong
nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView );
(void)bUseJava;
+#elif defined IOS
+ // FIXME: this is wrong
+ nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView );
#elif defined UNX
if( !bUseJava )
{
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index f6c7e422cc3b..77cfb7044740 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -39,6 +39,8 @@
#include <vcl/taskpanelist.hxx>
#include <vcl/unowrap.hxx>
+#include <rtl/strbuf.hxx>
+
#include <salframe.hxx>
#include <svdata.hxx>
#include <brdwin.hxx>
@@ -242,36 +244,6 @@ void SystemWindow::Resizing( Size& )
// -----------------------------------------------------------------------
-void SystemWindow::SetZLevel( sal_uInt8 nLevel )
-{
- Window* pWindow = this;
- while ( pWindow->mpWindowImpl->mpBorderWindow )
- pWindow = pWindow->mpWindowImpl->mpBorderWindow;
- if ( pWindow->mpWindowImpl->mbOverlapWin && !pWindow->mpWindowImpl->mbFrame )
- {
- sal_uInt8 nOldLevel = pWindow->mpWindowImpl->mpOverlapData->mnTopLevel;
- pWindow->mpWindowImpl->mpOverlapData->mnTopLevel = nLevel;
- // Wenn der neue Level groesser als der alte ist, schieben
- // wir das Fenster nach hinten
- if ( !IsReallyVisible() && (nLevel > nOldLevel) && pWindow->mpWindowImpl->mpNext )
- {
- // Fenster aus der Liste entfernen
- if ( pWindow->mpWindowImpl->mpPrev )
- pWindow->mpWindowImpl->mpPrev->mpWindowImpl->mpNext = pWindow->mpWindowImpl->mpNext;
- else
- pWindow->mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap = pWindow->mpWindowImpl->mpNext;
- pWindow->mpWindowImpl->mpNext->mpWindowImpl->mpPrev = pWindow->mpWindowImpl->mpPrev;
- pWindow->mpWindowImpl->mpNext = NULL;
- // und Fenster wieder in die Liste am Ende eintragen
- pWindow->mpWindowImpl->mpPrev = pWindow->mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap;
- pWindow->mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap = pWindow;
- pWindow->mpWindowImpl->mpPrev->mpWindowImpl->mpNext = pWindow;
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
void SystemWindow::SetRepresentedURL( const rtl::OUString& i_rURL )
{
bool bChanged = (i_rURL != mpImplData->maRepresentedURL);
@@ -286,12 +258,6 @@ void SystemWindow::SetRepresentedURL( const rtl::OUString& i_rURL )
pWindow->mpWindowImpl->mpFrame->SetRepresentedURL( i_rURL );
}
}
-// -----------------------------------------------------------------------
-
-const rtl::OUString& SystemWindow::GetRepresentedURL() const
-{
- return mpImplData->maRepresentedURL;
-}
// -----------------------------------------------------------------------
@@ -315,19 +281,6 @@ void SystemWindow::SetIcon( sal_uInt16 nIcon )
// -----------------------------------------------------------------------
-sal_uInt8 SystemWindow::GetZLevel() const
-{
- const Window* pWindow = this;
- while ( pWindow->mpWindowImpl->mpBorderWindow )
- pWindow = pWindow->mpWindowImpl->mpBorderWindow;
- if ( pWindow->mpWindowImpl->mpOverlapData )
- return pWindow->mpWindowImpl->mpOverlapData->mnTopLevel;
- else
- return sal_False;
-}
-
-// -----------------------------------------------------------------------
-
void SystemWindow::EnableSaveBackground( sal_Bool bSave )
{
if( ImplGetSVData()->maWinData.mbNoSaveBackground )
@@ -498,16 +451,17 @@ Size SystemWindow::GetResizeOutputSizePixel() const
// -----------------------------------------------------------------------
-static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rStr )
+static void ImplWindowStateFromStr(WindowStateData& rData,
+ const rtl::OString& rStr)
{
sal_uLong nValidMask = 0;
- xub_StrLen nIndex = 0;
- ByteString aTokenStr;
+ sal_Int32 nIndex = 0;
+ rtl::OString aTokenStr;
- aTokenStr = rStr.GetToken( 0, ',', nIndex );
- if ( aTokenStr.Len() )
+ aTokenStr = rStr.getToken(0, ',', nIndex);
+ if (!aTokenStr.isEmpty())
{
- rData.SetX( aTokenStr.ToInt32() );
+ rData.SetX(aTokenStr.toInt32());
if( rData.GetX() > -16384 && rData.GetX() < 16384 )
nValidMask |= WINDOWSTATE_MASK_X;
else
@@ -515,10 +469,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
}
else
rData.SetX( 0 );
- aTokenStr = rStr.GetToken( 0, ',', nIndex );
- if ( aTokenStr.Len() )
+ aTokenStr = rStr.getToken(0, ',', nIndex);
+ if (!aTokenStr.isEmpty())
{
- rData.SetY( aTokenStr.ToInt32() );
+ rData.SetY(aTokenStr.toInt32());
if( rData.GetY() > -16384 && rData.GetY() < 16384 )
nValidMask |= WINDOWSTATE_MASK_Y;
else
@@ -526,10 +480,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
}
else
rData.SetY( 0 );
- aTokenStr = rStr.GetToken( 0, ',', nIndex );
- if ( aTokenStr.Len() )
+ aTokenStr = rStr.getToken(0, ',', nIndex);
+ if (!aTokenStr.isEmpty())
{
- rData.SetWidth( aTokenStr.ToInt32() );
+ rData.SetWidth(aTokenStr.toInt32());
if( rData.GetWidth() > 0 && rData.GetWidth() < 16384 )
nValidMask |= WINDOWSTATE_MASK_WIDTH;
else
@@ -537,10 +491,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
}
else
rData.SetWidth( 0 );
- aTokenStr = rStr.GetToken( 0, ';', nIndex );
- if ( aTokenStr.Len() )
+ aTokenStr = rStr.getToken(0, ';', nIndex);
+ if (!aTokenStr.isEmpty())
{
- rData.SetHeight( aTokenStr.ToInt32() );
+ rData.SetHeight(aTokenStr.toInt32());
if( rData.GetHeight() > 0 && rData.GetHeight() < 16384 )
nValidMask |= WINDOWSTATE_MASK_HEIGHT;
else
@@ -548,12 +502,12 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
}
else
rData.SetHeight( 0 );
- aTokenStr = rStr.GetToken( 0, ';', nIndex );
- if ( aTokenStr.Len() )
+ aTokenStr = rStr.getToken(0, ';', nIndex);
+ if (!aTokenStr.isEmpty())
{
// #94144# allow Minimize again, should be masked out when read from configuration
// 91625 - ignore Minimize
- sal_uLong nState = (sal_uLong)aTokenStr.ToInt32();
+ sal_uInt32 nState = (sal_uInt32)aTokenStr.toInt32();
//nState &= ~(WINDOWSTATE_STATE_MINIMIZED);
rData.SetState( nState );
nValidMask |= WINDOWSTATE_MASK_STATE;
@@ -562,10 +516,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
rData.SetState( 0 );
// read maximized pos/size
- aTokenStr = rStr.GetToken( 0, ',', nIndex );
- if ( aTokenStr.Len() )
+ aTokenStr = rStr.getToken(0, ',', nIndex);
+ if (!aTokenStr.isEmpty())
{
- rData.SetMaximizedX( aTokenStr.ToInt32() );
+ rData.SetMaximizedX(aTokenStr.toInt32());
if( rData.GetMaximizedX() > -16384 && rData.GetMaximizedX() < 16384 )
nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_X;
else
@@ -573,10 +527,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
}
else
rData.SetMaximizedX( 0 );
- aTokenStr = rStr.GetToken( 0, ',', nIndex );
- if ( aTokenStr.Len() )
+ aTokenStr = rStr.getToken(0, ',', nIndex);
+ if (!aTokenStr.isEmpty())
{
- rData.SetMaximizedY( aTokenStr.ToInt32() );
+ rData.SetMaximizedY(aTokenStr.toInt32());
if( rData.GetMaximizedY() > -16384 && rData.GetMaximizedY() < 16384 )
nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_Y;
else
@@ -584,10 +538,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
}
else
rData.SetMaximizedY( 0 );
- aTokenStr = rStr.GetToken( 0, ',', nIndex );
- if ( aTokenStr.Len() )
+ aTokenStr = rStr.getToken(0, ',', nIndex);
+ if (!aTokenStr.isEmpty())
{
- rData.SetMaximizedWidth( aTokenStr.ToInt32() );
+ rData.SetMaximizedWidth(aTokenStr.toInt32());
if( rData.GetMaximizedWidth() > 0 && rData.GetMaximizedWidth() < 16384 )
nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_WIDTH;
else
@@ -595,10 +549,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
}
else
rData.SetMaximizedWidth( 0 );
- aTokenStr = rStr.GetToken( 0, ';', nIndex );
- if ( aTokenStr.Len() )
+ aTokenStr = rStr.getToken(0, ';', nIndex);
+ if (!aTokenStr.isEmpty())
{
- rData.SetMaximizedHeight( aTokenStr.ToInt32() );
+ rData.SetMaximizedHeight(aTokenStr.toInt32());
if( rData.GetMaximizedHeight() > 0 && rData.GetMaximizedHeight() < 16384 )
nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_HEIGHT;
else
@@ -613,45 +567,48 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
// -----------------------------------------------------------------------
-static void ImplWindowStateToStr( const WindowStateData& rData, ByteString& rStr )
+static rtl::OString ImplWindowStateToStr(const WindowStateData& rData)
{
sal_uLong nValidMask = rData.GetMask();
if ( !nValidMask )
- return;
+ return rtl::OString();
+
+ rtl::OStringBuffer rStrBuf;
if ( nValidMask & WINDOWSTATE_MASK_X )
- rStr.Append( ByteString::CreateFromInt32( rData.GetX() ) );
- rStr.Append( ',' );
+ rStrBuf.append(static_cast<sal_Int32>(rData.GetX()));
+ rStrBuf.append(',');
if ( nValidMask & WINDOWSTATE_MASK_Y )
- rStr.Append( ByteString::CreateFromInt32( rData.GetY() ) );
- rStr.Append( ',' );
+ rStrBuf.append(static_cast<sal_Int32>(rData.GetY()));
+ rStrBuf.append(',');
if ( nValidMask & WINDOWSTATE_MASK_WIDTH )
- rStr.Append( ByteString::CreateFromInt32( rData.GetWidth() ) );
- rStr.Append( ',' );
+ rStrBuf.append(static_cast<sal_Int32>(rData.GetWidth()));
+ rStrBuf.append(',');
if ( nValidMask & WINDOWSTATE_MASK_HEIGHT )
- rStr.Append( ByteString::CreateFromInt32( rData.GetHeight() ) );
- rStr.Append( ';' );
+ 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
- sal_uLong nState = rData.GetState();
- //nState &= ~(WINDOWSTATE_STATE_MINIMIZED);
- rStr.Append( ByteString::CreateFromInt32( (long)nState ) );
+ sal_uInt32 nState = rData.GetState();
+ rStrBuf.append(static_cast<sal_Int32>(nState));
}
- rStr.Append( ';' );
+ rStrBuf.append(';');
if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_X )
- rStr.Append( ByteString::CreateFromInt32( rData.GetMaximizedX() ) );
- rStr.Append( ',' );
+ rStrBuf.append(static_cast<sal_Int32>(rData.GetMaximizedX()));
+ rStrBuf.append(',');
if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_Y )
- rStr.Append( ByteString::CreateFromInt32( rData.GetMaximizedY() ) );
- rStr.Append( ',' );
+ rStrBuf.append(static_cast<sal_Int32>(rData.GetMaximizedY()));
+ rStrBuf.append( ',' );
if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_WIDTH )
- rStr.Append( ByteString::CreateFromInt32( rData.GetMaximizedWidth() ) );
- rStr.Append( ',' );
+ rStrBuf.append(static_cast<sal_Int32>(rData.GetMaximizedWidth()));
+ rStrBuf.append(',');
if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_HEIGHT )
- rStr.Append( ByteString::CreateFromInt32( rData.GetMaximizedHeight() ) );
- rStr.Append( ';' );
+ rStrBuf.append(static_cast<sal_Int32>(rData.GetMaximizedHeight()));
+ rStrBuf.append(';');
+
+ return rStrBuf.makeStringAndClear();
}
// -----------------------------------------------------------------------
@@ -955,9 +912,9 @@ void SystemWindow::GetWindowStateData( WindowStateData& rData ) const
// -----------------------------------------------------------------------
-void SystemWindow::SetWindowState( const ByteString& rStr )
+void SystemWindow::SetWindowState(const rtl::OString& rStr)
{
- if ( !rStr.Len() )
+ if (rStr.isEmpty())
return;
WindowStateData aData;
@@ -967,15 +924,13 @@ void SystemWindow::SetWindowState( const ByteString& rStr )
// -----------------------------------------------------------------------
-ByteString SystemWindow::GetWindowState( sal_uLong nMask ) const
+rtl::OString SystemWindow::GetWindowState( sal_uLong nMask ) const
{
WindowStateData aData;
aData.SetMask( nMask );
GetWindowStateData( aData );
- ByteString aStr;
- ImplWindowStateToStr( aData, aStr );
- return aStr;
+ return ImplWindowStateToStr(aData);
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx
index 24c8ded6e4b4..bfb3be82b70f 100644
--- a/vcl/source/window/taskpanelist.cxx
+++ b/vcl/source/window/taskpanelist.cxx
@@ -262,41 +262,6 @@ sal_Bool TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
// --------------------------------------------------
-// returns next valid pane
-Window* TaskPaneList::FindNextPane( Window *pWindow, sal_Bool bForward )
-{
- if( bForward )
- ::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSort() );
- else
- ::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSortBackward() );
-
- ::std::vector< Window* >::iterator p = mTaskPanes.begin();
- while( p != mTaskPanes.end() )
- {
- if( *p == pWindow )
- {
- unsigned n = mTaskPanes.size();
- while( --n )
- {
- if( ++p == mTaskPanes.end() )
- p = mTaskPanes.begin();
- if( (*p)->IsReallyVisible() && !(*p)->IsDialog() && !(*p)->ImplIsSplitter() )
- {
- pWindow = *p;
- break;
- }
- }
- break;
- }
- else
- ++p;
- }
-
- return pWindow;
-}
-
-// --------------------------------------------------
-
// returns next splitter
Window* TaskPaneList::FindNextSplitter( Window *pWindow, sal_Bool bForward )
{
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 8ffe04c4208a..742d821a1f7e 100755..100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -194,8 +194,6 @@ public:
void UpdateDragRect();
DECL_LINK( SelectHdl, Accelerator* );
- void StartCustomizeMode();
- void EndCustomizeMode();
sal_Bool IsCustomizeMode() { return mbCustomizeMode; }
sal_Bool IsResizeMode() { return mbResizeMode; }
};
@@ -1503,29 +1501,6 @@ IMPL_LINK( ImplTBDragMgr, SelectHdl, Accelerator*, pAccel )
// -----------------------------------------------------------------------
-void ImplTBDragMgr::StartCustomizeMode()
-{
- mbCustomizeMode = sal_True;
-
- for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i ) {
- (*mpBoxList)[ i ]->ImplStartCustomizeMode();
- }
-}
-
-// -----------------------------------------------------------------------
-
-void ImplTBDragMgr::EndCustomizeMode()
-{
- mbCustomizeMode = sal_False;
-
- for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i ) {
- (*mpBoxList)[ i ]->ImplEndCustomizeMode();
- }
-}
-
-// -----------------------------------------------------------------------
-
-
static void ImplDrawOutButton( OutputDevice* pOutDev, const Rectangle& rRect,
sal_uInt16 nStyle )
{
@@ -3178,60 +3153,6 @@ void ToolBox::ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, sal_Bool bBlac
}
}
-void ToolBox::SetToolArrowClipregion( ToolBox* pBox, long nX, long nY,
- sal_Bool bLeft, sal_Bool bTop, long nSize )
-{
- WindowAlign eAlign = pBox->meAlign;
- long nHalfSize;
- if ( bLeft )
- eAlign = WINDOWALIGN_RIGHT;
- else if ( bTop )
- eAlign = WINDOWALIGN_BOTTOM;
-
- nHalfSize = nSize/2;
-
- Point p[6];
-
- switch ( eAlign )
- {
- case WINDOWALIGN_LEFT:
- p[0].X() = nX-1; p[0].Y() = nY-1;
- p[1].X() = nX-1; p[1].Y() = nY+nSize+1;
- p[2].X() = nX+1; p[2].Y() = nY+nSize+1;
- p[3].X() = nX+nHalfSize+1; p[3].Y() = nY+nHalfSize+1;
- p[4].X() = nX+nHalfSize+1; p[4].Y() = nY+nHalfSize-1;
- p[5].X() = nX+1; p[5].Y() = nY-1;
- break;
- case WINDOWALIGN_TOP:
- p[0].X() = nX-1; p[0].Y() = nY-1;
- p[1].X() = nX-1; p[1].Y() = nY+1;
- p[2].X() = nX+nHalfSize-1; p[2].Y() = nY+nHalfSize+1;
- p[3].X() = nX+nHalfSize+1; p[3].Y() = nY+nHalfSize+1;
- p[4].X() = nX+nSize+1; p[4].Y() = nY+1;
- p[5].X() = nX+nSize+1; p[5].Y() = nY-1;
- break;
- case WINDOWALIGN_RIGHT:
- p[0].X() = nX+nHalfSize-1; p[0].Y() = nY-1;
- p[1].X() = nX-1; p[1].Y() = nY+nHalfSize-1;
- p[2].X() = nX-1; p[2].Y() = nY+nHalfSize+1;
- p[3].X() = nX+nHalfSize-1; p[3].Y() = nY+nSize+1;
- p[4].X() = nX+nHalfSize+1; p[4].Y() = nY+nSize+1;
- p[5].X() = nX+nHalfSize+1; p[5].Y() = nY-1;
- break;
- case WINDOWALIGN_BOTTOM:
- p[0].X() = nX-1; p[0].Y() = nY+nHalfSize-1;
- p[1].X() = nX-1; p[1].Y() = nY+nHalfSize+1;
- p[2].X() = nX+nSize+1; p[2].Y() = nY+nHalfSize+1;
- p[3].X() = nX+nSize+1; p[3].Y() = nY+nHalfSize-1;
- p[4].X() = nX+nHalfSize+1; p[4].Y() = nY-1;
- p[5].X() = nX+nHalfSize-1; p[5].Y() = nY-1;
- break;
- }
- Polygon aPoly(6,p);
- Region aRgn( aPoly );
- pBox->SetClipRegion( aRgn );
-}
-
// -----------------------------------------------------------------------
void ToolBox::ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight )
@@ -3847,60 +3768,6 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_uInt16 nHighlight, sal_Bool bPa
// -----------------------------------------------------------------------
-void ToolBox::ImplStartCustomizeMode()
-{
- mbCustomizeMode = sal_True;
-
- mpData->ImplClearLayoutData();
-
- std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
- while ( it != mpData->m_aItems.end() )
- {
- if ( it->mbShowWindow )
- {
- it->mpWindow->Hide();
-
- if ( !(it->maRect.IsEmpty()) )
- Invalidate( it->maRect );
- }
-
- ++it;
- }
-}
-
-void ToolBox::SetCustomizeMode( sal_Bool bSet )
-{
- if ( bSet )
- ImplStartCustomizeMode();
- else
- ImplEndCustomizeMode();
-}
-
-// -----------------------------------------------------------------------
-
-void ToolBox::ImplEndCustomizeMode()
-{
- mbCustomizeMode = sal_False;
-
- mpData->ImplClearLayoutData();
-
- std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
- while ( it != mpData->m_aItems.end() )
- {
- if ( it->mbShowWindow )
- {
- if ( !(it->maRect.IsEmpty()) )
- Invalidate( it->maRect );
-
- it->mpWindow->Show();
- }
-
- ++it;
- }
-}
-
-// -----------------------------------------------------------------------
-
void ToolBox::ImplDrawFloatwinBorder( ImplToolItem* pItem )
{
if ( !pItem->maRect.IsEmpty() )
@@ -5545,49 +5412,6 @@ void ToolBox::EnableCustomize( sal_Bool bEnable )
// -----------------------------------------------------------------------
-void ToolBox::StartCustomize( const Rectangle& rRect, void* pData )
-{
- DBG_ASSERT( mbCustomize,
- "ToolBox::StartCustomize(): ToolBox must be customized" );
-
- ImplTBDragMgr* pMgr = ImplGetTBDragMgr();
- Point aMousePos = GetPointerPosPixel();
- Point aPos = ScreenToOutputPixel( rRect.TopLeft() );
- Rectangle aRect( aPos.X(), aPos.Y(),
- aPos.X()+rRect.GetWidth()+SMALLBUTTON_HSIZE,
- aPos.Y()+rRect.GetHeight()+SMALLBUTTON_VSIZE );
- aMousePos = ScreenToOutputPixel( aPos );
- Pointer aPtr;
- SetPointer( aPtr );
- pMgr->StartDragging( this, aMousePos, aRect, 0, sal_False, pData );
-}
-
-// -----------------------------------------------------------------------
-
-void ToolBox::StartCustomizeMode()
-{
- ImplTBDragMgr* pMgr = ImplGetTBDragMgr();
- pMgr->StartCustomizeMode();
-}
-
-// -----------------------------------------------------------------------
-
-void ToolBox::EndCustomizeMode()
-{
- ImplTBDragMgr* pMgr = ImplGetTBDragMgr();
- pMgr->EndCustomizeMode();
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool ToolBox::IsCustomizeMode()
-{
- ImplTBDragMgr* pMgr = ImplGetTBDragMgr();
- return pMgr->IsCustomizeMode();
-}
-
-// -----------------------------------------------------------------------
-
void ToolBox::GetFocus()
{
DockingWindow::GetFocus();
@@ -5985,39 +5809,6 @@ ImplToolItem* ToolBox::ImplGetFirstValidItem( sal_uInt16 nLine )
return (it == mpData->m_aItems.end()) ? NULL : &(*it);
}
-// returns the last displayable item in the given line
-ImplToolItem* ToolBox::ImplGetLastValidItem( sal_uInt16 nLine )
-{
- if( !nLine || nLine > mnCurLines )
- return NULL;
-
- nLine--;
- ImplToolItem *pFound = NULL;
- std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin();
- while( it != mpData->m_aItems.end() )
- {
- // find correct line
- if ( it->mbBreak )
- nLine--;
- if( !nLine )
- {
- // find last useful item
- while( it != mpData->m_aItems.end() && ((it->meType == TOOLBOXITEM_BUTTON) &&
- /*it->mbEnabled &&*/ it->mbVisible && !ImplIsFixedControl( &(*it) )) )
- {
- pFound = &(*it);
- ++it;
- if( it == mpData->m_aItems.end() || it->mbBreak )
- return pFound; // end of line: return last useful item
- }
- return pFound;
- }
- ++it;
- }
-
- return pFound;
-}
-
// -----------------------------------------------------------------------
sal_uInt16 ToolBox::ImplFindItemPos( const ImplToolItem* pItem, const std::vector< ImplToolItem >& rList )
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 348ecec00104..3e32f5d02bf2 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -828,41 +828,6 @@ void ToolBox::RemoveItem( sal_uInt16 nPos )
// -----------------------------------------------------------------------
-void ToolBox::MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos )
-{
- sal_uInt16 nPos = GetItemPos( nItemId );
-
- if ( nPos == nNewPos )
- return;
-
- if ( nPos < nNewPos )
- nNewPos--;
-
- // Existiert Item
- if ( nPos != TOOLBOX_ITEM_NOTFOUND )
- {
- // ToolBox-Item in der Liste verschieben
- ImplToolItem aItem = mpData->m_aItems[nPos];
- mpData->m_aItems.erase( mpData->m_aItems.begin()+nPos );
- mpData->m_aItems.insert( (nNewPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nNewPos : mpData->m_aItems.end(), aItem );
- mpData->ImplClearLayoutData();
-
- // ToolBox neu ausgeben
- ImplInvalidate( sal_False );
-
- // Notify
- if( nPos < nNewPos ) // only send one event, all indices above this item are invalid anyway
- ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMREMOVED, reinterpret_cast< void* >( nPos ) );
- else
- {
- sal_uInt16 nNewPos2 = sal::static_int_cast<sal_uInt16>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos);
- ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos2 ) );
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
void ToolBox::CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId,
sal_uInt16 nNewPos )
{
@@ -893,29 +858,6 @@ void ToolBox::CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId,
// -----------------------------------------------------------------------
-void ToolBox::CopyItems( const ToolBox& rToolBox )
-{
- mpData->ImplClearLayoutData();
- mpData->m_aItems = rToolBox.mpData->m_aItems;
- // Absichern gegen das Loeschen im Select-Handler
- mnCurItemId = 0;
- mnHighItemId = 0;
-
- for( std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin();
- it != mpData->m_aItems.end(); ++it )
- {
- it->mpWindow = NULL;
- it->mbShowWindow = sal_False;
- }
-
- ImplInvalidate( sal_True, sal_True );
-
- // Notify
- ImplCallEventListeners( VCLEVENT_TOOLBOX_ALLITEMSCHANGED );
-}
-
-// -----------------------------------------------------------------------
-
void ToolBox::Clear()
{
mpData->m_aItems.clear();
@@ -1043,11 +985,6 @@ void ToolBox::SetPageScroll( sal_Bool b )
mpData->mbPageScroll = b;
}
-sal_Bool ToolBox::GetPageScroll()
-{
- return mpData->mbPageScroll;
-}
-
// -----------------------------------------------------------------------
void ToolBox::SetNextToolBox( const XubString& rStr )
@@ -1225,16 +1162,6 @@ Rectangle ToolBox::GetItemPosRect( sal_uInt16 nPos ) const
}
// -----------------------------------------------------------------------
-Rectangle ToolBox::GetItemDropDownRect( sal_uInt16 nItemId ) const
-{
- if ( mbCalc || mbFormat )
- ((ToolBox*)this)->ImplFormat();
-
- sal_uInt16 nPos = GetItemPos( nItemId );
- return GetItemPosDropDownRect( nPos );
-}
-
-// -----------------------------------------------------------------------
Rectangle ToolBox::GetItemPosDropDownRect( sal_uInt16 nPos ) const
{
@@ -1249,11 +1176,6 @@ Rectangle ToolBox::GetItemPosDropDownRect( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-Rectangle ToolBox::GetMenubuttonRect() const
-{
- return mpData->maMenubuttonItem.maRect;
-}
-
sal_Bool ToolBox::ImplHasExternalMenubutton()
{
// check if the borderwindow (i.e. the decoration) provides the menu button
@@ -1459,55 +1381,6 @@ Image ToolBox::GetItemImage( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-long ToolBox::GetItemImageAngle( sal_uInt16 nItemId ) const
-{
- ImplToolItem* pItem = ImplGetItem( nItemId );
-
- if ( pItem )
- return pItem->mnImageAngle;
- else
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool ToolBox::GetItemImageMirrorMode( sal_uInt16 nItemId ) const
-{
- ImplToolItem* pItem = ImplGetItem( nItemId );
-
- if ( pItem )
- return pItem->mbMirrorMode;
- else
- return sal_False;
-}
-
-// -----------------------------------------------------------------------
-
-void ToolBox::SetItemHighImage( sal_uInt16 nItemId, const Image& rImage )
-{
- ImplToolItem* pItem = ImplGetItem( nItemId );
- if ( pItem )
- {
- DBG_ASSERT( (pItem->maImage.GetSizePixel() == rImage.GetSizePixel()) ||
- ((!rImage) == sal_True), "ToolBox::SetItemHighImage() - ImageSize != HighImageSize" );
- pItem->maHighImage = rImage;
- }
-}
-
-// -----------------------------------------------------------------------
-
-Image ToolBox::GetItemHighImage( sal_uInt16 nItemId ) const
-{
- ImplToolItem* pItem = ImplGetItem( nItemId );
-
- if ( pItem )
- return pItem->maHighImage;
- else
- return Image();
-}
-
-// -----------------------------------------------------------------------
-
void ToolBox::SetItemText( sal_uInt16 nItemId, const XubString& rText )
{
sal_uInt16 nPos = GetItemPos( nItemId );
@@ -1668,18 +1541,6 @@ void ToolBox::SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease
// -----------------------------------------------------------------------
-sal_Bool ToolBox::IsItemDown( sal_uInt16 nItemId ) const
-{
- sal_uInt16 nPos = GetItemPos( nItemId );
-
- if ( nPos != TOOLBOX_ITEM_NOTFOUND )
- return (nPos == mnCurPos);
- else
- return sal_False;
-}
-
-// -----------------------------------------------------------------------
-
void ToolBox::SetItemState( sal_uInt16 nItemId, TriState eState )
{
sal_uInt16 nPos = GetItemPos( nItemId );
@@ -1969,13 +1830,6 @@ void ToolBox::SetOutStyle( sal_uInt16 nNewStyle )
// -----------------------------------------------------------------------
-void ToolBox::RecalcItems()
-{
- ImplInvalidate( sal_True );
-}
-
-// -----------------------------------------------------------------------
-
// disable key input if all items are disabled
void ToolBox::ImplUpdateInputEnable()
@@ -2066,37 +1920,6 @@ long ToolBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const
// -----------------------------------------------------------------------
-long ToolBox::GetTextCount() const
-{
- if( ! mpData->m_pLayoutData )
- ImplFillLayoutData();
- return mpData->m_pLayoutData ? mpData->m_pLayoutData->GetLineCount() : 0;
-}
-
-// -----------------------------------------------------------------------
-
-Pair ToolBox::GetTextStartEnd( long nText ) const
-{
- if( ! mpData->m_pLayoutData )
- ImplFillLayoutData();
- return mpData->m_pLayoutData ? mpData->m_pLayoutData->GetLineStartEnd( nText ) : Pair( -1, -1 );
-}
-
-// -----------------------------------------------------------------------
-
-sal_uInt16 ToolBox::GetDisplayItemId( long nText ) const
-{
- sal_uInt16 nItemId = 0;
- if( ! mpData->m_pLayoutData )
- ImplFillLayoutData();
- if( mpData->m_pLayoutData && nText >= 0 && (sal_uLong)nText < mpData->m_pLayoutData->m_aLineItemIds.size() )
- nItemId = mpData->m_pLayoutData->m_aLineItemIds[nText];
- return nItemId;
-}
-
-
-// -----------------------------------------------------------------------
-
void ToolBox::SetDropdownClickHdl( const Link& rLink )
{
mpData->maDropdownClickHdl = rLink;
@@ -2154,11 +1977,6 @@ void ToolBox::SetMenuButtonHdl( const Link& rLink )
mpData->maMenuButtonHdl = rLink;
}
-const Link& ToolBox::GetMenuButtonHdl() const
-{
- return mpData->maMenuButtonHdl;
-}
-
// -----------------------------------------------------------------------
sal_Bool ToolBox::ImplHasClippedItems()
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index b8457d1267a5..1e4157f5fcd3 100755..100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -4340,8 +4340,7 @@ Window::~Window()
if( xComponent.is() )
xComponent->dispose();
}
-
- catch ( Exception )
+ catch (const Exception&)
{
// can be safely ignored here.
}
@@ -8378,8 +8377,7 @@ uno::Reference< XDropTarget > Window::GetDropTarget()
mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = sal_True;
}
-
- catch( RuntimeException )
+ catch (const RuntimeException&)
{
// release all instances
mpWindowImpl->mpFrameData->mxDropTarget.clear();
@@ -8430,6 +8428,16 @@ uno::Reference< XDragSource > Window::GetDragSource()
aDropTargetSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.OleDropTarget"));
aDragSourceAL[ 1 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) );
aDropTargetAL[ 0 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) );
+#elif defined IOS
+ /* What does LibreOffice's use of DND concepts mean on
+ * iOS, huh, is this both inter-app DND (which clearly is
+ * meaningless), or intra-app? Anyway, use the same code
+ * as for MacOSX for now, even if meaningless...
+ */
+ aDragSourceSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.OleDragSource"));
+ aDropTargetSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.OleDropTarget"));
+ aDragSourceAL[ 1 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) );
+ aDropTargetAL[ 0 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) );
#elif defined UNX
aDropTargetAL.realloc( 3 );
aDragSourceAL.realloc( 3 );
@@ -8452,7 +8460,7 @@ uno::Reference< XDragSource > Window::GetDragSource()
}
// createInstance can throw any exception
- catch( Exception )
+ catch (const Exception&)
{
// release all instances
mpWindowImpl->mpFrameData->mxDropTarget.clear();
@@ -8532,7 +8540,7 @@ uno::Reference< XClipboard > Window::GetClipboard()
}
// createInstance can throw any exception
- catch( Exception )
+ catch (const Exception&)
{
// release all instances
mpWindowImpl->mpFrameData->mxClipboard.clear();
@@ -8584,7 +8592,7 @@ uno::Reference< XClipboard > Window::GetPrimarySelection()
}
// createInstance can throw any exception
- catch( Exception )
+ catch (const Exception&)
{
// release all instances
mpWindowImpl->mpFrameData->mxSelection.clear();
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index bf81d2665f48..a2dd24378e37 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1759,11 +1759,6 @@ sal_Bool Window::IsCompoundControl() const
return mpWindowImpl->mbCompoundControl;
}
-sal_Bool Window::HasCompoundControlFocus() const
-{
- return mpWindowImpl->mbCompoundControlHasFocus;
-}
-
sal_Bool Window::IsChildPointerOverwrite() const
{
return mpWindowImpl->mbChildPtrOverwrite;
diff --git a/vcl/source/window/window4.cxx b/vcl/source/window/window4.cxx
index 775249c450ee..b4abcf229502 100644
--- a/vcl/source/window/window4.cxx
+++ b/vcl/source/window/window4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -223,3 +224,4 @@ uno::Sequence< beans::PropertyValue > Window::getProperties() const
return aProps;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/wpropset.cxx b/vcl/source/window/wpropset.cxx
index 10e3e8fa5e2f..ceca8f8784d6 100644
--- a/vcl/source/window/wpropset.cxx
+++ b/vcl/source/window/wpropset.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -345,3 +346,5 @@ IMPL_LINK( vcl::WindowPropertySet, ChildEventListener, VclWindowEvent*, pEvent )
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx
index 24ca3c9120d5..24ca3c9120d5 100755..100644
--- a/vcl/source/window/wrkwin.cxx
+++ b/vcl/source/window/wrkwin.cxx
diff --git a/vcl/unx/generic/app/i18n_xkb.cxx b/vcl/unx/generic/app/i18n_xkb.cxx
index cb93f48b6bd7..c9e42dda6751 100644
--- a/vcl/unx/generic/app/i18n_xkb.cxx
+++ b/vcl/unx/generic/app/i18n_xkb.cxx
@@ -36,16 +36,10 @@
#include "unx/saldata.hxx"
#include "unx/i18n_xkb.hxx"
-SalI18N_KeyboardExtension::SalI18N_KeyboardExtension( Display*
-#if __XKeyboardExtension__
-pDisplay
-#endif
-)
- : mbUseExtension( (sal_Bool)__XKeyboardExtension__ ),
+SalI18N_KeyboardExtension::SalI18N_KeyboardExtension( Display* pDisplay )
+ : mbUseExtension( sal_True ),
mnDefaultGroup( 0 )
{
- #if __XKeyboardExtension__
-
mpDisplay = pDisplay;
// allow user to set the default keyboard group idx or to disable the usage
@@ -94,19 +88,11 @@ pDisplay
XkbGetState( mpDisplay, XkbUseCoreKbd, &aStateRecord );
mnGroup = aStateRecord.group;
}
-
- #endif // __XKeyboardExtension__
}
void
-SalI18N_KeyboardExtension::Dispatch( XEvent*
-#if __XKeyboardExtension__
-pEvent
-#endif
-)
+SalI18N_KeyboardExtension::Dispatch( XEvent* pEvent )
{
- #if __XKeyboardExtension__
-
// must the event be handled?
if ( !mbUseExtension
|| (pEvent->type != mnEventBase) )
@@ -130,21 +116,13 @@ pEvent
#endif
break;
}
- #endif // __XKeyboardExtension__
}
-#if __XKeyboardExtension__
sal_uInt32
SalI18N_KeyboardExtension::LookupKeysymInGroup( sal_uInt32 nKeyCode,
sal_uInt32 nShiftState,
sal_uInt32 nGroup ) const
-#else
-sal_uInt32
-SalI18N_KeyboardExtension::LookupKeysymInGroup( sal_uInt32,sal_uInt32,sal_uInt32 ) const
-#endif
{
- #if __XKeyboardExtension__
-
if ( !mbUseExtension )
return NoSymbol;
@@ -153,12 +131,6 @@ SalI18N_KeyboardExtension::LookupKeysymInGroup( sal_uInt32,sal_uInt32,sal_uInt32
KeySym nKeySymbol;
nKeySymbol = XkbKeycodeToKeysym( mpDisplay, nKeyCode, nGroup, nShiftState );
return nKeySymbol;
-
- #else
-
- return NoSymbol;
-
- #endif // __XKeyboardExtension__
}
diff --git a/vcl/unx/generic/app/keysymnames.cxx b/vcl/unx/generic/app/keysymnames.cxx
index e164d06d5d07..c2db38c2a13a 100644
--- a/vcl/unx/generic/app/keysymnames.cxx
+++ b/vcl/unx/generic/app/keysymnames.cxx
@@ -583,7 +583,7 @@ static const keyboard_layout type6_layout[] =
const char* SalDisplay::GetKeyboardName( bool bRefresh )
{
- if( bRefresh || ! m_aKeyboardName.Len() )
+ if (bRefresh || m_aKeyboardName.isEmpty())
{
#if defined(SOLARIS)
if( IsLocal() )
@@ -665,10 +665,10 @@ const char* SalDisplay::GetKeyboardName( bool bRefresh )
}
}
#endif
- if( ! m_aKeyboardName.Len() )
+ if (m_aKeyboardName.isEmpty())
m_aKeyboardName = "<unknown keyboard>";
}
- return m_aKeyboardName.GetBuffer();
+ return m_aKeyboardName.getStr();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 358bbc205004..8156b86cab08 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -885,10 +885,7 @@ void SalDisplay::Init()
sscanf( pProperties, "%li", &nProperties_ );
else
{
-#if defined DBG_UTIL || defined SUN || defined LINUX || defined FREEBSD || \
- defined NETBSD || defined OPENBSD || defined DRAGONFLY
nProperties_ |= PROPERTY_FEATURE_Maximize;
-#endif
// Server Bugs & Properties
if( GetServerVendor() == vendor_excursion )
{
@@ -909,31 +906,6 @@ void SalDisplay::Init()
if( otherwm == eWindowManager_ ) eWindowManager_ = mwm;
}
else
- if( GetServerVendor() == vendor_xfree )
- {
- nProperties_ |= PROPERTY_BUG_XCopyArea_GXxor;
-#if defined LINUX || defined FREEBSD || defined NETBSD || defined OPENBSD || \
- defined DRAGONFLY
- // otherwm and olwm are a kind of default, which are not detected
- // carefully. if we are running linux (i.e. not netbsd) on an xfree
- // display, fvwm is most probable the wm to choose, confusing with mwm
- // doesn't harm. #57791# start maximized if possible
- if( (otherwm == eWindowManager_)
- || (olwm == eWindowManager_ ))
- {
- eWindowManager_ = fvwm; // ???
- nProperties_ |= PROPERTY_FEATURE_Maximize;
- }
-#else
- if( otherwm == eWindowManager_ ) eWindowManager_ = winmgr;
-#endif
-#if defined SOLARIS && defined SPARC
- nProperties_ |= PROPERTY_BUG_Bitmap_Bit_Order;
- // solaris xlib seems to have problems with putting images
- // in correct bit order to xfree 8 bit displays
-#endif
- }
- else
if( GetServerVendor() == vendor_sun )
{
// nicht alle! (bekannt: nur Sparc II CG3, CG6?)
@@ -2358,7 +2330,7 @@ void SalX11Display::Yield()
if( pXLib_->HasXErrorOccurred() )
{
XFlush( pDisp_ );
- PrintEvent( "SalDisplay::Yield (WasXError)", &aEvent );
+ DbgPrintDisplayEvent("SalDisplay::Yield (WasXError)", &aEvent);
}
#endif
pXLib_->ResetXErrorOccurred();
@@ -2475,14 +2447,13 @@ long SalX11Display::Dispatch( XEvent *pEvent )
return 0;
}
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void SalDisplay::PrintEvent( const ByteString &rComment,
- XEvent *pEvent ) const
+#ifdef DBG_UTIL
+void SalDisplay::DbgPrintDisplayEvent(const char *pComment, XEvent *pEvent) const
{
if( pEvent->type <= MappingNotify )
{
fprintf( stderr, "[%s] %s s=%d w=%ld\n",
- rComment.GetBuffer(),
+ pComment,
EventNames[pEvent->type],
pEvent->xany.send_event,
pEvent->xany.window );
@@ -2609,11 +2580,12 @@ void SalDisplay::PrintEvent( const ByteString &rComment,
}
else
fprintf( stderr, "[%s] %d s=%d w=%ld\n",
- rComment.GetBuffer(),
+ pComment,
pEvent->type,
pEvent->xany.send_event,
pEvent->xany.window );
}
+#endif
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void SalDisplay::PrintInfo() const
diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx
index ad9b5ee22d6c..7ad584953069 100644
--- a/vcl/unx/generic/app/wmadaptor.cxx
+++ b/vcl/unx/generic/app/wmadaptor.cxx
@@ -228,8 +228,9 @@ WMAdaptor* WMAdaptor::createWMAdaptor( SalDisplay* pSalDisplay )
pAdaptor = new WMAdaptor( pSalDisplay );
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "Window Manager's name is \"%s\"\n",
- ByteString( pAdaptor->getWindowManagerName(), RTL_TEXTENCODING_ISO_8859_1 ).GetBuffer() );
+ fprintf(stderr, "Window Manager's name is \"%s\"\n",
+ rtl::OUStringToOString(pAdaptor->getWindowManagerName(),
+ RTL_TEXTENCODING_UTF8).getStr());
#endif
return pAdaptor;
}
@@ -1075,10 +1076,11 @@ void GnomeWMAdaptor::initAtoms()
void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
{
- ByteString aTitle( rWMName, osl_getThreadTextEncoding() );
+ rtl::OString aTitle(rtl::OUStringToOString(rWMName,
+ osl_getThreadTextEncoding()));
if( ! rWMName.Len() && m_aWMName.EqualsAscii( "Dtwm" ) )
- aTitle = " ";
+ aTitle = rtl::OString(' ');
::rtl::OString aWMLocale;
rtl_Locale* pLocale = NULL;
@@ -1140,7 +1142,7 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
}
#endif
- char* pT = const_cast<char*>(aTitle.GetBuffer());
+ char* pT = const_cast<char*>(aTitle.getStr());
XTextProperty aProp = { NULL, None, 0, 0 };
if( bTrustXmb )
{
@@ -1151,10 +1153,10 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
&aProp );
}
- unsigned char* pData = aProp.nitems ? aProp.value : (unsigned char*)aTitle.GetBuffer();
- Atom nType = aProp.nitems ? aProp.encoding : XA_STRING;
- int nFormat = aProp.nitems ? aProp.format : 8;
- int nBytes = aProp.nitems ? aProp.nitems : aTitle.Len();
+ unsigned char* pData = aProp.nitems ? aProp.value : (unsigned char*)aTitle.getStr();
+ Atom nType = aProp.nitems ? aProp.encoding : XA_STRING;
+ int nFormat = aProp.nitems ? aProp.format : 8;
+ int nBytes = aProp.nitems ? aProp.nitems : aTitle.getLength();
const SystemEnvData* pEnv = pFrame->GetSystemData();
XChangeProperty( m_pDisplay,
(XLIB_Window)pEnv->aShellWindow,
@@ -1195,7 +1197,7 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
{
WMAdaptor::setWMName( pFrame, rWMName );
- ByteString aTitle( rWMName, RTL_TEXTENCODING_UTF8 );
+ rtl::OString aTitle(rtl::OUStringToOString(rWMName, RTL_TEXTENCODING_UTF8));
const SystemEnvData* pEnv = pFrame->GetSystemData();
if( m_aWMAtoms[ NET_WM_NAME ] )
XChangeProperty( m_pDisplay,
@@ -1204,8 +1206,8 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
m_aWMAtoms[ UTF8_STRING ],
8,
PropModeReplace,
- (unsigned char*)aTitle.GetBuffer(),
- aTitle.Len()+1 );
+ (unsigned char*)aTitle.getStr(),
+ aTitle.getLength()+1 );
if( m_aWMAtoms[ NET_WM_ICON_NAME ] )
XChangeProperty( m_pDisplay,
(XLIB_Window)pEnv->aShellWindow,
@@ -1213,8 +1215,8 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
m_aWMAtoms[ UTF8_STRING ],
8,
PropModeReplace,
- (unsigned char*)aTitle.GetBuffer(),
- aTitle.Len()+1 );
+ (unsigned char*)aTitle.getStr(),
+ aTitle.getLength()+1 );
// The +1 copies the terminating null byte. Although
// the spec says, this should not be necessary
// at least the kwin implementation seems to depend
diff --git a/vcl/unx/generic/fontmanager/fontcache.cxx b/vcl/unx/generic/fontmanager/fontcache.cxx
index e7a4008f07f0..e47c95ec07ca 100644
--- a/vcl/unx/generic/fontmanager/fontcache.cxx
+++ b/vcl/unx/generic/fontmanager/fontcache.cxx
@@ -40,6 +40,8 @@
#include "tools/stream.hxx"
+#include <rtl/strbuf.hxx>
+
#include <unistd.h>
#include <sys/stat.h>
@@ -132,13 +134,14 @@ void FontCache::flush()
const FontDirMap& rDir( dir_it->second.m_aEntries );
ByteString aDirectory( rManager.getDirectory( dir_it->first ) );
- ByteString aLine( "FontCacheDirectory:" );
- aLine.Append( ByteString::CreateFromInt64( dir_it->second.m_nTimestamp ) );
- aLine.Append( ':' );
- aLine.Append( aDirectory );
+ rtl::OStringBuffer aLine(
+ RTL_CONSTASCII_STRINGPARAM("FontCacheDirectory:"));
+ aLine.append(dir_it->second.m_nTimestamp);
+ aLine.append(':');
+ aLine.append(aDirectory);
if( rDir.empty() && dir_it->second.m_bNoFiles )
- aLine.Insert( "Empty", 0 );
- aStream.WriteLine( aLine );
+ aLine.insert(0, RTL_CONSTASCII_STRINGPARAM("Empty"));
+ aStream.WriteLine(ByteString(aLine.makeStringAndClear()));
for( FontDirMap::const_iterator entry_it = rDir.begin(); entry_it != rDir.end(); ++entry_it )
{
@@ -147,16 +150,16 @@ void FontCache::flush()
if( rEntry.begin() == rEntry.end() )
continue;
- aLine = "File:";
- aLine.Append( ByteString( entry_it->first ) );
- aStream.WriteLine( aLine );
+ aLine.append(RTL_CONSTASCII_STRINGPARAM("File:"));
+ aLine.append(entry_it->first);
+ aStream.WriteLine(ByteString(aLine.makeStringAndClear()));
int nEntrySize = entry_it->second.m_aEntry.size();
// write: type;nfonts
- aLine = ByteString::CreateFromInt32( rEntry.front()->m_eType );
- aLine.Append( ';' );
- aLine.Append( ByteString::CreateFromInt32( nEntrySize ) );
- aStream.WriteLine( aLine );
+ aLine.append(static_cast<sal_Int32>(rEntry.front()->m_eType));
+ aLine.append(';');
+ aLine.append(static_cast<sal_Int32>(nEntrySize));
+ aStream.WriteLine(ByteString(aLine.makeStringAndClear()));
sal_Int32 nSubEntry = 0;
for( FontCacheEntry::const_iterator it = rEntry.begin(); it != rEntry.end(); ++it, nSubEntry++ )
@@ -171,73 +174,73 @@ void FontCache::flush()
else
nSubEntry = -1;
- aLine = OUStringToOString( pAtoms->getString( ATOM_FAMILYNAME, (*it)->m_nFamilyName ), RTL_TEXTENCODING_UTF8 );
+ aLine.append(OUStringToOString(pAtoms->getString( ATOM_FAMILYNAME, (*it)->m_nFamilyName), RTL_TEXTENCODING_UTF8));
for( ::std::list< int >::const_iterator name_it = (*it)->m_aAliases.begin(); name_it != (*it)->m_aAliases.end(); ++name_it )
{
const OUString& rAdd( pAtoms->getString( ATOM_FAMILYNAME, *name_it ) );
if( rAdd.getLength() )
{
- aLine.Append( ';' );
- aLine.Append( ByteString( String( rAdd ), RTL_TEXTENCODING_UTF8 ) );
+ aLine.append(';');
+ aLine.append(OUStringToOString(rAdd, RTL_TEXTENCODING_UTF8));
}
}
- aStream.WriteLine( aLine );
+ aStream.WriteLine(ByteString(aLine.makeStringAndClear()));
const OUString& rPSName( pAtoms->getString( ATOM_PSNAME, (*it)->m_nPSName ) );
- aLine = ByteString::CreateFromInt32( nSubEntry );
- aLine.Append( ';' );
- aLine.Append( ByteString( String( rPSName ), RTL_TEXTENCODING_UTF8 ) );
- aLine.Append( ';' );
- aLine.Append( ByteString::CreateFromInt32( (*it)->m_eItalic ) );
- aLine.Append( ';' );
- aLine.Append( ByteString::CreateFromInt32( (*it)->m_eWeight ) );
- aLine.Append( ';' );
- aLine.Append( ByteString::CreateFromInt32( (*it)->m_eWidth ) );
- aLine.Append( ';' );
- aLine.Append( ByteString::CreateFromInt32( (*it)->m_ePitch ) );
- aLine.Append( ';' );
- aLine.Append( ByteString::CreateFromInt32( (*it)->m_aEncoding ) );
- aLine.Append( ';' );
- aLine.Append( ByteString::CreateFromInt32( (*it)->m_nAscend ) );
- aLine.Append( ';' );
- aLine.Append( ByteString::CreateFromInt32( (*it)->m_nDescend ) );
- aLine.Append( ';' );
- aLine.Append( ByteString::CreateFromInt32( (*it)->m_nLeading ) );
- aLine.Append( ';' );
- aLine.Append( (*it)->m_bHaveVerticalSubstitutedGlyphs ? "1" : "0" );
- aLine.Append( ';' );
- aLine.Append( ByteString::CreateFromInt32( (*it)->m_aGlobalMetricX.width ) );
- aLine.Append( ';' );
- aLine.Append( ByteString::CreateFromInt32( (*it)->m_aGlobalMetricX.height ) );
- aLine.Append( ';' );
- aLine.Append( ByteString::CreateFromInt32( (*it)->m_aGlobalMetricY.width ) );
- aLine.Append( ';' );
- aLine.Append( ByteString::CreateFromInt32( (*it)->m_aGlobalMetricY.height ) );
- aLine.Append( ';' );
- aLine.Append( (*it)->m_bUserOverride ? "1" : "0" );
- aLine.Append( ';' );
- aLine.Append( ByteString::CreateFromInt32( 0 ) );
- aLine.Append( ';' );
- aLine.Append( ByteString::CreateFromInt32( 0 ) );
+ aLine.append(nSubEntry);
+ aLine.append(';');
+ aLine.append(OUStringToOString(rPSName, RTL_TEXTENCODING_UTF8));
+ aLine.append(';');
+ aLine.append(static_cast<sal_Int32>((*it)->m_eItalic));
+ aLine.append(';');
+ aLine.append(static_cast<sal_Int32>((*it)->m_eWeight));
+ aLine.append(';');
+ aLine.append(static_cast<sal_Int32>((*it)->m_eWidth));
+ aLine.append(';');
+ aLine.append(static_cast<sal_Int32>((*it)->m_ePitch));
+ aLine.append(';');
+ aLine.append(static_cast<sal_Int32>((*it)->m_aEncoding));
+ aLine.append(';');
+ aLine.append(static_cast<sal_Int32>((*it)->m_nAscend));
+ aLine.append(';');
+ aLine.append(static_cast<sal_Int32>((*it)->m_nDescend));
+ aLine.append(';');
+ aLine.append(static_cast<sal_Int32>((*it)->m_nLeading));
+ aLine.append(';');
+ aLine.append((*it)->m_bHaveVerticalSubstitutedGlyphs ? '1' : '0');
+ aLine.append(';');
+ aLine.append(static_cast<sal_Int32>((*it)->m_aGlobalMetricX.width ));
+ aLine.append(';');
+ aLine.append(static_cast<sal_Int32>((*it)->m_aGlobalMetricX.height));
+ aLine.append(';');
+ aLine.append(static_cast<sal_Int32>((*it)->m_aGlobalMetricY.width ));
+ aLine.append(';');
+ aLine.append(static_cast<sal_Int32>((*it)->m_aGlobalMetricY.height));
+ aLine.append(';');
+ aLine.append((*it)->m_bUserOverride ? '1' : '0');
+ aLine.append(';');
+ aLine.append(static_cast<sal_Int32>(0));
+ aLine.append(';');
+ aLine.append(static_cast<sal_Int32>(0));
switch( (*it)->m_eType )
{
case fonttype::Type1:
- aLine.Append( ';' );
- aLine.Append( ByteString( static_cast<const PrintFontManager::Type1FontFile*>(*it)->m_aMetricFile ) );
+ aLine.append(';');
+ aLine.append(static_cast<const PrintFontManager::Type1FontFile*>(*it)->m_aMetricFile);
break;
case fonttype::TrueType:
- aLine.Append( ';' );
- aLine.Append( ByteString::CreateFromInt32( static_cast<const PrintFontManager::TrueTypeFontFile*>(*it)->m_nTypeFlags ) );
+ aLine.append(';');
+ aLine.append(static_cast<sal_Int32>(static_cast<const PrintFontManager::TrueTypeFontFile*>(*it)->m_nTypeFlags));
break;
default: break;
}
if( (*it)->m_aStyleName.getLength() )
{
- aLine.Append( ';' );
- aLine.Append( ByteString( String( (*it)->m_aStyleName ), RTL_TEXTENCODING_UTF8 ) );
+ aLine.append(';');
+ aLine.append(OUStringToOString((*it)->m_aStyleName, RTL_TEXTENCODING_UTF8));
}
- aStream.WriteLine( aLine );
+ aStream.WriteLine(ByteString(aLine.makeStringAndClear()));
}
aStream.WriteLine( ByteString() );
}
diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx
index c1d506d91d83..38a5e93e56f3 100644
--- a/vcl/unx/generic/fontmanager/fontconfig.cxx
+++ b/vcl/unx/generic/fontmanager/fontconfig.cxx
@@ -36,53 +36,40 @@
using namespace psp;
-#ifdef ENABLE_FONTCONFIG
- #include <fontconfig/fontconfig.h>
- #include <ft2build.h>
- #include <fontconfig/fcfreetype.h>
- // allow compile on baseline (currently with fontconfig 2.2.0)
- #ifndef FC_WEIGHT_BOOK // TODO: remove when baseline moves to fc>=2.2.1
- #define FC_WEIGHT_BOOK 75
- #endif
- #ifndef FC_EMBEDDED_BITMAP // TODO: remove when baseline moves to fc>=2.3.92
- #define FC_EMBEDDED_BITMAP "embeddedbitmap"
- #endif
- #ifndef FC_FAMILYLANG // TODO: remove when baseline moves to fc>=2.2.97
- #define FC_FAMILYLANG "familylang"
- #endif
- #ifndef FC_CAPABILITY // TODO: remove when baseline moves to fc>=2.2.97
- #define FC_CAPABILITY "capability"
- #endif
- #ifndef FC_STYLELANG // TODO: remove when baseline moves to fc>=2.2.97
- #define FC_STYLELANG "stylelang"
- #endif
- #ifndef FC_HINT_STYLE // TODO: remove when baseline moves to fc>=2.2.91
- #define FC_HINT_STYLE "hintstyle"
- #define FC_HINT_NONE 0
- #define FC_HINT_SLIGHT 1
- #define FC_HINT_MEDIUM 2
- #define FC_HINT_FULL 3
- #endif
- #ifndef FC_FT_FACE
- #define FC_FT_FACE "ftface"
- #endif
- #ifndef FC_EMBOLDEN
- #define FC_EMBOLDEN "embolden"
- #endif
-#else
- typedef void FcConfig;
- typedef void FcObjectSet;
- typedef void FcPattern;
- typedef void FcFontSet;
- typedef void FcCharSet;
- typedef int FcResult;
- typedef int FcBool;
- typedef int FcMatchKind;
- typedef char FcChar8;
- typedef int FcChar32;
- typedef unsigned int FT_UInt;
- typedef void* FT_Face;
- typedef int FcSetName;
+#include <fontconfig/fontconfig.h>
+#include <ft2build.h>
+#include <fontconfig/fcfreetype.h>
+// allow compile on baseline (currently with fontconfig 2.2.0)
+#ifndef FC_WEIGHT_BOOK // TODO: remove when baseline moves to fc>=2.2.1
+ #define FC_WEIGHT_BOOK 75
+#endif
+#ifndef FC_EMBEDDED_BITMAP // TODO: remove when baseline moves to fc>=2.3.92
+ #define FC_EMBEDDED_BITMAP "embeddedbitmap"
+#endif
+#ifndef FC_FAMILYLANG // TODO: remove when baseline moves to fc>=2.2.97
+ #define FC_FAMILYLANG "familylang"
+#endif
+#ifndef FC_CAPABILITY // TODO: remove when baseline moves to fc>=2.2.97
+ #define FC_CAPABILITY "capability"
+#endif
+#ifndef FC_STYLELANG // TODO: remove when baseline moves to fc>=2.2.97
+ #define FC_STYLELANG "stylelang"
+#endif
+#ifndef FC_HINT_STYLE // TODO: remove when baseline moves to fc>=2.2.91
+ #define FC_HINT_STYLE "hintstyle"
+ #define FC_HINT_NONE 0
+ #define FC_HINT_SLIGHT 1
+ #define FC_HINT_MEDIUM 2
+ #define FC_HINT_FULL 3
+#endif
+#ifndef FC_FT_FACE
+ #define FC_FT_FACE "ftface"
+#endif
+#ifndef FC_EMBOLDEN
+ #define FC_EMBOLDEN "embolden"
+#endif
+#ifndef FC_FONTFORMAT
+ #define FC_FONTFORMAT "fontformat"
#endif
#include <cstdio>
@@ -114,53 +101,8 @@ namespace
class FontCfgWrapper
{
- oslModule m_pLib;
FcFontSet* m_pOutlineSet;
- int m_nFcVersion;
- FcBool (*m_pFcInit)();
- void (*m_pFcFini)();
- int (*m_pFcGetVersion)();
- FcConfig* (*m_pFcConfigGetCurrent)();
- FcObjectSet* (*m_pFcObjectSetVaBuild)(const char*,va_list);
- void (*m_pFcObjectSetDestroy)(FcObjectSet* pSet);
- FcPattern* (*m_pFcPatternCreate)();
- void (*m_pFcPatternDestroy)(FcPattern*);
- FcBool (*m_pFcPatternEqual)(const FcPattern*,const FcPattern*);
- FcFontSet* (*m_pFcConfigGetFonts)(FcConfig*,FcSetName);
- FcFontSet* (*m_pFcFontSetCreate)();
- FcCharSet* (*m_pFcCharSetCreate)();
- FcBool (*m_pFcCharSetAddChar)(FcCharSet *, FcChar32);
- FcBool (*m_pFcCharSetHasChar)(FcCharSet *, FcChar32);
- void (*m_pFcCharSetDestroy)(FcCharSet*);
- void (*m_pFcFontSetDestroy)(FcFontSet*);
- FcBool (*m_pFcFontSetAdd)(FcFontSet*,FcPattern*);
- void (*m_pFcPatternReference)(FcPattern*);
- FcResult (*m_pFcPatternGetCharSet)(const FcPattern*,const char*,int,FcCharSet**);
- FcResult (*m_pFcPatternGetString)(const FcPattern*,const char*,int,FcChar8**);
- FcResult (*m_pFcPatternGetInteger)(const FcPattern*,const char*,int,int*);
- FcResult (*m_pFcPatternGetDouble)(const FcPattern*,const char*,int,double*);
- FcResult (*m_pFcPatternGetBool)(const FcPattern*,const char*,int,FcBool*);
- void (*m_pFcDefaultSubstitute)(FcPattern *);
- FcPattern* (*m_pFcFontSetMatch)(FcConfig*,FcFontSet**, int, FcPattern*,FcResult*);
- FcPattern* (*m_pFcFontMatch)(FcConfig*,FcPattern*,FcResult*);
- FcBool (*m_pFcConfigAppFontAddFile)(FcConfig*, const FcChar8*);
- FcBool (*m_pFcConfigAppFontAddDir)(FcConfig*, const FcChar8*);
- FcBool (*m_pFcConfigParseAndLoad)(FcConfig*,const FcChar8*,FcBool);
- FcBool (*m_pFcConfigSubstitute)(FcConfig*,FcPattern*,FcMatchKind);
-
- FcPattern* (*m_pFcPatternDuplicate)(const FcPattern*);
- FcBool (*m_pFcPatternAddInteger)(FcPattern*,const char*,int);
- FcBool (*m_pFcPatternAddDouble)(FcPattern*,const char*,double);
- FcBool (*m_pFcPatternAddBool)(FcPattern*,const char*,FcBool);
- FcBool (*m_pFcPatternAddCharSet)(FcPattern*,const char*,const FcCharSet*);
- FcBool (*m_pFcPatternAddString)(FcPattern*,const char*,const FcChar8*);
- FcBool (*m_pFcPatternDel)(FcPattern*,const char*);
-
- FT_UInt (*m_pFcFreeTypeCharIndex)(FT_Face,FcChar32);
- FcBool (*m_pFcPatternAddFTFace)(FcPattern*,const char*,const FT_Face);
-
- oslGenericFunction loadSymbol( const char* );
void addFontSet( FcSetName );
FontCfgWrapper();
@@ -170,127 +112,8 @@ public:
static FontCfgWrapper& get();
static void release();
- bool isValid() const
- { return m_pLib != NULL;}
-
FcFontSet* getFontSet();
- FcBool FcInit()
- { return m_pFcInit(); }
-
- void FcFini()
- {
- //To-Do: get gtk vclplug smoketest to pass
- //if (m_pFcFini) m_pFcFini();
- }
-
- int FcGetVersion()
- { return m_pFcGetVersion(); }
-
- FcConfig* FcConfigGetCurrent()
- { return m_pFcConfigGetCurrent(); }
-
- FcObjectSet* FcObjectSetBuild( const char* first, ... )
- {
- va_list ap;
- va_start( ap, first );
- FcObjectSet* pSet = m_pFcObjectSetVaBuild( first, ap );
- va_end( ap );
- return pSet;
- }
-
- void FcObjectSetDestroy( FcObjectSet* pSet )
- { m_pFcObjectSetDestroy( pSet ); }
-
- FcPattern* FcPatternCreate()
- { return m_pFcPatternCreate(); }
-
- void FcPatternDestroy( FcPattern* pPattern )
- { if (m_pFcPatternDestroy) m_pFcPatternDestroy( pPattern ); }
-
- FcBool FcPatternEqual( const FcPattern* pPatternA, const FcPattern *pPatternB )
- { return m_pFcPatternEqual( pPatternA, pPatternB ); }
-
- FcFontSet* FcConfigGetFonts( FcConfig* pConfig, FcSetName eSet)
- { return m_pFcConfigGetFonts( pConfig, eSet ); }
-
- FcFontSet* FcFontSetCreate()
- { return m_pFcFontSetCreate(); }
-
- FcCharSet* FcCharSetCreate()
- { return m_pFcCharSetCreate(); }
-
- FcBool FcCharSetAddChar(FcCharSet *fcs, FcChar32 ucs4)
- { return m_pFcCharSetAddChar(fcs, ucs4); }
-
- FcBool FcCharSetHasChar(FcCharSet *fcs, FcChar32 ucs4)
- { return m_pFcCharSetHasChar(fcs, ucs4); }
-
- void FcCharSetDestroy( FcCharSet* pSet )
- { m_pFcCharSetDestroy( pSet );}
-
- void FcFontSetDestroy( FcFontSet* pSet )
- { m_pFcFontSetDestroy( pSet );}
-
- FcBool FcFontSetAdd( FcFontSet* pSet, FcPattern* pPattern )
- { return m_pFcFontSetAdd( pSet, pPattern ); }
-
- void FcPatternReference( FcPattern* pPattern )
- { m_pFcPatternReference( pPattern ); }
-
- FcResult FcPatternGetCharSet( const FcPattern* pPattern, const char* object, int n, FcCharSet** s )
- { return m_pFcPatternGetCharSet( pPattern, object, n, s ); }
-
- FcResult FcPatternGetString( const FcPattern* pPattern, const char* object, int n, FcChar8** s )
- { return m_pFcPatternGetString( pPattern, object, n, s ); }
-
- FcResult FcPatternGetInteger( const FcPattern* pPattern, const char* object, int n, int* s )
- { return m_pFcPatternGetInteger( pPattern, object, n, s ); }
-
- FcResult FcPatternGetDouble( const FcPattern* pPattern, const char* object, int n, double* s )
- { return m_pFcPatternGetDouble( pPattern, object, n, s ); }
-
- FcResult FcPatternGetBool( const FcPattern* pPattern, const char* object, int n, FcBool* s )
- { return m_pFcPatternGetBool( pPattern, object, n, s ); }
- FcBool FcConfigAppFontAddFile( FcConfig* pConfig, const FcChar8* pFileName )
- { return m_pFcConfigAppFontAddFile( pConfig, pFileName ); }
- FcBool FcConfigAppFontAddDir(FcConfig* pConfig, const FcChar8* pDirName )
- { return m_pFcConfigAppFontAddDir( pConfig, pDirName ); }
- FcBool FcConfigParseAndLoad( FcConfig* pConfig, const FcChar8* pFileName, FcBool bComplain )
- { return m_pFcConfigParseAndLoad( pConfig, pFileName, bComplain ); }
-
- void FcDefaultSubstitute( FcPattern* pPattern )
- { m_pFcDefaultSubstitute( pPattern ); }
- FcPattern* FcFontSetMatch( FcConfig* pConfig, FcFontSet **ppFontSet, int nset, FcPattern* pPattern, FcResult* pResult )
- { return m_pFcFontSetMatch ? m_pFcFontSetMatch( pConfig, ppFontSet, nset, pPattern, pResult ) : 0; }
- FcPattern* FcFontMatch( FcConfig* pConfig, FcPattern* pPattern, FcResult* pResult )
- { return m_pFcFontMatch( pConfig, pPattern, pResult ); }
- FcBool FcConfigSubstitute( FcConfig* pConfig, FcPattern* pPattern, FcMatchKind eKind )
- { return m_pFcConfigSubstitute( pConfig, pPattern, eKind ); }
-
- FcPattern* FcPatternDuplicate( const FcPattern* pPattern ) const
- { return m_pFcPatternDuplicate( pPattern ); }
- FcBool FcPatternAddInteger( FcPattern* pPattern, const char* pObject, int nValue )
- { return m_pFcPatternAddInteger( pPattern, pObject, nValue ); }
- FcBool FcPatternAddDouble( FcPattern* pPattern, const char* pObject, double nValue )
- { return m_pFcPatternAddDouble( pPattern, pObject, nValue ); }
- FcBool FcPatternAddString( FcPattern* pPattern, const char* pObject, const FcChar8* pString )
- { return m_pFcPatternAddString( pPattern, pObject, pString ); }
- FcBool FcPatternAddBool( FcPattern* pPattern, const char* pObject, bool nValue )
- { return m_pFcPatternAddBool( pPattern, pObject, nValue ); }
- FcBool FcPatternAddCharSet(FcPattern* pPattern,const char* pObject,const FcCharSet*pCharSet)
- { return m_pFcPatternAddCharSet(pPattern,pObject,pCharSet); }
- FcBool FcPatternDel(FcPattern* pPattern, const char* object)
- { return m_pFcPatternDel( pPattern, object); }
-
- FT_UInt FcFreeTypeCharIndex( FT_Face face, FcChar32 ucs4 )
- { return m_pFcFreeTypeCharIndex ? m_pFcFreeTypeCharIndex( face, ucs4 ) : 0; }
- FcBool FcPatternAddFTFace( FcPattern* pPattern, const char* pObject, const FT_Face nValue )
- {
- return m_pFcPatternAddFTFace
- ? m_pFcPatternAddFTFace( pPattern, pObject, nValue )
- : false;
- }
public:
FcResult LocalizedElementFromPattern(FcPattern* pPattern, FcChar8 **family,
const char *elementtype, const char *elementlangtype);
@@ -301,189 +124,14 @@ private:
void cacheLocalizedFontNames(FcChar8 *origfontname, FcChar8 *bestfontname, const std::vector< lang_and_element > &lang_and_elements);
};
-oslGenericFunction FontCfgWrapper::loadSymbol( const char* pSymbol )
-{
- OUString aSym( OUString::createFromAscii( pSymbol ) );
- oslGenericFunction pSym = osl_getFunctionSymbol( m_pLib, aSym.pData );
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "%s %s\n", pSymbol, pSym ? "found" : "not found" );
-#endif
- return pSym;
-}
-
FontCfgWrapper::FontCfgWrapper()
- : m_pLib( NULL ),
- m_pOutlineSet( NULL ),
- m_nFcVersion( 0 )
+ : m_pOutlineSet( NULL )
{
- OUString aLib( RTL_CONSTASCII_USTRINGPARAM( "libfontconfig.so.1" ) );
- m_pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY );
- if( !m_pLib )
- {
- aLib = OUString( RTL_CONSTASCII_USTRINGPARAM( "libfontconfig.so" ) );
- m_pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY );
- }
-
- if( ! m_pLib )
- {
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "no libfontconfig\n" );
-#endif
- return;
- }
-
- m_pFcInit = (FcBool(*)())
- loadSymbol( "FcInit" );
- m_pFcFini = (void(*)())
- loadSymbol( "FcFini" );
- m_pFcGetVersion = (int(*)())
- loadSymbol( "FcGetVersion" );
- m_pFcConfigGetCurrent = (FcConfig *(*)())
- loadSymbol( "FcConfigGetCurrent" );
- m_pFcObjectSetVaBuild = (FcObjectSet*(*)(const char*,va_list))
- loadSymbol( "FcObjectSetVaBuild" );
- m_pFcObjectSetDestroy = (void(*)(FcObjectSet*))
- loadSymbol( "FcObjectSetDestroy" );
- m_pFcPatternCreate = (FcPattern*(*)())
- loadSymbol( "FcPatternCreate" );
- m_pFcPatternDestroy = (void(*)(FcPattern*))
- loadSymbol( "FcPatternDestroy" );
- m_pFcPatternEqual = (FcBool(*)(const FcPattern*,const FcPattern*))
- loadSymbol( "FcPatternEqual" );
- m_pFcConfigGetFonts = (FcFontSet*(*)(FcConfig*,FcSetName))
- loadSymbol( "FcConfigGetFonts" );
- m_pFcFontSetCreate = (FcFontSet*(*)())
- loadSymbol( "FcFontSetCreate" );
- m_pFcCharSetCreate = (FcCharSet*(*)())
- loadSymbol( "FcCharSetCreate" );
- m_pFcCharSetAddChar = (FcBool(*)(FcCharSet*, FcChar32))
- loadSymbol( "FcCharSetAddChar" );
- m_pFcCharSetHasChar = (FcBool(*)(FcCharSet*, FcChar32))
- loadSymbol( "FcCharSetHasChar" );
- m_pFcCharSetDestroy = (void(*)(FcCharSet*))
- loadSymbol( "FcCharSetDestroy" );
- m_pFcFontSetDestroy = (void(*)(FcFontSet*))
- loadSymbol( "FcFontSetDestroy" );
- m_pFcFontSetAdd = (FcBool(*)(FcFontSet*,FcPattern*))
- loadSymbol( "FcFontSetAdd" );
- m_pFcPatternReference = (void(*)(FcPattern*))
- loadSymbol( "FcPatternReference" );
- m_pFcPatternGetCharSet = (FcResult(*)(const FcPattern*,const char*,int,FcCharSet**))
- loadSymbol( "FcPatternGetCharSet" );
- m_pFcPatternGetString = (FcResult(*)(const FcPattern*,const char*,int,FcChar8**))
- loadSymbol( "FcPatternGetString" );
- m_pFcPatternGetInteger = (FcResult(*)(const FcPattern*,const char*,int,int*))
- loadSymbol( "FcPatternGetInteger" );
- m_pFcPatternGetDouble = (FcResult(*)(const FcPattern*,const char*,int,double*))
- loadSymbol( "FcPatternGetDouble" );
- m_pFcPatternGetBool = (FcResult(*)(const FcPattern*,const char*,int,FcBool*))
- loadSymbol( "FcPatternGetBool" );
- m_pFcConfigAppFontAddFile = (FcBool(*)(FcConfig*, const FcChar8*))
- loadSymbol( "FcConfigAppFontAddFile" );
- m_pFcConfigAppFontAddDir = (FcBool(*)(FcConfig*, const FcChar8*))
- loadSymbol( "FcConfigAppFontAddDir" );
- m_pFcConfigParseAndLoad = (FcBool(*)(FcConfig*, const FcChar8*, FcBool))
- loadSymbol( "FcConfigParseAndLoad" );
- m_pFcDefaultSubstitute = (void(*)(FcPattern *))
- loadSymbol( "FcDefaultSubstitute" );
- m_pFcFontSetMatch = (FcPattern*(*)(FcConfig*,FcFontSet**,int,FcPattern*,FcResult*))
- loadSymbol( "FcFontSetMatch" );
- m_pFcFontMatch = (FcPattern*(*)(FcConfig*,FcPattern*,FcResult*))
- loadSymbol( "FcFontMatch" );
- m_pFcConfigSubstitute = (FcBool(*)(FcConfig*,FcPattern*,FcMatchKind))
- loadSymbol( "FcConfigSubstitute" );
-
- m_pFcPatternDuplicate = (FcPattern*(*)(const FcPattern*))
- loadSymbol( "FcPatternDuplicate" );
- m_pFcPatternAddInteger = (FcBool(*)(FcPattern*,const char*,int))
- loadSymbol( "FcPatternAddInteger" );
- m_pFcPatternAddDouble = (FcBool(*)(FcPattern*,const char*,double))
- loadSymbol( "FcPatternAddDouble" );
- m_pFcPatternAddBool = (FcBool(*)(FcPattern*,const char*,FcBool))
- loadSymbol( "FcPatternAddBool" );
- m_pFcPatternAddCharSet = (FcBool(*)(FcPattern*,const char*,const FcCharSet *))
- loadSymbol( "FcPatternAddCharSet" );
- m_pFcPatternAddString = (FcBool(*)(FcPattern*,const char*,const FcChar8*))
- loadSymbol( "FcPatternAddString" );
- m_pFcPatternDel = (FcBool(*)(FcPattern*,const char*))
- loadSymbol( "FcPatternDel" );
-
- m_pFcFreeTypeCharIndex = (FT_UInt(*)(FT_Face,FcChar32))
- loadSymbol( "FcFreeTypeCharIndex" );
- m_pFcPatternAddFTFace = (FcBool(*)(FcPattern*,const char*,const FT_Face))
- loadSymbol( "FcPatternAddFTFace" );
-
- m_nFcVersion = FcGetVersion();
-#if (OSL_DEBUG_LEVEL > 1)
- fprintf( stderr,"FC_VERSION = %05d\n", m_nFcVersion );
-#endif
- // make minimum version configurable
- const char* pMinFcVersion = getenv( "SAL_MIN_FC_VERSION");
- if( pMinFcVersion )
- {
- const int nMinFcVersion = atoi( pMinFcVersion );
- if( m_nFcVersion < nMinFcVersion )
- m_pFcInit = NULL;
- }
-
- if( ! (
- m_pFcInit &&
- m_pFcGetVersion &&
- m_pFcConfigGetCurrent &&
- m_pFcObjectSetVaBuild &&
- m_pFcObjectSetDestroy &&
- m_pFcPatternCreate &&
- m_pFcPatternDestroy &&
- m_pFcPatternEqual &&
- m_pFcConfigGetFonts &&
- m_pFcFontSetCreate &&
- m_pFcCharSetCreate &&
- m_pFcCharSetAddChar &&
- m_pFcCharSetHasChar &&
- m_pFcCharSetDestroy &&
- m_pFcFontSetDestroy &&
- m_pFcFontSetAdd &&
- m_pFcPatternReference &&
- m_pFcPatternGetCharSet &&
- m_pFcPatternGetString &&
- m_pFcPatternGetInteger &&
- m_pFcPatternGetDouble &&
- m_pFcPatternGetBool &&
- m_pFcConfigAppFontAddFile &&
- m_pFcConfigAppFontAddDir &&
- m_pFcConfigParseAndLoad &&
- m_pFcFontMatch &&
- m_pFcDefaultSubstitute &&
- m_pFcConfigSubstitute &&
- m_pFcPatternDuplicate &&
- m_pFcPatternAddInteger &&
- m_pFcPatternAddDouble &&
- m_pFcPatternAddCharSet &&
- m_pFcPatternAddBool &&
- m_pFcPatternAddString &&
- m_pFcPatternDel
- ) )
- {
- osl_unloadModule( (oslModule)m_pLib );
- m_pLib = NULL;
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "not all needed symbols were found in libfontconfig\n" );
-#endif
- return;
- }
-
-
FcInit();
- if( ! FcConfigGetCurrent() )
- {
- osl_unloadModule( (oslModule)m_pLib );
- m_pLib = NULL;
- }
}
void FontCfgWrapper::addFontSet( FcSetName eSetName )
{
- #ifdef ENABLE_FONTCONFIG
/*
add only acceptable outlined fonts to our config,
for future fontconfig use
@@ -506,20 +154,16 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName )
}
// TODO?: FcFontSetDestroy( pOrig );
- #else
- (void)eSetName; // prevent compiler warning about unused parameter
- #endif
}
-#ifdef ENABLE_FONTCONFIG
namespace
{
- int compareFontNames(FontCfgWrapper& rWrapper, const FcPattern *a, const FcPattern *b)
+ int compareFontNames(const FcPattern *a, const FcPattern *b)
{
FcChar8 *pNameA=NULL, *pNameB=NULL;
- bool bHaveA = rWrapper.FcPatternGetString(a, FC_FAMILY, 0, &pNameA) == FcResultMatch;
- bool bHaveB = rWrapper.FcPatternGetString(b, FC_FAMILY, 0, &pNameB) == FcResultMatch;
+ bool bHaveA = FcPatternGetString(a, FC_FAMILY, 0, &pNameA) == FcResultMatch;
+ bool bHaveB = FcPatternGetString(b, FC_FAMILY, 0, &pNameB) == FcResultMatch;
if (bHaveA && bHaveB)
return strcmp((const char*)pNameA, (const char*)pNameB);
@@ -531,21 +175,17 @@ namespace
//those with higher version numbers first
class SortFont : public ::std::binary_function< const FcPattern*, const FcPattern*, bool >
{
- private:
- FontCfgWrapper& m_rWrapper;
public:
- SortFont(FontCfgWrapper& rWrapper) : m_rWrapper(rWrapper) {}
-
bool operator()(const FcPattern *a, const FcPattern *b)
{
- int comp = compareFontNames(m_rWrapper, a, b);
+ int comp = compareFontNames(a, b);
if (comp != 0)
return comp < 0;
int nVersionA=0, nVersionB=0;
- bool bHaveA = m_rWrapper.FcPatternGetInteger(a, FC_FONTVERSION, 0, &nVersionA) == FcResultMatch;
- bool bHaveB = m_rWrapper.FcPatternGetInteger(b, FC_FONTVERSION, 0, &nVersionB) == FcResultMatch;
+ bool bHaveA = FcPatternGetInteger(a, FC_FONTVERSION, 0, &nVersionA) == FcResultMatch;
+ bool bHaveB = FcPatternGetInteger(b, FC_FONTVERSION, 0, &nVersionB) == FcResultMatch;
if (bHaveA && bHaveB)
return nVersionA > nVersionB;
@@ -560,7 +200,7 @@ namespace
//See if this font is a duplicate with equal attributes which has already been
//inserted, or if it an older version of an inserted fonts. Depends on FcFontSet
//on being sorted with SortFont
- bool isPreviouslyDuplicateOrObsoleted(FontCfgWrapper& rWrapper, FcFontSet *pFSet, int i)
+ bool isPreviouslyDuplicateOrObsoleted(FcFontSet *pFSet, int i)
{
if (i == 0)
return false;
@@ -568,46 +208,41 @@ namespace
const FcPattern *a = pFSet->fonts[i];
const FcPattern *b = pFSet->fonts[i-1];
- if (compareFontNames(rWrapper, a, b) != 0)
+ if (compareFontNames(a, b) != 0)
return false;
- FcPattern* pTestPatternA = rWrapper.FcPatternDuplicate(a);
- rWrapper.FcPatternDel(pTestPatternA, FC_FILE);
- rWrapper.FcPatternDel(pTestPatternA, FC_CHARSET);
- rWrapper.FcPatternDel(pTestPatternA, FC_CAPABILITY);
- rWrapper.FcPatternDel(pTestPatternA, FC_FONTVERSION);
+ FcPattern* pTestPatternA = FcPatternDuplicate(a);
+ FcPatternDel(pTestPatternA, FC_FILE);
+ FcPatternDel(pTestPatternA, FC_CHARSET);
+ FcPatternDel(pTestPatternA, FC_CAPABILITY);
+ FcPatternDel(pTestPatternA, FC_FONTVERSION);
- FcPattern* pTestPatternB = rWrapper.FcPatternDuplicate(b);
- rWrapper.FcPatternDel(pTestPatternB, FC_FILE);
- rWrapper.FcPatternDel(pTestPatternB, FC_CHARSET);
- rWrapper.FcPatternDel(pTestPatternB, FC_CAPABILITY);
- rWrapper.FcPatternDel(pTestPatternB, FC_FONTVERSION);
+ FcPattern* pTestPatternB = FcPatternDuplicate(b);
+ FcPatternDel(pTestPatternB, FC_FILE);
+ FcPatternDel(pTestPatternB, FC_CHARSET);
+ FcPatternDel(pTestPatternB, FC_CAPABILITY);
+ FcPatternDel(pTestPatternB, FC_FONTVERSION);
- bool bIsDup = false;
- if (rWrapper.FcPatternEqual(pTestPatternA, pTestPatternB))
- bIsDup = true;
+ bool bIsDup = FcPatternEqual(pTestPatternA, pTestPatternB);
- rWrapper.FcPatternDestroy(pTestPatternB);
- rWrapper.FcPatternDestroy(pTestPatternA);
+ FcPatternDestroy(pTestPatternB);
+ FcPatternDestroy(pTestPatternA);
return bIsDup;
}
}
-#endif
FcFontSet* FontCfgWrapper::getFontSet()
{
- #ifdef ENABLE_FONTCONFIG
if( !m_pOutlineSet )
{
m_pOutlineSet = FcFontSetCreate();
addFontSet( FcSetSystem );
- if( m_nFcVersion > 20400 ) // #i85462# prevent crashes
+ if( FcGetVersion() > 20400 ) // #i85462# prevent crashes
addFontSet( FcSetApplication );
- ::std::sort(m_pOutlineSet->fonts,m_pOutlineSet->fonts+m_pOutlineSet->nfont,SortFont(*this));
+ ::std::sort(m_pOutlineSet->fonts,m_pOutlineSet->fonts+m_pOutlineSet->nfont,SortFont());
}
- #endif
return m_pOutlineSet;
}
@@ -616,9 +251,8 @@ FontCfgWrapper::~FontCfgWrapper()
{
if( m_pOutlineSet )
FcFontSetDestroy( m_pOutlineSet );
- FcFini();
- if( m_pLib )
- osl_unloadModule( (oslModule)m_pLib );
+ //To-Do: get gtk vclplug smoketest to pass
+ //FcFini();
}
static FontCfgWrapper* pOneInstance = NULL;
@@ -639,7 +273,6 @@ void FontCfgWrapper::release()
}
}
-#ifdef ENABLE_FONTCONFIG
namespace
{
class localizedsorter
@@ -749,9 +382,7 @@ FcResult FontCfgWrapper::LocalizedElementFromPattern(FcPattern* pPattern, FcChar
*/
bool PrintFontManager::initFontconfig()
{
- FontCfgWrapper& rWrapper = FontCfgWrapper::get();
- if( ! rWrapper.isValid() )
- return false;
+ FontCfgWrapper::get();
return true;
}
@@ -827,8 +458,6 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, i
int nFonts = 0;
FontCfgWrapper& rWrapper = FontCfgWrapper::get();
- if( !rWrapper.isValid() )
- return 0;
FcFontSet* pFSet = rWrapper.getFontSet();
if( pFSet )
@@ -841,20 +470,22 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, i
FcChar8* file = NULL;
FcChar8* family = NULL;
FcChar8* style = NULL;
+ FcChar8* format = NULL;
int slant = 0;
int weight = 0;
int spacing = 0;
int nCollectionEntry = -1;
FcBool outline = false;
- FcResult eFileRes = rWrapper.FcPatternGetString( pFSet->fonts[i], FC_FILE, 0, &file );
+ FcResult eFileRes = FcPatternGetString(pFSet->fonts[i], FC_FILE, 0, &file);
FcResult eFamilyRes = rWrapper.LocalizedElementFromPattern( pFSet->fonts[i], &family, FC_FAMILY, FC_FAMILYLANG );
FcResult eStyleRes = rWrapper.LocalizedElementFromPattern( pFSet->fonts[i], &style, FC_STYLE, FC_STYLELANG );
- FcResult eSlantRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_SLANT, 0, &slant );
- FcResult eWeightRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_WEIGHT, 0, &weight );
- FcResult eSpacRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_SPACING, 0, &spacing );
- FcResult eOutRes = rWrapper.FcPatternGetBool( pFSet->fonts[i], FC_OUTLINE, 0, &outline );
- FcResult eIndexRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_INDEX, 0, &nCollectionEntry );
+ FcResult eSlantRes = FcPatternGetInteger(pFSet->fonts[i], FC_SLANT, 0, &slant);
+ FcResult eWeightRes = FcPatternGetInteger(pFSet->fonts[i], FC_WEIGHT, 0, &weight);
+ FcResult eSpacRes = FcPatternGetInteger(pFSet->fonts[i], FC_SPACING, 0, &spacing);
+ FcResult eOutRes = FcPatternGetBool(pFSet->fonts[i], FC_OUTLINE, 0, &outline);
+ FcResult eIndexRes = FcPatternGetInteger(pFSet->fonts[i], FC_INDEX, 0, &nCollectionEntry);
+ FcResult eFormatRes = FcPatternGetString(pFSet->fonts[i], FC_FONTFORMAT, 0, &format);
if( eFileRes != FcResultMatch || eFamilyRes != FcResultMatch || eOutRes != FcResultMatch )
continue;
@@ -862,13 +493,14 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, i
#if (OSL_DEBUG_LEVEL > 2)
fprintf( stderr, "found font \"%s\" in file %s\n"
" weight = %d, slant = %d, style = \"%s\"\n"
- " spacing = %d, outline = %d\n"
+ " spacing = %d, outline = %d, format %s\n"
, family, file
, eWeightRes == FcResultMatch ? weight : -1
, eSpacRes == FcResultMatch ? slant : -1
, eStyleRes == FcResultMatch ? (const char*) style : "<nil>"
, eSpacRes == FcResultMatch ? spacing : -1
, eOutRes == FcResultMatch ? outline : -1
+ , eFormatRes == FcResultMatch ? (const char*)format : "<unknown>"
);
#endif
@@ -878,7 +510,7 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, i
if( eOutRes == FcResultMatch && ! outline )
continue;
- if (isPreviouslyDuplicateOrObsoleted(rWrapper, pFSet, i))
+ if (isPreviouslyDuplicateOrObsoleted(pFSet, i))
{
#if OSL_DEBUG_LEVEL > 2
fprintf(stderr, "Ditching %s as duplicate/obsolete\n", file);
@@ -903,7 +535,9 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, i
// not known, analyze font file to get attributes
// not described by fontconfig (e.g. alias names, PSName)
std::list< OString > aDummy;
- analyzeFontFile( nDirID, aBase, aDummy, aFonts );
+ if (eFormatRes != FcResultMatch)
+ format = NULL;
+ analyzeFontFile( nDirID, aBase, aDummy, aFonts, (const char*)format );
#if OSL_DEBUG_LEVEL > 1
if( aFonts.empty() )
fprintf( stderr, "Warning: file \"%s\" is unusable to psprint\n", aOrgPath.getStr() );
@@ -1004,25 +638,15 @@ void PrintFontManager::deinitFontconfig()
FontCfgWrapper::release();
}
-int PrintFontManager::FreeTypeCharIndex( void *pFace, sal_uInt32 aChar )
-{
- FontCfgWrapper& rWrapper = FontCfgWrapper::get();
- return rWrapper.isValid() ? rWrapper.FcFreeTypeCharIndex( (FT_Face)pFace, aChar ) : 0;
-}
-
bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName )
{
- FontCfgWrapper& rWrapper = FontCfgWrapper::get();
- if( ! rWrapper.isValid() )
- return false;
-
// workaround for a stability problems in older FC versions
// when handling application specifc fonts
- const int nVersion = rWrapper.FcGetVersion();
+ const int nVersion = FcGetVersion();
if( nVersion <= 20400 )
return false;
const char* pDirName = (const char*)rDirName.getStr();
- bool bDirOk = (rWrapper.FcConfigAppFontAddDir( rWrapper.FcConfigGetCurrent(), (FcChar8*)pDirName ) == FcTrue);
+ bool bDirOk = (FcConfigAppFontAddDir(FcConfigGetCurrent(), (FcChar8*)pDirName ) == FcTrue);
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "FcConfigAppFontAddDir( \"%s\") => %d\n", pDirName, bDirOk );
@@ -1037,8 +661,8 @@ bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName )
if( pCfgFile )
{
fclose( pCfgFile);
- bool bCfgOk = rWrapper.FcConfigParseAndLoad( rWrapper.FcConfigGetCurrent(),
- (FcChar8*)aConfFileName.getStr(), FcTrue );
+ bool bCfgOk = FcConfigParseAndLoad(FcConfigGetCurrent(),
+ (FcChar8*)aConfFileName.getStr(), FcTrue);
if( !bCfgOk )
fprintf( stderr, "FcConfigParseAndLoad( \"%s\") => %d\n", aConfFileName.getStr(), bCfgOk );
}
@@ -1046,7 +670,7 @@ bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName )
return true;
}
-static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
+static void addtopattern(FcPattern *pPattern,
FontItalic eItalic, FontWeight eWeight, FontWidth eWidth, FontPitch ePitch)
{
if( eItalic != ITALIC_DONTKNOW )
@@ -1054,12 +678,16 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
int nSlant = FC_SLANT_ROMAN;
switch( eItalic )
{
- case ITALIC_NORMAL: nSlant = FC_SLANT_ITALIC;break;
- case ITALIC_OBLIQUE: nSlant = FC_SLANT_OBLIQUE;break;
+ case ITALIC_NORMAL:
+ nSlant = FC_SLANT_ITALIC;
+ break;
+ case ITALIC_OBLIQUE:
+ nSlant = FC_SLANT_OBLIQUE;
+ break;
default:
break;
}
- rWrapper.FcPatternAddInteger( pPattern, FC_SLANT, nSlant );
+ FcPatternAddInteger(pPattern, FC_SLANT, nSlant);
}
if( eWeight != WEIGHT_DONTKNOW )
{
@@ -1079,7 +707,7 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
default:
break;
}
- rWrapper.FcPatternAddInteger( pPattern, FC_WEIGHT, nWeight );
+ FcPatternAddInteger(pPattern, FC_WEIGHT, nWeight);
}
if( eWidth != WIDTH_DONTKNOW )
{
@@ -1098,7 +726,7 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
default:
break;
}
- rWrapper.FcPatternAddInteger( pPattern, FC_WIDTH, nWidth );
+ FcPatternAddInteger(pPattern, FC_WIDTH, nWidth);
}
if( ePitch != PITCH_DONTKNOW )
{
@@ -1110,9 +738,9 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
default:
break;
}
- rWrapper.FcPatternAddInteger( pPattern, FC_SPACING, nSpacing );
+ FcPatternAddInteger(pPattern, FC_SPACING, nSpacing);
if (nSpacing == FC_MONO)
- rWrapper.FcPatternAddString( pPattern, FC_FAMILY, (FcChar8*)"monospace");
+ FcPatternAddString(pPattern, FC_FAMILY, (FcChar8*)"monospace");
}
}
@@ -1123,18 +751,16 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName,
{
rtl::OUString aName;
FontCfgWrapper& rWrapper = FontCfgWrapper::get();
- if( ! rWrapper.isValid() )
- return aName;
// build pattern argument for fontconfig query
- FcPattern* pPattern = rWrapper.FcPatternCreate();
+ FcPattern* pPattern = FcPatternCreate();
// Prefer scalable fonts
- rWrapper.FcPatternAddBool( pPattern, FC_SCALABLE, FcTrue );
+ FcPatternAddBool(pPattern, FC_SCALABLE, FcTrue);
const rtl::OString aTargetName = rtl::OUStringToOString( rFontName, RTL_TEXTENCODING_UTF8 );
const FcChar8* pTargetNameUtf8 = (FcChar8*)aTargetName.getStr();
- rWrapper.FcPatternAddString( pPattern, FC_FAMILY, pTargetNameUtf8 );
+ FcPatternAddString(pPattern, FC_FAMILY, pTargetNameUtf8);
if( rLangAttrib.getLength() )
{
@@ -1143,42 +769,42 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName,
pLangAttribUtf8 = (FcChar8*)"pa";
else
pLangAttribUtf8 = (FcChar8*)rLangAttrib.getStr();
- rWrapper.FcPatternAddString( pPattern, FC_LANG, pLangAttribUtf8 );
+ FcPatternAddString(pPattern, FC_LANG, pLangAttribUtf8);
}
// Add required Unicode characters, if any
if ( rMissingCodes.getLength() )
{
- FcCharSet *unicodes = rWrapper.FcCharSetCreate();
+ FcCharSet *unicodes = FcCharSetCreate();
for( sal_Int32 nStrIndex = 0; nStrIndex < rMissingCodes.getLength(); )
{
// also handle unicode surrogates
const sal_uInt32 nCode = rMissingCodes.iterateCodePoints( &nStrIndex );
- rWrapper.FcCharSetAddChar( unicodes, nCode );
+ FcCharSetAddChar( unicodes, nCode );
}
- rWrapper.FcPatternAddCharSet( pPattern, FC_CHARSET, unicodes);
- rWrapper.FcCharSetDestroy( unicodes );
+ FcPatternAddCharSet(pPattern, FC_CHARSET, unicodes);
+ FcCharSetDestroy(unicodes);
}
- addtopattern(rWrapper, pPattern, rItalic, rWeight, rWidth, rPitch);
+ addtopattern(pPattern, rItalic, rWeight, rWidth, rPitch);
// query fontconfig for a substitute
- rWrapper.FcConfigSubstitute( rWrapper.FcConfigGetCurrent(), pPattern, FcMatchPattern );
- rWrapper.FcDefaultSubstitute( pPattern );
+ FcConfigSubstitute(FcConfigGetCurrent(), pPattern, FcMatchPattern);
+ FcDefaultSubstitute(pPattern);
// process the result of the fontconfig query
FcResult eResult = FcResultNoMatch;
FcFontSet* pFontSet = rWrapper.getFontSet();
- FcPattern* pResult = rWrapper.FcFontSetMatch( rWrapper.FcConfigGetCurrent(), &pFontSet, 1, pPattern, &eResult );
- rWrapper.FcPatternDestroy( pPattern );
+ FcPattern* pResult = FcFontSetMatch(FcConfigGetCurrent(), &pFontSet, 1, pPattern, &eResult);
+ FcPatternDestroy( pPattern );
FcFontSet* pSet = NULL;
if( pResult )
{
- pSet = rWrapper.FcFontSetCreate();
+ pSet = FcFontSetCreate();
// info: destroying the pSet destroys pResult implicitly
// since pResult was "added" to pSet
- rWrapper.FcFontSetAdd( pSet, pResult );
+ FcFontSetAdd( pSet, pResult );
}
if( pSet )
@@ -1187,7 +813,7 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName,
{
//extract the closest match
FcChar8* family = NULL;
- FcResult eFileRes = rWrapper.FcPatternGetString( pSet->fonts[0], FC_FAMILY, 0, &family );
+ FcResult eFileRes = FcPatternGetString( pSet->fonts[0], FC_FAMILY, 0, &family );
// get the family name
if( eFileRes == FcResultMatch )
@@ -1200,13 +826,13 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName,
int val = 0;
- if ( FcResultMatch == rWrapper.FcPatternGetInteger( pSet->fonts[0], FC_WEIGHT, 0, &val))
+ if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_WEIGHT, 0, &val))
rWeight = convertWeight(val);
- if ( FcResultMatch == rWrapper.FcPatternGetInteger( pSet->fonts[0], FC_SLANT, 0, &val))
+ if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_SLANT, 0, &val))
rItalic = convertSlant(val);
- if ( FcResultMatch == rWrapper.FcPatternGetInteger( pSet->fonts[0], FC_SPACING, 0, &val))
+ if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_SPACING, 0, &val))
rPitch = convertSpacing(val);
- if ( FcResultMatch == rWrapper.FcPatternGetInteger( pSet->fonts[0], FC_WIDTH, 0, &val))
+ if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_WIDTH, 0, &val))
rWidth = convertWidth(val);
}
@@ -1216,13 +842,13 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName,
sal_uInt32* pRemainingCodes = (sal_uInt32*)alloca( rMissingCodes.getLength() * sizeof(sal_uInt32) );
int nRemainingLen = 0;
FcCharSet* unicodes;
- if( !rWrapper.FcPatternGetCharSet( pSet->fonts[0], FC_CHARSET, 0, &unicodes ) )
+ if (!FcPatternGetCharSet(pSet->fonts[0], FC_CHARSET, 0, &unicodes))
{
for( sal_Int32 nStrIndex = 0; nStrIndex < rMissingCodes.getLength(); )
{
// also handle unicode surrogates
const sal_uInt32 nCode = rMissingCodes.iterateCodePoints( &nStrIndex );
- if( rWrapper.FcCharSetHasChar( unicodes, nCode ) != FcTrue )
+ if (FcCharSetHasChar(unicodes, nCode) != FcTrue)
pRemainingCodes[ nRemainingLen++ ] = nCode;
}
}
@@ -1230,7 +856,7 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName,
}
}
- rWrapper.FcFontSetDestroy( pSet );
+ FcFontSetDestroy( pSet );
}
return aName;
@@ -1242,18 +868,15 @@ public:
FontConfigFontOptions() : mpPattern(0) {}
~FontConfigFontOptions()
{
- FontCfgWrapper& rWrapper = FontCfgWrapper::get();
- if( rWrapper.isValid() )
- rWrapper.FcPatternDestroy( mpPattern );
+ FcPatternDestroy(mpPattern);
}
virtual void *GetPattern(void * face, bool bEmbolden) const
{
- FontCfgWrapper& rWrapper = FontCfgWrapper::get();
- if( rWrapper.isValid() )
- {
- rWrapper.FcPatternAddFTFace(mpPattern, FC_FT_FACE, static_cast<FT_Face>(face));
- rWrapper.FcPatternAddBool(mpPattern, FC_EMBOLDEN, bEmbolden ? FcTrue : FcFalse);
- }
+ FcValue value;
+ value.type = FcTypeFTFace;
+ value.u.f = face;
+ FcPatternAdd (mpPattern, FC_FT_FACE, value, FcTrue);
+ FcPatternAddBool(mpPattern, FC_EMBOLDEN, bEmbolden ? FcTrue : FcFalse);
return mpPattern;
}
FcPattern* mpPattern;
@@ -1262,17 +885,11 @@ public:
ImplFontOptions* PrintFontManager::getFontOptions(
const FastPrintFontInfo& rInfo, int nSize, void (*subcallback)(void*)) const
{
-#ifndef ENABLE_FONTCONFIG
- (void)rInfo;(void)nSize;(void)subcallback;(void)rOptions;
- return NULL;
-#else // ENABLE_FONTCONFIG
FontCfgWrapper& rWrapper = FontCfgWrapper::get();
- if( ! rWrapper.isValid() )
- return NULL;
FontConfigFontOptions* pOptions = NULL;
- FcConfig* pConfig = rWrapper.FcConfigGetCurrent();
- FcPattern* pPattern = rWrapper.FcPatternCreate();
+ FcConfig* pConfig = FcConfigGetCurrent();
+ FcPattern* pPattern = FcPatternCreate();
OString sFamily = OUStringToOString( rInfo.m_aFamilyName, RTL_TEXTENCODING_UTF8 );
@@ -1280,32 +897,33 @@ ImplFontOptions* PrintFontManager::getFontOptions(
if (aI != rWrapper.m_aLocalizedToCanonical.end())
sFamily = aI->second;
if( sFamily.getLength() )
- rWrapper.FcPatternAddString( pPattern, FC_FAMILY, (FcChar8*)sFamily.getStr() );
+ FcPatternAddString(pPattern, FC_FAMILY, (FcChar8*)sFamily.getStr());
- addtopattern(rWrapper, pPattern, rInfo.m_eItalic, rInfo.m_eWeight, rInfo.m_eWidth, rInfo.m_ePitch);
- rWrapper.FcPatternAddDouble( pPattern, FC_PIXEL_SIZE, nSize);
+ addtopattern(pPattern, rInfo.m_eItalic, rInfo.m_eWeight, rInfo.m_eWidth, rInfo.m_ePitch);
+ FcPatternAddDouble(pPattern, FC_PIXEL_SIZE, nSize);
FcBool embitmap = true, antialias = true, autohint = true, hinting = true;
int hintstyle = FC_HINT_FULL;
- rWrapper.FcConfigSubstitute( pConfig, pPattern, FcMatchPattern );
- if (subcallback) subcallback(pPattern);
- rWrapper.FcDefaultSubstitute( pPattern );
+ FcConfigSubstitute(pConfig, pPattern, FcMatchPattern);
+ if (subcallback)
+ subcallback(pPattern);
+ FcDefaultSubstitute(pPattern);
FcResult eResult = FcResultNoMatch;
FcFontSet* pFontSet = rWrapper.getFontSet();
- FcPattern* pResult = rWrapper.FcFontSetMatch( pConfig, &pFontSet, 1, pPattern, &eResult );
+ FcPattern* pResult = FcFontSetMatch( pConfig, &pFontSet, 1, pPattern, &eResult );
if( pResult )
{
- FcResult eEmbeddedBitmap = rWrapper.FcPatternGetBool(pResult,
+ FcResult eEmbeddedBitmap = FcPatternGetBool(pResult,
FC_EMBEDDED_BITMAP, 0, &embitmap);
- FcResult eAntialias = rWrapper.FcPatternGetBool(pResult,
+ FcResult eAntialias = FcPatternGetBool(pResult,
FC_ANTIALIAS, 0, &antialias);
- FcResult eAutoHint = rWrapper.FcPatternGetBool(pResult,
+ FcResult eAutoHint = FcPatternGetBool(pResult,
FC_AUTOHINT, 0, &autohint);
- FcResult eHinting = rWrapper.FcPatternGetBool(pResult,
+ FcResult eHinting = FcPatternGetBool(pResult,
FC_HINTING, 0, &hinting);
- /*FcResult eHintStyle =*/ rWrapper.FcPatternGetInteger(pResult,
+ /*FcResult eHintStyle =*/ FcPatternGetInteger(pResult,
FC_HINT_STYLE, 0, &hintstyle);
pOptions = new FontConfigFontOptions;
@@ -1331,20 +949,17 @@ ImplFontOptions* PrintFontManager::getFontOptions(
}
// cleanup
- rWrapper.FcPatternDestroy( pPattern );
+ FcPatternDestroy( pPattern );
return pOptions;
-#endif
}
bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale )
{
FontCfgWrapper& rWrapper = FontCfgWrapper::get();
- if( ! rWrapper.isValid() )
- return false;
- FcConfig* pConfig = rWrapper.FcConfigGetCurrent();
- FcPattern* pPattern = rWrapper.FcPatternCreate();
+ FcConfig* pConfig = FcConfigGetCurrent();
+ FcPattern* pPattern = FcPatternCreate();
OString aLangAttrib;
// populate pattern with font characteristics
@@ -1360,29 +975,29 @@ bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star
aLangAttrib = OUStringToOString( aLang.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
}
if( aLangAttrib.getLength() )
- rWrapper.FcPatternAddString( pPattern, FC_LANG, (FcChar8*)aLangAttrib.getStr() );
+ FcPatternAddString(pPattern, FC_LANG, (FcChar8*)aLangAttrib.getStr());
OString aFamily = OUStringToOString( rInfo.m_aFamilyName, RTL_TEXTENCODING_UTF8 );
if( aFamily.getLength() )
- rWrapper.FcPatternAddString( pPattern, FC_FAMILY, (FcChar8*)aFamily.getStr() );
+ FcPatternAddString(pPattern, FC_FAMILY, (FcChar8*)aFamily.getStr());
- addtopattern(rWrapper, pPattern, rInfo.m_eItalic, rInfo.m_eWeight, rInfo.m_eWidth, rInfo.m_ePitch);
+ addtopattern(pPattern, rInfo.m_eItalic, rInfo.m_eWeight, rInfo.m_eWidth, rInfo.m_ePitch);
- rWrapper.FcConfigSubstitute( pConfig, pPattern, FcMatchPattern );
- rWrapper.FcDefaultSubstitute( pPattern );
+ FcConfigSubstitute(pConfig, pPattern, FcMatchPattern);
+ FcDefaultSubstitute(pPattern);
FcResult eResult = FcResultNoMatch;
FcFontSet *pFontSet = rWrapper.getFontSet();
- FcPattern* pResult = rWrapper.FcFontSetMatch( pConfig, &pFontSet, 1, pPattern, &eResult );
+ FcPattern* pResult = FcFontSetMatch(pConfig, &pFontSet, 1, pPattern, &eResult);
bool bSuccess = false;
if( pResult )
{
- FcFontSet* pSet = rWrapper.FcFontSetCreate();
- rWrapper.FcFontSetAdd( pSet, pResult );
+ FcFontSet* pSet = FcFontSetCreate();
+ FcFontSetAdd( pSet, pResult );
if( pSet->nfont > 0 )
{
//extract the closest match
FcChar8* file = NULL;
- FcResult eFileRes = rWrapper.FcPatternGetString( pSet->fonts[0], FC_FILE, 0, &file );
+ FcResult eFileRes = FcPatternGetString(pSet->fonts[0], FC_FILE, 0, &file);
if( eFileRes == FcResultMatch )
{
OString aDir, aBase, aOrgPath( (sal_Char*)file );
@@ -1395,52 +1010,13 @@ bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star
}
// info: destroying the pSet destroys pResult implicitly
// since pResult was "added" to pSet
- rWrapper.FcFontSetDestroy( pSet );
+ FcFontSetDestroy( pSet );
}
// cleanup
- rWrapper.FcPatternDestroy( pPattern );
+ FcPatternDestroy( pPattern );
return bSuccess;
}
-#else // ENABLE_FONTCONFIG not defined
-
-bool PrintFontManager::initFontconfig()
-{
- return false;
-}
-
-int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, int, rtl::OStringHash>& )
-{
- return 0;
-}
-
-void PrintFontManager::deinitFontconfig()
-{}
-
-bool PrintFontManager::addFontconfigDir( const rtl::OString& )
-{
- return false;
-}
-
-bool PrintFontManager::matchFont( FastPrintFontInfo&, const com::sun::star::lang::Locale& )
-{
- return false;
-}
-
-int PrintFontManager::FreeTypeCharIndex( void*, sal_uInt32 )
-{
- return 0;
-}
-
-rtl::OUString PrintFontManager::Substitute( const rtl::OUString&,
- rtl::OUString&, const rtl::OString&, FontItalic, FontWeight, FontWidth, FontPitch) const
-{
- rtl::OUString aName;
- return aName;
-}
-
-#endif // ENABLE_FONTCONFIG
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx
index 1427daedb193..8936df327aeb 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -1281,9 +1281,12 @@ int PrintFontManager::addFontFile( const ::rtl::OString& rFileName, int /*nFaceN
return nFontId;
}
-// -------------------------------------------------------------------------
+enum fontFormat
+{
+ UNKNOWN, TRUETYPE, CFF, TYPE1, AFM
+};
-bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, const ::std::list<OString>& rXLFDs, ::std::list< PrintFontManager::PrintFont* >& rNewFonts ) const
+bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, const ::std::list<OString>& rXLFDs, ::std::list< PrintFontManager::PrintFont* >& rNewFonts, const char *pFormat ) const
{
rNewFonts.clear();
@@ -1297,8 +1300,32 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co
if( access( aFullPath.getStr(), R_OK ) )
return false;
- ByteString aExt( rFontFile.copy( rFontFile.lastIndexOf( '.' )+1 ) );
- if( aExt.EqualsIgnoreCaseAscii( "pfb" ) || aExt.EqualsIgnoreCaseAscii( "pfa" ) )
+ fontFormat eFormat = UNKNOWN;
+ if (pFormat)
+ {
+ if (!strcmp(pFormat, "TrueType"))
+ eFormat = TRUETYPE;
+ else if (!strcmp(pFormat, "CFF"))
+ eFormat = CFF;
+ else if (!strcmp(pFormat, "Type 1"))
+ eFormat = TYPE1;
+ }
+ if (eFormat == UNKNOWN)
+ {
+ ByteString aExt( rFontFile.copy( rFontFile.lastIndexOf( '.' )+1 ) );
+ if( aExt.EqualsIgnoreCaseAscii( "pfb" ) || aExt.EqualsIgnoreCaseAscii( "pfa" ) )
+ eFormat = TYPE1;
+ else if( aExt.EqualsIgnoreCaseAscii( "afm" ) )
+ eFormat = AFM;
+ else if( aExt.EqualsIgnoreCaseAscii( "ttf" )
+ || aExt.EqualsIgnoreCaseAscii( "ttc" )
+ || aExt.EqualsIgnoreCaseAscii( "tte" ) ) // #i33947# for Gaiji support
+ eFormat = TRUETYPE;
+ else if( aExt.EqualsIgnoreCaseAscii( "otf" ) ) // check for TTF- and PS-OpenType too
+ eFormat = CFF;
+ }
+
+ if (eFormat == TYPE1)
{
// check for corresponding afm metric
// first look for an adjacent file
@@ -1352,7 +1379,7 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co
}
}
}
- else if( aExt.EqualsIgnoreCaseAscii( "afm" ) )
+ else if (eFormat == AFM)
{
ByteString aFilePath( aDir );
aFilePath.Append( '/' );
@@ -1365,34 +1392,14 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co
else
delete pFont;
}
- else if( aExt.EqualsIgnoreCaseAscii( "ttf" )
- || aExt.EqualsIgnoreCaseAscii( "tte" ) // #i33947# for Gaiji support
- || aExt.EqualsIgnoreCaseAscii( "otf" ) ) // check for TTF- and PS-OpenType too
- {
- TrueTypeFontFile* pFont = new TrueTypeFontFile();
- pFont->m_nDirectory = nDirID;
- pFont->m_aFontFile = rFontFile;
- pFont->m_nCollectionEntry = -1;
-
- if( rXLFDs.size() )
- getFontAttributesFromXLFD( pFont, rXLFDs );
- // need to read the font anyway to get aliases inside the font file
- if( ! analyzeTrueTypeFile( pFont ) )
- {
- delete pFont;
- pFont = NULL;
- }
- else
- rNewFonts.push_back( pFont );
- }
- else if( aExt.EqualsIgnoreCaseAscii( "ttc" ) )
+ else if (eFormat == TRUETYPE || eFormat == CFF)
{
// get number of ttc entries
int nLength = CountTTCFonts( aFullPath.getStr() );
if( nLength )
{
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "%s contains %d fonts\n", aFullPath.getStr(), nLength );
+ fprintf( stderr, "ttc: %s contains %d fonts\n", aFullPath.getStr(), nLength );
#endif
for( int i = 0; i < nLength; i++ )
{
@@ -1411,10 +1418,24 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co
rNewFonts.push_back( pFont );
}
}
-#if OSL_DEBUG_LEVEL > 1
else
- fprintf( stderr, "CountTTCFonts( \"%s/%s\" ) failed\n", getDirectory(nDirID).getStr(), rFontFile.getStr() );
-#endif
+ {
+ TrueTypeFontFile* pFont = new TrueTypeFontFile();
+ pFont->m_nDirectory = nDirID;
+ pFont->m_aFontFile = rFontFile;
+ pFont->m_nCollectionEntry = -1;
+
+ if( rXLFDs.size() )
+ getFontAttributesFromXLFD( pFont, rXLFDs );
+ // need to read the font anyway to get aliases inside the font file
+ if( ! analyzeTrueTypeFile( pFont ) )
+ {
+ delete pFont;
+ pFont = NULL;
+ }
+ else
+ rNewFonts.push_back( pFont );
+ }
}
return ! rNewFonts.empty();
}
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index 3349e6ef3c01..22a5d1eddb26 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -32,6 +32,7 @@
#include <string.h>
#include <stdio.h>
#include <errno.h>
+
#ifdef FREEBSD
#include <sys/types.h>
#endif
@@ -69,14 +70,14 @@ SalBitmap* X11SalInstance::CreateSalBitmap()
}
ImplSalBitmapCache* X11SalBitmap::mpCache = NULL;
-sal_uLong X11SalBitmap::mnCacheInstCount = 0;
+sal_uLong X11SalBitmap::mnCacheInstCount = 0;
// -----------------------------------------------------------------------------
-X11SalBitmap::X11SalBitmap() :
- mpDIB( NULL ),
- mpDDB( NULL ),
- mbGrey( false )
+X11SalBitmap::X11SalBitmap()
+ : mpDIB( NULL )
+ , mpDDB( NULL )
+ , mbGrey( false )
{
}
@@ -115,9 +116,19 @@ void X11SalBitmap::ImplRemovedFromCache()
// -----------------------------------------------------------------------------
-BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal )
-{
- DBG_ASSERT( nBitCount == 1 || nBitCount == 4 || nBitCount == 8 || nBitCount == 16 || nBitCount == 24, "Unsupported BitCount!" );
+BitmapBuffer* X11SalBitmap::ImplCreateDIB(
+ const Size& rSize,
+ sal_uInt16 nBitCount,
+ const BitmapPalette& rPal
+) {
+ DBG_ASSERT(
+ nBitCount == 1
+ || nBitCount == 4
+ || nBitCount == 8
+ || nBitCount == 16
+ || nBitCount == 24
+ , "Unsupported BitCount!"
+ );
BitmapBuffer* pDIB = NULL;
@@ -192,13 +203,16 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCou
// -----------------------------------------------------------------------------
-BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
- int nScreen,
- long nDrawableDepth,
- long nX, long nY,
- long nWidth, long nHeight,
- bool bGrey )
-{
+BitmapBuffer* X11SalBitmap::ImplCreateDIB(
+ Drawable aDrawable,
+ int nScreen,
+ long nDrawableDepth,
+ long nX,
+ long nY,
+ long nWidth,
+ long nHeight,
+ bool bGrey
+) {
BitmapBuffer* pDIB = NULL;
if( aDrawable && nWidth && nHeight && nDrawableDepth )
@@ -221,7 +235,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
{
const SalTwoRect aTwoRect = { 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight };
BitmapBuffer aSrcBuf;
- sal_uLong nDstFormat = BMP_FORMAT_BOTTOM_UP;
+ sal_uLong nDstFormat = BMP_FORMAT_BOTTOM_UP;
const BitmapPalette* pDstPal = NULL;
aSrcBuf.mnFormat = BMP_FORMAT_TOP_DOWN;
@@ -239,14 +253,20 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
{
case( 1 ):
{
- aSrcBuf.mnFormat |= ( LSBFirst == pImage->bitmap_bit_order ? BMP_FORMAT_1BIT_LSB_PAL : BMP_FORMAT_1BIT_MSB_PAL );
+ aSrcBuf.mnFormat |= ( LSBFirst == pImage->bitmap_bit_order
+ ? BMP_FORMAT_1BIT_LSB_PAL
+ : BMP_FORMAT_1BIT_MSB_PAL
+ );
nDstFormat |= BMP_FORMAT_1BIT_MSB_PAL;
}
break;
case( 4 ):
{
- aSrcBuf.mnFormat |= ( LSBFirst == pImage->bitmap_bit_order ? BMP_FORMAT_4BIT_LSN_PAL : BMP_FORMAT_4BIT_MSN_PAL );
+ aSrcBuf.mnFormat |= ( LSBFirst == pImage->bitmap_bit_order
+ ? BMP_FORMAT_4BIT_LSN_PAL
+ : BMP_FORMAT_4BIT_MSN_PAL
+ );
nDstFormat |= BMP_FORMAT_4BIT_MSN_PAL;
}
break;
@@ -270,7 +290,6 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
else
{
aSrcBuf.mnFormat |= BMP_FORMAT_16BIT_TC_MSB_MASK;
- // aSrcBuf.maColorMask = ColorMask( pImage->red_mask ), SWAPSHORT( pImage->green_mask ), SWAPSHORT( pImage->blue_mask ) );
}
}
break;
@@ -289,10 +308,15 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
case( 32 ):
{
if( LSBFirst == pImage->byte_order )
- aSrcBuf.mnFormat |= ( pSalDisp->GetVisual(nScreen).red_mask == 0xFF ? BMP_FORMAT_32BIT_TC_RGBA : BMP_FORMAT_32BIT_TC_BGRA );
+ aSrcBuf.mnFormat |= ( pSalDisp->GetVisual(nScreen).red_mask == 0xFF
+ ? BMP_FORMAT_32BIT_TC_RGBA
+ : BMP_FORMAT_32BIT_TC_BGRA
+ );
else
- aSrcBuf.mnFormat |= ( pSalDisp->GetVisual(nScreen).red_mask == 0xFF ? BMP_FORMAT_32BIT_TC_ABGR : BMP_FORMAT_32BIT_TC_ARGB );
-
+ aSrcBuf.mnFormat |= ( pSalDisp->GetVisual(nScreen).red_mask == 0xFF
+ ? BMP_FORMAT_32BIT_TC_ABGR
+ : BMP_FORMAT_32BIT_TC_ARGB
+ );
nDstFormat |= BMP_FORMAT_24BIT_TC_BGR;
}
break;
@@ -326,7 +350,9 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
else if( aSrcBuf.mnBitCount <= 8 )
{
const SalColormap& rColMap = pSalDisp->GetColormap( nScreen );
- const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed(), (sal_uLong)(1 << nDrawableDepth) );
+ const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed()
+ , (sal_uLong)(1 << nDrawableDepth)
+ );
rPal.SetEntryCount( nCols );
pDstPal = &rPal;
@@ -354,7 +380,12 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
// -----------------------------------------------------------------------------
-XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const
+XImage* X11SalBitmap::ImplCreateXImage(
+ SalDisplay *pSalDisp,
+ int nScreen,
+ long nDepth,
+ const SalTwoRect& rTwoRect
+) const
{
XImage* pImage = NULL;
@@ -393,11 +424,17 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long
switch( pImage->bits_per_pixel )
{
case( 1 ):
- nDstFormat |= ( LSBFirst == pImage->bitmap_bit_order ? BMP_FORMAT_1BIT_LSB_PAL : BMP_FORMAT_1BIT_MSB_PAL );
+ nDstFormat |= ( LSBFirst == pImage->bitmap_bit_order
+ ? BMP_FORMAT_1BIT_LSB_PAL
+ : BMP_FORMAT_1BIT_MSB_PAL
+ );
break;
case( 4 ):
- nDstFormat |= ( LSBFirst == pImage->bitmap_bit_order ? BMP_FORMAT_4BIT_LSN_PAL : BMP_FORMAT_4BIT_MSN_PAL );
+ nDstFormat |= ( LSBFirst == pImage->bitmap_bit_order
+ ? BMP_FORMAT_4BIT_LSN_PAL
+ : BMP_FORMAT_4BIT_MSN_PAL
+ );
break;
case( 8 ):
@@ -437,9 +474,15 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long
case( 32 ):
{
if( LSBFirst == pImage->byte_order )
- nDstFormat |= ( pImage->red_mask == 0xFF ? BMP_FORMAT_32BIT_TC_RGBA : BMP_FORMAT_32BIT_TC_BGRA );
+ nDstFormat |= ( pImage->red_mask == 0xFF
+ ? BMP_FORMAT_32BIT_TC_RGBA
+ : BMP_FORMAT_32BIT_TC_BGRA
+ );
else
- nDstFormat |= ( pImage->red_mask == 0xFF ? BMP_FORMAT_32BIT_TC_ABGR : BMP_FORMAT_32BIT_TC_ARGB );
+ nDstFormat |= ( pImage->red_mask == 0xFF
+ ? BMP_FORMAT_32BIT_TC_ABGR
+ : BMP_FORMAT_32BIT_TC_ARGB
+ );
}
break;
}
@@ -467,7 +510,9 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long
else if( pImage->depth <= 8 )
{
const SalColormap& rColMap = pSalDisp->GetColormap( nScreen );
- const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed(), (sal_uLong)(1 << pImage->depth) );
+ const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed()
+ , (sal_uLong)(1 << pImage->depth)
+ );
pPal = new BitmapPalette( nCols );
@@ -506,10 +551,15 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long
}
// -----------------------------------------------------------------------------
-bool X11SalBitmap::ImplCreateFromDrawable( Drawable aDrawable,
- int nScreen, long nDrawableDepth,
- long nX, long nY, long nWidth, long nHeight )
-{
+bool X11SalBitmap::ImplCreateFromDrawable(
+ Drawable aDrawable,
+ int nScreen,
+ long nDrawableDepth,
+ long nX,
+ long nY,
+ long nWidth,
+ long nHeight
+) {
Destroy();
if( aDrawable && nWidth && nHeight && nDrawableDepth )
@@ -519,8 +569,7 @@ bool X11SalBitmap::ImplCreateFromDrawable( Drawable aDrawable,
}
// -----------------------------------------------------------------------------
-bool
-X11SalBitmap::SnapShot (Display* pDisplay, XLIB_Window hWindow)
+bool X11SalBitmap::SnapShot (Display* pDisplay, XLIB_Window hWindow)
{
if (hWindow != None)
{
@@ -598,9 +647,12 @@ X11SalBitmap::SnapShot (Display* pDisplay, XLIB_Window hWindow)
return False;
}
-bool
-X11SalBitmap::ImplCreateFromXImage (Display* pDisplay, XLIB_Window hWindow, int nScreen, XImage* pImage)
-{
+bool X11SalBitmap::ImplCreateFromXImage (
+ Display* pDisplay,
+ XLIB_Window hWindow,
+ int nScreen,
+ XImage* pImage
+) {
Destroy();
if (pImage != NULL && pImage->width != 0 && pImage->height != 0 && pImage->depth != 0)
@@ -611,10 +663,12 @@ X11SalBitmap::ImplCreateFromXImage (Display* pDisplay, XLIB_Window hWindow, int
return False;
}
-ImplSalDDB* X11SalBitmap::ImplGetDDB( Drawable aDrawable,
- int nScreen,
- long nDrawableDepth,
- const SalTwoRect& rTwoRect ) const
+ImplSalDDB* X11SalBitmap::ImplGetDDB(
+ Drawable aDrawable,
+ int nScreen,
+ long nDrawableDepth,
+ const SalTwoRect& rTwoRect
+) const
{
if( !mpDDB || !mpDDB->ImplMatches( nScreen, nDrawableDepth, rTwoRect ) )
{
@@ -708,11 +762,13 @@ ImplSalDDB* X11SalBitmap::ImplGetDDB( Drawable aDrawable,
// -----------------------------------------------------------------------------
-void X11SalBitmap::ImplDraw( Drawable aDrawable,
- int nScreen,
- long nDrawableDepth,
- const SalTwoRect& rTwoRect,
- const GC& rGC ) const
+void X11SalBitmap::ImplDraw(
+ Drawable aDrawable,
+ int nScreen,
+ long nDrawableDepth,
+ const SalTwoRect& rTwoRect,
+ const GC& rGC
+) const
{
ImplGetDDB( aDrawable, nScreen, nDrawableDepth, rTwoRect );
if( mpDDB )
@@ -770,21 +826,26 @@ bool X11SalBitmap::Create( const SalBitmap& rSSalBmp )
bool X11SalBitmap::Create( const SalBitmap&, SalGraphics* )
{
- return sal_False;
+ return false;
}
// -----------------------------------------------------------------------------
bool X11SalBitmap::Create( const SalBitmap&, sal_uInt16 )
{
- return sal_False;
+ return false;
}
// -----------------------------------------------------------------------------
-bool X11SalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, Size& rSize, bool bMask )
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet > xFastPropertySet( xBitmapCanvas, ::com::sun::star::uno::UNO_QUERY );
+bool X11SalBitmap::Create(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
+ Size& rSize,
+ bool bMask
+) {
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet >
+ xFastPropertySet( xBitmapCanvas, ::com::sun::star::uno::UNO_QUERY );
+
if( xFastPropertySet.get() ) {
sal_Int32 depth;
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > args;
@@ -794,7 +855,15 @@ bool X11SalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::s
if( ( args[1] >>= pixmapHandle ) && ( args[2] >>= depth ) ) {
mbGrey = bMask;
- bool bSuccess = ImplCreateFromDrawable( pixmapHandle, 0, depth, 0, 0, (long) rSize.Width(), (long) rSize.Height() );
+ bool bSuccess = ImplCreateFromDrawable(
+ pixmapHandle,
+ 0,
+ depth,
+ 0,
+ 0,
+ (long) rSize.Width(),
+ (long) rSize.Height()
+ );
bool bFreePixmap = false;
if( bSuccess && (args[0] >>= bFreePixmap) && bFreePixmap )
XFreePixmap( GetX11SalData()->GetDisplay()->GetDisplay(), pixmapHandle );
@@ -860,10 +929,15 @@ BitmapBuffer* X11SalBitmap::AcquireBuffer( bool )
{
if( !mpDIB && mpDDB )
{
- mpDIB = ImplCreateDIB( mpDDB->ImplGetPixmap(),
- mpDDB->ImplGetScreen(),
- mpDDB->ImplGetDepth(),
- 0, 0, mpDDB->ImplGetWidth(), mpDDB->ImplGetHeight(), mbGrey );
+ mpDIB = ImplCreateDIB(
+ mpDDB->ImplGetPixmap(),
+ mpDDB->ImplGetScreen(),
+ mpDDB->ImplGetDepth(),
+ 0, 0,
+ mpDDB->ImplGetWidth(),
+ mpDDB->ImplGetHeight(),
+ mbGrey
+ );
}
return mpDIB;
@@ -905,11 +979,11 @@ bool X11SalBitmap::GetSystemData( BitmapSystemData& rData )
// - ImplSalDDB -
// --------------
-ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, int nScreen, const SalTwoRect& rTwoRect ) :
- maPixmap ( 0 ),
- maTwoRect ( rTwoRect ),
- mnDepth ( pImage->depth ),
- mnScreen ( nScreen )
+ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, int nScreen, const SalTwoRect& rTwoRect )
+ : maPixmap ( 0 )
+ , maTwoRect ( rTwoRect )
+ , mnDepth ( pImage->depth )
+ , mnScreen ( nScreen )
{
SalDisplay* pSalDisp = GetX11SalData()->GetDisplay();
Display* pXDisp = pSalDisp->GetDisplay();
@@ -937,8 +1011,8 @@ ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, int nScreen, const S
// -----------------------------------------------------------------------------------------
// create from XImage
-ImplSalDDB::ImplSalDDB (Display* pDisplay, XLIB_Window hWindow, int nScreen, XImage* pImage) :
- mnScreen( nScreen )
+ImplSalDDB::ImplSalDDB (Display* pDisplay, XLIB_Window hWindow, int nScreen, XImage* pImage)
+ : mnScreen( nScreen )
{
maPixmap = XCreatePixmap (pDisplay, hWindow, pImage->width, pImage->height, pImage->depth);
if (maPixmap != 0)
@@ -975,9 +1049,16 @@ ImplSalDDB::ImplSalDDB (Display* pDisplay, XLIB_Window hWindow, int nScreen, XIm
// -----------------------------------------------------------------------------
-ImplSalDDB::ImplSalDDB( Drawable aDrawable, int nScreen, long nDrawableDepth, long nX, long nY, long nWidth, long nHeight ) :
- mnDepth( nDrawableDepth ),
- mnScreen( nScreen )
+ImplSalDDB::ImplSalDDB(
+ Drawable aDrawable,
+ int nScreen,
+ long nDrawableDepth,
+ long nX,
+ long nY,
+ long nWidth,
+ long nHeight
+) : mnDepth( nDrawableDepth )
+ , mnScreen( nScreen )
{
SalDisplay* pSalDisp = GetX11SalData()->GetDisplay();
Display* pXDisp = pSalDisp->GetDisplay();
@@ -1019,24 +1100,32 @@ ImplSalDDB::~ImplSalDDB()
bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const
{
- bool bRet = sal_False;
+ bool bRet = false;
if( ( maPixmap != 0 ) && ( ( mnDepth == nDepth ) || ( 1 == mnDepth ) ) && nScreen == mnScreen)
{
- if( rTwoRect.mnSrcX == maTwoRect.mnSrcX && rTwoRect.mnSrcY == maTwoRect.mnSrcY &&
- rTwoRect.mnSrcWidth == maTwoRect.mnSrcWidth && rTwoRect.mnSrcHeight == maTwoRect.mnSrcHeight &&
- rTwoRect.mnDestWidth == maTwoRect.mnDestWidth && rTwoRect.mnDestHeight == maTwoRect.mnDestHeight )
+ if ( rTwoRect.mnSrcX == maTwoRect.mnSrcX
+ && rTwoRect.mnSrcY == maTwoRect.mnSrcY
+ && rTwoRect.mnSrcWidth == maTwoRect.mnSrcWidth
+ && rTwoRect.mnSrcHeight == maTwoRect.mnSrcHeight
+ && rTwoRect.mnDestWidth == maTwoRect.mnDestWidth
+ && rTwoRect.mnDestHeight == maTwoRect.mnDestHeight
+ )
{
// absolutely indentically
- bRet = sal_True;
+ bRet = true;
}
- else if( rTwoRect.mnSrcWidth == rTwoRect.mnDestWidth && rTwoRect.mnSrcHeight == rTwoRect.mnDestHeight &&
- maTwoRect.mnSrcWidth == maTwoRect.mnDestWidth && maTwoRect.mnSrcHeight == maTwoRect.mnDestHeight &&
- rTwoRect.mnSrcX >= maTwoRect.mnSrcX && rTwoRect.mnSrcY >= maTwoRect.mnSrcY &&
- ( rTwoRect.mnSrcX + rTwoRect.mnSrcWidth ) <= ( maTwoRect.mnSrcX + maTwoRect.mnSrcWidth ) &&
- ( rTwoRect.mnSrcY + rTwoRect.mnSrcHeight ) <= ( maTwoRect.mnSrcY + maTwoRect.mnSrcHeight ) )
+ else if( rTwoRect.mnSrcWidth == rTwoRect.mnDestWidth
+ && rTwoRect.mnSrcHeight == rTwoRect.mnDestHeight
+ && maTwoRect.mnSrcWidth == maTwoRect.mnDestWidth
+ && maTwoRect.mnSrcHeight == maTwoRect.mnDestHeight
+ && rTwoRect.mnSrcX >= maTwoRect.mnSrcX
+ && rTwoRect.mnSrcY >= maTwoRect.mnSrcY
+ && ( rTwoRect.mnSrcX + rTwoRect.mnSrcWidth ) <= ( maTwoRect.mnSrcX + maTwoRect.mnSrcWidth )
+ && ( rTwoRect.mnSrcY + rTwoRect.mnSrcHeight ) <= ( maTwoRect.mnSrcY + maTwoRect.mnSrcHeight )
+ )
{
- bRet = sal_True;
+ bRet = true;
}
}
@@ -1045,7 +1134,12 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe
// -----------------------------------------------------------------------------
-void ImplSalDDB::ImplDraw( Drawable aDrawable, long nDrawableDepth, const SalTwoRect& rTwoRect, const GC& rGC ) const
+void ImplSalDDB::ImplDraw(
+ Drawable aDrawable,
+ long nDrawableDepth,
+ const SalTwoRect& rTwoRect,
+ const GC& rGC
+) const
{
ImplDraw( maPixmap, mnDepth, aDrawable, nDrawableDepth,
rTwoRect.mnSrcX - maTwoRect.mnSrcX, rTwoRect.mnSrcY - maTwoRect.mnSrcY,
@@ -1055,12 +1149,19 @@ void ImplSalDDB::ImplDraw( Drawable aDrawable, long nDrawableDepth, const SalTwo
// -----------------------------------------------------------------------------
-void ImplSalDDB::ImplDraw( Drawable aSrcDrawable, long nSrcDrawableDepth,
- Drawable aDstDrawable, long,
- long nSrcX, long nSrcY,
- long nDestWidth, long nDestHeight,
- long nDestX, long nDestY, const GC& rGC )
-{
+void ImplSalDDB::ImplDraw(
+ Drawable aSrcDrawable,
+ long nSrcDrawableDepth,
+ Drawable aDstDrawable,
+ long,
+ long nSrcX,
+ long nSrcY,
+ long nDestWidth,
+ long nDestHeight,
+ long nDestX,
+ long nDestY,
+ const GC& rGC
+) {
SalDisplay* pSalDisp = GetX11SalData()->GetDisplay();
Display* pXDisp = pSalDisp->GetDisplay();
@@ -1108,12 +1209,18 @@ ImplSalBitmapCache::~ImplSalBitmapCache()
void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, sal_uLong nMemSize, sal_uLong nFlags )
{
- ImplBmpObj* pObj;
- bool bFound = sal_False;
-
- for( pObj = (ImplBmpObj*) maBmpList.Last(); pObj && !bFound; pObj = (ImplBmpObj*) maBmpList.Prev() )
+ ImplBmpObj* pObj = NULL;
+ bool bFound = false;
+
+ for(
+ BmpList_impl::iterator it = maBmpList.begin();
+ (it != maBmpList.end() ) && !bFound ;
+ ++it
+ ) {
+ pObj = *it;
if( pObj->mpBmp == pBmp )
- bFound = sal_True;
+ bFound = true;
+ }
mnTotalSize += nMemSize;
@@ -1123,21 +1230,24 @@ void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, sal_uLong nMemSize, sal_uL
pObj->mnMemSize = nMemSize, pObj->mnFlags = nFlags;
}
else
- maBmpList.Insert( new ImplBmpObj( pBmp, nMemSize, nFlags ), LIST_APPEND );
+ maBmpList.push_back( new ImplBmpObj( pBmp, nMemSize, nFlags ) );
}
// -----------------------------------------------------------------------------
void ImplSalBitmapCache::ImplRemove( X11SalBitmap* pBmp )
{
- for( ImplBmpObj* pObj = (ImplBmpObj*) maBmpList.Last(); pObj; pObj = (ImplBmpObj*) maBmpList.Prev() )
- {
- if( pObj->mpBmp == pBmp )
+ for(
+ BmpList_impl::iterator it = maBmpList.begin();
+ it != maBmpList.end();
+ ++it
+ ) {
+ if( (*it)->mpBmp == pBmp )
{
- maBmpList.Remove( pObj );
- pObj->mpBmp->ImplRemovedFromCache();
- mnTotalSize -= pObj->mnMemSize;
- delete pObj;
+ (*it)->mpBmp->ImplRemovedFromCache();
+ mnTotalSize -= (*it)->mnMemSize;
+ delete *it;
+ maBmpList.erase( it );
break;
}
}
@@ -1147,13 +1257,15 @@ void ImplSalBitmapCache::ImplRemove( X11SalBitmap* pBmp )
void ImplSalBitmapCache::ImplClear()
{
- for( ImplBmpObj* pObj = (ImplBmpObj*) maBmpList.First(); pObj; pObj = (ImplBmpObj*) maBmpList.Next() )
- {
- pObj->mpBmp->ImplRemovedFromCache();
- delete pObj;
+ for(
+ BmpList_impl::iterator it = maBmpList.begin();
+ it != maBmpList.end();
+ ++it
+ ) {
+ (*it)->mpBmp->ImplRemovedFromCache();
+ delete *it;
}
-
- maBmpList.Clear();
+ maBmpList.clear();
mnTotalSize = 0;
}
diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx
index dce2e5ccb793..4934ed7f83fa 100644
--- a/vcl/unx/generic/gdi/salgdi3.cxx
+++ b/vcl/unx/generic/gdi/salgdi3.cxx
@@ -78,28 +78,21 @@
#include "salframe.hxx"
#include "outdev.h"
-
-
#ifdef ENABLE_GRAPHITE
#include <graphite_layout.hxx>
#include <graphite_serverfont.hxx>
#endif
-struct cairo_surface_t;
-struct cairo_t;
-struct cairo_font_face_t;
-typedef void* FT_Face;
-struct cairo_matrix_t {
- double xx; double yx;
- double xy; double yy;
- double x0; double y0;
-};
-struct cairo_glyph_t
-{
- unsigned long index;
- double x;
- double y;
-};
+#ifdef SYSTEM_CAIRO
+#include <cairo.h>
+#include <cairo-ft.h>
+#include <cairo-xlib-xrender.h>
+#else
+#include <cairo/cairo.h>
+#include <cairo/cairo-ft.h>
+#include <cairo/cairo-xlib-xrender.h>
+#endif
+
struct BOX
{
short x1, x2, y1, y2;
@@ -249,179 +242,12 @@ void ImplServerFontEntry::HandleFontOptions( void )
//--------------------------------------------------------------------------
-namespace {
-
-class CairoWrapper
-{
-private:
- osl::Module mpCairoLib;
-
- cairo_surface_t* (*mp_xlib_surface_create_with_xrender_format)(Display *, Drawable , Screen *, XRenderPictFormat *, int , int );
- void (*mp_surface_destroy)(cairo_surface_t *);
- cairo_t* (*mp_create)(cairo_surface_t *);
- void (*mp_destroy)(cairo_t*);
- void (*mp_clip)(cairo_t*);
- void (*mp_rectangle)(cairo_t*, double, double, double, double);
- cairo_font_face_t * (*mp_ft_font_face_create_for_ft_face)(FT_Face, int);
- cairo_font_face_t * (*mp_ft_font_face_create_for_pattern)(void*);
- void (*mp_set_font_face)(cairo_t *, cairo_font_face_t *);
- void (*mp_font_face_destroy)(cairo_font_face_t *);
- void (*mp_matrix_init_identity)(cairo_matrix_t *);
- void (*mp_matrix_scale)(cairo_matrix_t *, double, double);
- void (*mp_matrix_rotate)(cairo_matrix_t *, double);
- void (*mp_set_font_matrix)(cairo_t *, const cairo_matrix_t *);
- void (*mp_show_glyphs)(cairo_t *, const cairo_glyph_t *, int );
- void (*mp_set_source_rgb)(cairo_t *, double , double , double );
- void (*mp_set_font_options)(cairo_t *, const void *);
- void (*mp_ft_font_options_substitute)(const void*, void*);
-
- bool canEmbolden() const { return mp_ft_font_face_create_for_pattern != NULL; }
-
- CairoWrapper();
-public:
- static CairoWrapper& get();
- bool isValid() const { return (mpCairoLib != NULL); }
- bool isCairoRenderable(const ServerFont& rFont);
-
- cairo_surface_t* xlib_surface_create_with_xrender_format(Display *pDisplay, Drawable drawable, Screen *pScreen, XRenderPictFormat *pFormat, int width, int height)
- { return (*mp_xlib_surface_create_with_xrender_format)(pDisplay, drawable, pScreen, pFormat, width, height); }
- void surface_destroy(cairo_surface_t *surface) { (*mp_surface_destroy)(surface); }
- cairo_t* create(cairo_surface_t *surface) { return (*mp_create)(surface); }
- void destroy(cairo_t *cr) { (*mp_destroy)(cr); }
- void clip(cairo_t *cr) { (*mp_clip)(cr); }
- void rectangle(cairo_t *cr, double x, double y, double width, double height)
- { (*mp_rectangle)(cr, x, y, width, height); }
- cairo_font_face_t* ft_font_face_create_for_ft_face(FT_Face face, int load_flags)
- { return (*mp_ft_font_face_create_for_ft_face)(face, load_flags); }
- cairo_font_face_t* ft_font_face_create_for_pattern(void *pattern)
- {
- return mp_ft_font_face_create_for_pattern
- ? (*mp_ft_font_face_create_for_pattern)(pattern)
- : NULL;
- }
- void set_font_face(cairo_t *cr, cairo_font_face_t *font_face)
- { (*mp_set_font_face)(cr, font_face); }
- void font_face_destroy(cairo_font_face_t *font_face)
- { (*mp_font_face_destroy)(font_face); }
- void matrix_init_identity(cairo_matrix_t *matrix)
- { (*mp_matrix_init_identity)(matrix); }
- void matrix_scale(cairo_matrix_t *matrix, double sx, double sy)
- { (*mp_matrix_scale)(matrix, sx, sy); }
- void matrix_rotate(cairo_matrix_t *matrix, double radians)
- { (*mp_matrix_rotate)(matrix, radians); }
- void set_font_matrix(cairo_t *cr, const cairo_matrix_t *matrix)
- { (*mp_set_font_matrix)(cr, matrix); }
- void show_glyphs(cairo_t *cr, const cairo_glyph_t *glyphs, int no_glyphs)
- { (*mp_show_glyphs)(cr, glyphs, no_glyphs); }
- void set_source_rgb(cairo_t *cr, double red, double green, double blue)
- { (*mp_set_source_rgb)(cr, red, green, blue); }
- void set_font_options(cairo_t *cr, const void *options)
- { (*mp_set_font_options)(cr, options); }
- void ft_font_options_substitute(const void *options, void *pattern)
- { (*mp_ft_font_options_substitute)(options, pattern); }
-};
-
-static CairoWrapper* pCairoInstance = NULL;
-
-CairoWrapper& CairoWrapper::get()
-{
- if( ! pCairoInstance )
- pCairoInstance = new CairoWrapper();
- return *pCairoInstance;
-}
-
-CairoWrapper::CairoWrapper()
+namespace
{
- static const char* pDisableCairoText = getenv( "SAL_DISABLE_CAIROTEXT" );
- if( pDisableCairoText && (pDisableCairoText[0] != '0') )
- return;
-
- int nDummy;
- if( !XQueryExtension( GetX11SalData()->GetDisplay()->GetDisplay(), "RENDER", &nDummy, &nDummy, &nDummy ) )
- return;
-
- OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libcairo.so.2" ));
- if ( !mpCairoLib.load( aLibName, SAL_LOADMODULE_DEFAULT ) )
- return;
-
-#ifdef DEBUG
- // check cairo version
- int (*p_version)();
- p_version = (int(*)()) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_version" );
- const int nVersion = p_version ? (*p_version)() : 0;
- fprintf( stderr, "CAIRO version=%d\n", nVersion );
-#endif
-
- mp_xlib_surface_create_with_xrender_format = (cairo_surface_t* (*)(Display *, Drawable , Screen *, XRenderPictFormat *, int , int ))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_xlib_surface_create_with_xrender_format" );
- mp_surface_destroy = (void(*)(cairo_surface_t*))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_surface_destroy" );
- mp_create = (cairo_t*(*)(cairo_surface_t*))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_create" );
- mp_destroy = (void(*)(cairo_t*))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_destroy" );
- mp_clip = (void(*)(cairo_t*))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_clip" );
- mp_rectangle = (void(*)(cairo_t*, double, double, double, double))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_rectangle" );
- mp_ft_font_face_create_for_ft_face = (cairo_font_face_t * (*)(FT_Face, int))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_ft_font_face_create_for_ft_face" );
- mp_ft_font_face_create_for_pattern = (cairo_font_face_t * (*)(void*))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_ft_font_face_create_for_pattern" );
- mp_set_font_face = (void (*)(cairo_t *, cairo_font_face_t *))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_set_font_face" );
- mp_font_face_destroy = (void (*)(cairo_font_face_t *))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_font_face_destroy" );
- mp_matrix_init_identity = (void (*)(cairo_matrix_t *))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_init_identity" );
- mp_matrix_scale = (void (*)(cairo_matrix_t *, double, double))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_scale" );
- mp_matrix_rotate = (void (*)(cairo_matrix_t *, double))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_rotate" );
- mp_set_font_matrix = (void (*)(cairo_t *, const cairo_matrix_t *))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_set_font_matrix" );
- mp_show_glyphs = (void (*)(cairo_t *, const cairo_glyph_t *, int ))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_show_glyphs" );
- mp_set_source_rgb = (void (*)(cairo_t *, double , double , double ))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_set_source_rgb" );
- mp_set_font_options = (void (*)(cairo_t *, const void *options ))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_set_font_options" );
- mp_ft_font_options_substitute = (void (*)(const void *, void *))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_ft_font_options_substitute" );
-
- if( !(
- mp_xlib_surface_create_with_xrender_format &&
- mp_surface_destroy &&
- mp_create &&
- mp_destroy &&
- mp_clip &&
- mp_rectangle &&
- mp_ft_font_face_create_for_ft_face &&
- mp_set_font_face &&
- mp_font_face_destroy &&
- mp_matrix_init_identity &&
- mp_matrix_scale &&
- mp_matrix_rotate &&
- mp_set_font_matrix &&
- mp_show_glyphs &&
- mp_set_source_rgb &&
- mp_set_font_options &&
- mp_ft_font_options_substitute
- ) )
+ bool isCairoRenderable(const ServerFont& rFont)
{
- mpCairoLib.unload();
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "not all needed symbols were found\n" );
-#endif
+ return rFont.GetFtFace();
}
-}
-
-bool CairoWrapper::isCairoRenderable(const ServerFont& rFont)
-{
- return rFont.GetFtFace() && isValid() && rFont.GetAntialiasAdvice() &&
- (rFont.NeedsArtificialBold() ? canEmbolden() : true);
-}
-
} //namespace
CairoFontsCache::LRUFonts CairoFontsCache::maLRUFonts;
@@ -437,10 +263,9 @@ CairoFontsCache::~CairoFontsCache()
--mnRefCount;
if (!mnRefCount && !maLRUFonts.empty())
{
- CairoWrapper &rCairo = CairoWrapper::get();
LRUFonts::iterator aEnd = maLRUFonts.end();
for (LRUFonts::iterator aI = maLRUFonts.begin(); aI != aEnd; ++aI)
- rCairo.font_face_destroy((cairo_font_face_t*)aI->first);
+ cairo_font_face_destroy((cairo_font_face_t*)aI->first);
}
}
@@ -449,8 +274,7 @@ void CairoFontsCache::CacheFont(void *pFont, const CairoFontsCache::CacheId &rId
maLRUFonts.push_front( std::pair<void*, CairoFontsCache::CacheId>(pFont, rId) );
if (maLRUFonts.size() > 8)
{
- CairoWrapper &rCairo = CairoWrapper::get();
- rCairo.font_face_destroy((cairo_font_face_t*)maLRUFonts.back().first);
+ cairo_font_face_destroy((cairo_font_face_t*)maLRUFonts.back().first);
maLRUFonts.pop_back();
}
}
@@ -464,9 +288,18 @@ void* CairoFontsCache::FindCachedFont(const CairoFontsCache::CacheId &rId)
return NULL;
}
+namespace
+{
+ bool hasRotation(int nRotation)
+ {
+ return nRotation != 0;
+ }
+}
+
void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
{
std::vector<cairo_glyph_t> cairo_glyphs;
+ std::vector<int> glyph_extrarotation;
cairo_glyphs.reserve( 256 );
Point aPos;
@@ -478,6 +311,19 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
aGlyph.x = aPos.X();
aGlyph.y = aPos.Y();
cairo_glyphs.push_back(aGlyph);
+
+ switch (aGlyphId & GF_ROTMASK)
+ {
+ case GF_ROTL: // left
+ glyph_extrarotation.push_back(900);
+ break;
+ case GF_ROTR: // right
+ glyph_extrarotation.push_back(-900);
+ break;
+ default:
+ glyph_extrarotation.push_back(0);
+ break;
+ }
}
if (cairo_glyphs.empty())
@@ -489,11 +335,9 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
if( !pVisualFormat )
return;
- CairoWrapper &rCairo = CairoWrapper::get();
-
Display* pDisplay = GetXDisplay();
- cairo_surface_t *surface = rCairo.xlib_surface_create_with_xrender_format (pDisplay,
+ cairo_surface_t *surface = cairo_xlib_surface_create_with_xrender_format (pDisplay,
hDrawable_, ScreenOfDisplay(pDisplay, m_nScreen), pVisualFormat, SAL_MAX_INT16, SAL_MAX_INT16);
/*
@@ -502,26 +346,26 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
* least change the SalFrame etc impls to dtor the SalGraphics *before* the
* destruction of the windows they reference
*/
- cairo_t *cr = rCairo.create(surface);
- rCairo.surface_destroy(surface);
+ cairo_t *cr = cairo_create(surface);
+ cairo_surface_destroy(surface);
if (const void *pOptions = Application::GetSettings().GetStyleSettings().GetCairoFontOptions())
- rCairo.set_font_options( cr, pOptions);
+ cairo_set_font_options(cr, static_cast<const cairo_font_options_t*>(pOptions));
if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
{
for (long i = 0; i < mpClipRegion->numRects; ++i)
{
- rCairo.rectangle(cr,
- mpClipRegion->rects[i].x1,
- mpClipRegion->rects[i].y1,
- mpClipRegion->rects[i].x2 - mpClipRegion->rects[i].x1,
- mpClipRegion->rects[i].y2 - mpClipRegion->rects[i].y1);
+ cairo_rectangle(cr,
+ mpClipRegion->rects[i].x1,
+ mpClipRegion->rects[i].y1,
+ mpClipRegion->rects[i].x2 - mpClipRegion->rects[i].x1,
+ mpClipRegion->rects[i].y2 - mpClipRegion->rects[i].y1);
}
- rCairo.clip(cr);
+ cairo_clip(cr);
}
- rCairo.set_source_rgb(cr,
+ cairo_set_source_rgb(cr,
SALCOLOR_RED(nTextColor_)/255.0,
SALCOLOR_GREEN(nTextColor_)/255.0,
SALCOLOR_BLUE(nTextColor_)/255.0);
@@ -541,30 +385,67 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
const ImplFontOptions *pOptions = rFont.GetFontOptions().get();
void *pPattern = pOptions ? pOptions->GetPattern(pFace, aId.mbEmbolden) : NULL;
if (pPattern)
- font_face = rCairo.ft_font_face_create_for_pattern(pPattern);
+ font_face = cairo_ft_font_face_create_for_pattern(reinterpret_cast<FcPattern*>(pPattern));
if (!font_face)
- font_face = rCairo.ft_font_face_create_for_ft_face(pFace, rFont.GetLoadFlags());
+ font_face = cairo_ft_font_face_create_for_ft_face(reinterpret_cast<FT_Face>(pFace), rFont.GetLoadFlags());
m_aCairoFontsCache.CacheFont(font_face, aId);
}
- rCairo.set_font_face(cr, font_face);
+ cairo_set_font_face(cr, font_face);
cairo_matrix_t m;
const ImplFontSelectData& rFSD = rFont.GetFontSelData();
- int nWidth = rFSD.mnWidth ? rFSD.mnWidth : rFSD.mnHeight;
+ int nHeight = rFSD.mnHeight;
+ int nWidth = rFSD.mnWidth ? rFSD.mnWidth : nHeight;
+
+ std::vector<int>::const_iterator aEnd = glyph_extrarotation.end();
+ std::vector<int>::const_iterator aStart = glyph_extrarotation.begin();
+ std::vector<int>::const_iterator aI = aStart;
+ while (aI != aEnd)
+ {
+ int nGlyphRotation = *aI;
+
+ std::vector<int>::const_iterator aNext = std::find_if(aI+1, aEnd, hasRotation);
+
+ cairo_matrix_init_identity(&m);
+
+ if (rFont.NeedsArtificialItalic())
+ m.xy = -m.xx * 0x6000L / 0x10000L;
+
+ if (rLayout.GetOrientation())
+ cairo_matrix_rotate(&m, (3600 - rLayout.GetOrientation()) * M_PI / 1800.0);
- rCairo.matrix_init_identity(&m);
+ cairo_matrix_scale(&m, nWidth, nHeight);
- if (rLayout.GetOrientation())
- rCairo.matrix_rotate(&m, (3600 - rLayout.GetOrientation()) * M_PI / 1800.0);
+ if (nGlyphRotation)
+ {
+ cairo_matrix_rotate(&m, (3600 - nGlyphRotation) * M_PI / 1800.0);
+
+ cairo_font_extents_t extents;
+ cairo_font_extents(cr, &extents);
+ //gives the same positions as pre-cairo conversion, but I don't like them
+ double xdiff = -extents.descen