From a6163888f3c56123b1db313743c6147ba498732c Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Fri, 8 Aug 2014 14:42:07 +0300 Subject: Add third_party libs --- .../windows/fltk-1.1.10/fluid/CMakeLists.txt | 30 + .../windows/fltk-1.1.10/fluid/CodeEditor.cxx | 419 +++ third_party/windows/fltk-1.1.10/fluid/CodeEditor.h | 88 + .../windows/fltk-1.1.10/fluid/Fl_Function_Type.cxx | 1184 +++++++++ .../windows/fltk-1.1.10/fluid/Fl_Group_Type.cxx | 330 +++ .../windows/fltk-1.1.10/fluid/Fl_Menu_Type.cxx | 611 +++++ third_party/windows/fltk-1.1.10/fluid/Fl_Type.cxx | 908 +++++++ third_party/windows/fltk-1.1.10/fluid/Fl_Type.h | 772 ++++++ .../windows/fltk-1.1.10/fluid/Fl_Widget_Type.cxx | 2745 ++++++++++++++++++++ .../windows/fltk-1.1.10/fluid/Fl_Widget_Type.h | 42 + .../windows/fltk-1.1.10/fluid/Fl_Window_Type.cxx | 1533 +++++++++++ .../windows/fltk-1.1.10/fluid/Fluid_Image.cxx | 229 ++ .../windows/fltk-1.1.10/fluid/Fluid_Image.h | 66 + third_party/windows/fltk-1.1.10/fluid/Makefile | 137 + .../windows/fltk-1.1.10/fluid/Shortcut_Button.h | 41 + .../windows/fltk-1.1.10/fluid/about_panel.cxx | 306 +++ .../windows/fltk-1.1.10/fluid/about_panel.fl | 74 + .../windows/fltk-1.1.10/fluid/about_panel.h | 44 + .../windows/fltk-1.1.10/fluid/align_widget.cxx | 541 ++++ .../windows/fltk-1.1.10/fluid/alignment_panel.cxx | 506 ++++ .../windows/fltk-1.1.10/fluid/alignment_panel.fl | 420 +++ .../windows/fltk-1.1.10/fluid/alignment_panel.h | 106 + third_party/windows/fltk-1.1.10/fluid/code.cxx | 592 +++++ third_party/windows/fltk-1.1.10/fluid/comments.h | 82 + third_party/windows/fltk-1.1.10/fluid/factory.cxx | 1210 +++++++++ third_party/windows/fltk-1.1.10/fluid/file.cxx | 650 +++++ .../fluid/fluid.app/Contents/Info.plist | 68 + .../fltk-1.1.10/fluid/fluid.app/Contents/PkgInfo | 1 + .../fluid/fluid.app/Contents/Resources/fluid.icns | Bin 0 -> 34648 bytes third_party/windows/fltk-1.1.10/fluid/fluid.cxx | 2253 ++++++++++++++++ .../windows/fltk-1.1.10/fluid/fluid.desktop | 10 + .../windows/fltk-1.1.10/fluid/function_panel.cxx | 979 +++++++ .../windows/fltk-1.1.10/fluid/function_panel.fl | 819 ++++++ .../windows/fltk-1.1.10/fluid/function_panel.h | 119 + .../windows/fltk-1.1.10/fluid/icons/fluid-128.png | Bin 0 -> 10179 bytes .../windows/fltk-1.1.10/fluid/icons/fluid-16.png | Bin 0 -> 706 bytes .../windows/fltk-1.1.10/fluid/icons/fluid-16i.png | Bin 0 -> 278 bytes .../windows/fltk-1.1.10/fluid/icons/fluid-256.png | Bin 0 -> 23785 bytes .../windows/fltk-1.1.10/fluid/icons/fluid-32.png | Bin 0 -> 1587 bytes .../windows/fltk-1.1.10/fluid/icons/fluid-32.xpm | 67 + .../windows/fltk-1.1.10/fluid/icons/fluid-32i.png | Bin 0 -> 450 bytes .../windows/fltk-1.1.10/fluid/icons/fluid-48.png | Bin 0 -> 2763 bytes .../windows/fltk-1.1.10/fluid/icons/fluid-64.png | Bin 0 -> 3942 bytes .../windows/fltk-1.1.10/fluid/icons/fluid-96.xpm | 131 + .../windows/fltk-1.1.10/fluid/icons/fluid.ico | Bin 0 -> 1078 bytes .../windows/fltk-1.1.10/fluid/icons/fluid.xcf.gz | Bin 0 -> 22590 bytes third_party/windows/fltk-1.1.10/fluid/makedepend | 294 +++ third_party/windows/fltk-1.1.10/fluid/makefile.wat | 79 + .../fltk-1.1.10/fluid/pixmaps/flAdjuster.xpm | 29 + .../windows/fltk-1.1.10/fluid/pixmaps/flBox.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flBrowser.xpm | 29 + .../windows/fltk-1.1.10/fluid/pixmaps/flButton.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flCheckBrowser.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flCheckButton.xpm | 30 + .../windows/fltk-1.1.10/fluid/pixmaps/flChoice.xpm | 29 + .../windows/fltk-1.1.10/fluid/pixmaps/flClass.xpm | 27 + .../windows/fltk-1.1.10/fluid/pixmaps/flClock.xpm | 28 + .../windows/fltk-1.1.10/fluid/pixmaps/flCode.xpm | 27 + .../fltk-1.1.10/fluid/pixmaps/flCodeBlock.xpm | 27 + .../fltk-1.1.10/fluid/pixmaps/flComment.xpm | 27 + .../fltk-1.1.10/fluid/pixmaps/flCounter.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flDeclaration.xpm | 27 + .../fluid/pixmaps/flDeclarationBlock.xpm | 27 + .../windows/fltk-1.1.10/fluid/pixmaps/flDial.xpm | 28 + .../fltk-1.1.10/fluid/pixmaps/flFileBrowser.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flFileInput.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flFunction.xpm | 27 + .../windows/fltk-1.1.10/fluid/pixmaps/flGroup.xpm | 29 + .../windows/fltk-1.1.10/fluid/pixmaps/flHelp.xpm | 29 + .../windows/fltk-1.1.10/fluid/pixmaps/flInput.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flLightButton.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flMenuButton.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flMenubar.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flMenuitem.xpm | 29 + .../windows/fltk-1.1.10/fluid/pixmaps/flOutput.xpm | 29 + .../windows/fltk-1.1.10/fluid/pixmaps/flPack.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flProgress.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flRepeatButton.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flReturnButton.xpm | 29 + .../windows/fltk-1.1.10/fluid/pixmaps/flRoller.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flRoundButton.xpm | 30 + .../windows/fltk-1.1.10/fluid/pixmaps/flScroll.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flScrollBar.xpm | 29 + .../windows/fltk-1.1.10/fluid/pixmaps/flSlider.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flSpinner.xpm | 25 + .../fltk-1.1.10/fluid/pixmaps/flSubmenu.xpm | 29 + .../windows/fltk-1.1.10/fluid/pixmaps/flTabs.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flTextDisplay.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flTextEdit.xpm | 29 + .../windows/fltk-1.1.10/fluid/pixmaps/flTile.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flValueInput.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flValueOutput.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flValueSlider.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/flWidgetClass.xpm | 31 + .../windows/fltk-1.1.10/fluid/pixmaps/flWindow.xpm | 29 + .../windows/fltk-1.1.10/fluid/pixmaps/flWizard.xpm | 29 + .../windows/fltk-1.1.10/fluid/pixmaps/lock.xpm | 29 + .../fltk-1.1.10/fluid/pixmaps/print_color.xpm | 44 + .../fltk-1.1.10/fluid/pixmaps/print_gray.xpm | 44 + .../fltk-1.1.10/fluid/pixmaps/protected.xpm | 29 + .../windows/fltk-1.1.10/fluid/print_panel.cxx | 588 +++++ .../windows/fltk-1.1.10/fluid/print_panel.fl | 370 +++ .../windows/fltk-1.1.10/fluid/print_panel.h | 71 + .../windows/fltk-1.1.10/fluid/template_panel.cxx | 258 ++ .../windows/fltk-1.1.10/fluid/template_panel.fl | 244 ++ .../windows/fltk-1.1.10/fluid/template_panel.h | 55 + third_party/windows/fltk-1.1.10/fluid/undo.cxx | 192 ++ third_party/windows/fltk-1.1.10/fluid/undo.h | 46 + .../windows/fltk-1.1.10/fluid/widget_panel.cxx | 795 ++++++ .../windows/fltk-1.1.10/fluid/widget_panel.fl | 579 +++++ .../windows/fltk-1.1.10/fluid/widget_panel.h | 122 + .../windows/fltk-1.1.10/fluid/x-fluid.desktop | 8 + 112 files changed, 23336 insertions(+) create mode 100644 third_party/windows/fltk-1.1.10/fluid/CMakeLists.txt create mode 100644 third_party/windows/fltk-1.1.10/fluid/CodeEditor.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/CodeEditor.h create mode 100644 third_party/windows/fltk-1.1.10/fluid/Fl_Function_Type.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/Fl_Group_Type.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/Fl_Menu_Type.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/Fl_Type.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/Fl_Type.h create mode 100644 third_party/windows/fltk-1.1.10/fluid/Fl_Widget_Type.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/Fl_Widget_Type.h create mode 100644 third_party/windows/fltk-1.1.10/fluid/Fl_Window_Type.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/Fluid_Image.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/Fluid_Image.h create mode 100644 third_party/windows/fltk-1.1.10/fluid/Makefile create mode 100644 third_party/windows/fltk-1.1.10/fluid/Shortcut_Button.h create mode 100644 third_party/windows/fltk-1.1.10/fluid/about_panel.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/about_panel.fl create mode 100644 third_party/windows/fltk-1.1.10/fluid/about_panel.h create mode 100644 third_party/windows/fltk-1.1.10/fluid/align_widget.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/alignment_panel.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/alignment_panel.fl create mode 100644 third_party/windows/fltk-1.1.10/fluid/alignment_panel.h create mode 100644 third_party/windows/fltk-1.1.10/fluid/code.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/comments.h create mode 100644 third_party/windows/fltk-1.1.10/fluid/factory.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/file.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/fluid.app/Contents/Info.plist create mode 100644 third_party/windows/fltk-1.1.10/fluid/fluid.app/Contents/PkgInfo create mode 100644 third_party/windows/fltk-1.1.10/fluid/fluid.app/Contents/Resources/fluid.icns create mode 100644 third_party/windows/fltk-1.1.10/fluid/fluid.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/fluid.desktop create mode 100644 third_party/windows/fltk-1.1.10/fluid/function_panel.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/function_panel.fl create mode 100644 third_party/windows/fltk-1.1.10/fluid/function_panel.h create mode 100644 third_party/windows/fltk-1.1.10/fluid/icons/fluid-128.png create mode 100644 third_party/windows/fltk-1.1.10/fluid/icons/fluid-16.png create mode 100644 third_party/windows/fltk-1.1.10/fluid/icons/fluid-16i.png create mode 100644 third_party/windows/fltk-1.1.10/fluid/icons/fluid-256.png create mode 100644 third_party/windows/fltk-1.1.10/fluid/icons/fluid-32.png create mode 100644 third_party/windows/fltk-1.1.10/fluid/icons/fluid-32.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/icons/fluid-32i.png create mode 100644 third_party/windows/fltk-1.1.10/fluid/icons/fluid-48.png create mode 100644 third_party/windows/fltk-1.1.10/fluid/icons/fluid-64.png create mode 100644 third_party/windows/fltk-1.1.10/fluid/icons/fluid-96.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/icons/fluid.ico create mode 100644 third_party/windows/fltk-1.1.10/fluid/icons/fluid.xcf.gz create mode 100644 third_party/windows/fltk-1.1.10/fluid/makedepend create mode 100644 third_party/windows/fltk-1.1.10/fluid/makefile.wat create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flAdjuster.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flBox.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flBrowser.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flButton.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flCheckBrowser.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flCheckButton.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flChoice.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flClass.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flClock.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flCode.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flCodeBlock.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flComment.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flCounter.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flDeclaration.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flDeclarationBlock.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flDial.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flFileBrowser.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flFileInput.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flFunction.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flGroup.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flHelp.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flInput.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flLightButton.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flMenuButton.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flMenubar.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flMenuitem.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flOutput.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flPack.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flProgress.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flRepeatButton.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flReturnButton.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flRoller.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flRoundButton.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flScroll.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flScrollBar.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flSlider.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flSpinner.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flSubmenu.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flTabs.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flTextDisplay.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flTextEdit.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flTile.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flValueInput.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flValueOutput.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flValueSlider.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flWidgetClass.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flWindow.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/flWizard.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/lock.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/print_color.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/print_gray.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/pixmaps/protected.xpm create mode 100644 third_party/windows/fltk-1.1.10/fluid/print_panel.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/print_panel.fl create mode 100644 third_party/windows/fltk-1.1.10/fluid/print_panel.h create mode 100644 third_party/windows/fltk-1.1.10/fluid/template_panel.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/template_panel.fl create mode 100644 third_party/windows/fltk-1.1.10/fluid/template_panel.h create mode 100644 third_party/windows/fltk-1.1.10/fluid/undo.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/undo.h create mode 100644 third_party/windows/fltk-1.1.10/fluid/widget_panel.cxx create mode 100644 third_party/windows/fltk-1.1.10/fluid/widget_panel.fl create mode 100644 third_party/windows/fltk-1.1.10/fluid/widget_panel.h create mode 100644 third_party/windows/fltk-1.1.10/fluid/x-fluid.desktop (limited to 'third_party/windows/fltk-1.1.10/fluid') diff --git a/third_party/windows/fltk-1.1.10/fluid/CMakeLists.txt b/third_party/windows/fltk-1.1.10/fluid/CMakeLists.txt new file mode 100644 index 0000000..8f19c03 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/CMakeLists.txt @@ -0,0 +1,30 @@ +SET(CPPFILES + CodeEditor.cxx + Fl_Function_Type.cxx + Fl_Group_Type.cxx + Fl_Menu_Type.cxx + Fl_Type.cxx + Fl_Widget_Type.cxx + Fl_Window_Type.cxx + Fluid_Image.cxx + about_panel.cxx + align_widget.cxx + alignment_panel.cxx + code.cxx + factory.cxx + file.cxx + fluid.cxx + function_panel.cxx + template_panel.cxx + undo.cxx + widget_panel.cxx +) + + +ADD_EXECUTABLE(fluid ${CPPFILES}) +INSTALL_TARGETS(/bin fluid) +TARGET_LINK_LIBRARIES(fluid fltk fltk_images fltk_forms ${FLTK_PLATFORM_DEPENDENT_LIBS}) +IF(OPENGL_FOUND) + TARGET_LINK_LIBRARIES(fluid fltk_gl) +ENDIF(OPENGL_FOUND) + diff --git a/third_party/windows/fltk-1.1.10/fluid/CodeEditor.cxx b/third_party/windows/fltk-1.1.10/fluid/CodeEditor.cxx new file mode 100644 index 0000000..a69f745 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/CodeEditor.cxx @@ -0,0 +1,419 @@ +// +// "$Id: CodeEditor.cxx 5498 2006-09-29 21:02:27Z mike $" +// +// Code editor widget for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 necessary headers... +// + +#include +#include +#include +#include +#include "CodeEditor.h" + + +Fl_Text_Display::Style_Table_Entry CodeEditor:: + styletable[] = { // Style table + { FL_FOREGROUND_COLOR, FL_COURIER, 11 }, // A - Plain + { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // B - Line comments + { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // C - Block comments + { FL_BLUE, FL_COURIER, 11 }, // D - Strings + { FL_DARK_RED, FL_COURIER, 11 }, // E - Directives + { FL_DARK_RED, FL_COURIER_BOLD, 11 }, // F - Types + { FL_BLUE, FL_COURIER_BOLD, 11 } // G - Keywords + }; +const char * const CodeEditor:: + code_keywords[] = { // Sorted list of C/C++ keywords... + "and", + "and_eq", + "asm", + "bitand", + "bitor", + "break", + "case", + "catch", + "compl", + "continue", + "default", + "delete", + "do", + "else", + "false", + "for", + "goto", + "if", + "new", + "not", + "not_eq", + "operator", + "or", + "or_eq", + "return", + "switch", + "template", + "this", + "throw", + "true", + "try", + "while", + "xor", + "xor_eq" + }; +const char * const CodeEditor:: + code_types[] = { // Sorted list of C/C++ types... + "auto", + "bool", + "char", + "class", + "const", + "const_cast", + "double", + "dynamic_cast", + "enum", + "explicit", + "extern", + "float", + "friend", + "inline", + "int", + "long", + "mutable", + "namespace", + "private", + "protected", + "public", + "register", + "short", + "signed", + "sizeof", + "static", + "static_cast", + "struct", + "template", + "typedef", + "typename", + "union", + "unsigned", + "virtual", + "void", + "volatile" + }; + + +// 'compare_keywords()' - Compare two keywords... +int CodeEditor::compare_keywords(const void *a, const void *b) { + return (strcmp(*((const char **)a), *((const char **)b))); +} + +// 'style_parse()' - Parse text and produce style data. +void CodeEditor::style_parse(const char *text, char *style, int length) { + char current; + int col; + int last; + char buf[255], + *bufptr; + const char *temp; + + // Style letters: + // + // A - Plain + // B - Line comments + // C - Block comments + // D - Strings + // E - Directives + // F - Types + // G - Keywords + + for (current = *style, col = 0, last = 0; length > 0; length --, text ++) { + if (current == 'B' || current == 'F' || current == 'G') current = 'A'; + if (current == 'A') { + // Check for directives, comments, strings, and keywords... + if (col == 0 && *text == '#') { + // Set style to directive + current = 'E'; + } else if (strncmp(text, "//", 2) == 0) { + current = 'B'; + for (; length > 0 && *text != '\n'; length --, text ++) *style++ = 'B'; + + if (length == 0) break; + } else if (strncmp(text, "/*", 2) == 0) { + current = 'C'; + } else if (strncmp(text, "\\\"", 2) == 0) { + // Quoted quote... + *style++ = current; + *style++ = current; + text ++; + length --; + col += 2; + continue; + } else if (*text == '\"') { + current = 'D'; + } else if (!last && (islower(*text) || *text == '_')) { + // Might be a keyword... + for (temp = text, bufptr = buf; + (islower(*temp) || *temp == '_') && bufptr < (buf + sizeof(buf) - 1); + *bufptr++ = *temp++); + + if (!islower(*temp) && *temp != '_') { + *bufptr = '\0'; + + bufptr = buf; + + if (bsearch(&bufptr, code_types, + sizeof(code_types) / sizeof(code_types[0]), + sizeof(code_types[0]), compare_keywords)) { + while (text < temp) { + *style++ = 'F'; + text ++; + length --; + col ++; + } + + text --; + length ++; + last = 1; + continue; + } else if (bsearch(&bufptr, code_keywords, + sizeof(code_keywords) / sizeof(code_keywords[0]), + sizeof(code_keywords[0]), compare_keywords)) { + while (text < temp) { + *style++ = 'G'; + text ++; + length --; + col ++; + } + + text --; + length ++; + last = 1; + continue; + } + } + } + } else if (current == 'C' && strncmp(text, "*/", 2) == 0) { + // Close a C comment... + *style++ = current; + *style++ = current; + text ++; + length --; + current = 'A'; + col += 2; + continue; + } else if (current == 'D') { + // Continuing in string... + if (strncmp(text, "\\\"", 2) == 0) { + // Quoted end quote... + *style++ = current; + *style++ = current; + text ++; + length --; + col += 2; + continue; + } else if (*text == '\"') { + // End quote... + *style++ = current; + col ++; + current = 'A'; + continue; + } + } + + // Copy style info... + if (current == 'A' && (*text == '{' || *text == '}')) *style++ = 'G'; + else *style++ = current; + col ++; + + last = isalnum(*text) || *text == '_' || *text == '.'; + + if (*text == '\n') { + // Reset column and possibly reset the style + col = 0; + if (current == 'B' || current == 'E') current = 'A'; + } + } +} + +// 'style_unfinished_cb()' - Update unfinished styles. +void CodeEditor::style_unfinished_cb(int, void*) { } + +// 'style_update()' - Update the style buffer... +void CodeEditor::style_update(int pos, int nInserted, int nDeleted, + int /*nRestyled*/, const char * /*deletedText*/, + void *cbArg) { + CodeEditor *editor = (CodeEditor *)cbArg; + int start, // Start of text + end; // End of text + char last, // Last style on line + *style, // Style data + *text; // Text data + + + // If this is just a selection change, just unselect the style buffer... + if (nInserted == 0 && nDeleted == 0) { + editor->mStyleBuffer->unselect(); + return; + } + + // Track changes in the text buffer... + if (nInserted > 0) { + // Insert characters into the style buffer... + style = new char[nInserted + 1]; + memset(style, 'A', nInserted); + style[nInserted] = '\0'; + + editor->mStyleBuffer->replace(pos, pos + nDeleted, style); + delete[] style; + } else { + // Just delete characters in the style buffer... + editor->mStyleBuffer->remove(pos, pos + nDeleted); + } + + // Select the area that was just updated to avoid unnecessary + // callbacks... + editor->mStyleBuffer->select(pos, pos + nInserted - nDeleted); + + // Re-parse the changed region; we do this by parsing from the + // beginning of the line of the changed region to the end of + // the line of the changed region... Then we check the last + // style character and keep updating if we have a multi-line + // comment character... + start = editor->mBuffer->line_start(pos); + end = editor->mBuffer->line_end(pos + nInserted); + text = editor->mBuffer->text_range(start, end); + style = editor->mStyleBuffer->text_range(start, end); + if (start==end) + last = 0; + else + last = style[end - start - 1]; + + style_parse(text, style, end - start); + + editor->mStyleBuffer->replace(start, end, style); + editor->redisplay_range(start, end); + + if (start==end || last != style[end - start - 1]) { + // The last character on the line changed styles, so reparse the + // remainder of the buffer... + free(text); + free(style); + + end = editor->mBuffer->length(); + text = editor->mBuffer->text_range(start, end); + style = editor->mStyleBuffer->text_range(start, end); + + style_parse(text, style, end - start); + + editor->mStyleBuffer->replace(start, end, style); + editor->redisplay_range(start, end); + } + + free(text); + free(style); +} + +int CodeEditor::auto_indent(int, CodeEditor* e) { + if (e->buffer()->selected()) { + e->insert_position(e->buffer()->primary_selection()->start()); + e->buffer()->remove_selection(); + } + + int pos = e->insert_position(); + int start = e->line_start(pos); + char *text = e->buffer()->text_range(start, pos); + char *ptr; + + for (ptr = text; isspace(*ptr); ptr ++); + *ptr = '\0'; + if (*text) { + // use only a single 'insert' call to avoid redraw issues + int n = strlen(text); + char *b = (char*)malloc(n+2); + *b = '\n'; + strcpy(b+1, text); + e->insert(b); + free(b); + } else { + e->insert("\n"); + } + e->show_insert_position(); + e->set_changed(); + if (e->when()&FL_WHEN_CHANGED) e->do_callback(); + + free(text); + + return 1; +} + +// Create a CodeEditor widget... +CodeEditor::CodeEditor(int X, int Y, int W, int H, const char *L) : + Fl_Text_Editor(X, Y, W, H, L) { + buffer(new Fl_Text_Buffer); + + char *style = new char[mBuffer->length() + 1]; + char *text = mBuffer->text(); + + memset(style, 'A', mBuffer->length()); + style[mBuffer->length()] = '\0'; + + highlight_data(new Fl_Text_Buffer(mBuffer->length()), styletable, + sizeof(styletable) / sizeof(styletable[0]), + 'A', style_unfinished_cb, this); + + style_parse(text, style, mBuffer->length()); + + mStyleBuffer->text(style); + delete[] style; + free(text); + + mBuffer->add_modify_callback(style_update, this); + add_key_binding(FL_Enter, FL_TEXT_EDITOR_ANY_STATE, + (Fl_Text_Editor::Key_Func)auto_indent); +} + +// Destroy a CodeEditor widget... +CodeEditor::~CodeEditor() { + Fl_Text_Buffer *buf = mStyleBuffer; + mStyleBuffer = 0; + delete buf; + + buf = mBuffer; + buffer(0); + delete buf; +} + + +CodeViewer::CodeViewer(int X, int Y, int W, int H, const char *L) +: CodeEditor(X, Y, W, H, L) +{ + default_key_function(kf_ignore); + remove_all_key_bindings(&key_bindings); + cursor_style(CARET_CURSOR); +} + +// +// End of "$Id: CodeEditor.cxx 5498 2006-09-29 21:02:27Z mike $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/CodeEditor.h b/third_party/windows/fltk-1.1.10/fluid/CodeEditor.h new file mode 100644 index 0000000..aa544ed --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/CodeEditor.h @@ -0,0 +1,88 @@ +// +// "$Id: CodeEditor.h 5498 2006-09-29 21:02:27Z mike $" +// +// Code editor widget for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 CodeEditor_h +# define CodeEditor_h + +// +// Include necessary headers... +// + +# include +# include +# include +# include +# include +# include +# include + + +class CodeEditor : public Fl_Text_Editor { + static Fl_Text_Display::Style_Table_Entry styletable[]; + static const char * const code_keywords[]; + static const char * const code_types[]; + + + // 'compare_keywords()' - Compare two keywords... + static int compare_keywords(const void *a, const void *b); + + // 'style_parse()' - Parse text and produce style data. + static void style_parse(const char *text, char *style, int length); + + // 'style_unfinished_cb()' - Update unfinished styles. + static void style_unfinished_cb(int, void*); + + // 'style_update()' - Update the style buffer... + static void style_update(int pos, int nInserted, int nDeleted, + int /*nRestyled*/, const char * /*deletedText*/, + void *cbArg); + + static int auto_indent(int, CodeEditor* e); + + public: + + CodeEditor(int X, int Y, int W, int H, const char *L=0); + ~CodeEditor(); + int top_line() { return get_absolute_top_line_number(); } +}; + +class CodeViewer : public CodeEditor { + + public: + + CodeViewer(int X, int Y, int W, int H, const char *L=0); + + protected: + + int handle(int ev) { return Fl_Text_Display::handle(ev); } +}; + +#endif // !CodeEditor_h + +// +// End of "$Id: CodeEditor.h 5498 2006-09-29 21:02:27Z mike $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/Fl_Function_Type.cxx b/third_party/windows/fltk-1.1.10/fluid/Fl_Function_Type.cxx new file mode 100644 index 0000000..138964e --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/Fl_Function_Type.cxx @@ -0,0 +1,1184 @@ +// +// "$Id: Fl_Function_Type.cxx 6013 2008-01-04 22:18:40Z matt $" +// +// C function type code for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2006 by Bill Spitzak and others. +// +// 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 +#include +#include +#include "Fl_Type.h" +#include +#include "../src/flstring.h" +#include +#include + +extern int i18n_type; +extern const char* i18n_include; +extern const char* i18n_function; +extern const char* i18n_file; +extern const char* i18n_set; +extern char i18n_program[]; + +extern void redraw_browser(); + +//////////////////////////////////////////////////////////////// +// quick check of any C code for legality, returns an error message + +static char buffer[128]; // for error messages + +// check a quoted string ending in either " or ' or >: +const char *_q_check(const char * & c, int type) { + for (;;) switch (*c++) { + case '\0': + sprintf(buffer,"missing %c",type); + return buffer; + case '\\': + if (*c) c++; + break; + default: + if (*(c-1) == type) return 0; + } +} + +// check normal code, match braces and parenthesis: +const char *_c_check(const char * & c, int type) { + const char *d; + for (;;) switch (*c++) { + case 0: + if (!type) return 0; + sprintf(buffer, "missing %c", type); + return buffer; + case '/': + // Skip comments as needed... + if (*c == '/') { + while (*c != '\n' && *c) c++; + } else if (*c == '*') { + c++; + while ((*c != '*' || c[1] != '/') && *c) c++; + if (*c == '*') c+=2; + else { + return "missing '*/'"; + } + } + break; + case '#': + // treat cpp directives as a comment: + while (*c != '\n' && *c) c++; + break; + case '{': + if (type==')') goto UNEXPECTED; + d = _c_check(c,'}'); + if (d) return d; + break; + case '(': + d = _c_check(c,')'); + if (d) return d; + break; + case '\"': + d = _q_check(c,'\"'); + if (d) return d; + break; + case '\'': + d = _q_check(c,'\''); + if (d) return d; + break; + case '}': + case ')': + UNEXPECTED: + if (type == *(c-1)) return 0; + sprintf(buffer, "unexpected %c", *(c-1)); + return buffer; + } +} + +const char *c_check(const char *c, int type) { + return _c_check(c,type); +} + +//////////////////////////////////////////////////////////////// + +int Fl_Function_Type::is_public() const {return public_;} + +Fl_Type *Fl_Function_Type::make() { + Fl_Type *p = Fl_Type::current; + while (p && !p->is_decl_block()) p = p->parent; + Fl_Function_Type *o = new Fl_Function_Type(); + o->name("make_window()"); + o->return_type = 0; + o->add(p); + o->factory = this; + o->public_ = 1; + o->cdecl_ = 0; + return o; +} + +void Fl_Function_Type::write_properties() { + Fl_Type::write_properties(); + switch (public_) { + case 0: write_string("private"); break; + case 2: write_string("protected"); break; + } + if (cdecl_) write_string("C"); + if (return_type) { + write_string("return_type"); + write_word(return_type); + } +} + +void Fl_Function_Type::read_property(const char *c) { + if (!strcmp(c,"private")) { + public_ = 0; + } else if (!strcmp(c,"protected")) { + public_ = 2; + } else if (!strcmp(c,"C")) { + cdecl_ = 1; + } else if (!strcmp(c,"return_type")) { + storestring(read_word(),return_type); + } else { + Fl_Type::read_property(c); + } +} + +#include "function_panel.h" +#include + +void Fl_Function_Type::open() { + if (!function_panel) make_function_panel(); + f_return_type_input->static_value(return_type); + f_name_input->static_value(name()); + if (is_in_class()) { + f_public_member_choice->value(public_); + f_public_member_choice->show(); + f_public_choice->hide(); + } else { + f_public_choice->value(public_>0); + f_public_choice->show(); + f_public_member_choice->hide(); + } + f_c_button->value(cdecl_); + function_panel->show(); + const char* message = 0; + for (;;) { // repeat as long as there are errors + if (message) fl_alert(message); + for (;;) { + Fl_Widget* w = Fl::readqueue(); + if (w == f_panel_cancel) goto BREAK2; + else if (w == f_panel_ok) break; + else if (!w) Fl::wait(); + } + const char*c = f_name_input->value(); + while (isspace(*c)) c++; + message = c_check(c); if (message) continue; + const char *d = c; + for (; *d != '('; d++) if (isspace(*d) || !*d) break; + if (*c && *d != '(') { + message = "must be name(arguments), try again:"; continue; + } + int mod = 0; + c = f_return_type_input->value(); + message = c_check(c); if (message) continue; + name(f_name_input->value()); + storestring(c, return_type); + if (is_in_class()) { + if (public_ != f_public_member_choice->value()) { + mod = 1; + public_ = f_public_member_choice->value(); + redraw_browser(); + } + } else { + if (public_ != f_public_choice->value()) { + mod = 1; + public_ = f_public_choice->value(); + redraw_browser(); + } + } + if (cdecl_ != f_c_button->value()) { + mod = 1; + cdecl_ = f_c_button->value(); + } + if (mod) set_modflag(1); + break; + } + BREAK2: + function_panel->hide(); +} + +Fl_Function_Type Fl_Function_type; + +extern const char* subclassname(Fl_Type*); + +void Fl_Function_Type::write_code1() { + constructor=0; + havewidgets = 0; + Fl_Type *child; + for (child = next; child && child->level > level; child = child->next) + if (child->is_widget()) { + havewidgets = 1; + break; + } + write_c("\n"); + if (ismain()) + write_c("int main(int argc, char **argv) {\n"); + else { + const char* rtype = return_type; + const char* star = ""; + // from matt: let the user type "static " at the start of type + // in order to declare a static method; + int is_static = 0; + int is_virtual = 0; + if (rtype) { + if (!strcmp(rtype,"static")) {is_static = 1; rtype = 0;} + else if (!strncmp(rtype, "static ",7)) {is_static = 1; rtype += 7;} + if (!strcmp(rtype, "virtual")) {is_virtual = 1; rtype = 0;} + else if (!strncmp(rtype, "virtual ",8)) {is_virtual = 1; rtype += 8;} + } + if (!rtype) { + if (havewidgets) { + rtype = subclassname(child); + star = "*"; + } else rtype = "void"; + } + + const char* k = class_name(0); + if (k) { + write_public(public_); + if (name()[0] == '~') + constructor = 1; + else { + size_t n = strlen(k); + if (!strncmp(name(), k, n) && name()[n] == '(') constructor = 1; + } + write_h(" "); + if (is_static) write_h("static "); + if (is_virtual) write_h("virtual "); + if (!constructor) { + write_h("%s%s ", rtype, star); + write_c("%s%s ", rtype, star); + } + + // if this is a subclass, only write_h() the part before the ':' + char s[1024], *sptr = s; + char *nptr = (char *)name(); + + while (*nptr) { + if (*nptr == ':') { + if (nptr[1] != ':') break; + // Copy extra ":" for "class::member"... + *sptr++ = *nptr++; + } + *sptr++ = *nptr++; + } + *sptr = '\0'; + + write_h("%s;\n", s); + // skip all function default param. init in body: + int skips=0,skipc=0; + int nc=0,plevel=0; + for (sptr=s,nptr=(char*)name(); *nptr; nc++,nptr++) { + if (!skips && *nptr=='(') plevel++; + else if (!skips && *nptr==')') plevel--; + if ( *nptr=='"' && !(nc && *(nptr-1)=='\\') ) + skips = skips ? 0 : 1; + else if(!skips && *nptr=='\'' && !(nc && *(nptr-1)=='\\')) + skipc = skipc ? 0 : 1; + if(!skips && !skipc && plevel==1 && *nptr =='=' && + !(nc && *(nptr-1)=='\'') ) // ignore '=' case + while(*++nptr && (skips || skipc || (*nptr!=',' && *nptr!=')' || plevel!=1) )) { + if ( *nptr=='"' && *(nptr-1)!='\\' ) + skips = skips ? 0 : 1; + else if(!skips && *nptr=='\'' && *(nptr-1)!='\\') + skipc = skipc ? 0 : 1; + if (!skips && !skipc && *nptr=='(') plevel++; + else if (!skips && *nptr==')') plevel--; + } + + if (sptr < (s + sizeof(s) - 1)) *sptr++ = *nptr; + } + *sptr = '\0'; + + write_c("%s::%s {\n", k, s); + } else { + if (public_) { + if (cdecl_) + write_h("extern \"C\" { %s%s %s; }\n", rtype, star, name()); + else + write_h("%s%s %s;\n", rtype, star, name()); + } + else write_c("static "); + + // write everything but the default parameters (if any) + char s[1024], *sptr; + char *nptr; + int skips=0,skipc=0; + int nc=0,plevel=0; + for (sptr=s,nptr=(char*)name(); *nptr; nc++,nptr++) { + if (!skips && *nptr=='(') plevel++; + else if (!skips && *nptr==')') plevel--; + if ( *nptr=='"' && !(nc && *(nptr-1)=='\\') ) + skips = skips ? 0 : 1; + else if(!skips && *nptr=='\'' && !(nc && *(nptr-1)=='\\')) + skipc = skipc ? 0 : 1; + if(!skips && !skipc && plevel==1 && *nptr =='=' && + !(nc && *(nptr-1)=='\'') ) // ignore '=' case + while(*++nptr && (skips || skipc || (*nptr!=',' && *nptr!=')' || plevel!=1) )) { + if ( *nptr=='"' && *(nptr-1)!='\\' ) + skips = skips ? 0 : 1; + else if(!skips && *nptr=='\'' && *(nptr-1)!='\\') + skipc = skipc ? 0 : 1; + if (!skips && !skipc && *nptr=='(') plevel++; + else if (!skips && *nptr==')') plevel--; + } + + if (sptr < (s + sizeof(s) - 1)) *sptr++ = *nptr; + } + *sptr = '\0'; + + write_c("%s%s %s {\n", rtype, star, s); + } + } + + if (havewidgets && !child->name()) write_c(" %s* w;\n", subclassname(child)); + indentation += 2; +} + +void Fl_Function_Type::write_code2() { + Fl_Type *child; + const char *var = "w"; + for (child = next; child && child->level > level; child = child->next) + if (child->is_window() && child->name()) var = child->name(); + + if (ismain()) { + if (havewidgets) write_c(" %s->show(argc, argv);\n", var); + write_c(" return Fl::run();\n"); + } else if (havewidgets && !constructor && !return_type) { + write_c(" return %s;\n", var); + } + write_c("}\n"); + indentation = 0; +} + +int Fl_Function_Type::has_signature(const char *rtype, const char *sig) const { + if (rtype && !return_type) return 0; + if (!name()) return 0; + if ( (rtype==0L || strcmp(return_type, rtype)==0) + && fl_filename_match(name(), sig)) { + return 1; + } + return 0; +} + +//////////////////////////////////////////////////////////////// + +Fl_Type *Fl_Code_Type::make() { + Fl_Type *p = Fl_Type::current; + while (p && !p->is_code_block()) p = p->parent; + if (!p) { + fl_message("Please select a function"); + return 0; + } + Fl_Code_Type *o = new Fl_Code_Type(); + o->name("printf(\"Hello, World!\\n\");"); + o->add(p); + o->factory = this; + return o; +} + +void Fl_Code_Type::open() { + if (!code_panel) make_code_panel(); + const char *text = name(); + code_input->buffer()->text( text ? text : "" ); + code_panel->show(); + const char* message = 0; + for (;;) { // repeat as long as there are errors + if (message) fl_alert(message); + for (;;) { + Fl_Widget* w = Fl::readqueue(); + if (w == code_panel_cancel) goto BREAK2; + else if (w == code_panel_ok) break; + else if (!w) Fl::wait(); + } + char*c = code_input->buffer()->text(); + message = c_check(c); if (message) continue; + name(c); + free(c); + break; + } + BREAK2: + code_panel->hide(); +} + +Fl_Code_Type Fl_Code_type; + +void Fl_Code_Type::write_code1() { + const char* c = name(); + if (!c) return; + write_c("%s%s\n", indent(), c); +} + +void Fl_Code_Type::write_code2() {} + +//////////////////////////////////////////////////////////////// + +Fl_Type *Fl_CodeBlock_Type::make() { + Fl_Type *p = Fl_Type::current; + while (p && !p->is_code_block()) p = p->parent; + if (!p) { + fl_message("Please select a function"); + return 0; + } + Fl_CodeBlock_Type *o = new Fl_CodeBlock_Type(); + o->name("if (test())"); + o->after = 0; + o->add(p); + o->factory = this; + return o; +} + +void Fl_CodeBlock_Type::write_properties() { + Fl_Type::write_properties(); + if (after) { + write_string("after"); + write_word(after); + } +} + +void Fl_CodeBlock_Type::read_property(const char *c) { + if (!strcmp(c,"after")) { + storestring(read_word(),after); + } else { + Fl_Type::read_property(c); + } +} + +void Fl_CodeBlock_Type::open() { + if (!codeblock_panel) make_codeblock_panel(); + code_before_input->static_value(name()); + code_after_input->static_value(after); + codeblock_panel->show(); + const char* message = 0; + for (;;) { // repeat as long as there are errors + if (message) fl_alert(message); + for (;;) { + Fl_Widget* w = Fl::readqueue(); + if (w == codeblock_panel_cancel) goto BREAK2; + else if (w == codeblock_panel_ok) break; + else if (!w) Fl::wait(); + } + const char*c = code_before_input->value(); + message = c_check(c); if (message) continue; + name(c); + c = code_after_input->value(); + message = c_check(c); if (message) continue; + storestring(c, after); + break; + } + BREAK2: + codeblock_panel->hide(); +} + +Fl_CodeBlock_Type Fl_CodeBlock_type; + +void Fl_CodeBlock_Type::write_code1() { + const char* c = name(); + write_c("%s%s {\n", indent(), c ? c : ""); + indentation += 2; +} + +void Fl_CodeBlock_Type::write_code2() { + indentation += 2; + if (after) write_c("%s} %s\n", indent(), after); + else write_c("%s}\n", indent()); +} + +//////////////////////////////////////////////////////////////// + +int Fl_Decl_Type::is_public() const +{ + Fl_Type *p = parent; + while (p && !p->is_decl_block()) p = p->parent; + if(p && p->is_public() && public_) + return public_; + else if(!p) + return public_; + return 0; +} + +Fl_Type *Fl_Decl_Type::make() { + Fl_Type *p = Fl_Type::current; + while (p && !p->is_decl_block()) p = p->parent; + Fl_Decl_Type *o = new Fl_Decl_Type(); + o->public_ = 0; + o->static_ = 1; + o->name("int x;"); + o->add(p); + o->factory = this; + return o; +} + +void Fl_Decl_Type::write_properties() { + Fl_Type::write_properties(); + switch (public_) { + case 1: write_string("public"); break; + case 2: write_string("protected"); break; + } + if (!static_) write_string("global"); +} + +void Fl_Decl_Type::read_property(const char *c) { + if (!strcmp(c,"public")) { + public_ = 1; + } else if (!strcmp(c,"protected")) { + public_ = 2; + } else if (!strcmp(c,"global")) { + static_ = 0; + } else { + Fl_Type::read_property(c); + } +} + +void Fl_Decl_Type::open() { + if (!decl_panel) make_decl_panel(); + decl_input->static_value(name()); + if (is_in_class()) { + decl_class_choice->value(public_); + decl_class_choice->show(); + decl_choice->hide(); + } else { + decl_choice->value((public_&1)|((static_&1)<<1)); + decl_choice->show(); + decl_class_choice->hide(); + } + decl_panel->show(); + const char* message = 0; + for (;;) { // repeat as long as there are errors + if (message) fl_alert(message); + for (;;) { + Fl_Widget* w = Fl::readqueue(); + if (w == decl_panel_cancel) goto BREAK2; + else if (w == decl_panel_ok) break; + else if (!w) Fl::wait(); + } + const char*c = decl_input->value(); + while (isspace(*c)) c++; + message = c_check(c&&c[0]=='#' ? c+1 : c); + if (message) continue; + name(c); + if (is_in_class()) { + if (public_!=decl_class_choice->value()) { + set_modflag(1); + public_ = decl_class_choice->value(); + } + } else { + if (public_!=(decl_choice->value()&1)) { + set_modflag(1); + public_ = (decl_choice->value()&1); + } + if (static_!=((decl_choice->value()>>1)&1)) { + set_modflag(1); + static_ = ((decl_choice->value()>>1)&1); + } + } + break; + } + BREAK2: + decl_panel->hide(); +} + +Fl_Decl_Type Fl_Decl_type; + +void Fl_Decl_Type::write_code1() { + const char* c = name(); + if (!c) return; + // handle a few keywords differently if inside a class + if (is_in_class() && ( + !strncmp(c,"class",5) && isspace(c[5]) + || !strncmp(c,"typedef",7) && isspace(c[7]) + || !strncmp(c,"FL_EXPORT",9) && isspace(c[9]) + || !strncmp(c,"struct",6) && isspace(c[6]) + ) ) { + write_public(public_); + write_h(" %s\n", c); + return; + } + // handle putting #include, extern, using or typedef into decl: + if (!isalpha(*c) && *c != '~' + || !strncmp(c,"extern",6) && isspace(c[6]) + || !strncmp(c,"class",5) && isspace(c[5]) + || !strncmp(c,"typedef",7) && isspace(c[7]) + || !strncmp(c,"using",5) && isspace(c[5]) + || !strncmp(c,"FL_EXPORT",9) && isspace(c[9]) +// || !strncmp(c,"struct",6) && isspace(c[6]) + ) { + if (public_) + write_h("%s\n", c); + else + write_c("%s\n", c); + return; + } + // find the first C++ style comment + const char* e = c+strlen(c), *csc = c; + while (cscc && e[-1]==' ') e--; + while (e>c && e[-1]==';') e--; + if (class_name(1)) { + write_public(public_); + write_h(" %.*s; %s\n", (int)(e-c), c, csc); + } else { + if (public_) { + if (static_) + write_h("extern "); + write_h("%.*s; %s\n", (int)(e-c), c, csc); + if (static_) + write_c("%.*s; %s\n", (int)(e-c), c, csc); + } else { + if (static_) + write_c("static "); + write_c("%.*s; %s\n", (int)(e-c), c, csc); + } + } +} + +void Fl_Decl_Type::write_code2() {} + +//////////////////////////////////////////////////////////////// + +int Fl_DeclBlock_Type::is_public() const {return public_;} + +Fl_Type *Fl_DeclBlock_Type::make() { + Fl_Type *p = Fl_Type::current; + while (p && !p->is_decl_block()) p = p->parent; + Fl_DeclBlock_Type *o = new Fl_DeclBlock_Type(); + o->name("#if 1"); + o->public_ = 0; + o->after = strdup("#endif"); + o->add(p); + o->factory = this; + return o; +} + +void Fl_DeclBlock_Type::write_properties() { + Fl_Type::write_properties(); + switch (public_) { + case 1: write_string("public"); break; + case 2: write_string("protected"); break; + } + write_string("after"); + write_word(after); +} + +void Fl_DeclBlock_Type::read_property(const char *c) { + if(!strcmp(c,"public")) { + public_ = 1; + } else if(!strcmp(c,"protected")) { + public_ = 2; + } else if (!strcmp(c,"after")) { + storestring(read_word(),after); + } else { + Fl_Type::read_property(c); + } +} + +void Fl_DeclBlock_Type::open() { + if (!declblock_panel) make_declblock_panel(); + decl_before_input->static_value(name()); + declblock_public_choice->value((public_>0)); + decl_after_input->static_value(after); + declblock_panel->show(); + const char* message = 0; + for (;;) { // repeat as long as there are errors + if (message) fl_alert(message); + for (;;) { + Fl_Widget* w = Fl::readqueue(); + if (w == declblock_panel_cancel) goto BREAK2; + else if (w == declblock_panel_ok) break; + else if (!w) Fl::wait(); + } + const char*c = decl_before_input->value(); + while (isspace(*c)) c++; + message = c_check(c&&c[0]=='#' ? c+1 : c); + if (message) continue; + name(c); + c = decl_after_input->value(); + while (isspace(*c)) c++; + message = c_check(c&&c[0]=='#' ? c+1 : c); + if (message) continue; + storestring(c,after); + if (public_ != declblock_public_choice->value()) { + set_modflag(1); + public_ = declblock_public_choice->value(); + redraw_browser(); + } + break; + } + BREAK2: + declblock_panel->hide(); +} + +Fl_DeclBlock_Type Fl_DeclBlock_type; + +void Fl_DeclBlock_Type::write_code1() { + const char* c = name(); + if (public_) + write_h("%s\n", c); + write_c("%s\n", c); +} + +void Fl_DeclBlock_Type::write_code2() { + const char* c = after; + if (public_) + write_h("%s\n", c); + write_c("%s\n", c); +} + +//////////////////////////////////////////////////////////////// + +Fl_Type *Fl_Comment_Type::make() { + Fl_Type *p = Fl_Type::current; + while (p && !p->is_code_block()) p = p->parent; + Fl_Comment_Type *o = new Fl_Comment_Type(); + o->in_c_ = 1; + o->in_h_ = 1; + o->style_ = 0; + o->name("my comment"); + o->add(p); + o->factory = this; + o->title_buf[0] = 0; + return o; +} + +void Fl_Comment_Type::write_properties() { + Fl_Type::write_properties(); + if (in_c_) write_string("in_source"); else write_string("not_in_source"); + if (in_h_) write_string("in_header"); else write_string("not_in_header"); +} + +void Fl_Comment_Type::read_property(const char *c) { + if (!strcmp(c,"in_source")) { + in_c_ = 1; + } else if (!strcmp(c,"not_in_source")) { + in_c_ = 0; + } else if (!strcmp(c,"in_header")) { + in_h_ = 1; + } else if (!strcmp(c,"not_in_header")) { + in_h_ = 0; + } else { + Fl_Type::read_property(c); + } +} + +#include "comments.h" + +static void load_comments_preset(Fl_Preferences &menu) { + static const char * const predefined_comment[] = { + "GNU Public License/GPL Header", "GNU Public License/GPL Footer", + "GNU Public License/LGPL Header", "GNU Public License/LGPL Footer", + "FLTK/Header", "FLTK/Footer" }; + int i; + menu.set("n", 6); + Fl_Preferences db(Fl_Preferences::USER, "fltk.org", "fluid_comments"); + for (i=0; i<6; i++) { + menu.set(Fl_Preferences::Name(i), predefined_comment[i]); + db.set(predefined_comment[i], comment_text[i]); + } +} + +void Fl_Comment_Type::open() { + if (!comment_panel) make_comment_panel(); + const char *text = name(); + { + int i=0, n=0; + Fl_Preferences menu(Fl_Preferences::USER, "fltk.org", "fluid_comments_menu"); + comment_predefined->clear(); + comment_predefined->add("_Edit/Add current comment..."); + comment_predefined->add("_Edit/Remove last selection..."); + menu.get("n", n, -1); + if (n==-1) load_comments_preset(menu); + menu.get("n", n, 0); + for (i=0;iadd(text); + free(text); + } + } + comment_input->buffer()->text( text ? text : "" ); + comment_in_source->value(in_c_); + comment_in_header->value(in_h_); + comment_panel->show(); + const char* message = 0; + char itempath[256]; itempath[0] = 0; + int last_selected_item = 0; + for (;;) { // repeat as long as there are errors + if (message) fl_alert(message); + for (;;) { + Fl_Widget* w = Fl::readqueue(); + if (w == comment_panel_cancel) goto BREAK2; + else if (w == comment_panel_ok) break; + else if (w == comment_predefined) { + if (comment_predefined->value()==1) { + // add the current comment to the database + const char *xname = fl_input( + "Please enter a name to reference the current\ncomment in your database.\n\n" + "Use forward slashes '/' to create submenus.", + "My Comment"); + if (xname) { + char *name = strdup(xname); + for (char*s=name;*s;s++) if (*s==':') *s = ';'; + int n; + Fl_Preferences db(Fl_Preferences::USER, "fltk.org", "fluid_comments"); + db.set(name, comment_input->buffer()->text()); + Fl_Preferences menu(Fl_Preferences::USER, "fltk.org", "fluid_comments_menu"); + menu.get("n", n, 0); + menu.set(Fl_Preferences::Name(n), name); + menu.set("n", ++n); + comment_predefined->add(name); + free(name); + } + } else if (comment_predefined->value()==2) { + // remove the last selected comment from the database + if (itempath[0]==0 || last_selected_item==0) { + fl_message("Please select an entry form this menu first."); + } else if (fl_choice("Are you sure that you want to delete the entry\n" + "\"%s\"\nfrom the database?", "Cancel", "Delete", + NULL, itempath)) { + Fl_Preferences db(Fl_Preferences::USER, "fltk.org", "fluid_comments"); + db.deleteEntry(itempath); + comment_predefined->remove(last_selected_item); + Fl_Preferences menu(Fl_Preferences::USER, "fltk.org", "fluid_comments_menu"); + int i, n; + for (i=4, n=0; isize(); i++) { + const Fl_Menu_Item *mi = comment_predefined->menu()+i; + if (comment_predefined->item_pathname(itempath, 255, mi)==0) { + if (itempath[0]=='/') memmove(itempath, itempath+1, 255); + if (itempath[0]) menu.set(Fl_Preferences::Name(n++), itempath); + } + } + menu.set("n", n); + } + } else { + // load the selected comment from the database + if (comment_predefined->item_pathname(itempath, 255)==0) { + if (itempath[0]=='/') memmove(itempath, itempath+1, 255); + Fl_Preferences db(Fl_Preferences::USER, "fltk.org", "fluid_comments"); + char *text; + db.get(itempath, text, "(no text found in data base)"); + comment_input->buffer()->text(text); + free(text); + last_selected_item = comment_predefined->value(); + } + } + } + else if (w == comment_load) { + // load a comment from disk + fl_file_chooser_ok_label("Use File"); + const char *fname = fl_file_chooser("Pick a comment", 0L, 0L); + fl_file_chooser_ok_label(NULL); + if (fname) { + if (comment_input->buffer()->loadfile(fname)) { + fl_alert("Error loading file\n%s", fname); + } + } + } + else if (!w) Fl::wait(); + } + char*c = comment_input->buffer()->text(); + name(c); + free(c); + int mod = 0; + if (in_c_ != comment_in_source->value()) { + in_c_ = comment_in_source->value(); + mod = 1; + } + if (in_h_ != comment_in_header->value()) { + in_h_ = comment_in_header->value(); + mod = 1; + } + if (mod) set_modflag(1); + break; + } + BREAK2: + title_buf[0] = 0; + comment_panel->hide(); +} + +const char *Fl_Comment_Type::title() { + const char* n = name(); + if (!n || !*n) return type_name(); + if (title_buf[0]==0) { + const char *s = n; + char *d = title_buf; + int i = 50; + while (--i > 0) { + char n = *s++; + if (n==0) break; + if (n=='\r') { *d++ = '\\'; *d++ = 'r'; i--; } + else if (n=='\n') { *d++ = '\\'; *d++ = 'n'; i--; } + else if (n<32) { *d++ = '^'; *d++ = 'A'+n; i--; } + else *d++ = n; + } + if (i<=0) { *d++ = '.'; *d++ = '.'; *d++ = '.'; } + *d++ = 0; + } + return title_buf; +} + +Fl_Comment_Type Fl_Comment_type; + +void Fl_Comment_Type::write_code1() { + const char* c = name(); + if (!c) return; + if (!in_c_ && !in_h_) return; + // find out if there is already a valid comment: + const char *s = c; + while (isspace(*s)) s++; + // if this seems to be a C style comment, copy the block as is + // (it's up to the user to correctly close the comment) + if (s[0]=='/' && s[1]=='*') { + if (in_h_) write_h("%s\n", c); + if (in_c_) write_c("%s\n", c); + return; + } + // copy the comment line by line, add the double slash if needed + char *txt = strdup(c); + char *b = txt, *e = txt; + for (;;) { + // find the end of the line and set it to NUL + while (*e && *e!='\n') e++; + char eol = *e; + *e = 0; + // check if there is a C++ style comment at the beginning of the line + char *s = b; + while (isspace(*s)) s++; + if (s!=e && ( s[0]!='/' || s[1]!='/') ) { + // if no comment marker was found, we add one ourselves + if (in_h_) write_h("// "); + if (in_c_) write_c("// "); + } + // now copy the rest of the line + if (in_h_) write_h("%s\n", b); + if (in_c_) write_c("%s\n", b); + if (eol==0) break; + *e++ = eol; + b = e; + } +} + +void Fl_Comment_Type::write_code2() {} + +//////////////////////////////////////////////////////////////// + +const char* Fl_Type::class_name(const int need_nest) const { + Fl_Type* p = parent; + while (p) { + if (p->is_class()) { + // see if we are nested in another class, we must fully-qualify name: + // this is lame but works... + const char* q = 0; + if(need_nest) q=p->class_name(need_nest); + if (q) { + static char s[256]; + if (q != s) strlcpy(s, q, sizeof(s)); + strlcat(s, "::", sizeof(s)); + strlcat(s, p->name(), sizeof(s)); + return s; + } + return p->name(); + } + p = p->parent; + } + return 0; +} + +/** + * If this Type resides inside a class, this function returns the class type, or null. + */ +const Fl_Class_Type *Fl_Type::is_in_class() const { + Fl_Type* p = parent; + while (p) { + if (p->is_class()) { + return (Fl_Class_Type*)p; + } + p = p->parent; + } + return 0; +} + +int Fl_Class_Type::is_public() const {return public_;} + +void Fl_Class_Type::prefix(const char*p) { + free((void*) class_prefix); + class_prefix=strdup(p ? p : "" ); +} + +Fl_Type *Fl_Class_Type::make() { + Fl_Type *p = Fl_Type::current; + while (p && !p->is_decl_block()) p = p->parent; + Fl_Class_Type *o = new Fl_Class_Type(); + o->name("UserInterface"); + o->class_prefix=0; + o->subclass_of = 0; + o->public_ = 1; + o->add(p); + o->factory = this; + return o; +} + +void Fl_Class_Type::write_properties() { + Fl_Type::write_properties(); + if (subclass_of) { + write_string(":"); + write_word(subclass_of); + } + switch (public_) { + case 0: write_string("private"); break; + case 2: write_string("protected"); break; + } +} + +void Fl_Class_Type::read_property(const char *c) { + if (!strcmp(c,"private")) { + public_ = 0; + } else if (!strcmp(c,"protected")) { + public_ = 2; + } else if (!strcmp(c,":")) { + storestring(read_word(), subclass_of); + } else { + Fl_Type::read_property(c); + } +} + +void Fl_Class_Type::open() { + if (!class_panel) make_class_panel(); + char fullname[1024]=""; + if (prefix() && strlen(prefix())) + sprintf(fullname,"%s %s",prefix(),name()); + else + strcpy(fullname, name()); + c_name_input->static_value(fullname); + c_subclass_input->static_value(subclass_of); + c_public_button->value(public_); + class_panel->show(); + const char* message = 0; + + char *na=0,*pr=0,*p=0; // name and prefix substrings + + for (;;) { // repeat as long as there are errors + if (message) fl_alert(message); + for (;;) { + Fl_Widget* w = Fl::readqueue(); + if (w == c_panel_cancel) goto BREAK2; + else if (w == c_panel_ok) break; + else if (!w) Fl::wait(); + } + const char*c = c_name_input->value(); + char *s = strdup(c); + size_t len = strlen(s); + if (!*s) goto OOPS; + p = (char*) (s+len-1); + while (p>=s && isspace(*p)) *(p--)='\0'; + if (p=s && is_id(*p)) p--; + if ( (ps) *p--='\0'; + while (p>=s && isspace(*p)) *(p--)='\0'; + while (p>=s && is_id(*p)) p--; + if (pvalue(); + message = c_check(c); + if (message) { free((void*)s);continue;} + name(na); + prefix(pr); + free((void*)s); + storestring(c, subclass_of); + if (public_ != c_public_button->value()) { + public_ = c_public_button->value(); + set_modflag(1); + } + break; + } + BREAK2: + class_panel->hide(); +} + +Fl_Class_Type Fl_Class_type; + +Fl_Class_Type *current_class; +extern Fl_Widget_Class_Type *current_widget_class; +void write_public(int state) { + if (!current_class && !current_widget_class) return; + if (current_class && current_class->write_public_state == state) return; + if (current_widget_class && current_widget_class->write_public_state == state) return; + if (current_class) current_class->write_public_state = state; + if (current_widget_class) current_widget_class->write_public_state = state; + switch (state) { + case 0: write_h("private:\n"); break; + case 1: write_h("public:\n"); break; + case 2: write_h("protected:\n"); break; + } +} + +void Fl_Class_Type::write_code1() { + parent_class = current_class; + current_class = this; + write_public_state = 0; + if (prefix() && strlen(prefix())) + write_h("\nclass %s %s ", prefix(), name()); + else + write_h("\nclass %s ", name()); + if (subclass_of) write_h(": %s ", subclass_of); + write_h("{\n"); +} + +void Fl_Class_Type::write_code2() { + write_h("};\n"); + current_class = parent_class; +} + +/** + * Return 1 if this class contains a function with the given signature. + */ +int Fl_Class_Type::has_function(const char *rtype, const char *sig) const { + Fl_Type *child; + for (child = next; child && child->level > level; child = child->next) { + if (child->level == level+1 && strcmp(child->type_name(), "Function")==0) { + const Fl_Function_Type *fn = (const Fl_Function_Type*)child; + if (fn->has_signature(rtype, sig)) + return 1; + } + } + return 0; +} + +// +// End of "$Id: Fl_Function_Type.cxx 6013 2008-01-04 22:18:40Z matt $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/Fl_Group_Type.cxx b/third_party/windows/fltk-1.1.10/fluid/Fl_Group_Type.cxx new file mode 100644 index 0000000..a44f000 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/Fl_Group_Type.cxx @@ -0,0 +1,330 @@ +// +// "$Id: Fl_Group_Type.cxx 5845 2007-05-20 00:01:06Z mike $" +// +// Fl_Group object code for the Fast Light Tool Kit (FLTK). +// +// Object describing an Fl_Group and links to Fl_Window_Type.C and +// the Fl_Tabs widget, with special stuff to select tab items and +// insure that only one is visible. +// +// Copyright 1998-2006 by Bill Spitzak and others. +// +// 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 +#include +#include +#include "Fl_Widget_Type.h" +#include "../src/flstring.h" + +// Override group's resize behavior to do nothing to children: +void igroup::resize(int X, int Y, int W, int H) { + Fl_Widget::resize(X,Y,W,H); + redraw(); +} + +Fl_Group_Type Fl_Group_type; // the "factory" + +Fl_Type *Fl_Group_Type::make() { + return Fl_Widget_Type::make(); +} + +void fix_group_size(Fl_Type *tt) { + if (!tt || !tt->is_group()) return; + Fl_Group_Type* t = (Fl_Group_Type*)tt; + int X = t->o->x(); + int Y = t->o->y(); + int R = X+t->o->w(); + int B = Y+t->o->h(); + for (Fl_Type *nn = t->next; nn && nn->level > t->level; nn = nn->next) { + if (!nn->is_widget() || nn->is_menu_item()) continue; + Fl_Widget_Type* n = (Fl_Widget_Type*)nn; + int x = n->o->x(); if (x < X) X = x; + int y = n->o->y(); if (y < Y) Y = y; + int r = x+n->o->w();if (r > R) R = r; + int b = y+n->o->h();if (b > B) B = b; + } + t->o->resize(X,Y,R-X,B-Y); +} + +extern int force_parent; + +void group_cb(Fl_Widget *, void *) { + // Find the current widget: + Fl_Type *qq = Fl_Type::current; + while (qq && (!qq->is_widget() || qq->is_menu_item())) qq = qq->parent; + if (!qq || qq->level < 1 || (qq->level == 1 && !strcmp(qq->type_name(), "widget_class"))) { + fl_message("Please select widgets to group"); + return; + } + Fl_Widget_Type* q = (Fl_Widget_Type*)qq; + force_parent = 1; + Fl_Group_Type *n = (Fl_Group_Type*)(Fl_Group_type.make()); + n->move_before(q); + n->o->resize(q->o->x(),q->o->y(),q->o->w(),q->o->h()); + for (Fl_Type *t = Fl_Type::first; t;) { + if (t->level != n->level || t == n || !t->selected) { + t = t->next; continue;} + Fl_Type *nxt = t->remove(); + t->add(n); + t = nxt; + } + fix_group_size(n); +} + +void ungroup_cb(Fl_Widget *, void *) { + // Find the group: + Fl_Type *q = Fl_Type::current; + while (q && (!q->is_widget() || q->is_menu_item())) q = q->parent; + if (q) q = q->parent; + if (!q || q->level < 1 || (q->level == 1 && !strcmp(q->type_name(), "widget_class"))) { + fl_message("Please select widgets in a group"); + return; + } + Fl_Type* n; + for (n = q->next; n && n->level > q->level; n = n->next) { + if (n->level == q->level+1 && !n->selected) { + fl_message("Please select all widgets in group"); + return; + } + } + for (n = q->next; n && n->level > q->level;) { + Fl_Type *nxt = n->remove(); + n->insert(q); + n = nxt; + } + delete q; +} + +//////////////////////////////////////////////////////////////// + +#include + +void Fl_Group_Type::write_code1() { + Fl_Widget_Type::write_code1(); +} + +void Fl_Group_Type::write_code2() { + const char *var = name() ? name() : "o"; + write_extra_code(); + write_c("%s%s->end();\n", indent(), var); + if (resizable()) { + write_c("%sFl_Group::current()->resizable(%s);\n", indent(), var); + } + write_block_close(); +} + +//////////////////////////////////////////////////////////////// + +const char pack_type_name[] = "Fl_Pack"; + +Fl_Menu_Item pack_type_menu[] = { + {"HORIZONTAL", 0, 0, (void*)Fl_Pack::HORIZONTAL}, + {"VERTICAL", 0, 0, (void*)Fl_Pack::VERTICAL}, + {0}}; + +Fl_Pack_Type Fl_Pack_type; // the "factory" + +//////////////////////////////////////////////////////////////// + +const char tabs_type_name[] = "Fl_Tabs"; + +// Override group's resize behavior to do nothing to children: +void itabs::resize(int X, int Y, int W, int H) { + Fl_Widget::resize(X,Y,W,H); + redraw(); +} + +Fl_Tabs_Type Fl_Tabs_type; // the "factory" + +// This is called when user clicks on a widget in the window. See +// if it is a tab title, and adjust visibility and return new selection: +// If none, return o unchanged: + +Fl_Type* Fl_Tabs_Type::click_test(int x, int y) { + Fl_Tabs *t = (Fl_Tabs*)o; + Fl_Widget *a = t->which(x,y); + if (!a) return 0; // didn't click on tab + // changing the visible tab has an impact on the generated + // source code, so mark this project as changed. + int changed = (a!=t->value()); + // okay, run the tabs ui until they let go of mouse: + t->handle(FL_PUSH); + Fl::pushed(t); + while (Fl::pushed()==t) Fl::wait(); + if (changed) set_modflag(1); + return (Fl_Type*)(t->value()->user_data()); +} + +//////////////////////////////////////////////////////////////// + +const char wizard_type_name[] = "Fl_Wizard"; + +// Override group's resize behavior to do nothing to children: +void iwizard::resize(int X, int Y, int W, int H) { + Fl_Widget::resize(X,Y,W,H); + redraw(); +} + +Fl_Wizard_Type Fl_Wizard_type; // the "factory" + +// This is called when o is created. If it is in the tab group make +// sure it is visible: + +void Fl_Group_Type::add_child(Fl_Type* cc, Fl_Type* before) { + Fl_Widget_Type* c = (Fl_Widget_Type*)cc; + Fl_Widget* b = before ? ((Fl_Widget_Type*)before)->o : 0; + ((Fl_Group*)o)->insert(*(c->o), b); + o->redraw(); +} + +void Fl_Tabs_Type::add_child(Fl_Type* c, Fl_Type* before) { + Fl_Group_Type::add_child(c, before); +} + +// This is called when o is deleted. If it is in the tab group make +// sure it is not visible: + +void Fl_Group_Type::remove_child(Fl_Type* cc) { + Fl_Widget_Type* c = (Fl_Widget_Type*)cc; + ((Fl_Group*)o)->remove(c->o); + o->redraw(); +} + +void Fl_Tabs_Type::remove_child(Fl_Type* cc) { + Fl_Widget_Type* c = (Fl_Widget_Type*)cc; + Fl_Tabs *t = (Fl_Tabs*)o; + if (t->value() == c->o) t->value(0); + Fl_Group_Type::remove_child(c); +} + +// move, don't change selected value: + +void Fl_Group_Type::move_child(Fl_Type* cc, Fl_Type* before) { + Fl_Widget_Type* c = (Fl_Widget_Type*)cc; + Fl_Widget* b = before ? ((Fl_Widget_Type*)before)->o : 0; + ((Fl_Group*)o)->remove(c->o); + ((Fl_Group*)o)->insert(*(c->o), b); + o->redraw(); +} + +//////////////////////////////////////////////////////////////// +// live mode support + +Fl_Widget *Fl_Group_Type::enter_live_mode(int) { + Fl_Group *grp = new Fl_Group(o->x(), o->y(), o->w(), o->h()); + live_widget = grp; + if (live_widget) { + copy_properties(); + Fl_Type *n; + for (n = next; n && n->level > level; n = n->next) { + if (n->level == level+1) + n->enter_live_mode(); + } + grp->end(); + } + return live_widget; +} + +Fl_Widget *Fl_Tabs_Type::enter_live_mode(int) { + Fl_Tabs *grp = new Fl_Tabs(o->x(), o->y(), o->w(), o->h()); + live_widget = grp; + if (live_widget) { + copy_properties(); + Fl_Type *n; + for (n = next; n && n->level > level; n = n->next) { + if (n->level == level+1) + n->enter_live_mode(); + } + grp->end(); + } + grp->value(((Fl_Tabs*)o)->value()); + return live_widget; +} + +void Fl_Group_Type::leave_live_mode() { +} + +/** + * copy all properties from the edit widget to the live widget + */ +void Fl_Group_Type::copy_properties() { + Fl_Widget_Type::copy_properties(); +} + +//////////////////////////////////////////////////////////////// +// some other group subclasses that fluid does not treat specially: + +#include + +const char scroll_type_name[] = "Fl_Scroll"; + +Fl_Widget *Fl_Scroll_Type::enter_live_mode(int) { + Fl_Group *grp = new Fl_Scroll(o->x(), o->y(), o->w(), o->h()); + grp->show(); + live_widget = grp; + if (live_widget) { + copy_properties(); + Fl_Type *n; + for (n = next; n && n->level > level; n = n->next) { + if (n->level == level+1) + n->enter_live_mode(); + } + grp->end(); + } + return live_widget; +} + +Fl_Menu_Item scroll_type_menu[] = { + {"BOTH", 0, 0, 0/*(void*)Fl_Scroll::BOTH*/}, + {"HORIZONTAL", 0, 0, (void*)Fl_Scroll::HORIZONTAL}, + {"VERTICAL", 0, 0, (void*)Fl_Scroll::VERTICAL}, + {"HORIZONTAL_ALWAYS", 0, 0, (void*)Fl_Scroll::HORIZONTAL_ALWAYS}, + {"VERTICAL_ALWAYS", 0, 0, (void*)Fl_Scroll::VERTICAL_ALWAYS}, + {"BOTH_ALWAYS", 0, 0, (void*)Fl_Scroll::BOTH_ALWAYS}, + {0}}; + +Fl_Scroll_Type Fl_Scroll_type; // the "factory" + +void Fl_Scroll_Type::copy_properties() { + Fl_Group_Type::copy_properties(); + Fl_Scroll *s = (Fl_Scroll*)o, *d = (Fl_Scroll*)live_widget; + d->position(s->xposition(), s->yposition()); + d->type(s->type()); // TODO: get this flag from Fl_Scroll_Type! + d->scrollbar.align(s->scrollbar.align()); + d->hscrollbar.align(s->hscrollbar.align()); +} + +//////////////////////////////////////////////////////////////// + +const char tile_type_name[] = "Fl_Tile"; + +Fl_Tile_Type Fl_Tile_type; // the "factory" + +void Fl_Tile_Type::copy_properties() { + Fl_Group_Type::copy_properties(); + // no additional properties +} + +// +// End of "$Id: Fl_Group_Type.cxx 5845 2007-05-20 00:01:06Z mike $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/Fl_Menu_Type.cxx b/third_party/windows/fltk-1.1.10/fluid/Fl_Menu_Type.cxx new file mode 100644 index 0000000..cb8f101 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/Fl_Menu_Type.cxx @@ -0,0 +1,611 @@ +// +// "$Id: Fl_Menu_Type.cxx 5808 2007-05-10 12:06:31Z matt $" +// +// Menu item code for the Fast Light Tool Kit (FLTK). +// +// Menu items are kludged by making a phony Fl_Box widget so the normal +// widget panel can be used to control them. +// +// This file also contains code to make Fl_Menu_Button, Fl_Menu_Bar, +// etc widgets. +// +// Copyright 1998-2006 by Bill Spitzak and others. +// +// 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 +#include "Fl_Widget_Type.h" +#include "alignment_panel.h" +#include +#include +#include +#include "../src/flstring.h" +#include +#include + +Fl_Menu_Item menu_item_type_menu[] = { + {"Normal",0,0,(void*)0}, + {"Toggle",0,0,(void*)FL_MENU_BOX}, + {"Radio",0,0,(void*)FL_MENU_RADIO}, + {0}}; + +extern int reading_file; +extern int force_parent; +extern int i18n_type; +extern const char* i18n_include; +extern const char* i18n_function; +extern const char* i18n_file; +extern const char* i18n_set; + +static char submenuflag; + +void Fl_Input_Choice_Type::build_menu() { + Fl_Input_Choice* w = (Fl_Input_Choice*)o; + // count how many Fl_Menu_Item structures needed: + int n = 0; + Fl_Type* q; + for (q = next; q && q->level > level; q = q->next) { + if (q->is_parent()) n++; // space for null at end of submenu + n++; + } + if (!n) { + if (menusize) delete[] (Fl_Menu_Item*)(w->menu()); + w->menu(0); + menusize = 0; + } else { + n++; // space for null at end of menu + if (menusizemenu()); + menusize = n+10; + w->menu(new Fl_Menu_Item[menusize]); + } + // fill them all in: + Fl_Menu_Item* m = (Fl_Menu_Item*)(w->menu()); + int lvl = level+1; + for (q = next; q && q->level > level; q = q->next) { + Fl_Menu_Item_Type* i = (Fl_Menu_Item_Type*)q; + if (i->o->image()) i->o->image()->label(m); + else { + m->label(i->o->label() ? i->o->label() : "(nolabel)"); + m->labeltype(i->o->labeltype()); + } + m->shortcut(((Fl_Button*)(i->o))->shortcut()); + m->callback(0,(void*)i); + m->flags = i->flags(); + m->labelfont(i->o->labelfont()); + m->labelsize(i->o->labelsize()); + m->labelcolor(i->o->labelcolor()); + if (q->is_parent()) {lvl++; m->flags |= FL_SUBMENU;} + m++; + int l1 = + (q->next && q->next->is_menu_item()) ? q->next->level : level; + while (lvl > l1) {m->label(0); m++; lvl--;} + lvl = l1; + } + } + o->redraw(); +} + + +Fl_Type *Fl_Menu_Item_Type::make() { + // Find the current menu item: + Fl_Type* q = Fl_Type::current; + Fl_Type* p = q; + if (p) { + if (force_parent && q->is_menu_item() || !q->is_parent()) p = p->parent; + } + force_parent = 0; + if (!p || !(p->is_menu_button() || p->is_menu_item() && p->is_parent())) { + fl_message("Please select a menu to add to"); + return 0; + } + if (!o) { + o = new Fl_Button(0,0,100,20); // create template widget + o->labelsize(Fl_Widget_Type::default_size); + } + + Fl_Menu_Item_Type* t = submenuflag ? new Fl_Submenu_Type() : new Fl_Menu_Item_Type(); + t->o = new Fl_Button(0,0,100,20); + t->factory = this; + t->add(p); + if (!reading_file) t->label(submenuflag ? "submenu" : "item"); + return t; +} + +Fl_Type *Fl_Submenu_Type::make() { + submenuflag = 1; + Fl_Type* t = Fl_Menu_Item_Type::make(); + submenuflag = 0; + return t; +} + +Fl_Menu_Item_Type Fl_Menu_Item_type; +Fl_Submenu_Type Fl_Submenu_type; + +//////////////////////////////////////////////////////////////// +// Writing the C code: + +// test functions in Fl_Widget_Type.C: +int is_name(const char *c); +const char *array_name(Fl_Widget_Type *o); +int isdeclare(const char *c); + +// Search backwards to find the parent menu button and return it's name. +// Also put in i the index into the button's menu item array belonging +// to this menu item. +const char* Fl_Menu_Item_Type::menu_name(int& i) { + i = 0; + Fl_Type* t = prev; + while (t && t->is_menu_item()) { + // be sure to count the {0} that ends a submenu: + if (t->level > t->next->level) i += (t->level - t->next->level); + // detect empty submenu: + else if (t->level == t->next->level && t->is_parent()) i++; + t = t->prev; + i++; + } + return unique_id(t, "menu", t->name(), t->label()); +} + +#include "Fluid_Image.h" + +void Fl_Menu_Item_Type::write_static() { + if (callback() && is_name(callback())) + write_declare("extern void %s(Fl_Menu_*, %s);", callback(), + user_data_type() ? user_data_type() : "void*"); + for (int n=0; n < NUM_EXTRA_CODE; n++) { + if (extra_code(n) && isdeclare(extra_code(n))) + write_declare("%s", extra_code(n)); + } + if (callback() && !is_name(callback())) { + // see if 'o' or 'v' used, to prevent unused argument warnings: + int use_o = 0; + int use_v = 0; + const char *d; + for (d = callback(); *d;) { + if (*d == 'o' && !is_id(d[1])) use_o = 1; + if (*d == 'v' && !is_id(d[1])) use_v = 1; + do d++; while (is_id(*d)); + while (*d && !is_id(*d)) d++; + } + const char* cn = callback_name(); + const char* k = class_name(1); + if (k) { + write_c("\nvoid %s::%s_i(Fl_Menu_*", k, cn); + } else { + write_c("\nstatic void %s(Fl_Menu_*", cn); + } + if (use_o) write_c(" o"); + const char* ut = user_data_type() ? user_data_type() : "void*"; + write_c(", %s", ut); + if (use_v) write_c(" v"); + write_c(") {\n %s", callback()); + if (*(d-1) != ';') { + const char *p = strrchr(callback(), '\n'); + if (p) p ++; + else p = callback(); + // Only add trailing semicolon if the last line is not a preprocessor + // statement... + if (*p != '#' && *p) write_c(";"); + } + write_c("\n}\n"); + if (k) { + write_c("void %s::%s(Fl_Menu_* o, %s v) {\n", k, cn, ut); + write_c(" ((%s*)(o->", k); + Fl_Type* t = parent; while (t->is_menu_item()) t = t->parent; + for (t = t->parent; t && t->is_widget() && !is_class(); t = t->parent) write_c("parent()->"); + write_c("user_data()))->%s_i(o,v);\n}\n", cn); + } + } + if (image) { + if (image->written != write_number) { + image->write_static(); + image->written = write_number; + } + } + if (next && next->is_menu_item()) return; + // okay, when we hit last item in the menu we have to write the + // entire array out: + const char* k = class_name(1); + if (k) { + int i; write_c("\nFl_Menu_Item %s::%s[] = {\n", k, menu_name(i)); + } else { + int i; write_c("\nFl_Menu_Item %s[] = {\n", menu_name(i)); + } + Fl_Type* t = prev; while (t && t->is_menu_item()) t = t->prev; + for (Fl_Type* q = t->next; q && q->is_menu_item(); q = q->next) { + ((Fl_Menu_Item_Type*)q)->write_item(); + int thislevel = q->level; if (q->is_parent()) thislevel++; + int nextlevel = + (q->next && q->next->is_menu_item()) ? q->next->level : t->level+1; + while (thislevel > nextlevel) {write_c(" {0,0,0,0,0,0,0,0,0},\n"); thislevel--;} + } + write_c(" {0,0,0,0,0,0,0,0,0}\n};\n"); + + if (k) { + // Write menu item variables... + t = prev; while (t && t->is_menu_item()) t = t->prev; + for (Fl_Type* q = t->next; q && q->is_menu_item(); q = q->next) { + Fl_Menu_Item_Type *m = (Fl_Menu_Item_Type*)q; + const char *c = array_name(m); + if (c) { + if (c==m->name()) { + // assign a menu item address directly to a variable + int i; + const char* n = ((Fl_Menu_Item_Type *)q)->menu_name(i); + write_c("Fl_Menu_Item* %s::%s = %s::%s + %d;\n", k, c, k, n, i); + } else { + // if the name is an array, only define the array. + // The actual assignment is in write_code1() + write_c("Fl_Menu_Item* %s::%s;\n", k, c); + } + } + } + } +} + +int Fl_Menu_Item_Type::flags() { + int i = o->type(); + if (((Fl_Button*)o)->value()) i |= FL_MENU_VALUE; + if (!o->active()) i |= FL_MENU_INACTIVE; + if (!o->visible()) i |= FL_MENU_INVISIBLE; + if (is_parent()) { + if (user_data() == NULL) i |= FL_SUBMENU; + else i |= FL_SUBMENU_POINTER; + } + if (hotspot()) i |= FL_MENU_DIVIDER; + return i; +} + +void Fl_Menu_Item_Type::write_item() { + static const char * const labeltypes[] = { + "FL_NORMAL_LABEL", + "FL_NO_LABEL", + "FL_SHADOW_LABEL", + "FL_ENGRAVED_LABEL", + "FL_EMBOSSED_LABEL", + "FL_MULTI_LABEL", + "FL_ICON_LABEL", + "FL_IMAGE_LABEL" + }; + + write_c(" {"); + if (image) write_c("0"); + else if (label()) { + switch (i18n_type) { + case 0 : /* None */ + write_cstring(label()); + break; + case 1 : /* GNU gettext */ + write_c("%s(", i18n_function); + write_cstring(label()); + write_c(")"); + break; + case 2 : /* POSIX catgets */ + write_c("catgets(%s,%s,%d,", i18n_file[0] ? i18n_file : "_catalog", + i18n_set, msgnum()); + write_cstring(label()); + write_c(")"); + break; + } + } + else write_c("\"\""); + if (((Fl_Button*)o)->shortcut()) { + int s = ((Fl_Button*)o)->shortcut(); + if (use_FL_COMMAND && (s & (FL_CTRL|FL_META))) { + write_c(", FL_COMMAND|0x%x, ", s & ~(FL_CTRL|FL_META)); + } else { + write_c(", 0x%x, ", s); + } + } else + write_c(", 0, "); + if (callback()) { + const char* k = is_name(callback()) ? 0 : class_name(1); + if (k) { + write_c(" (Fl_Callback*)%s::%s,", k, callback_name()); + } else { + write_c(" (Fl_Callback*)%s,", callback_name()); + } + } else + write_c(" 0,"); + if (user_data()) + write_c(" (void*)(%s),", user_data()); + else + write_c(" 0,"); + write_c(" %d, %s, %d, %d, %d", flags(), + labeltypes[o->labeltype()], o->labelfont(), o->labelsize(), o->labelcolor()); + write_c("},\n"); +} + +void Fl_Menu_Item_Type::write_code1() { + int i; const char* mname = menu_name(i); + if (!prev->is_menu_item()) { + // for first menu item, declare the array + if (class_name(1)) + write_h(" static Fl_Menu_Item %s[];\n", mname); + else + write_h("extern Fl_Menu_Item %s[];\n", mname); + } + + const char *c = array_name(this); + if (c) { + if (class_name(1)) { + write_public(public_); + write_h(" static Fl_Menu_Item *%s;\n", c); + } else { + if (c==name()) + write_h("#define %s (%s+%d)\n", c, mname, i); + else + write_h("extern Fl_Menu_Item *%s;\n", c); + } + } + + if (callback()) { + if (!is_name(callback()) && class_name(1)) { + const char* cn = callback_name(); + const char* ut = user_data_type() ? user_data_type() : "void*"; + write_public(0); + write_h(" void %s_i(Fl_Menu_*, %s);\n", cn, ut); + write_h(" static void %s(Fl_Menu_*, %s);\n", cn, ut); + } + } + + int init = 0; + // if the name is an array variable, assign the value here + if (name() && strchr(name(), '[')) { + write_c("%s%s = &%s[%d];\n", indent(), name(), mname, i); + } + if (image) { + if (!init) { + init = 1; + write_c("%s{ Fl_Menu_Item* o = &%s[%d];\n", indent(), mname, i); + } + image->write_code("o"); + } + for (int n=0; n < NUM_EXTRA_CODE; n++) + if (extra_code(n) && !isdeclare(extra_code(n))) { + if (!init) { + init = 1; + write_c("%s{ Fl_Menu_Item* o = &%s[%d];\n", indent(), mname, i); + } + write_c("%s %s\n", indent(), extra_code(n)); + } + if (init) write_c("%s}\n",indent()); +} + +void Fl_Menu_Item_Type::write_code2() {} + +//////////////////////////////////////////////////////////////// +// This is the base class for widgets that contain a menu (ie +// subclasses of Fl_Menu_. +// This is a parent widget and menu items can be added as +// children. An actual array of Fl_Menu_Items is kept parallel +// with the child objects and updated as they change. + +void Fl_Menu_Type::build_menu() { + Fl_Menu_* w = (Fl_Menu_*)o; + // count how many Fl_Menu_Item structures needed: + int n = 0; + Fl_Type* q; + for (q = next; q && q->level > level; q = q->next) { + if (q->is_parent()) n++; // space for null at end of submenu + n++; + } + if (!n) { + if (menusize) delete[] (Fl_Menu_Item*)(w->menu()); + w->menu(0); + menusize = 0; + } else { + n++; // space for null at end of menu + if (menusizemenu()); + menusize = n+10; + w->menu(new Fl_Menu_Item[menusize]); + } + // fill them all in: + Fl_Menu_Item* m = (Fl_Menu_Item*)(w->menu()); + int lvl = level+1; + for (q = next; q && q->level > level; q = q->next) { + Fl_Menu_Item_Type* i = (Fl_Menu_Item_Type*)q; + if (i->o->image()) i->o->image()->label(m); + else { + m->label(i->o->label() ? i->o->label() : "(nolabel)"); + m->labeltype(i->o->labeltype()); + } + m->shortcut(((Fl_Button*)(i->o))->shortcut()); + m->callback(0,(void*)i); + m->flags = i->flags(); + m->labelfont(i->o->labelfont()); + m->labelsize(i->o->labelsize()); + m->labelcolor(i->o->labelcolor()); + if (q->is_parent()) {lvl++; m->flags |= FL_SUBMENU;} + m++; + int l1 = + (q->next && q->next->is_menu_item()) ? q->next->level : level; + while (lvl > l1) {m->label(0); m++; lvl--;} + lvl = l1; + } + } + o->redraw(); +} + +Fl_Type* Fl_Menu_Type::click_test(int, int) { + if (selected) return 0; // let user move the widget + Fl_Menu_* w = (Fl_Menu_*)o; + if (!menusize) return 0; + const Fl_Menu_Item* save = w->mvalue(); + w->value((Fl_Menu_Item*)0); + Fl::pushed(w); + w->handle(FL_PUSH); + const Fl_Menu_Item* m = w->mvalue(); + if (m) { + // restore the settings of toggles & radio items: + if (m->flags & (FL_MENU_RADIO | FL_MENU_TOGGLE)) build_menu(); + return (Fl_Type*)(m->user_data()); + } + w->value(save); + return this; +} + +void Fl_Menu_Type::write_code2() { + if (next && next->is_menu_item()) + write_c("%s%s->menu(%s);\n", indent(), name() ? name() : "o", + unique_id(this, "menu", name(), label())); + Fl_Widget_Type::write_code2(); +} + +void Fl_Menu_Type::copy_properties() { + Fl_Widget_Type::copy_properties(); + Fl_Menu_ *s = (Fl_Menu_*)o, *d = (Fl_Menu_*)live_widget; + d->menu(s->menu()); + d->down_box(s->down_box()); + d->textcolor(s->textcolor()); + d->textfont(s->textfont()); + d->textsize(s->textsize()); +} + +//////////////////////////////////////////////////////////////// + +#include +Fl_Menu_Item button_type_menu[] = { + {"normal",0,0,(void*)0}, + {"popup1",0,0,(void*)Fl_Menu_Button::POPUP1}, + {"popup2",0,0,(void*)Fl_Menu_Button::POPUP2}, + {"popup3",0,0,(void*)Fl_Menu_Button::POPUP3}, + {"popup12",0,0,(void*)Fl_Menu_Button::POPUP12}, + {"popup23",0,0,(void*)Fl_Menu_Button::POPUP23}, + {"popup13",0,0,(void*)Fl_Menu_Button::POPUP13}, + {"popup123",0,0,(void*)Fl_Menu_Button::POPUP123}, + {0}}; + +Fl_Menu_Button_Type Fl_Menu_Button_type; + +//////////////////////////////////////////////////////////////// + +Fl_Menu_Item dummymenu[] = {{"CHOICE"},{0}}; + +Fl_Choice_Type Fl_Choice_type; + +Fl_Input_Choice_Type Fl_Input_Choice_type; + +void Fl_Input_Choice_Type::copy_properties() { + Fl_Widget_Type::copy_properties(); + Fl_Input_Choice *s = (Fl_Input_Choice*)o, *d = (Fl_Input_Choice*)live_widget; + d->menu(s->menu()); + d->down_box(s->down_box()); + d->textcolor(s->textcolor()); + d->textfont(s->textfont()); + d->textsize(s->textsize()); +} + +Fl_Type* Fl_Input_Choice_Type::click_test(int, int) { + if (selected) return 0; // let user move the widget + Fl_Menu_* w = ((Fl_Input_Choice*)o)->menubutton(); + if (!menusize) return 0; + const Fl_Menu_Item* save = w->mvalue(); + w->value((Fl_Menu_Item*)0); + Fl::pushed(w); + w->handle(FL_PUSH); + const Fl_Menu_Item* m = w->mvalue(); + if (m) { + // restore the settings of toggles & radio items: + if (m->flags & (FL_MENU_RADIO | FL_MENU_TOGGLE)) build_menu(); + return (Fl_Type*)(m->user_data()); + } + w->value(save); + return this; +} + +//////////////////////////////////////////////////////////////// + +Fl_Menu_Bar_Type Fl_Menu_Bar_type; + +//////////////////////////////////////////////////////////////// +// Shortcut entry item in panel: + +#include +#include "Shortcut_Button.h" +#include + +void Shortcut_Button::draw() { + if (value()) draw_box(FL_DOWN_BOX, (Fl_Color)9); + else draw_box(FL_UP_BOX, FL_WHITE); + fl_font(FL_HELVETICA,14); fl_color(FL_FOREGROUND_COLOR); + if (use_FL_COMMAND && (svalue & (FL_CTRL|FL_META))) { + char buf[1024]; + fl_snprintf(buf, 1023, "Command+%s", fl_shortcut_label(svalue&~(FL_CTRL|FL_META))); + fl_draw(buf,x()+6,y(),w(),h(),FL_ALIGN_LEFT); + } else { + fl_draw(fl_shortcut_label(svalue),x()+6,y(),w(),h(),FL_ALIGN_LEFT); + } +} + +int Shortcut_Button::handle(int e) { + when(0); type(FL_TOGGLE_BUTTON); + if (e == FL_KEYBOARD) { + if (!value()) return 0; + int v = Fl::event_text()[0]; + if (v > 32 && v < 0x7f || v > 0xa0 && v <= 0xff) { + if (isupper(v)) { + v = tolower(v); + v |= FL_SHIFT; + } + v = v | Fl::event_state()&(FL_META|FL_ALT|FL_CTRL); + } else { + v = Fl::event_state()&(FL_META|FL_ALT|FL_CTRL|FL_SHIFT) | Fl::event_key(); + if (v == FL_BackSpace && svalue) v = 0; + } + if (v != svalue) {svalue = v; set_changed(); redraw(); do_callback(); } + return 1; + } else if (e == FL_UNFOCUS) { + int c = changed(); value(0); if (c) set_changed(); + return 1; + } else if (e == FL_FOCUS) { + return value(); + } else { + int r = Fl_Button::handle(e); + if (e == FL_RELEASE && value() && Fl::focus() != this) take_focus(); + return r; + } +} + +void shortcut_in_cb(Shortcut_Button* i, void* v) { + if (v == LOAD) { + if (!current_widget->is_button()) {i->hide(); return;} + i->show(); + i->svalue = ((Fl_Button*)(current_widget->o))->shortcut(); + i->redraw(); + } else { + int mod = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_button()) { + Fl_Button* b = (Fl_Button*)(((Fl_Widget_Type*)o)->o); + if (b->shortcut()!=i->svalue) mod = 1; + b->shortcut(i->svalue); + if (o->is_menu_item()) ((Fl_Widget_Type*)o)->redraw(); + } + if (mod) set_modflag(1); + } +} + +// +// End of "$Id: Fl_Menu_Type.cxx 5808 2007-05-10 12:06:31Z matt $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/Fl_Type.cxx b/third_party/windows/fltk-1.1.10/fluid/Fl_Type.cxx new file mode 100644 index 0000000..c746351 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/Fl_Type.cxx @@ -0,0 +1,908 @@ +// +// "$Id: Fl_Type.cxx 6012 2008-01-04 21:45:49Z matt $" +// +// Widget type code for the Fast Light Tool Kit (FLTK). +// +// Each object described by Fluid is one of these objects. They +// are all stored in a double-linked list. +// +// They "type" of the object is covered by the virtual functions. +// There will probably be a lot of these virtual functions. +// +// The type browser is also a list of these objects, but they +// are "factory" instances, not "real" ones. These objects exist +// only so the "make" method can be called on them. They are +// not in the linked list and are not written to files or +// copied or otherwise examined. +// +// Copyright 1998-2006 by Bill Spitzak and others. +// +// 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 +#include +#include +#include +#include "../src/flstring.h" +#include + +#include "Fl_Type.h" +#include "undo.h" + +#include +#include "pixmaps/lock.xpm" +#include "pixmaps/protected.xpm" +//#include "pixmaps/unlock.xpm" + +static Fl_Pixmap lock_pixmap(lock_xpm); +static Fl_Pixmap protected_pixmap(protected_xpm); +//static Fl_Pixmap unlock_pixmap(unlock_xpm); + +#include "pixmaps/flWindow.xpm" +#include "pixmaps/flButton.xpm" +#include "pixmaps/flCheckButton.xpm" +#include "pixmaps/flRoundButton.xpm" +#include "pixmaps/flBox.xpm" +#include "pixmaps/flGroup.xpm" +#include "pixmaps/flFunction.xpm" +#include "pixmaps/flCode.xpm" +#include "pixmaps/flCodeBlock.xpm" +#include "pixmaps/flComment.xpm" +#include "pixmaps/flDeclaration.xpm" +#include "pixmaps/flDeclarationBlock.xpm" +#include "pixmaps/flClass.xpm" +#include "pixmaps/flTabs.xpm" +#include "pixmaps/flInput.xpm" +#include "pixmaps/flChoice.xpm" +#include "pixmaps/flMenuitem.xpm" +#include "pixmaps/flMenubar.xpm" +#include "pixmaps/flSubmenu.xpm" +#include "pixmaps/flScroll.xpm" +#include "pixmaps/flTile.xpm" +#include "pixmaps/flWizard.xpm" +#include "pixmaps/flPack.xpm" +#include "pixmaps/flReturnButton.xpm" +#include "pixmaps/flLightButton.xpm" +#include "pixmaps/flRepeatButton.xpm" +#include "pixmaps/flMenuButton.xpm" +#include "pixmaps/flOutput.xpm" +#include "pixmaps/flTextDisplay.xpm" +#include "pixmaps/flTextEdit.xpm" +#include "pixmaps/flFileInput.xpm" +#include "pixmaps/flBrowser.xpm" +#include "pixmaps/flCheckBrowser.xpm" +#include "pixmaps/flFileBrowser.xpm" +#include "pixmaps/flClock.xpm" +#include "pixmaps/flHelp.xpm" +#include "pixmaps/flProgress.xpm" +#include "pixmaps/flSlider.xpm" +#include "pixmaps/flScrollBar.xpm" +#include "pixmaps/flValueSlider.xpm" +#include "pixmaps/flAdjuster.xpm" +#include "pixmaps/flCounter.xpm" +#include "pixmaps/flDial.xpm" +#include "pixmaps/flRoller.xpm" +#include "pixmaps/flValueInput.xpm" +#include "pixmaps/flValueOutput.xpm" +#include "pixmaps/flSpinner.xpm" +#include "pixmaps/flWidgetClass.xpm" + +static Fl_Pixmap window_pixmap(flWindow_xpm); +static Fl_Pixmap button_pixmap(flButton_xpm); +static Fl_Pixmap checkbutton_pixmap(flCheckButton_xpm); +static Fl_Pixmap roundbutton_pixmap(flRoundButton_xpm); +static Fl_Pixmap box_pixmap(flBox_xpm); +static Fl_Pixmap group_pixmap(flGroup_xpm); +static Fl_Pixmap function_pixmap(flFunction_xpm); +static Fl_Pixmap code_pixmap(flCode_xpm); +static Fl_Pixmap codeblock_pixmap(flCodeBlock_xpm); +static Fl_Pixmap comment_pixmap(flComment_xpm); +static Fl_Pixmap declaration_pixmap(flDeclaration_xpm); +static Fl_Pixmap declarationblock_pixmap(flDeclarationBlock_xpm); +static Fl_Pixmap class_pixmap(flClass_xpm); +static Fl_Pixmap tabs_pixmap(flTabs_xpm); +static Fl_Pixmap input_pixmap(flInput_xpm); +static Fl_Pixmap choice_pixmap(flChoice_xpm); +static Fl_Pixmap menuitem_pixmap(flMenuitem_xpm); +static Fl_Pixmap menubar_pixmap(flMenubar_xpm); +static Fl_Pixmap submenu_pixmap(flSubmenu_xpm); +static Fl_Pixmap scroll_pixmap(flScroll_xpm); +static Fl_Pixmap tile_pixmap(flTile_xpm); +static Fl_Pixmap wizard_pixmap(flWizard_xpm); +static Fl_Pixmap pack_pixmap(flPack_xpm); +static Fl_Pixmap returnbutton_pixmap(flReturnButton_xpm); +static Fl_Pixmap lightbutton_pixmap(flLightButton_xpm); +static Fl_Pixmap repeatbutton_pixmap(flRepeatButton_xpm); +static Fl_Pixmap menubutton_pixmap(flMenuButton_xpm); +static Fl_Pixmap output_pixmap(flOutput_xpm); +static Fl_Pixmap textdisplay_pixmap(flTextDisplay_xpm); +static Fl_Pixmap textedit_pixmap(flTextEdit_xpm); +static Fl_Pixmap fileinput_pixmap(flFileInput_xpm); +static Fl_Pixmap browser_pixmap(flBrowser_xpm); +static Fl_Pixmap checkbrowser_pixmap(flCheckBrowser_xpm); +static Fl_Pixmap filebrowser_pixmap(flFileBrowser_xpm); +static Fl_Pixmap clock_pixmap(flClock_xpm); +static Fl_Pixmap help_pixmap(flHelp_xpm); +static Fl_Pixmap progress_pixmap(flProgress_xpm); +static Fl_Pixmap slider_pixmap(flSlider_xpm); +static Fl_Pixmap scrollbar_pixmap(flScrollBar_xpm); +static Fl_Pixmap valueslider_pixmap(flValueSlider_xpm); +static Fl_Pixmap adjuster_pixmap(flAdjuster_xpm); +static Fl_Pixmap counter_pixmap(flCounter_xpm); +static Fl_Pixmap dial_pixmap(flDial_xpm); +static Fl_Pixmap roller_pixmap(flRoller_xpm); +static Fl_Pixmap valueinput_pixmap(flValueInput_xpm); +static Fl_Pixmap valueoutput_pixmap(flValueOutput_xpm); +static Fl_Pixmap spinner_pixmap(flSpinner_xpm); +static Fl_Pixmap widgetclass_pixmap(flWidgetClass_xpm); + +Fl_Pixmap *pixmap[] = { 0, &window_pixmap, &button_pixmap, &checkbutton_pixmap, &roundbutton_pixmap, /* 0..4 */ + &box_pixmap, &group_pixmap, &function_pixmap, &code_pixmap, &codeblock_pixmap, &declaration_pixmap, /* 5..10 */ + &declarationblock_pixmap, &class_pixmap, &tabs_pixmap, &input_pixmap, &choice_pixmap, /* 11..15 */ + &menuitem_pixmap, &menubar_pixmap, &submenu_pixmap, &scroll_pixmap, &tile_pixmap, &wizard_pixmap, /* 16..21 */ + &pack_pixmap, &returnbutton_pixmap, &lightbutton_pixmap, &repeatbutton_pixmap, &menubutton_pixmap, /* 22..26 */ + &output_pixmap, &textdisplay_pixmap, &textedit_pixmap, &fileinput_pixmap, &browser_pixmap, /* 27..32 */ + &checkbrowser_pixmap, &filebrowser_pixmap, &clock_pixmap, &help_pixmap, &progress_pixmap, /* 33..36 */ + &slider_pixmap, &scrollbar_pixmap, &valueslider_pixmap, &adjuster_pixmap, &counter_pixmap, /* 37..41 */ + &dial_pixmap, &roller_pixmap, &valueinput_pixmap, &valueoutput_pixmap, &comment_pixmap, /* 42..46 */ + &spinner_pixmap, &widgetclass_pixmap /* 47..48 */ }; + +//////////////////////////////////////////////////////////////// + +class Widget_Browser : public Fl_Browser_ { + friend class Fl_Type; + + // required routines for Fl_Browser_ subclass: + void *item_first() const ; + void *item_next(void *) const ; + void *item_prev(void *) const ; + int item_selected(void *) const ; + void item_select(void *,int); + int item_width(void *) const ; + int item_height(void *) const ; + void item_draw(void *,int,int,int,int) const ; + int incr_height() const ; + +public: + + int handle(int); + void callback(); + Widget_Browser(int,int,int,int,const char * =0); +}; + +static Widget_Browser *widget_browser; +Fl_Widget *make_widget_browser(int x,int y,int w,int h) { + return (widget_browser = new Widget_Browser(x,y,w,h)); +} + +void select(Fl_Type *o, int v) { + widget_browser->select(o,v,1); + // Fl_Type::current = o; +} + +void select_only(Fl_Type *o) { + widget_browser->select_only(o,1); +} + +void deselect() { + widget_browser->deselect(); + //Fl_Type::current = 0; // this breaks the paste & merge functions +} + +Fl_Type *Fl_Type::first; +Fl_Type *Fl_Type::last; + +static void Widget_Browser_callback(Fl_Widget *o,void *) { + ((Widget_Browser *)o)->callback(); +} + +Widget_Browser::Widget_Browser(int X,int Y,int W,int H,const char*l) +: Fl_Browser_(X,Y,W,H,l) { + type(FL_MULTI_BROWSER); + Fl_Widget::callback(Widget_Browser_callback); + when(FL_WHEN_RELEASE); +} + +void *Widget_Browser::item_first() const {return Fl_Type::first;} + +void *Widget_Browser::item_next(void *l) const {return ((Fl_Type*)l)->next;} + +void *Widget_Browser::item_prev(void *l) const {return ((Fl_Type*)l)->prev;} + +int Widget_Browser::item_selected(void *l) const {return ((Fl_Type*)l)->new_selected;} + +void Widget_Browser::item_select(void *l,int v) {((Fl_Type*)l)->new_selected = v;} + +int Widget_Browser::item_height(void *l) const { + return ((Fl_Type *)l)->visible ? textsize()+2 : 0; +} + +int Widget_Browser::incr_height() const {return textsize()+2;} + +static Fl_Type* pushedtitle; + +// Generate a descriptive text for this item, to put in browser & window titles +const char* Fl_Type::title() { + const char* c = name(); if (c) return c; + return type_name(); +} + +extern const char* subclassname(Fl_Type*); + +void Widget_Browser::item_draw(void *v, int X, int Y, int, int) const { + Fl_Type *l = (Fl_Type *)v; + X += 3 + 18 + l->level * 12; + if (l->new_selected) fl_color(fl_contrast(FL_FOREGROUND_COLOR,FL_SELECTION_COLOR)); + else fl_color(FL_FOREGROUND_COLOR); + Fl_Pixmap *pm = pixmap[l->pixmapID()]; + if (pm) pm->draw(X-18, Y); + switch (l->is_public()) { + case 0: lock_pixmap.draw(X - 17, Y); break; + case 2: protected_pixmap.draw(X - 17, Y); break; + } + if (l->is_parent()) { + if (!l->next || l->next->level <= l->level) { + if (l->open_!=(l==pushedtitle)) { + fl_loop(X,Y+7,X+5,Y+12,X+10,Y+7); + } else { + fl_loop(X+2,Y+2,X+7,Y+7,X+2,Y+12); + } + } else { + if (l->open_!=(l==pushedtitle)) { + fl_polygon(X,Y+7,X+5,Y+12,X+10,Y+7); + } else { + fl_polygon(X+2,Y+2,X+7,Y+7,X+2,Y+12); + } + } + X += 10; + } + if (l->is_widget() || l->is_class()) { + const char* c = subclassname(l); + if (!strncmp(c,"Fl_",3)) c += 3; + fl_font(textfont(), textsize()); + fl_draw(c, X, Y+13); + X += int(fl_width(c)+fl_width('n')); + c = l->name(); + if (c) { + fl_font(textfont()|FL_BOLD, textsize()); + fl_draw(c, X, Y+13); + } else if ((c=l->label())) { + char buf[50]; char* p = buf; + *p++ = '"'; + for (int i = 20; i--;) { + if (! (*c & -32)) break; + *p++ = *c++; + } + if (*c) {strcpy(p,"..."); p+=3;} + *p++ = '"'; + *p = 0; + fl_draw(buf, X, Y+13); + } + } else { + const char* c = l->title(); + char buf[60]; char* p = buf; + for (int i = 55; i--;) { + if (! (*c & -32)) break; + *p++ = *c++; + } + if (*c) {strcpy(p,"..."); p+=3;} + *p = 0; + fl_font(textfont() | (l->is_code_block() && (l->level==0 || l->parent->is_class())?0:FL_BOLD), textsize()); + fl_draw(buf, X, Y+13); + } +} + +int Widget_Browser::item_width(void *v) const { + Fl_Type *l = (Fl_Type *)v; + + if (!l->visible) return 0; + + int W = 3 + 16 + 18 + l->level*10; + if (l->is_parent()) W += 10; + + if (l->is_widget() || l->is_class()) { + const char* c = l->type_name(); + if (!strncmp(c,"Fl_",3)) c += 3; + fl_font(textfont(), textsize()); + W += int(fl_width(c) + fl_width('n')); + c = l->name(); + if (c) { + fl_font(textfont()|FL_BOLD, textsize()); + W += int(fl_width(c)); + } else if ((c=l->label())) { + char buf[50]; char* p = buf; + *p++ = '"'; + for (int i = 20; i--;) { + if (! (*c & -32)) break; + *p++ = *c++; + } + if (*c) {strcpy(p,"..."); p+=3;} + *p++ = '"'; + *p = 0; + W += int(fl_width(buf)); + } + } else { + const char* c = l->title(); + char buf[60]; char* p = buf; + for (int i = 55; i--;) { + if (! (*c & -32)) break; + *p++ = *c++; + } + if (*c) {strcpy(p,"..."); p+=3;} + *p = 0; + fl_font(textfont() | (l->is_code_block() && (l->level==0 || l->parent->is_class())?0:FL_BOLD), textsize()); + W += int(fl_width(buf)); + } + + return W; +} + +void redraw_browser() { + widget_browser->redraw(); +} + +void Widget_Browser::callback() { + selection_changed((Fl_Type*)selection()); +} + +int Widget_Browser::handle(int e) { + static Fl_Type *title; + Fl_Type *l; + int X,Y,W,H; bbox(X,Y,W,H); + switch (e) { + case FL_PUSH: + if (!Fl::event_inside(X,Y,W,H)) break; + l = (Fl_Type*)find_item(Fl::event_y()); + if (l) { + X += 12*l->level + 18 - hposition(); + if (l->is_parent() && Fl::event_x()>X && Fl::event_x()level + 18 - hposition(); + if (l->is_parent() && Fl::event_x()>X && Fl::event_x()new_selected && (Fl::event_clicks() || Fl::event_state(FL_CTRL))) + l->open(); + break; + } + l = pushedtitle; + title = pushedtitle = 0; + if (l) { + if (l->open_) { + l->open_ = 0; + for (Fl_Type*k = l->next; k&&k->level>l->level; k = k->next) + k->visible = 0; + } else { + l->open_ = 1; + for (Fl_Type*k=l->next; k&&k->level>l->level;) { + k->visible = 1; + if (k->is_parent() && !k->open_) { + Fl_Type *j; + for (j = k->next; j && j->level>k->level; j = j->next); + k = j; + } else + k = k->next; + } + } + redraw(); + } + return 1; + } + return Fl_Browser_::handle(e); +} + +Fl_Type::Fl_Type() { + factory = 0; + parent = 0; + next = prev = 0; + selected = new_selected = 0; + visible = 0; + name_ = 0; + label_ = 0; + user_data_ = 0; + user_data_type_ = 0; + callback_ = 0; + rtti = 0; + level = 0; + code_line = header_line = -1; + code_line_end = header_line_end = -1; +} + +static void fixvisible(Fl_Type *p) { + Fl_Type *t = p; + for (;;) { + if (t->parent) t->visible = t->parent->visible && t->parent->open_; + else t->visible = 1; + t = t->next; + if (!t || t->level <= p->level) break; + } +} + +// turn a click at x,y on this into the actual picked object: +Fl_Type* Fl_Type::click_test(int,int) {return 0;} +void Fl_Type::add_child(Fl_Type*, Fl_Type*) {} +void Fl_Type::move_child(Fl_Type*, Fl_Type*) {} +void Fl_Type::remove_child(Fl_Type*) {} + +// add a list of widgets as a new child of p: +void Fl_Type::add(Fl_Type *p) { + if (p && parent == p) return; + undo_checkpoint(); + parent = p; + Fl_Type *end = this; + while (end->next) end = end->next; + Fl_Type *q; + int newlevel; + if (p) { + for (q = p->next; q && q->level > p->level; q = q->next); + newlevel = p->level+1; + } else { + q = 0; + newlevel = 0; + } + for (Fl_Type *t = this->next; t; t = t->next) t->level += (newlevel-level); + level = newlevel; + if (q) { + prev = q->prev; + prev->next = this; + q->prev = end; + end->next = q; + } else if (first) { + prev = last; + prev->next = this; + end->next = 0; + last = end; + } else { + first = this; + last = end; + prev = end->next = 0; + } + if (p) p->add_child(this,0); + open_ = 1; + fixvisible(this); + set_modflag(1); + widget_browser->redraw(); +} + +// add to a parent before another widget: +void Fl_Type::insert(Fl_Type *g) { + Fl_Type *end = this; + while (end->next) end = end->next; + parent = g->parent; + int newlevel = g->level; + visible = g->visible; + for (Fl_Type *t = this->next; t; t = t->next) t->level += newlevel-level; + level = newlevel; + prev = g->prev; + if (prev) prev->next = this; else first = this; + end->next = g; + g->prev = end; + fixvisible(this); + if (parent) parent->add_child(this, g); + widget_browser->redraw(); +} + +// Return message number for I18N... +int +Fl_Type::msgnum() { + int count; + Fl_Type *p; + + for (count = 0, p = this; p;) { + if (p->label()) count ++; + if (p != this && p->is_widget() && ((Fl_Widget_Type *)p)->tooltip()) count ++; + + if (p->prev) p = p->prev; + else p = p->parent; + } + + return count; +} + + +// delete from parent: +Fl_Type *Fl_Type::remove() { + Fl_Type *end = this; + for (;;) { + if (!end->next || end->next->level <= level) break; + end = end->next; + } + if (prev) prev->next = end->next; + else first = end->next; + if (end->next) end->next->prev = prev; + else last = prev; + Fl_Type *r = end->next; + prev = end->next = 0; + if (parent) parent->remove_child(this); + parent = 0; + widget_browser->redraw(); + selection_changed(0); + return r; +} + +// update a string member: +int storestring(const char *n, const char * & p, int nostrip) { + if (n == p) return 0; + undo_checkpoint(); + int length = 0; + if (n) { // see if blank, strip leading & trailing blanks + if (!nostrip) while (isspace(*n)) n++; + const char *e = n + strlen(n); + if (!nostrip) while (e > n && isspace(*(e-1))) e--; + length = e-n; + if (!length) n = 0; + } + if (n == p) return 0; + if (n && p && !strncmp(n,p,length) && !p[length]) return 0; + if (p) free((void *)p); + if (!n || !*n) { + p = 0; + } else { + char *q = (char *)malloc(length+1); + strlcpy(q,n,length+1); + p = q; + } + set_modflag(1); + return 1; +} + +void Fl_Type::name(const char *n) { + int nostrip = is_comment(); + if (storestring(n,name_,nostrip)) { + if (visible) widget_browser->redraw(); + } +} + +void Fl_Type::label(const char *n) { + if (storestring(n,label_,1)) { + setlabel(label_); + if (visible && !name_) widget_browser->redraw(); + } +} + +void Fl_Type::callback(const char *n) { + storestring(n,callback_); +} + +void Fl_Type::user_data(const char *n) { + storestring(n,user_data_); +} + +void Fl_Type::user_data_type(const char *n) { + storestring(n,user_data_type_); +} + +void Fl_Type::open() { + printf("Open of '%s' is not yet implemented\n",type_name()); +} + +void Fl_Type::setlabel(const char *) {} + +Fl_Type::~Fl_Type() { + // warning: destructor only works for widgets that have been add()ed. + if (widget_browser) widget_browser->deleting(this); + if (prev) prev->next = next; else first = next; + if (next) next->prev = prev; else last = prev; + if (current == this) current = 0; + if (parent) parent->remove_child(this); +} + +int Fl_Type::is_parent() const {return 0;} +int Fl_Type::is_widget() const {return 0;} +int Fl_Type::is_valuator() const {return 0;} +int Fl_Type::is_spinner() const {return 0;} +int Fl_Type::is_button() const {return 0;} +int Fl_Type::is_menu_item() const {return 0;} +int Fl_Type::is_menu_button() const {return 0;} +int Fl_Type::is_group() const {return 0;} +int Fl_Type::is_window() const {return 0;} +int Fl_Type::is_code_block() const {return 0;} +int Fl_Type::is_decl_block() const {return 0;} +int Fl_Type::is_comment() const {return 0;} +int Fl_Type::is_class() const {return 0;} +int Fl_Type::is_public() const {return 1;} + +int Fl_Code_Type::is_public()const { return -1; } +int Fl_CodeBlock_Type::is_public()const { return -1; } + + +//////////////////////////////////////////////////////////////// + +Fl_Type *in_this_only; // set if menu popped-up in window + +void select_all_cb(Fl_Widget *,void *) { + Fl_Type *p = Fl_Type::current ? Fl_Type::current->parent : 0; + if (in_this_only) { + Fl_Type *t = p; + for (; t && t != in_this_only; t = t->parent); + if (t != in_this_only) p = in_this_only; + } + for (;;) { + if (p) { + int foundany = 0; + for (Fl_Type *t = p->next; t && t->level>p->level; t = t->next) { + if (!t->new_selected) {widget_browser->select(t,1,0); foundany = 1;} + } + if (foundany) break; + p = p->parent; + } else { + for (Fl_Type *t = Fl_Type::first; t; t = t->next) + widget_browser->select(t,1,0); + break; + } + } + selection_changed(p); +} + +void select_none_cb(Fl_Widget *,void *) { + Fl_Type *p = Fl_Type::current ? Fl_Type::current->parent : 0; + if (in_this_only) { + Fl_Type *t = p; + for (; t && t != in_this_only; t = t->parent); + if (t != in_this_only) p = in_this_only; + } + for (;;) { + if (p) { + int foundany = 0; + for (Fl_Type *t = p->next; t && t->level>p->level; t = t->next) { + if (t->new_selected) {widget_browser->select(t,0,0); foundany = 1;} + } + if (foundany) break; + p = p->parent; + } else { + for (Fl_Type *t = Fl_Type::first; t; t = t->next) + widget_browser->select(t,0,0); + break; + } + } + selection_changed(p); +} + +static void delete_children(Fl_Type *p) { + Fl_Type *f; + for (f = p; f && f->next && f->next->level > p->level; f = f->next); + for (; f != p; ) { + Fl_Type *g = f->prev; + delete f; + f = g; + } +} + +void delete_all(int selected_only) { + for (Fl_Type *f = Fl_Type::first; f;) { + if (f->selected || !selected_only) { + delete_children(f); + Fl_Type *g = f->next; + delete f; + f = g; + } else f = f->next; + } + if(!selected_only) { + include_H_from_C=1; + use_FL_COMMAND=0; + } + + selection_changed(0); +} + +// move f (and it's children) into list before g: +// returns pointer to whatever is after f & children +void Fl_Type::move_before(Fl_Type* g) { + if (level != g->level) printf("move_before levels don't match! %d %d\n", + level, g->level); + Fl_Type* n; + for (n = next; n && n->level > level; n = n->next); + if (n == g) return; + Fl_Type *l = n ? n->prev : Fl_Type::last; + prev->next = n; + if (n) n->prev = prev; else Fl_Type::last = prev; + prev = g->prev; + l->next = g; + if (prev) prev->next = this; else Fl_Type::first = this; + g->prev = l; + if (parent && is_widget()) parent->move_child(this,g); + widget_browser->redraw(); +} + +// move selected widgets in their parent's list: +void earlier_cb(Fl_Widget*,void*) { + Fl_Type *f; + int mod = 0; + for (f = Fl_Type::first; f; ) { + Fl_Type* nxt = f->next; + if (f->selected) { + Fl_Type* g; + for (g = f->prev; g && g->level > f->level; g = g->prev); + if (g && g->level == f->level && !g->selected) { + f->move_before(g); + mod = 1; + } + } + f = nxt; + } + if (mod) set_modflag(1); +} + +void later_cb(Fl_Widget*,void*) { + Fl_Type *f; + int mod = 0; + for (f = Fl_Type::last; f; ) { + Fl_Type* prv = f->prev; + if (f->selected) { + Fl_Type* g; + for (g = f->next; g && g->level > f->level; g = g->next); + if (g && g->level == f->level && !g->selected) { + g->move_before(f); + mod = 1; + } + } + f = prv; + } + if (mod) set_modflag(1); +} + +//////////////////////////////////////////////////////////////// + +// write a widget and all it's children: +void Fl_Type::write() { + write_indent(level); + write_word(type_name()); + + if (is_class()) { + const char * p = ((Fl_Class_Type*)this)->prefix(); + if (p && strlen(p)) + write_word(p); + } + + write_word(name()); + write_open(level); + write_properties(); + write_close(level); + if (!is_parent()) return; + // now do children: + write_open(level); + Fl_Type *child; + for (child = next; child && child->level > level; child = child->next) + if (child->level == level+1) child->write(); + write_close(level); +} + +void Fl_Type::write_properties() { + // repeat this for each attribute: + if (label()) { + write_indent(level+1); + write_word("label"); + write_word(label()); + } + if (user_data()) { + write_indent(level+1); + write_word("user_data"); + write_word(user_data()); + } + if (user_data_type()) { + write_word("user_data_type"); + write_word(user_data_type()); + } + if (callback()) { + write_indent(level+1); + write_word("callback"); + write_word(callback()); + } + if (is_parent() && open_) write_word("open"); + if (selected) write_word("selected"); +} + +void Fl_Type::read_property(const char *c) { + if (!strcmp(c,"label")) + label(read_word()); + else if (!strcmp(c,"user_data")) + user_data(read_word()); + else if (!strcmp(c,"user_data_type")) + user_data_type(read_word()); + else if (!strcmp(c,"callback")) + callback(read_word()); + else if (!strcmp(c,"open")) + open_ = 1; + else if (!strcmp(c,"selected")) + select(this,1); + else + read_error("Unknown property \"%s\"", c); +} + +int Fl_Type::read_fdesign(const char*, const char*) {return 0;} + +/** + * Return 1 if the list contains a function with the given signature at the top level + */ +int has_toplevel_function(const char *rtype, const char *sig) { + Fl_Type *child; + for (child = Fl_Type::first; child; child = child->next) { + if (!child->is_in_class() && strcmp(child->type_name(), "Function")==0) { + const Fl_Function_Type *fn = (const Fl_Function_Type*)child; + if (fn->has_signature(rtype, sig)) + return 1; + } + } + return 0; +} + +/** + * Make sure that the given item is visible in the browser by opening + * all parent groups and moving the item into the visible space. + */ +void reveal_in_browser(Fl_Type *t) { + Fl_Type *p = t->parent; + if (p) { + for (;;) { + if (!p->open_) + p->open_ = 1; + if (!p->parent) break; + p = p->parent; + } + fixvisible(p); + } + widget_browser->display(t); + redraw_browser(); +} + +/** + * Build widgets and dataset needed in live mode. + * \return a widget pointer that the live mode initiator can 'show()' + * \see leave_live_mode() + */ +Fl_Widget *Fl_Type::enter_live_mode(int) { + return 0L; +} + +/** + * Release all resources created when enetring live mode. + * \see enter_live_mode() + */ +void Fl_Type::leave_live_mode() { +} + +/** + * Copy all needed properties for this tye into the live object. + */ +void Fl_Type::copy_properties() { +} + +// +// End of "$Id: Fl_Type.cxx 6012 2008-01-04 21:45:49Z matt $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/Fl_Type.h b/third_party/windows/fltk-1.1.10/fluid/Fl_Type.h new file mode 100644 index 0000000..b428ea0 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/Fl_Type.h @@ -0,0 +1,772 @@ +// +// "$Id: Fl_Type.h 6012 2008-01-04 21:45:49Z matt $" +// +// Widget type header file for the Fast Light Tool Kit (FLTK). +// +// Each object described by Fluid is one of these objects. They +// are all stored in a double-linked list. +// +// There is also a single "factory" instance of each type of this. +// The method "make()" is called on this factory to create a new +// instance of this object. It could also have a "copy()" function, +// but it was easier to implement this by using the file read/write +// that is needed to save the setup anyways. +// +// Copyright 1998-2006 by Bill Spitzak and others. +// +// 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 +#include +#include "Fluid_Image.h" +#include + +void set_modflag(int mf); + +class Fl_Type { + + friend class Widget_Browser; + friend Fl_Widget *make_type_browser(int,int,int,int,const char *l=0); + friend class Fl_Window_Type; + virtual void setlabel(const char *); // virtual part of label(char*) + +protected: + + Fl_Type(); + + const char *name_; + const char *label_; + const char *callback_; + const char *user_data_; + const char *user_data_type_; + +public: // things that should not be public: + + Fl_Type *parent; // parent, which is previous in list + char new_selected; // browser highlight + char selected; // copied here by selection_changed() + char open_; // state of triangle in browser + char visible; // true if all parents are open + char rtti; // hack because I have no rtti, this is 0 for base class + int level; // number of parents over this + static Fl_Type *first, *last; // linked list of all objects + Fl_Type *next, *prev; // linked list of all objects + + Fl_Type *factory; + const char *callback_name(); + + int code_line, header_line; + int code_line_end, header_line_end; + +public: + + virtual ~Fl_Type(); + virtual Fl_Type *make() = 0; + + void add(Fl_Type *parent); // add as new child + void insert(Fl_Type *n); // insert into list before n + Fl_Type* remove(); // remove from list + void move_before(Fl_Type*); // move before a sibling + + virtual const char *title(); // string for browser + virtual const char *type_name() = 0; // type for code output + + const char *name() const {return name_;} + void name(const char *); + const char *label() const {return label_;} + void label(const char *); + const char *callback() const {return callback_;} + void callback(const char *); + const char *user_data() const {return user_data_;} + void user_data(const char *); + const char *user_data_type() const {return user_data_type_;} + void user_data_type(const char *); + + virtual Fl_Type* click_test(int,int); + virtual void add_child(Fl_Type*, Fl_Type* beforethis); + virtual void move_child(Fl_Type*, Fl_Type* beforethis); + virtual void remove_child(Fl_Type*); + + static Fl_Type *current; // most recently picked object + virtual void open(); // what happens when you double-click + + // read and write data to a saved file: + void write(); + virtual void write_properties(); + virtual void read_property(const char *); + virtual int read_fdesign(const char*, const char*); + + // write code, these are called in order: + virtual void write_static(); // write static stuff to .c file + virtual void write_code1(); // code and .h before children + virtual void write_code2(); // code and .h after children + + // live mode + virtual Fl_Widget *enter_live_mode(int top=0); // build wdgets needed for live mode + virtual void leave_live_mode(); // free allocated resources + virtual void copy_properties(); // copy properties from this type into a potetial live object + + // get message number for I18N + int msgnum(); + + // fake rtti: + virtual int is_parent() const; + virtual int is_widget() const; + virtual int is_button() const; + virtual int is_valuator() const; + virtual int is_spinner() const; + virtual int is_menu_item() const; + virtual int is_menu_button() const; + virtual int is_group() const; + virtual int is_window() const; + virtual int is_code_block() const; + virtual int is_decl_block() const; + virtual int is_comment() const; + virtual int is_class() const; + virtual int is_public() const; + + virtual int pixmapID() { return 0; } + + const char* class_name(const int need_nest) const; + const class Fl_Class_Type* is_in_class() const; +}; + +class Fl_Function_Type : public Fl_Type { + const char* return_type; + char public_, cdecl_, constructor, havewidgets; +public: + Fl_Type *make(); + void write_code1(); + void write_code2(); + void open(); + int ismain() {return name_ == 0;} + virtual const char *type_name() {return "Function";} + virtual const char *title() { + return name() ? name() : "main()"; + } + int is_parent() const {return 1;} + int is_code_block() const {return 1;} + virtual int is_public() const; + int pixmapID() { return 7; } + void write_properties(); + void read_property(const char *); + int has_signature(const char *, const char*) const; +}; + +class Fl_Code_Type : public Fl_Type { +public: + Fl_Type *make(); + void write_code1(); + void write_code2(); + void open(); + virtual const char *type_name() {return "code";} + int is_code_block() const {return 0;} + int pixmapID() { return 8; } + virtual int is_public() const; +}; + +class Fl_CodeBlock_Type : public Fl_Type { + const char* after; +public: + Fl_Type *make(); + void write_code1(); + void write_code2(); + void open(); + virtual const char *type_name() {return "codeblock";} + int is_code_block() const {return 1;} + int is_parent() const {return 1;} + virtual int is_public() const; + int pixmapID() { return 9; } + void write_properties(); + void read_property(const char *); +}; + +class Fl_Decl_Type : public Fl_Type { + char public_; + char static_; +public: + Fl_Type *make(); + void write_code1(); + void write_code2(); + void open(); + virtual const char *type_name() {return "decl";} + void write_properties(); + void read_property(const char *); + virtual int is_public() const; + int pixmapID() { return 10; } +}; + +class Fl_DeclBlock_Type : public Fl_Type { + const char* after; + char public_; +public: + Fl_Type *make(); + void write_code1(); + void write_code2(); + void open(); + virtual const char *type_name() {return "declblock";} + void write_properties(); + void read_property(const char *); + int is_parent() const {return 1;} + int is_decl_block() const {return 1;} + virtual int is_public() const; + int pixmapID() { return 11; } +}; + +class Fl_Comment_Type : public Fl_Type { + char in_c_, in_h_, style_; + char title_buf[64]; +public: + Fl_Type *make(); + void write_code1(); + void write_code2(); + void open(); + virtual const char *type_name() {return "comment";} + virtual const char *title(); // string for browser + void write_properties(); + void read_property(const char *); + virtual int is_public() const { return 1; } + virtual int is_comment() const { return 1; } + int pixmapID() { return 46; } +}; + +class Fl_Class_Type : public Fl_Type { + const char* subclass_of; + char public_; +public: + // state variables for output: + char write_public_state; // true when public: has been printed + Fl_Class_Type* parent_class; // save class if nested +// + Fl_Type *make(); + void write_code1(); + void write_code2(); + void open(); + virtual const char *type_name() {return "class";} + int is_parent() const {return 1;} + int is_decl_block() const {return 1;} + int is_class() const {return 1;} + virtual int is_public() const; + int pixmapID() { return 12; } + void write_properties(); + void read_property(const char *); + + // class prefix attribute access + void prefix(const char* p); + const char* prefix() const {return class_prefix;} + int has_function(const char*, const char*) const; +private: + const char* class_prefix; +}; + +#define NUM_EXTRA_CODE 4 + +class Fl_Widget_Type : public Fl_Type { + virtual Fl_Widget *widget(int,int,int,int) = 0; + virtual Fl_Widget_Type *_make() = 0; // virtual constructor + virtual void setlabel(const char *); + + const char *extra_code_[NUM_EXTRA_CODE]; + const char *subclass_; + const char *tooltip_; + const char *image_name_; + const char *inactive_name_; + uchar hotspot_; + +protected: + + void write_static(); + void write_code1(); + void write_widget_code(); + void write_extra_code(); + void write_block_close(); + void write_code2(); + void write_color(const char*, Fl_Color); + Fl_Widget *live_widget; + +public: + static int default_size; + + const char *xclass; // junk string, used for shortcut + Fl_Widget *o; + int public_; + + Fluid_Image *image; + void setimage(Fluid_Image *); + Fluid_Image *inactive; + void setinactive(Fluid_Image *); + + Fl_Widget_Type(); + Fl_Type *make(); + void open(); + + const char *extra_code(int n) const {return extra_code_[n];} + void extra_code(int n,const char *); + const char *subclass() const {return subclass_;} + void subclass(const char *); + const char *tooltip() const {return tooltip_;} + void tooltip(const char *); + const char *image_name() const {return image_name_;} + void image_name(const char *); + const char *inactive_name() const {return inactive_name_;} + void inactive_name(const char *); + uchar hotspot() const {return hotspot_;} + void hotspot(uchar v) {hotspot_ = v;} + uchar resizable() const; + void resizable(uchar v); + + virtual int textstuff(int what, Fl_Font &, int &, Fl_Color &); + virtual Fl_Menu_Item *subtypes(); + + virtual int is_widget() const; + virtual int is_public() const; + + virtual void write_properties(); + virtual void read_property(const char *); + virtual int read_fdesign(const char*, const char*); + + virtual Fl_Widget *enter_live_mode(int top=0); + virtual void leave_live_mode(); + virtual void copy_properties(); + + virtual void ideal_size(int &w, int &h); + virtual void ideal_spacing(int &x, int &y); + + ~Fl_Widget_Type(); + void redraw(); +}; + +#include +#include +#include + +class igroup : public Fl_Group { +public: + void resize(int,int,int,int); + void full_resize(int X, int Y, int W, int H) { Fl_Group::resize(X, Y, W, H); } + igroup(int X,int Y,int W,int H) : Fl_Group(X,Y,W,H) {Fl_Group::current(0);} +}; + +class itabs : public Fl_Tabs { +public: + void resize(int,int,int,int); + void full_resize(int X, int Y, int W, int H) { Fl_Group::resize(X, Y, W, H); } + itabs(int X,int Y,int W,int H) : Fl_Tabs(X,Y,W,H) {} +}; + +class iwizard : public Fl_Wizard { +public: + void resize(int,int,int,int); + void full_resize(int X, int Y, int W, int H) { Fl_Group::resize(X, Y, W, H); } + iwizard(int X,int Y,int W,int H) : Fl_Wizard(X,Y,W,H) {} +}; + +class Fl_Group_Type : public Fl_Widget_Type { +public: + virtual const char *type_name() {return "Fl_Group";} + Fl_Widget *widget(int X,int Y,int W,int H) { + igroup *g = new igroup(X,Y,W,H); Fl_Group::current(0); return g;} + Fl_Widget_Type *_make() {return new Fl_Group_Type();} + Fl_Type *make(); + void write_code1(); + void write_code2(); + void add_child(Fl_Type*, Fl_Type*); + void move_child(Fl_Type*, Fl_Type*); + void remove_child(Fl_Type*); + int is_parent() const {return 1;} + int is_group() const {return 1;} + int pixmapID() { return 6; } + + virtual Fl_Widget *enter_live_mode(int top=0); + virtual void leave_live_mode(); + virtual void copy_properties(); +}; + +extern const char pack_type_name[]; +extern Fl_Menu_Item pack_type_menu[]; + +class Fl_Pack_Type : public Fl_Group_Type { + Fl_Menu_Item *subtypes() {return pack_type_menu;} +public: + virtual const char *type_name() {return pack_type_name;} + Fl_Widget_Type *_make() {return new Fl_Pack_Type();} + int pixmapID() { return 22; } + void copy_properties(); +}; + +extern const char tabs_type_name[]; + +class Fl_Tabs_Type : public Fl_Group_Type { +public: + virtual void ideal_spacing(int &x, int &y) { + x = 10; + fl_font(o->labelfont(), o->labelsize()); + y = fl_height() + o->labelsize() - 6; + } + virtual const char *type_name() {return tabs_type_name;} + Fl_Widget *widget(int X,int Y,int W,int H) { + itabs *g = new itabs(X,Y,W,H); Fl_Group::current(0); return g;} + Fl_Widget_Type *_make() {return new Fl_Tabs_Type();} + Fl_Type* click_test(int,int); + void add_child(Fl_Type*, Fl_Type*); + void remove_child(Fl_Type*); + int pixmapID() { return 13; } + Fl_Widget *enter_live_mode(int top=0); +}; + +extern const char scroll_type_name[]; +extern Fl_Menu_Item scroll_type_menu[]; + +class Fl_Scroll_Type : public Fl_Group_Type { + Fl_Menu_Item *subtypes() {return scroll_type_menu;} +public: + virtual const char *type_name() {return scroll_type_name;} + Fl_Widget_Type *_make() {return new Fl_Scroll_Type();} + int pixmapID() { return 19; } + Fl_Widget *enter_live_mode(int top=0); + void copy_properties(); +}; + +extern const char tile_type_name[]; + +class Fl_Tile_Type : public Fl_Group_Type { +public: + virtual const char *type_name() {return tile_type_name;} + Fl_Widget_Type *_make() {return new Fl_Tile_Type();} + int pixmapID() { return 20; } + void copy_properties(); +}; + +extern const char wizard_type_name[]; + +class Fl_Wizard_Type : public Fl_Group_Type { +public: + virtual const char *type_name() {return wizard_type_name;} + Fl_Widget *widget(int X,int Y,int W,int H) { + iwizard *g = new iwizard(X,Y,W,H); Fl_Group::current(0); return g;} + Fl_Widget_Type *_make() {return new Fl_Wizard_Type();} + int pixmapID() { return 21; } +}; + +extern Fl_Menu_Item window_type_menu[]; + +class Fl_Window_Type : public Fl_Widget_Type { +protected: + + Fl_Menu_Item* subtypes() {return window_type_menu;} + + friend class Overlay_Window; + int mx,my; // mouse position during dragging + int x1,y1; // initial position of selection box + int bx,by,br,bt; // bounding box of selection before snapping + int sx,sy,sr,st; // bounding box of selection after snapping to guides + int dx,dy; + int drag; // which parts of bbox are being moved + int numselected; // number of children selected + enum {LEFT=1,RIGHT=2,BOTTOM=4,TOP=8,DRAG=16,BOX=32}; + void draw_overlay(); + void newdx(); + void newposition(Fl_Widget_Type *,int &x,int &y,int &w,int &h); + int handle(int); + virtual void setlabel(const char *); + void write_code1(); + void write_code2(); + Fl_Widget_Type *_make() {return 0;} // we don't call this + Fl_Widget *widget(int,int,int,int) {return 0;} + int recalc; // set by fix_overlay() + void moveallchildren(); + int pixmapID() { return 1; } + +public: + + Fl_Window_Type() { drag = dx = dy = 0; sr_min_w = sr_min_h = sr_max_w = sr_max_h = 0; } + uchar modal, non_modal; + + Fl_Type *make(); + virtual const char *type_name() {return "Fl_Window";} + + void open(); + + void fix_overlay(); // Update the bounding box, etc + uchar *read_image(int &ww, int &hh); // Read an image of the window + + virtual void write_properties(); + virtual void read_property(const char *); + virtual int read_fdesign(const char*, const char*); + + void add_child(Fl_Type*, Fl_Type*); + void move_child(Fl_Type*, Fl_Type*); + void remove_child(Fl_Type*); + + int is_parent() const {return 1;} + int is_group() const {return 1;} + int is_window() const {return 1;} + + Fl_Widget *enter_live_mode(int top=0); + void leave_live_mode(); + void copy_properties(); + + int sr_min_w, sr_min_h, sr_max_w, sr_max_h; +}; + +class Fl_Widget_Class_Type : private Fl_Window_Type { +public: + Fl_Widget_Class_Type() { + write_public_state = 0; + wc_relative = 0; + } + // state variables for output: + char write_public_state; // true when public: has been printed + char wc_relative; // if true, reposition all child widgets in an Fl_Group + + virtual void write_properties(); + virtual void read_property(const char *); + + void write_code1(); + void write_code2(); + Fl_Type *make(); + virtual const char *type_name() {return "widget_class";} + int pixmapID() { return 48; } + int is_parent() const {return 1;} + int is_code_block() const {return 1;} + int is_decl_block() const {return 1;} + int is_class() const {return 1;} +}; + + +extern Fl_Menu_Item menu_item_type_menu[]; + +class Fl_Menu_Item_Type : public Fl_Widget_Type { +public: + Fl_Menu_Item* subtypes() {return menu_item_type_menu;} + const char* type_name() {return "MenuItem";} + Fl_Type* make(); + int is_menu_item() const {return 1;} + int is_button() const {return 1;} // this gets shortcut to work + Fl_Widget* widget(int,int,int,int) {return 0;} + Fl_Widget_Type* _make() {return 0;} + const char* menu_name(int& i); + int flags(); + void write_static(); + void write_item(); + void write_code1(); + void write_code2(); + int pixmapID() { return 16; } +}; + +class Fl_Submenu_Type : public Fl_Menu_Item_Type { +public: + Fl_Menu_Item* subtypes() {return 0;} + const char* type_name() {return "Submenu";} + int is_parent() const {return 1;} + int is_button() const {return 0;} // disable shortcut + Fl_Type* make(); + // changes to submenu must propagate up so build_menu is called + // on the parent Fl_Menu_Type: + void add_child(Fl_Type*a, Fl_Type*b) {parent->add_child(a,b);} + void move_child(Fl_Type*a, Fl_Type*b) {parent->move_child(a,b);} + void remove_child(Fl_Type*a) {parent->remove_child(a);} + int pixmapID() { return 18; } +}; + + +#include +class Fl_Menu_Type : public Fl_Widget_Type { + int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { + Fl_Menu_ *myo = (Fl_Menu_*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o); + switch (w) { + case 4: + case 0: f = myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break; + case 1: myo->textfont(f); break; + case 2: myo->textsize(s); break; + case 3: myo->textcolor(c); break; + } + return 1; + } +public: + int is_menu_button() const {return 1;} + int is_parent() const {return 1;} + int menusize; + virtual void build_menu(); + Fl_Menu_Type() : Fl_Widget_Type() {menusize = 0;} + ~Fl_Menu_Type() { + if (menusize) delete[] (Fl_Menu_Item*)(((Fl_Menu_*)o)->menu()); + } + void add_child(Fl_Type*, Fl_Type*) {build_menu();} + void move_child(Fl_Type*, Fl_Type*) {build_menu();} + void remove_child(Fl_Type*) {build_menu();} + Fl_Type* click_test(int x, int y); + void write_code2(); + void copy_properties(); +}; + +extern Fl_Menu_Item button_type_menu[]; + +#include +class Fl_Menu_Button_Type : public Fl_Menu_Type { + Fl_Menu_Item *subtypes() {return button_type_menu;} +public: + virtual void ideal_size(int &w, int &h) { + Fl_Widget_Type::ideal_size(w, h); + w += 2 * ((o->labelsize() - 3) & ~1) + o->labelsize() - 4; + h = (h / 5) * 5; + if (h < 15) h = 15; + if (w < (15 + h)) w = 15 + h; + } + virtual const char *type_name() {return "Fl_Menu_Button";} + Fl_Widget *widget(int X,int Y,int W,int H) { + return new Fl_Menu_Button(X,Y,W,H,"menu");} + Fl_Widget_Type *_make() {return new Fl_Menu_Button_Type();} + int pixmapID() { return 26; } +}; + +extern Fl_Menu_Item dummymenu[]; + +#include +class Fl_Choice_Type : public Fl_Menu_Type { +public: + virtual void ideal_size(int &w, int &h) { + Fl_Widget_Type::ideal_size(w, h); + int w1 = o->h() - Fl::box_dh(o->box()); + if (w1 > 20) w1 = 20; + w1 = (w1 - 4) / 3; + if (w1 < 1) w1 = 1; + w += 2 * w1 + o->labelsize() - 4; + h = (h / 5) * 5; + if (h < 15) h = 15; + if (w < (15 + h)) w = 15 + h; + } + virtual const char *type_name() {return "Fl_Choice";} + Fl_Widget *widget(int X,int Y,int W,int H) { + Fl_Choice *myo = new Fl_Choice(X,Y,W,H,"choice:"); + myo->menu(dummymenu); + return myo; + } + Fl_Widget_Type *_make() {return new Fl_Choice_Type();} + int pixmapID() { return 15; } +}; + +#include +class Fl_Input_Choice_Type : public Fl_Menu_Type { + int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { + Fl_Input_Choice *myo = (Fl_Input_Choice*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o); + switch (w) { + case 4: + case 0: f = (Fl_Font)myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break; + case 1: myo->textfont(f); break; + case 2: myo->textsize(s); break; + case 3: myo->textcolor(c); break; + } + return 1; + } +public: + virtual void ideal_size(int &w, int &h) { + Fl_Input_Choice *myo = (Fl_Input_Choice *)o; + fl_font(myo->textfont(), myo->textsize()); + h = fl_height() + myo->textsize() - 6; + w = o->w() - 20 - Fl::box_dw(o->box()); + int ww = (int)fl_width('m'); + w = ((w + ww - 1) / ww) * ww + 20 + Fl::box_dw(o->box()); + if (h < 15) h = 15; + if (w < (15 + h)) w = 15 + h; + } + virtual const char *type_name() {return "Fl_Input_Choice";} + virtual Fl_Type* click_test(int,int); + Fl_Widget *widget(int X,int Y,int W,int H) { + Fl_Input_Choice *myo = new Fl_Input_Choice(X,Y,W,H,"input choice:"); + myo->menu(dummymenu); + myo->value("input"); + return myo; + } + Fl_Widget_Type *_make() {return new Fl_Input_Choice_Type();} + virtual void build_menu(); + int pixmapID() { return 15; } + void copy_properties(); +}; + +#include +#include +class Fl_Menu_Bar_Type : public Fl_Menu_Type { +public: + virtual void ideal_size(int &w, int &h) { + w = o->window()->w(); + h = ((o->labelsize() + Fl::box_dh(o->box()) + 4) / 5) * 5; + if (h < 15) h = 15; + } + virtual const char *type_name() {return "Fl_Menu_Bar";} + Fl_Widget *widget(int X,int Y,int W,int H) {return new Fl_Menu_Bar(X,Y,W,H);} + Fl_Widget_Type *_make() {return new Fl_Menu_Bar_Type();} + int pixmapID() { return 17; } +}; +// object list operations: +Fl_Widget *make_widget_browser(int X,int Y,int W,int H); +extern int modflag; +void delete_all(int selected_only=0); +void selection_changed(Fl_Type* new_current); +void reveal_in_browser(Fl_Type*); +int has_toplevel_function(const char *rtype, const char *sig); + +// file operations: +# ifdef __GNUC__ +# define __fl_attr(x) __attribute__ (x) +# else +# define __fl_attr(x) +# endif // __GNUC__ + +void write_word(const char *); +void write_string(const char *,...) __fl_attr((__format__ (__printf__, 1, 2))); +int write_file(const char *, int selected_only = 0); +int write_code(const char *cfile, const char *hfile); +int write_strings(const char *sfile); + +int write_declare(const char *, ...) __fl_attr((__format__ (__printf__, 1, 2))); +int is_id(char); +const char* unique_id(void* o, const char*, const char*, const char*); +void write_c(const char*, ...) __fl_attr((__format__ (__printf__, 1, 2))); +void write_h(const char*, ...) __fl_attr((__format__ (__printf__, 1, 2))); +void write_cstring(const char *); +void write_cstring(const char *,int length); +void write_cdata(const char *,int length); +void write_indent(int n); +void write_open(int); +void write_close(int n); +extern int write_number; +extern int write_sourceview; +void write_public(int state); // writes pubic:/private: as needed +extern int indentation; +extern const char* indent(); + +int read_file(const char *, int merge); +const char *read_word(int wantbrace = 0); +void read_error(const char *format, ...); + +// check legality of c code (sort of) and return error: +const char *c_check(const char *c, int type = 0); + +// replace a string pointer with new value, strips leading/trailing blanks: +int storestring(const char *n, const char * & p, int nostrip=0); + +extern int include_H_from_C; +extern int use_FL_COMMAND; + +// +// End of "$Id: Fl_Type.h 6012 2008-01-04 21:45:49Z matt $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/Fl_Widget_Type.cxx b/third_party/windows/fltk-1.1.10/fluid/Fl_Widget_Type.cxx new file mode 100644 index 0000000..83172d2 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/Fl_Widget_Type.cxx @@ -0,0 +1,2745 @@ +// +// "$Id: Fl_Widget_Type.cxx 6801 2009-06-28 22:09:25Z matt $" +// +// Widget type code for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2006 by Bill Spitzak and others. +// +// 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 +#include +#include +#include "Fl_Widget_Type.h" +#include "alignment_panel.h" +#include +#include +#include +#include +#include "../src/flstring.h" +#include +#include + +// Make an Fl_Widget_Type subclass instance. +// It figures out the automatic size and parent of the new widget, +// creates the Fl_Widget (by calling the virtual function _make), +// adds it to the Fl_Widget hierarchy, creates a new Fl_Type +// instance, sets the widget pointers, and makes all the display +// update correctly... + +extern int reading_file; +int force_parent; +extern int gridx; +extern int gridy; +extern int i18n_type; +extern const char* i18n_include; +extern const char* i18n_function; +extern const char* i18n_file; +extern const char* i18n_set; + +int Fl_Widget_Type::default_size = FL_NORMAL_SIZE; + +int Fl_Widget_Type::is_widget() const {return 1;} +int Fl_Widget_Type::is_public() const {return public_;} + +const char* subclassname(Fl_Type* l) { + if (l->is_widget()) { + Fl_Widget_Type* p = (Fl_Widget_Type*)l; + const char* c = p->subclass(); + if (c) return c; + if (l->is_class()) return "Fl_Group"; + if (p->o->type() == FL_WINDOW+1) return "Fl_Double_Window"; + } + return l->type_name(); +} + +// Return the ideal widget size... +void +Fl_Widget_Type::ideal_size(int &w, int &h) { + h = o->labelsize(); + o->measure_label(w, h); + + w += Fl::box_dw(o->box()); + h += Fl::box_dh(o->box()); + + if (w < 15) w = 15; + if (h < 15) h = 15; +} + +// Return the ideal widget spacing... +void +Fl_Widget_Type::ideal_spacing(int &x, int &y) { + if (o->labelsize() < 10) + x = y = 0; + else if (o->labelsize() < 14) + x = y = 5; + else + x = y = 10; +} + +Fl_Type *Fl_Widget_Type::make() { + // Find the current widget, or widget to copy: + Fl_Type *qq = Fl_Type::current; + while (qq && (!qq->is_widget() || qq->is_menu_item())) qq = qq->parent; + if (!qq) { + fl_message("Please select a widget"); + return 0; + } + Fl_Widget_Type* q = (Fl_Widget_Type*)qq; + // find the parent widget: + Fl_Widget_Type* p = q; + if ((force_parent || !p->is_group()) && p->parent->is_widget()) + p = (Fl_Widget_Type*)(p->parent); + force_parent = 0; + + // Figure out a border between widget and window: + int B = p->o->w()/2; if (p->o->h()/2 < B) B = p->o->h()/2; if (B>25) B = 25; + + int ULX,ULY; // parent's origin in window + if (!p->is_window()) { // if it is a group, add corner + ULX = p->o->x(); ULY = p->o->y(); + } else { + ULX = ULY = 0; + } + + // Figure out a position and size for the widget + int X,Y,W,H; + if (is_group()) { // fill the parent with the widget + X = ULX+B; + W = p->o->w()-B; + Y = ULY+B; + H = p->o->h()-B; + } else if (q != p) { // copy position and size of current widget + W = q->o->w(); + H = q->o->h(); + X = q->o->x()+W; + Y = q->o->y(); + if (X+W > ULX+p->o->w()) { + X = q->o->x(); + Y = q->o->y()+H; + if (Y+H > ULY+p->o->h()) Y = ULY+B; + } + } else { // just make it small and square... + X = ULX+B; + Y = ULY+B; + W = H = B; + } + + // satisfy the grid requirements (otherwise it edits really strangely): + if (gridx>1) { + X = (X/gridx)*gridx; + W = ((W-1)/gridx+1)*gridx; + } + if (gridy>1) { + Y = (Y/gridy)*gridy; + H = ((H-1)/gridy+1)*gridy; + } + + // Construct the Fl_Type: + Fl_Widget_Type *t = _make(); + if (!o) o = widget(0,0,100,100); // create template widget + t->factory = this; + // Construct the Fl_Widget: + t->o = widget(X,Y,W,H); + if (reading_file) t->o->label(0); + else if (t->o->label()) t->label(t->o->label()); // allow editing + t->o->user_data((void*)t); + // Put it in the parent: + // ((Fl_Group *)(p->o))->add(t->o); (done by Fl_Type::add()) + // add to browser: + t->add(p); + t->redraw(); + return t; +} + +#include "Fluid_Image.h" + +void Fl_Widget_Type::setimage(Fluid_Image *i) { + if (i == image || is_window()) return; + if (image) image->decrement(); + if (i) i->increment(); + image = i; + if (i) i->image(o); + else o->image(0); + redraw(); +} + +void Fl_Widget_Type::setinactive(Fluid_Image *i) { + if (i == inactive || is_window()) return; + if (inactive) inactive->decrement(); + if (i) i->increment(); + inactive = i; + if (i) i->deimage(o); + else o->deimage(0); + redraw(); +} + +void Fl_Widget_Type::setlabel(const char *n) { + o->label(n); + redraw(); +} + +Fl_Widget_Type::Fl_Widget_Type() { + for (int n=0; nhide(); + if (o->parent()) ((Fl_Group*)o->parent())->remove(*o); + delete o; + } +} + +void Fl_Widget_Type::extra_code(int m,const char *n) { + storestring(n,extra_code_[m]); +} + +extern void redraw_browser(); +void Fl_Widget_Type::subclass(const char *n) { + if (storestring(n,subclass_) && visible) + redraw_browser(); +} + +void Fl_Widget_Type::tooltip(const char *n) { + storestring(n,tooltip_); + o->tooltip(n); +} + +void Fl_Widget_Type::image_name(const char *n) { + setimage(Fluid_Image::find(n)); + storestring(n,image_name_); +} + +void Fl_Widget_Type::inactive_name(const char *n) { + setinactive(Fluid_Image::find(n)); + storestring(n,inactive_name_); +} + +void Fl_Widget_Type::redraw() { + Fl_Type *t = this; + if (is_menu_item()) { + // find the menu button that parents this menu: + do t = t->parent; while (t && t->is_menu_item()); + // kludge to cause build_menu to be called again: + t->add_child(0,0); + } else { + while (t->parent && t->parent->is_widget()) t = t->parent; + ((Fl_Widget_Type*)t)->o->redraw(); + } +} + +// the recursive part sorts all children, returns pointer to next: +Fl_Type *sort(Fl_Type *parent) { + Fl_Type *f,*n=0; + for (f = parent ? parent->next : Fl_Type::first; ; f = n) { + if (!f || parent && f->level <= parent->level) return f; + n = sort(f); + if (!f->selected || (!f->is_widget() || f->is_menu_item())) continue; + Fl_Widget* fw = ((Fl_Widget_Type*)f)->o; + Fl_Type *g; // we will insert before this + for (g = parent->next; g != f; g = g->next) { + if (!g->selected || g->level > f->level) continue; + Fl_Widget* gw = ((Fl_Widget_Type*)g)->o; + if (gw->y() > fw->y()) break; + if (gw->y() == fw->y() && gw->x() > fw->x()) break; + } + if (g != f) f->move_before(g); + } +} + +//////////////////////////////////////////////////////////////// +// The control panels! + +#include "widget_panel.h" +#include + +static Fl_Window *the_panel; + +// All the callbacks use the argument to indicate whether to load or store. +// This avoids the need for pointers to all the widgets, and keeps the +// code localized in the callbacks. +// A value of LOAD means to load. The hope is that this will not collide +// with any actual useful values for the argument. I also use this to +// initialized parts of the widget that are nyi by fluid. + +Fl_Widget_Type *current_widget; // one of the selected ones +static int numselected; // number selected +static int haderror; + +void name_cb(Fl_Input* o, void *v) { + if (v == LOAD) { + static char buf[1024]; + if (numselected != 1) { + snprintf(buf, sizeof(buf), "Widget Properties (%d widgets)", numselected); + o->hide(); + } else { + o->static_value(current_widget->name()); + o->show(); + snprintf(buf, sizeof(buf), "%s Properties", current_widget->title()); + } + + the_panel->label(buf); + } else { + if (numselected == 1) { + current_widget->name(o->value()); + // I don't update window title, as it probably is being closed + // and wm2 (a window manager) barfs if you retitle and then + // hide a window: + // ((Fl_Window*)(o->parent()->parent()->parent()))->label(current_widget->title()); + } + } +} + +void name_public_member_cb(Fl_Choice* i, void* v) { + if (v == LOAD) { + i->value(current_widget->public_); + if (current_widget->is_in_class()) i->show(); else i->hide(); + } else { + int mod = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type *w = ((Fl_Widget_Type*)o); + if (w->is_in_class()) { + w->public_ = i->value(); + } else { + // if this is not in a class, it can be only private or public + w->public_ = (i->value()>0); + } + mod = 1; + } + } + if (mod) { + set_modflag(1); + redraw_browser(); + } + } +} + +void name_public_cb(Fl_Choice* i, void* v) { + if (v == LOAD) { + i->value(current_widget->public_>0); + if (current_widget->is_in_class()) i->hide(); else i->show(); + } else { + int mod = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + ((Fl_Widget_Type*)o)->public_ = i->value(); + mod = 1; + } + } + if (mod) { + set_modflag(1); + redraw_browser(); + } + } +} + +static char* oldlabel; +static unsigned oldlabellen; + +void label_cb(Fl_Input* i, void *v) { + if (v == LOAD) { + i->static_value(current_widget->label()); + if (strlen(i->value()) >= oldlabellen) { + oldlabellen = strlen(i->value())+128; + oldlabel = (char*)realloc(oldlabel,oldlabellen); + } + strcpy(oldlabel,i->value()); + } else { + int mod = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + o->label(i->value()); + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +static Fl_Input *image_input; + +void image_cb(Fl_Input* i, void *v) { + if (v == LOAD) { + image_input = i; + if (current_widget->is_widget() && !current_widget->is_window()) { + i->activate(); + i->static_value(((Fl_Widget_Type*)current_widget)->image_name()); + } else i->deactivate(); + } else { + int mod = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + ((Fl_Widget_Type*)o)->image_name(i->value()); + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +void image_browse_cb(Fl_Button* b, void *v) { + if (v == LOAD) { + if (current_widget->is_widget() && !current_widget->is_window()) + b->activate(); + else + b->deactivate(); + } else { + int mod = 0; + if (ui_find_image(image_input->value())) { + image_input->value(ui_find_image_name); + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + ((Fl_Widget_Type*)o)->image_name(ui_find_image_name); + mod = 1; + } + } + if (mod) set_modflag(1); + } + } +} + +static Fl_Input *inactive_input; + +void inactive_cb(Fl_Input* i, void *v) { + if (v == LOAD) { + inactive_input = i; + if (current_widget->is_widget() && !current_widget->is_window()) { + i->activate(); + i->static_value(((Fl_Widget_Type*)current_widget)->inactive_name()); + } else i->deactivate(); + } else { + int mod = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + ((Fl_Widget_Type*)o)->inactive_name(i->value()); + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +void inactive_browse_cb(Fl_Button* b, void *v) { + if (v == LOAD) { + if (current_widget->is_widget() && !current_widget->is_window()) + b->activate(); + else + b->deactivate(); + } else { + int mod = 0; + if (ui_find_image(inactive_input->value())) { + inactive_input->value(ui_find_image_name); + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + ((Fl_Widget_Type*)o)->inactive_name(ui_find_image_name); + mod = 1; + } + } + if (mod) set_modflag(1); + } + } +} + +void tooltip_cb(Fl_Input* i, void *v) { + if (v == LOAD) { + if (current_widget->is_widget()) { + i->activate(); + i->static_value(((Fl_Widget_Type*)current_widget)->tooltip()); + } else i->deactivate(); + } else { + int mod = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + ((Fl_Widget_Type*)o)->tooltip(i->value()); + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +Fl_Value_Input *x_input, *y_input, *w_input, *h_input; + +void x_cb(Fl_Value_Input *i, void *v) { + if (v == LOAD) { + x_input = i; + if (current_widget->is_widget()) { + i->value(((Fl_Widget_Type *)current_widget)->o->x()); + x_input->activate(); + } else x_input->deactivate(); + } else { + int mod = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + w->resize((int)i->value(), w->y(), w->w(), w->h()); + if (w->window()) w->window()->redraw(); + if (o->is_window()) { + ((Fl_Window *)w)->size_range(gridx, gridy, Fl::w(), Fl::h(), + gridx, gridy, 0); + } + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +void y_cb(Fl_Value_Input *i, void *v) { + if (v == LOAD) { + y_input = i; + if (current_widget->is_widget()) { + i->value(((Fl_Widget_Type *)current_widget)->o->y()); + y_input->activate(); + } else y_input->deactivate(); + } else { + int mod = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + w->resize(w->x(), (int)i->value(), w->w(), w->h()); + if (w->window()) w->window()->redraw(); + if (o->is_window()) { + ((Fl_Window *)w)->size_range(gridx, gridy, Fl::w(), Fl::h(), + gridx, gridy, 0); + } + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +void w_cb(Fl_Value_Input *i, void *v) { + if (v == LOAD) { + w_input = i; + if (current_widget->is_widget()) { + i->value(((Fl_Widget_Type *)current_widget)->o->w()); + w_input->activate(); + } else w_input->deactivate(); + } else { + int mod = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + w->resize(w->x(), w->y(), (int)i->value(), w->h()); + if (w->window()) w->window()->redraw(); + if (o->is_window()) { + ((Fl_Window *)w)->size_range(gridx, gridy, Fl::w(), Fl::h(), + gridx, gridy, 0); + } + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +void h_cb(Fl_Value_Input *i, void *v) { + if (v == LOAD) { + h_input = i; + if (current_widget->is_widget()) { + i->value(((Fl_Widget_Type *)current_widget)->o->h()); + h_input->activate(); + } else h_input->deactivate(); + } else { + int mod = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + w->resize(w->x(), w->y(), w->w(), (int)i->value()); + if (w->window()) w->window()->redraw(); + if (o->is_window()) { + ((Fl_Window *)w)->size_range(gridx, gridy, Fl::w(), Fl::h(), + gridx, gridy, 0); + } + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +void wc_relative_cb(Fl_Light_Button *i, void *v) { + if (v == LOAD) { + if (!strcmp(current_widget->type_name(), "widget_class")) { + i->show(); + i->value(((Fl_Widget_Class_Type *)current_widget)->wc_relative); + } else { + i->hide(); + } + } else { + int mod = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && !strcmp(current_widget->type_name(), "widget_class")) { + Fl_Widget_Class_Type *t = (Fl_Widget_Class_Type *)o; + t->wc_relative = i->value(); + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +//////////////////////////////////////////////////////////////// + +// turn number to string or string to number for saving to file: +// does not work for hierarchial menus! + +const char *item_name(Fl_Menu_Item* m, int i) { + if (m) { + while (m->label()) { + if (m->argument() == i) return m->label(); + m++; + } + } + static char buffer[20]; + sprintf(buffer, "%d", i); + return buffer; +} +int item_number(Fl_Menu_Item* m, const char* i) { + if (m && i) { + if (i[0]=='F' && i[1]=='L' && i[2]=='_') i += 3; + while (m->label()) { + if (!strcmp(m->label(), i)) return int(m->argument()); + m++; + } + } + return atoi(i); +} + +#define ZERO_ENTRY 1000 + +Fl_Menu_Item boxmenu[] = { +{"NO_BOX",0,0,(void *)ZERO_ENTRY}, +{"boxes",0,0,0,FL_SUBMENU}, +{"UP_BOX",0,0,(void *)FL_UP_BOX}, +{"DOWN_BOX",0,0,(void *)FL_DOWN_BOX}, +{"FLAT_BOX",0,0,(void *)FL_FLAT_BOX}, +{"BORDER_BOX",0,0,(void *)FL_BORDER_BOX}, +{"THIN_UP_BOX",0,0,(void *)FL_THIN_UP_BOX}, +{"THIN_DOWN_BOX",0,0,(void *)FL_THIN_DOWN_BOX}, +{"ENGRAVED_BOX",0,0,(void *)FL_ENGRAVED_BOX}, +{"EMBOSSED_BOX",0,0,(void *)FL_EMBOSSED_BOX}, +{"ROUND_UP_BOX",0,0,(void *)FL_ROUND_UP_BOX}, +{"ROUND_DOWN_BOX",0,0,(void *)FL_ROUND_DOWN_BOX}, +{"DIAMOND_UP_BOX",0,0,(void *)FL_DIAMOND_UP_BOX}, +{"DIAMOND_DOWN_BOX",0,0,(void *)FL_DIAMOND_DOWN_BOX}, +{"SHADOW_BOX",0,0,(void *)FL_SHADOW_BOX}, +{"ROUNDED_BOX",0,0,(void *)FL_ROUNDED_BOX}, +{"RSHADOW_BOX",0,0,(void *)FL_RSHADOW_BOX}, +{"RFLAT_BOX",0,0,(void *)FL_RFLAT_BOX}, +{"OVAL_BOX",0,0,(void *)FL_OVAL_BOX}, +{"OSHADOW_BOX",0,0,(void *)FL_OSHADOW_BOX}, +{"OFLAT_BOX",0,0,(void *)FL_OFLAT_BOX}, +{"PLASTIC_UP_BOX",0,0,(void *)FL_PLASTIC_UP_BOX}, +{"PLASTIC_DOWN_BOX",0,0,(void *)FL_PLASTIC_DOWN_BOX}, +{"PLASTIC_THIN_UP_BOX",0,0,(void *)FL_PLASTIC_THIN_UP_BOX}, +{"PLASTIC_THIN_DOWN_BOX",0,0,(void *)FL_PLASTIC_THIN_DOWN_BOX}, +{"PLASTIC_ROUND_UP_BOX",0,0,(void *)FL_PLASTIC_ROUND_UP_BOX}, +{"PLASTIC_ROUND_DOWN_BOX",0,0,(void *)FL_PLASTIC_ROUND_DOWN_BOX}, +{"GTK_UP_BOX",0,0,(void *)FL_GTK_UP_BOX}, +{"GTK_DOWN_BOX",0,0,(void *)FL_GTK_DOWN_BOX}, +{"GTK_THIN_UP_BOX",0,0,(void *)FL_GTK_THIN_UP_BOX}, +{"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}, +{0}, +{"frames",0,0,0,FL_SUBMENU}, +{"UP_FRAME",0,0,(void *)FL_UP_FRAME}, +{"DOWN_FRAME",0,0,(void *)FL_DOWN_FRAME}, +{"THIN_UP_FRAME",0,0,(void *)FL_THIN_UP_FRAME}, +{"THIN_DOWN_FRAME",0,0,(void *)FL_THIN_DOWN_FRAME}, +{"ENGRAVED_FRAME",0,0,(void *)FL_ENGRAVED_FRAME}, +{"EMBOSSED_FRAME",0,0,(void *)FL_EMBOSSED_FRAME}, +{"BORDER_FRAME",0,0,(void *)FL_BORDER_FRAME}, +{"SHADOW_FRAME",0,0,(void *)FL_SHADOW_FRAME}, +{"ROUNDED_FRAME",0,0,(void *)FL_ROUNDED_FRAME}, +{"OVAL_FRAME",0,0,(void *)FL_OVAL_FRAME}, +{"PLASTIC_UP_FRAME",0,0,(void *)FL_PLASTIC_UP_FRAME}, +{"PLASTIC_DOWN_FRAME",0,0,(void *)FL_PLASTIC_DOWN_FRAME}, +{"GTK_UP_FRAME",0,0,(void *)FL_GTK_UP_FRAME}, +{"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}, +{0}, +{0}}; + +const char *boxname(int i) { + if (!i) i = ZERO_ENTRY; + for (int j = 0; j < int(sizeof(boxmenu)/sizeof(*boxmenu)); j++) + if (boxmenu[j].argument() == i) return boxmenu[j].label(); + return 0; +} + +int boxnumber(const char *i) { + if (i[0]=='F' && i[1]=='L' && i[2]=='_') i += 3; + for (int j = 0; j < int(sizeof(boxmenu)/sizeof(*boxmenu)); j++) + if (boxmenu[j].label() && !strcmp(boxmenu[j].label(), i)) { + return int(boxmenu[j].argument()); + } + return 0; +} + +void box_cb(Fl_Choice* i, void *v) { + if (v == LOAD) { + if (current_widget->is_menu_item()) {i->deactivate(); return;} else i->activate(); + int n = current_widget->o->box(); if (!n) n = ZERO_ENTRY; + for (int j = 0; j < int(sizeof(boxmenu)/sizeof(*boxmenu)); j++) + if (boxmenu[j].argument() == n) {i->value(j); break;} + } else { + int mod = 0; + int m = i->value(); + int n = int(boxmenu[m].argument()); + if (!n) return; // should not happen + if (n == ZERO_ENTRY) n = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->box((Fl_Boxtype)n); + q->redraw(); + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +void down_box_cb(Fl_Choice* i, void *v) { + if (v == LOAD) { + int n; + if (current_widget->is_button() && !current_widget->is_menu_item()) + n = ((Fl_Button*)(current_widget->o))->down_box(); + else if (!strcmp(current_widget->type_name(), "Fl_Input_Choice")) + n = ((Fl_Input_Choice*)(current_widget->o))->down_box(); + else if (current_widget->is_menu_button()) + n = ((Fl_Menu_*)(current_widget->o))->down_box(); + else { + i->deactivate(); return; + } + i->activate(); + if (!n) n = ZERO_ENTRY; + for (int j = 0; j < int(sizeof(boxmenu)/sizeof(*boxmenu)); j++) + if (boxmenu[j].argument() == n) {i->value(j); break;} + } else { + int mod = 0; + int m = i->value(); + int n = int(boxmenu[m].argument()); + if (!n) return; // should not happen + if (n == ZERO_ENTRY) n = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected) { + if (o->is_button() && !o->is_menu_item()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + ((Fl_Button*)(q->o))->down_box((Fl_Boxtype)n); + if (((Fl_Button*)(q->o))->value()) q->redraw(); + } else if (!strcmp(o->type_name(), "Fl_Input_Choice")) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + ((Fl_Input_Choice*)(q->o))->down_box((Fl_Boxtype)n); + } else if (o->is_menu_button()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + ((Fl_Menu_*)(q->o))->down_box((Fl_Boxtype)n); + } + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +//////////////////////////////////////////////////////////////// + +Fl_Menu_Item whenmenu[] = { + {"Never",0,0,(void*)ZERO_ENTRY}, + {"Release",0,0,(void*)FL_WHEN_RELEASE}, + {"Changed",0,0,(void*)FL_WHEN_CHANGED}, + {"Enter key",0,0,(void*)FL_WHEN_ENTER_KEY}, + //{"Release or Enter",0,0,(void*)(FL_WHEN_ENTER_KEY|FL_WHEN_RELEASE)}, + {0}}; + +static Fl_Menu_Item whensymbolmenu[] = { + {"FL_WHEN_NEVER",0,0,(void*)(FL_WHEN_NEVER)}, + {"FL_WHEN_CHANGED",0,0,(void*)(FL_WHEN_CHANGED)}, + {"FL_WHEN_RELEASE",0,0,(void*)(FL_WHEN_RELEASE)}, + {"FL_WHEN_RELEASE_ALWAYS",0,0,(void*)(FL_WHEN_RELEASE_ALWAYS)}, + {"FL_WHEN_ENTER_KEY",0,0,(void*)(FL_WHEN_ENTER_KEY)}, + {"FL_WHEN_ENTER_KEY_ALWAYS",0,0,(void*)(FL_WHEN_ENTER_KEY_ALWAYS)}, + {0}}; + +void when_cb(Fl_Choice* i, void *v) { + if (v == LOAD) { + if (current_widget->is_menu_item()) {i->deactivate(); return;} else i->activate(); + int n = current_widget->o->when() & (~FL_WHEN_NOT_CHANGED); + if (!n) n = ZERO_ENTRY; + for (int j = 0; j < int(sizeof(whenmenu)/sizeof(*whenmenu)); j++) + if (whenmenu[j].argument() == n) {i->value(j); break;} + } else { + int mod = 0; + int m = i->value(); + int n = int(whenmenu[m].argument()); + if (!n) return; // should not happen + if (n == ZERO_ENTRY) n = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->when(n|(q->o->when()&FL_WHEN_NOT_CHANGED)); + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +void when_button_cb(Fl_Light_Button* i, void *v) { + if (v == LOAD) { + if (current_widget->is_menu_item()) {i->deactivate(); return;} else i->activate(); + i->value(current_widget->o->when()&FL_WHEN_NOT_CHANGED); + } else { + int mod = 0; + int n = i->value() ? FL_WHEN_NOT_CHANGED : 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->when(n|(q->o->when()&~FL_WHEN_NOT_CHANGED)); + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +uchar Fl_Widget_Type::resizable() const { + if (is_window()) return ((Fl_Window*)o)->resizable() != 0; + Fl_Group* p = (Fl_Group*)o->parent(); + if (p) return p->resizable() == o; + else return 0; +} + +void Fl_Widget_Type::resizable(uchar v) { + if (v) { + if (resizable()) return; + if (is_window()) ((Fl_Window*)o)->resizable(o); + else { + Fl_Group* p = (Fl_Group*)o->parent(); + if (p) p->resizable(o); + } + } else { + if (!resizable()) return; + if (is_window()) { + ((Fl_Window*)o)->resizable(0); + } else { + Fl_Group* p = (Fl_Group*)o->parent(); + if (p) p->resizable(0); + } + } +} + +void resizable_cb(Fl_Light_Button* i,void* v) { + if (v == LOAD) { + if (current_widget->is_menu_item()) {i->deactivate(); return;} + if (numselected > 1) {i->deactivate(); return;} + i->activate(); + i->value(current_widget->resizable()); + } else { + current_widget->resizable(i->value()); + set_modflag(1); + } +} + +void hotspot_cb(Fl_Light_Button* i,void* v) { + if (v == LOAD) { + if (numselected > 1) {i->deactivate(); return;} + if (current_widget->is_menu_item()) i->label("divider"); + else i->label("hotspot"); + i->activate(); + i->value(current_widget->hotspot()); + } else { + current_widget->hotspot(i->value()); + if (current_widget->is_menu_item()) {current_widget->redraw(); return;} + if (i->value()) { + Fl_Type *p = current_widget->parent; + if (!p || !p->is_widget()) return; + while (!p->is_window()) p = p->parent; + for (Fl_Type *o = p->next; o && o->level > p->level; o = o->next) { + if (o->is_widget() && o != current_widget) + ((Fl_Widget_Type*)o)->hotspot(0); + } + } + set_modflag(1); + } +} + +void visible_cb(Fl_Light_Button* i, void* v) { + if (v == LOAD) { + i->value(current_widget->o->visible()); + if (current_widget->is_window()) i->deactivate(); + else i->activate(); + } else { + int mod = 0; + int n = i->value(); + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + n ? q->o->show() : q->o->hide(); + q->redraw(); + mod = 1; + if (n && q->parent && q->parent->type_name()) { + if (!strcmp(q->parent->type_name(), "Fl_Tabs")) { + ((Fl_Tabs *)q->o->parent())->value(q->o); + } else if (!strcmp(q->parent->type_name(), "Fl_Wizard")) { + ((Fl_Wizard *)q->o->parent())->value(q->o); + } + } + } + } + if (mod) set_modflag(1); + } +} + +void active_cb(Fl_Light_Button* i, void* v) { + if (v == LOAD) { + i->value(current_widget->o->active()); + if (current_widget->is_window()) i->deactivate(); + else i->activate(); + } else { + int mod = 0; + int n = i->value(); + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + n ? q->o->activate() : q->o->deactivate(); + q->redraw(); + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +//////////////////////////////////////////////////////////////// + +Fl_Menu_Item fontmenu[] = { +{"Helvetica"}, +{"Helvetica bold"}, +{"Helvetica italic"}, +{"Helvetica bold italic"}, +{"Courier"}, +{"Courier bold"}, +{"Courier italic"}, +{"Courier bold italic"}, +{"Times"}, +{"Times bold"}, +{"Times italic"}, +{"Times bold italic"}, +{"Symbol"}, +{"Terminal"}, +{"Terminal Bold"}, +{"Zapf Dingbats"}, +{0}}; + +void labelfont_cb(Fl_Choice* i, void *v) { + if (v == LOAD) { + int n = current_widget->o->labelfont(); + if (n > 15) n = 0; + i->value(n); + } else { + int mod = 0; + int n = i->value(); + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->labelfont(n); + q->redraw(); + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +void labelsize_cb(Fl_Value_Input* i, void *v) { + int n; + if (v == LOAD) { + n = current_widget->o->labelsize(); + } else { + int mod = 0; + n = int(i->value()); + if (n <= 0) n = Fl_Widget_Type::default_size; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->labelsize(n); + q->redraw(); + mod = 1; + } + } + if (mod) set_modflag(1); + } + i->value(n); +} + +extern const char *ui_find_image_name; + +Fl_Menu_Item labeltypemenu[] = { + {"NORMAL_LABEL",0,0,(void*)0}, + {"SHADOW_LABEL",0,0,(void*)FL_SHADOW_LABEL}, + {"ENGRAVED_LABEL",0,0,(void*)FL_ENGRAVED_LABEL}, + {"EMBOSSED_LABEL",0,0,(void*)FL_EMBOSSED_LABEL}, + {"NO_LABEL",0,0,(void*)(FL_NO_LABEL)}, +{0}}; + +void labeltype_cb(Fl_Choice* i, void *v) { + if (v == LOAD) { + int n; + n = current_widget->o->labeltype(); + i->when(FL_WHEN_RELEASE); + for (int j = 0; j < int(sizeof(labeltypemenu)/sizeof(*labeltypemenu)); j++) + if (labeltypemenu[j].argument() == n) {i->value(j); break;} + } else { + int mod = 0; + int m = i->value(); + int n = int(labeltypemenu[m].argument()); + if (n<0) return; // should not happen + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* p = (Fl_Widget_Type*)o; + p->o->labeltype((Fl_Labeltype)n); + p->redraw(); + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +//////////////////////////////////////////////////////////////// + +void color_cb(Fl_Button* i, void *v) { + Fl_Color c = current_widget->o->color(); + if (v == LOAD) { + if (current_widget->is_menu_item()) {i->deactivate(); return;} else i->activate(); + } else { + int mod = 0; + Fl_Color d = fl_show_colormap(c); + if (d == c) return; + c = d; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->color(c); q->o->redraw(); + if (q->parent && q->parent->type_name() == tabs_type_name) { + if (q->o->parent()) q->o->parent()->redraw(); + } + mod = 1; + } + } + if (mod) set_modflag(1); + } + i->color(c); i->labelcolor(fl_contrast(FL_BLACK,c)); i->redraw(); +} + +void color2_cb(Fl_Button* i, void *v) { + Fl_Color c = current_widget->o->selection_color(); + if (v == LOAD) { + if (current_widget->is_menu_item()) {i->deactivate(); return;} else i->activate(); + } else { + int mod = 0; + Fl_Color d = fl_show_colormap(c); + if (d == c) return; + c = d; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->selection_color(c); q->o->redraw(); + mod = 1; + } + } + if (mod) set_modflag(1); + } + i->color(c); i->labelcolor(fl_contrast(FL_BLACK,c)); i->redraw(); +} + +void labelcolor_cb(Fl_Button* i, void *v) { + Fl_Color c = current_widget->o->labelcolor(); + if (v != LOAD) { + int mod = 0; + Fl_Color d = fl_show_colormap(c); + if (d == c) return; + c = d; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->labelcolor(c); q->redraw(); + mod = 1; + } + } + if (mod) set_modflag(1); + } + i->color(c); i->labelcolor(fl_contrast(FL_BLACK,c)); i->redraw(); +} + +static Fl_Button* relative(Fl_Widget* o, int i) { + Fl_Group* g = (Fl_Group*)(o->parent()); + return (Fl_Button*)(g->child(g->find(*o)+i)); +} + +static Fl_Menu_Item alignmenu[] = { + {"FL_ALIGN_CENTER",0,0,(void*)(FL_ALIGN_CENTER)}, + {"FL_ALIGN_TOP",0,0,(void*)(FL_ALIGN_TOP)}, + {"FL_ALIGN_BOTTOM",0,0,(void*)(FL_ALIGN_BOTTOM)}, + {"FL_ALIGN_LEFT",0,0,(void*)(FL_ALIGN_LEFT)}, + {"FL_ALIGN_RIGHT",0,0,(void*)(FL_ALIGN_RIGHT)}, + {"FL_ALIGN_INSIDE",0,0,(void*)(FL_ALIGN_INSIDE)}, + {"FL_ALIGN_CLIP",0,0,(void*)(FL_ALIGN_CLIP)}, + {"FL_ALIGN_WRAP",0,0,(void*)(FL_ALIGN_WRAP)}, + {"FL_ALIGN_TEXT_OVER_IMAGE",0,0,(void*)(FL_ALIGN_TEXT_OVER_IMAGE)}, + {"FL_ALIGN_TOP_LEFT",0,0,(void*)(FL_ALIGN_TOP_LEFT)}, + {"FL_ALIGN_TOP_RIGHT",0,0,(void*)(FL_ALIGN_TOP_RIGHT)}, + {"FL_ALIGN_BOTTOM_LEFT",0,0,(void*)(FL_ALIGN_BOTTOM_LEFT)}, + {"FL_ALIGN_BOTTOM_RIGHT",0,0,(void*)(FL_ALIGN_BOTTOM_RIGHT)}, + {"FL_ALIGN_LEFT_TOP",0,0,(void*)(FL_ALIGN_LEFT_TOP)}, + {"FL_ALIGN_RIGHT_TOP",0,0,(void*)(FL_ALIGN_RIGHT_TOP)}, + {"FL_ALIGN_LEFT_BOTTOM",0,0,(void*)(FL_ALIGN_LEFT_BOTTOM)}, + {"FL_ALIGN_RIGHT_BOTTOM",0,0,(void*)(FL_ALIGN_RIGHT_BOTTOM)}, +{0}}; + +void align_cb(Fl_Button* i, void *v) { + int b = int(long(i->user_data())); + if (v == LOAD) { + if (current_widget->is_menu_item()) {i->deactivate(); return;} else i->activate(); + i->value(current_widget->o->align() & b); + } else { + int mod = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + int x = q->o->align(); + int y; + if (i->value()) { + y = x | b; + if (b == FL_ALIGN_LEFT || b == FL_ALIGN_TOP) { + Fl_Button *b1 = relative(i,+1); + b1->clear(); + y = y & ~(b1->argument()); + } + if (b == FL_ALIGN_RIGHT || b == FL_ALIGN_BOTTOM) { + Fl_Button *b1 = relative(i,-1); + b1->clear(); + y = y & ~(b1->argument()); + } + } else { + y = x & ~b; + } + if (x != y) { + q->o->align(y); + q->redraw(); + mod = 1; + } + } + } + if (mod) set_modflag(1); + } +} + +//////////////////////////////////////////////////////////////// + +void callback_cb(CodeEditor* i, void *v) { + if (v == LOAD) { + const char *cbtext = current_widget->callback(); + i->buffer()->text( cbtext ? cbtext : "" ); + } else { + int mod = 0; + char *c = i->buffer()->text(); + const char *d = c_check(c); + if (d) { + fl_message("Error in callback: %s",d); + if (i->window()) i->window()->make_current(); + haderror = 1; + } + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected) { + o->callback(c); + mod = 1; + } + } + if (mod) set_modflag(1); + free(c); + } +} + +void user_data_cb(Fl_Input *i, void *v) { + if (v == LOAD) { + i->static_value(current_widget->user_data()); + } else { + int mod = 0; + const char *c = i->value(); + const char *d = c_check(c); + if (d) {fl_message("Error in user_data: %s",d); haderror = 1; return;} + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected) { + o->user_data(c); + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +void user_data_type_cb(Fl_Input *i, void *v) { + static const char *dflt = "void*"; + if (v == LOAD) { + const char *c = current_widget->user_data_type(); + if (!c) c = dflt; + i->static_value(c); + } else { + int mod = 0; + const char *c = i->value(); + const char *d = c_check(c); + if (!*c) i->value(dflt); + else if (!strcmp(c,dflt)) c = 0; + if (!d) { + if (c && *c && c[strlen(c)-1] != '*' && strcmp(c,"long")) + d = "must be pointer or long"; + } + if (d) {fl_message("Error in type: %s",d); haderror = 1; return;} + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected) { + o->user_data_type(c); + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +// "v_attributes" let user type in random code for attribute settings: + +void v_input_cb(Fl_Input* i, void* v) { + int n = int(long(i->user_data())); + if (v == LOAD) { + i->static_value(current_widget->extra_code(n)); + } else { + int mod = 0; + const char *c = i->value(); + const char *d = c_check(c&&c[0]=='#' ? c+1 : c); + if (d) {fl_message("Error in %s: %s",i->label(),d); haderror = 1; return;} + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type *t = (Fl_Widget_Type*)o; + t->extra_code(n,c); + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +void subclass_cb(Fl_Input* i, void* v) { + if (v == LOAD) { + if (current_widget->is_menu_item()) {i->deactivate(); return;} else i->activate(); + i->static_value(current_widget->subclass()); + } else { + int mod = 0; + const char *c = i->value(); + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type *t = (Fl_Widget_Type*)o; + t->subclass(c); + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +//////////////////////////////////////////////////////////////// + +// textstuff: set textfont, textsize, textcolor attributes: + +// default widget returns 0 to indicate not-implemented: +int Fl_Widget_Type::textstuff(int, Fl_Font&, int&, Fl_Color&) {return 0;} + +void textfont_cb(Fl_Choice* i, void* v) { + Fl_Font n; int s; Fl_Color c; + if (v == LOAD) { + if (!current_widget->textstuff(0,n,s,c)) {i->deactivate(); return;} + i->activate(); + if (n > 15) n = FL_HELVETICA; + i->value(n); + } else { + int mod = 0; + n = (Fl_Font)i->value(); + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->textstuff(1,n,s,c); + q->o->redraw(); + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +void textsize_cb(Fl_Value_Input* i, void* v) { + Fl_Font n; int s; Fl_Color c; + if (v == LOAD) { + if (!current_widget->textstuff(0,n,s,c)) {i->deactivate(); return;} + i->activate(); + } else { + int mod = 0; + s = int(i->value()); + if (s <= 0) s = Fl_Widget_Type::default_size; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->textstuff(2,n,s,c); + q->o->redraw(); + mod = 1; + } + } + if (mod) set_modflag(1); + } + i->value(s); +} + +void textcolor_cb(Fl_Button* i, void* v) { + Fl_Font n; int s; Fl_Color c; + if (v == LOAD) { + if (!current_widget->textstuff(0,n,s,c)) {i->deactivate(); return;} + i->activate(); + } else { + int mod = 0; + c = i->color(); + Fl_Color d = fl_show_colormap(c); + if (d == c) return; + c = d; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->textstuff(3,n,s,c); q->o->redraw(); + mod = 1; + } + } + if (mod) set_modflag(1); + } + i->color(c); i->labelcolor(fl_contrast(FL_BLACK,c)); i->redraw(); +} + +//////////////////////////////////////////////////////////////// +// Kludges to the panel for subclasses: + +void min_w_cb(Fl_Value_Input* i, void* v) { + if (v == LOAD) { + if (!current_widget->is_window()) {i->parent()->hide(); return;} + i->parent()->show(); + i->value(((Fl_Window_Type*)current_widget)->sr_min_w); + } else { + int mod = 0; + int n = (int)i->value(); + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_window()) { + ((Fl_Window_Type*)current_widget)->sr_min_w = n; + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +void min_h_cb(Fl_Value_Input* i, void* v) { + if (v == LOAD) { + if (!current_widget->is_window()) return; + i->value(((Fl_Window_Type*)current_widget)->sr_min_h); + } else { + int mod = 0; + int n = (int)i->value(); + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_window()) { + ((Fl_Window_Type*)current_widget)->sr_min_h = n; + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +void max_w_cb(Fl_Value_Input* i, void* v) { + if (v == LOAD) { + if (!current_widget->is_window()) return; + i->value(((Fl_Window_Type*)current_widget)->sr_max_w); + } else { + int mod = 0; + int n = (int)i->value(); + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_window()) { + ((Fl_Window_Type*)current_widget)->sr_max_w = n; + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +void max_h_cb(Fl_Value_Input* i, void* v) { + if (v == LOAD) { + if (!current_widget->is_window()) return; + i->value(((Fl_Window_Type*)current_widget)->sr_max_h); + } else { + int mod = 0; + int n = (int)i->value(); + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_window()) { + ((Fl_Window_Type*)current_widget)->sr_max_h = n; + mod = 1; + } + } + if (mod) set_modflag(1); + } +} + +void set_min_size_cb(Fl_Button*, void* v) { + if (v == LOAD) { + } else { + int mod = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_window()) { + Fl_Window_Type *win = (Fl_Window_Type*)current_widget; + win->sr_min_w = win->o->w(); + win->sr_min_h = win->o->h(); + mod = 1; + } + } + propagate_load(the_panel, LOAD); + if (mod) set_modflag(1); + } +} + +void set_max_size_cb(Fl_Button*, void* v) { + if (v == LOAD) { + } else { + int mod = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_window()) { + Fl_Window_Type *win = (Fl_Window_Type*)current_widget; + win->sr_max_w = win->o->w(); + win->sr_max_h = win->o->h(); + mod = 1; + } + } + propagate_load(the_panel, LOAD); + if (mod) set_modflag(1); + } +} + +void slider_size_cb(Fl_Value_Input* i, void* v) { + if (v == LOAD) { + if (current_widget->is_window()) + i->parent()->hide(); + else + i->parent()->show(); + if (current_widget->is_valuator()<2) {i->deactivate(); return;} + i->activate(); + i->value(((Fl_Slider*)(current_widget->o))->slider_size()); + } else { + int mod = 0; + double n = i->value(); + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + if (q->is_valuator()>=2) { + ((Fl_Slider*)(q->o))->slider_size(n); + q->o->redraw(); + mod = 1; + } + } + } + if (mod) set_modflag(1); + } +} + +void min_cb(Fl_Value_Input* i, void* v) { + if (v == LOAD) { + if (current_widget->is_valuator()) { + i->activate(); + i->value(((Fl_Valuator*)(current_widget->o))->minimum()); + } else if (current_widget->is_spinner()) { + i->activate(); + i->value(((Fl_Spinner*)(current_widget->o))->minimum()); + } else { + i->deactivate(); + return; + } + } else { + int mod = 0; + double n = i->value(); + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + if (q->is_valuator()) { + ((Fl_Valuator*)(q->o))->minimum(n); + q->o->redraw(); + mod = 1; + } else if (q->is_spinner()) { + ((Fl_Spinner*)(q->o))->minimum(n); + q->o->redraw(); + mod = 1; + } + } + } + if (mod) set_modflag(1); + } +} + +void max_cb(Fl_Value_Input* i, void* v) { + if (v == LOAD) { + if (current_widget->is_valuator()) { + i->activate(); + i->value(((Fl_Valuator*)(current_widget->o))->maximum()); + } else if (current_widget->is_spinner()) { + i->activate(); + i->value(((Fl_Spinner*)(current_widget->o))->maximum()); + } else { + i->deactivate(); + return; + } + } else { + int mod = 0; + double n = i->value(); + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + if (q->is_valuator()) { + ((Fl_Valuator*)(q->o))->maximum(n); + q->o->redraw(); + mod = 1; + } else if (q->is_spinner()) { + ((Fl_Spinner*)(q->o))->maximum(n); + q->o->redraw(); + mod = 1; + } + } + } + if (mod) set_modflag(1); + } +} + +void step_cb(Fl_Value_Input* i, void* v) { + if (v == LOAD) { + if (current_widget->is_valuator()) { + i->activate(); + i->value(((Fl_Valuator*)(current_widget->o))->step()); + } else if (current_widget->is_spinner()) { + i->activate(); + i->value(((Fl_Spinner*)(current_widget->o))->step()); + } else { + i->deactivate(); + return; + } + } else { + int mod = 0; + double n = i->value(); + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + if (q->is_valuator()) { + ((Fl_Valuator*)(q->o))->step(n); + q->o->redraw(); + mod = 1; + } else if (q->is_spinner()) { + ((Fl_Spinner*)(q->o))->step(n); + q->o->redraw(); + mod = 1; + } + } + } + if (mod) set_modflag(1); + } +} + +void value_cb(Fl_Value_Input* i, void* v) { + if (v == LOAD) { + if (current_widget->is_valuator()) { + i->activate(); + i->value(((Fl_Valuator*)(current_widget->o))->value()); + } else if (current_widget->is_button()) { + i->activate(); + i->value(((Fl_Button*)(current_widget->o))->value()); + } else if (current_widget->is_spinner()) { + i->activate(); + i->value(((Fl_Spinner*)(current_widget->o))->value()); + } else + i->deactivate(); + } else { + int mod = 0; + double n = i->value(); + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + if (q->is_valuator()) { + ((Fl_Valuator*)(q->o))->value(n); + mod = 1; + } else if (q->is_button()) { + ((Fl_Button*)(q->o))->value(n != 0); + if (q->is_menu_item()) q->redraw(); + mod = 1; + } else if (q->is_spinner()) { + ((Fl_Spinner*)(q->o))->value(n); + mod = 1; + } + } + } + if (mod) set_modflag(1); + } +} + +//////////////////////////////////////////////////////////////// + +// subtypes: + +Fl_Menu_Item *Fl_Widget_Type::subtypes() {return 0;} + +void subtype_cb(Fl_Choice* i, void* v) { + if (v == LOAD) { + Fl_Menu_Item* m = current_widget->subtypes(); + if (!m) {i->deactivate(); return;} + i->menu(m); + int j; + for (j = 0;; j++) { + if (!m[j].text) {j = 0; break;} + if (current_widget->is_spinner()) { + if (m[j].argument() == ((Fl_Spinner*)current_widget->o)->type()) break; + } else { + if (m[j].argument() == current_widget->o->type()) break; + } + } + i->value(j); + i->activate(); + i->redraw(); + } else { + int mod = 0; + int n = int(i->mvalue()->argument()); + Fl_Menu_Item* m = current_widget->subtypes(); + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + if (q->subtypes()==m) { + if (q->is_spinner()) + ((Fl_Spinner*)q->o)->type(n); + else + q->o->type(n); + q->redraw(); + mod = 1; + } + } + } + if (mod) set_modflag(1); + } +} + +//////////////////////////////////////////////////////////////// + +void propagate_load(Fl_Group* g, void* v) { + if (v == LOAD) { + Fl_Widget*const* a = g->array(); + for (int i=g->children(); i--;) { + Fl_Widget* o = *a++; + o->do_callback(o,LOAD); + } + } +} + +void set_cb(Fl_Button*, void*) { + haderror = 0; + Fl_Widget*const* a = the_panel->array(); + for (int i=the_panel->children(); i--;) { + Fl_Widget* o = *a++; + if (o->changed()) { + o->do_callback(); + if (haderror) return; + o->clear_changed(); + } + } +} + +void ok_cb(Fl_Return_Button* o, void* v) { + set_cb(o,v); + if (!haderror) the_panel->hide(); +} + +void revert_cb(Fl_Button*, void*) { + // We have to revert all dynamically changing fields: + // but for now only the first label works... + if (numselected == 1) current_widget->label(oldlabel); + propagate_load(the_panel, LOAD); +} + +void cancel_cb(Fl_Button* o, void* v) { + revert_cb(o,v); + the_panel->hide(); +} + +void toggle_overlays(Fl_Widget *,void *); // in Fl_Window_Type.cxx +void overlay_cb(Fl_Button*o,void *v) { + toggle_overlays(o,v); +} + +void leave_live_mode_cb(Fl_Widget*, void*); + +void live_mode_cb(Fl_Button*o,void *) { + /// \todo live mode should end gracefully when the application quits + /// or when the user closes the live widget + static Fl_Type *live_type = 0L; + static Fl_Widget *live_widget = 0L; + static Fl_Window *live_window = 0L; + // if 'o' is 0, we must quit live mode + if (!o) { + o = wLiveMode; + o->value(0); + } + if (o->value()) { + if (numselected == 1) { + live_widget = current_widget->enter_live_mode(1); + if (live_widget) { + live_type = current_widget; + Fl_Group::current(0); + int w = live_widget->w(); + int h = live_widget->h(); + live_window = new Fl_Double_Window(w+20, h+55, "Fluid Live Mode Widget"); + live_window->box(FL_FLAT_BOX); + live_window->color(FL_GREEN); + Fl_Group *rsz = new Fl_Group(0, h+20, 130, 35); + rsz->box(FL_NO_BOX); + Fl_Box *rsz_dummy = new Fl_Box(110, h+20, 1, 25); + rsz_dummy->box(FL_NO_BOX); + rsz->resizable(rsz_dummy); + Fl_Button *btn = new Fl_Button(10, h+20, 100, 25, "Exit Live Mode"); + btn->labelsize(12); + btn->callback(leave_live_mode_cb); + live_widget->position(10, 10); + live_window->add(live_widget); + live_window->resizable(live_widget); + live_window->set_modal(); // block all other UI + live_window->callback(leave_live_mode_cb); + if (current_widget->is_window()) { + Fl_Window_Type *w = (Fl_Window_Type*)current_widget; + int mw = w->sr_min_w; if (mw>0) mw += 20; + int mh = w->sr_min_h; if (mh>0) mh += 55; + int MW = w->sr_max_w; if (MW>0) MW += 20; + int MH = w->sr_max_h; if (MH>2) MH += 55; + if (mw || mh || MW || MH) + live_window->size_range(mw, mh, MW, MH); + } + live_window->show(); + } else o->value(0); + } else o->value(0); + } else { + if (live_type) + live_type->leave_live_mode(); + if (live_window) { + live_window->hide(); + Fl::delete_widget(live_window); + } + live_type = 0L; + live_widget = 0L; + live_window = 0L; + } +} + +// update the panel according to current widget set: +static void load_panel() { + if (!the_panel) return; + + // find all the Fl_Widget subclasses currently selected: + numselected = 0; + current_widget = 0; + if (Fl_Type::current) { + if (Fl_Type::current->is_widget()) + current_widget=(Fl_Widget_Type*)Fl_Type::current; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->is_widget() && o->selected) { + numselected++; + if (!current_widget) current_widget = (Fl_Widget_Type*)o; + } + } + } + if (numselected) + propagate_load(the_panel, LOAD); + else + the_panel->hide(); +} + +// This is called when user double-clicks an item, open or update the panel: +void Fl_Widget_Type::open() { + if (!the_panel) the_panel = make_widget_panel(); + load_panel(); + if (numselected) the_panel->show(); +} + +Fl_Type *Fl_Type::current; + +extern void redraw_overlays(); +extern void redraw_browser(); +extern void update_sourceview_position(); + +// Called when ui changes what objects are selected: +// p is selected object, null for all deletions (we must throw away +// old panel in that case, as the object may no longer exist) +void selection_changed(Fl_Type *p) { + // store all changes to the current selected objects: + if (p && the_panel && the_panel->visible()) { + set_cb(0,0); + // if there was an error, we try to leave the selected set unchanged: + if (haderror) { + Fl_Type *q = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + o->new_selected = o->selected; + if (!q && o->selected) q = o; + } + if (!p || !p->selected) p = q; + Fl_Type::current = p; + redraw_browser(); + return; + } + } + // update the selected flags to new set: + Fl_Type *q = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + o->selected = o->new_selected; + if (!q && o->selected) q = o; + } + if (!p || !p->selected) p = q; + Fl_Type::current = p; + redraw_overlays(); + // load the panel with the new settings: + load_panel(); + // update the source viewer to show the code for the selected object + update_sourceview_position(); +} + +//////////////////////////////////////////////////////////////// +// Writing the C code: + +// test to see if user named a function, or typed in code: +int is_name(const char *c) { + for (; *c; c++) if (ispunct(*c) && *c!='_' && *c!=':') return 0; + return 1; +} + +// Test to see if name() is an array entry. If so, and this is the +// highest number, return name[num+1]. Return null if not the highest +// number or a field or function. Return name() if not an array entry. +const char *array_name(Fl_Widget_Type *o) { + const char *c = o->name(); + if (!c) return 0; + const char *d; + for (d = c; *d != '['; d++) { + if (!*d) return c; + if (ispunct(*d) && *d!='_') return 0; + } + int num = atoi(d+1); + int sawthis = 0; + Fl_Type *t = o->prev; + Fl_Type *tp = o; + const char *cn = o->class_name(1); + for (; t && t->class_name(1) == cn; tp = t, t = t->prev); + for (t = tp; t && t->class_name(1) == cn; t = t->next) { + if (t == o) {sawthis=1; continue;} + const char *e = t->name(); + if (!e) continue; + if (strncmp(c,e,d-c)) continue; + int n1 = atoi(e+(d-c)+1); + if (n1 > num || n1==num && sawthis) return 0; + } + static char buffer[128]; + // MRS: we want strncpy() here... + strncpy(buffer,c,d-c+1); + snprintf(buffer+(d-c+1),sizeof(buffer) - (d-c+1), "%d]",num+1); + return buffer; +} + +// Test to see if extra code is a declaration: +int isdeclare(const char *c) { + while (isspace(*c)) c++; + if (*c == '#') return 1; + if (!strncmp(c,"extern",6)) return 1; + if (!strncmp(c,"typedef",7)) return 1; + if (!strncmp(c,"using",5)) return 1; + return 0; +} + +void Fl_Widget_Type::write_static() { + const char* t = subclassname(this); + if (!subclass() || (is_class() && !strncmp(t, "Fl_", 3))) { + write_declare("#include ", t); + } + for (int n=0; n < NUM_EXTRA_CODE; n++) { + if (extra_code(n) && isdeclare(extra_code(n))) + write_declare("%s", extra_code(n)); + } + if (callback() && is_name(callback())) { + int write_extern_declaration = 1; + const Fl_Class_Type *cc = is_in_class(); + char buf[1024]; snprintf(buf, 1023, "%s(*)", callback()); + if (cc) { + if (cc->has_function("static void", buf)) + write_extern_declaration = 0; + } else { + if (has_toplevel_function(0L, buf)) + write_extern_declaration = 0; + } + if (write_extern_declaration) + write_declare("extern void %s(%s*, %s);", callback(), t, + user_data_type() ? user_data_type() : "void*"); + } + const char* k = class_name(1); + const char* c = array_name(this); + if (c && !k && !is_class()) { + write_c("\n"); + if (!public_) write_c("static "); + else write_h("extern %s *%s;\n", t, c); + if (strchr(c, '[') == NULL) write_c("%s *%s=(%s *)0;\n", t, c, t); + else write_c("%s *%s={(%s *)0};\n", t, c, t); + } + if (callback() && !is_name(callback())) { + // see if 'o' or 'v' used, to prevent unused argument warnings: + int use_o = 0; + int use_v = 0; + const char *d; + for (d = callback(); *d;) { + if (*d == 'o' && !is_id(d[1])) use_o = 1; + if (*d == 'v' && !is_id(d[1])) use_v = 1; + do d++; while (is_id(*d)); + while (*d && !is_id(*d)) d++; + } + const char* cn = callback_name(); + if (k) { + write_c("\nvoid %s::%s_i(%s*", k, cn, t); + } else { + write_c("\nstatic void %s(%s*", cn, t); + } + if (use_o) write_c(" o"); + const char* ut = user_data_type() ? user_data_type() : "void*"; + write_c(", %s", ut); + if (use_v) write_c(" v"); + write_c(") {\n %s", callback()); + if (*(d-1) != ';') { + const char *p = strrchr(callback(), '\n'); + if (p) p ++; + else p = callback(); + // Only add trailing semicolon if the last line is not a preprocessor + // statement... + if (*p != '#' && *p) write_c(";"); + } + write_c("\n}\n"); + if (k) { + write_c("void %s::%s(%s* o, %s v) {\n", k, cn, t, ut); + write_c(" ((%s*)(o", k); + Fl_Type *q = 0; + for (Fl_Type* p = parent; p && p->is_widget(); q = p, p = p->parent) + write_c("->parent()"); + if (!q || strcmp(q->type_name(), "widget_class")) + write_c("->user_data()"); + write_c("))->%s_i(o,v);\n}\n", cn); + } + } + if (image) { + if (image->written != write_number) { + image->write_static(); + image->written = write_number; + } + } + if (inactive) { + if (inactive->written != write_number) { + inactive->write_static(); + inactive->written = write_number; + } + } +} + +const char *Fl_Type::callback_name() { + if (is_name(callback())) return callback(); + return unique_id(this, "cb", name(), label()); +} + +extern int varused_test, varused; + +void Fl_Widget_Type::write_code1() { + const char* t = subclassname(this); + const char *c = array_name(this); + if (c) { + if (class_name(1)) { + write_public(public_); + write_h(" %s *%s;\n", t, c); + } + } + if (class_name(1) && callback() && !is_name(callback())) { + const char* cn = callback_name(); + const char* ut = user_data_type() ? user_data_type() : "void*"; + write_public(0); + write_h(" void %s_i(%s*, %s);\n", cn, t, ut); + write_h(" static void %s(%s*, %s);\n", cn, t, ut); + } + // figure out if local variable will be used (prevent compiler warnings): + int wused = !name() && is_window(); + const char *ptr; + + varused = wused; + + if (!name() && !varused) { + varused |= is_parent(); + + if (!varused) { + varused_test = 1; + write_widget_code(); + varused_test = 0; + } + } + + if (!varused) { + for (int n=0; n < NUM_EXTRA_CODE; n++) + if (extra_code(n) && !isdeclare(extra_code(n))) + { + int instring = 0; + int inname = 0; + for (ptr = extra_code(n); *ptr; ptr ++) { + if (instring) { + if (*ptr == '\\') ptr++; + else if (*ptr == '\"') instring = 0; + } else if (inname && !isalnum(*ptr & 255)) inname = 0; + else if (*ptr == '\"') instring = 1; + else if (isalnum(*ptr & 255) || *ptr == '_') { + size_t len = strspn(ptr, "0123456789_" + "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + + if (!strncmp(ptr, "o", len)) { + varused = 1; + break; + } else ptr += len - 1; + } + } + } + } + + write_c("%s{ ", indent()); + if (varused) write_c("%s* o = ", t); + if (name()) write_c("%s = ", name()); + if (is_window()) { + // Handle special case where user is faking a Fl_Group type as a window, + // there is no 2-argument constructor in that case: + if (!strstr(t, "Window")) + write_c("new %s(0, 0, %d, %d", t, o->w(), o->h()); + else + write_c("new %s(%d, %d", t, o->w(), o->h()); + } else { + write_c("new %s(%d, %d, %d, %d", t, o->x(), o->y(), o->w(), o->h()); + } + if (label() && *label()) { + write_c(", "); + switch (i18n_type) { + case 0 : /* None */ + write_cstring(label()); + break; + case 1 : /* GNU gettext */ + write_c("%s(", i18n_function); + write_cstring(label()); + write_c(")"); + break; + case 2 : /* POSIX catgets */ + write_c("catgets(%s,%s,%d,", i18n_file[0] ? i18n_file : "_catalog", + i18n_set, msgnum()); + write_cstring(label()); + write_c(")"); + break; + } + } + write_c(");\n"); + + indentation += 2; + + if (wused) write_c("%sw = o;\n", indent()); + + write_widget_code(); +} + +void Fl_Widget_Type::write_color(const char* field, Fl_Color color) { + const char* color_name = 0; + switch (color) { + case FL_FOREGROUND_COLOR: color_name = "FL_FOREGROUND_COLOR"; break; + case FL_BACKGROUND2_COLOR: color_name = "FL_BACKGROUND2_COLOR"; break; + case FL_INACTIVE_COLOR: color_name = "FL_INACTIVE_COLOR"; break; + case FL_SELECTION_COLOR: color_name = "FL_SELECTION_COLOR"; break; + case FL_GRAY0: color_name = "FL_GRAY0"; break; + case FL_DARK3: color_name = "FL_DARK3"; break; + case FL_DARK2: color_name = "FL_DARK2"; break; + case FL_DARK1: color_name = "FL_DARK1"; break; + case FL_BACKGROUND_COLOR: color_name = "FL_BACKGROUND_COLOR"; break; + case FL_LIGHT1: color_name = "FL_LIGHT1"; break; + case FL_LIGHT2: color_name = "FL_LIGHT2"; break; + case FL_LIGHT3: color_name = "FL_LIGHT3"; break; + case FL_BLACK: color_name = "FL_BLACK"; break; + case FL_RED: color_name = "FL_RED"; break; + case FL_GREEN: color_name = "FL_GREEN"; break; + case FL_YELLOW: color_name = "FL_YELLOW"; break; + case FL_BLUE: color_name = "FL_BLUE"; break; + case FL_MAGENTA: color_name = "FL_MAGENTA"; break; + case FL_CYAN: color_name = "FL_CYAN"; break; + case FL_DARK_RED: color_name = "FL_DARK_RED"; break; + case FL_DARK_GREEN: color_name = "FL_DARK_GREEN"; break; + case FL_DARK_YELLOW: color_name = "FL_DARK_YELLOW"; break; + case FL_DARK_BLUE: color_name = "FL_DARK_BLUE"; break; + case FL_DARK_MAGENTA: color_name = "FL_DARK_MAGENTA"; break; + case FL_DARK_CYAN: color_name = "FL_DARK_CYAN"; break; + case FL_WHITE: color_name = "FL_WHITE"; break; + } + const char *var = is_class() ? "this" : name() ? name() : "o"; + if (color_name) { + write_c("%s%s->%s((Fl_Color)%s);\n", indent(), var, field, color_name); + // we still must cast ^^^^^ here because a few widgets have the wrong argument type. Ouch! + } else { + write_c("%s%s->%s((Fl_Color)%d);\n", indent(), var, field, color); + } +} + +// this is split from write_code1() for Fl_Window_Type: +void Fl_Widget_Type::write_widget_code() { + Fl_Widget* tplate = ((Fl_Widget_Type*)factory)->o; + const char *var = is_class() ? "this" : name() ? name() : "o"; + + if (tooltip() && *tooltip()) { + write_c("%s%s->tooltip(",indent(), var); + switch (i18n_type) { + case 0 : /* None */ + write_cstring(tooltip()); + break; + case 1 : /* GNU gettext */ + write_c("%s(", i18n_function); + write_cstring(tooltip()); + write_c(")"); + break; + case 2 : /* POSIX catgets */ + write_c("catgets(%s,%s,%d,", i18n_file[0] ? i18n_file : "_catalog", + i18n_set, msgnum() + 1); + write_cstring(tooltip()); + write_c(")"); + break; + } + write_c(");\n"); + } + + if (is_spinner() && ((Fl_Spinner*)o)->type() != ((Fl_Spinner*)tplate)->type()) + write_c("%s%s->type(%d);\n", indent(), var, ((Fl_Spinner*)o)->type()); + else if (o->type() != tplate->type() && !is_window()) + write_c("%s%s->type(%d);\n", indent(), var, o->type()); + if (o->box() != tplate->box() || subclass()) + write_c("%s%s->box(FL_%s);\n", indent(), var, boxname(o->box())); + if (is_button()) { + Fl_Button* b = (Fl_Button*)o; + if (b->down_box()) write_c("%s%s->down_box(FL_%s);\n", indent(), var, + boxname(b->down_box())); + if (b->value()) write_c("%s%s->value(1);\n", indent(), var); + if (b->shortcut()) { + int s = b->shortcut(); + if (use_FL_COMMAND && (s & (FL_CTRL|FL_META))) { + write_c("%s%s->shortcut(FL_COMMAND|0x%x);\n", indent(), var, s & ~(FL_CTRL|FL_META)); + } else { + write_c("%s%s->shortcut(0x%x);\n", indent(), var, s); + } + } + } else if (!strcmp(type_name(), "Fl_Input_Choice")) { + Fl_Input_Choice* b = (Fl_Input_Choice*)o; + if (b->down_box()) write_c("%s%s->down_box(FL_%s);\n", indent(), var, + boxname(b->down_box())); + } else if (is_menu_button()) { + Fl_Menu_* b = (Fl_Menu_*)o; + if (b->down_box()) write_c("%s%s->down_box(FL_%s);\n", indent(), var, + boxname(b->down_box())); + } + if (o->color() != tplate->color() || subclass()) + write_color("color", o->color()); + if (o->selection_color() != tplate->selection_color() || subclass()) + write_color("selection_color", o->selection_color()); + if (image) image->write_code(var); + if (inactive) inactive->write_code(var, 1); + if (o->labeltype() != tplate->labeltype() || subclass()) + write_c("%s%s->labeltype(FL_%s);\n", indent(), var, + item_name(labeltypemenu, o->labeltype())); + if (o->labelfont() != tplate->labelfont() || subclass()) + write_c("%s%s->labelfont(%d);\n", indent(), var, o->labelfont()); + if (o->labelsize() != tplate->labelsize() || subclass()) + write_c("%s%s->labelsize(%d);\n", indent(), var, o->labelsize()); + if (o->labelcolor() != tplate->labelcolor() || subclass()) + write_color("labelcolor", o->labelcolor()); + if (is_valuator()) { + Fl_Valuator* v = (Fl_Valuator*)o; + Fl_Valuator* f = (Fl_Valuator*)(tplate); + if (v->minimum()!=f->minimum()) + write_c("%s%s->minimum(%g);\n", indent(), var, v->minimum()); + if (v->maximum()!=f->maximum()) + write_c("%s%s->maximum(%g);\n", indent(), var, v->maximum()); + if (v->step()!=f->step()) + write_c("%s%s->step(%g);\n", indent(), var, v->step()); + if (v->value()) { + if (is_valuator()==3) { // Fl_Scrollbar::value(double) is nott available + write_c("%s%s->Fl_Slider::value(%g);\n", indent(), var, v->value()); + } else { + write_c("%s%s->value(%g);\n", indent(), var, v->value()); + } + } + if (is_valuator()>=2) { + double x = ((Fl_Slider*)v)->slider_size(); + double y = ((Fl_Slider*)f)->slider_size(); + if (x != y) write_c("%s%s->slider_size(%g);\n", indent(), var, x); + } + } + if (is_spinner()) { + Fl_Spinner* v = (Fl_Spinner*)o; + Fl_Spinner* f = (Fl_Spinner*)(tplate); + if (v->minimum()!=f->minimum()) + write_c("%s%s->minimum(%g);\n", indent(), var, v->minimum()); + if (v->maximum()!=f->maximum()) + write_c("%s%s->maximum(%g);\n", indent(), var, v->maximum()); + if (v->step()!=f->step()) + write_c("%s%s->step(%g);\n", indent(), var, v->step()); + if (v->value()!=1.0f) + write_c("%s%s->value(%g);\n", indent(), var, v->value()); + } + + {Fl_Font ff; int fs; Fl_Color fc; if (textstuff(4,ff,fs,fc)) { + Fl_Font f; int s; Fl_Color c; textstuff(0,f,s,c); + if (f != ff) write_c("%s%s->textfont(%d);\n", indent(), var, f); + if (s != fs) write_c("%s%s->textsize(%d);\n", indent(), var, s); + if (c != fc) write_color("textcolor", c); + }} + const char* ud = user_data(); + if (class_name(1) && !parent->is_widget()) ud = "this"; + if (callback()) { + write_c("%s%s->callback((Fl_Callback*)%s", indent(), var, callback_name()); + if (ud) + write_c(", (void*)(%s));\n", ud); + else + write_c(");\n"); + } else if (ud) { + write_c("%s%s->user_data((void*)(%s));\n", indent(), var, ud); + } + if (o->align() != tplate->align() || subclass()) { + int i = o->align(); + write_c("%s%s->align(%s", indent(), var, + item_name(alignmenu, i & ~FL_ALIGN_INSIDE)); + if (i & FL_ALIGN_INSIDE) write_c("|FL_ALIGN_INSIDE"); + write_c(");\n"); + } + // avoid the unsupported combination of flegs when user sets + // "when" to "FL_WHEN_NEVER", but keeps the "no change" set. + // FIXME: This could be reflected in the GUI by graying out the button. + Fl_When ww = o->when(); + if (ww==FL_WHEN_NOT_CHANGED) + ww = FL_WHEN_NEVER; + if (ww != tplate->when() || subclass()) + write_c("%s%s->when(%s);\n", indent(), var, + item_name(whensymbolmenu, ww)); + if (!o->visible() && o->parent()) + write_c("%s%s->hide();\n", indent(), var); + if (!o->active()) + write_c("%s%s->deactivate();\n", indent(), var); + if (!is_group() && resizable()) + write_c("%sFl_Group::current()->resizable(%s);\n", indent(), var); + if (hotspot()) { + if (is_class()) + write_c("%shotspot(%s);\n", indent(), var); + else if (is_window()) + write_c("%s%s->hotspot(%s);\n", indent(), var, var); + else + write_c("%s%s->window()->hotspot(%s);\n", indent(), var, var); + } +} + +void Fl_Widget_Type::write_extra_code() { + for (int n=0; n < NUM_EXTRA_CODE; n++) + if (extra_code(n) && !isdeclare(extra_code(n))) + write_c("%s%s\n", indent(), extra_code(n)); +} + +void Fl_Widget_Type::write_block_close() { + indentation -= 2; + write_c("%s} // %s* %s\n", indent(), subclassname(this), + name() ? name() : "o"); +} + +void Fl_Widget_Type::write_code2() { + write_extra_code(); + write_block_close(); +} + +//////////////////////////////////////////////////////////////// + +void Fl_Widget_Type::write_properties() { + Fl_Type::write_properties(); + write_indent(level+1); + switch (public_) { + case 0: write_string("private"); break; + case 1: break; + case 2: write_string("protected"); break; + } + if (tooltip() && *tooltip()) { + write_string("tooltip"); + write_word(tooltip()); + } + if (image_name() && *image_name()) { + write_string("image"); + write_word(image_name()); + } + if (inactive_name() && *inactive_name()) { + write_string("deimage"); + write_word(inactive_name()); + } + write_string("xywh {%d %d %d %d}", o->x(), o->y(), o->w(), o->h()); + Fl_Widget* tplate = ((Fl_Widget_Type*)factory)->o; + if (is_spinner() && ((Fl_Spinner*)o)->type() != ((Fl_Spinner*)tplate)->type()) { + write_string("type"); + write_word(item_name(subtypes(), ((Fl_Spinner*)o)->type())); + } else if (o->type() != tplate->type() || is_window()) { + write_string("type"); + write_word(item_name(subtypes(), o->type())); + } + if (o->box() != tplate->box()) { + write_string("box"); write_word(boxname(o->box()));} + if (is_button()) { + Fl_Button* b = (Fl_Button*)o; + if (b->down_box()) { + write_string("down_box"); write_word(boxname(b->down_box()));} + if (b->shortcut()) write_string("shortcut 0x%x", b->shortcut()); + if (b->value()) write_string("value 1"); + } else if (!strcmp(type_name(), "Fl_Input_Choice")) { + Fl_Input_Choice* b = (Fl_Input_Choice*)o; + if (b->down_box()) { + write_string("down_box"); write_word(boxname(b->down_box()));} + } else if (is_menu_button()) { + Fl_Menu_* b = (Fl_Menu_*)o; + if (b->down_box()) { + write_string("down_box"); write_word(boxname(b->down_box()));} + } + if (o->color()!=tplate->color()) + write_string("color %d", o->color()); + if (o->selection_color()!=tplate->selection_color()) + write_string("selection_color %d", o->selection_color()); + if (o->labeltype()!=tplate->labeltype()) { + write_string("labeltype"); + write_word(item_name(labeltypemenu, o->labeltype())); + } + if (o->labelfont()!=tplate->labelfont()) + write_string("labelfont %d", o->labelfont()); + if (o->labelsize()!=tplate->labelsize()) + write_string("labelsize %d", o->labelsize()); + if (o->labelcolor()!=tplate->labelcolor()) + write_string("labelcolor %d", o->labelcolor()); + if (o->align()!=tplate->align()) + write_string("align %d", o->align()); + if (o->when() != tplate->when()) + write_string("when %d", o->when()); + if (is_valuator()) { + Fl_Valuator* v = (Fl_Valuator*)o; + Fl_Valuator* f = (Fl_Valuator*)(tplate); + if (v->minimum()!=f->minimum()) write_string("minimum %g",v->minimum()); + if (v->maximum()!=f->maximum()) write_string("maximum %g",v->maximum()); + if (v->step()!=f->step()) write_string("step %g",v->step()); + if (v->value()!=0.0) write_string("value %g",v->value()); + if (is_valuator()>=2) { + double x = ((Fl_Slider*)v)->slider_size(); + double y = ((Fl_Slider*)f)->slider_size(); + if (x != y) write_string("slider_size %g", x); + } + } + if (is_spinner()) { + Fl_Spinner* v = (Fl_Spinner*)o; + Fl_Spinner* f = (Fl_Spinner*)(tplate); + if (v->minimum()!=f->minimum()) write_string("minimum %g",v->minimum()); + if (v->maximum()!=f->maximum()) write_string("maximum %g",v->maximum()); + if (v->step()!=f->step()) write_string("step %g",v->step()); + if (v->value()!=1.0) write_string("value %g",v->value()); + } + {Fl_Font ff; int fs; Fl_Color fc; if (textstuff(4,ff,fs,fc)) { + Fl_Font f; int s; Fl_Color c; textstuff(0,f,s,c); + if (f != ff) write_string("textfont %d", f); + if (s != fs) write_string("textsize %d", s); + if (c != fc) write_string("textcolor %d", c); + }} + if (!o->visible()) write_string("hide"); + if (!o->active()) write_string("deactivate"); + if (resizable()) write_string("resizable"); + if (hotspot()) write_string(is_menu_item() ? "divider" : "hotspot"); + for (int n=0; n < NUM_EXTRA_CODE; n++) if (extra_code(n)) { + write_indent(level+1); + write_string("code%d",n); + write_word(extra_code(n)); + } + if (subclass()) { + write_indent(level+1); + write_string("class"); + write_word(subclass()); + } +} + +int pasteoffset; + +void Fl_Widget_Type::read_property(const char *c) { + int x,y,w,h; Fl_Font f; int s; Fl_Color cc; + if (!strcmp(c,"private")) { + public_ = 0; + } else if (!strcmp(c,"protected")) { + public_ = 2; + } else if (!strcmp(c,"xywh")) { + if (sscanf(read_word(),"%d %d %d %d",&x,&y,&w,&h) == 4) { + x += pasteoffset; + y += pasteoffset; + o->resize(x,y,w,h); + } + } else if (!strcmp(c,"tooltip")) { + tooltip(read_word()); + } else if (!strcmp(c,"image")) { + image_name(read_word()); + } else if (!strcmp(c,"deimage")) { + inactive_name(read_word()); + } else if (!strcmp(c,"type")) { + if (is_spinner()) + ((Fl_Spinner*)o)->type(item_number(subtypes(), read_word())); + else + o->type(item_number(subtypes(), read_word())); + } else if (!strcmp(c,"box")) { + const char* value = read_word(); + if ((x = boxnumber(value))) { + if (x == ZERO_ENTRY) x = 0; + o->box((Fl_Boxtype)x); + } else if (sscanf(value,"%d",&x) == 1) o->box((Fl_Boxtype)x); + } else if (is_button() && !strcmp(c,"down_box")) { + const char* value = read_word(); + if ((x = boxnumber(value))) { + if (x == ZERO_ENTRY) x = 0; + ((Fl_Button*)o)->down_box((Fl_Boxtype)x); + } + } else if (!strcmp(type_name(), "Fl_Input_Choice") && !strcmp(c,"down_box")) { + const char* value = read_word(); + if ((x = boxnumber(value))) { + if (x == ZERO_ENTRY) x = 0; + ((Fl_Input_Choice*)o)->down_box((Fl_Boxtype)x); + } + } else if (is_menu_button() && !strcmp(c,"down_box")) { + const char* value = read_word(); + if ((x = boxnumber(value))) { + if (x == ZERO_ENTRY) x = 0; + ((Fl_Menu_*)o)->down_box((Fl_Boxtype)x); + } + } else if (is_button() && !strcmp(c,"value")) { + const char* value = read_word(); + ((Fl_Button*)o)->value(atoi(value)); + } else if (!strcmp(c,"color")) { + int n = sscanf(read_word(),"%d %d",&x,&y); + if (n == 2) { // back compatability... + if (x != 47) o->color(x); + o->selection_color(y); + } else { + o->color(x); + } + } else if (!strcmp(c,"selection_color")) { + if (sscanf(read_word(),"%d",&x)) o->selection_color(x); + } else if (!strcmp(c,"labeltype")) { + c = read_word(); + if (!strcmp(c,"image")) { + Fluid_Image *i = Fluid_Image::find(label()); + if (!i) read_error("Image file '%s' not found", label()); + else setimage(i); + image_name(label()); + label(""); + } else { + o->labeltype((Fl_Labeltype)item_number(labeltypemenu,c)); + } + } else if (!strcmp(c,"labelfont")) { + if (sscanf(read_word(),"%d",&x) == 1) o->labelfont(x); + } else if (!strcmp(c,"labelsize")) { + if (sscanf(read_word(),"%d",&x) == 1) o->labelsize(x); + } else if (!strcmp(c,"labelcolor")) { + if (sscanf(read_word(),"%d",&x) == 1) o->labelcolor(x); + } else if (!strcmp(c,"align")) { + if (sscanf(read_word(),"%d",&x) == 1) o->align(x); + } else if (!strcmp(c,"when")) { + if (sscanf(read_word(),"%d",&x) == 1) o->when(x); + } else if (!strcmp(c,"minimum")) { + if (is_valuator()) ((Fl_Valuator*)o)->minimum(strtod(read_word(),0)); + if (is_spinner()) ((Fl_Spinner*)o)->minimum(strtod(read_word(),0)); + } else if (!strcmp(c,"maximum")) { + if (is_valuator()) ((Fl_Valuator*)o)->maximum(strtod(read_word(),0)); + if (is_spinner()) ((Fl_Spinner*)o)->maximum(strtod(read_word(),0)); + } else if (!strcmp(c,"step")) { + if (is_valuator()) ((Fl_Valuator*)o)->step(strtod(read_word(),0)); + if (is_spinner()) ((Fl_Spinner*)o)->step(strtod(read_word(),0)); + } else if (!strcmp(c,"value")) { + if (is_valuator()) ((Fl_Valuator*)o)->value(strtod(read_word(),0)); + if (is_spinner()) ((Fl_Spinner*)o)->value(strtod(read_word(),0)); + } else if ((!strcmp(c,"slider_size")||!strcmp(c,"size"))&&is_valuator()==2) { + ((Fl_Slider*)o)->slider_size(strtod(read_word(),0)); + } else if (!strcmp(c,"textfont")) { + if (sscanf(read_word(),"%d",&x) == 1) {f=(Fl_Font)x; textstuff(1,f,s,cc);} + } else if (!strcmp(c,"textsize")) { + if (sscanf(read_word(),"%d",&x) == 1) {s=x; textstuff(2,f,s,cc);} + } else if (!strcmp(c,"textcolor")) { + if (sscanf(read_word(),"%d",&x) == 1) {cc=(Fl_Color)x;textstuff(3,f,s,cc);} + } else if (!strcmp(c,"hide")) { + o->hide(); + } else if (!strcmp(c,"deactivate")) { + o->deactivate(); + } else if (!strcmp(c,"resizable")) { + resizable(1); + } else if (!strcmp(c,"hotspot") || !strcmp(c, "divider")) { + hotspot(1); + } else if (!strcmp(c,"class")) { + subclass(read_word()); + } else if (is_button() && !strcmp(c,"shortcut")) { + ((Fl_Button*)o)->shortcut(strtol(read_word(),0,0)); + } else { + if (!strncmp(c,"code",4)) { + int n = atoi(c+4); + if (n >= 0 && n <= NUM_EXTRA_CODE) { + extra_code(n,read_word()); + return; + } + } + Fl_Type::read_property(c); + } +} + +Fl_Menu_Item boxmenu1[] = { + // these extra ones are for looking up fdesign saved strings: + {"NO_FRAME", 0,0,(void *)FL_NO_BOX}, + {"ROUNDED3D_UPBOX", 0,0,(void *)_FL_ROUND_UP_BOX}, + {"ROUNDED3D_DOWNBOX", 0,0,(void *)_FL_ROUND_DOWN_BOX}, + {"OVAL3D_UPBOX", 0,0,(void *)_FL_ROUND_UP_BOX}, + {"OVAL3D_DOWNBOX", 0,0,(void *)_FL_ROUND_DOWN_BOX}, + {"0", 0,0,(void *)ZERO_ENTRY}, + {"1", 0,0,(void *)FL_UP_BOX}, + {"2", 0,0,(void *)FL_DOWN_BOX}, + {"3", 0,0,(void *)FL_FLAT_BOX}, + {"4", 0,0,(void *)FL_BORDER_BOX}, + {"5", 0,0,(void *)FL_SHADOW_BOX}, + {"6", 0,0,(void *)FL_FRAME_BOX}, + {"7", 0,0,(void *)FL_ROUNDED_BOX}, + {"8", 0,0,(void *)FL_RFLAT_BOX}, + {"9", 0,0,(void *)FL_RSHADOW_BOX}, + {"10", 0,0,(void *)FL_UP_FRAME}, + {"11", 0,0,(void *)FL_DOWN_FRAME}, +{0}}; + +extern int fdesign_flip; +int lookup_symbol(const char *, int &, int numberok = 0); + +int Fl_Widget_Type::read_fdesign(const char* propname, const char* value) { + int v; + if (!strcmp(propname,"box")) { + float x,y,w,h; + if (sscanf(value,"%f %f %f %f",&x,&y,&w,&h) == 4) { + if (fdesign_flip) { + Fl_Type *p; + for (p = parent; p && !p->is_window(); p = p->parent); + if (p && p->is_widget()) y = ((Fl_Widget_Type*)p)->o->h()-(y+h); + } + x += pasteoffset; + y += pasteoffset; + o->resize(int(x),int(y),int(w),int(h)); + } + } else if (!strcmp(propname,"label")) { + label(value); + } else if (!strcmp(propname,"name")) { + this->name(value); + } else if (!strcmp(propname,"callback")) { + callback(value); user_data_type("long"); + } else if (!strcmp(propname,"argument")) { + user_data(value); + } else if (!strcmp(propname,"shortcut")) { + if (value[0]) { + char buf[128]; sprintf(buf,"o->shortcut(\"%s\");",value); + extra_code(0,buf); + } + } else if (!strcmp(propname,"style")) { + if (!strncmp(value,"FL_NORMAL",9)) return 1; + if (!lookup_symbol(value,v,1)) return 0; + o->labelfont(v); o->labeltype((Fl_Labeltype)(v>>8)); + } else if (!strcmp(propname,"size")) { + if (!lookup_symbol(value,v,1)) return 0; + o->labelsize(v); + } else if (!strcmp(propname,"type")) { + if (!strncmp(value,"NORMAL",6)) return 1; + if (lookup_symbol(value,v,1)) {o->type(v); return 1;} + if (!strcmp(value+strlen(value)-5,"FRAME")) goto TRY_BOXTYPE; + if (!strcmp(value+strlen(value)-3,"BOX")) goto TRY_BOXTYPE; + return 0; + } else if (!strcmp(propname,"lcol")) { + if (!lookup_symbol(value,v,1)) return 0; + o->labelcolor(v); + } else if (!strcmp(propname,"return")) { + if (!lookup_symbol(value,v,0)) return 0; + o->when(v|FL_WHEN_RELEASE); + } else if (!strcmp(propname,"alignment")) { + if (!lookup_symbol(value,v)) { + // convert old numeric values: + int v1 = atoi(value); if (v1 <= 0 && strcmp(value,"0")) return 0; + v = 0; + if (v1 >= 5) {v = FL_ALIGN_INSIDE; v1 -= 5;} + switch (v1) { + case 0: v += FL_ALIGN_TOP; break; + case 1: v += FL_ALIGN_BOTTOM; break; + case 2: v += FL_ALIGN_LEFT; break; + case 3: v += FL_ALIGN_RIGHT; break; + case 4: v += FL_ALIGN_CENTER; break; + default: return 0; + } + } + o->align(v); + } else if (!strcmp(propname,"resizebox")) { + resizable(1); + } else if (!strcmp(propname,"colors")) { + char* p = (char*)value; + while (*p != ' ') {if (!*p) return 0; p++;} + *p = 0; + int v1; + if (!lookup_symbol(value,v,1) || !lookup_symbol(p+1,v1,1)) { + *p=' '; return 0;} + o->color(v,v1); + } else if (!strcmp(propname,"resize")) { + return !strcmp(value,"FL_RESIZE_ALL"); + } else if (!strcmp(propname,"gravity")) { + return !strcmp(value,"FL_NoGravity FL_NoGravity"); + } else if (!strcmp(propname,"boxtype")) { + TRY_BOXTYPE: + int x = boxnumber(value); + if (!x) {x = item_number(boxmenu1, value); if (x < 0) return 0;} + if (x == ZERO_ENTRY) { + x = 0; + if (o->box() != ((Fl_Widget_Type*)factory)->o->box()) return 1; // kludge for frame + } + o->box((Fl_Boxtype)x); + } else { + return 0; + } + return 1; +} + +void leave_live_mode_cb(Fl_Widget*, void*) { + live_mode_cb(0, 0); +} + +Fl_Widget *Fl_Widget_Type::enter_live_mode(int) { + live_widget = widget(o->x(), o->y(), o->w(), o->h()); + if (live_widget) + copy_properties(); + return live_widget; +} + +void Fl_Widget_Type::leave_live_mode() { +} + +/** + * copy all properties from the edit widget to the live widget + */ +void Fl_Widget_Type::copy_properties() { + if (!live_widget) + return; + + // copy all attributes common to all widget types + Fl_Widget *w = live_widget; + w->label(o->label()); + w->tooltip(tooltip()); + w->type(o->type()); + w->box(o->box()); + w->color(o->color()); + w->selection_color(o->selection_color()); + w->labeltype(o->labeltype()); + w->labelfont(o->labelfont()); + w->labelsize(o->labelsize()); + w->labelcolor(o->labelcolor()); + w->align(o->align()); + + // copy all attributes specific to widgets derived from Fl_Button + if (is_button()) { + Fl_Button* d = (Fl_Button*)live_widget, *s = (Fl_Button*)o; + d->down_box(s->down_box()); + d->shortcut(s->shortcut()); + d->value(s->value()); + } + + // copy all attributes specific to Fl_Valuator and derived classes + if (is_valuator()) { + Fl_Valuator* d = (Fl_Valuator*)live_widget, *s = (Fl_Valuator*)o; + d->minimum(s->minimum()); + d->maximum(s->maximum()); + d->step(s->step()); + d->value(s->value()); + if (is_valuator()>=2) { + Fl_Slider *d = (Fl_Slider*)live_widget, *s = (Fl_Slider*)o; + d->slider_size(s->slider_size()); + } + } + + // copy all attributes specific to Fl_Spinner and derived classes + if (is_spinner()) { + Fl_Spinner* d = (Fl_Spinner*)live_widget, *s = (Fl_Spinner*)o; + d->minimum(s->minimum()); + d->maximum(s->maximum()); + d->step(s->step()); + d->value(s->value()); + } + +/* TODO: implement this + {Fl_Font ff; int fs; Fl_Color fc; if (textstuff(4,ff,fs,fc)) { + Fl_Font f; int s; Fl_Color c; textstuff(0,f,s,c); + if (f != ff) write_string("textfont %d", f); + if (s != fs) write_string("textsize %d", s); + if (c != fc) write_string("textcolor %d", c); + }}*/ + + if (!o->visible()) + w->hide(); + if (!o->active()) + w->deactivate(); + if (resizable() && w->parent()) + w->parent()->resizable(o); +} + +void Fl_Pack_Type::copy_properties() +{ + Fl_Group_Type::copy_properties(); + Fl_Pack *d = (Fl_Pack*)live_widget, *s =(Fl_Pack*)o; + d->spacing(s->spacing()); +} + +// +// End of "$Id: Fl_Widget_Type.cxx 6801 2009-06-28 22:09:25Z matt $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/Fl_Widget_Type.h b/third_party/windows/fltk-1.1.10/fluid/Fl_Widget_Type.h new file mode 100644 index 0000000..5db1ab2 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/Fl_Widget_Type.h @@ -0,0 +1,42 @@ +// +// "$Id: Fl_Widget_Type.h 4288 2005-04-16 00:13:17Z mike $" +// +// Widget type header file for the Fast Light Tool Kit (FLTK). +// +// Type for creating all subclasses of Fl_Widget +// This should have the widget pointer in it, but it is still in the +// Fl_Type base class. +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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_Type.h" + +struct Fl_Menu_Item; +class Fluid_Image; + +void* const LOAD = (void *)9831; +extern Fl_Widget_Type *current_widget; // one of the selected ones + +// +// End of "$Id: Fl_Widget_Type.h 4288 2005-04-16 00:13:17Z mike $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/Fl_Window_Type.cxx b/third_party/windows/fltk-1.1.10/fluid/Fl_Window_Type.cxx new file mode 100644 index 0000000..cf570f6 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/Fl_Window_Type.cxx @@ -0,0 +1,1533 @@ +// +// "$Id: Fl_Window_Type.cxx 6098 2008-04-12 18:04:09Z matt $" +// +// Window type code for the Fast Light Tool Kit (FLTK). +// +// The widget describing an Fl_Window. This is also all the code +// for interacting with the overlay, which allows the user to +// select, move, and resize the children widgets. +// +// Copyright 1998-2006 by Bill Spitzak and others. +// +// 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 +#include +#include +#include +#include +#include +#include +#include "Fl_Widget_Type.h" +#include "undo.h" +#include +#include +#include "alignment_panel.h" +#include + +extern int gridx; +extern int gridy; +extern int snap; +extern int show_guides; + +int include_H_from_C = 1; +int use_FL_COMMAND = 0; +extern int i18n_type; +extern const char* i18n_include; +extern const char* i18n_function; +extern const char* i18n_file; +extern const char* i18n_set; + +extern Fl_Preferences fluid_prefs; + +inline int fl_min(int a, int b) { return (a < b ? a : b); } + +#include "widget_panel.h" + +// Update the XYWH values in the widget panel... +static void update_xywh() { + if (current_widget && current_widget->is_widget()) { + widget_x_input->value(((Fl_Widget_Type *)current_widget)->o->x()); + widget_y_input->value(((Fl_Widget_Type *)current_widget)->o->y()); + widget_w_input->value(((Fl_Widget_Type *)current_widget)->o->w()); + widget_h_input->value(((Fl_Widget_Type *)current_widget)->o->h()); + } +} + +void guides_cb(Fl_Check_Button *i, long) { + show_guides = i->value(); + fluid_prefs.set("show_guides", show_guides); + + for (Fl_Type *p = Fl_Type::first; p; p = p->next) { + if (p->is_window()) { + Fl_Window_Type *w = (Fl_Window_Type *)p; + ((Fl_Overlay_Window *)(w->o))->redraw_overlay(); + } + } +} + +void grid_cb(Fl_Input *i, long v) { + int n = atoi(i->value()); + if (n < 0) n = 0; + switch (v) { + case 1: + gridx = n; + fluid_prefs.set("gridx", n); + break; + case 2: + gridy = n; + fluid_prefs.set("gridy", n); + break; + case 3: + snap = n; + fluid_prefs.set("snap", n); + break; + } + + // Next go through all of the windows in the project and set the + // stepping for resizes... + Fl_Type *p; + Fl_Window_Type *w; + + for (p = Fl_Type::first; p; p = p->next) { + if (p->is_window()) { + w = (Fl_Window_Type *)p; + ((Fl_Window *)(w->o))->size_range(gridx, gridy, + Fl::w(), Fl::h(), + gridx, gridy, 0); + } + } +} + +// Set default widget sizes... +void default_widget_size_cb(Fl_Round_Button *b, long size) { + // Update the "normal" text size of new widgets... + b->setonly(); + Fl_Widget_Type::default_size = size; + fluid_prefs.set("widget_size", Fl_Widget_Type::default_size); +} + + +void i18n_type_cb(Fl_Choice *c, void *) { + undo_checkpoint(); + + switch (i18n_type = c->value()) { + case 0 : /* None */ + i18n_include_input->hide(); + i18n_file_input->hide(); + i18n_set_input->hide(); + i18n_function_input->hide(); + break; + case 1 : /* GNU gettext */ + i18n_include_input->value(""); + i18n_include = i18n_include_input->value(); + i18n_function_input->value("gettext"); + i18n_function = i18n_function_input->value(); + i18n_include_input->show(); + i18n_file_input->hide(); + i18n_set_input->hide(); + i18n_function_input->show(); + break; + case 2 : /* POSIX cat */ + i18n_include_input->value(""); + i18n_file_input->value(""); + i18n_file = i18n_file_input->value(); + i18n_set_input->value("1"); + i18n_set = i18n_set_input->value(); + i18n_include_input->show(); + i18n_include = i18n_include_input->value(); + i18n_file_input->show(); + i18n_set_input->show(); + i18n_function_input->hide(); + break; + } + + set_modflag(1); +} + +void i18n_text_cb(Fl_Input *i, void *) { + undo_checkpoint(); + + if (i == i18n_function_input) + i18n_function = i->value(); + else if (i == i18n_file_input) + i18n_file = i->value(); + else if (i == i18n_set_input) + i18n_set = i->value(); + else if (i == i18n_include_input) + i18n_include = i->value(); + + set_modflag(1); +} + +extern const char* header_file_name; +extern const char* code_file_name; + +void show_project_cb(Fl_Widget *, void *) { + if(project_window==0) make_project_window(); + include_H_from_C_button->value(include_H_from_C); + use_FL_COMMAND_button->value(use_FL_COMMAND); + header_file_input->value(header_file_name); + code_file_input->value(code_file_name); + i18n_type_chooser->value(i18n_type); + i18n_function_input->value(i18n_function); + i18n_file_input->value(i18n_file); + i18n_set_input->value(i18n_set); + i18n_include_input->value(i18n_include); + switch (i18n_type) { + case 0 : /* None */ + i18n_include_input->hide(); + i18n_file_input->hide(); + i18n_set_input->hide(); + i18n_function_input->hide(); + break; + case 1 : /* GNU gettext */ + i18n_include_input->show(); + i18n_file_input->hide(); + i18n_set_input->hide(); + i18n_function_input->show(); + break; + case 2 : /* POSIX cat */ + i18n_include_input->show(); + i18n_file_input->show(); + i18n_set_input->show(); + i18n_function_input->hide(); + break; + } + project_window->hotspot(project_window); + project_window->show(); +} + +void show_grid_cb(Fl_Widget *, void *) { + char buf[128]; + sprintf(buf,"%d",gridx); horizontal_input->value(buf); + sprintf(buf,"%d",gridy); vertical_input->value(buf); + sprintf(buf,"%d",snap); snap_input->value(buf); + guides_toggle->value(show_guides); + int s = Fl_Widget_Type::default_size; + if (s<=8) def_widget_size[0]->setonly(); + else if (s<=11) def_widget_size[1]->setonly(); + else if (s<=14) def_widget_size[2]->setonly(); + else if (s<=18) def_widget_size[3]->setonly(); + else if (s<=24) def_widget_size[4]->setonly(); + else if (s<=32) def_widget_size[5]->setonly(); + grid_window->hotspot(grid_window); + grid_window->show(); +} + +void show_settings_cb(Fl_Widget *, void *) { + settings_window->hotspot(settings_window); + settings_window->show(); +} + +void header_input_cb(Fl_Input* i, void*) { + if (header_file_name && strcmp(header_file_name, i->value())) + set_modflag(1); + header_file_name = i->value(); +} +void code_input_cb(Fl_Input* i, void*) { + if (code_file_name && strcmp(code_file_name, i->value())) + set_modflag(1); + code_file_name = i->value(); +} + +void include_H_from_C_button_cb(Fl_Check_Button* b, void*) { + if (include_H_from_C != b->value()) { + set_modflag(1); + include_H_from_C = b->value(); + } +} + +void use_FL_COMMAND_button_cb(Fl_Check_Button* b, void*) { + if (use_FL_COMMAND != b->value()) { + set_modflag(1); + use_FL_COMMAND = b->value(); + } +} + +//////////////////////////////////////////////////////////////// + +Fl_Menu_Item window_type_menu[] = { + {"Single",0,0,(void*)FL_WINDOW}, + {"Double",0,0,(void*)(FL_WINDOW+1)}, + {0}}; + +static int overlays_invisible; + +// The following Fl_Widget is used to simulate the windows. It has +// an overlay for the fluid ui, and special-cases the FL_NO_BOX. + +class Overlay_Window : public Fl_Overlay_Window { + void draw(); + void draw_overlay(); +public: + Fl_Window_Type *window; + int handle(int); + Overlay_Window(int W,int H) : Fl_Overlay_Window(W,H) {Fl_Group::current(0);} + void resize(int,int,int,int); + uchar *read_image(int &ww, int &hh); +}; +void Overlay_Window::draw() { + const int CHECKSIZE = 8; + // see if box is clear or a frame or rounded: + if ((damage()&FL_DAMAGE_ALL) && + (!box() || (box()>=4&&!(box()&2)) || box()>=_FL_ROUNDED_BOX)) { + // if so, draw checkerboard so user can see what areas are clear: + for (int Y = 0; Y < h(); Y += CHECKSIZE) + for (int X = 0; X < w(); X += CHECKSIZE) { + fl_color(((Y/(2*CHECKSIZE))&1) != ((X/(2*CHECKSIZE))&1) ? + FL_WHITE : FL_BLACK); + fl_rectf(X,Y,CHECKSIZE,CHECKSIZE); + } + } + Fl_Overlay_Window::draw(); +} + +extern Fl_Window *main_window; + +// Read an image of the overlay window +uchar *Overlay_Window::read_image(int &ww, int &hh) { + // Create an off-screen buffer for the window... + main_window->make_current(); + + ww = w(); + hh = h(); + + Fl_Offscreen offscreen = fl_create_offscreen(ww, hh); + uchar *pixels; + + // Redraw the window into the offscreen buffer... + fl_begin_offscreen(offscreen); + + if (!shown()) image(Fl::scheme_bg_); + + redraw(); + draw(); + + // Read the screen image... + pixels = fl_read_image(0, 0, 0, ww, hh); + + fl_end_offscreen(); + + // Cleanup and return... + fl_delete_offscreen(offscreen); + + return pixels; +} + +void Overlay_Window::draw_overlay() { + window->draw_overlay(); +} +int Overlay_Window::handle(int e) { + int ret = window->handle(e); + if (ret==0) { + switch (e) { + case FL_SHOW: + case FL_HIDE: + ret = Fl_Overlay_Window::handle(e); + } + } + return ret; +} + +Fl_Type *Fl_Window_Type::make() { + Fl_Type *p = Fl_Type::current; + while (p && !p->is_code_block()) p = p->parent; + if (!p) { + fl_message("Please select a function"); + return 0; + } + Fl_Window_Type *myo = new Fl_Window_Type(); + if (!this->o) {// template widget + this->o = new Fl_Window(100,100); + Fl_Group::current(0); + } + // Set the size ranges for this window; in order to avoid opening the + // X display we use an arbitrary maximum size... + ((Fl_Window *)(this->o))->size_range(gridx, gridy, + 3072, 2048, + gridx, gridy, 0); + myo->factory = this; + myo->drag = 0; + myo->numselected = 0; + Overlay_Window *w = new Overlay_Window(100,100); + w->window = myo; + myo->o = w; + myo->add(p); + myo->modal = 0; + myo->non_modal = 0; + return myo; +} + +void Fl_Window_Type::add_child(Fl_Type* cc, Fl_Type* before) { + if (!cc->is_widget()) return; + Fl_Widget_Type* c = (Fl_Widget_Type*)cc; + Fl_Widget* b = before ? ((Fl_Widget_Type*)before)->o : 0; + ((Fl_Window*)o)->insert(*(c->o), b); + o->redraw(); +} + +void Fl_Window_Type::remove_child(Fl_Type* cc) { + Fl_Widget_Type* c = (Fl_Widget_Type*)cc; + ((Fl_Window*)o)->remove(c->o); + o->redraw(); +} + +void Fl_Window_Type::move_child(Fl_Type* cc, Fl_Type* before) { + Fl_Widget_Type* c = (Fl_Widget_Type*)cc; + ((Fl_Window*)o)->remove(c->o); + Fl_Widget* b = before ? ((Fl_Widget_Type*)before)->o : 0; + ((Fl_Window*)o)->insert(*(c->o), b); + o->redraw(); +} + +//////////////////////////////////////////////////////////////// + +// Double-click on window widget shows the window, or if already shown, +// it shows the control panel. +void Fl_Window_Type::open() { + Overlay_Window *w = (Overlay_Window *)o; + if (w->shown()) { + w->show(); + Fl_Widget_Type::open(); + } else { + Fl_Widget *p = w->resizable(); + if (!p) w->resizable(w); + w->show(); + w->resizable(p); + } + + w->image(Fl::scheme_bg_); + w->size_range(gridx, gridy, Fl::w(), Fl::h(), gridx, gridy, 0); +} + +// Read an image of the window +uchar *Fl_Window_Type::read_image(int &ww, int &hh) { + Overlay_Window *w = (Overlay_Window *)o; + + // Read the screen image... + return (w->read_image(ww, hh)); +} + + +// control panel items: + +void modal_cb(Fl_Light_Button* i, void* v) { + if (v == LOAD) { + if (!current_widget->is_window()) {i->hide(); return;} + i->show(); + i->value(((Fl_Window_Type *)current_widget)->modal); + } else { + ((Fl_Window_Type *)current_widget)->modal = i->value(); + set_modflag(1); + } +} + +void non_modal_cb(Fl_Light_Button* i, void* v) { + if (v == LOAD) { + if (!current_widget->is_window()) {i->hide(); return;} + i->show(); + i->value(((Fl_Window_Type *)current_widget)->non_modal); + } else { + ((Fl_Window_Type *)current_widget)->non_modal = i->value(); + set_modflag(1); + } +} + +void border_cb(Fl_Light_Button* i, void* v) { + if (v == LOAD) { + if (!current_widget->is_window()) {i->hide(); return;} + i->show(); + i->value(((Fl_Window*)(current_widget->o))->border()); + } else { + ((Fl_Window*)(current_widget->o))->border(i->value()); + set_modflag(1); + } +} + +void xclass_cb(Fl_Input* i, void* v) { + if (v == LOAD) { + if (!current_widget->is_window()) { + i->hide(); + i->parent()->hide(); // hides the "X Class:" label as well + return; + } + i->show(); + i->parent()->show(); + i->value(((Fl_Widget_Type *)current_widget)->xclass); + } else { + int mod = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + mod = 1; + Fl_Widget_Type* w = (Fl_Widget_Type*)o; + if (w->is_window() || w->is_button()) + storestring(i->value(),w->xclass); + if (w->is_window()) ((Fl_Window*)(w->o))->xclass(w->xclass); + else if (w->is_menu_item()) w->redraw(); + } + } + if (mod) set_modflag(1); + } +} + +//////////////////////////////////////////////////////////////// + +void Fl_Window_Type::setlabel(const char *n) { + if (o) ((Fl_Window *)o)->label(n); +} + +// make() is called on this widget when user picks window off New menu: +Fl_Window_Type Fl_Window_type; + +// Resize from window manager... +void Overlay_Window::resize(int X,int Y,int W,int H) { + Fl_Widget* t = resizable(); resizable(0); + + // do not set the mod flag if the window was not resized. In FLUID, all + // windows are opened without a given x/y position, so modifying x/y + // should not mark the project as dirty + if (W!=w() || H!=h()) + set_modflag(1); + + Fl_Overlay_Window::resize(X,Y,W,H); + resizable(t); + update_xywh(); +} + +// calculate actual move by moving mouse position (mx,my) to +// nearest multiple of gridsize, and snap to original position +void Fl_Window_Type::newdx() { + int mydx, mydy; + if (Fl::event_state(FL_ALT) || !snap) { + mydx = mx-x1; + mydy = my-y1; + + if (abs(mydx) < 2 && abs(mydy) < 2) mydx = mydy = 0; + } else { + int dx0 = mx-x1; + int ix = (drag&RIGHT) ? br : bx; + mydx = gridx ? ((ix+dx0+gridx/2)/gridx)*gridx - ix : dx0; + if (dx0 > snap) { + if (mydx < 0) mydx = 0; + } else if (dx0 < -snap) { + if (mydx > 0) mydx = 0; + } else + mydx = 0; + int dy0 = my-y1; + int iy = (drag&BOTTOM) ? by : bt; + mydy = gridy ? ((iy+dy0+gridy/2)/gridy)*gridy - iy : dy0; + if (dy0 > snap) { + if (mydy < 0) mydy = 0; + } else if (dy0 < -snap) { + if (mydy > 0) mydy = 0; + } else + mydy = 0; + } + + if (!(drag & (DRAG | BOX | LEFT | RIGHT))) { + mydx = 0; + dx = 0; + } + + if (!(drag & (DRAG | BOX | TOP | BOTTOM))) { + mydy = 0; + dy = 0; + } + + if (dx != mydx || dy != mydy) { + dx = mydx; dy = mydy; + ((Overlay_Window *)o)->redraw_overlay(); + } +} + +// Move a widget according to dx and dy calculated above +void Fl_Window_Type::newposition(Fl_Widget_Type *myo,int &X,int &Y,int &R,int &T) { + X = myo->o->x(); + Y = myo->o->y(); + R = X+myo->o->w(); + T = Y+myo->o->h(); + if (!drag) return; + if (drag&DRAG) { + X += dx; + Y += dy; + R += dx; + T += dy; + } else { + if (drag&LEFT) if (X==bx) X += dx; else if (Xbr+dx) R = br+dx; + if (drag&BOTTOM) if (T==bt) T += dy; else if (T>bt+dx) T = bt+dx; + } + if (Ry2) ? -1 : 1 ; + fl_yxline(x, y1, y2); + fl_xyline(x-4, y2, x+4); + fl_line(x-2, y2-dy*5, x, y2-dy); + fl_line(x+2, y2-dy*5, x, y2-dy); +} + +static void draw_h_arrow(int x1, int y, int x2) { + int dx = (x1>x2) ? -1 : 1 ; + fl_xyline(x1, y, x2); + fl_yxline(x2, y-4, y+4); + fl_line(x2-dx*5, y-2, x2-dx, y); + fl_line(x2-dx*5, y+2, x2-dx, y); +} + +static void draw_top_brace(const Fl_Widget *w) { + fl_yxline(w->x(), w->y()-2, w->y()+6); + fl_yxline(w->x()+w->w()-1, w->y()-2, w->y()+6); + fl_xyline(w->x()-2, w->y(), w->x()+w->w()+1); +} + +static void draw_left_brace(const Fl_Widget *w) { + fl_xyline(w->x()-2, w->y(), w->x()+6); + fl_xyline(w->x()-2, w->y()+w->h()-1, w->x()+6); + fl_yxline(w->x(), w->y()-2, w->y()+w->h()+1); +} + +static void draw_right_brace(const Fl_Widget *w) { + int xx = w->x() + w->w() - 1; + fl_xyline(xx-6, w->y(), xx+2); + fl_xyline(xx-6, w->y()+w->h()-1, xx+2); + fl_yxline(xx, w->y()-2, w->y()+w->h()+1); +} + +static void draw_bottom_brace(const Fl_Widget *w) { + int yy = w->y() + w->h() - 1; + fl_yxline(w->x(), yy-6, yy+2); + fl_yxline(w->x()+w->w()-1, yy-6, yy+2); + fl_xyline(w->x()-2, yy, w->x()+w->w()+1); +} + +static void draw_height(int x, int y, int b, Fl_Align a) { + char buf[16]; + int h = b - y; + sprintf(buf, "%d", h); + fl_font(FL_HELVETICA, 9); + int lw = (int)fl_width(buf); + int lx; + + b --; + if (h < 30) { + // Move height to the side... + if (a == FL_ALIGN_LEFT) lx = x - lw - 2; + else lx = x + 2; + + fl_yxline(x, y, b); + } else { + // Put height inside the arrows... + lx = x - lw / 2; + + fl_yxline(x, y, y + (h - 11) / 2); + fl_yxline(x, y + (h + 11) / 2, b); + } + + // Draw the height... + fl_draw(buf, lx, y + (h + 9) / 2); + + // Draw the arrowheads... + fl_line(x-2, y+5, x, y+1, x+2, y+5); + fl_line(x-2, b-5, x, b-1, x+2, b-5); + + // Draw the end lines... + fl_xyline(x - 4, y, x + 4); + fl_xyline(x - 4, b, x + 4); +} + +static void draw_width(int x, int y, int r, Fl_Align a) { + char buf[16]; + int w = r-x; + sprintf(buf, "%d", w); + fl_font(FL_HELVETICA, 9); + int lw = (int)fl_width(buf); + int ly = y + 4; + + r --; + + if (lw > (w - 20)) { + // Move width above/below the arrows... + if (a == FL_ALIGN_TOP) ly -= 10; + else ly += 10; + + fl_xyline(x, y, r); + } else { + // Put width inside the arrows... + fl_xyline(x, y, x + (w - lw - 2) / 2); + fl_xyline(x + (w + lw + 2) / 2, y, r); + } + + // Draw the width... + fl_draw(buf, x + (w - lw) / 2, ly); + + // Draw the arrowheads... + fl_line(x+5, y-2, x+1, y, x+5, y+2); + fl_line(r-5, y-2, r-1, y, r-5, y+2); + + // Draw the end lines... + fl_yxline(x, y - 4, y + 4); + fl_yxline(r, y - 4, y + 4); +} + +void Fl_Window_Type::draw_overlay() { + if (recalc) { + bx = o->w(); by = o->h(); br = 0; bt = 0; + numselected = 0; + for (Fl_Type *q=next; q && q->level>level; q=q->next) + if (q->selected && q->is_widget() && !q->is_menu_item()) { + numselected++; + Fl_Widget_Type* myo = (Fl_Widget_Type*)q; + if (myo->o->x() < bx) bx = myo->o->x(); + if (myo->o->y() < by) by = myo->o->y(); + if (myo->o->x()+myo->o->w() > br) br = myo->o->x()+myo->o->w(); + if (myo->o->y()+myo->o->h() > bt) bt = myo->o->y()+myo->o->h(); + } + recalc = 0; + sx = bx; sy = by; sr = br; st = bt; + } + fl_color(FL_RED); + if (drag==BOX && (x1 != mx || y1 != my)) { + int x = x1; int r = mx; if (x > r) {x = mx; r = x1;} + int y = y1; int b = my; if (y > b) {y = my; b = y1;} + fl_rect(x,y,r-x,b-y); + } + if (overlays_invisible && !drag) return; + if (selected) fl_rect(0,0,o->w(),o->h()); + if (!numselected) return; + int mybx,myby,mybr,mybt; + int mysx,mysy,mysr,myst; + mybx = mysx = o->w(); myby = mysy = o->h(); mybr = mysr = 0; mybt = myst = 0; + Fl_Type *selection = 0L; // used to store the one selected widget (if n==1) + for (Fl_Type *q=next; q && q->level>level; q = q->next) + if (q->selected && q->is_widget() && !q->is_menu_item()) { + selection = q; + Fl_Widget_Type* myo = (Fl_Widget_Type*)q; + int x,y,r,t; + newposition(myo,x,y,r,t); + if (!show_guides || !drag || numselected != 1) fl_rect(x,y,r-x,t-y); + if (x < mysx) mysx = x; + if (y < mysy) mysy = y; + if (r > mysr) mysr = r; + if (t > myst) myst = t; + if (!(myo->o->align() & FL_ALIGN_INSIDE)) { + // Adjust left/right/top/bottom for top/bottom labels... + int ww, hh; + ww = (myo->o->align() & FL_ALIGN_WRAP) ? myo->o->w() : 0; + hh = myo->o->labelsize(); + myo->o->measure_label(ww, hh); + if (myo->o->align() & FL_ALIGN_TOP) y -= hh; + else if (myo->o->align() & FL_ALIGN_BOTTOM) t += hh; + else if (myo->o->align() & FL_ALIGN_LEFT) x -= ww + 4; + else if (myo->o->align() & FL_ALIGN_RIGHT) r += ww + 4; + } + if (x < mybx) mybx = x; + if (y < myby) myby = y; + if (r > mybr) mybr = r; + if (t > mybt) mybt = t; + } + if (selected) return; + + if (show_guides && drag) { + // draw overlays for UI Guideline distances + // - check for distance to the window edge + // * FLTK suggests 10 pixels from the edge + int d; + int xsp, ysp; + int mybx_bak = mybx, myby_bak = myby, mybr_bak = mybr, mybt_bak = mybt; + Fl_Widget_Type *mysel = (Fl_Widget_Type *)selection; + + + ideal_spacing(xsp, ysp); + + if (drag) { + // Check top spacing... + if (abs(d = myby - ysp) < 3) { + dy -= d; + if (drag & DRAG) mybt -= d; + myby -= d; + draw_v_arrow(mybx+5, myby, 0); + } + + // Check bottom spacing... + if (abs(d = o->h() - mybt - ysp) < 3) { + dy += d; + if (drag & DRAG) myby += d; + mybt += d; + draw_v_arrow(mybx+5, mybt, o->h()); + } + + // Check left spacing... + if (abs(d = mybx - xsp) < 3) { + dx -= d; + if (drag & DRAG) mybr -= d; + mybx -= d; + draw_h_arrow(mybx, myby+5, 0); + } + + // Check right spacing... + if (abs(d = o->w() - mybr - xsp) < 3) { + dx += d; + if (drag & DRAG) mybx += d; + mybr += d; + draw_h_arrow(mybr, myby+5, o->w()); + } + } + + if (numselected==1 && selection && !(drag & DRAG)) { + // Check ideal sizes + int x,y,r,t; + newposition(mysel,x,y,r,t); + int w = r-x; + int h = t-y; + int iw = w, ih = h; + + mysel->ideal_size(iw, ih); + + if (drag & (TOP | BOTTOM)) { + // Check height + if (abs(d = ih - h) < 5) { + // Resize height + if (drag & TOP) { + myby -= d; + y -= d; + dy -= d; + } else { + mybt += d; + t += d; + dy += d; + } + } + + // Draw height guide + draw_height(x < 50 ? x+10 : x-10, y, t, + x < 50 ? FL_ALIGN_RIGHT : FL_ALIGN_LEFT); + } + + if (drag & (LEFT | RIGHT)) { + // Check width + if (abs(d = iw - w) < 5) { + // Resize width + if (drag & LEFT) { + mybx -= d; + x -= d; + dx -= d; + } else { + mybr += d; + r += d; + dx += d; + } + } + + // Draw width guide + draw_width(x, y < 50 ? y+10 : y-10, r, + y < 50 ? FL_ALIGN_BOTTOM : FL_ALIGN_TOP); + } + } + + // Check spacing and alignment between individual widgets + if (drag && selection->is_widget()) { + for (Fl_Type *q=next; q && q->level>level; q = q->next) + if (q != selection && q->is_widget()) { + Fl_Widget_Type *qw = (Fl_Widget_Type*)q; + // Only check visible widgets... + if (!qw->o->visible_r()) continue; + + // Get bounding box of widget... + int qx = qw->o->x(); + int qr = qw->o->x() + qw->o->w(); + int qy = qw->o->y(); + int qt = qw->o->y() + qw->o->h(); + + if (!(qw->o->align() & FL_ALIGN_INSIDE)) { + // Adjust top/bottom for top/bottom labels... + int ww, hh; + ww = qw->o->w(); + hh = qw->o->labelsize(); + qw->o->measure_label(ww, hh); + if (qw->o->align() & FL_ALIGN_TOP) qy -= hh; + if (qw->o->align() & FL_ALIGN_BOTTOM) qt += hh; + } + + // Do horizontal alignment when the widget is within 25 + // pixels vertically... + if (fl_min(abs(qy - mysel->o->y() - mysel->o->h()), + abs(mysel->o->y() - qt)) < 25) { + // Align to left of other widget... + if ((drag & (LEFT | DRAG)) && abs(d = mybx - qx) < 3) { + dx += d; + mybx += d; + if (drag & DRAG) mybr += d; + + draw_left_brace(qw->o); + } + + // Align to right of other widget... + if ((drag & (RIGHT | DRAG)) && + abs(d = qr - mybr) < 3) { + dx += d; + if (drag & DRAG) mybx += d; + mybr += d; + + draw_right_brace(qw->o); + } + } + + // Align to top of other widget... + if ((drag & (TOP | DRAG)) && abs(d = myby - qy) < 3) { + dy += d; + myby += d; + if (drag & DRAG) mybt += d; + + draw_top_brace(qw->o); + } + + // Align to bottom of other widget... + if ((drag & (BOTTOM | DRAG)) && abs(d = qt - mybt) < 3) { + dy += d; + if (drag & DRAG) myby += d; + mybt += d; + + draw_bottom_brace(qw->o); + } + + // Check spacing between widgets + if (mysel->is_group()) mysel->ideal_spacing(xsp, ysp); + else qw->ideal_spacing(xsp, ysp); + + if ((qt)>=myby && qy<=mybt) { + if (drag & (LEFT | DRAG)) { + // Compare left of selected to left of current + if (abs(d = qx - mybx - xsp) >= 3) + d = qx - mybx + xsp; + + if (abs(d) < 3) { + dx += d; + mybx += d; + if (drag & DRAG) mybr += d; + + // Draw left arrow + draw_h_arrow(mybx, (myby+mybt)/2, qx); + } + + // Compare left of selected to right of current + if (abs(d = qr - mybx - xsp) >= 3) + d = qr - mybx + xsp; + + if (abs(d) < 3) { + dx += d; + mybx += d; + if (drag & DRAG) mybr += d; + + // Draw left arrow + draw_h_arrow(mybx, (myby+mybt)/2, qr); + } + } + + if (drag & (RIGHT | DRAG)) { + // Compare right of selected to left of current + if (abs(d = qx - mybr - xsp) >= 3) + d = qx - mybr + xsp; + + if (abs(d) < 3) { + dx += d; + if (drag & DRAG) mybx += d; + mybr += d; + + // Draw right arrow + draw_h_arrow(mybr, (myby+mybt)/2, qx); + } + + // Compare right of selected to right of current + if (abs(d = qr - mybr + xsp) >= 3) + d = qr - mybr - xsp; + + if (abs(d) < 3) { + dx += d; + if (drag & DRAG) mybx += d; + mybr += d; + + // Draw right arrow + draw_h_arrow(mybr, (myby+mybt)/2, qr); + } + } + } + + if (qr>=mybx && qx<=mybr) { + // Compare top of selected to top of current + if (drag & (TOP | DRAG)) { + if (abs(d = qy - myby - ysp) >= 3) + d = qy - myby + ysp; + + if (abs(d) < 3) { + dy += d; + myby += d; + if (drag & DRAG) mybt += d; + + // Draw up arrow... + draw_v_arrow((mybx+mybr)/2, myby, qy); + } + + // Compare top of selected to bottom of current + if (abs(d = qt - myby - ysp) >= 3) + d = qt - myby + ysp; + + if (abs(d) < 3) { + dy += d; + myby += d; + if (drag & DRAG) mybt += d; + + // Draw up arrow... + draw_v_arrow((mybx+mybr)/2, myby, qt); + } + } + + // Compare bottom of selected to top of current + if (drag & (BOTTOM | DRAG)) { + if (abs(d = qy - mybt - ysp) >= 3) + d = qy - mybt + ysp; + + if (abs(d) < 3) { + dy += d; + if (drag & DRAG) myby += d; + mybt += d; + + // Draw down arrow... + draw_v_arrow((mybx+mybr)/2, mybt, qy); + } + + // Compare bottom of selected to bottom of current + if (abs(d = qt - mybt - ysp) >= 3) + d = qt - mybt + ysp; + + if (abs(d) < 3) { + dy += d; + if (drag & DRAG) myby += d; + mybt += d; + + // Draw down arrow... + draw_v_arrow((mybx+mybr)/2, mybt, qt); + } + } + } + } + } + mysx += mybx-mybx_bak; mysr += mybr-mybr_bak; + mysy += myby-myby_bak; myst += mybt-mybt_bak; + } + // align the snapping selection box with the box we draw. + sx = mysx; sy = mysy; sr = mysr; st = myst; + + // Draw selection box + resize handles... + // draw box including all labels + fl_line_style(FL_DOT); + fl_rect(mybx,myby,mybr-mybx,mybt-myby); + fl_line_style(FL_SOLID); + // draw box excluding labels + fl_rect(mysx,mysy,mysr-mysx,myst-mysy); + fl_rectf(mysx,mysy,5,5); + fl_rectf(mysr-5,mysy,5,5); + fl_rectf(mysr-5,myst-5,5,5); + fl_rectf(mysx,myst-5,5,5); +} + +extern Fl_Menu_Item Main_Menu[]; + +// Calculate new bounding box of selected widgets: +void Fl_Window_Type::fix_overlay() { + Main_Menu[40].label("Hide O&verlays"); + overlays_invisible = 0; + recalc = 1; + ((Overlay_Window *)(this->o))->redraw_overlay(); +} + +// do that for every window (when selected set changes): +void redraw_overlays() { + for (Fl_Type *o=Fl_Type::first; o; o=o->next) + if (o->is_window()) ((Fl_Window_Type*)o)->fix_overlay(); +} + +void toggle_overlays(Fl_Widget *,void *) { + overlays_invisible = !overlays_invisible; + + if (overlays_invisible) Main_Menu[40].label("Show O&verlays"); + else Main_Menu[40].label("Hide O&verlays"); + + for (Fl_Type *o=Fl_Type::first; o; o=o->next) + if (o->is_window()) { + Fl_Widget_Type* w = (Fl_Widget_Type*)o; + ((Overlay_Window*)(w->o))->redraw_overlay(); + } +} + +extern void select(Fl_Type *,int); +extern void select_only(Fl_Type *); +extern void deselect(); +extern Fl_Type* in_this_only; +extern void fix_group_size(Fl_Type *t); + +extern Fl_Menu_Item Main_Menu[]; +extern Fl_Menu_Item New_Menu[]; + +// move the selected children according to current dx,dy,drag state: +void Fl_Window_Type::moveallchildren() +{ + undo_checkpoint(); + Fl_Type *i; + for (i=next; i && i->level>level;) { + if (i->selected && i->is_widget() && !i->is_menu_item()) { + Fl_Widget_Type* myo = (Fl_Widget_Type*)i; + int x,y,r,t; + newposition(myo,x,y,r,t); + myo->o->resize(x,y,r-x,t-y); + // move all the children, whether selected or not: + Fl_Type* p; + for (p = myo->next; p && p->level>myo->level; p = p->next) + if (p->is_widget() && !p->is_menu_item()) { + Fl_Widget_Type* myo2 = (Fl_Widget_Type*)p; + int X,Y,R,T; + newposition(myo2,X,Y,R,T); + myo2->o->resize(X,Y,R-X,T-Y); + } + i = p; + } else { + i = i->next; + } + } + for (i=next; i && i->level>level; i=i->next) + fix_group_size(i); + o->redraw(); + recalc = 1; + ((Overlay_Window *)(this->o))->redraw_overlay(); + set_modflag(1); + dx = dy = 0; + + update_xywh(); +} + +int Fl_Window_Type::handle(int event) { + static Fl_Type* selection; + switch (event) { + case FL_PUSH: + x1 = mx = Fl::event_x(); + y1 = my = Fl::event_y(); + drag = dx = dy = 0; + // test for popup menu: + if (Fl::event_button() >= 3) { + in_this_only = this; // modifies how some menu items work. + static const Fl_Menu_Item* myprev; + const Fl_Menu_Item* m = New_Menu->popup(mx,my,"New",myprev); + if (m && m->callback()) {myprev = m; m->do_callback(this->o);} + in_this_only = 0; + return 1; + } + // find the innermost item clicked on: + selection = this; + {for (Fl_Type* i=next; i && i->level>level; i=i->next) + if (i->is_widget() && !i->is_menu_item()) { + Fl_Widget_Type* myo = (Fl_Widget_Type*)i; + for (Fl_Widget *o1 = myo->o; o1; o1 = o1->parent()) + if (!o1->visible()) goto CONTINUE2; + if (Fl::event_inside(myo->o)) { + selection = myo; + if (Fl::event_clicks()==1) + reveal_in_browser(myo); + } + CONTINUE2:; + }} + // see if user grabs edges of selected region: + if (numselected && !(Fl::event_state(FL_SHIFT)) && + mx<=br+snap && mx>=bx-snap && my<=bt+snap && my>=by-snap) { + int snap1 = snap>5 ? snap : 5; + int w1 = (br-bx)/4; if (w1 > snap1) w1 = snap1; + if (mx>=br-w1) drag |= RIGHT; + else if (mx snap1) w1 = snap1; + if (my<=by+w1) drag |= TOP; + else if (my>bt-w1) drag |= BOTTOM; + if (!drag) drag = DRAG; + } + // do object-specific selection of other objects: + {Fl_Type* t = selection->click_test(mx, my); + if (t) { + //if (t == selection) return 1; // indicates mouse eaten w/o change + if (Fl::event_state(FL_SHIFT)) { + Fl::event_is_click(0); + select(t, !t->selected); + } else { + deselect(); + select(t, 1); + if (t->is_menu_item()) t->open(); + } + selection = t; + drag = 0; + } else { + if (!drag) drag = BOX; // if all else fails, start a new selection region + }} + return 1; + + case FL_DRAG: + if (!drag) return 0; + mx = Fl::event_x(); + my = Fl::event_y(); + newdx(); + return 1; + + case FL_RELEASE: + if (!drag) return 0; + mx = Fl::event_x(); + my = Fl::event_y(); + if (drag != BOX && (dx || dy || !Fl::event_is_click())) { + if (dx || dy) moveallchildren(); + } else if ((Fl::event_clicks() || Fl::event_state(FL_CTRL))) { + Fl_Widget_Type::open(); + } else { + if (mxlevel>level; i=i->next) + if (i->is_widget() && !i->is_menu_item()) { + Fl_Widget_Type* myo = (Fl_Widget_Type*)i; + for (Fl_Widget *o1 = myo->o; o1; o1 = o1->parent()) + if (!o1->visible()) goto CONTINUE; + if (Fl::event_inside(myo->o)) selection = myo; + if (myo->o->x()>=x1 && myo->o->y()>y1 && + myo->o->x()+myo->o->w()o->y()+myo->o->h()selected : 1); + } + CONTINUE:; + } + // if nothing in box, select what was clicked on: + if (!n) { + select(selection, toggle ? !selection->selected : 1); + } + } + drag = 0; + ((Overlay_Window *)o)->redraw_overlay(); + return 1; + + case FL_KEYBOARD: { + + int backtab = 0; + switch (Fl::event_key()) { + + case FL_Escape: + ((Fl_Window*)o)->hide(); + return 1; + + case 0xFE20: // backtab + backtab = 1; + case FL_Tab: { + if (Fl::event_state(FL_SHIFT)) backtab = 1; + // find current child: + Fl_Type *i = Fl_Type::current; + while (i && (!i->is_widget() || i->is_menu_item())) i = i->parent; + if (!i) return 0; + Fl_Type *p = i->parent; + while (p && p != this) p = p->parent; + if (!p || !p->is_widget()) { + i = next; if (!i || i->level <= level) return 0; + } + p = i; + for (;;) { + i = backtab ? i->prev : i->next; + if (!i || i->level <= level) {i = p; break;} + if (i->is_widget() && !i->is_menu_item()) break; + } + deselect(); select(i,1); + return 1;} + + case FL_Left: dx = -1; dy = 0; goto ARROW; + case FL_Right: dx = +1; dy = 0; goto ARROW; + case FL_Up: dx = 0; dy = -1; goto ARROW; + case FL_Down: dx = 0; dy = +1; goto ARROW; + ARROW: + // for some reason BOTTOM/TOP are swapped... should be fixed... + drag = (Fl::event_state(FL_SHIFT)) ? (RIGHT|TOP) : DRAG; + if (Fl::event_state(FL_CTRL)) {dx *= gridx; dy *= gridy;} + moveallchildren(); + drag = 0; + return 1; + + case 'o': + toggle_overlays(0, 0); + break; + + default: + return 0; + }} + + case FL_SHORTCUT: { + in_this_only = this; // modifies how some menu items work. + const Fl_Menu_Item* m = Main_Menu->test_shortcut(); + if (m && m->callback()) m->do_callback(this->o); + in_this_only = 0; + return (m != 0);} + + default: + return 0; + } +} + +//////////////////////////////////////////////////////////////// + +#include +#include "../src/flstring.h" + +void Fl_Window_Type::write_code1() { + Fl_Widget_Type::write_code1(); +} + +void Fl_Window_Type::write_code2() { + const char *var = is_class() ? "this" : name() ? name() : "o"; + write_extra_code(); + if (modal) write_c("%s%s->set_modal();\n", indent(), var); + else if (non_modal) write_c("%s%s->set_non_modal();\n", indent(), var); + if (!((Fl_Window*)o)->border()) { + write_c("%s%s->clear_border();\n", indent(), var); + } + if (xclass) { + write_c("%s%s->xclass(", indent(), var); + write_cstring(xclass); + write_c(");\n"); + } + if (sr_max_w || sr_max_h) { + write_c("%s%s->size_range(%d, %d, %d, %d);\n", indent(), var, + sr_min_w, sr_min_h, sr_max_w, sr_max_h); + } else if (sr_min_w || sr_min_h) { + write_c("%s%s->size_range(%d, %d);\n", indent(), var, sr_min_w, sr_min_h); + } + write_c("%s%s->end();\n", indent(), var); + if (((Fl_Window*)o)->resizable() == o) + write_c("%s%s->resizable(%s);\n", indent(), var, var); + write_block_close(); +} + +void Fl_Window_Type::write_properties() { + Fl_Widget_Type::write_properties(); + if (modal) write_string("modal"); + else if (non_modal) write_string("non_modal"); + if (!((Fl_Window*)o)->border()) write_string("noborder"); + if (xclass) {write_string("xclass"); write_word(xclass);} + if (sr_min_w || sr_min_h || sr_max_w || sr_max_h) + write_string("size_range {%d %d %d %d}", sr_min_w, sr_min_h, sr_max_w, sr_max_h); + if (o->visible()) write_string("visible"); +} + +extern int pasteoffset; +void Fl_Window_Type::read_property(const char *c) { + if (!strcmp(c,"modal")) { + modal = 1; + } else if (!strcmp(c,"non_modal")) { + non_modal = 1; + } else if (!strcmp(c, "visible")) { + if (Fl::first_window()) open(); // only if we are using user interface + } else if (!strcmp(c,"noborder")) { + ((Fl_Window*)o)->border(0); + } else if (!strcmp(c,"xclass")) { + storestring(read_word(),xclass); + ((Fl_Window*)o)->xclass(xclass); + } else if (!strcmp(c,"size_range")) { + int mw, mh, MW, MH; + if (sscanf(read_word(),"%d %d %d %d",&mw,&mh,&MW,&MH) == 4) { + sr_min_w = mw; sr_min_h = mh; sr_max_w = MW; sr_max_h = MH; + } + } else if (!strcmp(c,"xywh")) { + Fl_Widget_Type::read_property(c); + pasteoffset = 0; // make it not apply to contents + } else { + Fl_Widget_Type::read_property(c); + } +} + +int Fl_Window_Type::read_fdesign(const char* propname, const char* value) { + int x; + o->box(FL_NO_BOX); // because fdesign always puts an Fl_Box next + if (!strcmp(propname,"Width")) { + if (sscanf(value,"%d",&x) == 1) o->size(x,o->h()); + } else if (!strcmp(propname,"Height")) { + if (sscanf(value,"%d",&x) == 1) o->size(o->w(),x); + } else if (!strcmp(propname,"NumberofWidgets")) { + return 1; // we can figure out count from file + } else if (!strcmp(propname,"border")) { + if (sscanf(value,"%d",&x) == 1) ((Fl_Window*)o)->border(x); + } else if (!strcmp(propname,"title")) { + label(value); + } else { + return Fl_Widget_Type::read_fdesign(propname,value); + } + return 1; +} + +/////////////////////////////////////////////////////////////////////// + +Fl_Widget_Class_Type Fl_Widget_Class_type; +Fl_Widget_Class_Type *current_widget_class = 0; + +Fl_Type *Fl_Widget_Class_Type::make() { + Fl_Type *p = Fl_Type::current; + while (p && (!p->is_decl_block() || (p->is_widget() && p->is_class()))) p = p->parent; + Fl_Widget_Class_Type *myo = new Fl_Widget_Class_Type(); + myo->name("UserInterface"); + + if (!this->o) {// template widget + this->o = new Fl_Window(100,100); + Fl_Group::current(0); + } + // Set the size ranges for this window; in order to avoid opening the + // X display we use an arbitrary maximum size... + ((Fl_Window *)(this->o))->size_range(gridx, gridy, + 3072, 2048, + gridx, gridy, 0); + myo->factory = this; + myo->drag = 0; + myo->numselected = 0; + Overlay_Window *w = new Overlay_Window(100,100); + w->window = myo; + myo->o = w; + myo->add(p); + myo->modal = 0; + myo->non_modal = 0; + myo->wc_relative = 0; + + return myo; +} + +void Fl_Widget_Class_Type::write_properties() { + Fl_Window_Type::write_properties(); + if (wc_relative) write_string("position_relative"); +} + +void Fl_Widget_Class_Type::read_property(const char *c) { + if (!strcmp(c,"position_relative")) { + wc_relative = 1; + } else { + Fl_Window_Type::read_property(c); + } +} + +void Fl_Widget_Class_Type::write_code1() { +#if 0 + Fl_Widget_Type::write_code1(); +#endif // 0 + + current_widget_class = this; + write_public_state = 1; + + const char *c = subclass(); + if (!c) c = "Fl_Group"; + + write_h("\nclass %s : public %s {\n", name(), c); + if (strstr(c, "Window")) { + write_h(" void _%s();\n", name()); + write_h("public:\n"); + write_h(" %s(int X, int Y, int W, int H, const char *L = 0);\n", name()); + write_h(" %s(int W, int H, const char *L = 0);\n", name()); + + write_c("%s::%s(int X, int Y, int W, int H, const char *L)\n", name(), name()); + write_c(" : %s(X, Y, W, H, L) {\n", c); + write_c(" _%s();\n", name()); + write_c("}\n\n"); + + write_c("%s::%s(int W, int H, const char *L)\n", name(), name()); + write_c(" : %s(0, 0, W, H, L) {\n", c); + write_c(" clear_flag(16);\n"); + write_c(" _%s();\n", name()); + write_c("}\n\n"); + + write_c("void %s::_%s() {\n", name(), name()); +// write_c(" %s *w = this;\n", name()); + } else { + write_h("public:\n"); + write_h(" %s(int X, int Y, int W, int H, const char *L = 0);\n", name()); + + write_c("%s::%s(int X, int Y, int W, int H, const char *L)\n", name(), name()); + if (wc_relative) + write_c(" : %s(0, 0, W, H, L) {\n", c); + else + write_c(" : %s(X, Y, W, H, L) {\n", c); + } + +// write_c(" %s *o = this;\n", name()); + + write_widget_code(); +} + +void Fl_Widget_Class_Type::write_code2() { + write_extra_code(); + if (wc_relative) write_c("%sposition(X, Y);\n", indent()); + if (modal) write_c("%sset_modal();\n", indent()); + else if (non_modal) write_c("%sset_non_modal();\n", indent()); + if (!((Fl_Window*)o)->border()) write_c("%sclear_border();\n", indent()); + if (xclass) { + write_c("%sxclass(", indent()); + write_cstring(xclass); + write_c(");\n"); + } + write_c("%send();\n", indent()); + if (((Fl_Window*)o)->resizable() == o) + write_c("%sresizable(this);\n", indent()); + write_c("}\n"); +} + +//////////////////////////////////////////////////////////////// +// live mode support + +Fl_Widget *Fl_Window_Type::enter_live_mode(int) { + Fl_Window *win = new Fl_Window(o->x(), o->y(), o->w(), o->h()); + live_widget = win; + if (live_widget) { + copy_properties(); + Fl_Type *n; + for (n = next; n && n->level > level; n = n->next) { + if (n->level == level+1) + n->enter_live_mode(); + } + win->end(); + } + return live_widget; +} + +void Fl_Window_Type::leave_live_mode() { +} + +/** + * copy all properties from the edit widget to the live widget + */ +void Fl_Window_Type::copy_properties() { + Fl_Widget_Type::copy_properties(); + /// \todo copy resizing constraints over +} + + +// +// End of "$Id: Fl_Window_Type.cxx 6098 2008-04-12 18:04:09Z matt $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/Fluid_Image.cxx b/third_party/windows/fltk-1.1.10/fluid/Fluid_Image.cxx new file mode 100644 index 0000000..1b555de --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/Fluid_Image.cxx @@ -0,0 +1,229 @@ +// +// "$Id: Fluid_Image.cxx 5266 2006-07-26 19:52:28Z mike $" +// +// Pixmap label support for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2006 by Bill Spitzak and others. +// +// 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 +#include +#include "Fl_Type.h" +#include "Fluid_Image.h" +#include "../src/flstring.h" +#include +#include +#include +#include + +extern void goto_source_dir(); // in fluid.C +extern void leave_source_dir(); // in fluid.C + +void Fluid_Image::image(Fl_Widget *o) { + if (o->window() != o) o->image(img); +} + +void Fluid_Image::deimage(Fl_Widget *o) { + if (o->window() != o) o->deimage(img); +} + +static int pixmap_header_written = 0; +static int bitmap_header_written = 0; +static int image_header_written = 0; + +void Fluid_Image::write_static() { + if (!img) return; + if (img->count() > 1) { + // Write Pixmap data... + write_c("\n"); + if (pixmap_header_written != write_number) { + write_c("#include \n"); + pixmap_header_written = write_number; + } + write_c("static const char *%s[] = {\n", + unique_id(this, "idata", fl_filename_name(name()), 0)); + write_cstring(img->data()[0], strlen(img->data()[0])); + + int i; + int ncolors, chars_per_color; + sscanf(img->data()[0], "%*d%*d%d%d", &ncolors, &chars_per_color); + + if (ncolors < 0) { + write_c(",\n"); + write_cstring(img->data()[1], ncolors * -4); + i = 2; + } else { + for (i = 1; i <= ncolors; i ++) { + write_c(",\n"); + write_cstring(img->data()[i], strlen(img->data()[i])); + } + } + for (; i < img->count(); i ++) { + write_c(",\n"); + write_cstring(img->data()[i], img->w() * chars_per_color); + } + write_c("\n};\n"); + write_c("static Fl_Pixmap %s(%s);\n", + unique_id(this, "image", fl_filename_name(name()), 0), + unique_id(this, "idata", fl_filename_name(name()), 0)); + } else if (img->d() == 0) { + // Write Bitmap data... + write_c("\n"); + if (bitmap_header_written != write_number) { + write_c("#include \n"); + bitmap_header_written = write_number; + } + write_c("static unsigned char %s[] =\n", + unique_id(this, "idata", fl_filename_name(name()), 0)); + write_cdata(img->data()[0], ((img->w() + 7) / 8) * img->h()); + write_c(";\n"); + write_c("static Fl_Bitmap %s(%s, %d, %d);\n", + unique_id(this, "image", fl_filename_name(name()), 0), + unique_id(this, "idata", fl_filename_name(name()), 0), + img->w(), img->h()); + } else { + // Write image data... + write_c("\n"); + if (image_header_written != write_number) { + write_c("#include \n"); + image_header_written = write_number; + } + write_c("static unsigned char %s[] =\n", + unique_id(this, "idata", fl_filename_name(name()), 0)); + write_cdata(img->data()[0], (img->w() * img->d() + img->ld()) * img->h()); + write_c(";\n"); + write_c("static Fl_RGB_Image %s(%s, %d, %d, %d, %d);\n", + unique_id(this, "image", fl_filename_name(name()), 0), + unique_id(this, "idata", fl_filename_name(name()), 0), + img->w(), img->h(), img->d(), img->ld()); + } +} + +void Fluid_Image::write_code(const char *var, int inactive) { + if (!img) return; + write_c("%s%s->%s(%s);\n", indent(), var, inactive ? "deimage" : "image", + unique_id(this, "image", fl_filename_name(name()), 0)); +} + + +//////////////////////////////////////////////////////////////// + +static Fluid_Image** images = 0; // sorted list +static int numimages = 0; +static int tablesize = 0; + +Fluid_Image* Fluid_Image::find(const char *iname) { + if (!iname || !*iname) return 0; + + // first search to see if it exists already: + int a = 0; + int b = numimages; + while (a < b) { + int c = (a+b)/2; + int i = strcmp(iname,images[c]->name_); + if (i < 0) b = c; + else if (i > 0) a = c+1; + else return images[c]; + } + + // no, so now see if the file exists: + + goto_source_dir(); + FILE *f = fopen(iname,"rb"); + if (!f) { + read_error("%s : %s",iname,strerror(errno)); + leave_source_dir(); + return 0; + } + fclose(f); + + Fluid_Image *ret = new Fluid_Image(iname); + + if (!ret->img || !ret->img->w() || !ret->img->h()) { + delete ret; + ret = 0; + read_error("%s : unrecognized image format", iname); + } + leave_source_dir(); + if (!ret) return 0; + + // make a new entry in the table: + numimages++; + if (numimages > tablesize) { + tablesize = tablesize ? 2*tablesize : 16; + if (images) images = (Fluid_Image**)realloc(images, tablesize*sizeof(Fluid_Image*)); + else images = (Fluid_Image**)malloc(tablesize*sizeof(Fluid_Image*)); + } + for (b = numimages-1; b > a; b--) images[b] = images[b-1]; + images[a] = ret; + + return ret; +} + +Fluid_Image::Fluid_Image(const char *iname) { + name_ = strdup(iname); + written = 0; + refcount = 0; + img = Fl_Shared_Image::get(iname); +} + +void Fluid_Image::increment() { + ++refcount; +} + +void Fluid_Image::decrement() { + --refcount; + if (refcount > 0) return; + delete this; +} + +Fluid_Image::~Fluid_Image() { + int a; + if (images) { + for (a = 0;; a++) if (images[a] == this) break; + numimages--; + for (; a < numimages; a++) images[a] = images[a+1]; + } + if (img) img->release(); + free((void*)name_); +} + +//////////////////////////////////////////////////////////////// + +#include + +const char *ui_find_image_name; +Fluid_Image *ui_find_image(const char *oldname) { + goto_source_dir(); + fl_file_chooser_ok_label("Use Image"); + const char *name = fl_file_chooser("Image?","Image Files (*.{bm,bmp,gif,jpg,pbm,pgm,png,ppm,xbm,xpm})",oldname,1); + fl_file_chooser_ok_label(NULL); + ui_find_image_name = name; + Fluid_Image *ret = (name && *name) ? Fluid_Image::find(name) : 0; + leave_source_dir(); + return ret; +} + + +// +// End of "$Id: Fluid_Image.cxx 5266 2006-07-26 19:52:28Z mike $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/Fluid_Image.h b/third_party/windows/fltk-1.1.10/fluid/Fluid_Image.h new file mode 100644 index 0000000..fa74835 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/Fluid_Image.h @@ -0,0 +1,66 @@ +// +// "$Id: Fluid_Image.h 5266 2006-07-26 19:52:28Z mike $" +// +// Image header file for the Fast Light Tool Kit (FLTK). +// +// This class stores the image labels for widgets in fluid. This is +// not a class in FLTK itself, and will produce different types of +// code depending on what the image type is. +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 FLUID_IMAGE_H +# define FLUID_IMAGE_H + +# include + + +class Fluid_Image { + const char *name_; + int refcount; + Fl_Shared_Image *img; +protected: + Fluid_Image(const char *name); // no public constructor + ~Fluid_Image(); // no public destructor +public: + int written; + static Fluid_Image* find(const char *); + void decrement(); // reference counting & automatic free + void increment(); + void image(Fl_Widget *); // set the image of this widget + void deimage(Fl_Widget *); // set the deimage of this widget + void write_static(); + void write_code(const char *var, int inactive = 0); + const char *name() const {return name_;} +}; + +// pop up file chooser and return a legal image selected by user, +// or zero for any errors: +Fluid_Image *ui_find_image(const char *); +extern const char *ui_find_image_name; + +#endif + +// +// End of "$Id: Fluid_Image.h 5266 2006-07-26 19:52:28Z mike $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/Makefile b/third_party/windows/fltk-1.1.10/fluid/Makefile new file mode 100644 index 0000000..cc7a662 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/Makefile @@ -0,0 +1,137 @@ +# +# "$Id: Makefile 6612 2008-12-29 20:21:29Z matt $" +# +# FLUID makefile for the Fast Light Tool Kit (FLTK). +# +# Copyright 1998-2007 by Bill Spitzak and others. +# +# 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 +# + +CPPFILES = \ + CodeEditor.cxx \ + Fl_Function_Type.cxx \ + Fl_Group_Type.cxx \ + Fl_Menu_Type.cxx \ + Fl_Type.cxx \ + Fl_Widget_Type.cxx \ + Fl_Window_Type.cxx \ + Fluid_Image.cxx \ + about_panel.cxx \ + align_widget.cxx \ + alignment_panel.cxx \ + code.cxx \ + factory.cxx \ + file.cxx \ + fluid.cxx \ + function_panel.cxx \ + template_panel.cxx \ + undo.cxx \ + widget_panel.cxx + +################################################################ + +OBJECTS = $(CPPFILES:.cxx=.o) + +include ../makeinclude + +all: $(FLUID) fluid$(EXEEXT) + +fluid$(EXEEXT): $(OBJECTS) $(LIBNAME) $(FLLIBNAME) \ + $(IMGLIBNAME) + echo Linking $@... + $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LINKFLTKFORMS) $(LINKFLTKIMG) $(LDLIBS) + $(OSX_ONLY) $(INSTALL_BIN) fluid fluid.app/Contents/MacOS + $(POSTBUILD) $@ ../FL/mac.r + +fluid-shared$(EXEEXT): $(OBJECTS) ../src/$(DSONAME) ../src/$(FLDSONAME) \ + ../src/$(IMGDSONAME) + echo Linking $@... + $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LINKSHARED) $(LDLIBS) + $(POSTBUILD) $@ ../FL/mac.r + +clean: + -$(RM) *.o core.* *~ *.bck *.bck + -$(RM) core fluid$(EXEEXT) fluid-shared$(EXEEXT) + -$(RM) fluid.app/Contents/MacOS/fluid$(EXEEXT) + +depend: $(CPPFILES) + makedepend -Y -I.. -f makedepend $(CPPFILES) + +# Automatically generated dependencies... +include makedepend + +install: all + echo "Installing FLUID in $(DESTDIR)$(bindir)..." + -$(INSTALL_DIR) $(DESTDIR)$(bindir) + $(INSTALL_BIN) $(FLUID) $(DESTDIR)$(bindir)/fluid$(EXEEXT) + +install-linux: + -$(INSTALL_DIR) $(DESTDIR)/usr/share/applications + $(INSTALL_DATA) fluid.desktop $(DESTDIR)/usr/share/applications + for size in 16 32 48 64 128; do \ + if test ! -d $(DESTDIR)/usr/share/icons/hicolor/$${size}x$${size}/apps; then \ + $(INSTALL_DIR) $(DESTDIR)/usr/share/icons/hicolor/$${size}x$${size}/apps; \ + fi; \ + $(INSTALL_DATA) icons/fluid-$$size.png $(DESTDIR)/usr/share/icons/hicolor/$${size}x$${size}/apps/fluid.png; \ + done + -$(INSTALL_DIR) $(DESTDIR)/usr/share/mimelnk/application + $(INSTALL_DATA) x-fluid.desktop $(DESTDIR)/usr/share/mimelnk/application + +install-osx: + echo Installing Fluid in $(DESTDIR)/Applications... + -$(INSTALL_DIR) $(DESTDIR)/Applications/fluid.app + -$(INSTALL_DIR) $(DESTDIR)/Applications/fluid.app/Contents + $(INSTALL_DATA) fluid.app/Contents/Info.plist $(DESTDIR)/Applications/fluid.app/Contents/Info.plist + $(INSTALL_DATA) fluid.app/Contents/PkgInfo $(DESTDIR)/Applications/fluid.app/Contents/PkgInfo + -$(INSTALL_DIR) $(DESTDIR)/Applications/fluid.app/Contents/MacOS + $(RM) $(DESTDIR)/Applications/fluid.app/Contents/MacOS/fluid + $(LN) $(bindir)/fluid $(DESTDIR)/Applications/fluid.app/Contents/MacOS/fluid + -$(INSTALL_DIR) $(DESTDIR)/Applications/fluid.app/Contents/Resources + $(INSTALL_DATA) fluid.app/Contents/Resources/fluid.icns $(DESTDIR)/Applications/fluid.app/Contents/Resources + +uninstall: + $(RM) $(DESTDIR)$(bindir)/fluid$(EXEEXT) + +uninstall-linux: + $(RM) $(DESTDIR)/usr/share/applications/fluid.desktop + $(RM) $(DESTDIR)/usr/share/icons/hicolor/*/fluid.png + $(RM) $(DESTDIR)/usr/share/mimelnk/application/x-fluid.desktop + +uninstall-osx: + $(RM) -r $(DESTDIR)/Applications/fluid.app + + +# +# Note: The rebuild target can only be used if you have the original .fl +# files. This is normally only used by the FLTK maintainers... +# + +rebuild: + ./fluid -c about_panel.fl + ./fluid -c alignment_panel.fl + ./fluid -c function_panel.fl + ./fluid -c print_panel.fl + ./fluid -c template_panel.fl + ./fluid -c widget_panel.fl + +# +# End of "$Id: Makefile 6612 2008-12-29 20:21:29Z matt $". +# diff --git a/third_party/windows/fltk-1.1.10/fluid/Shortcut_Button.h b/third_party/windows/fltk-1.1.10/fluid/Shortcut_Button.h new file mode 100644 index 0000000..7ed8c23 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/Shortcut_Button.h @@ -0,0 +1,41 @@ +// +// "$Id: Shortcut_Button.h 4288 2005-04-16 00:13:17Z mike $" +// +// Shortcut header file for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 + +class Shortcut_Button : public Fl_Button { +public: + int svalue; + int handle(int); + void draw(); + Shortcut_Button(int X,int Y,int W,int H, const char* l = 0) : + Fl_Button(X,Y,W,H,l) {svalue = 0;} +}; + +// +// End of "$Id: Shortcut_Button.h 4288 2005-04-16 00:13:17Z mike $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/about_panel.cxx b/third_party/windows/fltk-1.1.10/fluid/about_panel.cxx new file mode 100644 index 0000000..312180f --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/about_panel.cxx @@ -0,0 +1,306 @@ +// +// "$Id: about_panel.cxx 6817 2009-07-02 09:42:17Z AlbrechtS $" +// +// About dialog for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2009 by Bill Spitzak and others. +// +// 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 +// + +// generated by Fast Light User Interface Designer (fluid) version 1.0110 + +#include "about_panel.h" +void show_help(const char *name); + +Fl_Double_Window *about_panel=(Fl_Double_Window *)0; + +#include +static const char *idata_fluid[] = { +"96 96 32 1", +" \tc None", +".\tc #000100", +"+\tc #031F3F", +"@\tc #00366C", +"#\tc #2E302D", +"$\tc #0058AC", +"%\tc #0060BF", +"&\tc #4E504D", +"*\tc #14659F", +"=\tc #006DDC", +"-\tc #2C7087", +";\tc #0080FF", +">\tc #407B74", +",\tc #0F85F9", +"\'\tc #268CCD", +")\tc #7C7E7B", +"!\tc #2D92EC", +"~\tc #4498A9", +"{\tc #2F94FE", +"]\tc #5BA18C", +"^\tc #6BA674", +"/\tc #7DAD62", +"(\tc #93BD53", +"_\tc #A4A6A2", +":\tc #6CB6FF", +"<\tc #ABCC3F", +"[\tc #C4DA2A", +"}\tc #CACCC9", +"|\tc #DCE913", +"1\tc #BBDEFF", +"2\tc #FDFE00", +"3\tc #FDFFFC", +" \ + ", +" \ + ", +" \ + ", +" ........... \ + ", +" ...................... \ + ", +" ........................ \ + ", +" ........#&#&#&#&##...... \ + ", +" ....)__}33333333333}_... \ + ", +" ...&33333333333333333... \ + ", +" ...#33311133333333333... \ + ", +" ...&33!,{,;:333333333... \ + ", +" ...&3:,{{{{,13333333}... \ + ", +" ...&3!{{!{{,13333333}... \ + ", +" ...&3:!{{!{;13333333}... \ + ", +" ...&3{{{{{{;133333333... \ + ", +" ...&31,{{{;,33333333}... \ + ", +" ...&331{{{:133333333}... \ + ", +" ...&3333333333333333_... \ + ", +" ...&3333333333333333}... \ + ", +" ...&3333333333333333_... \ + ", +" ...&3333333333333333}... \ + ", +" ...&3333333333333333_... \ + ", +" ...&3333333333333333}... \ + ", +" ...&3333333333333333_... \ + ", +" ...&3333333331!,,;:3}... \ + ", +" ...&333333333{{{{{;:_... \ + ", +" ...&333333331,{!{!{{}... \ + ", +" ...&333333331{{{{{{,_... \ + ", +" ...)333333331{{!{{{{_... \ + ", +" ...)333333333{{{!{;:_... \ + ", +" ...)3333333331{;;;:3_... \ + ", +" ...)3333333333331333_... \ + ", +" ...)3333333333333333_... \ + ", +" ...)3333333333333333_... \ + ", +" ..._3333333333333333_... \ + ", +" ..._3333333333333333_... \ + ", +" ..._3333333333333333_... \ + ", +" ..._3333333333333333}.... \ + ", +" ...._33333333333333333#... \ + ", +" ....&333333333333333333_.... \ + ", +" ....&33333333333333333333).... \ + ", +" ....333333333333333333333}&.... \ + ", +" ...._33333333333333333333333.... \ + ", +" ....&333333333331:11333333333_.... \ + ", +" ....#33333333333:,,,;:333333333&.... \ + ", +" ....}3333333333:,!{{{;1333333333&.... \ + ", +" ....}33333333333{{{!{{,!3333333333.... \ + ", +" ....)333333333333{{{{!{{{3333333333_.... \ + ", +" ....#3333333333333!{{{{{,:33333333333&.... \ + ", +" ...._33333333333331{{!{,;1333333333333#.... \ + ", +" ...._333333333333333:;,;,13333333333333_.... \ + ", +" ...._333333333333333333113333333333333333_.... \ + ", +" ....&33333333333333333333333333331::1333333&.... \ + ", +" ...._333333333333333333333333333{,{{;{133333#... \ + ", +" ...._3333333333333333333333333331,{!{{,:33333}.... \ + ", +" ....&3333333333133333333333333333:{{{{{{:333333).... \ + ", +" ...#333333331{,,;:333333333333333:{!{!{{:3333333&.... \ + ", +" ....}33333333,{{{{;:333333333333331,{!{{;:33333333#... \ + ", +" ...._333333331,!{!{{,333333333333333{,{{;{1333333333.... \ + ", +" ....&3333333331{{{{{{{3333333333333333::::33333333333)....\ + ", +" ....+!:::::::::{{{{!{{;::::::::::::::::::::::::::!:::::+...\ +. ", +" ...+=;;;;;;;;;;;;{{{{;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;=...\ +. ", +" ....%;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;%..\ +.. ", +" ....@;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;$.\ +... ", +" ...+%;;;;;;!!!;;;;;,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;!=;;;+\ +.... ", +" ....%;;;;;!([<|^~]^([%;;;;;;;;;;;;;;;;;,(<\'=;;;;;;;!^/<[|\'=;\ +;=+... ", +" ....$;;;;;\'|2>]22<|22[%=;;;;;;;;;;;;;;;;^22[%=;;;;;;!][22|%=;;\ +;$.... ", +" ....@;;;;;;[2[%^2|*[22(%=;;;;;;;;;;;;;;;,/22|$=;;;;;;;;<22<%=;;;\ +;$.... ", +" ....+=;;;;;~22^$%]~$|22>%=;;;;;;;;;;;;;;;;\'||^%=;;;;;;;,[22^$=;;\ +;;;+.... ", +" ....%;;;;;,[22-%===\'22|*==;;;;;;;;;;;;;;;;;;=%=;;;;;;;;\'22|*%=;\ +;;;;=+... ", +" ....$;;;;;;!22|$%;,;^22<$=;;;;;;;;;;;;;;;;;;===;;;;;;;;;^22|$==;;;\ +;;;%.... ", +" ....@;;;;;\'](22[^]=;;<22^$==!~]/~=;!]]~;;;;{\'~]==;;;;~<<]<22($=;;\ +;;;;;;@.... ", +" ....@;;;;;;]<|22|[<%;!|22-%\'[2222*=;/22(%;~|222(=;;;!<2|^[222>$=;;;\ +;;;;;;+.... ", +" ....=;;;;;;;,[22>$===~22|$==,[22[%=;[22]%=,!|22]%=;![2|*%]22|*==;;;;\ +;;;;;%+... ", +" ....@;;;;;;;;!|22*$=;;/22($=;,[22/$=\'222*%=;!|22-%;;<22>%=]22[$%;;;;\ +;;;;;;;=.... ", +" ....@;;;;;;;;;~22[*==;;[22>%=;\'22|-%,^22[$=;,~22[$%;]22<$%=(22/$=;;;;\ +;;;;;;;;@.... ", +" ....+;;;;;;;;;;^22<$=;;!222*$=;]22[$==[22/$=;;(22/$=![22]$=;|22-%=;;;;;\ +;;;;;;;;+... ", +" ....;;;;;;;;;;;<22^%=;;]22[$=;;(22/$=~222-%=;;[22>%=]22|$%;~22|$==;;;;;\ +;;;;;;;;;.... ", +" ....%;;;;;;;;;;;|22-%=;;(22/$=;{|22-%=<22|$%;;\'22|*%;<22<$==(22<$=;=;;;\ +;;;;;;;;;;$.... ", +" ....+;;;;;;;;;;;!222$==;,|22>%=;~22|$=]|22($=;;]22[$%,|22^%=!|22^$=;;;;;;\ +;;;;;;;;;;@.... ", +" ....+=;;;;;;;;;;;~22[$%;;\'22|*-/;]22($*[<22^$^=;(22/$(-222>$=(222->~;;;;;\ +;;;;;;;;;;;=+.... ", +" ...+;;;;;;;;;;;;;(22/$=;;]22|*<\'=(22/*[~[22>(]=;|22>//=|22/$^(|2|-[%=;;;;\ +;;;;;;;;;;;;=.... ", +" ....$;;;;;;;;;;;;;<22>%=;;]222|>==(222|^=|22|<%=;|222<%=(222|<-222|-==;;;;;\ +;;;;;;;;;;;;$.... ", +" ....@;;;;;;;;;;;;;!|2|$=;;;\'[2[>%=;\'|2[]%=/2|/$==;^2|(*%=!(2|($%<2[-%=;;;;\ +;;;;;;;;;;;;;;;@.... ", +"....@;;;;;;;;;;;;;;\'22($%;;;;=%%==;;;=%%%==;=%%==;;;=%===;;==%%====%%=,;;;;;\ +;;;;;;;;;;;;;;;+... ", +"...+=;;;;;;;;;;!\'=,]22-%=;;;;;;==;=;;;===;=;;===;;;;;===;;;;=;=,;;,=;=;;;;;;\ +;;;;;;;;;;;;;;;=....", +"...+;;;;;;;;;;;[2^=<2<$==;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\ +;;;;;;;;;;;;;;;+...", +"...+;;;;;;;;;;;22(\'2|*%=;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\ +;;;;;;;;;;;;;;;;+...", +"...+;;;;;;;;;;;^|<[[-%=;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\ +;;;;;;;;;;;;;;;+...", +"...+;;;;;;;;;;;;*~*%===;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\ +;;;;;;;;;;;;;;;@...", +"...+;;;;;;;;;;;;;====;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\ +;;;;;;;;;;;;;;;+...", +"....$=;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\ +;;;;;;;;;;;;;=$....", +" .....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\ ++++++++++++++..... ", +" ............................................................................\ +................. ", +" ...........................................................................\ +................. ", +" ........................................................................\ +.............. " +}; +static Fl_Pixmap image_fluid(idata_fluid); + +static void cb_View(Fl_Button*, void*) { + show_help("license.html"); +} + +static void cb_Close(Fl_Return_Button* o, void*) { + ((Fl_Window*)(o->parent()))->hide(); +} + +Fl_Double_Window* make_about_panel() { + { about_panel = new Fl_Double_Window(315, 175, "About FLUID"); + about_panel->color(FL_LIGHT1); + about_panel->selection_color(FL_DARK1); + about_panel->hotspot(about_panel); + { Fl_Box* o = new Fl_Box(10, 10, 115, 120); + o->image(image_fluid); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(135, 10, 170, 69, "FLTK User\nInterface Designer\nVersion 1.1.10"); + o->color((Fl_Color)12); + o->selection_color(FL_DARK1); + o->labelfont(1); + o->labelsize(18); + o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(135, 89, 170, 42, "Copyright 1998-2009 by\nBill Spitzak and others"); + o->align(132|FL_ALIGN_INSIDE); + } // Fl_Box* o + { Fl_Button* o = new Fl_Button(89, 141, 123, 25, "View License..."); + o->labelcolor(FL_DARK_BLUE); + o->callback((Fl_Callback*)cb_View); + } // Fl_Button* o + { Fl_Return_Button* o = new Fl_Return_Button(222, 141, 83, 25, "Close"); + o->callback((Fl_Callback*)cb_Close); + } // Fl_Return_Button* o + about_panel->set_non_modal(); + about_panel->end(); + } // Fl_Double_Window* about_panel + return about_panel; +} + +// +// End of "$Id: about_panel.cxx 6817 2009-07-02 09:42:17Z AlbrechtS $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/about_panel.fl b/third_party/windows/fltk-1.1.10/fluid/about_panel.fl new file mode 100644 index 0000000..f534285 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/about_panel.fl @@ -0,0 +1,74 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0108 +header_name {.h} +code_name {.cxx} +comment {// +// "$Id: about_panel.fl 6817 2009-07-02 09:42:17Z AlbrechtS $" +// +// About dialog for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2009 by Bill Spitzak and others. +// +// 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 +// +} {in_source in_header +} + +decl {void show_help(const char *name);} {public +} + +Function {make_about_panel()} {open +} { + Fl_Window about_panel { + label {About FLUID} open + xywh {390 162 315 175} type Double color 50 selection_color 47 hotspot non_modal visible + } { + Fl_Box {} { + image {icons/fluid-96.xpm} xywh {10 10 115 120} + } + Fl_Box {} { + label {FLTK User +Interface Designer +Version 1.1.10} + xywh {135 10 170 69} color 12 selection_color 47 labelfont 1 labelsize 18 align 21 + } + Fl_Box {} { + label {Copyright 1998-2009 by +Bill Spitzak and others} selected + xywh {135 89 170 42} align 148 + } + Fl_Button {} { + label {View License...} + callback {show_help("license.html");} + xywh {89 141 123 25} labelcolor 136 + } + Fl_Return_Button {} { + label Close + callback {((Fl_Window*)(o->parent()))->hide();} + xywh {222 141 83 25} + } + } +} + +comment { +// +// End of "$Id: about_panel.fl 6817 2009-07-02 09:42:17Z AlbrechtS $". +//} {in_source in_header +} diff --git a/third_party/windows/fltk-1.1.10/fluid/about_panel.h b/third_party/windows/fltk-1.1.10/fluid/about_panel.h new file mode 100644 index 0000000..35416db --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/about_panel.h @@ -0,0 +1,44 @@ +// +// "$Id: about_panel.h 6817 2009-07-02 09:42:17Z AlbrechtS $" +// +// About dialog for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2009 by Bill Spitzak and others. +// +// 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 +// + +// generated by Fast Light User Interface Designer (fluid) version 1.0110 + +#ifndef about_panel_h +#define about_panel_h +#include +extern void show_help(const char *name); +#include +extern Fl_Double_Window *about_panel; +#include +#include +#include +Fl_Double_Window* make_about_panel(); +#endif + +// +// End of "$Id: about_panel.h 6817 2009-07-02 09:42:17Z AlbrechtS $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/align_widget.cxx b/third_party/windows/fltk-1.1.10/fluid/align_widget.cxx new file mode 100644 index 0000000..2a95df1 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/align_widget.cxx @@ -0,0 +1,541 @@ +// +// "$Id: align_widget.cxx 5845 2007-05-20 00:01:06Z mike $" +// +// Alignment code for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 +#include +#include "Fl_Widget_Type.h" +#include "undo.h" + +/** + * the first behaviour always uses the first selected widget as a reference + * the second behaviour uses the largest widget (most extreme positions) as + * a reference. + */ +#define BREAK_ON_FIRST break +//#define BREAK_ON_FIRST + +void align_widget_cb(Fl_Widget*, long how) +{ + const int max = 32768, min = -32768; + int left, right, top, bot, wdt, hgt, n; + Fl_Type *o; + int changed = 0; + switch ( how ) + { + //---- align + case 10: // align left + left = max; + for (o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->x()x(); + BREAK_ON_FIRST; + } + if (left!=max) + for (Fl_Type *o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } + + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(left, w->y(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(left, w->y(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } + break; + case 11: // align h.center + left = max; right = min; + for (o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->x()x(); + if (w->x()+w->w()>right) + right = w->x()+w->w(); + BREAK_ON_FIRST; + } + if (left!=max) + { + int center2 = left+right; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } + + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize((center2-w->w())/2, w->y(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } + } + break; + case 12: // align right + right = min; + for (o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->x()+w->w()>right) + right = w->x()+w->w(); + BREAK_ON_FIRST; + } + if (right!=min) + for (Fl_Type *o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } + + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(right-w->w(), w->y(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(right-w->w(), w->y(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } + break; + case 13: // align top + top = max; + for (o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->y()y(); + BREAK_ON_FIRST; + } + if (top!=max) + for (Fl_Type *o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } + + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(w->x(), top, w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(w->x(), top, w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } + break; + case 14: // align v.center + top = max; bot = min; + for (o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->y()y(); + if (w->y()+w->h()>bot) + bot = w->y()+w->h(); + BREAK_ON_FIRST; + } + if (top!=max) + { + int center2 = top+bot; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } + + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(w->x(), (center2-w->h())/2, w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } + } + break; + case 15: // align bottom + bot = min; + for (o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->y()+w->h()>bot) + bot = w->y()+w->h(); + BREAK_ON_FIRST; + } + if (bot!=min) + for (Fl_Type *o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } + + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize( w->x(), bot-w->h(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize( w->x(), bot-w->h(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } + break; + //---- space evently + case 20: // space evenly across + left = max; right = min; wdt = 0, n = 0; + for (o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->x()x(); + if (w->x()+w->w()>right) + right = w->x()+w->w(); + wdt += w->w(); + n++; + } + wdt = (right-left)-wdt; + n--; + if (n>0) + { + int cnt = 0, wsum = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } + + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + cnt++; + wsum += w->w(); + } + } + break; + case 21: // space evenly down + top = max; bot = min; hgt = 0, n = 0; + for (o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->y()y(); + if (w->y()+w->h()>bot) + bot = w->y()+w->h(); + hgt += w->h(); + n++; + } + hgt = (bot-top)-hgt; + n--; + if (n>0) + { + int cnt = 0, hsum = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } + + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + cnt++; + hsum += w->h(); + } + } + break; + //---- make same size + case 30: // same width + wdt = min; + for (o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->w()>wdt) + wdt = w->w(); + BREAK_ON_FIRST; + } + if (wdt!=min) + for (Fl_Type *o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } + + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(w->x(), w->y(), wdt, w->h()); + } else { + // Otherwise, just do the widget... + w->resize(w->x(), w->y(), wdt, w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } + break; + case 31: // same height + hgt = min; + for (o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->h()>hgt) + hgt = w->h(); + BREAK_ON_FIRST; + } + if (hgt!=min) + for (Fl_Type *o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } + + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize( w->x(), w->y(), w->w(), hgt); + } else { + // Otherwise, just do the widget... + w->resize( w->x(), w->y(), w->w(), hgt); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } + break; + case 32: // same size + hgt = min; wdt = min; + for (o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->w()>wdt) + wdt = w->w(); + if (w->h()>hgt) + hgt = w->h(); + BREAK_ON_FIRST; + } + if (hgt!=min) + for (Fl_Type *o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } + + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize( w->x(), w->y(), wdt, hgt); + } else { + // Otherwise, just do the widget... + w->resize( w->x(), w->y(), wdt, hgt); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } + break; + //---- center in group + case 40: // center hor + for (o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget() && o->parent) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } + + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + Fl_Widget *p = ((Fl_Widget_Type *)o->parent)->o; + int center2; + + if (w->window() == p) center2 = p->w(); + else center2 = 2*p->x()+p->w(); + + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button() && !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize((center2-w->w())/2, w->y(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } + break; + case 41: // center vert + for (o = Fl_Type::first; o; o = o->next) + if (o->selected && o->is_widget() && o->parent) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } + + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + Fl_Widget *p = ((Fl_Widget_Type *)o->parent)->o; + int center2; + + if (w->window() == p) center2 = p->h(); + else center2 = 2*p->y()+p->h(); + + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(w->x(), (center2-w->h())/2, w->w(), w->h()); + } + set_modflag(1); + w->redraw(); + if (w->window()) w->window()->redraw(); + } + break; + } +} + + +// Set sizes of selected widgets... +void widget_size_cb(Fl_Widget *, long size) { + // Update any selected widgets... + int changed = 0; + for (Fl_Type *o = Fl_Type::first; o; o = o->next) { + if (o->selected && o->is_widget()) { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } + + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + w->labelsize((uchar)size); + Fl_Font f; + int s = (int)size; + Fl_Color c; + ((Fl_Widget_Type *)o)->textstuff(2, f, s, c); + + w->redraw(); + // since this may be a major change, the whole window should be redrawn + if (w->window()) w->window()->redraw(); + } + } +} + + +// +// End of "$Id: align_widget.cxx 5845 2007-05-20 00:01:06Z mike $". +// + diff --git a/third_party/windows/fltk-1.1.10/fluid/alignment_panel.cxx b/third_party/windows/fltk-1.1.10/fluid/alignment_panel.cxx new file mode 100644 index 0000000..46623aa --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/alignment_panel.cxx @@ -0,0 +1,506 @@ +// +// "$Id: alignment_panel.cxx 6817 2009-07-02 09:42:17Z AlbrechtS $" +// +// Setting and shell dialogs for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 +// + +// generated by Fast Light User Interface Designer (fluid) version 1.0110 + +#include "alignment_panel.h" + +Fl_Double_Window *project_window=(Fl_Double_Window *)0; + +static void cb_Close(Fl_Button*, void*) { + project_window->hide(); +} + +Fl_Input *header_file_input=(Fl_Input *)0; + +Fl_Input *code_file_input=(Fl_Input *)0; + +Fl_Check_Button *include_H_from_C_button=(Fl_Check_Button *)0; + +Fl_Check_Button *use_FL_COMMAND_button=(Fl_Check_Button *)0; + +Fl_Choice *i18n_type_chooser=(Fl_Choice *)0; + +Fl_Menu_Item menu_i18n_type_chooser[] = { + {"None", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"GNU gettext", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"POSIX catgets", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0}, + {0,0,0,0,0,0,0,0,0} +}; + +Fl_Input *i18n_include_input=(Fl_Input *)0; + +Fl_Input *i18n_file_input=(Fl_Input *)0; + +Fl_Input *i18n_set_input=(Fl_Input *)0; + +Fl_Input *i18n_function_input=(Fl_Input *)0; + +Fl_Double_Window* make_project_window() { + { project_window = new Fl_Double_Window(358, 207, "Project Settings"); + { Fl_Button* o = new Fl_Button(293, 175, 52, 20, "Close"); + o->tooltip("Close this dialog."); + o->labelsize(11); + o->callback((Fl_Callback*)cb_Close); + } // Fl_Button* o + { Fl_Tabs* o = new Fl_Tabs(10, 10, 335, 151); + o->selection_color((Fl_Color)12); + o->labelsize(11); + { Fl_Group* o = new Fl_Group(10, 30, 335, 131, "Output"); + o->labelsize(11); + { Fl_Box* o = new Fl_Box(15, 40, 325, 15, "Use \"name.ext\" to set name or just \".ext\" to set extension."); + o->labelsize(11); + o->align(FL_ALIGN_WRAP|FL_ALIGN_INSIDE); + } // Fl_Box* o + { header_file_input = new Fl_Input(96, 60, 228, 20, "Header File:"); + header_file_input->tooltip("The name of the generated header file."); + header_file_input->box(FL_THIN_DOWN_BOX); + header_file_input->labelfont(1); + header_file_input->labelsize(11); + header_file_input->textfont(4); + header_file_input->textsize(11); + header_file_input->callback((Fl_Callback*)header_input_cb, (void*)(1)); + header_file_input->when(FL_WHEN_CHANGED); + } // Fl_Input* header_file_input + { code_file_input = new Fl_Input(97, 85, 227, 20, "Code File:"); + code_file_input->tooltip("The name of the generated code file."); + code_file_input->box(FL_THIN_DOWN_BOX); + code_file_input->labelfont(1); + code_file_input->labelsize(11); + code_file_input->textfont(4); + code_file_input->textsize(11); + code_file_input->callback((Fl_Callback*)code_input_cb, (void*)(1)); + code_file_input->when(FL_WHEN_CHANGED); + } // Fl_Input* code_file_input + { include_H_from_C_button = new Fl_Check_Button(95, 110, 145, 20, "Include Header from Code"); + include_H_from_C_button->tooltip("Include the header file from the code file."); + include_H_from_C_button->down_box(FL_DOWN_BOX); + include_H_from_C_button->labelsize(11); + include_H_from_C_button->callback((Fl_Callback*)include_H_from_C_button_cb); + } // Fl_Check_Button* include_H_from_C_button + { use_FL_COMMAND_button = new Fl_Check_Button(95, 130, 245, 20, "Generate menu shortcuts using FL_COMMAND"); + use_FL_COMMAND_button->tooltip("Replace FL_CTRL with FL_COMMAND when generating menu shortcut code."); + use_FL_COMMAND_button->down_box(FL_DOWN_BOX); + use_FL_COMMAND_button->labelsize(11); + use_FL_COMMAND_button->callback((Fl_Callback*)use_FL_COMMAND_button_cb); + } // Fl_Check_Button* use_FL_COMMAND_button + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(10, 30, 335, 131, "Internationalization"); + o->labelsize(11); + o->hide(); + { i18n_type_chooser = new Fl_Choice(80, 42, 100, 20, "Use:"); + i18n_type_chooser->tooltip("Type of internationalization to use."); + i18n_type_chooser->box(FL_THIN_UP_BOX); + i18n_type_chooser->down_box(FL_BORDER_BOX); + i18n_type_chooser->labelfont(1); + i18n_type_chooser->labelsize(11); + i18n_type_chooser->textsize(11); + i18n_type_chooser->callback((Fl_Callback*)i18n_type_cb); + i18n_type_chooser->menu(menu_i18n_type_chooser); + } // Fl_Choice* i18n_type_chooser + { i18n_include_input = new Fl_Input(80, 67, 245, 20, "#include:"); + i18n_include_input->tooltip("The include file for internationalization."); + i18n_include_input->box(FL_THIN_DOWN_BOX); + i18n_include_input->labelfont(1); + i18n_include_input->labelsize(11); + i18n_include_input->textfont(4); + i18n_include_input->textsize(11); + i18n_include_input->callback((Fl_Callback*)i18n_text_cb); + } // Fl_Input* i18n_include_input + { i18n_file_input = new Fl_Input(80, 92, 245, 20, "File:"); + i18n_file_input->tooltip("The name of the message catalog."); + i18n_file_input->box(FL_THIN_DOWN_BOX); + i18n_file_input->labelfont(1); + i18n_file_input->labelsize(11); + i18n_file_input->textfont(4); + i18n_file_input->textsize(11); + i18n_file_input->callback((Fl_Callback*)i18n_text_cb); + } // Fl_Input* i18n_file_input + { i18n_set_input = new Fl_Input(80, 117, 245, 20, "Set:"); + i18n_set_input->tooltip("The message set number."); + i18n_set_input->type(2); + i18n_set_input->box(FL_THIN_DOWN_BOX); + i18n_set_input->labelfont(1); + i18n_set_input->labelsize(11); + i18n_set_input->textfont(4); + i18n_set_input->textsize(11); + i18n_set_input->callback((Fl_Callback*)i18n_text_cb); + } // Fl_Input* i18n_set_input + { i18n_function_input = new Fl_Input(80, 92, 245, 20, "Function:"); + i18n_function_input->tooltip("The function to call to internationalize the labels and tooltips."); + i18n_function_input->box(FL_THIN_DOWN_BOX); + i18n_function_input->labelfont(1); + i18n_function_input->labelsize(11); + i18n_function_input->textfont(4); + i18n_function_input->textsize(11); + i18n_function_input->callback((Fl_Callback*)i18n_text_cb); + } // Fl_Input* i18n_function_input + o->end(); + } // Fl_Group* o + o->end(); + } // Fl_Tabs* o + project_window->set_modal(); + project_window->end(); + } // Fl_Double_Window* project_window + return project_window; +} +Fl_Text_Buffer *shell_run_buffer; +void scheme_cb(Fl_Choice *, void *); + +Fl_Double_Window *settings_window=(Fl_Double_Window *)0; + +Fl_Choice *scheme_choice=(Fl_Choice *)0; + +Fl_Menu_Item menu_scheme_choice[] = { + {"Default", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, + {"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}, + {0,0,0,0,0,0,0,0,0} +}; + +Fl_Check_Button *tooltips_button=(Fl_Check_Button *)0; + +static void cb_tooltips_button(Fl_Check_Button*, void*) { + Fl_Tooltip::enable(tooltips_button->value()); +fluid_prefs.set("show_tooltips", tooltips_button->value()); +} + +Fl_Check_Button *completion_button=(Fl_Check_Button *)0; + +static void cb_completion_button(Fl_Check_Button*, void*) { + fluid_prefs.set("show_completion_dialogs", completion_button->value()); +} + +Fl_Check_Button *openlast_button=(Fl_Check_Button *)0; + +static void cb_openlast_button(Fl_Check_Button*, void*) { + fluid_prefs.set("open_previous_file", openlast_button->value()); +} + +Fl_Check_Button *prevpos_button=(Fl_Check_Button *)0; + +static void cb_prevpos_button(Fl_Check_Button*, void*) { + fluid_prefs.set("prev_window_pos", prevpos_button->value()); +} + +static void cb_Close1(Fl_Button*, void*) { + settings_window->hide(); +} + +Fl_Spinner *recent_spinner=(Fl_Spinner *)0; + +static void cb_recent_spinner(Fl_Spinner*, void*) { + fluid_prefs.set("recent_files", recent_spinner->value()); +load_history(); +} + +Fl_Double_Window* make_settings_window() { + { settings_window = new Fl_Double_Window(340, 225, "GUI Settings"); + { scheme_choice = new Fl_Choice(116, 10, 115, 25, "Scheme:"); + scheme_choice->down_box(FL_BORDER_BOX); + scheme_choice->labelfont(1); + scheme_choice->callback((Fl_Callback*)scheme_cb); + scheme_choice->menu(menu_scheme_choice); + int s; + fluid_prefs.get("scheme", s, 0); + scheme_choice->value(s); + scheme_cb(0, 0); + } // Fl_Choice* scheme_choice + { Fl_Group* o = new Fl_Group(116, 45, 215, 100, "Options:\n\n\n\n\n"); + o->labelfont(1); + o->align(FL_ALIGN_LEFT); + { tooltips_button = new Fl_Check_Button(116, 45, 113, 25, "Show Tooltips"); + tooltips_button->down_box(FL_DOWN_BOX); + tooltips_button->callback((Fl_Callback*)cb_tooltips_button); + int b; + fluid_prefs.get("show_tooltips", b, 1); + tooltips_button->value(b); + Fl_Tooltip::enable(b); + } // Fl_Check_Button* tooltips_button + { completion_button = new Fl_Check_Button(116, 70, 186, 25, "Show Completion Dialogs"); + completion_button->down_box(FL_DOWN_BOX); + completion_button->callback((Fl_Callback*)cb_completion_button); + int b; + fluid_prefs.get("show_completion_dialogs", b, 1); + completion_button->value(b); + } // Fl_Check_Button* completion_button + { openlast_button = new Fl_Check_Button(116, 95, 215, 25, "Open Previous File on Startup"); + openlast_button->down_box(FL_DOWN_BOX); + openlast_button->callback((Fl_Callback*)cb_openlast_button); + int b; + fluid_prefs.get("open_previous_file", b, 0); + openlast_button->value(b); + } // Fl_Check_Button* openlast_button + { prevpos_button = new Fl_Check_Button(116, 120, 210, 25, "Remember Window Positions"); + prevpos_button->down_box(FL_DOWN_BOX); + prevpos_button->callback((Fl_Callback*)cb_prevpos_button); + int b; + fluid_prefs.get("prev_window_pos", b, 1); + prevpos_button->value(b); + } // Fl_Check_Button* prevpos_button + o->end(); + } // Fl_Group* o + { Fl_Button* o = new Fl_Button(266, 190, 64, 25, "Close"); + o->tooltip("Close this dialog."); + o->callback((Fl_Callback*)cb_Close1); + } // Fl_Button* o + { recent_spinner = new Fl_Spinner(116, 155, 40, 25, "# Recent Files:"); + recent_spinner->labelfont(1); + recent_spinner->callback((Fl_Callback*)cb_recent_spinner); + recent_spinner->when(FL_WHEN_CHANGED); + int c; + fluid_prefs.get("recent_files", c, 5); + recent_spinner->maximum(10); + recent_spinner->value(c); + } // Fl_Spinner* recent_spinner + settings_window->set_non_modal(); + settings_window->end(); + } // Fl_Double_Window* settings_window + return settings_window; +} + +Fl_Double_Window *shell_window=(Fl_Double_Window *)0; + +Fl_Input *shell_command_input=(Fl_Input *)0; + +static void cb_shell_command_input(Fl_Input*, void*) { + fluid_prefs.set("shell_command", shell_command_input->value()); +} + +Fl_Check_Button *shell_writecode_button=(Fl_Check_Button *)0; + +static void cb_shell_writecode_button(Fl_Check_Button*, void*) { + fluid_prefs.set("shell_writecode", shell_writecode_button->value()); +} + +Fl_Check_Button *shell_writemsgs_button=(Fl_Check_Button *)0; + +static void cb_shell_writemsgs_button(Fl_Check_Button*, void*) { + fluid_prefs.set("shell_writemsgs", shell_writemsgs_button->value()); +} + +Fl_Check_Button *shell_savefl_button=(Fl_Check_Button *)0; + +static void cb_shell_savefl_button(Fl_Check_Button*, void*) { + fluid_prefs.set("shell_savefl", shell_savefl_button->value()); +} + +static void cb_Cancel(Fl_Button*, void*) { + shell_window->hide(); +} + +Fl_Double_Window *shell_run_window=(Fl_Double_Window *)0; + +Fl_Text_Display *shell_run_display=(Fl_Text_Display *)0; + +Fl_Return_Button *shell_run_button=(Fl_Return_Button *)0; + +static void cb_shell_run_button(Fl_Return_Button*, void*) { + shell_run_window->hide(); +} + +Fl_Double_Window* make_shell_window() { + { shell_window = new Fl_Double_Window(365, 125, "Shell Command"); + { shell_command_input = new Fl_Input(10, 27, 347, 25, "Command:"); + shell_command_input->labelfont(1); + shell_command_input->callback((Fl_Callback*)cb_shell_command_input); + shell_command_input->align(FL_ALIGN_TOP_LEFT); + char buf[1024]; + fluid_prefs.get("shell_command", buf, "", sizeof(buf)); + shell_command_input->value(buf); + } // Fl_Input* shell_command_input + { shell_writecode_button = new Fl_Check_Button(128, 61, 93, 19, "Write Code"); + shell_writecode_button->down_box(FL_DOWN_BOX); + shell_writecode_button->callback((Fl_Callback*)cb_shell_writecode_button); + int b; + fluid_prefs.get("shell_writecode", b, 1); + shell_writecode_button->value(b); + } // Fl_Check_Button* shell_writecode_button + { shell_writemsgs_button = new Fl_Check_Button(231, 61, 126, 19, "Write Messages"); + shell_writemsgs_button->down_box(FL_DOWN_BOX); + shell_writemsgs_button->callback((Fl_Callback*)cb_shell_writemsgs_button); + int b; + fluid_prefs.get("shell_writemsgs", b, 0); + shell_writemsgs_button->value(b); + } // Fl_Check_Button* shell_writemsgs_button + { shell_savefl_button = new Fl_Check_Button(10, 62, 108, 19, "Save .FL File"); + shell_savefl_button->down_box(FL_DOWN_BOX); + shell_savefl_button->callback((Fl_Callback*)cb_shell_savefl_button); + int b; + fluid_prefs.get("shell_savefl", b, 1); + shell_savefl_button->value(b); + } // Fl_Check_Button* shell_savefl_button + { Fl_Return_Button* o = new Fl_Return_Button(132, 90, 143, 25, "Run Command"); + o->callback((Fl_Callback*)do_shell_command); + } // Fl_Return_Button* o + { Fl_Button* o = new Fl_Button(285, 90, 72, 25, "Cancel"); + o->callback((Fl_Callback*)cb_Cancel); + } // Fl_Button* o + shell_window->end(); + } // Fl_Double_Window* shell_window + { shell_run_window = new Fl_Double_Window(555, 430, "Shell Command Output"); + { shell_run_display = new Fl_Text_Display(10, 10, 535, 375); + shell_run_display->box(FL_DOWN_BOX); + shell_run_display->textfont(4); + Fl_Group::current()->resizable(shell_run_display); + shell_run_buffer = new Fl_Text_Buffer(); + shell_run_display->buffer(shell_run_buffer); + } // Fl_Text_Display* shell_run_display + { shell_run_button = new Fl_Return_Button(468, 395, 77, 25, "Close"); + shell_run_button->callback((Fl_Callback*)cb_shell_run_button); + } // Fl_Return_Button* shell_run_button + shell_run_window->end(); + } // Fl_Double_Window* shell_run_window + return shell_run_window; +} + +Fl_Double_Window *grid_window=(Fl_Double_Window *)0; + +Fl_Input *horizontal_input=(Fl_Input *)0; + +Fl_Input *vertical_input=(Fl_Input *)0; + +Fl_Input *snap_input=(Fl_Input *)0; + +Fl_Check_Button *guides_toggle=(Fl_Check_Button *)0; + +static void cb_Close2(Fl_Button*, void*) { + grid_window->hide(); +} + +Fl_Round_Button *def_widget_size[6]={(Fl_Round_Button *)0}; + +Fl_Double_Window* make_layout_window() { + { grid_window = new Fl_Double_Window(285, 245, "Layout Settings"); + { Fl_Input* o = horizontal_input = new Fl_Input(106, 10, 50, 25, "x"); + horizontal_input->tooltip("Horizontal grid spacing."); + horizontal_input->type(2); + horizontal_input->box(FL_THIN_DOWN_BOX); + horizontal_input->callback((Fl_Callback*)grid_cb, (void*)(1)); + horizontal_input->align(FL_ALIGN_RIGHT); + o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY); + } // Fl_Input* horizontal_input + { Fl_Input* o = vertical_input = new Fl_Input(166, 10, 50, 25, "pixels"); + vertical_input->tooltip("Vertical grid spacing."); + vertical_input->type(2); + vertical_input->box(FL_THIN_DOWN_BOX); + vertical_input->callback((Fl_Callback*)grid_cb, (void*)(2)); + vertical_input->align(FL_ALIGN_RIGHT); + o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY); + } // Fl_Input* vertical_input + { Fl_Input* o = snap_input = new Fl_Input(106, 45, 50, 25, "pixel snap"); + snap_input->tooltip("Snap to grid within this many pixels."); + snap_input->type(2); + snap_input->box(FL_THIN_DOWN_BOX); + snap_input->callback((Fl_Callback*)grid_cb, (void*)(3)); + snap_input->align(FL_ALIGN_RIGHT); + o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY); + } // Fl_Input* snap_input + { guides_toggle = new Fl_Check_Button(106, 80, 110, 25, "Show Guides"); + guides_toggle->tooltip("Show distance and alignment guides in overlay"); + guides_toggle->down_box(FL_DOWN_BOX); + guides_toggle->callback((Fl_Callback*)guides_cb, (void*)(4)); + } // Fl_Check_Button* guides_toggle + { Fl_Button* o = new Fl_Button(215, 210, 60, 25, "Close"); + o->tooltip("Close this dialog."); + o->callback((Fl_Callback*)cb_Close2); + } // Fl_Button* o + { Fl_Box* o = new Fl_Box(26, 10, 70, 25, "Grid:"); + o->labelfont(1); + o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(-1, 115, 97, 25, "Widget Size:"); + o->labelfont(1); + o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE); + } // Fl_Box* o + { Fl_Group* o = new Fl_Group(105, 115, 170, 75); + { def_widget_size[0] = new Fl_Round_Button(105, 115, 70, 25); + def_widget_size[0]->type(102); + def_widget_size[0]->down_box(FL_ROUND_DOWN_BOX); + def_widget_size[0]->callback((Fl_Callback*)default_widget_size_cb, (void*)(8)); + } // Fl_Round_Button* def_widget_size[0] + { Fl_Box* o = new Fl_Box(120, 115, 50, 25, "tiny"); + o->labelsize(8); + o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); + } // Fl_Box* o + { def_widget_size[1] = new Fl_Round_Button(180, 115, 70, 25); + def_widget_size[1]->type(102); + def_widget_size[1]->down_box(FL_ROUND_DOWN_BOX); + def_widget_size[1]->callback((Fl_Callback*)default_widget_size_cb, (void*)(11)); + } // Fl_Round_Button* def_widget_size[1] + { Fl_Box* o = new Fl_Box(195, 115, 50, 25, "small"); + o->labelsize(11); + o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); + } // Fl_Box* o + { def_widget_size[2] = new Fl_Round_Button(105, 140, 70, 25); + def_widget_size[2]->type(102); + def_widget_size[2]->down_box(FL_ROUND_DOWN_BOX); + def_widget_size[2]->callback((Fl_Callback*)default_widget_size_cb, (void*)(14)); + } // Fl_Round_Button* def_widget_size[2] + { Fl_Box* o = new Fl_Box(120, 140, 50, 25, "normal"); + o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); + } // Fl_Box* o + { def_widget_size[3] = new Fl_Round_Button(180, 140, 90, 25); + def_widget_size[3]->type(102); + def_widget_size[3]->down_box(FL_ROUND_DOWN_BOX); + def_widget_size[3]->callback((Fl_Callback*)default_widget_size_cb, (void*)(18)); + } // Fl_Round_Button* def_widget_size[3] + { Fl_Box* o = new Fl_Box(195, 140, 68, 25, "medium"); + o->labelsize(18); + o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); + } // Fl_Box* o + { def_widget_size[4] = new Fl_Round_Button(105, 165, 75, 25); + def_widget_size[4]->type(102); + def_widget_size[4]->down_box(FL_ROUND_DOWN_BOX); + def_widget_size[4]->callback((Fl_Callback*)default_widget_size_cb, (void*)(24)); + } // Fl_Round_Button* def_widget_size[4] + { Fl_Box* o = new Fl_Box(120, 165, 64, 25, "large"); + o->labelsize(24); + o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); + } // Fl_Box* o + { def_widget_size[5] = new Fl_Round_Button(180, 165, 95, 25); + def_widget_size[5]->type(102); + def_widget_size[5]->down_box(FL_ROUND_DOWN_BOX); + def_widget_size[5]->callback((Fl_Callback*)default_widget_size_cb, (void*)(32)); + } // Fl_Round_Button* def_widget_size[5] + { Fl_Box* o = new Fl_Box(195, 165, 76, 25, "huge"); + o->labelsize(32); + o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + grid_window->set_non_modal(); + grid_window->end(); + } // Fl_Double_Window* grid_window + return grid_window; +} + +// +// End of "$Id: alignment_panel.cxx 6817 2009-07-02 09:42:17Z AlbrechtS $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/alignment_panel.fl b/third_party/windows/fltk-1.1.10/fluid/alignment_panel.fl new file mode 100644 index 0000000..b0f369f --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/alignment_panel.fl @@ -0,0 +1,420 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0108 +header_name {.h} +code_name {.cxx} +comment {// +// "$Id: alignment_panel.fl 5808 2007-05-10 12:06:31Z matt $" +// +// Setting and shell dialogs for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 +// +} {in_source in_header +} + +decl {\#include } {public +} + +decl {\#include } {public +} + +decl {extern void load_history();} {public +} + +Function {make_project_window()} {open +} { + Fl_Window project_window { + label {Project Settings} + xywh {312 395 358 207} type Double + code0 {\#include } + code1 {\#include } modal visible + } { + Fl_Button {} { + label Close + callback {project_window->hide();} + tooltip {Close this dialog.} xywh {293 175 52 20} labelsize 11 + } + Fl_Tabs {} {open + xywh {10 10 335 151} selection_color 12 labelsize 11 + } { + Fl_Group {} { + label Output open + xywh {10 30 335 131} labelsize 11 + } { + Fl_Box {} { + label {Use "name.ext" to set name or just ".ext" to set extension.} + xywh {15 40 325 15} labelsize 11 align 144 + } + Fl_Input header_file_input { + label {Header File:} + user_data 1 user_data_type {void*} + callback header_input_cb + tooltip {The name of the generated header file.} xywh {96 60 228 20} box THIN_DOWN_BOX labelfont 1 labelsize 11 when 1 textfont 4 textsize 11 + } + Fl_Input code_file_input { + label {Code File:} + user_data 1 user_data_type {void*} + callback code_input_cb + tooltip {The name of the generated code file.} xywh {97 85 227 20} box THIN_DOWN_BOX labelfont 1 labelsize 11 when 1 textfont 4 textsize 11 + } + Fl_Check_Button include_H_from_C_button { + label {Include Header from Code} + callback include_H_from_C_button_cb + tooltip {Include the header file from the code file.} xywh {95 110 145 20} down_box DOWN_BOX labelsize 11 + } + Fl_Check_Button use_FL_COMMAND_button { + label {Generate menu shortcuts using FL_COMMAND} + callback use_FL_COMMAND_button_cb selected + tooltip {Replace FL_CTRL with FL_COMMAND when generating menu shortcut code.} xywh {95 130 245 20} down_box DOWN_BOX labelsize 11 + } + } + Fl_Group {} { + label Internationalization open + xywh {10 30 335 131} labelsize 11 hide + } { + Fl_Choice i18n_type_chooser { + label {Use:} + callback i18n_type_cb open + tooltip {Type of internationalization to use.} xywh {80 42 100 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11 + } { + MenuItem {} { + label None + xywh {0 0 100 20} labelsize 11 + } + MenuItem {} { + label {GNU gettext} + xywh {0 0 100 20} labelsize 11 + } + MenuItem {} { + label {POSIX catgets} + xywh {0 0 100 20} labelsize 11 + } + } + Fl_Input i18n_include_input { + label {\#include:} + callback i18n_text_cb + tooltip {The include file for internationalization.} xywh {80 67 245 20} box THIN_DOWN_BOX labelfont 1 labelsize 11 textfont 4 textsize 11 + } + Fl_Input i18n_file_input { + label {File:} + callback i18n_text_cb + tooltip {The name of the message catalog.} xywh {80 92 245 20} box THIN_DOWN_BOX labelfont 1 labelsize 11 textfont 4 textsize 11 + } + Fl_Input i18n_set_input { + label {Set:} + callback i18n_text_cb + tooltip {The message set number.} xywh {80 117 245 20} type Int box THIN_DOWN_BOX labelfont 1 labelsize 11 textfont 4 textsize 11 + } + Fl_Input i18n_function_input { + label {Function:} + callback i18n_text_cb + tooltip {The function to call to internationalize the labels and tooltips.} xywh {80 92 245 20} box THIN_DOWN_BOX labelfont 1 labelsize 11 textfont 4 textsize 11 + } + } + } + } +} + +decl {extern void i18n_cb(Fl_Choice *,void *);} {public +} + +decl {extern Fl_Preferences fluid_prefs;} {public +} + +decl {Fl_Text_Buffer *shell_run_buffer;} {public +} + +decl {void scheme_cb(Fl_Choice *, void *);} {public +} + +Function {make_settings_window()} {open +} { + Fl_Window settings_window { + label {GUI Settings} open + xywh {326 145 340 225} type Double non_modal visible + } { + Fl_Choice scheme_choice { + label {Scheme:} + callback scheme_cb open + xywh {116 10 115 25} down_box BORDER_BOX labelfont 1 + code0 {int s;} + code1 {fluid_prefs.get("scheme", s, 0);} + code2 {scheme_choice->value(s);} + code3 {scheme_cb(0, 0);} + } { + MenuItem {} { + label Default + xywh {0 0 35 25} + } + MenuItem {} { + label None + xywh {0 0 35 25} + } + MenuItem {} { + label Plastic + xywh {0 0 35 25} + } + MenuItem {} { + label {GTK+} + xywh {10 10 35 25} + } + } + Fl_Group {} { + label {Options: + + + + +} open + xywh {116 45 215 100} labelfont 1 align 4 + } { + Fl_Check_Button tooltips_button { + label {Show Tooltips} + callback {Fl_Tooltip::enable(tooltips_button->value()); +fluid_prefs.set("show_tooltips", tooltips_button->value());} + xywh {116 45 113 25} down_box DOWN_BOX + code0 {int b;} + code1 {fluid_prefs.get("show_tooltips", b, 1);} + code2 {tooltips_button->value(b);} + code3 {Fl_Tooltip::enable(b);} + } + Fl_Check_Button completion_button { + label {Show Completion Dialogs} + callback {fluid_prefs.set("show_completion_dialogs", completion_button->value());} + xywh {116 70 186 25} down_box DOWN_BOX + code0 {int b;} + code1 {fluid_prefs.get("show_completion_dialogs", b, 1);} + code2 {completion_button->value(b);} + } + Fl_Check_Button openlast_button { + label {Open Previous File on Startup} + callback {fluid_prefs.set("open_previous_file", openlast_button->value());} + xywh {116 95 215 25} down_box DOWN_BOX + code0 {int b;} + code1 {fluid_prefs.get("open_previous_file", b, 0);} + code2 {openlast_button->value(b);} + } + Fl_Check_Button prevpos_button { + label {Remember Window Positions} + callback {fluid_prefs.set("prev_window_pos", prevpos_button->value());} + xywh {116 120 210 25} down_box DOWN_BOX + code0 {int b;} + code1 {fluid_prefs.get("prev_window_pos", b, 1);} + code2 {prevpos_button->value(b);} + } + } + Fl_Button {} { + label Close + callback {settings_window->hide();} + tooltip {Close this dialog.} xywh {266 190 64 25} + } + Fl_Spinner recent_spinner { + label {\# Recent Files:} + callback {fluid_prefs.set("recent_files", recent_spinner->value()); +load_history();} + xywh {116 155 40 25} labelfont 1 when 1 value 1 + code0 {int c;} + code1 {fluid_prefs.get("recent_files", c, 5);} + code2 {recent_spinner->maximum(10);} + code3 {recent_spinner->value(c);} + } + } +} + +Function {make_shell_window()} {open +} { + Fl_Window shell_window { + label {Shell Command} + xywh {682 167 365 125} type Double visible + } { + Fl_Input shell_command_input { + label {Command:} + callback {fluid_prefs.set("shell_command", shell_command_input->value());} + xywh {10 27 347 25} labelfont 1 align 5 + code0 {char buf[1024];} + code1 {fluid_prefs.get("shell_command", buf, "", sizeof(buf));} + code2 {shell_command_input->value(buf);} + } + Fl_Check_Button shell_writecode_button { + label {Write Code} + callback {fluid_prefs.set("shell_writecode", shell_writecode_button->value());} + xywh {128 61 93 19} down_box DOWN_BOX + code0 {int b;} + code1 {fluid_prefs.get("shell_writecode", b, 1);} + code2 {shell_writecode_button->value(b);} + } + Fl_Check_Button shell_writemsgs_button { + label {Write Messages} + callback {fluid_prefs.set("shell_writemsgs", shell_writemsgs_button->value());} + xywh {231 61 126 19} down_box DOWN_BOX + code0 {int b;} + code1 {fluid_prefs.get("shell_writemsgs", b, 0);} + code2 {shell_writemsgs_button->value(b);} + } + Fl_Check_Button shell_savefl_button { + label {Save .FL File} + callback {fluid_prefs.set("shell_savefl", shell_savefl_button->value());} + xywh {10 62 108 19} down_box DOWN_BOX + code0 {int b;} + code1 {fluid_prefs.get("shell_savefl", b, 1);} + code2 {shell_savefl_button->value(b);} + } + Fl_Return_Button {} { + label {Run Command} + callback do_shell_command + xywh {132 90 143 25} + } + Fl_Button {} { + label Cancel + callback {shell_window->hide();} + xywh {285 90 72 25} + } + } + Fl_Window shell_run_window { + label {Shell Command Output} + xywh {592 332 555 430} type Double hide resizable + } { + Fl_Text_Display shell_run_display { + xywh {10 10 535 375} box DOWN_BOX textfont 4 resizable + code0 {shell_run_buffer = new Fl_Text_Buffer();} + code1 {shell_run_display->buffer(shell_run_buffer);} + } + Fl_Return_Button shell_run_button { + label Close + callback {shell_run_window->hide();} + xywh {468 395 77 25} + } + } +} + +Function {make_layout_window()} {open +} { + Fl_Window grid_window { + label {Layout Settings} + xywh {676 337 285 245} type Double non_modal visible + } { + Fl_Input horizontal_input { + label x + user_data 1 user_data_type long + callback grid_cb + tooltip {Horizontal grid spacing.} xywh {106 10 50 25} type Int box THIN_DOWN_BOX align 8 + code0 {o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY);} + } + Fl_Input vertical_input { + label pixels + user_data 2 user_data_type long + callback grid_cb + tooltip {Vertical grid spacing.} xywh {166 10 50 25} type Int box THIN_DOWN_BOX align 8 + code0 {o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY);} + } + Fl_Input snap_input { + label {pixel snap} + user_data 3 user_data_type long + callback grid_cb + tooltip {Snap to grid within this many pixels.} xywh {106 45 50 25} type Int box THIN_DOWN_BOX align 8 + code0 {o->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY);} + } + Fl_Check_Button guides_toggle { + label {Show Guides} + user_data 4 user_data_type long + callback guides_cb + tooltip {Show distance and alignment guides in overlay} xywh {106 80 110 25} down_box DOWN_BOX + } + Fl_Button {} { + label Close + callback {grid_window->hide();} + tooltip {Close this dialog.} xywh {215 210 60 25} + } + Fl_Box {} { + label {Grid:} + xywh {26 10 70 25} labelfont 1 align 24 + } + Fl_Box {} { + label {Widget Size:} + xywh {-1 115 97 25} labelfont 1 align 24 + } + Fl_Group {} {open + xywh {105 115 170 75} + } { + Fl_Round_Button {def_widget_size[0]} { + user_data 8 user_data_type long + callback default_widget_size_cb + xywh {105 115 70 25} type Radio down_box ROUND_DOWN_BOX + } + Fl_Box {} { + label tiny + xywh {120 115 50 25} labelsize 8 align 20 + } + Fl_Round_Button {def_widget_size[1]} { + user_data 11 user_data_type long + callback default_widget_size_cb + xywh {180 115 70 25} type Radio down_box ROUND_DOWN_BOX + } + Fl_Box {} { + label small + xywh {195 115 50 25} labelsize 11 align 20 + } + Fl_Round_Button {def_widget_size[2]} { + user_data 14 user_data_type long + callback default_widget_size_cb + xywh {105 140 70 25} type Radio down_box ROUND_DOWN_BOX + } + Fl_Box {} { + label normal + xywh {120 140 50 25} align 20 + } + Fl_Round_Button {def_widget_size[3]} { + user_data 18 user_data_type long + callback default_widget_size_cb + xywh {180 140 90 25} type Radio down_box ROUND_DOWN_BOX + } + Fl_Box {} { + label medium + xywh {195 140 68 25} labelsize 18 align 20 + } + Fl_Round_Button {def_widget_size[4]} { + user_data 24 user_data_type long + callback default_widget_size_cb + xywh {105 165 75 25} type Radio down_box ROUND_DOWN_BOX + } + Fl_Box {} { + label large + xywh {120 165 64 25} labelsize 24 align 20 + } + Fl_Round_Button {def_widget_size[5]} { + user_data 32 user_data_type long + callback default_widget_size_cb + xywh {180 165 95 25} type Radio down_box ROUND_DOWN_BOX + } + Fl_Box {} { + label huge + xywh {195 165 76 25} labelsize 32 align 20 + } + } + } +} + +comment { +// +// End of "$Id: alignment_panel.fl 5808 2007-05-10 12:06:31Z matt $". +//} {in_source in_header +} diff --git a/third_party/windows/fltk-1.1.10/fluid/alignment_panel.h b/third_party/windows/fltk-1.1.10/fluid/alignment_panel.h new file mode 100644 index 0000000..92be789 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/alignment_panel.h @@ -0,0 +1,106 @@ +// +// "$Id: alignment_panel.h 6817 2009-07-02 09:42:17Z AlbrechtS $" +// +// Setting and shell dialogs for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 +// + +// generated by Fast Light User Interface Designer (fluid) version 1.0110 + +#ifndef alignment_panel_h +#define alignment_panel_h +#include +#include +#include +extern void load_history(); +#include +#include +#include +extern Fl_Double_Window *project_window; +#include +#include +#include +#include +#include +extern void header_input_cb(Fl_Input*, void*); +extern Fl_Input *header_file_input; +extern void code_input_cb(Fl_Input*, void*); +extern Fl_Input *code_file_input; +#include +extern void include_H_from_C_button_cb(Fl_Check_Button*, void*); +extern Fl_Check_Button *include_H_from_C_button; +extern void use_FL_COMMAND_button_cb(Fl_Check_Button*, void*); +extern Fl_Check_Button *use_FL_COMMAND_button; +#include +extern void i18n_type_cb(Fl_Choice*, void*); +extern Fl_Choice *i18n_type_chooser; +extern void i18n_text_cb(Fl_Input*, void*); +extern Fl_Input *i18n_include_input; +extern Fl_Input *i18n_file_input; +extern Fl_Input *i18n_set_input; +extern Fl_Input *i18n_function_input; +Fl_Double_Window* make_project_window(); +extern Fl_Menu_Item menu_i18n_type_chooser[]; +extern void i18n_cb(Fl_Choice *,void *); +extern Fl_Preferences fluid_prefs; +extern Fl_Text_Buffer *shell_run_buffer; +extern void scheme_cb(Fl_Choice *, void *); +extern Fl_Double_Window *settings_window; +extern void scheme_cb(Fl_Choice*, void*); +extern Fl_Choice *scheme_choice; +extern Fl_Check_Button *tooltips_button; +extern Fl_Check_Button *completion_button; +extern Fl_Check_Button *openlast_button; +extern Fl_Check_Button *prevpos_button; +#include +extern Fl_Spinner *recent_spinner; +Fl_Double_Window* make_settings_window(); +extern Fl_Menu_Item menu_scheme_choice[]; +extern Fl_Double_Window *shell_window; +extern Fl_Input *shell_command_input; +extern Fl_Check_Button *shell_writecode_button; +extern Fl_Check_Button *shell_writemsgs_button; +extern Fl_Check_Button *shell_savefl_button; +#include +extern void do_shell_command(Fl_Return_Button*, void*); +extern Fl_Double_Window *shell_run_window; +#include +extern Fl_Text_Display *shell_run_display; +extern Fl_Return_Button *shell_run_button; +Fl_Double_Window* make_shell_window(); +extern Fl_Double_Window *grid_window; +extern void grid_cb(Fl_Input*, long); +extern Fl_Input *horizontal_input; +extern Fl_Input *vertical_input; +extern Fl_Input *snap_input; +extern void guides_cb(Fl_Check_Button*, long); +extern Fl_Check_Button *guides_toggle; +#include +extern void default_widget_size_cb(Fl_Round_Button*, long); +extern Fl_Round_Button *def_widget_size[6]; +Fl_Double_Window* make_layout_window(); +#endif + +// +// End of "$Id: alignment_panel.h 6817 2009-07-02 09:42:17Z AlbrechtS $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/code.cxx b/third_party/windows/fltk-1.1.10/fluid/code.cxx new file mode 100644 index 0000000..d781aaf --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/code.cxx @@ -0,0 +1,592 @@ +// +// "$Id: code.cxx 6013 2008-01-04 22:18:40Z matt $" +// +// Code output routines for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2006 by Bill Spitzak and others. +// +// 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 +#include +#include "../src/flstring.h" +#include + +#include +#include "Fl_Type.h" +#include "alignment_panel.h" + +static FILE *code_file; +static FILE *header_file; + +extern char i18n_program[]; +extern int i18n_type; +extern const char* i18n_include; +extern const char* i18n_function; +extern const char* i18n_file; +extern const char* i18n_set; + +// return true if c can be in a C identifier. I needed this so +// it is not messed up by locale settings: +int is_id(char c) { + return c>='a' && c<='z' || c>='A' && c<='Z' || c>='0' && c<='9' || c=='_'; +} + +//////////////////////////////////////////////////////////////// +// Generate unique but human-readable identifiers: + +struct id { + char* text; + void* object; + id *left, *right; + id (const char* t, void* o) : text(strdup(t)), object(o) {left = right = 0;} + ~id(); +}; + +id::~id() { + delete left; + free((void *)text); + delete right; +} + +static id* id_root; + +const char* unique_id(void* o, const char* type, const char* name, const char* label) { + char buffer[128]; + char* q = buffer; + while (*type) *q++ = *type++; + *q++ = '_'; + const char* n = name; + if (!n || !*n) n = label; + if (n && *n) { + while (*n && !is_id(*n)) n++; + while (is_id(*n)) *q++ = *n++; + } + *q = 0; + // okay, search the tree and see if the name was already used: + id** p = &id_root; + int which = 0; + while (*p) { + int i = strcmp(buffer, (*p)->text); + if (!i) { + if ((*p)->object == o) return (*p)->text; + // already used, we need to pick a new name: + sprintf(q,"%x",++which); + p = &id_root; + continue; + } + else if (i < 0) p = &((*p)->left); + else p = &((*p)->right); + } + *p = new id(buffer, o); + return (*p)->text; +} + +//////////////////////////////////////////////////////////////// +// return current indentation: + +static const char* spaces = " "; +int indentation; +const char* indent() { + int i = indentation; if (i>16) i = 16; + return spaces+16-i; +} + +//////////////////////////////////////////////////////////////// +// declarations/include files: +// Each string generated by write_declare is written only once to +// the header file. This is done by keeping a binary tree of all +// the calls so far and not printing it if it is in the tree. + +struct included { + char *text; + included *left, *right; + included(const char *t) { + text = strdup(t); + left = right = 0; + } + ~included(); +}; + +included::~included() { + delete left; + free((void *)text); + delete right; +} +static included *included_root; + +int write_declare(const char *format, ...) { + va_list args; + char buf[1024]; + va_start(args, format); + vsnprintf(buf, sizeof(buf), format, args); + va_end(args); + included **p = &included_root; + while (*p) { + int i = strcmp(buf,(*p)->text); + if (!i) return 0; + else if (i < 0) p = &((*p)->left); + else p = &((*p)->right); + } + fprintf(header_file,"%s\n",buf); + *p = new included(buf); + return 1; +} + +//////////////////////////////////////////////////////////////// + +// silly thing to prevent declaring unused variables: +// When this symbol is on, all attempts to write code don't write +// anything, but set a variable if it looks like the variable "o" is used: +int varused_test; +int varused; + +// write an array of C characters (adds a null): +void write_cstring(const char *w, int length) { + if (varused_test) { + varused = 1; + return; + } + const char *e = w+length; + int linelength = 1; + putc('\"', code_file); + for (; w < e;) { + int c = *w++; + switch (c) { + case '\b': c = 'b'; goto QUOTED; + case '\t': c = 't'; goto QUOTED; + case '\n': c = 'n'; goto QUOTED; + case '\f': c = 'f'; goto QUOTED; + case '\r': c = 'r'; goto QUOTED; + case '\"': + case '\'': + case '\\': + QUOTED: + if (linelength >= 77) {fputs("\\\n",code_file); linelength = 0;} + putc('\\', code_file); + putc(c, code_file); + linelength += 2; + break; + case '?': // prevent trigraphs by writing ?? as ?\? + if (*(w-2) == '?') goto QUOTED; + // else fall through: + default: + if (c >= ' ' && c < 127) { + // a legal ASCII character + if (linelength >= 78) {fputs("\\\n",code_file); linelength = 0;} + putc(c, code_file); + linelength++; + break; + } + // otherwise we must print it as an octal constant: + c &= 255; + if (c < 8) { + if (linelength >= 76) {fputs("\\\n",code_file); linelength = 0;} + fprintf(code_file, "\\%o",c); + linelength += 2; + } else if (c < 64) { + if (linelength >= 75) {fputs("\\\n",code_file); linelength = 0;} + fprintf(code_file, "\\%o",c); + linelength += 3; + } else { + if (linelength >= 74) {fputs("\\\n",code_file); linelength = 0;} + fprintf(code_file, "\\%o",c); + linelength += 4; + } + // We must not put more numbers after it, because some C compilers + // consume them as part of the quoted sequence. Use string constant + // pasting to avoid this: + c = *w; + if (w < e && (c>='0'&&c<='9' || c>='a'&&c<='f' || c>='A'&&c<='F')) { + putc('\"', code_file); linelength++; + if (linelength >= 79) {fputs("\n",code_file); linelength = 0;} + putc('\"', code_file); linelength++; + } + break; + } + } + putc('\"', code_file); +} + +// write a C string, quoting characters if necessary: +void write_cstring(const char *w) {write_cstring(w,strlen(w));} + +// write an array of C binary data (does not add a null): +void write_cdata(const char *s, int length) { + if (varused_test) { + varused = 1; + return; + } + const unsigned char *w = (const unsigned char *)s; + const unsigned char *e = w+length; + int linelength = 1; + putc('{', code_file); + for (; w < e;) { + unsigned char c = *w++; + if (c>99) linelength += 4; + else if (c>9) linelength += 3; + else linelength += 2; + if (linelength >= 77) {fputs("\n",code_file); linelength = 0;} + fprintf(code_file, "%d", c); + if (w +int write_number; +int write_sourceview; +extern Fl_Widget_Class_Type *current_widget_class; + +// recursively dump code, putting children between the two parts +// of the parent code: +static Fl_Type* write_code(Fl_Type* p) { + if (write_sourceview) { + p->code_line = (int)ftell(code_file); + if (p->header_line_end==-1) + p->header_line = (int)ftell(header_file); + } + // write all code that come before the children code + // (but don't write the last comment until the very end) + if (!(p==Fl_Type::last && p->is_comment())) + p->write_code1(); + // recursively write the code of all children + Fl_Type* q; + if (p->is_widget() && p->is_class()) { + // Handle widget classes specially + for (q = p->next; q && q->level > p->level;) { + if (strcmp(q->type_name(), "Function")) q = write_code(q); + else { + int level = q->level; + do { + q = q->next; + } while (q && q->level > level); + } + } + + // write all code that come after the children + p->write_code2(); + + for (q = p->next; q && q->level > p->level;) { + if (!strcmp(q->type_name(), "Function")) q = write_code(q); + else { + int level = q->level; + do { + q = q->next; + } while (q && q->level > level); + } + } + + write_h("};\n"); + current_widget_class = 0L; + } else { + for (q = p->next; q && q->level > p->level;) q = write_code(q); + // write all code that come after the children + p->write_code2(); + } + if (write_sourceview) { + p->code_line_end = (int)ftell(code_file); + if (p->header_line_end==-1) + p->header_line_end = (int)ftell(header_file); + } + return q; +} + +extern const char* header_file_name; +extern Fl_Class_Type *current_class; + +int write_code(const char *s, const char *t) { + const char *filemode = "w"; + if (write_sourceview) + filemode = "wb"; + write_number++; + delete id_root; id_root = 0; + indentation = 0; + current_class = 0L; + current_widget_class = 0L; + if (!s) code_file = stdout; + else { + FILE *f = fopen(s, filemode); + if (!f) return 0; + code_file = f; + } + if (!t) header_file = stdout; + else { + FILE *f = fopen(t, filemode); + if (!f) {fclose(code_file); return 0;} + header_file = f; + } + // if the first entry in the Type tree is a comment, then it is probably + // a copyright notice. We print that before anything else in the file! + Fl_Type* first_type = Fl_Type::first; + if (first_type && first_type->is_comment()) { + if (write_sourceview) { + first_type->code_line = (int)ftell(code_file); + first_type->header_line = (int)ftell(header_file); + } + // it is ok to write non-recusive code here, because comments have no children or code2 blocks + first_type->write_code1(); + if (write_sourceview) { + first_type->code_line_end = (int)ftell(code_file); + first_type->header_line_end = (int)ftell(header_file); + } + first_type = first_type->next; + } + + const char *hdr = "\ +// generated by Fast Light User Interface Designer (fluid) version %.4f\n\n"; + fprintf(header_file, hdr, FL_VERSION); + fprintf(code_file, hdr, FL_VERSION); + + {char define_name[102]; + const char* a = fl_filename_name(t); + char* b = define_name; + if (!isalpha(*a)) {*b++ = '_';} + while (*a) {*b++ = isalnum(*a) ? *a : '_'; a++;} + *b = 0; + fprintf(header_file, "#ifndef %s\n", define_name); + fprintf(header_file, "#define %s\n", define_name); + } + + write_declare("#include "); + if (i18n_type && i18n_include[0]) { + if (i18n_include[0] != '<' && + i18n_include[0] != '\"') + write_c("#include \"%s\"\n", i18n_include); + else + write_c("#include %s\n", i18n_include); + if (i18n_type == 2) { + if (i18n_file[0]) write_c("extern nl_catd %s;\n", i18n_file); + else { + write_c("// Initialize I18N stuff now for menus...\n"); + write_c("#include \n"); + write_c("static char *_locale = setlocale(LC_MESSAGES, \"\");\n"); + write_c("static nl_catd _catalog = catopen(\"%s\", 0);\n", + i18n_program); + } + } + } + if (t && include_H_from_C) { + if (*header_file_name == '.' && strchr(header_file_name, '/') == NULL) { + write_c("#include \"%s\"\n", fl_filename_name(t)); + } else { + write_c("#include \"%s\"\n", t); + } + } + for (Fl_Type* p = first_type; p;) { + // write all static data for this & all children first + if (write_sourceview) p->header_line = (int)ftell(header_file); + p->write_static(); + if (write_sourceview) { + p->header_line_end = (int)ftell(header_file); + if (p->header_line==p->header_line_end) p->header_line_end = -1; + } + for (Fl_Type* q = p->next; q && q->level > p->level; q = q->next) { + if (write_sourceview) q->header_line = (int)ftell(header_file); + q->write_static(); + if (write_sourceview) { + q->header_line_end = (int)ftell(header_file); + if (q->header_line==q->header_line_end) q->header_line_end = -1; + } + } + // then write the nested code: + p = write_code(p); + } + + delete included_root; included_root = 0; + + if (!s) return 1; + + fprintf(header_file, "#endif\n"); + + Fl_Type* last_type = Fl_Type::last; + if (last_type && last_type->is_comment()) { + if (write_sourceview) { + last_type->code_line = (int)ftell(code_file); + last_type->header_line = (int)ftell(header_file); + } + last_type->write_code1(); + if (write_sourceview) { + last_type->code_line_end = (int)ftell(code_file); + last_type->header_line_end = (int)ftell(header_file); + } + } + + int x = fclose(code_file); + code_file = 0; + int y = fclose(header_file); + header_file = 0; + return x >= 0 && y >= 0; +} + +int write_strings(const char *sfile) { + FILE *fp = fopen(sfile, "w"); + Fl_Type *p; + Fl_Widget_Type *w; + int i; + + if (!fp) return 1; + + switch (i18n_type) { + case 0 : /* None, just put static text out */ + fprintf(fp, "# generated by Fast Light User Interface Designer (fluid) version %.4f\n", + FL_VERSION); + for (p = Fl_Type::first; p; p = p->next) { + if (p->is_widget()) { + w = (Fl_Widget_Type *)p; + + if (w->label()) { + for (const char *s = w->label(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); + putc('\n', fp); + } + + if (w->tooltip()) { + for (const char *s = w->tooltip(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); + putc('\n', fp); + } + } + } + break; + case 1 : /* GNU gettext, put a .po file out */ + fprintf(fp, "# generated by Fast Light User Interface Designer (fluid) version %.4f\n", + FL_VERSION); + for (p = Fl_Type::first; p; p = p->next) { + if (p->is_widget()) { + w = (Fl_Widget_Type *)p; + + if (w->label()) { + const char *s; + + fputs("msgid \"", fp); + for (s = w->label(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); + fputs("\"\n", fp); + + fputs("msgstr \"", fp); + for (s = w->label(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); + fputs("\"\n", fp); + } + + if (w->tooltip()) { + const char *s; + + fputs("msgid \"", fp); + for (s = w->tooltip(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); + fputs("\"\n", fp); + + fputs("msgstr \"", fp); + for (s = w->tooltip(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); + fputs("\"\n", fp); + } + } + } + break; + case 2 : /* POSIX catgets, put a .msg file out */ + fprintf(fp, "$ generated by Fast Light User Interface Designer (fluid) version %.4f\n", + FL_VERSION); + fprintf(fp, "$set %s\n", i18n_set); + fputs("$quote \"\n", fp); + + for (i = 1, p = Fl_Type::first; p; p = p->next) { + if (p->is_widget()) { + w = (Fl_Widget_Type *)p; + + if (w->label()) { + fprintf(fp, "%d \"", i ++); + for (const char *s = w->label(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); + fputs("\"\n", fp); + } + + if (w->tooltip()) { + fprintf(fp, "%d \"", i ++); + for (const char *s = w->tooltip(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); + fputs("\"\n", fp); + } + } + } + break; + } + + return fclose(fp); +} + +//////////////////////////////////////////////////////////////// + +void Fl_Type::write_static() {} +void Fl_Type::write_code1() { + write_h("// Header for %s\n", title()); + write_c("// Code for %s\n", title()); +} +void Fl_Type::write_code2() {} + +// +// End of "$Id: code.cxx 6013 2008-01-04 22:18:40Z matt $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/comments.h b/third_party/windows/fltk-1.1.10/fluid/comments.h new file mode 100644 index 0000000..f5822b5 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/comments.h @@ -0,0 +1,82 @@ + +static const char * const comment_text[] = { + // GNU Public License/GPL Header + "//\n" + "// NameOfProgram, ShortDescription\n" + "// Copyright (C) YYYY NameOfAuthor\n" + "//\n" + "// This program is free software; you can redistribute it and/or\n" + "// modify it under the terms of the GNU General Public License\n" + "// as published by the Free Software Foundation; either version 2\n" + "// of the License, or (at your option) any later version.\n" + "//\n" + "// This program is distributed in the hope that it will be useful,\n" + "// but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "// GNU General Public License for more details.\n" + "//\n" + "// You should have received a copy of the GNU General Public License\n" + "// along with this program; if not, write to the Free Software\n" + "// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + "//\n", + // GNU Public License/GPL Footer + "\n//\n" + "// NameOfProgram, ShortDescription\n" + "// Copyright (C) YYYY NameOfAuthor\n" + "//", + // GNU Public License/LGPL Header + "//\n" + "// NameOfLibrary, ShortDescription\n" + "// Copyright (C) YYYY NameOfAuthor\n" + "//\n" + "// This library is free software; you can redistribute it and/or\n" + "// modify it under the terms of the GNU Lesser General Public\n" + "// License as published by the Free Software Foundation; either\n" + "// version 2.1 of the License, or (at your option) any later version.\n" + "//\n" + "// This library is distributed in the hope that it will be useful,\n" + "// but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "// GNU Lesser General Public License for more details.\n" + "//\n" + "// You should have received a copy of the GNU Lesser General Public\n" + "// License along with this program; if not, write to the Free Software\n" + "// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + "//\n", + // GNU Public License/LGPL Footer + "\n//\n" + "// NameOfLibrary, ShortDescription\n" + "// Copyright (C) YYYY NameOfAuthor\n" + "//", + // FLTK/Header + "//\n" + "// \"$Id$\"\n" + "//\n" + "// ... for the Fast Light Tool Kit (FLTK).\n" + "//\n" + "// Copyright 1998-2005 by Bill Spitzak and others.\n" + "//\n" + "// This library is free software; you can redistribute it and/or\n" + "// modify it under the terms of the GNU Library General Public\n" + "// License as published by the Free Software Foundation; either\n" + "// version 2 of the License, or (at your option) any later version.\n" + "//\n" + "// This library is distributed in the hope that it will be useful,\n" + "// but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" + "// Library General Public License for more details.\n" + "//\n" + "// You should have received a copy of the GNU Library General Public\n" + "// License along with this library; if not, write to the Free Software\n" + "// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307\n" + "// USA.\n" + "//\n" + "// Please report all bugs and problems on the following page:\n" + "//\n" + "// http://www.fltk.org/str.php\n" + "//\n", + // FLTK/Footer + "\n//\n" + "// End of \"$Id$\".\n" + "//", +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/factory.cxx b/third_party/windows/fltk-1.1.10/fluid/factory.cxx new file mode 100644 index 0000000..1612dd1 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/factory.cxx @@ -0,0 +1,1210 @@ +// +// "$Id: factory.cxx 5658 2007-02-02 20:09:53Z mike $" +// +// Widget factory code for the Fast Light Tool Kit (FLTK). +// +// Type classes for most of the fltk widgets. Most of the work +// is done by code in Fl_Widget_Type.C. Also a factory instance +// of each of these type classes. +// +// This file also contains the "new" menu, which has a pointer +// to a factory instance for every class (both the ones defined +// here and ones in other files) +// +// Copyright 1998-2006 by Bill Spitzak and others. +// +// 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 +#include +#include +#include +#include +#include "../src/flstring.h" +#include "undo.h" + +#include "Fl_Widget_Type.h" + +extern Fl_Pixmap *pixmap[]; + +#if !HAVE_STRCASECMP +// +// 'strcasecmp()' - Do a case-insensitive compare... +// + +static int +strcasecmp(const char *s, const char *t) { + while (*s != '\0' && *t != '\0') { + if (tolower(*s) < tolower(*t)) + return (-1); + else if (tolower(*s) > tolower(*t)) + return (1); + + s ++; + t ++; + } + + if (*s == '\0' && *t == '\0') + return (0); + else if (*s != '\0') + return (1); + else + return (-1); +} +#endif // !HAVE_STRCASECMP + +//////////////////////////////////////////////////////////////// + +#include +class Fl_Box_Type : public Fl_Widget_Type { +public: + virtual const char *type_name() {return "Fl_Box";} + Fl_Widget *widget(int x,int y,int w, int h) { + return new Fl_Box(x,y,w,h,"label");} + Fl_Widget_Type *_make() {return new Fl_Box_Type();} + int pixmapID() { return 5; } +}; +static Fl_Box_Type Fl_Box_type; + +//////////////////////////////////////////////////////////////// + +#include +static Fl_Menu_Item buttontype_menu[] = { + {"Normal",0,0,(void*)0}, + {"Toggle",0,0,(void*)FL_TOGGLE_BUTTON}, + {"Radio",0,0,(void*)FL_RADIO_BUTTON}, + {0}}; +class Fl_Button_Type : public Fl_Widget_Type { + Fl_Menu_Item *subtypes() {return buttontype_menu;} +public: + virtual void ideal_size(int &w, int &h) { + Fl_Widget_Type::ideal_size(w, h); + w += 2 * (o->labelsize() - 4); + h = (h / 5) * 5; + } + virtual const char *type_name() {return "Fl_Button";} + Fl_Widget *widget(int x,int y,int w,int h) { + return new Fl_Button(x,y,w,h,"button");} + Fl_Widget_Type *_make() {return new Fl_Button_Type();} + int is_button() const {return 1;} + int pixmapID() { return 2; } +}; +static Fl_Button_Type Fl_Button_type; + +//////////////////////////////////////////////////////////////// + +#include +class Fl_Return_Button_Type : public Fl_Button_Type { +public: + virtual void ideal_size(int &w, int &h) { + Fl_Button_Type::ideal_size(w, h); + int W = o->h(); + if (o->w()/3 < W) W = o->w()/3; + w += W + 8 - o->labelsize(); + } + virtual const char *type_name() {return "Fl_Return_Button";} + Fl_Widget *widget(int x,int y,int w,int h) { + return new Fl_Return_Button(x,y,w,h,"button");} + Fl_Widget_Type *_make() {return new Fl_Return_Button_Type();} + int pixmapID() { return 23; } +}; +static Fl_Return_Button_Type Fl_Return_Button_type; + +//////////////////////////////////////////////////////////////// + +#include +class Fl_Repeat_Button_Type : public Fl_Widget_Type { +public: + virtual const char *type_name() {return "Fl_Repeat_Button";} + Fl_Widget *widget(int x,int y,int w,int h) { + return new Fl_Repeat_Button(x,y,w,h,"button");} + Fl_Widget_Type *_make() {return new Fl_Repeat_Button_Type();} + int pixmapID() { return 25; } +}; +static Fl_Repeat_Button_Type Fl_Repeat_Button_type; + +//////////////////////////////////////////////////////////////// + +#include +class Fl_Light_Button_Type : public Fl_Button_Type { +public: + virtual void ideal_size(int &w, int &h) { + Fl_Button_Type::ideal_size(w, h); + w += 4; + } + virtual const char *type_name() {return "Fl_Light_Button";} + Fl_Widget *widget(int x,int y,int w,int h) { + return new Fl_Light_Button(x,y,w,h,"button");} + Fl_Widget_Type *_make() {return new Fl_Light_Button_Type();} + int pixmapID() { return 24; } +}; +static Fl_Light_Button_Type Fl_Light_Button_type; + +//////////////////////////////////////////////////////////////// + +#include +class Fl_Check_Button_Type : public Fl_Button_Type { +public: + virtual void ideal_size(int &w, int &h) { + Fl_Button_Type::ideal_size(w, h); + w += 4; + } + virtual const char *type_name() {return "Fl_Check_Button";} + Fl_Widget *widget(int x,int y,int w,int h) { + return new Fl_Check_Button(x,y,w,h,"button");} + Fl_Widget_Type *_make() {return new Fl_Check_Button_Type();} + int pixmapID() { return 3; } +}; +static Fl_Check_Button_Type Fl_Check_Button_type; + +//////////////////////////////////////////////////////////////// + +#include +class Fl_Round_Button_Type : public Fl_Button_Type { +public: + virtual void ideal_size(int &w, int &h) { + Fl_Button_Type::ideal_size(w, h); + w += 4; + } + virtual const char *type_name() {return "Fl_Round_Button";} + Fl_Widget *widget(int x,int y,int w,int h) { + return new Fl_Round_Button(x,y,w,h,"button");} + Fl_Widget_Type *_make() {return new Fl_Round_Button_Type();} + int pixmapID() { return 4; } +}; +static Fl_Round_Button_Type Fl_Round_Button_type; + +//////////////////////////////////////////////////////////////// + +extern int compile_only; + +#include +#include +#include + +static Fl_Menu_Item browser_type_menu[] = { + {"No Select",0,0,(void*)FL_NORMAL_BROWSER}, + {"Select",0,0,(void*)FL_SELECT_BROWSER}, + {"Hold",0,0,(void*)FL_HOLD_BROWSER}, + {"Multi",0,0,(void*)FL_MULTI_BROWSER}, + {0}}; +class Fl_Browser_Type : public Fl_Widget_Type { + Fl_Menu_Item *subtypes() {return browser_type_menu;} + int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c); +public: + virtual void ideal_size(int &w, int &h) { + Fl_Browser *myo = (Fl_Browser *)o; + fl_font(myo->textfont(), myo->textsize()); + h -= Fl::box_dh(o->box()); + w -= Fl::box_dw(o->box()); + int ww = (int)fl_width('m'); + w = ((w + ww - 1) / ww) * ww + Fl::box_dw(o->box()); + h = ((h + fl_height() - 1) / fl_height()) * fl_height() + + Fl::box_dh(o->box()); + if (h < 30) h = 30; + if (w < 50) w = 50; + } + virtual const char *type_name() {return "Fl_Browser";} + Fl_Widget *widget(int x,int y,int w,int h) { + Fl_Browser* b = new Fl_Browser(x,y,w,h); + // Fl_Browser::add calls fl_height(), which requires the X display open. + // Avoid this when compiling so it works w/o a display: + if (!compile_only) { + char buffer[20]; + for (int i = 1; i <= 20; i++) { + sprintf(buffer,"Browser Line %d",i); + b->add(buffer); + } + } + return b; + } + Fl_Widget_Type *_make() {return new Fl_Browser_Type();} + int pixmapID() { return 31; } +}; +static Fl_Browser_Type Fl_Browser_type; + +int Fl_Browser_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { + Fl_Browser *myo = (Fl_Browser*)(w==4 ? ((Fl_Widget_Type*)factory)->o : o); + switch (w) { + case 4: + case 0: f = myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break; + case 1: myo->textfont(f); break; + case 2: myo->textsize(s); break; + case 3: myo->textcolor(c); break; + } + return 1; +} + +class Fl_Check_Browser_Type : public Fl_Widget_Type { + Fl_Menu_Item *subtypes() {return browser_type_menu;} + int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c); +public: + virtual void ideal_size(int &w, int &h) { + Fl_Check_Browser *myo = (Fl_Check_Browser *)o; + fl_font(myo->textfont(), myo->textsize()); + h -= Fl::box_dh(o->box()); + w -= Fl::box_dw(o->box()) - fl_height(); + int ww = (int)fl_width('m'); + w = ((w + ww - 1) / ww) * ww + Fl::box_dw(o->box()); + h = ((h + fl_height() - 1) / fl_height()) * fl_height() + + Fl::box_dh(o->box()); + if (h < 30) h = 30; + if (w < 50) w = 50; + } + virtual const char *type_name() {return "Fl_Check_Browser";} + Fl_Widget *widget(int x,int y,int w,int h) { + Fl_Check_Browser* b = new Fl_Check_Browser(x,y,w,h); + // Fl_Check_Browser::add calls fl_height(), which requires the X display open. + // Avoid this when compiling so it works w/o a display: + if (!compile_only) { + char buffer[20]; + for (int i = 1; i <= 20; i++) { + sprintf(buffer,"Browser Line %d",i); + b->add(buffer); + } + } + return b; + } + Fl_Widget_Type *_make() {return new Fl_Check_Browser_Type();} + int pixmapID() { return 32; } +}; +static Fl_Check_Browser_Type Fl_Check_Browser_type; + +int Fl_Check_Browser_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { + Fl_Check_Browser *myo = (Fl_Check_Browser*)(w==4 ? ((Fl_Widget_Type*)factory)->o : o); + switch (w) { + case 4: + case 0: f = myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break; + case 1: myo->textfont(f); break; + case 2: myo->textsize(s); break; + case 3: myo->textcolor(c); break; + } + return 1; +} + +class Fl_File_Browser_Type : public Fl_Widget_Type { + Fl_Menu_Item *subtypes() {return browser_type_menu;} + int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c); +public: + virtual void ideal_size(int &w, int &h) { + Fl_File_Browser *myo = (Fl_File_Browser *)o; + fl_font(myo->textfont(), myo->textsize()); + h -= Fl::box_dh(o->box()); + w -= Fl::box_dw(o->box()) + fl_height(); + int ww = (int)fl_width('m'); + w = ((w + ww - 1) / ww) * ww + Fl::box_dw(o->box()); + h = ((h + fl_height() - 1) / fl_height()) * fl_height() + + Fl::box_dh(o->box()); + if (h < 30) h = 30; + if (w < 50) w = 50; + } + virtual const char *type_name() {return "Fl_File_Browser";} + Fl_Widget *widget(int x,int y,int w,int h) { + Fl_File_Browser* b = new Fl_File_Browser(x,y,w,h); + // Fl_File_Browser::add calls fl_height(), which requires the X display open. + // Avoid this when compiling so it works w/o a display: + if (!compile_only) { + b->load("."); + } + return b; + } + Fl_Widget_Type *_make() {return new Fl_File_Browser_Type();} + int pixmapID() { return 33; } +}; +static Fl_File_Browser_Type Fl_File_Browser_type; + +int Fl_File_Browser_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { + Fl_File_Browser *myo = (Fl_File_Browser*)(w==4 ? ((Fl_Widget_Type*)factory)->o : o); + switch (w) { + case 4: + case 0: f = myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break; + case 1: myo->textfont(f); break; + case 2: myo->textsize(s); break; + case 3: myo->textcolor(c); break; + } + return 1; +} + +//////////////////////////////////////////////////////////////// + +#include +static Fl_Menu_Item counter_type_menu[] = { + {"Normal",0,0,(void*)FL_NORMAL_COUNTER}, + {"Simple",0,0,(void*)FL_SIMPLE_COUNTER}, + {0}}; +class Fl_Counter_Type : public Fl_Widget_Type { + Fl_Menu_Item *subtypes() {return counter_type_menu;} + int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c); + int is_valuator() const {return 1;} + int pixmapID() { return 41; } +public: + virtual const char *type_name() {return "Fl_Counter";} + Fl_Widget *widget(int x,int y,int w,int h) { + return new Fl_Counter(x,y,w,h,"counter:");} + Fl_Widget_Type *_make() {return new Fl_Counter_Type();} +}; +static Fl_Counter_Type Fl_Counter_type; + +int Fl_Counter_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { + Fl_Counter *myo = (Fl_Counter*)(w==4 ? ((Fl_Widget_Type*)factory)->o : o); + switch (w) { + case 4: + case 0: f = myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break; + case 1: myo->textfont(f); break; + case 2: myo->textsize(s); break; + case 3: myo->textcolor(c); break; + } + return 1; +} + +//////////////////////////////////////////////////////////////// + +#include +static Fl_Menu_Item spinner_type_menu[] = { + {"Integer",0,0,(void*)FL_INT_INPUT}, + {"Float", 0,0,(void*)FL_FLOAT_INPUT}, + {0}}; +class Fl_Spinner_Type : public Fl_Widget_Type { + Fl_Menu_Item *subtypes() {return spinner_type_menu;} + int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c); + int pixmapID() { return 47; } +public: + virtual void ideal_size(int &w, int &h) { + Fl_Spinner *myo = (Fl_Spinner *)o; + fl_font(myo->textfont(), myo->textsize()); + h = fl_height() + myo->textsize() - 6; + if (h < 15) h = 15; + w -= Fl::box_dw(o->box()); + int ww = (int)fl_width('m'); + w = ((w + ww - 1) / ww) * ww + Fl::box_dw(o->box()) + h / 2; + if (w < 40) w = 40 ; + } + virtual const char *type_name() {return "Fl_Spinner";} + int is_spinner() const { return 1; } + Fl_Widget *widget(int x,int y,int w,int h) { + return new Fl_Spinner(x,y,w,h,"spinner:");} + Fl_Widget_Type *_make() {return new Fl_Spinner_Type();} +}; +static Fl_Spinner_Type Fl_Spinner_type; + +int Fl_Spinner_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { + Fl_Spinner *myo = (Fl_Spinner*)(w==4 ? ((Fl_Widget_Type*)factory)->o : o); + switch (w) { + case 4: + case 0: f = (Fl_Font)myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break; + case 1: myo->textfont(f); break; + case 2: myo->textsize(s); break; + case 3: myo->textcolor(c); break; + } + return 1; +} + +//////////////////////////////////////////////////////////////// + +#include +static Fl_Menu_Item input_type_menu[] = { + {"Normal",0,0,(void*)FL_NORMAL_INPUT}, + {"Multiline",0,0,(void*)FL_MULTILINE_INPUT}, + {"Secret",0,0,(void*)FL_SECRET_INPUT}, + {"Int",0,0,(void*)FL_INT_INPUT}, + {"Float",0,0,(void*)FL_FLOAT_INPUT}, + {0}}; +class Fl_Input_Type : public Fl_Widget_Type { + Fl_Menu_Item *subtypes() {return input_type_menu;} + int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c); +public: + virtual void ideal_size(int &w, int &h) { + Fl_Input *myo = (Fl_Input *)o; + fl_font(myo->textfont(), myo->textsize()); + h = fl_height() + myo->textsize() - 6; + w -= Fl::box_dw(o->box()); + int ww = (int)fl_width('m'); + w = ((w + ww - 1) / ww) * ww + Fl::box_dw(o->box()); + if (h < 15) h = 15; + if (w < 15) w = 15; + } + virtual const char *type_name() {return "Fl_Input";} + Fl_Widget *widget(int x,int y,int w,int h) { + Fl_Input *myo = new Fl_Input(x,y,w,h,"input:"); + myo->value("Text Input"); + return myo; + } + Fl_Widget_Type *_make() {return new Fl_Input_Type();} + int pixmapID() { return 14; } + virtual void copy_properties() { + Fl_Widget_Type::copy_properties(); + Fl_Input_ *d = (Fl_Input_*)live_widget, *s = (Fl_Input_*)o; + d->textfont(s->textfont()); + d->textsize(s->textsize()); + d->textcolor(s->textcolor()); + } +}; +static Fl_Input_Type Fl_Input_type; + +int Fl_Input_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { + Fl_Input_ *myo = (Fl_Input_*)(w==4 ? ((Fl_Widget_Type*)factory)->o : o); + switch (w) { + case 4: + case 0: f = myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break; + case 1: myo->textfont(f); break; + case 2: myo->textsize(s); break; + case 3: myo->textcolor(c); break; + } + return 1; +} + +//////////////////////////////////////////////////////////////// + +#include +class Fl_File_Input_Type : public Fl_Widget_Type { + Fl_Menu_Item *subtypes() {return 0;} + int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c); +public: + virtual void ideal_size(int &w, int &h) { + Fl_File_Input *myo = (Fl_File_Input *)o; + fl_font(myo->textfont(), myo->textsize()); + h = fl_height() + myo->textsize() + 4; + w -= Fl::box_dw(o->box()); + int ww = (int)fl_width('m'); + w = ((w + ww - 1) / ww) * ww + Fl::box_dw(o->box()); + if (h < 20) h = 20; + if (w < 50) w = 50; + } + virtual const char *type_name() {return "Fl_File_Input";} + Fl_Widget *widget(int x,int y,int w,int h) { + Fl_File_Input *myo = new Fl_File_Input(x,y,w,h,"file:"); + myo->value("/now/is/the/time/for/a/filename.ext"); + return myo; + } + Fl_Widget_Type *_make() {return new Fl_File_Input_Type();} + int pixmapID() { return 30; } +}; +static Fl_File_Input_Type Fl_File_Input_type; + +int Fl_File_Input_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { + Fl_File_Input *myo = (Fl_File_Input*)(w==4 ? ((Fl_Widget_Type*)factory)->o : o); + switch (w) { + case 4: + case 0: f = myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break; + case 1: myo->textfont(f); break; + case 2: myo->textsize(s); break; + case 3: myo->textcolor(c); break; + } + return 1; +} + +//////////////////////////////////////////////////////////////// + +#include +class Fl_Text_Display_Type : public Fl_Widget_Type { + int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c); +public: + virtual void ideal_size(int &w, int &h) { + Fl_Text_Display *myo = (Fl_Text_Display *)o; + fl_font(myo->textfont(), myo->textsize()); + h -= Fl::box_dh(o->box()); + w -= Fl::box_dw(o->box()); + int ww = (int)fl_width('m'); + w = ((w + ww - 1) / ww) * ww + Fl::box_dw(o->box()); + h = ((h + fl_height() - 1) / fl_height()) * fl_height() + + Fl::box_dh(o->box()); + if (h < 30) h = 30; + if (w < 50) w = 50; + } + virtual const char *type_name() {return "Fl_Text_Display";} + Fl_Widget *widget(int x,int y,int w,int h) { + Fl_Text_Display *myo = new Fl_Text_Display(x,y,w,h); + return myo; + } + Fl_Widget_Type *_make() {return new Fl_Text_Display_Type();} + int pixmapID() { return 28; } +}; +static Fl_Text_Display_Type Fl_Text_Display_type; + +int Fl_Text_Display_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { + Fl_Text_Display *myo = (Fl_Text_Display*)(w==4 ? ((Fl_Widget_Type*)factory)->o : o); + switch (w) { + case 4: + case 0: f = myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break; + case 1: myo->textfont(f); break; + case 2: myo->textsize(s); break; + case 3: myo->textcolor(c); break; + } + return 1; +} + +//////////////////////////////////////////////////////////////// + +#include +class Fl_Text_Editor_Type : public Fl_Widget_Type { + int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c); +public: + virtual void ideal_size(int &w, int &h) { + Fl_Text_Editor *myo = (Fl_Text_Editor *)o; + fl_font(myo->textfont(), myo->textsize()); + h -= Fl::box_dh(o->box()); + w -= Fl::box_dw(o->box()); + int ww = (int)fl_width('m'); + w = ((w + ww - 1) / ww) * ww + Fl::box_dw(o->box()); + h = ((h + fl_height() - 1) / fl_height()) * fl_height() + + Fl::box_dh(o->box()); + if (h < 30) h = 30; + if (w < 50) w = 50; + } + virtual const char *type_name() {return "Fl_Text_Editor";} + Fl_Widget *widget(int x,int y,int w,int h) { + Fl_Text_Editor *myo = new Fl_Text_Editor(x,y,w,h); + return myo; + } + Fl_Widget_Type *_make() {return new Fl_Text_Editor_Type();} + int pixmapID() { return 29; } +}; +static Fl_Text_Editor_Type Fl_Text_Editor_type; + +int Fl_Text_Editor_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { + Fl_Text_Editor *myo = (Fl_Text_Editor*)(w==4 ? ((Fl_Widget_Type*)factory)->o : o); + switch (w) { + case 4: + case 0: f = myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break; + case 1: myo->textfont(f); break; + case 2: myo->textsize(s); break; + case 3: myo->textcolor(c); break; + } + return 1; +} + +//////////////////////////////////////////////////////////////// + +#include +class Fl_Clock_Type : public Fl_Widget_Type { +public: + virtual const char *type_name() {return "Fl_Clock";} + Fl_Widget *widget(int x,int y,int w,int h) { + return new Fl_Clock(x,y,w,h);} + Fl_Widget_Type *_make() {return new Fl_Clock_Type();} + int pixmapID() { return 34; } +}; +static Fl_Clock_Type Fl_Clock_type; + +//////////////////////////////////////////////////////////////// + +#include +class Fl_Help_View_Type : public Fl_Widget_Type { +public: + virtual void ideal_size(int &w, int &h) { + Fl_Help_View *myo = (Fl_Help_View *)o; + fl_font(myo->textfont(), myo->textsize()); + h -= Fl::box_dh(o->box()); + w -= Fl::box_dw(o->box()); + int ww = (int)fl_width('m'); + w = ((w + ww - 1) / ww) * ww + Fl::box_dw(o->box()); + h = ((h + fl_height() - 1) / fl_height()) * fl_height() + + Fl::box_dh(o->box()); + if (h < 30) h = 30; + if (w < 50) w = 50; + } + virtual const char *type_name() {return "Fl_Help_View";} + Fl_Widget *widget(int x,int y,int w,int h) { + Fl_Help_View *myo = new Fl_Help_View(x,y,w,h); + if (!compile_only) { + myo->value("

Fl_Help_View Widget

" + "

This is a Fl_Help_View widget.

"); + } + return myo;} + Fl_Widget_Type *_make() {return new Fl_Help_View_Type();} + int pixmapID() { return 35; } +}; +static Fl_Help_View_Type Fl_Help_View_type; + +//////////////////////////////////////////////////////////////// + +#include +class Fl_Progress_Type : public Fl_Widget_Type { +public: + virtual const char *type_name() {return "Fl_Progress";} + Fl_Widget *widget(int x,int y,int w,int h) { + Fl_Progress *myo = new Fl_Progress(x,y,w,h,"label"); + myo->value(50); + return myo;} + Fl_Widget_Type *_make() {return new Fl_Progress_Type();} + int pixmapID() { return 36; } +}; +static Fl_Progress_Type Fl_Progress_type; + +//////////////////////////////////////////////////////////////// + +#include +class Fl_Adjuster_Type : public Fl_Widget_Type { + int is_valuator() const {return 1;} +public: + virtual const char *type_name() {return "Fl_Adjuster";} + Fl_Widget *widget(int x,int y,int w,int h) { + return new Fl_Adjuster(x,y,w,h);} + Fl_Widget_Type *_make() {return new Fl_Adjuster_Type();} + int pixmapID() { return 40; } +}; +static Fl_Adjuster_Type Fl_Adjuster_type; + +//////////////////////////////////////////////////////////////// + +#include +static Fl_Menu_Item dial_type_menu[] = { + {"Dot",0,0,(void*)0}, + {"Line",0,0,(void*)FL_LINE_DIAL}, + {"Fill",0,0,(void*)FL_FILL_DIAL}, + {0}}; +class Fl_Dial_Type : public Fl_Widget_Type { + Fl_Menu_Item *subtypes() {return dial_type_menu;} + int is_valuator() const {return 1;} +public: + virtual const char *type_name() {return "Fl_Dial";} + Fl_Widget *widget(int x,int y,int w,int h) { + return new Fl_Dial(x,y,w,h);} + Fl_Widget_Type *_make() {return new Fl_Dial_Type();} + int pixmapID() { return 42; } +}; +static Fl_Dial_Type Fl_Dial_type; + +//////////////////////////////////////////////////////////////// + +#include +static Fl_Menu_Item roller_type_menu[] = { + {"Vertical",0,0,(void*)0}, + {"Horizontal",0,0,(void*)FL_HORIZONTAL}, + {0}}; +class Fl_Roller_Type : public Fl_Widget_Type { + Fl_Menu_Item *subtypes() {return roller_type_menu;} + int is_valuator() const {return 1;} +public: + virtual const char *type_name() {return "Fl_Roller";} + Fl_Widget *widget(int x,int y,int w,int h) { + return new Fl_Roller(x,y,w,h);} + Fl_Widget_Type *_make() {return new Fl_Roller_Type();} + int pixmapID() { return 43; } +}; +static Fl_Roller_Type Fl_Roller_type; + +//////////////////////////////////////////////////////////////// + +#include +static Fl_Menu_Item slider_type_menu[] = { + {"Vertical",0,0,(void*)FL_VERT_SLIDER}, + {"Horizontal",0,0,(void*)FL_HOR_SLIDER}, + {"Vert Fill",0,0,(void*)FL_VERT_FILL_SLIDER}, + {"Horz Fill",0,0,(void*)FL_HOR_FILL_SLIDER}, + {"Vert Knob",0,0,(void*)FL_VERT_NICE_SLIDER}, + {"Horz Knob",0,0,(void*)FL_HOR_NICE_SLIDER}, + {0}}; +class Fl_Slider_Type : public Fl_Widget_Type { + Fl_Menu_Item *subtypes() {return slider_type_menu;} + int is_valuator() const {return 2;} +public: + virtual const char *type_name() {return "Fl_Slider";} + Fl_Widget *widget(int x,int y,int w,int h) { + return new Fl_Slider(x,y,w,h,"slider:");} + Fl_Widget_Type *_make() {return new Fl_Slider_Type();} + int pixmapID() { return 37; } +}; +static Fl_Slider_Type Fl_Slider_type; + +static Fl_Menu_Item scrollbar_type_menu[] = { + {"Vertical",0,0,(void*)FL_VERT_SLIDER}, + {"Horizontal",0,0,(void*)FL_HOR_SLIDER}, + {0}}; +class Fl_Scrollbar_Type : public Fl_Slider_Type { + Fl_Menu_Item *subtypes() {return scrollbar_type_menu;} + int is_valuator() const {return 3;} +public: + virtual const char *type_name() {return "Fl_Scrollbar";} + Fl_Widget *widget(int x,int y,int w,int h) { + return new Fl_Scrollbar(x,y,w,h);} + Fl_Widget_Type *_make() {return new Fl_Scrollbar_Type();} + int pixmapID() { return 38; } +}; +static Fl_Scrollbar_Type Fl_Scrollbar_type; + +//////////////////////////////////////////////////////////////// + +#include +static Fl_Menu_Item output_type_menu[] = { + {"Normal",0,0,(void*)FL_NORMAL_OUTPUT}, + {"Multiline",0,0,(void*)FL_MULTILINE_OUTPUT}, + {0}}; +class Fl_Output_Type : public Fl_Input_Type { + Fl_Menu_Item *subtypes() {return output_type_menu;} +public: + virtual void ideal_size(int &w, int &h) { + Fl_Output *myo = (Fl_Output *)o; + fl_font(myo->textfont(), myo->textsize()); + h = fl_height() + myo->textsize() - 6; + w -= Fl::box_dw(o->box()); + int ww = (int)fl_width('m'); + w = ((w + ww - 1) / ww) * ww + Fl::box_dw(o->box()); + if (h < 15) h = 15; + if (w < 15) w = 15; + } + virtual const char *type_name() {return "Fl_Output";} + Fl_Widget *widget(int x,int y,int w,int h) { + Fl_Output *myo = new Fl_Output(x,y,w,h,"output:"); + myo->value("Text Output"); + return myo; + } + Fl_Widget_Type *_make() {return new Fl_Output_Type();} + int pixmapID() { return 27; } +}; +static Fl_Output_Type Fl_Output_type; + +//////////////////////////////////////////////////////////////// + +#include +class Fl_Value_Input_Type : public Fl_Widget_Type { +public: + virtual void ideal_size(int &w, int &h) { + Fl_Value_Input *myo = (Fl_Value_Input *)o; + fl_font(myo->textfont(), myo->textsize()); + h = fl_height() + myo->textsize() - 6; + w -= Fl::box_dw(o->box()); + int ww = (int)fl_width('m'); + w = ((w + ww - 1) / ww) * ww + Fl::box_dw(o->box()); + if (h < 15) h = 15; + if (w < 15) w = 15; + } + virtual const char *type_name() {return "Fl_Value_Input";} + int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c); + int is_valuator() const {return 1;} + Fl_Widget *widget(int x,int y,int w,int h) { + Fl_Value_Input *myo = new Fl_Value_Input(x,y,w,h,"value:"); + return myo; + } + Fl_Widget_Type *_make() {return new Fl_Value_Input_Type();} + int pixmapID() { return 44; } +}; +static Fl_Value_Input_Type Fl_Value_Input_type; + +int Fl_Value_Input_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { + Fl_Value_Input *myo = (Fl_Value_Input*)(w==4 ? ((Fl_Widget_Type*)factory)->o : o); + switch (w) { + case 4: + case 0: f = myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break; + case 1: myo->textfont(f); break; + case 2: myo->textsize(s); break; + case 3: myo->textcolor(c); break; + } + return 1; +} + +//////////////////////////////////////////////////////////////// + +#include +class Fl_Value_Output_Type : public Fl_Widget_Type { +public: + virtual void ideal_size(int &w, int &h) { + Fl_Value_Output *myo = (Fl_Value_Output *)o; + fl_font(myo->textfont(), myo->textsize()); + h = fl_height() + myo->textsize() - 6; + w = o->w() - Fl::box_dw(o->box()); + int ww = (int)fl_width('m'); + w = ((w + ww - 1) / ww) * ww + Fl::box_dw(o->box()); + if (h < 15) h = 15; + if (w < 15) w = 15; + } + virtual const char *type_name() {return "Fl_Value_Output";} + int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c); + int is_valuator() const {return 1;} + Fl_Widget *widget(int x,int y,int w,int h) { + Fl_Value_Output *myo = new Fl_Value_Output(x,y,w,h,"value:"); + return myo; + } + Fl_Widget_Type *_make() {return new Fl_Value_Output_Type();} + int pixmapID() { return 45; } +}; +static Fl_Value_Output_Type Fl_Value_Output_type; + +int Fl_Value_Output_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { + Fl_Value_Output *myo = (Fl_Value_Output*)(w==4 ? ((Fl_Widget_Type*)factory)->o : o); + switch (w) { + case 4: + case 0: f = myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break; + case 1: myo->textfont(f); break; + case 2: myo->textsize(s); break; + case 3: myo->textcolor(c); break; + } + return 1; +} + +//////////////////////////////////////////////////////////////// + +#include +class Fl_Value_Slider_Type : public Fl_Slider_Type { + int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c); +public: + virtual const char *type_name() {return "Fl_Value_Slider";} + Fl_Widget *widget(int x,int y,int w,int h) { + return new Fl_Value_Slider(x,y,w,h,"slider:");} + Fl_Widget_Type *_make() {return new Fl_Value_Slider_Type();} + int pixmapID() { return 39; } +}; +static Fl_Value_Slider_Type Fl_Value_Slider_type; + +int Fl_Value_Slider_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { + Fl_Value_Slider *myo = (Fl_Value_Slider*)(w==4 ? ((Fl_Widget_Type*)factory)->o : o); + switch (w) { + case 4: + case 0: f = myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break; + case 1: myo->textfont(f); break; + case 2: myo->textsize(s); break; + case 3: myo->textcolor(c); break; + } + return 1; +} + +//////////////////////////////////////////////////////////////// + +extern class Fl_Function_Type Fl_Function_type; +extern class Fl_Code_Type Fl_Code_type; +extern class Fl_CodeBlock_Type Fl_CodeBlock_type; +extern class Fl_Decl_Type Fl_Decl_type; +extern class Fl_DeclBlock_Type Fl_DeclBlock_type; +extern class Fl_Comment_Type Fl_Comment_type; +extern class Fl_Class_Type Fl_Class_type; +extern class Fl_Window_Type Fl_Window_type; +extern class Fl_Widget_Class_Type Fl_Widget_Class_type; +extern class Fl_Group_Type Fl_Group_type; +extern class Fl_Pack_Type Fl_Pack_type; +extern class Fl_Tabs_Type Fl_Tabs_type; +extern class Fl_Scroll_Type Fl_Scroll_type; +extern class Fl_Tile_Type Fl_Tile_type; +extern class Fl_Input_Choice_Type Fl_Input_Choice_type; +extern class Fl_Choice_Type Fl_Choice_type; +extern class Fl_Menu_Bar_Type Fl_Menu_Bar_type; +extern class Fl_Menu_Button_Type Fl_Menu_Button_type; +extern class Fl_Menu_Item_Type Fl_Menu_Item_type; +extern class Fl_Submenu_Type Fl_Submenu_type; +extern class Fl_Wizard_Type Fl_Wizard_type; + +extern void select(Fl_Type *,int); +extern void select_only(Fl_Type *); + +#include + +static void cb(Fl_Widget *, void *v) { + undo_checkpoint(); + undo_suspend(); + Fl_Type *t = ((Fl_Type*)v)->make(); + if (t) { + if (t->is_widget() && !t->is_window()) { + Fl_Widget_Type *wt = (Fl_Widget_Type *)t; + + // Set font sizes... + wt->o->labelsize(Fl_Widget_Type::default_size); + + Fl_Font f; + int s = Fl_Widget_Type::default_size; + Fl_Color c; + + wt->textstuff(2, f, s, c); + + // Resize and/or reposition new widget... + int w = 0, h = 0; + wt->ideal_size(w, h); + + if (!strcmp(wt->type_name(), "Fl_Menu_Bar")) { + // Move and resize the menubar across the top of the window... + wt->o->resize(0, 0, w, h); + } else { + // Just resize to the ideal size... + wt->o->size(w, h); + } + } + select_only(t); + set_modflag(1); + t->open(); + } else { + undo_current --; + undo_last --; + } + undo_resume(); +} + +Fl_Menu_Item New_Menu[] = { +{"Code",0,0,0,FL_SUBMENU}, + {"Function/Method",0,cb,(void*)&Fl_Function_type}, + {"Code",0,cb,(void*)&Fl_Code_type}, + {"Code Block",0,cb,(void*)&Fl_CodeBlock_type}, + {"Declaration",0,cb,(void*)&Fl_Decl_type}, + {"Declaration Block",0,cb,(void*)&Fl_DeclBlock_type}, + {"Class",0,cb,(void*)&Fl_Class_type}, + {"Widget Class",0,cb,(void*)&Fl_Widget_Class_type}, + {"Comment",0,cb,(void*)&Fl_Comment_type}, +{0}, +{"Group",0,0,0,FL_SUBMENU}, + {0,0,cb,(void*)&Fl_Window_type}, + {0,0,cb,(void*)&Fl_Group_type}, + {0,0,cb,(void*)&Fl_Pack_type}, + {0,0,cb,(void*)&Fl_Tabs_type}, + {0,0,cb,(void*)&Fl_Scroll_type}, + {0,0,cb,(void*)&Fl_Tile_type}, + {0,0,cb,(void*)&Fl_Wizard_type}, +{0}, +{"Buttons",0,0,0,FL_SUBMENU}, + {0,0,cb,(void*)&Fl_Button_type}, + {0,0,cb,(void*)&Fl_Return_Button_type}, + {0,0,cb,(void*)&Fl_Light_Button_type}, + {0,0,cb,(void*)&Fl_Check_Button_type}, + {0,0,cb,(void*)&Fl_Repeat_Button_type}, + {0,0,cb,(void*)&Fl_Round_Button_type}, +{0}, +{"Valuators",0,0,0,FL_SUBMENU}, + {0,0,cb,(void*)&Fl_Slider_type}, + {0,0,cb,(void*)&Fl_Scrollbar_type}, + {0,0,cb,(void*)&Fl_Value_Slider_type}, + {0,0,cb,(void*)&Fl_Adjuster_type}, + {0,0,cb,(void*)&Fl_Counter_type}, + {0,0,cb,(void*)&Fl_Spinner_type}, + {0,0,cb,(void*)&Fl_Dial_type}, + {0,0,cb,(void*)&Fl_Roller_type}, + {0,0,cb,(void*)&Fl_Value_Input_type}, + {0,0,cb,(void*)&Fl_Value_Output_type}, +{0}, +{"Text",0,0,0,FL_SUBMENU}, + {0,0,cb,(void*)&Fl_File_Input_type}, + {0,0,cb,(void*)&Fl_Input_type}, + {0,0,cb,(void*)&Fl_Output_type}, + {0,0,cb,(void*)&Fl_Text_Display_type}, + {0,0,cb,(void*)&Fl_Text_Editor_type}, +{0}, +{"Menus",0,0,0,FL_SUBMENU}, + {0,0,cb,(void*)&Fl_Menu_Bar_type}, + {0,0,cb,(void*)&Fl_Menu_Button_type}, + {0,0,cb,(void*)&Fl_Choice_type}, + {0,0,cb,(void*)&Fl_Input_Choice_type}, + {0,0,cb, (void*)&Fl_Submenu_type}, + {0,0,cb, (void*)&Fl_Menu_Item_type}, +{0}, +{"Browsers",0,0,0,FL_SUBMENU}, + {0,0,cb,(void*)&Fl_Browser_type}, + {0,0,cb,(void*)&Fl_Check_Browser_type}, + {0,0,cb,(void*)&Fl_File_Browser_type}, +{0}, +{"Other",0,0,0,FL_SUBMENU}, + {0,0,cb,(void*)&Fl_Box_type}, + {0,0,cb,(void*)&Fl_Clock_type}, + {0,0,cb,(void*)&Fl_Help_View_type}, + {0,0,cb,(void*)&Fl_Progress_type}, +{0}, +{0}}; + +#include + +// modify a menuitem to display an icon in front of the label +static void make_iconlabel( Fl_Menu_Item *mi, Fl_Image *ic, const char *txt ) +{ + if (ic) { + char *t1 = new char[strlen(txt)+6]; + strcpy( t1, " " ); + strcat(t1, txt); + strcat(t1, "..."); + mi->image( ic ); + Fl_Multi_Label *ml = new Fl_Multi_Label; + ml->labela = (char*)ic; + ml->labelb = t1; + ml->typea = _FL_IMAGE_LABEL; + ml->typeb = FL_NORMAL_LABEL; + ml->label( mi ); + } + else if (txt!=mi->text) + mi->label(txt); +} + +void fill_in_New_Menu() { + for (unsigned i = 0; i < sizeof(New_Menu)/sizeof(*New_Menu); i++) { + Fl_Menu_Item *m = New_Menu+i; + if (m->user_data()) { + Fl_Type *t = (Fl_Type*)m->user_data(); + if (m->text) { + make_iconlabel( m, pixmap[t->pixmapID()], m->label() ); + } + else { + const char *n = t->type_name(); + if (!strncmp(n,"Fl_",3)) n += 3; + make_iconlabel( m, pixmap[t->pixmapID()], n ); + } + } + } +} + +// use keyword to pick the type, this is used to parse files: +int reading_file; +Fl_Type *Fl_Type_make(const char *tn) { + reading_file = 1; // makes labels be null + Fl_Type *r = 0; + for (unsigned i = 0; i < sizeof(New_Menu)/sizeof(*New_Menu); i++) { + Fl_Menu_Item *m = New_Menu+i; + if (!m->user_data()) continue; + Fl_Type *t = (Fl_Type*)(m->user_data()); + if (!strcasecmp(tn,t->type_name())) {r = t->make(); break;} + } + reading_file = 0; + return r; +} + +//////////////////////////////////////////////////////////////// + +// Since I have included all the .H files, do this table here: +// This table is only used to read fdesign files: + +struct symbol {const char *name; int value;}; + +static symbol table[] = { + {"BLACK", FL_BLACK}, + {"RED", FL_RED}, + {"GREEN", FL_GREEN}, + {"YELLOW", FL_YELLOW}, + {"BLUE", FL_BLUE}, + {"MAGENTA", FL_MAGENTA}, + {"CYAN", FL_CYAN}, + {"WHITE", FL_WHITE}, + + {"LCOL", FL_BLACK}, + {"COL1", FL_GRAY}, + {"MCOL", FL_LIGHT1}, + {"LEFT_BCOL", FL_LIGHT3}, + {"TOP_BCOL", FL_LIGHT2}, + {"BOTTOM_BCOL", FL_DARK2}, + {"RIGHT_BCOL", FL_DARK3}, + {"INACTIVE", FL_INACTIVE_COLOR}, + {"INACTIVE_COL", FL_INACTIVE_COLOR}, + {"FREE_COL1", FL_FREE_COLOR}, + {"FREE_COL2", FL_FREE_COLOR+1}, + {"FREE_COL3", FL_FREE_COLOR+2}, + {"FREE_COL4", FL_FREE_COLOR+3}, + {"FREE_COL5", FL_FREE_COLOR+4}, + {"FREE_COL6", FL_FREE_COLOR+5}, + {"FREE_COL7", FL_FREE_COLOR+6}, + {"FREE_COL8", FL_FREE_COLOR+7}, + {"FREE_COL9", FL_FREE_COLOR+8}, + {"FREE_COL10", FL_FREE_COLOR+9}, + {"FREE_COL11", FL_FREE_COLOR+10}, + {"FREE_COL12", FL_FREE_COLOR+11}, + {"FREE_COL13", FL_FREE_COLOR+12}, + {"FREE_COL14", FL_FREE_COLOR+13}, + {"FREE_COL15", FL_FREE_COLOR+14}, + {"FREE_COL16", FL_FREE_COLOR+15}, + {"TOMATO", 131}, + {"INDIANRED", 164}, + {"SLATEBLUE", 195}, + {"DARKGOLD", 84}, + {"PALEGREEN", 157}, + {"ORCHID", 203}, + {"DARKCYAN", 189}, + {"DARKTOMATO", 113}, + {"WHEAT", 174}, + {"ALIGN_CENTER", FL_ALIGN_CENTER}, + {"ALIGN_TOP", FL_ALIGN_TOP}, + {"ALIGN_BOTTOM", FL_ALIGN_BOTTOM}, + {"ALIGN_LEFT", FL_ALIGN_LEFT}, + {"ALIGN_RIGHT", FL_ALIGN_RIGHT}, + {"ALIGN_INSIDE", FL_ALIGN_INSIDE}, + {"ALIGN_TOP_LEFT", FL_ALIGN_TOP | FL_ALIGN_LEFT}, + {"ALIGN_TOP_RIGHT", FL_ALIGN_TOP | FL_ALIGN_RIGHT}, + {"ALIGN_BOTTOM_LEFT", FL_ALIGN_BOTTOM | FL_ALIGN_LEFT}, + {"ALIGN_BOTTOM_RIGHT", FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT}, + {"ALIGN_CENTER|FL_ALIGN_INSIDE", FL_ALIGN_CENTER|FL_ALIGN_INSIDE}, + {"ALIGN_TOP|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_INSIDE}, + {"ALIGN_BOTTOM|FL_ALIGN_INSIDE", FL_ALIGN_BOTTOM|FL_ALIGN_INSIDE}, + {"ALIGN_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_LEFT|FL_ALIGN_INSIDE}, + {"ALIGN_RIGHT|FL_ALIGN_INSIDE", FL_ALIGN_RIGHT|FL_ALIGN_INSIDE}, + {"ALIGN_INSIDE|FL_ALIGN_INSIDE", FL_ALIGN_INSIDE|FL_ALIGN_INSIDE}, + {"ALIGN_TOP_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE}, + {"ALIGN_TOP_RIGHT|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_RIGHT|FL_ALIGN_INSIDE}, + {"ALIGN_BOTTOM_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_BOTTOM|FL_ALIGN_LEFT|FL_ALIGN_INSIDE}, + {"ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE",FL_ALIGN_BOTTOM|FL_ALIGN_RIGHT|FL_ALIGN_INSIDE}, + + {"ALIGN_LEFT_TOP", FL_ALIGN_TOP | FL_ALIGN_LEFT}, + {"ALIGN_RIGHT_TOP", FL_ALIGN_TOP | FL_ALIGN_RIGHT}, + {"ALIGN_LEFT_BOTTOM", FL_ALIGN_BOTTOM | FL_ALIGN_LEFT}, + {"ALIGN_RIGHT_BOTTOM", FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT}, + {"INVALID_STYLE", 255}, + {"NORMAL_STYLE", FL_HELVETICA}, + {"BOLD_STYLE", FL_HELVETICA|FL_BOLD}, + {"ITALIC_STYLE", FL_HELVETICA|FL_ITALIC}, + {"BOLDITALIC_STYLE", FL_HELVETICA|FL_BOLD|FL_ITALIC}, + {"FIXED_STYLE", FL_COURIER}, + {"FIXEDBOLD_STYLE", FL_COURIER|FL_BOLD}, + {"FIXEDITALIC_STYLE", FL_COURIER|FL_ITALIC}, + {"FIXEDBOLDITALIC_STYLE", FL_COURIER|FL_BOLD|FL_ITALIC}, + {"TIMES_STYLE", FL_TIMES}, + {"TIMESBOLD_STYLE", FL_TIMES|FL_BOLD}, + {"TIMESITALIC_STYLE", FL_TIMES|FL_ITALIC}, + {"TIMESBOLDITALIC_STYLE", FL_TIMES|FL_BOLD|FL_ITALIC}, + {"SHADOW_STYLE", (_FL_SHADOW_LABEL<<8)}, + {"ENGRAVED_STYLE", (_FL_ENGRAVED_LABEL<<8)}, + {"EMBOSSED_STYLE", (_FL_EMBOSSED_LABEL<<0)}, + {"TINY_SIZE", 8}, + {"SMALL_SIZE", 11}, + {"NORMAL_SIZE", FL_NORMAL_SIZE}, + {"MEDIUM_SIZE", 18}, + {"LARGE_SIZE", 24}, + {"HUGE_SIZE", 32}, + {"DEFAULT_SIZE", FL_NORMAL_SIZE}, + {"TINY_FONT", 8}, + {"SMALL_FONT", 11}, + {"NORMAL_FONT", FL_NORMAL_SIZE}, + {"MEDIUM_FONT", 18}, + {"LARGE_FONT", 24}, + {"HUGE_FONT", 32}, + {"NORMAL_FONT1", 11}, + {"NORMAL_FONT2", FL_NORMAL_SIZE}, + {"DEFAULT_FONT", 11}, + {"RETURN_END_CHANGED", 0}, + {"RETURN_CHANGED", 1}, + {"RETURN_END", 2}, + {"RETURN_ALWAYS", 3}, + {"PUSH_BUTTON", FL_TOGGLE_BUTTON}, + {"RADIO_BUTTON", FL_RADIO_BUTTON}, + {"HIDDEN_BUTTON", FL_HIDDEN_BUTTON}, + {"SELECT_BROWSER", FL_SELECT_BROWSER}, + {"HOLD_BROWSER", FL_HOLD_BROWSER}, + {"MULTI_BROWSER", FL_MULTI_BROWSER}, + {"SIMPLE_COUNTER", FL_SIMPLE_COUNTER}, + {"LINE_DIAL", FL_LINE_DIAL}, + {"FILL_DIAL", FL_FILL_DIAL}, + {"VERT_SLIDER", FL_VERT_SLIDER}, + {"HOR_SLIDER", FL_HOR_SLIDER}, + {"VERT_FILL_SLIDER", FL_VERT_FILL_SLIDER}, + {"HOR_FILL_SLIDER", FL_HOR_FILL_SLIDER}, + {"VERT_NICE_SLIDER", FL_VERT_NICE_SLIDER}, + {"HOR_NICE_SLIDER", FL_HOR_NICE_SLIDER}, +}; + +#include + +int lookup_symbol(const char *name, int &v, int numberok) { + if (name[0]=='F' && name[1]=='L' && name[2]=='_') name += 3; + for (int i=0; i < int(sizeof(table)/sizeof(*table)); i++) + if (!strcasecmp(name,table[i].name)) {v = table[i].value; return 1;} + if (numberok && ((v = atoi(name)) || !strcmp(name,"0"))) return 1; + return 0; +} + +// +// End of "$Id: factory.cxx 5658 2007-02-02 20:09:53Z mike $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/file.cxx b/third_party/windows/fltk-1.1.10/fluid/file.cxx new file mode 100644 index 0000000..af1a5af --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/file.cxx @@ -0,0 +1,650 @@ +// +// "$Id: file.cxx 5808 2007-05-10 12:06:31Z matt $" +// +// Fluid file routines for the Fast Light Tool Kit (FLTK). +// +// You may find the basic read_* and write_* routines to +// be useful for other programs. I have used them many times. +// They are somewhat similar to tcl, using matching { and } +// to quote strings. +// +// Copyright 1998-2006 by Bill Spitzak and others. +// +// 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 +#include +#include "../src/flstring.h" +#include +#include "alignment_panel.h" + +//////////////////////////////////////////////////////////////// +// BASIC FILE WRITING: + +static FILE *fout; + +int open_write(const char *s) { + if (!s) {fout = stdout; return 1;} + FILE *f = fopen(s,"w"); + if (!f) return 0; + fout = f; + return 1; +} + +int close_write() { + if (fout != stdout) { + int x = fclose(fout); + fout = stdout; + return x >= 0; + } + return 1; +} + +static int needspace; +int is_id(char); // in code.C + +// write a string, quoting characters if necessary: +void write_word(const char *w) { + if (needspace) putc(' ', fout); + needspace = 1; + if (!w || !*w) {fprintf(fout,"{}"); return;} + const char *p; + // see if it is a single word: + for (p = w; is_id(*p); p++) ; + if (!*p) {fprintf(fout,"%s",w); return;} + // see if there are matching braces: + int n = 0; + for (p = w; *p; p++) { + if (*p == '{') n++; + else if (*p == '}') {n--; if (n<0) break;} + } + int mismatched = (n != 0); + // write out brace-quoted string: + putc('{', fout); + for (; *w; w++) { + switch (*w) { + case '{': + case '}': + if (!mismatched) break; + case '\\': + case '#': + putc('\\',fout); + break; + } + putc(*w,fout); + } + putc('}', fout); +} + +// write an arbitrary formatted word, or a comment, etc: +void write_string(const char *format, ...) { + va_list args; + va_start(args, format); + if (needspace) fputc(' ',fout); + vfprintf(fout, format, args); + va_end(args); + needspace = !isspace(format[strlen(format)-1] & 255); +} + +// start a new line and indent it for a given nesting level: +void write_indent(int n) { + fputc('\n',fout); + while (n--) {fputc(' ',fout); fputc(' ',fout);} + needspace = 0; +} + +// write a '{' at the given indenting level: +void write_open(int) { + if (needspace) fputc(' ',fout); + fputc('{',fout); + needspace = 0; +} + +// write a '}' at the given indenting level: +void write_close(int n) { + if (needspace) write_indent(n); + fputc('}',fout); + needspace = 1; +} + +//////////////////////////////////////////////////////////////// +// BASIC FILE READING: + +static FILE *fin; +static int lineno; +static const char *fname; + +int open_read(const char *s) { + lineno = 1; + if (!s) {fin = stdin; fname = "stdin"; return 1;} + FILE *f = fopen(s,"r"); + if (!f) return 0; + fin = f; + fname = s; + return 1; +} + +int close_read() { + if (fin != stdin) { + int x = fclose(fin); + fin = 0; + return x >= 0; + } + return 1; +} + +#include + +void read_error(const char *format, ...) { + va_list args; + va_start(args, format); + if (!fin) { + char buffer[1024]; + vsnprintf(buffer, sizeof(buffer), format, args); + fl_message(buffer); + } else { + fprintf(stderr, "%s:%d: ", fname, lineno); + vfprintf(stderr, format, args); + fprintf(stderr, "\n"); + } + va_end(args); +} + +static int hexdigit(int x) { + if (isdigit(x)) return x-'0'; + if (isupper(x)) return x-'A'+10; + if (islower(x)) return x-'a'+10; + return 20; +} + + +static int read_quoted() { // read whatever character is after a \ . + int c,d,x; + switch(c = fgetc(fin)) { + case '\n': lineno++; return -1; + case 'a' : return('\a'); + case 'b' : return('\b'); + case 'f' : return('\f'); + case 'n' : return('\n'); + case 'r' : return('\r'); + case 't' : return('\t'); + case 'v' : return('\v'); + case 'x' : /* read hex */ + for (c=x=0; x<3; x++) { + int ch = fgetc(fin); + d = hexdigit(ch); + if (d > 15) {ungetc(ch,fin); break;} + c = (c<<4)+d; + } + break; + default: /* read octal */ + if (c<'0' || c>'7') break; + c -= '0'; + for (x=0; x<2; x++) { + int ch = fgetc(fin); + d = hexdigit(ch); + if (d>7) {ungetc(ch,fin); break;} + c = (c<<3)+d; + } + break; + } + return(c); +} + +// return a word read from the file, or NULL at the EOF: +// This will skip all comments (# to end of line), and evaluate +// all \xxx sequences and use \ at the end of line to remove the newline. +// A word is any one of: +// a continuous string of non-space chars except { and } and # +// everything between matching {...} (unless wantbrace != 0) +// the characters '{' and '}' + +static char *buffer; +static int buflen; +static void expand_buffer(int length) { + if (length >= buflen) { + if (!buflen) { + buflen = length+1; + buffer = (char*)malloc(buflen); + } else { + buflen = 2*buflen; + if (length >= buflen) buflen = length+1; + buffer = (char *)realloc((void *)buffer,buflen); + } + } +} + +const char *read_word(int wantbrace) { + int x; + + // skip all the whitespace before it: + for (;;) { + x = getc(fin); + if (x < 0 && feof(fin)) { // eof + return 0; + } else if (x == '#') { // comment + do x = getc(fin); while (x >= 0 && x != '\n'); + lineno++; + continue; + } else if (x == '\n') { + lineno++; + } else if (!isspace(x & 255)) { + break; + } + } + + expand_buffer(100); + + if (x == '{' && !wantbrace) { + + // read in whatever is between braces + int length = 0; + int nesting = 0; + for (;;) { + x = getc(fin); + if (x<0) {read_error("Missing '}'"); break;} + else if (x == '#') { // embedded comment + do x = getc(fin); while (x >= 0 && x != '\n'); + lineno++; + continue; + } else if (x == '\n') lineno++; + else if (x == '\\') {x = read_quoted(); if (x<0) continue;} + else if (x == '{') nesting++; + else if (x == '}') {if (!nesting--) break;} + buffer[length++] = x; + expand_buffer(length); + } + buffer[length] = 0; + return buffer; + + } else if (x == '{' || x == '}') { + // all the punctuation is a word: + buffer[0] = x; + buffer[1] = 0; + return buffer; + + } else { + + // read in an unquoted word: + int length = 0; + for (;;) { + if (x == '\\') {x = read_quoted(); if (x<0) continue;} + else if (x<0 || isspace(x & 255) || x=='{' || x=='}' || x=='#') break; + buffer[length++] = x; + expand_buffer(length); + x = getc(fin); + } + ungetc(x, fin); + buffer[length] = 0; + return buffer; + + } +} + +//////////////////////////////////////////////////////////////// + +#include +#include "Fl_Widget_Type.h" + +// global int variables: +extern int i18n_type; +extern const char* i18n_include; +extern const char* i18n_function; +extern const char* i18n_file; +extern const char* i18n_set; + + +extern int header_file_set; +extern int code_file_set; +extern const char* header_file_name; +extern const char* code_file_name; + +int write_file(const char *filename, int selected_only) { + if (!open_write(filename)) return 0; + write_string("# data file for the Fltk User Interface Designer (fluid)\n" + "version %.4f",FL_VERSION); + if(!include_H_from_C) + write_string("\ndo_not_include_H_from_C"); + if(use_FL_COMMAND) + write_string("\nuse_FL_COMMAND"); + if (i18n_type) { + write_string("\ni18n_type %d", i18n_type); + write_string("\ni18n_include %s", i18n_include); + switch (i18n_type) { + case 1 : /* GNU gettext */ + write_string("\ni18n_function %s", i18n_function); + break; + case 2 : /* POSIX catgets */ + if (i18n_file[0]) write_string("\ni18n_file %s", i18n_file); + write_string("\ni18n_set %s", i18n_set); + break; + } + } + if (!selected_only) { + write_string("\nheader_name"); write_word(header_file_name); + write_string("\ncode_name"); write_word(code_file_name); + } + for (Fl_Type *p = Fl_Type::first; p;) { + if (!selected_only || p->selected) { + p->write(); + write_string("\n"); + int q = p->level; + for (p = p->next; p && p->level > q; p = p->next); + } else { + p = p->next; + } + } + return close_write(); +} + +//////////////////////////////////////////////////////////////// +// read all the objects out of the input file: + +void read_fdesign(); + +double read_version; + +extern Fl_Type *Fl_Type_make(const char *tn); + +static void read_children(Fl_Type *p, int paste) { + Fl_Type::current = p; + for (;;) { + const char *c = read_word(); + REUSE_C: + if (!c) { + if (p && !paste) read_error("Missing '}'"); + break; + } + + if (!strcmp(c,"}")) { + if (!p) read_error("Unexpected '}'"); + break; + } + + // this is the first word in a .fd file: + if (!strcmp(c,"Magic:")) { + read_fdesign(); + return; + } + + if (!strcmp(c,"version")) { + c = read_word(); + read_version = strtod(c,0); + if (read_version<=0 || read_version>FL_VERSION) + read_error("unknown version '%s'",c); + continue; + } + + // back compatability with Vincent Penne's original class code: + if (!p && !strcmp(c,"define_in_struct")) { + Fl_Type *t = Fl_Type_make("class"); + t->name(read_word()); + Fl_Type::current = p = t; + paste = 1; // stops "missing }" error + continue; + } + + if (!strcmp(c,"do_not_include_H_from_C")) { + include_H_from_C=0; + goto CONTINUE; + } + if (!strcmp(c,"use_FL_COMMAND")) { + use_FL_COMMAND=1; + goto CONTINUE; + } + if (!strcmp(c,"i18n_type")) { + i18n_type = atoi(read_word()); + goto CONTINUE; + } + if (!strcmp(c,"i18n_function")) { + i18n_function = strdup(read_word()); + goto CONTINUE; + } + if (!strcmp(c,"i18n_file")) { + i18n_file = strdup(read_word()); + goto CONTINUE; + } + if (!strcmp(c,"i18n_set")) { + i18n_set = strdup(read_word()); + goto CONTINUE; + } + if (!strcmp(c,"i18n_include")) { + i18n_include = strdup(read_word()); + goto CONTINUE; + } + if (!strcmp(c,"i18n_type")) + { + i18n_type = atoi(read_word()); + goto CONTINUE; + } + if (!strcmp(c,"i18n_type")) + { + i18n_type = atoi(read_word()); + goto CONTINUE; + } + if (!strcmp(c,"header_name")) { + if (!header_file_set) header_file_name = strdup(read_word()); + else read_word(); + goto CONTINUE; + } + + if (!strcmp(c,"code_name")) { + if (!code_file_set) code_file_name = strdup(read_word()); + else read_word(); + goto CONTINUE; + } + + if (!strcmp(c, "snap") || !strcmp(c, "gridx") || !strcmp(c, "gridy")) { + // grid settings are now global + read_word(); + goto CONTINUE; + } + + {Fl_Type *t = Fl_Type_make(c); + if (!t) { + read_error("Unknown word \"%s\"", c); + continue; + } + t->name(read_word()); + + c = read_word(1); + if (strcmp(c,"{") && t->is_class()) { // + ((Fl_Class_Type*)t)->prefix(t->name()); + t->name(c); + c = read_word(1); + } + + if (strcmp(c,"{")) { + read_error("Missing property list for %s\n",t->title()); + goto REUSE_C; + } + + t->open_ = 0; + for (;;) { + const char *cc = read_word(); + if (!cc || !strcmp(cc,"}")) break; + t->read_property(cc); + } + + if (!t->is_parent()) continue; + c = read_word(1); + if (strcmp(c,"{")) { + read_error("Missing child list for %s\n",t->title()); + goto REUSE_C; + } + read_children(t, 0);} + Fl_Type::current = p; + CONTINUE:; + } +} + +extern void deselect(); + +int read_file(const char *filename, int merge) { + Fl_Type *o; + read_version = 0.0; + if (!open_read(filename)) return 0; + if (merge) deselect(); else delete_all(); + read_children(Fl_Type::current, merge); + Fl_Type::current = 0; + // Force menu items to be rebuilt... + for (o = Fl_Type::first; o; o = o->next) + if (o->is_menu_button()) o->add_child(0,0); + for (o = Fl_Type::first; o; o = o->next) + if (o->selected) {Fl_Type::current = o; break;} + selection_changed(Fl_Type::current); + return close_read(); +} + +//////////////////////////////////////////////////////////////// +// Read Forms and XForms fdesign files: + +int read_fdesign_line(const char*& name, const char*& value) { + + int length = 0; + int x; + // find a colon: + for (;;) { + x = getc(fin); + if (x < 0 && feof(fin)) return 0; + if (x == '\n') {length = 0; continue;} // no colon this line... + if (!isspace(x & 255)) { + buffer[length++] = x; + expand_buffer(length); + } + if (x == ':') break; + } + int valueoffset = length; + buffer[length-1] = 0; + + // skip to start of value: + for (;;) { + x = getc(fin); + if ((x < 0 && feof(fin)) || x == '\n' || !isspace(x & 255)) break; + } + + // read the value: + for (;;) { + if (x == '\\') {x = read_quoted(); if (x<0) continue;} + else if (x == '\n') break; + buffer[length++] = x; + expand_buffer(length); + x = getc(fin); + } + buffer[length] = 0; + name = buffer; + value = buffer+valueoffset; + return 1; +} + +int fdesign_flip; +int fdesign_magic; +#include + +static const char *class_matcher[] = { +"FL_CHECKBUTTON", "Fl_Check_Button", +"FL_ROUNDBUTTON", "Fl_Round_Button", +"FL_ROUND3DBUTTON", "Fl_Round_Button", +"FL_LIGHTBUTTON", "Fl_Light_Button", +"FL_FRAME", "Fl_Box", +"FL_LABELFRAME", "Fl_Box", +"FL_TEXT", "Fl_Box", +"FL_VALSLIDER", "Fl_Value_Slider", +"FL_MENU", "Fl_Menu_Button", +"3", "FL_BITMAP", +"1", "FL_BOX", +"71","FL_BROWSER", +"11","FL_BUTTON", +"4", "FL_CHART", +"42","FL_CHOICE", +"61","FL_CLOCK", +"25","FL_COUNTER", +"22","FL_DIAL", +"101","FL_FREE", +"31","FL_INPUT", +"12","Fl_Light_Button", +"41","FL_MENU", +"23","FL_POSITIONER", +"13","Fl_Round_Button", +"21","FL_SLIDER", +"2", "FL_BOX", // was FL_TEXT +"62","FL_TIMER", +"24","Fl_Value_Slider", +0}; + +void read_fdesign() { + fdesign_magic = atoi(read_word()); + fdesign_flip = (fdesign_magic < 13000); + Fl_Widget_Type *window = 0; + Fl_Widget_Type *group = 0; + Fl_Widget_Type *widget = 0; + if (!Fl_Type::current) { + Fl_Type *t = Fl_Type_make("Function"); + t->name("create_the_forms()"); + Fl_Type::current = t; + } + for (;;) { + const char *name; + const char *value; + if (!read_fdesign_line(name, value)) break; + + if (!strcmp(name,"Name")) { + + window = (Fl_Widget_Type*)Fl_Type_make("Fl_Window"); + window->name(value); + window->label(value); + Fl_Type::current = widget = window; + + } else if (!strcmp(name,"class")) { + + if (!strcmp(value,"FL_BEGIN_GROUP")) { + group = widget = (Fl_Widget_Type*)Fl_Type_make("Fl_Group"); + Fl_Type::current = group; + } else if (!strcmp(value,"FL_END_GROUP")) { + if (group) { + Fl_Group* g = (Fl_Group*)(group->o); + g->begin(); + g->forms_end(); + Fl_Group::current(0); + } + group = widget = 0; + Fl_Type::current = window; + } else { + for (int i = 0; class_matcher[i]; i += 2) + if (!strcmp(value,class_matcher[i])) { + value = class_matcher[i+1]; break;} + widget = (Fl_Widget_Type*)Fl_Type_make(value); + if (!widget) { + printf("class %s not found, using Fl_Button\n", value); + widget = (Fl_Widget_Type*)Fl_Type_make("Fl_Button"); + } + } + + } else if (widget) { + if (!widget->read_fdesign(name, value)) + printf("Ignoring \"%s: %s\"\n", name, value); + } + } +} + +// +// End of "$Id: file.cxx 5808 2007-05-10 12:06:31Z matt $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/fluid.app/Contents/Info.plist b/third_party/windows/fltk-1.1.10/fluid/fluid.app/Contents/Info.plist new file mode 100644 index 0000000..84b9185 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/fluid.app/Contents/Info.plist @@ -0,0 +1,68 @@ + + + + CFBundleInfoDictionaryVersion + 6.0 + + CFBundleExecutable + fluid + + CFBundleIdentifier + org.fltk.fluid + + CFBundleVersion + 1.1.7 + + CFBundleDevelopmentRegion + English + + NSHumanReadableCopyright + Copyright 1998-2006 by Bill Spitzak and others + + CFAppleHelpAnchor + help + + CFBundleName + FLUID + + CFBundlePackageType + APPL + + CFBundleSignature + FLID + + CFBundleIconFile + fluid.icns + + CFBundleShortVersionString + 1.1.7 + + CFBundleGetInfoString + 1.1.7, Copyright 1998-2006 by Bill Spitzak and others + + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + fl + + + CFBundleTypeIconFile + fluid.icns + + CFBundleTypeName + FLUID Designer File + + CFBundleTypeOSTypes + + Flid + + + CFBundleTypeRole + Editor + + + + + diff --git a/third_party/windows/fltk-1.1.10/fluid/fluid.app/Contents/PkgInfo b/third_party/windows/fltk-1.1.10/fluid/fluid.app/Contents/PkgInfo new file mode 100644 index 0000000..ee8b9a9 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/fluid.app/Contents/PkgInfo @@ -0,0 +1 @@ +FLIDFlid diff --git a/third_party/windows/fltk-1.1.10/fluid/fluid.app/Contents/Resources/fluid.icns b/third_party/windows/fltk-1.1.10/fluid/fluid.app/Contents/Resources/fluid.icns new file mode 100644 index 0000000..bb9a233 Binary files /dev/null and b/third_party/windows/fltk-1.1.10/fluid/fluid.app/Contents/Resources/fluid.icns differ diff --git a/third_party/windows/fltk-1.1.10/fluid/fluid.cxx b/third_party/windows/fltk-1.1.10/fluid/fluid.cxx new file mode 100644 index 0000000..11c3ca0 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/fluid.cxx @@ -0,0 +1,2253 @@ +// +// "$Id: fluid.cxx 6783 2009-04-27 15:50:29Z AlbrechtS $" +// +// FLUID main entry for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2007 by Bill Spitzak and others. +// +// 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // time(), localtime(), etc. + +#include "../src/flstring.h" +#include "alignment_panel.h" +#include "function_panel.h" +#include "template_panel.h" +#if !defined(WIN32) || defined(__CYGWIN__) +# include "print_panel.cxx" +#endif // !WIN32 || __CYGWIN__ + +#if defined(WIN32) && !defined(__CYGWIN__) +# include +# include +# include +# include +# include +# ifndef __WATCOMC__ +// Visual C++ 2005 incorrectly displays a warning about the use of POSIX APIs +// on Windows, which is supposed to be POSIX compliant... +# define access _access +# define chdir _chdir +# define getcwd _getcwd +# endif // !__WATCOMC__ +#else +# include +#endif +#ifdef __EMX__ +# include +#endif + +#include "about_panel.h" +#include "undo.h" + +#include "Fl_Type.h" + +extern "C" +{ +#if defined(HAVE_LIBPNG) && defined(HAVE_LIBZ) +# include +# ifdef HAVE_PNG_H +# include +# else +# include +# endif // HAVE_PNG_H +#endif // HAVE_LIBPNG && HAVE_LIBZ +} + +static Fl_Help_Dialog *help_dialog = 0; + +Fl_Preferences fluid_prefs(Fl_Preferences::USER, "fltk.org", "fluid"); +int gridx = 5; +int gridy = 5; +int snap = 1; +int show_guides = 1; + +// File history info... +char absolute_history[10][1024]; +char relative_history[10][1024]; + +void load_history(); +void update_history(const char *); + +// Shell command support... +void show_shell_window(); + +//////////////////////////////////////////////////////////////// + +static const char *filename; +void set_filename(const char *c); +void set_modflag(int mf); +int modflag; + +static char* pwd; +static char in_source_dir; +void goto_source_dir() { + if (in_source_dir) return; + if (!filename || !*filename) return; + const char *p = fl_filename_name(filename); + if (p <= filename) return; // it is in the current directory + char buffer[1024]; + strlcpy(buffer, filename, sizeof(buffer)); + int n = p-filename; if (n>1) n--; buffer[n] = 0; + if (!pwd) { + pwd = getcwd(0,1024); + if (!pwd) {fprintf(stderr,"getwd : %s\n",strerror(errno)); return;} + } + if (chdir(buffer)<0) {fprintf(stderr, "Can't chdir to %s : %s\n", + buffer, strerror(errno)); return;} + in_source_dir = 1; +} + +void leave_source_dir() { + if (!in_source_dir) return; + if (chdir(pwd)<0) {fprintf(stderr, "Can't chdir to %s : %s\n", + pwd, strerror(errno));} + in_source_dir = 0; +} + +char position_window(Fl_Window *w, const char *prefsName, int Visible, int X, int Y, int W=0, int H=0 ) { + Fl_Preferences pos(fluid_prefs, prefsName); + if (prevpos_button->value()) { + pos.get("x", X, X); + pos.get("y", Y, Y); + if ( W!=0 ) { + pos.get("w", W, W); + pos.get("h", H, H); + w->resize( X, Y, W, H ); + } + else + w->position( X, Y ); + } + pos.get("visible", Visible, Visible); + return Visible; +} + +void save_position(Fl_Window *w, const char *prefsName) { + Fl_Preferences pos(fluid_prefs, prefsName); + pos.set("x", w->x()); + pos.set("y", w->y()); + pos.set("w", w->w()); + pos.set("h", w->h()); + pos.set("visible", (int)(w->shown() && w->visible())); +} + +Fl_Window *main_window; +Fl_Menu_Bar *main_menubar; + +static char* cutfname(int which = 0) { + static char name[2][1024]; + static char beenhere = 0; + + if (!beenhere) { + beenhere = 1; + fluid_prefs.getUserdataPath(name[0], sizeof(name[0])); + strlcat(name[0], "cut_buffer", sizeof(name[0])); + fluid_prefs.getUserdataPath(name[1], sizeof(name[1])); + strlcat(name[1], "dup_buffer", sizeof(name[1])); + } + + return name[which]; +} + +void save_cb(Fl_Widget *, void *v) { + const char *c = filename; + if (v || !c || !*c) { + fl_file_chooser_ok_label("Save"); + c=fl_file_chooser("Save To:", "FLUID Files (*.f[ld])", c); + fl_file_chooser_ok_label(NULL); + if (!c) return; + + if (!access(c, 0)) { + const char *basename; + if ((basename = strrchr(c, '/')) != NULL) + basename ++; +#if defined(WIN32) || defined(__EMX__) + if ((basename = strrchr(c, '\\')) != NULL) + basename ++; +#endif // WIN32 || __EMX__ + else + basename = c; + + if (fl_choice("The file \"%s\" already exists.\n" + "Do you want to replace it?", "Cancel", + "Replace", NULL, basename) == 0) return; + } + + if (v != (void *)2) set_filename(c); + } + if (!write_file(c)) { + fl_alert("Error writing %s: %s", c, strerror(errno)); + return; + } + + if (v != (void *)2) { + set_modflag(0); + undo_save = undo_current; + } +} + +void save_template_cb(Fl_Widget *, void *) { + // Setup the template panel... + if (!template_panel) make_template_panel(); + + template_clear(); + template_browser->add("New Template"); + template_load(); + + template_name->show(); + template_name->value(""); + + template_instance->hide(); + + template_delete->show(); + template_delete->deactivate(); + + template_submit->label("Save"); + template_submit->deactivate(); + + template_panel->label("Save Template"); + + // Show the panel and wait for the user to do something... + template_panel->show(); + while (template_panel->shown()) Fl::wait(); + + // Get the template name, return if it is empty... + const char *c = template_name->value(); + if (!c || !*c) return; + + // Convert template name to filename_with_underscores + char safename[1024], *safeptr; + strlcpy(safename, c, sizeof(safename)); + for (safeptr = safename; *safeptr; safeptr ++) { + if (isspace(*safeptr)) *safeptr = '_'; + } + + // Find the templates directory... + char filename[1024]; + fluid_prefs.getUserdataPath(filename, sizeof(filename)); + + strlcat(filename, "templates", sizeof(filename)); +#if defined(WIN32) && !defined(__CYGWIN__) + if (access(filename, 0)) mkdir(filename); +#else + if (access(filename, 0)) mkdir(filename, 0777); +#endif // WIN32 && !__CYGWIN__ + + strlcat(filename, "/", sizeof(filename)); + strlcat(filename, safename, sizeof(filename)); + + char *ext = filename + strlen(filename); + if (ext >= (filename + sizeof(filename) - 5)) { + fl_alert("The template name \"%s\" is too long!", c); + return; + } + + // Save the .fl file... + strcpy(ext, ".fl"); + + if (!access(filename, 0)) { + if (fl_choice("The template \"%s\" already exists.\n" + "Do you want to replace it?", "Cancel", + "Replace", NULL, c) == 0) return; + } + + if (!write_file(filename)) { + fl_alert("Error writing %s: %s", filename, strerror(errno)); + return; + } + +#if defined(HAVE_LIBPNG) && defined(HAVE_LIBZ) + // Get the screenshot, if any... + Fl_Type *t; + + for (t = Fl_Type::first; t; t = t->next) { + // Find the first window... + if (t->is_window()) break; + } + + if (!t) return; + + // Grab a screenshot... + Fl_Window_Type *wt = (Fl_Window_Type *)t; + uchar *pixels; + int w, h; + + if ((pixels = wt->read_image(w, h)) == NULL) return; + + // Save to a PNG file... + strcpy(ext, ".png"); + + FILE *fp; + + if ((fp = fopen(filename, "wb")) == NULL) { + delete[] pixels; + fl_alert("Error writing %s: %s", filename, strerror(errno)); + return; + } + + png_structp pptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0); + png_infop iptr = png_create_info_struct(pptr); + png_bytep ptr = (png_bytep)pixels; + + png_init_io(pptr, fp); + png_set_IHDR(pptr, iptr, w, h, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, + PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); + png_set_sRGB(pptr, iptr, PNG_sRGB_INTENT_PERCEPTUAL); + + png_write_info(pptr, iptr); + + for (int i = h; i > 0; i --, ptr += w * 3) { + png_write_row(pptr, ptr); + } + + png_write_end(pptr, iptr); + png_destroy_write_struct(&pptr, &iptr); + + fclose(fp); + +# if 0 // The original PPM output code... + strcpy(ext, ".ppm"); + fp = fopen(filename, "wb"); + fprintf(fp, "P6\n%d %d 255\n", w, h); + fwrite(pixels, w * h, 3, fp); + fclose(fp); +# endif // 0 + + delete[] pixels; +#endif // HAVE_LIBPNG && HAVE_LIBZ +} + +void revert_cb(Fl_Widget *,void *) { + if (modflag) { + if (!fl_choice("This user interface has been changed. Really revert?", + "Cancel", "Revert", NULL)) return; + } + undo_suspend(); + if (!read_file(filename, 0)) { + undo_resume(); + fl_message("Can't read %s: %s", filename, strerror(errno)); + return; + } + undo_resume(); + set_modflag(0); + undo_clear(); +} + +void exit_cb(Fl_Widget *,void *) { + if (modflag) + switch (fl_choice("Do you want to save changes to this user\n" + "interface before exiting?", "Cancel", + "Save", "Don't Save")) + { + case 0 : /* Cancel */ + return; + case 1 : /* Save */ + save_cb(NULL, NULL); + if (modflag) return; // Didn't save! + } + + save_position(main_window,"main_window_pos"); + + if (widgetbin_panel) { + save_position(widgetbin_panel,"widgetbin_pos"); + delete widgetbin_panel; + } + if (sourceview_panel) { + Fl_Preferences svp(fluid_prefs, "sourceview"); + svp.set("autorefresh", sv_autorefresh->value()); + svp.set("autoposition", sv_autoposition->value()); + svp.set("tab", sv_tab->find(sv_tab->value())); + save_position(sourceview_panel,"sourceview_pos"); + delete sourceview_panel; + } + if (about_panel) + delete about_panel; + if (help_dialog) + delete help_dialog; + + undo_clear(); + + exit(0); +} + +#ifdef __APPLE__ +# include + +void +apple_open_cb(const char *c) { + if (modflag) { + switch (fl_choice("Do you want to save changes to this user\n" + "interface before opening another one?", "Don't Save", + "Save", "Cancel")) + { + case 0 : /* Cancel */ + return; + case 1 : /* Save */ + save_cb(NULL, NULL); + if (modflag) return; // Didn't save! + } + } + const char *oldfilename; + oldfilename = filename; + filename = NULL; + set_filename(c); + undo_suspend(); + if (!read_file(c, 0)) { + undo_resume(); + fl_message("Can't read %s: %s", c, strerror(errno)); + free((void *)filename); + filename = oldfilename; + if (main_window) main_window->label(filename); + return; + } + + // Loaded a file; free the old filename... + set_modflag(0); + undo_resume(); + undo_clear(); + if (oldfilename) free((void *)oldfilename); +} +#endif // __APPLE__ + +void open_cb(Fl_Widget *, void *v) { + if (!v && modflag) { + switch (fl_choice("Do you want to save changes to this user\n" + "interface before opening another one?", "Cancel", + "Save", "Don't Save")) + { + case 0 : /* Cancel */ + return; + case 1 : /* Save */ + save_cb(NULL, NULL); + if (modflag) return; // Didn't save! + } + } + const char *c; + const char *oldfilename; + fl_file_chooser_ok_label("Open"); + c = fl_file_chooser("Open:", "FLUID Files (*.f[ld])", filename); + fl_file_chooser_ok_label(NULL); + if (!c) return; + oldfilename = filename; + filename = NULL; + set_filename(c); + if (v != 0) undo_checkpoint(); + undo_suspend(); + if (!read_file(c, v!=0)) { + undo_resume(); + fl_message("Can't read %s: %s", c, strerror(errno)); + free((void *)filename); + filename = oldfilename; + if (main_window) set_modflag(modflag); + return; + } + undo_resume(); + if (v) { + // Inserting a file; restore the original filename... + free((void *)filename); + filename = oldfilename; + set_modflag(1); + } else { + // Loaded a file; free the old filename... + set_modflag(0); + undo_clear(); + if (oldfilename) free((void *)oldfilename); + } +} + +void open_history_cb(Fl_Widget *, void *v) { + if (modflag) { + switch (fl_choice("Do you want to save changes to this user\n" + "interface before opening another one?", "Cancel", + "Save", "Don't Save")) + { + case 0 : /* Cancel */ + return; + case 1 : /* Save */ + save_cb(NULL, NULL); + if (modflag) return; // Didn't save! + } + } + const char *oldfilename = filename; + filename = NULL; + set_filename((char *)v); + undo_suspend(); + if (!read_file(filename, 0)) { + undo_resume(); + undo_clear(); + fl_message("Can't read %s: %s", filename, strerror(errno)); + free((void *)filename); + filename = oldfilename; + if (main_window) main_window->label(filename); + return; + } + set_modflag(0); + undo_resume(); + undo_clear(); + if (oldfilename) free((void *)oldfilename); +} + +void new_cb(Fl_Widget *, void *v) { + // Check if the current file has been modified... + if (!v && modflag) { + // Yes, ask the user what to do... + switch (fl_choice("Do you want to save changes to this user\n" + "interface before creating a new one?", "Cancel", + "Save", "Don't Save")) + { + case 0 : /* Cancel */ + return; + case 1 : /* Save */ + save_cb(NULL, NULL); + if (modflag) return; // Didn't save! + } + } + + // Setup the template panel... + if (!template_panel) make_template_panel(); + + template_clear(); + template_browser->add("Blank"); + template_load(); + + template_name->hide(); + template_name->value(""); + + template_instance->show(); + template_instance->deactivate(); + template_instance->value(""); + + template_delete->hide(); + + template_submit->label("New"); + template_submit->deactivate(); + + template_panel->label("New"); + + // Show the panel and wait for the user to do something... + template_panel->show(); + while (template_panel->shown()) Fl::wait(); + + // See if the user chose anything... + int item = template_browser->value(); + if (item < 1) return; + + // Clear the current data... + delete_all(); + set_filename(NULL); + + // Load the template, if any... + const char *tname = (const char *)template_browser->data(item); + + if (tname) { + // Grab the instance name... + const char *iname = template_instance->value(); + + if (iname && *iname) { + // Copy the template to a temp file, then read it in... + char line[1024], *ptr, *next; + FILE *infile, *outfile; + + if ((infile = fopen(tname, "r")) == NULL) { + fl_alert("Error reading template file \"%s\":\n%s", tname, + strerror(errno)); + set_modflag(0); + undo_clear(); + return; + } + + if ((outfile = fopen(cutfname(1), "w")) == NULL) { + fl_alert("Error writing buffer file \"%s\":\n%s", cutfname(1), + strerror(errno)); + fclose(infile); + set_modflag(0); + undo_clear(); + return; + } + + while (fgets(line, sizeof(line), infile)) { + // Replace @INSTANCE@ with the instance name... + for (ptr = line; (next = strstr(ptr, "@INSTANCE@")) != NULL; ptr = next + 10) { + fwrite(ptr, next - ptr, 1, outfile); + fputs(iname, outfile); + } + + fputs(ptr, outfile); + } + + fclose(infile); + fclose(outfile); + + undo_suspend(); + read_file(cutfname(1), 0); + unlink(cutfname(1)); + undo_resume(); + } else { + // No instance name, so read the template without replacements... + undo_suspend(); + read_file(tname, 0); + undo_resume(); + } + } + + set_modflag(0); + undo_clear(); +} + +int compile_only = 0; +int compile_strings = 0; +int header_file_set = 0; +int code_file_set = 0; +const char* header_file_name = ".h"; +const char* code_file_name = ".cxx"; +int i18n_type = 0; +const char* i18n_include = ""; +const char* i18n_function = ""; +const char* i18n_file = ""; +const char* i18n_set = ""; +char i18n_program[1024] = ""; + +void write_cb(Fl_Widget *, void *) { + if (!filename) { + save_cb(0,0); + if (!filename) return; + } + char cname[1024]; + char hname[1024]; + strlcpy(i18n_program, fl_filename_name(filename), sizeof(i18n_program)); + fl_filename_setext(i18n_program, sizeof(i18n_program), ""); + if (*code_file_name == '.' && strchr(code_file_name, '/') == NULL) { + strlcpy(cname, fl_filename_name(filename), sizeof(cname)); + fl_filename_setext(cname, sizeof(cname), code_file_name); + } else { + strlcpy(cname, code_file_name, sizeof(hname)); + } + if (*header_file_name == '.' && strchr(header_file_name, '/') == NULL) { + strlcpy(hname, fl_filename_name(filename), sizeof(hname)); + fl_filename_setext(hname, sizeof(hname), header_file_name); + } else { + strlcpy(hname, header_file_name, sizeof(hname)); + } + if (!compile_only) goto_source_dir(); + int x = write_code(cname,hname); + if (!compile_only) leave_source_dir(); + strlcat(cname, " and ", sizeof(cname)); + strlcat(cname, hname, sizeof(cname)); + if (compile_only) { + if (!x) {fprintf(stderr,"%s : %s\n",cname,strerror(errno)); exit(1);} + } else { + if (!x) { + fl_message("Can't write %s: %s", cname, strerror(errno)); + } else if (completion_button->value()) { + fl_message("Wrote %s", cname); + } + } +} + +void write_strings_cb(Fl_Widget *, void *) { + static const char *exts[] = { ".txt", ".po", ".msg" }; + if (!filename) { + save_cb(0,0); + if (!filename) return; + } + char sname[1024]; + strlcpy(sname, fl_filename_name(filename), sizeof(sname)); + fl_filename_setext(sname, sizeof(sname), exts[i18n_type]); + if (!compile_only) goto_source_dir(); + int x = write_strings(sname); + if (!compile_only) leave_source_dir(); + if (compile_only) { + if (x) {fprintf(stderr,"%s : %s\n",sname,strerror(errno)); exit(1);} + } else { + if (x) { + fl_message("Can't write %s: %s", sname, strerror(errno)); + } else if (completion_button->value()) { + fl_message("Wrote %s", sname); + } + } +} + +void openwidget_cb(Fl_Widget *, void *) { + if (!Fl_Type::current) { + fl_message("Please select a widget"); + return; + } + Fl_Type::current->open(); +} + +void toggle_overlays(Fl_Widget *,void *); + +void select_all_cb(Fl_Widget *,void *); +void select_none_cb(Fl_Widget *,void *); + +void group_cb(Fl_Widget *, void *); + +void ungroup_cb(Fl_Widget *, void *); + +extern int pasteoffset; +static int ipasteoffset; + +void copy_cb(Fl_Widget*, void*) { + if (!Fl_Type::current) { + fl_beep(); + return; + } + ipasteoffset = 10; + if (!write_file(cutfname(),1)) { + fl_message("Can't write %s: %s", cutfname(), strerror(errno)); + return; + } +} + +extern void select_only(Fl_Type *); +void cut_cb(Fl_Widget *, void *) { + if (!Fl_Type::current) { + fl_beep(); + return; + } + if (!write_file(cutfname(),1)) { + fl_message("Can't write %s: %s", cutfname(), strerror(errno)); + return; + } + undo_checkpoint(); + set_modflag(1); + ipasteoffset = 0; + Fl_Type *p = Fl_Type::current->parent; + while (p && p->selected) p = p->parent; + delete_all(1); + if (p) select_only(p); +} + +void delete_cb(Fl_Widget *, void *) { + if (!Fl_Type::current) { + fl_beep(); + return; + } + undo_checkpoint(); + set_modflag(1); + ipasteoffset = 0; + Fl_Type *p = Fl_Type::current->parent; + while (p && p->selected) p = p->parent; + delete_all(1); + if (p) select_only(p); +} + +extern int force_parent; + +void paste_cb(Fl_Widget*, void*) { + //if (ipasteoffset) force_parent = 1; + pasteoffset = ipasteoffset; + if (gridx>1) pasteoffset = ((pasteoffset-1)/gridx+1)*gridx; + if (gridy>1) pasteoffset = ((pasteoffset-1)/gridy+1)*gridy; + undo_checkpoint(); + undo_suspend(); + if (!read_file(cutfname(), 1)) { + fl_message("Can't read %s: %s", cutfname(), strerror(errno)); + } + undo_resume(); + pasteoffset = 0; + ipasteoffset += 10; + force_parent = 0; +} + +// Duplicate the selected widgets... +void duplicate_cb(Fl_Widget*, void*) { + if (!Fl_Type::current) { + fl_beep(); + return; + } + + if (!write_file(cutfname(1),1)) { + fl_message("Can't write %s: %s", cutfname(1), strerror(errno)); + return; + } + + pasteoffset = 0; + force_parent = 1; + + undo_checkpoint(); + undo_suspend(); + if (!read_file(cutfname(1), 1)) { + fl_message("Can't read %s: %s", cutfname(1), strerror(errno)); + } + unlink(cutfname(1)); + undo_resume(); + + force_parent = 0; +} + +void earlier_cb(Fl_Widget*,void*); + +void later_cb(Fl_Widget*,void*); + +Fl_Type *sort(Fl_Type *parent); + +static void sort_cb(Fl_Widget *,void *) { + sort((Fl_Type*)0); +} + +void show_project_cb(Fl_Widget *, void *); +void show_grid_cb(Fl_Widget *, void *); +void show_settings_cb(Fl_Widget *, void *); + +void align_widget_cb(Fl_Widget *, long); +void widget_size_cb(Fl_Widget *, long); + +void about_cb(Fl_Widget *, void *) { + if (!about_panel) make_about_panel(); + about_panel->show(); +} + +void show_help(const char *name) { + const char *docdir; + char helpname[1024]; + + if (!help_dialog) help_dialog = new Fl_Help_Dialog(); + + if ((docdir = getenv("FLTK_DOCDIR")) == NULL) { +#ifdef __EMX__ + // Doesn't make sense to have a hardcoded fallback + static char fltk_docdir[1024]; + + strlcpy(fltk_docdir, __XOS2RedirRoot("/XFree86/lib/X11/fltk/doc"), + sizeof(fltk_docdir)); + + docdir = fltk_docdir; +#else + docdir = FLTK_DOCDIR; +#endif // __EMX__ + } + snprintf(helpname, sizeof(helpname), "%s/%s", docdir, name); + + help_dialog->load(helpname); + help_dialog->show(); +} + +void help_cb(Fl_Widget *, void *) { + show_help("fluid.html"); +} + +void manual_cb(Fl_Widget *, void *) { + show_help("index.html"); +} + + +//////////////////////////////////////////////////////////////// + +#if defined(WIN32) && !defined(__CYGWIN__) +// Draw a shaded box... +static void win_box(int x, int y, int w, int h) { + fl_color(0xc0, 0xc0, 0xc0); + fl_rectf(x, y, w, h); + fl_color(0, 0, 0); + fl_rect(x, y, w, h); + fl_color(0xf0, 0xf0, 0xf0); + fl_rectf(x + 1, y + 1, 4, h - 2); + fl_rectf(x + 1, y + 1, w - 2, 4); + fl_color(0x90, 0x90, 0x90); + fl_rectf(x + w - 5, y + 1, 4, h - 2); + fl_rectf(x + 1, y + h - 5, w - 2, 4); +} + +// Load and show the print dialog... +void print_menu_cb(Fl_Widget *, void *) { + PRINTDLG dialog; // Print dialog + DOCINFO docinfo; // Document info + int first, last; // First and last page + int page; // Current page + int winpage; // Current window page + int num_pages; // Number of pages + Fl_Type *t; // Current widget + int num_windows; // Number of windows + Fl_Window_Type *windows[1000]; // Windows to print + + + // Show print dialog... + for (t = Fl_Type::first, num_pages = 0; t; t = t->next) { + if (t->is_window()) num_pages ++; + } + + memset(&dialog, 0, sizeof(dialog)); + dialog.lStructSize = sizeof(dialog); + dialog.hwndOwner = fl_xid(main_window); + dialog.Flags = PD_ALLPAGES | + PD_RETURNDC; + dialog.nFromPage = 1; + dialog.nToPage = num_pages; + dialog.nMinPage = 1; + dialog.nMaxPage = num_pages; + dialog.nCopies = 1; + + if (!PrintDlg(&dialog)) return; + + // Get the base filename... + const char *basename = strrchr(filename, '/'); + if (basename) basename ++; + else basename = filename; + + // Do the print job... + memset(&docinfo, 0, sizeof(docinfo)); + docinfo.cbSize = sizeof(docinfo); + docinfo.lpszDocName = basename; + + StartDoc(dialog.hDC, &docinfo); + + // Figure out how many pages we'll have to print... + if (dialog.Flags & PD_PAGENUMS) { + // Get from and to page numbers... + first = dialog.nFromPage; + last = dialog.nToPage; + + if (first > last) { + // Swap first/last page + page = first; + first = last; + last = page; + } + } else { + // Print everything... + first = 1; + last = dialog.nMaxPage; + } + + for (t = Fl_Type::first, num_windows = 0, winpage = 0; t; t = t->next) { + if (t->is_window()) { + winpage ++; + windows[num_windows] = (Fl_Window_Type *)t; + num_windows ++; +#if 0 + if (dialog.Flags & PD_ALLPAGES) num_windows ++; + else if ((dialog.Flags & PD_PAGENUMS) && winpage >= first && + winpage <= last) num_windows ++; + else if ((dialog.Flags & PD_SELECTION) && t->selected) num_windows ++; +#endif // 0 + } + } + + num_pages = num_windows; + + // Figure out the page size and margins... + int width, length; // Size of page + int xdpi, ydpi; // Output resolution + char buffer[1024]; + + width = GetDeviceCaps(dialog.hDC, HORZRES); + length = GetDeviceCaps(dialog.hDC, VERTRES); + xdpi = GetDeviceCaps(dialog.hDC, LOGPIXELSX); + ydpi = GetDeviceCaps(dialog.hDC, LOGPIXELSY); + +// fl_message("width=%d, length=%d, xdpi=%d, ydpi=%d, num_windows=%d\n", +// width, length, xdpi, ydpi, num_windows); + + HDC save_dc = fl_gc; + HWND save_win = fl_window; + int fontsize = 14 * ydpi / 72; + + fl_gc = dialog.hDC; + fl_window = (HWND)dialog.hDC; + fl_push_no_clip(); + + // Get the time and date... + time_t curtime = time(NULL); + struct tm *curdate = localtime(&curtime); + char date[1024]; + + strftime(date, sizeof(date), "%c", curdate); + + // Print each of the windows... + for (winpage = 0; winpage < num_windows; winpage ++) { + // Draw header... + StartPage(dialog.hDC); + + fl_font(FL_HELVETICA_BOLD, fontsize); + fl_color(0, 0, 0); + + fl_draw(basename, 0, fontsize); + + fl_draw(date, (width - (int)fl_width(date)) / 2, fontsize); + + sprintf(buffer, "%d/%d", winpage + 1, num_windows); + fl_draw(buffer, width - (int)fl_width(buffer), fontsize); + + // Get window image... + uchar *pixels; // Window image data + int w, h; // Window image dimensions + int ww, hh; // Scaled size + int ulx, uly; // Upper-lefthand corner + Fl_Window *win; // Window widget + BITMAPINFO info; // Bitmap information + + win = (Fl_Window *)(windows[winpage]->o); + pixels = windows[winpage]->read_image(w, h); + + // Swap colors: FLTK uses R-G-B --> Windows GDI uses B-G-R + + { uchar *p = pixels; + for (int i=0; i width) { + ww = width; + hh = h * ww * ydpi / xdpi / w; + } + + if (hh > (length - ydpi / 2)) { + hh = length - ydpi / 2; + ww = w * hh / h; + } + + // Position the window in the center... + ulx = (width - ww) / 2; + uly = (length - hh) / 2; + +// fl_message("winpage=%d, ulx=%d, uly=%d, ww=%d, hh=%d", +// winpage, ulx, uly, ww, hh); + + // Draw a simulated window border... + int xborder = 4 * ww / w; + int yborder = 4 * hh / h; + + win_box(ulx - xborder, uly - 5 * yborder, + ww + 2 * xborder, hh + 6 * yborder); + + fl_color(0, 0, 255); + fl_rectf(ulx, uly - 4 * yborder, ww, 4 * yborder); + + fl_font(FL_HELVETICA_BOLD, 2 * yborder); + fl_color(255, 255, 255); + fl_draw(win->label() ? win->label() : "Window", + ulx + xborder, uly - 3 * yborder); + + int x = ulx + ww - 4 * xborder; + + win_box(x, uly - 4 * yborder, 4 * xborder, 4 * yborder); + fl_color(0, 0, 0); + fl_line(x + xborder, uly - yborder, + x + 3 * xborder, uly - 3 * yborder); + fl_line(x + xborder, uly - 3 * yborder, + x + 3 * xborder, uly - yborder); + x -= 4 * xborder; + + if (win->resizable()) { + win_box(x, uly - 4 * yborder, 4 * xborder, 4 * yborder); + fl_color(0, 0, 0); + fl_rect(x + xborder, uly - 3 * yborder, 2 * xborder, 2 * yborder); + x -= 4 * xborder; + } + + if (!win->modal()) { + win_box(x, uly - 4 * yborder, 4 * xborder, 4 * yborder); + fl_color(0, 0, 0); + fl_line(x + xborder, uly - yborder, x + 3 * xborder, uly - yborder); + x -= 4 * xborder; + } + + // Color image... + memset(&info, 0, sizeof(info)); + info.bmiHeader.biSize = sizeof(info); + info.bmiHeader.biWidth = w; + info.bmiHeader.biHeight = 1; + info.bmiHeader.biPlanes = 1; + info.bmiHeader.biBitCount = 24; + info.bmiHeader.biCompression = BI_RGB; + + for (int y = 0; y < h; y ++) { + StretchDIBits(dialog.hDC, ulx, uly + y * hh / h, ww, (hh + h - 1) / h, 0, 0, w, 1, + pixels + y * w * 3, &info, DIB_RGB_COLORS, SRCCOPY); + } + + delete[] pixels; + + // Show the page... + EndPage(dialog.hDC); + } + + // Finish up... + EndDoc(dialog.hDC); + + fl_gc = save_dc; + fl_window = save_win; + fl_pop_clip(); + + // Free the print DC and return... + DeleteDC(dialog.hDC); +} +#else +// Load and show the print dialog... +void print_menu_cb(Fl_Widget *, void *) { + if (!print_panel) make_print_panel(); + + print_load(); + + print_selection->deactivate(); + + for (Fl_Type *t = Fl_Type::first; t; t = t->next) { + if (t->selected && t->is_window()) { + print_selection->activate(); + break; + } + } + + print_all->setonly(); + print_all->do_callback(); + + print_panel->show(); +} + +// Quote a string for PostScript printing +static const char *ps_string(const char *s) { + char *bufptr; + static char buffer[2048]; + + + if (!s) { + buffer[0] = '\0'; + } else { + for (bufptr = buffer; bufptr < (buffer + sizeof(buffer) - 3) && *s;) { + if (*s == '(' || *s == ')' || *s == '\\') *bufptr++ = '\\'; + *bufptr++ = *s++; + } + + *bufptr = '\0'; + } + + return (buffer); +} + +// Actually print... +void print_cb(Fl_Return_Button *, void *) { + FILE *outfile; // Output file or pipe to print command + char command[1024]; // Print command + int copies; // Collated copies + int first, last; // First and last page + int page; // Current page + int winpage; // Current window page + int num_pages; // Number of pages + Fl_Type *t; // Current widget + int num_windows; // Number of windows + Fl_Window_Type *windows[1000]; // Windows to print + + // Show progress, deactivate controls... + print_panel_controls->deactivate(); + print_progress->show(); + + // Figure out how many pages we'll have to print... + if (print_collate_button->value()) copies = (int)print_copies->value(); + else copies = 1; + + if (print_pages->value()) { + // Get from and to page numbers... + if ((first = atoi(print_from->value())) < 1) first = 1; + if ((last = atoi(print_to->value())) < 1) last = 1000; + + if (first > last) { + // Swap first/last page + page = first; + first = last; + last = page; + } + } else { + // Print everything... + first = 1; + last = 1000; + } + + for (t = Fl_Type::first, num_windows = 0, winpage = 0; t; t = t->next) { + if (t->is_window()) { + winpage ++; + windows[num_windows] = (Fl_Window_Type *)t; + + if (print_all->value()) num_windows ++; + else if (print_pages->value() && winpage >= first && + winpage <= last) num_windows ++; + else if (print_selection->value() && t->selected) num_windows ++; + } + } + + num_pages = num_windows * copies; + + print_progress->minimum(0); + print_progress->maximum(num_pages); + print_progress->value(0); + Fl::check(); + + // Get the base filename... + const char *basename = strrchr(filename, '/'); + if (basename) basename ++; + else basename = filename; + + // Open the print stream... + if (print_choice->value()) { + // Pipe the output into the lp command... + const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data(); + + snprintf(command, sizeof(command), "lp -s -d %s -n %.0f -t '%s' -o media=%s", + printer, print_collate_button->value() ? 1.0 : print_copies->value(), + basename, print_page_size->text(print_page_size->value())); + outfile = popen(command, "w"); + } else { + // Print to file... + fl_file_chooser_ok_label("Print"); + const char *outname = fl_file_chooser("Print To", "PostScript (*.ps)", NULL, 1); + fl_file_chooser_ok_label(NULL); + + if (outname && !access(outname, 0)) { + if (fl_choice("The file \"%s\" already exists.\n" + "Do you want to replace it?", "Cancel", + "Replace", NULL, outname) == 0) outname = NULL; + } + + if (outname) outfile = fopen(outname, "w"); + else outfile = NULL; + } + + if (outfile) { + // Figure out the page size and margins... + int width, length; // Size of page + int left, bottom, // Bottom lefthand corner + right, top; // Top righthand corner + + if (print_page_size->value()) { + // A4 + width = 595; + length = 842; + } else { + // Letter + width = 612; + length = 792; + } + + int output_mode; + for (output_mode = 0; output_mode < 4; output_mode ++) { + if (print_output_mode[output_mode]->value()) break; + } + + if (output_mode & 1) { + // Landscape + left = 36; + bottom = 18; + right = length - 36; + top = width - 18; + } else { + // Portrait + left = 18; + bottom = 36; + right = width - 18; + top = length - 36; + } + + // Get the time and date... + time_t curtime = time(NULL); + struct tm *curdate = localtime(&curtime); + char date[1024]; + + strftime(date, sizeof(date), "%c", curdate); + + // Write the prolog... + fprintf(outfile, + "%%!PS-Adobe-3.0\n" + "%%%%BoundingBox: 18 36 %d %d\n" + "%%%%Pages: %d\n" + "%%%%LanguageLevel: 1\n" + "%%%%DocumentData: Clean7Bit\n" + "%%%%DocumentNeededResources: font Helvetica-Bold\n" + "%%%%Creator: FLUID %.4f\n" + "%%%%CreationDate: %s\n" + "%%%%Title: (%s)\n" + "%%%%EndComments\n" + "%%%%BeginProlog\n" + "%%languagelevel 1 eq {\n" + " /rectfill {\n" + " newpath 4 2 roll moveto dup 0 exch rlineto exch 0 rlineto\n" + " neg 0 exch rlineto closepath fill\n" + " } bind def\n" + " /rectstroke {\n" + " newpath 4 2 roll moveto dup 0 exch rlineto exch 0 rlineto\n" + " neg 0 exch rlineto closepath stroke\n" + " } bind def\n" + "%%} if\n" + "%%%%EndProlog\n" + "%%%%BeginSetup\n" + "%%%%BeginFeature: *PageSize %s\n" + "languagelevel 1 ne {\n" + " <>setpagedevice\n" + "} {\n" + " %s\n" + "} ifelse\n" + "%%%%EndFeature\n" + "%%%%EndSetup\n", + width - 18, length - 36, + num_pages, + FL_VERSION, + date, + basename, + print_page_size->text(print_page_size->value()), + width, length, + print_page_size->value() ? "a4tray" : "lettertray"); + + // Print each of the windows... + char progress[255]; // Progress text + int copy; // Current copy + + for (copy = 0, page = 0; copy < copies; copy ++) { + for (winpage = 0; winpage < num_pages; winpage ++) { + // Start next page... + page ++; + sprintf(progress, "Printing page %d/%d...", page, num_pages); + print_progress->value(page); + print_progress->label(progress); + Fl::check(); + + // Add common page stuff... + fprintf(outfile, + "%%%%Page: %d %d\n" + "gsave\n", + page, page); + + if (output_mode & 1) { + // Landscape... + fprintf(outfile, "%d 0 translate 90 rotate\n", width); + } + + // Draw header... + fprintf(outfile, + "0 setgray\n" + "/Helvetica-Bold findfont 14 scalefont setfont\n" + "%d %d moveto (%s) show\n" + "%.1f %d moveto (%s) dup stringwidth pop -0.5 mul 0 rmoveto show\n" + "%d %d moveto (%d/%d) dup stringwidth pop neg 0 rmoveto show\n", + left, top - 15, ps_string(basename), + 0.5 * (left + right), top - 15, date, + right, top - 15, winpage + 1, num_windows); + + // Get window image... + uchar *pixels; // Window image data + int w, h; // Window image dimensions + float ww, hh; // Scaled size + float border; // Width of 1 pixel + float llx, lly, // Lower-lefthand corner + urx, ury; // Upper-righthand corner + Fl_Window *win; // Window widget + + win = (Fl_Window *)(windows[winpage]->o); + pixels = windows[winpage]->read_image(w, h); + + // Figure out the window size, first at 100 PPI and then scaled + // down if that is too big... + ww = w * 72.0 / 100.0; + hh = h * 72.0 / 100.0; + + if (ww > (right - left)) { + ww = right - left; + hh = h * ww / w; + } + + if (hh > (top - bottom - 36)) { + hh = top - bottom; + ww = w * hh / h; + } + + border = ww / w; + + // Position the window in the center... + llx = 0.5 * (right - left - ww); + lly = 0.5 * (top - bottom - hh); + urx = 0.5 * (right - left + ww); + ury = 0.5 * (top - bottom + hh); + + // Draw a simulated window border... + fprintf(outfile, + "0.75 setgray\n" // Gray background + "newpath %.2f %.2f %.2f 180 90 arcn\n" // Top left + "%.2f %.2f %.2f 90 0 arcn\n" // Top right + "%.2f %.2f %.2f 0 -90 arcn\n" // Bottom right + "%.2f %.2f %.2f -90 -180 arcn\n" // Bottom left + "closepath gsave fill grestore\n" // Fill + "0 setlinewidth 0 setgray stroke\n", // Outline + llx, ury + 12 * border, 4 * border, + urx, ury + 12 * border, 4 * border, + urx, lly, 4 * border, + llx, lly, 4 * border); + + // Title bar... + if (output_mode & 2) { + fputs("0.25 setgray\n", outfile); + } else { + fputs("0.1 0.2 0.6 setrgbcolor\n", outfile); + } + + fprintf(outfile, "%.2f %.2f %.2f %.2f rectfill\n", + llx + 12 * border, ury, + ww - (24 + 16 * (!win->modal() || win->resizable()) + + 16 * (!win->modal() && win->resizable())) * border, + 16 * border); + + if (win->resizable()) { + fprintf(outfile, + "%.2f %.2f %.2f -90 -180 arcn\n" // Bottom left + "0 %.2f rlineto %.2f 0 rlineto 0 -%.2f rlineto closepath fill\n" + "%.2f %.2f %.2f 0 -90 arcn\n" // Bottom right + "-%.2f 0 rlineto 0 %.2f rlineto %.2f 0 rlineto closepath fill\n", + llx, lly, 4 * border, + 12 * border, 16 * border, 16 * border, + urx, lly, 4 * border, + 12 * border, 16 * border, 16 * border); + } + + // Inside outline and button shading... + fprintf(outfile, + "%.2f setlinewidth 0.5 setgray\n" + "%.2f %.2f %.2f %.2f rectstroke\n" + "%.2f %.2f moveto 0 %.2f rlineto\n" + "%.2f %.2f moveto 0 %.2f rlineto\n", + border, + llx - 0.5 * border, lly - 0.5 * border, ww + border, hh + border, + llx + 12 * border, ury, 16 * border, + urx - 12 * border, ury, 16 * border); + + if (!win->modal() || win->resizable()) { + fprintf(outfile, "%.2f %.2f moveto 0 %.2f rlineto\n", + urx - 28 * border, ury, 16 * border); + } + + if (!win->modal() && win->resizable()) { + fprintf(outfile, "%.2f %.2f moveto 0 %.2f rlineto\n", + urx - 44 * border, ury, 16 * border); + } + + fprintf(outfile, "%.2f %.2f moveto %.2f 0 rlineto stroke\n", + llx - 3.5 * border, ury + 0.5 * border, ww + 7 * border); + + // Button icons... + fprintf(outfile, + "%.2f setlinewidth 0 setgray\n" + "%.2f %.2f moveto %.2f -%.2f rlineto %.2f %.2f rlineto\n" + "%.2f %.2f moveto -%.2f -%.2f rlineto 0 %.2f rmoveto %.2f -%.2f rlineto\n", + 2 * border, + llx, ury + 10 * border, 4 * border, 4 * border, 4 * border, 4 * border, + urx, ury + 12 * border, 8 * border, 8 * border, 8 * border, 8 * border, 8 * border); + + float x = urx - 16 * border; + + if (win->resizable()) { + // Maximize button + fprintf(outfile, + "%.2f %.2f moveto -%.2f 0 rlineto 0 -%.2f rlineto " + "%.2f 0 rlineto 0 %.2f rlineto\n", + x, ury + 12 * border, 8 * border, 8 * border, + 8 * border, 8 * border); + + x -= 16 * border; + } + + if (!win->modal()) { + // Minimize button + fprintf(outfile, + "%.2f %.2f moveto -%.2f 0 rlineto\n", + x, ury + 4 * border, 8 * border); + } + + fputs("stroke\n", outfile); + + if (win->label()) { + // Add window title... + fprintf(outfile, + "1 setgray\n" + "/Helvetica-Bold findfont %.2f scalefont setfont\n" + "(%s) %.2f %.2f moveto show\n", + 12 * border, + ps_string(win->label()), llx + 16 * border, ury + 4 * border); + } + + fprintf(outfile, + "gsave\n" + "%.2f %.2f translate %.2f %.2f scale\n", + llx, ury - border, border, border); + + if (output_mode & 2) { + // Grayscale image... + fprintf(outfile, + "/imgdata %d string def\n" + "%d %d 8[1 0 0 -1 0 1] " + "{currentfile imgdata readhexstring pop} image\n", + w, + w, h); + + uchar *ptr = pixels; + int i, count = w * h; + + for (i = 0; i < count; i ++, ptr += 3) { + fprintf(outfile, "%02X", + (31 * ptr[0] + 61 * ptr[1] + 8 * ptr[2]) / 100); + if (!(i % 40)) putc('\n', outfile); + } + } else { + // Color image... + fprintf(outfile, + "/imgdata %d string def\n" + "%d %d 8[1 0 0 -1 0 1] " + "{currentfile imgdata readhexstring pop} false 3 colorimage\n", + w * 3, + w, h); + + uchar *ptr = pixels; + int i, count = w * h; + + for (i = 0; i < count; i ++, ptr += 3) { + fprintf(outfile, "%02X%02X%02X", ptr[0], ptr[1], ptr[2]); + if (!(i % 13)) putc('\n', outfile); + } + } + + fputs("\ngrestore\n", outfile); + + delete[] pixels; + + // Show the page... + fputs("grestore showpage\n", outfile); + } + } + + // Finish up... + fputs("%%EOF\n", outfile); + + if (print_choice->value()) pclose(outfile); + else fclose(outfile); + } else { + // Unable to print... + fl_alert("Error printing: %s", strerror(errno)); + } + + // Hide progress, activate controls, hide print panel... + print_panel_controls->activate(); + print_progress->hide(); + print_panel->hide(); +} +#endif // WIN32 && !__CYGWIN__ + +//////////////////////////////////////////////////////////////// + +extern Fl_Menu_Item New_Menu[]; + +void toggle_widgetbin_cb(Fl_Widget *, void *); +void toggle_sourceview_cb(Fl_Double_Window *, void *); + +Fl_Menu_Item Main_Menu[] = { +{"&File",0,0,0,FL_SUBMENU}, + {"&New...", FL_COMMAND+'n', new_cb, 0}, + {"&Open...", FL_COMMAND+'o', open_cb, 0}, + {"&Insert...", FL_COMMAND+'i', open_cb, (void*)1, FL_MENU_DIVIDER}, +#define SAVE_ITEM 4 + {"&Save", FL_COMMAND+'s', save_cb, 0}, + {"Save &As...", FL_COMMAND+FL_SHIFT+'s', save_cb, (void*)1}, + {"Sa&ve A Copy...", 0, save_cb, (void*)2}, + {"Save &Template...", 0, save_template_cb}, + {"&Revert...", 0, revert_cb, 0, FL_MENU_DIVIDER}, + {"&Print...", FL_COMMAND+'p', print_menu_cb}, + {"Write &Code...", FL_COMMAND+FL_SHIFT+'c', write_cb, 0}, + {"&Write Strings...", FL_COMMAND+FL_SHIFT+'w', write_strings_cb, 0, FL_MENU_DIVIDER}, +#define HISTORY_ITEM 12 + {relative_history[0], FL_COMMAND+'0', open_history_cb, absolute_history[0]}, + {relative_history[1], FL_COMMAND+'1', open_history_cb, absolute_history[1]}, + {relative_history[2], FL_COMMAND+'2', open_history_cb, absolute_history[2]}, + {relative_history[3], FL_COMMAND+'3', open_history_cb, absolute_history[3]}, + {relative_history[4], FL_COMMAND+'4', open_history_cb, absolute_history[4]}, + {relative_history[5], FL_COMMAND+'5', open_history_cb, absolute_history[5]}, + {relative_history[6], FL_COMMAND+'6', open_history_cb, absolute_history[6]}, + {relative_history[7], FL_COMMAND+'7', open_history_cb, absolute_history[7]}, + {relative_history[8], FL_COMMAND+'8', open_history_cb, absolute_history[8]}, + {relative_history[9], FL_COMMAND+'9', open_history_cb, absolute_history[9], FL_MENU_DIVIDER}, + {"&Quit", FL_COMMAND+'q', exit_cb}, + {0}, +{"&Edit",0,0,0,FL_SUBMENU}, + {"&Undo", FL_COMMAND+'z', undo_cb}, + {"&Redo", FL_COMMAND+FL_SHIFT+'z', redo_cb, 0, FL_MENU_DIVIDER}, + {"C&ut", FL_COMMAND+'x', cut_cb}, + {"&Copy", FL_COMMAND+'c', copy_cb}, + {"&Paste", FL_COMMAND+'v', paste_cb}, + {"Dup&licate", FL_COMMAND+'u', duplicate_cb}, + {"&Delete", FL_Delete, delete_cb, 0, FL_MENU_DIVIDER}, + {"Select &All", FL_COMMAND+'a', select_all_cb}, + {"Select &None", FL_COMMAND+FL_SHIFT+'a', select_none_cb, 0, FL_MENU_DIVIDER}, + {"Pr&operties...", FL_F+1, openwidget_cb}, + {"&Sort",0,sort_cb}, + {"&Earlier", FL_F+2, earlier_cb}, + {"&Later", FL_F+3, later_cb}, + {"&Group", FL_F+7, group_cb}, + {"Ung&roup", FL_F+8, ungroup_cb,0, FL_MENU_DIVIDER}, + {"Hide O&verlays",FL_COMMAND+FL_SHIFT+'o',toggle_overlays}, +#define WIDGETBIN_ITEM 41 + {"Show Widget &Bin...",FL_ALT+'b',toggle_widgetbin_cb}, +#define SOURCEVIEW_ITEM 42 + {"Show Source Code...",FL_ALT+FL_SHIFT+'s', (Fl_Callback*)toggle_sourceview_cb, 0, FL_MENU_DIVIDER}, + {"Pro&ject Settings...",FL_ALT+'p',show_project_cb}, + {"GU&I Settings...",FL_ALT+FL_SHIFT+'p',show_settings_cb}, + {0}, +{"&New", 0, 0, (void *)New_Menu, FL_SUBMENU_POINTER}, +{"&Layout",0,0,0,FL_SUBMENU}, + {"&Align",0,0,0,FL_SUBMENU}, + {"&Left",0,(Fl_Callback *)align_widget_cb,(void*)10}, + {"&Center",0,(Fl_Callback *)align_widget_cb,(void*)11}, + {"&Right",0,(Fl_Callback *)align_widget_cb,(void*)12}, + {"&Top",0,(Fl_Callback *)align_widget_cb,(void*)13}, + {"&Middle",0,(Fl_Callback *)align_widget_cb,(void*)14}, + {"&Bottom",0,(Fl_Callback *)align_widget_cb,(void*)15}, + {0}, + {"&Space Evenly",0,0,0,FL_SUBMENU}, + {"&Across",0,(Fl_Callback *)align_widget_cb,(void*)20}, + {"&Down",0,(Fl_Callback *)align_widget_cb,(void*)21}, + {0}, + {"&Make Same Size",0,0,0,FL_SUBMENU}, + {"&Width",0,(Fl_Callback *)align_widget_cb,(void*)30}, + {"&Height",0,(Fl_Callback *)align_widget_cb,(void*)31}, + {"&Both",0,(Fl_Callback *)align_widget_cb,(void*)32}, + {0}, + {"&Center In Group",0,0,0,FL_SUBMENU}, + {"&Horizontal",0,(Fl_Callback *)align_widget_cb,(void*)40}, + {"&Vertical",0,(Fl_Callback *)align_widget_cb,(void*)41}, + {0}, + {"Set &Widget Size",0,0,0,FL_SUBMENU|FL_MENU_DIVIDER}, + {"&Tiny",FL_ALT+'1',(Fl_Callback *)widget_size_cb,(void*)8,0,FL_NORMAL_LABEL,FL_HELVETICA,8}, + {"&Small",FL_ALT+'2',(Fl_Callback *)widget_size_cb,(void*)11,0,FL_NORMAL_LABEL,FL_HELVETICA,11}, + {"&Normal",FL_ALT+'3',(Fl_Callback *)widget_size_cb,(void*)14,0,FL_NORMAL_LABEL,FL_HELVETICA,14}, + {"&Medium",FL_ALT+'4',(Fl_Callback *)widget_size_cb,(void*)18,0,FL_NORMAL_LABEL,FL_HELVETICA,18}, + {"&Large",FL_ALT+'5',(Fl_Callback *)widget_size_cb,(void*)24,0,FL_NORMAL_LABEL,FL_HELVETICA,24}, + {"&Huge",FL_ALT+'6',(Fl_Callback *)widget_size_cb,(void*)32,0,FL_NORMAL_LABEL,FL_HELVETICA,32}, + {0}, + {"&Grid and Size Settings...",FL_COMMAND+'g',show_grid_cb}, + {0}, +{"&Shell",0,0,0,FL_SUBMENU}, + {"Execute &Command...",FL_ALT+'x',(Fl_Callback *)show_shell_window}, + {"Execute &Again...",FL_ALT+'g',(Fl_Callback *)do_shell_command}, + {0}, +{"&Help",0,0,0,FL_SUBMENU}, + {"&About FLUID...",0,about_cb}, + {"&On FLUID...",0,help_cb}, + {"&Manual...",0,manual_cb}, + {0}, +{0}}; + +#define BROWSERWIDTH 300 +#define BROWSERHEIGHT 500 +#define WINWIDTH 300 +#define MENUHEIGHT 25 +#define WINHEIGHT (BROWSERHEIGHT+MENUHEIGHT) + +extern void fill_in_New_Menu(); + +void scheme_cb(Fl_Choice *, void *) { + if (compile_only) + return; + + switch (scheme_choice->value()) { + case 0 : // Default + Fl::scheme(NULL); + break; + case 1 : // None + Fl::scheme("none"); + break; + case 2 : // Plastic + Fl::scheme("plastic"); + break; + case 3 : // GTK+ + Fl::scheme("gtk+"); + break; + } + + fluid_prefs.set("scheme", scheme_choice->value()); +} + +void toggle_widgetbin_cb(Fl_Widget *, void *) { + if (!widgetbin_panel) { + make_widgetbin(); + widgetbin_panel->callback(toggle_widgetbin_cb); + if (!position_window(widgetbin_panel,"widgetbin_pos", 1, 320, 30)) return; + } + + if (widgetbin_panel->visible()) { + widgetbin_panel->hide(); + Main_Menu[WIDGETBIN_ITEM].label("Show Widget &Bin..."); + } else { + widgetbin_panel->show(); + Main_Menu[WIDGETBIN_ITEM].label("Hide Widget &Bin"); + } +} + + +void toggle_sourceview_cb(Fl_Double_Window *, void *) { + if (!sourceview_panel) { + make_sourceview(); + sourceview_panel->callback((Fl_Callback*)toggle_sourceview_cb); + Fl_Preferences svp(fluid_prefs, "sourceview"); + int autorefresh; + svp.get("autorefresh", autorefresh, 1); + sv_autorefresh->value(autorefresh); + int autoposition; + svp.get("autoposition", autoposition, 1); + sv_autoposition->value(autoposition); + int tab; + svp.get("tab", tab, 0); + if (tab>=0 && tabchildren()) sv_tab->value(sv_tab->child(tab)); + if (!position_window(sourceview_panel,"sourceview_pos", 0, 320, 120, 550, 500)) return; + } + + if (sourceview_panel->visible()) { + sourceview_panel->hide(); + Main_Menu[SOURCEVIEW_ITEM].label("Show Source Code..."); + } else { + sourceview_panel->show(); + Main_Menu[SOURCEVIEW_ITEM].label("Hide Source Code..."); + update_sourceview_cb(0,0); + } +} + +void toggle_sourceview_b_cb(Fl_Button*, void *) { + toggle_sourceview_cb(0,0); +} + +void make_main_window() { + fluid_prefs.get("snap", snap, 1); + fluid_prefs.get("gridx", gridx, 5); + fluid_prefs.get("gridy", gridy, 5); + fluid_prefs.get("show_guides", show_guides, 0); + fluid_prefs.get("widget_size", Fl_Widget_Type::default_size, 14); + + load_history(); + + make_layout_window(); + make_settings_window(); + make_shell_window(); + + if (!main_window) { + Fl_Widget *o; + main_window = new Fl_Double_Window(WINWIDTH,WINHEIGHT,"fluid"); + main_window->box(FL_NO_BOX); + o = make_widget_browser(0,MENUHEIGHT,BROWSERWIDTH,BROWSERHEIGHT); + o->box(FL_FLAT_BOX); + o->tooltip("Double-click to view or change an item."); + main_window->resizable(o); + main_menubar = new Fl_Menu_Bar(0,0,BROWSERWIDTH,MENUHEIGHT); + main_menubar->menu(Main_Menu); + main_menubar->global(); + fill_in_New_Menu(); + main_window->end(); + } +} + +// Load file history from preferences... +void load_history() { + int i; // Looping var + int max_files; + + + fluid_prefs.get("recent_files", max_files, 5); + if (max_files > 10) max_files = 10; + + for (i = 0; i < max_files; i ++) { + fluid_prefs.get( Fl_Preferences::Name("file%d", i), absolute_history[i], "", sizeof(absolute_history[i])); + if (absolute_history[i][0]) { + // Make a relative version of the filename for the menu... + fl_filename_relative(relative_history[i], sizeof(relative_history[i]), + absolute_history[i]); + + if (i == 9) Main_Menu[i + HISTORY_ITEM].flags = FL_MENU_DIVIDER; + else Main_Menu[i + HISTORY_ITEM].flags = 0; + } else break; + } + + for (; i < 10; i ++) { + if (i) Main_Menu[i + HISTORY_ITEM - 1].flags |= FL_MENU_DIVIDER; + Main_Menu[i + HISTORY_ITEM].hide(); + } +} + +// Update file history from preferences... +void update_history(const char *flname) { + int i; // Looping var + char absolute[1024]; + int max_files; + + + fluid_prefs.get("recent_files", max_files, 5); + if (max_files > 10) max_files = 10; + + fl_filename_absolute(absolute, sizeof(absolute), flname); + + for (i = 0; i < max_files; i ++) +#if defined(WIN32) || defined(__APPLE__) + if (!strcasecmp(absolute, absolute_history[i])) break; +#else + if (!strcmp(absolute, absolute_history[i])) break; +#endif // WIN32 || __APPLE__ + + if (i == 0) return; + + if (i >= max_files) i = max_files - 1; + + // Move the other flnames down in the list... + memmove(absolute_history + 1, absolute_history, + i * sizeof(absolute_history[0])); + memmove(relative_history + 1, relative_history, + i * sizeof(relative_history[0])); + + // Put the new file at the top... + strlcpy(absolute_history[0], absolute, sizeof(absolute_history[0])); + + fl_filename_relative(relative_history[0], sizeof(relative_history[0]), + absolute_history[0]); + + // Update the menu items as needed... + for (i = 0; i < max_files; i ++) { + fluid_prefs.set( Fl_Preferences::Name("file%d", i), absolute_history[i]); + if (absolute_history[i][0]) { + if (i == 9) Main_Menu[i + HISTORY_ITEM].flags = FL_MENU_DIVIDER; + else Main_Menu[i + HISTORY_ITEM].flags = 0; + } else break; + } + + for (; i < 10; i ++) { + fluid_prefs.set( Fl_Preferences::Name("file%d", i), ""); + if (i) Main_Menu[i + HISTORY_ITEM - 1].flags |= FL_MENU_DIVIDER; + Main_Menu[i + HISTORY_ITEM].hide(); + } +} + +// Shell command support... +#if (!defined(WIN32) || defined(__CYGWIN__)) && !defined(__MWERKS__) +// Support the full piped shell command... +static FILE *shell_pipe = 0; + +void +shell_pipe_cb(int, void*) { + char line[1024]; // Line from command output... + + if (fgets(line, sizeof(line), shell_pipe) != NULL) { + // Add the line to the output list... + shell_run_buffer->append(line); + } else { + // End of file; tell the parent... + Fl::remove_fd(fileno(shell_pipe)); + + pclose(shell_pipe); + shell_pipe = NULL; + shell_run_buffer->append("... END SHELL COMMAND ...\n"); + } + + shell_run_display->scroll(shell_run_display->count_lines(0, + shell_run_buffer->length(), 1), 0); +} + +void +do_shell_command(Fl_Return_Button*, void*) { + const char *command; // Command to run + + + shell_window->hide(); + + if (shell_pipe) { + fl_alert("Previous shell command still running!"); + return; + } + + if ((command = shell_command_input->value()) == NULL || !*command) { + fl_alert("No shell command entered!"); + return; + } + + if (shell_savefl_button->value()) { + save_cb(0, 0); + } + + if (shell_writecode_button->value()) { + compile_only = 1; + write_cb(0, 0); + compile_only = 0; + } + + if (shell_writemsgs_button->value()) { + compile_only = 1; + write_strings_cb(0, 0); + compile_only = 0; + } + + // Show the output window and clear things... + shell_run_buffer->text(""); + shell_run_buffer->append(command); + shell_run_buffer->append("\n"); + shell_run_window->label("Shell Command Running..."); + + if ((shell_pipe = popen((char *)command, "r")) == NULL) { + fl_alert("Unable to run shell command: %s", strerror(errno)); + return; + } + + shell_run_button->deactivate(); + shell_run_window->hotspot(shell_run_display); + shell_run_window->show(); + + Fl::add_fd(fileno(shell_pipe), shell_pipe_cb); + + while (shell_pipe) Fl::wait(); + + shell_run_button->activate(); + shell_run_window->label("Shell Command Complete"); + fl_beep(); + + while (shell_run_window->shown()) Fl::wait(); +} +#else +// Just do basic shell command stuff, no status window... +void +do_shell_command(Fl_Return_Button*, void*) { + const char *command; // Command to run + int status; // Status from command... + + + shell_window->hide(); + + if ((command = shell_command_input->value()) == NULL || !*command) { + fl_alert("No shell command entered!"); + return; + } + + if (shell_savefl_button->value()) { + save_cb(0, 0); + } + + if (shell_writecode_button->value()) { + compile_only = 1; + write_cb(0, 0); + compile_only = 0; + } + + if (shell_writemsgs_button->value()) { + compile_only = 1; + write_strings_cb(0, 0); + compile_only = 0; + } + + if ((status = system(command)) != 0) { + fl_alert("Shell command returned status %d!", status); + } else if (completion_button->value()) { + fl_message("Shell command completed successfully!"); + } +} +#endif // (!WIN32 || __CYGWIN__) && !__MWERKS__ + + +void +show_shell_window() { + shell_window->hotspot(shell_command_input); + shell_window->show(); +} + +void set_filename(const char *c) { + if (filename) free((void *)filename); + filename = c ? strdup(c) : NULL; + + if (filename) update_history(filename); + + set_modflag(modflag); +} + +// +// The Source View system offers an immediate preview of 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 +// file. +// +// Can we patent this? ;-) - Matt, mm@matthiasm.com +// + +// +// Update the header and source code highlighting depending on the +// currently selected object +// +void update_sourceview_position() +{ + if (!sourceview_panel || !sourceview_panel->visible()) + return; + if (sv_autoposition->value()==0) + return; + if (sourceview_panel && sourceview_panel->visible() && Fl_Type::current) { + int pos0, pos1; + if (sv_source->visible_r()) { + pos0 = Fl_Type::current->code_line; + pos1 = Fl_Type::current->code_line_end; + if (pos0>=0) { + if (pos1buffer()->highlight(pos0, pos1); + int line = sv_source->buffer()->count_lines(0, pos0); + sv_source->scroll(line, 0); + } + } + if (sv_header->visible_r()) { + pos0 = Fl_Type::current->header_line; + pos1 = Fl_Type::current->header_line_end; + if (pos0>=0) { + if (pos1buffer()->highlight(pos0, pos1); + int line = sv_header->buffer()->count_lines(0, pos0); + sv_header->scroll(line, 0); + } + } + } +} + +void update_sourceview_position_cb(Fl_Tabs*, void*) +{ + update_sourceview_position(); +} + +static char *sv_source_filename = 0; +static char *sv_header_filename = 0; + +// +// Generate a header and source file in a temporary directory and +// load those into the Code Viewer widgets. +// +void update_sourceview_cb(Fl_Button*, void*) +{ + if (!sourceview_panel || !sourceview_panel->visible()) + return; + // generate space for the source and header file filenames + if (!sv_source_filename) { + sv_source_filename = (char*)malloc(FL_PATH_MAX); + fluid_prefs.getUserdataPath(sv_source_filename, FL_PATH_MAX); + strlcat(sv_source_filename, "source_view_tmp.cxx", FL_PATH_MAX); + } + if (!sv_header_filename) { + sv_header_filename = (char*)malloc(FL_PATH_MAX); + fluid_prefs.getUserdataPath(sv_header_filename, FL_PATH_MAX); + strlcat(sv_header_filename, "source_view_tmp.h", FL_PATH_MAX); + } + + strlcpy(i18n_program, fl_filename_name(sv_source_filename), sizeof(i18n_program)); + fl_filename_setext(i18n_program, sizeof(i18n_program), ""); + const char *code_file_name_bak = code_file_name; + code_file_name = sv_source_filename; + const char *header_file_name_bak = header_file_name; + header_file_name = sv_header_filename; + + // generate the code and load the files + write_sourceview = 1; + // generate files + if (write_code(sv_source_filename, sv_header_filename)) + { + // load file into source editor + int pos = sv_source->top_line(); + sv_source->buffer()->loadfile(sv_source_filename); + sv_source->scroll(pos, 0); + // load file into header editor + pos = sv_header->top_line(); + sv_header->buffer()->loadfile(sv_header_filename); + sv_header->scroll(pos, 0); + // update the source code highlighting + update_sourceview_position(); + } + write_sourceview = 0; + + code_file_name = code_file_name_bak; + header_file_name = header_file_name_bak; +} + +void update_sourceview_timer(void*) +{ + update_sourceview_cb(0,0); +} + +// Set the "modified" flag and update the title of the main window... +void set_modflag(int mf) { + const char *basename; + static char title[1024]; + + modflag = mf; + + if (main_window) { + if (!filename) basename = "Untitled.fl"; + else if ((basename = strrchr(filename, '/')) != NULL) basename ++; +#if defined(WIN32) || defined(__EMX__) + else if ((basename = strrchr(filename, '\\')) != NULL) basename ++; +#endif // WIN32 || __EMX__ + else basename = filename; + + if (modflag) { + snprintf(title, sizeof(title), "%s (modified)", basename); + main_window->label(title); + } else main_window->label(basename); + } + // if the UI was modified in any way, update the Source View panel + if (sourceview_panel && sourceview_panel->visible() && sv_autorefresh->value()) + { + // we will only update ealiest 0.5 seconds after the last change, and only + // if no other change was made, so dragging a widget will not generate any + // CPU load + Fl::remove_timeout(update_sourceview_timer, 0); + Fl::add_timeout(0.5, update_sourceview_timer, 0); + } + + // Enable/disable the Save menu item... + if (modflag) Main_Menu[SAVE_ITEM].activate(); + else Main_Menu[SAVE_ITEM].deactivate(); +} + +//////////////////////////////////////////////////////////////// + +static int arg(int argc, char** argv, int& i) { + if (argv[i][1] == 'c' && !argv[i][2]) {compile_only = 1; i++; return 1;} + if (argv[i][1] == 'c' && argv[i][2] == 's' && !argv[i][3]) {compile_only = 1; compile_strings = 1; i++; return 1;} + if (argv[i][1] == 'o' && !argv[i][2] && i+1 < argc) { + code_file_name = argv[i+1]; + code_file_set = 1; + i += 2; + return 2; + } + if (argv[i][1] == 'h' && !argv[i][2]) { + header_file_name = argv[i+1]; + header_file_set = 1; + i += 2; + return 2; + } + return 0; +} + +#if ! (defined(WIN32) && !defined (__CYGWIN__)) + +int quit_flag = 0; +#include +#ifdef _sigargs +#define SIGARG _sigargs +#else +#ifdef __sigargs +#define SIGARG __sigargs +#else +#define SIGARG int // you may need to fix this for older systems +#endif +#endif + +extern "C" { +static void sigint(SIGARG) { + signal(SIGINT,sigint); + quit_flag = 1; +} +} +#endif + +int main(int argc,char **argv) { + int i = 1; + if (!Fl::args(argc,argv,i,arg) || i < argc-1) { + fprintf(stderr,"usage: %s name.fl\n" +" -c : write .cxx and .h and exit\n" +" -cs : write .cxx and .h and strings and exit\n" +" -o : .cxx output filename, or extension if starts with '.'\n" +" -h : .h output filename, or extension if starts with '.'\n" +"%s\n", argv[0], Fl::help); + return 1; + } + const char *c = argv[i]; + + fl_register_images(); + + make_main_window(); + +#ifdef __APPLE__ + fl_open_callback(apple_open_cb); +#endif // __APPLE__ + + if (c) set_filename(c); + if (!compile_only) { + Fl::visual((Fl_Mode)(FL_DOUBLE|FL_INDEX)); + Fl_File_Icon::load_system_icons(); + main_window->callback(exit_cb); + position_window(main_window,"main_window_pos", 1, 10, 30, WINWIDTH, WINHEIGHT ); + main_window->show(argc,argv); + toggle_widgetbin_cb(0,0); + toggle_sourceview_cb(0,0); + if (!c && openlast_button->value() && absolute_history[0][0]) { + // Open previous file when no file specified... + open_history_cb(0, absolute_history[0]); + } + } + undo_suspend(); + if (c && !read_file(c,0)) { + if (compile_only) { + fprintf(stderr,"%s : %s\n", c, strerror(errno)); + exit(1); + } + fl_message("Can't read %s: %s", c, strerror(errno)); + } + undo_resume(); + if (compile_only) { + if (compile_strings) write_strings_cb(0,0); + write_cb(0,0); + exit(0); + } + set_modflag(0); + undo_clear(); +#ifndef WIN32 + signal(SIGINT,sigint); +#endif + + grid_cb(horizontal_input, 0); // Makes sure that windows get snap params... + +#ifdef WIN32 + Fl::run(); +#else + while (!quit_flag) Fl::wait(); + + if (quit_flag) exit_cb(0,0); +#endif // WIN32 + + undo_clear(); + + return (0); +} + +// +// End of "$Id: fluid.cxx 6783 2009-04-27 15:50:29Z AlbrechtS $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/fluid.desktop b/third_party/windows/fltk-1.1.10/fluid/fluid.desktop new file mode 100644 index 0000000..f8241ce --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/fluid.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=FLUID +Comment=FLTK GUI Designer +TryExec=fluid +Exec=cd %D && fluid %F +Icon=fluid +Terminal=false +Type=Application +MimeType=application/x-fluid +Categories=Development;GUIDesigner; diff --git a/third_party/windows/fltk-1.1.10/fluid/function_panel.cxx b/third_party/windows/fltk-1.1.10/fluid/function_panel.cxx new file mode 100644 index 0000000..5e86872 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/function_panel.cxx @@ -0,0 +1,979 @@ +// +// "$Id: function_panel.cxx 6817 2009-07-02 09:42:17Z AlbrechtS $" +// +// Code dialogs for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 +// + +// generated by Fast Light User Interface Designer (fluid) version 1.0110 + +#include "function_panel.h" +#include +#include "Fl_Type.h" +#include "undo.h" +extern class Fl_Pixmap *pixmap[]; +extern class Fl_Type *Fl_Type_make(const char*); +extern void select_only(Fl_Type*); + +Fl_Double_Window *function_panel=(Fl_Double_Window *)0; + +Fl_Choice *f_public_member_choice=(Fl_Choice *)0; + +Fl_Menu_Item menu_f_public_member_choice[] = { + {"private", 0, 0, (void*)(0), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"public", 0, 0, (void*)(1), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"protected", 0, 0, (void*)(2), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {0,0,0,0,0,0,0,0,0} +}; + +Fl_Choice *f_public_choice=(Fl_Choice *)0; + +Fl_Menu_Item menu_f_public_choice[] = { + {"local", 0, 0, (void*)(0), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"global", 0, 0, (void*)(1), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {0,0,0,0,0,0,0,0,0} +}; + +Fl_Light_Button *f_c_button=(Fl_Light_Button *)0; + +Fl_Input *f_name_input=(Fl_Input *)0; + +Fl_Input *f_return_type_input=(Fl_Input *)0; + +Fl_Return_Button *f_panel_ok=(Fl_Return_Button *)0; + +Fl_Button *f_panel_cancel=(Fl_Button *)0; + +Fl_Double_Window* make_function_panel() { + { Fl_Double_Window* o = function_panel = new Fl_Double_Window(290, 150, "Function/Method Properties"); + { Fl_Group* o = new Fl_Group(10, 10, 270, 20); + { f_public_member_choice = new Fl_Choice(10, 10, 75, 20); + f_public_member_choice->tooltip("Change member access attribute."); + f_public_member_choice->down_box(FL_BORDER_BOX); + f_public_member_choice->labelsize(11); + f_public_member_choice->textsize(11); + f_public_member_choice->when(FL_WHEN_CHANGED); + f_public_member_choice->menu(menu_f_public_member_choice); + } // Fl_Choice* f_public_member_choice + { f_public_choice = new Fl_Choice(10, 10, 75, 20); + f_public_choice->tooltip("Change widget accessibility."); + f_public_choice->down_box(FL_BORDER_BOX); + f_public_choice->labelsize(11); + f_public_choice->textsize(11); + f_public_choice->when(FL_WHEN_CHANGED); + f_public_choice->menu(menu_f_public_choice); + } // Fl_Choice* f_public_choice + { f_c_button = new Fl_Light_Button(95, 10, 80, 20, "C declaration"); + f_c_button->tooltip("Declare with a C interface instead of C++."); + f_c_button->labelsize(11); + } // Fl_Light_Button* f_c_button + { Fl_Box* o = new Fl_Box(235, 10, 45, 20); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + { f_name_input = new Fl_Input(10, 50, 270, 20, "Name(args): (blank for main())"); + f_name_input->tooltip("The name of the function or method."); + f_name_input->labelfont(1); + f_name_input->labelsize(11); + f_name_input->textfont(4); + f_name_input->textsize(11); + f_name_input->align(FL_ALIGN_TOP_LEFT); + f_name_input->when(FL_WHEN_NEVER); + Fl_Group::current()->resizable(f_name_input); + } // Fl_Input* f_name_input + { f_return_type_input = new Fl_Input(10, 90, 270, 20, "Return Type: (blank to return outermost widget)"); + f_return_type_input->tooltip("The return type of the function or method."); + f_return_type_input->labelfont(1); + f_return_type_input->labelsize(11); + f_return_type_input->textfont(4); + f_return_type_input->textsize(11); + f_return_type_input->align(FL_ALIGN_TOP_LEFT); + f_return_type_input->when(FL_WHEN_NEVER); + } // Fl_Input* f_return_type_input + { Fl_Group* o = new Fl_Group(10, 120, 270, 20); + { f_panel_ok = new Fl_Return_Button(170, 120, 50, 20, "OK"); + f_panel_ok->tooltip("Apply the changes."); + f_panel_ok->labelsize(11); + f_panel_ok->window()->hotspot(f_panel_ok); + } // Fl_Return_Button* f_panel_ok + { f_panel_cancel = new Fl_Button(230, 120, 50, 20, "Cancel"); + f_panel_cancel->tooltip("Cancel the changes."); + f_panel_cancel->shortcut(0xff1b); + f_panel_cancel->labelsize(11); + } // Fl_Button* f_panel_cancel + { Fl_Box* o = new Fl_Box(10, 120, 150, 20); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + o->size_range(o->w(), o->h(), Fl::w(), o->h()); + function_panel->set_modal(); + function_panel->end(); + } // Fl_Double_Window* function_panel + return function_panel; +} + +Fl_Double_Window *code_panel=(Fl_Double_Window *)0; + +CodeEditor *code_input=(CodeEditor *)0; + +Fl_Return_Button *code_panel_ok=(Fl_Return_Button *)0; + +Fl_Button *code_panel_cancel=(Fl_Button *)0; + +Fl_Double_Window* make_code_panel() { + { Fl_Double_Window* o = code_panel = new Fl_Double_Window(540, 180, "Code Properties"); + code_panel->labelsize(11); + { CodeEditor* o = code_input = new CodeEditor(10, 10, 520, 130); + code_input->box(FL_DOWN_BOX); + code_input->color(FL_BACKGROUND2_COLOR); + code_input->selection_color(FL_SELECTION_COLOR); + code_input->labeltype(FL_NORMAL_LABEL); + code_input->labelfont(0); + code_input->labelsize(11); + code_input->labelcolor(FL_FOREGROUND_COLOR); + code_input->textfont(4); + code_input->textsize(11); + code_input->align(FL_ALIGN_TOP); + code_input->when(FL_WHEN_RELEASE); + Fl_Group::current()->resizable(code_input); + o->when(FL_WHEN_ENTER_KEY_CHANGED|FL_WHEN_RELEASE); + } // CodeEditor* code_input + { Fl_Group* o = new Fl_Group(10, 150, 520, 20); + o->labelsize(11); + { code_panel_ok = new Fl_Return_Button(400, 150, 60, 20, "OK"); + code_panel_ok->labelsize(11); + code_panel_ok->window()->hotspot(code_panel_ok); + } // Fl_Return_Button* code_panel_ok + { code_panel_cancel = new Fl_Button(470, 150, 60, 20, "Cancel"); + code_panel_cancel->shortcut(0xff1b); + code_panel_cancel->labelsize(11); + } // Fl_Button* code_panel_cancel + { Fl_Box* o = new Fl_Box(10, 150, 380, 20); + o->labelsize(11); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + o->size_range(200, 150); + code_panel->set_modal(); + code_panel->end(); + } // Fl_Double_Window* code_panel + return code_panel; +} + +Fl_Double_Window *codeblock_panel=(Fl_Double_Window *)0; + +Fl_Input *code_before_input=(Fl_Input *)0; + +Fl_Input *code_after_input=(Fl_Input *)0; + +Fl_Return_Button *codeblock_panel_ok=(Fl_Return_Button *)0; + +Fl_Button *codeblock_panel_cancel=(Fl_Button *)0; + +Fl_Double_Window* make_codeblock_panel() { + { Fl_Double_Window* o = codeblock_panel = new Fl_Double_Window(300, 115, "Code Block Properties"); + codeblock_panel->labelsize(11); + { code_before_input = new Fl_Input(10, 15, 280, 20, "Conditional code block"); + code_before_input->tooltip("#ifdef or similar conditional code block."); + code_before_input->labelsize(11); + code_before_input->textfont(4); + code_before_input->textsize(11); + code_before_input->align(FL_ALIGN_TOP_LEFT); + code_before_input->when(FL_WHEN_NEVER); + } // Fl_Input* code_before_input + { code_after_input = new Fl_Input(10, 55, 280, 20, "\"{...child code...}\" is inserted here"); + code_after_input->tooltip("#endif or similar conditional code block."); + code_after_input->labelsize(11); + code_after_input->textfont(4); + code_after_input->textsize(11); + code_after_input->align(FL_ALIGN_TOP_LEFT); + code_after_input->when(FL_WHEN_NEVER); + Fl_Group::current()->resizable(code_after_input); + } // Fl_Input* code_after_input + { Fl_Group* o = new Fl_Group(10, 85, 280, 20); + { codeblock_panel_ok = new Fl_Return_Button(160, 85, 60, 20, "OK"); + codeblock_panel_ok->labelsize(11); + codeblock_panel_ok->window()->hotspot(codeblock_panel_ok); + } // Fl_Return_Button* codeblock_panel_ok + { codeblock_panel_cancel = new Fl_Button(230, 85, 60, 20, "Cancel"); + codeblock_panel_cancel->shortcut(0xff1b); + codeblock_panel_cancel->labelsize(11); + } // Fl_Button* codeblock_panel_cancel + { Fl_Box* o = new Fl_Box(10, 85, 140, 20); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + o->size_range(o->w(), o->h(), Fl::w(), o->h()); + codeblock_panel->set_modal(); + codeblock_panel->end(); + } // Fl_Double_Window* codeblock_panel + return codeblock_panel; +} + +Fl_Double_Window *declblock_panel=(Fl_Double_Window *)0; + +Fl_Choice *declblock_public_choice=(Fl_Choice *)0; + +Fl_Menu_Item menu_declblock_public_choice[] = { + {"in source code only", 0, 0, (void*)(0), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"in header and source", 0, 0, (void*)(1), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {0,0,0,0,0,0,0,0,0} +}; + +Fl_Light_Button *declblock_public_button_x=(Fl_Light_Button *)0; + +Fl_Input *decl_before_input=(Fl_Input *)0; + +Fl_Input *decl_after_input=(Fl_Input *)0; + +Fl_Return_Button *declblock_panel_ok=(Fl_Return_Button *)0; + +Fl_Button *declblock_panel_cancel=(Fl_Button *)0; + +Fl_Double_Window* make_declblock_panel() { + { Fl_Double_Window* o = declblock_panel = new Fl_Double_Window(300, 135, "Declaration Block Properties"); + declblock_panel->labelsize(11); + { Fl_Group* o = new Fl_Group(10, 10, 280, 20); + { declblock_public_choice = new Fl_Choice(10, 10, 140, 20); + declblock_public_choice->tooltip("Change widget accessibility."); + declblock_public_choice->down_box(FL_BORDER_BOX); + declblock_public_choice->labelsize(11); + declblock_public_choice->textsize(11); + declblock_public_choice->when(FL_WHEN_NEVER); + declblock_public_choice->menu(menu_declblock_public_choice); + } // Fl_Choice* declblock_public_choice + { declblock_public_button_x = new Fl_Light_Button(10, 10, 60, 20, "public"); + declblock_public_button_x->tooltip("Make the declaration publicly accessible."); + declblock_public_button_x->labelsize(11); + declblock_public_button_x->when(FL_WHEN_NEVER); + declblock_public_button_x->hide(); + } // Fl_Light_Button* declblock_public_button_x + { Fl_Box* o = new Fl_Box(155, 10, 135, 20); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + { decl_before_input = new Fl_Input(10, 40, 280, 20); + decl_before_input->tooltip("#ifdef or similar conditional declaration block."); + decl_before_input->labelsize(11); + decl_before_input->textfont(4); + decl_before_input->textsize(11); + decl_before_input->align(FL_ALIGN_TOP_LEFT); + decl_before_input->when(FL_WHEN_NEVER); + Fl_Group::current()->resizable(decl_before_input); + } // Fl_Input* decl_before_input + { decl_after_input = new Fl_Input(10, 75, 280, 20, "\"\\n...child code...\\n\" is inserted here"); + decl_after_input->tooltip("#endif or similar declaration code block."); + decl_after_input->labelsize(11); + decl_after_input->textfont(4); + decl_after_input->textsize(11); + decl_after_input->align(FL_ALIGN_TOP_LEFT); + decl_after_input->when(FL_WHEN_NEVER); + } // Fl_Input* decl_after_input + { Fl_Group* o = new Fl_Group(10, 105, 280, 20); + { declblock_panel_ok = new Fl_Return_Button(160, 105, 60, 20, "OK"); + declblock_panel_ok->labelsize(11); + declblock_panel_ok->window()->hotspot(declblock_panel_ok); + } // Fl_Return_Button* declblock_panel_ok + { declblock_panel_cancel = new Fl_Button(230, 105, 60, 20, "Cancel"); + declblock_panel_cancel->shortcut(0xff1b); + declblock_panel_cancel->labelsize(11); + } // Fl_Button* declblock_panel_cancel + { Fl_Box* o = new Fl_Box(10, 105, 140, 20); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + o->size_range(o->w(), o->h(), Fl::w(), o->h()); + declblock_panel->set_modal(); + declblock_panel->end(); + } // Fl_Double_Window* declblock_panel + return declblock_panel; +} + +Fl_Double_Window *decl_panel=(Fl_Double_Window *)0; + +Fl_Choice *decl_choice=(Fl_Choice *)0; + +Fl_Menu_Item menu_decl_choice[] = { + {"in source file only", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"in header file only", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"\"static\" in source file", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"in source and \"extern\" in header", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0}, + {0,0,0,0,0,0,0,0,0} +}; + +Fl_Choice *decl_class_choice=(Fl_Choice *)0; + +Fl_Menu_Item menu_decl_class_choice[] = { + {"private", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"public", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"protected", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0}, + {0,0,0,0,0,0,0,0,0} +}; + +Fl_Input *decl_input=(Fl_Input *)0; + +Fl_Return_Button *decl_panel_ok=(Fl_Return_Button *)0; + +Fl_Button *decl_panel_cancel=(Fl_Button *)0; + +Fl_Double_Window* make_decl_panel() { + { Fl_Double_Window* o = decl_panel = new Fl_Double_Window(290, 150, "Declaration Properties"); + decl_panel->align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE); + { Fl_Group* o = new Fl_Group(10, 10, 270, 20); + { Fl_Box* o = new Fl_Box(200, 10, 80, 20); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + { decl_choice = new Fl_Choice(10, 10, 185, 20); + decl_choice->down_box(FL_BORDER_BOX); + decl_choice->labelsize(11); + decl_choice->textsize(11); + decl_choice->menu(menu_decl_choice); + } // Fl_Choice* decl_choice + { decl_class_choice = new Fl_Choice(10, 10, 75, 20); + decl_class_choice->down_box(FL_BORDER_BOX); + decl_class_choice->labelsize(11); + decl_class_choice->textsize(11); + decl_class_choice->menu(menu_decl_class_choice); + } // Fl_Choice* decl_class_choice + o->end(); + } // Fl_Group* o + { decl_input = new Fl_Input(10, 40, 270, 20, "Can be any declaration, like \"int x;\", an external symbol like \"extern int\ + foo();\", a #directive like \"#include \", a comment like \"//foo\" or\ + \"/*foo*/\", or typedef like \"typedef char byte;\" or \"using std::list;\"."); + decl_input->tooltip("Declaration text."); + decl_input->labelsize(11); + decl_input->textfont(4); + decl_input->textsize(11); + decl_input->align(134); + decl_input->when(FL_WHEN_NEVER); + Fl_Group::current()->resizable(decl_input); + } // Fl_Input* decl_input + { Fl_Group* o = new Fl_Group(10, 120, 270, 20); + { decl_panel_ok = new Fl_Return_Button(150, 120, 60, 20, "OK"); + decl_panel_ok->labelsize(11); + decl_panel_ok->window()->hotspot(decl_panel_ok); + } // Fl_Return_Button* decl_panel_ok + { decl_panel_cancel = new Fl_Button(220, 120, 60, 20, "Cancel"); + decl_panel_cancel->shortcut(0xff1b); + decl_panel_cancel->labelsize(11); + } // Fl_Button* decl_panel_cancel + { Fl_Box* o = new Fl_Box(10, 120, 130, 20); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + o->size_range(o->w(), o->h(), Fl::w(), o->h()); + decl_panel->end(); + } // Fl_Double_Window* decl_panel + return decl_panel; +} + +Fl_Double_Window *class_panel=(Fl_Double_Window *)0; + +Fl_Light_Button *c_public_button=(Fl_Light_Button *)0; + +Fl_Input *c_name_input=(Fl_Input *)0; + +Fl_Input *c_subclass_input=(Fl_Input *)0; + +Fl_Return_Button *c_panel_ok=(Fl_Return_Button *)0; + +Fl_Button *c_panel_cancel=(Fl_Button *)0; + +Fl_Double_Window* make_class_panel() { + { Fl_Double_Window* o = class_panel = new Fl_Double_Window(300, 115, "Class Properties"); + class_panel->labelsize(11); + { Fl_Group* o = new Fl_Group(10, 10, 280, 20); + o->hide(); + { c_public_button = new Fl_Light_Button(10, 10, 60, 20, "public"); + c_public_button->tooltip("Make the class publicly accessible."); + c_public_button->labelsize(11); + c_public_button->when(FL_WHEN_NEVER); + c_public_button->hide(); + } // Fl_Light_Button* c_public_button + { Fl_Box* o = new Fl_Box(80, 10, 210, 20); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + { c_name_input = new Fl_Input(10, 20, 280, 20, "Name:"); + c_name_input->tooltip("Name of class."); + c_name_input->labelfont(1); + c_name_input->labelsize(11); + c_name_input->textfont(4); + c_name_input->textsize(11); + c_name_input->align(FL_ALIGN_TOP_LEFT); + c_name_input->when(FL_WHEN_NEVER); + Fl_Group::current()->resizable(c_name_input); + } // Fl_Input* c_name_input + { c_subclass_input = new Fl_Input(10, 55, 280, 20, "Subclass of (text between : and {)"); + c_subclass_input->tooltip("Name of subclass."); + c_subclass_input->labelfont(1); + c_subclass_input->labelsize(11); + c_subclass_input->textfont(4); + c_subclass_input->textsize(11); + c_subclass_input->align(FL_ALIGN_TOP_LEFT); + c_subclass_input->when(FL_WHEN_NEVER); + } // Fl_Input* c_subclass_input + { Fl_Group* o = new Fl_Group(10, 85, 280, 20); + { c_panel_ok = new Fl_Return_Button(160, 85, 60, 20, "OK"); + c_panel_ok->labelsize(11); + c_panel_ok->window()->hotspot(c_panel_ok); + } // Fl_Return_Button* c_panel_ok + { c_panel_cancel = new Fl_Button(230, 85, 60, 20, "Cancel"); + c_panel_cancel->shortcut(0xff1b); + c_panel_cancel->labelsize(11); + } // Fl_Button* c_panel_cancel + { Fl_Box* o = new Fl_Box(10, 85, 140, 20); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + o->size_range(o->w(), o->h(), Fl::w(), o->h()); + class_panel->set_modal(); + class_panel->end(); + } // Fl_Double_Window* class_panel + return class_panel; +} + +Fl_Double_Window *comment_panel=(Fl_Double_Window *)0; + +CodeEditor *comment_input=(CodeEditor *)0; + +Fl_Return_Button *comment_panel_ok=(Fl_Return_Button *)0; + +Fl_Button *comment_panel_cancel=(Fl_Button *)0; + +Fl_Light_Button *comment_in_source=(Fl_Light_Button *)0; + +Fl_Light_Button *comment_in_header=(Fl_Light_Button *)0; + +Fl_Menu_Button *comment_predefined=(Fl_Menu_Button *)0; + +Fl_Button *comment_load=(Fl_Button *)0; + +Fl_Double_Window* make_comment_panel() { + { Fl_Double_Window* o = comment_panel = new Fl_Double_Window(550, 280, "Comment Properties"); + comment_panel->labelsize(11); + { CodeEditor* o = comment_input = new CodeEditor(110, 10, 430, 230); + comment_input->box(FL_DOWN_BOX); + comment_input->color(FL_BACKGROUND2_COLOR); + comment_input->selection_color(FL_SELECTION_COLOR); + comment_input->labeltype(FL_NORMAL_LABEL); + comment_input->labelfont(0); + comment_input->labelsize(11); + comment_input->labelcolor(FL_FOREGROUND_COLOR); + comment_input->textfont(4); + comment_input->textsize(11); + comment_input->align(FL_ALIGN_TOP); + comment_input->when(FL_WHEN_RELEASE); + Fl_Group::current()->resizable(comment_input); + o->when(FL_WHEN_ENTER_KEY_CHANGED|FL_WHEN_RELEASE); + } // CodeEditor* comment_input + { Fl_Group* o = new Fl_Group(110, 250, 430, 20); + o->labelsize(11); + { comment_panel_ok = new Fl_Return_Button(370, 250, 80, 20, "OK"); + comment_panel_ok->labelsize(11); + comment_panel_ok->window()->hotspot(comment_panel_ok); + } // Fl_Return_Button* comment_panel_ok + { comment_panel_cancel = new Fl_Button(460, 250, 80, 20, "Cancel"); + comment_panel_cancel->shortcut(0xff1b); + comment_panel_cancel->labelsize(11); + } // Fl_Button* comment_panel_cancel + { Fl_Box* o = new Fl_Box(110, 250, 250, 20); + o->labelsize(11); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(10, 10, 90, 243); + o->labelsize(11); + { comment_in_source = new Fl_Light_Button(10, 10, 90, 20, "In Source"); + comment_in_source->tooltip("Put the comment into the source (.cxx) file."); + comment_in_source->labelsize(11); + comment_in_source->when(FL_WHEN_NEVER); + } // Fl_Light_Button* comment_in_source + { comment_in_header = new Fl_Light_Button(10, 40, 90, 20, "In Header"); + comment_in_header->tooltip("Put the comment into the header (.h) file."); + comment_in_header->labelsize(11); + comment_in_header->when(FL_WHEN_NEVER); + } // Fl_Light_Button* comment_in_header + { comment_predefined = new Fl_Menu_Button(10, 70, 90, 20, "Predefined"); + comment_predefined->labelsize(11); + comment_predefined->textsize(11); + } // Fl_Menu_Button* comment_predefined + { comment_load = new Fl_Button(10, 100, 90, 20, "Import..."); + comment_load->labelsize(11); + } // Fl_Button* comment_load + { Fl_Box* o = new Fl_Box(10, 132, 90, 121); + o->labelsize(11); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + o->size_range(320, 180); + comment_panel->set_modal(); + comment_panel->end(); + } // Fl_Double_Window* comment_panel + return comment_panel; +} + +void type_make_cb(Fl_Widget*,void*d) { + undo_checkpoint(); + Fl_Type *t = Fl_Type_make((char*)d); + if (t) { + select_only(t); + set_modflag(1); + t->open(); + } else { + undo_current --; + undo_last --; + } +} + +Fl_Window *widgetbin_panel=(Fl_Window *)0; + +Fl_Window* make_widgetbin() { + { widgetbin_panel = new Fl_Window(550, 85, "Widget Bin"); + widgetbin_panel->align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE); + { Fl_Group* o = new Fl_Group(3, 3, 79, 79); + { Fl_Button* o = new Fl_Button(5, 5, 24, 24); + o->tooltip("Function"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Function")); + o->image(pixmap[7]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(30, 5, 24, 24); + o->tooltip("Class"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Class")); + o->image(pixmap[12]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(55, 5, 24, 24); + o->tooltip("Comment"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("comment")); + o->image(pixmap[46]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(5, 30, 24, 24); + o->tooltip("Code"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Code")); + o->image(pixmap[8]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(30, 30, 24, 24); + o->tooltip("Code Block"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("CodeBlock")); + o->image(pixmap[9]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(55, 30, 24, 24); + o->tooltip("Widget Class"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("widget_class")); + o->image(pixmap[48]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(5, 55, 24, 24); + o->tooltip("Declaration"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("decl")); + o->image(pixmap[10]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(30, 55, 24, 24); + o->tooltip("Declaration Block"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("declblock")); + o->image(pixmap[11]); + } // Fl_Button* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(87, 3, 79, 79); + { Fl_Button* o = new Fl_Button(89, 5, 24, 24); + o->tooltip("Window"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Window")); + o->image(pixmap[1]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(114, 5, 24, 24); + o->tooltip("Group"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Group")); + o->image(pixmap[6]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(139, 5, 24, 24); + o->tooltip("Pack"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Pack")); + o->image(pixmap[22]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(89, 30, 24, 24); + o->tooltip("Tabs"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Tabs")); + o->image(pixmap[13]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(114, 30, 24, 24); + o->tooltip("Scroll"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Scroll")); + o->image(pixmap[19]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(89, 55, 24, 24); + o->tooltip("Tile"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Tile")); + o->image(pixmap[20]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(114, 55, 24, 24); + o->tooltip("Wizard"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Wizard")); + o->image(pixmap[21]); + } // Fl_Button* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(171, 3, 54, 79); + { Fl_Button* o = new Fl_Button(173, 5, 24, 24); + o->tooltip("Button"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Button")); + o->image(pixmap[2]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(198, 5, 24, 24); + o->tooltip("Return Button"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Return_Button")); + o->image(pixmap[23]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(173, 30, 24, 24); + o->tooltip("Light Button"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Light_Button")); + o->image(pixmap[24]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(198, 30, 24, 24); + o->tooltip("Repeat Button"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Repeat_Button")); + o->image(pixmap[25]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(173, 55, 24, 24); + o->tooltip("Check Button"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Check_Button")); + o->image(pixmap[3]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(198, 55, 24, 24); + o->tooltip("Round Button"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Round_Button")); + o->image(pixmap[4]); + } // Fl_Button* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(230, 3, 104, 79); + { Fl_Button* o = new Fl_Button(232, 5, 24, 24); + o->tooltip("Slider"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Slider")); + o->image(pixmap[37]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(257, 5, 24, 24); + o->tooltip("Scroll Bar"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Scrollbar")); + o->image(pixmap[38]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(282, 5, 24, 24); + o->tooltip("Value Slider"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Value_Slider")); + o->image(pixmap[39]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(307, 5, 24, 24); + o->tooltip("Value Output"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Value_Output")); + o->image(pixmap[45]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(232, 30, 24, 24); + o->tooltip("Adjuster"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Adjuster")); + o->image(pixmap[40]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(257, 30, 24, 24); + o->tooltip("Counter"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Counter")); + o->image(pixmap[41]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(282, 30, 24, 24); + o->tooltip("Dial"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Dial")); + o->image(pixmap[42]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(232, 55, 24, 24); + o->tooltip("Roller"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Roller")); + o->image(pixmap[43]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(257, 55, 24, 24); + o->tooltip("Spinner"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Spinner")); + o->image(pixmap[47]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(282, 55, 24, 24); + o->tooltip("Value Input"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Value_Input")); + o->image(pixmap[44]); + } // Fl_Button* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(339, 3, 54, 79); + { Fl_Button* o = new Fl_Button(341, 5, 24, 24); + o->tooltip("Input"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Input")); + o->image(pixmap[14]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(366, 5, 24, 24); + o->tooltip("Output"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Output")); + o->image(pixmap[27]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(341, 30, 24, 24); + o->tooltip("Text Edit"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Text_Editor")); + o->image(pixmap[29]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(366, 30, 24, 24); + o->tooltip("Text Display"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Text_Display")); + o->image(pixmap[28]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(341, 55, 24, 24); + o->tooltip("File Input"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_File_Input")); + o->image(pixmap[30]); + } // Fl_Button* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(398, 3, 54, 79); + { Fl_Button* o = new Fl_Button(400, 5, 24, 24); + o->tooltip("Menu Bar"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Menu_Bar")); + o->image(pixmap[17]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(425, 5, 24, 24); + o->tooltip("Input Choice"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Input_Choice")); + o->image(pixmap[15]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(400, 30, 24, 24); + o->tooltip("Menu Button"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Menu_Button")); + o->image(pixmap[26]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(425, 30, 24, 24); + o->tooltip("Menu Item"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("menuitem")); + o->image(pixmap[16]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(400, 55, 24, 24); + o->tooltip("Choice"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Choice")); + o->image(pixmap[15]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(425, 55, 24, 24); + o->tooltip("Sub Menu"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("submenu")); + o->image(pixmap[18]); + } // Fl_Button* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(457, 3, 29, 79); + { Fl_Button* o = new Fl_Button(459, 5, 24, 24); + o->tooltip("Browser"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Browser")); + o->image(pixmap[31]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(459, 30, 24, 24); + o->tooltip("Check Browser"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Check_Browser")); + o->image(pixmap[32]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(459, 55, 24, 24); + o->tooltip("File Browser"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_File_Browser")); + o->image(pixmap[33]); + } // Fl_Button* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(491, 3, 55, 79); + { Fl_Button* o = new Fl_Button(493, 5, 24, 24); + o->tooltip("Box"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Box")); + o->image(pixmap[5]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(518, 5, 24, 24); + o->tooltip("Clock"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Clock")); + o->image(pixmap[34]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(493, 30, 24, 24); + o->tooltip("Help Browser"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Help_View")); + o->image(pixmap[35]); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(493, 55, 24, 24); + o->tooltip("Progress"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Progress")); + o->image(pixmap[36]); + } // Fl_Button* o + o->end(); + } // Fl_Group* o + widgetbin_panel->set_non_modal(); + widgetbin_panel->end(); + } // Fl_Window* widgetbin_panel + return widgetbin_panel; +} + +Fl_Double_Window *sourceview_panel=(Fl_Double_Window *)0; + +Fl_Tabs *sv_tab=(Fl_Tabs *)0; + +CodeViewer *sv_source=(CodeViewer *)0; + +CodeViewer *sv_header=(CodeViewer *)0; + +Fl_Light_Button *sv_autorefresh=(Fl_Light_Button *)0; + +Fl_Light_Button *sv_autoposition=(Fl_Light_Button *)0; + +Fl_Double_Window* make_sourceview() { + { sourceview_panel = new Fl_Double_Window(520, 490, "Code View"); + sourceview_panel->callback((Fl_Callback*)toggle_sourceview_cb); + sourceview_panel->align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE); + { sv_tab = new Fl_Tabs(10, 10, 500, 440); + sv_tab->selection_color((Fl_Color)4); + sv_tab->labelcolor(FL_BACKGROUND2_COLOR); + sv_tab->callback((Fl_Callback*)update_sourceview_position_cb); + { Fl_Group* o = new Fl_Group(10, 35, 500, 415, "Source"); + o->labelsize(13); + o->hide(); + { sv_source = new CodeViewer(20, 50, 480, 390); + sv_source->box(FL_DOWN_FRAME); + sv_source->color(FL_BACKGROUND2_COLOR); + sv_source->selection_color(FL_SELECTION_COLOR); + sv_source->labeltype(FL_NORMAL_LABEL); + sv_source->labelfont(0); + sv_source->labelsize(14); + sv_source->labelcolor(FL_FOREGROUND_COLOR); + sv_source->textfont(4); + sv_source->textsize(11); + sv_source->align(FL_ALIGN_TOP); + sv_source->when(FL_WHEN_RELEASE); + Fl_Group::current()->resizable(sv_source); + } // CodeViewer* sv_source + o->end(); + Fl_Group::current()->resizable(o); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(10, 35, 500, 415, "Header"); + o->labelsize(13); + { sv_header = new CodeViewer(20, 50, 480, 390); + sv_header->box(FL_DOWN_FRAME); + sv_header->color(FL_BACKGROUND2_COLOR); + sv_header->selection_color(FL_SELECTION_COLOR); + sv_header->labeltype(FL_NORMAL_LABEL); + sv_header->labelfont(0); + sv_header->labelsize(14); + sv_header->labelcolor(FL_FOREGROUND_COLOR); + sv_header->textfont(4); + sv_header->textsize(11); + sv_header->align(FL_ALIGN_TOP); + sv_header->when(FL_WHEN_RELEASE); + Fl_Group::current()->resizable(sv_header); + } // CodeViewer* sv_header + o->end(); + } // Fl_Group* o + sv_tab->end(); + Fl_Group::current()->resizable(sv_tab); + } // Fl_Tabs* sv_tab + { Fl_Group* o = new Fl_Group(10, 460, 500, 20); + { Fl_Button* o = new Fl_Button(10, 460, 61, 20, "Refresh"); + o->labelsize(11); + o->callback((Fl_Callback*)update_sourceview_cb); + } // Fl_Button* o + { Fl_Light_Button* o = sv_autorefresh = new Fl_Light_Button(76, 460, 91, 20, "Auto-Refresh"); + sv_autorefresh->labelsize(11); + o->callback((Fl_Callback*)update_sourceview_cb); + } // Fl_Light_Button* sv_autorefresh + { sv_autoposition = new Fl_Light_Button(172, 460, 89, 20, "Auto-Position"); + sv_autoposition->labelsize(11); + } // Fl_Light_Button* sv_autoposition + { Fl_Button* o = new Fl_Button(460, 460, 50, 20, "Close"); + o->labelsize(11); + o->callback((Fl_Callback*)toggle_sourceview_b_cb); + } // Fl_Button* o + { Fl_Box* o = new Fl_Box(265, 460, 190, 20); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + sourceview_panel->size_range(384, 120); + sourceview_panel->end(); + } // Fl_Double_Window* sourceview_panel + return sourceview_panel; +} + +// +// End of "$Id: function_panel.cxx 6817 2009-07-02 09:42:17Z AlbrechtS $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/function_panel.fl b/third_party/windows/fltk-1.1.10/fluid/function_panel.fl new file mode 100644 index 0000000..c9483f3 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/function_panel.fl @@ -0,0 +1,819 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0108 +header_name {.h} +code_name {.cxx} +comment {// +// "$Id: function_panel.fl 6012 2008-01-04 21:45:49Z matt $" +// +// Code dialogs for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 +// +} {in_source in_header +} + +decl {\#include } {} + +decl {\#include "Fl_Type.h"} {} + +decl {\#include "undo.h"} {} + +decl {extern class Fl_Pixmap *pixmap[];} {} + +decl {extern class Fl_Type *Fl_Type_make(const char*);} {} + +decl {extern void select_only(Fl_Type*);} {} + +Function {make_function_panel()} {} { + Fl_Window function_panel { + label {Function/Method Properties} open + xywh {412 442 290 150} type Double resizable + code0 {o->size_range(o->w(), o->h(), Fl::w(), o->h());} modal visible + } { + Fl_Group {} {open + xywh {10 10 270 20} + } { + Fl_Choice f_public_member_choice { + tooltip {Change member access attribute.} xywh {10 10 75 20} down_box BORDER_BOX labelsize 11 when 1 textsize 11 + } { + MenuItem {} { + label private + user_data 0 user_data_type long + xywh {5 5 100 20} labelsize 11 + } + MenuItem {} { + label public + user_data 1 user_data_type long + xywh {5 5 100 20} labelsize 11 + } + MenuItem {} { + label protected + user_data 2 user_data_type long + xywh {5 5 100 20} labelsize 11 + } + } + Fl_Choice f_public_choice { + tooltip {Change widget accessibility.} xywh {10 10 75 20} down_box BORDER_BOX labelsize 11 when 1 textsize 11 + } { + MenuItem {} { + label local + user_data 0 user_data_type long + xywh {15 15 100 20} labelsize 11 + } + MenuItem {} { + label global + user_data 1 user_data_type long + xywh {15 15 100 20} labelsize 11 + } + } + Fl_Light_Button f_c_button { + label {C declaration} + tooltip {Declare with a C interface instead of C++.} xywh {95 10 80 20} labelsize 11 + } + Fl_Box {} { + xywh {235 10 45 20} resizable + } + } + Fl_Input f_name_input { + label {Name(args): (blank for main())} + tooltip {The name of the function or method.} xywh {10 50 270 20} labelfont 1 labelsize 11 align 5 when 0 textfont 4 textsize 11 resizable + } + Fl_Input f_return_type_input { + label {Return Type: (blank to return outermost widget)} + tooltip {The return type of the function or method.} xywh {10 90 270 20} labelfont 1 labelsize 11 align 5 when 0 textfont 4 textsize 11 + } + Fl_Group {} { + xywh {10 120 270 20} + } { + Fl_Return_Button f_panel_ok { + label OK + tooltip {Apply the changes.} xywh {170 120 50 20} labelsize 11 hotspot + } + Fl_Button f_panel_cancel { + label Cancel + tooltip {Cancel the changes.} xywh {230 120 50 20} shortcut 0xff1b labelsize 11 + } + Fl_Box {} { + xywh {10 120 150 20} resizable + } + } + } +} + +Function {make_code_panel()} {} { + Fl_Window code_panel { + label {Code Properties} + xywh {353 262 540 180} type Double labelsize 11 resizable + code0 {o->size_range(200, 150);} modal visible + } { + Fl_Text_Editor code_input { + xywh {10 10 520 130} box DOWN_BOX labelsize 11 textfont 4 textsize 11 resizable + code0 {o->when(FL_WHEN_ENTER_KEY_CHANGED|FL_WHEN_RELEASE);} + code1 {\#include "CodeEditor.h"} + class CodeEditor + } + Fl_Group {} {open + xywh {10 150 520 20} labelsize 11 + } { + Fl_Return_Button code_panel_ok { + label OK + xywh {400 150 60 20} labelsize 11 hotspot + } + Fl_Button code_panel_cancel { + label Cancel + xywh {470 150 60 20} shortcut 0xff1b labelsize 11 + } + Fl_Box {} { + xywh {10 150 380 20} labelsize 11 resizable + } + } + } +} + +Function {make_codeblock_panel()} {} { + Fl_Window codeblock_panel { + label {Code Block Properties} + xywh {468 221 300 115} type Double labelsize 11 resizable + code0 {o->size_range(o->w(), o->h(), Fl::w(), o->h());} modal visible + } { + Fl_Input code_before_input { + label {Conditional code block} + tooltip {\#ifdef or similar conditional code block.} xywh {10 15 280 20} labelsize 11 align 5 when 0 textfont 4 textsize 11 + } + Fl_Input code_after_input { + label {"{...child code...}" is inserted here} + tooltip {\#endif or similar conditional code block.} xywh {10 55 280 20} labelsize 11 align 5 when 0 textfont 4 textsize 11 resizable + } + Fl_Group {} {open + xywh {10 85 280 20} + } { + Fl_Return_Button codeblock_panel_ok { + label OK + xywh {160 85 60 20} labelsize 11 hotspot + } + Fl_Button codeblock_panel_cancel { + label Cancel + xywh {230 85 60 20} shortcut 0xff1b labelsize 11 + } + Fl_Box {} { + xywh {10 85 140 20} resizable + } + } + } +} + +Function {make_declblock_panel()} {} { + Fl_Window declblock_panel { + label {Declaration Block Properties} open + xywh {428 215 300 135} type Double labelsize 11 resizable + code0 {o->size_range(o->w(), o->h(), Fl::w(), o->h());} modal visible + } { + Fl_Group {} {open + xywh {10 10 280 20} + } { + Fl_Choice declblock_public_choice {open + tooltip {Change widget accessibility.} xywh {10 10 140 20} down_box BORDER_BOX labelsize 11 when 0 textsize 11 + } { + MenuItem {} { + label {in source code only} + user_data 0 user_data_type long + xywh {25 25 100 20} labelsize 11 + } + MenuItem {} { + label {in header and source} + user_data 1 user_data_type long + xywh {25 25 100 20} labelsize 11 + } + } + Fl_Light_Button declblock_public_button_x { + label public + tooltip {Make the declaration publicly accessible.} xywh {10 10 60 20} labelsize 11 when 0 hide + } + Fl_Box {} { + xywh {155 10 135 20} resizable + } + } + Fl_Input decl_before_input { + tooltip {\#ifdef or similar conditional declaration block.} xywh {10 40 280 20} labelsize 11 align 5 when 0 textfont 4 textsize 11 resizable + } + Fl_Input decl_after_input { + label {"\\n...child code...\\n" is inserted here} + tooltip {\#endif or similar declaration code block.} xywh {10 75 280 20} labelsize 11 align 5 when 0 textfont 4 textsize 11 + } + Fl_Group {} { + xywh {10 105 280 20} + } { + Fl_Return_Button declblock_panel_ok { + label OK + xywh {160 105 60 20} labelsize 11 hotspot + } + Fl_Button declblock_panel_cancel { + label Cancel + xywh {230 105 60 20} shortcut 0xff1b labelsize 11 + } + Fl_Box {} { + xywh {10 105 140 20} resizable + } + } + } +} + +Function {make_decl_panel()} {selected +} { + Fl_Window decl_panel { + label {Declaration Properties} open + xywh {501 185 290 150} type Double align 80 resizable + code0 {o->size_range(o->w(), o->h(), Fl::w(), o->h());} visible + } { + Fl_Group {} {open + xywh {10 10 270 20} + } { + Fl_Box {} { + xywh {200 10 80 20} resizable + } + Fl_Choice decl_choice { + xywh {10 10 185 20} down_box BORDER_BOX labelsize 11 textsize 11 + } { + MenuItem {} { + label {in source file only} + xywh {0 0 100 20} labelsize 11 + } + MenuItem {} { + label {in header file only} + xywh {0 0 100 20} labelsize 11 + } + MenuItem {} { + label {"static" in source file} + xywh {0 0 100 20} labelsize 11 + } + MenuItem {} { + label {in source and "extern" in header} + xywh {0 0 100 20} labelsize 11 + } + } + Fl_Choice decl_class_choice { + xywh {10 10 75 20} down_box BORDER_BOX labelsize 11 textsize 11 + } { + MenuItem {} { + label private + xywh {10 10 100 20} labelsize 11 + } + MenuItem {} { + label public + xywh {10 10 100 20} labelsize 11 + } + MenuItem {} { + label protected + xywh {10 10 100 20} labelsize 11 + } + } + } + Fl_Input decl_input { + label {Can be any declaration, like "int x;", an external symbol like "extern int foo();", a \#directive like "\#include ", a comment like "//foo" or "/*foo*/", or typedef like "typedef char byte;" or "using std::list;".} + tooltip {Declaration text.} xywh {10 40 270 20} labelsize 11 align 134 when 0 textfont 4 textsize 11 resizable + } + Fl_Group {} {open + xywh {10 120 270 20} + } { + Fl_Return_Button decl_panel_ok { + label OK + xywh {150 120 60 20} labelsize 11 hotspot + } + Fl_Button decl_panel_cancel { + label Cancel + xywh {220 120 60 20} shortcut 0xff1b labelsize 11 + } + Fl_Box {} { + xywh {10 120 130 20} resizable + } + } + } +} + +Function {make_class_panel()} {} { + Fl_Window class_panel { + label {Class Properties} open + xywh {449 218 300 115} type Double labelsize 11 resizable + code0 {o->size_range(o->w(), o->h(), Fl::w(), o->h());} modal visible + } { + Fl_Group {} {open + xywh {10 10 280 20} hide + } { + Fl_Light_Button c_public_button { + label public + tooltip {Make the class publicly accessible.} xywh {10 10 60 20} labelsize 11 when 0 hide + } + Fl_Box {} { + xywh {80 10 210 20} resizable + } + } + Fl_Input c_name_input { + label {Name:} + tooltip {Name of class.} xywh {10 20 280 20} labelfont 1 labelsize 11 align 5 when 0 textfont 4 textsize 11 resizable + } + Fl_Input c_subclass_input { + label {Subclass of (text between : and \{)} + tooltip {Name of subclass.} xywh {10 55 280 20} labelfont 1 labelsize 11 align 5 when 0 textfont 4 textsize 11 + } + Fl_Group {} {open + xywh {10 85 280 20} + } { + Fl_Return_Button c_panel_ok { + label OK + xywh {160 85 60 20} labelsize 11 hotspot + } + Fl_Button c_panel_cancel { + label Cancel + xywh {230 85 60 20} shortcut 0xff1b labelsize 11 + } + Fl_Box {} { + xywh {10 85 140 20} resizable + } + } + } +} + +Function {make_comment_panel()} {} { + Fl_Window comment_panel { + label {Comment Properties} + xywh {422 190 550 280} type Double labelsize 11 resizable + code0 {o->size_range(320, 180);} modal visible + } { + Fl_Text_Editor comment_input { + xywh {110 10 430 230} box DOWN_BOX labelsize 11 textfont 4 textsize 11 resizable + code0 {o->when(FL_WHEN_ENTER_KEY_CHANGED|FL_WHEN_RELEASE);} + class CodeEditor + } + Fl_Group {} {open + xywh {110 250 430 20} labelsize 11 + } { + Fl_Return_Button comment_panel_ok { + label OK + xywh {370 250 80 20} labelsize 11 hotspot + } + Fl_Button comment_panel_cancel { + label Cancel + xywh {460 250 80 20} shortcut 0xff1b labelsize 11 + } + Fl_Box {} { + xywh {110 250 250 20} labelsize 11 resizable + } + } + Fl_Group {} {open + xywh {10 10 90 243} labelsize 11 + } { + Fl_Light_Button comment_in_source { + label {In Source} + tooltip {Put the comment into the source (.cxx) file.} xywh {10 10 90 20} labelsize 11 when 0 + } + Fl_Light_Button comment_in_header { + label {In Header} + tooltip {Put the comment into the header (.h) file.} xywh {10 40 90 20} labelsize 11 when 0 + } + Fl_Menu_Button comment_predefined { + label Predefined open + xywh {10 70 90 20} labelsize 11 textsize 11 + } {} + Fl_Button comment_load { + label {Import...} + xywh {10 100 90 20} labelsize 11 + } + Fl_Box {} { + xywh {10 132 90 121} labelsize 11 resizable + } + } + } +} + +Function {type_make_cb(Fl_Widget*,void*d)} {return_type void +} { + code {undo_checkpoint(); + Fl_Type *t = Fl_Type_make((char*)d); + if (t) { + select_only(t); + set_modflag(1); + t->open(); + } else { + undo_current --; + undo_last --; + }} {} +} + +Function {make_widgetbin()} {} { + Fl_Window widgetbin_panel { + label {Widget Bin} + xywh {411 171 550 85} type Single align 80 non_modal visible + } { + Fl_Group {} { + xywh {3 3 79 79} + } { + Fl_Button {} { + user_data {"Function"} + callback type_make_cb + tooltip Function xywh {5 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[7]);} + } + Fl_Button {} { + user_data {"Class"} + callback type_make_cb + tooltip Class xywh {30 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[12]);} + } + Fl_Button {} { + user_data {"comment"} + callback type_make_cb + tooltip Comment xywh {55 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[46]);} + } + Fl_Button {} { + user_data {"Code"} + callback type_make_cb + tooltip Code xywh {5 30 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[8]);} + } + Fl_Button {} { + user_data {"CodeBlock"} + callback type_make_cb + tooltip {Code Block} xywh {30 30 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[9]);} + } + Fl_Button {} { + user_data {"widget_class"} + callback type_make_cb + tooltip {Widget Class} xywh {55 30 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[48]);} + } + Fl_Button {} { + user_data {"decl"} + callback type_make_cb + tooltip Declaration xywh {5 55 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[10]);} + } + Fl_Button {} { + user_data {"declblock"} + callback type_make_cb + tooltip {Declaration Block} xywh {30 55 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[11]);} + } + } + Fl_Group {} { + xywh {87 3 79 79} + } { + Fl_Button {} { + user_data {"Fl_Window"} + callback type_make_cb + tooltip Window xywh {89 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[1]);} + } + Fl_Button {} { + user_data {"Fl_Group"} + callback type_make_cb + tooltip Group xywh {114 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[6]);} + } + Fl_Button {} { + user_data {"Fl_Pack"} + callback type_make_cb + tooltip Pack xywh {139 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[22]);} + } + Fl_Button {} { + user_data {"Fl_Tabs"} + callback type_make_cb + tooltip Tabs xywh {89 30 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[13]);} + } + Fl_Button {} { + user_data {"Fl_Scroll"} + callback type_make_cb + tooltip Scroll xywh {114 30 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[19]);} + } + Fl_Button {} { + user_data {"Fl_Tile"} + callback type_make_cb + tooltip Tile xywh {89 55 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[20]);} + } + Fl_Button {} { + user_data {"Fl_Wizard"} + callback type_make_cb + tooltip Wizard xywh {114 55 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[21]);} + } + } + Fl_Group {} { + xywh {171 3 54 79} + } { + Fl_Button {} { + user_data {"Fl_Button"} + callback type_make_cb + tooltip Button xywh {173 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[2]);} + } + Fl_Button {} { + user_data {"Fl_Return_Button"} + callback type_make_cb + tooltip {Return Button} xywh {198 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[23]);} + } + Fl_Button {} { + user_data {"Fl_Light_Button"} + callback type_make_cb + tooltip {Light Button} xywh {173 30 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[24]);} + } + Fl_Button {} { + user_data {"Fl_Repeat_Button"} + callback type_make_cb + tooltip {Repeat Button} xywh {198 30 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[25]);} + } + Fl_Button {} { + user_data {"Fl_Check_Button"} + callback type_make_cb + tooltip {Check Button} xywh {173 55 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[3]);} + } + Fl_Button {} { + user_data {"Fl_Round_Button"} + callback type_make_cb + tooltip {Round Button} xywh {198 55 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[4]);} + } + } + Fl_Group {} { + xywh {230 3 104 79} + } { + Fl_Button {} { + user_data {"Fl_Slider"} + callback type_make_cb + tooltip Slider xywh {232 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[37]);} + } + Fl_Button {} { + user_data {"Fl_Scrollbar"} + callback type_make_cb + tooltip {Scroll Bar} xywh {257 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[38]);} + } + Fl_Button {} { + user_data {"Fl_Value_Slider"} + callback type_make_cb + tooltip {Value Slider} xywh {282 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[39]);} + } + Fl_Button {} { + user_data {"Fl_Value_Output"} + callback type_make_cb + tooltip {Value Output} xywh {307 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[45]);} + } + Fl_Button {} { + user_data {"Fl_Adjuster"} + callback type_make_cb + tooltip Adjuster xywh {232 30 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[40]);} + } + Fl_Button {} { + user_data {"Fl_Counter"} + callback type_make_cb + tooltip Counter xywh {257 30 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[41]);} + } + Fl_Button {} { + user_data {"Fl_Dial"} + callback type_make_cb + tooltip Dial xywh {282 30 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[42]);} + } + Fl_Button {} { + user_data {"Fl_Roller"} + callback type_make_cb + tooltip Roller xywh {232 55 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[43]);} + } + Fl_Button {} { + user_data {"Fl_Spinner"} + callback type_make_cb + tooltip Spinner xywh {257 55 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[47]);} + } + Fl_Button {} { + user_data {"Fl_Value_Input"} + callback type_make_cb + tooltip {Value Input} xywh {282 55 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[44]);} + } + } + Fl_Group {} { + xywh {339 3 54 79} + } { + Fl_Button {} { + user_data {"Fl_Input"} + callback type_make_cb + tooltip Input xywh {341 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[14]);} + } + Fl_Button {} { + user_data {"Fl_Output"} + callback type_make_cb + tooltip Output xywh {366 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[27]);} + } + Fl_Button {} { + user_data {"Fl_Text_Editor"} + callback type_make_cb + tooltip {Text Edit} xywh {341 30 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[29]);} + } + Fl_Button {} { + user_data {"Fl_Text_Display"} + callback type_make_cb + tooltip {Text Display} xywh {366 30 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[28]);} + } + Fl_Button {} { + user_data {"Fl_File_Input"} + callback type_make_cb + tooltip {File Input} xywh {341 55 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[30]);} + } + } + Fl_Group {} { + xywh {398 3 54 79} + } { + Fl_Button {} { + user_data {"Fl_Menu_Bar"} + callback type_make_cb + tooltip {Menu Bar} xywh {400 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[17]);} + } + Fl_Button {} { + user_data {"Fl_Input_Choice"} + callback type_make_cb + tooltip {Input Choice} xywh {425 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[15]);} + } + Fl_Button {} { + user_data {"Fl_Menu_Button"} + callback type_make_cb + tooltip {Menu Button} xywh {400 30 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[26]);} + } + Fl_Button {} { + user_data {"menuitem"} + callback type_make_cb + tooltip {Menu Item} xywh {425 30 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[16]);} + } + Fl_Button {} { + user_data {"Fl_Choice"} + callback type_make_cb + tooltip Choice xywh {400 55 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[15]);} + } + Fl_Button {} { + user_data {"submenu"} + callback type_make_cb + tooltip {Sub Menu} xywh {425 55 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[18]);} + } + } + Fl_Group {} { + xywh {457 3 29 79} + } { + Fl_Button {} { + user_data {"Fl_Browser"} + callback type_make_cb + tooltip Browser xywh {459 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[31]);} + } + Fl_Button {} { + user_data {"Fl_Check_Browser"} + callback type_make_cb + tooltip {Check Browser} xywh {459 30 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[32]);} + } + Fl_Button {} { + user_data {"Fl_File_Browser"} + callback type_make_cb + tooltip {File Browser} xywh {459 55 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[33]);} + } + } + Fl_Group {} { + xywh {491 3 55 79} + } { + Fl_Button {} { + user_data {"Fl_Box"} + callback type_make_cb + tooltip Box xywh {493 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[5]);} + } + Fl_Button {} { + user_data {"Fl_Clock"} + callback type_make_cb + tooltip Clock xywh {518 5 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[34]);} + } + Fl_Button {} { + user_data {"Fl_Help_View"} + callback type_make_cb + tooltip {Help Browser} xywh {493 30 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[35]);} + } + Fl_Button {} { + user_data {"Fl_Progress"} + callback type_make_cb + tooltip Progress xywh {493 55 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[36]);} + } + } + } +} + +Function {make_sourceview()} {} { + Fl_Window sourceview_panel { + label {Code View} + callback toggle_sourceview_cb + xywh {430 273 520 490} type Double align 80 resizable size_range {384 120 0 0} visible + } { + Fl_Tabs sv_tab { + callback update_sourceview_position_cb + xywh {10 10 500 440} selection_color 4 labelcolor 7 resizable + } { + Fl_Group {} { + label Source open + xywh {10 35 500 415} labelsize 13 hide resizable + } { + Fl_Text_Editor sv_source { + xywh {20 50 480 390} textfont 4 textsize 11 resizable + code0 {\#include "CodeEditor.h"} + class CodeViewer + } + } + Fl_Group {} { + label Header open + xywh {10 35 500 415} labelsize 13 + } { + Fl_Text_Editor sv_header { + xywh {20 50 480 390} textfont 4 textsize 11 resizable + code0 {\#include "CodeEditor.h"} + class CodeViewer + } + } + } + Fl_Group {} { + xywh {10 460 500 20} + } { + Fl_Button {} { + label Refresh + callback update_sourceview_cb + xywh {10 460 61 20} labelsize 11 + } + Fl_Light_Button sv_autorefresh { + label {Auto-Refresh} + xywh {76 460 91 20} labelsize 11 + code0 {o->callback((Fl_Callback*)update_sourceview_cb);} + } + Fl_Light_Button sv_autoposition { + label {Auto-Position} + xywh {172 460 89 20} labelsize 11 + } + Fl_Button {} { + label Close + callback toggle_sourceview_b_cb + xywh {460 460 50 20} labelsize 11 + } + Fl_Box {} { + xywh {265 460 190 20} resizable + } + } + } +} + +comment { +// +// End of "$Id: function_panel.fl 6012 2008-01-04 21:45:49Z matt $". +//} {in_source in_header +} diff --git a/third_party/windows/fltk-1.1.10/fluid/function_panel.h b/third_party/windows/fltk-1.1.10/fluid/function_panel.h new file mode 100644 index 0000000..f53ae5d --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/function_panel.h @@ -0,0 +1,119 @@ +// +// "$Id: function_panel.h 6817 2009-07-02 09:42:17Z AlbrechtS $" +// +// Code dialogs for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 +// + +// generated by Fast Light User Interface Designer (fluid) version 1.0110 + +#ifndef function_panel_h +#define function_panel_h +#include +#include +extern Fl_Double_Window *function_panel; +#include +#include +extern Fl_Choice *f_public_member_choice; +extern Fl_Choice *f_public_choice; +#include +extern Fl_Light_Button *f_c_button; +#include +#include +extern Fl_Input *f_name_input; +extern Fl_Input *f_return_type_input; +#include +extern Fl_Return_Button *f_panel_ok; +#include +extern Fl_Button *f_panel_cancel; +Fl_Double_Window* make_function_panel(); +extern Fl_Menu_Item menu_f_public_member_choice[]; +extern Fl_Menu_Item menu_f_public_choice[]; +extern Fl_Double_Window *code_panel; +#include "CodeEditor.h" +extern CodeEditor *code_input; +extern Fl_Return_Button *code_panel_ok; +extern Fl_Button *code_panel_cancel; +Fl_Double_Window* make_code_panel(); +extern Fl_Double_Window *codeblock_panel; +extern Fl_Input *code_before_input; +extern Fl_Input *code_after_input; +extern Fl_Return_Button *codeblock_panel_ok; +extern Fl_Button *codeblock_panel_cancel; +Fl_Double_Window* make_codeblock_panel(); +extern Fl_Double_Window *declblock_panel; +extern Fl_Choice *declblock_public_choice; +extern Fl_Light_Button *declblock_public_button_x; +extern Fl_Input *decl_before_input; +extern Fl_Input *decl_after_input; +extern Fl_Return_Button *declblock_panel_ok; +extern Fl_Button *declblock_panel_cancel; +Fl_Double_Window* make_declblock_panel(); +extern Fl_Menu_Item menu_declblock_public_choice[]; +extern Fl_Double_Window *decl_panel; +extern Fl_Choice *decl_choice; +extern Fl_Choice *decl_class_choice; +extern Fl_Input *decl_input; +extern Fl_Return_Button *decl_panel_ok; +extern Fl_Button *decl_panel_cancel; +Fl_Double_Window* make_decl_panel(); +extern Fl_Menu_Item menu_decl_choice[]; +extern Fl_Menu_Item menu_decl_class_choice[]; +extern Fl_Double_Window *class_panel; +extern Fl_Light_Button *c_public_button; +extern Fl_Input *c_name_input; +extern Fl_Input *c_subclass_input; +extern Fl_Return_Button *c_panel_ok; +extern Fl_Button *c_panel_cancel; +Fl_Double_Window* make_class_panel(); +extern Fl_Double_Window *comment_panel; +extern CodeEditor *comment_input; +extern Fl_Return_Button *comment_panel_ok; +extern Fl_Button *comment_panel_cancel; +extern Fl_Light_Button *comment_in_source; +extern Fl_Light_Button *comment_in_header; +#include +extern Fl_Menu_Button *comment_predefined; +extern Fl_Button *comment_load; +Fl_Double_Window* make_comment_panel(); +void type_make_cb(Fl_Widget*,void*d); +#include +extern Fl_Window *widgetbin_panel; +Fl_Window* make_widgetbin(); +extern void toggle_sourceview_cb(Fl_Double_Window*, void*); +extern Fl_Double_Window *sourceview_panel; +#include +extern void update_sourceview_position_cb(Fl_Tabs*, void*); +extern Fl_Tabs *sv_tab; +extern CodeViewer *sv_source; +extern CodeViewer *sv_header; +extern void update_sourceview_cb(Fl_Button*, void*); +extern Fl_Light_Button *sv_autorefresh; +extern Fl_Light_Button *sv_autoposition; +extern void toggle_sourceview_b_cb(Fl_Button*, void*); +Fl_Double_Window* make_sourceview(); +#endif + +// +// End of "$Id: function_panel.h 6817 2009-07-02 09:42:17Z AlbrechtS $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/icons/fluid-128.png b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-128.png new file mode 100644 index 0000000..cf9cf40 Binary files /dev/null and b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-128.png differ diff --git a/third_party/windows/fltk-1.1.10/fluid/icons/fluid-16.png b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-16.png new file mode 100644 index 0000000..5a50222 Binary files /dev/null and b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-16.png differ diff --git a/third_party/windows/fltk-1.1.10/fluid/icons/fluid-16i.png b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-16i.png new file mode 100644 index 0000000..10e0dfa Binary files /dev/null and b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-16i.png differ diff --git a/third_party/windows/fltk-1.1.10/fluid/icons/fluid-256.png b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-256.png new file mode 100644 index 0000000..33681a7 Binary files /dev/null and b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-256.png differ diff --git a/third_party/windows/fltk-1.1.10/fluid/icons/fluid-32.png b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-32.png new file mode 100644 index 0000000..38efb2e Binary files /dev/null and b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-32.png differ diff --git a/third_party/windows/fltk-1.1.10/fluid/icons/fluid-32.xpm b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-32.xpm new file mode 100644 index 0000000..0a18a1c --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-32.xpm @@ -0,0 +1,67 @@ +/* XPM */ +static char * fluid_32_xpm[] = { +"32 32 32 1", +" c None", +". c #000200", +"+ c #01162D", +"@ c #01356A", +"# c #2F312E", +"$ c #035FB1", +"% c #0061C0", +"& c #0071E1", +"* c #007FFF", +"= c #247ABD", +"- c #626E6F", +"; c #777976", +"> c #2A90E9", +", c #3291D2", +"' c #2690FC", +") c #449EAD", +"! c #5A9D87", +"~ c #70AD78", +"{ c #7EA3C4", +"] c #87B556", +"^ c #6EB8FF", +"/ c #A8ABA9", +"( c #A2C443", +"_ c #8BC3F9", +": c #BED831", +"< c #CDDF1B", +"[ c #CACDCB", +"} c #ACD7FF", +"| c #ECF408", +"1 c #E5E7E4", +"2 c #DDEDFD", +"3 c #FCFFFC", +" ", +" ....... ", +" .-//[//. ", +" ./^^333. ", +" .{''231. ", +" .[^^331. ", +" .[33331. ", +" .[33331. ", +" .[33^'_. ", +" .[33^',. ", +" .[332}2. ", +" .133331. ", +" .133331. ", +" .-333333;. ", +" .#1332_333#. ", +" .[333''^333. ", +" ./3333>'}333/. ", +" .-333333232_}3;. ", +" .#132}23333_'>33#. ", +" .[33^'^33332>^331. ", +" .$'''*'*''''''''''$. ", +" .@*')>{******,***>)&@. ", +" .+&':~(:&*****:)**)|&*+. ", +" .%*!:&~(&,'>'*>**,~(**&. ", +" .$*':]>:!!|&|=~<&]~:!(]!:%*****+. ", +" .&***):&!:=<]((&|!~:]<=*****&. ", +".$&**)~!**&**&&&*&&*&*&*******$.", +".%***]~%*****************'****%.", +".@%%%%%%%%%%%%%%%%%%%%%$%%%$%%@.", +" .............................. "}; diff --git a/third_party/windows/fltk-1.1.10/fluid/icons/fluid-32i.png b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-32i.png new file mode 100644 index 0000000..d7581d8 Binary files /dev/null and b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-32i.png differ diff --git a/third_party/windows/fltk-1.1.10/fluid/icons/fluid-48.png b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-48.png new file mode 100644 index 0000000..0aab52c Binary files /dev/null and b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-48.png differ diff --git a/third_party/windows/fltk-1.1.10/fluid/icons/fluid-64.png b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-64.png new file mode 100644 index 0000000..9157cca Binary files /dev/null and b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-64.png differ diff --git a/third_party/windows/fltk-1.1.10/fluid/icons/fluid-96.xpm b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-96.xpm new file mode 100644 index 0000000..6eb06cb --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/icons/fluid-96.xpm @@ -0,0 +1,131 @@ +/* XPM */ +static char * fluid_96_xpm[] = { +"96 96 32 1", +" c None", +". c #000100", +"+ c #031F3F", +"@ c #00366C", +"# c #2E302D", +"$ c #0058AC", +"% c #0060BF", +"& c #4E504D", +"* c #14659F", +"= c #006DDC", +"- c #2C7087", +"; c #0080FF", +"> c #407B74", +", c #0F85F9", +"' c #268CCD", +") c #7C7E7B", +"! c #2D92EC", +"~ c #4498A9", +"{ c #2F94FE", +"] c #5BA18C", +"^ c #6BA674", +"/ c #7DAD62", +"( c #93BD53", +"_ c #A4A6A2", +": c #6CB6FF", +"< c #ABCC3F", +"[ c #C4DA2A", +"} c #CACCC9", +"| c #DCE913", +"1 c #BBDEFF", +"2 c #FDFE00", +"3 c #FDFFFC", +" ", +" ", +" ", +" ........... ", +" ...................... ", +" ........................ ", +" ........#&#&#&#&##...... ", +" ....)__}33333333333}_... ", +" ...&33333333333333333... ", +" ...#33311133333333333... ", +" ...&33!,{,;:333333333... ", +" ...&3:,{{{{,13333333}... ", +" ...&3!{{!{{,13333333}... ", +" ...&3:!{{!{;13333333}... ", +" ...&3{{{{{{;133333333... ", +" ...&31,{{{;,33333333}... ", +" ...&331{{{:133333333}... ", +" ...&3333333333333333_... ", +" ...&3333333333333333}... ", +" ...&3333333333333333_... ", +" ...&3333333333333333}... ", +" ...&3333333333333333_... ", +" ...&3333333333333333}... ", +" ...&3333333333333333_... ", +" ...&3333333331!,,;:3}... ", +" ...&333333333{{{{{;:_... ", +" ...&333333331,{!{!{{}... ", +" ...&333333331{{{{{{,_... ", +" ...)333333331{{!{{{{_... ", +" ...)333333333{{{!{;:_... ", +" ...)3333333331{;;;:3_... ", +" ...)3333333333331333_... ", +" ...)3333333333333333_... ", +" ...)3333333333333333_... ", +" ..._3333333333333333_... ", +" ..._3333333333333333_... ", +" ..._3333333333333333_... ", +" ..._3333333333333333}.... ", +" ...._33333333333333333#... ", +" ....&333333333333333333_.... ", +" ....&33333333333333333333).... ", +" ....333333333333333333333}&.... ", +" ...._33333333333333333333333.... ", +" ....&333333333331:11333333333_.... ", +" ....#33333333333:,,,;:333333333&.... ", +" ....}3333333333:,!{{{;1333333333&.... ", +" ....}33333333333{{{!{{,!3333333333.... ", +" ....)333333333333{{{{!{{{3333333333_.... ", +" ....#3333333333333!{{{{{,:33333333333&.... ", +" ...._33333333333331{{!{,;1333333333333#.... ", +" ...._333333333333333:;,;,13333333333333_.... ", +" ...._333333333333333333113333333333333333_.... ", +" ....&33333333333333333333333333331::1333333&.... ", +" ...._333333333333333333333333333{,{{;{133333#... ", +" ...._3333333333333333333333333331,{!{{,:33333}.... ", +" ....&3333333333133333333333333333:{{{{{{:333333).... ", +" ...#333333331{,,;:333333333333333:{!{!{{:3333333&.... ", +" ....}33333333,{{{{;:333333333333331,{!{{;:33333333#... ", +" ...._333333331,!{!{{,333333333333333{,{{;{1333333333.... ", +" ....&3333333331{{{{{{{3333333333333333::::33333333333).... ", +" ....+!:::::::::{{{{!{{;::::::::::::::::::::::::::!:::::+.... ", +" ...+=;;;;;;;;;;;;{{{{;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;=.... ", +" ....%;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;%.... ", +" ....@;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;$.... ", +" ...+%;;;;;;!!!;;;;;,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;!=;;;+.... ", +" ....%;;;;;!([<|^~]^([%;;;;;;;;;;;;;;;;;,(<'=;;;;;;;!^/<[|'=;;=+... ", +" ....$;;;;;'|2>]22<|22[%=;;;;;;;;;;;;;;;;^22[%=;;;;;;!][22|%=;;;$.... ", +" ....@;;;;;;[2[%^2|*[22(%=;;;;;;;;;;;;;;;,/22|$=;;;;;;;;<22<%=;;;;$.... ", +" ....+=;;;;;~22^$%]~$|22>%=;;;;;;;;;;;;;;;;'||^%=;;;;;;;,[22^$=;;;;;+.... ", +" ....%;;;;;,[22-%==='22|*==;;;;;;;;;;;;;;;;;;=%=;;;;;;;;'22|*%=;;;;;=+... ", +" ....$;;;;;;!22|$%;,;^22<$=;;;;;;;;;;;;;;;;;;===;;;;;;;;;^22|$==;;;;;;%.... ", +" ....@;;;;;'](22[^]=;;<22^$==!~]/~=;!]]~;;;;{'~]==;;;;~<<]<22($=;;;;;;;;@.... ", +" ....@;;;;;;]<|22|[<%;!|22-%'[2222*=;/22(%;~|222(=;;;!<2|^[222>$=;;;;;;;;;+.... ", +" ....=;;;;;;;,[22>$===~22|$==,[22[%=;[22]%=,!|22]%=;![2|*%]22|*==;;;;;;;;;%+... ", +" ....@;;;;;;;;!|22*$=;;/22($=;,[22/$='222*%=;!|22-%;;<22>%=]22[$%;;;;;;;;;;;=.... ", +" ....@;;;;;;;;;~22[*==;;[22>%=;'22|-%,^22[$=;,~22[$%;]22<$%=(22/$=;;;;;;;;;;;;@.... ", +" ....+;;;;;;;;;;^22<$=;;!222*$=;]22[$==[22/$=;;(22/$=![22]$=;|22-%=;;;;;;;;;;;;;+... ", +" ....;;;;;;;;;;;<22^%=;;]22[$=;;(22/$=~222-%=;;[22>%=]22|$%;~22|$==;;;;;;;;;;;;;;.... ", +" ....%;;;;;;;;;;;|22-%=;;(22/$=;{|22-%=<22|$%;;'22|*%;<22<$==(22<$=;=;;;;;;;;;;;;;$.... ", +" ....+;;;;;;;;;;;!222$==;,|22>%=;~22|$=]|22($=;;]22[$%,|22^%=!|22^$=;;;;;;;;;;;;;;;;@.... ", +" ....+=;;;;;;;;;;;~22[$%;;'22|*-/;]22($*[<22^$^=;(22/$(-222>$=(222->~;;;;;;;;;;;;;;;;=+.... ", +" ...+;;;;;;;;;;;;;(22/$=;;]22|*<'=(22/*[~[22>(]=;|22>//=|22/$^(|2|-[%=;;;;;;;;;;;;;;;;=.... ", +" ....$;;;;;;;;;;;;;<22>%=;;]222|>==(222|^=|22|<%=;|222<%=(222|<-222|-==;;;;;;;;;;;;;;;;;$.... ", +" ....@;;;;;;;;;;;;;!|2|$=;;;'[2[>%=;'|2[]%=/2|/$==;^2|(*%=!(2|($%<2[-%=;;;;;;;;;;;;;;;;;;;@.... ", +"....@;;;;;;;;;;;;;;'22($%;;;;=%%==;;;=%%%==;=%%==;;;=%===;;==%%====%%=,;;;;;;;;;;;;;;;;;;;;+... ", +"...+=;;;;;;;;;;!'=,]22-%=;;;;;;==;=;;;===;=;;===;;;;;===;;;;=;=,;;,=;=;;;;;;;;;;;;;;;;;;;;;=....", +"...+;;;;;;;;;;;[2^=<2<$==;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+...", +"...+;;;;;;;;;;;22('2|*%=;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+...", +"...+;;;;;;;;;;;^|<[[-%=;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+...", +"...+;;;;;;;;;;;;*~*%===;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;@...", +"...+;;;;;;;;;;;;;====;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+...", +"....$=;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;=$....", +" .....++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..... ", +" ............................................................................................. ", +" ............................................................................................ ", +" ...................................................................................... "}; diff --git a/third_party/windows/fltk-1.1.10/fluid/icons/fluid.ico b/third_party/windows/fltk-1.1.10/fluid/icons/fluid.ico new file mode 100644 index 0000000..aee6b18 Binary files /dev/null and b/third_party/windows/fltk-1.1.10/fluid/icons/fluid.ico differ diff --git a/third_party/windows/fltk-1.1.10/fluid/icons/fluid.xcf.gz b/third_party/windows/fltk-1.1.10/fluid/icons/fluid.xcf.gz new file mode 100644 index 0000000..189c0c9 Binary files /dev/null and b/third_party/windows/fltk-1.1.10/fluid/icons/fluid.xcf.gz differ diff --git a/third_party/windows/fltk-1.1.10/fluid/makedepend b/third_party/windows/fltk-1.1.10/fluid/makedepend new file mode 100644 index 0000000..94d312d --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/makedepend @@ -0,0 +1,294 @@ +# DO NOT DELETE THIS LINE -- make depend depends on it. +CodeEditor.o: CodeEditor.cxx CodeEditor.h ../FL/Fl.H ../FL/Enumerations.H \ + ../FL/Fl_Export.H ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Editor.H \ + ../FL/Fl_Text_Display.H ../FL/fl_draw.H ../FL/Fl_Group.H \ + ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H \ + ../FL/Fl_Valuator.H ../FL/Fl_Text_Buffer.H +Fl_Function_Type.o: Fl_Function_Type.cxx ../FL/Fl.H ../FL/Enumerations.H \ + ../FL/Fl_Export.H ../FL/Fl_Preferences.H ../FL/Fl_File_Chooser.H \ + ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H \ + ../FL/Fl_Widget.H ../FL/Fl_Group.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H \ + ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Menu_Button.H \ + ../FL/Fl_Button.H ../FL/Fl_Tile.H ../FL/Fl_File_Browser.H \ + ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H \ + ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_File_Icon.H ../FL/Fl.H \ + ../FL/filename.H ../FL/Fl_Box.H ../FL/Fl_Check_Button.H \ + ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_File_Input.H \ + ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Return_Button.H \ + ../FL/fl_ask.H Fl_Type.h ../FL/Fl_Widget.H ../FL/Fl_Menu.H \ + Fluid_Image.h ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Tabs.H \ + ../FL/Fl_Pack.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H \ + ../FL/Fl_Input_Choice.H ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H \ + ../FL/fl_show_input.H ../FL/fl_ask.H ../src/flstring.h \ + ../FL/Fl_Export.H ../config.h function_panel.h ../FL/Fl_Light_Button.H \ + CodeEditor.h ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Editor.H \ + ../FL/Fl_Text_Display.H ../FL/fl_draw.H ../FL/Fl_Text_Buffer.H \ + comments.h +Fl_Group_Type.o: Fl_Group_Type.cxx ../FL/Fl.H ../FL/Enumerations.H \ + ../FL/Fl_Export.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/fl_message.H \ + ../FL/fl_ask.H Fl_Widget_Type.h Fl_Type.h ../FL/Fl_Widget.H \ + ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H Fluid_Image.h \ + ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Tabs.H \ + ../FL/Fl_Group.H ../FL/Fl_Pack.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H \ + ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H ../FL/Fl_Choice.H \ + ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H ../FL/Fl_Input_.H \ + ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H ../src/flstring.h \ + ../FL/Fl_Export.H ../config.h ../FL/Fl_Scroll.H ../FL/Fl_Scrollbar.H \ + ../FL/Fl_Slider.H ../FL/Fl_Valuator.H +Fl_Menu_Type.o: Fl_Menu_Type.cxx ../FL/Fl.H ../FL/Enumerations.H \ + ../FL/Fl_Export.H Fl_Widget_Type.h Fl_Type.h ../FL/Fl_Widget.H \ + ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H ../FL/Fl_Image.H \ + Fluid_Image.h ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Tabs.H \ + ../FL/Fl_Group.H ../FL/Fl_Pack.H ../FL/Fl_Group.H ../FL/Fl_Wizard.H \ + ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H \ + ../FL/Fl_Choice.H ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H \ + ../FL/Fl_Input_.H ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H \ + alignment_panel.h ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Display.H \ + ../FL/fl_draw.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H \ + ../FL/Fl_Valuator.H ../FL/Fl_Text_Buffer.H ../FL/Fl_Double_Window.H \ + ../FL/Fl_Window.H ../FL/Fl_Preferences.H ../FL/Fl_Tooltip.H \ + ../FL/Fl_Button.H ../FL/Fl_Box.H ../FL/Fl_Light_Button.H \ + ../FL/Fl_Button.H ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H \ + ../FL/Fl_Spinner.H ../FL/Enumerations.H ../FL/Fl_Repeat_Button.H \ + ../FL/Fl.H ../FL/Fl_Return_Button.H ../FL/Fl_Round_Button.H \ + ../FL/fl_message.H ../FL/fl_ask.H ../src/flstring.h ../FL/Fl_Export.H \ + ../config.h ../FL/Fl_Output.H ../FL/Fl_Input.H Shortcut_Button.h +Fl_Type.o: Fl_Type.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \ + ../FL/Fl_Browser_.H ../FL/Fl_Group.H ../FL/Fl_Widget.H \ + ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H \ + ../FL/fl_draw.H ../src/flstring.h ../FL/Fl_Export.H ../config.h \ + Fl_Type.h ../FL/Fl_Widget.H ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H \ + ../FL/Fl_Image.H Fluid_Image.h ../FL/Fl_Shared_Image.H ../FL/Fl_Tabs.H \ + ../FL/Fl_Pack.H ../FL/Fl_Group.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H \ + ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H ../FL/Fl_Choice.H \ + ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H ../FL/Fl_Input_.H \ + ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H undo.h ../FL/Fl_Pixmap.H \ + pixmaps/lock.xpm pixmaps/flWindow.xpm pixmaps/flButton.xpm \ + pixmaps/flCheckButton.xpm pixmaps/flRoundButton.xpm pixmaps/flBox.xpm \ + pixmaps/flGroup.xpm pixmaps/flFunction.xpm pixmaps/flCode.xpm \ + pixmaps/flCodeBlock.xpm pixmaps/flComment.xpm pixmaps/flDeclaration.xpm \ + pixmaps/flDeclarationBlock.xpm pixmaps/flClass.xpm pixmaps/flTabs.xpm \ + pixmaps/flInput.xpm pixmaps/flChoice.xpm pixmaps/flMenuitem.xpm \ + pixmaps/flMenubar.xpm pixmaps/flSubmenu.xpm pixmaps/flScroll.xpm \ + pixmaps/flTile.xpm pixmaps/flWizard.xpm pixmaps/flPack.xpm \ + pixmaps/flReturnButton.xpm pixmaps/flLightButton.xpm \ + pixmaps/flRepeatButton.xpm pixmaps/flMenuButton.xpm \ + pixmaps/flOutput.xpm pixmaps/flTextDisplay.xpm pixmaps/flTextEdit.xpm \ + pixmaps/flFileInput.xpm pixmaps/flBrowser.xpm \ + pixmaps/flCheckBrowser.xpm pixmaps/flFileBrowser.xpm \ + pixmaps/flClock.xpm pixmaps/flHelp.xpm pixmaps/flProgress.xpm \ + pixmaps/flSlider.xpm pixmaps/flScrollBar.xpm pixmaps/flValueSlider.xpm \ + pixmaps/flAdjuster.xpm pixmaps/flCounter.xpm pixmaps/flDial.xpm \ + pixmaps/flRoller.xpm pixmaps/flValueInput.xpm pixmaps/flValueOutput.xpm \ + pixmaps/flSpinner.xpm pixmaps/flWidgetClass.xpm +Fl_Widget_Type.o: Fl_Widget_Type.cxx ../FL/Fl.H ../FL/Enumerations.H \ + ../FL/Fl_Export.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Input.H \ + ../FL/Fl_Input_.H Fl_Widget_Type.h Fl_Type.h ../FL/Fl_Widget.H \ + ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H Fluid_Image.h \ + ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Tabs.H \ + ../FL/Fl_Group.H ../FL/Fl_Pack.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H \ + ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H ../FL/Fl_Choice.H \ + ../FL/Fl_Input_Choice.H ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H \ + alignment_panel.h ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Display.H \ + ../FL/fl_draw.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H \ + ../FL/Fl_Valuator.H ../FL/Fl_Text_Buffer.H ../FL/Fl_Double_Window.H \ + ../FL/Fl_Window.H ../FL/Fl_Preferences.H ../FL/Fl_Tooltip.H \ + ../FL/Fl_Button.H ../FL/Fl_Box.H ../FL/Fl_Light_Button.H \ + ../FL/Fl_Button.H ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H \ + ../FL/Fl_Spinner.H ../FL/Enumerations.H ../FL/Fl_Repeat_Button.H \ + ../FL/Fl.H ../FL/Fl_Return_Button.H ../FL/Fl_Round_Button.H \ + ../FL/fl_message.H ../FL/fl_ask.H ../FL/Fl_Slider.H ../src/flstring.h \ + ../FL/Fl_Export.H ../config.h widget_panel.h ../FL/Fl_Value_Input.H \ + ../FL/Fl_Input.H Shortcut_Button.h CodeEditor.h ../FL/Fl_Text_Editor.H \ + ../FL/Fl_Text_Display.H ../FL/fl_show_colormap.H +Fl_Window_Type.o: Fl_Window_Type.cxx ../FL/Fl.H ../FL/Enumerations.H \ + ../FL/Fl_Export.H ../FL/Fl_Overlay_Window.H ../FL/Fl_Double_Window.H \ + ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/fl_message.H \ + ../FL/fl_ask.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Menu_Item.H \ + ../FL/Fl_Image.H ../FL/Fl_Round_Button.H ../FL/Fl_Light_Button.H \ + ../FL/Fl_Button.H Fl_Widget_Type.h Fl_Type.h ../FL/Fl_Widget.H \ + ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H Fluid_Image.h \ + ../FL/Fl_Shared_Image.H ../FL/Fl_Tabs.H ../FL/Fl_Pack.H \ + ../FL/Fl_Group.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H \ + ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H ../FL/Fl_Choice.H \ + ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H ../FL/Fl_Input_.H \ + ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H undo.h alignment_panel.h \ + ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Display.H ../FL/fl_draw.H \ + ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H \ + ../FL/Fl_Text_Buffer.H ../FL/Fl_Double_Window.H ../FL/Fl_Preferences.H \ + ../FL/Fl_Tooltip.H ../FL/Fl_Button.H ../FL/Fl_Box.H \ + ../FL/Fl_Light_Button.H ../FL/Fl_Check_Button.H ../FL/Fl_Spinner.H \ + ../FL/Enumerations.H ../FL/Fl_Repeat_Button.H ../FL/Fl.H \ + ../FL/Fl_Return_Button.H widget_panel.h ../FL/Fl_Value_Input.H \ + ../FL/Fl_Input.H Shortcut_Button.h CodeEditor.h ../FL/Fl_Text_Editor.H \ + ../FL/Fl_Text_Display.H ../src/flstring.h ../FL/Fl_Export.H ../config.h +Fluid_Image.o: Fluid_Image.cxx ../FL/Fl.H ../FL/Enumerations.H \ + ../FL/Fl_Export.H ../FL/Fl_Widget.H Fl_Type.h ../FL/Fl_Menu.H \ + ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H ../FL/Fl_Image.H Fluid_Image.h \ + ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Tabs.H \ + ../FL/Fl_Group.H ../FL/Fl_Pack.H ../FL/Fl_Group.H ../FL/Fl_Wizard.H \ + ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H \ + ../FL/Fl_Choice.H ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H \ + ../FL/Fl_Input_.H ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H \ + ../src/flstring.h ../FL/Fl_Export.H ../config.h ../FL/filename.H \ + ../FL/Fl_File_Chooser.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H \ + ../FL/Fl_Button.H ../FL/Fl_Preferences.H ../FL/Fl_Tile.H \ + ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H \ + ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H \ + ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/filename.H ../FL/Fl_Box.H \ + ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H ../FL/Fl_Button.H \ + ../FL/Fl_File_Input.H ../FL/Fl_Return_Button.H ../FL/fl_ask.H +about_panel.o: about_panel.cxx about_panel.h ../FL/Fl.H \ + ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Double_Window.H \ + ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Box.H \ + ../FL/Fl_Button.H ../FL/Fl_Return_Button.H ../FL/Fl_Button.H \ + ../FL/Fl_Pixmap.H ../FL/Fl_Image.H +align_widget.o: align_widget.cxx ../FL/Fl.H ../FL/Enumerations.H \ + ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H \ + Fl_Widget_Type.h Fl_Type.h ../FL/Fl_Widget.H ../FL/Fl_Menu.H \ + ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H Fluid_Image.h \ + ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Tabs.H ../FL/Fl_Pack.H \ + ../FL/Fl_Group.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H \ + ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H ../FL/Fl_Choice.H \ + ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H ../FL/Fl_Input_.H \ + ../FL/Fl_Menu_Bar.H undo.h +alignment_panel.o: alignment_panel.cxx alignment_panel.h ../FL/Fl.H \ + ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Text_Buffer.H \ + ../FL/Fl_Text_Display.H ../FL/fl_draw.H ../FL/Fl_Group.H \ + ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H \ + ../FL/Fl_Valuator.H ../FL/Fl_Text_Buffer.H ../FL/Fl_Double_Window.H \ + ../FL/Fl_Window.H ../FL/Fl_Preferences.H ../FL/Fl_Tooltip.H \ + ../FL/Fl_Widget.H ../FL/Fl_Button.H ../FL/Fl_Tabs.H ../FL/Fl_Group.H \ + ../FL/Fl_Box.H ../FL/Fl_Input.H ../FL/Fl_Input_.H \ + ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_Choice.H \ + ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H \ + ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H ../FL/Fl_Spinner.H \ + ../FL/Enumerations.H ../FL/Fl_Repeat_Button.H ../FL/Fl.H \ + ../FL/Fl_Return_Button.H ../FL/Fl_Round_Button.H +code.o: code.cxx ../src/flstring.h ../FL/Fl_Export.H ../config.h \ + ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H Fl_Type.h \ + ../FL/Fl_Widget.H ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H \ + ../FL/Fl_Widget.H ../FL/Fl_Image.H Fluid_Image.h \ + ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Tabs.H \ + ../FL/Fl_Group.H ../FL/Fl_Pack.H ../FL/Fl_Group.H ../FL/Fl_Wizard.H \ + ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H \ + ../FL/Fl_Choice.H ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H \ + ../FL/Fl_Input_.H ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H \ + alignment_panel.h ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Display.H \ + ../FL/fl_draw.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H \ + ../FL/Fl_Valuator.H ../FL/Fl_Text_Buffer.H ../FL/Fl_Double_Window.H \ + ../FL/Fl_Window.H ../FL/Fl_Preferences.H ../FL/Fl_Tooltip.H \ + ../FL/Fl_Button.H ../FL/Fl_Box.H ../FL/Fl_Light_Button.H \ + ../FL/Fl_Button.H ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H \ + ../FL/Fl_Spinner.H ../FL/Enumerations.H ../FL/Fl_Repeat_Button.H \ + ../FL/Fl.H ../FL/Fl_Return_Button.H ../FL/Fl_Round_Button.H \ + ../FL/filename.H +factory.o: factory.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \ + ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H \ + ../FL/Fl_Image.H ../FL/Fl_Pixmap.H ../src/flstring.h ../FL/Fl_Export.H \ + ../config.h undo.h Fl_Widget_Type.h Fl_Type.h ../FL/Fl_Widget.H \ + ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H Fluid_Image.h \ + ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Tabs.H \ + ../FL/Fl_Group.H ../FL/Fl_Pack.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H \ + ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H ../FL/Fl_Choice.H \ + ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H ../FL/Fl_Input_.H \ + ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H ../FL/Fl_Box.H ../FL/Fl_Button.H \ + ../FL/Fl_Return_Button.H ../FL/Fl_Button.H ../FL/Fl_Repeat_Button.H \ + ../FL/Fl.H ../FL/Fl_Light_Button.H ../FL/Fl_Check_Button.H \ + ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H ../FL/Fl_Browser.H \ + ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H \ + ../FL/Fl_Valuator.H ../FL/Fl_Check_Browser.H ../FL/Fl_File_Browser.H \ + ../FL/Fl_Browser.H ../FL/Fl_File_Icon.H ../FL/filename.H \ + ../FL/Fl_Counter.H ../FL/Fl_Spinner.H ../FL/Enumerations.H \ + ../FL/Fl_File_Input.H ../FL/Fl_Text_Display.H ../FL/fl_draw.H \ + ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Editor.H ../FL/Fl_Text_Display.H \ + ../FL/Fl_Clock.H ../FL/Fl_Help_View.H ../FL/Fl_Shared_Image.H \ + ../FL/Fl_Progress.H ../FL/Fl_Adjuster.H ../FL/Fl_Dial.H \ + ../FL/Fl_Roller.H ../FL/Fl_Scrollbar.H ../FL/Fl_Output.H \ + ../FL/Fl_Input.H ../FL/Fl_Value_Input.H ../FL/Fl_Value_Output.H \ + ../FL/Fl_Value_Slider.H ../FL/Fl_Multi_Label.H +file.o: file.cxx ../src/flstring.h ../FL/Fl_Export.H ../config.h \ + alignment_panel.h ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \ + ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Display.H ../FL/fl_draw.H \ + ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H \ + ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Text_Buffer.H \ + ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Preferences.H \ + ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H ../FL/Fl_Button.H ../FL/Fl_Tabs.H \ + ../FL/Fl_Group.H ../FL/Fl_Box.H ../FL/Fl_Input.H ../FL/Fl_Input_.H \ + ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_Choice.H \ + ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H \ + ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H ../FL/Fl_Spinner.H \ + ../FL/Enumerations.H ../FL/Fl_Repeat_Button.H ../FL/Fl.H \ + ../FL/Fl_Return_Button.H ../FL/Fl_Round_Button.H ../FL/fl_message.H \ + ../FL/fl_ask.H Fl_Widget_Type.h Fl_Type.h ../FL/Fl_Menu.H Fluid_Image.h \ + ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Pack.H \ + ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H \ + ../FL/Fl_Input_Choice.H ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H +fluid.o: fluid.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \ + ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H \ + ../FL/Fl_Widget.H ../FL/Fl_Box.H ../FL/Fl_Button.H ../FL/Fl_File_Icon.H \ + ../FL/Fl.H ../FL/Fl_Help_Dialog.H ../FL/Fl_Group.H ../FL/Fl_Input.H \ + ../FL/Fl_Input_.H ../FL/Fl_Help_View.H ../FL/Fl_Scrollbar.H \ + ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/fl_draw.H \ + ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H ../FL/Fl_Hold_Browser.H \ + ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Menu_Bar.H \ + ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/fl_ask.H ../FL/fl_draw.H \ + ../FL/Fl_File_Chooser.H ../FL/Fl_Choice.H ../FL/Fl_Menu_Button.H \ + ../FL/Fl_Preferences.H ../FL/Fl_Tile.H ../FL/Fl_File_Browser.H \ + ../FL/Fl_File_Icon.H ../FL/filename.H ../FL/Fl_Check_Button.H \ + ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_File_Input.H \ + ../FL/Fl_Return_Button.H ../FL/fl_message.H ../FL/fl_ask.H \ + ../FL/filename.H ../src/flstring.h ../FL/Fl_Export.H ../config.h \ + alignment_panel.h ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Display.H \ + ../FL/Fl_Text_Buffer.H ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H \ + ../FL/Fl_Tabs.H ../FL/Fl_Light_Button.H ../FL/Fl_Spinner.H \ + ../FL/Enumerations.H ../FL/Fl_Repeat_Button.H ../FL/Fl_Round_Button.H \ + function_panel.h CodeEditor.h ../FL/Fl_Text_Editor.H \ + ../FL/Fl_Text_Display.H ../FL/Fl_Window.H template_panel.h \ + ../FL/Fl_Browser.H print_panel.cxx print_panel.h ../FL/Fl_Progress.H \ + ../FL/Fl_Pixmap.H about_panel.h undo.h Fl_Type.h ../FL/Fl_Menu.H \ + Fluid_Image.h ../FL/Fl_Shared_Image.H ../FL/Fl_Pack.H ../FL/Fl_Wizard.H \ + ../FL/Fl_Menu_.H ../FL/Fl_Input_Choice.H +function_panel.o: function_panel.cxx function_panel.h ../FL/Fl.H \ + ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Double_Window.H \ + ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Group.H \ + ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_Box.H \ + ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Return_Button.H \ + ../FL/Fl_Button.H CodeEditor.h ../FL/Fl_Text_Buffer.H \ + ../FL/Fl_Text_Editor.H ../FL/Fl_Text_Display.H ../FL/fl_draw.H \ + ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H \ + ../FL/Fl_Text_Buffer.H ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H \ + ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Window.H ../FL/Fl_Tabs.H \ + ../FL/Fl_Pixmap.H Fl_Type.h ../FL/Fl_Widget.H ../FL/Fl_Menu.H \ + Fluid_Image.h ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Pack.H \ + ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H ../FL/Fl_Choice.H \ + ../FL/Fl_Input_Choice.H ../FL/Fl_Menu_Bar.H undo.h +template_panel.o: template_panel.cxx template_panel.h ../FL/Fl.H \ + ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Double_Window.H \ + ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Browser.H \ + ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H \ + ../FL/Fl_Valuator.H ../FL/Fl_Box.H ../FL/Fl_Input.H ../FL/Fl_Input_.H \ + ../FL/Fl_Group.H ../FL/Fl_Button.H ../FL/Fl_Return_Button.H \ + ../FL/Fl_Button.H ../src/flstring.h ../FL/Fl_Export.H ../config.h \ + ../FL/filename.H ../FL/fl_ask.H ../FL/Fl_Shared_Image.H \ + ../FL/Fl_Image.H ../FL/Fl_Preferences.H +undo.o: undo.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \ + Fl_Type.h ../FL/Fl_Widget.H ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H \ + ../FL/Fl_Widget.H ../FL/Fl_Image.H Fluid_Image.h \ + ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Tabs.H \ + ../FL/Fl_Group.H ../FL/Fl_Pack.H ../FL/Fl_Group.H ../FL/Fl_Wizard.H \ + ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H \ + ../FL/Fl_Choice.H ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H \ + ../FL/Fl_Input_.H ../FL/Fl_Window.H ../FL/Fl_Menu_Bar.H undo.h \ + ../FL/Fl_Preferences.H ../src/flstring.h ../FL/Fl_Export.H ../config.h +widget_panel.o: widget_panel.cxx widget_panel.h ../FL/Fl.H \ + ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Double_Window.H \ + ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Tabs.H \ + ../FL/Fl_Group.H ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Choice.H \ + ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H \ + ../FL/Fl_Button.H ../FL/Fl_Box.H ../FL/Fl_Value_Input.H \ + ../FL/Fl_Valuator.H ../FL/Fl_Input.H ../FL/Fl_Light_Button.H \ + ../FL/Fl_Button.H Shortcut_Button.h CodeEditor.h ../FL/Fl_Text_Buffer.H \ + ../FL/Fl_Text_Editor.H ../FL/Fl_Text_Display.H ../FL/fl_draw.H \ + ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Text_Buffer.H \ + ../FL/Fl_Return_Button.H diff --git a/third_party/windows/fltk-1.1.10/fluid/makefile.wat b/third_party/windows/fltk-1.1.10/fluid/makefile.wat new file mode 100644 index 0000000..436038f --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/makefile.wat @@ -0,0 +1,79 @@ +# +# "$Id: makefile.wat 5699 2007-02-20 17:02:41Z matt $" +# +# FLUID makefile for the Fast Light Tool Kit (FLTK). +# +# Copyright 1998-2004 by Bill Spitzak and others. +# +# 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 to "fltk-bugs@fltk.org". +# + +OBJECTS = & + CodeEditor.obj & + Fl_Function_Type.obj & + Fl_Group_Type.obj & + Fl_Menu_Type.obj & + Fl_Type.obj & + Fl_Widget_Type.obj & + Fl_Window_Type.obj & + Fluid_Image.obj & + about_panel.obj & + align_widget.obj & + alignment_panel.obj & + code.obj & + factory.obj & + file.obj & + function_panel.obj & + template_panel.obj & + undo.obj & + widget_panel.obj + +# fluid.obj should not be in the list, because the watcom.mif file +# assumes an object file with the same name as the target executable + +################################################################ + +!include ../watcom.mif + +all: $(ODIR)/fluid$(EXEEXT) + +$(ODIR)\fluid$(EXEEXT): $(OBJECTS) $(LIBS) + +# +# Clean all directories +# +clean : .SYMBOLIC + @echo Cleaning up. +CLEANEXTS = exe map sym obj lk1 + @for %a in ($(CLEANEXTS)) do -rm -f $(ODIR)\*.%a + -rm -f *.err + +# +# Note: The rebuild target can only be used if you have the original .fl +# files. This is normally only used by the FLTK maintainers... +# + +rebuild: + ./fluid -c about_panel.fl + ./fluid -c alignment_panel.fl + ./fluid -c function_panel.fl + ./fluid -c widget_panel.fl + +# +# End of "$Id: makefile.wat 5699 2007-02-20 17:02:41Z matt $". +# diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flAdjuster.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flAdjuster.xpm new file mode 100644 index 0000000..d235a05 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flAdjuster.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flAdjuster_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"b c #2020ff", +"c c none", +"d c #c0c0c0", +"e c #8080ff", +"f c #e0e0e0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"fffffffffffffffc", +"fdddafdddafdddac", +"fdddafdddafdddac", +"fdddafdddafdddac", +"fdddafdddafdddac", +"fdddafdddafdddac", +"fdddafdddafdddac", +"aaaaaaaaaaaaaaac", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flBox.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flBox.xpm new file mode 100644 index 0000000..3704ed8 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flBox.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flBox_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"b c #2020ff", +"c c none", +"d c #c0c0c0", +"e c #909090", +"f c #000000", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"dddddddddddddddc", +"dddddddddddddddc", +"deeeeeeeeeeeeedc", +"deeeeeeeeeeeeedc", +"deeeeeeeeeeeeedc", +"deeeeeeeeeeeeedc", +"deeeeeeeeeeeeedc", +"deeeeeeeeeeeeedc", +"deeeeeeeeeeeeedc", +"deeeeeeeeeeeeedc", +"dddddddddddddddc", +"dddddddddddddddc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flBrowser.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flBrowser.xpm new file mode 100644 index 0000000..06b354e --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flBrowser.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flBrowser_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"b c #808080", +"c c none", +"d c #c0c0c0", +"e c #ffffff", +"f c #000000", +/* pixels */ +"cccccccccccccccc", +"dddddddddddddddc", +"dfffffffffffffdc", +"dfeeeeeeeeebbfdc", +"dfeeeeeeeeebdfdc", +"dfeeeeeeeeebdfdc", +"dfeeeeeeeeebffdc", +"dfeeeeeeeeebdfdc", +"dfeeeeeeeeebdfdc", +"dfeeeeeeeeebdfdc", +"dfeeeeeeeeebdfdc", +"dfbbbbbbbbbbbfdc", +"dfbdddfddddbdfdc", +"dfffffffffffffdc", +"dddddddddddddddc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flButton.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flButton.xpm new file mode 100644 index 0000000..b6ffeb4 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flButton.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flButton_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"b c #2020ff", +"c c none", +"d c #a0a0a0", +"e c #8080ff", +"f c #d0d0d0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"ffffffffffffffac", +"fdddddddddddddac", +"fdddddddddddddac", +"fdddddddddddddac", +"fdddddddddddddac", +"fdddddddddddddac", +"fdddddddddddddac", +"aaaaaaaaaaaaaaac", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flCheckBrowser.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flCheckBrowser.xpm new file mode 100644 index 0000000..a61bed9 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flCheckBrowser.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flCheckBrowser_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"b c #808080", +"c c none", +"d c #c0c0c0", +"e c #ffffff", +"f c #000000", +/* pixels */ +"cccccccccccccccc", +"dddddddddddddddc", +"dfffffffffffffdc", +"dfeeeeeeeeebbfdc", +"dfefffeeeeebdfdc", +"dfefefeeeeebdfdc", +"dfefffeeeeebffdc", +"dfeeeeeeeeebdfdc", +"dfefffeeeeebdfdc", +"dfefefeeeeebdfdc", +"dfefffeeeeebdfdc", +"dfbbbbbbbbbbbfdc", +"dfbdddfddddbdfdc", +"dfffffffffffffdc", +"dddddddddddddddc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flCheckButton.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flCheckButton.xpm new file mode 100644 index 0000000..7cd73c3 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flCheckButton.xpm @@ -0,0 +1,30 @@ +/* XPM */ +static const char *flCheckButton_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 7 1", +/* colors */ +"a c #606060", +"b c #2020ff", +"c c none", +"d c #ffffff", +"e c #8080ff", +"f c #d0d0d0", +"' c #000000", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccaaaaaaaaaaccc", +"cccaddddddddfccc", +"cccadddddd''fccc", +"cccaddddd''dfccc", +"cccaddddd''dfccc", +"ccca''dd''ddfccc", +"cccad''''dddfccc", +"cccadd''ddddfccc", +"cccaddddddddfccc", +"cccaaaaaaaaaaccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flChoice.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flChoice.xpm new file mode 100644 index 0000000..244fa96 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flChoice.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flChoice_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +". c #000000", +"c c none", +"d c #b0b0b0", +"e c #ffffff", +"f c #d0d0d0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"ffffffffffffffff", +"feeeeeafddddddda", +"feeeeeafddddddda", +"feeeeeaf.......a", +"feeeeeafd.....da", +"feeeeeafdd...dda", +"feeeeeafddd.ddda", +"feeeeeafddddddda", +"feeeeeafddddddda", +"aaaaaaaaaaaaaaaa", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flClass.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flClass.xpm new file mode 100644 index 0000000..ca7a431 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flClass.xpm @@ -0,0 +1,27 @@ +/* XPM */ +static const char *flClass_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 4 1", +/* colors */ +". c none", +"a c #000000", +"b c #c0e0c0", +"c c #000000", +/* pixels */ +"................", +"................", +"...aaaaaaaaaaaaa", +"..abbbbbbbbbbbc.", +".abbbbbbbbbbbc..", +".abbbbbbbbbbbc..", +"abbbbbbbbbbbc...", +"abbbbbbbbbbbc...", +"abbbbbbbbbbbc...", +"abbbbbbbbbbbc...", +".abbbbbbbbbbbc..", +".abbbbbbbbbbbc..", +"..cbbbbbbbbbbbc.", +"...ccccccccccccc", +"................", +"................", +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flClock.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flClock.xpm new file mode 100644 index 0000000..179af53 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flClock.xpm @@ -0,0 +1,28 @@ +/* XPM */ +static const char *flClock_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 5 1", +/* colors */ +". c none", +"a c #000000", +"b c #c0c0c0", +"c c #000000", +"' c #202080", +/* pixels */ +"................", +"................", +"....aaaaaaa.....", +"..aabbbbbbbcc...", +".abbbbbbbbb'bc..", +".abb'bbbbb'bbc..", +"abbbb'bbb'bbbbc.", +"abbbbb'b'bbbbbc.", +"abbbbbb'bbbbbbc.", +"abbbbbbbbbbbbbc.", +"abbbbbbbbbbbbbc.", +".abbbbbbbbbbbc..", +".abbbbbbbbbbbc..", +"..ccbbbbbbbcc...", +"....ccccccc.....", +"................", +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flCode.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flCode.xpm new file mode 100644 index 0000000..af35df3 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flCode.xpm @@ -0,0 +1,27 @@ +/* XPM */ +static const char *flCode_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 4 1", +/* colors */ +". c none", +"a c #000000", +"b c #c0e0c0", +"c c #000000", +/* pixels */ +"................", +"................", +"aaaaaaaaaaaaaaaa", +"abbbbbbbbbbbbbbc", +"abbbbbbbbbbbbbbc", +"abbbbbbbbbbbbbbc", +"abbbbbbbbbbbbbbc", +"abbbbbbbbbbbbbbc", +"abbbbbbbbbbbbbbc", +"abbbbbbbbbbbbbbc", +"abbbbbbbbbbbbbbc", +"abbbbbbbbbbbbbbc", +"abbbbbbbbbbbbbbc", +"accccccccccccccc", +"................", +"................", +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flCodeBlock.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flCodeBlock.xpm new file mode 100644 index 0000000..59abda7 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flCodeBlock.xpm @@ -0,0 +1,27 @@ +/* XPM */ +static const char *flCodeBlock_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 4 1", +/* colors */ +". c none", +"a c #000000", +"b c #c0e0c0", +"c c #000000", +/* pixels */ +".......aa.......", +"......abbc......", +".....abbbbc.....", +"....abbbbbbc....", +"...abbbbbbbbc...", +"..abbbbbbbbbbc..", +".abbbbbbbbbbbbc.", +"abbbbbbbbbbbbbbc", +"abbbbbbbbbbbbbbc", +".abbbbbbbbbbbbc.", +"..abbbbbbbbbbc..", +"...abbbbbbbbc...", +"....abbbbbbc....", +".....abbbbc.....", +"......abbc......", +".......ac.......", +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flComment.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flComment.xpm new file mode 100644 index 0000000..ece76c5 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flComment.xpm @@ -0,0 +1,27 @@ +/* XPM */ +static const char *flComment_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 4 1", +/* colors */ +". c none", +"a c #000000", +"b c #c0e0c0", +"c c #000000", +/* pixels */ +"................", +"................", +".aaaaaaaaaaaaaa.", +".abbbbbbbbbbbbc.", +".abbbbbccbbccbc.", +".abbbbccbbccbbc.", +".abbbbccbbccbbc.", +".abbbccbbccbbbc.", +".abbbccbbccbbbc.", +".abbccbbccbbbbc.", +".abbccbbccbbbbc.", +".abccbbccbbbbbc.", +".abbbbbbbbbbbbc.", +".accccccccccccc.", +"................", +"................", +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flCounter.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flCounter.xpm new file mode 100644 index 0000000..8fec9cd --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flCounter.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flCounter_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"' c #000000", +"c c none", +"d c #c0c0c0", +"e c #ffffff", +"f c #e0e0e0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"fffffffffffffffc", +"fdddaeeeeefdddac", +"fd'daee'eefd'dac", +"f''dae''eefd''ac", +"f''daee'eefd''ac", +"fd'dae'''efd'dac", +"fdddaeeeeefdddac", +"aaaaaaaaaaaaaaac", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flDeclaration.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flDeclaration.xpm new file mode 100644 index 0000000..a1a7af4 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flDeclaration.xpm @@ -0,0 +1,27 @@ +/* XPM */ +static const char *flDeclaration_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 4 1", +/* colors */ +". c none", +"a c #000000", +"b c #c0e0c0", +"c c #000000", +/* pixels */ +"................", +"................", +"...aaaaaaaaaaaaa", +"...abbbbbbbbbbbc", +"...abbbbbbbbbbbc", +"..abbbbbbbbbbbc.", +"..abbbbbbbbbbbc.", +"..abbbbbbbbbbbc.", +".abbbbbbbbbbbc..", +".abbbbbbbbbbbc..", +".abbbbbbbbbbbc..", +"abbbbbbbbbbbc...", +"abbbbbbbbbbbc...", +"acccccccccccc...", +"................", +"................", +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flDeclarationBlock.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flDeclarationBlock.xpm new file mode 100644 index 0000000..60b2b91 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flDeclarationBlock.xpm @@ -0,0 +1,27 @@ +/* XPM */ +static const char *flDeclarationBlock_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 4 1", +/* colors */ +". c none", +"a c #000000", +"b c #c0e0c0", +"c c #000000", +/* pixels */ +".......aa.......", +"......abbc......", +".....abbbbc.....", +"....abbbbbbc....", +"...abbbbbbbbc...", +"..abbbcbbcbbbc..", +".abbbccccccbbbc.", +"abbbbbcbbcbbbbbc", +"abbbbbcbbcbbbbbc", +".abbbccccccbbbc.", +"..abbbcbbcbbbc..", +"...abbbbbbbbc...", +"....abbbbbbc....", +".....abbbbc.....", +"......abbc......", +".......ac.......", +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flDial.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flDial.xpm new file mode 100644 index 0000000..e45a703 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flDial.xpm @@ -0,0 +1,28 @@ +/* XPM */ +static const char *flDial_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 5 1", +/* colors */ +". c none", +"a c #000000", +"b c #c0c0c0", +"c c #000000", +"' c #202080", +/* pixels */ +"................", +"................", +"....aaaaaaa.....", +"..aabbbbbbbcc...", +".abbbbbbbbbbbc..", +".ab''bbbbbbbbc..", +"ab'bb'bbbbbbbbc.", +"ab'bb'bbbbbbbbc.", +"abb''bbbbbbbbbc.", +"abbbbbbbbbbbbbc.", +"abbbbbbbbbbbbbc.", +".abbbbbbbbbbbc..", +".abbbbbbbbbbbc..", +"..ccbbbbbbbcc...", +"....ccccccc.....", +"................", +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flFileBrowser.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flFileBrowser.xpm new file mode 100644 index 0000000..d13587a --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flFileBrowser.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flFileBrowser_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #ffff00", +"b c #808080", +"c c none", +"d c #c0c0c0", +"e c #ffffff", +"f c #000000", +/* pixels */ +"cccccccccccccccc", +"dddddddddddddddc", +"dfffffffffffffdc", +"dfeeeeeeeeebbfdc", +"dfeefffeeeebdfdc", +"dfefaaafffebdfdc", +"dfefaaaaafebffdc", +"dfefaaaaafebdfdc", +"dfefaaaaafebdfdc", +"dfefffffffebdfdc", +"dfeeeeeeeeebdfdc", +"dfbbbbbbbbbbbfdc", +"dfbdddfddddbdfdc", +"dfffffffffffffdc", +"dddddddddddddddc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flFileInput.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flFileInput.xpm new file mode 100644 index 0000000..e8b48a8 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flFileInput.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flFileInput_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"f c #606060", +". c #000000", +"c c none", +"d c #ffffff", +"e c #8080ff", +"a c #d0d0d0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"ffffffffffffffff", +"faaaaaaaafaaaaaa", +"ffffffffffffffff", +"fdddddddddddddda", +"fdd...dd..ddddda", +"fd.ddd.d..ddddda", +"fd.ddd.d..ddddda", +"fd.....d..ddddda", +"fd.ddd.d..ddddda", +"fd.ddd.d..ddddda", +"fdddddddddddddda", +"aaaaaaaaaaaaaaaa", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flFunction.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flFunction.xpm new file mode 100644 index 0000000..0746f9b --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flFunction.xpm @@ -0,0 +1,27 @@ +/* XPM */ +static const char *flFunction_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 4 1", +/* colors */ +". c none", +"a c #000000", +"b c #c0e0c0", +"c c #000000", +/* pixels */ +"................", +"................", +"....aaaaaaaa....", +"..aabbbbbbbbcc..", +".abbbbbbbbbbbbc.", +".abbbbbbbbbbbbc.", +"abbbbbbbbbbbbbbc", +"abbbbbbbbbbbbbbc", +"abbbbbbbbbbbbbbc", +"abbbbbbbbbbbbbbc", +".abbbbbbbbbbbbc.", +".abbbbbbbbbbbbc.", +"..ccbbbbbbbbcc..", +"....cccccccc....", +"................", +"................", +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flGroup.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flGroup.xpm new file mode 100644 index 0000000..c1c70b5 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flGroup.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flGroup_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"b c #2020ff", +"c c none", +"d c #c0c0c0", +"e c #8080ff", +"f c #000000", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"dddddddddddddddc", +"dfffffffffffffdc", +"dfdddddddddddfdc", +"dfdddddddddddfdc", +"dfdddddddddddfdc", +"dfdddddddddddfdc", +"dfdddddddddddfdc", +"dfdddddddddddfdc", +"dfdddddddddddfdc", +"dfdddddddddddfdc", +"dfffffffffffffdc", +"dddddddddddddddc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flHelp.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flHelp.xpm new file mode 100644 index 0000000..9c7ff38 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flHelp.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flHelp_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"b c #808080", +"c c none", +"d c #c0c0c0", +"e c #ffffff", +"f c #000000", +/* pixels */ +"cccccccccccccccc", +"dddddddddddddddc", +"dfffffffffffffdc", +"dfeeeeeeeeebbfdc", +"dfeeeffeeeebdfdc", +"dfeeffeeeeebdfdc", +"dfeffeeeeeebffdc", +"dfeeffeeeeebdfdc", +"dfeeeffeeeebdfdc", +"dfeeeeeeeeebdfdc", +"dfeeeeeeeeebdfdc", +"dfbbbbbbbbbbbfdc", +"dfbdddfddddbdfdc", +"dfffffffffffffdc", +"dddddddddddddddc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flInput.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flInput.xpm new file mode 100644 index 0000000..77575ee --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flInput.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flInput_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"f c #606060", +". c #000000", +"c c none", +"d c #ffffff", +"e c #8080ff", +"a c #d0d0d0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"ffffffffffffffff", +"fdddddddddddddda", +"fdd...dd..ddddda", +"fd.ddd.d..ddddda", +"fd.ddd.d..ddddda", +"fd.....d..ddddda", +"fd.ddd.d..ddddda", +"fd.ddd.d..ddddda", +"fdddddddddddddda", +"aaaaaaaaaaaaaaaa", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flLightButton.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flLightButton.xpm new file mode 100644 index 0000000..b47d4a1 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flLightButton.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flLightButton_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"b c #ffff00", +"c c none", +"d c #a0a0a0", +"e c #8080ff", +"f c #d0d0d0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"ffffffffffffffac", +"fdddddddddddddac", +"fdaaaaddddddddac", +"fdabbfddddddddac", +"fdabbfddddddddac", +"fdafffddddddddac", +"fdddddddddddddac", +"aaaaaaaaaaaaaaac", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flMenuButton.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flMenuButton.xpm new file mode 100644 index 0000000..f0ab6cd --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flMenuButton.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flMenuButton_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +". c #000000", +"c c none", +"d c #b0b0b0", +"e c #ffffff", +"f c #d0d0d0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"ffffffffffffffff", +"fdddddddddddddda", +"fdddddddddddddda", +"fddddddd.......a", +"fdddddddd.ddd.da", +"fddddddddd.d.dda", +"fdddddddddd.ddda", +"fdddddddddddddda", +"fdddddddddddddda", +"aaaaaaaaaaaaaaaa", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flMenubar.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flMenubar.xpm new file mode 100644 index 0000000..e4d129e --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flMenubar.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flMenubar_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +". c #2020cf", +"c c none", +"d c #b0b0b0", +"e c #ffffff", +"f c #e0e0e0", +/* pixels */ +"cccccccccccccccc", +"ffffffffffffffff", +"dddddddddddddddd", +"dddddddddddddddd", +"dddddddddddddddd", +"dddffffffffffffd", +"aaafddddddddddaa", +"cccfddddddddddac", +"cccfddddddddddac", +"cccfddddddddddac", +"cccfddddddddddac", +"cccfddddddddddac", +"cccfddddddddddac", +"cccfddddddddddac", +"cccfaaaaaaaaaaac", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flMenuitem.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flMenuitem.xpm new file mode 100644 index 0000000..623e09e --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flMenuitem.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flMenuitem_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +". c #000000", +"c c none", +"d c #b0b0b0", +"e c #d0d0d0", +"f c #c0c0c0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccffffccccccccc", +"c.fffffffccccf.c", +"c.ffffffffffff.c", +"c.eeeeeeeeeeee.c", +"c.ee.ee.eeeeee.c", +"c.e.e.e.eee..e.c", +"c.e...e..e.eee.c", +"c.e.e.e..e.eee.c", +"c.e.e.e..ee..e.c", +"c.eeeeeeeeeeee.c", +"c.ffffffffffff.c", +"c.fccccfffffff.c", +"cccccccccffffccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flOutput.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flOutput.xpm new file mode 100644 index 0000000..a7449d4 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flOutput.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flOutput_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"f c #606060", +". c #000000", +"c c none", +"d c #d0d0d0", +"e c #8080ff", +"a c #d0d0d0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"ffffffffffffffff", +"fdddddddddddddda", +"fdd...ddddddddda", +"fd.ddd.dddddddda", +"fd.ddd.dddddddda", +"fd.....dddddddda", +"fd.ddd.dddddddda", +"fd.ddd.dddddddda", +"fdddddddddddddda", +"aaaaaaaaaaaaaaaa", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flPack.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flPack.xpm new file mode 100644 index 0000000..f3a2c38 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flPack.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flPack_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"b c #f0f0f0", +"c c none", +"d c #c0c0c0", +"e c #8080ff", +"f c #000000", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"dddddddddddddddc", +"dfffffffffffffdc", +"dfddfddfddfddfdc", +"dfddfddfddfddfdc", +"dfddfddfddfddfdc", +"dfddfddfddfddfdc", +"dfddfddfddfddfdc", +"dfddfddfddfddfdc", +"dfddfddfddfddfdc", +"dfddfddfddfddfdc", +"dfffffffffffffdc", +"dddddddddddddddc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flProgress.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flProgress.xpm new file mode 100644 index 0000000..88af00c --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flProgress.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flProgress_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"f c #606060", +". c #f0f000", +"c c none", +"d c #ffffff", +"e c #8080ff", +"a c #d0d0d0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"ffffffffffffffff", +"f.........ddddda", +"f.........ddddda", +"f.........ddddda", +"f.........ddddda", +"f.........ddddda", +"f.........ddddda", +"aaaaaaaaaaaaaaaa", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flRepeatButton.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flRepeatButton.xpm new file mode 100644 index 0000000..f85eb39 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flRepeatButton.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flRepeatButton_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"' c #000000", +"c c none", +"d c #a0a0a0", +"e c #8080ff", +"f c #d0d0d0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"ffffffffffffffac", +"fdddddddddddddac", +"fdddddddddddddac", +"fdddddddddddddac", +"fdddd''d''d''dac", +"fdddd''d''d''dac", +"fdddddddddddddac", +"aaaaaaaaaaaaaaac", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flReturnButton.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flReturnButton.xpm new file mode 100644 index 0000000..6af4e15 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flReturnButton.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flReturnButton_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"' c #000000", +"c c none", +"d c #a0a0a0", +"e c #8080ff", +"f c #d0d0d0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"ffffffffffffffac", +"fdddddddddddddac", +"fddddddd'dd''dac", +"fdddddd''dd''dac", +"fddddd'''''''dac", +"fdddddd''dddddac", +"fddddddd'dddddac", +"aaaaaaaaaaaaaaac", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flRoller.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flRoller.xpm new file mode 100644 index 0000000..15aad3e --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flRoller.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flRoller_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #e0e0e0", +"' c #000000", +"c c none", +"d c #c0c0c0", +"e c #ffffff", +"f c #606060", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"aaaaaaaaaaaaaaac", +"a'f'ee'ddd'dd'f'", +"a'f'ee'ddd'dd'f'", +"a'f'ee'ddd'dd'f'", +"a'f'ee'ddd'dd'f'", +"a'f'ee'ddd'dd'f'", +"a'f'ee'ddd'dd'f'", +"''''''''''''''''", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flRoundButton.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flRoundButton.xpm new file mode 100644 index 0000000..6596db5 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flRoundButton.xpm @@ -0,0 +1,30 @@ +/* XPM */ +static const char *flRoundButton_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 7 1", +/* colors */ +"a c #606060", +"b c #2020ff", +". c none", +"d c #ffffff", +"e c #8080ff", +"f c #d0d0d0", +"# c #000000", +/* pixels */ +"................", +"................", +"......aaa.......", +"....aadddaa.....", +"...adddddddf....", +"...add###ddf....", +"..add#####ddf...", +"..add#####ddf...", +"..add#####ddf...", +"...add###ddf....", +"...adddddddf....", +"....ffdddff.....", +"......fff.......", +"................", +"................", +"................" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flScroll.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flScroll.xpm new file mode 100644 index 0000000..ced8271 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flScroll.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flScroll_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"b c #f0f0f0", +"c c none", +"d c #c0c0c0", +"e c #8080ff", +"f c #000000", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"dddddddddddddddc", +"dfffffffffffffdc", +"dfddddddddbbbfdc", +"dfddddddddbddfdc", +"dfddddddddbddfdc", +"dfddddddddbfffdc", +"dfddddddddbddfdc", +"dfbbbbbbbbbbbfdc", +"dfbdddfdddbddfdc", +"dfbdddfdddbddfdc", +"dfffffffffffffdc", +"dddddddddddddddc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flScrollBar.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flScrollBar.xpm new file mode 100644 index 0000000..b19a67a --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flScrollBar.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flScrollBar_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"b c #2020ff", +"c c none", +"d c #c0c0c0", +"e c #8080ff", +"f c #e0e0e0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"aaaaaaaaaaaaaaaa", +"adddfffffddddddf", +"ad'dfdddadddd'df", +"a''dfdddadddd''f", +"a''dfdddadddd''f", +"ad'dfdddadddd'df", +"adddfaaaaddddddf", +"afffffffffffffff", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flSlider.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flSlider.xpm new file mode 100644 index 0000000..8be2caa --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flSlider.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flSlider_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"b c #2020ff", +"c c none", +"d c #c0c0c0", +"e c #8080ff", +"f c #e0e0e0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"aaaaaaaaaaaaaaaa", +"afffffdddddddddf", +"afdddadddddddddf", +"afdddadddddddddf", +"afdddadddddddddf", +"afdddadddddddddf", +"afaaaadddddddddf", +"afffffffffffffff", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flSpinner.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flSpinner.xpm new file mode 100644 index 0000000..c907446 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flSpinner.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static const char *flSpinner_xpm[]={ +"16 16 6 1", +". c None", +"c c #000000", +"d c #606060", +"b c #c0c0c0", +"# c #e0e0e0", +"a c #ffffff", +"................", +"................", +"................", +"................", +"###############.", +"#aaaaaaaaa#bcbd.", +"#aaaaaacaa#cccd.", +"#aaaaaccaaddddd.", +"#aaaaaacaa####d.", +"#aaaaaccca#cccd.", +"#aaaaaaaaa#bcbd.", +"ddddddddddddddd.", +"................", +"................", +"................", +"................"}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flSubmenu.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flSubmenu.xpm new file mode 100644 index 0000000..9e9a9cd --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flSubmenu.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flSubmenu_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +". c #000000", +"c c none", +"d c #b0b0b0", +"e c #d0d0d0", +"f c #c0c0c0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccffffccccccccc", +"c.fffffffccccf.c", +"c.ffffffffffff.c", +"c.eeeeeeeeeeee.c", +"c.ee.eeeee.eee.c", +"c.e.e.eeee..ee.c", +"c.e...eeee...e.c", +"c.e.e.eeee..ee.c", +"c.e.e.eeee.eee.c", +"c.eeeeeeeee.....", +"c.fffffffff.ffff", +"c.fccccffff.ffff", +"cccccccccff.ffff", +"ccccccccccc.ffff" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flTabs.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flTabs.xpm new file mode 100644 index 0000000..4234d0d --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flTabs.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flTabs_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #a0a0a0", +"b c #2020ff", +"c c none", +"d c #c0c0c0", +"e c #8080ff", +"f c #000000", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"dddddddddddddddc", +"ddffffdffffddddc", +"dfddddfaaaafdddc", +"dfddddfaaaafdddc", +"dfddddffffffffdc", +"dfdddddddddddfdc", +"dfdddddddddddfdc", +"dfdddddddddddfdc", +"dfdddddddddddfdc", +"dfdddddddddddfdc", +"dfffffffffffffdc", +"dddddddddddddddc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flTextDisplay.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flTextDisplay.xpm new file mode 100644 index 0000000..72e1f05 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flTextDisplay.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flTextDisplay_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"f c #606060", +". c #000000", +"c c none", +"d c #d0d0d0", +"e c #8080ff", +"a c #d0d0d0", +/* pixels */ +"cccccccccccccccc", +"ffffffffffffffff", +"fdddddddddddddda", +"fdd...ddddddddda", +"fd.ddd.dddddddda", +"fd.ddd.dddddddda", +"fd.....dddddddda", +"fd.ddd.dddddddda", +"fd.ddd.dddddddda", +"fdddddddddddddda", +"fdddddddddddddda", +"fdddddddddddddda", +"fdddddddddddddda", +"fdddddddddddddda", +"aaaaaaaaaaaaaaaa", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flTextEdit.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flTextEdit.xpm new file mode 100644 index 0000000..b3d2d4a --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flTextEdit.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flTextEdit_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"f c #606060", +". c #000000", +"c c none", +"d c #ffffff", +"e c #8080ff", +"a c #d0d0d0", +/* pixels */ +"cccccccccccccccc", +"ffffffffffffffff", +"fdddddddddddddda", +"fdd...dd..ddddda", +"fd.ddd.d..ddddda", +"fd.ddd.d..ddddda", +"fd.....d..ddddda", +"fd.ddd.d..ddddda", +"fd.ddd.d..ddddda", +"fdddddddddddddda", +"fdddddddddddddda", +"fdddddddddddddda", +"fdddddddddddddda", +"fdddddddddddddda", +"aaaaaaaaaaaaaaaa", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flTile.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flTile.xpm new file mode 100644 index 0000000..73534b2 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flTile.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flTile_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"b c #f0f0f0", +"c c none", +"d c #c0c0c0", +"e c #8080ff", +"f c #000000", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"dddddddddddddddd", +"dfffffffffffffbd", +"dfdddddbfdddddbd", +"dfdddddbfdddddbd", +"dfdddddbfdddddbdc", +"dfbbbbbbfbbbbbbd", +"dfffffffffffffbd", +"dfdddddbfdddddbd", +"dfdddddbfdddddbd", +"dfdddddbfdddddbd", +"dfbbbbbbfbbbbbbd", +"dddddddddddddddd", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flValueInput.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flValueInput.xpm new file mode 100644 index 0000000..aa1b475 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flValueInput.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flValueInput_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"f c #606060", +". c #000000", +"c c none", +"d c #ffffff", +"e c #8080ff", +"a c #d0d0d0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"ffffffffffffffff", +"fdddddddddddddda", +"fdd...dd..ddddda", +"fd.dd..d..ddddda", +"fd.d.d.d..ddddda", +"fd..dd.d..ddddda", +"fd.ddd.d..ddddda", +"fdd...dd..ddddda", +"fdddddddddddddda", +"aaaaaaaaaaaaaaaa", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flValueOutput.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flValueOutput.xpm new file mode 100644 index 0000000..856cb97 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flValueOutput.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flValueOutput_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"f c #606060", +". c #000000", +"c c none", +"d c #d0d0d0", +"e c #8080ff", +"a c #d0d0d0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"ffffffffffffffff", +"fdddddddddddddda", +"fdd...ddddddddda", +"fd.dd..dddddddda", +"fd.d.d.dddddddda", +"fd..dd.dddddddda", +"fd.ddd.dddddddda", +"fdd...ddddddddda", +"fdddddddddddddda", +"aaaaaaaaaaaaaaaa", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flValueSlider.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flValueSlider.xpm new file mode 100644 index 0000000..d166b22 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flValueSlider.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flValueSlider_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"b c #2020ff", +"c c none", +"d c #c0c0c0", +"' c #000000", +"f c #e0e0e0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"aaaaaaaaaaaaaaaa", +"adddddfffffddddf", +"add'ddfdddaddddf", +"ad''ddfdddaddddf", +"add'ddfdddaddddf", +"ad'''dfdddaddddf", +"adddddfaaaaddddf", +"afffffffffffffff", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flWidgetClass.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flWidgetClass.xpm new file mode 100644 index 0000000..9a8ecef --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flWidgetClass.xpm @@ -0,0 +1,31 @@ +/* XPM */ +static const char *flWidgetClass_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 8 1", +/* colors */ +"a c #606060", +"b c #2020ff", +"c c none", +"d c #a0a0a0", +"e c #8080ff", +"f c #d0d0d0", +"g c #c0e0c0", +"h c #000000", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"ffffffffffffffff", +"feebbbbbbbeebeea", +"feebbbbbbbeebeea", +"fdddhhhhhhhhhhda", +"fddhgggggggghdda", +"fdhgggggggghddda", +"fdhgggggggghddda", +"fdhgggggggghddda", +"fdhgggggggghddda", +"fddhgggggggghdda", +"fdddhhhhhhhhhhda", +"faaaaaaaaaaaaaaa", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flWindow.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flWindow.xpm new file mode 100644 index 0000000..e90d840 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flWindow.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flWindow_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"b c #2020ff", +"c c none", +"d c #a0a0a0", +"e c #8080ff", +"f c #d0d0d0", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"ffffffffffffffff", +"feebbbbbbbeebeea", +"feebbbbbbbeebeea", +"fdddddddddddddda", +"fdddddddddddddda", +"fdddddddddddddda", +"fdddddddddddddda", +"fdddddddddddddda", +"fdddddddddddddda", +"fdddddddddddddda", +"fdddddddddddddda", +"faaaaaaaaaaaaaaa", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/flWizard.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flWizard.xpm new file mode 100644 index 0000000..75ef378 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/flWizard.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *flWizard_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"a c #606060", +"b c #f0f0f0", +"c c none", +"d c #c0c0c0", +"e c #8080ff", +"f c #000000", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"dddddddddddddddc", +"dfffffffffffffdc", +"dfdddddddddddfdc", +"dfdddddddddddfdc", +"dfdddddddddddfdc", +"dfdddddddddddfdc", +"dfdddddddddddfdc", +"dfbbbbbbbbbbbfdc", +"dfbddddfbdbddfdc", +"dfbddddfbdbddfdc", +"dfffffffffffffdc", +"dddddddddddddddc", +"cccccccccccccccc", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/lock.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/lock.xpm new file mode 100644 index 0000000..981e693 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/lock.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *lock_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"` c #000000", +"a c #c08080", +"b c #FFc0c0", +"c c none", +"d c #FFc0c0", +"e c #804040", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccc```ccc", +"ccccccccc`daa`cc", +"cccccccc`da`bd`c", +"cccccccc`a`c`d`c", +"ccccccc`````````", +"ccccccc`dddaaae`", +"ccccccc`daa`aae`", +"ccccccc`da`eaae`", +"ccccccc`da`daee`", +"ccccccc`````````", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/print_color.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/print_color.xpm new file mode 100644 index 0000000..6662007 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/print_color.xpm @@ -0,0 +1,44 @@ +/* XPM */ +static char * print_color_xpm[] = { +"24 24 17 1", +" c None", +". c #FFFF00", +"+ c #C8FF00", +"@ c #00FF00", +"# c #FFC800", +"$ c #FF0000", +"% c #00FFFF", +"& c #000000", +"* c #FF00FF", +"= c #00FFC8", +"- c #FF00C8", +"; c #00C800", +"> c #C80000", +", c #0000C8", +"' c #0000FF", +") c #00C8FF", +"! c #C800FF", +" ...... ", +" .......... ", +" ............ ", +" .............. ", +" .............. ", +" ................ ", +" ................ ", +" ................ ", +" +@@@@@@+#$$$$$$# ", +" %@@@@@@@&&$$$$$$$* ", +" %%@@@@@@&&&&$$$$$$** ", +" %%%=@@@@&&&&&&$$$$-*** ", +" %%%%@@@;&&&&&&>$$$**** ", +"%%%%%%@@&&&&&&&&$$******", +"%%%%%%%@&&&&&&&&$*******", +"%%%%%%%%,&&&&&&,********", +"%%%%%%%%''''''''********", +"%%%%%%%%''''''''********", +"%%%%%%%%''''''''********", +" %%%%%%%)''''''!******* ", +" %%%%%%%%''''''******** ", +" %%%%%%%%''''******** ", +" %%%%%%%%''******** ", +" %%%%%% ****** "}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/print_gray.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/print_gray.xpm new file mode 100644 index 0000000..2c292d2 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/print_gray.xpm @@ -0,0 +1,44 @@ +/* XPM */ +static char * print_gray_xpm[] = { +"24 24 17 1", +" c None", +". c #E3E3E3", +"+ c #D2D2D2", +"@ c #969696", +"# c #C2C2C2", +"$ c #4C4C4C", +"% c #B2B2B2", +"& c #000000", +"* c #696969", +"= c #ACACAC", +"- c #626262", +"; c #767676", +"> c #3C3C3C", +", c #161616", +"' c #1C1C1C", +") c #929292", +"! c #585858", +" ...... ", +" .......... ", +" ............ ", +" .............. ", +" .............. ", +" ................ ", +" ................ ", +" ................ ", +" +@@@@@@+#$$$$$$# ", +" %@@@@@@@&&$$$$$$$* ", +" %%@@@@@@&&&&$$$$$$** ", +" %%%=@@@@&&&&&&$$$$-*** ", +" %%%%@@@;&&&&&&>$$$**** ", +"%%%%%%@@&&&&&&&&$$******", +"%%%%%%%@&&&&&&&&$*******", +"%%%%%%%%,&&&&&&,********", +"%%%%%%%%''''''''********", +"%%%%%%%%''''''''********", +"%%%%%%%%''''''''********", +" %%%%%%%)''''''!******* ", +" %%%%%%%%''''''******** ", +" %%%%%%%%''''******** ", +" %%%%%%%%''******** ", +" %%%%%% ****** "}; diff --git a/third_party/windows/fltk-1.1.10/fluid/pixmaps/protected.xpm b/third_party/windows/fltk-1.1.10/fluid/pixmaps/protected.xpm new file mode 100644 index 0000000..46baa6d --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/pixmaps/protected.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *protected_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"` c #000000", +"a c #80c080", +"b c #c0ffc0", +"c c none", +"d c #c0ffc0", +"e c #408040", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccc```ccc", +"ccccccccc`daa`cc", +"cccccccc`da`bd`c", +"cccccccc`a`c`d`c", +"ccccccc`````````", +"ccccccc`dddaaae`", +"ccccccc`daa`aae`", +"ccccccc`da`eaae`", +"ccccccc`da`daee`", +"ccccccc`````````", +"cccccccccccccccc" +}; diff --git a/third_party/windows/fltk-1.1.10/fluid/print_panel.cxx b/third_party/windows/fltk-1.1.10/fluid/print_panel.cxx new file mode 100644 index 0000000..19ce32b --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/print_panel.cxx @@ -0,0 +1,588 @@ +// +// "$Id$" +// +// FLUID print panel for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 +// + +// generated by Fast Light User Interface Designer (fluid) version 1.0110 + +#include "print_panel.h" +#include +#include +#include "../src/flstring.h" +#include +extern Fl_Preferences fluid_prefs; + +Fl_Double_Window *print_panel=(Fl_Double_Window *)0; + +Fl_Group *print_panel_controls=(Fl_Group *)0; + +Fl_Choice *print_choice=(Fl_Choice *)0; + +static void cb_print_choice(Fl_Choice*, void*) { + print_update_status(); +} + +Fl_Button *print_properties=(Fl_Button *)0; + +static void cb_print_properties(Fl_Button*, void*) { + print_properties_panel->show(); +} + +Fl_Box *print_status=(Fl_Box *)0; + +Fl_Round_Button *print_all=(Fl_Round_Button *)0; + +static void cb_print_all(Fl_Round_Button*, void*) { + print_from->deactivate(); +print_to->deactivate(); +} + +Fl_Round_Button *print_pages=(Fl_Round_Button *)0; + +static void cb_print_pages(Fl_Round_Button*, void*) { + print_from->activate(); +print_to->activate(); +} + +Fl_Round_Button *print_selection=(Fl_Round_Button *)0; + +static void cb_print_selection(Fl_Round_Button*, void*) { + print_from->deactivate(); +print_to->deactivate(); +} + +Fl_Input *print_from=(Fl_Input *)0; + +Fl_Input *print_to=(Fl_Input *)0; + +Fl_Spinner *print_copies=(Fl_Spinner *)0; + +static void cb_print_copies(Fl_Spinner*, void*) { + if (print_copies->value() == 1) { + print_collate_button->deactivate(); + print_collate_group[0]->deactivate(); + print_collate_group[1]->deactivate(); +} else { + print_collate_button->activate(); + print_collate_group[0]->activate(); + print_collate_group[1]->activate(); +}; +} + +Fl_Check_Button *print_collate_button=(Fl_Check_Button *)0; + +static void cb_print_collate_button(Fl_Check_Button*, void*) { + int i = print_collate_button->value() != 0; +print_collate_group[i]->show(); +print_collate_group[1 - i]->hide(); +} + +Fl_Group *print_collate_group[2]={(Fl_Group *)0}; + +static void cb_Cancel(Fl_Button*, void*) { + print_panel->hide(); +} + +Fl_Progress *print_progress=(Fl_Progress *)0; + +Fl_Double_Window *print_properties_panel=(Fl_Double_Window *)0; + +static void cb_print_properties_panel(Fl_Double_Window*, void*) { + print_properties_panel->hide(); +print_update_status(); +} + +Fl_Choice *print_page_size=(Fl_Choice *)0; + +Fl_Menu_Item menu_print_page_size[] = { + {"Letter", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, + {"A4", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, + {0,0,0,0,0,0,0,0,0} +}; + +#include +static const char *idata_print_color[] = { +"24 24 17 1", +" \tc None", +".\tc #FFFF00", +"+\tc #C8FF00", +"@\tc #00FF00", +"#\tc #FFC800", +"$\tc #FF0000", +"%\tc #00FFFF", +"&\tc #000000", +"*\tc #FF00FF", +"=\tc #00FFC8", +"-\tc #FF00C8", +";\tc #00C800", +">\tc #C80000", +",\tc #0000C8", +"\'\tc #0000FF", +")\tc #00C8FF", +"!\tc #C800FF", +" ...... ", +" .......... ", +" ............ ", +" .............. ", +" .............. ", +" ................ ", +" ................ ", +" ................ ", +" +@@@@@@+#$$$$$$# ", +" %@@@@@@@&&$$$$$$$* ", +" %%@@@@@@&&&&$$$$$$** ", +" %%%=@@@@&&&&&&$$$$-*** ", +" %%%%@@@;&&&&&&>$$$**** ", +"%%%%%%@@&&&&&&&&$$******", +"%%%%%%%@&&&&&&&&$*******", +"%%%%%%%%,&&&&&&,********", +"%%%%%%%%\'\'\'\'\'\'\'\'********", +"%%%%%%%%\'\'\'\'\'\'\'\'********", +"%%%%%%%%\'\'\'\'\'\'\'\'********", +" %%%%%%%)\'\'\'\'\'\'!******* ", +" %%%%%%%%\'\'\'\'\'\'******** ", +" %%%%%%%%\'\'\'\'******** ", +" %%%%%%%%\'\'******** ", +" %%%%%% ****** " +}; +static Fl_Pixmap image_print_color(idata_print_color); + +static const char *idata_print_gray[] = { +"24 24 17 1", +" \tc None", +".\tc #E3E3E3", +"+\tc #D2D2D2", +"@\tc #969696", +"#\tc #C2C2C2", +"$\tc #4C4C4C", +"%\tc #B2B2B2", +"&\tc #000000", +"*\tc #696969", +"=\tc #ACACAC", +"-\tc #626262", +";\tc #767676", +">\tc #3C3C3C", +",\tc #161616", +"\'\tc #1C1C1C", +")\tc #929292", +"!\tc #585858", +" ...... ", +" .......... ", +" ............ ", +" .............. ", +" .............. ", +" ................ ", +" ................ ", +" ................ ", +" +@@@@@@+#$$$$$$# ", +" %@@@@@@@&&$$$$$$$* ", +" %%@@@@@@&&&&$$$$$$** ", +" %%%=@@@@&&&&&&$$$$-*** ", +" %%%%@@@;&&&&&&>$$$**** ", +"%%%%%%@@&&&&&&&&$$******", +"%%%%%%%@&&&&&&&&$*******", +"%%%%%%%%,&&&&&&,********", +"%%%%%%%%\'\'\'\'\'\'\'\'********", +"%%%%%%%%\'\'\'\'\'\'\'\'********", +"%%%%%%%%\'\'\'\'\'\'\'\'********", +" %%%%%%%)\'\'\'\'\'\'!******* ", +" %%%%%%%%\'\'\'\'\'\'******** ", +" %%%%%%%%\'\'\'\'******** ", +" %%%%%%%%\'\'******** ", +" %%%%%% ****** " +}; +static Fl_Pixmap image_print_gray(idata_print_gray); + +Fl_Button *print_output_mode[4]={(Fl_Button *)0}; + +static void cb_Save(Fl_Return_Button*, void*) { + print_properties_panel->hide(); + +char name[1024]; +int val; +const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data(); + +snprintf(name, sizeof(name), "%s/page_size", printer); +fluid_prefs.set(name, print_page_size->value()); + +snprintf(name, sizeof(name), "%s/output_mode", printer); +for (val = 0; val < 4; val ++) { + if (print_output_mode[val]->value()) break; +} +fluid_prefs.set(name, val); +} + +static void cb_Cancel1(Fl_Button*, void*) { + print_properties_panel->hide(); +print_update_status(); +} + +static void cb_Use(Fl_Button*, void*) { + print_properties_panel->hide(); +} + +Fl_Double_Window* make_print_panel() { + { print_panel = new Fl_Double_Window(465, 235, "Print"); + { print_panel_controls = new Fl_Group(10, 10, 447, 216); + { print_choice = new Fl_Choice(113, 10, 181, 25, "Printer:"); + print_choice->down_box(FL_BORDER_BOX); + print_choice->labelfont(1); + print_choice->callback((Fl_Callback*)cb_print_choice); + print_choice->when(FL_WHEN_CHANGED); + } // Fl_Choice* print_choice + { print_properties = new Fl_Button(294, 10, 105, 25, "Properties..."); + print_properties->callback((Fl_Callback*)cb_print_properties); + } // Fl_Button* print_properties + { print_status = new Fl_Box(111, 41, 288, 17, "printer/job status"); + print_status->align(68|FL_ALIGN_INSIDE); + } // Fl_Box* print_status + { Fl_Group* o = new Fl_Group(10, 86, 227, 105, "Print Range"); + o->box(FL_THIN_DOWN_BOX); + o->labelfont(1); + o->align(FL_ALIGN_TOP_LEFT); + { print_all = new Fl_Round_Button(20, 96, 38, 25, "All"); + print_all->type(102); + print_all->down_box(FL_ROUND_DOWN_BOX); + print_all->value(1); + print_all->callback((Fl_Callback*)cb_print_all); + } // Fl_Round_Button* print_all + { print_pages = new Fl_Round_Button(20, 126, 64, 25, "Pages"); + print_pages->type(102); + print_pages->down_box(FL_ROUND_DOWN_BOX); + print_pages->callback((Fl_Callback*)cb_print_pages); + } // Fl_Round_Button* print_pages + { print_selection = new Fl_Round_Button(20, 156, 82, 25, "Selection"); + print_selection->type(102); + print_selection->down_box(FL_ROUND_DOWN_BOX); + print_selection->callback((Fl_Callback*)cb_print_selection); + } // Fl_Round_Button* print_selection + { print_from = new Fl_Input(136, 126, 28, 25, "From:"); + print_from->type(2); + print_from->textfont(4); + print_from->deactivate(); + } // Fl_Input* print_from + { print_to = new Fl_Input(199, 126, 28, 25, "To:"); + print_to->type(2); + print_to->textfont(4); + print_to->deactivate(); + } // Fl_Input* print_to + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(247, 86, 210, 105, "Copies"); + o->box(FL_THIN_DOWN_BOX); + o->labelfont(1); + o->align(FL_ALIGN_TOP_LEFT); + { print_copies = new Fl_Spinner(321, 96, 45, 25, "# Copies:"); + print_copies->callback((Fl_Callback*)cb_print_copies); + print_copies->when(FL_WHEN_CHANGED); + } // Fl_Spinner* print_copies + { print_collate_button = new Fl_Check_Button(376, 96, 64, 25, "Collate"); + print_collate_button->down_box(FL_DOWN_BOX); + print_collate_button->callback((Fl_Callback*)cb_print_collate_button); + print_collate_button->when(FL_WHEN_CHANGED); + print_collate_button->deactivate(); + } // Fl_Check_Button* print_collate_button + { print_collate_group[0] = new Fl_Group(257, 131, 191, 50); + print_collate_group[0]->deactivate(); + { Fl_Box* o = new Fl_Box(287, 141, 30, 40, "1"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + o->deactivate(); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(272, 136, 30, 40, "1"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + o->deactivate(); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(257, 131, 30, 40, "1"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + o->deactivate(); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(352, 141, 30, 40, "2"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + o->deactivate(); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(337, 136, 30, 40, "2"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + o->deactivate(); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(322, 131, 30, 40, "2"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + o->deactivate(); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(417, 141, 30, 40, "3"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + o->deactivate(); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(402, 136, 30, 40, "3"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + o->deactivate(); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(387, 131, 30, 40, "3"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + o->deactivate(); + } // Fl_Box* o + print_collate_group[0]->end(); + } // Fl_Group* print_collate_group[0] + { print_collate_group[1] = new Fl_Group(257, 131, 191, 50); + print_collate_group[1]->hide(); + print_collate_group[1]->deactivate(); + { Fl_Box* o = new Fl_Box(287, 141, 30, 40, "3"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(272, 136, 30, 40, "2"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(257, 131, 30, 40, "1"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(352, 141, 30, 40, "3"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(337, 136, 30, 40, "2"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(322, 131, 30, 40, "1"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(417, 141, 30, 40, "3"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(402, 136, 30, 40, "2"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + } // Fl_Box* o + { Fl_Box* o = new Fl_Box(387, 131, 30, 40, "1"); + o->box(FL_BORDER_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->labelsize(11); + o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE); + } // Fl_Box* o + print_collate_group[1]->end(); + } // Fl_Group* print_collate_group[1] + o->end(); + } // Fl_Group* o + { Fl_Return_Button* o = new Fl_Return_Button(309, 201, 70, 25, "Print"); + o->callback((Fl_Callback*)print_cb); + } // Fl_Return_Button* o + { Fl_Button* o = new Fl_Button(389, 201, 68, 25, "Cancel"); + o->callback((Fl_Callback*)cb_Cancel); + } // Fl_Button* o + print_panel_controls->end(); + } // Fl_Group* print_panel_controls + { print_progress = new Fl_Progress(10, 203, 289, 21); + print_progress->selection_color((Fl_Color)4); + print_progress->hide(); + } // Fl_Progress* print_progress + print_panel->set_modal(); + print_panel->end(); + } // Fl_Double_Window* print_panel + { print_properties_panel = new Fl_Double_Window(290, 130, "Printer Properties"); + print_properties_panel->callback((Fl_Callback*)cb_print_properties_panel); + { print_page_size = new Fl_Choice(110, 10, 80, 25, "Page Size:"); + print_page_size->down_box(FL_BORDER_BOX); + print_page_size->labelfont(1); + print_page_size->menu(menu_print_page_size); + } // Fl_Choice* print_page_size + { Fl_Group* o = new Fl_Group(110, 45, 170, 40, "Output Mode:"); + o->labelfont(1); + o->align(FL_ALIGN_LEFT); + { print_output_mode[0] = new Fl_Button(110, 45, 30, 40); + print_output_mode[0]->type(102); + print_output_mode[0]->box(FL_BORDER_BOX); + print_output_mode[0]->down_box(FL_BORDER_BOX); + print_output_mode[0]->value(1); + print_output_mode[0]->color(FL_BACKGROUND2_COLOR); + print_output_mode[0]->selection_color(FL_FOREGROUND_COLOR); + print_output_mode[0]->image(image_print_color); + } // Fl_Button* print_output_mode[0] + { print_output_mode[1] = new Fl_Button(150, 50, 40, 30); + print_output_mode[1]->type(102); + print_output_mode[1]->box(FL_BORDER_BOX); + print_output_mode[1]->down_box(FL_BORDER_BOX); + print_output_mode[1]->color(FL_BACKGROUND2_COLOR); + print_output_mode[1]->selection_color(FL_FOREGROUND_COLOR); + print_output_mode[1]->image(image_print_color); + } // Fl_Button* print_output_mode[1] + { print_output_mode[2] = new Fl_Button(200, 45, 30, 40); + print_output_mode[2]->type(102); + print_output_mode[2]->box(FL_BORDER_BOX); + print_output_mode[2]->down_box(FL_BORDER_BOX); + print_output_mode[2]->color(FL_BACKGROUND2_COLOR); + print_output_mode[2]->selection_color(FL_FOREGROUND_COLOR); + print_output_mode[2]->image(image_print_gray); + } // Fl_Button* print_output_mode[2] + { print_output_mode[3] = new Fl_Button(240, 50, 40, 30); + print_output_mode[3]->type(102); + print_output_mode[3]->box(FL_BORDER_BOX); + print_output_mode[3]->down_box(FL_BORDER_BOX); + print_output_mode[3]->color(FL_BACKGROUND2_COLOR); + print_output_mode[3]->selection_color(FL_FOREGROUND_COLOR); + print_output_mode[3]->image(image_print_gray); + } // Fl_Button* print_output_mode[3] + o->end(); + } // Fl_Group* o + { Fl_Return_Button* o = new Fl_Return_Button(123, 95, 79, 25, "Save"); + o->callback((Fl_Callback*)cb_Save); + } // Fl_Return_Button* o + { Fl_Button* o = new Fl_Button(212, 95, 68, 25, "Cancel"); + o->callback((Fl_Callback*)cb_Cancel1); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(60, 95, 53, 25, "Use"); + o->callback((Fl_Callback*)cb_Use); + } // Fl_Button* o + print_properties_panel->set_modal(); + print_properties_panel->end(); + } // Fl_Double_Window* print_properties_panel + return print_properties_panel; +} +void print_cb(Fl_Return_Button *, void *); + +void print_load() { + FILE *lpstat; +char line[1024], name[1024], *nptr, qname[2048], *qptr, defname[1024]; +int i; + +if (print_choice->size() > 1) { + for (i = 1; print_choice->text(i); i ++) { + free(print_choice->menu()[i].user_data()); + } +} + +print_choice->clear(); +print_choice->add("Print To File", 0, 0, 0, FL_MENU_DIVIDER); +print_choice->value(0); + +defname[0] = '\0'; + +if ((lpstat = popen("lpstat -p -d", "r")) != NULL) { + while (fgets(line, sizeof(line), lpstat)) { + if (!strncmp(line, "printer ", 8) && + sscanf(line + 8, "%s", name) == 1) { + for (nptr = name, qptr = qname; *nptr; *qptr++ = *nptr++) { + if (*nptr == '/') *qptr++ = '\\'; + } + *qptr = '\0'; + + print_choice->add(qname, 0, 0, (void *)strdup(name), 0); + } else if (!strncmp(line, "system default destination: ", 28)) { + if (sscanf(line + 28, "%s", defname) != 1) defname[0] = '\0'; + } + } + pclose(lpstat); +} + +if (defname[0]) { + for (i = 1; print_choice->text(i); i ++) { + if (!strcmp((char *)print_choice->menu()[i].user_data(), defname)) { + print_choice->value(i); + break; + } + } +} else if (print_choice->size() > 2) print_choice->value(1); + + +print_update_status(); +} + +void print_update_status() { + FILE *lpstat; +char command[1024]; +static char status[1024]; +const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data(); + +if (print_choice->value()) { + snprintf(command, sizeof(command), "lpstat -p '%s'", printer); + if ((lpstat = popen(command, "r")) != NULL) { + fgets(status, sizeof(status), lpstat); + pclose(lpstat); + } else strcpy(status, "printer status unavailable"); +} else status[0] = '\0'; + +print_status->label(status); + +char name[1024]; +int val; + +snprintf(name, sizeof(name), "%s/page_size", printer); +fluid_prefs.get(name, val, 0); +print_page_size->value(val); + +snprintf(name, sizeof(name), "%s/output_mode", printer); +fluid_prefs.get(name, val, 0); +print_output_mode[val]->setonly(); +} + +// +// End of "$Id$". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/print_panel.fl b/third_party/windows/fltk-1.1.10/fluid/print_panel.fl new file mode 100644 index 0000000..b647fd6 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/print_panel.fl @@ -0,0 +1,370 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0107 +header_name {.h} +code_name {.cxx} +comment {// +// "$Id$" +// +// FLUID print panel for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 +// +} {in_source in_header +} + +decl {\#include } {} + +decl {\#include } {} + +decl {\#include "../src/flstring.h"} {} + +decl {\#include } {} + +decl {extern Fl_Preferences fluid_prefs;} {} + +Function {make_print_panel()} {open +} { + Fl_Window print_panel { + label Print open + xywh {342 21 465 235} type Double modal visible + } { + Fl_Group print_panel_controls {open + xywh {10 10 447 216} + } { + Fl_Choice print_choice { + label {Printer:} + callback {print_update_status();} open + xywh {113 10 181 25} down_box BORDER_BOX labelfont 1 when 1 + } {} + Fl_Button print_properties { + label {Properties...} + callback {print_properties_panel->show();} + xywh {294 10 105 25} + } + Fl_Box print_status { + label {printer/job status} + xywh {111 41 288 17} align 84 + } + Fl_Group {} { + label {Print Range} open + xywh {10 86 227 105} box THIN_DOWN_BOX labelfont 1 align 5 + } { + Fl_Round_Button print_all { + label All + callback {print_from->deactivate(); +print_to->deactivate();} + xywh {20 96 38 25} type Radio down_box ROUND_DOWN_BOX value 1 + } + Fl_Round_Button print_pages { + label Pages + callback {print_from->activate(); +print_to->activate();} + xywh {20 126 64 25} type Radio down_box ROUND_DOWN_BOX + } + Fl_Round_Button print_selection { + label Selection + callback {print_from->deactivate(); +print_to->deactivate();} + xywh {20 156 82 25} type Radio down_box ROUND_DOWN_BOX + } + Fl_Input print_from { + label {From:} + xywh {136 126 28 25} type Int textfont 4 deactivate + } + Fl_Input print_to { + label {To:} + xywh {199 126 28 25} type Int textfont 4 deactivate + } + } + Fl_Group {} { + label Copies open + xywh {247 86 210 105} box THIN_DOWN_BOX labelfont 1 align 5 + } { + Fl_Spinner print_copies { + label {\# Copies:} + callback {if (print_copies->value() == 1) { + print_collate_button->deactivate(); + print_collate_group[0]->deactivate(); + print_collate_group[1]->deactivate(); +} else { + print_collate_button->activate(); + print_collate_group[0]->activate(); + print_collate_group[1]->activate(); +}} selected + xywh {321 96 45 25} when 1 + } + Fl_Check_Button print_collate_button { + label Collate + callback {int i = print_collate_button->value() != 0; +print_collate_group[i]->show(); +print_collate_group[1 - i]->hide();} + xywh {376 96 64 25} down_box DOWN_BOX when 1 deactivate + } + Fl_Group {print_collate_group[0]} { + xywh {257 131 191 50} deactivate + } { + Fl_Box {} { + label 1 + xywh {287 141 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate + } + Fl_Box {} { + label 1 + xywh {272 136 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate + } + Fl_Box {} { + label 1 + xywh {257 131 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate + } + Fl_Box {} { + label 2 + xywh {352 141 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate + } + Fl_Box {} { + label 2 + xywh {337 136 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate + } + Fl_Box {} { + label 2 + xywh {322 131 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate + } + Fl_Box {} { + label 3 + xywh {417 141 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate + } + Fl_Box {} { + label 3 + xywh {402 136 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate + } + Fl_Box {} { + label 3 + xywh {387 131 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate + } + } + Fl_Group {print_collate_group[1]} { + xywh {257 131 191 50} hide deactivate + } { + Fl_Box {} { + label 3 + xywh {287 141 30 40} box BORDER_BOX color 7 labelsize 11 align 26 + } + Fl_Box {} { + label 2 + xywh {272 136 30 40} box BORDER_BOX color 7 labelsize 11 align 26 + } + Fl_Box {} { + label 1 + xywh {257 131 30 40} box BORDER_BOX color 7 labelsize 11 align 26 + } + Fl_Box {} { + label 3 + xywh {352 141 30 40} box BORDER_BOX color 7 labelsize 11 align 26 + } + Fl_Box {} { + label 2 + xywh {337 136 30 40} box BORDER_BOX color 7 labelsize 11 align 26 + } + Fl_Box {} { + label 1 + xywh {322 131 30 40} box BORDER_BOX color 7 labelsize 11 align 26 + } + Fl_Box {} { + label 3 + xywh {417 141 30 40} box BORDER_BOX color 7 labelsize 11 align 26 + } + Fl_Box {} { + label 2 + xywh {402 136 30 40} box BORDER_BOX color 7 labelsize 11 align 26 + } + Fl_Box {} { + label 1 + xywh {387 131 30 40} box BORDER_BOX color 7 labelsize 11 align 26 + } + } + } + Fl_Return_Button {} { + label Print + callback print_cb + xywh {309 201 70 25} + } + Fl_Button {} { + label Cancel + callback {print_panel->hide();} + xywh {389 201 68 25} + } + } + Fl_Progress print_progress { + xywh {10 203 289 21} selection_color 4 hide + } + } + Fl_Window print_properties_panel { + label {Printer Properties} + callback {print_properties_panel->hide(); +print_update_status();} open + xywh {340 213 290 130} type Double modal visible + } { + Fl_Choice print_page_size { + label {Page Size:} + xywh {110 10 80 25} down_box BORDER_BOX labelfont 1 + } { + MenuItem {} { + label Letter + xywh {0 0 35 25} + } + MenuItem {} { + label A4 + xywh {0 0 35 25} + } + } + Fl_Group {} { + label {Output Mode:} open + xywh {110 45 170 40} labelfont 1 align 4 + } { + Fl_Button {print_output_mode[0]} { + image {pixmaps/print_color.xpm} xywh {110 45 30 40} type Radio box BORDER_BOX down_box BORDER_BOX value 1 color 7 selection_color 0 + } + Fl_Button {print_output_mode[1]} { + image {pixmaps/print_color.xpm} xywh {150 50 40 30} type Radio box BORDER_BOX down_box BORDER_BOX color 7 selection_color 0 + } + Fl_Button {print_output_mode[2]} { + image {pixmaps/print_gray.xpm} xywh {200 45 30 40} type Radio box BORDER_BOX down_box BORDER_BOX color 7 selection_color 0 + } + Fl_Button {print_output_mode[3]} { + image {pixmaps/print_gray.xpm} xywh {240 50 40 30} type Radio box BORDER_BOX down_box BORDER_BOX color 7 selection_color 0 + } + } + Fl_Return_Button {} { + label Save + callback {print_properties_panel->hide(); + +char name[1024]; +int val; +const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data(); + +snprintf(name, sizeof(name), "%s/page_size", printer); +fluid_prefs.set(name, print_page_size->value()); + +snprintf(name, sizeof(name), "%s/output_mode", printer); +for (val = 0; val < 4; val ++) { + if (print_output_mode[val]->value()) break; +} +fluid_prefs.set(name, val);} + xywh {123 95 79 25} + } + Fl_Button {} { + label Cancel + callback {print_properties_panel->hide(); +print_update_status();} + xywh {212 95 68 25} + } + Fl_Button {} { + label Use + callback {print_properties_panel->hide();} + xywh {60 95 53 25} + } + } +} + +decl {void print_cb(Fl_Return_Button *, void *);} {public +} + +Function {print_load()} {open return_type void +} { + code {FILE *lpstat; +char line[1024], name[1024], *nptr, qname[2048], *qptr, defname[1024]; +int i; + +if (print_choice->size() > 1) { + for (i = 1; print_choice->text(i); i ++) { + free(print_choice->menu()[i].user_data()); + } +} + +print_choice->clear(); +print_choice->add("Print To File", 0, 0, 0, FL_MENU_DIVIDER); +print_choice->value(0); + +defname[0] = '\\0'; + +if ((lpstat = popen("lpstat -p -d", "r")) != NULL) { + while (fgets(line, sizeof(line), lpstat)) { + if (!strncmp(line, "printer ", 8) && + sscanf(line + 8, "%s", name) == 1) { + for (nptr = name, qptr = qname; *nptr; *qptr++ = *nptr++) { + if (*nptr == '/') *qptr++ = '\\\\'; + } + *qptr = '\\0'; + + print_choice->add(qname, 0, 0, (void *)strdup(name), 0); + } else if (!strncmp(line, "system default destination: ", 28)) { + if (sscanf(line + 28, "%s", defname) != 1) defname[0] = '\\0'; + } + } + pclose(lpstat); +} + +if (defname[0]) { + for (i = 1; print_choice->text(i); i ++) { + if (!strcmp((char *)print_choice->menu()[i].user_data(), defname)) { + print_choice->value(i); + break; + } + } +} else if (print_choice->size() > 2) print_choice->value(1); + + +print_update_status();} {} +} + +Function {print_update_status()} {open return_type void +} { + code {FILE *lpstat; +char command[1024]; +static char status[1024]; +const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data(); + +if (print_choice->value()) { + snprintf(command, sizeof(command), "lpstat -p '%s'", printer); + if ((lpstat = popen(command, "r")) != NULL) { + fgets(status, sizeof(status), lpstat); + pclose(lpstat); + } else strcpy(status, "printer status unavailable"); +} else status[0] = '\\0'; + +print_status->label(status); + +char name[1024]; +int val; + +snprintf(name, sizeof(name), "%s/page_size", printer); +fluid_prefs.get(name, val, 0); +print_page_size->value(val); + +snprintf(name, sizeof(name), "%s/output_mode", printer); +fluid_prefs.get(name, val, 0); +print_output_mode[val]->setonly();} {} +} + +comment { +// +// End of "$Id$". +//} {in_source in_header +} diff --git a/third_party/windows/fltk-1.1.10/fluid/print_panel.h b/third_party/windows/fltk-1.1.10/fluid/print_panel.h new file mode 100644 index 0000000..dbbbeb7 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/print_panel.h @@ -0,0 +1,71 @@ +// +// "$Id$" +// +// FLUID print panel for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 +// + +// generated by Fast Light User Interface Designer (fluid) version 1.0110 + +#ifndef print_panel_h +#define print_panel_h +#include +#include +extern Fl_Double_Window *print_panel; +#include +extern Fl_Group *print_panel_controls; +#include +extern Fl_Choice *print_choice; +#include +extern Fl_Button *print_properties; +#include +extern Fl_Box *print_status; +#include +extern Fl_Round_Button *print_all; +extern Fl_Round_Button *print_pages; +extern Fl_Round_Button *print_selection; +#include +extern Fl_Input *print_from; +extern Fl_Input *print_to; +#include +extern Fl_Spinner *print_copies; +#include +extern Fl_Check_Button *print_collate_button; +extern Fl_Group *print_collate_group[2]; +#include +extern void print_cb(Fl_Return_Button*, void*); +#include +extern Fl_Progress *print_progress; +extern Fl_Double_Window *print_properties_panel; +extern Fl_Choice *print_page_size; +extern Fl_Button *print_output_mode[4]; +Fl_Double_Window* make_print_panel(); +extern Fl_Menu_Item menu_print_page_size[]; +extern void print_cb(Fl_Return_Button *, void *); +void print_load(); +void print_update_status(); +#endif + +// +// End of "$Id$". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/template_panel.cxx b/third_party/windows/fltk-1.1.10/fluid/template_panel.cxx new file mode 100644 index 0000000..52cb8a0 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/template_panel.cxx @@ -0,0 +1,258 @@ +// +// "$Id$" +// +// FLUID template support for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 +// + +// generated by Fast Light User Interface Designer (fluid) version 1.0110 + +#include "template_panel.h" +#include +#include +#include "../src/flstring.h" +#include +#include +#include +#include +#include +#if defined(WIN32) && !defined(__CYGWIN__) +#include +#else +#include +#endif // WIN32 && !__CYGWIN__ +extern Fl_Preferences fluid_prefs; + +Fl_Double_Window *template_panel=(Fl_Double_Window *)0; + +static void cb_template_panel(Fl_Double_Window*, void*) { + Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image(); +if (img) img->release(); +template_preview->image(0); + +template_browser->deselect(); +template_name->value(""); +template_instance->value(""); +template_panel->hide(); +} + +Fl_Browser *template_browser=(Fl_Browser *)0; + +static void cb_template_browser(Fl_Browser*, void*) { + if (Fl::event_clicks()) { + template_panel->hide(); + return; +} +Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image(); +if (img) img->release(); +template_preview->image(0); +template_preview->redraw(); + +int item = template_browser->value(); + +if (item <= 1) template_instance->deactivate(); +else template_instance->activate(); + +if (item < 1) { + template_submit->deactivate(); + template_delete->deactivate(); + return; +} + +template_submit->activate(); + +const char *flfile = (const char *)template_browser->data(item); +if (!flfile) { + template_delete->deactivate(); + return; +} + +template_name->value(template_browser->text(item)); + +template_delete->activate(); + +char pngfile[1024], *ext; + +strlcpy(pngfile, flfile, sizeof(pngfile)); +if ((ext = strrchr(pngfile, '.')) == NULL) return; +strcpy(ext, ".png"); + +img = Fl_Shared_Image::get(pngfile); + +if (img) { + template_preview->image(img); + template_preview->redraw(); +}; +} + +Fl_Box *template_preview=(Fl_Box *)0; + +Fl_Input *template_name=(Fl_Input *)0; + +static void cb_template_name(Fl_Input*, void*) { + if (strlen(template_name->value())) { + template_submit->activate(); + if (Fl::event_key() == FL_Enter) template_panel->hide(); +} else template_submit->deactivate(); +} + +Fl_Input *template_instance=(Fl_Input *)0; + +Fl_Button *template_delete=(Fl_Button *)0; + +static void cb_Cancel(Fl_Button*, void*) { + Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image(); +if (img) img->release(); +template_preview->image(0); + +template_browser->deselect(); +template_name->value(""); +template_instance->value(""); +template_panel->hide(); +} + +Fl_Return_Button *template_submit=(Fl_Return_Button *)0; + +static void cb_template_submit(Fl_Return_Button*, void*) { + Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image(); +if (img) img->release(); +template_preview->image(0); + +template_panel->hide(); +} + +Fl_Double_Window* make_template_panel() { + { template_panel = new Fl_Double_Window(460, 355, "New/Save Template"); + template_panel->callback((Fl_Callback*)cb_template_panel); + { template_browser = new Fl_Browser(10, 28, 180, 250, "Available Templates:"); + template_browser->type(2); + template_browser->labelfont(1); + template_browser->callback((Fl_Callback*)cb_template_browser); + template_browser->align(FL_ALIGN_TOP_LEFT); + template_browser->when(3); + } // Fl_Browser* template_browser + { template_preview = new Fl_Box(200, 28, 250, 250); + template_preview->box(FL_THIN_DOWN_BOX); + template_preview->align(69|FL_ALIGN_INSIDE); + Fl_Group::current()->resizable(template_preview); + } // Fl_Box* template_preview + { template_name = new Fl_Input(124, 288, 326, 25, "Template Name:"); + template_name->labelfont(1); + template_name->textfont(4); + template_name->callback((Fl_Callback*)cb_template_name); + template_name->when(3); + } // Fl_Input* template_name + { template_instance = new Fl_Input(124, 288, 326, 25, "Instance Name:"); + template_instance->labelfont(1); + template_instance->textfont(4); + template_instance->hide(); + } // Fl_Input* template_instance + { Fl_Group* o = new Fl_Group(10, 323, 440, 25); + { template_delete = new Fl_Button(10, 323, 133, 25, "Delete Template"); + template_delete->callback((Fl_Callback*)template_delete_cb); + } // Fl_Button* template_delete + { Fl_Box* o = new Fl_Box(153, 323, 126, 25); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + { Fl_Button* o = new Fl_Button(289, 323, 72, 25, "Cancel"); + o->callback((Fl_Callback*)cb_Cancel); + } // Fl_Button* o + { template_submit = new Fl_Return_Button(371, 323, 79, 25, "Save"); + template_submit->callback((Fl_Callback*)cb_template_submit); + } // Fl_Return_Button* template_submit + o->end(); + } // Fl_Group* o + template_panel->set_modal(); + template_panel->end(); + } // Fl_Double_Window* template_panel + return template_panel; +} + +void template_clear() { + int i; +void *filename; + +for (i = 1; i <= template_browser->size(); i ++) { + if ((filename = template_browser->data(i)) != NULL) free(filename); +} + +template_browser->deselect(); +template_browser->clear(); +} + +void template_delete_cb(Fl_Button *, void *) { + int item = template_browser->value(); +if (item < 1) return; + +const char *name = template_browser->text(item); +const char *flfile = (const char *)template_browser->data(item); +if (!flfile) return; + +if (!fl_choice("Are you sure you want to delete the template \"%s\"?", + "Cancel", "Delete", 0, name)) return; + +if (unlink(flfile)) { + fl_alert("Unable to delete template \"%s\":\n%s", name, strerror(errno)); + return; +} + +template_browser->remove(item); +template_browser->do_callback(); +} + +void template_load() { + int i; +char name[1024], filename[1024], path[1024], *ptr; +struct dirent **files; +int num_files; + +fluid_prefs.getUserdataPath(path, sizeof(path)); +strlcat(path, "templates", sizeof(path)); + +num_files = fl_filename_list(path, &files); + +for (i = 0; i < num_files; i ++) { + if (fl_filename_match(files[i]->d_name, "*.fl")) { + // Format the name as the filename with "_" replaced with " " + // and without the trailing ".fl"... + strlcpy(name, files[i]->d_name, sizeof(name)); + *strstr(name, ".fl") = '\0'; + + for (ptr = name; *ptr; ptr ++) { + if (*ptr == '_') *ptr = ' '; + } + + // Add the template to the browser... + snprintf(filename, sizeof(filename), "%s/%s", path, files[i]->d_name); + template_browser->add(name, strdup(filename)); + } + + free(files[i]); +} + +if (num_files > 0) free(files); +} + +// +// End of "$Id$". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/template_panel.fl b/third_party/windows/fltk-1.1.10/fluid/template_panel.fl new file mode 100644 index 0000000..ae2e2b7 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/template_panel.fl @@ -0,0 +1,244 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0107 +header_name {.h} +code_name {.cxx} +comment {// +// "$Id$" +// +// FLUID template support for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 +// +} {in_source in_header +} + +decl {\#include } {} + +decl {\#include } {} + +decl {\#include "../src/flstring.h"} {} + +decl {\#include } {} + +decl {\#include } {} + +decl {\#include } {} + +decl {\#include } {} + +decl {\#include } {} + +declblock {\#if defined(WIN32) && !defined(__CYGWIN__)} {selected after {\#endif // WIN32 && !__CYGWIN__} +} { + decl {\#include } {} + decl {\#else} {} + decl {\#include } {} +} + +decl {extern Fl_Preferences fluid_prefs;} {} + +Function {make_template_panel()} {open +} { + Fl_Window template_panel { + label {New/Save Template} + callback {Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image(); +if (img) img->release(); +template_preview->image(0); + +template_browser->deselect(); +template_name->value(""); +template_instance->value(""); +template_panel->hide();} open + xywh {340 237 460 355} type Double resizable modal visible + } { + Fl_Browser template_browser { + label {Available Templates:} + callback {if (Fl::event_clicks()) { + template_panel->hide(); + return; +} +Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image(); +if (img) img->release(); +template_preview->image(0); +template_preview->redraw(); + +int item = template_browser->value(); + +if (item <= 1) template_instance->deactivate(); +else template_instance->activate(); + +if (item < 1) { + template_submit->deactivate(); + template_delete->deactivate(); + return; +} + +template_submit->activate(); + +const char *flfile = (const char *)template_browser->data(item); +if (!flfile) { + template_delete->deactivate(); + return; +} + +template_name->value(template_browser->text(item)); + +template_delete->activate(); + +char pngfile[1024], *ext; + +strlcpy(pngfile, flfile, sizeof(pngfile)); +if ((ext = strrchr(pngfile, '.')) == NULL) return; +strcpy(ext, ".png"); + +img = Fl_Shared_Image::get(pngfile); + +if (img) { + template_preview->image(img); + template_preview->redraw(); +}} + xywh {10 28 180 250} type Hold labelfont 1 align 5 when 3 + } + Fl_Box template_preview { + xywh {200 28 250 250} box THIN_DOWN_BOX align 85 resizable + } + Fl_Input template_name { + label {Template Name:} + callback {if (strlen(template_name->value())) { + template_submit->activate(); + if (Fl::event_key() == FL_Enter) template_panel->hide(); +} else template_submit->deactivate();} + xywh {124 288 326 25} labelfont 1 when 3 textfont 4 + } + Fl_Input template_instance { + label {Instance Name:} + xywh {124 288 326 25} labelfont 1 textfont 4 hide + } + Fl_Group {} { + xywh {10 323 440 25} + } { + Fl_Button template_delete { + label {Delete Template} + callback template_delete_cb + xywh {10 323 133 25} + } + Fl_Box {} { + xywh {153 323 126 25} resizable + } + Fl_Button {} { + label Cancel + callback {Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image(); +if (img) img->release(); +template_preview->image(0); + +template_browser->deselect(); +template_name->value(""); +template_instance->value(""); +template_panel->hide();} + xywh {289 323 72 25} + } + Fl_Return_Button template_submit { + label Save + callback {Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image(); +if (img) img->release(); +template_preview->image(0); + +template_panel->hide();} + xywh {371 323 79 25} + } + } + } +} + +Function {template_clear()} {return_type void +} { + code {int i; +void *filename; + +for (i = 1; i <= template_browser->size(); i ++) { + if ((filename = template_browser->data(i)) != NULL) free(filename); +} + +template_browser->deselect(); +template_browser->clear();} {} +} + +Function {template_delete_cb(Fl_Button *, void *)} {return_type void +} { + code {int item = template_browser->value(); +if (item < 1) return; + +const char *name = template_browser->text(item); +const char *flfile = (const char *)template_browser->data(item); +if (!flfile) return; + +if (!fl_choice("Are you sure you want to delete the template \\"%s\\"?", + "Cancel", "Delete", 0, name)) return; + +if (unlink(flfile)) { + fl_alert("Unable to delete template \\"%s\\":\\n%s", name, strerror(errno)); + return; +} + +template_browser->remove(item); +template_browser->do_callback();} {} +} + +Function {template_load()} {open return_type void +} { + code {int i; +char name[1024], filename[1024], path[1024], *ptr; +struct dirent **files; +int num_files; + +fluid_prefs.getUserdataPath(path, sizeof(path)); +strlcat(path, "templates", sizeof(path)); + +num_files = fl_filename_list(path, &files); + +for (i = 0; i < num_files; i ++) { + if (fl_filename_match(files[i]->d_name, "*.fl")) { + // Format the name as the filename with "_" replaced with " " + // and without the trailing ".fl"... + strlcpy(name, files[i]->d_name, sizeof(name)); + *strstr(name, ".fl") = '\\0'; + + for (ptr = name; *ptr; ptr ++) { + if (*ptr == '_') *ptr = ' '; + } + + // Add the template to the browser... + snprintf(filename, sizeof(filename), "%s/%s", path, files[i]->d_name); + template_browser->add(name, strdup(filename)); + } + + free(files[i]); +} + +if (num_files > 0) free(files);} {} +} + +comment { +// +// End of "$Id$". +//} {in_source in_header +} diff --git a/third_party/windows/fltk-1.1.10/fluid/template_panel.h b/third_party/windows/fltk-1.1.10/fluid/template_panel.h new file mode 100644 index 0000000..1c7d07d --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/template_panel.h @@ -0,0 +1,55 @@ +// +// "$Id$" +// +// FLUID template support for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 +// + +// generated by Fast Light User Interface Designer (fluid) version 1.0110 + +#ifndef template_panel_h +#define template_panel_h +#include +#include +extern Fl_Double_Window *template_panel; +#include +extern Fl_Browser *template_browser; +#include +extern Fl_Box *template_preview; +#include +extern Fl_Input *template_name; +extern Fl_Input *template_instance; +#include +#include +extern Fl_Button *template_delete; +#include +extern Fl_Return_Button *template_submit; +Fl_Double_Window* make_template_panel(); +void template_clear(); +void template_delete_cb(Fl_Button *, void *); +void template_load(); +#endif + +// +// End of "$Id$". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/undo.cxx b/third_party/windows/fltk-1.1.10/fluid/undo.cxx new file mode 100644 index 0000000..0b8a1d8 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/undo.cxx @@ -0,0 +1,192 @@ +// +// "$Id$" +// +// FLUID undo support for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2007 by Bill Spitzak and others. +// +// 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 +#include "Fl_Type.h" +#include "undo.h" +#include +#include "../src/flstring.h" +#if defined(WIN32) && !defined(__CYGWIN__) +# include +# include +# define getpid (int)GetCurrentProcessId +# ifndef __WATCOMC__ +// Visual C++ 2005 incorrectly displays a warning about the use of POSIX APIs +// on Windows, which is supposed to be POSIX compliant... +# define unlink _unlink +# endif // !__WATCOMC__ +#else +# include +#endif // WIN32 && !__CYGWIN__ + + +extern Fl_Preferences fluid_prefs; // FLUID preferences +extern Fl_Menu_Item Main_Menu[]; // Main menu + +#define UNDO_ITEM 25 // Undo menu item index +#define REDO_ITEM 26 // Redo menu item index + + +// +// This file implements an undo system using temporary files; ideally +// we'd like to do this in memory, however the current data structures +// and design aren't well-suited... Instead, we save and restore +// checkpoint files. +// + + +int undo_current = 0; // Current undo level in buffer +int undo_last = 0; // Last undo level in buffer +int undo_max = 0; // Maximum undo level used +int undo_save = -1; // Last undo level that was saved +static int undo_paused = 0; // Undo checkpointing paused? + + +// Return the undo filename +static char *undo_filename(int level, char *buf, int bufsize) { + static char undo_path[1024] = ""; // Undo path + + + if (!undo_path[0]) fluid_prefs.getUserdataPath(undo_path, sizeof(undo_path)); + + snprintf(buf, bufsize, "%sundo_%d_%d.fl", undo_path, getpid(), level); + return buf; +} + + +// Redo menu callback +void redo_cb(Fl_Widget *, void *) { + char filename[1024]; // Undo checkpoint file + + if (undo_current >= undo_last) return; + + undo_suspend(); + if (!read_file(undo_filename(undo_current + 1, filename, sizeof(filename)), 0)) { + // Unable to read checkpoint file, don't redo... + undo_resume(); + return; + } + + undo_current ++; + + // Update modified flag... + set_modflag(undo_current != undo_save); + + // Update undo/redo menu items... + if (undo_current >= undo_last) Main_Menu[REDO_ITEM].deactivate(); + Main_Menu[UNDO_ITEM].activate(); +} + +// Undo menu callback +void undo_cb(Fl_Widget *, void *) { + char filename[1024]; // Undo checkpoint file + + if (undo_current <= 0) return; + + if (undo_current == undo_last) { + write_file(undo_filename(undo_current, filename, sizeof(filename))); + } + + undo_suspend(); + if (!read_file(undo_filename(undo_current - 1, filename, sizeof(filename)), 0)) { + // Unable to read checkpoint file, don't undo... + undo_resume(); + return; + } + + undo_current --; + + // Update modified flag... + set_modflag(undo_current != undo_save); + + // Update undo/redo menu items... + if (undo_current <= 0) Main_Menu[UNDO_ITEM].deactivate(); + Main_Menu[REDO_ITEM].activate(); + undo_resume(); +} + +// Save current file to undo buffer +void undo_checkpoint() { + char filename[1024]; // Undo checkpoint filename + +// printf("undo_checkpoint(): undo_current=%d, undo_paused=%d, modflag=%d\n", +// undo_current, undo_paused, modflag); + + // Don't checkpoint if undo_suspend() has been called... + if (undo_paused) return; + + // Save the current UI to a checkpoint file... + if (!write_file(undo_filename(undo_current, filename, sizeof(filename)))) { + // Don't attempt to do undo stuff if we can't write a checkpoint file... + perror(filename); + return; + } + + // Update the saved level... + if (modflag && undo_current <= undo_save) undo_save = -1; + else if (!modflag) undo_save = undo_current; + + // Update the current undo level... + undo_current ++; + undo_last = undo_current; + if (undo_current > undo_max) undo_max = undo_current; + + // Enable the Undo and disable the Redo menu items... + Main_Menu[UNDO_ITEM].activate(); + Main_Menu[REDO_ITEM].deactivate(); +} + +// Clear undo buffer +void undo_clear() { + char filename[1024]; // Undo checkpoint filename + + + // Remove old checkpoint files... + for (int i = 0; i <= undo_max; i ++) { + unlink(undo_filename(i, filename, sizeof(filename))); + } + + // Reset current, last, and save indices... + undo_current = undo_last = undo_max = 0; + if (modflag) undo_save = -1; + else undo_save = 0; +} + +// Resume undo checkpoints +void undo_resume() { + undo_paused = 0; +} + +// Suspend undo checkpoints +void undo_suspend() { + undo_paused = 1; +} + + +// +// End of "$Id$". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/undo.h b/third_party/windows/fltk-1.1.10/fluid/undo.h new file mode 100644 index 0000000..16a4318 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/undo.h @@ -0,0 +1,46 @@ +// +// "$Id$" +// +// FLUID undo definitions for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 undo_h +# define undo_h + +extern int undo_current; // Current undo level in buffer +extern int undo_last; // Last undo level in buffer +extern int undo_save; // Last undo level that was saved + +void redo_cb(Fl_Widget *, void *); // Redo menu callback +void undo_cb(Fl_Widget *, void *); // Undo menu callback +void undo_checkpoint(); // Save current file to undo buffer +void undo_clear(); // Clear undo buffer +void undo_resume(); // Resume undo checkpoints +void undo_suspend(); // Suspend undo checkpoints + +#endif // !undo_h + +// +// End of "$Id$". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/widget_panel.cxx b/third_party/windows/fltk-1.1.10/fluid/widget_panel.cxx new file mode 100644 index 0000000..92c80b1 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/widget_panel.cxx @@ -0,0 +1,795 @@ +// +// "$Id: widget_panel.cxx 6817 2009-07-02 09:42:17Z AlbrechtS $" +// +// Widget panel for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 +// + +// generated by Fast Light User Interface Designer (fluid) version 1.0110 + +#include "widget_panel.h" + +static void cb_(Fl_Tabs* o, void* v) { + propagate_load((Fl_Group *)o,v); +} + +Fl_Value_Input *widget_x_input=(Fl_Value_Input *)0; + +Fl_Value_Input *widget_y_input=(Fl_Value_Input *)0; + +Fl_Value_Input *widget_w_input=(Fl_Value_Input *)0; + +Fl_Value_Input *widget_h_input=(Fl_Value_Input *)0; + +Fl_Menu_Item menu_[] = { + {"private", 0, 0, (void*)(0), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"public", 0, 0, (void*)(1), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"protected", 0, 0, (void*)(2), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {0,0,0,0,0,0,0,0,0} +}; + +Fl_Menu_Item menu_1[] = { + {"local", 0, 0, (void*)(0), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"global", 0, 0, (void*)(1), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {0,0,0,0,0,0,0,0,0} +}; + +Fl_Input *v_input[4]={(Fl_Input *)0}; + +Fl_Button *wLiveMode=(Fl_Button *)0; + +Fl_Double_Window* make_widget_panel() { + Fl_Double_Window* w; + { Fl_Double_Window* o = new Fl_Double_Window(420, 360); + w = o; + o->labelsize(11); + o->align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE); + o->hotspot(o); + { Fl_Tabs* o = new Fl_Tabs(10, 10, 400, 310); + o->selection_color((Fl_Color)12); + o->labelsize(11); + o->labelcolor(FL_BACKGROUND2_COLOR); + o->callback((Fl_Callback*)cb_); + o->when(FL_WHEN_NEVER); + { Fl_Group* o = new Fl_Group(10, 30, 400, 290, "GUI"); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->when(FL_WHEN_NEVER); + o->hide(); + { Fl_Group* o = new Fl_Group(95, 40, 309, 20, "Label:"); + o->labelfont(1); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->align(FL_ALIGN_LEFT); + { Fl_Input* o = new Fl_Input(95, 40, 190, 20); + o->tooltip("The label text for the widget."); + o->labelfont(1); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)label_cb); + o->when(FL_WHEN_CHANGED); + Fl_Group::current()->resizable(o); + } // Fl_Input* o + { Fl_Choice* o = new Fl_Choice(284, 40, 120, 20); + o->tooltip("The label style for the widget."); + o->box(FL_THIN_UP_BOX); + o->down_box(FL_BORDER_BOX); + o->labelfont(1); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)labeltype_cb); + o->menu(labeltypemenu); + } // Fl_Choice* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(95, 65, 309, 20, "Image:"); + o->labelfont(1); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->align(FL_ALIGN_LEFT); + { Fl_Input* o = new Fl_Input(95, 65, 240, 20); + o->tooltip("The active image for the widget."); + o->labelfont(1); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)image_cb); + Fl_Group::current()->resizable(o); + } // Fl_Input* o + { Fl_Button* o = new Fl_Button(334, 65, 70, 20, "Browse..."); + o->tooltip("Click to choose the active image."); + o->labelsize(11); + o->callback((Fl_Callback*)image_browse_cb); + } // Fl_Button* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(95, 90, 309, 20, "Inactive:"); + o->labelfont(1); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->align(FL_ALIGN_LEFT); + { Fl_Input* o = new Fl_Input(95, 90, 240, 20); + o->tooltip("The inactive image for the widget."); + o->labelfont(1); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)inactive_cb); + Fl_Group::current()->resizable(o); + } // Fl_Input* o + { Fl_Button* o = new Fl_Button(334, 90, 70, 20, "Browse..."); + o->tooltip("Click to choose the inactive image."); + o->labelsize(11); + o->callback((Fl_Callback*)inactive_browse_cb); + } // Fl_Button* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(95, 115, 300, 20, "Alignment:"); + o->labelfont(1); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->align(FL_ALIGN_LEFT); + { Fl_Button* o = new Fl_Button(95, 115, 45, 20, "Clip"); + o->tooltip("Clip the label to the inside of the widget."); + o->type(1); + o->selection_color(FL_INACTIVE_COLOR); + o->labelsize(11); + o->callback((Fl_Callback*)align_cb, (void*)(FL_ALIGN_CLIP)); + o->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(145, 115, 50, 20, "Wrap"); + o->tooltip("Wrap the label text."); + o->type(1); + o->selection_color(FL_INACTIVE_COLOR); + o->labelsize(11); + o->callback((Fl_Callback*)align_cb, (void*)(FL_ALIGN_WRAP)); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(200, 115, 65, 20, "Text/Image"); + o->tooltip("Show the label text over the image."); + o->type(1); + o->selection_color(FL_INACTIVE_COLOR); + o->labelsize(11); + o->callback((Fl_Callback*)align_cb, (void*)(FL_ALIGN_TEXT_OVER_IMAGE)); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(270, 115, 20, 20, "@-1<-"); + o->tooltip("Left-align the label."); + o->type(1); + o->selection_color(FL_INACTIVE_COLOR); + o->labelsize(11); + o->labelcolor(FL_INACTIVE_COLOR); + o->callback((Fl_Callback*)align_cb, (void*)(FL_ALIGN_LEFT)); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(295, 115, 20, 20, "@-1->"); + o->tooltip("Right-align the label."); + o->type(1); + o->selection_color(FL_INACTIVE_COLOR); + o->labelsize(11); + o->labelcolor(FL_INACTIVE_COLOR); + o->callback((Fl_Callback*)align_cb, (void*)(FL_ALIGN_RIGHT)); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(320, 115, 20, 20, "@-18"); + o->tooltip("Top-align the label."); + o->type(1); + o->selection_color(FL_INACTIVE_COLOR); + o->labelsize(11); + o->labelcolor(FL_INACTIVE_COLOR); + o->callback((Fl_Callback*)align_cb, (void*)(FL_ALIGN_TOP)); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(345, 115, 20, 20, "@-12"); + o->tooltip("Bottom-align the label."); + o->type(1); + o->selection_color(FL_INACTIVE_COLOR); + o->labelsize(11); + o->labelcolor(FL_INACTIVE_COLOR); + o->callback((Fl_Callback*)align_cb, (void*)(FL_ALIGN_BOTTOM)); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(370, 115, 20, 20, "@-3square"); + o->tooltip("Show the label inside the widget."); + o->type(1); + o->selection_color(FL_INACTIVE_COLOR); + o->labelsize(11); + o->labelcolor(FL_INACTIVE_COLOR); + o->callback((Fl_Callback*)align_cb, (void*)(FL_ALIGN_INSIDE)); + } // Fl_Button* o + { Fl_Box* o = new Fl_Box(395, 115, 0, 20); + o->labelsize(11); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(95, 150, 300, 20, "Position:"); + o->labelfont(1); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->align(FL_ALIGN_LEFT); + { widget_x_input = new Fl_Value_Input(95, 150, 55, 20, "X:"); + widget_x_input->tooltip("The X position of the widget."); + widget_x_input->labelsize(11); + widget_x_input->maximum(2048); + widget_x_input->step(1); + widget_x_input->textsize(11); + widget_x_input->callback((Fl_Callback*)x_cb); + widget_x_input->align(FL_ALIGN_TOP_LEFT); + } // Fl_Value_Input* widget_x_input + { widget_y_input = new Fl_Value_Input(155, 150, 55, 20, "Y:"); + widget_y_input->tooltip("The Y position of the widget."); + widget_y_input->labelsize(11); + widget_y_input->maximum(2048); + widget_y_input->step(1); + widget_y_input->textsize(11); + widget_y_input->callback((Fl_Callback*)y_cb); + widget_y_input->align(FL_ALIGN_TOP_LEFT); + } // Fl_Value_Input* widget_y_input + { widget_w_input = new Fl_Value_Input(215, 150, 55, 20, "Width:"); + widget_w_input->tooltip("The width of the widget."); + widget_w_input->labelsize(11); + widget_w_input->maximum(2048); + widget_w_input->step(1); + widget_w_input->textsize(11); + widget_w_input->callback((Fl_Callback*)w_cb); + widget_w_input->align(FL_ALIGN_TOP_LEFT); + } // Fl_Value_Input* widget_w_input + { widget_h_input = new Fl_Value_Input(275, 150, 55, 20, "Height:"); + widget_h_input->tooltip("The height of the widget."); + widget_h_input->labelsize(11); + widget_h_input->maximum(2048); + widget_h_input->step(1); + widget_h_input->textsize(11); + widget_h_input->callback((Fl_Callback*)h_cb); + widget_h_input->align(FL_ALIGN_TOP_LEFT); + } // Fl_Value_Input* widget_h_input + { Fl_Light_Button* o = new Fl_Light_Button(335, 150, 55, 20, "Relative"); + o->tooltip("If set, widgets inside a widget class of type Fl_Group are repositioned relat\ +ive to the origin at construction time"); + o->labelsize(11); + o->callback((Fl_Callback*)wc_relative_cb); + } // Fl_Light_Button* o + { Fl_Box* o = new Fl_Box(394, 150, 1, 20); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(95, 185, 300, 20, "Values:"); + o->labelfont(1); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->align(FL_ALIGN_LEFT); + { Fl_Value_Input* o = new Fl_Value_Input(95, 185, 55, 20, "Size:"); + o->tooltip("The size of the slider."); + o->labelsize(11); + o->step(0.010101); + o->textsize(11); + o->callback((Fl_Callback*)slider_size_cb); + o->align(FL_ALIGN_TOP_LEFT); + } // Fl_Value_Input* o + { Fl_Value_Input* o = new Fl_Value_Input(155, 185, 55, 20, "Minimum:"); + o->tooltip("The minimum value of the widget."); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)min_cb); + o->align(FL_ALIGN_TOP_LEFT); + } // Fl_Value_Input* o + { Fl_Value_Input* o = new Fl_Value_Input(215, 185, 55, 20, "Maximum:"); + o->tooltip("The maximum value of the widget."); + o->labelsize(11); + o->value(1); + o->textsize(11); + o->callback((Fl_Callback*)max_cb); + o->align(FL_ALIGN_TOP_LEFT); + } // Fl_Value_Input* o + { Fl_Value_Input* o = new Fl_Value_Input(275, 185, 55, 20, "Step:"); + o->tooltip("The resolution of the widget value."); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)step_cb); + o->align(FL_ALIGN_TOP_LEFT); + } // Fl_Value_Input* o + { Fl_Value_Input* o = new Fl_Value_Input(335, 185, 55, 20, "Value:"); + o->tooltip("The current widget value."); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)value_cb); + o->align(FL_ALIGN_TOP_LEFT); + } // Fl_Value_Input* o + { Fl_Box* o = new Fl_Box(395, 185, 0, 20); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(95, 185, 300, 20, "Size Range:"); + o->labelfont(1); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->align(FL_ALIGN_LEFT); + o->hide(); + { Fl_Value_Input* o = new Fl_Value_Input(95, 185, 55, 20, "Minimum Size:"); + o->tooltip("The size of the slider."); + o->labelsize(11); + o->maximum(2048); + o->step(1); + o->textsize(11); + o->callback((Fl_Callback*)min_w_cb); + o->align(FL_ALIGN_TOP_LEFT); + } // Fl_Value_Input* o + { Fl_Value_Input* o = new Fl_Value_Input(155, 185, 55, 20); + o->tooltip("The minimum value of the widget."); + o->labelsize(11); + o->maximum(2048); + o->step(1); + o->textsize(11); + o->callback((Fl_Callback*)min_h_cb); + o->align(FL_ALIGN_TOP_LEFT); + } // Fl_Value_Input* o + { Fl_Button* o = new Fl_Button(215, 185, 25, 20, "set"); + o->labelsize(11); + o->callback((Fl_Callback*)set_min_size_cb); + } // Fl_Button* o + { Fl_Value_Input* o = new Fl_Value_Input(245, 185, 55, 20, "Maximum Size:"); + o->tooltip("The maximum value of the widget."); + o->labelsize(11); + o->maximum(2048); + o->step(1); + o->textsize(11); + o->callback((Fl_Callback*)max_w_cb); + o->align(FL_ALIGN_TOP_LEFT); + } // Fl_Value_Input* o + { Fl_Value_Input* o = new Fl_Value_Input(305, 185, 55, 20); + o->tooltip("The resolution of the widget value."); + o->labelsize(11); + o->maximum(2048); + o->step(1); + o->textsize(11); + o->callback((Fl_Callback*)max_h_cb); + o->align(FL_ALIGN_TOP_LEFT); + } // Fl_Value_Input* o + { Fl_Button* o = new Fl_Button(365, 185, 25, 20, "set"); + o->labelsize(11); + o->callback((Fl_Callback*)set_max_size_cb); + } // Fl_Button* o + { Fl_Box* o = new Fl_Box(395, 185, 0, 20); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + { Shortcut_Button* o = new Shortcut_Button(95, 210, 310, 20, "Shortcut:"); + o->tooltip("The shortcut key for the widget."); + o->box(FL_DOWN_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->selection_color(FL_BACKGROUND2_COLOR); + o->labeltype(FL_NORMAL_LABEL); + o->labelfont(1); + o->labelsize(11); + o->labelcolor(FL_FOREGROUND_COLOR); + o->callback((Fl_Callback*)shortcut_in_cb); + o->align(FL_ALIGN_LEFT); + o->when(FL_WHEN_RELEASE); + } // Shortcut_Button* o + { Fl_Group* o = new Fl_Group(95, 235, 300, 20, "X Class:"); + o->labelfont(1); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->align(FL_ALIGN_LEFT); + { Fl_Input* o = new Fl_Input(95, 235, 95, 20, ":"); + o->tooltip("The X resource class."); + o->labelfont(1); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)xclass_cb); + Fl_Group::current()->resizable(o); + } // Fl_Input* o + { Fl_Light_Button* o = new Fl_Light_Button(195, 235, 60, 20, "Border"); + o->tooltip("Add a border around the window."); + o->selection_color((Fl_Color)1); + o->labelsize(11); + o->callback((Fl_Callback*)border_cb); + } // Fl_Light_Button* o + { Fl_Light_Button* o = new Fl_Light_Button(260, 235, 55, 20, "Modal"); + o->tooltip("Make the window modal."); + o->selection_color((Fl_Color)1); + o->labelsize(11); + o->callback((Fl_Callback*)modal_cb); + } // Fl_Light_Button* o + { Fl_Light_Button* o = new Fl_Light_Button(320, 235, 75, 20, "Nonmodal"); + o->tooltip("Make the window non-modal."); + o->selection_color((Fl_Color)1); + o->labelsize(11); + o->callback((Fl_Callback*)non_modal_cb); + o->align(132|FL_ALIGN_INSIDE); + } // Fl_Light_Button* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(95, 260, 305, 20, "Attributes:"); + o->labelfont(1); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->align(FL_ALIGN_LEFT); + { Fl_Light_Button* o = new Fl_Light_Button(95, 260, 60, 20, "Visible"); + o->tooltip("Show the widget."); + o->selection_color((Fl_Color)1); + o->labelsize(11); + o->callback((Fl_Callback*)visible_cb); + } // Fl_Light_Button* o + { Fl_Light_Button* o = new Fl_Light_Button(160, 260, 60, 20, "Active"); + o->tooltip("Activate the widget."); + o->selection_color((Fl_Color)1); + o->labelsize(11); + o->callback((Fl_Callback*)active_cb); + } // Fl_Light_Button* o + { Fl_Light_Button* o = new Fl_Light_Button(225, 260, 75, 20, "Resizable"); + o->tooltip("Make the widget resizable."); + o->selection_color((Fl_Color)1); + o->labelsize(11); + o->callback((Fl_Callback*)resizable_cb); + o->when(FL_WHEN_CHANGED); + } // Fl_Light_Button* o + { Fl_Light_Button* o = new Fl_Light_Button(305, 260, 70, 20, "Hotspot"); + o->tooltip("Center the window under this widget."); + o->selection_color((Fl_Color)1); + o->labelsize(11); + o->callback((Fl_Callback*)hotspot_cb); + o->when(FL_WHEN_CHANGED); + } // Fl_Light_Button* o + { Fl_Box* o = new Fl_Box(395, 260, 0, 20); + o->labelsize(11); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + { Fl_Input* o = new Fl_Input(95, 285, 310, 20, "Tooltip:"); + o->tooltip("The tooltip text for the widget."); + o->labelfont(1); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)tooltip_cb); + } // Fl_Input* o + { Fl_Box* o = new Fl_Box(95, 305, 300, 5); + o->labelsize(11); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + Fl_Group::current()->resizable(o); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(10, 30, 400, 290, "Style"); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->when(FL_WHEN_NEVER); + o->hide(); + { Fl_Group* o = new Fl_Group(95, 40, 309, 20, "Label Font:"); + o->labelfont(1); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->align(FL_ALIGN_LEFT); + { Fl_Choice* o = new Fl_Choice(95, 40, 170, 20); + o->tooltip("The style of the label text."); + o->box(FL_THIN_UP_BOX); + o->down_box(FL_BORDER_BOX); + o->labelfont(1); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)labelfont_cb); + Fl_Group::current()->resizable(o); + o->menu(fontmenu); + } // Fl_Choice* o + { Fl_Value_Input* o = new Fl_Value_Input(264, 40, 50, 20); + o->tooltip("The size of the label text."); + o->labelsize(11); + o->maximum(100); + o->step(1); + o->value(14); + o->textsize(11); + o->callback((Fl_Callback*)labelsize_cb); + } // Fl_Value_Input* o + { Fl_Button* o = new Fl_Button(314, 40, 90, 20, "Label Color"); + o->tooltip("The color of the label text."); + o->labelsize(11); + o->callback((Fl_Callback*)labelcolor_cb); + } // Fl_Button* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(95, 65, 309, 20, "Box:"); + o->labelfont(1); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->align(FL_ALIGN_LEFT); + { Fl_Choice* o = new Fl_Choice(95, 65, 219, 20); + o->tooltip("The \"up\" box of the widget."); + o->box(FL_THIN_UP_BOX); + o->down_box(FL_BORDER_BOX); + o->labelfont(1); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)box_cb); + Fl_Group::current()->resizable(o); + o->menu(boxmenu); + } // Fl_Choice* o + { Fl_Button* o = new Fl_Button(314, 65, 90, 20, "Color"); + o->tooltip("The background color of the widget."); + o->labelsize(11); + o->callback((Fl_Callback*)color_cb); + } // Fl_Button* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(95, 90, 309, 20, "Down Box:"); + o->labelfont(1); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->align(FL_ALIGN_LEFT); + { Fl_Choice* o = new Fl_Choice(95, 90, 219, 20); + o->tooltip("The \"down\" box of the widget."); + o->box(FL_THIN_UP_BOX); + o->down_box(FL_BORDER_BOX); + o->labelfont(1); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)down_box_cb); + Fl_Group::current()->resizable(o); + o->menu(boxmenu); + } // Fl_Choice* o + { Fl_Button* o = new Fl_Button(314, 90, 90, 20, "Select Color"); + o->tooltip("The selection color of the widget."); + o->labelsize(11); + o->callback((Fl_Callback*)color2_cb); + } // Fl_Button* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(95, 115, 309, 20, "Text Font:"); + o->labelfont(1); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->align(FL_ALIGN_LEFT); + { Fl_Choice* o = new Fl_Choice(95, 115, 170, 20); + o->tooltip("The value text style."); + o->box(FL_DOWN_BOX); + o->down_box(FL_BORDER_BOX); + o->labelfont(1); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)textfont_cb); + Fl_Group::current()->resizable(o); + o->menu(fontmenu); + } // Fl_Choice* o + { Fl_Value_Input* o = new Fl_Value_Input(264, 115, 50, 20); + o->tooltip("The value text size."); + o->labelsize(11); + o->maximum(100); + o->step(1); + o->value(14); + o->textsize(11); + o->callback((Fl_Callback*)textsize_cb); + } // Fl_Value_Input* o + { Fl_Button* o = new Fl_Button(314, 115, 90, 20, "Text Color"); + o->tooltip("The value text color."); + o->labelsize(11); + o->callback((Fl_Callback*)textcolor_cb); + } // Fl_Button* o + o->end(); + } // Fl_Group* o + { Fl_Box* o = new Fl_Box(95, 140, 300, 40); + o->labelsize(11); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(10, 30, 400, 290, "C++"); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->when(FL_WHEN_NEVER); + { Fl_Group* o = new Fl_Group(95, 40, 310, 20, "Class:"); + o->labelfont(1); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->align(FL_ALIGN_LEFT); + { Fl_Input* o = new Fl_Input(95, 40, 172, 20); + o->tooltip("The widget subclass."); + o->labelfont(1); + o->labelsize(11); + o->textfont(4); + o->textsize(11); + o->callback((Fl_Callback*)subclass_cb, (void*)(4)); + Fl_Group::current()->resizable(o); + } // Fl_Input* o + { Fl_Choice* o = new Fl_Choice(265, 40, 140, 20); + o->tooltip("The widget subtype."); + o->box(FL_THIN_UP_BOX); + o->down_box(FL_BORDER_BOX); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)subtype_cb); + } // Fl_Choice* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(95, 65, 310, 20, "Name:"); + o->labelfont(1); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->align(FL_ALIGN_LEFT); + { Fl_Input* o = new Fl_Input(95, 65, 235, 20); + o->tooltip("The name of the widget."); + o->labelfont(1); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)name_cb); + Fl_Group::current()->resizable(o); + } // Fl_Input* o + { Fl_Choice* o = new Fl_Choice(330, 65, 75, 20); + o->tooltip("Change member access attribute."); + o->down_box(FL_BORDER_BOX); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)name_public_member_cb); + o->when(FL_WHEN_CHANGED); + o->menu(menu_); + } // Fl_Choice* o + { Fl_Choice* o = new Fl_Choice(330, 65, 75, 20); + o->tooltip("Change widget accessibility."); + o->down_box(FL_BORDER_BOX); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)name_public_cb); + o->when(FL_WHEN_CHANGED); + o->menu(menu_1); + } // Fl_Choice* o + o->end(); + } // Fl_Group* o + { v_input[0] = new Fl_Input(95, 90, 310, 20, "Extra Code:"); + v_input[0]->tooltip("Extra initialization code for the widget."); + v_input[0]->labelfont(1); + v_input[0]->labelsize(11); + v_input[0]->textfont(4); + v_input[0]->textsize(11); + v_input[0]->callback((Fl_Callback*)v_input_cb, (void*)(0)); + } // Fl_Input* v_input[0] + { v_input[1] = new Fl_Input(95, 110, 310, 20); + v_input[1]->tooltip("Extra initialization code for the widget."); + v_input[1]->labelsize(11); + v_input[1]->textfont(4); + v_input[1]->textsize(11); + v_input[1]->callback((Fl_Callback*)v_input_cb, (void*)(1)); + } // Fl_Input* v_input[1] + { v_input[2] = new Fl_Input(95, 130, 310, 20); + v_input[2]->tooltip("Extra initialization code for the widget."); + v_input[2]->labelsize(11); + v_input[2]->textfont(4); + v_input[2]->textsize(11); + v_input[2]->callback((Fl_Callback*)v_input_cb, (void*)(2)); + } // Fl_Input* v_input[2] + { v_input[3] = new Fl_Input(95, 150, 310, 20); + v_input[3]->tooltip("Extra initialization code for the widget."); + v_input[3]->labelsize(11); + v_input[3]->textfont(4); + v_input[3]->textsize(11); + v_input[3]->callback((Fl_Callback*)v_input_cb, (void*)(3)); + } // Fl_Input* v_input[3] + { CodeEditor* o = new CodeEditor(95, 175, 310, 90, "Callback:"); + o->tooltip("The callback function or code for the widget. Use the variable name \'o\' to \ +access the Widget pointer and \'v\' to access the user value."); + o->box(FL_DOWN_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->selection_color(FL_SELECTION_COLOR); + o->labeltype(FL_NORMAL_LABEL); + o->labelfont(1); + o->labelsize(11); + o->labelcolor(FL_FOREGROUND_COLOR); + o->textfont(4); + o->textsize(11); + o->callback((Fl_Callback*)callback_cb); + o->align(FL_ALIGN_LEFT); + o->when(FL_WHEN_RELEASE); + Fl_Group::current()->resizable(o); + } // CodeEditor* o + { Fl_Group* o = new Fl_Group(95, 270, 310, 20, "User Data:"); + o->labelfont(1); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->align(FL_ALIGN_LEFT); + { Fl_Input* o = new Fl_Input(95, 270, 158, 20); + o->tooltip("The user data to pass into the callback code."); + o->labelfont(1); + o->labelsize(11); + o->textfont(4); + o->textsize(11); + o->callback((Fl_Callback*)user_data_cb); + Fl_Group::current()->resizable(o); + } // Fl_Input* o + { Fl_Choice* o = new Fl_Choice(300, 270, 105, 20, "When:"); + o->tooltip("When to call the callback function."); + o->box(FL_THIN_UP_BOX); + o->down_box(FL_BORDER_BOX); + o->labelfont(1); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)when_cb); + o->when(FL_WHEN_CHANGED); + o->menu(whenmenu); + } // Fl_Choice* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(95, 295, 310, 20, "Type:"); + o->labelfont(1); + o->labelsize(11); + o->callback((Fl_Callback*)propagate_load); + o->align(FL_ALIGN_LEFT); + { Fl_Input* o = new Fl_Input(95, 295, 158, 20); + o->tooltip("The type of the user data."); + o->labelfont(1); + o->labelsize(11); + o->textfont(4); + o->textsize(11); + o->callback((Fl_Callback*)user_data_type_cb); + Fl_Group::current()->resizable(o); + } // Fl_Input* o + { Fl_Light_Button* o = new Fl_Light_Button(300, 295, 105, 20, "No Change"); + o->tooltip("Call the callback even if the value has not changed."); + o->selection_color((Fl_Color)1); + o->labelsize(11); + o->callback((Fl_Callback*)when_button_cb); + } // Fl_Light_Button* o + o->end(); + } // Fl_Group* o + o->end(); + } // Fl_Group* o + o->end(); + Fl_Group::current()->resizable(o); + } // Fl_Tabs* o + { Fl_Group* o = new Fl_Group(9, 330, 400, 20); + o->labelsize(11); + { Fl_Box* o = new Fl_Box(9, 330, 20, 20); + o->labelsize(11); + Fl_Group::current()->resizable(o); + } // Fl_Box* o + { Fl_Button* o = new Fl_Button(240, 330, 99, 20, "Hide &Overlays"); + o->tooltip("Hide the widget overlay box."); + o->labelsize(11); + o->labelcolor((Fl_Color)1); + o->callback((Fl_Callback*)overlay_cb); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(66, 330, 80, 20, "Revert"); + o->labelsize(11); + o->callback((Fl_Callback*)revert_cb); + o->hide(); + } // Fl_Button* o + { Fl_Return_Button* o = new Fl_Return_Button(344, 330, 64, 20, "Close"); + o->labelsize(11); + o->callback((Fl_Callback*)ok_cb); + } // Fl_Return_Button* o + { Fl_Button* o = new Fl_Button(339, 330, 70, 20, "Cancel"); + o->labelsize(11); + o->callback((Fl_Callback*)cancel_cb); + o->hide(); + } // Fl_Button* o + { wLiveMode = new Fl_Button(151, 330, 84, 20, "Live &Mode"); + wLiveMode->tooltip("Create a live duplicate of the selected widgets to test resizing and menu beh\ +avior."); + wLiveMode->type(1); + wLiveMode->labelsize(11); + wLiveMode->callback((Fl_Callback*)live_mode_cb); + } // Fl_Button* wLiveMode + o->end(); + } // Fl_Group* o + o->size_range(o->w(), o->h()); + o->end(); + } // Fl_Double_Window* o + return w; +} + +// +// End of "$Id: widget_panel.cxx 6817 2009-07-02 09:42:17Z AlbrechtS $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/widget_panel.fl b/third_party/windows/fltk-1.1.10/fluid/widget_panel.fl new file mode 100644 index 0000000..6ab4e00 --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/widget_panel.fl @@ -0,0 +1,579 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0108 +header_name {.h} +code_name {.cxx} +comment {// +// "$Id: widget_panel.fl 6012 2008-01-04 21:45:49Z matt $" +// +// Widget panel for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 +// +} {in_source in_header +} + +Function {make_widget_panel()} {open +} { + Fl_Window {} {open + xywh {383 206 420 360} type Double labelsize 11 align 80 resizable hotspot + code0 {o->size_range(o->w(), o->h());} visible + } { + Fl_Tabs {} { + callback {propagate_load((Fl_Group *)o,v);} open + xywh {10 10 400 310} selection_color 12 labelsize 11 labelcolor 7 when 0 resizable + } { + Fl_Group {} { + label GUI + callback propagate_load + xywh {10 30 400 290} labelsize 11 when 0 hide resizable + } { + Fl_Group {} { + label {Label:} + callback propagate_load + xywh {95 40 309 20} labelfont 1 labelsize 11 align 4 + } { + Fl_Input {} { + callback label_cb + tooltip {The label text for the widget.} xywh {95 40 190 20} labelfont 1 labelsize 11 when 1 textsize 11 resizable + } + Fl_Choice {} { + callback labeltype_cb open + tooltip {The label style for the widget.} xywh {284 40 120 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11 + code0 {extern Fl_Menu_Item labeltypemenu[];} + code1 {o->menu(labeltypemenu);} + } {} + } + Fl_Group {} { + label {Image:} + callback propagate_load + xywh {95 65 309 20} labelfont 1 labelsize 11 align 4 + } { + Fl_Input {} { + callback image_cb + tooltip {The active image for the widget.} xywh {95 65 240 20} labelfont 1 labelsize 11 textsize 11 resizable + } + Fl_Button {} { + label {Browse...} + callback image_browse_cb + tooltip {Click to choose the active image.} xywh {334 65 70 20} labelsize 11 + } + } + Fl_Group {} { + label {Inactive:} + callback propagate_load + xywh {95 90 309 20} labelfont 1 labelsize 11 align 4 + } { + Fl_Input {} { + callback inactive_cb + tooltip {The inactive image for the widget.} xywh {95 90 240 20} labelfont 1 labelsize 11 textsize 11 resizable + } + Fl_Button {} { + label {Browse...} + callback inactive_browse_cb + tooltip {Click to choose the inactive image.} xywh {334 90 70 20} labelsize 11 + } + } + Fl_Group {} { + label {Alignment:} + callback propagate_load + xywh {95 115 300 20} labelfont 1 labelsize 11 align 4 + } { + Fl_Button {} { + label Clip + user_data FL_ALIGN_CLIP + callback align_cb + tooltip {Clip the label to the inside of the widget.} xywh {95 115 45 20} type Toggle selection_color 8 labelsize 11 align 16 + } + Fl_Button {} { + label Wrap + user_data FL_ALIGN_WRAP + callback align_cb + tooltip {Wrap the label text.} xywh {145 115 50 20} type Toggle selection_color 8 labelsize 11 + } + Fl_Button {} { + label {Text/Image} + user_data FL_ALIGN_TEXT_OVER_IMAGE + callback align_cb + tooltip {Show the label text over the image.} xywh {200 115 65 20} type Toggle selection_color 8 labelsize 11 + } + Fl_Button {} { + label {@-1<-} + user_data FL_ALIGN_LEFT + callback align_cb + tooltip {Left-align the label.} xywh {270 115 20 20} type Toggle selection_color 8 labelsize 11 labelcolor 8 + } + Fl_Button {} { + label {@-1->} + user_data FL_ALIGN_RIGHT + callback align_cb + tooltip {Right-align the label.} xywh {295 115 20 20} type Toggle selection_color 8 labelsize 11 labelcolor 8 + } + Fl_Button {} { + label {@-18} + user_data FL_ALIGN_TOP + callback align_cb + tooltip {Top-align the label.} xywh {320 115 20 20} type Toggle selection_color 8 labelsize 11 labelcolor 8 + } + Fl_Button {} { + label {@-12} + user_data FL_ALIGN_BOTTOM + callback align_cb + tooltip {Bottom-align the label.} xywh {345 115 20 20} type Toggle selection_color 8 labelsize 11 labelcolor 8 + } + Fl_Button {} { + label {@-3square} + user_data FL_ALIGN_INSIDE + callback align_cb + tooltip {Show the label inside the widget.} xywh {370 115 20 20} type Toggle selection_color 8 labelsize 11 labelcolor 8 + } + Fl_Box {} { + xywh {395 115 0 20} labelsize 11 resizable + } + } + Fl_Group {} { + label {Position:} + callback propagate_load + xywh {95 150 300 20} labelfont 1 labelsize 11 align 4 + } { + Fl_Value_Input widget_x_input { + label {X:} + callback x_cb + tooltip {The X position of the widget.} xywh {95 150 55 20} labelsize 11 align 5 maximum 2048 step 1 textsize 11 + } + Fl_Value_Input widget_y_input { + label {Y:} + callback y_cb + tooltip {The Y position of the widget.} xywh {155 150 55 20} labelsize 11 align 5 maximum 2048 step 1 textsize 11 + } + Fl_Value_Input widget_w_input { + label {Width:} + callback w_cb + tooltip {The width of the widget.} xywh {215 150 55 20} labelsize 11 align 5 maximum 2048 step 1 textsize 11 + } + Fl_Value_Input widget_h_input { + label {Height:} + callback h_cb + tooltip {The height of the widget.} xywh {275 150 55 20} labelsize 11 align 5 maximum 2048 step 1 textsize 11 + } + Fl_Light_Button {} { + label Relative + callback wc_relative_cb + tooltip {If set, widgets inside a widget class of type Fl_Group are repositioned relative to the origin at construction time} xywh {335 150 55 20} labelsize 11 + } + Fl_Box {} { + xywh {394 150 1 20} resizable + } + } + Fl_Group {} { + label {Values:} + callback propagate_load + xywh {95 185 300 20} labelfont 1 labelsize 11 align 4 + } { + Fl_Value_Input {} { + label {Size:} + callback slider_size_cb + tooltip {The size of the slider.} xywh {95 185 55 20} labelsize 11 align 5 step 0.010101 textsize 11 + } + Fl_Value_Input {} { + label {Minimum:} + callback min_cb + tooltip {The minimum value of the widget.} xywh {155 185 55 20} labelsize 11 align 5 textsize 11 + } + Fl_Value_Input {} { + label {Maximum:} + callback max_cb + tooltip {The maximum value of the widget.} xywh {215 185 55 20} labelsize 11 align 5 value 1 textsize 11 + } + Fl_Value_Input {} { + label {Step:} + callback step_cb + tooltip {The resolution of the widget value.} xywh {275 185 55 20} labelsize 11 align 5 textsize 11 + } + Fl_Value_Input {} { + label {Value:} + callback value_cb + tooltip {The current widget value.} xywh {335 185 55 20} labelsize 11 align 5 textsize 11 + } + Fl_Box {} { + xywh {395 185 0 20} resizable + } + } + Fl_Group {} { + label {Size Range:} + callback propagate_load + xywh {95 185 300 20} labelfont 1 labelsize 11 align 4 hide + } { + Fl_Value_Input {} { + label {Minimum Size:} + callback min_w_cb + tooltip {The size of the slider.} xywh {95 185 55 20} labelsize 11 align 5 maximum 2048 step 1 textsize 11 + } + Fl_Value_Input {} { + callback min_h_cb + tooltip {The minimum value of the widget.} xywh {155 185 55 20} labelsize 11 align 5 maximum 2048 step 1 textsize 11 + } + Fl_Button {} { + label set + callback set_min_size_cb + xywh {215 185 25 20} labelsize 11 + } + Fl_Value_Input {} { + label {Maximum Size:} + callback max_w_cb + tooltip {The maximum value of the widget.} xywh {245 185 55 20} labelsize 11 align 5 maximum 2048 step 1 textsize 11 + } + Fl_Value_Input {} { + callback max_h_cb + tooltip {The resolution of the widget value.} xywh {305 185 55 20} labelsize 11 align 5 maximum 2048 step 1 textsize 11 + } + Fl_Button {} { + label set + callback set_max_size_cb + xywh {365 185 25 20} labelsize 11 + } + Fl_Box {} { + xywh {395 185 0 20} resizable + } + } + Fl_Button {} { + label {Shortcut:} + callback shortcut_in_cb + tooltip {The shortcut key for the widget.} xywh {95 210 310 20} box DOWN_BOX color 7 selection_color 7 labelfont 1 labelsize 11 align 4 + code0 {\#include "Shortcut_Button.h"} + class Shortcut_Button + } + Fl_Group {} { + label {X Class:} + callback propagate_load + xywh {95 235 300 20} labelfont 1 labelsize 11 align 4 + } { + Fl_Input {} { + label {:} + callback xclass_cb + tooltip {The X resource class.} xywh {95 235 95 20} labelfont 1 labelsize 11 textsize 11 resizable + } + Fl_Light_Button {} { + label Border + callback border_cb + tooltip {Add a border around the window.} xywh {195 235 60 20} selection_color 1 labelsize 11 + } + Fl_Light_Button {} { + label Modal + callback modal_cb + tooltip {Make the window modal.} xywh {260 235 55 20} selection_color 1 labelsize 11 + } + Fl_Light_Button {} { + label Nonmodal + callback non_modal_cb + tooltip {Make the window non-modal.} xywh {320 235 75 20} selection_color 1 labelsize 11 align 148 + } + } + Fl_Group {} { + label {Attributes:} + callback propagate_load + xywh {95 260 305 20} labelfont 1 labelsize 11 align 4 + } { + Fl_Light_Button {} { + label Visible + callback visible_cb + tooltip {Show the widget.} xywh {95 260 60 20} selection_color 1 labelsize 11 + } + Fl_Light_Button {} { + label Active + callback active_cb + tooltip {Activate the widget.} xywh {160 260 60 20} selection_color 1 labelsize 11 + } + Fl_Light_Button {} { + label Resizable + callback resizable_cb + tooltip {Make the widget resizable.} xywh {225 260 75 20} selection_color 1 labelsize 11 when 1 + } + Fl_Light_Button {} { + label Hotspot + callback hotspot_cb + tooltip {Center the window under this widget.} xywh {305 260 70 20} selection_color 1 labelsize 11 when 1 + } + Fl_Box {} { + xywh {395 260 0 20} labelsize 11 resizable + } + } + Fl_Input {} { + label {Tooltip:} + callback tooltip_cb + tooltip {The tooltip text for the widget.} xywh {95 285 310 20} labelfont 1 labelsize 11 textsize 11 + } + Fl_Box {} { + xywh {95 305 300 5} labelsize 11 resizable + } + } + Fl_Group {} { + label Style + callback propagate_load + xywh {10 30 400 290} labelsize 11 when 0 hide + } { + Fl_Group {} { + label {Label Font:} + callback propagate_load + xywh {95 40 309 20} labelfont 1 labelsize 11 align 4 + } { + Fl_Choice {} { + callback labelfont_cb open + tooltip {The style of the label text.} xywh {95 40 170 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11 resizable + code0 {extern Fl_Menu_Item fontmenu[];} + code1 {o->menu(fontmenu);} + } {} + Fl_Value_Input {} { + callback labelsize_cb + tooltip {The size of the label text.} xywh {264 40 50 20} labelsize 11 maximum 100 step 1 value 14 textsize 11 + } + Fl_Button {} { + label {Label Color} + callback labelcolor_cb + tooltip {The color of the label text.} xywh {314 40 90 20} labelsize 11 + } + } + Fl_Group {} { + label {Box:} + callback propagate_load + xywh {95 65 309 20} labelfont 1 labelsize 11 align 4 + } { + Fl_Choice {} { + callback box_cb open + tooltip {The "up" box of the widget.} xywh {95 65 219 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11 resizable + code0 {extern Fl_Menu_Item boxmenu[];} + code1 {o->menu(boxmenu);} + } {} + Fl_Button {} { + label Color + callback color_cb + tooltip {The background color of the widget.} xywh {314 65 90 20} labelsize 11 + } + } + Fl_Group {} { + label {Down Box:} + callback propagate_load + xywh {95 90 309 20} labelfont 1 labelsize 11 align 4 + } { + Fl_Choice {} { + callback down_box_cb open + tooltip {The "down" box of the widget.} xywh {95 90 219 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11 resizable + code0 {extern Fl_Menu_Item boxmenu[];} + code1 {o->menu(boxmenu);} + } {} + Fl_Button {} { + label {Select Color} + callback color2_cb + tooltip {The selection color of the widget.} xywh {314 90 90 20} labelsize 11 + } + } + Fl_Group {} { + label {Text Font:} + callback propagate_load + xywh {95 115 309 20} labelfont 1 labelsize 11 align 4 + } { + Fl_Choice {} { + callback textfont_cb open + tooltip {The value text style.} xywh {95 115 170 20} box DOWN_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11 resizable + code0 {extern Fl_Menu_Item fontmenu[];} + code1 {o->menu(fontmenu);} + } {} + Fl_Value_Input {} { + callback textsize_cb + tooltip {The value text size.} xywh {264 115 50 20} labelsize 11 maximum 100 step 1 value 14 textsize 11 + } + Fl_Button {} { + label {Text Color} + callback textcolor_cb + tooltip {The value text color.} xywh {314 115 90 20} labelsize 11 + } + } + Fl_Box {} { + xywh {95 140 300 40} labelsize 11 resizable + } + } + Fl_Group {} { + label {C++} + callback propagate_load open + xywh {10 30 400 290} labelsize 11 when 0 + } { + Fl_Group {} { + label {Class:} + callback propagate_load + xywh {95 40 310 20} labelfont 1 labelsize 11 align 4 + } { + Fl_Input {} { + user_data 4 + callback subclass_cb + tooltip {The widget subclass.} xywh {95 40 172 20} labelfont 1 labelsize 11 textfont 4 textsize 11 resizable + } + Fl_Choice {} { + callback subtype_cb open + tooltip {The widget subtype.} xywh {265 40 140 20} box THIN_UP_BOX down_box BORDER_BOX labelsize 11 textsize 11 + } {} + } + Fl_Group {} { + label {Name:} + callback propagate_load open + xywh {95 65 310 20} labelfont 1 labelsize 11 align 4 + } { + Fl_Input {} { + callback name_cb selected + tooltip {The name of the widget.} xywh {95 65 235 20} labelfont 1 labelsize 11 textsize 11 resizable + } + Fl_Choice {} { + callback name_public_member_cb open + tooltip {Change member access attribute.} xywh {330 65 75 20} down_box BORDER_BOX labelsize 11 when 1 textsize 11 + } { + MenuItem {} { + label private + user_data 0 user_data_type long + xywh {0 0 100 20} labelsize 11 + } + MenuItem {} { + label public + user_data 1 user_data_type long + xywh {0 0 100 20} labelsize 11 + } + MenuItem {} { + label protected + user_data 2 user_data_type long + xywh {0 0 100 20} labelsize 11 + } + } + Fl_Choice {} { + callback name_public_cb open + tooltip {Change widget accessibility.} xywh {330 65 75 20} down_box BORDER_BOX labelsize 11 when 1 textsize 11 + } { + MenuItem {} { + label local + user_data 0 user_data_type long + xywh {10 10 100 20} labelsize 11 + } + MenuItem {} { + label global + user_data 1 user_data_type long + xywh {10 10 100 20} labelsize 11 + } + } + } + Fl_Input {v_input[0]} { + label {Extra Code:} + user_data 0 + callback v_input_cb + tooltip {Extra initialization code for the widget.} xywh {95 90 310 20} labelfont 1 labelsize 11 textfont 4 textsize 11 + } + Fl_Input {v_input[1]} { + user_data 1 + callback v_input_cb + tooltip {Extra initialization code for the widget.} xywh {95 110 310 20} labelsize 11 textfont 4 textsize 11 + } + Fl_Input {v_input[2]} { + user_data 2 + callback v_input_cb + tooltip {Extra initialization code for the widget.} xywh {95 130 310 20} labelsize 11 textfont 4 textsize 11 + } + Fl_Input {v_input[3]} { + user_data 3 + callback v_input_cb + tooltip {Extra initialization code for the widget.} xywh {95 150 310 20} labelsize 11 textfont 4 textsize 11 + } + Fl_Text_Editor {} { + label {Callback:} + callback callback_cb + tooltip {The callback function or code for the widget. Use the variable name 'o' to access the Widget pointer and 'v' to access the user value.} xywh {95 175 310 90} box DOWN_BOX labelfont 1 labelsize 11 align 4 textfont 4 textsize 11 resizable + code0 {\#include "CodeEditor.h"} + class CodeEditor + } + Fl_Group {} { + label {User Data:} + callback propagate_load + xywh {95 270 310 20} labelfont 1 labelsize 11 align 4 + } { + Fl_Input {} { + callback user_data_cb + tooltip {The user data to pass into the callback code.} xywh {95 270 158 20} labelfont 1 labelsize 11 textfont 4 textsize 11 resizable + } + Fl_Choice {} { + label {When:} + callback when_cb open + tooltip {When to call the callback function.} xywh {300 270 105 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 when 1 textsize 11 + code0 {extern Fl_Menu_Item whenmenu[];} + code1 {o->menu(whenmenu);} + } {} + } + Fl_Group {} { + label {Type:} + callback propagate_load + xywh {95 295 310 20} labelfont 1 labelsize 11 align 4 + } { + Fl_Input {} { + callback user_data_type_cb + tooltip {The type of the user data.} xywh {95 295 158 20} labelfont 1 labelsize 11 textfont 4 textsize 11 resizable + } + Fl_Light_Button {} { + label {No Change} + callback when_button_cb + tooltip {Call the callback even if the value has not changed.} xywh {300 295 105 20} selection_color 1 labelsize 11 + } + } + } + } + Fl_Group {} {open + xywh {9 330 400 20} labelsize 11 + } { + Fl_Box {} { + xywh {9 330 20 20} labelsize 11 resizable + } + Fl_Button {} { + label {Hide &Overlays} + callback overlay_cb + tooltip {Hide the widget overlay box.} xywh {240 330 99 20} labelsize 11 labelcolor 1 + } + Fl_Button {} { + label Revert + callback revert_cb + xywh {66 330 80 20} labelsize 11 hide + } + Fl_Return_Button {} { + label Close + callback ok_cb + xywh {344 330 64 20} labelsize 11 + } + Fl_Button {} { + label Cancel + callback cancel_cb + xywh {339 330 70 20} labelsize 11 hide + } + Fl_Button wLiveMode { + label {Live &Mode} + callback live_mode_cb + tooltip {Create a live duplicate of the selected widgets to test resizing and menu behavior.} xywh {151 330 84 20} type Toggle labelsize 11 + } + } + } +} + +comment { +// +// End of "$Id: widget_panel.fl 6012 2008-01-04 21:45:49Z matt $". +//} {in_source in_header +} diff --git a/third_party/windows/fltk-1.1.10/fluid/widget_panel.h b/third_party/windows/fltk-1.1.10/fluid/widget_panel.h new file mode 100644 index 0000000..0c78ebf --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/widget_panel.h @@ -0,0 +1,122 @@ +// +// "$Id: widget_panel.h 6817 2009-07-02 09:42:17Z AlbrechtS $" +// +// Widget panel for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// 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 +// + +// generated by Fast Light User Interface Designer (fluid) version 1.0110 + +#ifndef widget_panel_h +#define widget_panel_h +#include +#include +#include +#include +extern void propagate_load(Fl_Group*, void*); +#include +extern void label_cb(Fl_Input*, void*); +#include +extern Fl_Menu_Item labeltypemenu[]; +extern void labeltype_cb(Fl_Choice*, void*); +extern void image_cb(Fl_Input*, void*); +#include +extern void image_browse_cb(Fl_Button*, void*); +extern void inactive_cb(Fl_Input*, void*); +extern void inactive_browse_cb(Fl_Button*, void*); +extern void align_cb(Fl_Button*, void*); +#include +#include +extern void x_cb(Fl_Value_Input*, void*); +extern Fl_Value_Input *widget_x_input; +extern void y_cb(Fl_Value_Input*, void*); +extern Fl_Value_Input *widget_y_input; +extern void w_cb(Fl_Value_Input*, void*); +extern Fl_Value_Input *widget_w_input; +extern void h_cb(Fl_Value_Input*, void*); +extern Fl_Value_Input *widget_h_input; +#include +extern void wc_relative_cb(Fl_Light_Button*, void*); +extern void slider_size_cb(Fl_Value_Input*, void*); +extern void min_cb(Fl_Value_Input*, void*); +extern void max_cb(Fl_Value_Input*, void*); +extern void step_cb(Fl_Value_Input*, void*); +extern void value_cb(Fl_Value_Input*, void*); +extern void min_w_cb(Fl_Value_Input*, void*); +extern void min_h_cb(Fl_Value_Input*, void*); +extern void set_min_size_cb(Fl_Button*, void*); +extern void max_w_cb(Fl_Value_Input*, void*); +extern void max_h_cb(Fl_Value_Input*, void*); +extern void set_max_size_cb(Fl_Button*, void*); +#include "Shortcut_Button.h" +extern void shortcut_in_cb(Shortcut_Button*, void*); +extern void xclass_cb(Fl_Input*, void*); +extern void border_cb(Fl_Light_Button*, void*); +extern void modal_cb(Fl_Light_Button*, void*); +extern void non_modal_cb(Fl_Light_Button*, void*); +extern void visible_cb(Fl_Light_Button*, void*); +extern void active_cb(Fl_Light_Button*, void*); +extern void resizable_cb(Fl_Light_Button*, void*); +extern void hotspot_cb(Fl_Light_Button*, void*); +extern void tooltip_cb(Fl_Input*, void*); +extern Fl_Menu_Item fontmenu[]; +extern void labelfont_cb(Fl_Choice*, void*); +extern void labelsize_cb(Fl_Value_Input*, void*); +extern void labelcolor_cb(Fl_Button*, void*); +extern Fl_Menu_Item boxmenu[]; +extern void box_cb(Fl_Choice*, void*); +extern void color_cb(Fl_Button*, void*); +extern void down_box_cb(Fl_Choice*, void*); +extern void color2_cb(Fl_Button*, void*); +extern void textfont_cb(Fl_Choice*, void*); +extern void textsize_cb(Fl_Value_Input*, void*); +extern void textcolor_cb(Fl_Button*, void*); +extern void subclass_cb(Fl_Input*, void*); +extern void subtype_cb(Fl_Choice*, void*); +extern void name_cb(Fl_Input*, void*); +extern void name_public_member_cb(Fl_Choice*, void*); +extern void name_public_cb(Fl_Choice*, void*); +extern void v_input_cb(Fl_Input*, void*); +extern Fl_Input *v_input[4]; +#include "CodeEditor.h" +extern void callback_cb(CodeEditor*, void*); +extern void user_data_cb(Fl_Input*, void*); +extern Fl_Menu_Item whenmenu[]; +extern void when_cb(Fl_Choice*, void*); +extern void user_data_type_cb(Fl_Input*, void*); +extern void when_button_cb(Fl_Light_Button*, void*); +extern void overlay_cb(Fl_Button*, void*); +extern void revert_cb(Fl_Button*, void*); +#include +extern void ok_cb(Fl_Return_Button*, void*); +extern void cancel_cb(Fl_Button*, void*); +extern void live_mode_cb(Fl_Button*, void*); +extern Fl_Button *wLiveMode; +Fl_Double_Window* make_widget_panel(); +extern Fl_Menu_Item menu_[]; +extern Fl_Menu_Item menu_1[]; +#endif + +// +// End of "$Id: widget_panel.h 6817 2009-07-02 09:42:17Z AlbrechtS $". +// diff --git a/third_party/windows/fltk-1.1.10/fluid/x-fluid.desktop b/third_party/windows/fltk-1.1.10/fluid/x-fluid.desktop new file mode 100644 index 0000000..f31602d --- /dev/null +++ b/third_party/windows/fltk-1.1.10/fluid/x-fluid.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=MimeType +MimeType=application/x-fluid +Icon=fluid.png +Patterns=*.fl +Name=FLUID +Comment=FLUID GUI Design +Encoding=UTF-8 -- cgit v1.3.1