
Aber ich habe jetzt hier noch etwas interessantes gefunden. Vielleicht hilft das weiter. Mit einem Klick auf Funktionen kommt man auch ihrer Definition:
Mozilla - nsClipboard.cpp
Code: Alles auswählen
gtk_init_(0,0)
ImportC ""
gtk_selection_data_set_text_(*selection_data.GtkSelectionData,str.p-ascii,len) As "gtk_selection_data_set_text"
gtk_selection_data_set_(*selection_data.GtkSelectionData,type,format,datas.p-ascii,length) As "gtk_selection_data_set"
EndImport
; Clipboard Targets
Enumeration
#TARGET_STRING
#TARGET_RTF
EndEnumeration
Global Dim targets.GtkTargetEntry(2)
*mem_STRING=AllocateMemory(StringByteLength("STRING"))
PokeS(*mem_STRING,"STRING",-1,#PB_Ascii)
string.s=PeekS(*mem_STRING,-1,#PB_Unicode)
*mem_texrtf=AllocateMemory(StringByteLength("text/rtf"))
PokeS(*mem_texrtf,"text/rtf",-1,#PB_Ascii)
textrtf.s=PeekS(*mem_texrtf,-1,#PB_Unicode)
targets(0)\target=@string
targets(0)\flags=0
targets(0)\info=#TARGET_STRING
targets(1)\target=@textrtf
targets(1)\flags=0
targets(1)\info=#TARGET_RTF
; Ende Target-Definition
Global n_targets=ArraySize(targets()) ; Anzahl der Targets
Global clipboard=gtk_clipboard_get_(GDK_SELECTION_PRIMARY) ;Clipboard oeffnen
Global rtf.s = "{\rtf1\ansi\ansicpg1252\deff0\deflang3082{\fonttbl{\f0\fswiss\fcharset0 Verdana;}}" ;rtf das kopiert wird
rtf.s + "{\colortbl ;\red255\green102\blue0;\red128\green128\blue128;}"
rtf.s + "\viewkind4\uc1\pard\qc\f0\fs20\par"
rtf.s + "\cf1\ul\b\i\fs28 RTF RTF \cf2\fs20\par"
rtf.s + "\cf0\ulnone\b0\i0\par"
rtf.s + "\cf2 geht fast alles \par"
rtf.s + "\par"
rtf.s + "\cf2 bis auf Umlaute \par"
rtf.s + "\cf2 ääääÄ \par"
rtf.s + "\par"
rtf.s + "}"
ProcedureC get_func(clipboard,selection_data,info,user_data) ;rtf ins Clipboard
length=Len(rtf)
Select info
Case #TARGET_STRING
gtk_selection_data_set_text_(selection_data,rtf,length)
Case #TARGET_RTF
gtk_selection_data_set_(selection_data,gdk_atom_intern_("text/rtf", #False),8,rtf,length)
EndSelect
EndProcedure
gtk_clipboard_set_with_data_(clipboard,targets(),n_targets,@get_func(),#Null,#Null) ;hier werden u.a. die Targets uebertragen targets()
; Dummy-Fenster, muss waehrend des Programmtests geoffnet bleiben
OpenWindow(0, 0, 0, 345, 105, "GTK clipboard test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
Code: Alles auswählen
gtk_init_(0,0)
ImportC ""
gtk_selection_data_set_text_(*selection_data.GtkSelectionData,str.p-ascii,len) As "gtk_selection_data_set_text"
gtk_selection_data_set_(*selection_data.GtkSelectionData,type,format,datas.p-ascii,length) As "gtk_selection_data_set"
EndImport
; Clipboard Targets
Enumeration
#TARGET_STRING
#TARGET_RTF
EndEnumeration
Global Dim targets.GtkTargetEntry(2)
*mem_STRING=AllocateMemory(StringByteLength("STRING") + SizeOf(Character), #PB_Ascii)
PokeS(*mem_STRING,"STRING",-1,#PB_Ascii)
*mem_texrtf=AllocateMemory(StringByteLength("text/rtf") + SizeOf(Character), #PB_Ascii)
PokeS(*mem_texrtf,"text/rtf",-1,#PB_Ascii)
targets(0)\target=*mem_STRING
targets(0)\flags=0
targets(0)\info=#TARGET_STRING
targets(1)\target=*mem_texrtf
targets(1)\flags=0
targets(1)\info=#TARGET_RTF
; Ende Target-Definition
Global n_targets=ArraySize(targets()) ; Anzahl der Targets
Global clipboard=gtk_clipboard_get_(GDK_SELECTION_PRIMARY) ;Clipboard oeffnen
Global rtf.s = "{\rtf1\ansi\ansicpg1252\deff0\deflang3082{\fonttbl{\f0\fswiss\fcharset0 Verdana;}}" ;rtf das kopiert wird
rtf.s + "{\colortbl ;\red255\green102\blue0;\red128\green128\blue128;}"
rtf.s + "\viewkind4\uc1\pard\qc\f0\fs20\par"
rtf.s + "\cf1\ul\b\i\fs28 RTF RTF \cf2\fs20\par"
rtf.s + "\cf0\ulnone\b0\i0\par"
rtf.s + "\cf2 geht fast alles \par"
rtf.s + "\par"
rtf.s + "\cf2 bis auf Umlaute \par"
rtf.s + "\cf2 ääääÄ \par"
rtf.s + "\par"
rtf.s + "}"
ProcedureC get_func(clipboard,selection_data,info,user_data) ;rtf ins Clipboard
length=Len(rtf)
Select info
Case #TARGET_STRING
gtk_selection_data_set_text_(selection_data,rtf,length)
Case #TARGET_RTF
gtk_selection_data_set_(selection_data,gdk_atom_intern_("text/rtf", #False),8,rtf,length)
EndSelect
EndProcedure
gtk_clipboard_set_with_data_(clipboard,targets(),n_targets,@get_func(),#Null,#Null) ;hier werden u.a. die Targets uebertragen targets()
; Dummy-Fenster, muss waehrend des Programmtests geoffnet bleiben
OpenWindow(0, 0, 0, 345, 105, "GTK clipboard test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow