Reva GUI Library: Check-in [9a94fd2fc6]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:textbuffer
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9a94fd2fc660512791088a43ca8b1f04d2032a39
User & Date: ron 2010-03-03 18:47:36
Context
2010-03-03
20:21
textdisplay check-in: 69765670ad user: ron tags: trunk
18:47
textbuffer check-in: 9a94fd2fc6 user: ron tags: trunk
2010-03-02
11:44
no comment check-in: 3d66c3cf04 user: ron tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/revagui.cpp.

     1      1   #include <stdio.h>
     2      2   #include <FL/Fl.H>
     3      3   #include <FL/fl_utf8.h>
     4      4   #include <FL/Fl_Window.H>
     5      5   #include <FL/Fl_Box.H>
     6      6   #include <FL/Fl_Button.H>
            7  +#include <FL/Fl_Text_Buffer.H>
     7      8   
     8      9   extern "C" {
     9     10   int run(void)
    10     11   {
    11     12   	Fl::run();
    12     13   }
    13     14   void redraw(void)
................................................................................
    90     91   	w->callback(cb,data);
    91     92   }
    92     93   
    93     94   void destroy(Fl_Widget *w)
    94     95   {
    95     96   	if (w != NULL)
    96     97   		delete w;
           98  +}
           99  +void memfree(void *w)
          100  +{
          101  +	if (w != NULL)
          102  +		free(w);
    97    103   }
    98    104   
    99    105   void setcolor(Fl_Widget *w, unsigned c)
   100    106   {
   101    107   	w->color(c);
   102    108   }
   103    109   
................................................................................
   202    208   	return w->user_data(d);
   203    209   }
   204    210   
   205    211   int is_visible( Fl_Widget *w)
   206    212   {
   207    213   	return w->visible();
   208    214   }
          215  +
          216  +int text_buffer() 
          217  +{
          218  +	return (int) new Fl_Text_Buffer();
          219  +}
          220  +int tb_length( Fl_Text_Buffer *w)
          221  +{
          222  +	return w->length();
          223  +}
          224  +void tb_settext( Fl_Text_Buffer *w, const char *t)
          225  +{
          226  +	w->text(t);
          227  +}
          228  +char * tb_gettext( Fl_Text_Buffer *w)
          229  +{
          230  +	return w->text();
          231  +}
          232  +void tb_append( Fl_Text_Buffer *w, const char *t)
          233  +{
          234  +	w->append(t);
          235  +}
          236  +void tb_insert( Fl_Text_Buffer *w, int pos, const char *t)
          237  +{
          238  +	w->insert(pos,t);
          239  +}
          240  +void tb_remove( Fl_Text_Buffer *w, int start, int end)
          241  +{
          242  +	w->remove(start,end);
          243  +}
          244  +void tb_replace( Fl_Text_Buffer *w, int start, int end, const char *text)
          245  +{
          246  +	w->replace(start,end,text);
          247  +}
          248  +void tb_copy( Fl_Text_Buffer *w, Fl_Text_Buffer *from, int start, int end, int to)
          249  +{
          250  +	w->copy(from,start,end,to);
          251  +}
          252  +void tb_select( Fl_Text_Buffer *w, int start, int end)
          253  +{
          254  +	w->select(start,end);
          255  +}
          256  +char * tb_selection( Fl_Text_Buffer *w)
          257  +{
          258  +	return w->selection_text();
          259  +}
          260  +void tb_remove_selection( Fl_Text_Buffer *w)
          261  +{
          262  +	w->remove_selection();
          263  +}
          264  +void tb_replace_selection( Fl_Text_Buffer *w, const char *t)
          265  +{
          266  +	w->replace_selection(t);
          267  +}
          268  +
   209    269   }