This commit is contained in:
MatthiasWM 2023-11-29 13:16:35 +01:00
commit 06e2bd7f0e
23 changed files with 175 additions and 67 deletions

View File

@ -61,6 +61,8 @@ public:
void label(Fl_Widget*w) FL_OVERRIDE; void label(Fl_Widget*w) FL_OVERRIDE;
void label(Fl_Menu_Item*m) FL_OVERRIDE; void label(Fl_Menu_Item*m) FL_OVERRIDE;
void uncache() FL_OVERRIDE; void uncache() FL_OVERRIDE;
int cache_w() {return cache_w_;}
int cache_h() {return cache_h_;}
}; };
#endif #endif

View File

@ -383,7 +383,7 @@ public:
Fl_Fontsize size; /**< font size */ Fl_Fontsize size; /**< font size */
Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size); Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size);
virtual FL_EXPORT ~Fl_Font_Descriptor() {} virtual FL_EXPORT ~Fl_Font_Descriptor() {}
short ascent, descent; int ascent, descent;
unsigned int listbase;// base of display list, 0 = none unsigned int listbase;// base of display list, 0 = none
}; };

View File

@ -369,6 +369,8 @@ public:
void label(Fl_Widget*w) FL_OVERRIDE; void label(Fl_Widget*w) FL_OVERRIDE;
void label(Fl_Menu_Item*m) FL_OVERRIDE; void label(Fl_Menu_Item*m) FL_OVERRIDE;
void uncache() FL_OVERRIDE; void uncache() FL_OVERRIDE;
int cache_w() {return cache_w_;}
int cache_h() {return cache_h_;}
/** Sets the maximum allowed image size in bytes when creating an Fl_RGB_Image object. /** Sets the maximum allowed image size in bytes when creating an Fl_RGB_Image object.
The image size in bytes of an Fl_RGB_Image object is the value of the product w() * h() * d(). The image size in bytes of an Fl_RGB_Image object is the value of the product w() * h() * d().

View File

@ -72,6 +72,8 @@ public:
void label(Fl_Widget*w) FL_OVERRIDE; void label(Fl_Widget*w) FL_OVERRIDE;
void label(Fl_Menu_Item*m) FL_OVERRIDE; void label(Fl_Menu_Item*m) FL_OVERRIDE;
void uncache() FL_OVERRIDE; void uncache() FL_OVERRIDE;
int cache_w() {return cache_w_;}
int cache_h() {return cache_h_;}
}; };
#endif #endif

View File

@ -498,7 +498,7 @@ protected:
int leftClip, int rightClip) const; int leftClip, int rightClip) const;
int handle_rmb(int readonly); int handle_rmb(int readonly);
void draw_line_numbers(bool clearAll); void draw_line_numbers(bool clearAll);
void clear_rect(int style, int x, int y, int width, int height) const; void clear_rect(int style, int x, int y, int width, int height) const;

View File

@ -868,7 +868,7 @@ public:
int tsize_; int tsize_;
Fl_Color tcolor_; Fl_Color tcolor_;
Fl_Batchmode_Terminal(int x, int y, int w, int h, const char *l=NULL) Fl_Batchmode_Terminal(int x, int y, int w, int h, const char *l=NULL)
: Fl_Group(x, y, w, h, l) : Fl_Group(x, y, w, h, l)
{ // set the defaults that Fl_Terminal would set { // set the defaults that Fl_Terminal would set
box(FL_DOWN_BOX); box(FL_DOWN_BOX);
color(FL_FOREGROUND_COLOR); color(FL_FOREGROUND_COLOR);

View File

@ -74,11 +74,11 @@ alignment_panel.o: ../FL/Fl_Scheme.H
alignment_panel.o: ../FL/Fl_Scheme_Choice.H alignment_panel.o: ../FL/Fl_Scheme_Choice.H
alignment_panel.o: ../FL/Fl_Scrollbar.H alignment_panel.o: ../FL/Fl_Scrollbar.H
alignment_panel.o: ../FL/Fl_Shortcut_Button.H alignment_panel.o: ../FL/Fl_Shortcut_Button.H
alignment_panel.o: ../FL/Fl_Simple_Terminal.H
alignment_panel.o: ../FL/Fl_Slider.H alignment_panel.o: ../FL/Fl_Slider.H
alignment_panel.o: ../FL/Fl_Spinner.H alignment_panel.o: ../FL/Fl_Spinner.H
alignment_panel.o: ../FL/fl_string_functions.h alignment_panel.o: ../FL/fl_string_functions.h
alignment_panel.o: ../FL/Fl_Tabs.H alignment_panel.o: ../FL/Fl_Tabs.H
alignment_panel.o: ../FL/Fl_Terminal.H
alignment_panel.o: ../FL/Fl_Text_Buffer.H alignment_panel.o: ../FL/Fl_Text_Buffer.H
alignment_panel.o: ../FL/Fl_Text_Display.H alignment_panel.o: ../FL/Fl_Text_Display.H
alignment_panel.o: ../FL/Fl_Text_Editor.H alignment_panel.o: ../FL/Fl_Text_Editor.H
@ -363,10 +363,10 @@ factory.o: ../FL/Fl_Repeat_Button.H
factory.o: ../FL/Fl_RGB_Image.H factory.o: ../FL/Fl_RGB_Image.H
factory.o: ../FL/Fl_Roller.H factory.o: ../FL/Fl_Roller.H
factory.o: ../FL/Fl_Scrollbar.H factory.o: ../FL/Fl_Scrollbar.H
factory.o: ../FL/Fl_Simple_Terminal.H
factory.o: ../FL/Fl_Slider.H factory.o: ../FL/Fl_Slider.H
factory.o: ../FL/Fl_Spinner.H factory.o: ../FL/Fl_Spinner.H
factory.o: ../FL/Fl_Tabs.H factory.o: ../FL/Fl_Tabs.H
factory.o: ../FL/Fl_Terminal.H
factory.o: ../FL/Fl_Text_Buffer.H factory.o: ../FL/Fl_Text_Buffer.H
factory.o: ../FL/Fl_Text_Display.H factory.o: ../FL/Fl_Text_Display.H
factory.o: ../FL/Fl_Text_Editor.H factory.o: ../FL/Fl_Text_Editor.H
@ -448,11 +448,11 @@ Fd_Snap_Action.o: ../FL/Fl_Scheme.H
Fd_Snap_Action.o: ../FL/Fl_Scheme_Choice.H Fd_Snap_Action.o: ../FL/Fl_Scheme_Choice.H
Fd_Snap_Action.o: ../FL/Fl_Scrollbar.H Fd_Snap_Action.o: ../FL/Fl_Scrollbar.H
Fd_Snap_Action.o: ../FL/Fl_Shortcut_Button.H Fd_Snap_Action.o: ../FL/Fl_Shortcut_Button.H
Fd_Snap_Action.o: ../FL/Fl_Simple_Terminal.H
Fd_Snap_Action.o: ../FL/Fl_Slider.H Fd_Snap_Action.o: ../FL/Fl_Slider.H
Fd_Snap_Action.o: ../FL/Fl_Spinner.H Fd_Snap_Action.o: ../FL/Fl_Spinner.H
Fd_Snap_Action.o: ../FL/fl_string_functions.h Fd_Snap_Action.o: ../FL/fl_string_functions.h
Fd_Snap_Action.o: ../FL/Fl_Tabs.H Fd_Snap_Action.o: ../FL/Fl_Tabs.H
Fd_Snap_Action.o: ../FL/Fl_Terminal.H
Fd_Snap_Action.o: ../FL/Fl_Text_Buffer.H Fd_Snap_Action.o: ../FL/Fl_Text_Buffer.H
Fd_Snap_Action.o: ../FL/Fl_Text_Display.H Fd_Snap_Action.o: ../FL/Fl_Text_Display.H
Fd_Snap_Action.o: ../FL/Fl_Text_Editor.H Fd_Snap_Action.o: ../FL/Fl_Text_Editor.H
@ -530,11 +530,11 @@ file.o: ../FL/Fl_Scheme_Choice.H
file.o: ../FL/Fl_Scrollbar.H file.o: ../FL/Fl_Scrollbar.H
file.o: ../FL/Fl_Shared_Image.H file.o: ../FL/Fl_Shared_Image.H
file.o: ../FL/Fl_Shortcut_Button.H file.o: ../FL/Fl_Shortcut_Button.H
file.o: ../FL/Fl_Simple_Terminal.H
file.o: ../FL/Fl_Slider.H file.o: ../FL/Fl_Slider.H
file.o: ../FL/Fl_Spinner.H file.o: ../FL/Fl_Spinner.H
file.o: ../FL/fl_string_functions.h file.o: ../FL/fl_string_functions.h
file.o: ../FL/Fl_Tabs.H file.o: ../FL/Fl_Tabs.H
file.o: ../FL/Fl_Terminal.H
file.o: ../FL/Fl_Text_Buffer.H file.o: ../FL/Fl_Text_Buffer.H
file.o: ../FL/Fl_Text_Display.H file.o: ../FL/Fl_Text_Display.H
file.o: ../FL/Fl_Text_Editor.H file.o: ../FL/Fl_Text_Editor.H
@ -623,11 +623,11 @@ fluid.o: ../FL/Fl_Scheme_Choice.H
fluid.o: ../FL/Fl_Scrollbar.H fluid.o: ../FL/Fl_Scrollbar.H
fluid.o: ../FL/Fl_Shared_Image.H fluid.o: ../FL/Fl_Shared_Image.H
fluid.o: ../FL/Fl_Shortcut_Button.H fluid.o: ../FL/Fl_Shortcut_Button.H
fluid.o: ../FL/Fl_Simple_Terminal.H
fluid.o: ../FL/Fl_Slider.H fluid.o: ../FL/Fl_Slider.H
fluid.o: ../FL/Fl_Spinner.H fluid.o: ../FL/Fl_Spinner.H
fluid.o: ../FL/fl_string_functions.h fluid.o: ../FL/fl_string_functions.h
fluid.o: ../FL/Fl_Tabs.H fluid.o: ../FL/Fl_Tabs.H
fluid.o: ../FL/Fl_Terminal.H
fluid.o: ../FL/Fl_Text_Buffer.H fluid.o: ../FL/Fl_Text_Buffer.H
fluid.o: ../FL/Fl_Text_Display.H fluid.o: ../FL/Fl_Text_Display.H
fluid.o: ../FL/Fl_Text_Editor.H fluid.o: ../FL/Fl_Text_Editor.H
@ -869,6 +869,7 @@ Fl_Function_Type.o: Fl_Window_Type.h
Fl_Function_Type.o: function_panel.h Fl_Function_Type.o: function_panel.h
Fl_Function_Type.o: mergeback.h Fl_Function_Type.o: mergeback.h
Fl_Function_Type.o: StyleParse.h Fl_Function_Type.o: StyleParse.h
Fl_Function_Type.o: undo.h
Fl_Function_Type.o: widget_browser.h Fl_Function_Type.o: widget_browser.h
Fl_Grid_Type.o: ../config.h Fl_Grid_Type.o: ../config.h
Fl_Grid_Type.o: ../FL/Enumerations.H Fl_Grid_Type.o: ../FL/Enumerations.H
@ -1149,12 +1150,12 @@ Fl_Widget_Type.o: ../FL/Fl_Scrollbar.H
Fl_Widget_Type.o: ../FL/Fl_Shared_Image.H Fl_Widget_Type.o: ../FL/Fl_Shared_Image.H
Fl_Widget_Type.o: ../FL/Fl_Shortcut_Button.H Fl_Widget_Type.o: ../FL/Fl_Shortcut_Button.H
Fl_Widget_Type.o: ../FL/fl_show_colormap.H Fl_Widget_Type.o: ../FL/fl_show_colormap.H
Fl_Widget_Type.o: ../FL/Fl_Simple_Terminal.H
Fl_Widget_Type.o: ../FL/Fl_Slider.H Fl_Widget_Type.o: ../FL/Fl_Slider.H
Fl_Widget_Type.o: ../FL/Fl_Spinner.H Fl_Widget_Type.o: ../FL/Fl_Spinner.H
Fl_Widget_Type.o: ../FL/fl_string_functions.h Fl_Widget_Type.o: ../FL/fl_string_functions.h
Fl_Widget_Type.o: ../FL/Fl_Table.H Fl_Widget_Type.o: ../FL/Fl_Table.H
Fl_Widget_Type.o: ../FL/Fl_Tabs.H Fl_Widget_Type.o: ../FL/Fl_Tabs.H
Fl_Widget_Type.o: ../FL/Fl_Terminal.H
Fl_Widget_Type.o: ../FL/Fl_Text_Buffer.H Fl_Widget_Type.o: ../FL/Fl_Text_Buffer.H
Fl_Widget_Type.o: ../FL/Fl_Text_Display.H Fl_Widget_Type.o: ../FL/Fl_Text_Display.H
Fl_Widget_Type.o: ../FL/Fl_Text_Editor.H Fl_Widget_Type.o: ../FL/Fl_Text_Editor.H
@ -1247,11 +1248,11 @@ Fl_Window_Type.o: ../FL/Fl_Scheme_Choice.H
Fl_Window_Type.o: ../FL/Fl_Scrollbar.H Fl_Window_Type.o: ../FL/Fl_Scrollbar.H
Fl_Window_Type.o: ../FL/Fl_Shared_Image.H Fl_Window_Type.o: ../FL/Fl_Shared_Image.H
Fl_Window_Type.o: ../FL/Fl_Shortcut_Button.H Fl_Window_Type.o: ../FL/Fl_Shortcut_Button.H
Fl_Window_Type.o: ../FL/Fl_Simple_Terminal.H
Fl_Window_Type.o: ../FL/Fl_Slider.H Fl_Window_Type.o: ../FL/Fl_Slider.H
Fl_Window_Type.o: ../FL/Fl_Spinner.H Fl_Window_Type.o: ../FL/Fl_Spinner.H
Fl_Window_Type.o: ../FL/fl_string_functions.h Fl_Window_Type.o: ../FL/fl_string_functions.h
Fl_Window_Type.o: ../FL/Fl_Tabs.H Fl_Window_Type.o: ../FL/Fl_Tabs.H
Fl_Window_Type.o: ../FL/Fl_Terminal.H
Fl_Window_Type.o: ../FL/Fl_Text_Buffer.H Fl_Window_Type.o: ../FL/Fl_Text_Buffer.H
Fl_Window_Type.o: ../FL/Fl_Text_Display.H Fl_Window_Type.o: ../FL/Fl_Text_Display.H
Fl_Window_Type.o: ../FL/Fl_Text_Editor.H Fl_Window_Type.o: ../FL/Fl_Text_Editor.H
@ -1299,7 +1300,6 @@ function_panel.o: ../FL/Fl_Browser_.H
function_panel.o: ../FL/Fl_Button.H function_panel.o: ../FL/Fl_Button.H
function_panel.o: ../FL/Fl_Cairo.H function_panel.o: ../FL/Fl_Cairo.H
function_panel.o: ../FL/fl_casts.H function_panel.o: ../FL/fl_casts.H
function_panel.o: ../FL/Fl_Check_Button.H
function_panel.o: ../FL/Fl_Choice.H function_panel.o: ../FL/Fl_Choice.H
function_panel.o: ../FL/fl_config.h function_panel.o: ../FL/fl_config.h
function_panel.o: ../FL/Fl_Device.H function_panel.o: ../FL/Fl_Device.H
@ -1478,11 +1478,11 @@ shell_command.o: ../FL/Fl_Scheme.H
shell_command.o: ../FL/Fl_Scheme_Choice.H shell_command.o: ../FL/Fl_Scheme_Choice.H
shell_command.o: ../FL/Fl_Scrollbar.H shell_command.o: ../FL/Fl_Scrollbar.H
shell_command.o: ../FL/Fl_Shortcut_Button.H shell_command.o: ../FL/Fl_Shortcut_Button.H
shell_command.o: ../FL/Fl_Simple_Terminal.H
shell_command.o: ../FL/Fl_Slider.H shell_command.o: ../FL/Fl_Slider.H
shell_command.o: ../FL/Fl_Spinner.H shell_command.o: ../FL/Fl_Spinner.H
shell_command.o: ../FL/fl_string_functions.h shell_command.o: ../FL/fl_string_functions.h
shell_command.o: ../FL/Fl_Tabs.H shell_command.o: ../FL/Fl_Tabs.H
shell_command.o: ../FL/Fl_Terminal.H
shell_command.o: ../FL/Fl_Text_Buffer.H shell_command.o: ../FL/Fl_Text_Buffer.H
shell_command.o: ../FL/Fl_Text_Display.H shell_command.o: ../FL/Fl_Text_Display.H
shell_command.o: ../FL/Fl_Text_Editor.H shell_command.o: ../FL/Fl_Text_Editor.H

View File

@ -32,7 +32,7 @@ extern void reveal_in_browser(Fl_Type *t);
/** /**
Update the header and source code highlighting depending on the Update the header and source code highlighting depending on the
currently selected object currently selected object
The Source View system offers an immediate preview of the code The Source View system offers an immediate preview of the code
files that will be generated by FLUID. It also marks the code files that will be generated by FLUID. It also marks the code
generated for the last selected item in the header and the source generated for the last selected item in the header and the source

View File

@ -307,7 +307,7 @@ void template_load() {
"er\n}\n", f); "er\n}\n", f);
fclose(f); fclose(f);
} }
template_install(path, "/FLTK_License.fl", tmpl_FLTK_License_fl, sizeof(tmpl_FLTK_License_fl), tmpl_FLTK_License_fl_size); template_install(path, "/FLTK_License.fl", tmpl_FLTK_License_fl, sizeof(tmpl_FLTK_License_fl), tmpl_FLTK_License_fl_size);
template_install(path, "/1of7GUIs.fl", tmpl_1of7GUIs_fl, sizeof(tmpl_1of7GUIs_fl), tmpl_1of7GUIs_fl_size); template_install(path, "/1of7GUIs.fl", tmpl_1of7GUIs_fl, sizeof(tmpl_1of7GUIs_fl), tmpl_1of7GUIs_fl_size);
sample_templates_generated = 2; sample_templates_generated = 2;

View File

@ -265,7 +265,7 @@ if (sample_templates_generated < 2) {
"er\\n}\\n", f); "er\\n}\\n", f);
fclose(f); fclose(f);
} }
template_install(path, "/FLTK_License.fl", tmpl_FLTK_License_fl, sizeof(tmpl_FLTK_License_fl), tmpl_FLTK_License_fl_size); template_install(path, "/FLTK_License.fl", tmpl_FLTK_License_fl, sizeof(tmpl_FLTK_License_fl), tmpl_FLTK_License_fl_size);
template_install(path, "/1of7GUIs.fl", tmpl_1of7GUIs_fl, sizeof(tmpl_1of7GUIs_fl), tmpl_1of7GUIs_fl_size); template_install(path, "/1of7GUIs.fl", tmpl_1of7GUIs_fl, sizeof(tmpl_1of7GUIs_fl), tmpl_1of7GUIs_fl_size);
sample_templates_generated = 2; sample_templates_generated = 2;

View File

@ -42,8 +42,6 @@ get_setting_sync(DBusConnection *const connection,
DBusMessage *message; DBusMessage *message;
DBusMessage *reply; DBusMessage *reply;
dbus_error_init(&error);
message = dbus_message_new_method_call( message = dbus_message_new_method_call(
"org.freedesktop.portal.Desktop", "org.freedesktop.portal.Desktop",
"/org/freedesktop/portal/desktop", "/org/freedesktop/portal/desktop",
@ -58,6 +56,8 @@ get_setting_sync(DBusConnection *const connection,
if (!success) if (!success)
return NULL; return NULL;
dbus_error_init(&error);
reply = dbus_connection_send_with_reply_and_block( reply = dbus_connection_send_with_reply_and_block(
connection, connection,
message, message,
@ -66,9 +66,12 @@ get_setting_sync(DBusConnection *const connection,
dbus_message_unref(message); dbus_message_unref(message);
if (dbus_error_is_set(&error)) if (dbus_error_is_set(&error)) {
dbus_error_free(&error);
return NULL; return NULL;
}
dbus_error_free(&error);
return reply; return reply;
} }

View File

@ -953,9 +953,9 @@ J1:
*/ */
Fl_Browser_::Fl_Browser_(int X, int Y, int W, int H, const char* L) Fl_Browser_::Fl_Browser_(int X, int Y, int W, int H, const char* L)
: Fl_Group(X, Y, W, H, L), : Fl_Group(X, Y, W, H, L),
linespacing_(0),
scrollbar(0, 0, 0, 0, 0), // they will be resized by draw() scrollbar(0, 0, 0, 0, 0), // they will be resized by draw()
hscrollbar(0, 0, 0, 0, 0), hscrollbar(0, 0, 0, 0, 0)
linespacing_(0)
{ {
box(FL_NO_BOX); box(FL_NO_BOX);
align(FL_ALIGN_BOTTOM); align(FL_ALIGN_BOTTOM);

View File

@ -56,7 +56,7 @@
In this mode, the child that is marked resizable() will behave as it would In this mode, the child that is marked resizable() will behave as it would
in a regular Fl_Group widget. in a regular Fl_Group widget.
When dragging edges or intersections with the mouse, Fl_Tile will ensure that When dragging edges or intersections with the mouse, Fl_Tile will ensure that
none of the children shrinks to a size that is smaller than requested. none of the children shrinks to a size that is smaller than requested.
When resizing the Fl_Tile group, size ranges are not enforced by the tile. When resizing the Fl_Tile group, size ranges are not enforced by the tile.
Instead, the size range of the enclosing window should be limited to a Instead, the size range of the enclosing window should be limited to a
valid range. valid range.
@ -155,7 +155,7 @@ static Fl_Cursor Fl_Tile_cursors[4] = {
static int fl_min(int a, int b) { return a<b ? a : b; } static int fl_min(int a, int b) { return a<b ? a : b; }
static int fl_max(int a, int b) { return a>b ? a : b; } static int fl_max(int a, int b) { return a>b ? a : b; }
/** /**
Request for children to change their layout. Request for children to change their layout.
drag_intersection requests that all children with the left edge at old_l to drag_intersection requests that all children with the left edge at old_l to
@ -695,7 +695,7 @@ int Fl_Tile::handle(int event) {
// if (damage()) return 1; // don't fall behind // if (damage()) return 1; // don't fall behind
case FL_RELEASE: { case FL_RELEASE: {
if (!sdrag) break; if (!sdrag) break;
Fl_Widget* r = resizable(); Fl_Widget* r = resizable();
if (size_range_ || !r) r = this; if (size_range_ || !r) r = this;
int newx; int newx;
if (sdrag&DRAGH) { if (sdrag&DRAGH) {

View File

@ -153,7 +153,7 @@ public:
void ps_translate(int, int); void ps_translate(int, int);
void ps_untranslate(); void ps_untranslate();
void draw_cached_pattern_(Fl_Image *img, cairo_pattern_t *pat, int X, int Y, int W, int H, int cx, int cy); void draw_cached_pattern_(Fl_Image *img, cairo_pattern_t *pat, int X, int Y, int W, int H, int cx, int cy, int cache_w, int cache_h);
void draw_image(const uchar *data, int ix, int iy, int iw, int ih, int D, int LD) FL_OVERRIDE; void draw_image(const uchar *data, int ix, int iy, int iw, int ih, int D, int LD) FL_OVERRIDE;
void draw_rgb(Fl_RGB_Image *rgb,int XP, int YP, int WP, int HP, int cx, int cy) FL_OVERRIDE; void draw_rgb(Fl_RGB_Image *rgb,int XP, int YP, int WP, int HP, int cx, int cy) FL_OVERRIDE;
void cache(Fl_RGB_Image *rgb) FL_OVERRIDE; void cache(Fl_RGB_Image *rgb) FL_OVERRIDE;

View File

@ -783,7 +783,7 @@ void Fl_Cairo_Graphics_Driver::overlay_rect(int x, int y, int w , int h) {
} }
void Fl_Cairo_Graphics_Driver::draw_cached_pattern_(Fl_Image *img, cairo_pattern_t *pat, int X, int Y, int W, int H, int cx, int cy) { void Fl_Cairo_Graphics_Driver::draw_cached_pattern_(Fl_Image *img, cairo_pattern_t *pat, int X, int Y, int W, int H, int cx, int cy, int cache_w, int cache_h) {
// compute size of output image in drawing units // compute size of output image in drawing units
cairo_matrix_t matrix; cairo_matrix_t matrix;
cairo_get_matrix(cairo_, &matrix); cairo_get_matrix(cairo_, &matrix);
@ -794,7 +794,7 @@ void Fl_Cairo_Graphics_Driver::draw_cached_pattern_(Fl_Image *img, cairo_pattern
int Hs = Fl_Scalable_Graphics_Driver::floor(Y - cy + img->h(), s) - Ys; int Hs = Fl_Scalable_Graphics_Driver::floor(Y - cy + img->h(), s) - Ys;
if (Ws == 0 || Hs == 0) return; if (Ws == 0 || Hs == 0) return;
cairo_save(cairo_); cairo_save(cairo_);
bool need_extend = (img->data_w() != Ws || img->data_h() != Hs || (W >= 2 && H >= 2)); bool need_extend = (cache_w != Ws || cache_h != Hs || (W >= 2 && H >= 2));
if (need_extend || cx || cy || W < img->w() || H < img->h()) { // clip when necessary if (need_extend || cx || cy || W < img->w() || H < img->h()) { // clip when necessary
cairo_rectangle(cairo_, X - 0.5, Y - 0.5, W + 0.5, H + 0.5); cairo_rectangle(cairo_, X - 0.5, Y - 0.5, W + 0.5, H + 0.5);
cairo_clip(cairo_); cairo_clip(cairo_);
@ -805,11 +805,12 @@ void Fl_Cairo_Graphics_Driver::draw_cached_pattern_(Fl_Image *img, cairo_pattern
cairo_set_matrix(cairo_, &matrix); cairo_set_matrix(cairo_, &matrix);
if (img->d() >= 1) cairo_set_source(cairo_, pat); if (img->d() >= 1) cairo_set_source(cairo_, pat);
if (need_extend) { if (need_extend) {
cairo_pattern_set_filter(pat, Fl_RGB_Image::scaling_algorithm() == FL_RGB_SCALING_BILINEAR ? bool condition = Fl_RGB_Image::scaling_algorithm() == FL_RGB_SCALING_BILINEAR &&
CAIRO_FILTER_GOOD : CAIRO_FILTER_FAST); (fabs(Ws/float(cache_w) - 1) > 0.02 || fabs(Hs/float(cache_h) - 1) > 0.02);
cairo_pattern_set_filter(pat, condition ? CAIRO_FILTER_GOOD : CAIRO_FILTER_FAST);
cairo_pattern_set_extend(pat, CAIRO_EXTEND_PAD); cairo_pattern_set_extend(pat, CAIRO_EXTEND_PAD);
} }
cairo_matrix_init_scale(&matrix, double(img->data_w())/Ws, double(img->data_h())/Hs); cairo_matrix_init_scale(&matrix, double(cache_w)/Ws, double(cache_h)/Hs);
cairo_matrix_translate(&matrix, -Xs , -Ys ); cairo_matrix_translate(&matrix, -Xs , -Ys );
cairo_pattern_set_matrix(pat, &matrix); cairo_pattern_set_matrix(pat, &matrix);
if (img->d() > 1) cairo_paint(cairo_); if (img->d() > 1) cairo_paint(cairo_);
@ -834,7 +835,7 @@ void Fl_Cairo_Graphics_Driver::draw_rgb(Fl_RGB_Image *rgb,int XP, int YP, int WP
cache(rgb); cache(rgb);
pat = (cairo_pattern_t*)*Fl_Graphics_Driver::id(rgb); pat = (cairo_pattern_t*)*Fl_Graphics_Driver::id(rgb);
} }
draw_cached_pattern_(rgb, pat, X, Y, W, H, cx, cy); draw_cached_pattern_(rgb, pat, X, Y, W, H, cx, cy, rgb->cache_w(), rgb->cache_h());
} }
@ -909,7 +910,7 @@ void Fl_Cairo_Graphics_Driver::uncache(Fl_RGB_Image *img, fl_uintptr_t &id_, fl_
} }
void Fl_Cairo_Graphics_Driver::draw_fixed(Fl_Bitmap *bm,int XP, int YP, int WP, int HP, void Fl_Cairo_Graphics_Driver::draw_fixed(Fl_Bitmap *bm,int XP, int YP, int WP, int HP,
int cx, int cy) { int cx, int cy) {
cairo_pattern_t *pat = NULL; cairo_pattern_t *pat = NULL;
float s = wld_scale * scale(); float s = wld_scale * scale();
@ -927,7 +928,10 @@ void Fl_Cairo_Graphics_Driver::draw_fixed(Fl_Bitmap *bm,int XP, int YP, int WP,
} else { } else {
pat = (cairo_pattern_t*)*Fl_Graphics_Driver::id(bm); pat = (cairo_pattern_t*)*Fl_Graphics_Driver::id(bm);
color(color()); color(color());
draw_cached_pattern_(bm, pat, XP, YP, WP, HP, cx, cy); int old_w = bm->w(), old_h = bm->h();
bm->scale(bm->cache_w(), bm->cache_h(), 0, 1); // transiently
draw_cached_pattern_(bm, pat, XP, YP, WP, HP, cx, cy, bm->cache_w(), bm->cache_h());
bm->scale(old_w, old_h, 0, 1); // back
} }
cairo_set_matrix(cairo_, &matrix); cairo_set_matrix(cairo_, &matrix);
} }
@ -995,7 +999,7 @@ void Fl_Cairo_Graphics_Driver::cache(Fl_Bitmap *bm) {
} }
void Fl_Cairo_Graphics_Driver::draw_fixed(Fl_Pixmap *pxm,int XP, int YP, int WP, int HP, void Fl_Cairo_Graphics_Driver::draw_fixed(Fl_Pixmap *pxm,int XP, int YP, int WP, int HP,
int cx, int cy) { int cx, int cy) {
cairo_pattern_t *pat = NULL; cairo_pattern_t *pat = NULL;
float s = wld_scale * scale(); float s = wld_scale * scale();
@ -1013,7 +1017,10 @@ void Fl_Cairo_Graphics_Driver::draw_fixed(Fl_Pixmap *pxm,int XP, int YP, int WP,
Fl_Graphics_Driver::draw_empty(pxm, XP, YP); Fl_Graphics_Driver::draw_empty(pxm, XP, YP);
} else { } else {
pat = (cairo_pattern_t*)*Fl_Graphics_Driver::id(pxm); pat = (cairo_pattern_t*)*Fl_Graphics_Driver::id(pxm);
draw_cached_pattern_(pxm, pat, XP, YP, WP, HP, cx, cy); int old_w = pxm->w(), old_h = pxm->h();
pxm->scale(pxm->cache_w(), pxm->cache_h(), 0, 1); // transiently
draw_cached_pattern_(pxm, pat, XP, YP, WP, HP, cx, cy, pxm->cache_w(), pxm->cache_h());
pxm->scale(old_w, old_h, 0, 1); // back
} }
cairo_set_matrix(cairo_, &matrix); cairo_set_matrix(cairo_, &matrix);
} }

View File

@ -145,12 +145,11 @@ Fl_PostScript_Graphics_Driver::Fl_PostScript_Graphics_Driver(void)
//lang_level_ = 3; //lang_level_ = 3;
lang_level_ = 2; lang_level_ = 2;
mask = 0; mask = 0;
#endif
ps_filename_ = NULL;
scale_x = scale_y = 1.;
bg_r = bg_g = bg_b = 255; bg_r = bg_g = bg_b = 255;
clip_ = NULL; clip_ = NULL;
what = NONE; scale_x = scale_y = 1.;
#endif
ps_filename_ = NULL;
} }
/** \brief The destructor. */ /** \brief The destructor. */
@ -1750,9 +1749,9 @@ Fl_EPS_File_Surface::Fl_EPS_File_Surface(int width, int height, FILE *eps, Fl_Co
if (s != 1) { if (s != 1) {
ps->clocale_printf("GR GR GS %f %f SC GS\n", s, s); ps->clocale_printf("GR GR GS %f %f SC GS\n", s, s);
} }
Fl::get_color(background, ps->bg_r, ps->bg_g, ps->bg_b);
#endif #endif
ps->scale_x = ps->scale_y = s; ps->scale_x = ps->scale_y = s;
Fl::get_color(background, ps->bg_r, ps->bg_g, ps->bg_b);
} }
} }

