office-gobmx/vcl
Noel Grandin e7f6fdd5c3 loplugin:unusedfields
The mnRequestedLength fields in formula/ were introduced in

    commit 6ef6dd0122
    Author: Kohei Yoshida <kohei.yoshida@collabora.com>
    Date:   Wed Feb 26 14:32:57 2014 -0500
    Store the length of originally requested array size prior to
    trimming.

but then partially removed in

    commit d7f1f91b19
    Author: Noel Grandin <noel@peralex.com>
    Date:   Mon Mar 3 13:29:43 2014 +0200
    remove unused code in formula/vectortoken

Change-Id: Ic56b6e42682131ee45df7838867145f980f3d601
Reviewed-on: https://gerrit.libreoffice.org/45571
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-01 08:13:06 +01:00
..
android Replace list by vector for ShowNativeDialog (vcl) 2017-11-11 23:36:17 +01:00
backendtest loplugin:includeform: vcl 2017-10-23 22:45:47 +02:00
headless Resolves: tdf#114117 draw page shadow mangled 2017-11-29 21:40:58 +01:00
inc loplugin:unusedfields 2017-12-01 08:13:06 +01:00
ios Replace list by vector for ShowNativeDialog (vcl) 2017-11-11 23:36:17 +01:00
null Replace lists by vectors printer part (vcl) 2017-09-02 06:50:53 +02:00
opengl loplugin:constparams in various(2) 2017-11-06 07:13:42 +01:00
osx loplugin:unnecessaryparen 2017-11-23 13:55:01 +01:00
qa loplugin:flatten in vcl 2017-11-15 12:13:42 +01:00
qt5 Adapt Library_vclplug_qt5 2017-11-14 11:40:50 +01:00
quartz use std::unique_ptr for SalLayout 2017-11-14 10:19:32 +01:00
source loplugin:unusedfields 2017-12-01 08:13:06 +01:00
uiconfig/ui Resolves: tdf#113435 device tab missing from print dialog 2017-10-25 17:31:24 +02:00
unx Make loplugin:unnecessaryparen look through implicit 2017-11-23 10:00:44 +01:00
win loplugin:useuniqueptr (clang-cl) 2017-11-27 23:36:55 +01:00
workben add mml support to fftester 2017-11-30 20:35:26 +00:00
AllLangMoTarget_vcl.mk migrate to boost::gettext 2017-07-21 08:20:50 +01:00
commonfuzzer.mk consistent naming of externals: png -> libpng 2017-09-15 11:01:39 +02:00
CppunitTest_vcl_app_test.mk
CppunitTest_vcl_bitmap_test.mk gbuild: Remove MSVC 2013 legacy code 2017-04-21 18:18:44 +02:00
CppunitTest_vcl_bitmapprocessor_test.mk gbuild: Remove MSVC 2013 legacy code 2017-04-21 18:18:44 +02:00
CppunitTest_vcl_blocklistparser_test.mk gbuild: Remove MSVC 2013 legacy code 2017-04-21 18:18:44 +02:00
CppunitTest_vcl_complextext.mk vcl: CppunitTest_vcl_complextext requires DejaVu fonts 2017-11-06 17:37:23 +01:00
CppunitTest_vcl_dialogs_test.mk gbuild: Remove MSVC 2013 legacy code 2017-04-21 18:18:44 +02:00
CppunitTest_vcl_errorhandler.mk Uwinapi is not used any more 2017-04-27 12:22:06 +02:00
CppunitTest_vcl_filters_test.mk emfplus: corrections for UnitTest in vcl 2017-07-15 11:01:31 +02:00
CppunitTest_vcl_font.mk gbuild: Remove MSVC 2013 legacy code 2017-04-21 18:18:44 +02:00
CppunitTest_vcl_fontcharmap.mk gbuild: Remove MSVC 2013 legacy code 2017-04-21 18:18:44 +02:00
CppunitTest_vcl_fontmetric.mk gbuild: Remove MSVC 2013 legacy code 2017-04-21 18:18:44 +02:00
CppunitTest_vcl_jpeg_read_write_test.mk gbuild: Remove MSVC 2013 legacy code 2017-04-21 18:18:44 +02:00
CppunitTest_vcl_lifecycle.mk gbuild: Remove MSVC 2013 legacy code 2017-04-21 18:18:44 +02:00
CppunitTest_vcl_mnemonic.mk mnemonics in words with Eszett misplaced 2017-07-21 21:36:49 +01:00
CppunitTest_vcl_outdev.mk gbuild: Remove MSVC 2013 legacy code 2017-04-21 18:18:44 +02:00
CppunitTest_vcl_pdfexport.mk CppunitTest_vcl_pdfexport: replace std::search() with pdfium calls 2017-05-04 10:49:31 +02:00
CppunitTest_vcl_svm_test.mk gbuild: Remove MSVC 2013 legacy code 2017-04-21 18:18:44 +02:00
CppunitTest_vcl_timer.mk gbuild: Remove MSVC 2013 legacy code 2017-04-21 18:18:44 +02:00
CustomTarget_kde4_moc.mk
CustomTarget_kde5_moc.mk kde5: copy basic kde4 blocks -> kde5 and build againt qt5/kf5 libs 2017-10-25 03:23:12 +02:00
CustomTarget_nativecalc.mk refactor fuzzer army a bit 2017-06-11 22:26:31 +02:00
CustomTarget_nativecore.mk refactor fuzzer army a bit 2017-06-11 22:26:31 +02:00
CustomTarget_nativedraw.mk refactor fuzzer army a bit 2017-06-11 22:26:31 +02:00
CustomTarget_nativewriter.mk refactor fuzzer army a bit 2017-06-11 22:26:31 +02:00
CustomTarget_qt5_moc.mk QT5 first stab on implementing CommonSalLayout 2017-11-06 12:05:32 +01:00
Executable_602fuzzer.mk shrink 602 fuzzer 2017-10-16 16:44:19 +01:00
Executable_bmpfuzzer.mk shrink bmp fuzzer 2017-10-09 18:07:15 +02:00
Executable_cgmfuzzer.mk shrink cgm fuzzer 2017-10-23 17:01:05 +01:00
Executable_diffuzzer.mk add dif fuzzer 2017-11-09 16:43:16 +01:00
Executable_docxfuzzer.mk add docx fuzzer 2017-11-28 11:04:04 +01:00
Executable_dxffuzzer.mk shrink dxf fuzzer 2017-10-15 15:15:56 +01:00
Executable_epsfuzzer.mk reduce eps fuzzer size 2017-10-16 00:25:03 +02:00
Executable_fftester.mk fix macosx build failure 2017-03-24 13:52:11 +00:00
Executable_fodpfuzzer.mk add fodp fuzzer 2017-09-24 17:29:44 +02:00
Executable_fodsfuzzer.mk add fods fuzzer 2017-09-21 09:55:44 +02:00
Executable_fodtfuzzer.mk expose fodt to oss-fuzz 2017-09-19 13:41:15 +02:00
Executable_giffuzzer.mk shrink gif fuzzer 2017-10-09 11:19:03 +01:00
Executable_hwpfuzzer.mk shrink hwp fuzzer 2017-10-16 08:38:24 +01:00
Executable_icontest.mk post glew->epoxy, we don't need to link to win openg32 and mac OpenGL 2016-12-13 21:01:48 +00:00
Executable_jpgfuzzer.mk shrink jpg fuzzer 2017-10-09 11:39:37 +02:00
Executable_lwpfuzzer.mk shrink lwp fuzzer 2017-10-16 17:01:20 +01:00
Executable_metfuzzer.mk shrink met fuzzer 2017-10-15 16:44:07 +01:00
Executable_mtfdemo.mk
Executable_olefuzzer.mk shrink ole fuzzer 2017-10-16 17:31:08 +01:00
Executable_outdevgrind.mk
Executable_pcdfuzzer.mk shrink pcd fuzzer 2017-10-15 10:50:12 +01:00
Executable_pctfuzzer.mk shrink pct fuzzer 2017-10-15 21:09:37 +01:00
Executable_pcxfuzzer.mk shrink pcx fuzzer 2017-10-15 21:24:59 +01:00
Executable_pngfuzzer.mk shrink png fuzzer 2017-10-09 17:08:39 +02:00
Executable_ppmfuzzer.mk shrink ppm fuzzer 2017-10-15 16:59:24 +01:00
Executable_pptfuzzer.mk shrink ppt fuzzer 2017-10-23 16:27:34 +01:00
Executable_psdfuzzer.mk shrink psd fuzzer 2017-10-15 17:14:42 +01:00
Executable_qpwfuzzer.mk shrink qpw fuzzer 2017-10-23 09:22:05 +01:00
Executable_rasfuzzer.mk shrink ras fuzzer 2017-10-15 23:26:55 +01:00
Executable_rtffuzzer.mk shrink rtf fuzzer 2017-10-23 10:26:57 +01:00
Executable_scrtffuzzer.mk add calc rtf fuzzer 2017-11-06 15:12:26 +01:00
Executable_slkfuzzer.mk shrink slk fuzzer 2017-10-22 20:44:27 +01:00
Executable_svdemo.mk
Executable_svmfuzzer.mk shrink svm fuzzer 2017-10-14 20:55:46 +01:00
Executable_svpclient.mk
Executable_svptest.mk
Executable_tgafuzzer.mk shrink tga fuzzer 2017-10-15 23:43:41 +01:00
Executable_tiffuzzer.mk shrink tiff fuzzer 2017-10-16 08:24:45 +01:00
Executable_ui-previewer.mk
Executable_vcldemo.mk change from glew to epoxy 2016-12-13 11:33:18 +00:00
Executable_visualbackendtest.mk change from glew to epoxy 2016-12-13 11:33:18 +00:00
Executable_wksfuzzer.mk add 1-2-3 fuzzer 2017-11-07 17:44:05 +01:00
Executable_wmffuzzer.mk knock 200M off wmf fuzzer 2017-10-08 21:00:19 +01:00
Executable_ww2fuzzer.mk shrink ww2 fuzzer 2017-10-19 15:16:19 +01:00
Executable_ww6fuzzer.mk shrink ww6 fuzzer 2017-10-20 09:21:29 +01:00
Executable_ww8fuzzer.mk shrink ww8 fuzzer 2017-10-20 13:49:18 +01:00
Executable_xbmfuzzer.mk shrink xbm fuzzer 2017-10-09 15:37:09 +02:00
Executable_xid_fullscreen_on_all_monitors.mk
Executable_xlsfuzzer.mk add xls fuzzer 2017-11-02 10:16:15 +01:00
Executable_xlsxfuzzer.mk add xlsx fuzzer 2017-11-30 10:00:30 +01:00
Executable_xpmfuzzer.mk shrink xpm fuzzer 2017-10-09 16:49:33 +02:00
Library_desktop_detector.mk
Library_vcl.mk lokdialog: Move the painting down to Window, and enable Calc and Impress. 2017-11-29 10:16:57 +01:00
Library_vclplug_gen.mk change from glew to epoxy 2016-12-13 11:33:18 +00:00
Library_vclplug_gtk.mk change from glew to epoxy 2016-12-13 11:33:18 +00:00
Library_vclplug_gtk3.mk change from glew to epoxy 2016-12-13 11:33:18 +00:00
Library_vclplug_kde4.mk change from glew to epoxy 2016-12-13 11:33:18 +00:00
Library_vclplug_kde5.mk KF5 seperate Qt5 detection from KF5 2017-11-06 12:05:31 +01:00
Library_vclplug_qt5.mk QT5 implement Graphics damage tracking 2017-11-06 12:05:32 +01:00
Makefile
Module_vcl.mk add xlsx fuzzer 2017-11-30 10:00:30 +01:00
Package_fontunxppds.mk
Package_fontunxpsprint.mk
Package_opengl.mk
Package_opengl_blacklist.mk
Package_osxres.mk remove the remaining unused mouse cursors 2017-04-14 10:27:04 +01:00
README vcl: adapt README to VCL_DEBUG_DISABLE_PDFCOMPRESSION changes 2017-07-07 16:31:20 +02:00
README.GDIMetaFile Fix typos 2017-03-02 12:43:32 +00:00
README.lifecycle
README.scheduler WIN guarantee direct timeout handling 2017-10-20 10:45:58 +02:00
README.vars vcl: parallelize JPEG import from ImportGraphics() 2017-05-24 14:24:11 +02:00
StaticLibrary_fuzzer_calc.mk refactor fuzzer army a bit 2017-06-11 22:26:31 +02:00
StaticLibrary_fuzzer_core.mk refactor fuzzer army a bit 2017-06-11 22:26:31 +02:00
StaticLibrary_fuzzer_draw.mk refactor fuzzer army a bit 2017-06-11 22:26:31 +02:00
StaticLibrary_fuzzer_writer.mk refactor fuzzer army a bit 2017-06-11 22:26:31 +02:00
StaticLibrary_fuzzerstubs.mk refactor fuzzer army a bit 2017-06-11 22:26:31 +02:00
StaticLibrary_glxtest.mk
StaticLibrary_vclmain.mk
UIConfig_vcl.mk convert edit menu to .ui format 2017-01-30 15:44:23 +00:00
vcl.android.component enable clipboard service for android 2017-04-25 11:48:02 +02:00
vcl.headless.component
vcl.ios.component
vcl.macosx.component
vcl.unx.component
vcl.windows.component
WinResTarget_vcl.mk remove the remaining unused mouse cursors 2017-04-14 10:27:04 +01:00

