Re: Drag'n'drop between apps
Posted: Fri Aug 30, 2013 7:30 am
@gonegahgah
Good luck in Syria, Mr. Obama - you'll need it boss!
would be represented by a list containing the following five nodes (pieces):
1.
Text: "Good luck in "
Flags: normal
2.
Text: "Syria"
Flags: italics
3.
Text: ", Mr. Obama - you'll "
Flags: normal
4.
Text: "need"
Flags: bold
5.
Text: " it boss!"
Flags: normal
From this list representation, an app interested in formatted text would retrieve the particular meta-information by reading the flags, whereas an app only interested in the text itself (i.e. no formatting) will be able to disregards the flags and just extract the text.
There are other methods of course.
Perhaps I'm not getting you right but shouldn't we strive for a generic formatted (rich) text datatype? I.e. one of which rtf / ww / doc / whatever would be subclasses?So why don't we just write an rtf based datatype.
As a piece chain, for example. The entire document would be represented as an Exec list, with individual nodes containing a data structure that carries a pointer to a text buffer plus formatting flags. For instance, this following formatted textHow will datatype store rtf in memory when the datatype loads it?
Good luck in Syria, Mr. Obama - you'll need it boss!
would be represented by a list containing the following five nodes (pieces):
1.
Text: "Good luck in "
Flags: normal
2.
Text: "Syria"
Flags: italics
3.
Text: ", Mr. Obama - you'll "
Flags: normal
4.
Text: "need"
Flags: bold
5.
Text: " it boss!"
Flags: normal
From this list representation, an app interested in formatted text would retrieve the particular meta-information by reading the flags, whereas an app only interested in the text itself (i.e. no formatting) will be able to disregards the flags and just extract the text.
There are other methods of course.