View File

@ -1,7 +1,7 @@
// //
// Support for graphics output to PostScript file for the Fast Light Tool Kit (FLTK). // Support for graphics output to PostScript file for the Fast Light Tool Kit (FLTK).
// //
// Copyright 2010-2022 by Bill Spitzak and others. // Copyright 2010-2023 by Bill Spitzak and others.
// //
// This library is free software. Distribution and use rights are outlined in // This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this // the file "COPYING" which should have been included with this file. If this
@ -49,7 +49,6 @@ public:
char *ps_filename_; char *ps_filename_;
int nPages; int nPages;
double pw_, ph_; double pw_, ph_;
uchar bg_r, bg_g, bg_b;
Fl_PostScript_Graphics_Driver(); Fl_PostScript_Graphics_Driver();
~Fl_PostScript_Graphics_Driver(); ~Fl_PostScript_Graphics_Driver();
@ -80,11 +79,13 @@ public:
int not_clipped(int x, int y, int w, int h) FL_OVERRIDE; int not_clipped(int x, int y, int w, int h) FL_OVERRIDE;
int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H) FL_OVERRIDE; int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H) FL_OVERRIDE;
virtual int has_feature(driver_feature feature_mask) FL_OVERRIDE { return feature_mask & PRINTER; } virtual int has_feature(driver_feature feature_mask) FL_OVERRIDE { return feature_mask & PRINTER; }
#if !FLTK_USE_CAIRO
// draw image classes without caching them // draw image classes without caching them
void draw_rgb_bitmap_(Fl_Image *img,int XP, int YP, int WP, int HP, int cx, int cy); void draw_rgb_bitmap_(Fl_Image *img,int XP, int YP, int WP, int HP, int cx, int cy);
void draw_pixmap(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy) FL_OVERRIDE; void draw_pixmap(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy) FL_OVERRIDE;
void draw_bitmap(Fl_Bitmap * bitmap,int XP, int YP, int WP, int HP, int cx, int cy) FL_OVERRIDE; void draw_bitmap(Fl_Bitmap * bitmap,int XP, int YP, int WP, int HP, int cx, int cy) FL_OVERRIDE;
void draw_rgb(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy) FL_OVERRIDE; void draw_rgb(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy) FL_OVERRIDE;
#endif // !FLTK_USE_CAIRO
}; };
#else // ! USE_PANGO #else // ! USE_PANGO

