diff options
| -rw-r--r-- | doc/fl_color_chooser.html | 238 | ||||
| -rw-r--r-- | doc/fl_input_choice.html | 297 | ||||
| -rw-r--r-- | doc/fl_printer.html | 250 | ||||
| -rw-r--r-- | doc/fl_text_display.html | 822 | ||||
| -rw-r--r-- | progress.txt | 8 | ||||
| -rw-r--r-- | src/c_fl_color_chooser.cpp | 31 | ||||
| -rw-r--r-- | src/c_fl_color_chooser.h | 36 | ||||
| -rw-r--r-- | src/c_fl_input_choice.cpp | 41 | ||||
| -rw-r--r-- | src/c_fl_input_choice.h | 46 | ||||
| -rw-r--r-- | src/c_fl_printer.h | 36 | ||||
| -rw-r--r-- | src/c_fl_text_display.cpp | 26 | ||||
| -rw-r--r-- | src/c_fl_text_display.h | 124 | ||||
| -rw-r--r-- | src/fltk-devices-surfaces-paged-printers.adb | 54 | ||||
| -rw-r--r-- | src/fltk-devices-surfaces-paged-printers.ads | 28 | ||||
| -rw-r--r-- | src/fltk-text_buffers.ads | 2 | ||||
| -rw-r--r-- | src/fltk-widgets-groups-color_choosers.adb | 61 | ||||
| -rw-r--r-- | src/fltk-widgets-groups-color_choosers.ads | 44 | ||||
| -rw-r--r-- | src/fltk-widgets-groups-input_choices.adb | 64 | ||||
| -rw-r--r-- | src/fltk-widgets-groups-input_choices.ads | 38 | ||||
| -rw-r--r-- | src/fltk-widgets-groups-text_displays.adb | 193 | ||||
| -rw-r--r-- | src/fltk-widgets-groups-text_displays.ads | 158 | 
21 files changed, 2416 insertions, 181 deletions
| diff --git a/doc/fl_color_chooser.html b/doc/fl_color_chooser.html new file mode 100644 index 0000000..66a14a7 --- /dev/null +++ b/doc/fl_color_chooser.html @@ -0,0 +1,238 @@ + +<!DOCTYPE html> + +<html lang="en"> +  <head> +    <meta charset="utf-8"> +    <title>Fl_Color_Chooser Binding Map</title> +    <link href="map.css" rel="stylesheet"> +  </head> + +  <body> + + +<h2>Fl_Color_Chooser Binding Map</h2> + + +<table class="package"> +  <tr><th colspan="2">Package name</th></tr> + +  <tr> +    <td>Fl_Color_Chooser</td> +    <td>FLTK.Widgets.Groups.Color_Choosers</td> +  </tr> + +</table> + + + +<table class="type"> +  <tr><th colspan="2">Types</th></tr> + +  <tr> +    <td>Fl_Color_Chooser</td> +    <td>Color_Chooser</td> +  </tr> + +  <tr> +    <td> </td> +    <td>Color_Chooser_Reference</td> +  </tr> + +  <tr> +    <td> </td> +    <td>Color_Mode</td> +  </tr> + +</table> + + + +<table class="function"> +  <tr><th colspan="2">Functions and Procedures</th></tr> + +  <tr> +<td><pre> +Fl_Color_Chooser(int X, int Y, int W, int H, const char *L=0); +</pre></td> +<td><pre> +function Create +       (X, Y, W, H : in Integer; +        Text       : in String) +    return Color_Chooser; +</pre></td> +  </tr> + +  <tr> +<td><pre> +double b() const; +</pre></td> +<td><pre> +function Get_Blue +       (This : in Color_Chooser) +    return Long_Float; +</pre></td> +  </tr> + +  <tr> +<td> </td> +<td><pre> +function Color_Was_Changed +       (This : in Color_Chooser) +    return Boolean; +</pre></td> +  </tr> + +  <tr> +<td> </td> +<td><pre> +procedure Clear_Changed +       (This : in out Color_Chooser); +</pre></td> +  </tr> + +  <tr> +<td> </td> +<td><pre> +procedure Draw +       (This : in out Color_Chooser); +</pre></td> +  </tr> + +  <tr> +<td><pre> +double g() const; +</pre></td> +<td><pre> +function Get_Green +       (This : in Color_Chooser) +    return Long_Float; +</pre></td> +  </tr> + +  <tr> +<td> </td> +<td><pre> +function Handle +       (This  : in out Color_Chooser; +        Event : in     Event_Kind) +    return Event_Outcome; +</pre></td> +  </tr> + +  <tr> +<td><pre> +int hsv(double H, double S, double V); +</pre></td> +<td><pre> +procedure Set_HSV +       (This    : in out Color_Chooser; +        H, S, V : in     Long_Float); +</pre></td> +  </tr> + +  <tr> +<td><pre> +double hue() const; +</pre></td> +<td><pre> +function Get_Hue +       (This : in Color_Chooser) +    return Long_Float; +</pre></td> +  </tr> + +  <tr> +<td><pre> +int mode(); +</pre></td> +<td><pre> +function Get_Mode +       (This : in Color_Chooser) +    return Color_Mode; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void mode(int newMode); +</pre></td> +<td><pre> +procedure Set_Mode +       (This : in out Color_Chooser; +        To   : in     Color_Mode); +</pre></td> +  </tr> + +  <tr> +<td><pre> +double r() const; +</pre></td> +<td><pre> +function Get_Red +       (This : in Color_Chooser) +    return Long_Float; +</pre></td> +  </tr> + +  <tr> +<td><pre> +int rgb(double R, double G, double B); +</pre></td> +<td><pre> +procedure Set_RGB +       (This    : in out Color_Chooser; +        R, G, B : in     Long_Float); +</pre></td> +  </tr> + +  <tr> +<td><pre> +double saturation() const; +</pre></td> +<td><pre> +function Get_Saturation +       (This : in Color_Chooser) +    return Long_Float; +</pre></td> +  </tr> + +  <tr> +<td><pre> +double value() const; +</pre></td> +<td><pre> +function Get_Value +       (This : in Color_Chooser) +    return Long_Float; +</pre></td> +  </tr> + +  <tr> +<td><pre> +static void hsv2rgb(double H, double S, double V, double &R, double &G, double &B); +</pre></td> +<td><pre> +procedure HSV_To_RGB +       (H, S, V : in     Long_Float; +        R, G, B :    out Long_Float); +</pre></td> +  </tr> + +  <tr> +<td><pre> +static void rgb2hsv(double R, double G, double B, double &H, double &S, double &V); +</pre></td> +<td><pre> +procedure RGB_To_HSV +       (R, G, B : in     Long_Float; +        H, S, V :    out Long_Float); +</pre></td> +  </tr> + +</table> + + +  </body> +</html> + diff --git a/doc/fl_input_choice.html b/doc/fl_input_choice.html new file mode 100644 index 0000000..c15f677 --- /dev/null +++ b/doc/fl_input_choice.html @@ -0,0 +1,297 @@ + +<!DOCTYPE html> + +<html lang="en"> +  <head> +    <meta charset="utf-8"> +    <title>Fl_Input_Choice Binding Map</title> +    <link href="map.css" rel="stylesheet"> +  </head> + +  <body> + + +<h2>Fl_Input_Choice Binding Map</h2> + + +<table class="package"> +  <tr><th colspan="2">Package name</th></tr> + +  <tr> +    <td>Fl_Input_Choice</td> +    <td>FLTK.Widgets.Groups.Input_Choices</td> +  </tr> + +</table> + + + +<table class="type"> +  <tr><th colspan="2">Types</th></tr> + +  <tr> +    <td>Fl_Input_Choice</td> +    <td>Input_Choice</td> +  </tr> + +  <tr> +    <td> </td> +    <td>Input_Choice_Reference</td> +  </tr> + +</table> + + + +<table class="function"> +  <tr><th colspan="2">Functions and Procedures</th></tr> + +  <tr> +<td><pre> +Fl_Input_Choice(int X, int Y, int W, int H, const char *L=0); +</pre></td> +<td><pre> +function Create +       (X, Y, W, H : in Integer; +        Text       : in String) +    return Input_Choice; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void add(const char *s); +</pre></td> +<td>Use Menu_Button instead</td> +  </tr> + +  <tr> +<td><pre> +int changed() const; +</pre></td> +<td><pre> +function Has_Changed +       (This : in Input_Choice) +    return Boolean; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void clear(); +</pre></td> +<td><pre> +procedure Clear +       (This : in out Input_Choice); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void clear_changed(); +</pre></td> +<td><pre> +procedure Clear_Changed +       (This : in out Input_Choice); +</pre></td> +  </tr> + +  <tr> +<td><pre> +Fl_Boxtype down_box() const; +</pre></td> +<td><pre> +function Get_Down_Box +       (This : in Input_Choice) +    return Box_Kind; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void down_box(Fl_Boxtype b); +</pre></td> +<td><pre> +procedure Set_Down_Box +       (This : in out Input_Choice; +        To   : in     Box_Kind); +</pre></td> +  </tr> + +  <tr> +<td> </td> +<td><pre> +procedure Draw +       (This : in out Input_Choice); +</pre></td> +  </tr> + +  <tr> +<td> </td> +<td><pre> +function Handle +       (This  : in out Input_Choice; +        Event : in     Event_Kind) +    return Event_Outcome; +</pre></td> +  </tr> + +  <tr> +<td><pre> +Fl_Input * input(); +</pre></td> +<td><pre> +function Input +       (This : in out Input_Choice) +    return FLTK.Widgets.Inputs.Input_Reference; +</pre></td> +  </tr> + +  <tr> +<td><pre> +const Fl_Menu_Item * menu(); +</pre></td> +<td> </td> +  </tr> + +  <tr> +<td><pre> +void menu(const Fl_Menu_Item *m); +</pre></td> +<td> </td> +  </tr> + +  <tr> +<td><pre> +Fl_Menu_Button * menubutton(); +</pre></td> +<td><pre> +function Menu_Button +       (This : in out Input_Choice) +    return FLTK.Widgets.Menus.Menu_Buttons.Menu_Button_Reference; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void resize(int X, int Y, int W, int H); +</pre></td> +<td> </td> +  </tr> + +  <tr> +<td><pre> +void set_changed(); +</pre></td> +<td><pre> +procedure Set_Changed +       (This : in out Input_Choice; +        To   : in     Boolean); +</pre></td> +  </tr> + +  <tr> +<td><pre> +Fl_Color textcolor() const; +</pre></td> +<td><pre> +function Get_Text_Color +       (This : in Input_Choice) +    return Color; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void textcolor(Fl_Color c); +</pre></td> +<td><pre> +procedure Set_Text_Color +       (This : in out Input_Choice; +        To   : in     Color); +</pre></td> +  </tr> + +  <tr> +<td><pre> +Fl_Font textfont() const; +</pre></td> +<td><pre> +function Get_Text_Font +       (This : in Input_Choice) +    return Font_Kind; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void textfont(Fl_Font f); +</pre></td> +<td><pre> +procedure Set_Text_Font +       (This : in out Input_Choice; +        To   : in     Font_Kind); +</pre></td> +  </tr> + +  <tr> +<td><pre> +Fl_Fontsize textsize() const; +</pre></td> +<td><pre> +function Get_Text_Size +       (This : in Input_Choice) +    return Font_Size; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void textsize(Fl_Fontsize s); +</pre></td> +<td><pre> +procedure Set_Text_Size +       (This : in out Input_Choice; +        To   : in     Font_Size); +</pre></td> +  </tr> + +  <tr> +<td><pre> +const char * value() const; +</pre></td> +<td><pre> +function Get_Input +       (This : in Input_Choice) +    return String; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void value(const char *val); +</pre></td> +<td><pre> +procedure Set_Input +       (This : in out Input_Choice; +        To   : in     String); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void value(int val); +</pre></td> +<td><pre> +procedure Set_Item +       (This : in out Input_Choice; +        Num  : in     Integer); +</pre></td> +  </tr> + +</table> + + +  </body> +</html> + diff --git a/doc/fl_printer.html b/doc/fl_printer.html new file mode 100644 index 0000000..97b0e9c --- /dev/null +++ b/doc/fl_printer.html @@ -0,0 +1,250 @@ + +<!DOCTYPE html> + +<html lang="en"> +  <head> +    <meta charset="utf-8"> +    <title>Fl_Printer Binding Map</title> +    <link href="map.css" rel="stylesheet"> +  </head> + +  <body> + + +<h2>Fl_Printer Binding Map</h2> + + +<table class="package"> +  <tr><th colspan="2">Package name</th></tr> + +  <tr> +    <td>Fl_Printer</td> +    <td>FLTK.Devices.Surfaces.Paged.Printers</td> +  </tr> + +</table> + + + +<table class="type"> +  <tr><th colspan="2">Types</th></tr> + +  <tr> +    <td>Fl_Printer</td> +    <td>Printer</td> +  </tr> + +  <tr> +    <td> </td> +    <td>Printer_Reference</td> +  </tr> + +</table> + + + +<table class="function"> +  <tr><th colspan="2">Functions and Procedures</th></tr> + +  <tr> +<td><pre> +Fl_Printer(void); +</pre></td> +<td><pre> +function Create +    return Printer; +</pre></td> +  </tr> + +  <tr> +<td><pre> +const char * class_name(); +</pre></td> +<td>Use runtime tag checking</td> +  </tr> + +  <tr> +<td><pre> +Fl_Graphics_Driver * driver(void); +</pre></td> +<td> </td> +  </tr> + +  <tr> +<td><pre> +void end_job(void); +</pre></td> +<td><pre> +procedure End_Job +       (This : in out Printer); +</pre></td> +  </tr> + +  <tr> +<td><pre> +int end_page(void); +</pre></td> +<td><pre> +procedure End_Page +       (This : in out Printer); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void margins(int *left, int *top, int *right, int *bottom); +</pre></td> +<td><pre> +procedure Get_Margins +       (This                     : in     Printer; +        Left, Top, Right, Bottom :    out Integer); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void origin(int *x, int *y); +</pre></td> +<td><pre> +procedure Get_Origin +       (This : in     Printer; +        X, Y :    out Integer); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void origin(int x, int y); +</pre></td> +<td><pre> +procedure Set_Origin +       (This : in out Printer; +        X, Y : in     Integer); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void print_widget(Fl_Widget *widget, int delta_x=0, int delta_y=0); +</pre></td> +<td><pre> +procedure Print_Widget +       (This               : in out Printer; +        Item               : in     FLTK.Widgets.Widget'Class; +        Offset_X, Offset_Y : in     Integer := 0); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x=0, int delta_y=0); +</pre></td> +<td><pre> +procedure Print_Window_Part +       (This               : in out Printer; +        Item               : in     FLTK.Widgets.Groups.Windows.Window'Class; +        X, Y, W, H         : in     Integer; +        Offset_X, Offset_Y : in     Integer := 0); +</pre></td> +  </tr> + +  <tr> +<td><pre> +int printable_rect(int *w, int *h); +</pre></td> +<td><pre> +procedure Get_Printable_Rect +       (This : in     Printer; +        W, H :    out Integer); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void rotate(float angle); +</pre></td> +<td><pre> +procedure Rotate +       (This    : in out Printer; +        Degrees : in     Float); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void scale(float scale_x, float scale_y=0); +</pre></td> +<td><pre> +procedure Scale +       (This   : in out Printer; +        Factor : in     Float); + +procedure Scale +       (This               : in out Printer; +        Factor_X, Factor_Y : in     Float); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void set_current(void); +</pre></td> +<td><pre> +procedure Set_Current +       (This : in out Printer); +</pre></td> +  </tr> + +  <tr> +<td><pre> +int start_job(int pagecount, int *frompage=NULL, int *topage=NULL); +</pre></td> +<td><pre> +procedure Start_Job +       (This  : in out Printer; +        Count : in     Natural); + +procedure Start_Job +       (This     : in out Printer; +        Count    : in     Natural; +        From, To : in     Positive); +</pre></td> +  </tr> + +  <tr> +<td><pre> +int start_page(void); +</pre></td> +<td><pre> +procedure Start_Page +       (This : in out Printer); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void translate(int x, int y); +</pre></td> +<td><pre> +procedure Translate +       (This             : in out Printer; +        Delta_X, Delta_Y : in     Integer); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void untranslate(void); +</pre></td> +<td><pre> +procedure Untranslate +       (This : in out Printer); +</pre></td> +  </tr> + +</table> + + +  </body> +</html> + diff --git a/doc/fl_text_display.html b/doc/fl_text_display.html new file mode 100644 index 0000000..723c5fe --- /dev/null +++ b/doc/fl_text_display.html @@ -0,0 +1,822 @@ + +<!DOCTYPE html> + +<html lang="en"> +  <head> +    <meta charset="utf-8"> +    <title>Fl_Text_Display Binding Map</title> +    <link href="map.css" rel="stylesheet"> +  </head> + +  <body> + + +<h2>Fl_Text_Display Binding Map</h2> + + +<table class="package"> +  <tr><th colspan="2">Package name</th></tr> + +  <tr> +    <td>Fl_Text_Display</td> +    <td>FLTK.Widgets.Groups.Text_Displays</td> +  </tr> + +</table> + + + +<table class="type"> +  <tr><th colspan="2">Types</th></tr> + +  <tr> +    <td>Fl_Text_Display</td> +    <td>Text_Display</td> +  </tr> + +  <tr> +    <td> </td> +    <td>Text_Display_Reference</td> +  </tr> + +  <tr> +    <td>enum { NORMAL_CURSOR, CARET_CURSOR, DIM_CURSOR, BLOCK_CURSOR, HEAVY_CURSOR, SIMPLE_CURSOR }</td> +    <td>Cursor_Style</td> +  </tr> + +  <tr> +    <td>enum { CURSOR_POS, CHARACTER_POS }</td> +    <td> </td> +  </tr> + +  <tr> +    <td>enum { DRAG_NONE = -2, DRAG_START_DND = -1, DRAG_CHAR = 0, DRAG_WORD = 1, DRAG_LINE = 2 }</td> +    <td> </td> +  </tr> + +  <tr> +    <td>enum { WRAP_NONE, WRAP_AT_COLUMN, WRAP_AT_PIXEL, WRAP_AT_BOUNDS }</td> +    <td>Wrap_Mode</td> +  </tr> + +  <tr> +    <td>Unfinished_Style_Cb</td> +    <td>Unfinished_Style_Callback</td> +  </tr> + +  <tr> +    <td>Style_Table_Entry</td> +    <td>Style_Entry</td> +  </tr> + +  <tr> +    <td> </td> +    <td>Style_Index</td> +  </tr> + +  <tr> +    <td> </td> +    <td>Style_Array</td> +  </tr> + +</table> + + + +<table class="function"> +  <tr><th colspan="2">Functions and Procedures</th></tr> + +  <tr> +<td><pre> +Fl_Text_Display(int X, int Y, int W, int H, const char *L=0); +</pre></td> +<td><pre> +function Create +       (X, Y, W, H : in Integer; +        Text       : in String) +    return Text_Display; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void buffer(Fl_Text_Buffer *buf); +void buffer(Fl_Text_Buffer &buf); +</pre></td> +<td><pre> +procedure Set_Buffer +       (This : in out Text_Display; +        Buff : in out FLTK.Text_Buffers.Text_Buffer); +</pre></td> +  </tr> + +  <tr> +<td><pre> +Fl_Text_Buffer * buffer() const; +</pre></td> +<td><pre> +function Get_Buffer +       (This : in Text_Display) +    return FLTK.Text_Buffers.Text_Buffer_Reference; +</pre></td> +  </tr> + +  <tr> +<td><pre> +double col_to_x(double col) const; +</pre></td> +<td><pre> +function Col_To_X +       (This    : in Text_Display; +        Col_Num : in Integer) +    return Integer; +</pre></td> +  </tr> + +  <tr> +<td><pre> +int count_lines(int start, int end, bool start_pos_is_line_start) const; +</pre></td> +<td><pre> +function Count_Lines +       (This                    : in Text_Display; +        Start, Finish           : in Natural; +        Start_Pos_Is_Line_Start : in Boolean := False) +    return Natural; +</pre></td> +  </tr> + +  <tr> +<td><pre> +Fl_Color cursor_color() const; +</pre></td> +<td><pre> +function Get_Cursor_Color +       (This : in Text_Display) +    return Color; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void cursor_color(Fl_Color n); +</pre></td> +<td><pre> +procedure Set_Cursor_Color +       (This : in out Text_Display; +        Col  : in     Color); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void cursor_style(int style); +</pre></td> +<td><pre> +procedure Set_Cursor_Style +       (This  : in out Text_Display; +        Style : in     Cursor_Style); +</pre></td> +  </tr> + +  <tr> +<td><pre> +virtual void draw(); +</pre></td> +<td><pre> +procedure Draw +       (This : in out Text_Display); +</pre></td> +  </tr> + +  <tr> +<td><pre> +virtual int handle(int e); +</pre></td> +<td><pre> +function Handle +       (This  : in out Text_Display; +        Event : in     Event_Kind) +    return Event_Outcome; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void hide_cursor(); +</pre></td> +<td><pre> +procedure Hide_Cursor +       (This : in out Text_Display); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void highlight_data +   (Fl_Text_Buffer *styleBuffer, +    const Style_Table_Entry *styleTable, +    int nStyles, +    char unfinishedStyle, +    Unfinished_Style_Cb unfinishedHighlightCB, +    void *cbArg); +</pre></td> +<td><pre> +procedure Highlight_Data +       (This  : in out Text_Display; +        Buff  : in out FLTK.Text_Buffers.Text_Buffer; +        Table : in     Styles.Style_Array); + +procedure Highlight_Data +       (This       : in out Text_Display; +        Buff       : in out FLTK.Text_Buffers.Text_Buffer; +        Table      : in     Styles.Style_Array; +        Unfinished : in     Styles.Style_Index; +        Callback   : in     Styles.Unfinished_Style_Callback); +</pre></td> +  </tr> + +  <tr> +<td><pre> +int in_selection(int x, int y) const; +</pre></td> +<td><pre> +function In_Selection +       (This : in Text_Display; +        X, Y : in Integer) +    return Boolean; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void insert(const char *text); +</pre></td> +<td><pre> +procedure Insert_Text +       (This : in out Text_Display; +        Item : in     String); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void insert_position(int newPos); +</pre></td> +<td><pre> +procedure Set_Insert_Position +       (This : in out Text_Display; +        Pos  : in     Natural); +</pre></td> +  </tr> + +  <tr> +<td><pre> +int insert_position() const; +</pre></td> +<td><pre> +function Get_Insert_Position +       (This : in Text_Display) +    return Natural; +</pre></td> +  </tr> + +  <tr> +<td> </td> +<td><pre> +function Item +       (Tint : in Color; +        Font : in Font_Kind; +        Size : in Font_Size) +    return Style_Entry; +</pre></td> +  </tr> + +  <tr> +<td><pre> +int line_end(int startPos, bool startPosIsLineStart) const; +</pre></td> +<td><pre> +function Line_End +       (This                    : in Text_Display; +        Pos                     : in Natural; +        Start_Pos_Is_Line_Start : in Boolean := False) +    return Natural; +</pre></td> +  </tr> + +  <tr> +<td><pre> +int line_start(int pos) const; +</pre></td> +<td><pre> +function Line_Start +       (This : in Text_Display; +        Pos  : in Natural) +    return Natural; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void linenumber_align(Fl_Align val); +</pre></td> +<td><pre> +procedure Set_Linenumber_Alignment +       (This : in out Text_Display; +        To   : in     Alignment); +</pre></td> +  </tr> + +  <tr> +<td><pre> +Fl_Align linenumber_align() const; +</pre></td> +<td><pre> +function Get_Linenumber_Alignment +       (This : in Text_Display) +    return Alignment; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void linenumber_bgcolor(Fl_Color val); +</pre></td> +<td><pre> +procedure Set_Linenumber_Back_Color +       (This : in out Text_Display; +        To   : in     Color); +</pre></td> +  </tr> + +  <tr> +<td><pre> +Fl_Color linenumber_bgcolor() const; +</pre></td> +<td><pre> +function Get_Linenumber_Back_Color +       (This : in Text_Display) +    return Color; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void linenumber_fgcolor(Fl_Color val); +</pre></td> +<td><pre> +procedure Set_Linenumber_Fore_Color +       (This : in out Text_Display; +        To   : in     Color); +</pre></td> +  </tr> + +  <tr> +<td><pre> +Fl_Color linenumber_fgcolor() const; +</pre></td> +<td><pre> +function Get_Linenumber_Fore_Color +       (This : in Text_Display) +    return Color; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void linenumber_font(Fl_Font val); +</pre></td> +<td><pre> +procedure Set_Linenumber_Font +       (This : in out Text_Display; +        To   : in     Font_Kind); +</pre></td> +  </tr> + +  <tr> +<td><pre> +Fl_Font linenumber_font() const; +</pre></td> +<td><pre> +function Get_Linenumber_Font +       (This : in Text_Display) +    return Font_Kind; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void linenumber_format(const char *val); +</pre></td> +<td> </td> +  </tr> + +  <tr> +<td><pre> +const char * linenumber_format() const; +</pre></td> +<td> </td> +  </tr> + +  <tr> +<td><pre> +void linenumber_size(Fl_Fontsize val); +</pre></td> +<td><pre> +procedure Set_Linenumber_Size +       (This : in out Text_Display; +        To   : in     Font_Size); +</pre></td> +  </tr> + +  <tr> +<td><pre> +Fl_Fontsize linenumber_size() const; +</pre></td> +<td><pre> +function Get_Linenumber_Size +       (This : in Text_Display) +    return Font_Size; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void linenumber_width(int width); +</pre></td> +<td><pre> +procedure Set_Linenumber_Width +       (This  : in out Text_Display; +        Width : in     Natural); +</pre></td> +  </tr> + +  <tr> +<td><pre> +int linenumber_width() const; +</pre></td> +<td><pre> +function Get_Linenumber_Width +       (This : in Text_Display) +    return Natural; +</pre></td> +  </tr> + +  <tr> +<td><pre> +int move_down(); +</pre></td> +<td><pre> +procedure Move_Down +       (This : in out Text_Display); +</pre></td> +  </tr> + +  <tr> +<td><pre> +int move_left(); +</pre></td> +<td><pre> +procedure Move_Left +       (This : in out Text_Display); +</pre></td> +  </tr> + +  <tr> +<td><pre> +int move_right(); +</pre></td> +<td><pre> +procedure Move_Right +       (This : in out Text_Display); +</pre></td> +  </tr> + +  <tr> +<td><pre> +int move_up(); +</pre></td> +<td><pre> +procedure Move_Up +       (This : in out Text_Display); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void next_word(void); +</pre></td> +<td><pre> +procedure Next_Word +       (This : in out Text_Display); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void overstrike(const char *text); +</pre></td> +<td><pre> +procedure Overstrike +       (This : in out Text_Display; +        Text : in     String); +</pre></td> +  </tr> + +  <tr> +<td><pre> +int position_style(int lineStartPos, int lineLen, int lineIndex) const; +</pre></td> +<td> </td> +  </tr> + +  <tr> +<td><pre> +int position_to_xy(int pos, int *x, int *y) const; +</pre></td> +<td><pre> +procedure Position_To_XY +       (This     : in     Text_Display; +        Pos      : in     Integer; +        X, Y     :    out Integer; +        Vert_Out :    out Boolean); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void previous_word(void); +</pre></td> +<td><pre> +procedure Previous_Word +       (This : in out Text_Display); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void redisplay_range(int start, int end); +</pre></td> +<td><pre> +procedure Redisplay_Range +       (This          : in out Text_Display; +        Start, Finish : in     Natural); +</pre></td> +  </tr> + +  <tr> +<td><pre> +virtual void resize(int X, int Y, int W, int H); +</pre></td> +<td> </td> +  </tr> + +  <tr> +<td><pre> +int rewind_lines(int startPos, int nLines); +</pre></td> +<td><pre> +function Rewind_Lines +       (This         : in Text_Display; +        Start, Lines : in Natural) +    return Natural; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void scroll(int topLineNum, int horizOffset); +</pre></td> +<td><pre> +procedure Scroll_To +       (This : in out Text_Display; +        Line : in     Natural); +</pre></td> +  </tr> + +  <tr> +<td><pre> +Fl_Align scrollbar_align() const; +</pre></td> +<td><pre> +function Get_Scrollbar_Alignment +       (This : in Text_Display) +    return Alignment; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void scrollbar_align(Fl_Align a); +</pre></td> +<td><pre> +procedure Set_Scrollbar_Alignment +       (This  : in out Text_Display; +        Align : in     Alignment); +</pre></td> +  </tr> + +  <tr> +<td><pre> +int scrollbar_width() const; +</pre></td> +<td><pre> +function Get_Scrollbar_Width +       (This : in Text_Display) +    return Natural; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void scrollbar_width(int W); +</pre></td> +<td><pre> +procedure Set_Scrollbar_Width +       (This  : in out Text_Display; +        Width : in     Natural); +</pre></td> +  </tr> + +  <tr> +<td><pre> +int shortcut() const; +</pre></td> +<td> </td> +  </tr> + +  <tr> +<td><pre> +void shortcut(int s); +</pre></td> +<td> </td> +  </tr> + +  <tr> +<td><pre> +void show_cursor(int b=1); +</pre></td> +<td><pre> +procedure Show_Cursor +       (This : in out Text_Display); +</pre></td> +  </tr> + +  <tr> +<td><pre> +void show_insert_position(); +</pre></td> +<td><pre> +procedure Show_Insert_Position +       (This : in out Text_Display); +</pre></td> +  </tr> + +  <tr> +<td><pre> +int skip_lines(int startPos, int nLines, bool startPosIsLineStart); +</pre></td> +<td><pre> +function Skip_Lines +       (This                    : in Text_Display; +        Start, Lines            : in Natural; +        Start_Pos_Is_Line_Start : in Boolean := False) +    return Natural; +</pre></td> +  </tr> + +  <tr> +<td><pre> +Fl_Color textcolor() const; +</pre></td> +<td><pre> +function Get_Text_Color +       (This : in Text_Display) +    return Color; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void textcolor(Fl_Color n); +</pre></td> +<td><pre> +procedure Set_Text_Color +       (This : in out Text_Display; +        Col  : in     Color); +</pre></td> +  </tr> + +  <tr> +<td><pre> +Fl_Font textfont() const; +</pre></td> +<td><pre> +function Get_Text_Font +       (This : in Text_Display) +    return Font_Kind; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void textfont(Fl_Font s); +</pre></td> +<td><pre> +procedure Set_Text_Font +       (This : in out Text_Display; +        Font : in     Font_Kind); +</pre></td> +  </tr> + +  <tr> +<td><pre> +Fl_Fontsize textsize() const; +</pre></td> +<td><pre> +function Get_Text_Size +       (This : in Text_Display) +    return Font_Size; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void textsize(Fl_Fontsize s); +</pre></td> +<td><pre> +procedure Set_Text_Size +       (This : in out Text_Display; +        Size : in     Font_Size); +</pre></td> +  </tr> + +  <tr> +<td><pre> +int word_end(int pos) const; +</pre></td> +<td><pre> +function Word_End +       (This : in out Text_Display; +        Pos  : in     Natural) +    return Natural; +</pre></td> +  </tr> + +  <tr> +<td><pre> +int word_start(int pos) const; +</pre></td> +<td><pre> +function Word_Start +       (This : in out Text_Display; +        Pos  : in     Natural) +    return Natural; +</pre></td> +  </tr> + +  <tr> +<td><pre> +void wrap_mode(int wrap, int wrap_margin); +</pre></td> +<td><pre> +procedure Set_Wrap_Mode +       (This   : in out Text_Display; +        Mode   : in     Wrap_Mode; +        Margin : in     Natural := 0); +</pre></td> +  </tr> + +  <tr> +<td><pre> +int wrapped_column(int row, int column) const; +</pre></td> +<td> </td> +  </tr> + +  <tr> +<td><pre> +int wrapped_row(int row) const; +</pre></td> +<td> </td> +  </tr> + +  <tr> +<td><pre> +double x_to_col(double x) const; +</pre></td> +<td><pre> +function X_To_Col +       (This  : in Text_Display; +        X_Pos : in Integer) +    return Integer; +</pre></td> +  </tr> + +</table> + + +  </body> +</html> + diff --git a/progress.txt b/progress.txt index c1dd896..558d332 100644 --- a/progress.txt +++ b/progress.txt @@ -16,6 +16,7 @@ FLTK.Devices  FLTK.Devices.Surfaces.Copy  FLTK.Devices.Surfaces.Image  FLTK.Devices.Surfaces.Paged +FLTK.Devices.Surfaces.Paged.Printers  FLTK.Dialogs  FLTK.Images  FLTK.Images.Bitmaps @@ -42,10 +43,13 @@ FLTK.Widgets.Charts  FLTK.Widgets.Clocks  FLTK.Widgets.Clocks.Updated  FLTK.Widgets.Clocks.Updated.Round +FLTK.Widgets.Groups.Color_Choosers +FLTK.Widgets.Groups.Input_Choices  FLTK.Widgets.Groups.Packed  FLTK.Widgets.Groups.Scrolls  FLTK.Widgets.Groups.Spinners  FLTK.Widgets.Groups.Tabbed +FLTK.Widgets.Groups.Text_Displays  FLTK.Widgets.Groups.Tiled  FLTK.Widgets.Groups.Windows  FLTK.Widgets.Groups.Windows.Double @@ -86,11 +90,8 @@ FLTK.Widgets.Valuators.Sliders.Horizontal  Done: -FLTK.Devices.Surfaces.Paged.Printers  FLTK.Event  FLTK.Screen -FLTK.Widgets.Groups.Color_Choosers -FLTK.Widgets.Groups.Input_Choices  FLTK.Widgets.Groups.Text_Displays.Text_Editors @@ -106,7 +107,6 @@ FLTK.Menu_Items  FLTK.Text_Buffers  FLTK.Widgets  FLTK.Widgets.Groups -FLTK.Widgets.Groups.Text_Displays (94%)  FLTK.Widgets.Menus diff --git a/src/c_fl_color_chooser.cpp b/src/c_fl_color_chooser.cpp index fa34171..86e1014 100644 --- a/src/c_fl_color_chooser.cpp +++ b/src/c_fl_color_chooser.cpp @@ -71,49 +71,60 @@ void free_fl_color_chooser(COLOR_CHOOSER n) {  double fl_color_chooser_r(COLOR_CHOOSER n) { -    return reinterpret_cast<My_Color_Chooser*>(n)->r(); +    return reinterpret_cast<Fl_Color_Chooser*>(n)->r();  }  double fl_color_chooser_g(COLOR_CHOOSER n) { -    return reinterpret_cast<My_Color_Chooser*>(n)->g(); +    return reinterpret_cast<Fl_Color_Chooser*>(n)->g();  }  double fl_color_chooser_b(COLOR_CHOOSER n) { -    return reinterpret_cast<My_Color_Chooser*>(n)->b(); +    return reinterpret_cast<Fl_Color_Chooser*>(n)->b();  }  int fl_color_chooser_rgb(COLOR_CHOOSER n, int r, int g, int b) { -    return reinterpret_cast<My_Color_Chooser*>(n)->rgb(r,g,b); +    return reinterpret_cast<Fl_Color_Chooser*>(n)->rgb(r,g,b);  }  double fl_color_chooser_hue(COLOR_CHOOSER n) { -    return reinterpret_cast<My_Color_Chooser*>(n)->hue(); +    return reinterpret_cast<Fl_Color_Chooser*>(n)->hue();  }  double fl_color_chooser_saturation(COLOR_CHOOSER n) { -    return reinterpret_cast<My_Color_Chooser*>(n)->saturation(); +    return reinterpret_cast<Fl_Color_Chooser*>(n)->saturation();  }  double fl_color_chooser_value(COLOR_CHOOSER n) { -    return reinterpret_cast<My_Color_Chooser*>(n)->value(); +    return reinterpret_cast<Fl_Color_Chooser*>(n)->value();  }  int fl_color_chooser_hsv(COLOR_CHOOSER n, int h, int s, int v) { -    return reinterpret_cast<My_Color_Chooser*>(n)->hsv(h,s,v); +    return reinterpret_cast<Fl_Color_Chooser*>(n)->hsv(h,s,v); +} + + + + +void fl_color_chooser_hsv2rgb(double h, double s, double v, double &r, double &g, double &b) { +    Fl_Color_Chooser::hsv2rgb(h,s,v,r,g,b); +} + +void fl_color_chooser_rgb2hsv(double r, double g, double b, double &h, double &s, double &v) { +    Fl_Color_Chooser::rgb2hsv(r,g,b,h,s,v);  }  int fl_color_chooser_get_mode(COLOR_CHOOSER n) { -    return reinterpret_cast<My_Color_Chooser*>(n)->mode(); +    return reinterpret_cast<Fl_Color_Chooser*>(n)->mode();  }  void fl_color_chooser_set_mode(COLOR_CHOOSER n, int m) { -    reinterpret_cast<My_Color_Chooser*>(n)->mode(m); +    reinterpret_cast<Fl_Color_Chooser*>(n)->mode(m);  } diff --git a/src/c_fl_color_chooser.h b/src/c_fl_color_chooser.h index 2948285..f545002 100644 --- a/src/c_fl_color_chooser.h +++ b/src/c_fl_color_chooser.h @@ -11,34 +11,38 @@ typedef void* COLOR_CHOOSER; -extern "C" void color_chooser_set_draw_hook(COLOR_CHOOSER n, void * d); -extern "C" void fl_color_chooser_draw(COLOR_CHOOSER n); -extern "C" void color_chooser_set_handle_hook(COLOR_CHOOSER n, void * h); -extern "C" int fl_color_chooser_handle(COLOR_CHOOSER n, int e); +extern "C" inline void color_chooser_set_draw_hook(COLOR_CHOOSER n, void * d); +extern "C" inline void fl_color_chooser_draw(COLOR_CHOOSER n); +extern "C" inline void color_chooser_set_handle_hook(COLOR_CHOOSER n, void * h); +extern "C" inline int fl_color_chooser_handle(COLOR_CHOOSER n, int e); -extern "C" COLOR_CHOOSER new_fl_color_chooser(int x, int y, int w, int h, char* label); -extern "C" void free_fl_color_chooser(COLOR_CHOOSER n); +extern "C" inline COLOR_CHOOSER new_fl_color_chooser(int x, int y, int w, int h, char* label); +extern "C" inline void free_fl_color_chooser(COLOR_CHOOSER n); -extern "C" double fl_color_chooser_r(COLOR_CHOOSER n); -extern "C" double fl_color_chooser_g(COLOR_CHOOSER n); -extern "C" double fl_color_chooser_b(COLOR_CHOOSER n); -extern "C" int fl_color_chooser_rgb(COLOR_CHOOSER n, int r, int g, int b); +extern "C" inline double fl_color_chooser_r(COLOR_CHOOSER n); +extern "C" inline double fl_color_chooser_g(COLOR_CHOOSER n); +extern "C" inline double fl_color_chooser_b(COLOR_CHOOSER n); +extern "C" inline int fl_color_chooser_rgb(COLOR_CHOOSER n, int r, int g, int b); -extern "C" double fl_color_chooser_hue(COLOR_CHOOSER n); -extern "C" double fl_color_chooser_saturation(COLOR_CHOOSER n); -extern "C" double fl_color_chooser_value(COLOR_CHOOSER n); -extern "C" int fl_color_chooser_hsv(COLOR_CHOOSER n, int h, int s, int v); +extern "C" inline double fl_color_chooser_hue(COLOR_CHOOSER n); +extern "C" inline double fl_color_chooser_saturation(COLOR_CHOOSER n); +extern "C" inline double fl_color_chooser_value(COLOR_CHOOSER n); +extern "C" inline int fl_color_chooser_hsv(COLOR_CHOOSER n, int h, int s, int v); -extern "C" int fl_color_chooser_get_mode(COLOR_CHOOSER n); -extern "C" void fl_color_chooser_set_mode(COLOR_CHOOSER n, int m); +extern "C" inline void fl_color_chooser_hsv2rgb(double h, double s, double v, double &r, double &g, double &b); +extern "C" inline void fl_color_chooser_rgb2hsv(double r, double g, double b, double &h, double &s, double &v); + + +extern "C" inline int fl_color_chooser_get_mode(COLOR_CHOOSER n); +extern "C" inline void fl_color_chooser_set_mode(COLOR_CHOOSER n, int m);  #endif diff --git a/src/c_fl_input_choice.cpp b/src/c_fl_input_choice.cpp index a56d836..a48a4bc 100644 --- a/src/c_fl_input_choice.cpp +++ b/src/c_fl_input_choice.cpp @@ -71,66 +71,77 @@ void free_fl_input_choice(INPUT_CHOICE n) {  void * fl_input_choice_input(INPUT_CHOICE n) { -    return reinterpret_cast<My_Input_Choice*>(n)->input(); +    return reinterpret_cast<Fl_Input_Choice*>(n)->input();  }  void * fl_input_choice_menubutton(INPUT_CHOICE n) { -    return reinterpret_cast<My_Input_Choice*>(n)->menubutton(); +    return reinterpret_cast<Fl_Input_Choice*>(n)->menubutton(); +} + + + + +void fl_input_choice_clear(INPUT_CHOICE n) { +    reinterpret_cast<Fl_Input_Choice*>(n)->clear();  }  int fl_input_choice_changed(INPUT_CHOICE n) { -    return reinterpret_cast<My_Input_Choice*>(n)->changed(); +    return reinterpret_cast<Fl_Input_Choice*>(n)->changed();  }  void fl_input_choice_clear_changed(INPUT_CHOICE n) { -    reinterpret_cast<My_Input_Choice*>(n)->clear_changed(); +    reinterpret_cast<Fl_Input_Choice*>(n)->clear_changed(); +} + +void fl_input_choice_set_changed(INPUT_CHOICE n) { +    reinterpret_cast<Fl_Input_Choice*>(n)->set_changed();  }  int fl_input_choice_get_down_box(INPUT_CHOICE n) { -    return reinterpret_cast<My_Input_Choice*>(n)->down_box(); +    return reinterpret_cast<Fl_Input_Choice*>(n)->down_box();  }  void fl_input_choice_set_down_box(INPUT_CHOICE n, int t) { -    reinterpret_cast<My_Input_Choice*>(n)->down_box(static_cast<Fl_Boxtype>(t)); +    reinterpret_cast<Fl_Input_Choice*>(n)->down_box(static_cast<Fl_Boxtype>(t));  }  unsigned int fl_input_choice_get_textcolor(INPUT_CHOICE n) { -    return reinterpret_cast<My_Input_Choice*>(n)->textcolor(); +    return reinterpret_cast<Fl_Input_Choice*>(n)->textcolor();  }  void fl_input_choice_set_textcolor(INPUT_CHOICE n, unsigned int t) { -    reinterpret_cast<My_Input_Choice*>(n)->textcolor(t); +    reinterpret_cast<Fl_Input_Choice*>(n)->textcolor(t);  }  int fl_input_choice_get_textfont(INPUT_CHOICE n) { -    return reinterpret_cast<My_Input_Choice*>(n)->textfont(); +    return reinterpret_cast<Fl_Input_Choice*>(n)->textfont();  }  void fl_input_choice_set_textfont(INPUT_CHOICE n, int t) { -    reinterpret_cast<My_Input_Choice*>(n)->textfont(t); +    reinterpret_cast<Fl_Input_Choice*>(n)->textfont(t);  }  int fl_input_choice_get_textsize(INPUT_CHOICE n) { -    return reinterpret_cast<My_Input_Choice*>(n)->textsize(); +    return reinterpret_cast<Fl_Input_Choice*>(n)->textsize();  }  void fl_input_choice_set_textsize(INPUT_CHOICE n, int t) { -    reinterpret_cast<My_Input_Choice*>(n)->textsize(t); +    reinterpret_cast<Fl_Input_Choice*>(n)->textsize(t);  }  const char * fl_input_choice_get_value(INPUT_CHOICE n) { -    return reinterpret_cast<My_Input_Choice*>(n)->value(); +    return reinterpret_cast<Fl_Input_Choice*>(n)->value();  }  void fl_input_choice_set_value(INPUT_CHOICE n, const char * t) { -    reinterpret_cast<My_Input_Choice*>(n)->value(t); +    reinterpret_cast<Fl_Input_Choice*>(n)->value(t);  }  void fl_input_choice_set_value2(INPUT_CHOICE n, int t) { -    reinterpret_cast<My_Input_Choice*>(n)->value(t); +    reinterpret_cast<Fl_Input_Choice*>(n)->value(t);  } diff --git a/src/c_fl_input_choice.h b/src/c_fl_input_choice.h index 8ad700b..2535b93 100644 --- a/src/c_fl_input_choice.h +++ b/src/c_fl_input_choice.h @@ -11,37 +11,41 @@ typedef void* INPUT_CHOICE; -extern "C" void input_choice_set_draw_hook(INPUT_CHOICE n, void * d); -extern "C" void fl_input_choice_draw(INPUT_CHOICE n); -extern "C" void input_choice_set_handle_hook(INPUT_CHOICE n, void * h); -extern "C" int fl_input_choice_handle(INPUT_CHOICE n, int e); +extern "C" inline void input_choice_set_draw_hook(INPUT_CHOICE n, void * d); +extern "C" inline void fl_input_choice_draw(INPUT_CHOICE n); +extern "C" inline void input_choice_set_handle_hook(INPUT_CHOICE n, void * h); +extern "C" inline int fl_input_choice_handle(INPUT_CHOICE n, int e); -extern "C" INPUT_CHOICE new_fl_input_choice(int x, int y, int w, int h, char* label); -extern "C" void free_fl_input_choice(INPUT_CHOICE n); +extern "C" inline INPUT_CHOICE new_fl_input_choice(int x, int y, int w, int h, char* label); +extern "C" inline void free_fl_input_choice(INPUT_CHOICE n); -extern "C" void * fl_input_choice_input(INPUT_CHOICE n); -extern "C" void * fl_input_choice_menubutton(INPUT_CHOICE n); +extern "C" inline void * fl_input_choice_input(INPUT_CHOICE n); +extern "C" inline void * fl_input_choice_menubutton(INPUT_CHOICE n); -extern "C" int fl_input_choice_changed(INPUT_CHOICE n); -extern "C" void fl_input_choice_clear_changed(INPUT_CHOICE n); -extern "C" int fl_input_choice_get_down_box(INPUT_CHOICE n); -extern "C" void fl_input_choice_set_down_box(INPUT_CHOICE n, int t); -extern "C" unsigned int fl_input_choice_get_textcolor(INPUT_CHOICE n); -extern "C" void fl_input_choice_set_textcolor(INPUT_CHOICE n, unsigned int t); -extern "C" int fl_input_choice_get_textfont(INPUT_CHOICE n); -extern "C" void fl_input_choice_set_textfont(INPUT_CHOICE n, int t); -extern "C" int fl_input_choice_get_textsize(INPUT_CHOICE n); -extern "C" void fl_input_choice_set_textsize(INPUT_CHOICE n, int t); -extern "C" const char * fl_input_choice_get_value(INPUT_CHOICE n); -extern "C" void fl_input_choice_set_value(INPUT_CHOICE n, const char * t); -extern "C" void fl_input_choice_set_value2(INPUT_CHOICE n, int t); +extern "C" inline void fl_input_choice_clear(INPUT_CHOICE n); + + +extern "C" inline int fl_input_choice_changed(INPUT_CHOICE n); +extern "C" inline void fl_input_choice_clear_changed(INPUT_CHOICE n); +extern "C" inline void fl_input_choice_set_changed(INPUT_CHOICE n); +extern "C" inline int fl_input_choice_get_down_box(INPUT_CHOICE n); +extern "C" inline void fl_input_choice_set_down_box(INPUT_CHOICE n, int t); +extern "C" inline unsigned int fl_input_choice_get_textcolor(INPUT_CHOICE n); +extern "C" inline void fl_input_choice_set_textcolor(INPUT_CHOICE n, unsigned int t); +extern "C" inline int fl_input_choice_get_textfont(INPUT_CHOICE n); +extern "C" inline void fl_input_choice_set_textfont(INPUT_CHOICE n, int t); +extern "C" inline int fl_input_choice_get_textsize(INPUT_CHOICE n); +extern "C" inline void fl_input_choice_set_textsize(INPUT_CHOICE n, int t); +extern "C" inline const char * fl_input_choice_get_value(INPUT_CHOICE n); +extern "C" inline void fl_input_choice_set_value(INPUT_CHOICE n, const char * t); +extern "C" inline void fl_input_choice_set_value2(INPUT_CHOICE n, int t);  #endif diff --git a/src/c_fl_printer.h b/src/c_fl_printer.h index 0ae2499..74abc84 100644 --- a/src/c_fl_printer.h +++ b/src/c_fl_printer.h @@ -11,34 +11,34 @@ typedef void* PRINTER; -extern "C" PRINTER new_fl_printer(void); -extern "C" void free_fl_printer(PRINTER p); +extern "C" inline PRINTER new_fl_printer(void); +extern "C" inline void free_fl_printer(PRINTER p); -extern "C" int fl_printer_start_job(PRINTER p, int c); -extern "C" int fl_printer_start_job2(PRINTER p, int c, int f, int t); -extern "C" void fl_printer_end_job(PRINTER p); -extern "C" int fl_printer_start_page(PRINTER p); -extern "C" int fl_printer_end_page(PRINTER p); +extern "C" inline int fl_printer_start_job(PRINTER p, int c); +extern "C" inline int fl_printer_start_job2(PRINTER p, int c, int f, int t); +extern "C" inline void fl_printer_end_job(PRINTER p); +extern "C" inline int fl_printer_start_page(PRINTER p); +extern "C" inline int fl_printer_end_page(PRINTER p); -extern "C" void fl_printer_margins(PRINTER p, int * l, int * t, int * r, int * b); -extern "C" int fl_printer_printable_rect(PRINTER p, int * w, int * h); -extern "C" void fl_printer_get_origin(PRINTER p, int * x, int * y); -extern "C" void fl_printer_set_origin(PRINTER p, int x, int y); -extern "C" void fl_printer_rotate(PRINTER p, float r); -extern "C" void fl_printer_scale(PRINTER p, float x, float y); -extern "C" void fl_printer_translate(PRINTER p, int x, int y); -extern "C" void fl_printer_untranslate(PRINTER p); +extern "C" inline void fl_printer_margins(PRINTER p, int * l, int * t, int * r, int * b); +extern "C" inline int fl_printer_printable_rect(PRINTER p, int * w, int * h); +extern "C" inline void fl_printer_get_origin(PRINTER p, int * x, int * y); +extern "C" inline void fl_printer_set_origin(PRINTER p, int x, int y); +extern "C" inline void fl_printer_rotate(PRINTER p, float r); +extern "C" inline void fl_printer_scale(PRINTER p, float x, float y); +extern "C" inline void fl_printer_translate(PRINTER p, int x, int y); +extern "C" inline void fl_printer_untranslate(PRINTER p); -extern "C" void fl_printer_print_widget(PRINTER p, void * i, int dx, int dy); -extern "C" void fl_printer_print_window_part(PRINTER p, void * i, int x, int y, int w, int h, int dx, int dy); +extern "C" inline void fl_printer_print_widget(PRINTER p, void * i, int dx, int dy); +extern "C" inline void fl_printer_print_window_part(PRINTER p, void * i, int x, int y, int w, int h, int dx, int dy); -extern "C" void fl_printer_set_current(PRINTER p); +extern "C" inline void fl_printer_set_current(PRINTER p);  #endif diff --git a/src/c_fl_text_display.cpp b/src/c_fl_text_display.cpp index 9cc087e..b56f368 100644 --- a/src/c_fl_text_display.cpp +++ b/src/c_fl_text_display.cpp @@ -85,6 +85,20 @@ void fl_text_display_set_buffer(TEXTDISPLAY td, TEXTBUFFER tb) { +void fl_text_display_highlight_data(TEXTDISPLAY td, TEXTBUFFER tb, void * st, int len) { +    reinterpret_cast<Fl_Text_Display*>(td)->highlight_data +        (reinterpret_cast<Fl_Text_Buffer*>(tb), reinterpret_cast<Fl_Text_Display::Style_Table_Entry*>(st), len, 0, 0, 0); +} + +void fl_text_display_highlight_data2(TEXTDISPLAY td, TEXTBUFFER tb, void * st, int len, char us, void * cb, void * a) { +    reinterpret_cast<Fl_Text_Display*>(td)->highlight_data +       (reinterpret_cast<Fl_Text_Buffer*>(tb), reinterpret_cast<Fl_Text_Display::Style_Table_Entry*>(st), len, +        us, reinterpret_cast<Fl_Text_Display::Unfinished_Style_Cb>(cb), a); +} + + + +  double fl_text_display_col_to_x(TEXTDISPLAY td, double c) {      return reinterpret_cast<Fl_Text_Display*>(td)->col_to_x(c);  } @@ -158,6 +172,10 @@ void fl_text_display_insert(TEXTDISPLAY td, char * i) {      reinterpret_cast<Fl_Text_Display*>(td)->insert(i);  } +void fl_text_display_overstrike(TEXTDISPLAY td, char * t) { +    reinterpret_cast<Fl_Text_Display*>(td)->overstrike(t); +} +  int fl_text_display_get_insert_pos(TEXTDISPLAY td) {      return reinterpret_cast<Fl_Text_Display*>(td)->insert_position();  } @@ -309,3 +327,11 @@ void fl_text_display_set_scrollbar_width(TEXTDISPLAY td, int w) {      reinterpret_cast<Fl_Text_Display*>(td)->scrollbar_width(w);  } + + + +void fl_text_display_redisplay_range(TEXTDISPLAY td, int s, int f) { +    reinterpret_cast<Fl_Text_Display*>(td)->redisplay_range(s,f); +} + + diff --git a/src/c_fl_text_display.h b/src/c_fl_text_display.h index 3b7e7e3..5d4574b 100644 --- a/src/c_fl_text_display.h +++ b/src/c_fl_text_display.h @@ -13,90 +13,98 @@ typedef void* TEXTDISPLAY; -extern "C" void text_display_set_draw_hook(TEXTDISPLAY td, void * d); -extern "C" void fl_text_display_draw(TEXTDISPLAY td); -extern "C" void text_display_set_handle_hook(TEXTDISPLAY td, void * h); -extern "C" int fl_text_display_handle(TEXTDISPLAY td, int e); +extern "C" inline void text_display_set_draw_hook(TEXTDISPLAY td, void * d); +extern "C" inline void fl_text_display_draw(TEXTDISPLAY td); +extern "C" inline void text_display_set_handle_hook(TEXTDISPLAY td, void * h); +extern "C" inline int fl_text_display_handle(TEXTDISPLAY td, int e); -extern "C" TEXTDISPLAY new_fl_text_display(int x, int y, int w, int h, char* label); -extern "C" void free_fl_text_display(TEXTDISPLAY td); +extern "C" inline TEXTDISPLAY new_fl_text_display(int x, int y, int w, int h, char* label); +extern "C" inline void free_fl_text_display(TEXTDISPLAY td); -extern "C" TEXTBUFFER fl_text_display_get_buffer(TEXTDISPLAY td); -extern "C" void fl_text_display_set_buffer(TEXTDISPLAY td, TEXTBUFFER tb); +extern "C" inline TEXTBUFFER fl_text_display_get_buffer(TEXTDISPLAY td); +extern "C" inline void fl_text_display_set_buffer(TEXTDISPLAY td, TEXTBUFFER tb); -extern "C" double fl_text_display_col_to_x(TEXTDISPLAY td, double c); -extern "C" double fl_text_display_x_to_col(TEXTDISPLAY td, double x); -extern "C" int fl_text_display_in_selection(TEXTDISPLAY td, int x, int y); -extern "C" int fl_text_display_position_to_xy(TEXTDISPLAY td, int p, int * x, int * y); +extern "C" inline void fl_text_display_highlight_data(TEXTDISPLAY td, TEXTBUFFER tb, void * st, int len); +extern "C" inline void fl_text_display_highlight_data2(TEXTDISPLAY td, TEXTBUFFER tb, void * st, int len, char us, void * cb, void * a); -extern "C" unsigned int fl_text_display_get_cursor_color(TEXTDISPLAY td); -extern "C" void fl_text_display_set_cursor_color(TEXTDISPLAY td, unsigned int c); -extern "C" void fl_text_display_set_cursor_style(TEXTDISPLAY td, int s); -extern "C" void fl_text_display_hide_cursor(TEXTDISPLAY td); -extern "C" void fl_text_display_show_cursor(TEXTDISPLAY td); +extern "C" inline double fl_text_display_col_to_x(TEXTDISPLAY td, double c); +extern "C" inline double fl_text_display_x_to_col(TEXTDISPLAY td, double x); +extern "C" inline int fl_text_display_in_selection(TEXTDISPLAY td, int x, int y); +extern "C" inline int fl_text_display_position_to_xy(TEXTDISPLAY td, int p, int * x, int * y); -extern "C" unsigned int fl_text_display_get_text_color(TEXTDISPLAY td); -extern "C" void fl_text_display_set_text_color(TEXTDISPLAY td, unsigned int c); -extern "C" int fl_text_display_get_text_font(TEXTDISPLAY td); -extern "C" void fl_text_display_set_text_font(TEXTDISPLAY td, int f); -extern "C" int fl_text_display_get_text_size(TEXTDISPLAY td); -extern "C" void fl_text_display_set_text_size(TEXTDISPLAY td, int s); +extern "C" inline unsigned int fl_text_display_get_cursor_color(TEXTDISPLAY td); +extern "C" inline void fl_text_display_set_cursor_color(TEXTDISPLAY td, unsigned int c); +extern "C" inline void fl_text_display_set_cursor_style(TEXTDISPLAY td, int s); +extern "C" inline void fl_text_display_hide_cursor(TEXTDISPLAY td); +extern "C" inline void fl_text_display_show_cursor(TEXTDISPLAY td); -extern "C" void fl_text_display_insert(TEXTDISPLAY td, char * i); -extern "C" int fl_text_display_get_insert_pos(TEXTDISPLAY td); -extern "C" void fl_text_display_set_insert_pos(TEXTDISPLAY td, int p); -extern "C" void fl_text_display_show_insert_pos(TEXTDISPLAY td); +extern "C" inline unsigned int fl_text_display_get_text_color(TEXTDISPLAY td); +extern "C" inline void fl_text_display_set_text_color(TEXTDISPLAY td, unsigned int c); +extern "C" inline int fl_text_display_get_text_font(TEXTDISPLAY td); +extern "C" inline void fl_text_display_set_text_font(TEXTDISPLAY td, int f); +extern "C" inline int fl_text_display_get_text_size(TEXTDISPLAY td); +extern "C" inline void fl_text_display_set_text_size(TEXTDISPLAY td, int s); -extern "C" int fl_text_display_word_start(TEXTDISPLAY td, int p); -extern "C" int fl_text_display_word_end(TEXTDISPLAY td, int p); -extern "C" void fl_text_display_next_word(TEXTDISPLAY td); -extern "C" void fl_text_display_previous_word(TEXTDISPLAY td); -extern "C" void fl_text_display_wrap_mode(TEXTDISPLAY td, int w, int m); +extern "C" inline void fl_text_display_insert(TEXTDISPLAY td, char * i); +extern "C" inline void fl_text_display_overstrike(TEXTDISPLAY td, char * t); +extern "C" inline int fl_text_display_get_insert_pos(TEXTDISPLAY td); +extern "C" inline void fl_text_display_set_insert_pos(TEXTDISPLAY td, int p); +extern "C" inline void fl_text_display_show_insert_pos(TEXTDISPLAY td); -extern "C" int fl_text_display_line_start(TEXTDISPLAY td, int s); -extern "C" int fl_text_display_line_end(TEXTDISPLAY td, int s, int p); -extern "C" int fl_text_display_count_lines(TEXTDISPLAY td, int s, int f, int p); -extern "C" int fl_text_display_skip_lines(TEXTDISPLAY td, int s, int l, int p); -extern "C" int fl_text_display_rewind_lines(TEXTDISPLAY td, int s, int l); +extern "C" inline int fl_text_display_word_start(TEXTDISPLAY td, int p); +extern "C" inline int fl_text_display_word_end(TEXTDISPLAY td, int p); +extern "C" inline void fl_text_display_next_word(TEXTDISPLAY td); +extern "C" inline void fl_text_display_previous_word(TEXTDISPLAY td); +extern "C" inline void fl_text_display_wrap_mode(TEXTDISPLAY td, int w, int m); -extern "C" unsigned int fl_text_display_get_linenumber_align(TEXTDISPLAY td); -extern "C" void fl_text_display_set_linenumber_align(TEXTDISPLAY td, unsigned int a); -extern "C" unsigned int fl_text_display_get_linenumber_bgcolor(TEXTDISPLAY td); -extern "C" void fl_text_display_set_linenumber_bgcolor(TEXTDISPLAY td, unsigned int c); -extern "C" unsigned int fl_text_display_get_linenumber_fgcolor(TEXTDISPLAY td); -extern "C" void fl_text_display_set_linenumber_fgcolor(TEXTDISPLAY td, unsigned int c); -extern "C" int fl_text_display_get_linenumber_font(TEXTDISPLAY td); -extern "C" void fl_text_display_set_linenumber_font(TEXTDISPLAY td, int f); -extern "C" int fl_text_display_get_linenumber_size(TEXTDISPLAY td); -extern "C" void fl_text_display_set_linenumber_size(TEXTDISPLAY td, int s); -extern "C" int fl_text_display_get_linenumber_width(TEXTDISPLAY td); -extern "C" void fl_text_display_set_linenumber_width(TEXTDISPLAY td, int w); +extern "C" inline int fl_text_display_line_start(TEXTDISPLAY td, int s); +extern "C" inline int fl_text_display_line_end(TEXTDISPLAY td, int s, int p); +extern "C" inline int fl_text_display_count_lines(TEXTDISPLAY td, int s, int f, int p); +extern "C" inline int fl_text_display_skip_lines(TEXTDISPLAY td, int s, int l, int p); +extern "C" inline int fl_text_display_rewind_lines(TEXTDISPLAY td, int s, int l); -extern "C" int fl_text_display_move_down(TEXTDISPLAY td); -extern "C" int fl_text_display_move_left(TEXTDISPLAY td); -extern "C" int fl_text_display_move_right(TEXTDISPLAY td); -extern "C" int fl_text_display_move_up(TEXTDISPLAY td); +extern "C" inline unsigned int fl_text_display_get_linenumber_align(TEXTDISPLAY td); +extern "C" inline void fl_text_display_set_linenumber_align(TEXTDISPLAY td, unsigned int a); +extern "C" inline unsigned int fl_text_display_get_linenumber_bgcolor(TEXTDISPLAY td); +extern "C" inline void fl_text_display_set_linenumber_bgcolor(TEXTDISPLAY td, unsigned int c); +extern "C" inline unsigned int fl_text_display_get_linenumber_fgcolor(TEXTDISPLAY td); +extern "C" inline void fl_text_display_set_linenumber_fgcolor(TEXTDISPLAY td, unsigned int c); +extern "C" inline int fl_text_display_get_linenumber_font(TEXTDISPLAY td); +extern "C" inline void fl_text_display_set_linenumber_font(TEXTDISPLAY td, int f); +extern "C" inline int fl_text_display_get_linenumber_size(TEXTDISPLAY td); +extern "C" inline void fl_text_display_set_linenumber_size(TEXTDISPLAY td, int s); +extern "C" inline int fl_text_display_get_linenumber_width(TEXTDISPLAY td); +extern "C" inline void fl_text_display_set_linenumber_width(TEXTDISPLAY td, int w); -extern "C" void fl_text_display_scroll(TEXTDISPLAY td, int l); -extern "C" unsigned int fl_text_display_get_scrollbar_align(TEXTDISPLAY td); -extern "C" void fl_text_display_set_scrollbar_align(TEXTDISPLAY td, unsigned int a); -extern "C" int fl_text_display_get_scrollbar_width(TEXTDISPLAY td); -extern "C" void fl_text_display_set_scrollbar_width(TEXTDISPLAY td, int w); +extern "C" inline int fl_text_display_move_down(TEXTDISPLAY td); +extern "C" inline int fl_text_display_move_left(TEXTDISPLAY td); +extern "C" inline int fl_text_display_move_right(TEXTDISPLAY td); +extern "C" inline int fl_text_display_move_up(TEXTDISPLAY td); + + +extern "C" inline void fl_text_display_scroll(TEXTDISPLAY td, int l); +extern "C" inline unsigned int fl_text_display_get_scrollbar_align(TEXTDISPLAY td); +extern "C" inline void fl_text_display_set_scrollbar_align(TEXTDISPLAY td, unsigned int a); +extern "C" inline int fl_text_display_get_scrollbar_width(TEXTDISPLAY td); +extern "C" inline void fl_text_display_set_scrollbar_width(TEXTDISPLAY td, int w); + + +extern "C" inline void fl_text_display_redisplay_range(TEXTDISPLAY td, int s, int f);  #endif diff --git a/src/fltk-devices-surfaces-paged-printers.adb b/src/fltk-devices-surfaces-paged-printers.adb index 6114cae..bdc34b0 100644 --- a/src/fltk-devices-surfaces-paged-printers.adb +++ b/src/fltk-devices-surfaces-paged-printers.adb @@ -17,10 +17,12 @@ package body FLTK.Devices.Surfaces.Paged.Printers is      function new_fl_printer          return System.Address;      pragma Import (C, new_fl_printer, "new_fl_printer"); +    pragma Inline (new_fl_printer);      procedure free_fl_printer             (D : in System.Address);      pragma Import (C, free_fl_printer, "free_fl_printer"); +    pragma Inline (free_fl_printer); @@ -30,26 +32,31 @@ package body FLTK.Devices.Surfaces.Paged.Printers is              C : in Interfaces.C.int)          return Interfaces.C.int;      pragma Import (C, fl_printer_start_job, "fl_printer_start_job"); +    pragma Inline (fl_printer_start_job);      function fl_printer_start_job2             (D       : in System.Address;              C, F, T : in Interfaces.C.int)          return Interfaces.C.int;      pragma Import (C, fl_printer_start_job2, "fl_printer_start_job2"); +    pragma Inline (fl_printer_start_job2);      procedure fl_printer_end_job             (D : in System.Address);      pragma Import (C, fl_printer_end_job, "fl_printer_end_job"); +    pragma Inline (fl_printer_end_job);      function fl_printer_start_page             (D : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_printer_start_page, "fl_printer_start_page"); +    pragma Inline (fl_printer_start_page);      function fl_printer_end_page             (D : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_printer_end_page, "fl_printer_end_page"); +    pragma Inline (fl_printer_end_page); @@ -58,41 +65,49 @@ package body FLTK.Devices.Surfaces.Paged.Printers is             (D          : in     System.Address;              L, T, R, B :    out Interfaces.C.int);      pragma Import (C, fl_printer_margins, "fl_printer_margins"); +    pragma Inline (fl_printer_margins);      function fl_printer_printable_rect             (D    : in     System.Address;              W, H :    out Interfaces.C.int)          return Interfaces.C.int;      pragma Import (C, fl_printer_printable_rect, "fl_printer_printable_rect"); +    pragma Inline (fl_printer_printable_rect);      procedure fl_printer_get_origin             (D    : in     System.Address;              X, Y :    out Interfaces.C.int);      pragma Import (C, fl_printer_get_origin, "fl_printer_get_origin"); +    pragma Inline (fl_printer_get_origin);      procedure fl_printer_set_origin             (D    : in System.Address;              X, Y : in Interfaces.C.int);      pragma Import (C, fl_printer_set_origin, "fl_printer_set_origin"); +    pragma Inline (fl_printer_set_origin);      procedure fl_printer_rotate             (D : in System.Address;              R : in Interfaces.C.C_float);      pragma Import (C, fl_printer_rotate, "fl_printer_rotate"); +    pragma Inline (fl_printer_rotate);      procedure fl_printer_scale             (D    : in System.Address;              X, Y : in Interfaces.C.C_float);      pragma Import (C, fl_printer_scale, "fl_printer_scale"); +    pragma Inline (fl_printer_scale);      procedure fl_printer_translate             (D    : in System.Address;              X, Y : in Interfaces.C.int);      pragma Import (C, fl_printer_translate, "fl_printer_translate"); +    pragma Inline (fl_printer_translate);      procedure fl_printer_untranslate             (D : in System.Address);      pragma Import (C, fl_printer_untranslate, "fl_printer_untranslate"); +    pragma Inline (fl_printer_untranslate); @@ -101,11 +116,13 @@ package body FLTK.Devices.Surfaces.Paged.Printers is             (D, I   : in System.Address;              DX, DY : in Interfaces.C.int);      pragma Import (C, fl_printer_print_widget, "fl_printer_print_widget"); +    pragma Inline (fl_printer_print_widget);      procedure fl_printer_print_window_part             (D, I               : in System.Address;              X, Y, W, H, DX, DY : in Interfaces.C.int);      pragma Import (C, fl_printer_print_window_part, "fl_printer_print_window_part"); +    pragma Inline (fl_printer_print_window_part); @@ -113,6 +130,7 @@ package body FLTK.Devices.Surfaces.Paged.Printers is      procedure fl_printer_set_current             (D : in System.Address);      pragma Import (C, fl_printer_set_current, "fl_printer_set_current"); +    pragma Inline (fl_printer_set_current); @@ -142,6 +160,8 @@ package body FLTK.Devices.Surfaces.Paged.Printers is              end return;          end Create; +        pragma Inline (Create); +      end Forge; @@ -204,42 +224,34 @@ package body FLTK.Devices.Surfaces.Paged.Printers is      procedure Get_Margins             (This                     : in     Printer; -            Left, Top, Right, Bottom :    out Integer) -    is -        L, T, R, B : Interfaces.C.int; +            Left, Top, Right, Bottom :    out Integer) is      begin -        fl_printer_margins (This.Void_Ptr, L, T, R, B); -        Left := Integer (L); -        Top := Integer (T); -        Right := Integer (R); -        Bottom := Integer (B); +        fl_printer_margins +           (This.Void_Ptr, +            Interfaces.C.int (Left), +            Interfaces.C.int (Top), +            Interfaces.C.int (Right), +            Interfaces.C.int (Bottom));      end Get_Margins;      procedure Get_Printable_Rect             (This : in     Printer; -            W, H :    out Integer) -    is -        Wid, Hei : Interfaces.C.int; +            W, H :    out Integer) is      begin -        if fl_printer_printable_rect (This.Void_Ptr, Wid, Hei) /= 0 then +        if fl_printer_printable_rect +            (This.Void_Ptr, Interfaces.C.int (W), Interfaces.C.int (H)) /= 0 +        then              raise Page_Error; -        else -            W := Integer (Wid); -            H := Integer (Hei);          end if;      end Get_Printable_Rect;      procedure Get_Origin             (This : in     Printer; -            X, Y :    out Integer) -    is -        Eks, Why : Interfaces.C.int; +            X, Y :    out Integer) is      begin -        fl_printer_get_origin (This.Void_Ptr, Eks, Why); -        X := Integer (Eks); -        Y := Integer (Why); +        fl_printer_get_origin (This.Void_Ptr, Interfaces.C.int (X), Interfaces.C.int (Y));      end Get_Origin; diff --git a/src/fltk-devices-surfaces-paged-printers.ads b/src/fltk-devices-surfaces-paged-printers.ads index 7eae340..b336373 100644 --- a/src/fltk-devices-surfaces-paged-printers.ads +++ b/src/fltk-devices-surfaces-paged-printers.ads @@ -10,6 +10,9 @@ package FLTK.Devices.Surfaces.Paged.Printers is      type Printer is new Paged_Surface with private; +    type Printer_Reference (Data : not null access Printer'Class) is limited null record +        with Implicit_Dereference => Data; + @@ -109,5 +112,30 @@ private             (This : in out Printer); + + +    pragma Inline (Start_Job); +    pragma Inline (End_Job); +    pragma Inline (Start_Page); +    pragma Inline (End_Page); + + +    pragma Inline (Get_Margins); +    pragma Inline (Get_Printable_Rect); +    pragma Inline (Get_Origin); +    pragma Inline (Set_Origin); +    pragma Inline (Rotate); +    pragma Inline (Scale); +    pragma Inline (Translate); +    pragma Inline (Untranslate); + + +    pragma Inline (Print_Widget); +    pragma Inline (Print_Window_Part); + + +    pragma Inline (Set_Current); + +  end FLTK.Devices.Surfaces.Paged.Printers; diff --git a/src/fltk-text_buffers.ads b/src/fltk-text_buffers.ads index ea66f6f..a2b5a6a 100644 --- a/src/fltk-text_buffers.ads +++ b/src/fltk-text_buffers.ads @@ -12,7 +12,7 @@ package FLTK.Text_Buffers is      type Text_Buffer is new Wrapper with private; -    type Text_Buffer_Cursor (Data : access Text_Buffer'Class) is limited null record +    type Text_Buffer_Reference (Data : access Text_Buffer'Class) is limited null record          with Implicit_Dereference => Data;      type Position is new Natural; diff --git a/src/fltk-widgets-groups-color_choosers.adb b/src/fltk-widgets-groups-color_choosers.adb index dabcf00..9d8221b 100644 --- a/src/fltk-widgets-groups-color_choosers.adb +++ b/src/fltk-widgets-groups-color_choosers.adb @@ -17,10 +17,12 @@ package body FLTK.Widgets.Groups.Color_Choosers is      procedure color_chooser_set_draw_hook             (W, D : in System.Address);      pragma Import (C, color_chooser_set_draw_hook, "color_chooser_set_draw_hook"); +    pragma Inline (color_chooser_set_draw_hook);      procedure color_chooser_set_handle_hook             (W, H : in System.Address);      pragma Import (C, color_chooser_set_handle_hook, "color_chooser_set_handle_hook"); +    pragma Inline (color_chooser_set_handle_hook); @@ -30,10 +32,12 @@ package body FLTK.Widgets.Groups.Color_Choosers is              Text       : in Interfaces.C.char_array)          return System.Address;      pragma Import (C, new_fl_color_chooser, "new_fl_color_chooser"); +    pragma Inline (new_fl_color_chooser);      procedure free_fl_color_chooser             (W : in System.Address);      pragma Import (C, free_fl_color_chooser, "free_fl_color_chooser"); +    pragma Inline (free_fl_color_chooser); @@ -42,22 +46,26 @@ package body FLTK.Widgets.Groups.Color_Choosers is             (N : in System.Address)          return Interfaces.C.double;      pragma Import (C, fl_color_chooser_r, "fl_color_chooser_r"); +    pragma Inline (fl_color_chooser_r);      function fl_color_chooser_g             (N : in System.Address)          return Interfaces.C.double;      pragma Import (C, fl_color_chooser_g, "fl_color_chooser_g"); +    pragma Inline (fl_color_chooser_g);      function fl_color_chooser_b             (N : in System.Address)          return Interfaces.C.double;      pragma Import (C, fl_color_chooser_b, "fl_color_chooser_b"); +    pragma Inline (fl_color_chooser_b);      function fl_color_chooser_rgb             (N       : in System.Address;              R, G, B : in Interfaces.C.double)          return Interfaces.C.int;      pragma Import (C, fl_color_chooser_rgb, "fl_color_chooser_rgb"); +    pragma Inline (fl_color_chooser_rgb); @@ -66,22 +74,41 @@ package body FLTK.Widgets.Groups.Color_Choosers is             (N : in System.Address)          return Interfaces.C.double;      pragma Import (C, fl_color_chooser_hue, "fl_color_chooser_hue"); +    pragma Inline (fl_color_chooser_hue);      function fl_color_chooser_saturation             (N : in System.Address)          return Interfaces.C.double;      pragma Import (C, fl_color_chooser_saturation, "fl_color_chooser_saturation"); +    pragma Inline (fl_color_chooser_saturation);      function fl_color_chooser_value             (N : in System.Address)          return Interfaces.C.double;      pragma Import (C, fl_color_chooser_value, "fl_color_chooser_value"); +    pragma Inline (fl_color_chooser_value);      function fl_color_chooser_hsv             (N       : in System.Address;              H, S, V : in Interfaces.C.double)          return Interfaces.C.int;      pragma Import (C, fl_color_chooser_hsv, "fl_color_chooser_hsv"); +    pragma Inline (fl_color_chooser_hsv); + + + + +    procedure fl_color_chooser_hsv2rgb +           (H, S, V : in     Interfaces.C.double; +            R, G, B :    out Interfaces.C.double); +    pragma Import (C, fl_color_chooser_hsv2rgb, "fl_color_chooser_hsv2rgb"); +    pragma Inline (fl_color_chooser_hsv2rgb); + +    procedure fl_color_chooser_rgb2hsv +           (R, G, B : in     Interfaces.C.double; +            H, S, V :    out Interfaces.C.double); +    pragma Import (C, fl_color_chooser_rgb2hsv, "fl_color_chooser_rgb2hsv"); +    pragma Inline (fl_color_chooser_rgb2hsv); @@ -90,11 +117,13 @@ package body FLTK.Widgets.Groups.Color_Choosers is             (N : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_color_chooser_get_mode, "fl_color_chooser_get_mode"); +    pragma Inline (fl_color_chooser_get_mode);      procedure fl_color_chooser_set_mode             (N : in System.Address;              M : in Interfaces.C.int);      pragma Import (C, fl_color_chooser_set_mode, "fl_color_chooser_set_mode"); +    pragma Inline (fl_color_chooser_set_mode); @@ -102,12 +131,14 @@ package body FLTK.Widgets.Groups.Color_Choosers is      procedure fl_color_chooser_draw             (W : in System.Address);      pragma Import (C, fl_color_chooser_draw, "fl_color_chooser_draw"); +    pragma Inline (fl_color_chooser_draw);      function fl_color_chooser_handle             (W : in System.Address;              E : in Interfaces.C.int)          return Interfaces.C.int;      pragma Import (C, fl_color_chooser_handle, "fl_color_chooser_handle"); +    pragma Inline (fl_color_chooser_handle); @@ -232,6 +263,36 @@ package body FLTK.Widgets.Groups.Color_Choosers is +    procedure HSV_To_RGB +           (H, S, V : in     Long_Float; +            R, G, B :    out Long_Float) is +    begin +        fl_color_chooser_hsv2rgb +           (Interfaces.C.double (H), +            Interfaces.C.double (S), +            Interfaces.C.double (V), +            Interfaces.C.double (R), +            Interfaces.C.double (G), +            Interfaces.C.double (B)); +    end HSV_To_RGB; + + +    procedure RGB_To_HSV +           (R, G, B : in     Long_Float; +            H, S, V :    out Long_Float) is +    begin +        fl_color_chooser_rgb2hsv +           (Interfaces.C.double (R), +            Interfaces.C.double (G), +            Interfaces.C.double (B), +            Interfaces.C.double (H), +            Interfaces.C.double (S), +            Interfaces.C.double (V)); +    end RGB_To_HSV; + + + +      function Color_Was_Changed             (This : in Color_Chooser)          return Boolean is diff --git a/src/fltk-widgets-groups-color_choosers.ads b/src/fltk-widgets-groups-color_choosers.ads index 3af3fa4..fa26c2d 100644 --- a/src/fltk-widgets-groups-color_choosers.ads +++ b/src/fltk-widgets-groups-color_choosers.ads @@ -5,6 +5,9 @@ package FLTK.Widgets.Groups.Color_Choosers is      type Color_Chooser is new Group with private; +    type Color_Chooser_Reference (Data : not null access Color_Chooser'Class) is +        limited null record with Implicit_Dereference => Data; +      type Color_Mode is (RGB, Byte, Hex, HSV); @@ -60,6 +63,17 @@ package FLTK.Widgets.Groups.Color_Choosers is +    procedure HSV_To_RGB +           (H, S, V : in     Long_Float; +            R, G, B :    out Long_Float); + +    procedure RGB_To_HSV +           (R, G, B : in     Long_Float; +            H, S, V :    out Long_Float); + + + +      function Color_Was_Changed             (This : in Color_Chooser)          return Boolean; @@ -101,5 +115,35 @@ private             (This : in out Color_Chooser); + + +    pragma Inline (Get_Red); +    pragma Inline (Get_Green); +    pragma Inline (Get_Blue); +    pragma Inline (Set_RGB); + + +    pragma Inline (Get_Hue); +    pragma Inline (Get_Saturation); +    pragma Inline (Get_Value); +    pragma Inline (Set_HSV); + + +    pragma Inline (HSV_To_RGB); +    pragma Inline (RGB_To_HSV); + + +    pragma Inline (Color_Was_Changed); +    pragma Inline (Clear_Changed); + + +    pragma Inline (Get_Mode); +    pragma Inline (Set_Mode); + + +    pragma Inline (Draw); +    pragma Inline (Handle); + +  end FLTK.Widgets.Groups.Color_Choosers; diff --git a/src/fltk-widgets-groups-input_choices.adb b/src/fltk-widgets-groups-input_choices.adb index afda09f..366eade 100644 --- a/src/fltk-widgets-groups-input_choices.adb +++ b/src/fltk-widgets-groups-input_choices.adb @@ -18,10 +18,12 @@ package body FLTK.Widgets.Groups.Input_Choices is      procedure input_choice_set_draw_hook             (W, D : in System.Address);      pragma Import (C, input_choice_set_draw_hook, "input_choice_set_draw_hook"); +    pragma Inline (input_choice_set_draw_hook);      procedure input_choice_set_handle_hook             (W, H : in System.Address);      pragma Import (C, input_choice_set_handle_hook, "input_choice_set_handle_hook"); +    pragma Inline (input_choice_set_handle_hook); @@ -31,10 +33,12 @@ package body FLTK.Widgets.Groups.Input_Choices is              Text       : in Interfaces.C.char_array)          return System.Address;      pragma Import (C, new_fl_input_choice, "new_fl_input_choice"); +    pragma Inline (new_fl_input_choice);      procedure free_fl_input_choice             (W : in System.Address);      pragma Import (C, free_fl_input_choice, "free_fl_input_choice"); +    pragma Inline (free_fl_input_choice); @@ -43,11 +47,21 @@ package body FLTK.Widgets.Groups.Input_Choices is             (N : in System.Address)          return System.Address;      pragma Import (C, fl_input_choice_input, "fl_input_choice_input"); +    pragma Inline (fl_input_choice_input);      function fl_input_choice_menubutton             (N : in System.Address)          return System.Address;      pragma Import (C, fl_input_choice_menubutton, "fl_input_choice_menubutton"); +    pragma Inline (fl_input_choice_menubutton); + + + + +    procedure fl_input_choice_clear +           (N : in System.Address); +    pragma Import (C, fl_input_choice_clear, "fl_input_choice_clear"); +    pragma Inline (fl_input_choice_clear); @@ -56,65 +70,83 @@ package body FLTK.Widgets.Groups.Input_Choices is             (N : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_input_choice_changed, "fl_input_choice_changed"); +    pragma Inline (fl_input_choice_changed);      procedure fl_input_choice_clear_changed             (N : in System.Address);      pragma Import (C, fl_input_choice_clear_changed, "fl_input_choice_clear_changed"); +    pragma Inline (fl_input_choice_clear_changed); + +    procedure fl_input_choice_set_changed +           (N : in System.Address); +    pragma Import (C, fl_input_choice_set_changed, "fl_input_choice_set_changed"); +    pragma Inline (fl_input_choice_set_changed);      function fl_input_choice_get_down_box             (N : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_input_choice_get_down_box, "fl_input_choice_get_down_box"); +    pragma Inline (fl_input_choice_get_down_box);      procedure fl_input_choice_set_down_box             (N : in System.Address;              T : in Interfaces.C.int);      pragma Import (C, fl_input_choice_set_down_box, "fl_input_choice_set_down_box"); +    pragma Inline (fl_input_choice_set_down_box);      function fl_input_choice_get_textcolor             (N : in System.Address)          return Interfaces.C.unsigned;      pragma Import (C, fl_input_choice_get_textcolor, "fl_input_choice_get_textcolor"); +    pragma Inline (fl_input_choice_get_textcolor);      procedure fl_input_choice_set_textcolor             (N : in System.Address;              T : in Interfaces.C.unsigned);      pragma Import (C, fl_input_choice_set_textcolor, "fl_input_choice_set_textcolor"); +    pragma Inline (fl_input_choice_set_textcolor);      function fl_input_choice_get_textfont             (N : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_input_choice_get_textfont, "fl_input_choice_get_textfont"); +    pragma Inline (fl_input_choice_get_textfont);      procedure fl_input_choice_set_textfont             (N : in System.Address;              T : in Interfaces.C.int);      pragma Import (C, fl_input_choice_set_textfont, "fl_input_choice_set_textfont"); +    pragma Inline (fl_input_choice_set_textfont);      function fl_input_choice_get_textsize             (N : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_input_choice_get_textsize, "fl_input_choice_get_textsize"); +    pragma Inline (fl_input_choice_get_textsize);      procedure fl_input_choice_set_textsize             (N : in System.Address;              T : in Interfaces.C.int);      pragma Import (C, fl_input_choice_set_textsize, "fl_input_choice_set_textsize"); +    pragma Inline (fl_input_choice_set_textsize);      function fl_input_choice_get_value             (N : in System.Address)          return Interfaces.C.Strings.chars_ptr;      pragma Import (C, fl_input_choice_get_value, "fl_input_choice_get_value"); +    pragma Inline (fl_input_choice_get_value);      procedure fl_input_choice_set_value             (N : in System.Address;              T : in Interfaces.C.char_array);      pragma Import (C, fl_input_choice_set_value, "fl_input_choice_set_value"); +    pragma Inline (fl_input_choice_set_value);      procedure fl_input_choice_set_value2             (N : in System.Address;              T : in Interfaces.C.int);      pragma Import (C, fl_input_choice_set_value2, "fl_input_choice_set_value2"); +    pragma Inline (fl_input_choice_set_value2); @@ -122,12 +154,14 @@ package body FLTK.Widgets.Groups.Input_Choices is      procedure fl_input_choice_draw             (W : in System.Address);      pragma Import (C, fl_input_choice_draw, "fl_input_choice_draw"); +    pragma Inline (fl_input_choice_draw);      function fl_input_choice_handle             (W : in System.Address;              E : in Interfaces.C.int)          return Interfaces.C.int;      pragma Import (C, fl_input_choice_handle, "fl_input_choice_handle"); +    pragma Inline (fl_input_choice_handle); @@ -146,7 +180,7 @@ package body FLTK.Widgets.Groups.Input_Choices is          if  This.Void_Ptr /= System.Null_Address and then              This in Input_Choice'Class          then -            This.Clear; +            Group (This).Clear;              free_fl_input_choice (This.Void_Ptr);              Free (This.My_Input);              Free (This.My_Menu_Button); @@ -214,6 +248,15 @@ package body FLTK.Widgets.Groups.Input_Choices is +    procedure Clear +           (This : in out Input_Choice) is +    begin +        fl_input_choice_clear (This.Void_Ptr); +    end Clear; + + + +      function Has_Changed             (This : in Input_Choice)          return Boolean is @@ -229,6 +272,16 @@ package body FLTK.Widgets.Groups.Input_Choices is      end Clear_Changed; +    procedure Set_Changed +           (This : in out Input_Choice; +            To   : in     Boolean) is +    begin +        if To then +            fl_input_choice_set_changed (This.Void_Ptr); +        end if; +    end Set_Changed; + +      function Get_Down_Box             (This : in Input_Choice)          return Box_Kind is @@ -295,13 +348,10 @@ package body FLTK.Widgets.Groups.Input_Choices is      function Get_Input             (This : in Input_Choice) -        return String -    is -        C_Str : Interfaces.C.Strings.chars_ptr := fl_input_choice_get_value (This.Void_Ptr); -        The_Text : String := Interfaces.C.Strings.Value (C_Str); +        return String is      begin -        Interfaces.C.Strings.Free (C_Str); -        return The_Text; +        --  pointer to internal buffer so no free necessary +        return Interfaces.C.Strings.Value (fl_input_choice_get_value (This.Void_Ptr));      end Get_Input; diff --git a/src/fltk-widgets-groups-input_choices.ads b/src/fltk-widgets-groups-input_choices.ads index 52fa2d0..b57585d 100644 --- a/src/fltk-widgets-groups-input_choices.ads +++ b/src/fltk-widgets-groups-input_choices.ads @@ -11,6 +11,9 @@ package FLTK.Widgets.Groups.Input_Choices is      type Input_Choice is new Group with private; +    type Input_Choice_Reference (Data : not null access Input_Choice'Class) is +        limited null record with Implicit_Dereference => Data; + @@ -37,6 +40,12 @@ package FLTK.Widgets.Groups.Input_Choices is +    procedure Clear +           (This : in out Input_Choice); + + + +      function Has_Changed             (This : in Input_Choice)          return Boolean; @@ -44,6 +53,10 @@ package FLTK.Widgets.Groups.Input_Choices is      procedure Clear_Changed             (This : in out Input_Choice); +    procedure Set_Changed +           (This : in out Input_Choice; +            To   : in     Boolean); +      function Get_Down_Box             (This : in Input_Choice)          return Box_Kind; @@ -120,5 +133,30 @@ private             (This : in out Input_Choice); + + +    pragma Inline (Input); +    pragma Inline (Menu_Button); + + +    pragma Inline (Has_Changed); +    pragma Inline (Clear_Changed); +    pragma Inline (Get_Down_Box); +    pragma Inline (Set_Down_Box); +    pragma Inline (Get_Text_Color); +    pragma Inline (Set_Text_Color); +    pragma Inline (Get_Text_Font); +    pragma Inline (Set_Text_Font); +    pragma Inline (Get_Text_Size); +    pragma Inline (Set_Text_Size); +    pragma Inline (Get_Input); +    pragma Inline (Set_Input); +    pragma Inline (Set_Item); + + +    pragma Inline (Draw); +    pragma Inline (Handle); + +  end FLTK.Widgets.Groups.Input_Choices; diff --git a/src/fltk-widgets-groups-text_displays.adb b/src/fltk-widgets-groups-text_displays.adb index 4548708..a28cdbb 100644 --- a/src/fltk-widgets-groups-text_displays.adb +++ b/src/fltk-widgets-groups-text_displays.adb @@ -18,10 +18,12 @@ package body FLTK.Widgets.Groups.Text_Displays is      procedure text_display_set_draw_hook             (W, D : in System.Address);      pragma Import (C, text_display_set_draw_hook, "text_display_set_draw_hook"); +    pragma Inline (text_display_set_draw_hook);      procedure text_display_set_handle_hook             (W, H : in System.Address);      pragma Import (C, text_display_set_handle_hook, "text_display_set_handle_hook"); +    pragma Inline (text_display_set_handle_hook); @@ -31,10 +33,12 @@ package body FLTK.Widgets.Groups.Text_Displays is              Label      : in Interfaces.C.char_array)          return System.Address;      pragma Import (C, new_fl_text_display, "new_fl_text_display"); +    pragma Inline (new_fl_text_display);      procedure free_fl_text_display             (TD : in System.Address);      pragma Import (C, free_fl_text_display, "free_fl_text_display"); +    pragma Inline (free_fl_text_display); @@ -43,10 +47,29 @@ package body FLTK.Widgets.Groups.Text_Displays is             (TD : in System.Address)          return System.Address;      pragma Import (C, fl_text_display_get_buffer, "fl_text_display_get_buffer"); +    pragma Inline (fl_text_display_get_buffer);      procedure fl_text_display_set_buffer             (TD, TB : in System.Address);      pragma Import (C, fl_text_display_set_buffer, "fl_text_display_set_buffer"); +    pragma Inline (fl_text_display_set_buffer); + + + + +    procedure fl_text_display_highlight_data +           (TD, TB, ST : in System.Address; +            L          : in Interfaces.C.int); +    pragma Import (C, fl_text_display_highlight_data, "fl_text_display_highlight_data"); +    pragma Inline (fl_text_display_highlight_data); + +    procedure fl_text_display_highlight_data2 +           (TD, TB, ST : in System.Address; +            L          : in Interfaces.C.int; +            C          : in Interfaces.C.unsigned; +            B, A       : in System.Address); +    pragma Import (C, fl_text_display_highlight_data2, "fl_text_display_highlight_data2"); +    pragma Inline (fl_text_display_highlight_data2); @@ -56,18 +79,21 @@ package body FLTK.Widgets.Groups.Text_Displays is              C  : in Interfaces.C.double)          return Interfaces.C.double;      pragma Import (C, fl_text_display_col_to_x, "fl_text_display_col_to_x"); +    pragma Inline (fl_text_display_col_to_x);      function fl_text_display_x_to_col             (TD : in System.Address;              X  : in Interfaces.C.double)          return Interfaces.C.double;      pragma Import (C, fl_text_display_x_to_col, "fl_text_display_x_to_col"); +    pragma Inline (fl_text_display_x_to_col);      function fl_text_display_in_selection             (TD   : in System.Address;              X, Y : in Interfaces.C.int)          return Interfaces.C.int;      pragma Import (C, fl_text_display_in_selection, "fl_text_display_in_selection"); +    pragma Inline (fl_text_display_in_selection);      function fl_text_display_position_to_xy             (TD   : in     System.Address; @@ -75,6 +101,7 @@ package body FLTK.Widgets.Groups.Text_Displays is              X, Y :    out Interfaces.C.int)          return Interfaces.C.int;      pragma Import (C, fl_text_display_position_to_xy, "fl_text_display_position_to_xy"); +    pragma Inline (fl_text_display_position_to_xy); @@ -83,24 +110,29 @@ package body FLTK.Widgets.Groups.Text_Displays is             (TD : in System.Address)          return Interfaces.C.unsigned;      pragma Import (C, fl_text_display_get_cursor_color, "fl_text_display_get_cursor_color"); +    pragma Inline (fl_text_display_get_cursor_color);      procedure fl_text_display_set_cursor_color             (TD : in System.Address;              C  : in Interfaces.C.unsigned);      pragma Import (C, fl_text_display_set_cursor_color, "fl_text_display_set_cursor_color"); +    pragma Inline (fl_text_display_set_cursor_color);      procedure fl_text_display_set_cursor_style             (TD : in System.Address;              S  : in Interfaces.C.int);      pragma Import (C, fl_text_display_set_cursor_style, "fl_text_display_set_cursor_style"); +    pragma Inline (fl_text_display_set_cursor_style);      procedure fl_text_display_hide_cursor             (TD : in System.Address);      pragma Import (C, fl_text_display_hide_cursor, "fl_text_display_hide_cursor"); +    pragma Inline (fl_text_display_hide_cursor);      procedure fl_text_display_show_cursor             (TD : in System.Address);      pragma Import (C, fl_text_display_show_cursor, "fl_text_display_show_cursor"); +    pragma Inline (fl_text_display_show_cursor); @@ -109,31 +141,37 @@ package body FLTK.Widgets.Groups.Text_Displays is             (TD : in System.Address)          return Interfaces.C.unsigned;      pragma Import (C, fl_text_display_get_text_color, "fl_text_display_get_text_color"); +    pragma Inline (fl_text_display_get_text_color);      procedure fl_text_display_set_text_color             (TD : in System.Address;              C  : in Interfaces.C.unsigned);      pragma Import (C, fl_text_display_set_text_color, "fl_text_display_set_text_color"); +    pragma Inline (fl_text_display_set_text_color);      function fl_text_display_get_text_font             (TD : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_text_display_get_text_font, "fl_text_display_get_text_font"); +    pragma Inline (fl_text_display_get_text_font);      procedure fl_text_display_set_text_font             (TD : in System.Address;              F  : in Interfaces.C.int);      pragma Import (C, fl_text_display_set_text_font, "fl_text_display_set_text_font"); +    pragma Inline (fl_text_display_set_text_font);      function fl_text_display_get_text_size             (TD : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_text_display_get_text_size, "fl_text_display_get_text_size"); +    pragma Inline (fl_text_display_get_text_size);      procedure fl_text_display_set_text_size             (TD : in System.Address;              S  : in Interfaces.C.int);      pragma Import (C, fl_text_display_set_text_size, "fl_text_display_set_text_size"); +    pragma Inline (fl_text_display_set_text_size); @@ -142,20 +180,30 @@ package body FLTK.Widgets.Groups.Text_Displays is             (TD : in System.Address;              I  : in Interfaces.C.char_array);      pragma Import (C, fl_text_display_insert, "fl_text_display_insert"); +    pragma Inline (fl_text_display_insert); + +    procedure fl_text_display_overstrike +           (TD : in System.Address; +            T  : in Interfaces.C.char_array); +    pragma Import (C, fl_text_display_overstrike, "fl_text_display_overstrike"); +    pragma Inline (fl_text_display_overstrike);      function fl_text_display_get_insert_pos             (TD : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_text_display_get_insert_pos, "fl_text_display_get_insert_pos"); +    pragma Inline (fl_text_display_get_insert_pos);      procedure fl_text_display_set_insert_pos             (TD : in System.Address;              P  : in Interfaces.C.int);      pragma Import (C, fl_text_display_set_insert_pos, "fl_text_display_set_insert_pos"); +    pragma Inline (fl_text_display_set_insert_pos);      procedure fl_text_display_show_insert_pos             (TD : in System.Address);      pragma Import (C, fl_text_display_show_insert_pos, "fl_text_display_show_insert_pos"); +    pragma Inline (fl_text_display_show_insert_pos); @@ -165,25 +213,30 @@ package body FLTK.Widgets.Groups.Text_Displays is              P  : in Interfaces.C.int)          return Interfaces.C.int;      pragma Import (C, fl_text_display_word_start, "fl_text_display_word_start"); +    pragma Inline (fl_text_display_word_start);      function fl_text_display_word_end             (TD : in System.Address;              P  : in Interfaces.C.int)          return Interfaces.C.int;      pragma Import (C, fl_text_display_word_end, "fl_text_display_word_end"); +    pragma Inline (fl_text_display_word_end);      procedure fl_text_display_next_word             (TD : in System.Address);      pragma Import (C, fl_text_display_next_word, "fl_text_display_next_word"); +    pragma Inline (fl_text_display_next_word);      procedure fl_text_display_previous_word             (TD : in System.Address);      pragma Import (C, fl_text_display_previous_word, "fl_text_display_previous_word"); +    pragma Inline (fl_text_display_previous_word);      procedure fl_text_display_wrap_mode             (TD    : in System.Address;              W, M  : in Interfaces.C.int);      pragma Import (C, fl_text_display_wrap_mode, "fl_text_display_wrap_mode"); +    pragma Inline (fl_text_display_wrap_mode); @@ -193,30 +246,35 @@ package body FLTK.Widgets.Groups.Text_Displays is              S  : in Interfaces.C.int)          return Interfaces.C.int;      pragma Import (C, fl_text_display_line_start, "fl_text_display_line_start"); +    pragma Inline (fl_text_display_line_start);      function fl_text_display_line_end             (TD   : in System.Address;              S, P : in Interfaces.C.int)          return Interfaces.C.int;      pragma Import (C, fl_text_display_line_end, "fl_text_display_line_end"); +    pragma Inline (fl_text_display_line_end);      function fl_text_display_count_lines             (TD      : in System.Address;              S, F, P : in Interfaces.C.int)          return Interfaces.C.int;      pragma Import (C, fl_text_display_count_lines, "fl_text_display_count_lines"); +    pragma Inline (fl_text_display_count_lines);      function fl_text_display_skip_lines             (TD      : in System.Address;              S, L, P : in Interfaces.C.int)          return Interfaces.C.int;      pragma Import (C, fl_text_display_skip_lines, "fl_text_display_skip_lines"); +    pragma Inline (fl_text_display_skip_lines);      function fl_text_display_rewind_lines             (TD   : in System.Address;              S, L : in Interfaces.C.int)          return Interfaces.C.int;      pragma Import (C, fl_text_display_rewind_lines, "fl_text_display_rewind_lines"); +    pragma Inline (fl_text_display_rewind_lines); @@ -226,72 +284,84 @@ package body FLTK.Widgets.Groups.Text_Displays is          return Interfaces.C.unsigned;      pragma Import (C, fl_text_display_get_linenumber_align,          "fl_text_display_get_linenumber_align"); +    pragma Inline (fl_text_display_get_linenumber_align);      procedure fl_text_display_set_linenumber_align             (TD : in System.Address;              A  : in Interfaces.C.unsigned);      pragma Import (C, fl_text_display_set_linenumber_align,          "fl_text_display_set_linenumber_align"); +    pragma Inline (fl_text_display_set_linenumber_align);      function fl_text_display_get_linenumber_bgcolor             (TD : in System.Address)          return Interfaces.C.unsigned;      pragma Import (C, fl_text_display_get_linenumber_bgcolor,          "fl_text_display_get_linenumber_bgcolor"); +    pragma Inline (fl_text_display_get_linenumber_bgcolor);      procedure fl_text_display_set_linenumber_bgcolor             (TD : in System.Address;              C  : in Interfaces.C.unsigned);      pragma Import (C, fl_text_display_set_linenumber_bgcolor,          "fl_text_display_set_linenumber_bgcolor"); +    pragma Inline (fl_text_display_set_linenumber_bgcolor);      function fl_text_display_get_linenumber_fgcolor             (TD : in System.Address)          return Interfaces.C.unsigned;      pragma Import (C, fl_text_display_get_linenumber_fgcolor,          "fl_text_display_get_linenumber_fgcolor"); +    pragma Inline (fl_text_display_get_linenumber_fgcolor);      procedure fl_text_display_set_linenumber_fgcolor             (TD : in System.Address;              C  : in Interfaces.C.unsigned);      pragma Import (C, fl_text_display_set_linenumber_fgcolor,          "fl_text_display_set_linenumber_fgcolor"); +    pragma Inline (fl_text_display_set_linenumber_fgcolor);      function fl_text_display_get_linenumber_font             (TD : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_text_display_get_linenumber_font,          "fl_text_display_get_linenumber_font"); +    pragma Inline (fl_text_display_get_linenumber_font);      procedure fl_text_display_set_linenumber_font             (TD : in System.Address;              F  : in Interfaces.C.int);      pragma Import (C, fl_text_display_set_linenumber_font,          "fl_text_display_set_linenumber_font"); +    pragma Inline (fl_text_display_set_linenumber_font);      function fl_text_display_get_linenumber_size             (TD : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_text_display_get_linenumber_size,          "fl_text_display_get_linenumber_size"); +    pragma Inline (fl_text_display_get_linenumber_size);      procedure fl_text_display_set_linenumber_size             (TD : in System.Address;              S  : in Interfaces.C.int);      pragma Import (C, fl_text_display_set_linenumber_size,          "fl_text_display_set_linenumber_size"); +    pragma Inline (fl_text_display_set_linenumber_size);      function fl_text_display_get_linenumber_width             (TD : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_text_display_get_linenumber_width,          "fl_text_display_get_linenumber_width"); +    pragma Inline (fl_text_display_get_linenumber_width);      procedure fl_text_display_set_linenumber_width             (TD : in System.Address;              W  : in Interfaces.C.int);      pragma Import (C, fl_text_display_set_linenumber_width,          "fl_text_display_set_linenumber_width"); +    pragma Inline (fl_text_display_set_linenumber_width); @@ -300,21 +370,25 @@ package body FLTK.Widgets.Groups.Text_Displays is             (TD : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_text_display_move_down, "fl_text_display_move_down"); +    pragma Inline (fl_text_display_move_down);      function fl_text_display_move_left             (TD : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_text_display_move_left, "fl_text_display_move_left"); +    pragma Inline (fl_text_display_move_left);      function fl_text_display_move_right             (TD : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_text_display_move_right, "fl_text_display_move_right"); +    pragma Inline (fl_text_display_move_right);      function fl_text_display_move_up             (TD : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_text_display_move_up, "fl_text_display_move_up"); +    pragma Inline (fl_text_display_move_up); @@ -323,39 +397,69 @@ package body FLTK.Widgets.Groups.Text_Displays is             (TD : in System.Address;              L  : in Interfaces.C.int);      pragma Import (C, fl_text_display_scroll, "fl_text_display_scroll"); +    pragma Inline (fl_text_display_scroll);      function fl_text_display_get_scrollbar_align             (TD : in System.Address)          return Interfaces.C.unsigned;      pragma Import (C, fl_text_display_get_scrollbar_align, "fl_text_display_get_scrollbar_align"); +    pragma Inline (fl_text_display_get_scrollbar_align);      procedure fl_text_display_set_scrollbar_align             (TD : in System.Address;              A  : in Interfaces.C.unsigned);      pragma Import (C, fl_text_display_set_scrollbar_align, "fl_text_display_set_scrollbar_align"); +    pragma Inline (fl_text_display_set_scrollbar_align);      function fl_text_display_get_scrollbar_width             (TD : in System.Address)          return Interfaces.C.int;      pragma Import (C, fl_text_display_get_scrollbar_width, "fl_text_display_get_scrollbar_width"); +    pragma Inline (fl_text_display_get_scrollbar_width);      procedure fl_text_display_set_scrollbar_width             (TD : in System.Address;              W  : in Interfaces.C.int);      pragma Import (C, fl_text_display_set_scrollbar_width, "fl_text_display_set_scrollbar_width"); +    pragma Inline (fl_text_display_set_scrollbar_width); + +    procedure fl_text_display_redisplay_range +           (TD   : in System.Address; +            S, F : in Interfaces.C.int); +    pragma Import (C, fl_text_display_redisplay_range, "fl_text_display_redisplay_range"); +    pragma Inline (fl_text_display_redisplay_range);      procedure fl_text_display_draw             (W : in System.Address);      pragma Import (C, fl_text_display_draw, "fl_text_display_draw"); +    pragma Inline (fl_text_display_draw);      function fl_text_display_handle             (W : in System.Address;              E : in Interfaces.C.int)          return Interfaces.C.int;      pragma Import (C, fl_text_display_handle, "fl_text_display_handle"); +    pragma Inline (fl_text_display_handle); + + + + +    procedure Style_Hook +           (C : in Interfaces.C.int; +            D : in System.Address) +    is +        use Styles;  --  for maximum stylin' + +        Ada_Widget : access Text_Display'Class := +            Text_Display_Convert.To_Pointer (D); +    begin +        if Ada_Widget.Style_Callback /= null then +            Ada_Widget.Style_Callback (Character'Val (C), Text_Display (Ada_Widget.all)); +        end if; +    end Style_Hook; @@ -404,11 +508,34 @@ package body FLTK.Widgets.Groups.Text_Displays is +    package body Styles is + +        function Item +               (Tint : in Color; +                Font : in Font_Kind; +                Size : in Font_Size) +            return Style_Entry is +        begin +            return This : Style_Entry do +                This.Attr := 0; +                This.Col  := Interfaces.C.unsigned (Tint); +                This.Font := Font_Kind'Pos (Font); +                This.Size := Interfaces.C.int (Size); +            end return; +        end Item; + +        pragma Inline (Item); + +    end Styles; + + + +      function Get_Buffer             (This : in Text_Display) -        return FLTK.Text_Buffers.Text_Buffer_Cursor is +        return FLTK.Text_Buffers.Text_Buffer_Reference is      begin -        return Ref : FLTK.Text_Buffers.Text_Buffer_Cursor (This.Buffer); +        return Ref : FLTK.Text_Buffers.Text_Buffer_Reference (This.Buffer);      end Get_Buffer; @@ -423,6 +550,40 @@ package body FLTK.Widgets.Groups.Text_Displays is +    procedure Highlight_Data +           (This  : in out Text_Display; +            Buff  : in out FLTK.Text_Buffers.Text_Buffer; +            Table : in     Styles.Style_Array) is +    begin +        fl_text_display_highlight_data +           (This.Void_Ptr, +            Wrapper (Buff).Void_Ptr, +            Table'Address, +            Table'Length); +    end Highlight_Data; + + +    procedure Highlight_Data +           (This       : in out Text_Display; +            Buff       : in out FLTK.Text_Buffers.Text_Buffer; +            Table      : in     Styles.Style_Array; +            Unfinished : in     Styles.Style_Index; +            Callback   : in     Styles.Unfinished_Style_Callback) is +    begin +        This.Style_Callback := Callback; +        fl_text_display_highlight_data2 +           (This.Void_Ptr, +            Wrapper (Buff).Void_Ptr, +            Table'Address, +            Table'Length, +            Character'Pos (Character (Unfinished)), +            Style_Hook'Address, +            This'Address); +    end Highlight_Data; + + + +      function Col_To_X             (This    : in Text_Display;              Col_Num : in Integer) @@ -457,16 +618,13 @@ package body FLTK.Widgets.Groups.Text_Displays is             (This     : in     Text_Display;              Pos      : in     Integer;              X, Y     :    out Integer; -            Vert_Out :    out Boolean) -    is -        Raw_X, Raw_Y : Interfaces.C.int; +            Vert_Out :    out Boolean) is      begin          Vert_Out := fl_text_display_position_to_xy                 (This.Void_Ptr,                  Interfaces.C.int (Pos), -                Raw_X, Raw_Y) /= 0; -        X := Integer (Raw_X); -        Y := Integer (Raw_Y); +                Interfaces.C.int (X), +                Interfaces.C.int (Y)) /= 0;      end Position_To_XY; @@ -570,6 +728,14 @@ package body FLTK.Widgets.Groups.Text_Displays is      end Insert_Text; +    procedure Overstrike +           (This : in out Text_Display; +            Text : in     String) is +    begin +        fl_text_display_overstrike (This.Void_Ptr, Interfaces.C.To_C (Text)); +    end Overstrike; + +      function Get_Insert_Position             (This : in Text_Display)          return Natural is @@ -905,6 +1071,17 @@ package body FLTK.Widgets.Groups.Text_Displays is +    procedure Redisplay_Range +           (This          : in out Text_Display; +            Start, Finish : in     Natural) is +    begin +        fl_text_display_redisplay_range +           (This.Void_Ptr, +            Interfaces.C.int (Start), +            Interfaces.C.int (Finish)); +    end Redisplay_Range; + +      procedure Draw             (This : in out Text_Display) is      begin diff --git a/src/fltk-widgets-groups-text_displays.ads b/src/fltk-widgets-groups-text_displays.ads index 6262125..332af44 100644 --- a/src/fltk-widgets-groups-text_displays.ads +++ b/src/fltk-widgets-groups-text_displays.ads @@ -4,13 +4,22 @@ with      FLTK.Text_Buffers; +private with + +    Interfaces.C, +    System.Address_To_Access_Conversions; +  package FLTK.Widgets.Groups.Text_Displays is      type Text_Display is new Group with private; +    type Text_Display_Reference (Data : not null access Text_Display'Class) is +        limited null record with Implicit_Dereference => Data; +      type Wrap_Mode is (None, Column, Pixel, Bounds); +      type Cursor_Style is (Normal, Caret, Dim, Block, Heavy, Simple);      Bounds_Error : exception; @@ -30,9 +39,42 @@ package FLTK.Widgets.Groups.Text_Displays is +    package Styles is + +        type Style_Entry is private; +        type Style_Index is new Character range 'A' .. '~'; +        type Style_Array is array (Style_Index range <>) of Style_Entry; + +        type Unfinished_Style_Callback is access procedure +               (Char    : in     Character; +                Display : in out Text_Display); + +        function Item +               (Tint : in Color; +                Font : in Font_Kind; +                Size : in Font_Size) +            return Style_Entry; + +    private + +        type Style_Entry is record +            Attr : Interfaces.C.unsigned; +            Col  : Interfaces.C.unsigned; +            Font : Interfaces.C.int; +            Size : Interfaces.C.int; +        end record; + +        pragma Convention (C, Style_Entry); +        pragma Convention (C, Style_Array); + +    end Styles; + + + +      function Get_Buffer             (This : in Text_Display) -        return FLTK.Text_Buffers.Text_Buffer_Cursor; +        return FLTK.Text_Buffers.Text_Buffer_Reference;      procedure Set_Buffer             (This : in out Text_Display; @@ -41,6 +83,21 @@ package FLTK.Widgets.Groups.Text_Displays is +    procedure Highlight_Data +           (This  : in out Text_Display; +            Buff  : in out FLTK.Text_Buffers.Text_Buffer; +            Table : in     Styles.Style_Array); + +    procedure Highlight_Data +           (This       : in out Text_Display; +            Buff       : in out FLTK.Text_Buffers.Text_Buffer; +            Table      : in     Styles.Style_Array; +            Unfinished : in     Styles.Style_Index; +            Callback   : in     Styles.Unfinished_Style_Callback); + + + +      function Col_To_X             (This    : in Text_Display;              Col_Num : in Integer) @@ -117,6 +174,10 @@ package FLTK.Widgets.Groups.Text_Displays is             (This : in out Text_Display;              Item : in     String); +    procedure Overstrike +           (This : in out Text_Display; +            Text : in     String); +      function Get_Insert_Position             (This : in Text_Display)          return Natural; @@ -279,6 +340,10 @@ package FLTK.Widgets.Groups.Text_Displays is +    procedure Redisplay_Range +           (This          : in out Text_Display; +            Start, Finish : in     Natural); +      procedure Draw             (This : in out Text_Display); @@ -293,12 +358,101 @@ private      type Text_Display is new Group with          record -            Buffer : access FLTK.Text_Buffers.Text_Buffer; +            Buffer         : access FLTK.Text_Buffers.Text_Buffer; +            Style_Callback : Styles.Unfinished_Style_Callback;          end record;      overriding procedure Finalize             (This : in out Text_Display); + + +    package Text_Display_Convert is new System.Address_To_Access_Conversions (Text_Display'Class); + + + + +    pragma Inline (Get_Buffer); +    pragma Inline (Set_Buffer); + + +    pragma Inline (Highlight_Data); + + +    pragma Inline (Col_To_X); +    pragma Inline (X_To_Col); +    pragma Inline (In_Selection); +    pragma Inline (Position_To_XY); + + +    pragma Inline (Get_Cursor_Color); +    pragma Inline (Set_Cursor_Color); +    pragma Inline (Set_Cursor_Style); +    pragma Inline (Hide_Cursor); +    pragma Inline (Show_Cursor); + + +    pragma Inline (Get_Text_Color); +    pragma Inline (Set_Text_Color); +    pragma Inline (Get_Text_Font); +    pragma Inline (Set_Text_Font); +    pragma Inline (Get_Text_Size); +    pragma Inline (Set_Text_Size); + + +    pragma Inline (Insert_Text); +    pragma Inline (Overstrike); +    pragma Inline (Get_Insert_Position); +    pragma Inline (Set_Insert_Position); +    pragma Inline (Show_Insert_Position); + + +    pragma Inline (Word_Start); +    pragma Inline (Word_End); +    pragma Inline (Next_Word); +    pragma Inline (Previous_Word); +    pragma Inline (Set_Wrap_Mode); + + +    pragma Inline (Line_Start); +    pragma Inline (Line_End); +    pragma Inline (Count_Lines); +    pragma Inline (Skip_Lines); +    pragma Inline (Rewind_Lines); + + +    pragma Inline (Get_Linenumber_Alignment); +    pragma Inline (Set_Linenumber_Alignment); +    pragma Inline (Get_Linenumber_Back_Color); +    pragma Inline (Set_Linenumber_Back_Color); +    pragma Inline (Get_Linenumber_Fore_Color); +    pragma Inline (Set_Linenumber_Fore_Color); +    pragma Inline (Get_Linenumber_Font); +    pragma Inline (Set_Linenumber_Font); +    pragma Inline (Get_Linenumber_Size); +    pragma Inline (Set_Linenumber_Size); +    pragma Inline (Get_Linenumber_Width); +    pragma Inline (Set_Linenumber_Width); + + +    pragma Inline (Move_Down); +    pragma Inline (Move_Left); +    pragma Inline (Move_Right); +    pragma Inline (Move_Up); + + +    pragma Inline (Scroll_To); +    pragma Inline (Get_Scrollbar_Alignment); +    pragma Inline (Set_Scrollbar_Alignment); +    pragma Inline (Get_Scrollbar_Width); +    pragma Inline (Set_Scrollbar_Width); + + +    pragma Inline (Redisplay_Range); +    pragma Inline (Draw); +    pragma Inline (Handle); + +  end FLTK.Widgets.Groups.Text_Displays; | 
