Assists music production by grouping standalone programs into sessions. Community version of "Non Session Manager".
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
3.5KB

  1. /*******************************************************************************/
  2. /* Copyright (C) 2012 Jonathan Moore Liles */
  3. /* Copyright (C) 2001-2005 by Colin Jones */
  4. /* */
  5. /* This program is free software; you can redistribute it and/or modify it */
  6. /* under the terms of the GNU General Public License as published by the */
  7. /* Free Software Foundation; either version 2 of the License, or (at your */
  8. /* option) any later version. */
  9. /* */
  10. /* This program is distributed in the hope that it will be useful, but WITHOUT */
  11. /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
  12. /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */
  13. /* more details. */
  14. /* */
  15. /* You should have received a copy of the GNU General Public License along */
  16. /* with This program; see the file COPYING. If not,write to the Free Software */
  17. /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
  18. /*******************************************************************************/
  19. /* Taken from the "Gleam" FLTK scheme, as modified by prodatum */
  20. #include <FL/Fl.H>
  21. #include <FL/fl_draw.H>
  22. #include "FL/Fl_Theme.H"
  23. static void clean_color(Fl_Color c)
  24. {
  25. c = fl_color_average( FL_GRAY, c, 0.4 );
  26. if (Fl::draw_box_active())
  27. fl_color(c);
  28. else
  29. fl_color(fl_inactive(c));
  30. }
  31. static void rect(int x, int y, int w, int h, Fl_Color bc)
  32. {
  33. // clean_color( bc );
  34. fl_rect( x, y, w, h, bc );
  35. }
  36. static void rectf ( int x, int y,int w, int h, Fl_Color bc )
  37. {
  38. clean_color(fl_color_average( FL_WHITE, bc, 0.05 ) );
  39. fl_rectf( x, y, w, h );
  40. }
  41. static void up_frame(int x, int y, int w, int h, Fl_Color c)
  42. {
  43. rect(x, y, w, h, fl_color_average( FL_WHITE, c, 0.2 ) );
  44. }
  45. static void up_box(int x, int y, int w, int h, Fl_Color c)
  46. {
  47. rectf(x, y, w, h, c );
  48. rect(x, y, w, h, fl_color_average( FL_WHITE, c, 0.2 ) );
  49. }
  50. static void down_frame(int x, int y, int w, int h, Fl_Color c)
  51. {
  52. rect(x, y, w, h, fl_color_average( FL_BLACK, c, 0.2 ) );
  53. }
  54. static void down_box(int x, int y, int w, int h, Fl_Color c)
  55. {
  56. rectf(x, y, w, h, fl_color_average( FL_WHITE, c, 0.2 ) );
  57. rect(x, y, w, h, fl_color_average( FL_WHITE, c, 0.4 ) );
  58. }
  59. static void flat_box( int x, int y, int w, int h, Fl_Color c )
  60. {
  61. rectf( x, y, w, h, c );
  62. }
  63. static void
  64. init_theme ( void )
  65. {
  66. Fl::set_boxtype( FL_UP_BOX, up_box, 1,1,2,2 );
  67. Fl::set_boxtype( FL_DOWN_BOX, down_box, 1,1,2,2 );
  68. Fl::set_boxtype( FL_THIN_UP_BOX, up_box, 1,1,2,2 );
  69. Fl::set_boxtype( FL_THIN_DOWN_BOX, down_box, 1,1,2,2 );
  70. Fl::set_boxtype( FL_UP_FRAME, up_frame, 1,1,2,2 );
  71. Fl::set_boxtype( FL_DOWN_FRAME, down_frame, 1,1,2,2 );
  72. Fl::set_boxtype( FL_ROUND_UP_BOX, up_box, 1,1,2,2 );
  73. Fl::set_boxtype( FL_ROUND_DOWN_BOX, down_box, 1,1,2,2 );
  74. Fl::set_boxtype( FL_FLAT_BOX, flat_box, 0, 0, 0, 0 );
  75. }
  76. void
  77. init_clean_theme ( void )
  78. {
  79. Fl_Theme *t = new Fl_Theme( "Clean", "", "", init_theme );
  80. Fl_Theme::add( t );
  81. }