View File

@ -1,7 +1,7 @@
// //
// Postscript image drawing implementation for the Fast Light Tool Kit (FLTK). // Postscript image drawing implementation for the Fast Light Tool Kit (FLTK).
// //
// Copyright 1998-2022 by Bill Spitzak and others. // Copyright 1998-2023 by Bill Spitzak and others.
// //
// This library is free software. Distribution and use rights are outlined in // This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this // the file "COPYING" which should have been included with this file. If this
@ -68,7 +68,9 @@ void Fl_PostScript_Graphics_Driver::draw_image(const uchar *data, int ix, int iy
draw_image(draw_image_cb, &cb_data, ix, iy, iw, ih, abs(D)); draw_image(draw_image_cb, &cb_data, ix, iy, iw, ih, abs(D));
} }
#if USE_PANGO #if USE_PANGO
#if !FLTK_USE_CAIRO
static void destroy_BGRA(void *data) { static void destroy_BGRA(void *data) {
delete[] (uchar*)data; delete[] (uchar*)data;
@ -180,7 +182,9 @@ void Fl_PostScript_Graphics_Driver::draw_rgb_bitmap_(Fl_Image *img,int XP, int Y
} }
} }
#else // USE_PANGO #endif // !FLTK_USE_CAIRO
#else // ! USE_PANGO
// //
// Implementation of the /ASCII85Encode PostScript filter // Implementation of the /ASCII85Encode PostScript filter

