Difference between revisions of "User:CL"

From Apache OpenOffice Wiki
Jump to: navigation, search
(update 2006-08-21)
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
My log of the vcl bitmap and widget stuff to the QUARTZ API
+
My personal list of todo stuff and current status
  
Nick on irc.freenode.net : ChristianL
+
Nick on irc.freenode.net : CL
  
Mail : mac AT fishbyte.de
+
Mail : christian.lippka AT sun.com
  
 
== DISCLAIMER ==
 
== DISCLAIMER ==
Line 13: Line 13:
 
</pre>
 
</pre>
  
== Status updates ==
+
== Current Work ==
  
=== [[2006]]-[[08-21]] ===
+
* Fixing issues for OOo 3.3
 +
* Embedding Video/Sounds in impress
  
[http://www.fishbyte.de/menu.png Screenshot of the day]
+
== Whats new in impress/draw ==
  
Today I did a resync of aquavcl01 to m182.
+
=== OOo 3.3 ===
  
I looked at the sample implementation of how we could use the RunApplicationEvent() method to install some basic needed CarbonEvent handlers. The problem with that is that this call only returns when the application is finished.
+
* [http://www.openoffice.org/issues/show_bug.cgi?id=48179 Backward navigation in effects in impress]
So basicly what that sample code did and what I added to the ImplSVMainHook() method is the following
+
* [http://qa.openoffice.org/issues/show_bug.cgi?id=57928 Format paintbrush enabled for text selection and more shapes]
  
<pre>
+
== TODO ==
BOOL ImplSVMainHook( BOOL * pbInit )
+
{
+
  EventLoopTimerRef aMainRunLoopTimerRef;
+
  
  (void) InstallEventLoopTimer( GetCurrentEventLoop(), 0, 0,
+
=== cws impressmedia01 ===
                                NewEventLoopTimerUPP( MainRunLoopForThreadedApps ),
+
                                NULL, &aMainRunLoopTimerRef );
+
  
  RunApplicationEventLoop();
+
==== Feature Mails ====
  
  return TRUE;  // indicate that ImplSVMainHook is implemented
+
Service "com.sun.star.io.comp.TempFile" got XInitialization interface and the following css::beans::NamedValue arguments
  
}
+
* [optional] string LeadingChars // name of the tempfile will start with this string, followed by a counter to make the name unique
</pre>
+
* [optional] string Extension // extension for the tempfile. If none is given, the extension will be ".tmp"
 +
* [optional] string Parent // if given, this will be the parent directory of the tempfile
 +
* [optional] boolean KillingFileEnabled // if true, the file will be deleted as soon as the instance of this service is deleted
  
The ImplSVMainHook() function is directly called from the applicaions main function. It is an alternative
+
=== Open ODF issues ===
for the call to ImplSVMain(). So when the ''return TRUE;'' statement is hit, the application
+
exits. What RunApplicationEventLoop() does is init all default handlers and then call the
+
registered timer handler at MainRunLoopForThreadedApps(). This is the code:
+
  
<pre>
+
* draw:textarea-horizontal-align attribute has no default exported? [[http://www.openoffice.org/issues/show_bug.cgi?id=85397 issue 85397]]
static pascal void MainRunLoopForThreadedApps( EventLoopTimerRef inTimer, void *inUserData )
+
{
+
  BOOL bRet = ImplSVMain();
+
  QuitApplicationEventLoop();
+
}
+
</pre>
+
  
And as you can see, all that we do is call the original ImplSVMain() instead of the ImplSVMainHook() which starts the actual office. So the stack currently is
+
=== Frequently needed Issues ===
  
<pre>
+
* incompatible bullets from 3.0 in 2.x => issue 91466
{office code}
+
ImplSVMain()
+
MainRunLoopForThreadedApps()
+
ImplSVMainHook()
+
SVMain()
+
main()
+
</pre>
+
  
So we are still inside the call to RunApplicationEventLoop() but we can also query for all events ourselfs. As soon as ImplSVMain() exits, we tell QuitApplicationEventLoop() to end the application event loop, therefore exiting ImplSVMainHook and quiting the application for good.
+
=== Open ODF 1.2 features ===
  
The results, as you can see on my screenshot above are realy cool. Rulers started to paint themselfs, I could create actuall shapes in impress, many repaint problems vanished. I even could start some java wizards without problems. Then I also compiled with pavels native menus and they worked! Great work pavel.
+
Auto shrink text in shapes [[http://lists.oasis-open.org/archives/office/200701/msg00025.html OASIS]]
 +
Status: Desired for OOo3.x
  
Eric and Pierre are currently implementing more native drawn widgets so expect some real cool screenshots soon.
+
Proposal: last visited page interaction [[http://lists.oasis-open.org/archives/office/200701/msg00042.html OASIS]]
 +
Status: Desired for OOo3.x
  
=== [[2006]]-[[08-19]] ===
+
How to add animations for shapes on master pages [[http://lists.oasis-open.org/archives/office/200702/msg00123.html OASIS]]
 +
Status: Desired for OOo 3.x
  
[http://www.fishbyte.de/toolbar_bitmaps.png Screenshot of the day]
+
Proposal for rounded corners of rects (draw:corner-radius) [[http://lists.oasis-open.org/archives/office/200703/msg00206.html OASIS]]
 +
Status: Currently not planed for OOo
  
Not much update today. I managed to find my transparency problem yesterday night. You can see the
+
Add glue points to 3D objects [[http://lists.oasis-open.org/archives/office/200705/msg00102.html OASIS]]
results on the screenshot above. I cleaned up my code a bit and commit everything to vcl. I also implemented that each window now also have an offscreen CGBitmapContext. All drawings are rendered both to the window and the offscreen bitmap. If pixels needs to be read, the offscreen bitmap is used.
+
Status: Currently not planed for OOo
  
If you want to check it out, update vcl/aqua and also delete your ~/Library/Application Support/OpenOffice.org 2.0/users directory as it contains cached images that are broken.
+
Proposal to enhance hyperlinks to support shapes [[http://lists.oasis-open.org/archives/office/200707/msg00061.html OASIS]]
 +
Status: Import planned for OOo 2.4, export desired for OOo 3.x
  
Currently the office loops as soon as a multi line text is visible. It loops somewhere in that ATSULayout stuff. I have to ask Stephan on monday if he may have a look as this crash is annoying.
+
<svg:desc> and <svg:title> for drawing pages [[http://lists.oasis-open.org/archives/office/200710/msg00065.html OASIS]]
 +
Status: Still under discussion in the TC
  
=== [[2006]]-[[08-18]] ===
+
Layer-set per page [[http://lists.oasis-open.org/archives/office/200705/msg00132.html OASIS]]
 +
Status: Still under discussion in the TC
  
[http://www.fishbyte.de/nativecontrols.png Screenshot of the day]
+
Points are integers in ODF,but floating-point in SVG [[http://lists.oasis-open.org/archives/office/200703/msg00243.html OASIS]]
 +
Status: Still under discussion in the TC
  
Status: I optimized the AquaSalBitmap implementation. In my first emplementation I always created a [http://developer.apple.com/documentation/GraphicsImaging/Reference/CGBitmapContext/Reference/reference.html CGBitmapContext] with either 16 or 32 bit. This made it fast and easy to create CGImage for rendering. The cost was that for AquaSalBitmap::AquireBuffer I had to convert the mac format back to VCL for 1,4,8 and 24 bit formats. This also is a drawback because many SalBitmaps are not even used for drawing. For example when loading a bitmap from a file a SalBitmap with the original file format is created. Then this is copied via the Create( const SalBitmap& rSalBmp, SalGraphics* pGraphics ) to have the same format as the current display. Also alpha masks are never drawn directly.
+
=Headless Mode Debuging=
  
As a consequence, I now always store the bitmap data in a memory puffer in the format that is requested by VCL. Only if the bitmap is to be drawn on screen I create a CGBitmapContext and only convert the format if needed.
+
<pre>
 
+
soffice -norestore -invisible -headless macro:///Standard.Module1.Main
The biggest issue at the moment besides not having any raster operations is the problem with
+
</pre>
 
+
* AquaSalGraphics::getBitmap
+
* AquaSalGraphics::copyBits
+
* AquaSalGraphics::copyArea
+
 
+
This methods need access to the pixels on screen. This currently is used sometimes for transparency in bitmaps
+
and also for late 80's style scrolling speedups. Getting pixels from an on screen window on the mac would
+
require to directly access the buffer inside the graphic card.
+
 
+
Pavel send me this marvelous [http://lists.apple.com/archives/cocoa-dev/2005/Jun/msg02321.html link] how to get a pointer to the pixels inside the graphic card. I got that working but what I get was [http://www.fishbyte.de/gamma_problem.png this].
+
 
+
The problem is that the mac does a gamma correctur. So what you see is what you get but not what you want.
+
The image above shows a 32x32 area at the bottom right that is a copy of the same area at the top left.
+
You can see that it is much brighter. Thats because on second paint it again is gamma corrected. Therefore
+
the pixel information from the graphic card is not usable, unless we undo the gamma correction. But that slows
+
a slow method down even more and also we lose precision.
+
 
+
So I rethink about my first aproach to this problem where I did all rendering to an offscreen CGBitmapContext
+
and then blitting that to the window. This worked like a charm since you can access the unaltered pixel from
+
a CGBitmapContext in contrast to a CGContext from a window.
+
 
+
There is a problem with this aproach. If we want to let the mac render native widgets we can either use the draw methods of the controls itself or the appereance manager. But both only render directly in a window. Therefore the pixels of the controls would not be present in the offscreen CGBitmapContext and could be overridden if we blit that part of the offscreen bitmap to the window.
+
 
+
My current idea is a mixed solution where we have a CGBitmapContext for each window and render twice. Once in the window directly and once in the offscreen bitmap. The offscreen bitmap is then only used to read pixels. This will be a significant overhead but on the other hand we will need an offscreen bitmap sooner or later to implement raster operations.
+
 
+
== Open Issues ==
+
* implement raster operations
+
* make transparency bitmaps work (done)
+
* implement Invert methods
+
* implement GetPixel method
+
* check if text is also drawn to the offscreen bitmap
+
 
+
== Todo ==
+
* Write something about raster operations
+
 
+
== Code fragments ==
+
 
+
The following code creates a AquaSalBitmap from the window area (nX,nY,nDX,nDY). Problem is that the resulting pixels are already gamma corrected. Painting them again causes a second gamma correction.
+
  
 
<pre>
 
<pre>
CGrafPtr windowPort( GetWindowPort(mrWindow) );
+
Sub Main
LockPortBits(windowPort);
+
oDoc = StarDesktop.loadComponentFromURL( "file:///e:/html.odp", "_blank", 0, Array(MakePropertyValue("Hidden",True)) )
 +
 +
oDoc.storeToURL( "file:///e:/html/out.html", Array( MakePropertyValue( "URL", "file:///e:/html/out.html" ), MakePropertyValue( "FilterName", "impress_html_Export" ) )
 +
oDoc.close( True )
 +
End Sub
  
PixMapHandle thePixels( GetPortPixMap(windowPort) );
+
Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue
LockPixels(thePixels );
+
Dim oPropertyValue As New com.sun.star.beans.PropertyValue
 +
oPropertyValue.Name = cName
 +
oPropertyValue.Value = uValue
 +
MakePropertyValue() = oPropertyValue
 +
End Function
 +
</pre>
  
Rect windowBounds;
 
GetWindowPortBounds ( mrWindow, &windowBounds);
 
 
Rect structureWidths;
 
// Obtains the width of the structure region on each edge of a window.
 
GetWindowStructureWidths ( mrWindow, &structureWidths );
 
 
// exclude left and top window border
 
nX += structureWidths.left;
 
nY += structureWidths.top;
 
 
AquaSalBitmap* pBitmap = new AquaSalBitmap;
 
ipBitmap->Create( windowBounds.right - windowBounds.left,
 
                  windowBounds.bottom - windowBounds.top,
 
                  GetBitCount(), GetPixRowBytes(thePixels),
 
                  reinterpret_cast< sal_uInt8* >( GetPixBaseAddr(thePixels)),
 
  nX, nY, nDX, nDY );
 
 
UnlockPixels (thePixels);
 
UnlockPortBits(windowPort);
 
</pre>
 
  
[[Category:Porting]]
 
 
[[Category:Development]]
 
[[Category:Development]]
[[Category:Aqua]]
+
[[Category:Impress]]
[[Category:MacOSX]]
+
[[Category:Draw]]

Latest revision as of 16:35, 19 November 2009

My personal list of todo stuff and current status

Nick on irc.freenode.net : CL

Mail : christian.lippka AT sun.com

DISCLAIMER

This is my personal wiki. Everything I write here
may be wrong, stupid, incorrect, harmful or worse.
The views expressed on this page aren't (necessarily)
the views of Sun Microsystems Inc. 

Current Work

  • Fixing issues for OOo 3.3
  • Embedding Video/Sounds in impress

Whats new in impress/draw

OOo 3.3

TODO

cws impressmedia01

Feature Mails

Service "com.sun.star.io.comp.TempFile" got XInitialization interface and the following css::beans::NamedValue arguments

  • [optional] string LeadingChars // name of the tempfile will start with this string, followed by a counter to make the name unique
  • [optional] string Extension // extension for the tempfile. If none is given, the extension will be ".tmp"
  • [optional] string Parent // if given, this will be the parent directory of the tempfile
  • [optional] boolean KillingFileEnabled // if true, the file will be deleted as soon as the instance of this service is deleted

Open ODF issues

  • draw:textarea-horizontal-align attribute has no default exported? [issue 85397]

Frequently needed Issues

  • incompatible bullets from 3.0 in 2.x => issue 91466

Open ODF 1.2 features

Auto shrink text in shapes [OASIS] Status: Desired for OOo3.x

Proposal: last visited page interaction [OASIS] Status: Desired for OOo3.x

How to add animations for shapes on master pages [OASIS] Status: Desired for OOo 3.x

Proposal for rounded corners of rects (draw:corner-radius) [OASIS] Status: Currently not planed for OOo

Add glue points to 3D objects [OASIS] Status: Currently not planed for OOo

Proposal to enhance hyperlinks to support shapes [OASIS] Status: Import planned for OOo 2.4, export desired for OOo 3.x

<svg:desc> and <svg:title> for drawing pages [OASIS] Status: Still under discussion in the TC

Layer-set per page [OASIS] Status: Still under discussion in the TC

Points are integers in ODF,but floating-point in SVG [OASIS] Status: Still under discussion in the TC

Headless Mode Debuging

soffice -norestore -invisible -headless macro:///Standard.Module1.Main
Sub Main
	oDoc = StarDesktop.loadComponentFromURL( "file:///e:/html.odp", "_blank", 0, Array(MakePropertyValue("Hidden",True)) )
	
	oDoc.storeToURL( "file:///e:/html/out.html", Array( MakePropertyValue( "URL", "file:///e:/html/out.html" ), MakePropertyValue( "FilterName", "impress_html_Export" ) )
	oDoc.close( True )
End Sub

Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue
	Dim oPropertyValue As New com.sun.star.beans.PropertyValue
	oPropertyValue.Name = cName
	oPropertyValue.Value = uValue
	MakePropertyValue() = oPropertyValue
End Function
Personal tools