Visual Components Library is responsible for the widgets (windowing, buttons, controls, file-pickers etc.) operating system abstraction, including basic rendering (e.g. the output device).

VCL provides a graphical toolkit similar to gtk+, Qt, SWING etc.

source/
	+ the main cross-platform chunk of source

inc/
	+ cross-platform abstraction headers

headless/
	+ a backend renderer that draws to bitmaps

android/
	+ Android backend

osx/
	+ OS X backend

ios/
	+ iOS backend

quartz/
	+ code common to OS X and iOS

win/
	+ Windows backend

unx/
	+ X11 backend and its sub-platforms

	plugadapt/
		+ pluggable framework to select correct unx backend
	gtk/
		+ GTK2 support
	gtk3/
		+ GTK3.2+ support
	kde/
		+ KDE3 support
	kde4/
		+ KDE4 support
	generic/
		+ raw X11 support

		dtrans/
			+ "data transfer" - clipboard handling
			+ http://stackoverflow.com/questions/3261379/getting-html-source-or-rich-text-from-the-x-clipboard
			  for tips how to show the current content of the
			  clipboard


How the platform abstraction works

	+ InitVCL calls 'CreateSalInstance'
		+ this is implemented by the compiled-in platform backend
		+ it stores various bits of global state in the
		  'SalData' (inc/saldatabasic.hxx) structure but:
	+ the SalInstance vtable is the primary outward facing gateway
	  API for platform backends
		+ It is a factory for:
		  SalFrames, SalVirtualDevices, SalPrinters,
		  Timers, the SolarMutex, Drag&Drop and other
		  objects, as well as the primary event loop wrapper.