View File

@ -46,6 +46,8 @@ private:
void swap_buffers() FL_OVERRIDE; void swap_buffers() FL_OVERRIDE;
void resize(int is_a_resize, int w, int h) FL_OVERRIDE; void resize(int is_a_resize, int w, int h) FL_OVERRIDE;
char swap_type() FL_OVERRIDE; char swap_type() FL_OVERRIDE;
void swap_interval(int) FL_OVERRIDE;
int swap_interval() const FL_OVERRIDE;
Fl_Gl_Choice *find(int m, const int *alistp) FL_OVERRIDE; Fl_Gl_Choice *find(int m, const int *alistp) FL_OVERRIDE;
GLContext create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g) FL_OVERRIDE; GLContext create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g) FL_OVERRIDE;
void set_gl_context(Fl_Window* w, GLContext context) FL_OVERRIDE; void set_gl_context(Fl_Window* w, GLContext context) FL_OVERRIDE;

View File

@ -63,6 +63,9 @@ struct gl_start_support { // to support use of gl_start / gl_finish
static EGLConfig wld_egl_conf = NULL; static EGLConfig wld_egl_conf = NULL;
static EGLint swap_interval_ = 1;
static EGLint max_swap_interval = 1000;
static EGLint min_swap_interval = 0;
EGLDisplay Fl_Wayland_Gl_Window_Driver::egl_display = EGL_NO_DISPLAY; EGLDisplay Fl_Wayland_Gl_Window_Driver::egl_display = EGL_NO_DISPLAY;
@ -170,6 +173,9 @@ Fl_Gl_Choice *Fl_Wayland_Gl_Window_Driver::find(int m, const int *alistp)
Fl::fatal("failed to choose an EGL config\n"); Fl::fatal("failed to choose an EGL config\n");
} }
eglGetConfigAttrib(egl_display, g->egl_conf, EGL_MAX_SWAP_INTERVAL, &max_swap_interval);
eglGetConfigAttrib(egl_display, g->egl_conf, EGL_MIN_SWAP_INTERVAL, &min_swap_interval);
first = g; first = g;
return g; return g;
} }
@ -431,6 +437,18 @@ void Fl_Wayland_Gl_Window_Driver::gl_start() {
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
} }
void Fl_Wayland_Gl_Window_Driver::swap_interval(int interval) {
if (interval < min_swap_interval) interval = min_swap_interval;
if (interval > max_swap_interval) interval = max_swap_interval;
if (egl_display && eglSwapInterval(egl_display, interval))
swap_interval_ = interval;
// printf("swap_interval_=%d\n",swap_interval_);
}
int Fl_Wayland_Gl_Window_Driver::swap_interval() const {
return swap_interval_;
}
FL_EXPORT EGLContext fl_wl_glcontext(GLContext rc) { return (EGLContext)rc; } FL_EXPORT EGLContext fl_wl_glcontext(GLContext rc) { return (EGLContext)rc; }

