Interface TextBufferCommitNotify
- All Superinterfaces:
FunctionPointer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
TextBufferCommitNotify callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidrun(TextBuffer buffer, Set<TextBufferNotifyFlags> flags, int position, int length) A notification callback used byTextBuffer.addCommitNotify(java.util.Set<org.gnome.gtk.TextBufferNotifyFlags>, org.gnome.gtk.TextBufferCommitNotify).default MemorySegmenttoCallback(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, int, int, int, java.lang.foreign.MemorySegment)method.default voidupcall(MemorySegment buffer, int flags, int position, int length, MemorySegment userData) Theupcallmethod is called from native code.
-
Method Details
-
run
A notification callback used byTextBuffer.addCommitNotify(java.util.Set<org.gnome.gtk.TextBufferNotifyFlags>, org.gnome.gtk.TextBufferCommitNotify).You may not modify the
TextBufferfrom aGtk.TextBufferCommitNotifycallback and that is enforced by theTextBufferAPI.Gtk.TextBufferCommitNotifymay be used to be notified about changes to the underlying buffer right before-or-after the changes are committed to the underlying B-Tree. This is useful if you want to observe changes to the buffer without other signal handlers potentially modifying state on the way to the default signal handler.When
flagsisGTK_TEXT_BUFFER_NOTIFY_BEFORE_INSERT,positionis set to the offset in characters from the start of the buffer where the insertion will occur.lengthis set to the number of characters to be inserted. You may not yet retrieve the text until it has been inserted. You may access the text fromGTK_TEXT_BUFFER_NOTIFY_AFTER_INSERTusingTextBuffer.getSlice(org.gnome.gtk.TextIter, org.gnome.gtk.TextIter, boolean).When
flagsisGTK_TEXT_BUFFER_NOTIFY_AFTER_INSERT,positionis set to offset in characters where the insertion occurred andlengthis set to the number of characters inserted.When
flagsisGTK_TEXT_BUFFER_NOTIFY_BEFORE_DELETE,positionis set to offset in characters where the deletion will occur andlengthis set to the number of characters that will be removed. You may still retrieve the text from this handler usingpositionandlength.When
flagsisGTK_TEXT_BUFFER_NOTIFY_AFTER_DELETE,lengthis set to zero to denote that the delete-range has already been committed to the underlying B-Tree. You may no longer retrieve the text that has been deleted from theTextBuffer.- Since:
- 4.16
-
upcall
default void upcall(MemorySegment buffer, int flags, int position, int length, MemorySegment userData) Theupcallmethod is called from native code. The parameters are marshaled andrun(org.gnome.gtk.TextBuffer, java.util.Set<org.gnome.gtk.TextBufferNotifyFlags>, int, int)is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, int, int, int, java.lang.foreign.MemorySegment)method.- Specified by:
toCallbackin interfaceFunctionPointer- Parameters:
arena- the arena in which the function pointer is allocated- Returns:
- the native function pointer
-