View Issue Details

IDProjectCategoryView StatusLast Update
0036348LazarusWidgetsetpublic2019-12-25 14:36
ReporterCudaText manAssigned ToJuha Manninen 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
PlatformUbuntu 19.10 x64OSOS Version
Product Version2.1 (SVN)Product Build 
Target VersionFixed in Version 
Summary0036348: gtk3: Clipboard.AsText crash
DescriptionMake empty app with a button and do this in OnClick of btn:

uses clipbrd;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Clipboard.AsText:= 'zz'0000010'ee'0000010'aa';
end;

this gives crash:
[Debugger Exception Notification]
Project project1 raised exception class 'Exception' with message:
IndexOfCachedFormatID: Internal Error: invalid FormatID 0 for clipboard
 In file 'include/clipbrd.inc' at line 58
TagsNo tags attached.
Fixed in Revisionr62426
LazTarget-
WidgetsetGTK 3
Attached Files
  • c1.diff (3,060 bytes)
    Index: lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas
    ===================================================================
    --- lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas	(revision 62425)
    +++ lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas	(working copy)
    @@ -2885,8 +2885,8 @@
       PGdkAtom = ^TGdkAtom;
       TGdkAtom = object
         function name: Pgchar; cdecl; inline;
    -    function intern(atom_name: Pgchar; only_if_exists: gboolean): TGdkAtom; cdecl; inline; static;
    -    function intern_static_string(atom_name: Pgchar): TGdkAtom; cdecl; inline; static;
    +    function intern(atom_name: Pgchar; only_if_exists: gboolean): PGdkAtom; cdecl; inline; static;
    +    function intern_static_string(atom_name: Pgchar): PGdkAtom; cdecl; inline; static;
       end;
       TGdkDisplay = object(TGObject)
         function get_default: PGdkDisplay; cdecl; inline; static;
    @@ -3891,8 +3891,8 @@
     
     
     function gdk_app_launch_context_get_type: TGType; cdecl; external;
    -function gdk_atom_intern(atom_name: Pgchar; only_if_exists: gboolean): TGdkAtom; cdecl; external;
    -function gdk_atom_intern_static_string(atom_name: Pgchar): TGdkAtom; cdecl; external;
    +function gdk_atom_intern(atom_name: Pgchar; only_if_exists: gboolean): PGdkAtom; cdecl; external;
    +function gdk_atom_intern_static_string(atom_name: Pgchar): PGdkAtom; cdecl; external;
     function gdk_atom_name(atom: TGdkAtom): Pgchar; cdecl; external;
     function gdk_cairo_create(window: PGdkWindow): Pcairo_t; cdecl; external;
     function gdk_cairo_get_clip_rectangle(cr: Pcairo_t; rect: PGdkRectangle): gboolean; cdecl; external;
    @@ -4502,12 +4502,12 @@
       Result := LazGdk3.gdk_atom_name(self);
     end;
     
    -function TGdkAtom.intern(atom_name: Pgchar; only_if_exists: gboolean): TGdkAtom; cdecl;
    +function TGdkAtom.intern(atom_name: Pgchar; only_if_exists: gboolean): PGdkAtom; cdecl;
     begin
       Result := LazGdk3.gdk_atom_intern(atom_name, only_if_exists);
     end;
     
    -function TGdkAtom.intern_static_string(atom_name: Pgchar): TGdkAtom; cdecl;
    +function TGdkAtom.intern_static_string(atom_name: Pgchar): PGdkAtom; cdecl;
     begin
       Result := LazGdk3.gdk_atom_intern_static_string(atom_name);
     end;
    Index: lcl/interfaces/gtk3/gtk3winapi.inc
    ===================================================================
    --- lcl/interfaces/gtk3/gtk3winapi.inc	(revision 62425)
    +++ lcl/interfaces/gtk3/gtk3winapi.inc	(working copy)
    @@ -170,13 +170,13 @@
         FormatCount, Formats);
     end;
     
    -function TGtk3WidgetSet.ClipboardRegisterFormat(const AMimeType: string
    -  ): TClipboardFormat;
    +function TGtk3WidgetSet.ClipboardRegisterFormat(const AMimeType: string): TClipboardFormat;
     begin
    -  {$IFDEF GTK3DEBUGNOTIMPLEMENTED}
    -  DebugLn('WARNING: TGtk3WidgetSet.ClipboardRegisterFormat not implemented ...');
    -  {$ENDIF}
    -  Result:=inherited ClipboardRegisterFormat(AMimeType);
    +  if Assigned(Application) then
    +    Result := TClipboardFormat(TGdkAtom.intern(PChar(AMimeType), False))
    +  else
    +    RaiseGDBException(
    +      'ERROR: TGtk3WidgetSet.ClipboardRegisterFormat gdk not initialized');
     end;
     
     function TGtk3WidgetSet.CombineRgn(Dest, Src1, Src2: HRGN;
    
    c1.diff (3,060 bytes)
  • c2.diff (14,760 bytes)
    Index: lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas
    ===================================================================
    --- lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas	(revision 62425)
    +++ lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas	(working copy)
    @@ -2885,8 +2885,8 @@
       PGdkAtom = ^TGdkAtom;
       TGdkAtom = object
         function name: Pgchar; cdecl; inline;
    -    function intern(atom_name: Pgchar; only_if_exists: gboolean): TGdkAtom; cdecl; inline; static;
    -    function intern_static_string(atom_name: Pgchar): TGdkAtom; cdecl; inline; static;
    +    function intern(atom_name: Pgchar; only_if_exists: gboolean): PGdkAtom; cdecl; inline; static;
    +    function intern_static_string(atom_name: Pgchar): PGdkAtom; cdecl; inline; static;
       end;
       TGdkDisplay = object(TGObject)
         function get_default: PGdkDisplay; cdecl; inline; static;
    @@ -2911,7 +2911,7 @@
         procedure notify_startup_complete(startup_id: Pgchar); cdecl; inline;
         function peek_event: PGdkEvent; cdecl; inline;
         procedure put_event(event: PGdkEvent); cdecl; inline;
    -    function request_selection_notification(selection: TGdkAtom): gboolean; cdecl; inline;
    +    function request_selection_notification(selection: PGdkAtom): gboolean; cdecl; inline;
         procedure set_double_click_distance(distance: guint); cdecl; inline;
         procedure set_double_click_time(msec: guint); cdecl; inline;
         procedure store_clipboard(clipboard_window: PGdkWindow; time_: guint32; targets: PGdkAtom; n_targets: gint); cdecl; inline;
    @@ -3045,7 +3045,7 @@
         function get_associated_device: PGdkDevice; cdecl; inline;
         function get_axis(axes: Pgdouble; use: TGdkAxisUse; value: Pgdouble): gboolean; cdecl; inline;
         function get_axis_use(index_: guint): TGdkAxisUse; cdecl; inline;
    -    function get_axis_value(axes: Pgdouble; axis_label: TGdkAtom; value: Pgdouble): gboolean; cdecl; inline;
    +    function get_axis_value(axes: Pgdouble; axis_label: PGdkAtom; value: Pgdouble): gboolean; cdecl; inline;
         function get_device_type: TGdkDeviceType; cdecl; inline;
         function get_display: PGdkDisplay; cdecl; inline;
         function get_has_cursor: gboolean; cdecl; inline;
    @@ -3495,7 +3495,7 @@
         type_: TGdkEventType;
         window: PGdkWindow;
         send_event: gint8;
    -    atom: TGdkAtom;
    +    atom: PGdkAtom;
         time: guint32;
         state: TGdkPropertyState;
       end;
    @@ -3509,9 +3509,9 @@
         type_: TGdkEventType;
         window: PGdkWindow;
         send_event: gint8;
    -    selection: TGdkAtom;
    -    target: TGdkAtom;
    -    property_: TGdkAtom;
    +    selection: PGdkAtom;
    +    target: PGdkAtom;
    +    property_: PGdkAtom;
         time: guint32;
         requestor: PGdkWindow;
       end;
    @@ -3530,7 +3530,7 @@
         send_event: gint8;
         owner: PGdkWindow;
         reason: TGdkOwnerChange;
    -    selection: TGdkAtom;
    +    selection: PGdkAtom;
         time: guint32;
         selection_time: guint32;
       end;
    @@ -3891,9 +3891,9 @@
     
     
     function gdk_app_launch_context_get_type: TGType; cdecl; external;
    -function gdk_atom_intern(atom_name: Pgchar; only_if_exists: gboolean): TGdkAtom; cdecl; external;
    -function gdk_atom_intern_static_string(atom_name: Pgchar): TGdkAtom; cdecl; external;
    -function gdk_atom_name(atom: TGdkAtom): Pgchar; cdecl; external;
    +function gdk_atom_intern(atom_name: Pgchar; only_if_exists: gboolean): PGdkAtom; cdecl; external;
    +function gdk_atom_intern_static_string(atom_name: Pgchar): PGdkAtom; cdecl; external;
    +function gdk_atom_name(atom: PGdkAtom): Pgchar; cdecl; external;
     function gdk_cairo_create(window: PGdkWindow): Pcairo_t; cdecl; external;
     function gdk_cairo_get_clip_rectangle(cr: Pcairo_t; rect: PGdkRectangle): gboolean; cdecl; external;
     function gdk_cairo_region_create_from_surface(surface: Pcairo_surface_t): Pcairo_region_t; cdecl; external;
    @@ -3914,7 +3914,7 @@
     function gdk_device_get_associated_device(device: PGdkDevice): PGdkDevice; cdecl; external;
     function gdk_device_get_axis(device: PGdkDevice; axes: Pgdouble; use: TGdkAxisUse; value: Pgdouble): gboolean; cdecl; external;
     function gdk_device_get_axis_use(device: PGdkDevice; index_: guint): TGdkAxisUse; cdecl; external;
    -function gdk_device_get_axis_value(device: PGdkDevice; axes: Pgdouble; axis_label: TGdkAtom; value: Pgdouble): gboolean; cdecl; external;
    +function gdk_device_get_axis_value(device: PGdkDevice; axes: Pgdouble; axis_label: PGdkAtom; value: Pgdouble): gboolean; cdecl; external;
     function gdk_device_get_device_type(device: PGdkDevice): TGdkDeviceType; cdecl; external;
     function gdk_device_get_display(device: PGdkDevice): PGdkDisplay; cdecl; external;
     function gdk_device_get_has_cursor(device: PGdkDevice): gboolean; cdecl; external;
    @@ -3958,7 +3958,7 @@
     function gdk_display_open(display_name: Pgchar): PGdkDisplay; cdecl; external;
     function gdk_display_open_default_libgtk_only: PGdkDisplay; cdecl; external;
     function gdk_display_peek_event(display: PGdkDisplay): PGdkEvent; cdecl; external;
    -function gdk_display_request_selection_notification(display: PGdkDisplay; selection: TGdkAtom): gboolean; cdecl; external;
    +function gdk_display_request_selection_notification(display: PGdkDisplay; selection: PGdkAtom): gboolean; cdecl; external;
     function gdk_display_supports_clipboard_persistence(display: PGdkDisplay): gboolean; cdecl; external;
     function gdk_display_supports_composite(display: PGdkDisplay): gboolean; cdecl; external;
     function gdk_display_supports_cursor_alpha(display: PGdkDisplay): gboolean; cdecl; external;
    @@ -3978,7 +3978,7 @@
     function gdk_drag_context_get_type: TGType; cdecl; external;
     function gdk_drag_context_list_targets(context: PGdkDragContext): PGList; cdecl; external;
     function gdk_drag_drop_succeeded(context: PGdkDragContext): gboolean; cdecl; external;
    -function gdk_drag_get_selection(context: PGdkDragContext): TGdkAtom; cdecl; external;
    +function gdk_drag_get_selection(context: PGdkDragContext): PGdkAtom; cdecl; external;
     function gdk_drag_motion(context: PGdkDragContext; dest_window: PGdkWindow; protocol: TGdkDragProtocol; x_root: gint; y_root: gint; suggested_action: TGdkDragAction; possible_actions: TGdkDragAction; time_: guint32): gboolean; cdecl; external;
     function gdk_error_trap_pop: gint; cdecl; external;
     function gdk_event_copy(event: PGdkEvent): PGdkEvent; cdecl; external;
    @@ -4058,7 +4058,7 @@
     function gdk_pixbuf_get_from_window(window: PGdkWindow; src_x: gint; src_y: gint; width: gint; height: gint): PGdkPixbuf; cdecl; external;
     function gdk_pointer_grab(window: PGdkWindow; owner_events: gboolean; event_mask: TGdkEventMask; confine_to: PGdkWindow; cursor: PGdkCursor; time_: guint32): TGdkGrabStatus; cdecl; external;
     function gdk_pointer_is_grabbed: gboolean; cdecl; external;
    -function gdk_property_get(window: PGdkWindow; property_: TGdkAtom; type_: TGdkAtom; offset: gulong; length: gulong; pdelete: gint; actual_property_type: PGdkAtom; actual_format: Pgint; actual_length: Pgint; data: PPguint8): gboolean; cdecl; external;
    +function gdk_property_get(window: PGdkWindow; property_: PGdkAtom; type_: PGdkAtom; offset: gulong; length: gulong; pdelete: gint; actual_property_type: PGdkAtom; actual_format: Pgint; actual_length: Pgint; data: PPguint8): gboolean; cdecl; external;
     function gdk_rectangle_get_type: TGType; cdecl; external;
     function gdk_rectangle_intersect(src1: PGdkRectangle; src2: PGdkRectangle; dest: PGdkRectangle): gboolean; cdecl; external;
     function gdk_rgba_copy(rgba: PGdkRGBA): PGdkRGBA; cdecl; external;
    @@ -4099,15 +4099,15 @@
     function gdk_screen_make_display_name(screen: PGdkScreen): Pgchar; cdecl; external;
     function gdk_screen_width: gint; cdecl; external;
     function gdk_screen_width_mm: gint; cdecl; external;
    -function gdk_selection_owner_get(selection: TGdkAtom): PGdkWindow; cdecl; external;
    -function gdk_selection_owner_get_for_display(display: PGdkDisplay; selection: TGdkAtom): PGdkWindow; cdecl; external;
    -function gdk_selection_owner_set(owner: PGdkWindow; selection: TGdkAtom; time_: guint32; send_event: gboolean): gboolean; cdecl; external;
    -function gdk_selection_owner_set_for_display(display: PGdkDisplay; owner: PGdkWindow; selection: TGdkAtom; time_: guint32; send_event: gboolean): gboolean; cdecl; external;
    +function gdk_selection_owner_get(selection: PGdkAtom): PGdkWindow; cdecl; external;
    +function gdk_selection_owner_get_for_display(display: PGdkDisplay; selection: PGdkAtom): PGdkWindow; cdecl; external;
    +function gdk_selection_owner_set(owner: PGdkWindow; selection: PGdkAtom; time_: guint32; send_event: gboolean): gboolean; cdecl; external;
    +function gdk_selection_owner_set_for_display(display: PGdkDisplay; owner: PGdkWindow; selection: PGdkAtom; time_: guint32; send_event: gboolean): gboolean; cdecl; external;
     function gdk_selection_property_get(requestor: PGdkWindow; data: PPguint8; prop_type: PGdkAtom; prop_format: Pgint): gint; cdecl; external;
     function gdk_setting_get(name: Pgchar; value: PGValue): gboolean; cdecl; external;
     function gdk_test_simulate_button(window: PGdkWindow; x: gint; y: gint; button: guint; modifiers: TGdkModifierType; button_pressrelease: TGdkEventType): gboolean; cdecl; external;
     function gdk_test_simulate_key(window: PGdkWindow; x: gint; y: gint; keyval: guint; modifiers: TGdkModifierType; key_pressrelease: TGdkEventType): gboolean; cdecl; external;
    -function gdk_text_property_to_utf8_list_for_display(display: PGdkDisplay; encoding: TGdkAtom; format: gint; text: Pguint8; length: gint; list: PPPgchar): gint; cdecl; external;
    +function gdk_text_property_to_utf8_list_for_display(display: PGdkDisplay; encoding: PGdkAtom; format: gint; text: Pguint8; length: gint; list: PPPgchar): gint; cdecl; external;
     function gdk_threads_add_idle(function_: TGSourceFunc; data: gpointer): guint; cdecl; external;
     function gdk_threads_add_idle_full(priority: gint; function_: TGSourceFunc; data: gpointer; notify: TGDestroyNotify): guint; cdecl; external;
     function gdk_threads_add_timeout(interval: guint; function_: TGSourceFunc; data: gpointer): guint; cdecl; external;
    @@ -4242,8 +4242,8 @@
     procedure gdk_parse_args(argc: Pgint; argv: PPPgchar); cdecl; external;
     procedure gdk_pointer_ungrab(time_: guint32); cdecl; external;
     procedure gdk_pre_parse_libgtk_only; cdecl; external;
    -procedure gdk_property_change(window: PGdkWindow; property_: TGdkAtom; type_: TGdkAtom; format: gint; mode: TGdkPropMode; data: Pguint8; nelements: gint); cdecl; external;
    -procedure gdk_property_delete(window: PGdkWindow; property_: TGdkAtom); cdecl; external;
    +procedure gdk_property_change(window: PGdkWindow; property_: PGdkAtom; type_: PGdkAtom; format: gint; mode: TGdkPropMode; data: Pguint8; nelements: gint); cdecl; external;
    +procedure gdk_property_delete(window: PGdkWindow; property_: PGdkAtom); cdecl; external;
     procedure gdk_query_depths(depths: PPgint; count: Pgint); cdecl; external;
     procedure gdk_query_visual_types(visual_types: PPGdkVisualType; count: Pgint); cdecl; external;
     procedure gdk_rectangle_union(src1: PGdkRectangle; src2: PGdkRectangle; dest: PGdkRectangle); cdecl; external;
    @@ -4252,9 +4252,9 @@
     procedure gdk_screen_get_monitor_workarea(screen: PGdkScreen; monitor_num: gint; dest: PGdkRectangle); cdecl; external;
     procedure gdk_screen_set_font_options(screen: PGdkScreen; options: Pcairo_font_options_t); cdecl; external;
     procedure gdk_screen_set_resolution(screen: PGdkScreen; dpi: gdouble); cdecl; external;
    -procedure gdk_selection_convert(requestor: PGdkWindow; selection: TGdkAtom; target: TGdkAtom; time_: guint32); cdecl; external;
    -procedure gdk_selection_send_notify(requestor: PGdkWindow; selection: TGdkAtom; target: TGdkAtom; property_: TGdkAtom; time_: guint32); cdecl; external;
    -procedure gdk_selection_send_notify_for_display(display: PGdkDisplay; requestor: PGdkWindow; selection: TGdkAtom; target: TGdkAtom; property_: TGdkAtom; time_: guint32); cdecl; external;
    +procedure gdk_selection_convert(requestor: PGdkWindow; selection: PGdkAtom; target: PGdkAtom; time_: guint32); cdecl; external;
    +procedure gdk_selection_send_notify(requestor: PGdkWindow; selection: PGdkAtom; target: PGdkAtom; property_: PGdkAtom; time_: guint32); cdecl; external;
    +procedure gdk_selection_send_notify_for_display(display: PGdkDisplay; requestor: PGdkWindow; selection: PGdkAtom; target: PGdkAtom; property_: PGdkAtom; time_: guint32); cdecl; external;
     procedure gdk_set_double_click_time(msec: guint); cdecl; external;
     procedure gdk_set_program_class(program_class: Pgchar); cdecl; external;
     procedure gdk_set_show_events(show_events: gboolean); cdecl; external;
    @@ -4499,20 +4499,20 @@
     
     function TGdkAtom.name: Pgchar; cdecl;
     begin
    -  Result := LazGdk3.gdk_atom_name(self);
    +  Result := LazGdk3.gdk_atom_name(@self);
     end;
     
    -function TGdkAtom.intern(atom_name: Pgchar; only_if_exists: gboolean): TGdkAtom; cdecl;
    +function TGdkAtom.intern(atom_name: Pgchar; only_if_exists: gboolean): PGdkAtom; cdecl;
     begin
       Result := LazGdk3.gdk_atom_intern(atom_name, only_if_exists);
     end;
     
    -function TGdkAtom.intern_static_string(atom_name: Pgchar): TGdkAtom; cdecl;
    +function TGdkAtom.intern_static_string(atom_name: Pgchar): PGdkAtom; cdecl;
     begin
       Result := LazGdk3.gdk_atom_intern_static_string(atom_name);
     end;
     
    -function TGdkDisplay.request_selection_notification(selection: TGdkAtom): gboolean; cdecl;
    +function TGdkDisplay.request_selection_notification(selection: PGdkAtom): gboolean; cdecl;
     begin
       Result := LazGdk3.gdk_display_request_selection_notification(@self, selection);
     end;
    @@ -4837,7 +4837,7 @@
       Result := LazGdk3.gdk_device_get_axis_use(@self, index_);
     end;
     
    -function TGdkDevice.get_axis_value(axes: Pgdouble; axis_label: TGdkAtom; value: Pgdouble): gboolean; cdecl;
    +function TGdkDevice.get_axis_value(axes: Pgdouble; axis_label: PGdkAtom; value: Pgdouble): gboolean; cdecl;
     begin
       Result := LazGdk3.gdk_device_get_axis_value(@self, axes, axis_label, value);
     end;
    Index: lcl/interfaces/gtk3/gtk3winapi.inc
    ===================================================================
    --- lcl/interfaces/gtk3/gtk3winapi.inc	(revision 62425)
    +++ lcl/interfaces/gtk3/gtk3winapi.inc	(working copy)
    @@ -170,13 +170,13 @@
         FormatCount, Formats);
     end;
     
    -function TGtk3WidgetSet.ClipboardRegisterFormat(const AMimeType: string
    -  ): TClipboardFormat;
    +function TGtk3WidgetSet.ClipboardRegisterFormat(const AMimeType: string): TClipboardFormat;
     begin
    -  {$IFDEF GTK3DEBUGNOTIMPLEMENTED}
    -  DebugLn('WARNING: TGtk3WidgetSet.ClipboardRegisterFormat not implemented ...');
    -  {$ENDIF}
    -  Result:=inherited ClipboardRegisterFormat(AMimeType);
    +  if Assigned(Application) then
    +    Result := TClipboardFormat(TGdkAtom.intern(PChar(AMimeType), False))
    +  else
    +    RaiseGDBException(
    +      'ERROR: TGtk3WidgetSet.ClipboardRegisterFormat gdk not initialized');
     end;
     
     function TGtk3WidgetSet.CombineRgn(Dest, Src1, Src2: HRGN;
    
    c2.diff (14,760 bytes)
  • ClipboardTest.zip (128,992 bytes)
  • c3.diff (12,721 bytes)
    Index: lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas
    ===================================================================
    --- lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas	(revision 62430)
    +++ lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas	(working copy)
    @@ -2911,7 +2911,7 @@
         procedure notify_startup_complete(startup_id: Pgchar); cdecl; inline;
         function peek_event: PGdkEvent; cdecl; inline;
         procedure put_event(event: PGdkEvent); cdecl; inline;
    -    function request_selection_notification(selection: TGdkAtom): gboolean; cdecl; inline;
    +    function request_selection_notification(selection: PGdkAtom): gboolean; cdecl; inline;
         procedure set_double_click_distance(distance: guint); cdecl; inline;
         procedure set_double_click_time(msec: guint); cdecl; inline;
         procedure store_clipboard(clipboard_window: PGdkWindow; time_: guint32; targets: PGdkAtom; n_targets: gint); cdecl; inline;
    @@ -3045,7 +3045,7 @@
         function get_associated_device: PGdkDevice; cdecl; inline;
         function get_axis(axes: Pgdouble; use: TGdkAxisUse; value: Pgdouble): gboolean; cdecl; inline;
         function get_axis_use(index_: guint): TGdkAxisUse; cdecl; inline;
    -    function get_axis_value(axes: Pgdouble; axis_label: TGdkAtom; value: Pgdouble): gboolean; cdecl; inline;
    +    function get_axis_value(axes: Pgdouble; axis_label: PGdkAtom; value: Pgdouble): gboolean; cdecl; inline;
         function get_device_type: TGdkDeviceType; cdecl; inline;
         function get_display: PGdkDisplay; cdecl; inline;
         function get_has_cursor: gboolean; cdecl; inline;
    @@ -3495,7 +3495,7 @@
         type_: TGdkEventType;
         window: PGdkWindow;
         send_event: gint8;
    -    atom: TGdkAtom;
    +    atom: PGdkAtom;
         time: guint32;
         state: TGdkPropertyState;
       end;
    @@ -3509,9 +3509,9 @@
         type_: TGdkEventType;
         window: PGdkWindow;
         send_event: gint8;
    -    selection: TGdkAtom;
    -    target: TGdkAtom;
    -    property_: TGdkAtom;
    +    selection: PGdkAtom;
    +    target: PGdkAtom;
    +    property_: PGdkAtom;
         time: guint32;
         requestor: PGdkWindow;
       end;
    @@ -3530,7 +3530,7 @@
         send_event: gint8;
         owner: PGdkWindow;
         reason: TGdkOwnerChange;
    -    selection: TGdkAtom;
    +    selection: PGdkAtom;
         time: guint32;
         selection_time: guint32;
       end;
    @@ -3893,7 +3893,7 @@
     function gdk_app_launch_context_get_type: TGType; cdecl; external;
     function gdk_atom_intern(atom_name: Pgchar; only_if_exists: gboolean): PGdkAtom; cdecl; external;
     function gdk_atom_intern_static_string(atom_name: Pgchar): PGdkAtom; cdecl; external;
    -function gdk_atom_name(atom: TGdkAtom): Pgchar; cdecl; external;
    +function gdk_atom_name(atom: PGdkAtom): Pgchar; cdecl; external;
     function gdk_cairo_create(window: PGdkWindow): Pcairo_t; cdecl; external;
     function gdk_cairo_get_clip_rectangle(cr: Pcairo_t; rect: PGdkRectangle): gboolean; cdecl; external;
     function gdk_cairo_region_create_from_surface(surface: Pcairo_surface_t): Pcairo_region_t; cdecl; external;
    @@ -3914,7 +3914,7 @@
     function gdk_device_get_associated_device(device: PGdkDevice): PGdkDevice; cdecl; external;
     function gdk_device_get_axis(device: PGdkDevice; axes: Pgdouble; use: TGdkAxisUse; value: Pgdouble): gboolean; cdecl; external;
     function gdk_device_get_axis_use(device: PGdkDevice; index_: guint): TGdkAxisUse; cdecl; external;
    -function gdk_device_get_axis_value(device: PGdkDevice; axes: Pgdouble; axis_label: TGdkAtom; value: Pgdouble): gboolean; cdecl; external;
    +function gdk_device_get_axis_value(device: PGdkDevice; axes: Pgdouble; axis_label: PGdkAtom; value: Pgdouble): gboolean; cdecl; external;
     function gdk_device_get_device_type(device: PGdkDevice): TGdkDeviceType; cdecl; external;
     function gdk_device_get_display(device: PGdkDevice): PGdkDisplay; cdecl; external;
     function gdk_device_get_has_cursor(device: PGdkDevice): gboolean; cdecl; external;
    @@ -3958,7 +3958,7 @@
     function gdk_display_open(display_name: Pgchar): PGdkDisplay; cdecl; external;
     function gdk_display_open_default_libgtk_only: PGdkDisplay; cdecl; external;
     function gdk_display_peek_event(display: PGdkDisplay): PGdkEvent; cdecl; external;
    -function gdk_display_request_selection_notification(display: PGdkDisplay; selection: TGdkAtom): gboolean; cdecl; external;
    +function gdk_display_request_selection_notification(display: PGdkDisplay; selection: PGdkAtom): gboolean; cdecl; external;
     function gdk_display_supports_clipboard_persistence(display: PGdkDisplay): gboolean; cdecl; external;
     function gdk_display_supports_composite(display: PGdkDisplay): gboolean; cdecl; external;
     function gdk_display_supports_cursor_alpha(display: PGdkDisplay): gboolean; cdecl; external;
    @@ -3978,7 +3978,7 @@
     function gdk_drag_context_get_type: TGType; cdecl; external;
     function gdk_drag_context_list_targets(context: PGdkDragContext): PGList; cdecl; external;
     function gdk_drag_drop_succeeded(context: PGdkDragContext): gboolean; cdecl; external;
    -function gdk_drag_get_selection(context: PGdkDragContext): TGdkAtom; cdecl; external;
    +function gdk_drag_get_selection(context: PGdkDragContext): PGdkAtom; cdecl; external;
     function gdk_drag_motion(context: PGdkDragContext; dest_window: PGdkWindow; protocol: TGdkDragProtocol; x_root: gint; y_root: gint; suggested_action: TGdkDragAction; possible_actions: TGdkDragAction; time_: guint32): gboolean; cdecl; external;
     function gdk_error_trap_pop: gint; cdecl; external;
     function gdk_event_copy(event: PGdkEvent): PGdkEvent; cdecl; external;
    @@ -4058,7 +4058,7 @@
     function gdk_pixbuf_get_from_window(window: PGdkWindow; src_x: gint; src_y: gint; width: gint; height: gint): PGdkPixbuf; cdecl; external;
     function gdk_pointer_grab(window: PGdkWindow; owner_events: gboolean; event_mask: TGdkEventMask; confine_to: PGdkWindow; cursor: PGdkCursor; time_: guint32): TGdkGrabStatus; cdecl; external;
     function gdk_pointer_is_grabbed: gboolean; cdecl; external;
    -function gdk_property_get(window: PGdkWindow; property_: TGdkAtom; type_: TGdkAtom; offset: gulong; length: gulong; pdelete: gint; actual_property_type: PGdkAtom; actual_format: Pgint; actual_length: Pgint; data: PPguint8): gboolean; cdecl; external;
    +function gdk_property_get(window: PGdkWindow; property_: PGdkAtom; type_: PGdkAtom; offset: gulong; length: gulong; pdelete: gint; actual_property_type: PGdkAtom; actual_format: Pgint; actual_length: Pgint; data: PPguint8): gboolean; cdecl; external;
     function gdk_rectangle_get_type: TGType; cdecl; external;
     function gdk_rectangle_intersect(src1: PGdkRectangle; src2: PGdkRectangle; dest: PGdkRectangle): gboolean; cdecl; external;
     function gdk_rgba_copy(rgba: PGdkRGBA): PGdkRGBA; cdecl; external;
    @@ -4099,15 +4099,15 @@
     function gdk_screen_make_display_name(screen: PGdkScreen): Pgchar; cdecl; external;
     function gdk_screen_width: gint; cdecl; external;
     function gdk_screen_width_mm: gint; cdecl; external;
    -function gdk_selection_owner_get(selection: TGdkAtom): PGdkWindow; cdecl; external;
    -function gdk_selection_owner_get_for_display(display: PGdkDisplay; selection: TGdkAtom): PGdkWindow; cdecl; external;
    -function gdk_selection_owner_set(owner: PGdkWindow; selection: TGdkAtom; time_: guint32; send_event: gboolean): gboolean; cdecl; external;
    -function gdk_selection_owner_set_for_display(display: PGdkDisplay; owner: PGdkWindow; selection: TGdkAtom; time_: guint32; send_event: gboolean): gboolean; cdecl; external;
    +function gdk_selection_owner_get(selection: PGdkAtom): PGdkWindow; cdecl; external;
    +function gdk_selection_owner_get_for_display(display: PGdkDisplay; selection: PGdkAtom): PGdkWindow; cdecl; external;
    +function gdk_selection_owner_set(owner: PGdkWindow; selection: PGdkAtom; time_: guint32; send_event: gboolean): gboolean; cdecl; external;
    +function gdk_selection_owner_set_for_display(display: PGdkDisplay; owner: PGdkWindow; selection: PGdkAtom; time_: guint32; send_event: gboolean): gboolean; cdecl; external;
     function gdk_selection_property_get(requestor: PGdkWindow; data: PPguint8; prop_type: PGdkAtom; prop_format: Pgint): gint; cdecl; external;
     function gdk_setting_get(name: Pgchar; value: PGValue): gboolean; cdecl; external;
     function gdk_test_simulate_button(window: PGdkWindow; x: gint; y: gint; button: guint; modifiers: TGdkModifierType; button_pressrelease: TGdkEventType): gboolean; cdecl; external;
     function gdk_test_simulate_key(window: PGdkWindow; x: gint; y: gint; keyval: guint; modifiers: TGdkModifierType; key_pressrelease: TGdkEventType): gboolean; cdecl; external;
    -function gdk_text_property_to_utf8_list_for_display(display: PGdkDisplay; encoding: TGdkAtom; format: gint; text: Pguint8; length: gint; list: PPPgchar): gint; cdecl; external;
    +function gdk_text_property_to_utf8_list_for_display(display: PGdkDisplay; encoding: PGdkAtom; format: gint; text: Pguint8; length: gint; list: PPPgchar): gint; cdecl; external;
     function gdk_threads_add_idle(function_: TGSourceFunc; data: gpointer): guint; cdecl; external;
     function gdk_threads_add_idle_full(priority: gint; function_: TGSourceFunc; data: gpointer; notify: TGDestroyNotify): guint; cdecl; external;
     function gdk_threads_add_timeout(interval: guint; function_: TGSourceFunc; data: gpointer): guint; cdecl; external;
    @@ -4242,8 +4242,8 @@
     procedure gdk_parse_args(argc: Pgint; argv: PPPgchar); cdecl; external;
     procedure gdk_pointer_ungrab(time_: guint32); cdecl; external;
     procedure gdk_pre_parse_libgtk_only; cdecl; external;
    -procedure gdk_property_change(window: PGdkWindow; property_: TGdkAtom; type_: TGdkAtom; format: gint; mode: TGdkPropMode; data: Pguint8; nelements: gint); cdecl; external;
    -procedure gdk_property_delete(window: PGdkWindow; property_: TGdkAtom); cdecl; external;
    +procedure gdk_property_change(window: PGdkWindow; property_: PGdkAtom; type_: PGdkAtom; format: gint; mode: TGdkPropMode; data: Pguint8; nelements: gint); cdecl; external;
    +procedure gdk_property_delete(window: PGdkWindow; property_: PGdkAtom); cdecl; external;
     procedure gdk_query_depths(depths: PPgint; count: Pgint); cdecl; external;
     procedure gdk_query_visual_types(visual_types: PPGdkVisualType; count: Pgint); cdecl; external;
     procedure gdk_rectangle_union(src1: PGdkRectangle; src2: PGdkRectangle; dest: PGdkRectangle); cdecl; external;
    @@ -4252,9 +4252,9 @@
     procedure gdk_screen_get_monitor_workarea(screen: PGdkScreen; monitor_num: gint; dest: PGdkRectangle); cdecl; external;
     procedure gdk_screen_set_font_options(screen: PGdkScreen; options: Pcairo_font_options_t); cdecl; external;
     procedure gdk_screen_set_resolution(screen: PGdkScreen; dpi: gdouble); cdecl; external;
    -procedure gdk_selection_convert(requestor: PGdkWindow; selection: TGdkAtom; target: TGdkAtom; time_: guint32); cdecl; external;
    -procedure gdk_selection_send_notify(requestor: PGdkWindow; selection: TGdkAtom; target: TGdkAtom; property_: TGdkAtom; time_: guint32); cdecl; external;
    -procedure gdk_selection_send_notify_for_display(display: PGdkDisplay; requestor: PGdkWindow; selection: TGdkAtom; target: TGdkAtom; property_: TGdkAtom; time_: guint32); cdecl; external;
    +procedure gdk_selection_convert(requestor: PGdkWindow; selection: PGdkAtom; target: PGdkAtom; time_: guint32); cdecl; external;
    +procedure gdk_selection_send_notify(requestor: PGdkWindow; selection: PGdkAtom; target: PGdkAtom; property_: PGdkAtom; time_: guint32); cdecl; external;
    +procedure gdk_selection_send_notify_for_display(display: PGdkDisplay; requestor: PGdkWindow; selection: PGdkAtom; target: PGdkAtom; property_: PGdkAtom; time_: guint32); cdecl; external;
     procedure gdk_set_double_click_time(msec: guint); cdecl; external;
     procedure gdk_set_program_class(program_class: Pgchar); cdecl; external;
     procedure gdk_set_show_events(show_events: gboolean); cdecl; external;
    @@ -4499,7 +4499,7 @@
     
     function TGdkAtom.name: Pgchar; cdecl;
     begin
    -  Result := LazGdk3.gdk_atom_name(self);
    +  Result := LazGdk3.gdk_atom_name(@self);
     end;
     
     function TGdkAtom.intern(atom_name: Pgchar; only_if_exists: gboolean): PGdkAtom; cdecl;
    @@ -4512,7 +4512,7 @@
       Result := LazGdk3.gdk_atom_intern_static_string(atom_name);
     end;
     
    -function TGdkDisplay.request_selection_notification(selection: TGdkAtom): gboolean; cdecl;
    +function TGdkDisplay.request_selection_notification(selection: PGdkAtom): gboolean; cdecl;
     begin
       Result := LazGdk3.gdk_display_request_selection_notification(@self, selection);
     end;
    @@ -4837,7 +4837,7 @@
       Result := LazGdk3.gdk_device_get_axis_use(@self, index_);
     end;
     
    -function TGdkDevice.get_axis_value(axes: Pgdouble; axis_label: TGdkAtom; value: Pgdouble): gboolean; cdecl;
    +function TGdkDevice.get_axis_value(axes: Pgdouble; axis_label: PGdkAtom; value: Pgdouble): gboolean; cdecl;
     begin
       Result := LazGdk3.gdk_device_get_axis_value(@self, axes, axis_label, value);
     end;
    
    c3.diff (12,721 bytes)

Relationships

has duplicate 0036441 closedBart Broersma GTK3: Crash when string assigned to clipboard 

Activities

Anton Kavalenka

2019-11-23 15:45

reporter   ~0119454

I think copy-paste from GTK2 would work

CudaText man

2019-12-20 21:19

reporter   ~0119980

fix added-- it implements ClipboardRegisterFormat in WS, please check the code - Im not sure that I've ok changed result of Gtk3 functions: TGtkAtom->PGtkAtom, but seems it is ok, Gtk3 cannot return TGtkAtom.

c1.diff (3,060 bytes)
Index: lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas
===================================================================
--- lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas	(revision 62425)
+++ lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas	(working copy)
@@ -2885,8 +2885,8 @@
   PGdkAtom = ^TGdkAtom;
   TGdkAtom = object
     function name: Pgchar; cdecl; inline;
-    function intern(atom_name: Pgchar; only_if_exists: gboolean): TGdkAtom; cdecl; inline; static;
-    function intern_static_string(atom_name: Pgchar): TGdkAtom; cdecl; inline; static;
+    function intern(atom_name: Pgchar; only_if_exists: gboolean): PGdkAtom; cdecl; inline; static;
+    function intern_static_string(atom_name: Pgchar): PGdkAtom; cdecl; inline; static;
   end;
   TGdkDisplay = object(TGObject)
     function get_default: PGdkDisplay; cdecl; inline; static;
@@ -3891,8 +3891,8 @@
 
 
 function gdk_app_launch_context_get_type: TGType; cdecl; external;
-function gdk_atom_intern(atom_name: Pgchar; only_if_exists: gboolean): TGdkAtom; cdecl; external;
-function gdk_atom_intern_static_string(atom_name: Pgchar): TGdkAtom; cdecl; external;
+function gdk_atom_intern(atom_name: Pgchar; only_if_exists: gboolean): PGdkAtom; cdecl; external;
+function gdk_atom_intern_static_string(atom_name: Pgchar): PGdkAtom; cdecl; external;
 function gdk_atom_name(atom: TGdkAtom): Pgchar; cdecl; external;
 function gdk_cairo_create(window: PGdkWindow): Pcairo_t; cdecl; external;
 function gdk_cairo_get_clip_rectangle(cr: Pcairo_t; rect: PGdkRectangle): gboolean; cdecl; external;
@@ -4502,12 +4502,12 @@
   Result := LazGdk3.gdk_atom_name(self);
 end;
 
-function TGdkAtom.intern(atom_name: Pgchar; only_if_exists: gboolean): TGdkAtom; cdecl;
+function TGdkAtom.intern(atom_name: Pgchar; only_if_exists: gboolean): PGdkAtom; cdecl;
 begin
   Result := LazGdk3.gdk_atom_intern(atom_name, only_if_exists);
 end;
 
-function TGdkAtom.intern_static_string(atom_name: Pgchar): TGdkAtom; cdecl;
+function TGdkAtom.intern_static_string(atom_name: Pgchar): PGdkAtom; cdecl;
 begin
   Result := LazGdk3.gdk_atom_intern_static_string(atom_name);
 end;
Index: lcl/interfaces/gtk3/gtk3winapi.inc
===================================================================
--- lcl/interfaces/gtk3/gtk3winapi.inc	(revision 62425)
+++ lcl/interfaces/gtk3/gtk3winapi.inc	(working copy)
@@ -170,13 +170,13 @@
     FormatCount, Formats);
 end;
 