View File

@ -397,41 +397,90 @@ char Fl_X11_Gl_Window_Driver::swap_type() {
return copy; return copy;
} }
typedef void (*SWAPINTERVALPROC) (Display *dpy, GLXDrawable drawable, int interval);
static SWAPINTERVALPROC glXSwapIntervalEXT = NULL; // Start of swap_interval implementation in the three possibel ways for X11
static bool glXSwapIntervalChecked = false;
static void checkGlxXSwapInterval() { // -1 = not yet initialized, 0 = none found, 1 = GLX, 2 = MESA, 3 = SGI
if (!glXSwapIntervalChecked) { static signed char swap_interval_type = -1;
glXSwapIntervalChecked = true;
glXSwapIntervalEXT = (SWAPINTERVALPROC)glXGetProcAddressARB((const GLubyte*)"glXSwapIntervalEXT"); typedef void (*GLX_Set_Swap_Iterval_Proc) (Display *dpy, GLXDrawable drawable, int interval);
typedef int (*MESA_Set_Swap_Iterval_Proc) (unsigned int interval);
typedef int (*MESA_Get_Swap_Iterval_Proc) ();
typedef int (*SGI_Set_Swap_Iterval_Proc) (int interval);
static union {
GLX_Set_Swap_Iterval_Proc glXSwapIntervalEXT = NULL;
MESA_Set_Swap_Iterval_Proc glXSwapIntervalMESA;
SGI_Set_Swap_Iterval_Proc glXSwapIntervalSGI;
};
static MESA_Get_Swap_Iterval_Proc glXGetSwapIntervalMESA = NULL;
static void init_swap_interval() {
if (swap_interval_type != -1) return;
int major = 1, minor = 0;
glXQueryVersion(fl_display, &major, &minor);
swap_interval_type = 0;
const char *extensions = glXQueryExtensionsString(fl_display, fl_screen);
if (strstr(extensions, "GLX_EXT_swap_control") && ((major > 1) || (minor >= 3))) {
glXSwapIntervalEXT = (GLX_Set_Swap_Iterval_Proc)glXGetProcAddressARB((const GLubyte*)"glXSwapIntervalEXT");
swap_interval_type = 1;
} else if (strstr(extensions, "GLX_MESA_swap_control")) {
glXSwapIntervalMESA = (MESA_Set_Swap_Iterval_Proc)glXGetProcAddressARB((const GLubyte*)"glXSwapIntervalMESA");
glXGetSwapIntervalMESA = (MESA_Get_Swap_Iterval_Proc)glXGetProcAddressARB((const GLubyte*)"glXGetSwapIntervalMESA");
swap_interval_type = 2;
} else if (strstr(extensions, "GLX_SGI_swap_control")) {
glXSwapIntervalSGI = (SGI_Set_Swap_Iterval_Proc)glXGetProcAddressARB((const GLubyte*)"glXSwapIntervalSGI");
swap_interval_type = 3;
} }
} }
void Fl_X11_Gl_Window_Driver::swap_interval(int interval) { void Fl_X11_Gl_Window_Driver::swap_interval(int interval) {
if (!fl_xid(pWindow)) if (!fl_xid(pWindow))
return; return;
if (!glXSwapIntervalChecked) checkGlxXSwapInterval(); if (swap_interval_type == -1)
if (glXSwapIntervalEXT) { init_swap_interval();
glXSwapIntervalEXT(fl_display, fl_xid(pWindow), interval); switch (swap_interval_type) {
case 1:
if (glXSwapIntervalEXT)
glXSwapIntervalEXT(fl_display, fl_xid(pWindow), interval);
break;
case 2:
if (glXSwapIntervalMESA)
glXSwapIntervalMESA((unsigned int)interval);
break;
case 3:
if (glXSwapIntervalSGI)
glXSwapIntervalSGI(interval);
break;
} }
} }
int Fl_X11_Gl_Window_Driver::swap_interval() const { int Fl_X11_Gl_Window_Driver::swap_interval() const {
if (!fl_xid(pWindow)) if (!fl_xid(pWindow))
return -1; return -1;
if (!glXSwapIntervalChecked) checkGlxXSwapInterval(); if (swap_interval_type == -1)
if (!glXSwapIntervalEXT) return -1; init_swap_interval();
static bool ext_checked = false, ext_exists = false; int interval = -1;
if (!ext_checked) { switch (swap_interval_type) {
ext_checked = true; case 1: {
ext_exists = (strstr(glXQueryExtensionsString(fl_display, fl_screen), "GLX_EXT_swap_control") != NULL); unsigned int val = 0;
glXQueryDrawable(fl_display, fl_xid(pWindow), 0x20F1 /*GLX_SWAP_INTERVAL_EXT*/, &val);
interval = (int)val;
break; }
case 2:
if (glXGetSwapIntervalMESA)
interval = glXGetSwapIntervalMESA();
break;
case 3:
// not available
break;
} }
if (!ext_exists) return -1;
unsigned int interval = -1;
glXQueryDrawable(fl_display, fl_xid(pWindow), 0x20F1 /*GLX_SWAP_INTERVAL_EXT*/, &interval);
return interval; return interval;
} }
// end of swap_interval implementation
void Fl_X11_Gl_Window_Driver::waitGL() { void Fl_X11_Gl_Window_Driver::waitGL() {
glXWaitGL(); glXWaitGL();
} }