Note: references to "SV" in the code mean StarView, which was a
portable C++ class library for GUIs, with very old roots, that was
developed by StarDivision. Nowadays it is not used by anything except
LibreOffice (and OpenOffice).

"svp" stands for "StarView Plugin".

== COM threading ==

The way COM is used in LO generally:
- vcl InitSalData() puts main thread into Single-threaded Apartment (STA)
- oslWorkerWrapperFunction() puts every thread spawned via oslCreateThread()
  into MTA (free-threaded)

== GDIMetafile ==

GDIMetafile is a vector drawing representation that corresponds directly
to the SVM (StarView Metafile) format; it is extremely important as
an intermediate format in all sorts of drawing and printing operations.

There is a class MetafileXmlDump in include/test/mtfxmldump.hxx that
can store a GDIMetafile as XML, which makes debugging much easier
since you can just use "diff" to see changes.

To use it you need to link against "test" library and then (because
"test" is not part of the installation) run with:
LD_LIBRARY_PATH=workdir/LinkTarget/Library:workdir/UnpackedTarball/cppunit/src/cppunit/.libs instdir/program/soffice

== EMF+ ==

emf+ is vector file format used by MSO and is successor of wmf and
emf formats. see
http://msdn.microsoft.com/en-us/library/cc230724.aspx for
documentation. note that we didn't have this documentation from
start, so part of the code predates to the time when we had guessed
some parts and can be enhanced today. there also still many thing not
complete