-function TGtk3WidgetSet.ClipboardRegisterFormat(const AMimeType: string
-  ): TClipboardFormat;
+function TGtk3WidgetSet.ClipboardRegisterFormat(const AMimeType: string): TClipboardFormat;
 begin
-  {$IFDEF GTK3DEBUGNOTIMPLEMENTED}
-  DebugLn('WARNING: TGtk3WidgetSet.ClipboardRegisterFormat not implemented ...');
-  {$ENDIF}
-  Result:=inherited ClipboardRegisterFormat(AMimeType);
+  if Assigned(Application) then
+    Result := TClipboardFormat(TGdkAtom.intern(PChar(AMimeType), False))
+  else
+    RaiseGDBException(
+      'ERROR: TGtk3WidgetSet.ClipboardRegisterFormat gdk not initialized');
 end;
 
 function TGtk3WidgetSet.CombineRgn(Dest, Src1, Src2: HRGN;
c1.diff (3,060 bytes)

CudaText man

2019-12-20 22:11

reporter   ~0119982

Last edited: 2019-12-20 22:13

View 4 revisions

If i am right then ALL occurrences of ": TGdkAtom" must be replaced to ": PGdkAtom".
i 've done it in next patch. c2.diff.
it makes no sence to have fields of TGdkAtom since it's FAKE OBJECT used only to have PGdkAtom ptr.



c2.diff (14,760 bytes)
Index: lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas
===================================================================
--- lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas	(revision 62425)
+++ lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas	(working copy)
@@ -2885,8 +2885,8 @@
   PGdkAtom = ^TGdkAtom;
   TGdkAtom = object
     function name: Pgchar; cdecl; inline;
-    function intern(atom_name: Pgchar; only_if_exists: gboolean): TGdkAtom; cdecl; inline; static;
-    function intern_static_string(atom_name: Pgchar): TGdkAtom; cdecl; inline; static;
+    function intern(atom_name: Pgchar; only_if_exists: gboolean): PGdkAtom; cdecl; inline; static;
+    function intern_static_string(atom_name: Pgchar): PGdkAtom; cdecl; inline; static;
   end;
   TGdkDisplay = object(TGObject)
     function get_default: PGdkDisplay; cdecl; inline; static;
@@ -2911,7 +2911,7 @@
     procedure notify_startup_complete(startup_id: Pgchar); cdecl; inline;
     function peek_event: PGdkEvent; cdecl; inline;
     procedure put_event(event: PGdkEvent); cdecl; inline;
-    function request_selection_notification(selection: TGdkAtom): gboolean; cdecl; inline;
+    function request_selection_notification(selection: PGdkAtom): gboolean; cdecl; inline;
     procedure set_double_click_distance(distance: guint); cdecl; inline;
     procedure set_double_click_time(msec: guint); cdecl; inline;
     procedure store_clipboard(clipboard_window: PGdkWindow; time_: guint32; targets: PGdkAtom; n_targets: gint); cdecl; inline;
@@ -3045,7 +3045,7 @@
     function get_associated_device: PGdkDevice; cdecl; inline;
     function get_axis(axes: Pgdouble; use: TGdkAxisUse; value: Pgdouble): gboolean; cdecl; inline;
     function get_axis_use(index_: guint): TGdkAxisUse; cdecl; inline;
-    function get_axis_value(axes: Pgdouble; axis_label: TGdkAtom; value: Pgdouble): gboolean; cdecl; inline;
+    function get_axis_value(axes: Pgdouble; axis_label: PGdkAtom; value: Pgdouble): gboolean; cdecl; inline;
     function get_device_type: TGdkDeviceType; cdecl; inline;
     function get_display: PGdkDisplay; cdecl; inline;
     function get_has_cursor: gboolean; cdecl; inline;
@@ -3495,7 +3495,7 @@
     type_: TGdkEventType;
     window: PGdkWindow;
     send_event: gint8;
-    atom: TGdkAtom;
+    atom: PGdkAtom;
     time: guint32;
     state: TGdkPropertyState;
   end;
@@ -3509,9 +3509,9 @@
     type_: TGdkEventType;
     window: PGdkWindow;
     send_event: gint8;
-    selection: TGdkAtom;
-    target: TGdkAtom;
-    property_: TGdkAtom;
+    selection: PGdkAtom;
+    target: PGdkAtom;
+    property_: PGdkAtom;
     time: guint32;
     requestor: PGdkWindow;
   end;
@@ -3530,7 +3530,7 @@
     send_event: gint8;
     owner: PGdkWindow;
     reason: TGdkOwnerChange;
-    selection: TGdkAtom;
+    selection: PGdkAtom;
     time: guint32;
     selection_time: guint32;
   end;
@@ -3891,9 +3891,9 @@
 
 
 function gdk_app_launch_context_get_type: TGType; cdecl; external;
-function gdk_atom_intern(atom_name: Pgchar; only_if_exists: gboolean): TGdkAtom; cdecl; external;
-function gdk_atom_intern_static_string(atom_name: Pgchar): TGdkAtom; cdecl; external;
-function gdk_atom_name(atom: TGdkAtom): Pgchar; cdecl; external;
+function gdk_atom_intern(atom_name: Pgchar; only_if_exists: gboolean): PGdkAtom; cdecl; external;
+function gdk_atom_intern_static_string(atom_name: Pgchar): PGdkAtom; cdecl; external;
+function gdk_atom_name(atom: PGdkAtom): Pgchar; cdecl; external;
 function gdk_cairo_create(window: PGdkWindow): Pcairo_t; cdecl; external;
 function gdk_cairo_get_clip_rectangle(cr: Pcairo_t; rect: PGdkRectangle): gboolean; cdecl; external;
 function gdk_cairo_region_create_from_surface(surface: Pcairo_surface_t): Pcairo_region_t; cdecl; external;
@@ -3914,7 +3914,7 @@
 function gdk_device_get_associated_device(device: PGdkDevice): PGdkDevice; cdecl; external;
 function gdk_device_get_axis(device: PGdkDevice; axes: Pgdouble; use: TGdkAxisUse; value: Pgdouble): gboolean; cdecl; external;
 function gdk_device_get_axis_use(device: PGdkDevice; index_: guint): TGdkAxisUse; cdecl; external;
-function gdk_device_get_axis_value(device: PGdkDevice; axes: Pgdouble; axis_label: TGdkAtom; value: Pgdouble): gboolean; cdecl; external;
+function gdk_device_get_axis_value(device: PGdkDevice; axes: Pgdouble; axis_label: PGdkAtom; value: Pgdouble): gboolean; cdecl; external;
 function gdk_device_get_device_type(device: PGdkDevice): TGdkDeviceType; cdecl; external;
 function gdk_device_get_display(device: PGdkDevice): PGdkDisplay; cdecl; external;
 function gdk_device_get_has_cursor(device: PGdkDevice): gboolean; cdecl; external;
@@ -3958,7 +3958,7 @@
 function gdk_display_open(display_name: Pgchar): PGdkDisplay; cdecl; external;
 function gdk_display_open_default_libgtk_only: PGdkDisplay; cdecl; external;
 function gdk_display_peek_event(display: PGdkDisplay): PGdkEvent; cdecl; external;
-function gdk_display_request_selection_notification(display: PGdkDisplay; selection: TGdkAtom): gboolean; cdecl; external;
+function gdk_display_request_selection_notification(display: PGdkDisplay; selection: PGdkAtom): gboolean; cdecl; external;
 function gdk_display_supports_clipboard_persistence(display: PGdkDisplay): gboolean; cdecl; external;
 function gdk_display_supports_composite(display: PGdkDisplay): gboolean; cdecl; external;
 function gdk_display_supports_cursor_alpha(display: PGdkDisplay): gboolean; cdecl; external;
@@ -3978,7 +3978,7 @@
 function gdk_drag_context_get_type: TGType; cdecl; external;
 function gdk_drag_context_list_targets(context: PGdkDragContext): PGList; cdecl; external;
 function gdk_drag_drop_succeeded(context: PGdkDragContext): gboolean; cdecl; external;
-function gdk_drag_get_selection(context: PGdkDragContext): TGdkAtom; cdecl; external;
+function gdk_drag_get_selection(context: PGdkDragContext): PGdkAtom; cdecl; external;
 function gdk_drag_motion(context: PGdkDragContext; dest_window: PGdkWindow; protocol: TGdkDragProtocol; x_root: gint; y_root: gint; suggested_action: TGdkDragAction; possible_actions: TGdkDragAction; time_: guint32): gboolean; cdecl; external;
 function gdk_error_trap_pop: gint; cdecl; external;
 function gdk_event_copy(event: PGdkEvent): PGdkEvent; cdecl; external;
@@ -4058,7 +4058,7 @@
 function gdk_pixbuf_get_from_window(window: PGdkWindow; src_x: gint; src_y: gint; width: gint; height: gint): PGdkPixbuf; cdecl; external;
 function gdk_pointer_grab(window: PGdkWindow; owner_events: gboolean; event_mask: TGdkEventMask; confine_to: PGdkWindow; cursor: PGdkCursor; time_: guint32): TGdkGrabStatus; cdecl; external;
 function gdk_pointer_is_grabbed: gboolean; cdecl; external;
-function gdk_property_get(window: PGdkWindow; property_: TGdkAtom; type_: TGdkAtom; offset: gulong; length: gulong; pdelete: gint; actual_property_type: PGdkAtom; actual_format: Pgint; actual_length: Pgint; data: PPguint8): gboolean; cdecl; external;
+function gdk_property_get(window: PGdkWindow; property_: PGdkAtom; type_: PGdkAtom; offset: gulong; length: gulong; pdelete: gint; actual_property_type: PGdkAtom; actual_format: Pgint; actual_length: Pgint; data: PPguint8): gboolean; cdecl; external;
 function gdk_rectangle_get_type: TGType; cdecl; external;
 function gdk_rectangle_intersect(src1: PGdkRectangle; src2: PGdkRectangle; dest: PGdkRectangle): gboolean; cdecl; external;
 function gdk_rgba_copy(rgba: PGdkRGBA): PGdkRGBA; cdecl; external;
@@ -4099,15 +4099,15 @@
 function gdk_screen_make_display_name(screen: PGdkScreen): Pgchar; cdecl; external;
 function gdk_screen_width: gint; cdecl; external;
 function gdk_screen_width_mm: gint; cdecl; external;
-function gdk_selection_owner_get(selection: TGdkAtom): PGdkWindow; cdecl; external;
-function gdk_selection_owner_get_for_display(display: PGdkDisplay; selection: TGdkAtom): PGdkWindow; cdecl; external;
-function gdk_selection_owner_set(owner: PGdkWindow; selection: TGdkAtom; time_: guint32; send_event: gboolean): gboolean; cdecl; external;
-function gdk_selection_owner_set_for_display(display: PGdkDisplay; owner: PGdkWindow; selection: TGdkAtom; time_: guint32; send_event: gboolean): gboolean; cdecl; external;
+function gdk_selection_owner_get(selection: PGdkAtom): PGdkWindow; cdecl; external;
+function gdk_selection_owner_get_for_display(display: PGdkDisplay; selection: PGdkAtom): PGdkWindow; cdecl; external;
+function gdk_selection_owner_set(owner: PGdkWindow; selection: PGdkAtom; time_: guint32; send_event: gboolean): gboolean; cdecl; external;
+function gdk_selection_owner_set_for_display(display: PGdkDisplay; owner: PGdkWindow; selection: PGdkAtom; time_: guint32; send_event: gboolean): gboolean; cdecl; external;
 function gdk_selection_property_get(requestor: PGdkWindow; data: PPguint8; prop_type: PGdkAtom; prop_format: Pgint): gint; cdecl; external;
 function gdk_setting_get(name: Pgchar; value: PGValue): gboolean; cdecl; external;
 function gdk_test_simulate_button(window: PGdkWindow; x: gint; y: gint; button: guint; modifiers: TGdkModifierType; button_pressrelease: TGdkEventType): gboolean; cdecl; external;
 function gdk_test_simulate_key(window: PGdkWindow; x: gint; y: gint; keyval: guint; modifiers: TGdkModifierType; key_pressrelease: TGdkEventType): gboolean; cdecl; external;
-function gdk_text_property_to_utf8_list_for_display(display: PGdkDisplay; encoding: TGdkAtom; format: gint; text: Pguint8; length: gint; list: PPPgchar): gint; cdecl; external;
+function gdk_text_property_to_utf8_list_for_display(display: PGdkDisplay; encoding: PGdkAtom; format: gint; text: Pguint8; length: gint; list: PPPgchar): gint; cdecl; external;
 function gdk_threads_add_idle(function_: TGSourceFunc; data: gpointer): guint; cdecl; external;
 function gdk_threads_add_idle_full(priority: gint; function_: TGSourceFunc; data: gpointer; notify: TGDestroyNotify): guint; cdecl; external;
 function gdk_threads_add_timeout(interval: guint; function_: TGSourceFunc; data: gpointer): guint; cdecl; external;
@@ -4242,8 +4242,8 @@
 procedure gdk_parse_args(argc: Pgint; argv: PPPgchar); cdecl; external;
 procedure gdk_pointer_ungrab(time_: guint32); cdecl; external;
 procedure gdk_pre_parse_libgtk_only; cdecl; external;
-procedure gdk_property_change(window: PGdkWindow; property_: TGdkAtom; type_: TGdkAtom; format: gint; mode: TGdkPropMode; data: Pguint8; nelements: gint); cdecl; external;
-procedure gdk_property_delete(window: PGdkWindow; property_: TGdkAtom); cdecl; external;
+procedure gdk_property_change(window: PGdkWindow; property_: PGdkAtom; type_: PGdkAtom; format: gint; mode: TGdkPropMode; data: Pguint8; nelements: gint); cdecl; external;
+procedure gdk_property_delete(window: PGdkWindow; property_: PGdkAtom); cdecl; external;
 procedure gdk_query_depths(depths: PPgint; count: Pgint); cdecl; external;
 procedure gdk_query_visual_types(visual_types: PPGdkVisualType; count: Pgint); cdecl; external;
 procedure gdk_rectangle_union(src1: PGdkRectangle; src2: PGdkRectangle; dest: PGdkRectangle); cdecl; external;
@@ -4252,9 +4252,9 @@
 procedure gdk_screen_get_monitor_workarea(screen: PGdkScreen; monitor_num: gint; dest: PGdkRectangle); cdecl; external;
 procedure gdk_screen_set_font_options(screen: PGdkScreen; options: Pcairo_font_options_t); cdecl; external;
 procedure gdk_screen_set_resolution(screen: PGdkScreen; dpi: gdouble); cdecl; external;
-procedure gdk_selection_convert(requestor: PGdkWindow; selection: TGdkAtom; target: TGdkAtom; time_: guint32); cdecl; external;
-procedure gdk_selection_send_notify(requestor: PGdkWindow; selection: TGdkAtom; target: TGdkAtom; property_: TGdkAtom; time_: guint32); cdecl; external;
-procedure gdk_selection_send_notify_for_display(display: PGdkDisplay; requestor: PGdkWindow; selection: TGdkAtom; target: TGdkAtom; property_: TGdkAtom; time_: guint32); cdecl; external;
+procedure gdk_selection_convert(requestor: PGdkWindow; selection: PGdkAtom; target: PGdkAtom; time_: guint32); cdecl; external;
+procedure gdk_selection_send_notify(requestor: PGdkWindow; selection: PGdkAtom; target: PGdkAtom; property_: PGdkAtom; time_: guint32); cdecl; external;
+procedure gdk_selection_send_notify_for_display(display: PGdkDisplay; requestor: PGdkWindow; selection: PGdkAtom; target: PGdkAtom; property_: PGdkAtom; time_: guint32); cdecl; external;
 procedure gdk_set_double_click_time(msec: guint); cdecl; external;
 procedure gdk_set_program_class(program_class: Pgchar); cdecl; external;
 procedure gdk_set_show_events(show_events: gboolean); cdecl; external;
@@ -4499,20 +4499,20 @@
 
 function TGdkAtom.name: Pgchar; cdecl;
 begin
-  Result := LazGdk3.gdk_atom_name(self);
+  Result := LazGdk3.gdk_atom_name(@self);
 end;
 
-function TGdkAtom.intern(atom_name: Pgchar; only_if_exists: gboolean): TGdkAtom; cdecl;
+function TGdkAtom.intern(atom_name: Pgchar; only_if_exists: gboolean): PGdkAtom; cdecl;
 begin
   Result := LazGdk3.gdk_atom_intern(atom_name, only_if_exists);
 end;
 
-function TGdkAtom.intern_static_string(atom_name: Pgchar): TGdkAtom; cdecl;
+function TGdkAtom.intern_static_string(atom_name: Pgchar): PGdkAtom; cdecl;
 begin
   Result := LazGdk3.gdk_atom_intern_static_string(atom_name);
 end;
 
-function TGdkDisplay.request_selection_notification(selection: TGdkAtom): gboolean; cdecl;
+function TGdkDisplay.request_selection_notification(selection: PGdkAtom): gboolean; cdecl;
 begin
   Result := LazGdk3.gdk_display_request_selection_notification(@self, selection);
 end;
@@ -4837,7 +4837,7 @@
   Result := LazGdk3.gdk_device_get_axis_use(@self, index_);
 end;
 
-function TGdkDevice.get_axis_value(axes: Pgdouble; axis_label: TGdkAtom; value: Pgdouble): gboolean; cdecl;
+function TGdkDevice.get_axis_value(axes: Pgdouble; axis_label: PGdkAtom; value: Pgdouble): gboolean; cdecl;
 begin
   Result := LazGdk3.gdk_device_get_axis_value(@self, axes, axis_label, value);
 end;
Index: lcl/interfaces/gtk3/gtk3winapi.inc
===================================================================
--- lcl/interfaces/gtk3/gtk3winapi.inc	(revision 62425)
+++ lcl/interfaces/gtk3/gtk3winapi.inc	(working copy)
@@ -170,13 +170,13 @@
     FormatCount, Formats);
 end;
 
