DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2675
Version: 1.3-feature
Hi guys!
I've wrote the new theme for FLTK 1.3.
It's supporting gradient, and good-looked boxes and frames + boxes with
gradient specially for buttons...
For applying scheme to your applications you need call it's:
Fl::scheme("Grad1");
FLUID is supporting it too.
License is LGPL.
Perhaps it will like to you...
Screenshot of fluid is here (theme preview):
http://www.imgplace.com/viewimg39/5411/88fluidgradient.png
PS: Patch was made for fltk-1.3.x-r8800.
PSS: `Grad1' is from word of `gradient' and number `1' is numeric
identity.
Best regards.
Link: http://www.fltk.org/str.php?L2675
Version: 1.3-featurediff -U 3 -H -d -r -N -- FL/Enumerations.H FL/Enumerations.H
--- FL/Enumerations.H 2011-05-22 03:55:59.000000000 +0600
+++ FL/Enumerations.H 2011-07-05 01:23:17.940000002 +0600
@@ -511,6 +511,18 @@
_FL_GTK_THIN_DOWN_FRAME, ///< gtk+ version of FL_THIN_DOWN_FRAME
_FL_GTK_ROUND_UP_BOX, ///< gtk+ version of FL_ROUND_UP_BOX
_FL_GTK_ROUND_DOWN_BOX, ///< gtk+ version of FL_ROUND_DOWN_BOX
+ _FL_GRAD1_UP_BOX,
+ _FL_GRAD1_DOWN_BOX,
+ _FL_GRAD1_UP_FRAME,
+ _FL_GRAD1_DOWN_FRAME,
+ _FL_GRAD1_THIN_UP_BOX,
+ _FL_GRAD1_THIN_DOWN_BOX,
+ _FL_GRAD1_THIN_UP_FRAME,
+ _FL_GRAD1_THIN_DOWN_FRAME,
+ _FL_GRAD1_ROUND_UP_BOX,
+ _FL_GRAD1_ROUND_DOWN_BOX,
+ _FL_GRAD1_BUTTON_UP_BOX,
+ _FL_GRAD1_BUTTON_DOWN_BOX,
FL_FREE_BOXTYPE ///< the first free box type for creation of
new box types
};
extern FL_EXPORT Fl_Boxtype fl_define_FL_ROUND_UP_BOX();
@@ -557,6 +569,20 @@
#define FL_GTK_ROUND_UP_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+8)
#define FL_GTK_ROUND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+9)
+extern FL_EXPORT Fl_Boxtype fl_define_FL_GRAD1_UP_BOX();
+#define FL_GRAD1_UP_BOX fl_define_FL_GRAD1_UP_BOX()
+#define FL_GRAD1_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GRAD1_UP_BOX()+1)
+#define FL_GRAD1_UP_FRAME (Fl_Boxtype)(fl_define_FL_GRAD1_UP_BOX()+2)
+#define FL_GRAD1_DOWN_FRAME (Fl_Boxtype)(fl_define_FL_GRAD1_UP_BOX()+3)
+#define FL_GRAD1_THIN_UP_BOX (Fl_Boxtype)(fl_define_FL_GRAD1_UP_BOX()+4)
+#define FL_GRAD1_THIN_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GRAD1_UP_BOX()+5)
+#define FL_GRAD1_THIN_UP_FRAME (Fl_Boxtype)(fl_define_FL_GRAD1_UP_BOX()+6)
+#define FL_GRAD1_THIN_DOWN_FRAME (Fl_Boxtype)(fl_define_FL_GRAD1_UP_BOX()+7)
+#define FL_GRAD1_ROUND_UP_BOX (Fl_Boxtype)(fl_define_FL_GRAD1_UP_BOX()+8)
+#define FL_GRAD1_ROUND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GRAD1_UP_BOX()+9)
+#define FL_GRAD1_BUTTON_UP_BOX (Fl_Boxtype)(fl_define_FL_GRAD1_UP_BOX()+10)
+#define FL_GRAD1_BUTTON_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GRAD1_UP_BOX()+11)
+
// conversions of box types to other boxtypes:
/**
Get the filled version of a frame.
diff -U 3 -H -d -r -N -- FL/fl_designer.H FL/fl_designer.H
--- FL/fl_designer.H 1970-01-01 05:00:00.000000000 +0500
+++ FL/fl_designer.H 2011-07-05 05:19:37.081000002 +0600
@@ -0,0 +1,124 @@
+//
+// "fl_designer" drawing routines for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 2011 by Dmitrij K. e-mail: kdiman at live dot ru
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+
+#ifndef fl_designer_H
+#define fl_designer_H
+
+#include <FL/Fl.H>
+
+enum Fl_GradientStyle {
+ FL_GRADIENT_STYLE_NONE, // draw background by one color (without gradient)
+ FL_GRADIENT_STYLE_BUTTON, // draw gradient for box of buttons
+ FL_GRADIENT_STYLE_SE, // draw gradient from SouthEast to NordWest
+ FL_GRADIENT_STYLE_S, // draw gradient from South to Nord
+ FL_GRADIENT_STYLE_SW, // draw gradient from SouthWest to NordEast
+ FL_GRADIENT_STYLE_W, // draw gradient from West to East
+ FL_GRADIENT_STYLE_NW, // draw gradient from NordWest to SouthEast
+ FL_GRADIENT_STYLE_N, // draw gradient from Nord to South
+ FL_GRADIENT_STYLE_NE, // draw gradient from NordEast to SouthWest
+ FL_GRADIENT_STYLE_E, // draw gradient from East to West
+ FL_GRADIENT_STYLE_CN_CS, // draw gradient from center to Nord and from center
to South
+ FL_GRADIENT_STYLE_CW_CE, // draw gradient from center to West and from center
to East
+ FL_GRADIENT_STYLE_NC_SC, // draw gradient from Nord to center and from South
to center
+ FL_GRADIENT_STYLE_WC_EC // draw gradient from West to center and from East to
center
+};
+
+enum Fl_FrameType {
+ FL_FRAME_TYPE_ONLY_BG, // don't draw border/frame box (only background)
+ FL_FRAME_TYPE_UP_FRAME, // draw up frame (without background)
+ FL_FRAME_TYPE_DOWN_FRAME, // draw down frame (without background)
+ FL_FRAME_TYPE_UP_BOX, // draw border/frame UP_BOX (with background)
+ FL_FRAME_TYPE_DOWN_BOX, // draw border/frame DOWN_BOX (with background)
+ FL_FRAME_TYPE_ROUND_UP_BOX, // draw rounded up box (only without gradient)
+ FL_FRAME_TYPE_ROUND_DOWN_BOX, // draw rounded down box (only without gradient)
+ FL_FRAME_TYPE_UP_BOX_W, // UP_BOX, only West is top of box
+ FL_FRAME_TYPE_DOWN_BOX_W, // DOWN_BOX, only West is top of box
+ FL_FRAME_TYPE_UP_BOX_E, // UP_BOX, only East is top of box
+ FL_FRAME_TYPE_DOWN_BOX_E, // DOWN_BOX, only East is top of box
+ FL_FRAME_TYPE_UP_BOX_S, // UP_BOX, only South is top of box
+ FL_FRAME_TYPE_DOWN_BOX_S // DOWN_BOX, only South is top of box
+};
+
+enum Fl_FrameShadow {
+ FL_FRAME_SHADOW_NONE, // no shadow for frame
+ FL_FRAME_SHADOW_NORMAL, // normal is two lines of shadow (It is good only not
for gradient and not for ONLY_FRAME and BUTTON)
+ FL_FRAME_SHADOW_THIN // one line of shadow
+ };
+
+enum Fl_RoundCorner {
+ // LB - left-bottom corner
+ // LT - left-top corner
+ // RT - right-top corner
+ // RB - right-bottom corner
+ FL_ROUND_CORNER_ALL, // to round all corners
+ FL_ROUND_CORNER_LB, // to round LB
+ FL_ROUND_CORNER_LT, // to round LT
+ FL_ROUND_CORNER_RT, // to round RT
+ FL_ROUND_CORNER_RB, // to round RB
+ FL_ROUND_CORNER_LB_LT, // to round LB and LT
+ FL_ROUND_CORNER_LT_RT, // to round LT and RT
+ FL_ROUND_CORNER_RT_RB, // to round RT and RB
+ FL_ROUND_CORNER_RB_LB, // to round RB and LB
+ FL_ROUND_CORNER_LT_RB, // to round LT and RB
+ FL_ROUND_CORNER_RT_LB, // to round RT and LB
+ FL_ROUND_CORNER_LB_LT_RT, // to round LB and LT and RT
+ FL_ROUND_CORNER_LT_RT_RB, // to round LT and RT and RB
+ FL_ROUND_CORNER_RT_RB_LB, // to round RT and RB and LB
+ FL_ROUND_CORNER_RB_LB_LT // to round RB and LB and LT
+};
+
+
+/**
+ License: LGPL 2 or any later version.
+ Thanks to Nikita Egorov for consultings
+ I like FLTK! Enjoy!
+ \author Dmitrij K. e-mail: kdiman at live dot ru
+
+ \brief `fl_designer' is drawing boxes and frames and simply bg.
+ \version 1.2 (5 july 2011)
+ \note This is function was writen for making of themes of FLTK and for
designing of new widgets (composing etc).
+
+ \param[in] x, y, w, h coordinates and sizes of box
+ \param[in] frame color of frame/border. Recomends to set it as color as \p bg
+ \param[in] bg color of background
+ \param[in] smoothing value of smooth (in this moment it is supporting value
only 0-4). Radius of corners=\p smoothing *3
+ \param[in] fs shadow of frame (if \p ft ==FRAME_TYPE_ONLY_BG, then it is
ignoring)
+ \param[in] ft type of frame
+ \param[in] groff gradient offset (from 0.0f to 1.0f)
+ \param[in] gs style of gradient (if \p ft ==FRAME_TYPE_ONLY_FRAME or
*ROUND*BOX, then it is ignoring)
+ \param[in] rc rounding of corners (if \p smoothing ==0, then it is ignoring)
+*/
+
+FL_EXPORT extern void fl_designer(int x, int y, int w, int h,
+ Fl_Color frame = 0xe3e3ff00,
+ Fl_Color bg = 0xe3e3ff00,
+ int smoothing = 1,
+ Fl_FrameShadow fs = FL_FRAME_SHADOW_THIN,
+ Fl_FrameType ft = FL_FRAME_TYPE_UP_BOX,
+ float groff = 0.18f,
+ Fl_GradientStyle gs = FL_GRADIENT_STYLE_SW,
+ Fl_RoundCorner rc = FL_ROUND_CORNER_ALL);
+
+#endif
diff -U 3 -H -d -r -N -- fluid/Fl_Widget_Type.cxx fluid/Fl_Widget_Type.cxx
--- fluid/Fl_Widget_Type.cxx 2011-01-03 13:28:38.000000000 +0500
+++ fluid/Fl_Widget_Type.cxx 2011-07-05 04:02:50.855000002 +0600
@@ -687,6 +687,14 @@
{"GTK_THIN_DOWN_BOX",0,0,(void *)FL_GTK_THIN_DOWN_BOX},
{"GTK_ROUND_UP_BOX",0,0,(void *)FL_GTK_ROUND_UP_BOX},
{"GTK_ROUND_DOWN_BOX",0,0,(void *)FL_GTK_ROUND_DOWN_BOX},
+{"GRAD1_UP_BOX",0,0,(void *)FL_GRAD1_UP_BOX},
+{"GRAD1_DOWN_BOX",0,0,(void *)FL_GRAD1_DOWN_BOX},
+{"GRAD1_THIN_UP_BOX",0,0,(void *)FL_GRAD1_THIN_UP_BOX},
+{"GRAD1_THIN_DOWN_BOX",0,0,(void *)FL_GRAD1_THIN_DOWN_BOX},
+{"GRAD1_ROUND_UP_BOX",0,0,(void *)FL_GRAD1_ROUND_UP_BOX},
+{"GRAD1_ROUND_DOWN_BOX",0,0,(void *)FL_GRAD1_ROUND_DOWN_BOX},
+{"GRAD1_BUTTON_UP_BOX",0,0,(void *)FL_GRAD1_BUTTON_UP_BOX},
+{"GRAD1_BUTTON_DOWN_BOX",0,0,(void *)FL_GRAD1_BUTTON_DOWN_BOX},
{0},
{"frames",0,0,0,FL_SUBMENU},
{"UP_FRAME",0,0,(void *)FL_UP_FRAME},
@@ -705,6 +713,10 @@
{"GTK_DOWN_FRAME",0,0,(void *)FL_GTK_DOWN_FRAME},
{"GTK_THIN_UP_FRAME",0,0,(void *)FL_GTK_THIN_UP_FRAME},
{"GTK_THIN_DOWN_FRAME",0,0,(void *)FL_GTK_THIN_DOWN_FRAME},
+{"GRAD1_UP_FRAME",0,0,(void *)FL_GRAD1_UP_FRAME},
+{"GRAD1_DOWN_FRAME",0,0,(void *)FL_GRAD1_DOWN_FRAME},
+{"GRAD1_THIN_UP_FRAME",0,0,(void *)FL_GRAD1_THIN_UP_FRAME},
+{"GRAD1_THIN_DOWN_FRAME",0,0,(void *)FL_GRAD1_THIN_DOWN_FRAME},
{0},
{0}};
diff -U 3 -H -d -r -N -- fluid/alignment_panel.cxx fluid/alignment_panel.cxx
--- fluid/alignment_panel.cxx 2010-12-21 03:19:24.000000000 +0500
+++ fluid/alignment_panel.cxx 2011-07-05 00:55:25.330000002 +0600
@@ -162,6 +162,7 @@
{"None", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
{"Plastic", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
{"GTK+", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Grad1", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
{0,0,0,0,0,0,0,0,0}
};
diff -U 3 -H -d -r -N -- fluid/alignment_panel.fl fluid/alignment_panel.fl
--- fluid/alignment_panel.fl 2010-12-21 03:19:24.000000000 +0500
+++ fluid/alignment_panel.fl 2011-07-05 00:54:30.823000000 +0600
@@ -196,6 +196,10 @@
label {GTK+}
xywh {10 10 35 25}
}
+ MenuItem {} {
+ label {Grad1}
+ xywh {20 20 35 25}
+ }
}
Fl_Group {} {open
xywh {116 43 220 126} labelfont 1 align 0
diff -U 3 -H -d -r -N -- fluid/fluid.cxx fluid/fluid.cxx
--- fluid/fluid.cxx 2011-01-24 22:04:22.000000000 +0500
+++ fluid/fluid.cxx 2011-07-05 00:56:55.347000000 +0600
@@ -1753,6 +1753,9 @@
case 3 : // GTK+
Fl::scheme("gtk+");
break;
+ case 4 : // Grad1
+ Fl::scheme("grad1");
+ break;
}
fluid_prefs.set("scheme", scheme_choice->value());
diff -U 3 -H -d -r -N -- src/Fl_get_system_colors.cxx
src/Fl_get_system_colors.cxx
--- src/Fl_get_system_colors.cxx 2010-11-29 02:06:39.000000000 +0500
+++ src/Fl_get_system_colors.cxx 2011-07-05 03:35:47.771000002 +0600
@@ -36,6 +36,7 @@
#include <FL/Fl_Pixmap.H>
#include <FL/Fl_Tiled_Image.H>
#include "tile.xpm"
+#include "fl_grad1.h"
#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
// Visual C++ 2005 incorrectly displays a warning about the use of POSIX APIs
@@ -386,6 +387,28 @@
// Use slightly thinner scrollbars...
Fl::scrollbar_size(15);
+ } else if (scheme_ && !strcasecmp(scheme_, "grad1")) {
+ // Grad1 scheme
+ if (scheme_bg_) {
+ delete scheme_bg_;
+ scheme_bg_ = (Fl_Image *)0;
+ }
+
+ set_boxtype(FL_UP_FRAME, grad1_up_frame, 2, 2, 4, 4);
+ set_boxtype(FL_DOWN_FRAME, grad1_down_frame, 2, 2, 4, 4);
+ set_boxtype(FL_THIN_UP_FRAME, grad1_thin_up_frame, 1, 1, 2, 2);
+ set_boxtype(FL_THIN_DOWN_FRAME, grad1_thin_down_frame, 1, 1, 2, 2);
+
+ set_boxtype(FL_UP_BOX, grad1_up_box, 2, 2, 4, 4);
+ set_boxtype(FL_DOWN_BOX, grad1_down_box, 2, 2, 4, 4);
+ set_boxtype(FL_THIN_UP_BOX, grad1_thin_up_box, 1, 1, 2, 2);
+ set_boxtype(FL_THIN_DOWN_BOX, grad1_thin_down_box, 1, 1, 2, 2);
+ set_boxtype(_FL_ROUND_UP_BOX, grad1_round_up_box, 4, 4, 8, 8);
+ set_boxtype(_FL_ROUND_DOWN_BOX, grad1_round_down_box, 4, 4, 8, 8);
+
+ // Use slightly thinner scrollbars...
+ Fl::scrollbar_size(14);
+
} else {
// Use the standard FLTK look-n-feel...
if (scheme_bg_) {
diff -U 3 -H -d -r -N -- src/Makefile src/Makefile
--- src/Makefile 2011-02-06 19:08:08.000000000 +0500
+++ src/Makefile 2011-07-05 01:38:47.343000002 +0600
@@ -133,6 +133,7 @@
fl_color.cxx \
fl_cursor.cxx \
fl_curve.cxx \
+ fl_designer.cxx \
fl_diamond_box.cxx \
fl_dnd.cxx \
fl_draw.cxx \
@@ -144,6 +145,7 @@
fl_file_dir.cxx \
fl_font.cxx \
fl_gtk.cxx \
+ fl_grad1.cxx \
fl_labeltype.cxx \
fl_line_style.cxx \
fl_open_uri.cxx \
diff -U 3 -H -d -r -N -- src/fl_boxtype.cxx src/fl_boxtype.cxx
--- src/fl_boxtype.cxx 2010-11-29 02:06:39.000000000 +0500
+++ src/fl_boxtype.cxx 2011-07-05 02:59:30.589000000 +0600
@@ -37,6 +37,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Widget.H>
#include <FL/fl_draw.H>
+#include "fl_grad1.h"
#include <config.h>
////////////////////////////////////////////////////////////////
@@ -302,6 +303,16 @@
{fl_down_box, 1,1,2,2,0}, // _FL_GTK_THIN_ROUND_DOWN_BOX,
{fl_up_box, 2,2,4,4,0}, // _FL_GTK_ROUND_UP_BOX,
{fl_down_box, 2,2,4,4,0}, // _FL_GTK_ROUND_DOWN_BOX,
+ {grad1_up_box, 2,2,4,4,0}, // _FL_GRAD1_UP_BOX,
+ {grad1_down_box, 2,2,4,4,0}, // _FL_GRAD1_DOWN_BOX,
+ {grad1_up_frame, 2,2,4,4,0}, // _FL_GRAD1_UP_FRAME,
+ {grad1_down_frame, 2,2,4,4,0}, // _FL_GRAD1_DOWN_FRAME,
+ {grad1_thin_up_box, 1,1,2,2,0}, // _FL_GRAD1_THIN_UP_BOX,
+ {grad1_thin_down_box, 1,1,2,2,0}, // _FL_GRAD1_THIN_DOWN_BOX,
+ {grad1_thin_up_frame, 1,1,2,2,0}, // _FL_GRAD1_THIN_UP_FRAME,
+ {grad1_thin_down_frame, 1,1,2,2,0}, //
_FL_GRAD1_THIN_DOWN_FRAME,
+ {grad1_round_up_box, 4,4,8,8,0}, // _FL_GRAD1_ROUND_UP_BOX,
+ {grad1_round_down_box, 4,4,8,8,0}, // _FL_GRAD1_ROUND_DOWN_BOX,
{fl_up_box, 3,3,6,6,0}, // FL_FREE_BOX+0
{fl_down_box, 3,3,6,6,0}, // FL_FREE_BOX+1
{fl_up_box, 3,3,6,6,0}, // FL_FREE_BOX+2
diff -U 3 -H -d -r -N -- src/fl_designer.cxx src/fl_designer.cxx
--- src/fl_designer.cxx 1970-01-01 05:00:00.000000000 +0500
+++ src/fl_designer.cxx 2011-07-05 05:20:02.226000002 +0600
@@ -0,0 +1,1055 @@
+//
+// "fl_designer" drawing routines for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 2011 by Dmitrij K. e-mail: kdiman at live dot ru
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+
+#ifndef fl_designer_cxx
+#define fl_designer_cxx
+
+#include <FL/fl_designer.H>
+#include <FL/fl_draw.H>
+#include <math.h>
+
+ // draw background by one color (without gradient)
+ static void gradient_style_none(int x, int y, int w, int h, Fl_Color bg){
+ fl_rectf(x, y, w, h, bg);
+ }
+
+ // draw gradient for button up box
+ static void gradient_style_button_up_box(int x, int y, int w, int h,
Fl_Color bg){
+ int half_h = h/2;
+ float gradoffset = 0.15f;
+ float stepoffset = (1.0/(float)half_h);
+ Fl_Color c = fl_color_average(bg, FL_WHITE, 0.5);
+ int xw = x+w-1;
+ for(int _y = y; _y <= y+half_h; _y++){
+ fl_color(fl_color_average(c, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(x, _y, xw, _y);
+ gradoffset += stepoffset;
+ }
+ gradoffset = 0.0f;
+ c = bg;
+ for(int _y = y+h-1; _y >= y+half_h-1; _y--){
+ fl_color(fl_color_average(c, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(x, _y, xw, _y);
+ gradoffset += stepoffset;
+ }
+ }
+
+ // draw gradient for button down box
+ static void gradient_style_button_down_box(int x, int y, int w, int h,
Fl_Color bg){
+ int half_h = h/2;
+ float gradoffset;
+ float stepoffset = (1.0/(float)half_h);
+ Fl_Color c = fl_color_average(bg, FL_WHITE, 0.65);
+ int xw = x+w-1;
+ fl_color(c);
+ for(int _y = y; _y <= y+half_h; _y++){
+ fl_line(x, _y, xw, _y);
+ }
+ gradoffset = 0.20f;
+ c = fl_color_average(bg, FL_WHITE, 0.55);
+ for(int _y = y+h-1; _y >= y+half_h-1; _y--){
+ fl_color(fl_color_average(c, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(x, _y, xw, _y);
+ gradoffset += stepoffset;
+ }
+ }
+
+ // draw rounded box
+ static void rounded_box(int x, int y, int w, int h, Fl_Color bg){
+ fl_color(bg);
+ if(w > h){
+ fl_pie(x, y, h, h, 90.0, 270.0); // right half of circle
+ fl_rectf(x+h/2, y, w-h, h); // rectangle between left and right half-circle
+ fl_pie(x+w-h, y, h, h, 0.0, 90.0); // top-left quarter of circle
+ fl_pie(x+w-h, y, h, h, 270.0, 360.0); // bottom-left quarter of circle
+ }
+ else {
+ fl_pie(x, y, w, w, 0.0, 180.0); // top half of circle
+ fl_rectf(x, y+w/2, w, h-w); // rectangle between top and bottom half-circle
+ fl_pie(x, y+h-w, w, w, 180.0, 360.0); // bottom half of circle
+ }
+ }
+
+ // draw gradient from South to Nord
+ static void gradient_style_s(int x, int y, int w, int h, Fl_Color bg, float
groff){
+ if(groff < 0.0){ groff = 0.0f; }
+ float gradoffset = groff;
+ float stepoffset = (1.0/(float)h);
+ int xw = x+w-1;
+// from bottom to top
+ for (int _y = y; _y < y+h; _y++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(x, _y, xw, _y);
+ gradoffset += stepoffset;
+ }
+ }
+
+ // draw gradient from Nord to South
+ static void gradient_style_n(int x, int y, int w, int h, Fl_Color bg, float
groff){
+ if(groff < 0.0){ groff = 0.0f; }
+ float gradoffset = groff;
+ float stepoffset = (1.0/(float)h);
+ int xw = x+w-1;
+// from top to bottom
+ for (int _y = y+h-1; _y >= y; _y--){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(x, _y, xw, _y);
+ gradoffset += stepoffset;
+ }
+ }
+
+ // draw gradient from West to East
+ static void gradient_style_w(int x, int y, int w, int h, Fl_Color bg, float
groff){
+ if(groff < 0.0){ groff = 0.0f; }
+ float gradoffset = groff;
+ float stepoffset = (1.0/(float)w);
+ int yh = y+h-1;
+// from left to right
+ for (int _x = x+w-1; _x >= x; _x--){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, _x, yh);
+ gradoffset += stepoffset;
+ }
+ }
+
+ // draw gradient from East to West
+ static void gradient_style_e(int x, int y, int w, int h, Fl_Color bg, float
groff){
+ if(groff < 0.0){ groff = 0.0f; }
+ float gradoffset = groff;
+ float stepoffset = (1.0/(float)w);
+ int yh = y+h-1;
+// from right to left
+ for (int _x = x; _x < x+w-1; _x++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, _x, yh);
+ gradoffset += stepoffset;
+ }
+ }
+
+
+ // draw gradient from NordEast to SouthWest
+ static void gradient_style_ne(int x, int y, int w, int h, Fl_Color bg, float
groff){
+ if(groff < 0.0){ groff = 0.0f; }
+ float gradoffset = groff;
+ float stepoffset = (1.0/(float)sqrt((h+w)*(h+w)));
+ int yh = y+h-1;
+ int xw = x+w-1;
+
+// from top-right to down-left
+ if(w >= h){
+ for (int _y = yh, _offset = 0; _y >= y; _y--, _offset++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(x, _y, x+_offset, yh);
+ gradoffset += stepoffset;
+ }
+
+ if(w != h){
+ for (int _x = x+1, _offset = h; _x < x+w-1; _x++, _offset++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, x+_offset, yh);
+ gradoffset += stepoffset;
+ if(_offset >= w-1){ break; }
+ }
+ }
+
+ for (int _x = x+w-h, _y = yh; _x < x+w; _x++, _y--){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, xw, _y);
+ gradoffset += stepoffset;
+ }
+ }
+
+ else {
+
+ for (int _y = yh, _offset = 0; _y >= y+h-w; _y--, _offset++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(x, _y, x+_offset, yh);
+ gradoffset += stepoffset;
+ if(_offset >= w-1){ break; }
+ }
+
+ for (int _y = y+h-w, _offset = yh; _y >= y; _y--, _offset--){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(x, _y, xw, _offset);
+ gradoffset += stepoffset;
+ }
+
+ for (int _x = x, _y = y+w-1; _x < x+w; _x++, _y--){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, xw, _y);
+ gradoffset += stepoffset;
+ }
+ }
+ }
+
+
+ // draw gradient from SouthWest to NordEast
+ static void gradient_style_sw(int x, int y, int w, int h, Fl_Color bg, float
groff){
+ if(groff < 0.0){ groff = 0.0f; }
+ float gradoffset = groff;
+ float stepoffset = (1.0/(float)sqrt((h+w)*(h+w)));
+ int xw = x+w-1;
+ int yh = y+h-1;
+
+ // from left-down to right-top
+ if(w >= h){
+ for (int _x = xw, _offset = 0; _x >= x; _x--, _offset++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, xw, y+_offset);
+ gradoffset += stepoffset;
+ if(_offset >= h-1){ break; }
+ }
+
+ if(w != h){
+ for (int _x = xw-h, _offset = 1; _x >= x+1; _x--, _offset++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, xw-_offset, yh);
+ gradoffset += stepoffset;
+ }
+ }
+
+ for (int _y = y, _offset = h-1; _y < y+h; _y++, _offset--){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(x, _y, x+_offset, yh);
+ gradoffset += stepoffset;
+ }
+ }
+
+ else {
+ for (int _x = xw, _offset = 0; _x >= x; _x--, _offset++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, xw, y+_offset);
+ gradoffset += stepoffset;
+ if(_offset >= w-1){ break; }
+ }
+
+ for (int _y = y+1, _offset = y+w; _y < y+h-w; _y++, _offset++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(x, _y, xw, _offset);
+ gradoffset += stepoffset;
+ }
+
+ for (int _y = y+h-w, _offset = w-1; _y < y+h; _y++, _offset--){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(x, _y, x+_offset, yh);
+ gradoffset += stepoffset;
+ }
+ }
+ }
+
+
+
+
+
+ // draw gradient from NordWest to SouthEast
+ static void gradient_style_nw(int x, int y, int w, int h, Fl_Color bg, float
groff){
+ if(groff < 0.0){ groff = 0.0f; }
+ float gradoffset = groff;
+ float stepoffset = (1.0/(float)sqrt((h+w)*(h+w)));
+ int xw = x+w-1;
+ int yh = y+h-1;
+
+ // from left-top to right-down
+ if(w >= h){
+ for (int _y = yh, _offset = 0; _y >= y; _y--, _offset++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(xw, _y, xw-_offset, yh);
+ gradoffset += stepoffset;
+ if(_offset >= h-1){ break; }
+ }
+
+ if(w != h){
+ for (int _x = xw-1, _offset = h; _x >= x+h; _x--, _offset++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, xw-_offset, yh);
+ gradoffset += stepoffset;
+ }
+ }
+
+ for (int _x = x+h-1, _offset = h-1; _x >= x; _x--, _offset--){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, x, y+_offset);
+ gradoffset += stepoffset;
+ }
+ }
+
+ else {
+ for (int _y = yh, _offset = 0; _y >= y; _y--, _offset++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(xw, _y, xw-_offset, yh);
+ gradoffset += stepoffset;
+ if(_offset >= w-1){ break; }
+ }
+
+ for (int _y = yh-1, _offset = yh-w; _y >= y+w; _y--, _offset--){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(xw, _offset, x, _y);
+ gradoffset += stepoffset;
+ }
+
+ for (int _x = xw, _offset = y+w-1; _x >= x; _x--, _offset--){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, x, _offset);
+ gradoffset += stepoffset;
+ }
+ }
+ }
+
+
+
+
+ // draw gradient from SouthEast to NordWest
+ static void gradient_style_se(int x, int y, int w, int h, Fl_Color bg, float
groff){
+ if(groff < 0.0){ groff = 0.0f; }
+ float gradoffset = groff;
+ float stepoffset = (1.0/(float)sqrt((h+w)*(h+w)));
+ int xw = x+w-1;
+ int yh = y+h-1;
+
+ // from right-down to left-top
+ if(w >= h){
+ for (int _x = x, _offset = 0; _x < x+h; _x++, _offset++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, x, y+_offset);
+ gradoffset += stepoffset;
+ if(_offset >= h){ break; }
+ }
+
+ if(w != h){
+ for (int _x = x+h, _offset = 1; _x < xw; _x++, _offset++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, x+_offset, yh);
+ gradoffset += stepoffset;
+ }
+ }
+
+ for (int _y = y, _offset = x+w-h; _y < y+h; _y++, _offset++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(xw, _y, _offset, yh);
+ gradoffset += stepoffset;
+ }
+ }
+
+ else {
+ for (int _x = x, _offset = 0; _x < x+h-1; _x++, _offset++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, x, y+_offset);
+ gradoffset += stepoffset;
+ if(_offset >= w-1){ break; }
+ }
+
+ for (int _y = y+1, _offset = y+w; _y < y+h-w; _y++, _offset++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(xw, _y, x, _offset);
+ gradoffset += stepoffset;
+ }
+
+ for (int _y = y+h-w, _offset = x; _y < y+h; _y++, _offset++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(xw, _y, _offset, yh);
+ gradoffset += stepoffset;
+ }
+ }
+ }
+
+
+
+
+ // draw gradient from center to Nord and from center to South
+ static void gradient_style_cn_cs(int x, int y, int w, int h, Fl_Color bg,
float groff){
+ if(groff < 0.0){ groff = 0.0f; }
+ int half_h = h/2;
+ float gradoffset = groff;
+ float stepoffset = (1.0 / (float)half_h);
+ int xw = x+w-1;
+
+ for(int _y = y; _y < y+half_h; _y++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(x, _y, xw, _y);
+ gradoffset += stepoffset;
+ }
+
+ gradoffset = groff;
+ for(int _y = y+h-1; _y >= y+half_h; _y--){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(x, _y, xw, _y);
+ gradoffset += stepoffset;
+ }
+ }
+
+
+ // draw gradient from Nord to center and from South to center
+ static void gradient_style_nc_sc(int x, int y, int w, int h, Fl_Color bg,
float groff){
+ if(groff < 0.0){ groff = 0.0f; }
+ int half_h = h/2;
+ float gradoffset = groff;
+ float stepoffset = (1.0 / (float)half_h);
+ int xw = x+w-1;
+
+ for(int _y = y+half_h; _y >= y; _y--){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(x, _y, xw, _y);
+ gradoffset += stepoffset;
+ }
+
+ gradoffset = groff;
+ for(int _y = y+half_h+1; _y < y+h-1; _y++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(x, _y, xw, _y);
+ gradoffset += stepoffset;
+ }
+ }
+
+
+ // draw gradient from center to West and from center to East
+ static void gradient_style_cw_ce(int x, int y, int w, int h, Fl_Color bg,
float groff){
+ if(groff < 0.0){ groff = 0.0f; }
+ int half_w = w/2;
+ float gradoffset = groff;
+ float stepoffset = (1.0 / (float)half_w);
+ int yh = y+h-1;
+
+ for(int _x = x; _x < x+half_w; _x++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, _x, yh);
+ gradoffset += stepoffset;
+ }
+
+ gradoffset = groff;
+ for(int _x = x+w-1; _x >= x+half_w; _x--){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, _x, yh);
+ gradoffset += stepoffset;
+ }
+ }
+
+
+ // draw gradient from West to center and from East to center
+ static void gradient_style_wc_ec(int x, int y, int w, int h, Fl_Color bg,
float groff){
+ if(groff < 0.0){ groff = 0.0f; }
+ int half_w = w/2;
+ float gradoffset = groff;
+ float stepoffset = (1.0 / (float)half_w);
+ int yh = y+h-1;
+
+ for(int _x = x+half_w; _x >= x; _x--){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, _x, yh);
+ gradoffset += stepoffset;
+ }
+
+ gradoffset = groff;
+ for(int _x = x+half_w+1; _x < x+w; _x++){
+ fl_color(fl_color_average(bg, FL_WHITE, (gradoffset<1.0)?gradoffset:1.0));
+ fl_line(_x, y, _x, yh);
+ gradoffset += stepoffset;
+ }
+ }
+
+
+
+struct MySimpleLine{
+ int x1;
+ int y1;
+ int x2;
+ int y2;
+ MySimpleLine(){x1=0;y1=0;x2=0;y2=0;}
+};
+
+
+static Fl_Color gradient_color(Fl_Color c) {
+ if(Fl::draw_box_active()){ return c; }
+ else { return fl_inactive(c); }
+}
+
+
+
+
+void fl_designer(int x, int y, int w, int h, Fl_Color frame, Fl_Color bg, int
smoothing, Fl_FrameShadow fs, Fl_FrameType ft, float groff, Fl_GradientStyle
gs, Fl_RoundCorner rc){
+
+ // check width and height
+ if(w < 1 || h < 1){ return; }
+
+ bool LB, LT, RT, RB; // left-bottom, left-top, right-top and right-bottom
corners (if this seted, then it will be to round the corners)
+ int smooth = smoothing;
+ int X, Y, X1, Y1, W, H; // points
+ int Radius; // radius of circle for the corners
+ int r_offset1, r_offset2; // quarter of smooth and half of smooth
+ Fl_Color leftline = bg, topline = bg, rightline = bg, bottomline = bg, lbc =
bg, ltc = bg, rtc = bg, rbc = bg;
+ MySimpleLine plbc, pltc, prtc, prbc;
+
+
+ if(ft == FL_FRAME_TYPE_ROUND_UP_BOX || ft == FL_FRAME_TYPE_ROUND_DOWN_BOX){
+ if(w > h){ smooth = w; }
+ else { smooth = h; }
+ gs = FL_GRADIENT_STYLE_NONE;
+ }
+
+ else {
+ if(smooth < 0){ smooth = 0; }
+ else if(smooth > 4){ smooth = 4; }
+ }
+
+ // correcting `smooth'
+ if(smooth > 0 && (smooth*3 > w || smooth*3 > h)){
+ if(h < w){ smooth = h/3; }
+ else { smooth = w/3; }
+ }
+
+ r_offset1 = smooth/4;
+ r_offset2 = smooth/2;
+
+ Radius = smooth*3;
+ if(Radius == 3){ Radius = 4; }
+
+
+ // correcting type of frame for button
+ if(gs == FL_GRADIENT_STYLE_BUTTON){
+ if(ft != FL_FRAME_TYPE_UP_BOX && ft != FL_FRAME_TYPE_DOWN_BOX){
+ ft = FL_FRAME_TYPE_UP_BOX;
+ }
+ }
+
+ LB = LT = RT = RB = false;
+
+ if(Radius > 0){
+ switch(rc){
+ case FL_ROUND_CORNER_ALL: { LB = LT = RT = RB = true; break; }
+ case FL_ROUND_CORNER_LB: { LB = true; break; }
+ case FL_ROUND_CORNER_LT: { LT = true; break; }
+ case FL_ROUND_CORNER_RT: { RT = true; break; }
+ case FL_ROUND_CORNER_RB: { RB = true; break; }
+ case FL_ROUND_CORNER_LB_LT: { LB = LT = true; break; }
+ case FL_ROUND_CORNER_LT_RT: { LT = RT = true; break; }
+ case FL_ROUND_CORNER_RT_RB: { RT = RB = true; break; }
+ case FL_ROUND_CORNER_RB_LB: { RB = LB = true; break; }
+ case FL_ROUND_CORNER_LT_RB: { LT = RB = true; break; }
+ case FL_ROUND_CORNER_RT_LB: { RT = LB = true; break; }
+ case FL_ROUND_CORNER_LB_LT_RT: { LB = LT = RT = true; break; }
+ case FL_ROUND_CORNER_LT_RT_RB: { LT = RT = RB = true; break; }
+ case FL_ROUND_CORNER_RT_RB_LB: { RT = RB = LB = true; break; }
+ case FL_ROUND_CORNER_RB_LB_LT: { RB = LB = LT = true; break; }
+ default: { break; }
+ }
+ } /// end `if(Radius > 0)'
+
+
+ // to draw background
+ if(ft !=FL_FRAME_TYPE_UP_FRAME && ft != FL_FRAME_TYPE_DOWN_FRAME){
+
+ Fl_Color bgc = gradient_color(bg);
+ X = x; Y = y; W = w; H = h;
+ if(smooth < 4){
+ X+=1; Y+=1; W-=1; H-=1;
+ if(smooth == 1){ W-=1; H-=1; }
+ }
+ else if(smooth > 4){ X+=r_offset1;Y+=r_offset1;W-=r_offset2;H-=r_offset2; }
+
+ if(Radius > 0){
+ switch(rc){
+ case FL_ROUND_CORNER_ALL: {
X+=r_offset1;Y+=r_offset1;W-=r_offset2;H-=r_offset2; break; }
+ case FL_ROUND_CORNER_LB: { X+=r_offset1;W-=r_offset1;H-=r_offset1; break; }
+ case FL_ROUND_CORNER_LT: {
X+=r_offset1;Y+=r_offset1;W-=r_offset1;H-=r_offset1; break; }
+ case FL_ROUND_CORNER_RT: { Y+=r_offset1;W-=r_offset1;H-=r_offset1; break; }
+ case FL_ROUND_CORNER_RB: { W-=r_offset1;H-=r_offset1; break; }
+ case FL_ROUND_CORNER_LB_LT: {
X+=r_offset1;Y+=r_offset1;W-=r_offset1;H-=r_offset2; break; }
+ case FL_ROUND_CORNER_LT_RT: {
X+=r_offset1;Y+=r_offset1;W-=r_offset2;H-=r_offset1; break; }
+ case FL_ROUND_CORNER_RT_RB: { Y+=r_offset1;W-=r_offset1;H-=r_offset2;
break; }
+ case FL_ROUND_CORNER_RB_LB: { X+=r_offset1;W-=r_offset2;H-=r_offset1;
break; }
+ case FL_ROUND_CORNER_LT_RB: {
X+=r_offset1;Y+=r_offset1;W-=r_offset2;H-=r_offset2; break; }
+ case FL_ROUND_CORNER_RT_LB: {
X+=r_offset1;Y+=r_offset1;W-=r_offset2;H-=r_offset2; break; }
+ case FL_ROUND_CORNER_LB_LT_RT: {
X+=r_offset1;Y+=r_offset1;W-=r_offset2;H-=r_offset2; break; }
+ case FL_ROUND_CORNER_LT_RT_RB: {
X+=r_offset1;Y+=r_offset1;W-=r_offset2;H-=r_offset2; break; }
+ case FL_ROUND_CORNER_RT_RB_LB: {
X+=r_offset1;Y+=r_offset1;W-=r_offset2;H-=r_offset2; break; }
+ case FL_ROUND_CORNER_RB_LB_LT: {
X+=r_offset1;Y+=r_offset1;W-=r_offset2;H-=r_offset2; break; }
+ default: { break; }
+ }
+ } /// end `if(Radius > 0)'
+
+ switch(gs){
+ case FL_GRADIENT_STYLE_NONE: {
+ if(ft == FL_FRAME_TYPE_ROUND_UP_BOX || ft == FL_FRAME_TYPE_ROUND_DOWN_BOX){
+ rounded_box(x, y, w, h, gradient_color(fl_color_average(bg, FL_WHITE,
0.82)));
+ }
+ else { gradient_style_none(X, Y, W, H, bgc); }
+ break;
+ }
+ case FL_GRADIENT_STYLE_SE: { gradient_style_se(X, Y, W, H, bgc, groff);
break; }
+ case FL_GRADIENT_STYLE_S: { gradient_style_s(X, Y, W, H, bgc, groff);
break; }
+ case FL_GRADIENT_STYLE_SW: { gradient_style_sw(X, Y, W, H, bgc, groff);
break; }
+ case FL_GRADIENT_STYLE_W: { gradient_style_w(X, Y, W, H, bgc, groff);
break; }
+ case FL_GRADIENT_STYLE_NW: { gradient_style_nw(X, Y, W, H, bgc, groff);
break; }
+ case FL_GRADIENT_STYLE_N: { gradient_style_n(X, Y, W, H, bgc, groff);
break; }
+ case FL_GRADIENT_STYLE_NE: { gradient_style_ne(X, Y, W, H, bgc, groff);
break; }
+ case FL_GRADIENT_STYLE_E: { gradient_style_e(X, Y, W, H, bgc, groff);
break; }
+ case FL_GRADIENT_STYLE_CN_CS: { gradient_style_cn_cs(X, Y, W, H, bgc,
groff); break; }
+ case FL_GRADIENT_STYLE_CW_CE: { gradient_style_cw_ce(X, Y, W, H, bgc,
groff); break; }
+ case FL_GRADIENT_STYLE_NC_SC: { gradient_style_nc_sc(X, Y, W, H, bgc,
groff); break; }
+ case FL_GRADIENT_STYLE_WC_EC: { gradient_style_wc_ec(X, Y, W, H, bgc,
groff); break; }
+ case FL_GRADIENT_STYLE_BUTTON: {
+ if(ft == FL_FRAME_TYPE_UP_BOX){ gradient_style_button_up_box(X, Y, W, H,
bgc); }
+ else { gradient_style_button_down_box(X, Y, W, H, bgc); }
+ break;
+ }
+ default: { break; }
+ }
+
+ } /// end `if(ft !=FRAME_TYPE_ONLY_FRAME )'
+
+
+ if(ft == FL_FRAME_TYPE_ONLY_BG){
+ leftline = topline = rightline = bottomline = lbc = ltc = rtc = rbc = bg;
+ }
+
+ else if(ft == FL_FRAME_TYPE_ROUND_UP_BOX || ft ==
FL_FRAME_TYPE_ROUND_DOWN_BOX){
+ leftline = fl_color_average(frame, FL_WHITE, 0.88);
+ leftline = topline = rightline = bottomline = lbc = ltc = rtc = rbc =
fl_color_average(leftline, FL_BLACK, 0.97);
+ }
+
+ else if(ft == FL_FRAME_TYPE_UP_BOX || ft == FL_FRAME_TYPE_UP_FRAME){
+ topline = fl_color_average(frame, FL_BLACK, 0.95);
+ ltc = fl_color_average(frame, FL_BLACK, 0.92);
+ rtc = ltc;
+ leftline = fl_color_average(frame, FL_BLACK, 0.85);
+ rightline = leftline;
+ lbc = fl_color_average(frame, FL_BLACK, 0.84);
+ rbc = lbc;
+ bottomline = fl_color_average(frame, FL_BLACK, 0.88);
+ }
+
+ else if(ft == FL_FRAME_TYPE_DOWN_BOX || ft == FL_FRAME_TYPE_DOWN_FRAME){
+ topline = fl_color_average(frame, FL_BLACK, 0.88);
+ ltc = fl_color_average(frame, FL_BLACK, 0.84);
+ rtc = ltc;
+ leftline = fl_color_average(frame, FL_BLACK, 0.85);
+ rightline = leftline;
+ lbc = fl_color_average(frame, FL_BLACK, 0.92);
+ rbc = lbc;
+ bottomline = fl_color_average(frame, FL_BLACK, 0.95);
+ }
+
+ else if(ft == FL_FRAME_TYPE_UP_BOX_W){
+ leftline = fl_color_average(frame, FL_BLACK, 0.95);
+ lbc = fl_color_average(frame, FL_BLACK, 0.92);
+ ltc = lbc;
+ topline = fl_color_average(frame, FL_BLACK, 0.85);
+ bottomline = topline;
+ rbc = fl_color_average(frame, FL_BLACK, 0.84);
+ rtc = rbc;
+ rightline = fl_color_average(frame, FL_BLACK, 0.88);
+ }
+
+ else if(ft == FL_FRAME_TYPE_DOWN_BOX_W){
+ leftline = fl_color_average(frame, FL_BLACK, 0.88);
+ lbc = fl_color_average(frame, FL_BLACK, 0.84);
+ ltc = lbc;
+ topline = fl_color_average(frame, FL_BLACK, 0.85);
+ bottomline = topline;
+ rbc = fl_color_average(frame, FL_BLACK, 0.92);
+ rtc = rbc;
+ rightline = fl_color_average(frame, FL_BLACK, 0.95);
+ }
+
+ else if(ft == FL_FRAME_TYPE_UP_BOX_E){
+ rightline = fl_color_average(frame, FL_BLACK, 0.95);
+ rtc = fl_color_average(frame, FL_BLACK, 0.92);
+ rbc = rtc;
+ topline = fl_color_average(frame, FL_BLACK, 0.85);
+ bottomline = topline;
+ ltc = fl_color_average(frame, FL_BLACK, 0.84);
+ lbc = ltc;
+ leftline = fl_color_average(frame, FL_BLACK, 0.88);
+ }
+
+ else if(ft == FL_FRAME_TYPE_DOWN_BOX_E){
+ rightline = fl_color_average(frame, FL_BLACK, 0.88);
+ rtc = fl_color_average(frame, FL_BLACK, 0.84);
+ rbc = rtc;
+ topline = fl_color_average(frame, FL_BLACK, 0.85);
+ bottomline = topline;
+ ltc = fl_color_average(frame, FL_BLACK, 0.92);
+ lbc = ltc;
+ leftline = fl_color_average(frame, FL_BLACK, 0.95);
+ }
+
+ else if(ft == FL_FRAME_TYPE_UP_BOX_S){
+ bottomline = fl_color_average(frame, FL_BLACK, 0.95);
+ lbc = fl_color_average(frame, FL_BLACK, 0.92);
+ rbc = lbc;
+ rightline = fl_color_average(frame, FL_BLACK, 0.85);
+ leftline = rightline;
+ ltc = fl_color_average(frame, FL_BLACK, 0.84);
+ rtc = ltc;
+ topline = fl_color_average(frame, FL_BLACK, 0.88);
+ }
+
+ else if(ft == FL_FRAME_TYPE_DOWN_BOX_S){
+ bottomline = fl_color_average(frame, FL_BLACK, 0.88);
+ lbc = fl_color_average(frame, FL_BLACK, 0.84);
+ rbc = lbc;
+ rightline = fl_color_average(frame, FL_BLACK, 0.85);
+ leftline = rightline;
+ ltc = fl_color_average(frame, FL_BLACK, 0.92);
+ rtc = ltc;
+ topline = fl_color_average(frame, FL_BLACK, 0.95);
+ }
+
+
+ if(LB){
+ // left-bottom corner
+ fl_color(gradient_color(lbc));
+ fl_arc(x, y+h-Radius, Radius, Radius, 180.0, 270.0);
+ if(smooth == 4 && ft != FL_FRAME_TYPE_ROUND_UP_BOX && ft !=
FL_FRAME_TYPE_ROUND_DOWN_BOX){
+ fl_color(gradient_color(fl_color_average(lbc, FL_WHITE, 0.25)));
+ fl_point(x+1, y+h-1-1);
+ }
+ X=x; Y=y+h-smooth-r_offset2-1;
+ X1=x; Y1=y;
+ if(LT){ Y1=Y1+r_offset2+smooth; }
+ }
+ else {
+ X=x; Y=y+h-1;
+ X1=x; Y1=y;
+ if(LT){ Y1=Y1+r_offset2+smooth; }
+ }
+ if(fs != FL_FRAME_SHADOW_NONE && smooth > 1){
+ plbc.x1=X+1;plbc.y1=Y+r_offset2;
+ pltc.x2=X1+1;pltc.y2=Y1-r_offset2;
+ }
+ // left side
+ fl_color(gradient_color(leftline));
+ fl_line(X, Y, X1, Y1);
+
+
+ if(LT){
+ // left-top corner
+ fl_color(gradient_color(ltc));
+ fl_arc(x, y, Radius, Radius, 90.0, 180.0);
+ if(smooth == 4 && ft != FL_FRAME_TYPE_ROUND_UP_BOX && ft !=
FL_FRAME_TYPE_ROUND_DOWN_BOX){
+ fl_color(gradient_color(fl_color_average(ltc, FL_WHITE, 0.25)));
+ fl_point(x+1, y+1);
+ }
+ X=x+smooth+r_offset2; Y=y;
+ X1=x+w-1; Y1=y;
+ if(RT){ X1=X1-smooth-r_offset2; }
+ }
+ else {
+ X=x+1; Y=y;
+ X1=x+w-1; Y1=y;
+ if(RT){ X1=X1-smooth-r_offset2; }
+ }
+ if(fs != FL_FRAME_SHADOW_NONE && smooth > 1){
+ pltc.x1=X-r_offset2;pltc.y1=Y+1;
+ prtc.x1=X1+r_offset2;prtc.y1=Y1+1;
+ }
+ // top side
+ fl_color(gradient_color(topline));
+ fl_line(X, Y, X1, Y1);
+
+
+ if(RT){
+ // right-top corner
+ fl_color(gradient_color(rtc));
+ fl_arc(x+w-Radius, y, Radius, Radius, 00.0, 90.0);
+ if(smooth == 4 && ft != FL_FRAME_TYPE_ROUND_UP_BOX && ft !=
FL_FRAME_TYPE_ROUND_DOWN_BOX){
+ fl_color(gradient_color(fl_color_average(rtc, FL_WHITE, 0.25)));
+ fl_point(x+w-1-1, y+1);
+ }
+ X=x+w-1; Y=y+smooth+r_offset2;
+ X1=x+w-1; Y1=y+h-1;
+ if(RB){ Y1=Y1-smooth-r_offset2; }
+ }
+ else {
+ X=x+w-1; Y=y;
+ X1=x+w-1; Y1=y+h-1;
+ if(RB){ Y1=Y1-smooth-r_offset2; }
+ }
+ if(fs != FL_FRAME_SHADOW_NONE && smooth > 1){
+ prtc.x2=X-1;prtc.y2=Y-r_offset2;
+ prbc.x1=X1-1;prbc.y1=Y1+r_offset2;
+ }
+ // right side
+ fl_color(gradient_color(rightline));
+ fl_line(X, Y, X1, Y1);
+
+
+ if(RB){
+ // right-bottom corner
+ fl_color(gradient_color(rbc));
+ fl_arc(x+w-Radius, y+h-Radius, Radius, Radius, 270.0, 360.0);
+ if(smooth == 4 && ft != FL_FRAME_TYPE_ROUND_UP_BOX && ft !=
FL_FRAME_TYPE_ROUND_DOWN_BOX){
+ fl_color(gradient_color(fl_color_average(rbc, FL_WHITE, 0.25)));
+ fl_point(x+w-1-1, y+h-1-1);
+ }
+ X=x+w-smooth-r_offset2-1; Y=y+h-1;
+ X1=x; Y1=y+h-1;
+ if(LB){ X1=X1+smooth+r_offset2; }
+ }
+ else {
+ X=x+w-1; Y=y+h-1;
+ X1=x; Y1=y+h-1;
+ if(LB){ X1=X1+smooth+r_offset2; }
+ }
+ if(fs != FL_FRAME_SHADOW_NONE && smooth > 1){
+ prbc.x2=X+r_offset2;prbc.y2=Y-1;
+ plbc.x2=X1-r_offset2;plbc.y2=Y1-1;
+ }
+ // bottom side
+ fl_color(gradient_color(bottomline));
+ fl_line(X, Y, X1, Y1);
+
+
+ if(fs != FL_FRAME_SHADOW_NONE && smooth > 1){
+ if(!LB){ plbc.x1=plbc.x2=x+1; plbc.y1=plbc.y2=y+h-2; }
+ if(!LT){ pltc.x1=pltc.x2=x+1; pltc.y1=pltc.y2=y+1; }
+ if(!RT){ prtc.x1=prtc.x2=x+w-2; prtc.y1=prtc.y2=y+1; }
+ if(!RB){ prbc.x1=prbc.x2=x+w-2; prbc.y1=prbc.y2=y+h-2; }
+ }
+
+
+ if(fs != FL_FRAME_SHADOW_NONE){
+
+ if(ft == FL_FRAME_TYPE_ROUND_UP_BOX){
+ topline = fl_color_average(frame, FL_WHITE, 0.5);
+ bottomline = fl_color_average(frame, FL_BLACK, 0.94);
+ }
+
+ else if(ft == FL_FRAME_TYPE_ROUND_DOWN_BOX){
+ topline = fl_color_average(frame, FL_BLACK, 0.94);
+ bottomline = fl_color_average(frame, FL_WHITE, 0.5);
+ }
+
+ else if(ft == FL_FRAME_TYPE_UP_BOX || ft == FL_FRAME_TYPE_UP_FRAME){
+ topline = fl_color_average(frame, FL_WHITE, 0.5);
+ leftline = topline;
+ rightline = topline;
+ ltc = topline; rtc = topline;
+ bottomline = fl_color_average(frame, FL_BLACK, 0.8);
+ lbc = bottomline; rbc = bottomline;
+ }
+
+ else if(ft == FL_FRAME_TYPE_DOWN_BOX || ft == FL_FRAME_TYPE_DOWN_FRAME){
+ topline = fl_color_average(frame, FL_BLACK, 0.8);
+ ltc = topline; rtc = topline;
+ leftline = fl_color_average(frame, FL_BLACK, 0.94);
+ rightline = leftline;
+ bottomline = fl_color_average(frame, FL_WHITE, 0.5);
+ lbc = bottomline; rbc = bottomline;
+ }
+
+ else if(ft == FL_FRAME_TYPE_UP_BOX_W){
+ leftline = fl_color_average(frame, FL_WHITE, 0.5);
+ bottomline = leftline;
+ topline = leftline;
+ lbc = leftline; ltc = leftline;
+ rightline = fl_color_average(frame, FL_BLACK, 0.8);
+ rbc = rightline; rtc = rightline;
+ }
+
+ else if(ft == FL_FRAME_TYPE_DOWN_BOX_W){
+ leftline = fl_color_average(frame, FL_BLACK, 0.8);
+ lbc = leftline; ltc = leftline;
+ bottomline = fl_color_average(frame, FL_BLACK, 0.94);
+ topline = bottomline;
+ rightline = fl_color_average(frame, FL_WHITE, 0.5);
+ rbc = rightline; rtc = rightline;
+ }
+
+ else if(ft == FL_FRAME_TYPE_UP_BOX_E){
+ rightline = fl_color_average(frame, FL_WHITE, 0.5);
+ bottomline = rightline;
+ topline = rightline;
+ rtc = rightline; rbc = rightline;
+ leftline = fl_color_average(frame, FL_BLACK, 0.8);
+ ltc = leftline; lbc = leftline;
+ }
+
+ else if(ft == FL_FRAME_TYPE_DOWN_BOX_E){
+ rightline = fl_color_average(frame, FL_BLACK, 0.8);
+ rtc = rightline; rbc = rightline;
+ bottomline = fl_color_average(frame, FL_BLACK, 0.94);
+ topline = bottomline;
+ leftline = fl_color_average(frame, FL_WHITE, 0.5);
+ lbc = leftline; ltc = leftline;
+ }
+
+ else if(ft == FL_FRAME_TYPE_UP_BOX_S){
+ bottomline = fl_color_average(frame, FL_WHITE, 0.5);
+ leftline = bottomline;
+ rightline = bottomline;
+ lbc = bottomline; rbc = bottomline;
+ topline = fl_color_average(frame, FL_BLACK, 0.8);
+ ltc = topline; rtc = topline;
+ }
+
+ else if(ft == FL_FRAME_TYPE_DOWN_BOX_S){
+ bottomline = fl_color_average(frame, FL_BLACK, 0.8);
+ lbc = bottomline; rbc = bottomline;
+ leftline = fl_color_average(frame, FL_BLACK, 0.94);
+ rightline = leftline;
+ topline = fl_color_average(frame, FL_WHITE, 0.5);
+ ltc = topline; rtc = topline;
+ }
+
+
+ if(ft == FL_FRAME_TYPE_ROUND_UP_BOX || ft == FL_FRAME_TYPE_ROUND_DOWN_BOX){
+ fl_color(gradient_color(topline));
+ X=x+1; Y=y+h-smooth-r_offset2-1;
+ X1=x+1; Y1=y+r_offset2+smooth;
+ fl_line(X, Y, X1, Y1); // left side
+ fl_arc(x+1, y+1, Radius, Radius, 90.0, 180.0); // left-top corner
+ if(ft == FL_FRAME_TYPE_ROUND_DOWN_BOX){ fl_arc(x+1, y+1, Radius+1,
Radius+1, 90.0, 180.0); } // left-top corner (DOWN_BOX)
+ X=x+smooth+r_offset2; Y=y+1;
+ X1=x+w-1-smooth-r_offset2; Y1=y+1;
+ fl_line(X, Y, X1, Y1); // top side
+ fl_arc(x+w-Radius-1, y+1, Radius, Radius, 00.0, 90.0); // right-top corner
+ if(ft == FL_FRAME_TYPE_ROUND_DOWN_BOX){ fl_arc(x+w-Radius-1, y+1, Radius+1,
Radius+1, 00.0, 90.0); } // right-top corner (DOWN_BOX)
+ X=x+w-2; Y=y+smooth+r_offset2;
+ X1=x+w-2; Y1=y+h-1-smooth-r_offset2;
+ fl_line(X, Y, X1, Y1); // right side
+ fl_arc(x+1, y+h-Radius-1, Radius, Radius, 180.0, 200.0); // left-bottom
corner
+ fl_arc(x+w-Radius-1, y+h-Radius-1, Radius, Radius, 340.0, 360.0); //
right-bottom
+ fl_color(gradient_color(bottomline));
+ fl_arc(x+1, y+h-Radius-1, Radius, Radius, 200.0, 270.0); // left-bottom
corner
+ if(ft == FL_FRAME_TYPE_ROUND_UP_BOX){ fl_arc(x+1, y+h-Radius-1, Radius+1,
Radius+1, 200.0, 270.0); } // left-bottom corner (UP_BOX)
+ X=x+w-smooth-r_offset2-1; Y=y+h-2;
+ X1=x+smooth+r_offset2; Y1=y+h-2;
+ fl_line(X, Y, X1, Y1); // bottom side
+ fl_arc(x+w-Radius-1, y+h-Radius-1, Radius, Radius, 270.0, 340.0); //
right-bottom corner
+ if(ft == FL_FRAME_TYPE_ROUND_UP_BOX){ fl_arc(x+w-Radius-1, y+h-Radius-1,
Radius+1, Radius+1, 270.0, 340.0); } // right-bottom corner
+ }
+
+ else {
+ if(smooth < 2){
+ int xw2=x+w-2;
+ int yh=y+h;
+ /// to draw first line of shadow
+ if(ft == FL_FRAME_TYPE_UP_FRAME || ft == FL_FRAME_TYPE_DOWN_FRAME || ft ==
FL_FRAME_TYPE_UP_BOX || ft == FL_FRAME_TYPE_DOWN_BOX || ft ==
FL_FRAME_TYPE_UP_BOX_S || ft == FL_FRAME_TYPE_DOWN_BOX_S){
+ fl_color(gradient_color(topline));
+ fl_line(x+1, y+1, xw2, y+1); // top line
+ fl_color(gradient_color(leftline));
+ fl_line(x+1, yh-3, x+1, y+2); // left line
+ fl_color(gradient_color(rightline));
+ fl_line(xw2, y+2, xw2, yh-3); // right line
+ fl_color(gradient_color(bottomline));
+ fl_line(xw2, yh-2, x+1, yh-2); // bottom line
+ }
+
+ else {
+ fl_color(gradient_color(topline));
+ fl_line(x+2, y+1, xw2-1, y+1); // top line
+ fl_color(gradient_color(leftline));
+ fl_line(x+1, yh-2, x+1, y+1); // left line
+ fl_color(gradient_color(rightline));
+ fl_line(xw2, y+1, xw2, yh-2); // right line
+ fl_color(gradient_color(bottomline));
+ fl_line(xw2-1, yh-2, x+1, yh-2); // bottom line
+ }
+
+ /// to draw second line of shadow
+ if(fs == FL_FRAME_SHADOW_NORMAL){
+ int xw3=x+w-3;
+ fl_color(gradient_color(fl_color_average(frame, FL_WHITE, 0.87)));
+ fl_line(x+2, y+2, xw3, y+2); // top line
+ fl_line(x+2, yh-4, x+2, y+3); // left line
+ fl_line(xw3, y+3, xw3, yh-4); // right line
+ fl_line(xw3, yh-3, x+2, yh-3); // bottom line
+ }
+ }
+
+ else {
+ /// to draw first line of shadow
+ // left-bottom corner
+ fl_color(gradient_color(lbc));
+ fl_line(plbc.x1, plbc.y1, plbc.x2, plbc.y2);
+ // right-bottom corner
+ fl_color(gradient_color(rbc));
+ fl_line(prbc.x1, prbc.y1, prbc.x2, prbc.y2);
+ // left-top corner
+ fl_color(gradient_color(ltc));
+ fl_line(pltc.x1, pltc.y1, pltc.x2, pltc.y2);
+ // right-top corner
+ fl_color(gradient_color(rtc));
+ fl_line(prtc.x1, prtc.y1, prtc.x2, prtc.y2);
+
+ if(ft == FL_FRAME_TYPE_UP_FRAME || ft == FL_FRAME_TYPE_DOWN_FRAME || ft ==
FL_FRAME_TYPE_UP_BOX || ft == FL_FRAME_TYPE_DOWN_BOX || ft ==
FL_FRAME_TYPE_UP_BOX_S || ft == FL_FRAME_TYPE_DOWN_BOX_S){
+ if(!LT){ pltc.y2+=1; }
+ if(!LB){ plbc.y1-=1; }
+ if(!RT){ prtc.y2+=1; }
+ if(!RB){ prbc.y1-=1; }
+ }
+
+ else {
+ if(!LT){ pltc.x1+=1; }
+ if(!LB){ plbc.x2+=1; }
+ if(!RT){ prtc.x1-=1; }
+ if(!RB){ prbc.x2-=1; }
+ }
+
+ // bottom line
+ fl_color(gradient_color(bottomline));
+ fl_line(plbc.x2, plbc.y2, prbc.x2, prbc.y2);
+ // top line
+ fl_color(gradient_color(topline));
+ fl_line(pltc.x1, pltc.y1, prtc.x1, prtc.y1);
+ // left line
+ fl_color(gradient_color(leftline));
+ fl_line(pltc.x2, pltc.y2, plbc.x1, plbc.y1);
+ // right line
+ fl_color(gradient_color(rightline));
+ fl_line(prtc.x2, prtc.y2, prbc.x1, prbc.y1);
+
+ /// to draw second line of shadow
+ if(fs == FL_FRAME_SHADOW_NORMAL){
+ fl_color(gradient_color(fl_color_average(frame, FL_WHITE, 0.87)));
+ // left line
+ fl_line(pltc.x2+1, pltc.y2+1, plbc.x1+1, plbc.y1-1);
+ // right line
+ fl_line(prtc.x2-1, prtc.y2+1, prbc.x1-1, prbc.y1-1);
+ // top line
+ fl_line(pltc.x1+1, pltc.y1+1, prtc.x1-1, prtc.y1+1);
+ // bottom line
+ fl_line(plbc.x2+1, plbc.y2-1, prbc.x2-1, prbc.y2-1);
+ /// to draw corners
+ // left-bottom corner
+ if(LB){ fl_line(plbc.x1+1, plbc.y1, plbc.x2, plbc.y2-1); }
+ // right-bottom corner
+ if(RB){ fl_line(prbc.x1-1, prbc.y1, prbc.x2, prbc.y2-1); }
+ // right-top corner
+ if(RT){ fl_line(prtc.x1, prtc.y1+1, prtc.x2-1, prtc.y2); }
+ // left-top corner
+ if(LT){ fl_line(pltc.x1, pltc.y1+1, pltc.x2+1, pltc.y2); }
+ }
+ }
+ }
+
+ } /// end `if(fs != FL_FRAME_SHADOW_NONE)'
+
+
+ return;
+
+} /// end `void fl_designer(...)'
+
+#endif
diff -U 3 -H -d -r -N -- src/fl_grad1.cxx src/fl_grad1.cxx
--- src/fl_grad1.cxx 1970-01-01 05:00:00.000000000 +0500
+++ src/fl_grad1.cxx 2011-07-05 05:15:35.438000002 +0600
@@ -0,0 +1,104 @@
+#ifndef fl_grad1_cxx
+#define fl_grad1_cxx
+
+//
+// "Grad1" drawing routines for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 2011 by Dmitrij K. e-mail: kdiman at live dot ru
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+
+#include <FL/Fl.H>
+#include <FL/fl_draw.H>
+#include <FL/fl_designer.H>
+#include "fl_grad1.h"
+
+void grad1_button_up_box(int x, int y, int w, int h, Fl_Color c){
+ fl_designer(x, y, w, h, c, c, 1, FL_FRAME_SHADOW_THIN, FL_FRAME_TYPE_UP_BOX,
0.45f, FL_GRADIENT_STYLE_BUTTON, FL_ROUND_CORNER_ALL);
+}
+
+void grad1_button_down_box(int x, int y, int w, int h, Fl_Color c){
+ fl_designer(x, y, w, h, c, c, 1, FL_FRAME_SHADOW_THIN,
FL_FRAME_TYPE_DOWN_BOX, 0.45f, FL_GRADIENT_STYLE_BUTTON, FL_ROUND_CORNER_ALL);
+}
+
+void grad1_up_box(int x, int y, int w, int h, Fl_Color c){
+ fl_designer(x, y, w, h, c, c, 1, FL_FRAME_SHADOW_THIN, FL_FRAME_TYPE_UP_BOX,
0.45f, FL_GRADIENT_STYLE_S, FL_ROUND_CORNER_ALL);
+}
+
+void grad1_down_box(int x, int y, int w, int h, Fl_Color c){
+ fl_designer(x, y, w, h, c, c, 1, FL_FRAME_SHADOW_THIN,
FL_FRAME_TYPE_DOWN_BOX, 0.45f, FL_GRADIENT_STYLE_N, FL_ROUND_CORNER_ALL);
+}
+
+void grad1_thin_up_box(int x, int y, int w, int h, Fl_Color c){
+ fl_designer(x, y, w, h, c, c, 1, FL_FRAME_SHADOW_NONE, FL_FRAME_TYPE_UP_BOX,
0.45f, FL_GRADIENT_STYLE_S, FL_ROUND_CORNER_ALL);
+}
+
+void grad1_thin_down_box(int x, int y, int w, int h, Fl_Color c){
+ fl_designer(x, y, w, h, c, c, 1, FL_FRAME_SHADOW_NONE,
FL_FRAME_TYPE_DOWN_BOX, 0.45f, FL_GRADIENT_STYLE_N, FL_ROUND_CORNER_ALL);
+}
+
+void grad1_up_frame(int x, int y, int w, int h, Fl_Color c){
+ fl_designer(x, y, w, h, c, c, 1, FL_FRAME_SHADOW_THIN,
FL_FRAME_TYPE_UP_FRAME, 0.45f, FL_GRADIENT_STYLE_S, FL_ROUND_CORNER_ALL);
+}
+
+void grad1_down_frame(int x, int y, int w, int h, Fl_Color c){
+ fl_designer(x, y, w, h, c, c, 1, FL_FRAME_SHADOW_THIN,
FL_FRAME_TYPE_DOWN_FRAME, 0.45f, FL_GRADIENT_STYLE_N, FL_ROUND_CORNER_ALL);
+}
+
+void grad1_thin_up_frame(int x, int y, int w, int h, Fl_Color c){
+ fl_designer(x, y, w, h, c, c, 1, FL_FRAME_SHADOW_NONE,
FL_FRAME_TYPE_UP_FRAME, 0.45f, FL_GRADIENT_STYLE_S, FL_ROUND_CORNER_ALL);
+}
+
+void grad1_thin_down_frame(int x, int y, int w, int h, Fl_Color c){
+ fl_designer(x, y, w, h, c, c, 1, FL_FRAME_SHADOW_NONE,
FL_FRAME_TYPE_DOWN_FRAME, 0.45f, FL_GRADIENT_STYLE_N, FL_ROUND_CORNER_ALL);
+}
+
+void grad1_round_up_box(int x, int y, int w, int h, Fl_Color c){
+ fl_designer(x, y, w, h, c, c, 1, FL_FRAME_SHADOW_THIN,
FL_FRAME_TYPE_ROUND_UP_BOX, 0.45f, FL_GRADIENT_STYLE_S, FL_ROUND_CORNER_ALL);
+}
+
+void grad1_round_down_box(int x, int y, int w, int h, Fl_Color c){
+ fl_designer(x, y, w, h, c, c, 1, FL_FRAME_SHADOW_THIN,
FL_FRAME_TYPE_ROUND_DOWN_BOX, 0.45f, FL_GRADIENT_STYLE_N, FL_ROUND_CORNER_ALL);
+}
+
+
+extern void fl_internal_boxtype(Fl_Boxtype, Fl_Box_Draw_F*);
+
+Fl_Boxtype fl_define_FL_GRAD1_UP_BOX(){
+
+ fl_internal_boxtype(_FL_GRAD1_UP_BOX, grad1_up_box);
+ fl_internal_boxtype(_FL_GRAD1_DOWN_BOX, grad1_down_box);
+ fl_internal_boxtype(_FL_GRAD1_UP_FRAME, grad1_up_frame);
+ fl_internal_boxtype(_FL_GRAD1_DOWN_FRAME, grad1_down_frame);
+ fl_internal_boxtype(_FL_GRAD1_THIN_UP_BOX, grad1_thin_up_box);
+ fl_internal_boxtype(_FL_GRAD1_THIN_DOWN_BOX, grad1_thin_down_box);
+ fl_internal_boxtype(_FL_GRAD1_THIN_UP_FRAME, grad1_thin_up_frame);
+ fl_internal_boxtype(_FL_GRAD1_THIN_DOWN_FRAME, grad1_thin_down_frame);
+ fl_internal_boxtype(_FL_GRAD1_ROUND_UP_BOX, grad1_round_up_box);
+ fl_internal_boxtype(_FL_GRAD1_ROUND_DOWN_BOX, grad1_round_down_box);
+ fl_internal_boxtype(_FL_GRAD1_BUTTON_UP_BOX, grad1_button_up_box);
+ fl_internal_boxtype(_FL_GRAD1_BUTTON_DOWN_BOX, grad1_button_down_box);
+
+ return _FL_GRAD1_UP_BOX;
+
+}
+
+#endif
diff -U 3 -H -d -r -N -- src/fl_grad1.h src/fl_grad1.h
--- src/fl_grad1.h 1970-01-01 05:00:00.000000000 +0500
+++ src/fl_grad1.h 2011-07-05 05:16:34.360000000 +0600
@@ -0,0 +1,44 @@
+#ifndef fl_grad1_h
+#define fl_grad1_h
+
+//
+// "Grad1" drawing routines for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 2011 by Dmitrij K. e-mail: kdiman at live dot ru
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+
+#include <FL/Fl.H>
+
+extern void grad1_up_box(int x, int y, int w, int h, Fl_Color c);
+extern void grad1_down_box(int x, int y, int w, int h, Fl_Color c);
+extern void grad1_up_frame(int x, int y, int w, int h, Fl_Color c);
+extern void grad1_down_frame(int x, int y, int w, int h, Fl_Color c);
+extern void grad1_thin_up_box(int x, int y, int w, int h, Fl_Color c);
+extern void grad1_thin_down_box(int x, int y, int w, int h, Fl_Color c);
+extern void grad1_thin_up_frame(int x, int y, int w, int h, Fl_Color c);
+extern void grad1_thin_down_frame(int x, int y, int w, int h, Fl_Color c);
+extern void grad1_round_up_box(int x, int y, int w, int h, Fl_Color c);
+extern void grad1_round_down_box(int x, int y, int w, int h, Fl_Color c);
+extern void grad1_button_up_box(int x, int y, int w, int h, Fl_Color c);
+extern void grad1_button_down_box(int x, int y, int w, int h, Fl_Color c);
+
+#endif
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev