office-gobmx/vcl
Andrea Gelmini 08c529c6c1 Fix typos
Change-Id: I81d85cb8ae8b0075929beb01e8991d895b94d0c4
Reviewed-on: https://gerrit.libreoffice.org/71314
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2019-04-26 00:07:31 +02:00
..
android o3tl::make_unique -> std::make_unique in tools..xmloff 2019-02-08 12:30:06 +01:00
backendtest remove or change salbtype.hxx includes 2019-04-17 01:18:36 +02:00
headless tdf#124923: Remove unneeded iOS ifdeffery 2019-04-24 14:19:04 +03:00
inc Related: tdf#113076 vcl win DirectWrite: handle stretched text 2019-04-24 18:40:15 +02:00
ios Further tweaks that affect the "tunnelled" dialogs in the iOS app 2019-03-14 15:23:56 +02:00
null
opengl fix areaScaleFragmentShader.glsl with texture atlas (tdf#105277) 2019-04-16 13:46:30 +02:00
osx optimise find/insert pattern 2019-04-19 13:19:31 +02:00
qa test unreliable under windows 2019-04-25 16:07:17 +02:00
qt5 use more std::make_unique 2019-04-13 09:28:44 +02:00
quartz tdf#101854 Move to CommonSalLayout removed faux bold in macos 2019-04-21 01:00:48 +02:00
source lazy image loading shouldn't read the entire .xls file (tdf#124828) 2019-04-24 08:59:29 +02:00
uiconfig tdf#124567 Print dialog: distance & margin mixed up 2019-04-08 09:41:13 +02:00
unx Fix typos 2019-04-26 00:07:31 +02:00
win Related: tdf#113076 vcl win DirectWrite: handle stretched text 2019-04-24 18:40:15 +02:00
workben loplugin:sequentialassign in vcl 2019-04-15 11:02:53 +02:00
AllLangMoTarget_vcl.mk
commonfuzzer.mk ctl (UnoControls) needed now 2019-03-25 22:13:21 +01:00
CppunitTest_vcl_apitests.mk
CppunitTest_vcl_app_test.mk
CppunitTest_vcl_backend_test.mk Add backend tests as CPPUNIT tests 2019-04-16 03:48:28 +02:00
CppunitTest_vcl_bitmap_render_test.mk Test drawing BitmapEx with an alpha channel on a VirtualDevice 2019-04-16 07:20:00 +02:00
CppunitTest_vcl_bitmap_test.mk Add test for BitmapEx GetPixelColor for 24+8 and 32bit Bitmaps 2019-04-16 06:52:47 +02:00
CppunitTest_vcl_bitmapprocessor_test.mk
CppunitTest_vcl_blocklistparser_test.mk
CppunitTest_vcl_complextext.mk Related: tdf#124109 vcl: make glyph item caching work with kashida glyphs 2019-03-22 18:45:43 +01:00
CppunitTest_vcl_dialogs_test.mk
CppunitTest_vcl_errorhandler.mk
CppunitTest_vcl_filters_test.mk
CppunitTest_vcl_font.mk
CppunitTest_vcl_fontcharmap.mk
CppunitTest_vcl_fontfeature.mk
CppunitTest_vcl_fontmetric.mk
CppunitTest_vcl_gen.mk tdf#107966 vcl opengl: fix not drawn 1px wide polypolygons 2019-03-29 15:20:49 +01:00
CppunitTest_vcl_graphic_test.mk vcl_graphic_test requires Library_gie for .gif 2019-02-04 19:20:34 +01:00
CppunitTest_vcl_jpeg_read_write_test.mk check that jpeg export of 8bit non-grayscale works 2019-03-28 15:44:19 +01:00
CppunitTest_vcl_lifecycle.mk
CppunitTest_vcl_mnemonic.mk
CppunitTest_vcl_outdev.mk vcl: protect more outdev functions for disposed state 2019-01-15 23:22:11 +01:00
CppunitTest_vcl_pdfexport.mk
CppunitTest_vcl_png_test.mk add PngImageFilter that uses libpng for PNG loading 2019-02-09 11:57:48 +01:00
CppunitTest_vcl_svm_test.mk fix vcl_svm_test with OpenGL 2019-04-16 13:45:46 +02:00
CppunitTest_vcl_timer.mk
CppunitTest_vcl_widget_definition_reader_test.mk Read style colors from a xml widget definition file 2019-03-04 12:28:51 +01:00
CustomTarget_gtk3_kde5_moc.mk
CustomTarget_kde5_moc.mk
CustomTarget_nativecalc.mk
CustomTarget_nativecore.mk
CustomTarget_nativedraw.mk
CustomTarget_nativemath.mk
CustomTarget_nativewriter.mk
CustomTarget_qt5_moc.mk tdf#122689 qt5: Consider external clipboard updates 2019-02-27 20:57:11 +01:00
Executable_602fuzzer.mk
Executable_bmpfuzzer.mk
Executable_cgmfuzzer.mk
Executable_diffuzzer.mk
Executable_docxfuzzer.mk
Executable_dxffuzzer.mk
Executable_epsfuzzer.mk
Executable_fftester.mk
Executable_fodpfuzzer.mk
Executable_fodsfuzzer.mk
Executable_fodtfuzzer.mk
Executable_giffuzzer.mk
Executable_htmlfuzzer.mk
Executable_hwpfuzzer.mk
Executable_icontest.mk Cut down on -pthread/-lpthread proliferation 2019-04-25 21:27:43 +02:00
Executable_jpgfuzzer.mk
Executable_lo_kde5filepicker.mk Cut down on -pthread/-lpthread proliferation 2019-04-25 21:27:43 +02:00
Executable_lwpfuzzer.mk
Executable_metfuzzer.mk
Executable_mmlfuzzer.mk
Executable_mtfdemo.mk Cut down on -pthread/-lpthread proliferation 2019-04-25 21:27:43 +02:00
Executable_mtpfuzzer.mk
Executable_olefuzzer.mk
Executable_outdevgrind.mk
Executable_pcdfuzzer.mk
Executable_pctfuzzer.mk
Executable_pcxfuzzer.mk
Executable_pngfuzzer.mk
Executable_ppmfuzzer.mk
Executable_pptfuzzer.mk
Executable_pptxfuzzer.mk
Executable_psdfuzzer.mk
Executable_qpwfuzzer.mk
Executable_rasfuzzer.mk
Executable_rtffuzzer.mk
Executable_scrtffuzzer.mk
Executable_sftfuzzer.mk
Executable_slkfuzzer.mk
Executable_svdemo.mk
Executable_svmfuzzer.mk
Executable_svpclient.mk
Executable_svptest.mk
Executable_tgafuzzer.mk
Executable_tiffuzzer.mk
Executable_ui-previewer.mk Cut down on -pthread/-lpthread proliferation 2019-04-25 21:27:43 +02:00
Executable_vcldemo.mk Cut down on -pthread/-lpthread proliferation 2019-04-25 21:27:43 +02:00
Executable_visualbackendtest.mk Cut down on -pthread/-lpthread proliferation 2019-04-25 21:27:43 +02:00
Executable_wksfuzzer.mk
Executable_wmffuzzer.mk
Executable_ww2fuzzer.mk
Executable_ww6fuzzer.mk
Executable_ww8fuzzer.mk
Executable_xbmfuzzer.mk
Executable_xid_fullscreen_on_all_monitors.mk
Executable_xlsfuzzer.mk
Executable_xlsxfuzzer.mk
Executable_xpmfuzzer.mk
Library_desktop_detector.mk Cut down on -pthread/-lpthread proliferation 2019-04-25 21:27:43 +02:00
Library_vcl.mk Cut down on -pthread/-lpthread proliferation 2019-04-25 21:27:43 +02:00
Library_vclplug_gen.mk Cut down on -pthread/-lpthread proliferation 2019-04-25 21:27:43 +02:00
Library_vclplug_gtk.mk Cut down on -pthread/-lpthread proliferation 2019-04-25 21:27:43 +02:00
Library_vclplug_gtk3.mk Cut down on -pthread/-lpthread proliferation 2019-04-25 21:27:43 +02:00
Library_vclplug_gtk3_kde5.mk Cut down on -pthread/-lpthread proliferation 2019-04-25 21:27:43 +02:00
Library_vclplug_kde5.mk Cut down on -pthread/-lpthread proliferation 2019-04-25 21:27:43 +02:00
Library_vclplug_osx.mk
Library_vclplug_qt5.mk Cut down on -pthread/-lpthread proliferation 2019-04-25 21:27:43 +02:00
Library_vclplug_win.mk Replace legacy dynamically-loaded functions with statically linked ones 2019-04-05 23:13:15 +02:00
Makefile
Module_vcl.mk Library_vcl has a dependency on vcl opengl packages 2019-04-16 13:41:30 +02:00
Package_fontunxppds.mk
Package_fontunxpsprint.mk
Package_opengl_blacklist.mk
Package_opengl_shader.mk Library_vcl has a dependency on vcl opengl packages 2019-04-16 13:41:30 +02:00
Package_osxres.mk
Package_theme_definitions.mk ios widget defs: update combobox, checkbox, spinbox SVGs 2019-04-04 16:59:26 +02:00
Package_tipoftheday.mk fix build failure, use explicit $(SRCDIR) 2019-04-10 21:39:09 +01:00
README svm xml dumper: move this from test to vcl 2019-01-03 15:08:06 +01:00
README.GDIMetaFile
README.lifecycle
README.scheduler
README.vars
StaticLibrary_fuzzer_calc.mk
StaticLibrary_fuzzer_core.mk
StaticLibrary_fuzzer_draw.mk
StaticLibrary_fuzzer_math.mk
StaticLibrary_fuzzer_writer.mk
StaticLibrary_fuzzerstubs.mk
StaticLibrary_glxtest.mk Cut down on -pthread/-lpthread proliferation 2019-04-25 21:27:43 +02:00
StaticLibrary_vclmain.mk
UIConfig_vcl.mk
vcl.android.component
vcl.common.component
vcl.headless.component
vcl.ios.component
vcl.macosx.component
vcl.unx.component
vcl.windows.component
WinResTarget_vcl.mk

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

It should not be confused with Borland's Visual Component Library, which is entirely unrelated.

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/
	+ macOS backend

ios/
	+ iOS backend

quartz/
	+ code common to macOS and iOS

win/
	+ Windows backend

qt5/
	+ Qt5 (under construction)

unx/
	+ X11 backend and its sub-platforms

	gtk/
		+ GTK2 support
	gtk3/
		+ GTK3 support
	kde5/
		+ KDE5 support
	gtk3_kde5/
		+ GTK3 support with KDE5 file pickers (alternative to native kde5 one)
	generic/
		+ raw X11 support

		plugadapt/
			+ pluggable framework to select correct unx backend

		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 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/vcl/mtfxmldump.hxx that
can store a GDIMetafile as XML, which makes debugging much easier
since you can just use "diff" to see changes.

== 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