Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-10

Clipboard changes

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Flávio Etrusco
to Mattias Gaertner
Mattias Gaertner wrote 14 lines
On Fri, 7 Oct 2011 13:26:16 -0300 Fl?vio Etrusco wrote: > Hello, > I would like some feedback by anyone using or knowledgeable in the LCL > clipboard design on the changes introduced by this (already committed) > patch: > http://bugs.freepascal.org/view.php?id=20089 What's the problem? Mattias --

I made TWin32WidgetSet.ClipboardFormatToMimeType raise an exception when Windows.GetClipboardFormatName returns empty (either a Windows predefined format or an error). At the last it will be triggered by code that uses TClipboard.FindFormatID (or iterate over available formats names in the clipboard) if there's a predefined format in the clipboard the LCL doesn't know about. Is that ok?
I didn't see any other issues, but the LCL uses MIME strings more extensively than initially thought, so I'm asking for advice.

-Fl?vio

Reply by email

Mattias Gaertner
to Flávio Etrusco
Show quoted text 25 lines
On Fri, Oct 7, 2011 at 1:37 PM, Mattias Gaertner wrote: > On Fri, 7 Oct 2011 13:26:16 -0300 > Fl?vio Etrusco wrote: > >> Hello, >> I would like some feedback by anyone using or knowledgeable in the LCL >> clipboard design on the changes introduced by this (already committed) >> patch: >> http://bugs.freepascal.org/view.php?id=20089 > > What's the problem? > > Mattias > > -- I made TWin32WidgetSet.ClipboardFormatToMimeType raise an exception when Windows.GetClipboardFormatName returns empty (either a Windows predefined format or an error). At the last it will be triggered by code that uses TClipboard.FindFormatID (or iterate over available formats names in the clipboard) if there's a predefined format in the clipboard the LCL doesn't know about. Is that ok? I didn't see any other issues, but the LCL uses MIME strings more extensively than initially thought, so I'm asking for advice.

Raising an exception in an LCL interface function is unusual. What do you mean with "a predefined format in the clipboard the LCL doesn't know about"?

Mattias

Reply by email

Flávio Etrusco
to Mattias Gaertner
Mattias Gaertner wrote 30 lines
On Fri, 7 Oct 2011 14:35:18 -0300 Fl?vio Etrusco wrote: > On Fri, Oct 7, 2011 at 1:37 PM, Mattias Gaertner > wrote: > > On Fri, 7 Oct 2011 13:26:16 -0300 > > Fl?vio Etrusco wrote: > > > >> Hello, > >> I would like some feedback by anyone using or knowledgeable in the LCL > >> clipboard design on the changes introduced by this (already committed) > >> patch: > >> http://bugs.freepascal.org/view.php?id=20089 > > > > What's the problem? > > > > Mattias > > > > -- > > I made TWin32WidgetSet.ClipboardFormatToMimeType raise an exception > when Windows.GetClipboardFormatName returns empty (either a Windows > predefined format or an error). At the last it will be triggered by > code that uses TClipboard.FindFormatID (or iterate over available > formats names in the clipboard) if there's a predefined format in the > clipboard the LCL doesn't know about. Is that ok? > I didn't see any other issues, but the LCL uses MIME strings more > extensively than initially thought, so I'm asking for advice. Raising an exception in an LCL interface function is unusual.

Is this why assigning icons to the clipboard doesn't raise exceptions even though it's not implemented? ;-)
If it's not reaised there, I think it should be raised in some other places anyway - in TRasterImage.LoadFromMimeStream for instance.

Show quoted text 6 lines
What do you mean with "a predefined format in the clipboard the LCL doesn't know about"? Mattias

GetClipboardFormatName(1) doesn't return a string for "standard formats" (2) - sometimes called predefined formats in the docs -, so the LCL itself (i.e. TWin32WidgetSet.ClipboardFormatToMimeType) must "know" their MIME types.

(1) http://msdn.microsoft.com/en-us/library/windows/desktop/ms649040%28v=vs.85%29.aspx (2) http://msdn.microsoft.com/en-us/library/windows/desktop/ff729168%28v=vs.85%29.aspx

There're some other info and comments in the bug report.

-Fl?vio

Reply by email