-function TGtk3WidgetSet.ClipboardRegisterFormat(const AMimeType: string
-  ): TClipboardFormat;
+function TGtk3WidgetSet.ClipboardRegisterFormat(const AMimeType: string): TClipboardFormat;
 begin
-  {$IFDEF GTK3DEBUGNOTIMPLEMENTED}
-  DebugLn('WARNING: TGtk3WidgetSet.ClipboardRegisterFormat not implemented ...');
-  {$ENDIF}
-  Result:=inherited ClipboardRegisterFormat(AMimeType);
+  if Assigned(Application) then
+    Result := TClipboardFormat(TGdkAtom.intern(PChar(AMimeType), False))
+  else
+    RaiseGDBException(
+      'ERROR: TGtk3WidgetSet.ClipboardRegisterFormat gdk not initialized');
 end;
 
 function TGtk3WidgetSet.CombineRgn(Dest, Src1, Src2: HRGN;
c2.diff (14,760 bytes)

Juha Manninen

2019-12-20 23:02

developer   ~0119984

I applied the first patch in r62426. The exception is gone now which is good, but the clipboard still does not work. There is no data to be pasted.
I am uploading a test app for it.

ClipboardTest.zip (128,992 bytes)

CudaText man

2019-12-24 20:53

reporter   ~0120056

Juha,
as continue to c1.diff+c2.diff I upload c3.diff.
it changes parameters of type "TGdkAtom" to "PGdkAtom". why? only using params of P* is correct, not of T*. LCL functions pass generic pointers to GTK3 so they must pass P*. and also - TGdkAtom objects cannot be made (see how this type is made - it's FAKE TYPE, it's only to make type difference in parameters)

c3.diff (12,721 bytes)
Index: lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas
===================================================================
--- lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas	(revision 62430)
+++ lcl/interfaces/gtk3/gtk3bindings/lazgdk3.pas	(working copy)
@@ -2911,7 +2911,7 @@
     procedure notify_startup_complete(startup_id: Pgchar); cdecl; inline;
     function peek_event: PGdkEvent; cdecl; inline;
     procedure put_event(event: PGdkEvent); cdecl; inline;
-    function request_selection_notification(selection: TGdkAtom): gboolean; cdecl; inline;
+    function request_selection_notification(selection: PGdkAtom): gboolean; cdecl; inline;
     procedure set_double_click_distance(distance: guint); cdecl; inline;
     procedure set_double_click_time(msec: guint); cdecl; inline;
     procedure store_clipboard(clipboard_window: PGdkWindow; time_: guint32; targets: PGdkAtom; n_targets: gint); cdecl; inline;
@@ -3045,7 +3045,7 @@
     function get_associated_device: PGdkDevice; cdecl; inline;
     function get_axis(axes: Pgdouble; use: TGdkAxisUse; value: Pgdouble): gboolean; cdecl; inline;
     function get_axis_use(index_: guint): TGdkAxisUse; cdecl; inline;
-    function get_axis_value(axes: Pgdouble; axis_label: TGdkAtom; value: Pgdouble): gboolean; cdecl; inline;
+    function get_axis_value(axes: Pgdouble; axis_label: PGdkAtom; value: Pgdouble): gboolean; cdecl; inline;
     function get_device_type: TGdkDeviceType; cdecl; inline;
     function get_display: PGdkDisplay; cdecl; inline;
     function get_has_cursor: gboolean; cdecl; inline;
@@ -3495,7 +3495,7 @@
     type_: TGdkEventType;
     window: PGdkWindow;
     send_event: gint8;
-    atom: TGdkAtom;
+    atom: PGdkAtom;
     time: guint32;
     state: TGdkPropertyState;
   end;
@@ -3509,9 +3509,9 @@
     type_: TGdkEventType;
     window: PGdkWindow;
     send_event: gint8;
-    selection: TGdkAtom;
-    target: TGdkAtom;
-    property_: TGdkAtom;
+    selection: PGdkAtom;
+    target: PGdkAtom;
+    property_: PGdkAtom;
     time: guint32;
     requestor: PGdkWindow;
   end;
@@ -3530,7 +3530,7 @@
     send_event: gint8;
     owner: PGdkWindow;
     reason: TGdkOwnerChange;
-    selection: TGdkAtom;
+    selection: PGdkAtom;
     time: guint32;
     selection_time: guint32;
   end;
@@ -3893,7 +3893,7 @@
 function gdk_app_launch_context_get_type: TGType; cdecl; external;
 function gdk_atom_intern(atom_name: Pgchar; only_if_exists: gboolean): PGdkAtom; cdecl; external;
 function gdk_atom_intern_static_string(atom_name: Pgchar): PGdkAtom; cdecl; external;
-function gdk_atom_name(atom: TGdkAtom): Pgchar; cdecl; external;
+function gdk_atom_name(atom: PGdkAtom): Pgchar; cdecl; external;
 function gdk_cairo_create(window: PGdkWindow): Pcairo_t; cdecl; external;
 function gdk_cairo_get_clip_rectangle(cr: Pcairo_t; rect: PGdkRectangle): gboolean; cdecl; external;
 function gdk_cairo_region_create_from_surface(surface: Pcairo_surface_t): Pcairo_region_t; cdecl; external;
@@ -3914,7 +3914,7 @@
 function gdk_device_get_associated_device(device: PGdkDevice): PGdkDevice; cdecl; external;
 function gdk_device_get_axis(device: PGdkDevice; axes: Pgdouble; use: TGdkAxisUse; value: Pgdouble): gboolean; cdecl; external;
 function gdk_device_get_axis_use(device: PGdkDevice; index_: guint): TGdkAxisUse; cdecl; external;
-function gdk_device_get_axis_value(device: PGdkDevice; axes: Pgdouble; axis_label: TGdkAtom; value: Pgdouble): gboolean; cdecl; external;
+function gdk_device_get_axis_value(device: PGdkDevice; axes: Pgdouble; axis_label: PGdkAtom; value: Pgdouble): gboolean; cdecl; external;
 function gdk_device_get_device_type(device: PGdkDevice): TGdkDeviceType; cdecl; external;
 function gdk_device_get_display(device: PGdkDevice): PGdkDisplay; cdecl; external;
 function gdk_device_get_has_cursor(device: PGdkDevice): gboolean; cdecl; external;
@@ -3958,7 +3958,7 @@
 function gdk_display_open(display_name: Pgchar): PGdkDisplay; cdecl; external;
 function gdk_display_open_default_libgtk_only: PGdkDisplay; cdecl; external;
 function gdk_display_peek_event(display: PGdkDisplay): PGdkEvent; cdecl; external;
-function gdk_display_request_selection_notification(display: PGdkDisplay; selection: TGdkAtom): gboolean; cdecl; external;
+function gdk_display_request_selection_notification(display: PGdkDisplay; selection: PGdkAtom): gboolean; cdecl; external;
 function gdk_display_supports_clipboard_persistence(display: PGdkDisplay): gboolean; cdecl; external;
 function gdk_display_supports_composite(display: PGdkDisplay): gboolean; cdecl; external;
 function gdk_display_supports_cursor_alpha(display: PGdkDisplay): gboolean; cdecl; external;
@@ -3978,7 +3978,7 @@
 function gdk_drag_context_get_type: TGType; cdecl; external;
 function gdk_drag_context_list_targets(context: PGdkDragContext): PGList; cdecl; external;
 function gdk_drag_drop_succeeded(context: PGdkDragContext): gboolean; cdecl; external;
-function gdk_drag_get_selection(context: PGdkDragContext): TGdkAtom; cdecl; external;
+function gdk_drag_get_selection(context: PGdkDragContext): PGdkAtom; cdecl; external;
 function gdk_drag_motion(context: PGdkDragContext; dest_window: PGdkWindow; protocol: TGdkDragProtocol; x_root: gint; y_root: gint; suggested_action: TGdkDragAction; possible_actions: TGdkDragAction; time_: guint32): gboolean; cdecl; external;
 function gdk_error_trap_pop: gint; cdecl; external;
 function gdk_event_copy(event: PGdkEvent): PGdkEvent; cdecl; external;
@@ -4058,7 +4058,7 @@
 function gdk_pixbuf_get_from_window(window: PGdkWindow; src_x: gint; src_y: gint; width: gint; height: gint): PGdkPixbuf; cdecl; external;
 function gdk_pointer_grab(window: PGdkWindow; owner_events: gboolean; event_mask: TGdkEventMask; confine_to: PGdkWindow; cursor: PGdkCursor; time_: guint32): TGdkGrabStatus; cdecl; external;
 function gdk_pointer_is_grabbed: gboolean; cdecl; external;
-function gdk_property_get(window: PGdkWindow; property_: TGdkAtom; type_: TGdkAtom; offset: gulong; length: gulong; pdelete: gint; actual_property_type: PGdkAtom; actual_format: Pgint; actual_length: Pgint; data: PPguint8): gboolean; cdecl; external;
+function gdk_property_get(window: PGdkWindow; property_: PGdkAtom; type_: PGdkAtom; offset: gulong; length: gulong; pdelete: gint; actual_property_type: PGdkAtom; actual_format: Pgint; actual_length: Pgint; data: PPguint8): gboolean; cdecl; external;
 function gdk_rectangle_get_type: TGType; cdecl; external;
 function gdk_rectangle_intersect(src1: PGdkRectangle; src2: PGdkRectangle; dest: PGdkRectangle): gboolean; cdecl; external;
 function gdk_rgba_copy(rgba: PGdkRGBA): PGdkRGBA; cdecl; external;
@@ -4099,15 +4099,15 @@
 function gdk_screen_make_display_name(screen: PGdkScreen): Pgchar; cdecl; external;
 function gdk_screen_width: gint; cdecl; external;
 function gdk_screen_width_mm: gint; cdecl; external;
-function gdk_selection_owner_get(selection: TGdkAtom): PGdkWindow; cdecl; external;
-function gdk_selection_owner_get_for_display(display: PGdkDisplay; selection: TGdkAtom): PGdkWindow; cdecl; external;
-function gdk_selection_owner_set(owner: PGdkWindow; selection: TGdkAtom; time_: guint32; send_event: gboolean): gboolean; cdecl; external;
-function gdk_selection_owner_set_for_display(display: PGdkDisplay; owner: PGdkWindow; selection: TGdkAtom; time_: guint32; send_event: gboolean): gboolean; cdecl; external;
+function gdk_selection_owner_get(selection: PGdkAtom): PGdkWindow; cdecl; external;
+function gdk_selection_owner_get_for_display(display: PGdkDisplay; selection: PGdkAtom): PGdkWindow; cdecl; external;
+function gdk_selection_owner_set(owner: PGdkWindow; selection: PGdkAtom; time_: guint32; send_event: gboolean): gboolean; cdecl; external;
+function gdk_selection_owner_set_for_display(display: PGdkDisplay; owner: PGdkWindow; selection: PGdkAtom; time_: guint32; send_event: gboolean): gboolean; cdecl; external;
 function gdk_selection_property_get(requestor: PGdkWindow; data: PPguint8; prop_type: PGdkAtom; prop_format: Pgint): gint; cdecl; external;
 function gdk_setting_get(name: Pgchar; value: PGValue): gboolean; cdecl; external;
 function gdk_test_simulate_button(window: PGdkWindow; x: gint; y: gint; button: guint; modifiers: TGdkModifierType; button_pressrelease: TGdkEventType): gboolean; cdecl; external;
 function gdk_test_simulate_key(window: PGdkWindow; x: gint; y: gint; keyval: guint; modifiers: TGdkModifierType; key_pressrelease: TGdkEventType): gboolean; cdecl; external;
-function gdk_text_property_to_utf8_list_for_display(display: PGdkDisplay; encoding: TGdkAtom; format: gint; text: Pguint8; length: gint; list: PPPgchar): gint; cdecl; external;
+function gdk_text_property_to_utf8_list_for_display(display: PGdkDisplay; encoding: PGdkAtom; format: gint; text: Pguint8; length: gint; list: PPPgchar): gint; cdecl; external;
 function gdk_threads_add_idle(function_: TGSourceFunc; data: gpointer): guint; cdecl; external;
 function gdk_threads_add_idle_full(priority: gint; function_: TGSourceFunc; data: gpointer; notify: TGDestroyNotify): guint; cdecl; external;
 function gdk_threads_add_timeout(interval: guint; function_: TGSourceFunc; data: gpointer): guint; cdecl; external;
@@ -4242,8 +4242,8 @@
 procedure gdk_parse_args(argc: Pgint; argv: PPPgchar); cdecl; external;
 procedure gdk_pointer_ungrab(time_: guint32); cdecl; external;
 procedure gdk_pre_parse_libgtk_only; cdecl; external;
-procedure gdk_property_change(window: PGdkWindow; property_: TGdkAtom; type_: TGdkAtom; format: gint; mode: TGdkPropMode; data: Pguint8; nelements: gint); cdecl; external;
-procedure gdk_property_delete(window: PGdkWindow; property_: TGdkAtom); cdecl; external;
+procedure gdk_property_change(window: PGdkWindow; property_: PGdkAtom; type_: PGdkAtom; format: gint; mode: TGdkPropMode; data: Pguint8; nelements: gint); cdecl; external;
+procedure gdk_property_delete(window: PGdkWindow; property_: PGdkAtom); cdecl; external;
 procedure gdk_query_depths(depths: PPgint; count: Pgint); cdecl; external;
 procedure gdk_query_visual_types(visual_types: PPGdkVisualType; count: Pgint); cdecl; external;
 procedure gdk_rectangle_union(src1: PGdkRectangle; src2: PGdkRectangle; dest: PGdkRectangle); cdecl; external;
@@ -4252,9 +4252,9 @@
 procedure gdk_screen_get_monitor_workarea(screen: PGdkScreen; monitor_num: gint; dest: PGdkRectangle); cdecl; external;
 procedure gdk_screen_set_font_options(screen: PGdkScreen; options: Pcairo_font_options_t); cdecl; external;
 procedure gdk_screen_set_resolution(screen: PGdkScreen; dpi: gdouble); cdecl; external;
-procedure gdk_selection_convert(requestor: PGdkWindow; selection: TGdkAtom; target: TGdkAtom; time_: guint32); cdecl; external;
-procedure gdk_selection_send_notify(requestor: PGdkWindow; selection: TGdkAtom; target: TGdkAtom; property_: TGdkAtom; time_: guint32); cdecl; external;
-procedure gdk_selection_send_notify_for_display(display: PGdkDisplay; requestor: PGdkWindow; selection: TGdkAtom; target: TGdkAtom; property_: TGdkAtom; time_: guint32); cdecl; external;
+procedure gdk_selection_convert(requestor: PGdkWindow; selection: PGdkAtom; target: PGdkAtom; time_: guint32); cdecl; external;
+procedure gdk_selection_send_notify(requestor: PGdkWindow; selection: PGdkAtom; target: PGdkAtom; property_: PGdkAtom; time_: guint32); cdecl; external;
+procedure gdk_selection_send_notify_for_display(display: PGdkDisplay; requestor: PGdkWindow; selection: PGdkAtom; target: PGdkAtom; property_: PGdkAtom; time_: guint32); cdecl; external;
 procedure gdk_set_double_click_time(msec: guint); cdecl; external;
 procedure gdk_set_program_class(program_class: Pgchar); cdecl; external;
 procedure gdk_set_show_events(show_events: gboolean); cdecl; external;
@@ -4499,7 +4499,7 @@
 
 function TGdkAtom.name: Pgchar; cdecl;
 begin
-  Result := LazGdk3.gdk_atom_name(self);
+  Result := LazGdk3.gdk_atom_name(@self);
 end;
 
 function TGdkAtom.intern(atom_name: Pgchar; only_if_exists: gboolean): PGdkAtom; cdecl;
@@ -4512,7 +4512,7 @@
   Result := LazGdk3.gdk_atom_intern_static_string(atom_name);
 end;
 
-function TGdkDisplay.request_selection_notification(selection: TGdkAtom): gboolean; cdecl;
+function TGdkDisplay.request_selection_notification(selection: PGdkAtom): gboolean; cdecl;
 begin
   Result := LazGdk3.gdk_display_request_selection_notification(@self, selection);
 end;
@@ -4837,7 +4837,7 @@
   Result := LazGdk3.gdk_device_get_axis_use(@self, index_);
 end;
 
-function TGdkDevice.get_axis_value(axes: Pgdouble; axis_label: TGdkAtom; value: Pgdouble): gboolean; cdecl;
+function TGdkDevice.get_axis_value(axes: Pgdouble; axis_label: PGdkAtom; value: Pgdouble): gboolean; cdecl;
 begin
   Result := LazGdk3.gdk_device_get_axis_value(@self, axes, axis_label, value);
 end;
c3.diff (12,721 bytes)

Juha Manninen

2019-12-25 14:36

developer   ~0120060

The patch does not really do anything. I would rather combine it with some functionality.

Yes, TGdkAtom is "object", not class.

Issue History

Date Modified Username Field Change
2019-11-23 15:00 CudaText man New Issue
2019-11-23 15:45 Anton Kavalenka Note Added: 0119454
2019-12-14 23:29 Bart Broersma Relationship added has duplicate 0036441
2019-12-20 21:19 CudaText man File Added: c1.diff
2019-12-20 21:19 CudaText man Note Added: 0119980
2019-12-20 22:11 CudaText man File Added: c2.diff
2019-12-20 22:11 CudaText man Note Added: 0119982
2019-12-20 22:12 CudaText man Note Edited: 0119982 View Revisions
2019-12-20 22:12 CudaText man Note Edited: 0119982 View Revisions
2019-12-20 22:13 CudaText man Note Edited: 0119982 View Revisions
2019-12-20 23:02 Juha Manninen File Added: ClipboardTest.zip
2019-12-20 23:02 Juha Manninen Note Added: 0119984
2019-12-20 23:03 Juha Manninen Fixed in Revision => r62426
2019-12-20 23:03 Juha Manninen LazTarget => -
2019-12-20 23:03 Juha Manninen Widgetset GTK 3 => GTK 3
2019-12-20 23:04 Juha Manninen Assigned To => Juha Manninen
2019-12-20 23:04 Juha Manninen Status new => assigned
2019-12-24 20:53 CudaText man File Added: c3.diff
2019-12-24 20:53 CudaText man Note Added: 0120056
2019-12-25 14:36 Juha Manninen Note Added: 0120060