Gapped Text Buffer
- From: Derek Simkowiak <dereks kd-dev com>
- To: gtk-list redhat com, gtk-devel-list redhat com
- cc: Wilson Soong <gwydion uswest net>, Kathryn Simkowiak <kwick kd-dev com>
- Subject: Gapped Text Buffer
- Date: Thu, 9 Mar 2000 17:05:10 -0800 (PST)
For those who are interested, I have written an Emacs-like gapped
text buffer in the Glib style. It was inspired by the GtkText, but this
is all-original code, and is much cleaner/maintainable/safe.
It's called "GdkBufferGap". The "Gdk" is because one of the
supported data types is a GdkWChar, which requires Gdk. Otherwise I would
have called it "GBufferGap". See
http://www.web.us.uu.net/staff/djm/lore/buffer-gap for info on how a
buffer gap works.
Features:
o Supports guchar, GdkWChar, and adding support for other element types
will be very easy (GUChar will take <5 mins to implement :). Grep
"DATATYPE code" for all type-specific source code...
o Fully encapsulated (all struct members are to be considered private)
o Allows direct (readonly) access to both the left- and right- data sides
of the buffer, for direct interaction with GNU regex.c or
application-level buffer mucking.
o Automatically grows the buffer for you
o Allows you to set the buffer growth size (for tweaking)
o Allows you to shrink the buffer (for app-level performance tweaking)
I plan to use this as the text data storage for my upcoming text
widget. It could/should be useful for any application which needs to
interactively edit a large number of elements (i.e., text editors).
It has only been briefly tested, but I think it all works. I will
test it thoroughly once i have an interactive, visual text-widget to look
at. Hardcore testing with g_print() is just too time consuming.
If anyone actually looks at this, I'm open to API changes or
additions. I have attached the 6K zip file with the source. I do not
have anyone locally to peer-review this code, so criticism is much
appreciated.
Thanks,
Derek Simkowiak
dereks@kd-dev.com
gdkbuffergap.zip
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]