View File

@ -2439,6 +2439,7 @@ Fl_Input.o: ../FL/Fl_Image.H
Fl_Input.o: ../FL/Fl_Input.H Fl_Input.o: ../FL/Fl_Input.H
Fl_Input.o: ../FL/Fl_Input_.H Fl_Input.o: ../FL/Fl_Input_.H
Fl_Input.o: ../FL/Fl_Int_Input.H Fl_Input.o: ../FL/Fl_Int_Input.H
Fl_Input.o: ../FL/Fl_Menu_Item.H
Fl_Input.o: ../FL/Fl_Multiline_Input.H Fl_Input.o: ../FL/Fl_Multiline_Input.H
Fl_Input.o: ../FL/Fl_Multiline_Output.H Fl_Input.o: ../FL/Fl_Multiline_Output.H
Fl_Input.o: ../FL/Fl_Output.H Fl_Input.o: ../FL/Fl_Output.H
@ -3929,6 +3930,9 @@ Fl_Text_Display.o: ../FL/Fl_Export.H
Fl_Text_Display.o: ../FL/Fl_Graphics_Driver.H Fl_Text_Display.o: ../FL/Fl_Graphics_Driver.H
Fl_Text_Display.o: ../FL/Fl_Group.H Fl_Text_Display.o: ../FL/Fl_Group.H
Fl_Text_Display.o: ../FL/Fl_Image.H Fl_Text_Display.o: ../FL/Fl_Image.H
Fl_Text_Display.o: ../FL/Fl_Input.H
Fl_Text_Display.o: ../FL/Fl_Input_.H
Fl_Text_Display.o: ../FL/Fl_Menu_Item.H
Fl_Text_Display.o: ../FL/Fl_Pixmap.H Fl_Text_Display.o: ../FL/Fl_Pixmap.H
Fl_Text_Display.o: ../FL/Fl_Plugin.H Fl_Text_Display.o: ../FL/Fl_Plugin.H
Fl_Text_Display.o: ../FL/Fl_Preferences.H Fl_Text_Display.o: ../FL/Fl_Preferences.H

View File

@ -3149,3 +3149,18 @@ windowfocus.o: ../FL/fl_utf8.h
windowfocus.o: ../FL/Fl_Widget.H windowfocus.o: ../FL/Fl_Widget.H
windowfocus.o: ../FL/Fl_Window.H windowfocus.o: ../FL/Fl_Window.H
windowfocus.o: ../FL/platform_types.h windowfocus.o: ../FL/platform_types.h
wizard.o: ../FL/Enumerations.H
wizard.o: ../FL/Fl.H
wizard.o: ../FL/fl_attr.h
wizard.o: ../FL/Fl_Button.H
wizard.o: ../FL/Fl_Cairo.H
wizard.o: ../FL/fl_casts.H
wizard.o: ../FL/fl_config.h
wizard.o: ../FL/Fl_Export.H
wizard.o: ../FL/Fl_Group.H
wizard.o: ../FL/fl_types.h
wizard.o: ../FL/fl_utf8.h
wizard.o: ../FL/Fl_Widget.H
wizard.o: ../FL/Fl_Window.H
wizard.o: ../FL/Fl_Wizard.H
wizard.o: ../FL/platform_types.h