Message-ID: <42FA132C.3030302 at compiler.kaist.ac.kr> Date: Wed, 10 Aug 2005 23:46:04 +0900 From: SooHyoung Oh MIME-Version: 1.0 To: Jacques Garrigue CC: lablgtk at math.nagoya-u.ac.jp Subject: Re: Q) missing functons in clipboard References: <42F9A601.2000605 at compiler.kaist.ac.kr> <20050810.165736.38359746.garrigue at math.nagoya-u.ac.jp> In-Reply-To: <20050810.165736.38359746.garrigue at math.nagoya-u.ac.jp> Content-Type: multipart/alternative; boundary="------------000807030403040502090008" This is a multi-part message in MIME format. --------------000807030403040502090008 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit These days I'm looking sources mozilla and OpenOffice and I'm thinking how we can use ocaml/lablgtk with these applications. These softwares are transfering Cut and Paste data throught different formats on Linux (including Windows). For doing that, they uses some data format such as "text/html" or "application/x-openoffice...". With the current Lablgtk clipboard APIs, I can't support such format. gtk_clipboard_set_with_data and/or gtk_clipboard_set_with_owner seem to be made for such case. Without these APIs, are there any methods to support Data Flavors (or Data Formats) in Openoffice and Mozilla? Example 1) Here is some document from Openoffice's developmentn guide 6.2.1: OpenOffice.org Clipboard Data Formats This section describes common clipboard data formats that OpenOffice.org supports and their corresponding DataType. As previously mentioned, data formats are described by DataFlavors. The important characteristics of a DataFlavor are the MimeType and DataType. The OpenOffice.org clipboard service uses a standard MimeType for different data formats if there is one registered at Iana . For example, for HTML text, the MimeType "text/html" is used, Rich Text uses the MimeType "text/richtext", and text uses "text/plain". If there is no corresponding MimeType registered at Iana, OpenOffice.org defines a private MimeType. Private OpenOffice.org MimeType always has the MimeType "application/x-openoffice". Each private OpenOffice.org MimeType has a parameter "windows_formatname" identifying the clipboard format name used under Windows. The used Windows format names are the format names used with older OpenOffice.org versions. Common Windows format names are "Bitmap", "GDIMetaFile", "FileName", "FileList", and "DIF". Example 2) Here is document about clipboard in setion of "Introduction to the clipboard and drag & drop" of mozilla: Data Flavors Each piece of data, such as a hunk of text or a single bookmark item in a tree, can (and should) have multiple representations of the data of varying (usually decreasing) fidelity. This allows other applications to still be able to process the data even if they don't understand the richest representation used by mozilla. For example, the hunk of text might have html styled text, the stripped-down plain text representation, and possibly a gif illustrating the text. Mozilla knows what to do with the styled html, but SimpleText, for example, does not, yet we still want to be able to communicate with SimpleText. Each representation of the data is referred to as a "flavor." When referring to data in the transferable, you need to know the flavor. When you can accept a variety of flavors, there are mechanisms for asking for the best one. Jacques Garrigue wrote: >From: SooHyoung Oh > > > >>It seems that there are some missing functions of clipboard in lablgtk? >>For example, >> >>gtk_clipboard_wait_for_targets >>gtk_clipboard_request_targets >>gtk_clipboard_set_with_data >>gtk_clipboard_set_with_owner >>gtk_clipboard_get_owner >> >>As you know, withous these function, clipboard functionality can't be >>used fully. >>Does lablgtk team have any plan to support these functions in next release? >> >>p.s.: Instead of gtk_clipboard_get_owner, we can make a function such as >>"is_owning". >> >> > >As you can see from their types, these functions use callbacks, so >they are a bit more complicated to interface. >And of course all they can do can already be done through the more >low-level signal-based API. >If you have good examples of applications using non-string data in >clipboard, then it might be worth considering. >(By the way, the _targets function were added in 2.4) > >Jacques > > > > --------------000807030403040502090008 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit These days I'm looking sources  mozilla and OpenOffice
and I'm thinking how we can use ocaml/lablgtk with these applications.
These softwares are transfering Cut and Paste data throught different formats on Linux (including Windows).
For doing that, they uses some data format such as "text/html" or "application/x-openoffice...".
With the current Lablgtk clipboard APIs, I can't support such format.
gtk_clipboard_set_with_data and/or gtk_clipboard_set_with_owner seem to  be made for such case.
Without these APIs, are there any methods to support Data Flavors (or Data Formats) in Openoffice and Mozilla?

Example 1) Here is some document from Openoffice's developmentn guide 6.2.1:

OpenOffice.org Clipboard Data Formats

This section describes common clipboard data formats that OpenOffice.org supports and their corresponding DataType.
As previously mentioned, data formats are described by DataFlavors. The important characteristics of a DataFlavor are the MimeType and DataType. The OpenOffice.org clipboard service uses a standard MimeType for different data formats if there is one registered at
Iana. For example, for HTML text, the MimeType "text/html" is used, Rich Text uses the MimeType "text/richtext", and text uses "text/plain". If there is no corresponding MimeType registered at Iana, OpenOffice.org defines a private MimeType. Private OpenOffice.org MimeType always has the MimeType "application/x-openoffice". Each private OpenOffice.org MimeType has a parameter "windows_formatname" identifying the clipboard format name used under Windows. The used Windows format names are the format names used with older OpenOffice.org versions. Common Windows format names are "Bitmap", "GDIMetaFile", "FileName", "FileList", and "DIF".
 
Example 2) Here is document about clipboard in setion of "Introduction to the clipboard and drag & drop" of mozilla:

Data Flavors

Each piece of data, such as a hunk of text or a single bookmark item in a tree, can (and should) have multiple representations of the data of varying (usually decreasing) fidelity. This allows other applications to still be able to process the data even if they don't understand the richest representation used by mozilla. For example, the hunk of text might have html styled text, the stripped-down plain text representation, and possibly a gif illustrating the text. Mozilla knows what to do with the styled html, but SimpleText, for example, does not, yet we still want to be able to communicate with SimpleText.

Each representation of the data is referred to as a "flavor." When referring to data in the transferable, you need to know the flavor. When you can accept a variety of flavors, there are mechanisms for asking for the best one.



Jacques Garrigue wrote:
From: SooHyoung Oh <shoh@compiler.kaist.ac.kr>

  
It seems that there are some missing functions of clipboard in lablgtk?
For example,

gtk_clipboard_wait_for_targets
gtk_clipboard_request_targets
gtk_clipboard_set_with_data
gtk_clipboard_set_with_owner
gtk_clipboard_get_owner

As you know, withous these function, clipboard functionality can't be 
used fully.
Does lablgtk team have any plan to support these functions in next release?

p.s.: Instead of gtk_clipboard_get_owner, we can make a function such as 
"is_owning".
    

As you can see from their types, these functions use callbacks, so
they are a bit more complicated to interface.
And of course all they can do can already be done through the more
low-level signal-based API.
If you have good examples of applications using non-string data in
clipboard, then it might be worth considering.
(By the way, the _targets function were added in 2.4)

Jacques


  
--------------000807030403040502090008--