emf+ is handled a bit differently compared to original emf/wmf files,
because GDIMetafile is missing features we need (mostly related to
transparency, argb colors, etc.)

emf/wmf is translated to GDIMetafile in import filter
vcl/source/filter/wmf and so special handling ends here

emf+ is encapsulated into GDIMetafile inside comment records and
parsed/rendered later, when it reaches cppcanvas. it is parsed and
rendered in cppcanvas/source/mtfrenderer. also note that there are
emf+-only and emf+-dual files. dual files contains both types of
records (emf and emf+) for rendering the images. these can used also
in applications which don't know emf+. in that case we must ignore
emf records and use emf+ for rendering. for more details see
documentation

parsing:

 wmf/emf filter --> GDI metafile with emf+ in comments --> cppcanvas metafile renderer

lately the GDIMetafile rendering path changed which also influenced
emf+ rendering. now many things happen in drawing layer, where
GDIMetafile is translated into drawing layer primitives. for
metafiles with emf+ we let the mtfrenderer render them into bitmap
(with transparency) and use this bitmap in drawinlayer. cleaner
solution for current state would be to extend the drawing layer for
missing features and move parsing into drawing layer (might be quite
a lot of work). intermediary enhancement would be to know better the
needed size/resolution of the bitmap, before we render emf+ into
bitmap in drawing layer. Thorsten is working on the same problem with
svg rendering, so hopefully his approach could be extended for emf+ as
well. the places in drawing layer where we use canvas mtfrenderer to
render into bitmaps can be found when you grep for GetUseCanvas. also
look at vcl/source/gdi/gdimetafile.cxx where you can look for
UseCanvas again. moving the parsing into drawinglayer might also have
nice side effect for emf+-dual metafiles. in case the emf+ records
are broken, it would be easier to use the duplicit emf
rendering. fortunately we didn't run into such a broken emf+ file
yet. but there were already few cases where we first though that the
problem might be because of broken emf+ part. so far it always turned
out to be another problem.

