TODO:
----

* REWRITE PAINT/SCROLLING API
* line/word wrap support
* avoid call text_get_text/with_tabs

 
* if cursor_pos > hscrollbar it should move hscroll.... 
* Undo implementation [90% done need to fix redo code]
* Userconfigurated keyboard shortcuts implementation using GtkBindings
* Support for 16Bit characters sets (Use pango [www.pango.org] for this)



Higliglight:
--------

/*******************************************************************************************/
On 18 Sep 1999, Thomas Mailund Jensen wrote:

> >>>>> "MH" == Mikael Hermansson <mikeh@bahnhof.se> writes:
> 
>  MH> Hello!  Here is a new release of my GtkExText widget.0
> 
> Thanks for the copy.  I can see from the TODO file that you've though
> about how to use the gtkeditor for highlighting.  Have you done any
> more work on this?
> 
> I'd personally like a changed gtkeditor using the extext widget, but
> until the later part of november I won't have much spare time to make
> it myself.[1]  Is this something you plan to look into?  Do you have
> any idea about the amount of work needed?
> 
> If you do not plan to look at using the gtkeditor with gtkextext in
> the near future, I'd try to look at it in whatever spare time I can
> find.  I just don't think will go anywhere soon...
> 

I looked a bit at your code yesterday. And If am understand it right you
only syntax higlight the text on screen?


An other way I am thinking about is to change propertys before <= after
when insert/delete any text.

Something like this. (Not tested)

signal_[insert/delete](...,gint pos,gint len)
{
	gint start,end;
	GtkExTextProperty *propstart,*propend;

	/* get nearest property backward from pos where text is insert/deleted */
  	/* NULL means start search from begining of my linked list */
	propstart=get_property_nearest_backward(pos,NULL);

	/* get nearest property after  */
	/* start searching from propstart this improve searhing alot :-) */
	/* because this means it will not start searhing from begining of*/
	/* linked list. Instead we start search were the last(=propstart)*/
	/* property were found.  */
	propend=gtk_extext_nearest_forward(pos+len,propstart);

	/* if no property before pos, start is set to 0 */
	start=propstart ? propstart->startpos : 0;

	/* if no propertys after pos+len, end is set to  end of text */
	end=propend ? propend->endpos : text->length;

	/* this is maybe stupid but I dont know any better way :-/  */
	/* must remove all propertys between start and end */
	gtk_extext_property_remove_all(text,start,end);

	gtk_editor_rehilite_interval(start,end);
}

In my widget there is No propertys at default.
This means the font/bgcol/fgcol is set to "Default" GtkExTextStyle.

if we remove/insert text we MUST always call
gtk_extext_property_move_all(pos+len,diff,NULL); /* NULL or lastprop */

This updates all propertys after pos+len.
diff = how many chars inserted(+diff) removed(-diff)

Oki thats  all.... I will test this in your widget as soon as possible.
 
Sorry my poor English.
/********************************************************************************************/

Checked the GtkEditable(the baseclass to GtkText/GtkExText) 

and it's signal API and if am right the "delete_text"
signal is sent AFTER the text has been removed.

Is this good for the higlight GtkEditor Widget or should  we implement
a new signal in GtkExText widget so GtkEditor/other widgets could use this instead?

enum signals{
	PROPERTY_REMOVE;
	PROPERTY_INSERT;
	LAST_SIGNAL;
};

Signal callback:
----------------

gint property_[insert/remove]_signal(GtkExText *text,
			GtkExTextProperty *firstprop, /* the first property 
				which is between textstartpos and 
				textendpos could be NULL    

			gint textstartpos, /* [delete/insert]text startpos */
			gint textendpos) /* [delete/insert] text endpos */ 
{
	return TRUE; /* user take care and update the prop values*/
 
       return FALSE; /* widget take care and if "property_insert" */ 
		/* update all properties after endpos and remove all
			/*	properties under >=start and  <end*/
			/* if "property_remove" remove all propertys between 
                          textstartpos and textendpos and update
				all propertys AFTER endpos*/
}

This signals will the be called AFTER text has been inserted and BEFORE
text removed so the GtkEditor/user have possibilities to remove/update
propertys correcly....


If this looks crazy and unreadable , 
maybe it is but this is not tested in reallity its
only tested in my head at the moment :-)


mikeh@bahnhof.se