rendering:

 before

 vcl --> cppcanvas metafile renderer --> vcl

 now

 drawing layer --> vcl --> cppcanvas metafile renderer --> vcl --> drawing layer

another interesting part is actual rendering into canvas bitmap and
using that bitmap later in code using vcl API.

EMF+ implementation has some extensive logging, best if you do a dbgutil
build, and then

export SAL_LOG=+INFO.cppcanvas.emf+INFO.vcl.emf

before running LibreOffice; it will give you lots of useful hints.

You can also fallback to EMF (from EMF+) rendering via

export EMF_PLUS_DISABLE=1


== Printing/PDF export ==

Printing from Writer works like this:

1) individual pages print by passing an appropriate OutputDevice to XRenderable
2) in drawinglayer, a VclMetafileProcessor2D is used to record everything on
   the page (because the OutputDevice has been set up to record a GDIMetaFile)
3) the pages' GDIMetaFiles are converted to PDF by the vcl::PDFWriter
   in vcl/source/gdi/pdfwriter*

Creating the ODF thumbnail for the first page works as above except step 3 is:

3) the GDIMetaFile is replayed to create the thumbnail

On-screen display differs in step 1 and 2:

1) the VCL Window gets invalidated somehow and paints itself
2) in drawinglayer, a VclPixelProcessor2D is used to display the content


=== Debugging PDF export ===

Debugging the PDF export becomes much easier when
compression is disabled (so the PDF file is directly readable) and
the MARK function puts comments into the PDF file about which method
generated the following PDF content.

The compression can be disabled even using a env. var:

export VCL_DEBUG_DISABLE_PDFCOMPRESSION=1

To de-compress the contents of a PDF file written by a release build or
other programs, use the "pdfunzip" tool:

bin/run pdfunzip input.pdf output.pdf