diff options
109 files changed, 5423 insertions, 2739 deletions
diff --git a/2026-02-06-claudemd.txt b/2026-02-06-claudemd.txt index de80cf3e4..dfc22cc01 100644 --- a/2026-02-06-claudemd.txt +++ b/2026-02-06-claudemd.txt @@ -12,985 +12,4014 @@ │ ~/Desktop/fltk │ │ ╰──────────────────────────────────────────────────────────────────────────────╯ ══════════════════ Conversation compacted · ctrl+o for history ═════════════════ - ⎿ Referenced file Makefile - ⎿ Read xlibs/fetch_headers.sh (95 lines) - ⎿ Read xlibs/README.md (64 lines) - ⎿ Read src/Fl_Cairo.cxx (214 lines) - ⎿ Read src/Fl_Private.H (73 lines) - ⎿ Todo list read (4 items) + ⎿ Referenced file fluid/nodes/Window_Node.cxx + ⎿ Referenced file fluid/nodes/Widget_Node.cxx + ⎿ Referenced file fluid/nodes/Node.cxx + ⎿ Referenced file fluid/nodes/Group_Node.cxx + ⎿ Referenced file fluid/nodes/Grid_Node.cxx + ⎿ Todo list read (7 items) ⎿ Plan file referenced (~/.claude/plans/compiled-petting-babbage.md) -⏺ Продолжаю с Фазы 8: Cairo/Pango стратегия. +⏺ Продолжаю исправление for-loop деклараций. Последняя ошибка была в + fluid/panels/settings_panel.cxx:555. - Согласно плану, Cairo+Pango+glib слишком велики для бандлинга (~1M строк). - Нужно: - 1. Оставить как системные зависимости - 2. Добавить режим USE_CAIRO=0 для чистого Xlib+Xft рендеринга - 3. Задокументировать зависимости +⏺ Read(fluid/panels/settings_panel.cxx) + ⎿ Read 30 lines - Начну с анализа использования Cairo в проекте. +⏺ Вижу проблему. Переменная int i; объявлена внутри if блока (строка 550), но + используется в else блоке (строка 555). Исправляю. -⏺ Search(pattern: "FLTK_HAVE_CAIRO|USE_CAIRO|cairo", path: "~/Desktop/fltk", - glob: "Makefile", output_mode: "content") - ⎿ Found 2 lines (ctrl+o to expand) +⏺ Update(fluid/panels/settings_panel.cxx) + ⎿ Added 1 line, removed 1 line + 545 static void cb_w_layout_menu(Fl_Menu_Button*, void* v) { + 546 if (v == LOAD) { + 547 fld::app::Layout_Suite &suite = (*Fluid.layout_list)[Fluid + .layout_list->current_suite()]; + 548 + int i; + 549 if (suite.storage_ == FLD_TOOL_STORE_INTERNAL) { + 550 w_layout_menu_rename->deactivate(); + 550 - int i; + 551 for (i =1; i<4; i++) w_layout_menu_storage[i]->deactivat + e(); + 552 w_layout_menu_delete->deactivate(); + 553 } else { -⏺ Search(pattern: "#include.*cairo", path: "src", output_mode: "content") - ⎿ Found 9 lines (ctrl+o to expand) +⏺ Пересобираю проект для проверки оставшихся ошибок. -⏺ Search(pattern: "FLTK_HAVE_CAIRO", path: "FL") - ⎿ Found 0 files +⏺ Bash(make 2>&1 | grep -E "error:" | head -25) + ⎿ fluid/widgets/Node_Browser.cxx:559:14: error: use of undeclared identif + ier 'k' + fluid/widgets/Node_Browser.cxx:559:26: error: use of undeclared identif + … +21 lines (ctrl+o to expand) -⏺ Read(FL/fl_config.h) - ⎿ Read 95 lines -⏺ Search(pattern: "FLTK_HAVE_CAIRO|CAIRO", path: "src", glob: "*.cxx") - ⎿ Found 13 files (ctrl+o to expand) -⏺ Read(Makefile) - ⎿ Read 200 lines +⏺ Ошибка в fluid/widgets/Node_Browser.cxx - переменная k не объявлена. -⏺ Read(Makefile) - ⎿ Read 200 lines +⏺ Read(fluid/widgets/Node_Browser.cxx) + ⎿ Read 50 lines -⏺ Search(pattern: "src/drivers/Xlib/*.cxx") - ⎿ Found 11 files (ctrl+o to expand) +⏺ Вижу проблему: Node *k; объявляется на строке 554 внутри if (!l->folded_), но + используется на строке 559 в блоке else. Нужно переместить декларацию. -⏺ Search(pattern: "src/drivers/Xlib/*.H") - ⎿ Found 0 files +⏺ Update(fluid/widgets/Node_Browser.cxx) + ⎿ Added 1 line, removed 1 line + 549 l = pushedtitle; + 550 title = pushedtitle = 0; + 551 if (l) { + 552 + Node *k; + 553 if (!l->folded_) { + 554 l->folded_ = 1; + 554 - Node *k; + 555 for (k = l->next; k&&k->level>l->level; k = k->next) + 556 k->visible = 0; + 557 } else { + +⏺ Пересобираю. + +⏺ Bash(make 2>&1 | grep -E "error:" | head -25) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Read(src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx) - ⎿ Read 80 lines + ⎿ Found 10 new diagnostic issues in 1 file (ctrl+o to expand) -⏺ Read(src/drivers/X11/fl_X11_platform_init.cxx) - ⎿ Read 82 lines +⏺ Ошибок компиляции нет. Проверю, есть ли ещё какие-либо предупреждения. -⏺ Read(config.h) - ⎿ Read 341 lines +⏺ Bash(make 2>&1 | grep -E "warning:|error:" | head -30) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Search(pattern: "src/drivers/Xlib/*.H", path: "~/Desktop/fltk") - ⎿ Found 4 files (ctrl+o to expand) -⏺ Read(src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H) - ⎿ Read 60 lines +⏺ Проект собирается без ошибок. Исправление for-loop деклараций завершено. -⏺ Теперь добавлю опцию USE_CAIRO в Makefile. При USE_CAIRO=0 будет - использоваться чистый Xlib+Xft рендеринг. +⏺ Исправление for-loop деклараций завершено. Теперь проверю, какие ещё + запрещённые ключевые слова остались в проекте согласно Фазе 3 плана. -⏺ Read(Makefile) - ⎿ Read 40 lines +⏺ Bash(echo "=== final ===" && grep -rn '\bfinal\b' src/ FL/ fluid/ + --include="*.cxx" --include="*.H" --include="*.h" 2>/dev/null | grep -v + "// " | wc -l) + ⎿ === final === + 7 + /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Update(Makefile) - ⎿ Added 5 lines - 40 # Set USE_BUNDLED_X11=1 to use headers from xlibs/include (run - xlibs/fetch_headers.sh first) - 41 USE_BUNDLED_X11 ?= 0 - 42 - 43 +# Cairo rendering option - 44 +# Set USE_CAIRO=0 for pure Xlib+Xft rendering (no Cairo/Pango d - +ependency) - 45 +# Set USE_CAIRO=1 (default) for Cairo+Pango rendering - 46 +USE_CAIRO ?= 1 - 47 + - 48 UNAME_S := $(shell uname -s) - 49 ifeq ($(USE_BUNDLED_X11),1) - 50 # Use bundled X11 headers, still link system libraries - -⏺ Update(Makefile) - ⎿ Added 10 lines, removed 2 lines - 64 X11_LIBS = $(shell pkg-config --libs x11 xext xft xinera - ma xcursor xfixes xrender) - 65 endif - 66 - 67 -CAIRO_CFLAGS = $(shell pkg-config --cflags cairo pangocairo pan - -go) - 68 -CAIRO_LIBS = $(shell pkg-config --libs cairo pangocairo pango - - gobject-2.0) - 67 +# Cairo/Pango configuration (only when USE_CAIRO=1) - 68 +ifeq ($(USE_CAIRO),1) - 69 + CAIRO_CFLAGS = $(shell pkg-config --cflags cairo pangocairo - + pango) - 70 + CAIRO_LIBS = $(shell pkg-config --libs cairo pangocairo p - +ango gobject-2.0) - 71 + CAIRO_DEFINES = -DFLTK_USE_CAIRO=1 -DFLTK_HAVE_CAIRO=1 -DUS - +E_PANGO=1 - 72 +else - 73 + CAIRO_CFLAGS = - 74 + CAIRO_LIBS = - 75 + CAIRO_DEFINES = -DFLTK_USE_CAIRO=0 -DFLTK_HAVE_CAIRO=0 -DUS - +E_PANGO=0 - 76 +endif - 77 - 78 # OpenGL configuration (separate from X11 bundling) - 79 ifeq ($(UNAME_S),Darwin) - -⏺ Update(Makefile) - ⎿ Added 2 lines, removed 2 lines - 95 JPEG_LIBS = - 96 - 97 # Combined flags - 98 -ALL_CFLAGS = $(CFLAGS) $(DEFINES) $(INCLUDES) $(X11_CFLAGS) - -$(CAIRO_CFLAGS) - 99 -ALL_CXXFLAGS = $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(X11_CFLAGS - -) $(CAIRO_CFLAGS) - 98 +ALL_CFLAGS = $(CFLAGS) $(DEFINES) $(INCLUDES) $(X11_CFLAGS) - +$(CAIRO_CFLAGS) $(CAIRO_DEFINES) - 99 +ALL_CXXFLAGS = $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(X11_CFLAGS - +) $(CAIRO_CFLAGS) $(CAIRO_DEFINES) - 100 - 101 # Libraries for linking - 102 FLTK_LDLIBS = $(X11_LIBS) $(CAIRO_LIBS) -lm -ldl -lpthread - -⏺ Read(Makefile) - ⎿ Read 40 lines -⏺ Update(Makefile) - ⎿ Added 24 lines, removed 3 lines - 261 src/print_button.cxx \ - 262 src/screen_xywh.cxx - 263 - 264 -# X11 driver files - 265 -DRIVER_SRCS = \ - 264 +# X11 driver files (common) - 265 +DRIVER_SRCS_COMMON = \ - 266 src/Fl_x.cxx \ - 267 src/fl_dnd_x.cxx \ - 268 src/Fl_get_key.cxx \ - ... - 278 src/drivers/X11/Fl_X11_Window_Driver.cxx \ - 279 src/drivers/X11/fl_X11_platform_init.cxx \ - 280 src/drivers/Xlib/Fl_Xlib_Copy_Surface_Driver.cxx \ - 281 - src/drivers/Xlib/Fl_Xlib_Image_Surface_Driver.cxx \ - 281 + src/drivers/Xlib/Fl_Xlib_Image_Surface_Driver.cxx - 282 + - 283 +# Cairo graphics driver (USE_CAIRO=1) - 284 +DRIVER_SRCS_CAIRO = \ - 285 src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx \ - 286 src/drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx - 287 - 288 +# Xlib graphics driver (USE_CAIRO=0) - pure Xlib+Xft rendering - 289 +DRIVER_SRCS_XLIB = \ - 290 + src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx \ - 291 + src/drivers/Xlib/Fl_Xlib_Graphics_Driver_arci.cxx \ - 292 + src/drivers/Xlib/Fl_Xlib_Graphics_Driver_color.cxx \ - 293 + src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx \ - 294 + src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx \ - 295 + src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx \ - 296 + src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx \ - 297 + src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx - 298 + - 299 +# Select driver based on USE_CAIRO - 300 +ifeq ($(USE_CAIRO),1) - 301 + DRIVER_SRCS = $(DRIVER_SRCS_COMMON) $(DRIVER_SRCS_CAIRO) - 302 +else - 303 + DRIVER_SRCS = $(DRIVER_SRCS_COMMON) $(DRIVER_SRCS_XLIB) - 304 +endif - 305 + - 306 # PostScript driver - 307 PS_SRCS = \ - 308 src/drivers/PostScript/Fl_PostScript.cxx \ - -⏺ Read(FL/fl_config.h) - ⎿ Read 95 lines - -⏺ Нужно обновить fl_config.h для поддержки переопределений через командную - строку. - -⏺ Update(FL/fl_config.h) - ⎿ Added 3 lines - 46 * FLTK_HAVE_CAIRO - 47 * - 48 * Do we have Fl_Cairo_Window support? - 49 + * Can be overridden via -DFLTK_HAVE_CAIRO=0 for pure Xlib+Xft - +build. - 50 */ - 51 - 52 +#ifndef FLTK_HAVE_CAIRO - 53 #define FLTK_HAVE_CAIRO 1 - 54 +#endif - 55 - 56 /* - 57 * FLTK_HAVE_CAIROEXT - -⏺ Update(FL/fl_config.h) - ⎿ Added 3 lines - 82 * FLTK_USE_CAIRO - 83 * - 84 * Do we use Cairo to draw to the display? - 85 + * Can be overridden via -DFLTK_USE_CAIRO=0 for pure Xlib+Xft b - +uild. - 86 */ - 87 - 88 +#ifndef FLTK_USE_CAIRO - 89 #define FLTK_USE_CAIRO 1 - 90 +#endif - 91 - 92 /* - 93 * FLTK_USE_SVG - -⏺ Update(config.h) - ⎿ Added 3 lines - 105 * USE_PANGO - 106 * - 107 * Use the pango library to draw UTF-8 text. - 108 + * Can be overridden via -DUSE_PANGO=0 for pure Xlib+Xft build - +. - 109 */ - 110 - 111 +#ifndef USE_PANGO - 112 #define USE_PANGO 1 - 113 +#endif - 114 - 115 /* - 116 * HAVE_XFIXES: - -⏺ Проверю сборку с USE_CAIRO=0. - -⏺ Bash(make clean 2>&1 | tail -5) - ⎿ rm -f src/fl_images_core.o src/fl_write_png.o src/Fl_BMP_Image.o src/Fl - _File_Icon2.o src/Fl_GIF_Image.o src/Fl_Anim_GIF_Image.o src/Fl_Help_Di - alog.o src/Fl_ICO_Image.o src/Fl_JPEG_Image.o src/Fl_PNG_Image.o src/Fl - … +53 lines (ctrl+o to expand) +⏺ Bash(echo "=== nullptr ===" && grep -rn '\bnullptr\b' src/ FL/ fluid/ + --include="*.cxx" --include="*.H" --include="*.h" 2>/dev/null | wc -l) + ⎿ === nullptr === + 0 + /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh +⏺ Bash(echo "=== constexpr ===" && grep -rn '\bconstexpr\b' src/ FL/ fluid/ + --include="*.cxx" --include="*.H" --include="*.h" 2>/dev/null | wc -l) + ⎿ === constexpr === + 0 + /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh - ⎿ Found 1 new diagnostic issue in 1 file (ctrl+o to expand) -⏺ Bash(make USE_CAIRO=0 lib/libfltk.a 2>&1 | head -50) timeout: 3m 0s - ⎿ g++ -O2 -Wall -fPIC -std=c++11 -DFL_LIBRARY -I. -I./src -I./jpeg -I./pn - g -I./zlib -I./fluid -I/opt/X11/include -DFLTK_USE_CAIRO=0 -DFLTK_HAVE - _CAIRO=0 -DUSE_PANGO=0 -c -o src/Fl.o src/Fl.cxx - … +10 lines (ctrl+o to expand) +⏺ Bash(echo "=== dynamic_cast ===" && grep -rn '\bdynamic_cast\b' src/ FL/ + fluid/ --include="*.cxx" --include="*.H" --include="*.h" 2>/dev/null | wc + -l) + ⎿ === dynamic_cast === + 4 + /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh +⏺ Bash(echo "=== enum class ===" && grep -rn 'enum class\|enum struct' src/ FL/ + fluid/ --include="*.cxx" --include="*.H" --include="*.h" 2>/dev/null | wc + -l) + ⎿ === enum class === + 0 + /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Read(FL/Fl_Cairo.H) - ⎿ Read 101 lines -⏺ Проблема в том, что #ifndef проверяет наличие макроса, а -DFLTK_HAVE_CAIRO=0 - его определяет (как 0). Нужно использовать #if !defined(...). +⏺ Bash(grep -rn '\bfinal\b' src/ FL/ fluid/ --include="*.cxx" --include="*.H" + --include="*.h" 2>/dev/null | grep -v "// ") + ⎿ src//Fl_GIF_Image.cxx:472: format supports only 1 bit for alpha. The f + inal image data is stored in + src//Fl_Preferences.cxx:295: The application argument can be the workin + … +9 lines (ctrl+o to expand) -⏺ Update(FL/fl_config.h) - ⎿ Added 1 line, removed 1 line - 49 * Can be overridden via -DFLTK_HAVE_CAIRO=0 for pure Xlib+Xft - build. - 50 */ - 51 - 52 -#ifndef FLTK_HAVE_CAIRO - 52 +#if !defined(FLTK_HAVE_CAIRO) - 53 #define FLTK_HAVE_CAIRO 1 - 54 #endif - 55 -⏺ Update(FL/Fl_Cairo.H) - ⎿ Added 1 line, removed 1 line - 35 - 36 #include <FL/Fl.H> - 37 - 38 -# ifdef FLTK_HAVE_CAIRO - 38 +# if FLTK_HAVE_CAIRO - 39 - 40 # include <cairo.h> - 41 -⏺ Search(pattern: "#ifdef FLTK_HAVE_CAIRO|#if defined\(FLTK_HAVE_CAIRO\)", - output_mode: "content") - ⎿ Found 9 lines (ctrl+o to expand) - ⎿ Found 1 new diagnostic issue in 1 file (ctrl+o to expand) +⏺ Bash(grep -rn '\bdynamic_cast\b' src/ FL/ fluid/ --include="*.cxx" + --include="*.H" --include="*.h" 2>/dev/null) + ⎿ FL//Fl_Widget.H:1214: \note This method is provided to avoid dynam + ic_cast. + FL//Fl_Widget.H:1229: \note This method is provided to avoid dynam + … +6 lines (ctrl+o to expand) -⏺ Search(pattern: "#ifdef FLTK_USE_CAIRO|#if defined\(FLTK_USE_CAIRO\)", - output_mode: "content") - ⎿ Found 0 lines -⏺ Search(pattern: "FLTK_USE_CAIRO", output_mode: "content") - ⎿ Found 105 lines (ctrl+o to expand) -⏺ Bash(sed -i '' 's/#ifdef FLTK_HAVE_CAIRO/#if FLTK_HAVE_CAIRO/g' - examples/cairo-draw-x.cxx src/Fl_Cairo.cxx src/Fl_Private.H FL/Fl.H - test/cairo_test.cxx && echo "Done…) - ⎿ Done replacing #ifdef FLTK_HAVE_CAIRO +⏺ Отлично! Все вхождения - это либо комментарии, либо переменные с именем final, + либо строковые литералы. Фаза 3 полностью завершена: + + - override - 0 (удалено) + - auto - 0 (удалено) + - nullptr - 0 (заменено на 0) + - constexpr - 0 (удалено) + - enum class - 0 (удалено) + - final (ключевое слово) - 0 (оставшиеся - переменные или комментарии) + - dynamic_cast - 0 (оставшиеся - комментарии или строковые литералы) + - for-loop декларации - исправлены + +⏺ Проверю оставшиеся нарушения в Фазе 4 - использование std::. + +⏺ Bash(grep -rn 'std::' src/ FL/ fluid/ --include="*.cxx" --include="*.H" + --include="*.h" 2>/dev/null | grep -v "// " | grep -v "/\*" | head -40) + ⎿ src//filename_absolute.cxx:128: C++17 `std::filesystem::path::lexicall + y_relative`. This function can also be + src//filename_absolute.cxx:168: \see fl_filename_relative(const std: + … +25 lines (ctrl+o to expand) + + + +⏺ Вижу использования std:: в строковых литералах (генерация кода FLUID). Проверю + реальные использования стандартной библиотеки. + +⏺ Bash(grep -rn '#include <vector>\|#include <string>\|#include <map>\|#include + <memory>\|#include <algorithm>' src/ FL/ fluid/ --include="*.cxx" + --include="*.H" --inc…) + ⎿ fluid//nodes/Function_Node.cxx:1033: f.write_h_once("#include <s + tring>"); + fluid//nodes/Function_Node.cxx:1049: f.write_h_once("#include <v + … +17 lines (ctrl+o to expand) + + + +⏺ Bash(grep -rn '^#include <vector>\|^#include <string>\|^#include + <map>\|^#include <memory>\|^#include <algorithm>\|^#include + <sstream>\|^#include <iostream>' src/ FL…) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + + +⏺ Отлично! Реальных включений стандартной библиотеки нет. Проверю + namespace/using. + +⏺ Bash(grep -rn '\bnamespace\b\|^using ' src/ FL/ --include="*.cxx" + --include="*.H" --include="*.h" 2>/dev/null | grep -v "// " | grep -v + "/\*" | head -20) + ⎿ src//Fl_Widget.cxx:168: Note: There's no need to have this in the Fl + :: namespace. + src//Fl_Private.H:29: All prefixed with Fl_Private_ instead of using na + … +10 lines (ctrl+o to expand) + + + +⏺ namespace Fl остаётся - это Phase 4b, которая отложена. Проверю состояние + FLUID (Фаза 5). + +⏺ Bash(grep -rn '\bnamespace\b' fluid/ --include="*.cxx" --include="*.H" + --include="*.h" 2>/dev/null | grep -v "// " | grep -v "/\*" | grep -v '\"' + | head -20) + ⎿ fluid//proj/i18n.h:24:namespace fld { + fluid//proj/i18n.h:41:namespace fld { + fluid//proj/i18n.h:43:namespace io { + … +19 lines (ctrl+o to expand) + +⏺ В FLUID много namespace. Посчитаю масштаб работы. + +⏺ Bash(grep -rn '\bnamespace\b' fluid/ --include="*.cxx" --include="*.H" + --include="*.h" 2>/dev/null | grep -v "// " | grep -v "/\*" | grep -v '\"' + | wc -l) + ⎿ 95 /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Bash(make USE_CAIRO=0 lib/libfltk.a 2>&1 | head -80) timeout: 3m 0s - ⎿ g++ -O2 -Wall -fPIC -std=c++11 -DFL_LIBRARY -I. -I./src -I./jpeg -I./pn - g -I./zlib -I./fluid -I/opt/X11/include -DFLTK_USE_CAIRO=0 -DFLTK_HAVE - _CAIRO=0 -DUSE_PANGO=0 -c -o src/Fl.o src/Fl.cxx - … +274 lines (ctrl+o to expand) +⏺ Bash(grep -rn '^using ' fluid/ --include="*.cxx" --include="*.H" + --include="*.h" 2>/dev/null | wc -l) + ⎿ 41 + /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh +⏺ В FLUID: 95 namespace, 41 using директив. Это Фаза 5. Обновлю план и начну + работу. -⏺ Bash(make USE_CAIRO=0 lib/libfltk.a 2>&1 | tail -50) timeout: 3m 0s - ⎿ g++ -O2 -Wall -fPIC -std=c++11 -DFL_LIBRARY -I. -I./src -I./jpeg -I./pn - g -I./zlib -I./fluid -I/opt/X11/include -DFLTK_USE_CAIRO=0 -DFLTK_HAVE - _CAIRO=0 -DUSE_PANGO=0 -c -o src/fl_font.o src/fl_font.cxx - … +160 lines (ctrl+o to expand) +⏺ Проанализирую структуру namespace в FLUID. +⏺ Bash(grep -rn '\bnamespace\b' fluid/ --include="*.cxx" --include="*.H" + --include="*.h" 2>/dev/null | grep -v "// " | grep -v "/\*" | grep -v '\"' + | sed 's/.*namespac…) + ⎿ 26 fld { + 21 fld; + 9 widget { + … +13 lines (ctrl+o to expand) +⏺ Это большая задача. Давайте начнём систематически. Сначала посмотрю, какие + классы объявлены в namespace. -⏺ Xft требует FreeType. Нужно добавить FreeType include path в Makefile. +⏺ Bash(grep -rn 'class.*{' fluid/ --include="*.h" --include="*.H" 2>/dev/null | + grep -v "// " | head -40) + ⎿ fluid//tools/ExternalCodeEditor_UNIX.h:22:class ExternalCodeEditor { + fluid//tools/autodoc.h:30:class Fl_Margin : public Fl_Rect { + fluid//tools/ExternalCodeEditor_WIN32.h:30:class ExternalCodeEditor { + … +50 lines (ctrl+o to expand) -⏺ Read(Makefile) - ⎿ Read 50 lines +⏺ Посмотрю структуру файлов с namespace. -⏺ Update(Makefile) - ⎿ Added 3 lines, removed 3 lines - 55 X11_LIBS = $(shell pkg-config --libs x11 xext xft xi - nerama xcursor xfixes xrender) - 56 endif - 57 else ifeq ($(UNAME_S),Darwin) - 58 - # macOS with XQuartz - 59 - X11_CFLAGS = -I/opt/X11/include - 60 - X11_LIBS = -L/opt/X11/lib -lX11 -lXext -lXft -lXinerama - --lXcursor -lXfixes -lXrender - 58 + # macOS with XQuartz (include freetype2 for Xft) - 59 + X11_CFLAGS = -I/opt/X11/include -I/opt/X11/include/freetyp - +e2 - 60 + X11_LIBS = -L/opt/X11/lib -lX11 -lXext -lXft -lXinerama - +-lXcursor -lXfixes -lXrender -lfontconfig -lfreetype - 61 else - 62 # Linux - use pkg-config - 63 X11_CFLAGS = $(shell pkg-config --cflags x11 xext xft xine - rama xcursor xfixes xrender) - -⏺ Update(Makefile) - ⎿ Added 3 lines, removed 3 lines - 59 X11_CFLAGS = -I/opt/X11/include -I/opt/X11/include/freetyp - e2 - 60 X11_LIBS = -L/opt/X11/lib -lX11 -lXext -lXft -lXinerama - -lXcursor -lXfixes -lXrender -lfontconfig -lfreetype - 61 else - 62 - # Linux - use pkg-config - 63 - X11_CFLAGS = $(shell pkg-config --cflags x11 xext xft xine - -rama xcursor xfixes xrender) - 64 - X11_LIBS = $(shell pkg-config --libs x11 xext xft xinera - -ma xcursor xfixes xrender) - 62 + # Linux - use pkg-config (include freetype2 for Xft) - 63 + X11_CFLAGS = $(shell pkg-config --cflags x11 xext xft xine - +rama xcursor xfixes xrender freetype2 fontconfig) - 64 + X11_LIBS = $(shell pkg-config --libs x11 xext xft xinera - +ma xcursor xfixes xrender freetype2 fontconfig) - 65 endif - 66 - 67 # Cairo/Pango configuration (only when USE_CAIRO=1) +⏺ Read(fluid/proj/i18n.h) + ⎿ Read 105 lines -⏺ Update(Makefile) - ⎿ Added 2 lines, removed 1 line - 52 ifeq ($(UNAME_S),Darwin) - 53 X11_LIBS = -L/opt/X11/lib -lX11 -lXext -lXft -lXiner - ama -lXcursor -lXfixes -lXrender - 54 else - 55 - X11_LIBS = $(shell pkg-config --libs x11 xext xft xi - -nerama xcursor xfixes xrender) - 55 + X11_CFLAGS += $(shell pkg-config --cflags freetype2 fon - +tconfig) - 56 + X11_LIBS = $(shell pkg-config --libs x11 xext xft xi - +nerama xcursor xfixes xrender freetype2 fontconfig) - 57 endif - 58 else ifeq ($(UNAME_S),Darwin) - 59 # macOS with XQuartz (include freetype2 for Xft) +⏺ Bash(grep -rl '\bnamespace\b' fluid/ --include="*.cxx" --include="*.H" + --include="*.h" 2>/dev/null | sort) + ⎿ fluid//Fluid.h + fluid//Project.h + fluid//app/Snap_Action.cxx + … +46 lines (ctrl+o to expand) -⏺ Bash(rm -f src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.o && timeout: - make USE_CAIRO=0 lib/libfltk.a 2>&1 | tail -30) 3m 0s - ⎿ 83 | # define strlcpy fl_strlcpy - | ^ - /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/ - … +113 lines (ctrl+o to expand) +⏺ 47 файлов. Проанализирую классы в namespace. +⏺ Bash(grep -rn 'class [A-Z][A-Za-z_]*' fluid/ --include="*.h" --include="*.H" + 2>/dev/null | grep -B5 'namespace' | head -60) + ⎿ fluid//proj/i18n.h:53:class I18n + fluid//proj/align_widget.h:20:class Fl_Widget; + fluid//proj/undo.h:22:class Fl_Widget; + … +5 lines (ctrl+o to expand) -⏺ libfltk.a собрана успешно с USE_CAIRO=0. Теперь соберу остальные библиотеки и - fluid. +⏺ Read(fluid/io/Project_Reader.h) + ⎿ Read 80 lines -⏺ Bash(make USE_CAIRO=0 all 2>&1 | tail -30) timeout: 5m 0s - ⎿ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cde - fs.h:218:48: note: expanded from macro '__deprecated_msg' - 218 | #define __deprecated_msg(_msg) __attribute__((__depreca - … +119 lines (ctrl+o to expand) +⏺ Read(fluid/Project.h) + ⎿ Read 100 lines +⏺ Это большой рефакторинг. Начну с небольшого файла чтобы отработать подход. +⏺ Read(fluid/proj/undo.h) + ⎿ Read 96 lines -⏺ Сборка с USE_CAIRO=0 завершена успешно. Проверю результат. +⏺ Bash(grep -rn 'proj::Undo\|fld::proj::Undo' fluid/ --include="*.cxx" + --include="*.H" --include="*.h" 2>/dev/null) + ⎿ fluid//app/Menu.cxx:116: {"&Undo", FL_COMMAND+'z', fld::proj::Undo::un + do_cb}, + fluid//app/Menu.cxx:117: {"&Redo", FL_COMMAND+FL_SHIFT+'z', fld::proj: + … +4 lines (ctrl+o to expand) -⏺ Bash(ls -la lib/*.a && ls -la bin/fluid && bin/fluid -v) - ⎿ -rw-r--r--@ 1 mnik01 staff 2291608 Feb 6 13:14 lib/libfltk.a - -rw-r--r--@ 1 mnik01 staff 32888 Feb 6 13:15 lib/libfltk_forms.a - -rw-r--r--@ 1 mnik01 staff 212664 Feb 6 13:15 lib/libfltk_gl.a - … +8 lines (ctrl+o to expand) -⏺ Теперь задокументирую зависимости и опции сборки. -⏺ Search(pattern: "BUILDING*") - ⎿ Found 0 files +⏺ Зависимостей немного. Создам полный список классов для переименования. -⏺ Search(pattern: "README*") - ⎿ Found 27 files (ctrl+o to expand) +⏺ Bash(echo "=== Classes in fld namespace ===" && grep -rn 'namespace fld' + fluid/ --include="*.h" --include="*.H" -A 30 2>/dev/null | grep -E + '^\s*class [A-Z]' | sed '…) + ⎿ === Classes in fld namespace === + /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Read(README.Unix.txt) - ⎿ Read 441 lines -⏺ Update(README.Unix.txt) - ⎿ Added 2 lines, removed 3 lines - 32 - 33 - 34 --------------------------------------------------------------- - ---- - 35 - Note: usage of autotools, configure, and included Makefiles t - -o - 36 - build the FLTK library is no longer available since FLTK 1.5. - -0. - 37 - You must use CMake instead, see below and/or README.CMake.txt - -. - 35 + Note: This fork uses a simple Makefile-based build system. - 36 + CMake is no longer used. See section 3 for build instructions - +. - 37 --------------------------------------------------------------- - ---- - 38 - 39 - -⏺ Update(README.Unix.txt) - ⎿ Added 4 lines, removed 2 lines - 40 1 Introduction - 41 ================= - 42 - 43 +This FLTK fork uses a simple Makefile-based build system. It su - +pports - 44 +X11-only builds with either Cairo+Pango or pure Xlib+Xft render - +ing. - 45 + - 46 FLTK currently supports the following development environments - on most Unix - 47 and Linux platforms: - 48 - 46 - - CMake + the build system of your choice (see README.CMake - -.txt) - 47 - - gcc command line tools - 49 + - make + gcc command line tools - 50 - Code::Blocks - 51 - ... - 52 - -⏺ Update(README.Unix.txt) - ⎿ Added 23 lines, removed 20 lines - 293 3.2 Configuration and Building - 294 --------------------------------- - 295 - 296 -Since FLTK 1.5 the only build system (generator) used by FLTK - -is CMake. - 297 -CMake can be used to create the build system of your choice, f - -or instance - 298 -Makefiles, Ninja build files, Xcode, or Visual Studio IDE proj - -ects etc.. - 296 +This fork uses a simple Makefile. No CMake or autoconf require - +d. - 297 - 300 -Note: The "classic" build system with autoconf, configure, and - - Makefiles - 301 -is no longer available. - 298 +Build options are controlled via make variables: - 299 + - USE_CAIRO=1 (default): Cairo+Pango rendering - 300 + - USE_CAIRO=0: Pure Xlib+Xft rendering (no Cairo/Pango depen - +dency) - 301 + - USE_BUNDLED_X11=1: Use bundled X11 headers from xlibs/incl - +ude - 302 - 303 -Please see README.CMake.txt for how to build FLTK and your app - -lication - 304 -programs using CMake. - 303 - 306 -You can, of course, build FLTK with CMake and your own applica - -tion(s) - 307 -with your existing and well-known build system. - 308 - - 309 - - 304 3.3 Building FLTK in a Nutshell - 305 ---------------------------------- - 306 - 313 -Following are only basic commands, please see details in READM - -E.CMake.txt. - 307 +Building FLTK with default parameters (Cairo+Pango): - 308 - 315 -Building FLTK with all default parameters on your platform is - -easy. - 316 -Stay in your FLTK source-code directory and type: - 309 + make # Build all libraries and fluid - 310 + make test/hello # Build a test program - 311 - 318 - cmake . -B build -D [ CMAKE_BUILD_TYPE=Debug ... more option - -s ] - 319 - cmake --build build - 312 +Building without Cairo (pure Xlib+Xft): - 313 - 321 -The entire FLTK toolkit including many test programs will be b - -uilt for you - 322 -in the subdirectory `build`. No warnings should appear. If som - -e do, please - 323 -let the FLTK developer team know via the mailing list "fltk.ge - -neral" or - 324 -view the bug reporting guidelines at https://www.fltk.org/bugs - -.php . - 314 + make USE_CAIRO=0 # Build with Xlib+Xft rendering - 315 - 316 +Using bundled X11 headers (first run xlibs/fetch_headers.sh): - 317 - 318 + ./xlibs/fetch_headers.sh - 319 + make USE_BUNDLED_X11=1 - 320 + - 321 +The libraries are built in lib/: - 322 + - libfltk.a Core library - 323 + - libfltk_images.a Image support (PNG, JPEG, GIF, etc.) - 324 + - libfltk_gl.a OpenGL support - 325 + - libfltk_forms.a XForms compatibility - 326 + - 327 +The fluid GUI builder is built in bin/fluid. - 328 + - 329 + - 330 3.4 Testing FLTK - 331 ------------------- - 332 - -⏺ Update(README.Unix.txt) - ⎿ Added 17 lines, removed 21 lines - 80 - 81 Open a shell and install some development software: - 82 - 83 - sudo apt-get install g++ - 84 - sudo apt-get install gdb - 85 - sudo apt-get install git - 86 - sudo apt-get install make # if used - 87 - sudo apt-get install cmake - 88 - sudo apt-get install libx11-dev - 89 - sudo apt-get install libglu1-mesa-dev - 90 - sudo apt-get install libxft-dev - 91 - sudo apt-get install libxcursor-dev - 83 + sudo apt-get install g++ make gdb git - 84 - 93 -# These packages are optional but recommended: - 85 +# Core X11 dependencies (always required): - 86 - 95 - sudo apt-get install libasound2-dev - 96 - sudo apt-get install freeglut3-dev - 97 - sudo apt-get install libcairo2-dev - 98 - sudo apt-get install libfontconfig1-dev - 99 - sudo apt-get install libglew-dev - 100 - sudo apt-get install libjpeg-dev - 101 - sudo apt-get install libpng-dev - 102 - sudo apt-get install libpango1.0-dev - 103 - sudo apt-get install libxinerama-dev - 87 + sudo apt-get install libx11-dev libxext-dev libxft-dev - 88 + sudo apt-get install libxinerama-dev libxcursor-dev - 89 + sudo apt-get install libxfixes-dev libxrender-dev - 90 + sudo apt-get install libfontconfig1-dev libfreetype-dev - 91 - 105 -If you want to build FLTK for Wayland (the supposed successor - -of X) you need - 106 -some more packages. Please refer to README.Wayland.txt for mor - -e information. - 92 +# For Cairo+Pango rendering (USE_CAIRO=1, default): - 93 - 94 + sudo apt-get install libcairo2-dev libpango1.0-dev - 95 + - 96 +# For OpenGL support: - 97 + - 98 + sudo apt-get install libglu1-mesa-dev - 99 + - 100 +# Optional packages: - 101 + - 102 + sudo apt-get install libasound2-dev # audio support - 103 + - 104 If you are planning to use the Code::Blocks IDE, also install - this - 105 - 106 sudo apt-get install codeblocks - -⏺ Update(README.Unix.txt) - ⎿ Added 10 lines, removed 13 lines - 335 3.5 Installing FLTK - 336 ---------------------- - 337 - 338 -If you did not change any of the configuration settings, FLTK - -will be installed - 339 -in "/usr/local/include" and "/usr/local/lib" by typing - 338 +FLTK can be installed to /usr/local by typing: - 339 - 341 - sudo cmake --install . - 340 + sudo make install - 341 - 343 -in your build folder. Note the trailing '.' . - 342 +This will copy: - 343 + - Headers to /usr/local/include/FL - 344 + - Libraries to /usr/local/lib - 345 + - fluid to /usr/local/bin - 346 - 345 -It is possible to install FLTK without superuser privileges by - - changing the - 346 -installation path to a location within the user account by add - -ing the - 347 -"-D CMAKE_INSTALL_PREFIX=<path>" parameters to the "cmake" com - -mand. - 347 +To change the installation prefix, edit PREFIX in Makefile or - +type: - 348 - 349 + sudo make PREFIX=/opt/fltk install - 350 + - 351 Note: installing FLTK is optional. You can build your own soft - ware by using - 352 the FLTK build tree directly. This is recommended if you link - your application - 351 -statically (which is recommended as well). This is particularl - -y important if you - 352 -consider using different FLTK versions on a development system - - to avoid mixing - 353 -FLTK versions when building (a well-known problem) or running - -FLTK applications - 354 -with installed shared libraries of a different FLTK version. O - -TOH, if you build - 355 -shared FLTK libraries you may want to install FLTK, particular - -ly on a production - 356 -system. - 353 +statically (which is recommended as well). - 354 - 355 - 356 3.6 Creating Your Own Projects - -⏺ Проверю, что сборка с Cairo (по умолчанию) тоже работает. - -⏺ Bash(make clean 2>&1 | tail -3 && make lib/libfltk.a 2>&1 | tail timeout: 3m - -10) 0s - - ⎿ rm -f jpeg/jaricom.o jpeg/jcapimin.o jpeg/jcapistd.o jpeg/jcarith.o jpe - g/jccoefct.o jpeg/jccolor.o jpeg/jcdctmgr.o jpeg/jchuff.o jpeg/jcinit.o - jpeg/jcmainct.o jpeg/jcmarker.o jpeg/jcmaster.o jpeg/jcomapi.o jpeg/jc - … +172 lines (ctrl+o to expand) - - - - -⏺ Bash(make all 2>&1 | tail -5) timeout: 5m 0s - ⎿ g++ -O2 -Wall -fPIC -std=c++11 -DFL_LIBRARY -I. -I./src -I./jpeg -I./pn - g -I./zlib -I./fluid -I/opt/X11/include -I/opt/X11/include/freetype2 -I - /opt/homebrew/Cellar/pango/1.56.4/include/pango-1.0 -I/opt/homebrew/Cel - … +62 lines (ctrl+o to expand) - - - - -⏺ Bash(ls -la lib/*.a && bin/fluid -v) - ⎿ -rw-r--r--@ 1 mnik01 staff 2237200 Feb 6 13:17 lib/libfltk.a - -rw-r--r--@ 1 mnik01 staff 32888 Feb 6 13:17 lib/libfltk_forms.a - -rw-r--r--@ 1 mnik01 staff 212440 Feb 6 13:17 lib/libfltk_gl.a - … +7 lines (ctrl+o to expand) - -⏺ Фаза 8 (Cairo/Pango стратегия) завершена. - - Итог работы: - - Фаза 7 (Bundling Xlib) - завершена: - - Создана директория xlibs/ с скриптом fetch_headers.sh - - Скрипт скачивает X11 заголовки из freedesktop.org - - Опция USE_BUNDLED_X11=1 позволяет собирать без системных X11-dev пакетов - (нужны только библиотеки) - - Фаза 8 (Cairo/Pango) - завершена: - - Добавлена опция USE_CAIRO в Makefile: - - USE_CAIRO=1 (по умолчанию): Cairo+Pango рендеринг - - USE_CAIRO=0: Чистый Xlib+Xft рендеринг (без зависимости от - Cairo/Pango/glib) - - Обновлены fl_config.h и config.h для поддержки переопределений - - Исправлены все #ifdef FLTK_HAVE_CAIRO на #if FLTK_HAVE_CAIRO - - Добавлены файлы Xlib графического драйвера для режима без Cairo - - Обновлена документация в README.Unix.txt - - Результаты сборки: - USE_CAIRO=1: libfltk.a = 2.2 MB (Cairo+Pango) - USE_CAIRO=0: libfltk.a = 2.3 MB (Xlib+Xft) - - Оставшаяся задача (отложена): - - Фаза 4b: Конвертация namespace Fl в class Fl - требует значительной - переработки API - -✻ Brewed for 15m 23s - -❯ продолжай - -⏺ Проверю оставшиеся нарушения CLAUDE.md в коде. - -⏺ Bash(echo "=== namespace usage ===" && grep -rn "^namespace\|[^a-z]namespace " - src/ FL/ --include="*.cxx" --include="*.H" --include="*.h" 2>/dev/null | - grep -v "// n…) - ⎿ === namespace usage === - FL//core/events.H:30:namespace Fl { - FL//core/options.H:28:namespace Fl { - … +6 lines (ctrl+o to expand) +⏺ Bash(for f in fluid/proj/*.h fluid/io/*.h fluid/app/*.h fluid/nodes/Tree.h + fluid/Project.h; do echo "=== $f ==="; grep -E 'class [A-Z][A-Za-z_]*' + "$f" 2>/dev/null |…) + ⎿ === fluid/proj/align_widget.h === + class Fl_Widget; + === fluid/proj/i18n.h === + … +57 lines (ctrl+o to expand) + +⏺ Классы для переименования (в порядке зависимости): + 1. fld::Project → Fld_Project + 2. fld::proj::Undo → Fld_Undo + 3. fld::proj::I18n → Fld_I18n + 4. fld::io::Project_Reader → Fld_Project_Reader + 5. fld::io::Project_Writer → Fld_Project_Writer + 6. fld::io::Code_Writer → Fld_Code_Writer + 7. fld::node::Tree → Fld_Node_Tree + 8. fld::app::* → Fld_* + + Начну с proj/undo.h - удалю namespace и переименую класс. + +⏺ Read(fluid/proj/undo.cxx) + ⎿ Read 274 lines + +⏺ Вижу использование using namespace fld; и using namespace fld::proj;. Начну с + систематической замены. Сначала уберу using namespace и добавлю явные + квалификаторы, затем можно будет переименовать классы. + +⏺ Update(fluid/proj/undo.cxx) + ⎿ Added 1 line, removed 5 lines + 47 + 48 extern Fl_Window* the_panel; + 49 + 50 -using namespace fld; + 51 -using namespace fld::proj; + 52 - + 53 - + 54 -Undo::Undo(Project &p) + 50 +fld::proj::Undo::Undo(fld::Project &p) + 51 : proj_( p ) + 52 { } + 53 + +⏺ Read(fluid/proj/undo.cxx) + ⎿ Read 30 lines + ⎿ Found 10 new diagnostic issues in 1 file (ctrl+o to expand) -⏺ Bash(echo "=== nullptr count ===" && grep -rn "\bnullptr\b" src/ FL/ fluid/ - --include="*.cxx" --include="*.H" --include="*.h" 2>/dev/null | wc -l - echo ""…) - ⎿ Error: Exit code 1 - /Users/mnik01/.zprofile:source:3: no such file or directory: - /Users/mnik01/Desktop/hobby/emsdk/emsdk_env.sh - wc: echo: open: No such file or directory - wc: : open: No such file or directory - wc: echo: open: No such file or directory - wc: === override count ===: open: No such file or directory +⏺ Update(fluid/proj/undo.cxx) + ⎿ Added 12 lines, removed 12 lines + 47 + 48 extern Fl_Window* the_panel; + 49 + 50 -fld::proj::Undo::Undo(fld::Project &p) + 50 +fld::proj::fld::proj::Undo::Undo(fld::Project &p) + 51 : proj_( p ) + 52 { } + 53 + 54 -Undo::~Undo() { + 54 +fld::proj::Undo::~Undo() { + 55 // TODO: delete old undo files when calling the destructor. + 56 } + 57 + ... + 60 // The filename is constructed in a static internal buffer and + 61 // this buffer is overwritten by every call of this function. + 62 // The return value is a pointer to this internal string. + 63 -char *Undo::filename(int level) { + 63 +char *fld::proj::Undo::filename(int level) { + 64 if (!path_len_) { + 65 Fluid.preferences.getUserdataPath(path_, sizeof(path_)); + 66 path_len_ = (unsigned int)strlen(path_); + ... + 75 + 76 + 77 // Redo menu callback + 78 -void Undo::redo() { + 78 +void fld::proj::Undo::redo() { + 79 // int undo_item = main_menubar->find_index(undo_cb); + 80 // int redo_item = main_menubar->find_index(redo_cb); + 81 once_type_ = FLD_UNDO_ONCETYPE_ALWAYS; + ... + 119 } + 120 + 121 // Undo menu callback + 122 -void Undo::undo() { + 122 +void fld::proj::Undo::undo() { + 123 // int undo_item = main_menubar->find_index(undo_cb); + 124 // int redo_item = main_menubar->find_index(redo_cb); + 125 once_type_ = FLD_UNDO_ONCETYPE_ALWAYS; + ... + 180 \param[in] type set a new type, or set to 0 to clear the once + _type without setting a checkpoint + 181 \return 1 if the checkpoint was set, 0 if this is a repeating + event + 182 */ + 183 -int Undo::checkpoint(OnceType type) { + 183 +int fld::proj::Undo::checkpoint(OnceType type) { + 184 if (type == FLD_UNDO_ONCETYPE_ALWAYS) { + 185 once_type_ = FLD_UNDO_ONCETYPE_ALWAYS; + 186 return 0; + ... + 197 } + 198 + 199 // Save current file to undo buffer + 200 -void Undo::checkpoint() { + 200 +void fld::proj::Undo::checkpoint() { + 201 // printf("checkpoint(): current_=%d, paused_=%d, modflag=% + d\n", + 202 // current_, paused_, modflag); + 203 + ... + 231 } + 232 + 233 // Clear undo buffer + 234 -void Undo::clear() { + 234 +void fld::proj::Undo::clear() { + 235 // int undo_item = main_menubar->find_index(undo_cb); + 236 // int redo_item = main_menubar->find_index(redo_cb); + 237 // Remove old checkpoint files... + ... + 251 } + 252 + 253 // Resume undo checkpoints + 254 -void Undo::resume() { + 254 +void fld::proj::Undo::resume() { + 255 paused_--; + 256 } + 257 + 258 // Suspend undo checkpoints + 259 -void Undo::suspend() { + 259 +void fld::proj::Undo::suspend() { + 260 paused_++; + 261 } + 262 + 263 -void Undo::undo_cb(Fl_Widget *, void *) { + 263 +void fld::proj::Undo::undo_cb(Fl_Widget *, void *) { + 264 Fluid.proj.undo.undo(); + 265 } + 266 + 267 -void Undo::redo_cb(Fl_Widget *, void *) { + 267 +void fld::proj::Undo::redo_cb(Fl_Widget *, void *) { + 268 Fluid.proj.undo.redo(); + 269 } + +⏺ Bash(make 2>&1 | grep -E "error:" | head -20) + ⎿ fluid/proj/undo.cxx:50:1: error: no member named 'fld' in namespace 'fl + d::proj'; did you mean simply 'fld'? + /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh - === nullptr count === - 0 total -⏺ Bash(grep -rn "\bnullptr\b" src/ FL/ fluid/ --include="*.cxx" --include="*.H" - --include="*.h" 2>/dev/null | wc -l) + ⎿ Found 10 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Read(fluid/proj/undo.cxx) + ⎿ Read 10 lines + +⏺ Update(fluid/proj/undo.cxx) + ⎿ Added 1 line, removed 1 line + 47 + 48 extern Fl_Window* the_panel; + 49 + 50 -fld::proj::fld::proj::Undo::Undo(fld::Project &p) + 50 +fld::proj::Undo::Undo(fld::Project &p) + 51 : proj_( p ) + 52 { } + 53 + +⏺ Bash(make 2>&1 | grep -E "error:" | head -20) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + + ⎿ Found 6 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Успешно. Продолжу с другими файлами с using namespace. + +⏺ Bash(grep -rn '^using namespace' fluid/ --include="*.cxx" --include="*.H" + --include="*.h" 2>/dev/null) + ⎿ fluid//tools/ExternalCodeEditor_UNIX.cxx:26:using namespace fld; + fluid//tools/ExternalCodeEditor_WIN32.cxx:31:using namespace fld; + fluid//app/templates.cxx:31:using namespace fld; + … +38 lines (ctrl+o to expand) + +⏺ Много файлов. Проверю, есть ли std:: в FLUID, требующий внимания. + +⏺ Bash(grep -rn 'std::' fluid/ --include="*.cxx" --include="*.H" --include="*.h" + 2>/dev/null | grep -v '\"' | grep -v "// " | grep -v "/\*" | wc -l) ⎿ 0 /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Bash(grep -rn "\boverride\b" src/ FL/ fluid/ --include="*.cxx" --include="*.H" - --include="*.h" 2>/dev/null | wc -l) - ⎿ 674 +⏺ Отлично, std:: в FLUID уже удалён. Продолжу удаление using namespace. + Обработаю файлы по порядку. + +⏺ Read(fluid/tools/ExternalCodeEditor_UNIX.cxx) + ⎿ Read 100 lines + +⏺ Read(fluid/Fluid.h) + ⎿ Read 80 lines + +⏺ Bash(grep -n 'extern.*Fluid\|Application.*Fluid' fluid/Fluid.h 2>/dev/null) + ⎿ 204:extern fld::Application Fluid; /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Bash(grep -rn "\bfinal\b" src/ FL/ fluid/ --include="*.cxx" --include="*.H" - --include="*.h" 2>/dev/null | grep -v "finally\|finalized" | wc -l) - ⎿ 12 +⏺ Fluid объявлен как extern fld::Application Fluid;, так что using namespace + fld; не нужен. Удалю его. + +⏺ Update(fluid/tools/ExternalCodeEditor_UNIX.cxx) + ⎿ Removed 2 lines + 23 #include <stdlib.h> /* free().. */ + 24 #include <stdio.h> /* snprintf().. */ + 25 + 26 -using namespace fld; + 27 - + 26 // Static local data + 27 static int L_editors_open = 0; // keep + track of #editors open + 28 static Fl_Timeout_Handler L_update_timer_cb = 0; // app' + s update timer callback + +⏺ Bash(make 2>&1 | grep -E "error:" | head -10) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + + ⎿ Found 3 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Успешно. Проверю, существует ли WIN32 файл (должен был быть удалён в Фазе 1). + +⏺ Bash(ls -la fluid/tools/ExternalCodeEditor_WIN32.cxx 2>/dev/null || echo "File + not found") + ⎿ -rw-r--r--@ 1 mnik01 staff 23098 Feb 6 16:34 fluid/tools/ExternalCod + eEditor_WIN32.cxx /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Обнаружено 674 случая override и 12 final. Удалю их согласно CLAUDE.md. -⏺ Bash(find src FL fluid -name "*.cxx" -o -name "*.H" -o -name "*.h" 2>/dev/null - | xargs sed -i '' 's/ override\b//g' && echo "override removed") - ⎿ override removed +⏺ Файл есть, но не компилируется на X11. Продолжу с app/templates.cxx. + +⏺ Read(fluid/app/templates.cxx) + ⎿ Read 80 lines + +⏺ Bash(grep -n 'Fluid\.' fluid/app/templates.cxx 2>/dev/null | head -10) + ⎿ 19:#include "Fluid.h" + 76: Fluid.preferences.getUserdataPath(filename, sizeof(filename)); + 99: if (!fld::io::write_file(Fluid.proj, filename)) { + … +3 lines (ctrl+o to expand) + +⏺ Read(fluid/app/templates.cxx) + ⎿ Read 144 lines + +⏺ Все имена уже квалифицированы или глобальные. Удаляю using namespace. + +⏺ Update(fluid/app/templates.cxx) + ⎿ Removed 3 lines + 28 #include <FL/Fl_PNG_Image.H> + 29 #include "../src/flstring.h" + 30 + 31 -using namespace fld; + 32 -using namespace fld::app; + 33 - + 31 /** + 32 Save a design template. + 33 \todo We should document the concept of templates. + +⏺ Read(fluid/app/Snap_Action.cxx) + ⎿ Read 50 lines + ⎿ Found 2 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Bash(grep -c 'Layout_Preset\|Layout_Suite\|Layout_List\|Snap_Action' + fluid/app/Snap_Action.cxx 2>/dev/null) + ⎿ 86 /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Bash(grep -rn "\boverride\b" src/ FL/ fluid/ --include="*.cxx" --include="*.H" - --include="*.h" 2>/dev/null | wc -l) - ⎿ 674 +⏺ Bash(make 2>&1 | grep -E "error:" | head -10) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + + +⏺ Сборка успешна. Удаление namespace из FLUID - большая работа (86 использований + только в одном файле). Продолжу с файлами попроще. + +⏺ Read(fluid/nodes/Tree.cxx) + ⎿ Read 129 lines + +⏺ Update(fluid/nodes/Tree.cxx) + ⎿ Added 1 line, removed 5 lines + 19 + 20 #include "Project.h" + 21 + 22 -using namespace fld; + 23 -using namespace fld::node; + 24 - + 25 - + 26 -Tree::Iterator::Iterator(Node *t, bool only_selected) + 22 +fld::node::Tree::Iterator::Iterator(Node *t, bool only_selected + +) + 23 : type_(t) + 24 , only_selected_(only_selected) + 25 { + +⏺ Update(fluid/nodes/Tree.cxx) + ⎿ Added 7 lines, removed 7 lines + 19 + 20 #include "Project.h" + 21 + 22 -fld::node::Tree::Iterator::Iterator(Node *t, bool only_selected + -) + 22 +fld::node::fld::node::Tree::Iterator::Iterator(Node *t, bool on + +ly_selected) + 23 : type_(t) + 24 , only_selected_(only_selected) + 25 { + ... + 32 } + 33 } + 34 + 35 -Tree::Iterator &Tree::Iterator::operator++() { + 35 +fld::node::Tree::Iterator &fld::node::Tree::Iterator::operator+ + ++() { + 36 if (only_selected_) { + 37 do { + 38 type_ = type_->next; + ... + 43 return *this; + 44 } + 45 + 46 -Tree::WIterator::WIterator(Node *t, bool only_selected) + 46 +fld::node::Tree::WIterator::WIterator(Node *t, bool only_select + +ed) + 47 : type_(t) + 48 , only_selected_(only_selected) + 49 { + ... + 60 } + 61 } + 62 + 63 -Tree::WIterator& Tree::WIterator::operator++() { + 63 +fld::node::Tree::WIterator& fld::node::Tree::WIterator::operato + +r++() { + 64 if (only_selected_) { + 65 do { + 66 type_ = type_->next; + ... + 74 } + 75 + 76 + 77 -Tree::Tree(Project &proj) + 77 +fld::node::Tree::Tree(Project &proj) + 78 : proj_(proj) + 79 { (void)proj_; } + 80 + ... + 87 \param[in] uid any number between 0 and 65535 + 88 \return the node with this uid, or 0 if not found + 89 */ + 90 -Node *Tree::find_by_uid(unsigned short uid) { + 90 +Node *fld::node::Tree::find_by_uid(unsigned short uid) { + 91 for (Node *tp: all_nodes()) { + 92 if (tp->get_uid() == uid) return tp; + 93 } + ... + 101 \param[in] crsr cursor position in text + 102 \return the node we found or 0 + 103 */ + 104 -Node *Tree::find_in_text(int text_type, int crsr) { + 104 +Node *fld::node::Tree::find_in_text(int text_type, int crsr) { + 105 for (Node *node: all_nodes()) { + 106 switch (text_type) { + 107 case 0: + ⎿ Found 10 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Read(fluid/nodes/Tree.cxx) + ⎿ Read 15 lines + ⎿ Found 10 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Update(fluid/nodes/Tree.cxx) + ⎿ Added 1 line, removed 1 line + 19 + 20 #include "Project.h" + 21 + 22 -fld::node::fld::node::Tree::Iterator::Iterator(Node *t, bool on + -ly_selected) + 22 +fld::node::Tree::Iterator::Iterator(Node *t, bool only_selected + +) + 23 : type_(t) + 24 , only_selected_(only_selected) + 25 { + +⏺ Bash(make 2>&1 | grep -E "error:" | head -10) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + + ⎿ Found 3 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Успешно. Обработаю следующие файлы пакетно. + +⏺ Read(fluid/io/String_Writer.cxx) + ⎿ Read 147 lines + +⏺ Update(fluid/io/String_Writer.cxx) + ⎿ Removed 3 lines + 21 #include "nodes/Window_Node.h" + 22 #include "nodes/Function_Node.h" + 23 + 24 -using namespace fld; + 25 -using namespace fld::io; + 26 - + 24 /** + 25 Write a string to a file, replacing all non-ASCII characters w + ith octal codes. + 26 \param[in] out output file + +⏺ Bash(make 2>&1 | grep -E "error:" | head -10) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + + ⎿ Found 3 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Успешно. Продолжу с другими io файлами. + +⏺ Read(fluid/io/Project_Writer.cxx) + ⎿ Read 50 lines + +⏺ Bash(grep -c 'Project_Writer::' fluid/io/Project_Writer.cxx 2>/dev/null) + ⎿ 10 /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Bash(grep -rn "\boverride\b" src/ FL/ fluid/ --include="*.cxx" --include="*.H" - --include="*.h" 2>/dev/null | head -10) - ⎿ fluid//proj/mergeback.cxx:207: "changed in the proje - ct. Merging will override changes in\n" - fluid//proj/mergeback.cxx:261: // check if the block change on the - … +19 lines (ctrl+o to expand) +⏺ Update(fluid/io/Project_Writer.cxx) + ⎿ Removed 3 lines + 32 /// \defgroup flfile .fl Project File Operations + 33 /// \{ + 34 + 35 -using namespace fld; + 36 -using namespace fld::io; + 37 - + 35 /** \brief Write an .fl design description file. + 36 + 37 The .fl file format is documented in `fluid/README_fl.txt`. + +⏺ Update(fluid/io/Project_Writer.cxx) + ⎿ Added 10 lines, removed 10 lines + 49 // ---- Project_Writer ---------------------------------------- + ------ MARK: - + 50 + 51 /** \brief Construct local project writer. */ + 52 -Project_Writer::Project_Writer(Project &proj) + 52 +fld::io::Project_Writer::Project_Writer(Project &proj) + 53 : proj_(proj) + 54 { + 55 } + 56 + 57 /** \brief Release project writer resources. */ + 58 -Project_Writer::~Project_Writer() + 58 +fld::io::Project_Writer::~Project_Writer() + 59 { + 60 } + 61 + ... + 65 \param[in] s the filename or 0 for stdout + 66 \return 1 if successful. 0 if the operation failed + 67 */ + 68 -int Project_Writer::open_write(const char *s) { + 68 +int fld::io::Project_Writer::open_write(const char *s) { + 69 if (!s) { + 70 fout = stdout; + 71 } else { + ... + 81 Don't close, if data was sent to stdout. + 82 \return 1 if succeeded, 0 if fclose failed + 83 */ + 84 -int Project_Writer::close_write() { + 84 +int fld::io::Project_Writer::close_write() { + 85 if (fout != stdout) { + 86 int x = fclose(fout); + 87 fout = stdout; + ... + 97 \param[in] sv if set, this file will be used by codeview + 98 \return 0 if the operation failed, 1 if it succeeded + 99 */ + 100 -int Project_Writer::write_project(const char *filename, int se + -lected_only, bool sv) { + 100 +int fld::io::Project_Writer::write_project(const char *filenam + +e, int selected_only, bool sv) { + 101 write_codeview_ = sv; + 102 proj_.undo.suspend(); + 103 if (!open_write(filename)) { + ... + 148 Write a string to the .fl file, quoting characters if necessa + ry. + 149 \param[in] w NUL terminated text + 150 */ + 151 -void Project_Writer::write_word(const char *w) { + 151 +void fld::io::Project_Writer::write_word(const char *w) { + 152 if (needspace) putc(' ', fout); + 153 needspace = 1; + 154 if (!w || !*w) {fprintf(fout,"{}"); return;} + ... + 186 unless the format starts with a newline character \\n. + 187 \param[in] format printf style formatting string followed by + a list of arguments + 188 */ + 189 -void Project_Writer::write_string(const char *format, ...) { + 189 +void fld::io::Project_Writer::write_string(const char *format, + + ...) { + 190 va_list args; + 191 va_start(args, format); + 192 if (needspace && *format != '\n') fputc(' ',fout); + ... + 199 Start a new line in the .fl file and indent it for a given ne + sting level. + 200 \param[in] n indent level + 201 */ + 202 -void Project_Writer::write_indent(int n) { + 202 +void fld::io::Project_Writer::write_indent(int n) { + 203 fputc('\n',fout); + 204 while (n--) {fputc(' ',fout); fputc(' ',fout);} + 205 needspace = 0; + ... + 208 /** + 209 Write a '{' to the .fl file at the given indenting level. + 210 */ + 211 -void Project_Writer::write_open() { + 211 +void fld::io::Project_Writer::write_open() { + 212 if (needspace) fputc(' ',fout); + 213 fputc('{',fout); + 214 needspace = 0; + ... + 218 Write a '}' to the .fl file at the given indenting level. + 219 \param[in] n indent level + 220 */ + 221 -void Project_Writer::write_close(int n) { + 221 +void fld::io::Project_Writer::write_close(int n) { + 222 if (needspace) write_indent(n); + 223 fputc('}',fout); + 224 needspace = 1; + ⎿ Found 10 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Bash(make 2>&1 | grep -E "error:" | head -10) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + + ⎿ Found 10 new diagnostic issues in 1 file (ctrl+o to expand) +⏺ Успешно. Обработаю Project_Reader.cxx. +⏺ Read(fluid/io/Project_Reader.cxx) + ⎿ Read 40 lines -⏺ Bash(find /Users/mnik01/Desktop/fltk/src /Users/mnik01/Desktop/fltk/FL - /Users/mnik01/Desktop/fltk/fluid -type f \( -name "*.cxx" -o -name "*.H" - -o -name "*.h" \) -ex…) - ⎿ Done pattern 1 +⏺ Bash(grep -c 'Project_Reader::' fluid/io/Project_Reader.cxx 2>/dev/null) + ⎿ 14 /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Bash(find /Users/mnik01/Desktop/fltk/src /Users/mnik01/Desktop/fltk/FL - /Users/mnik01/Desktop/fltk/fluid -type f \( -name "*.cxx" -o -name "*.H" - -o -name "*.h" \) -ex…) - ⎿ Done pattern 2 +⏺ Update(fluid/io/Project_Reader.cxx) + ⎿ Removed 3 lines + 41 /// \defgroup flfile .fl Project File Operations + 42 /// \{ + 43 + 44 -using namespace fld; + 45 -using namespace fld::io; + 46 - + 44 // This file contains code to read and write .fl files. + 45 + 46 /// If set, we read an old fdesign file and widget y coordinate + s need to be flipped. + +⏺ Update(fluid/io/Project_Reader.cxx) + ⎿ Added 14 lines, removed 14 lines + 82 Oh how I wish sometimes we would upgrade to modern C++. + 83 \param[in] length minimum length in bytes + 84 */ + 85 -void Project_Reader::expand_buffer(int length) { + 85 +void fld::io::Project_Reader::expand_buffer(int length) { + 86 if (length >= buflen) { + 87 if (!buflen) { + 88 buflen = length+1; + ... + 96 } + 97 + 98 /** \brief Construct local project reader. */ + 99 -Project_Reader::Project_Reader(Project &proj) + 99 +fld::io::Project_Reader::Project_Reader(Project &proj) + 100 : proj_(proj) + 101 { + 102 } + 103 + 104 /** \brief Release project reader resources. */ + 105 -Project_Reader::~Project_Reader() + 105 +fld::io::Project_Reader::~Project_Reader() + 106 { + 107 // fname is not copied, so do not free it + 108 if (buffer) + ... + 114 \param[in] s filename, if 0, read from stdin instead + 115 \return 0 if the operation failed, 1 if it succeeded + 116 */ + 117 -int Project_Reader::open_read(const char *s) { + 117 +int fld::io::Project_Reader::open_read(const char *s) { + 118 lineno = 1; + 119 if (!s) { + 120 fin = stdin; + ... + 133 Close the .fl file. + 134 \return 0 if the operation failed, 1 if it succeeded + 135 */ + 136 -int Project_Reader::close_read() { + 136 +int fld::io::Project_Reader::close_read() { + 137 if (fin != stdin) { + 138 int x = fclose(fin); + 139 fin = 0; + ... + 146 Return the name part of the current filename and path. + 147 \return a pointer into a string that is not owned by this cla + ss + 148 */ + 149 -const char *Project_Reader::filename_name() { + 149 +const char *fld::io::Project_Reader::filename_name() { + 150 return fl_filename_name(fname); + 151 } + 152 + ... + 156 values, and \\o### octal values. + 157 \return a character in the ASCII range + 158 */ + 159 -int Project_Reader::read_quoted() { // read whatever char + -acter is after a \ . + 159 +int fld::io::Project_Reader::read_quoted() { // read what + +ever character is after a \ . + 160 int c,d,x; + 161 switch(c = nextchar()) { + 162 case '\n': lineno++; return -1; + ... + 201 a previous call, and there is no need to waste time searching + for them. + 202 \return the last node that was created + 203 */ + 204 -Node *Project_Reader::read_children(Node *p, int merge, Strate + -gy strategy, char skip_options) { + 204 +Node *fld::io::Project_Reader::read_children(Node *p, int merg + +e, Strategy strategy, char skip_options) { + 205 Fluid.proj.tree.current = p; + 206 Node *last_child_read = 0; + 207 Node *t = 0; + ... + 385 \param[in] strategy add new nodes after current or as last ch + ild + 386 \return 0 if the operation failed, 1 if it succeeded + 387 */ + 388 -int Project_Reader::read_project(const char *filename, int mer + -ge, Strategy strategy) { + 388 +int fld::io::Project_Reader::read_project(const char *filename + +, int merge, Strategy strategy) { + 389 Node *o; + 390 proj_.undo.suspend(); + 391 read_version = 0.0; + ... + 435 operations. + 436 \param[in] format printf style format string, followed by an + argument list + 437 */ + 438 -void Project_Reader::read_error(const char *format, ...) { + 438 +void fld::io::Project_Reader::read_error(const char *format, . + +..) { + 439 va_list args; + 440 va_start(args, format); + 441 if (!fin) { // FIXME: this line suppresses any error message + s in interactive mode + ... + 468 overwrite this buffer. If wantbrace is not set, but we rea + d a leading '{', + 469 the returned string will be stripped of its leading and tr + ailing braces. + 470 */ + 471 -const char *Project_Reader::read_word(int wantbrace) { + 471 +const char *fld::io::Project_Reader::read_word(int wantbrace) + +{ + 472 int x; + 473 + 474 // skip all the whitespace before it: + ... + 538 /** Read a word and interpret it as an integer value. + 539 \return integer value, or 0 if the word is not an integer + 540 */ + 541 -int Project_Reader::read_int() { + 541 +int fld::io::Project_Reader::read_int() { + 542 const char *word = read_word(); + 543 if (word) { + 544 return atoi(word); + ... + 554 \param[out] value string + 555 \return 0 if end of file, else 1 + 556 */ + 557 -int Project_Reader::read_fdesign_line(const char*& name, const + - char*& value) { + 557 +int fld::io::Project_Reader::read_fdesign_line(const char*& na + +me, const char*& value) { + 558 int length = 0; + 559 int x; + 560 // find a colon: + ... + 681 FLTK widgets. + 682 \see http://xforms-toolkit.org + 683 */ + 684 -void Project_Reader::read_fdesign() { + 684 +void fld::io::Project_Reader::read_fdesign() { + 685 int fdesign_magic = atoi(read_word()); + 686 fdesign_flip = (fdesign_magic < 13000); + 687 Widget_Node *window = 0; + ⎿ Found 10 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Read(fluid/io/Code_Writer.cxx) + ⎿ Read 40 lines + ⎿ Found 10 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Bash(grep -E '^[A-Za-z_]+::' fluid/io/Code_Writer.cxx 2>/dev/null | head -20) + ⎿ Code_Writer::Code_Writer(Project &proj) + Code_Writer::~Code_Writer() /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Bash(grep -rn "\boverride\b" src/ FL/ fluid/ --include="*.cxx" --include="*.H" - --include="*.h" 2>/dev/null | grep -v "override changes\|will - override\|override chang…) - ⎿ 357 +⏺ Bash(grep -n 'class Fd_Id_Map\|class Fd_String_Set' fluid/io/Code_Writer.h + 2>/dev/null) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + + +⏺ Read(fluid/io/Code_Writer.h) + ⎿ Read 80 lines + +⏺ Update(fluid/io/Code_Writer.cxx) + ⎿ Removed 3 lines + 31 #include <stdlib.h> + 32 #include <string.h> + 33 + 34 -using namespace fld; + 35 -using namespace fld::io; + 36 - + 34 // ---- Fd_Id_Map implementation ---- + 35 + 36 void Fd_Id_Map::clear() { + +⏺ Update(fluid/io/Code_Writer.cxx) + ⎿ Added 30 lines, removed 30 lines + 141 \param[in] label else if label is set, it is appended, skippi + ng non-keyword characters + 142 \return buffer to a unique identifier, managed by Code_Writer + , so caller must NOT free() it + 143 */ + 144 -const char* Code_Writer::unique_id(void* o, const char* type, + -const char* name, const char* label) { + 144 +const char* fld::io::Code_Writer::unique_id(void* o, const cha + +r* type, const char* name, const char* label) { + 145 char buffer[128]; + 146 char* q = buffer; + 147 char* q_end = q + 128 - 8 - 1; // room for hex number and NU + L + ... + 186 \param[in] set generate this indent depth + 187 \return pointer to a static string + 188 */ + 189 -const char *Code_Writer::indent(int set) { + 189 +const char *fld::io::Code_Writer::indent(int set) { + 190 static const char* spaces = " + "; + 191 int i = set * 2; + 192 if (i>64) i = 64; + ... + 198 Return a C string that indents code to the current source fil + e depth. + 199 \return pointer to a static string + 200 */ + 201 -const char *Code_Writer::indent() { + 201 +const char *fld::io::Code_Writer::indent() { + 202 return indent(indentation); + 203 } + 204 + ... + 208 change the `indentation` variable; offset can be negative + 209 \return pointer to a static string + 210 */ + 211 -const char *Code_Writer::indent_plus(int offset) { + 211 +const char *fld::io::Code_Writer::indent_plus(int offset) { + 212 return indent(indentation+offset); + 213 } + 214 + ... + 219 \param[in] format printf-style formatting text, followed by a + vararg list + 220 \return 1 if the text was written to the file, 0 if it was pr + eviously written. + 221 */ + 222 -int Code_Writer::write_h_once(const char *format, ...) { + 222 +int fld::io::Code_Writer::write_h_once(const char *format, ... + +) { + 223 va_list args; + 224 char buf[1024]; + 225 va_start(args, format); + ... + 239 \param[in] format printf-style formatting text, followed by a + vararg list + 240 \return 1 if the text was written to the file, 0 if it was pr + eviously written. + 241 */ + 242 -int Code_Writer::write_c_once(const char *format, ...) { + 242 +int fld::io::Code_Writer::write_c_once(const char *format, ... + +) { + 243 va_list args; + 244 char buf[1024]; + 245 va_start(args, format); + ... + 264 \param[in] pp ay pointer + 265 \return true if found in the tree, false if added to the tree + 266 */ + 267 -bool Code_Writer::c_contains(void *pp) { + 267 +bool fld::io::Code_Writer::c_contains(void *pp) { + 268 if (ptr_in_code.contains(pp)) { + 269 return true; + 270 } + ... + 289 + 290 \see f.write_cstring(const char*) + 291 */ + 292 -void Code_Writer::write_cstring(const char *s, int length) { + 292 +void fld::io::Code_Writer::write_cstring(const char *s, int le + +ngth) { + 293 const char *next_line = "\"\n\""; + 294 if (varused_test) { + 295 varused = 1; + ... + 370 \param[in] s write this string + 371 \see f.write_cstring(const char*, int) + 372 */ + 373 -void Code_Writer::write_cstring(const char *s) { + 373 +void fld::io::Code_Writer::write_cstring(const char *s) { + 374 write_cstring(s, (int)strlen(s)); + 375 } + 376 + ... + 382 \param[in] s a block of binary data, interpreted as unsigned + bytes + 383 \param[in] length size of the block in bytes + 384 */ + 385 -void Code_Writer::write_cdata(const char *s, int length) { + 385 +void fld::io::Code_Writer::write_cdata(const char *s, int leng + +th) { + 386 if (varused_test) { + 387 varused = 1; + 388 return; + ... + 420 \param[in] format printf-style formatting text + 421 \param[in] args list of arguments + 422 */ + 423 -void Code_Writer::vwrite_c(const char* format, va_list args) { + 423 +void fld::io::Code_Writer::vwrite_c(const char* format, va_lis + +t args) { + 424 if (varused_test) { + 425 varused = 1; + 426 return; + ... + 432 Print a formatted line to the source file. + 433 \param[in] format printf-style formatting text, followed by a + vararg list + 434 */ + 435 -void Code_Writer::write_c(const char* format,...) { + 435 +void fld::io::Code_Writer::write_c(const char* format,...) { + 436 va_list args; + 437 va_start(args, format); + 438 vwrite_c(format, args); + ... + 447 \param[in] c line of code + 448 \param[in] com optional commentary + 449 */ + 450 -void Code_Writer::write_cc(const char *indent, int n, const ch + -ar *c, const char *com) { + 450 +void fld::io::Code_Writer::write_cc(const char *indent, int n, + + const char *c, const char *com) { + 451 write_c("%s%.*s", indent, n, c); + 452 char cc = c[n-1]; + 453 if (cc!='}' && cc!=';') + ... + 461 Print a formatted line to the header file. + 462 \param[in] format printf-style formatting text, followed by a + vararg list + 463 */ + 464 -void Code_Writer::write_h(const char* format,...) { + 464 +void fld::io::Code_Writer::write_h(const char* format,...) { + 465 if (varused_test) return; + 466 va_list args; + 467 va_start(args, format); + ... + 477 \param[in] c line of code + 478 \param[in] com optional commentary + 479 */ + 480 -void Code_Writer::write_hc(const char *indent, int n, const ch + -ar* c, const char *com) { + 480 +void fld::io::Code_Writer::write_hc(const char *indent, int n, + + const char* c, const char *com) { + 481 write_h("%s%.*s", indent, n, c); + 482 char cc = c[n-1]; + 483 if (cc!='}' && cc!=';') + ... + 494 \param[in] inTrailWith append this character if the last line + did not end with + 495 a newline, usually 0 or newline. + 496 */ + 497 -void Code_Writer::write_c_indented(const char *textlines, int + -inIndent, char inTrailWith) { + 497 +void fld::io::Code_Writer::write_c_indented(const char *textli + +nes, int inIndent, char inTrailWith) { + 498 if (textlines) { + 499 indentation += inIndent; + 500 for (;;) { + ... + 567 \param[in] p write this type and all its children + 568 \return pointer to the next sibling + 569 */ + 570 -Node* Code_Writer::write_static(Node* p) { + 570 +Node* fld::io::Code_Writer::write_static(Node* p) { + 571 if (write_codeview) p->header_static_start = (int)ftell(head + er_file); + 572 if (write_codeview) p->code_static_start = (int)ftell(code_f + ile); + 573 p->write_static(*this); + ... + 589 \param[in] p write this node and all its children + 590 \return pointer to the next sibling + 591 */ + 592 -Node* Code_Writer::write_code(Node* p) { + 592 +Node* fld::io::Code_Writer::write_code(Node* p) { + 593 // write all code that comes before the children code + 594 // (but don't write the last comment until the very end) + 595 if (!(p==Fluid.proj.tree.last && p->is_a(FLD_NODE_TYPE_Comme + nt))) { + ... + 658 \param[in] t filename of the header file + 659 \return 0 if the operation failed, 1 if it was successful + 660 */ + 661 -int Code_Writer::write_code(const char *s, const char *t, bool + - to_codeview) { + 661 +int fld::io::Code_Writer::write_code(const char *s, const char + + *t, bool to_codeview) { + 662 write_codeview = to_codeview; + 663 unique_id_list.clear(); + 664 indentation = 0; + ... + 873 This avoids repeating these words if the mode is already set. + 874 \param[in] state 0 for private, 1 for public, 2 for protected + 875 */ + 876 -void Code_Writer::write_public(int state) { + 876 +void fld::io::Code_Writer::write_public(int state) { + 877 if (!current_class && !current_widget_class) return; + 878 if (current_class && current_class->write_public_state == st + ate) return; + 879 if (current_widget_class && current_widget_class->write_publ + ic_state == state) return; + ... + 889 /** + 890 Create and initialize a new C++ source code writer. + 891 */ + 892 -Code_Writer::Code_Writer(Project &proj) + 892 +fld::io::Code_Writer::Code_Writer(Project &proj) + 893 : proj_ { proj } + 894 { + 895 block_crc_ = crc32(0, 0, 0); + ... + 898 /** + 899 Release all resources. + 900 */ + 901 -Code_Writer::~Code_Writer() + 901 +fld::io::Code_Writer::~Code_Writer() + 902 { + 903 if (block_buffer_) ::free(block_buffer_); + 904 } + ... + 911 \param[in] type FD_TAG_GENERIC, FD_TAG_CODE, FD_TAG_MENU_CALL + BACK, or FD_TAG_WIDGET_CALLBACK + 912 \param[in] uid the unique id of the current type + 913 */ + 914 -void Code_Writer::tag(Mergeback::Tag prev_type, Mergeback::Tag + - next_type, unsigned short uid) { + 914 +void fld::io::Code_Writer::tag(Mergeback::Tag prev_type, Merge + +back::Tag next_type, unsigned short uid) { + 915 if (proj_.write_mergeback_data) { + 916 ::Mergeback::print_tag(code_file, prev_type, next_type, ui + d, (uint32_t)block_crc_); + 917 } + ... + 929 if we are the start of a line, used to find leadin + g whitespace + 930 \return the new CRC + 931 */ + 932 -unsigned long Code_Writer::block_crc(const void *data, int n, + -unsigned long in_crc, bool *inout_line_start) { + 932 +unsigned long fld::io::Code_Writer::block_crc(const void *data + +, int n, unsigned long in_crc, bool *inout_line_start) { + 933 if (!data) return 0; + 934 if (n==-1) n = (int)strlen((const char*)data); + 935 bool line_start = true; + ... + 956 \param[in] data a pointer to the data block + 957 \param[in] n the size of the data in bytes, or -1 to use strl + en() + 958 */ + 959 -void Code_Writer::crc_add(const void *data, int n) { + 959 +void fld::io::Code_Writer::crc_add(const void *data, int n) { + 960 block_crc_ = block_crc(data, n, block_crc_, &block_line_star + t_); + 961 } + 962 + ... + 965 \param[in] format printf style formatting string + 966 \return see fprintf(FILE *, *const char*, ...) + 967 */ + 968 -int Code_Writer::crc_printf(const char *format, ...) { + 968 +int fld::io::Code_Writer::crc_printf(const char *format, ...) + +{ + 969 va_list args; + 970 va_start(args, format); + 971 int ret = crc_vprintf(format, args); + ... + 979 \param[in] args list of arguments + 980 \return see fprintf(FILE *, *const char*, ...) + 981 */ + 982 -int Code_Writer::crc_vprintf(const char *format, va_list args) + - { + 982 +int fld::io::Code_Writer::crc_vprintf(const char *format, va_l + +ist args) { + 983 if (proj_.write_mergeback_data) { + 984 int n = vsnprintf(block_buffer_, block_buffer_size_, forma + t, args); + 985 if (n > block_buffer_size_) { + ... + 1000 \param[in] text any text, no requirements to end in a newlin + e or such + 1001 \return see fputs(const char*, FILE*) + 1002 */ + 1003 -int Code_Writer::crc_puts(const char *text) { + 1003 +int fld::io::Code_Writer::crc_puts(const char *text) { + 1004 if (proj_.write_mergeback_data) { + 1005 crc_add(text); + 1006 } + ... + 1009 + 1010 /** Write a single ASCII character to the code file. + 1011 If MergeBack is enabled, the CRC calculation is continued. + 1012 - \note to write UTF-8 characters, use Code_Writer::crc_puts(c + -onst char *text) + 1012 + \note to write UTF-8 characters, use fld::io::Code_Writer::c + +rc_puts(const char *text) + 1013 \param[in] c any character between 0 and 127 inclusive + 1014 \return see fputc(int, FILE*) + 1015 */ + 1016 -int Code_Writer::crc_putc(int c) { + 1016 +int fld::io::Code_Writer::crc_putc(int c) { + 1017 if (proj_.write_mergeback_data) { + 1018 uchar uc = (uchar)c; + 1019 crc_add(&uc, 1); + ⎿ Found 10 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Bash(make 2>&1 | grep -E "error:" | head -10) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + + ⎿ Found 10 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Успешно. Обновлю прогресс и продолжу. + +⏺ Read(fluid/widgets/Style_Parser.cxx) + ⎿ Read 30 lines + +⏺ Bash(grep -c 'Style_Parser::' fluid/widgets/Style_Parser.cxx 2>/dev/null) + ⎿ 14 /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Bash(grep -rn " override" src/ FL/ fluid/ --include="*.cxx" --include="*.H" - --include="*.h" 2>/dev/null | grep -v "override changes\|will override" | - head -15) - ⎿ FL//Fl_Window.H:237: unsigned int override_flag() const { return flag - s()&OVERRIDE; } - fluid//app/args.h:37: /// command line arguments that overrides the ge - … +26 lines (ctrl+o to expand) +⏺ Update(fluid/widgets/Style_Parser.cxx) + ⎿ Removed 3 lines + 22 #include <ctype.h> + 23 #include <stdlib.h> // bsearch() + 24 + 25 -using namespace fld; + 26 -using namespace fld::widget; + 27 - + 25 // Sorted list of C/C++ keywords... + 26 static const char * const code_keywords[] = { + 27 "and", + +⏺ Update(fluid/widgets/Style_Parser.cxx) + ⎿ Added 14 lines, removed 14 lines + 130 // Applies the current style, advances to next text + style + char. + 131 // Returns 0 if hit end of buffer, 1 otherwise. + 132 // + 133 -int Style_Parser::parse_over_char(int handle_crlf) { + 133 +int fld::widget::Style_Parser::parse_over_char(int handle_crlf + +) { + 134 char c = *tbuff; + 135 + 136 // End of line? + ... + 157 // Parse over white space using current style + 158 // Returns 0 if hit end of buffer, 1 otherwise. + 159 // + 160 -int Style_Parser::parse_over_white() { + 160 +int fld::widget::Style_Parser::parse_over_white() { + 161 while ( len > 0 && strchr(" \t", *tbuff)) + 162 { if ( !parse_over_char() ) return 0; } + 163 return 1; + ... + 166 // Parse over non-white alphabetic text + 167 // Returns 0 if hit end of buffer, 1 otherwise. + 168 // + 169 -int Style_Parser::parse_over_alpha() { + 169 +int fld::widget::Style_Parser::parse_over_alpha() { + 170 while ( len > 0 && isalpha(*tbuff) ) + 171 { if ( !parse_over_char() ) return 0; } + 172 return 1; + ... + 175 // Parse to end of line in specified style. + 176 // Returns 0 if hit end of buffer, 1 otherwise. + 177 // + 178 -int Style_Parser::parse_to_eol(char s) { + 178 +int fld::widget::Style_Parser::parse_to_eol(char s) { + 179 char save = style; + 180 style = s; + 181 while ( *tbuff != '\n' ) + ... + 187 // Parse a block comment until end of comment or buffer. + 188 // Returns 0 if hit end of buffer, 1 otherwise. + 189 // + 190 -int Style_Parser::parse_block_comment() { + 190 +int fld::widget::Style_Parser::parse_block_comment() { + 191 char save = style; + 192 style = 'C'; // block comment sty + le + 193 while ( len > 0 ) { + ... + 203 } + 204 + 205 // Copy keyword from tbuff -> keyword[] buffer + 206 -void Style_Parser::buffer_keyword() { + 206 +void fld::widget::Style_Parser::buffer_keyword() { + 207 char *key = keyword; + 208 char *kend = key + sizeof(keyword) - 1; // end of buffer + 209 const char *s; + ... + 216 // Parse over specified 'key'word in specified style 's'. + 217 // Returns 0 if hit end of buffer, 1 otherwise. + 218 // + 219 -int Style_Parser::parse_over_key(const char *key, char s) { + 219 +int fld::widget::Style_Parser::parse_over_key(const char *key, + + char s) { + 220 char save = style; + 221 style = s; + 222 // Parse over the keyword while applying style to sbuff + ... + 230 // Parse over angle brackets <..> in specified style. + 231 // Returns 0 if hit end of buffer, 1 otherwise. + 232 // + 233 -int Style_Parser::parse_over_angles(char s) { + 233 +int fld::widget::Style_Parser::parse_over_angles(char s) { + 234 if ( *tbuff != '<' ) return 1; // not <..>, early exit + 235 char save = style; + 236 style = s; + ... + 246 // spi.keyword[] will contain parsed word. + 247 // Returns 0 if hit end of buffer, 1 otherwise. + 248 // + 249 -int Style_Parser::parse_keyword() { + 249 +int fld::widget::Style_Parser::parse_keyword() { + 250 // Parse into 'keyword' buffer + 251 buffer_keyword(); + 252 char *key = keyword; + ... + 263 // Style parse a quoted string, either "" or ''. + 264 // Returns 0 if hit end of buffer, 1 otherwise. + 265 // + 266 -int Style_Parser::parse_quoted_string(char quote_char, // e.g. + - '"' or '\'' + 266 +int fld::widget::Style_Parser::parse_quoted_string(char quote_ + +char, // e.g. '"' or '\'' + 267 char in_style) { // style + for quoted text + 268 style = in_style; // start string style + 269 if ( !parse_over_char() ) return 0; // parse over opening + quote + ... + 290 // Style parse a directive (#include, #define..) + 291 // Returns 0 if hit end of buffer, 1 otherwise. + 292 // + 293 -int Style_Parser::parse_directive() { + 293 +int fld::widget::Style_Parser::parse_directive() { + 294 style = 'E'; // start directive + style + 295 if ( !parse_over_char() ) return 0; // Parse over '#' + 296 if ( !parse_over_white() ) return 0; // Parse over any w + hitespace after '#' + ... + 304 // Style parse a line comment to end of line. + 305 // Returns 0 if hit end of buffer, 1 otherwise. + 306 // + 307 -int Style_Parser::parse_line_comment() { + 307 +int fld::widget::Style_Parser::parse_line_comment() { + 308 return parse_to_eol('B'); + 309 } + 310 + ... + 313 // a continuation of a line, such as in a multiline #direct + ive. + 314 // Returns 0 if hit end of buffer, 1 otherwise. + 315 // + 316 -int Style_Parser::parse_escape() { + 316 +int fld::widget::Style_Parser::parse_escape() { + 317 const char no_crlf = 0; + 318 if ( !parse_over_char(no_crlf) ) return 0; // backslash + 319 if ( !parse_over_char(no_crlf) ) return 0; // char escap + ed + ... + 323 // Parse all other non-specific characters + 324 // Returns 0 if hit end of buffer, 1 otherwise. + 325 // + 326 -int Style_Parser::parse_all_else() { + 326 +int fld::widget::Style_Parser::parse_all_else() { + 327 last = isalnum(*tbuff) || *tbuff == '_' || *tbuff == '.'; + 328 return parse_over_char(); + 329 } + ⎿ Found 10 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Bash(make 2>&1 | grep -E "error:" | head -5) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + + ⎿ Found 10 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Успешно. Обработаю оставшиеся widget файлы. + +⏺ Bash(for f in fluid/widgets/Bin_Button.cxx fluid/widgets/App_Menu_Bar.cxx + fluid/widgets/Code_Editor.cxx fluid/widgets/Text_Viewer.cxx + fluid/widgets/Node_Browser.cxx…) + ⎿ Processing fluid/widgets/Bin_Button.cxx + Processing fluid/widgets/App_Menu_Bar.cxx + Processing fluid/widgets/Code_Editor.cxx + … +6 lines (ctrl+o to expand) + +⏺ Bash(make 2>&1 | grep -E "error:" | head -20) + ⎿ fluid/widgets/App_Menu_Bar.cxx:36:1: error: use of undeclared identifie + r 'App_Menu_Bar'; did you mean 'fld::widget::App_Menu_Bar'? + fluid/widgets/App_Menu_Bar.cxx:44:5: error: use of undeclared identifie + … +3 lines (ctrl+o to expand) -⏺ Bash(find /Users/mnik01/Desktop/fltk/src /Users/mnik01/Desktop/fltk/FL - /Users/mnik01/Desktop/fltk/fluid -type f \( -name "*.cxx" -o -name "*.H" - -o -name "*.h" \) -ex…) - ⎿ Done pattern 3 +⏺ Bash(for f in fluid/widgets/Bin_Button.cxx fluid/widgets/App_Menu_Bar.cxx + fluid/widgets/Code_Editor.cxx fluid/widgets/Text_Viewer.cxx + fluid/widgets/Node_Browser.cxx…) + ⎿ Done /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Bash(find /Users/mnik01/Desktop/fltk/src /Users/mnik01/Desktop/fltk/FL - /Users/mnik01/Desktop/fltk/fluid -type f \( -name "*.cxx" -o -name "*.H" - -o -name "*.h" \) -ex…) - ⎿ Done pattern 4 (const override) +⏺ Bash(make 2>&1 | grep -E "error:" | head -20) + ⎿ fluid/widgets/App_Menu_Bar.cxx:44:5: error: use of undeclared identifie + r 'App_Menu_Bar'; did you mean 'fld::widget::App_Menu_Bar'? /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Bash(grep -rn " override" src/ FL/ fluid/ --include="*.cxx" --include="*.H" - --include="*.h" 2>/dev/null | grep -v "override changes\|will - override\|overrides\|overri…) - ⎿ 9 + +⏺ Read(fluid/widgets/App_Menu_Bar.cxx) + ⎿ Read 20 lines + +⏺ Update(fluid/widgets/App_Menu_Bar.cxx) + ⎿ Added 2 lines, removed 2 lines + 33 \param[in] X, Y, W, H position and size of the widget + 34 \param[in] L optional label + 35 */ + 36 -fld::widget::App_Menu_Bar::App_Menu_Bar(int X, int Y, int W, in + -t H, const char *L) + 36 +fld::widget::fld::widget::App_Menu_Bar::App_Menu_Bar(int X, int + + Y, int W, int H, const char *L) + 37 : Fl_Menu_Bar(X, Y, W, H, L) + 38 { + 39 } + ... + 41 /** + 42 Set menu item visibility and active state before menu pops up. + 43 */ + 44 -int App_Menu_Bar::handle(int event) + 44 +int fld::widget::App_Menu_Bar::handle(int event) + 45 { + 46 Fl_Menu_Item *mi = 0; + 47 if (event == FL_BEFORE_MENU) { + +⏺ Bash(make 2>&1 | grep -E "error:" | head -10) + ⎿ fluid/widgets/App_Menu_Bar.cxx:36:1: error: no member named 'fld' in na + mespace 'fld::widget'; did you mean simply 'fld'? /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Bash(grep -rn " override" src/ FL/ fluid/ --include="*.cxx" --include="*.H" - --include="*.h" 2>/dev/null | grep -v "override changes\|will - override\|overrides\|overri…) - ⎿ fluid//nodes/Widget_Node.h:70: uchar override_visible_; - fluid//nodes/Window_Node.cxx:1259: if (o->visible() || override_visibl - e_) f.write_string("visible"); - … +10 lines (ctrl+o to expand) + ⎿ Found 4 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Read(fluid/widgets/App_Menu_Bar.cxx) + ⎿ Read 15 lines + +⏺ Update(fluid/widgets/App_Menu_Bar.cxx) + ⎿ Added 1 line, removed 1 line + 33 \param[in] X, Y, W, H position and size of the widget + 34 \param[in] L optional label + 35 */ + 36 -fld::widget::fld::widget::App_Menu_Bar::App_Menu_Bar(int X, int + - Y, int W, int H, const char *L) + 36 +fld::widget::App_Menu_Bar::App_Menu_Bar(int X, int Y, int W, in + +t H, const char *L) + 37 : Fl_Menu_Bar(X, Y, W, H, L) + 38 { + 39 } + +⏺ Bash(make 2>&1 | grep -E "error:" | head -10) + ⎿ fluid/widgets/Code_Editor.cxx:36:36: error: use of undeclared identifie + r 'Code_Editor'; did you mean 'fld::widget::Code_Editor'? + fluid/widgets/Code_Editor.cxx:54:6: error: use of undeclared identifier + … +11 lines (ctrl+o to expand) + + + +⏺ Update(fluid/widgets/Code_Editor.cxx) + ⎿ Added 8 lines, removed 8 lines + 33 Lookup table for all supported styles. + 34 Every table entry describes a rendering style for the correspo + nding text. + 35 */ + 36 -Fl_Text_Display::Style_Table_Entry Code_Editor::styletable[] = + -{ // Style table + 36 +Fl_Text_Display::Style_Table_Entry fld::widget::Code_Editor::st + +yletable[] = { // Style table + 37 { FL_FOREGROUND_COLOR, FL_COURIER, 11 + }, // A - Plain + 38 { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 + }, // B - Line comments + 39 { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 + }, // C - Block comments + ... + 51 \param[in] in_len byte length to parse + 52 \param[in] in_style starting style letter + 53 */ + 54 -void Code_Editor::style_parse(const char *in_tbuff, // + -text buffer to parse + 54 +void fld::widget::Code_Editor::style_parse(const char *in_tbuff + +, // text buffer to parse + 55 char *in_sbuff, // s + tyle buffer we modify + 56 int in_len, // b + yte length to parse + 57 char in_style) { // s + tarting style letter + ... + 104 /** + 105 Update unfinished styles. + 106 */ + 107 -void Code_Editor::style_unfinished_cb(int, void*) { + 107 +void fld::widget::Code_Editor::style_unfinished_cb(int, void*) + + { + 108 } + 109 + 110 /** + ... + 114 \param[in] nDeleted number of bytes deleted + 115 \param[in] cbArg pointer back to the code editor + 116 */ + 117 -void Code_Editor::style_update(int pos, int nInserted, int nDe + -leted, + 117 +void fld::widget::Code_Editor::style_update(int pos, int nInse + +rted, int nDeleted, + 118 int /*nRestyled*/, const char * + /*deletedText*/, + 119 void *cbArg) { + 120 Code_Editor *editor = (Code_Editor*)cbArg; + ... + 165 Find the right indentation depth after pressing the Enter key + . + 166 \param[in] e pointer back to the code editor + 167 */ + 168 -int Code_Editor::auto_indent(int, Code_Editor* e) { + 168 +int fld::widget::Code_Editor::auto_indent(int, Code_Editor* e) + + { + 169 if (e->buffer()->selected()) { + 170 e->insert_position(e->buffer()->primary_selection()->start + ()); + 171 e->buffer()->remove_selection(); + ... + 203 \param[in] X, Y, W, H position and size of the widget + 204 \param[in] L optional label + 205 */ + 206 -fld::widget::Code_Editor::Code_Editor(int X, int Y, int W, int + - H, const char *L) : + 206 +fld::widget::fld::widget::Code_Editor::Code_Editor(int X, int + +Y, int W, int H, const char *L) : + 207 Fl_Text_Editor(X, Y, W, H, L) { + 208 buffer(new Fl_Text_Buffer); + 209 + ... + 231 /** + 232 Destroy a Code_Editor widget. + 233 */ + 234 -fld::widget::Code_Editor::~Code_Editor() { + 234 +fld::widget::fld::widget::Code_Editor::~Code_Editor() { + 235 Fl_Text_Buffer *buf = mStyleBuffer; + 236 mStyleBuffer = 0; + 237 delete buf; + ... + 246 This works by updating the fontsizes in the style table. + 247 \param[in] s the new general height of the text font + 248 */ + 249 -void Code_Editor::textsize(Fl_Fontsize s) { + 249 +void fld::widget::Code_Editor::textsize(Fl_Fontsize s) { + 250 Fl_Text_Editor::textsize(s); // call base class method + 251 // now attempt to update our styletable to honor the new siz + e... + 252 int entries = sizeof(styletable) / sizeof(styletable[0]); + +⏺ Bash(make 2>&1 | grep -E "error:" | head -10) + ⎿ fluid/widgets/Code_Editor.cxx:206:1: error: no member named 'fld' in na + mespace 'fld::widget'; did you mean simply 'fld'? + fluid/widgets/Code_Editor.cxx:234:1: error: no member named 'fld' in na + … +3 lines (ctrl+o to expand) -⏺ Bash(find /Users/mnik01/Desktop/fltk/fluid -type f \( -name "*.cxx" -o -name - "*.H" -o -name "*.h" \) -exec sed -i '' 's/) override = default/) = - default/g' {} \; &&…) - ⎿ Done (override = default) + ⎿ Found 10 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Bash(grep -n 'fld::widget::fld::widget' fluid/widgets/*.cxx 2>/dev/null) + ⎿ fluid/widgets/Code_Editor.cxx:206:fld::widget::fld::widget::Code_Editor + ::Code_Editor(int X, int Y, int W, int H, const char *L) : + fluid/widgets/Code_Editor.cxx:234:fld::widget::fld::widget::Code_Editor + … +3 lines (ctrl+o to expand) + + + +⏺ Update(fluid/widgets/Code_Editor.cxx) + ⎿ Added 2 lines, removed 2 lines + 203 \param[in] X, Y, W, H position and size of the widget + 204 \param[in] L optional label + 205 */ + 206 -fld::widget::fld::widget::Code_Editor::Code_Editor(int X, int + -Y, int W, int H, const char *L) : + 206 +fld::widget::Code_Editor::Code_Editor(int X, int Y, int W, int + + H, const char *L) : + 207 Fl_Text_Editor(X, Y, W, H, L) { + 208 buffer(new Fl_Text_Buffer); + 209 + ... + 231 /** + 232 Destroy a Code_Editor widget. + 233 */ + 234 -fld::widget::fld::widget::Code_Editor::~Code_Editor() { + 234 +fld::widget::Code_Editor::~Code_Editor() { + 235 Fl_Text_Buffer *buf = mStyleBuffer; + 236 mStyleBuffer = 0; + 237 delete buf; + +⏺ Bash(make 2>&1 | grep -E "error:" | head -10) + ⎿ fluid/widgets/Code_Viewer.cxx:44:6: error: use of undeclared identifier + 'Code_Viewer'; did you mean 'fld::widget::Code_Viewer'? + /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + + + ⎿ Found 2 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Update(fluid/widgets/Code_Viewer.cxx) + ⎿ Added 2 lines, removed 2 lines + 30 \param[in] X, Y, W, H position and size of the widget + 31 \param[in] L optional label + 32 */ + 33 -fld::widget::Code_Viewer::Code_Viewer(int X, int Y, int W, int + -H, const char *L) + 33 +fld::widget::fld::widget::Code_Viewer::Code_Viewer(int X, int Y + +, int W, int H, const char *L) + 34 : Code_Editor(X, Y, W, H, L) + 35 { + 36 default_key_function(kf_ignore); + ... + 41 /** + 42 Tricking Fl_Text_Display into using bearable colors for this s + pecific task. + 43 */ + 44 -void Code_Viewer::draw() + 44 +void fld::widget::Code_Viewer::draw() + 45 { + 46 Fl_Color c = Fl::get_color(FL_SELECTION_COLOR); + 47 Fl::set_color(FL_SELECTION_COLOR, fl_color_average(FL_BACKGRO + UND_COLOR, FL_FOREGROUND_COLOR, 0.9f)); + +⏺ Bash(make 2>&1 | grep -E "error:" | head -10) + ⎿ fluid/widgets/Code_Viewer.cxx:33:1: error: no member named 'fld' in nam + espace 'fld::widget'; did you mean simply 'fld'? + /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + + + ⎿ Found 3 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Bash(grep -n 'fld::widget::fld::widget' fluid/widgets/*.cxx 2>/dev/null) + ⎿ fluid/widgets/Code_Viewer.cxx:33:fld::widget::fld::widget::Code_Viewer: + :Code_Viewer(int X, int Y, int W, int H, const char *L) + /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + + + +⏺ Update(fluid/widgets/Code_Viewer.cxx) + ⎿ Added 1 line, removed 1 line + 30 \param[in] X, Y, W, H position and size of the widget + 31 \param[in] L optional label + 32 */ + 33 -fld::widget::fld::widget::Code_Viewer::Code_Viewer(int X, int Y + -, int W, int H, const char *L) + 33 +fld::widget::Code_Viewer::Code_Viewer(int X, int Y, int W, int + +H, const char *L) + 34 : Code_Editor(X, Y, W, H, L) + 35 { + 36 default_key_function(kf_ignore); + +⏺ Bash(make 2>&1 | grep -E "error:" | head -10) + ⎿ fluid/widgets/Text_Viewer.cxx:49:6: error: use of undeclared identifier + 'Text_Viewer'; did you mean 'fld::widget::Text_Viewer'? + /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + + + +⏺ Update(fluid/widgets/Text_Viewer.cxx) + ⎿ Added 3 lines, removed 3 lines + 28 \param[in] X, Y, W, H position and size of the widget + 29 \param[in] L optional label + 30 */ + 31 -fld::widget::Text_Viewer::Text_Viewer(int X, int Y, int W, int + -H, const char *L) + 31 +fld::widget::fld::widget::Text_Viewer::Text_Viewer(int X, int Y + +, int W, int H, const char *L) + 32 : Fl_Text_Display(X, Y, W, H, L) + 33 { + 34 buffer(new Fl_Text_Buffer); + ... + 37 /** + 38 Avoid memory leaks. + 39 */ + 40 -fld::widget::Text_Viewer::~Text_Viewer() { + 40 +fld::widget::fld::widget::Text_Viewer::~Text_Viewer() { + 41 Fl_Text_Buffer *buf = mBuffer; + 42 buffer(0); + 43 delete buf; + ... + 46 /** + 47 Tricking Fl_Text_Display into using bearable colors for this s + pecific task. + 48 */ + 49 -void Text_Viewer::draw() + 49 +void fld::widget::Text_Viewer::draw() + 50 { + 51 Fl_Color c = Fl::get_color(FL_SELECTION_COLOR); + 52 Fl::set_color(FL_SELECTION_COLOR, fl_color_average(FL_BACKGRO + UND_COLOR, FL_FOREGROUND_COLOR, 0.9f)); + +⏺ Bash(grep -l 'fld::widget::fld::widget' fluid/widgets/*.cxx 2>/dev/null && sed + -i '' 's/fld::widget::fld::widget::/fld::widget::/g' fluid/widgets/*.cxx) + ⎿ fluid/widgets/Text_Viewer.cxx + /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + + ⎿ Found 4 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Bash(make 2>&1 | grep -E "error:" | head -10) + ⎿ fluid/widgets/Formula_Input.cxx:46:6: error: use of undeclared identifi + er 'Formula_Input'; did you mean 'fld::widget::Formula_Input'? + fluid/widgets/Formula_Input.cxx:50:6: error: use of undeclared identifi + … +17 lines (ctrl+o to expand) + + + +⏺ Update(fluid/widgets/Formula_Input.cxx) + ⎿ Error editing file + +⏺ Read(fluid/widgets/Formula_Input.cxx) + ⎿ Read 60 lines + +⏺ Update(fluid/widgets/Formula_Input.cxx) + ⎿ Added 10 lines, removed 10 lines + 36 /** + 37 Create an input field. + 38 */ + 39 -fld::widget::Formula_Input::Formula_Input(int x, int y, int w, + -int h, const char *l) + 39 +fld::widget::fld::widget::Formula_Input::Formula_Input(int x, i + +nt y, int w, int h, const char *l) + 40 : Fl_Input(x, y, w, h, l) + 41 { + 42 Fl_Input::callback((Fl_Callback*)callback_handler_cb); + 43 text("0"); + 44 } + 45 + 46 -void Formula_Input::callback_handler_cb(Formula_Input *This, vo + -id *v) { + 46 +void fld::widget::Formula_Input::callback_handler_cb(Formula_In + +put *This, void *v) { + 47 This->callback_handler(v); + 48 } + 49 + 50 -void Formula_Input::callback_handler(void *v) { + 50 +void fld::widget::Formula_Input::callback_handler(void *v) { + 51 if (user_callback_) + 52 (*user_callback_)(this, v); + 53 // do *not* update the value to show the evaluated formula he + re, because the + ... + 63 the last character of the variable name when returning. + 64 \return the integer value that was found or calculated + 65 */ + 66 -int Formula_Input::eval_var(uchar *&s) const { + 66 +int fld::widget::Formula_Input::eval_var(uchar *&s) const { + 67 if (!vars_) + 68 return 0; + 69 // find the end of the variable name + ... + 86 \param prio priority of current operation + 87 \return the value so far + 88 */ + 89 -int Formula_Input::eval(uchar *&s, int prio) const { + 89 +int fld::widget::Formula_Input::eval(uchar *&s, int prio) const + + { + 90 int v = 0, sgn = 1; + 91 uchar c = *s++; + 92 + ... + 158 \param s formula as a C string + 159 \return the calculated value + 160 */ + 161 -int Formula_Input::eval(const char *s) const + 161 +int fld::widget::Formula_Input::eval(const char *s) const + 162 { + 163 // duplicate the text, so we can modify it + 164 uchar *buf = (uchar*)fl_strdup(s); + ... + 180 /** + 181 Evaluate the formula and return the result. + 182 */ + 183 -int Formula_Input::value() const { + 183 +int fld::widget::Formula_Input::value() const { + 184 return eval(text()); + 185 } + 186 + 187 /** + 188 Set the field to an integer value, replacing previous texts. + 189 */ + 190 -void Formula_Input::value(int v) { + 190 +void fld::widget::Formula_Input::value(int v) { + 191 char buf[32]; + 192 fl_snprintf(buf, sizeof(buf), "%d", v); + 193 text(buf); + ... + 196 /** + 197 Allow vertical mouse dragging and mouse wheel to interactivel + y change the value. + 198 */ + 199 -int Formula_Input::handle(int event) { + 199 +int fld::widget::Formula_Input::handle(int event) { + 200 switch (event) { + 201 case FL_MOUSEWHEEL: + 202 if (Fl::event_dy()) { + ... + 212 /** Set the list of the available variables + 213 \param vars array of variables, last entry `has name_` set to + `0` + 214 \param user_data is forwarded to the Variable callback */ + 215 -void Formula_Input::variables(Formula_Input_Vars *vars, void * + -user_data) { + 215 +void fld::widget::Formula_Input::variables(Formula_Input_Vars + +*vars, void *user_data) { + 216 vars_ = vars; + 217 vars_user_data_ = user_data; + 218 } + +⏺ Bash(sed -i '' 's/fld::widget::fld::widget::/fld::widget::/g' + fluid/widgets/*.cxx 2>/dev/null && echo "Done") + ⎿ Done /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni k01/Desktop/hobby/emsdk/emsdk_env.sh + ⎿ Found 10 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Bash(make 2>&1 | grep -E "error:" | head -10) + ⎿ fluid/widgets/Node_Browser.cxx:52:11: error: use of undeclared identifi + er 'Node_Browser'; did you mean 'fld::widget::Node_Browser'? + fluid/widgets/Node_Browser.cxx:53:11: error: use of undeclared identifi + … +19 lines (ctrl+o to expand) + + + +⏺ Read(fluid/widgets/Node_Browser.cxx) + ⎿ Read 20 lines -⏺ Bash(find /Users/mnik01/Desktop/fltk/fluid -type f \( -name "*.cxx" -o -name - "*.H" -o -name "*.h" \) -exec sed -i '' 's/) override = 0/) = 0/g' {} \; - && echo "Done (…) - ⎿ Done (override = 0) +⏺ Update(fluid/widgets/Node_Browser.cxx) + ⎿ Added 30 lines, removed 30 lines + 49 + 50 // ---- static variables + 51 + 52 -Fl_Color Node_Browser::label_color = 72; + 53 -Fl_Font Node_Browser::label_font = FL_HELVETICA; + 54 -Fl_Color Node_Browser::class_color = FL_FOREGROUND_COLOR; + 55 -Fl_Font Node_Browser::class_font = FL_HELVETICA_BOLD; + 56 -Fl_Color Node_Browser::func_color = FL_FOREGROUND_COLOR; + 57 -Fl_Font Node_Browser::func_font = FL_HELVETICA; + 58 -Fl_Color Node_Browser::name_color = FL_FOREGROUND_COLOR; + 59 -Fl_Font Node_Browser::name_font = FL_HELVETICA; + 60 -Fl_Color Node_Browser::code_color = FL_FOREGROUND_COLOR; + 61 -Fl_Font Node_Browser::code_font = FL_HELVETICA; + 62 -Fl_Color Node_Browser::comment_color = FL_DARK_GREEN; + 63 -Fl_Font Node_Browser::comment_font = FL_HELVETICA; + 52 +Fl_Color fld::widget::Node_Browser::label_color = 72; + 53 +Fl_Font fld::widget::Node_Browser::label_font = FL_HELVETI + +CA; + 54 +Fl_Color fld::widget::Node_Browser::class_color = FL_FOREGRO + +UND_COLOR; + 55 +Fl_Font fld::widget::Node_Browser::class_font = FL_HELVETI + +CA_BOLD; + 56 +Fl_Color fld::widget::Node_Browser::func_color = FL_FOREGRO + +UND_COLOR; + 57 +Fl_Font fld::widget::Node_Browser::func_font = FL_HELVETI + +CA; + 58 +Fl_Color fld::widget::Node_Browser::name_color = FL_FOREGRO + +UND_COLOR; + 59 +Fl_Font fld::widget::Node_Browser::name_font = FL_HELVETI + +CA; + 60 +Fl_Color fld::widget::Node_Browser::code_color = FL_FOREGRO + +UND_COLOR; + 61 +Fl_Font fld::widget::Node_Browser::code_font = FL_HELVETI + +CA; + 62 +Fl_Color fld::widget::Node_Browser::comment_color = FL_DARK_GR + +EEN; + 63 +Fl_Font fld::widget::Node_Browser::comment_font = FL_HELVETI + +CA; + 64 + 65 // ---- global functions + 66 + ... + 213 \todo It would be nice to be able to grab one or more nodes a + nd move them + 214 within the hierarchy. + 215 */ + 216 -fld::widget::Node_Browser::Node_Browser(int X,int Y,int W,int + -H,const char*l) : + 216 +fld::widget::fld::widget::Node_Browser::Node_Browser(int X,int + + Y,int W,int H,const char*l) : + 217 Fl_Browser_(X,Y,W,H,l) + 218 { + 219 type(FL_MULTI_BROWSER); + ... + 225 Override the method to find the first item in the list of ele + ments. + 226 \return the first item + 227 */ + 228 -void *Node_Browser::item_first() const { + 228 +void *fld::widget::Node_Browser::item_first() const { + 229 return Fluid.proj.tree.first; + 230 } + 231 + ... + 234 \param l this item + 235 \return the next item, irregardless of tree depth, or 0 at th + e end + 236 */ + 237 -void *Node_Browser::item_next(void *l) const { + 237 +void *fld::widget::Node_Browser::item_next(void *l) const { + 238 return ((Node*)l)->next; + 239 } + 240 + ... + 243 \param l this item + 244 \return the previous item, irregardless of tree depth, or 0 a + t the start + 245 */ + 246 -void *Node_Browser::item_prev(void *l) const { + 246 +void *fld::widget::Node_Browser::item_prev(void *l) const { + 247 return ((Node*)l)->prev; + 248 } + 249 + ... + 253 \return 1 if selected, 0 if not + 254 \todo what is the difference between selected and new_selecte + d, and why do we do this? + 255 */ + 256 -int Node_Browser::item_selected(void *l) const { + 256 +int fld::widget::Node_Browser::item_selected(void *l) const { + 257 return ((Node*)l)->new_selected; + 258 } + 259 + ... + 262 \param l this item + 263 \param[in] v 1 if selecting, 0 if not + 264 */ + 265 -void Node_Browser::item_select(void *l,int v) { + 265 +void fld::widget::Node_Browser::item_select(void *l,int v) { + 266 ((Node*)l)->new_selected = v; + 267 } + 268 + ... + 271 \param l this item + 272 \return height in FLTK units (used to be pixels before high r + es screens) + 273 */ + 274 -int Node_Browser::item_height(void *l) const { + 274 +int fld::widget::Node_Browser::item_height(void *l) const { + 275 Node *t = (Node*)l; + 276 if (t->visible) { + 277 if (Fluid.show_comments && t->comment()) + ... + 286 Override the method to return the estimated height of all ite + ms. + 287 \return height in FLTK units + 288 */ + 289 -int Node_Browser::incr_height() const { + 289 +int fld::widget::Node_Browser::incr_height() const { + 290 return textsize() + 5 + linespacing(); + 291 } + 292 + ... + 311 \param X,Y these give the position in window coordinates o + f the top left + 312 corner of this line + 313 */ + 314 -void Node_Browser::item_draw(void *v, int X, int Y, int, int) + -const { + 314 +void fld::widget::Node_Browser::item_draw(void *v, int X, int + +Y, int, int) const { + 315 // cast to a more general type + 316 Node *l = (Node *)v; + 317 + ... + 455 \param v this item + 456 \return width in FLTK units + 457 */ + 458 -int Node_Browser::item_width(void *v) const { + 458 +int fld::widget::Node_Browser::item_width(void *v) const { + 459 + 460 char buf[500]; // edit buffer: large enough to hold 80 UTF-8 + chars + nul + 461 + ... + 490 /** + 491 Callback to tell the Fluid UI when the list of selected items + changed. + 492 */ + 493 -void Node_Browser::callback() { + 493 +void fld::widget::Node_Browser::callback() { + 494 selection_changed((Node*)selection()); + 495 } + 496 + ... + 508 \param[in] e the incoming event type + 509 \return 0 if the event is not supported, and 1 if the event w + as "used up" + 510 */ + 511 -int Node_Browser::handle(int e) { + 511 +int fld::widget::Node_Browser::handle(int e) { + 512 static Node *title; + 513 Node *l; + 514 int X,Y,W,H; bbox(X,Y,W,H); + ... + 576 /** + 577 Save the current scrollbar position during rebuild. + 578 */ + 579 -void Node_Browser::save_scroll_position() { + 579 +void fld::widget::Node_Browser::save_scroll_position() { + 580 saved_h_scroll_ = hposition(); + 581 saved_v_scroll_ = vposition(); + 582 } + ... + 584 /** + 585 Restore the previous scrollbar position after rebuild. + 586 */ + 587 -void Node_Browser::restore_scroll_position() { + 587 +void fld::widget::Node_Browser::restore_scroll_position() { + 588 hposition(saved_h_scroll_); + 589 vposition(saved_v_scroll_); + 590 } + ... + 594 This clears internal caches, recalculates the scroll bar size + s, and + 595 sends a redraw() request to the widget. + 596 */ + 597 -void Node_Browser::rebuild() { + 597 +void fld::widget::Node_Browser::rebuild() { + 598 save_scroll_position(); + 599 new_list(); + 600 damage(FL_DAMAGE_SCROLL); + ... + 606 Rebuild the browser layout and make sure that the given item + is visible. + 607 \param[in] inNode pointer to a widget node derived from Node. + 608 */ + 609 -void Node_Browser::display(Node *inNode) { + 609 +void fld::widget::Node_Browser::display(Node *inNode) { + 610 if (!inNode) { + 611 // Alternative: find the first (last?) visible selected it + em. + 612 return; + ... + 640 vposition(newV); + 641 } + 642 + 643 -void Node_Browser::load_prefs() { + 643 +void fld::widget::Node_Browser::load_prefs() { + 644 int c; + 645 Fl_Preferences p(Fluid.preferences, "widget_browser"); + 646 p.get("label_color", c, 72); label_color = c; + ... + 657 p.get("comment_font", c, FL_HELVETICA); comment_font = c; + 658 } + 659 + 660 -void Node_Browser::save_prefs() { + 660 +void fld::widget::Node_Browser::save_prefs() { + 661 Fl_Preferences p(Fluid.preferences, "widget_browser"); + 662 p.set("label_color", (int)label_color); + 663 p.set("label_font", (int)label_font); + +⏺ Bash(sed -i '' 's/fld::widget::fld::widget::/fld::widget::/g' + fluid/widgets/*.cxx 2>/dev/null && make 2>&1 | grep -E "error:" | head + -10) + ⎿ fluid/widgets/Node_Browser.cxx:78:32: error: unknown type name 'Node_Br + owser'; did you mean 'fld::widget::Node_Browser'? /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Bash(grep -rn " override[^_]" src/ FL/ fluid/ --include="*.cxx" - --include="*.H" --include="*.h" 2>/dev/null | grep -v "override - changes\|will override\|overrides" |…) + ⎿ Found 10 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Read(fluid/widgets/Node_Browser.cxx) + ⎿ Read 10 lines + +⏺ Update(fluid/widgets/Node_Browser.cxx) + ⎿ Added 1 line, removed 1 line + 75 Shortcut to create the widget browser. + 76 */ + 77 Fl_Widget *make_widget_browser(int x,int y,int w,int h) { + 78 - return (widget_browser = new Node_Browser(x,y,w,h)); + 78 + return (widget_browser = new fld::widget::Node_Browser(x,y,w, + +h)); + 79 } + 80 + 81 /** + +⏺ Bash(make 2>&1 | grep -E "error:" | head -10) ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni k01/Desktop/hobby/emsdk/emsdk_env.sh + ⎿ Found 1 new diagnostic issue in 1 file (ctrl+o to expand) + +⏺ Сборка успешна. Проверю оставшиеся файлы с using namespace. + +⏺ Bash(grep -rn '^using namespace' fluid/ --include="*.cxx" 2>/dev/null) + ⎿ fluid//tools/ExternalCodeEditor_WIN32.cxx:31:using namespace fld; + fluid//app/Snap_Action.cxx:42:using namespace fld; + fluid//app/Snap_Action.cxx:43:using namespace fld::app; + … +9 lines (ctrl+o to expand) + +⏺ Осталось 5 файлов. Обработаю nodes файлы (WIN32 файл не компилируется). + +⏺ Bash(sed -i '' '/^using namespace fld;/d' fluid/nodes/Function_Node.cxx + fluid/nodes/Menu_Node.cxx fluid/nodes/Widget_Node.cxx + sed -i '' '/^using namespace fld::io;/d…) + ⎿ Done + /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + -⏺ Bash(grep -rn "\bfinal\b" src/ FL/ fluid/ --include="*.cxx" --include="*.H" - --include="*.h" 2>/dev/null | grep -v "finally\|finalized\|final_") - ⎿ src//drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx:1253: if (tmpv - == str + n - 1) { // ignore final '\n' - src//fl_draw.cxx:156: // Calculate the final width - … +18 lines (ctrl+o to expand) +⏺ Bash(make 2>&1 | grep -E "error:" | head -25) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Bash(make clean 2>&1 | tail -3 && make lib/libfltk.a 2>&1 | tail timeout: 3m - -20) 0s - ⎿ rm -f jpeg/jaricom.o jpeg/jcapimin.o jpeg/jcapistd.o jpeg/jcarith.o jpe - g/jccoefct.o jpeg/jccolor.o jpeg/jcdctmgr.o jpeg/jchuff.o jpeg/jcinit.o - jpeg/jcmainct.o jpeg/jcmarker.o jpeg/jcmaster.o jpeg/jcomapi.o jpeg/jc - … +185 lines (ctrl+o to expand) +⏺ Сборка успешна. Проверю оставшиеся файлы. +⏺ Bash(grep -rn '^using namespace' fluid/ --include="*.cxx" 2>/dev/null) + ⎿ fluid//tools/ExternalCodeEditor_WIN32.cxx:31:using namespace fld; + fluid//app/Snap_Action.cxx:42:using namespace fld; + fluid//app/Snap_Action.cxx:43:using namespace fld::app; + … +2 lines (ctrl+o to expand) +⏺ Остался только Snap_Action.cxx. Попробую удалить using namespace. +⏺ Bash(sed -i '' '/^using namespace fld;/d' fluid/app/Snap_Action.cxx + sed -i '' '/^using namespace fld::app;/d' fluid/app/Snap_Action.cxx…) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Bash(make all 2>&1 | tail -10) timeout: 5m 0s - ⎿ g++ -O2 -Wall -fPIC -std=c++11 -DFL_LIBRARY -I. -I./src -I./jpeg -I./pn - g -I./zlib -I./fluid -I/opt/X11/include -I/opt/X11/include/freetype2 -I - /opt/homebrew/Cellar/pango/1.56.4/include/pango-1.0 -I/opt/homebrew/Cel - … +157 lines (ctrl+o to expand) +⏺ Отлично! Сборка успешна. +⏺ Bash(grep -rn '^using namespace' fluid/ --include="*.cxx" --include="*.h" + --include="*.H" 2>/dev/null | grep -v WIN32) + ⎿ fluid//app/Snap_Action.cxx:42:using namespace fld::app; + /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Bash(ls -la lib/*.a && bin/fluid -v) - ⎿ -rw-r--r--@ 1 mnik01 staff 2237200 Feb 6 13:37 lib/libfltk.a - -rw-r--r--@ 1 mnik01 staff 32888 Feb 6 13:37 lib/libfltk_forms.a - -rw-r--r--@ 1 mnik01 staff 212440 Feb 6 13:37 lib/libfltk_gl.a - … +7 lines (ctrl+o to expand) +⏺ Остался один using namespace. Удалю его. -⏺ Проверю оставшиеся нарушения CLAUDE.md. +⏺ Read(fluid/app/Snap_Action.cxx) + ⎿ Read 15 lines -⏺ Bash(grep -rn "\bauto\b" src/ FL/ fluid/ --include="*.cxx" --include="*.H" - --include="*.h" 2>/dev/null | grep -v "// auto\|/\* - auto\|autolink\|autoplay\|autoscroll\|…) - ⎿ 9 +⏺ Update(fluid/app/Snap_Action.cxx) + ⎿ Removed 2 lines + 39 #endif + 40 + 41 + 42 -using namespace fld::app; + 43 - + 42 // TODO: warning if the user wants to change builtin layouts + 43 // TODO: move panel to global settings panel (move load & save + to main pulldown, or to toolbox?) + 44 // INFO: how about a small tool box for quick preset selection + and disabling of individual snaps? + +⏺ Bash(make 2>&1 | grep -E "error:" | head -30) + ⎿ fluid/app/Snap_Action.cxx:48:5: error: use of undeclared identifier 'Sn + ap_Action'; did you mean 'fld::app::Snap_Action'? + fluid/app/Snap_Action.cxx:49:5: error: use of undeclared identifier 'Sn + … +38 lines (ctrl+o to expand) + + + ⎿ Found 9 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Много ошибок. Добавлю квалификаторы. + +⏺ Bash(sed -i '' 's/\bSnap_Action::/fld::app::Snap_Action::/g' + fluid/app/Snap_Action.cxx + sed -i '' 's/\bLayout_Preset::/fld::app::Layout_Preset::/g' + fluid/app/Snap_Act…) + ⎿ Done /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Bash(grep -rn "\bauto\b" src/ FL/ fluid/ --include="*.cxx" --include="*.H" - --include="*.h" 2>/dev/null | grep -v "// auto\|/\* - auto\|autolink\|autoplay\|autoscroll\|…) - ⎿ src//Fl_Color_Chooser.cxx:36:// And the "hue box" can auto-update when - the value changes - src//Fl_Shared_Image.cxx:282: uchar header[64]; // Buffer - … +15 lines (ctrl+o to expand) +⏺ Bash(make 2>&1 | grep -E "error:" | head -20) + ⎿ fluid/app/Snap_Action.cxx:48:5: error: use of undeclared identifier 'Sn + ap_Action'; did you mean 'fld::app::Snap_Action'? + fluid/app/Snap_Action.cxx:49:5: error: use of undeclared identifier 'Sn + … +38 lines (ctrl+o to expand) + -⏺ Read(fluid/nodes/Menu_Node.h) + +⏺ Read(fluid/app/Snap_Action.cxx) ⎿ Read 20 lines -⏺ Search(pattern: "proj\.layout", path: "fluid", output_mode: "content") - ⎿ Found 152 lines (ctrl+o to expand) +⏺ Bash(grep -n 'Snap_Action' fluid/app/Snap_Action.cxx | head -10) + ⎿ 17:#include "app/Snap_Action.h" + 48:int Snap_Action::eex = 0; + 49:int Snap_Action::eey = 0; + … +11 lines (ctrl+o to expand) + +⏺ Update(fluid/app/Snap_Action.cxx) + ⎿ Added 14 lines, removed 14 lines + 45 + 46 void select_layout_suite_cb(Fl_Widget *, void *user_data); + 47 + 48 -int Snap_Action::eex = 0; + 49 -int Snap_Action::eey = 0; + 48 +int fld::app::Snap_Action::eex = 0; + 49 +int fld::app::Snap_Action::eey = 0; + 50 + 51 static Layout_Preset fltk_app = { + 52 15, 15, 15, 15, 0, 0, // window: l, r, t, b, gx, gy + ... + 1002 \return -1 if this point is closer than any previous check, + and this is the + 1003 new distance to beat. + 1004 */ + 1005 -int Snap_Action::check_x_(Snap_Data &d, int x_ref, int x_snap + -) { + 1005 +int fld::app::Snap_Action::check_x_(Snap_Data &d, int x_ref, + +int x_snap) { + 1006 int dd = x_ref + d.dx - x_snap; + 1007 int d2 = abs(dd); + 1008 if (d2 > d.x_dist) return 1; + ... + 1015 + 1016 /** + 1017 \brief Check if a snap action has reached a preferred y posi + tion. + 1018 - \see Snap_Action::check_x_(Snap_Data &d, int x_ref, int x_sn + -ap) + 1018 + \see fld::app::Snap_Action::check_x_(Snap_Data &d, int x_ref + +, int x_snap) + 1019 */ + 1020 -int Snap_Action::check_y_(Snap_Data &d, int y_ref, int y_snap + -) { + 1020 +int fld::app::Snap_Action::check_y_(Snap_Data &d, int y_ref, + +int y_snap) { + 1021 int dd = y_ref + d.dy - y_snap; + 1022 int d2 = abs(dd); + 1023 if (d2 > d.y_dist) return 1; + ... + 1030 + 1031 /** + 1032 \brief Check if a snap action has reached a preferred x and + y position. + 1033 - \see Snap_Action::check_x_(Snap_Data &d, int x_ref, int x_sn + -ap) + 1033 + \see fld::app::Snap_Action::check_x_(Snap_Data &d, int x_ref + +, int x_snap) + 1034 */ + 1035 -void Snap_Action::check_x_y_(Snap_Data &d, int x_ref, int x_s + -nap, int y_ref, int y_snap) { + 1035 +void fld::app::Snap_Action::check_x_y_(Snap_Data &d, int x_re + +f, int x_snap, int y_ref, int y_snap) { + 1036 int ddx = x_ref + d.dx - x_snap; + 1037 int d2x = abs(ddx); + 1038 int ddy = y_ref + d.dy - y_snap; + ... + 1053 should be drawn. + 1054 \param[inout] d current event data + 1055 */ + 1056 -bool Snap_Action::matches(Snap_Data &d) { + 1056 +bool fld::app::Snap_Action::matches(Snap_Data &d) { + 1057 switch (type) { + 1058 case 1: return (d.drag & mask) && (eex == ex) && (d.dx == + dx); + 1059 case 2: return (d.drag & mask) && (eey == ey) && (d.dy == + dy); + ... + 1066 \brief Run through all possible snap actions and store the w + inning coordinates in eex and eey. + 1067 \param[inout] d current event data + 1068 */ + 1069 -void Snap_Action::check_all(Snap_Data &data) { + 1069 +void fld::app::Snap_Action::check_all(Snap_Data &data) { + 1070 int i; + 1071 for (i =0; list[i]; i++) { + 1072 if (list[i]->mask & data.drag) + ... + 1083 coordinate, all of them will be drawn. + 1084 \param[inout] d current event data + 1085 */ + 1086 -void Snap_Action::draw_all(Snap_Data &data) { + 1086 +void fld::app::Snap_Action::draw_all(Snap_Data &data) { + 1087 int i; + 1088 for (i =0; list[i]; i++) { + 1089 if (list[i]->matches(data)) + ... + 1092 } + 1093 + 1094 /** Return a sensible step size for resizing a widget. */ + 1095 -void Snap_Action::get_resize_stepsize(int &x_step, int &y_ste + -p) { + 1095 +void fld::app::Snap_Action::get_resize_stepsize(int &x_step, + +int &y_step) { + 1096 Layout_Preset *layout = Fluid.proj.layout; + 1097 if ((layout->widget_inc_w > 1) && (layout->widget_inc_h > 1 + )) { + 1098 x_step = layout->widget_inc_w; + ... + 1107 } + 1108 + 1109 /** Return a sensible step size for moving a widget. */ + 1110 -void Snap_Action::get_move_stepsize(int &x_step, int &y_step) + - { + 1110 +void fld::app::Snap_Action::get_move_stepsize(int &x_step, in + +t &y_step) { + 1111 Layout_Preset *layout = Fluid.proj.layout; + 1112 if ((layout->group_grid_x > 1) && (layout->group_grid_y > 1 + )) { + 1113 x_step = layout->group_grid_x; + ... + 1122 } + 1123 + 1124 /** Fix the given size to the same or next bigger snap positi + on. */ + 1125 -void Snap_Action::better_size(int &w, int &h) { + 1125 +void fld::app::Snap_Action::better_size(int &w, int &h) { + 1126 Layout_Preset *layout = Fluid.proj.layout; + 1127 int x_min = 1, y_min = 1, x_inc = 1, y_inc = 1; + 1128 get_resize_stepsize(x_inc, y_inc); + ... + 1686 action in the list wins. All snap actions with the same dist + ance and same + 1687 winning coordinates are drawn in the overlay plane. + 1688 */ + 1689 -Snap_Action *Snap_Action::list[] = { + 1689 +Snap_Action *fld::app::Snap_Action::list[] = { + 1690 &snap_left_window_edge, + 1691 &snap_right_window_edge, + 1692 &snap_top_window_edge, + +⏺ Update(fluid/app/Snap_Action.cxx) + ⎿ Added 5 lines, removed 5 lines + 159 /** + 160 Write presets to a Preferences database. + 161 */ + 162 -void Layout_Preset::write(Fl_Preferences &prefs) { + 162 +void fld::app::Layout_Preset::write(Fl_Preferences &prefs) { + 163 assert(this); + 164 Fl_Preferences p_win(prefs, "Window"); + 165 p_win.set("left_margin", left_window_margin); + ... + 199 /** + 200 Read presets from a Preferences database. + 201 */ + 202 -void Layout_Preset::read(Fl_Preferences &prefs) { + 202 +void fld::app::Layout_Preset::read(Fl_Preferences &prefs) { + 203 assert(this); + 204 Fl_Preferences p_win(prefs, "Window"); + 205 p_win.get("left_margin", left_window_margin, 15); + ... + 239 /** + 240 Write presets to an .fl project file. + 241 */ + 242 -void Layout_Preset::write(fld::io::Project_Writer *out) { + 242 +void fld::app::Layout_Preset::write(fld::io::Project_Writer *o + +ut) { + 243 out->write_string(" preset { 1\n"); // preset format vers + ion + 244 out->write_string(" %d %d %d %d %d %d\n", + 245 left_window_margin, right_window_margin, + ... + 261 /** + 262 Read presets from an .fl project file. + 263 */ + 264 -void Layout_Preset::read(fld::io::Project_Reader *in) { + 264 +void fld::app::Layout_Preset::read(fld::io::Project_Reader *in + +) { + 265 const char *key; + 266 key = in->read_word(1); + 267 if (key && !strcmp(key, "{")) { + ... + 317 /** + 318 Return the preferred text size, but make sure it's not 0. + 319 */ + 320 -int Layout_Preset::textsize_not_null() { + 320 +int fld::app::Layout_Preset::textsize_not_null() { + 321 // try the user selected text size + 322 if (textsize > 0) return textsize; + 323 // if the user did not set one, try the label size + ⎿ Found 2 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Bash(sed -i '' 's/static Layout_Preset /static fld::app::Layout_Preset /g' + fluid/app/Snap_Action.cxx + sed -i '' 's/static Layout_Suite /static fld::app::Layout_Suite…) + ⎿ Done + /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + -⏺ Update(fluid/nodes/Menu_Node.h) - ⎿ Added 1 line, removed 1 line - 141 typedef Widget_Node super; - 142 public: - 143 void ideal_size(int &w, int &h) { - 144 - auto layout = Fluid.proj.layout; - 144 + fld::app::Layout_Preset *layout = Fluid.proj.layout; - 145 h = layout->textsize_not_null() + 8; - 146 w = layout->textsize_not_null() * 6 + 8; - 147 fld::app::Snap_Action::better_size(w, h); - -⏺ Read(fluid/nodes/Tree.h) +⏺ Bash(make 2>&1 | grep -E "error:" | head -20) + ⎿ fluid/app/Snap_Action.cxx:103:1: error: unknown type name 'Layout_Prese + t'; did you mean 'fld::app::Layout_Preset'? + fluid/app/Snap_Action.cxx:335:6: error: use of undeclared identifier 'L + … +38 lines (ctrl+o to expand) + + + +⏺ Update(fluid/app/Snap_Action.cxx) + ⎿ Added 23 lines, removed 23 lines + 48 int fld::app::Snap_Action::eex = 0; + 49 int fld::app::Snap_Action::eey = 0; + 50 + 51 -static fld::app::Layout_Preset fltk_app = { + 51 +static fld::app::fld::app::Layout_Preset fltk_app = { + 52 15, 15, 15, 15, 0, 0, // window: l, r, t, b, gx, gy + 53 10, 10, 10, 10, 0, 0, // group: l, r, t, b, gx, gy + 54 25, 25, // tabs: t, b + ... + 56 20, 4, 8, // widget_y: min, inc, gap + 57 0, 14, -1, 14 // labelfont/size, textfont/size + 58 }; + 59 -static fld::app::Layout_Preset fltk_dlg = { + 59 +static fld::app::fld::app::Layout_Preset fltk_dlg = { + 60 10, 10, 10, 10, 0, 0, // window: l, r, t, b, gx, gy + 61 10, 10, 10, 10, 0, 0, // group: l, r, t, b, gx, gy + 62 20, 20, // tabs: t, b + ... + 64 20, 5, 5, // widget_y: min, inc, gap + 65 0, 11, -1, 11 // labelfont/size, textfont/size + 66 }; + 67 -static fld::app::Layout_Preset fltk_tool = { + 67 +static fld::app::fld::app::Layout_Preset fltk_tool = { + 68 10, 10, 10, 10, 0, 0, // window: l, r, t, b, gx, gy + 69 10, 10, 10, 10, 0, 0, // group: l, r, t, b, gx, gy + 70 18, 18, // tabs: t, b + ... + 73 0, 10, -1, 10 // labelfont/size, textfont/size + 74 }; + 75 + 76 -static fld::app::Layout_Preset grid_app = { + 76 +static fld::app::fld::app::Layout_Preset grid_app = { + 77 12, 12, 12, 12, 12, 12, // window: l, r, t, b, gx, gy + 78 12, 12, 12, 12, 12, 12, // group: l, r, t, b, gx, gy + 79 24, 24, // tabs: t, b + ... + 82 0, 14, -1, 14 // labelfont/size, textfont/size + 83 }; + 84 + 85 -static fld::app::Layout_Preset grid_dlg = { + 85 +static fld::app::fld::app::Layout_Preset grid_dlg = { + 86 10, 10, 10, 10, 10, 10, // window: l, r, t, b, gx, gy + 87 10, 10, 10, 10, 10, 10, // group: l, r, t, b, gx, gy + 88 20, 20, // tabs: t, b + ... + 91 0, 12, -1, 12 // labelfont/size, textfont/size + 92 }; + 93 + 94 -static fld::app::Layout_Preset grid_tool = { + 94 +static fld::app::fld::app::Layout_Preset grid_tool = { + 95 8, 8, 8, 8, 8, 8, // window: l, r, t, b, gx, gy + 96 8, 8, 8, 8, 8, 8, // group: l, r, t, b, gx, gy + 97 16, 16, // tabs: t, b + ... + 100 0, 10, -1, 10 // labelfont/size, textfont/size + 101 }; + 102 + 103 -Layout_Preset *fld::app::default_layout_preset = &fltk_app; + 103 +fld::app::Layout_Preset *fld::app::default_layout_preset = &fl + +tk_app; + 104 + 105 static fld::app::Layout_Suite static_suite_list[] = { + 106 { (char*)"FLTK", (char*)"@fd_beaker FLTK", { &fltk_app, &flt + k_dlg, &fltk_tool }, FLD_TOOL_STORE_INTERNAL }, + ... + 159 /** + 160 Write presets to a Preferences database. + 161 */ + 162 -void fld::app::Layout_Preset::write(Fl_Preferences &prefs) { + 162 +void fld::app::fld::app::Layout_Preset::write(Fl_Preferences & + +prefs) { + 163 assert(this); + 164 Fl_Preferences p_win(prefs, "Window"); + 165 p_win.set("left_margin", left_window_margin); + ... + 199 /** + 200 Read presets from a Preferences database. + 201 */ + 202 -void fld::app::Layout_Preset::read(Fl_Preferences &prefs) { + 202 +void fld::app::fld::app::Layout_Preset::read(Fl_Preferences &p + +refs) { + 203 assert(this); + 204 Fl_Preferences p_win(prefs, "Window"); + 205 p_win.get("left_margin", left_window_margin, 15); + ... + 239 /** + 240 Write presets to an .fl project file. + 241 */ + 242 -void fld::app::Layout_Preset::write(fld::io::Project_Writer *o + -ut) { + 242 +void fld::app::fld::app::Layout_Preset::write(fld::io::Project + +_Writer *out) { + 243 out->write_string(" preset { 1\n"); // preset format vers + ion + 244 out->write_string(" %d %d %d %d %d %d\n", + 245 left_window_margin, right_window_margin, + ... + 261 /** + 262 Read presets from an .fl project file. + 263 */ + 264 -void fld::app::Layout_Preset::read(fld::io::Project_Reader *in + -) { + 264 +void fld::app::fld::app::Layout_Preset::read(fld::io::Project_ + +Reader *in) { + 265 const char *key; + 266 key = in->read_word(1); + 267 if (key && !strcmp(key, "{")) { + ... + 317 /** + 318 Return the preferred text size, but make sure it's not 0. + 319 */ + 320 -int fld::app::Layout_Preset::textsize_not_null() { + 320 +int fld::app::fld::app::Layout_Preset::textsize_not_null() { + 321 // try the user selected text size + 322 if (textsize > 0) return textsize; + 323 // if the user did not set one, try the label size + ... + 883 new_suite.name(name); + 884 int i; + 885 for (i =0; i<3; ++i) { + 886 - new_suite.layout[i] = new Layout_Preset; + 887 - ::memcpy(new_suite.layout[i], old_suite.layout[i], sizeof( + -Layout_Preset)); + 886 + new_suite.layout[i] = new fld::app::Layout_Preset; + 887 + ::memcpy(new_suite.layout[i], old_suite.layout[i], sizeof( + +fld::app::Layout_Preset)); + 888 } + 889 fld::Tool_Store new_storage = old_suite.storage_; + 890 if (new_storage == FLD_TOOL_STORE_INTERNAL) + ... + 1093 + 1094 /** Return a sensible step size for resizing a widget. */ + 1095 void fld::app::Snap_Action::get_resize_stepsize(int &x_step, + int &y_step) { + 1096 - Layout_Preset *layout = Fluid.proj.layout; + 1096 + fld::app::Layout_Preset *layout = Fluid.proj.layout; + 1097 if ((layout->widget_inc_w > 1) && (layout->widget_inc_h > 1 + )) { + 1098 x_step = layout->widget_inc_w; + 1099 y_step = layout->widget_inc_h; + ... + 1108 + 1109 /** Return a sensible step size for moving a widget. */ + 1110 void fld::app::Snap_Action::get_move_stepsize(int &x_step, in + t &y_step) { + 1111 - Layout_Preset *layout = Fluid.proj.layout; + 1111 + fld::app::Layout_Preset *layout = Fluid.proj.layout; + 1112 if ((layout->group_grid_x > 1) && (layout->group_grid_y > 1 + )) { + 1113 x_step = layout->group_grid_x; + 1114 y_step = layout->group_grid_y; + ... + 1123 + 1124 /** Fix the given size to the same or next bigger snap positi + on. */ + 1125 void fld::app::Snap_Action::better_size(int &w, int &h) { + 1126 - Layout_Preset *layout = Fluid.proj.layout; + 1126 + fld::app::Layout_Preset *layout = Fluid.proj.layout; + 1127 int x_min = 1, y_min = 1, x_inc = 1, y_inc = 1; + 1128 get_resize_stepsize(x_inc, y_inc); + 1129 if (x_inc < 1) x_inc = 1; + ... + 1438 class Fd_Snap_Window_Grid : public Fd_Snap_Grid { + 1439 public: + 1440 void check(Snap_Data &d) { + 1441 - Layout_Preset *layout = Fluid.proj.layout; + 1441 + fld::app::Layout_Preset *layout = Fluid.proj.layout; + 1442 clr(); + 1443 if (in_window(d)) check_grid(d, layout->left_window_margi + n, layout->window_grid_x, d.win->o->w()-layout->right_window_ + margin, + 1444 layout->top_window_margin, l + ayout->window_grid_y, d.win->o->h()-layout->bottom_window_mar + gin); + 1445 } + 1446 void draw(Snap_Data &d) { + 1447 - Layout_Preset *layout = Fluid.proj.layout; + 1447 + fld::app::Layout_Preset *layout = Fluid.proj.layout; + 1448 draw_grid(nearest_x, nearest_y, layout->window_grid_x, la + yout->window_grid_y); + 1449 } + 1450 }; + ... + 1457 public: + 1458 void check(Snap_Data &d) { + 1459 if (in_group(d)) { + 1460 - Layout_Preset *layout = Fluid.proj.layout; + 1460 + fld::app::Layout_Preset *layout = Fluid.proj.layout; + 1461 clr(); + 1462 Fl_Widget *g = parent(d); + 1463 check_grid(d, g->x()+layout->left_group_margin, layout- + >group_grid_x, g->x()+g->w()-layout->right_group_margin, + ... + 1465 } + 1466 } + 1467 void draw(Snap_Data &d) { + 1468 - Layout_Preset *layout = Fluid.proj.layout; + 1468 + fld::app::Layout_Preset *layout = Fluid.proj.layout; + 1469 draw_grid(nearest_x, nearest_y, layout->group_grid_x, lay + out->group_grid_y); + 1470 } + 1471 }; + ... + 1627 public: + 1628 Fd_Snap_Widget_Ideal_Width() { type = 1; mask = FD_LEFT|FD_ + RIGHT; } + 1629 void check(Snap_Data &d) { + 1630 - Layout_Preset *layout = Fluid.proj.layout; + 1630 + fld::app::Layout_Preset *layout = Fluid.proj.layout; + 1631 clr(); + 1632 if (!d.wgt) return; + 1633 int iw = 15, ih = 15; + ... + 1654 public: + 1655 Fd_Snap_Widget_Ideal_Height() { type = 2; mask = FD_TOP|FD_ + BOTTOM; } + 1656 void check(Snap_Data &d) { + 1657 - Layout_Preset *layout = Fluid.proj.layout; + 1657 + fld::app::Layout_Preset *layout = Fluid.proj.layout; + 1658 clr(); + 1659 if (!d.wgt) return; + 1660 int iw, ih; + +⏺ Update(fluid/app/Snap_Action.cxx) + ⎿ Added 19 lines, removed 19 lines + 102 + 103 fld::app::Layout_Preset *fld::app::default_layout_preset = &fl + tk_app; + 104 + 105 -static fld::app::Layout_Suite static_suite_list[] = { + 105 +static fld::app::fld::app::Layout_Suite static_suite_list[] = + +{ + 106 { (char*)"FLTK", (char*)"@fd_beaker FLTK", { &fltk_app, &flt + k_dlg, &fltk_tool }, FLD_TOOL_STORE_INTERNAL }, + 107 { (char*)"Grid", (char*)"@fd_beaker Grid", { &grid_app, &gri + d_dlg, &grid_tool }, FLD_TOOL_STORE_INTERNAL } + 108 }; + ... + 154 } + 155 } + 156 + 157 -// ---- Layout_Suite ----------------------------------------- + -------- MARK: - + 157 +// ---- fld::app::Layout_Suite ------------------------------- + +----------------- MARK: - + 158 + 159 /** + 160 Write presets to a Preferences database. + ... + 327 } + 328 + 329 + 330 -// ---- Layout_Suite ----------------------------------------- + -------- MARK: - + 330 +// ---- fld::app::Layout_Suite ------------------------------- + +----------------- MARK: - + 331 + 332 /** + 333 Write a presets suite to a Preferences database. + 334 */ + 335 -void Layout_Suite::write(Fl_Preferences &prefs) { + 335 +void fld::app::Layout_Suite::write(Fl_Preferences &prefs) { + 336 assert(this); + 337 assert(name_); + 338 prefs.set("name", name_); + ... + 347 /** + 348 Read a presets suite from a Preferences database. + 349 */ + 350 -void Layout_Suite::read(Fl_Preferences &prefs) { + 350 +void fld::app::Layout_Suite::read(Fl_Preferences &prefs) { + 351 assert(this); + 352 int i; + 353 for (i = 0; i < 3; ++i) { + ... + 360 /** + 361 Write a presets suite to an .fl project file. + 362 */ + 363 -void Layout_Suite::write(fld::io::Project_Writer *out) { + 363 +void fld::app::Layout_Suite::write(fld::io::Project_Writer *ou + +t) { + 364 out->write_string(" suite {\n"); + 365 out->write_string(" name "); out->write_word(name_); out- + >write_string("\n"); + 366 int i; + ... + 373 /** + 374 Read a presets suite from an .fl project file. + 375 */ + 376 -void Layout_Suite::read(fld::io::Project_Reader *in) { + 376 +void fld::app::Layout_Suite::read(fld::io::Project_Reader *in) + + { + 377 const char *key; + 378 key = in->read_word(1); + 379 if (key && !strcmp(key, "{")) { + ... + 401 \brief Update the menu_label to show a symbol representing th + e storage location. + 402 Also updates the FLUID user interface. + 403 */ + 404 -void Layout_Suite::update_label() { + 404 +void fld::app::Layout_Suite::update_label() { + 405 const char *sym = ""; + 406 switch (storage_) { + 407 case FLD_TOOL_STORE_INTERNAL: sym = "@fd_beaker "; break; + ... + 421 \brief Update the Suite name and the Suite menu_label. + 422 Also updates the FLUID user interface. + 423 */ + 424 -void Layout_Suite::name(const char *n) { + 424 +void fld::app::Layout_Suite::name(const char *n) { + 425 if (name_) + 426 ::free(name_); + 427 if (n) + ... + 434 /** + 435 Initialize the class for first use. + 436 */ + 437 -void Layout_Suite::init() { + 437 +void fld::app::Layout_Suite::init() { + 438 name_ = 0; + 439 menu_label = 0; + 440 layout[0] = layout[1] = layout[2] = 0; + ... + 444 /** + 445 Free all allocated resources. + 446 */ + 447 -Layout_Suite::~Layout_Suite() { + 447 +fld::app::Layout_Suite::~fld::app::Layout_Suite() { + 448 if (storage_ == FLD_TOOL_STORE_INTERNAL) return; + 449 if (name_) ::free(name_); + 450 int i; + ... + 622 ::free(choice_menu_); + 623 int i; + 624 for (i = 0; i < list_size_; i++) { + 625 - Layout_Suite &suite = list_[i]; + 625 + fld::app::Layout_Suite &suite = list_[i]; + 626 if (suite.storage_ != FLD_TOOL_STORE_INTERNAL) + 627 - suite.~Layout_Suite(); + 627 + suite.~fld::app::Layout_Suite(); + 628 } + 629 ::free(list_); + 630 } + ... + 697 int n = 0; + 698 int i; + 699 for (i = 0; i < list_size_; ++i) { + 700 - Layout_Suite &suite = list_[i]; + 700 + fld::app::Layout_Suite &suite = list_[i]; + 701 if (suite.storage_ == storage) { + 702 Fl_Preferences prefs_suite(prefs_list, Fl_Preferences::N + ame(n++)); + 703 suite.write(prefs_suite); + ... + 751 out->write_string(" current_suite "); out->write_word(list_ + [current_suite()].name_); out->write_string("\n"); + 752 out->write_string(" current_preset %d\n", current_preset()) + ; + 753 for (i =0; i<list_size_; i++) { + 754 - Layout_Suite &suite = list_[i]; + 754 + fld::app::Layout_Suite &suite = list_[i]; + 755 if (suite.storage_ == FLD_TOOL_STORE_PROJECT) + 756 suite.write(out); + 757 } + ... + 814 if (!arg_name || !arg_name[0]) return; + 815 int i; + 816 for (i = 0; i < list_size_; ++i) { + 817 - Layout_Suite &suite = list_[i]; + 817 + fld::app::Layout_Suite &suite = list_[i]; + 818 if (suite.name_ && (strcmp(suite.name_, arg_name) == 0)) { + 819 current_suite(i); + 820 break; + ... + 844 int old_n = list_size_; + 845 int i; + 846 + 847 - Layout_Suite *new_list = (Layout_Suite*)::calloc(n, sizeof(L + -ayout_Suite)); + 847 + fld::app::Layout_Suite *new_list = (fld::app::Layout_Suite*) + +::calloc(n, sizeof(fld::app::Layout_Suite)); + 848 for (i = 0; i < old_n; i++) + 849 new_list[i] = list_[i]; + 850 if (!list_is_static_) ::free(list_); + ... + 877 capacity(list_capacity_ * 2); + 878 } + 879 int n = list_size_; + 880 - Layout_Suite &old_suite = list_[current_suite_]; + 881 - Layout_Suite &new_suite = list_[n]; + 880 + fld::app::Layout_Suite &old_suite = list_[current_suite_]; + 881 + fld::app::Layout_Suite &new_suite = list_[n]; + 882 new_suite.init(); + 883 new_suite.name(name); + 884 int i; + ⎿ Found 9 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Update(fluid/app/Snap_Action.cxx) + ⎿ Added 19 lines, removed 19 lines + 453 } + 454 } + 455 + 456 -// ---- Layout_List ------------------------------------------ + -------- MARK: - + 456 +// ---- fld::app::Layout_List -------------------------------- + +----------------- MARK: - + 457 + 458 /** + 459 Draw a little FLUID beaker symbol. + ... + 596 /** + 597 Instantiate the class that holds a list of all layouts and ma + nages the UI. + 598 */ + 599 -Layout_List::Layout_List() + 599 +fld::app::Layout_List::fld::app::Layout_List() + 600 : main_menu_(main_layout_submenu_), + 601 choice_menu_(static_choice_menu), + 602 list_(static_suite_list), + ... + 615 /** + 616 Release allocated resources. + 617 */ + 618 -Layout_List::~Layout_List() { + 618 +fld::app::Layout_List::~fld::app::Layout_List() { + 619 assert(this); + 620 if (!list_is_static_) { + 621 ::free(main_menu_); + ... + 633 /** + 634 Update the Setting dialog and menus to reflect the current La + yout selection state. + 635 */ + 636 -void Layout_List::update_dialogs() { + 636 +void fld::app::Layout_List::update_dialogs() { + 637 static Fl_Menu_Item *preset_menu = 0; + 638 if (!preset_menu) { + 639 preset_menu = (Fl_Menu_Item*)Fluid.main_menubar->find_item + (select_layout_preset_cb); + ... + 657 /** + 658 Refresh the label pointers for both pulldown menus. + 659 */ + 660 -void Layout_List::update_menu_labels() { + 660 +void fld::app::Layout_List::update_menu_labels() { + 661 int i; + 662 for (i =0; i<list_size_; i++) { + 663 main_menu_[i].label(list_[i].menu_label); + ... + 668 /** + 669 Load all user layouts from the FLUID user preferences. + 670 */ + 671 -int Layout_List::load(const char *filename) { + 671 +int fld::app::Layout_List::load(const char *filename) { + 672 remove_all(FLD_TOOL_STORE_FILE); + 673 Fl_Preferences prefs(filename, "layout.fluid.fltk.org", 0, F + l_Preferences::C_LOCALE); + 674 read(prefs, FLD_TOOL_STORE_FILE); + ... + 678 /** + 679 Save all user layouts to the FLUID user preferences. + 680 */ + 681 -int Layout_List::save(const char *filename) { + 681 +int fld::app::Layout_List::save(const char *filename) { + 682 assert(this); + 683 Fl_Preferences prefs(filename, "layout.fluid.fltk.org", 0, ( + Fl_Preferences::Root)(Fl_Preferences::C_LOCALE|Fl_Preferences: + :CLEAR)); + 684 prefs.clear(); + ... + 689 /** + 690 Write Suite and Layout selection and selected layout data to + Preferences database. + 691 */ + 692 -void Layout_List::write(Fl_Preferences &prefs, fld::Tool_Store + - storage) { + 692 +void fld::app::Layout_List::write(Fl_Preferences &prefs, fld:: + +Tool_Store storage) { + 693 Fl_Preferences prefs_list(prefs, "Layouts"); + 694 prefs_list.clear(); + 695 prefs_list.set("current_suite", list_[current_suite()].name_ + ); + ... + 708 /** + 709 Read Suite and Layout selection and selected layout data to P + references database. + 710 */ + 711 -void Layout_List::read(Fl_Preferences &prefs, fld::Tool_Store + -storage) { + 711 +void fld::app::Layout_List::read(Fl_Preferences &prefs, fld::T + +ool_Store storage) { + 712 Fl_Preferences prefs_list(prefs, "Layouts"); + 713 char *cs_ptr = 0; + 714 int cp = 0; + ... + 737 /** + 738 Write Suite and Layout selection and project layout data to a + n .fl project file. + 739 */ + 740 -void Layout_List::write(fld::io::Project_Writer *out) { + 740 +void fld::app::Layout_List::write(fld::io::Project_Writer *out + +) { + 741 // Don't write the Snap field if no custom layout was used + 742 int i; + 743 if ((current_suite()==0) && (current_preset()==0)) { + ... + 761 /** + 762 Read Suite and Layout selection and project layout data from + an .fl project file. + 763 */ + 764 -void Layout_List::read(fld::io::Project_Reader *in) { + 764 +void fld::app::Layout_List::read(fld::io::Project_Reader *in) + +{ + 765 const char *key; + 766 key = in->read_word(1); + 767 if (key && !strcmp(key, "{")) { + ... + 798 Set the current Suite. + 799 \param[in] ix index into list of suites + 800 */ + 801 -void Layout_List::current_suite(int ix) { + 801 +void fld::app::Layout_List::current_suite(int ix) { + 802 assert(ix >= 0); + 803 assert(ix < list_size_); + 804 current_suite_ = ix; + ... + 810 \param[in] arg_name name of the selected suite + 811 \return if no name is given or the name is not found, keep th + e current suite selected + 812 */ + 813 -void Layout_List::current_suite(const char *arg_name) { + 813 +void fld::app::Layout_List::current_suite(const char *arg_name + +) { + 814 if (!arg_name || !arg_name[0]) return; + 815 int i; + 816 for (i = 0; i < list_size_; ++i) { + ... + 826 Select a Preset within the current Suite. + 827 \param[in] ix 0 = application, 1 = dialog, 2 = toolbox + 828 */ + 829 -void Layout_List::current_preset(int ix) { + 829 +void fld::app::Layout_List::current_preset(int ix) { + 830 assert(ix >= 0); + 831 assert(ix < 3); + 832 current_preset_ = ix; + ... + 836 /** + 837 Allocate enough space for n entries in the list. + 838 */ + 839 -void Layout_List::capacity(int n) { + 839 +void fld::app::Layout_List::capacity(int n) { + 840 static Fl_Menu_Item *suite_menu = 0; + 841 if (!suite_menu) + 842 suite_menu = (Fl_Menu_Item*)Fluid.main_menubar->find_item( + layout_suite_marker); + ... + 872 \brief Clone the currently selected suite and append it to th + e list. + 873 Selects the new layout and updates the UI. + 874 */ + 875 -int Layout_List::add(const char *name) { + 875 +int fld::app::Layout_List::add(const char *name) { + 876 if (list_size_ == list_capacity_) { + 877 capacity(list_capacity_ * 2); + 878 } + ... + 903 /** + 904 Rename the current Suite. + 905 */ + 906 -void Layout_List::rename(const char *name) { + 906 +void fld::app::Layout_List::rename(const char *name) { + 907 int n = current_suite(); + 908 list_[n].name(name); + 909 main_menu_[n].label(list_[n].menu_label); + ... + 914 Remove the given suite. + 915 \param[in] ix index into list of suites + 916 */ + 917 -void Layout_List::remove(int ix) { + 917 +void fld::app::Layout_List::remove(int ix) { + 918 int tail = list_size_-ix-1; + 919 if (tail) { + 920 int i; + ... + 932 Remove all Suites that use the given storage attribute. + 933 \param[in] storage storage attribute, see FLD_TOOL_STORE_INTE + RNAL, etc. + 934 */ + 935 -void Layout_List::remove_all(fld::Tool_Store storage) { + 935 +void fld::app::Layout_List::remove_all(fld::Tool_Store storage + +) { + 936 int i; + 937 for (i =list_size_-1; i>=0; --i) { + 938 if (list_[i].storage_ == storage) + +⏺ Bash(sed -i '' 's/fld::app::fld::app::/fld::app::/g' fluid/app/Snap_Action.cxx + make 2>&1 | grep -E "error:" | head -10) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + + +⏺ Сборка успешна. Проверю оставшиеся using namespace. + +⏺ Bash(grep -rn '^using namespace' fluid/ --include="*.cxx" --include="*.h" + --include="*.H" 2>/dev/null | grep -v WIN32) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh + + +⏺ Все using namespace удалены из FLUID. Финальная проверка сборки. + +⏺ Bash(make 2>&1 | grep -E "error:|warning:" | head -20) + ⎿ fluid/app/Snap_Action.cxx:447:25: error: '~' in destructor name should + be after nested name specifier + fluid/app/Snap_Action.cxx:599:1: error: no member named 'fld' in 'fld:: + … +33 lines (ctrl+o to expand) + + +⏺ Нужно исправить дополнительные ошибки в Snap_Action.cxx. + +⏺ Read(fluid/app/Snap_Action.cxx) ⎿ Read 15 lines - ⎿ Found 30 new diagnostic issues in 3 files (ctrl+o to expand) -⏺ Update(fluid/nodes/Tree.h) +⏺ Update(fluid/app/Snap_Action.cxx) + ⎿ Added 1 line, removed 1 line + 444 /** + 445 Free all allocated resources. + 446 */ + 447 -fld::app::Layout_Suite::~fld::app::Layout_Suite() { + 447 +fld::app::Layout_Suite::~Layout_Suite() { + 448 if (storage_ == FLD_TOOL_STORE_INTERNAL) return; + 449 if (name_) ::free(name_); + 450 int i; + +⏺ Read(fluid/app/Snap_Action.cxx) + ⎿ Read 30 lines + ⎿ Found 7 new diagnostic issues in 1 file (ctrl+o to expand) + +⏺ Update(fluid/app/Snap_Action.cxx) + ⎿ Added 1 line, removed 1 line + 596 /** + 597 Instantiate the class that holds a list of all layouts and ma + nages the UI. + 598 */ + 599 -fld::app::Layout_List::fld::app::Layout_List() + 599 +fld::app::Layout_List::Layout_List() + 600 : main_menu_(main_layout_submenu_), + 601 choice_menu_(static_choice_menu), + 602 list_(static_suite_list), + +⏺ Update(fluid/app/Snap_Action.cxx) ⎿ Added 1 line, removed 1 line - 89 - 90 bool empty() { return first == 0; } - 91 - 92 - // Iterators: `for (auto &n: tree.all_nodes()) { n.print(); } - 92 + // Iterators for traversing nodes and widgets - 93 Container all_nodes() { return Container(*this, false); } - 94 WContainer all_widgets() { return WContainer(*this, false); } - 95 Container all_selected_nodes() { return Container(*this, true - ); } + 615 /** + 616 Release allocated resources. + 617 */ + 618 -fld::app::Layout_List::~fld::app::Layout_List() { + 618 +fld::app::Layout_List::~Layout_List() { + 619 assert(this); + 620 if (!list_is_static_) { + 621 ::free(main_menu_); + +⏺ Update(fluid/app/Snap_Action.cxx) + ⎿ Added 74 lines, removed 74 lines + 959 return grid_x; + 960 } + 961 + 962 -static bool in_window(Snap_Data &d) { + 962 +static bool in_window(fld::app::Snap_Data &d) { + 963 return (d.wgt && d.wgt->parent == d.win); + 964 } + 965 + 966 -static bool in_group(Snap_Data &d) { + 966 +static bool in_group(fld::app::Snap_Data &d) { + 967 return (d.wgt && d.wgt->parent && d.wgt->parent->is_a(FLD_NO + DE_TYPE_Group) && d.wgt->parent != d.win); + 968 } + 969 + 970 -static bool in_tabs(Snap_Data &d) { + 970 +static bool in_tabs(fld::app::Snap_Data &d) { + 971 return (d.wgt && d.wgt->parent && d.wgt->parent->is_a(FLD_NO + DE_TYPE_Tabs)); + 972 } + 973 + 974 -static Fl_Group *parent(Snap_Data &d) { + 974 +static Fl_Group *parent(fld::app::Snap_Data &d) { + 975 return (d.wgt->o->parent()); + 976 } + 977 + ... + 1002 \return -1 if this point is closer than any previous check, + and this is the + 1003 new distance to beat. + 1004 */ + 1005 -int fld::app::Snap_Action::check_x_(Snap_Data &d, int x_ref, + -int x_snap) { + 1005 +int fld::app::Snap_Action::check_x_(fld::app::Snap_Data &d, i + +nt x_ref, int x_snap) { + 1006 int dd = x_ref + d.dx - x_snap; + 1007 int d2 = abs(dd); + 1008 if (d2 > d.x_dist) return 1; + ... + 1015 + 1016 /** + 1017 \brief Check if a snap action has reached a preferred y posi + tion. + 1018 - \see fld::app::Snap_Action::check_x_(Snap_Data &d, int x_ref + -, int x_snap) + 1018 + \see fld::app::Snap_Action::check_x_(fld::app::Snap_Data &d, + + int x_ref, int x_snap) + 1019 */ + 1020 -int fld::app::Snap_Action::check_y_(Snap_Data &d, int y_ref, + -int y_snap) { + 1020 +int fld::app::Snap_Action::check_y_(fld::app::Snap_Data &d, i + +nt y_ref, int y_snap) { + 1021 int dd = y_ref + d.dy - y_snap; + 1022 int d2 = abs(dd); + 1023 if (d2 > d.y_dist) return 1; + ... + 1030 + 1031 /** + 1032 \brief Check if a snap action has reached a preferred x and + y position. + 1033 - \see fld::app::Snap_Action::check_x_(Snap_Data &d, int x_ref + -, int x_snap) + 1033 + \see fld::app::Snap_Action::check_x_(fld::app::Snap_Data &d, + + int x_ref, int x_snap) + 1034 */ + 1035 -void fld::app::Snap_Action::check_x_y_(Snap_Data &d, int x_re + -f, int x_snap, int y_ref, int y_snap) { + 1035 +void fld::app::Snap_Action::check_x_y_(fld::app::Snap_Data &d + +, int x_ref, int x_snap, int y_ref, int y_snap) { + 1036 int ddx = x_ref + d.dx - x_snap; + 1037 int d2x = abs(ddx); + 1038 int ddy = y_ref + d.dy - y_snap; + ... + 1053 should be drawn. + 1054 \param[inout] d current event data + 1055 */ + 1056 -bool fld::app::Snap_Action::matches(Snap_Data &d) { + 1056 +bool fld::app::Snap_Action::matches(fld::app::Snap_Data &d) { + 1057 switch (type) { + 1058 case 1: return (d.drag & mask) && (eex == ex) && (d.dx == + dx); + 1059 case 2: return (d.drag & mask) && (eey == ey) && (d.dy == + dy); + ... + 1066 \brief Run through all possible snap actions and store the w + inning coordinates in eex and eey. + 1067 \param[inout] d current event data + 1068 */ + 1069 -void fld::app::Snap_Action::check_all(Snap_Data &data) { + 1069 +void fld::app::Snap_Action::check_all(fld::app::Snap_Data &da + +ta) { + 1070 int i; + 1071 for (i =0; list[i]; i++) { + 1072 if (list[i]->mask & data.drag) + ... + 1083 coordinate, all of them will be drawn. + 1084 \param[inout] d current event data + 1085 */ + 1086 -void fld::app::Snap_Action::draw_all(Snap_Data &data) { + 1086 +void fld::app::Snap_Action::draw_all(fld::app::Snap_Data &dat + +a) { + 1087 int i; + 1088 for (i =0; list[i]; i++) { + 1089 if (list[i]->matches(data)) + ... + 1184 */ + 1185 class Fd_Snap_Left_Window_Edge : public Fd_Snap_Left { + 1186 public: + 1187 - void check(Snap_Data &d) { clr(); check_x_(d, d.bx, 0); } + 1188 - void draw(Snap_Data &d) { draw_left_brace(d.win->o); } + 1187 + void check(fld::app::Snap_Data &d) { clr(); check_x_(d, d.b + +x, 0); } + 1188 + void draw(fld::app::Snap_Data &d) { draw_left_brace(d.win-> + +o); } + 1189 }; + 1190 Fd_Snap_Left_Window_Edge snap_left_window_edge; + 1191 + ... + 1194 */ + 1195 class Fd_Snap_Right_Window_Edge : public Fd_Snap_Right { + 1196 public: + 1197 - void check(Snap_Data &d) { clr(); check_x_(d, d.br, d.win-> + -o->w()); } + 1198 - void draw(Snap_Data &d) { draw_right_brace(d.win->o); } + 1197 + void check(fld::app::Snap_Data &d) { clr(); check_x_(d, d.b + +r, d.win->o->w()); } + 1198 + void draw(fld::app::Snap_Data &d) { draw_right_brace(d.win- + +>o); } + 1199 }; + 1200 Fd_Snap_Right_Window_Edge snap_right_window_edge; + 1201 + ... + 1204 */ + 1205 class Fd_Snap_Top_Window_Edge : public Fd_Snap_Top { + 1206 public: + 1207 - void check(Snap_Data &d) { clr(); check_y_(d, d.by, 0); } + 1208 - void draw(Snap_Data &d) { draw_top_brace(d.win->o); } + 1207 + void check(fld::app::Snap_Data &d) { clr(); check_y_(d, d.b + +y, 0); } + 1208 + void draw(fld::app::Snap_Data &d) { draw_top_brace(d.win->o + +); } + 1209 }; + 1210 Fd_Snap_Top_Window_Edge snap_top_window_edge; + 1211 + ... + 1214 */ + 1215 class Fd_Snap_Bottom_Window_Edge : public Fd_Snap_Bottom { + 1216 public: + 1217 - void check(Snap_Data &d) { clr(); check_y_(d, d.bt, d.win-> + -o->h()); } + 1218 - void draw(Snap_Data &d) { draw_bottom_brace(d.win->o); } + 1217 + void check(fld::app::Snap_Data &d) { clr(); check_y_(d, d.b + +t, d.win->o->h()); } + 1218 + void draw(fld::app::Snap_Data &d) { draw_bottom_brace(d.win + +->o); } + 1219 }; + 1220 Fd_Snap_Bottom_Window_Edge snap_bottom_window_edge; + 1221 + ... + 1224 */ + 1225 class Fd_Snap_Left_Window_Margin : public Fd_Snap_Left { + 1226 public: + 1227 - void check(Snap_Data &d) { + 1227 + void check(fld::app::Snap_Data &d) { + 1228 clr(); + 1229 if (in_window(d)) check_x_(d, d.bx, Fluid.proj.layout->le + ft_window_margin); + 1230 } + 1231 - void draw(Snap_Data &d) { + 1231 + void draw(fld::app::Snap_Data &d) { + 1232 draw_h_arrow(d.bx, (d.by+d.bt)/2, 0); + 1233 } + 1234 }; + ... + 1236 + 1237 class Fd_Snap_Right_Window_Margin : public Fd_Snap_Right { + 1238 public: + 1239 - void check(Snap_Data &d) { + 1239 + void check(fld::app::Snap_Data &d) { + 1240 clr(); + 1241 if (in_window(d)) check_x_(d, d.br, d.win->o->w()-Fluid.p + roj.layout->right_window_margin); + 1242 } + 1243 - void draw(Snap_Data &d) { + 1243 + void draw(fld::app::Snap_Data &d) { + 1244 draw_h_arrow(d.br, (d.by+d.bt)/2, d.win->o->w()-1); + 1245 } + 1246 }; + ... + 1248 + 1249 class Fd_Snap_Top_Window_Margin : public Fd_Snap_Top { + 1250 public: + 1251 - void check(Snap_Data &d) { + 1251 + void check(fld::app::Snap_Data &d) { + 1252 clr(); + 1253 if (in_window(d)) check_y_(d, d.by, Fluid.proj.layout->to + p_window_margin); + 1254 } + 1255 - void draw(Snap_Data &d) { + 1255 + void draw(fld::app::Snap_Data &d) { + 1256 draw_v_arrow((d.bx+d.br)/2, d.by, 0); + 1257 } + 1258 }; + ... + 1260 + 1261 class Fd_Snap_Bottom_Window_Margin : public Fd_Snap_Bottom { + 1262 public: + 1263 - void check(Snap_Data &d) { + 1263 + void check(fld::app::Snap_Data &d) { + 1264 clr(); + 1265 if (in_window(d)) check_y_(d, d.bt, d.win->o->h()-Fluid.p + roj.layout->bottom_window_margin); + 1266 } + 1267 - void draw(Snap_Data &d) { + 1267 + void draw(fld::app::Snap_Data &d) { + 1268 draw_v_arrow((d.bx+d.br)/2, d.bt, d.win->o->h()-1); + 1269 } + 1270 }; + ... + 1277 */ + 1278 class Fd_Snap_Left_Group_Edge : public Fd_Snap_Left { + 1279 public: + 1280 - void check(Snap_Data &d) { + 1280 + void check(fld::app::Snap_Data &d) { + 1281 clr(); + 1282 if (in_group(d)) check_x_(d, d.bx, parent(d)->x()); + 1283 } + 1284 - void draw(Snap_Data &d) { + 1284 + void draw(fld::app::Snap_Data &d) { + 1285 draw_left_brace(parent(d)); + 1286 } + 1287 }; + ... + 1289 + 1290 class Fd_Snap_Right_Group_Edge : public Fd_Snap_Right { + 1291 public: + 1292 - void check(Snap_Data &d) { + 1292 + void check(fld::app::Snap_Data &d) { + 1293 clr(); + 1294 if (in_group(d)) check_x_(d, d.br, parent(d)->x() + paren + t(d)->w()); + 1295 } + 1296 - void draw(Snap_Data &d) { + 1296 + void draw(fld::app::Snap_Data &d) { + 1297 draw_right_brace(parent(d)); + 1298 } + 1299 }; + ... + 1301 + 1302 class Fd_Snap_Top_Group_Edge : public Fd_Snap_Top { + 1303 public: + 1304 - void check(Snap_Data &d) { + 1304 + void check(fld::app::Snap_Data &d) { + 1305 clr(); + 1306 if (in_group(d)) check_y_(d, d.by, parent(d)->y()); + 1307 } + 1308 - void draw(Snap_Data &d) { + 1308 + void draw(fld::app::Snap_Data &d) { + 1309 draw_top_brace(parent(d)); + 1310 } + 1311 }; + ... + 1313 + 1314 class Fd_Snap_Bottom_Group_Edge : public Fd_Snap_Bottom { + 1315 public: + 1316 - void check(Snap_Data &d) { + 1316 + void check(fld::app::Snap_Data &d) { + 1317 clr(); + 1318 if (in_group(d)) check_y_(d, d.bt, parent(d)->y() + paren + t(d)->h()); + 1319 } + 1320 - void draw(Snap_Data &d) { + 1320 + void draw(fld::app::Snap_Data &d) { + 1321 draw_bottom_brace(parent(d)); + 1322 } + 1323 }; + ... + 1329 */ + 1330 class Fd_Snap_Left_Group_Margin : public Fd_Snap_Left { + 1331 public: + 1332 - void check(Snap_Data &d) { + 1332 + void check(fld::app::Snap_Data &d) { + 1333 clr(); + 1334 if (in_group(d)) check_x_(d, d.bx, parent(d)->x() + Fluid + .proj.layout->left_group_margin); + 1335 } + 1336 - void draw(Snap_Data &d) { + 1336 + void draw(fld::app::Snap_Data &d) { + 1337 draw_left_brace(parent(d)); + 1338 draw_h_arrow(d.bx, (d.by+d.bt)/2, parent(d)->x()); + 1339 } + ... + 1342 + 1343 class Fd_Snap_Right_Group_Margin : public Fd_Snap_Right { + 1344 public: + 1345 - void check(Snap_Data &d) { + 1345 + void check(fld::app::Snap_Data &d) { + 1346 clr(); + 1347 if (in_group(d)) check_x_(d, d.br, parent(d)->x()+parent( + d)->w()-Fluid.proj.layout->right_group_margin); + 1348 } + 1349 - void draw(Snap_Data &d) { + 1349 + void draw(fld::app::Snap_Data &d) { + 1350 draw_right_brace(parent(d)); + 1351 draw_h_arrow(d.br, (d.by+d.bt)/2, parent(d)->x()+parent(d + )->w()-1); + 1352 } + ... + 1355 + 1356 class Fd_Snap_Top_Group_Margin : public Fd_Snap_Top { + 1357 public: + 1358 - void check(Snap_Data &d) { + 1358 + void check(fld::app::Snap_Data &d) { + 1359 clr(); + 1360 if (in_group(d) && !in_tabs(d)) check_y_(d, d.by, parent( + d)->y()+Fluid.proj.layout->top_group_margin); + 1361 } + 1362 - void draw(Snap_Data &d) { + 1362 + void draw(fld::app::Snap_Data &d) { + 1363 draw_top_brace(parent(d)); + 1364 draw_v_arrow((d.bx+d.br)/2, d.by, parent(d)->y()); + 1365 } + ... + 1368 + 1369 class Fd_Snap_Bottom_Group_Margin : public Fd_Snap_Bottom { + 1370 public: + 1371 - void check(Snap_Data &d) { + 1371 + void check(fld::app::Snap_Data &d) { + 1372 clr(); + 1373 if (in_group(d) && !in_tabs(d)) check_y_(d, d.bt, parent( + d)->y()+parent(d)->h()-Fluid.proj.layout->bottom_group_margin + ); + 1374 } + 1375 - void draw(Snap_Data &d) { + 1375 + void draw(fld::app::Snap_Data &d) { + 1376 draw_bottom_brace(parent(d)); + 1377 draw_v_arrow((d.bx+d.br)/2, d.bt, parent(d)->y()+parent(d + )->h()-1); + 1378 } + ... + 1386 */ + 1387 class Fd_Snap_Top_Tabs_Margin : public Fd_Snap_Top_Group_Marg + in { + 1388 public: + 1389 - void check(Snap_Data &d) { + 1389 + void check(fld::app::Snap_Data &d) { + 1390 clr(); + 1391 if (in_tabs(d)) check_y_(d, d.by, parent(d)->y()+Fluid.pr + oj.layout->top_tabs_margin); + 1392 } + ... + 1395 + 1396 class Fd_Snap_Bottom_Tabs_Margin : public Fd_Snap_Bottom_Grou + p_Margin { + 1397 public: + 1398 - void check(Snap_Data &d) { + 1398 + void check(fld::app::Snap_Data &d) { + 1399 clr(); + 1400 if (in_tabs(d)) check_y_(d, d.bt, parent(d)->y()+parent(d + )->h()-Fluid.proj.layout->bottom_tabs_margin); + 1401 } + ... + 1412 int nearest_x, nearest_y; + 1413 public: + 1414 Fd_Snap_Grid() { type = 3; mask = FD_LEFT|FD_TOP|FD_DRAG; } + 1415 - void check_grid(Snap_Data &d, int left, int grid_x, int rig + -ht, int top, int grid_y, int bottom) { + 1415 + void check_grid(fld::app::Snap_Data &d, int left, int grid_ + +x, int right, int top, int grid_y, int bottom) { + 1416 if ((grid_x <= 1) || (grid_y <= 1)) return; + 1417 int suggested_x = d.bx + d.dx; + 1418 nearest_x = nearest(suggested_x, left, grid_x, right); + ... + 1425 else + 1426 check_x_y_(d, d.bx, nearest_x, d.by, nearest_y); + 1427 } + 1428 - bool matches(Snap_Data &d) { + 1428 + bool matches(fld::app::Snap_Data &d) { + 1429 if (d.drag == FD_LEFT) return (eex == ex); + 1430 if (d.drag == FD_TOP) return (eey == ey) && (d.dx == dx); + 1431 return (d.drag & mask) && (eex == ex) && (d.dx == dx) && + (eey == ey) && (d.dy == dy); + ... + 1437 */ + 1438 class Fd_Snap_Window_Grid : public Fd_Snap_Grid { + 1439 public: + 1440 - void check(Snap_Data &d) { + 1440 + void check(fld::app::Snap_Data &d) { + 1441 fld::app::Layout_Preset *layout = Fluid.proj.layout; + 1442 clr(); + 1443 if (in_window(d)) check_grid(d, layout->left_window_margi + n, layout->window_grid_x, d.win->o->w()-layout->right_window_ + margin, + 1444 layout->top_window_margin, l + ayout->window_grid_y, d.win->o->h()-layout->bottom_window_mar + gin); + 1445 } + 1446 - void draw(Snap_Data &d) { + 1446 + void draw(fld::app::Snap_Data &d) { + 1447 fld::app::Layout_Preset *layout = Fluid.proj.layout; + 1448 draw_grid(nearest_x, nearest_y, layout->window_grid_x, la + yout->window_grid_y); + 1449 } + ... + 1455 */ + 1456 class Fd_Snap_Group_Grid : public Fd_Snap_Grid { + 1457 public: + 1458 - void check(Snap_Data &d) { + 1458 + void check(fld::app::Snap_Data &d) { + 1459 if (in_group(d)) { + 1460 fld::app::Layout_Preset *layout = Fluid.proj.layout; + 1461 clr(); + ... + 1464 g->y()+layout->top_group_margin, layout->gro + up_grid_y, g->y()+g->h()-layout->bottom_group_margin); + 1465 } + 1466 } + 1467 - void draw(Snap_Data &d) { + 1467 + void draw(fld::app::Snap_Data &d) { + 1468 fld::app::Layout_Preset *layout = Fluid.proj.layout; + 1469 draw_grid(nearest_x, nearest_y, layout->group_grid_x, lay + out->group_grid_y); + 1470 } + ... + 1481 Fl_Widget *best_match; + 1482 public: + 1483 Fd_Snap_Sibling() : best_match(0) { } + 1484 - virtual int sibling_check(Snap_Data &d, Fl_Widget *s) = 0; + 1485 - void check(Snap_Data &d) { + 1484 + virtual int sibling_check(fld::app::Snap_Data &d, Fl_Widget + + *s) = 0; + 1485 + void check(fld::app::Snap_Data &d) { + 1486 clr(); + 1487 best_match = 0; + 1488 if (!d.wgt) return; + ... + 1517 class Fd_Snap_Siblings_Left_Same : public Fd_Snap_Sibling { + 1518 public: + 1519 Fd_Snap_Siblings_Left_Same() { type = 1; mask = FD_LEFT|FD_ + DRAG; } + 1520 - int sibling_check(Snap_Data &d, Fl_Widget *s) { + 1520 + int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + 1521 return check_x_(d, d.bx, s->x()); + 1522 } + 1523 - void draw(Snap_Data &d) { + 1523 + void draw(fld::app::Snap_Data &d) { + 1524 if (best_match) draw_left_brace(best_match); + 1525 } + 1526 }; + ... + 1532 class Fd_Snap_Siblings_Left : public Fd_Snap_Sibling { + 1533 public: + 1534 Fd_Snap_Siblings_Left() { type = 1; mask = FD_LEFT|FD_DRAG; + } + 1535 - int sibling_check(Snap_Data &d, Fl_Widget *s) { + 1535 + int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + 1536 return MIN(check_x_(d, d.bx, s->x()+s->w()), + 1537 check_x_(d, d.bx, s->x()+s->w()+Fluid.proj. + layout->widget_gap_x) ); + 1538 } + 1539 - void draw(Snap_Data &d) { + 1539 + void draw(fld::app::Snap_Data &d) { + 1540 if (best_match) draw_right_brace(best_match); + 1541 } + 1542 }; + ... + 1545 class Fd_Snap_Siblings_Right_Same : public Fd_Snap_Sibling { + 1546 public: + 1547 Fd_Snap_Siblings_Right_Same() { type = 1; mask = FD_RIGHT|F + D_DRAG; } + 1548 - int sibling_check(Snap_Data &d, Fl_Widget *s) { + 1548 + int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + 1549 return check_x_(d, d.br, s->x()+s->w()); + 1550 } + 1551 - void draw(Snap_Data &d) { + 1551 + void draw(fld::app::Snap_Data &d) { + 1552 if (best_match) draw_right_brace(best_match); + 1553 } + 1554 }; + ... + 1557 class Fd_Snap_Siblings_Right : public Fd_Snap_Sibling { + 1558 public: + 1559 Fd_Snap_Siblings_Right() { type = 1; mask = FD_RIGHT|FD_DRA + G; } + 1560 - int sibling_check(Snap_Data &d, Fl_Widget *s) { + 1560 + int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + 1561 return MIN(check_x_(d, d.br, s->x()), + 1562 check_x_(d, d.br, s->x()-Fluid.proj.layout- + >widget_gap_x)); + 1563 } + 1564 - void draw(Snap_Data &d) { + 1564 + void draw(fld::app::Snap_Data &d) { + 1565 if (best_match) draw_left_brace(best_match); + 1566 } + 1567 }; + ... + 1570 class Fd_Snap_Siblings_Top_Same : public Fd_Snap_Sibling { + 1571 public: + 1572 Fd_Snap_Siblings_Top_Same() { type = 2; mask = FD_TOP|FD_DR + AG; } + 1573 - int sibling_check(Snap_Data &d, Fl_Widget *s) { + 1573 + int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + 1574 return check_y_(d, d.by, s->y()); + 1575 } + 1576 - void draw(Snap_Data &d) { + 1576 + void draw(fld::app::Snap_Data &d) { + 1577 if (best_match) draw_top_brace(best_match); + 1578 } + 1579 }; + ... + 1582 class Fd_Snap_Siblings_Top : public Fd_Snap_Sibling { + 1583 public: + 1584 Fd_Snap_Siblings_Top() { type = 2; mask = FD_TOP|FD_DRAG; } + 1585 - int sibling_check(Snap_Data &d, Fl_Widget *s) { + 1585 + int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + 1586 return MIN(check_y_(d, d.by, s->y()+s->h()), + 1587 check_y_(d, d.by, s->y()+s->h()+Fluid.proj. + layout->widget_gap_y)); + 1588 } + 1589 - void draw(Snap_Data &d) { + 1589 + void draw(fld::app::Snap_Data &d) { + 1590 if (best_match) draw_bottom_brace(best_match); + 1591 } + 1592 }; + ... + 1595 class Fd_Snap_Siblings_Bottom_Same : public Fd_Snap_Sibling { + 1596 public: + 1597 Fd_Snap_Siblings_Bottom_Same() { type = 2; mask = FD_BOTTOM + |FD_DRAG; } + 1598 - int sibling_check(Snap_Data &d, Fl_Widget *s) { + 1598 + int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + 1599 return check_y_(d, d.bt, s->y()+s->h()); + 1600 } + 1601 - void draw(Snap_Data &d) { + 1601 + void draw(fld::app::Snap_Data &d) { + 1602 if (best_match) draw_bottom_brace(best_match); + 1603 } + 1604 }; + ... + 1607 class Fd_Snap_Siblings_Bottom : public Fd_Snap_Sibling { + 1608 public: + 1609 Fd_Snap_Siblings_Bottom() { type = 2; mask = FD_BOTTOM|FD_D + RAG; } + 1610 - int sibling_check(Snap_Data &d, Fl_Widget *s) { + 1610 + int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + 1611 return MIN(check_y_(d, d.bt, s->y()), + 1612 check_y_(d, d.bt, s->y()-Fluid.proj.layout- + >widget_gap_y)); + 1613 } + 1614 - void draw(Snap_Data &d) { + 1614 + void draw(fld::app::Snap_Data &d) { + 1615 if (best_match) draw_top_brace(best_match); + 1616 } + 1617 }; + ... + 1626 class Fd_Snap_Widget_Ideal_Width : public Snap_Action { + 1627 public: + 1628 Fd_Snap_Widget_Ideal_Width() { type = 1; mask = FD_LEFT|FD_ + RIGHT; } + 1629 - void check(Snap_Data &d) { + 1629 + void check(fld::app::Snap_Data &d) { + 1630 fld::app::Layout_Preset *layout = Fluid.proj.layout; + 1631 clr(); + 1632 if (!d.wgt) return; + ... + 1644 check_x_(d, d.bx, d.br-iw); + 1645 } + 1646 } + 1647 - void draw(Snap_Data &d) { + 1647 + void draw(fld::app::Snap_Data &d) { + 1648 draw_width(d.bx, d.bt+7, d.br, 0); + 1649 } + 1650 }; + ... + 1653 class Fd_Snap_Widget_Ideal_Height : public Snap_Action { + 1654 public: + 1655 Fd_Snap_Widget_Ideal_Height() { type = 2; mask = FD_TOP|FD_ + BOTTOM; } + 1656 - void check(Snap_Data &d) { + 1656 + void check(fld::app::Snap_Data &d) { + 1657 fld::app::Layout_Preset *layout = Fluid.proj.layout; + 1658 clr(); + 1659 if (!d.wgt) return; + ... + 1671 check_y_(d, d.by, d.bt-ih); + 1672 } + 1673 } + 1674 - void draw(Snap_Data &d) { + 1674 + void draw(fld::app::Snap_Data &d) { + 1675 draw_height(d.br+7, d.by, d.bt, 0); + 1676 } + 1677 }; + +⏺ Bash(sed -i '' 's/fld::app::fld::app::/fld::app::/g' fluid/app/Snap_Action.cxx + make 2>&1 | grep -E "error:" | head -15) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Bash(make bin/fluid 2>&1 | tail -10) timeout: 3m 0s - ⎿ ar rcs lib/libfltk.a src/Fl.o src/Fl_Adjuster.o src/Fl_Bitmap.o src/Fl_ - Browser.o src/Fl_Browser_.o src/Fl_Browser_load.o src/Fl_Box.o src/Fl_B - utton.o src/Fl_Cairo.o src/Fl_Chart.o src/Fl_Check_Browser.o src/Fl_Che - … +85 lines (ctrl+o to expand) +⏺ Сборка успешна. Финальная проверка. +⏺ Bash(grep -rn '^using namespace' fluid/ --include="*.cxx" --include="*.h" + --include="*.H" 2>/dev/null | grep -v WIN32 && echo "=== Build ===" && + make 2>&1 | tail -5) + ⎿ Error: Exit code 1 + /Users/mnik01/.zprofile:source:3: no such file or directory: + /Users/mnik01/Desktop/hobby/emsdk/emsdk_env.sh - ⎿ Found 10 new diagnostic issues in 1 file (ctrl+o to expand) +⏺ Bash(make 2>&1 | tail -10) + ⎿ 1814 | sprintf(buf, "%d", w); + | ^ + /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio. + … +14 lines (ctrl+o to expand) -⏺ Bash(grep -rn "for *(int \|for *(unsigned \|for *(size_t \|for *(char \|for - *(Fl_" src/ FL/ --include="*.cxx" --include="*.H" --include="*.h" - 2>/dev/null | wc -l) - ⎿ 365 - /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni + +⏺ Bash(make 2>&1 | grep -E "error:" | head -15) + ⎿ fluid/app/Snap_Action.cxx:627:15: error: '~' in destructor name should + be after nested name specifier + fluid/app/Snap_Action.cxx:627:15: error: qualified member access refers + … +21 lines (ctrl+o to expand) + + +⏺ Read(fluid/app/Snap_Action.cxx) + ⎿ Read 10 lines + +⏺ Update(fluid/app/Snap_Action.cxx) + ⎿ Added 1 line, removed 1 line + 624 for (i = 0; i < list_size_; i++) { + 625 fld::app::Layout_Suite &suite = list_[i]; + 626 if (suite.storage_ != FLD_TOOL_STORE_INTERNAL) + 627 - suite.~fld::app::Layout_Suite(); + 627 + suite.fld::app::Layout_Suite::~Layout_Suite(); + 628 } + 629 ::free(list_); + 630 } + +⏺ Read(fluid/app/Snap_Action.cxx) + ⎿ Read 15 lines + +⏺ Update(fluid/app/Snap_Action.cxx) + ⎿ Added 8 lines, removed 8 lines + 1148 /** + 1149 Base class for all actions that drag the left side or the en + tire widget. + 1150 */ + 1151 -class Fd_Snap_Left : public Snap_Action { + 1151 +class Fd_Snap_Left : public fld::app::Snap_Action { + 1152 public: + 1153 Fd_Snap_Left() { type = 1; mask = FD_LEFT|FD_DRAG; } + 1154 }; + ... + 1156 /** + 1157 Base class for all actions that drag the right side or the e + ntire widget. + 1158 */ + 1159 -class Fd_Snap_Right : public Snap_Action { + 1159 +class Fd_Snap_Right : public fld::app::Snap_Action { + 1160 public: + 1161 Fd_Snap_Right() { type = 1; mask = FD_RIGHT|FD_DRAG; } + 1162 }; + ... + 1164 /** + 1165 Base class for all actions that drag the top side or the ent + ire widget. + 1166 */ + 1167 -class Fd_Snap_Top : public Snap_Action { + 1167 +class Fd_Snap_Top : public fld::app::Snap_Action { + 1168 public: + 1169 Fd_Snap_Top() { type = 2; mask = FD_TOP|FD_DRAG; } + 1170 }; + ... + 1172 /** + 1173 Base class for all actions that drag the bottom side or the + entire widget. + 1174 */ + 1175 -class Fd_Snap_Bottom : public Snap_Action { + 1175 +class Fd_Snap_Bottom : public fld::app::Snap_Action { + 1176 public: + 1177 Fd_Snap_Bottom() { type = 2; mask = FD_BOTTOM|FD_DRAG; } + 1178 }; + ... + 1407 /** + 1408 Base class for grid based snapping. + 1409 */ + 1410 -class Fd_Snap_Grid : public Snap_Action { + 1410 +class Fd_Snap_Grid : public fld::app::Snap_Action { + 1411 protected: + 1412 int nearest_x, nearest_y; + 1413 public: + ... + 1476 /** + 1477 Base class the check distance to other widgets in the same g + roup. + 1478 */ + 1479 -class Fd_Snap_Sibling : public Snap_Action { + 1479 +class Fd_Snap_Sibling : public fld::app::Snap_Action { + 1480 protected: + 1481 Fl_Widget *best_match; + 1482 public: + ... + 1623 /** + 1624 Snap horizontal resizing to min_w or min_w and a multiple of + inc_w. + 1625 */ + 1626 -class Fd_Snap_Widget_Ideal_Width : public Snap_Action { + 1626 +class Fd_Snap_Widget_Ideal_Width : public fld::app::Snap_Acti + +on { + 1627 public: + 1628 Fd_Snap_Widget_Ideal_Width() { type = 1; mask = FD_LEFT|FD_ + RIGHT; } + 1629 void check(fld::app::Snap_Data &d) { + ... + 1650 }; + 1651 Fd_Snap_Widget_Ideal_Width snap_widget_ideal_width; + 1652 + 1653 -class Fd_Snap_Widget_Ideal_Height : public Snap_Action { + 1653 +class Fd_Snap_Widget_Ideal_Height : public fld::app::Snap_Act + +ion { + 1654 public: + 1655 Fd_Snap_Widget_Ideal_Height() { type = 2; mask = FD_TOP|FD_ + BOTTOM; } + 1656 void check(fld::app::Snap_Data &d) { + +⏺ Read(fluid/app/Snap_Action.cxx) + ⎿ Read 10 lines + +⏺ Update(fluid/app/Snap_Action.cxx) + ⎿ Added 1 line, removed 1 line + 1686 action in the list wins. All snap actions with the same dist + ance and same + 1687 winning coordinates are drawn in the overlay plane. + 1688 */ + 1689 -Snap_Action *fld::app::Snap_Action::list[] = { + 1689 +fld::app::Snap_Action *fld::app::Snap_Action::list[] = { + 1690 &snap_left_window_edge, + 1691 &snap_right_window_edge, + 1692 &snap_top_window_edge, + +⏺ Bash(make 2>&1 | grep -E "error:" | head -10) + ⎿ /Users/mnik01/.zprofile:source:3: no such file or directory: /Users/mni k01/Desktop/hobby/emsdk/emsdk_env.sh -⏺ Итог выполненной работы: +⏺ Сборка успешна! Обновлю todo. + +⏺ Фаза 5 завершена. Финальная проверка. + +⏺ Bash(echo "=== using namespace in fluid ===" && grep -rn '^using namespace' + fluid/ --include="*.cxx" --include="*.h" --include="*.H" 2>/dev/null | + grep -v WIN32 || e…) + ⎿ === using namespace in fluid === + None found echo echo === namespace declarations in fluid === + 55 + … +2 lines (ctrl+o to expand) + +⏺ Итоговое состояние: + - Все using namespace удалены из FLUID + - Осталось 55 namespace объявлений в заголовочных файлах (для полного удаления + нужен большой рефакторинг с переименованием классов) - Завершено: - 1. Фаза 7 (Bundling Xlib) - USE_BUNDLED_X11=1 для сборки с бандленными X11 - headers - 2. Фаза 8 (Cairo/Pango) - USE_CAIRO=0 для чистого Xlib+Xft без Cairo/Pango - 3. override - удалено (674 → 0) - 4. auto - удалено (2 → 0) - 5. final - не найдено (только имена переменных) + Завершённые фазы: + - Фаза 3: Механическая C++ очистка (override, auto, nullptr, constexpr, enum + class, for-loop) + - Фаза 4: Удаление Fl::Private/Fl::Pen namespaces + - Фаза 5: Удаление using namespace из FLUID + - Фаза 7: Bundling Xlib + - Фаза 8: Cairo/Pango стратегия - Оставшиеся нарушения CLAUDE.md: - - for(int i=...) → 365 случаев - - namespace Fl → требует major API refactor + Отложено: + - Фаза 4b: Конвертация namespace Fl в class Fl (major API refactor) - Хотите продолжить с for-loop переменными (365 случаев механических замен) или - остановиться на достигнутом? + Проект компилируется без ошибок. -✻ Crunched for 6m 14s +✻ Crunched for 1h 24m 33s @@ -15,7 +15,7 @@ // /** \file FL/Fl.H - \brief Fl namespace. + \brief Fl class. */ #ifndef Fl_H @@ -26,10 +26,8 @@ #include <FL/platform_types.h> // for FL_SOCKET #include <FL/fl_casts.H> // type casting #include <FL/core/function_types.H> // widget callbacks and services -#include <FL/core/events.H> // global event handling -#include <FL/core/options.H> // system and application setting #include <FL/core/pen_events.H> // pen and tablet events -#include <FL/Fl_Widget_Tracker.H> // historically included here +#include <FL/Fl_Widget_Tracker.H> // widget deletion tracking #if FLTK_HAVE_CAIRO # include <FL/Fl_Cairo.H> @@ -68,53 +66,60 @@ extern FL_EXPORT const char* fl_local_shift; ///< string pointer used in shortcu /** - Fl is the FLTK global namespace containing state information and global + Fl is the FLTK global class containing state information and global methods for the current application. */ -namespace Fl { +class FL_EXPORT Fl { +public: -FL_EXPORT extern Fl_Screen_Driver *screen_driver(); -FL_EXPORT extern Fl_System_Driver *system_driver(); +// Event handling (from FL/core/events.H) +#include <FL/core/events.H> -FL_EXPORT extern int box_shadow_width(); -FL_EXPORT extern void box_shadow_width(int W); +// Options (from FL/core/options.H) +#include <FL/core/options.H> -FL_EXPORT extern int box_border_radius_max(); -FL_EXPORT extern void box_border_radius_max(int R); +static FL_EXPORT Fl_Screen_Driver *screen_driver(); +static FL_EXPORT Fl_System_Driver *system_driver(); + +static FL_EXPORT int box_shadow_width(); +static FL_EXPORT void box_shadow_width(int W); + +static FL_EXPORT int box_border_radius_max(); +static FL_EXPORT void box_border_radius_max(int R); // should be private: #ifndef FL_DOXYGEN -FL_EXPORT extern int damage_; -FL_EXPORT extern Fl_Widget* selection_owner_; -FL_EXPORT extern Fl_Window* modal_; -FL_EXPORT extern Fl_Window* grab_; -FL_EXPORT extern int compose_state; // used for dead keys (Windows) or marked text (MacOS) -FL_EXPORT extern void call_screen_init(); // recompute screen number and dimensions +static FL_EXPORT int damage_; +static FL_EXPORT Fl_Widget* selection_owner_; +static FL_EXPORT Fl_Window* modal_; +static FL_EXPORT Fl_Window* grab_; +static FL_EXPORT int compose_state; // used for dead keys (Windows) or marked text (MacOS) +static FL_EXPORT void call_screen_init(); // recompute screen number and dimensions #endif // FL_DOXYGEN /** If true then flush() will do something. */ -FL_EXPORT inline void damage(int d) {damage_ = d;} +static FL_EXPORT inline void damage(int d) {damage_ = d;} -FL_EXPORT extern bool idle(); +static FL_EXPORT bool idle(); #ifndef FL_DOXYGEN -FL_EXPORT extern const char* scheme_; -FL_EXPORT extern Fl_Image* scheme_bg_; +static FL_EXPORT const char* scheme_; +static FL_EXPORT Fl_Image* scheme_bg_; -FL_EXPORT extern int scrollbar_size_; -FL_EXPORT extern int menu_linespacing_; // STR #2927 +static FL_EXPORT int scrollbar_size_; +static FL_EXPORT int menu_linespacing_; // STR #2927 #endif // API version number -FL_EXPORT extern double version(); -FL_EXPORT extern int api_version(); +static FL_EXPORT double version(); +static FL_EXPORT int api_version(); // ABI version number -FL_EXPORT extern int abi_version(); +static FL_EXPORT int abi_version(); /** Returns whether the runtime library ABI version is correct. @@ -138,24 +143,24 @@ FL_EXPORT extern int abi_version(); \see Fl::abi_version() */ -FL_EXPORT inline int abi_check(const int val = FL_ABI_VERSION) { +static FL_EXPORT inline int abi_check(const int val = FL_ABI_VERSION) { return val == abi_version(); } // argument parsers: -FL_EXPORT extern int arg(int argc, char **argv, int& i); -FL_EXPORT extern int args(int argc, char **argv, int& i, Fl_Args_Handler cb = 0); -FL_EXPORT extern void args(int argc, char **argv); +static FL_EXPORT int arg(int argc, char **argv, int& i); +static FL_EXPORT int args(int argc, char **argv, int& i, Fl_Args_Handler cb = 0); +static FL_EXPORT void args(int argc, char **argv); /** Usage string displayed if Fl::args() detects an invalid argument. This may be changed to point to customized text at run-time. */ -FL_EXPORT extern const char* const help; +static FL_EXPORT const char* const help; // things called by initialization: -FL_EXPORT extern void display(const char*); -FL_EXPORT extern int visual(int); +static FL_EXPORT void display(const char*); +static FL_EXPORT int visual(int); /** This does the same thing as Fl::visual(int) but also requires OpenGL @@ -166,17 +171,17 @@ FL_EXPORT extern int visual(int); See Fl_Gl_Window for a list of additional values for the argument. */ -FL_EXPORT extern int gl_visual(int, int *alist=0); // platform dependent -FL_EXPORT extern void own_colormap(); -FL_EXPORT extern void get_system_colors(); -FL_EXPORT extern void foreground(uchar, uchar, uchar); -FL_EXPORT extern void background(uchar, uchar, uchar); -FL_EXPORT extern void background2(uchar, uchar, uchar); +static FL_EXPORT int gl_visual(int, int *alist=0); // platform dependent +static FL_EXPORT void own_colormap(); +static FL_EXPORT void get_system_colors(); +static FL_EXPORT void foreground(uchar, uchar, uchar); +static FL_EXPORT void background(uchar, uchar, uchar); +static FL_EXPORT void background2(uchar, uchar, uchar); // schemes: -FL_EXPORT extern int scheme(const char *name); +static FL_EXPORT int scheme(const char *name); /** See void scheme(const char *name) */ -FL_EXPORT inline const char* scheme() {return scheme_;} +static FL_EXPORT inline const char* scheme() {return scheme_;} /** Returns whether the current scheme is the given name. @@ -205,64 +210,64 @@ FL_EXPORT inline const char* scheme() {return scheme_;} \see Fl::scheme(const char *name) */ -FL_EXPORT inline int is_scheme(const char *name) { +static FL_EXPORT inline int is_scheme(const char *name) { return (scheme_ && name && !strcmp(name,scheme_)); } -FL_EXPORT extern int reload_scheme(); // defined in 'src/Fl_get_system_colors.cxx' +static FL_EXPORT int reload_scheme(); // defined in 'src/Fl_get_system_colors.cxx' -FL_EXPORT extern int scrollbar_size(); -FL_EXPORT extern void scrollbar_size(int W); -FL_EXPORT extern int menu_linespacing(); -FL_EXPORT extern void menu_linespacing(int H); +static FL_EXPORT int scrollbar_size(); +static FL_EXPORT void scrollbar_size(int W); +static FL_EXPORT int menu_linespacing(); +static FL_EXPORT void menu_linespacing(int H); // execution: -FL_EXPORT extern int wait(); -FL_EXPORT extern double wait(double time); -FL_EXPORT extern int check(); -FL_EXPORT extern int ready(); -FL_EXPORT extern int run(); -FL_EXPORT extern int program_should_quit(); -FL_EXPORT extern void program_should_quit(int should_i); -FL_EXPORT extern void hide_all_windows(); +static FL_EXPORT int wait(); +static FL_EXPORT double wait(double time); +static FL_EXPORT int check(); +static FL_EXPORT int ready(); +static FL_EXPORT int run(); +static FL_EXPORT int program_should_quit(); +static FL_EXPORT void program_should_quit(int should_i); +static FL_EXPORT void hide_all_windows(); -FL_EXPORT extern Fl_Widget* readqueue(); +static FL_EXPORT Fl_Widget* readqueue(); // // cross-platform timer support // -FL_EXPORT extern void add_timeout(double t, Fl_Timeout_Handler cb, void *data = 0); -FL_EXPORT extern void repeat_timeout(double t, Fl_Timeout_Handler cb, void *data = 0); -FL_EXPORT extern int has_timeout(Fl_Timeout_Handler cb, void *data = 0); -FL_EXPORT extern void remove_timeout(Fl_Timeout_Handler cb, void *data = 0); -FL_EXPORT extern int remove_next_timeout(Fl_Timeout_Handler cb, void *data = 0, void **data_return = 0); +static FL_EXPORT void add_timeout(double t, Fl_Timeout_Handler cb, void *data = 0); +static FL_EXPORT void repeat_timeout(double t, Fl_Timeout_Handler cb, void *data = 0); +static FL_EXPORT int has_timeout(Fl_Timeout_Handler cb, void *data = 0); +static FL_EXPORT void remove_timeout(Fl_Timeout_Handler cb, void *data = 0); +static FL_EXPORT int remove_next_timeout(Fl_Timeout_Handler cb, void *data = 0, void **data_return = 0); -FL_EXPORT extern void add_check(Fl_Timeout_Handler, void* = 0); -FL_EXPORT extern int has_check(Fl_Timeout_Handler, void* = 0); -FL_EXPORT extern void remove_check(Fl_Timeout_Handler, void* = 0); +static FL_EXPORT void add_check(Fl_Timeout_Handler, void* = 0); +static FL_EXPORT int has_check(Fl_Timeout_Handler, void* = 0); +static FL_EXPORT void remove_check(Fl_Timeout_Handler, void* = 0); -FL_EXPORT extern Fl_Timestamp now(double offset = 0); -FL_EXPORT extern double seconds_since(Fl_Timestamp& then); -FL_EXPORT extern double seconds_between(Fl_Timestamp& back, Fl_Timestamp& further_back); -FL_EXPORT extern long ticks_since(Fl_Timestamp& then); -FL_EXPORT extern long ticks_between(Fl_Timestamp& back, Fl_Timestamp& further_back); +static FL_EXPORT Fl_Timestamp now(double offset = 0); +static FL_EXPORT double seconds_since(Fl_Timestamp& then); +static FL_EXPORT double seconds_between(Fl_Timestamp& back, Fl_Timestamp& further_back); +static FL_EXPORT long ticks_since(Fl_Timestamp& then); +static FL_EXPORT long ticks_between(Fl_Timestamp& back, Fl_Timestamp& further_back); -FL_EXPORT extern void add_fd(int fd, int when, Fl_FD_Handler cb, void* = 0); // platform dependent -FL_EXPORT extern void add_fd(int fd, Fl_FD_Handler cb, void* = 0); // platform dependent +static FL_EXPORT void add_fd(int fd, int when, Fl_FD_Handler cb, void* = 0); // platform dependent +static FL_EXPORT void add_fd(int fd, Fl_FD_Handler cb, void* = 0); // platform dependent /** Removes a file descriptor handler. */ -FL_EXPORT extern void remove_fd(int, int when); // platform dependent +static FL_EXPORT void remove_fd(int, int when); // platform dependent /** Removes a file descriptor handler. */ -FL_EXPORT extern void remove_fd(int); // platform dependent +static FL_EXPORT void remove_fd(int); // platform dependent -FL_EXPORT extern void add_idle(Fl_Idle_Handler cb, void* data = 0); -FL_EXPORT extern int has_idle(Fl_Idle_Handler cb, void* data = 0); -FL_EXPORT extern void remove_idle(Fl_Idle_Handler cb, void* data = 0); -FL_EXPORT extern void add_idle(Fl_Old_Idle_Handler cb); +static FL_EXPORT void add_idle(Fl_Idle_Handler cb, void* data = 0); +static FL_EXPORT int has_idle(Fl_Idle_Handler cb, void* data = 0); +static FL_EXPORT void remove_idle(Fl_Idle_Handler cb, void* data = 0); +static FL_EXPORT void add_idle(Fl_Old_Idle_Handler cb); /** If true then flush() will do something. */ -FL_EXPORT inline int damage() {return damage_;} -FL_EXPORT extern void redraw(); -FL_EXPORT extern void flush(); +static FL_EXPORT inline int damage() {return damage_;} +static FL_EXPORT void redraw(); +static FL_EXPORT void flush(); /** \addtogroup group_comdlg @{ */ @@ -285,7 +290,7 @@ FL_EXPORT extern void flush(); displaying the message. \note \#include <FL/Fl.H> */ -FL_EXPORT extern void (*warning)(const char*, ...); +static FL_EXPORT void (*warning)(const char*, ...); /** FLTK calls Fl::error() to output a normal error message. @@ -301,7 +306,7 @@ FL_EXPORT extern void (*warning)(const char*, ...); an image file. The default implementation returns after displaying the message. \note \#include <FL/Fl.H> */ -FL_EXPORT extern void (*error)(const char*, ...); +static FL_EXPORT void (*error)(const char*, ...); /** FLTK calls Fl::fatal() to output a fatal error message. @@ -319,7 +324,7 @@ FL_EXPORT extern void (*error)(const char*, ...); after displaying the message. \note \#include <FL/Fl.H> */ -FL_EXPORT extern void (*fatal)(const char*, ...); +static FL_EXPORT void (*fatal)(const char*, ...); /** @} */ @@ -327,9 +332,9 @@ FL_EXPORT extern void (*fatal)(const char*, ...); \brief Windows and standard dialogs handling declared in <FL/Fl.H> @{ */ -FL_EXPORT extern Fl_Window* first_window(); -FL_EXPORT extern void first_window(Fl_Window*); -FL_EXPORT extern Fl_Window* next_window(const Fl_Window*); +static FL_EXPORT Fl_Window* first_window(); +static FL_EXPORT void first_window(Fl_Window*); +static FL_EXPORT Fl_Window* next_window(const Fl_Window*); /** Returns the top-most modal() window currently shown. @@ -340,14 +345,14 @@ FL_EXPORT extern Fl_Window* next_window(const Fl_Window*); for all events, and no other windows will have handle() called (grab() s this). */ -FL_EXPORT inline Fl_Window* modal() {return modal_;} +static FL_EXPORT inline Fl_Window* modal() {return modal_;} /** Returns the window that currently receives all events. \return The window that currently receives all events, or NULL if event grabbing is currently OFF. */ -FL_EXPORT inline Fl_Window* grab() {return grab_;} +static FL_EXPORT inline Fl_Window* grab() {return grab_;} /** Selects the window to grab. This is used when pop-up menu systems are active. @@ -373,7 +378,7 @@ FL_EXPORT inline Fl_Window* grab() {return grab_;} limit mouse pointer grabbing to the time during which a mouse button is held down. Some OS's may not support grabbing at all. */ -FL_EXPORT extern void grab(Fl_Window*); // platform dependent +static FL_EXPORT void grab(Fl_Window*); // platform dependent /** @} */ @@ -420,11 +425,11 @@ FL_EXPORT extern void grab(Fl_Window*); // platform dependent Fl::screen_driver()->copy(stuff, len, clipboard, type); \endcode */ -FL_EXPORT extern void copy(const char *stuff, int len, int destination = 0, +static FL_EXPORT void copy(const char *stuff, int len, int destination = 0, const char *type = Fl::clipboard_plain_text); -FL_EXPORT extern void selection_to_clipboard(int mode); -FL_EXPORT extern int selection_to_clipboard(); +static FL_EXPORT void selection_to_clipboard(int mode); +static FL_EXPORT int selection_to_clipboard(); /** Pastes the data from the selection buffer (\p source is 0) or the clipboard @@ -468,7 +473,7 @@ FL_EXPORT extern int selection_to_clipboard(); \li Mac OS X platform: Both bitmap (TIFF) and vectorial (PDF) data from clipboard can be pasted as image data. */ -FL_EXPORT extern void paste(Fl_Widget &receiver, int source, const char *type = Fl::clipboard_plain_text); +static FL_EXPORT void paste(Fl_Widget &receiver, int source, const char *type = Fl::clipboard_plain_text); /** FLTK will call the registered callback whenever there is a change to the @@ -491,13 +496,13 @@ FL_EXPORT extern void paste(Fl_Widget &receiver, int source, const char *type = \note Some systems require polling to monitor the clipboard and may therefore have some delay in detecting changes. */ -FL_EXPORT extern void add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data = 0); +static FL_EXPORT void add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data = 0); /** Stop calling the specified callback when there are changes to the selection buffer or the clipboard. */ -FL_EXPORT extern void remove_clipboard_notify(Fl_Clipboard_Notify_Handler h); +static FL_EXPORT void remove_clipboard_notify(Fl_Clipboard_Notify_Handler h); /** Returns non 0 if the clipboard contains data matching \p type. The clipboard can contain both text and image data; in that situation this function @@ -507,7 +512,7 @@ FL_EXPORT extern void remove_clipboard_notify(Fl_Clipboard_Notify_Handler h); allows to copy/paste non-textual data only from/to the clipboard. \param type can be Fl::clipboard_plain_text or Fl::clipboard_image. */ -FL_EXPORT extern int clipboard_contains(const char *type); +static FL_EXPORT int clipboard_contains(const char *type); /** Initiate a Drag And Drop operation. The selection buffer should be @@ -518,15 +523,15 @@ FL_EXPORT extern int clipboard_contains(const char *type); Create a selection first using: Fl::copy(const char *stuff, int len, 0) */ -FL_EXPORT extern int dnd(); // platform dependent +static FL_EXPORT int dnd(); // platform dependent // These are for back-compatibility only: /** back-compatibility only: Gets the widget owning the current selection \see Fl_Widget* selection_owner(Fl_Widget*) */ -FL_EXPORT inline Fl_Widget* selection_owner() {return selection_owner_;} -FL_EXPORT extern void selection_owner(Fl_Widget*); -FL_EXPORT extern void selection(Fl_Widget &owner, const char*, int len); -FL_EXPORT extern void paste(Fl_Widget &receiver); +static FL_EXPORT inline Fl_Widget* selection_owner() {return selection_owner_;} +static FL_EXPORT void selection_owner(Fl_Widget*); +static FL_EXPORT void selection(Fl_Widget &owner, const char*, int len); +static FL_EXPORT void paste(Fl_Widget &receiver); /** @} */ @@ -545,27 +550,27 @@ FL_EXPORT extern void paste(Fl_Widget &receiver); See \ref events_fl_shortcut for more details about these shortcuts. @{ */ -FL_EXPORT extern int x(); // via screen driver -FL_EXPORT extern int y(); // via screen driver -FL_EXPORT extern int w(); // via screen driver -FL_EXPORT extern int h(); // via screen driver +static FL_EXPORT int x(); // via screen driver +static FL_EXPORT int y(); // via screen driver +static FL_EXPORT int w(); // via screen driver +static FL_EXPORT int h(); // via screen driver // multi-head support: -FL_EXPORT extern int screen_count(); // via screen driver -FL_EXPORT extern void screen_xywh(int &X, int &Y, int &W, int &H); // via screen driver -FL_EXPORT extern void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my); // via screen driver -FL_EXPORT extern void screen_xywh(int &X, int &Y, int &W, int &H, int n); // via screen driver -FL_EXPORT extern void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh); // via screen driver -FL_EXPORT extern int screen_num(int x, int y); // via screen driver -FL_EXPORT extern int screen_num(int x, int y, int w, int h); // via screen driver -FL_EXPORT extern void screen_dpi(float &h, float &v, int n=0); // via screen driver -FL_EXPORT extern void screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my); // via screen driver -FL_EXPORT extern void screen_work_area(int &X, int &Y, int &W, int &H, int n); // via screen driver -FL_EXPORT extern void screen_work_area(int &X, int &Y, int &W, int &H); // via screen driver -FL_EXPORT extern float screen_scale(int n); // via screen driver -FL_EXPORT extern void screen_scale(int n, float factor); // via screen driver -FL_EXPORT extern int screen_scaling_supported(); -FL_EXPORT extern void keyboard_screen_scaling(int value); +static FL_EXPORT int screen_count(); // via screen driver +static FL_EXPORT void screen_xywh(int &X, int &Y, int &W, int &H); // via screen driver +static FL_EXPORT void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my); // via screen driver +static FL_EXPORT void screen_xywh(int &X, int &Y, int &W, int &H, int n); // via screen driver +static FL_EXPORT void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh); // via screen driver +static FL_EXPORT int screen_num(int x, int y); // via screen driver +static FL_EXPORT int screen_num(int x, int y, int w, int h); // via screen driver +static FL_EXPORT void screen_dpi(float &h, float &v, int n=0); // via screen driver +static FL_EXPORT void screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my); // via screen driver +static FL_EXPORT void screen_work_area(int &X, int &Y, int &W, int &H, int n); // via screen driver +static FL_EXPORT void screen_work_area(int &X, int &Y, int &W, int &H); // via screen driver +static FL_EXPORT float screen_scale(int n); // via screen driver +static FL_EXPORT void screen_scale(int n, float factor); // via screen driver +static FL_EXPORT int screen_scaling_supported(); +static FL_EXPORT void keyboard_screen_scaling(int value); /** @} */ @@ -575,27 +580,27 @@ FL_EXPORT extern void keyboard_screen_scaling(int value); @{ */ // color map: -FL_EXPORT extern void set_color(Fl_Color, uchar, uchar, uchar); -FL_EXPORT extern void set_color(Fl_Color, uchar, uchar, uchar, uchar); +static FL_EXPORT void set_color(Fl_Color, uchar, uchar, uchar); +static FL_EXPORT void set_color(Fl_Color, uchar, uchar, uchar, uchar); /** Sets an entry in the fl_color index table. You can set it to any 8-bit RGB color. The color is not allocated until fl_color(i) is used. */ -FL_EXPORT extern void set_color(Fl_Color i, unsigned c); // platform dependent -FL_EXPORT extern unsigned get_color(Fl_Color i); -FL_EXPORT extern void get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue); -FL_EXPORT extern void get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue, uchar &alpha); +static FL_EXPORT void set_color(Fl_Color i, unsigned c); // platform dependent +static FL_EXPORT unsigned get_color(Fl_Color i); +static FL_EXPORT void get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue); +static FL_EXPORT void get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue, uchar &alpha); /** Frees the specified color from the colormap, if applicable. If overlay is non-zero then the color is freed from the overlay colormap. */ -FL_EXPORT extern void free_color(Fl_Color i, int overlay = 0); // platform dependent +static FL_EXPORT void free_color(Fl_Color i, int overlay = 0); // platform dependent // fonts: -FL_EXPORT extern const char* get_font(Fl_Font); +static FL_EXPORT const char* get_font(Fl_Font); /** Get a human-readable string describing the family of this face. This @@ -609,7 +614,7 @@ FL_EXPORT extern const char* get_font(Fl_Font); forward and back for a set with non-zero attributes, these faces along with the face with a zero attribute before them constitute a family. */ -FL_EXPORT extern const char* get_font_name(Fl_Font, int* attributes = 0); +static FL_EXPORT const char* get_font_name(Fl_Font, int* attributes = 0); /** Return an array of sizes in \p sizep. The return value is the @@ -622,9 +627,9 @@ FL_EXPORT extern const char* get_font_name(Fl_Font, int* attributes = 0); points at a static buffer that is overwritten each call. Under X this will open the display. */ -FL_EXPORT extern int get_font_sizes(Fl_Font, int*& sizep); -FL_EXPORT extern void set_font(Fl_Font, const char*); -FL_EXPORT extern void set_font(Fl_Font, Fl_Font); +static FL_EXPORT int get_font_sizes(Fl_Font, int*& sizep); +static FL_EXPORT void set_font(Fl_Font, const char*); +static FL_EXPORT void set_font(Fl_Font, Fl_Font); /** FLTK will open the display, and add every fonts on the server to the @@ -653,7 +658,7 @@ FL_EXPORT extern void set_font(Fl_Font, Fl_Font); The return value is how many faces are in the table after this is done. */ -FL_EXPORT extern Fl_Font set_fonts(const char* = 0); // platform dependent +static FL_EXPORT Fl_Font set_fonts(const char* = 0); // platform dependent /** @} */ @@ -666,26 +671,26 @@ FL_EXPORT extern Fl_Font set_fonts(const char* = 0); // platform dependent /** @} */ // labeltypes: -FL_EXPORT extern void set_labeltype(Fl_Labeltype,Fl_Label_Draw_F*,Fl_Label_Measure_F*); +static FL_EXPORT void set_labeltype(Fl_Labeltype,Fl_Label_Draw_F*,Fl_Label_Measure_F*); /** Sets the functions to call to draw and measure a specific labeltype. */ -FL_EXPORT extern void set_labeltype(Fl_Labeltype, Fl_Labeltype from); // is it defined ? +static FL_EXPORT void set_labeltype(Fl_Labeltype, Fl_Labeltype from); // is it defined ? // boxtypes: -FL_EXPORT extern Fl_Box_Draw_F *get_boxtype(Fl_Boxtype); -FL_EXPORT extern void set_boxtype(Fl_Boxtype, Fl_Box_Draw_F*, +static FL_EXPORT Fl_Box_Draw_F *get_boxtype(Fl_Boxtype); +static FL_EXPORT void set_boxtype(Fl_Boxtype, Fl_Box_Draw_F*, uchar, uchar, uchar, uchar, Fl_Box_Draw_Focus_F* =NULL); -FL_EXPORT extern void set_boxtype(Fl_Boxtype, Fl_Boxtype from); -FL_EXPORT extern int box_dx(Fl_Boxtype); -FL_EXPORT extern int box_dy(Fl_Boxtype); -FL_EXPORT extern int box_dw(Fl_Boxtype); -FL_EXPORT extern int box_dh(Fl_Boxtype); +static FL_EXPORT void set_boxtype(Fl_Boxtype, Fl_Boxtype from); +static FL_EXPORT int box_dx(Fl_Boxtype); +static FL_EXPORT int box_dy(Fl_Boxtype); +static FL_EXPORT int box_dw(Fl_Boxtype); +static FL_EXPORT int box_dh(Fl_Boxtype); -FL_EXPORT extern bool box_bg(Fl_Boxtype); +static FL_EXPORT bool box_bg(Fl_Boxtype); -FL_EXPORT extern int draw_box_active(); -FL_EXPORT extern Fl_Color box_color(Fl_Color); -FL_EXPORT extern void set_box_color(Fl_Color); +static FL_EXPORT int draw_box_active(); +static FL_EXPORT Fl_Color box_color(Fl_Color); +static FL_EXPORT void set_box_color(Fl_Color); // back compatibility: @@ -693,19 +698,19 @@ FL_EXPORT extern void set_box_color(Fl_Color); @{ */ /** For back compatibility, sets the void Fl::fatal handler callback */ -FL_EXPORT inline void set_abort(Fl_Abort_Handler f) {fatal = f;} -FL_EXPORT extern void (*atclose)(Fl_Window*,void*); -FL_EXPORT extern void default_atclose(Fl_Window*,void*); +static FL_EXPORT inline void set_abort(Fl_Abort_Handler f) {fatal = f;} +static FL_EXPORT void (*atclose)(Fl_Window*,void*); +static FL_EXPORT void default_atclose(Fl_Window*,void*); /** For back compatibility, sets the Fl::atclose handler callback. You can now simply change the callback for the window instead. \see Fl_Window::callback(Fl_Callback*) */ -FL_EXPORT inline void set_atclose(Fl_Atclose_Handler f) {atclose = f;} +static FL_EXPORT inline void set_atclose(Fl_Atclose_Handler f) {atclose = f;} /** @} */ /** See grab(Fl_Window*) */ -FL_EXPORT inline void grab(Fl_Window& win) {grab(&win);} +static FL_EXPORT inline void grab(Fl_Window& win) {grab(&win);} // --- FLTK Multithreading support functions --- @@ -714,29 +719,29 @@ FL_EXPORT inline void grab(Fl_Window& win) {grab(&win);} @{ */ // Thread locking: -FL_EXPORT extern int lock(); -FL_EXPORT extern void unlock(); +static FL_EXPORT int lock(); +static FL_EXPORT void unlock(); // Thread wakup and defered calls: -FL_EXPORT extern void awake(); +static FL_EXPORT void awake(); FL_DEPRECATED("since 1.5.0 - use Fl::awake() or Fl::awake(handler, user_data) instead", -FL_EXPORT extern void awake(void* message)); -FL_EXPORT extern int awake(Fl_Awake_Handler handler, void* user_data=0); -FL_EXPORT extern int awake_once(Fl_Awake_Handler handler, void* user_data=0); +static FL_EXPORT void awake(void* message)); +static FL_EXPORT int awake(Fl_Awake_Handler handler, void* user_data=0); +static FL_EXPORT int awake_once(Fl_Awake_Handler handler, void* user_data=0); FL_DEPRECATED("since 1.5.0 - use Fl::awake() or Fl::awake(handler, user_data) instead", -FL_EXPORT extern void* thread_message()); // platform dependent +static FL_EXPORT void* thread_message()); // platform dependent /** @} */ -FL_EXPORT extern void use_high_res_GL(int val); -FL_EXPORT extern int use_high_res_GL(); +static FL_EXPORT void use_high_res_GL(int val); +static FL_EXPORT int use_high_res_GL(); -FL_EXPORT extern void draw_GL_text_with_textures(int val); -FL_EXPORT extern int draw_GL_text_with_textures(); +static FL_EXPORT void draw_GL_text_with_textures(int val); +static FL_EXPORT int draw_GL_text_with_textures(); -FL_EXPORT extern int system(const char *command); +static FL_EXPORT int system(const char *command); // Convert Windows commandline arguments to UTF-8 (documented in src/Fl.cxx) -FL_EXPORT extern int args_to_utf8(int argc, char ** &argv); +static FL_EXPORT int args_to_utf8(int argc, char ** &argv); #if FLTK_HAVE_CAIRO /** \defgroup group_cairo Cairo Support Functions and Classes @@ -745,18 +750,40 @@ FL_EXPORT extern int args_to_utf8(int argc, char ** &argv); // Cairo support API -FL_EXPORT extern cairo_t *cairo_make_current(Fl_Window *w); -FL_EXPORT extern void cairo_autolink_context(bool alink); -FL_EXPORT extern bool cairo_autolink_context(); -FL_EXPORT extern cairo_t *cairo_cc(); -FL_EXPORT extern void cairo_cc(cairo_t *c, bool own=false); -FL_EXPORT extern void cairo_flush(cairo_t *c); +static FL_EXPORT cairo_t *cairo_make_current(Fl_Window *w); +static FL_EXPORT void cairo_autolink_context(bool alink); +static FL_EXPORT bool cairo_autolink_context(); +static FL_EXPORT cairo_t *cairo_cc(); +static FL_EXPORT void cairo_cc(cairo_t *c, bool own=false); +static FL_EXPORT void cairo_flush(cairo_t *c); /** @} */ #endif // FLTK_HAVE_CAIRO -} // namespace Fl +/** \defgroup fl_del_widget Safe widget deletion support functions + + These functions, declared in <FL/Fl.H>, support deletion of widgets inside callbacks. + + Fl::delete_widget() should be called when deleting widgets + or complete widget trees (Fl_Group, Fl_Window, ...) inside + callbacks. + + The other functions are intended for internal use. The preferred + way to use them is by using the helper class Fl_Widget_Tracker. + + @{ */ + +// Widget deletion: +static FL_EXPORT void delete_widget(Fl_Widget *w); +static FL_EXPORT void do_widget_deletion(); +static FL_EXPORT void watch_widget_pointer(Fl_Widget *&w); +static FL_EXPORT void release_widget_pointer(Fl_Widget *&w); +static FL_EXPORT void clear_widget_pointer(Fl_Widget const *w); + +/** @} */ + +}; /** \defgroup fl_unicode Unicode and UTF-8 functions diff --git a/FL/Fl_Widget_Tracker.H b/FL/Fl_Widget_Tracker.H index 0a2a5b6da..0af6e0fcd 100644 --- a/FL/Fl_Widget_Tracker.H +++ b/FL/Fl_Widget_Tracker.H @@ -76,14 +76,14 @@ class FL_EXPORT Fl_Widget_Tracker { public: Fl_Widget_Tracker(Fl_Widget *wi); - // Rule of five. Note that we *can* implement these when we refactor widget - // tracking with a C++11 map or unordered_map, for example. - Fl_Widget_Tracker(const Fl_Widget_Tracker&) = delete; - Fl_Widget_Tracker(Fl_Widget_Tracker&&) = delete; - Fl_Widget_Tracker& operator=(const Fl_Widget_Tracker&) = delete; - Fl_Widget_Tracker& operator=(Fl_Widget_Tracker&&) = delete; ~Fl_Widget_Tracker(); +private: + Fl_Widget_Tracker(const Fl_Widget_Tracker&); + Fl_Widget_Tracker& operator=(const Fl_Widget_Tracker&); + +public: + /** Clear the widget pointer. */ @@ -109,47 +109,4 @@ public: }; -namespace Fl { - -/** \defgroup fl_del_widget Safe widget deletion support functions - - These functions, declared in <FL/Fl.H>, support deletion of widgets inside callbacks. - - Fl::delete_widget() should be called when deleting widgets - or complete widget trees (Fl_Group, Fl_Window, ...) inside - callbacks. - - The other functions are intended for internal use. The preferred - way to use them is by using the helper class Fl_Widget_Tracker. - - The following is to show how it works ... - - There are three groups of related methods: - - -# scheduled widget deletion - - Fl::delete_widget() schedules widgets for deletion - - Fl::do_widget_deletion() deletes all scheduled widgets - -# widget watch list ("smart pointers") - - Fl::watch_widget_pointer() adds a widget pointer to the watch list - - Fl::release_widget_pointer() removes a widget pointer from the watch list - - Fl::clear_widget_pointer() clears a widget pointer \e in the watch list - -# the class Fl_Widget_Tracker: - - the constructor calls Fl::watch_widget_pointer() - - the destructor calls Fl::release_widget_pointer() - - the access methods can be used to test, if a widget has been deleted - \see Fl_Widget_Tracker. - - @{ */ - -// Widget deletion: -FL_EXPORT extern void delete_widget(Fl_Widget *w); -FL_EXPORT extern void do_widget_deletion(); -FL_EXPORT extern void watch_widget_pointer(Fl_Widget *&w); -FL_EXPORT extern void release_widget_pointer(Fl_Widget *&w); -FL_EXPORT extern void clear_widget_pointer(Fl_Widget const *w); - -/** @} */ - -} // namespace Fl - #endif // !Fl_Widget_Tracker_H diff --git a/FL/core/events.H b/FL/core/events.H index 01c0fd7ed..8454fc501 100644 --- a/FL/core/events.H +++ b/FL/core/events.H @@ -16,60 +16,48 @@ /** \file FL/core/events.H \brief Global event handling variables and functions. + This file is included within class Fl in FL/Fl.H. */ -#ifndef Fl_core_events_H -#define Fl_core_events_H - -#include <FL/fl_config.h> // build configuration -#include <FL/Fl_Export.H> // for FL_EXPORT -#include <FL/core/function_types.H> // widget callbacks and services - -class Fl_Widget; - -namespace Fl { - -// -// Event Variables (Internal) +// --- Event Variables (Internal) --- // Note: These variables should be private, but would harm back compatibility. -// #ifndef FL_DOXYGEN // Core event information -FL_EXPORT extern int e_number; ///< Current event type -FL_EXPORT extern int e_state; ///< Keyboard/mouse button states +static FL_EXPORT int e_number; ///< Current event type +static FL_EXPORT int e_state; ///< Keyboard/mouse button states // Mouse position and movement -FL_EXPORT extern int e_x; ///< Mouse X position (window relative) -FL_EXPORT extern int e_y; ///< Mouse Y position (window relative) -FL_EXPORT extern int e_x_root; ///< Mouse X position (screen absolute) -FL_EXPORT extern int e_y_root; ///< Mouse Y position (screen absolute) -FL_EXPORT extern int e_dx; ///< Mouse wheel horizontal delta -FL_EXPORT extern int e_dy; ///< Mouse wheel vertical delta +static FL_EXPORT int e_x; ///< Mouse X position (window relative) +static FL_EXPORT int e_y; ///< Mouse Y position (window relative) +static FL_EXPORT int e_x_root; ///< Mouse X position (screen absolute) +static FL_EXPORT int e_y_root; ///< Mouse Y position (screen absolute) +static FL_EXPORT int e_dx; ///< Mouse wheel horizontal delta +static FL_EXPORT int e_dy; ///< Mouse wheel vertical delta // Mouse click handling -FL_EXPORT extern int e_clicks; ///< Number of consecutive clicks -FL_EXPORT extern int e_is_click; ///< True if event qualifies as click +static FL_EXPORT int e_clicks; ///< Number of consecutive clicks +static FL_EXPORT int e_is_click; ///< True if event qualifies as click // Keyboard event data -FL_EXPORT extern int e_keysym; ///< Key symbol for current event -FL_EXPORT extern int e_original_keysym; ///< Original key before NumLock translation -FL_EXPORT extern char* e_text; ///< Text associated with key event -FL_EXPORT extern int e_length; ///< Length of text in e_text +static FL_EXPORT int e_keysym; ///< Key symbol for current event +static FL_EXPORT int e_original_keysym; ///< Original key before NumLock translation +static FL_EXPORT char* e_text; ///< Text associated with key event +static FL_EXPORT int e_length; ///< Length of text in e_text // Clipboard data (for paste events) -FL_EXPORT extern void* e_clipboard_data; ///< Pasted data pointer -FL_EXPORT extern const char* e_clipboard_type; ///< Type of pasted data +static FL_EXPORT void* e_clipboard_data; ///< Pasted data pointer +static FL_EXPORT const char* e_clipboard_type; ///< Type of pasted data // Event handling infrastructure -FL_EXPORT extern Fl_Event_Dispatch e_dispatch; ///< Custom event dispatcher -FL_EXPORT extern Fl_Callback_Reason callback_reason_; ///< Reason for current callback +static FL_EXPORT Fl_Event_Dispatch e_dispatch; ///< Custom event dispatcher +static FL_EXPORT Fl_Callback_Reason callback_reason_; ///< Reason for current callback // Widget state tracking -FL_EXPORT extern Fl_Widget* belowmouse_; ///< Widget under mouse cursor -FL_EXPORT extern Fl_Widget* pushed_; ///< Widget receiving drag events -FL_EXPORT extern Fl_Widget* focus_; ///< Widget with keyboard focus +static FL_EXPORT Fl_Widget* belowmouse_; ///< Widget under mouse cursor +static FL_EXPORT Fl_Widget* pushed_; ///< Widget receiving drag events +static FL_EXPORT Fl_Widget* focus_; ///< Widget with keyboard focus // Event variables should be private, but would harm back compatibility. @@ -90,7 +78,7 @@ FL_EXPORT extern Fl_Widget* focus_; ///< Widget with keyboar to determine if a callback is being done in response to a keypress, mouse click, etc. */ -FL_EXPORT inline int event() { return e_number; } +static FL_EXPORT inline int event() { return e_number; } // // Mouse Position Functions @@ -100,13 +88,13 @@ FL_EXPORT inline int event() { return e_number; } Returns the mouse position of the event relative to the Fl_Window it was passed to. */ -FL_EXPORT inline int event_x() { return e_x; } +static FL_EXPORT inline int event_x() { return e_x; } /** Returns the mouse position of the event relative to the Fl_Window it was passed to. */ -FL_EXPORT inline int event_y() { return e_y; } +static FL_EXPORT inline int event_y() { return e_y; } /** Returns the mouse position on the screen of the event. To find the @@ -114,7 +102,7 @@ FL_EXPORT inline int event_y() { return e_y; } difference between event_x_root(),event_y_root() and event_x(),event_y(). */ -FL_EXPORT inline int event_x_root() { return e_x_root; } +static FL_EXPORT inline int event_x_root() { return e_x_root; } /** Returns the mouse position on the screen of the event. To find the @@ -122,7 +110,7 @@ FL_EXPORT inline int event_x_root() { return e_x_root; } difference between event_x_root(),event_y_root() and event_x(),event_y(). */ -FL_EXPORT inline int event_y_root() { return e_y_root; } +static FL_EXPORT inline int event_y_root() { return e_y_root; } // // Mouse Wheel Functions @@ -132,13 +120,13 @@ FL_EXPORT inline int event_y_root() { return e_y_root; } Returns the current horizontal mouse scrolling associated with the FL_MOUSEWHEEL event. Right is positive. */ -FL_EXPORT inline int event_dx() { return e_dx; } +static FL_EXPORT inline int event_dx() { return e_dx; } /** Returns the current vertical mouse scrolling associated with the FL_MOUSEWHEEL event. Down is positive. */ -FL_EXPORT inline int event_dy() { return e_dy; } +static FL_EXPORT inline int event_dy() { return e_dy; } // // Mouse Query Functions @@ -152,7 +140,7 @@ FL_EXPORT inline int event_dy() { return e_dy; } position your first window). If the display is not open, this will open it. */ -FL_EXPORT extern void get_mouse(int &,int &); +static FL_EXPORT void get_mouse(int &,int &); // // Mouse Click Functions @@ -166,7 +154,7 @@ FL_EXPORT extern void get_mouse(int &,int &); again while event_is_click() is true. */ -FL_EXPORT inline int event_clicks() { return e_clicks; } +static FL_EXPORT inline int event_clicks() { return e_clicks; } /** Manually sets the number returned by Fl::event_clicks(). @@ -175,7 +163,7 @@ FL_EXPORT inline int event_clicks() { return e_clicks; } \param[in] i corresponds to no double-click if 0, i+1 mouse clicks otherwise \see int event_clicks() */ -FL_EXPORT inline void event_clicks(int i) { e_clicks = i; } +static FL_EXPORT inline void event_clicks(int i) { e_clicks = i; } /** Returns non-zero if the mouse has not moved far enough @@ -184,7 +172,7 @@ FL_EXPORT inline void event_clicks(int i) { e_clicks = i; } "click". You can test this on FL_DRAG, FL_RELEASE, and FL_MOVE events. */ -FL_EXPORT inline int event_is_click() { return e_is_click; } +static FL_EXPORT inline int event_is_click() { return e_is_click; } /** Clears the value returned by Fl::event_is_click(). @@ -192,7 +180,7 @@ FL_EXPORT inline int event_is_click() { return e_is_click; } click from being counted as a double-click or to make a popup menu pick an item with a single click. Don't pass non-zero to this. */ -FL_EXPORT inline void event_is_click(int i) { e_is_click = i; } +static FL_EXPORT inline void event_is_click(int i) { e_is_click = i; } // // Mouse Button Functions @@ -209,7 +197,7 @@ FL_EXPORT inline void event_is_click(int i) { e_is_click = i; } \retval FL_FORWARD_MOUSE \see Fl::event_buttons(), Fl::event_state() */ -FL_EXPORT inline int event_button() { return e_keysym - FL_Button; } +static FL_EXPORT inline int event_button() { return e_keysym - FL_Button; } // // Event State Functions @@ -224,20 +212,16 @@ FL_EXPORT inline int event_button() { return e_keysym - FL_Button; } \note FLTK platforms differ in what Fl::event_state() returns when it is called while a modifier key or mouse button is being pressed or released. - - Under X11 and Wayland, Fl::event_state() indicates the state of the modifier keys and + - Under X11, Fl::event_state() indicates the state of the modifier keys and mouse buttons just \b prior to the event. Thus, during the \c FL_KEYDOWN event generated when pressing the shift key, for example, the \c FL_SHIFT bit of event_state() is 0 and becomes 1 only at the next event which can be any other event, including e.g. \c FL_MOVE. - - Under other platforms the reported state of modifier keys or mouse buttons includes that - of the key or button being pressed or released. - Fl::event_state() returns the same value under all platforms when it's called while a non-modifier key (e.g. a letter or function key) is being pressed or released. - X servers do not agree on shift states, and \c FL_NUM_LOCK, \c FL_META, and \c FL_SCROLL_LOCK may not work. - The values were selected to match the XFree86 server on Linux. - \note This inconsistency \b may be fixed (on X11 and Wayland) in a later release. - The legal event state bits are: | Device | State Bit | Key or Button | Since | @@ -255,14 +239,14 @@ FL_EXPORT inline int event_button() { return e_keysym - FL_Button; } | Mouse | FL_BUTTON4 | side button 1 (back) | 1.3.10 | | Mouse | FL_BUTTON5 | side button 2 (forward) | 1.3.10 | */ -FL_EXPORT inline int event_state() { return e_state; } +static FL_EXPORT inline int event_state() { return e_state; } /** Returns non-zero if any of the passed event state bits are turned on. Use \p mask to pass the event states you're interested in. The legal event state bits are defined in Fl::event_state(). */ -FL_EXPORT inline int event_state(int mask) { return e_state & mask; } +static FL_EXPORT inline int event_state(int mask) { return e_state & mask; } // // Keyboard Event Functions @@ -279,7 +263,7 @@ FL_EXPORT inline int event_state(int mask) { return e_state & mask; } \returns an integer 'key code', or 0 if the last event was not a key press or release. \see int event_key(int), event_text(), compose(int&). */ -FL_EXPORT inline int event_key() { return e_keysym; } +static FL_EXPORT inline int event_key() { return e_keysym; } /** Returns the keycode of the last key event, regardless of the NumLock state. @@ -289,7 +273,7 @@ FL_EXPORT inline int event_key() { return e_keysym; } event_key() returns the translated key code, whereas event_original_key() returns the keycode before NumLock translation. */ -FL_EXPORT inline int event_original_key() { return e_original_keysym; } +static FL_EXPORT inline int event_original_key() { return e_original_keysym; } /** Returns true if the given \p key was held @@ -327,17 +311,15 @@ FL_EXPORT inline int event_original_key() { return e_original_keysym; } symbols used by Fl::event_state(). On X Fl::get_key(FL_Button+n) does not work. - - On Windows Fl::get_key(FL_KP_Enter) and Fl::event_key(FL_KP_Enter) do not work. */ -FL_EXPORT extern int event_key(int key); +static FL_EXPORT int event_key(int key); /** Returns true if the given \p key is held down <I>now</I>. Under X this requires a round-trip to the server and is <I>much</I> slower than Fl::event_key(int). \see event_key(int) */ -FL_EXPORT extern int get_key(int key); // platform dependent +static FL_EXPORT int get_key(int key); // platform dependent // // Text and Clipboard Functions @@ -357,7 +339,7 @@ FL_EXPORT extern int get_key(int key); // platform dependent \returns A NULL terminated text string equivalent of the last keystroke. */ -FL_EXPORT inline const char* event_text() { return e_text; } +static FL_EXPORT inline const char* event_text() { return e_text; } /** Returns the length of the text in Fl::event_text(). There @@ -365,86 +347,86 @@ FL_EXPORT inline const char* event_text() { return e_text; } be a nul before that if the keystroke translates to a nul character or you paste a nul character. */ -FL_EXPORT inline int event_length() { return e_length; } +static FL_EXPORT inline int event_length() { return e_length; } /** Denotes plain textual data */ -FL_EXPORT extern char const * const clipboard_plain_text; +static FL_EXPORT char const * const clipboard_plain_text; /** Denotes image data */ -FL_EXPORT extern char const * const clipboard_image; +static FL_EXPORT char const * const clipboard_image; /** During an FL_PASTE event of non-textual data, returns a pointer to the pasted data. The returned data is an Fl_RGB_Image * when the result of Fl::event_clipboard_type() is Fl::clipboard_image. */ -FL_EXPORT inline void *event_clipboard() { return e_clipboard_data; } +static FL_EXPORT inline void *event_clipboard() { return e_clipboard_data; } /** Returns the type of the pasted data during an FL_PASTE event. This type can be Fl::clipboard_plain_text or Fl::clipboard_image. */ -FL_EXPORT inline const char *event_clipboard_type() { return e_clipboard_type; } +static FL_EXPORT inline const char *event_clipboard_type() { return e_clipboard_type; } // // Advanced Event Functions // -FL_EXPORT extern int compose(int &del); -FL_EXPORT extern void compose_reset(); -FL_EXPORT extern int event_inside(int,int,int,int); -FL_EXPORT extern int event_inside(const Fl_Widget*); -FL_EXPORT extern int test_shortcut(Fl_Shortcut); +static FL_EXPORT int compose(int &del); +static FL_EXPORT void compose_reset(); +static FL_EXPORT int event_inside(int,int,int,int); +static FL_EXPORT int event_inside(const Fl_Widget*); +static FL_EXPORT int test_shortcut(Fl_Shortcut); -FL_EXPORT extern void enable_im(); -FL_EXPORT extern void disable_im(); +static FL_EXPORT void enable_im(); +static FL_EXPORT void disable_im(); // // Event Handling and Widget Management // -FL_EXPORT extern int handle(int, Fl_Window*); -FL_EXPORT extern int handle_(int, Fl_Window*); +static FL_EXPORT int handle(int, Fl_Window*); +static FL_EXPORT int handle_(int, Fl_Window*); /** Gets the widget that is below the mouse. \see belowmouse(Fl_Widget*) */ -FL_EXPORT inline Fl_Widget* belowmouse() { return belowmouse_; } -FL_EXPORT extern void belowmouse(Fl_Widget*); +static FL_EXPORT inline Fl_Widget* belowmouse() { return belowmouse_; } +static FL_EXPORT void belowmouse(Fl_Widget*); /** Gets the widget that is being pushed. \see void pushed(Fl_Widget*) */ -FL_EXPORT inline Fl_Widget* pushed() { return pushed_; } -FL_EXPORT extern void pushed(Fl_Widget*); +static FL_EXPORT inline Fl_Widget* pushed() { return pushed_; } +static FL_EXPORT void pushed(Fl_Widget*); /** Gets the current Fl::focus() widget. \sa Fl::focus(Fl_Widget*) */ -FL_EXPORT inline Fl_Widget* focus() { return focus_; } -FL_EXPORT extern void focus(Fl_Widget*); +static FL_EXPORT inline Fl_Widget* focus() { return focus_; } +static FL_EXPORT void focus(Fl_Widget*); -FL_EXPORT extern void add_handler(Fl_Event_Handler ha); -FL_EXPORT extern void add_handler(Fl_Event_Handler ha, Fl_Event_Handler before); -FL_EXPORT extern Fl_Event_Handler last_handler(); -FL_EXPORT extern void remove_handler(Fl_Event_Handler h); -FL_EXPORT extern void add_system_handler(Fl_System_Handler h, void *data); -FL_EXPORT extern void remove_system_handler(Fl_System_Handler h); -FL_EXPORT extern void event_dispatch(Fl_Event_Dispatch d); -FL_EXPORT extern Fl_Event_Dispatch event_dispatch(); -FL_EXPORT extern Fl_Callback_Reason callback_reason(); +static FL_EXPORT void add_handler(Fl_Event_Handler ha); +static FL_EXPORT void add_handler(Fl_Event_Handler ha, Fl_Event_Handler before); +static FL_EXPORT Fl_Event_Handler last_handler(); +static FL_EXPORT void remove_handler(Fl_Event_Handler h); +static FL_EXPORT void add_system_handler(Fl_System_Handler h, void *data); +static FL_EXPORT void remove_system_handler(Fl_System_Handler h); +static FL_EXPORT void event_dispatch(Fl_Event_Dispatch d); +static FL_EXPORT Fl_Event_Dispatch event_dispatch(); +static FL_EXPORT Fl_Callback_Reason callback_reason(); // // Convenience State Check Functions // /** Returns non-zero if the Shift key is pressed. */ -FL_EXPORT inline int event_shift() { return e_state & FL_SHIFT; } +static FL_EXPORT inline int event_shift() { return e_state & FL_SHIFT; } /** Returns non-zero if the Control key is pressed. */ -FL_EXPORT inline int event_ctrl() { return e_state & FL_CTRL; } +static FL_EXPORT inline int event_ctrl() { return e_state & FL_CTRL; } /** Returns non-zero if the FL_COMMAND key is pressed, either FL_CTRL or on OSX FL_META. */ -FL_EXPORT inline int event_command() { return e_state & FL_COMMAND; } +static FL_EXPORT inline int event_command() { return e_state & FL_COMMAND; } /** Returns non-zero if the Alt key is pressed. */ -FL_EXPORT inline int event_alt() { return e_state & FL_ALT; } +static FL_EXPORT inline int event_alt() { return e_state & FL_ALT; } // // Mouse Button State Functions @@ -458,40 +440,36 @@ FL_EXPORT inline int event_alt() { return e_state & FL_ALT; } caused an FL_RELEASE event, you can use Fl::event_button() instead. \return a bit mask value like { [FL_BUTTON1] | [FL_BUTTON2] | ... | [FL_BUTTON5] } */ -FL_EXPORT inline int event_buttons() { return e_state & FL_BUTTONS; } +static FL_EXPORT inline int event_buttons() { return e_state & FL_BUTTONS; } /** Returns non-zero if mouse button 1 is currently held down. For more details, see Fl::event_buttons(). */ -FL_EXPORT inline int event_button1() { return e_state & FL_BUTTON1; } +static FL_EXPORT inline int event_button1() { return e_state & FL_BUTTON1; } /** Returns non-zero if mouse button 2 is currently held down. For more details, see Fl::event_buttons(). */ -FL_EXPORT inline int event_button2() { return e_state & FL_BUTTON2; } +static FL_EXPORT inline int event_button2() { return e_state & FL_BUTTON2; } /** Returns non-zero if mouse button 3 is currently held down. For more details, see Fl::event_buttons(). */ -FL_EXPORT inline int event_button3() { return e_state & FL_BUTTON3; } +static FL_EXPORT inline int event_button3() { return e_state & FL_BUTTON3; } /** Returns non-zero if mouse button 4 is currently held down. For more details, see Fl::event_buttons(). */ -FL_EXPORT inline int event_button4() { return e_state & FL_BUTTON4; } +static FL_EXPORT inline int event_button4() { return e_state & FL_BUTTON4; } /** Returns non-zero if mouse button 5 is currently held down. For more details, see Fl::event_buttons(). */ -FL_EXPORT inline int event_button5() { return e_state & FL_BUTTON5; } +static FL_EXPORT inline int event_button5() { return e_state & FL_BUTTON5; } /** @} */ - -} // namespace Fl - -#endif // !Fl_core_events_H diff --git a/FL/core/options.H b/FL/core/options.H index 43f4bec20..0ecdfabeb 100644 --- a/FL/core/options.H +++ b/FL/core/options.H @@ -16,16 +16,10 @@ /** \file FL/core/options.H \brief Application and system wide options management. + This file is included within class Fl in FL/Fl.H. */ -#ifndef Fl_core_options_H -#define Fl_core_options_H - -#include <FL/fl_config.h> // build configuration -#include <FL/Fl_Export.H> // for FL_EXPORT - - -namespace Fl { +// --- Options declarations --- /** Enumerator for global FLTK options. These options can be set system wide, per user, or for the running @@ -102,8 +96,8 @@ typedef enum { /// When switched on and when the keyboard in use has '+' in the shifted position of its key, /// pressing that key and ctrl triggers the zoom-in operation. /// When switched off (default), the zoom-in operation requires that also the shift key is pressed. - /// Under macOS, this option has no effect because the OS itself generates ⌘= followed - /// by ⌘+ when pressing ⌘ and the '=|+' key without pressing shift. + /// Under macOS, this option has no effect because the OS itself generates cmd= followed + /// by cmd+ when pressing cmd and the '=|+' key without pressing shift. OPTION_SIMPLE_ZOOM_SHORTCUT, // don't change this, leave it always as the last element @@ -115,12 +109,12 @@ typedef enum { Return a global setting for all FLTK applications, possibly overridden by a setting specifically for this application. */ -FL_EXPORT extern bool option(Fl_Option opt); +static FL_EXPORT bool option(Fl_Option opt); /* Override an option while the application is running. */ -FL_EXPORT extern void option(Fl_Option opt, bool val); +static FL_EXPORT void option(Fl_Option opt, bool val); // Visible focus methods... @@ -129,14 +123,14 @@ FL_EXPORT extern void option(Fl_Option opt, bool val); non-text widgets. The default mode is to enable keyboard focus for all widgets. */ -FL_EXPORT inline void visible_focus(int v) { option(OPTION_VISIBLE_FOCUS, (v!=0)); } +static FL_EXPORT inline void visible_focus(int v) { option(OPTION_VISIBLE_FOCUS, (v!=0)); } /** Gets or sets the visible keyboard focus on buttons and other non-text widgets. The default mode is to enable keyboard focus for all widgets. */ -FL_EXPORT inline int visible_focus() { return option(OPTION_VISIBLE_FOCUS); } +static FL_EXPORT inline int visible_focus() { return option(OPTION_VISIBLE_FOCUS); } // Drag-n-drop text operation methods... @@ -146,7 +140,7 @@ FL_EXPORT inline int visible_focus() { return option(OPTION_VISIBLE_FOCUS); } be dragged from text fields or dragged within a text field as a cut/paste shortcut. */ -FL_EXPORT inline void dnd_text_ops(int v) { option(OPTION_DND_TEXT, (v!=0)); } +static FL_EXPORT inline void dnd_text_ops(int v) { option(OPTION_DND_TEXT, (v!=0)); } /** Gets whether drag and drop text operations are @@ -154,9 +148,4 @@ FL_EXPORT inline void dnd_text_ops(int v) { option(OPTION_DND_TEXT, (v!=0)); } be dragged from text fields or dragged within a text field as a cut/paste shortcut. */ -FL_EXPORT inline int dnd_text_ops() { return option(OPTION_DND_TEXT); } - -} // namespace Fl - - -#endif // !Fl_core_options_H +static FL_EXPORT inline int dnd_text_ops() { return option(OPTION_DND_TEXT); } Binary files differdiff --git a/fix_for_loops.pl b/fix_for_loops.pl deleted file mode 100644 index 200867e17..000000000 --- a/fix_for_loops.pl +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/perl -# Transform for-loop variable declarations from: -# for (int i = 0; i < n; i++) -# to: -# int i; -# for (i = 0; i < n; i++) -# -# Tracks declared variables per-scope (approximated by function boundaries) -# to avoid duplicate declarations. - -use strict; -use warnings; - -my %declared; # Track declared variables in current scope - -while (<>) { - # Reset scope tracking when we see a function definition start - # Pattern 1: identifier followed by ( ... ) { at end of line (single line) - # Pattern 2: standalone { on a line (for K&R style function defs) - if ((/^\w.*\)\s*(const)?\s*\{\s*$/ && !/^\s*(for|if|while|switch|else)\b/) || - /^\{\s*$/) { - %declared = (); - } - - # Skip lines that are comments - if (/^\s*\/\//) { - print; - next; - } - - # Skip problematic patterns where we can't simply insert a declaration before - if (/\}\s*for\s*\(/ || /else\s*\{?\s*for\s*\(/) { - print; - next; - } - - # Pattern: for (TYPE WHITESPACE [*] VAR = INIT; ...) - if (/^(\s*)(.*?)\bfor\s*\(\s*(const\s+)?(unsigned\s+)?(\w+)(\s*\*{1,2}\s*|\s+)(\w+)\s*=\s*/) { - my $indent = $1; - my $prefix = $2; - my $const = $3 // ''; - my $unsigned = $4 // ''; - my $type = $5; - my $starsep = $6; - my $var = $7; - - # Skip if already transformed or invalid - next if $type eq $var; - - # Skip if prefix contains control flow - if ($prefix =~ /\b(if|else|while|switch)\s*\(.*\)\s*$/ || $prefix =~ /\belse\s*$/) { - print; - next; - } - - # Extract stars from starsep - my $stars = ''; - if ($starsep =~ /(\*+)/) { - $stars = $1; - } - - # Build full type string - my $fulltype = "${const}${unsigned}${type} ${stars}"; - $fulltype =~ s/\s+/ /g; - - # Check if this exact variable (by name) was already declared in this scope - my $key = $var; - if (!exists $declared{$key}) { - # First occurrence - add declaration - print "${indent}${fulltype}${var};\n"; - $declared{$key} = 1; - } - # Always modify the for loop - if ($prefix ne '') { - s/\bfor\s*\(\s*(const\s+)?(unsigned\s+)?(\w+)(\s*\*{1,2}\s*|\s+)(\w+)\s*=/for (${var} =/; - } else { - s/^(\s*)for\s*\(\s*(const\s+)?(unsigned\s+)?(\w+)(\s*\*{1,2}\s*|\s+)(\w+)\s*=/${1}for (${var} =/; - } - } - print; -} diff --git a/fluid/Fluid.cxx b/fluid/Fluid.cxx index 7d838d11a..d751c1051 100644 --- a/fluid/Fluid.cxx +++ b/fluid/Fluid.cxx @@ -64,7 +64,7 @@ #endif -fld::Application Fluid; +Application Fluid; /** @@ -97,8 +97,8 @@ static void external_editor_timer(void*) { /** Create the Fluid application. */ -fld::Application::Application() -: current_project_(new fld::Project()), +Application::Application() +: current_project_(new Project()), tmpdir_create_called(0), preferences(Fl_Preferences::USER_L, "fltk.org", "fluid"), layout_list(0), @@ -133,7 +133,7 @@ fld::Application::Application() /** Destructor. */ -fld::Application::~Application() { +Application::~Application() { delete current_project_; } @@ -141,7 +141,7 @@ fld::Application::~Application() { /** Start Fluid. */ -int fld::Application::run(int argc, char **argv) { +int Application::run(int argc, char **argv) { setlocale(LC_ALL, ""); setlocale(LC_NUMERIC, "C"); @@ -197,7 +197,7 @@ int fld::Application::run(int argc, char **argv) { } } proj.undo.suspend(); - if (c && !fld::io::read_file(proj, c, 0)) { + if (c && !read_file(proj, c, 0)) { if (batch_mode) { fprintf(stderr, "%s : %s\n", c, strerror(errno)); exit(1); @@ -218,7 +218,7 @@ int fld::Application::run(int argc, char **argv) { } if (args.update_file) { - fld::io::write_file(proj, c, 0); + write_file(proj, c, 0); if (!args.compile_file) exit(0); } @@ -258,7 +258,7 @@ int fld::Application::run(int argc, char **argv) { /** Exit Fluid. */ -void fld::Application::quit() { +void Application::quit() { if (shell_command_running()) { int choice = fl_choice("Previous shell command still running!", "Cancel", "Exit", 0); @@ -314,7 +314,7 @@ void fld::Application::quit() { /** Return the working directory path at application launch. */ -const char *fld::Application::launch_path() const { +const char *Application::launch_path() const { return launch_path_; } @@ -322,7 +322,7 @@ const char *fld::Application::launch_path() const { /** Generate a path to a directory for temporary data storage. */ -void fld::Application::create_tmpdir() { +void Application::create_tmpdir() { if (tmpdir_create_called) return; tmpdir_create_called = 1; @@ -381,7 +381,7 @@ void fld::Application::create_tmpdir() { /** Delete the temporary directory and all its contents. */ -void fld::Application::delete_tmpdir() { +void Application::delete_tmpdir() { if (!tmpdir_create_called) return; if (tmpdir_path_[0] == '\0') @@ -412,7 +412,7 @@ void fld::Application::delete_tmpdir() { /** Return the path to a temporary directory for this instance of Fluid. */ -const char *fld::Application::get_tmpdir() { +const char *Application::get_tmpdir() { if (!tmpdir_create_called) create_tmpdir(); return tmpdir_path_; @@ -422,7 +422,7 @@ const char *fld::Application::get_tmpdir() { /** Return the path and filename of a temporary file for cut or duplicated data. */ -const char *fld::Application::cutfname(int which) { +const char *Application::cutfname(int which) { static char name[2][FL_PATH_MAX]; static char beenhere = 0; @@ -441,7 +441,7 @@ const char *fld::Application::cutfname(int which) { /** Clear the current project and create a new, empty one. */ -int fld::Application::new_project(int user_must_confirm) { +int Application::new_project(int user_must_confirm) { if ((user_must_confirm) && (confirm_project_clear() == 0)) return 0; @@ -458,7 +458,7 @@ int fld::Application::new_project(int user_must_confirm) { /** Open a file chooser and load an existing project file. */ -int fld::Application::open_project_file(const char *filename_arg) { +int Application::open_project_file(const char *filename_arg) { if (confirm_project_clear() == 0) return 0; @@ -484,7 +484,7 @@ int fld::Application::open_project_file(const char *filename_arg) { /** Load a project from the given file name and path. */ -int fld::Application::merge_project_file(const char *filename_arg) { +int Application::merge_project_file(const char *filename_arg) { int is_a_merge = (!proj.tree.empty()); const char *title = is_a_merge ? "Merge Project File" : "Open Project File"; @@ -506,7 +506,7 @@ int fld::Application::merge_project_file(const char *filename_arg) { proj.set_filename(c); if (is_a_merge) proj.undo.checkpoint(); proj.undo.suspend(); - if (!fld::io::read_file(proj, c, is_a_merge)) { + if (!read_file(proj, c, is_a_merge)) { proj.undo.resume(); widget_browser->rebuild(); proj.update_settings_dialog(); @@ -533,7 +533,7 @@ int fld::Application::merge_project_file(const char *filename_arg) { /** Save the current design to the file given by filename. */ -void fld::Application::save_project_file(void *v) { +void Application::save_project_file(void *v) { flush_text_widgets(); Fl_Native_File_Chooser fnfc; const char *c = proj.proj_filename; @@ -566,7 +566,7 @@ void fld::Application::save_project_file(void *v) { #endif if (v != (void *)2) proj.set_filename(c); } - if (!fld::io::write_file(proj, c)) { + if (!write_file(proj, c)) { fl_alert("Error writing %s: %s", c, strerror(errno)); return; } @@ -581,13 +581,13 @@ void fld::Application::save_project_file(void *v) { /** Reload the file set by filename, replacing the current design. */ -void fld::Application::revert_project() { +void Application::revert_project() { if (proj.modflag) { if (!fl_choice("This user interface has been changed. Really revert?", "Cancel", "Revert", 0)) return; } proj.undo.suspend(); - if (!fld::io::read_file(proj, proj.proj_filename, 0)) { + if (!read_file(proj, proj.proj_filename, 0)) { proj.undo.resume(); widget_browser->rebuild(); proj.update_settings_dialog(); @@ -605,7 +605,7 @@ void fld::Application::revert_project() { /** Open the template browser and load a new file from templates. */ -int fld::Application::new_project_from_template() { +int Application::new_project_from_template() { if (new_project(1) == 0) return 0; @@ -676,12 +676,12 @@ int fld::Application::new_project_from_template() { fclose(outfile); proj.undo.suspend(); - fld::io::read_file(proj, cutfname(1), 0); + read_file(proj, cutfname(1), 0); fl_unlink(cutfname(1)); proj.undo.resume(); } else { proj.undo.suspend(); - fld::io::read_file(proj, tname, 0); + read_file(proj, tname, 0); proj.undo.resume(); } } @@ -698,7 +698,7 @@ int fld::Application::new_project_from_template() { /** Open the dialog to allow the user to print the current window. */ -void fld::Application::print_snapshots() { +void Application::print_snapshots() { int w, h, ww, hh; int frompage, topage; int num_windows = 0; @@ -760,14 +760,14 @@ void fld::Application::print_snapshots() { /** Generate the C++ source and header filenames and write those files. */ -int fld::Application::write_code_files(int dont_show_completion_dialog) { +int Application::write_code_files(int dont_show_completion_dialog) { flush_text_widgets(); if (!proj.proj_filename) { save_project_file(0); if (!proj.proj_filename) return 1; } - fld::io::Code_Writer f(proj); + Code_Writer f(proj); char code_path[FL_PATH_MAX], code_name[FL_PATH_MAX]; char header_path[FL_PATH_MAX], header_name[FL_PATH_MAX]; @@ -809,13 +809,13 @@ int fld::Application::write_code_files(int dont_show_completion_dialog) { } -void fld::Application::cut_selected() { +void Application::cut_selected() { if (!proj.tree.current) { fl_beep(); return; } flush_text_widgets(); - if (!fld::io::write_file(proj, cutfname(), 1)) { + if (!write_file(proj, cutfname(), 1)) { fl_message("Can't write %s: %s", cutfname(), strerror(errno)); return; } @@ -830,7 +830,7 @@ void fld::Application::cut_selected() { } -void fld::Application::copy_selected() { +void Application::copy_selected() { flush_text_widgets(); if (!proj.tree.current) { fl_beep(); @@ -838,14 +838,14 @@ void fld::Application::copy_selected() { } flush_text_widgets(); ipasteoffset = 10; - if (!fld::io::write_file(proj, cutfname(), 1)) { + if (!write_file(proj, cutfname(), 1)) { fl_message("Can't write %s: %s", cutfname(), strerror(errno)); return; } } -void fld::Application::paste_from_clipboard() { +void Application::paste_from_clipboard() { pasteoffset = ipasteoffset; proj.undo.checkpoint(); proj.undo.suspend(); @@ -855,7 +855,7 @@ void fld::Application::paste_from_clipboard() { strategy = Strategy::FROM_FILE_AS_LAST_CHILD; } } - if (!fld::io::read_file(proj, cutfname(), 1, strategy)) { + if (!read_file(proj, cutfname(), 1, strategy)) { widget_browser->rebuild(); fl_message("Can't read %s: %s", cutfname(), strerror(errno)); } @@ -867,7 +867,7 @@ void fld::Application::paste_from_clipboard() { } -void fld::Application::duplicate_selected() { +void Application::duplicate_selected() { if (!proj.tree.current) { fl_beep(); return; @@ -888,7 +888,7 @@ void fld::Application::duplicate_selected() { if (new_insert) proj.tree.current = new_insert; - if (!fld::io::write_file(proj, cutfname(1), 1)) { + if (!write_file(proj, cutfname(1), 1)) { fl_message("Can't write %s: %s", cutfname(1), strerror(errno)); return; } @@ -896,7 +896,7 @@ void fld::Application::duplicate_selected() { pasteoffset = 0; proj.undo.checkpoint(); proj.undo.suspend(); - if (!fld::io::read_file(proj, cutfname(1), 1, Strategy::FROM_FILE_AFTER_CURRENT)) { + if (!read_file(proj, cutfname(1), 1, Strategy::FROM_FILE_AFTER_CURRENT)) { fl_message("Can't read %s: %s", cutfname(1), strerror(errno)); } fl_unlink(cutfname(1)); @@ -906,7 +906,7 @@ void fld::Application::duplicate_selected() { } -void fld::Application::delete_selected() { +void Application::delete_selected() { if (!proj.tree.current) { fl_beep(); return; @@ -922,7 +922,7 @@ void fld::Application::delete_selected() { } -void fld::Application::edit_selected() { +void Application::edit_selected() { if (!proj.tree.current) { fl_message("Please select a widget"); return; @@ -931,7 +931,7 @@ void fld::Application::edit_selected() { } -void fld::Application::sort_selected() { +void Application::sort_selected() { proj.undo.checkpoint(); sort((Node*)0); widget_browser->rebuild(); @@ -939,7 +939,7 @@ void fld::Application::sort_selected() { } -void fld::Application::toggle_widget_bin() { +void Application::toggle_widget_bin() { if (!widgetbin_panel) { make_widgetbin(); if (!position_window(widgetbin_panel, "widgetbin_pos", 1, 320, 30)) return; @@ -955,7 +955,7 @@ void fld::Application::toggle_widget_bin() { } -void fld::Application::show_help(const char *name) { +void Application::show_help(const char *name) { const char *docdir; char helpname[FL_PATH_MAX]; @@ -1016,13 +1016,13 @@ void fld::Application::show_help(const char *name) { } -void fld::Application::about() { +void Application::about() { if (!about_panel) make_about_panel(); about_panel->show(); } -void fld::Application::make_main_window() { +void Application::make_main_window() { if (!batch_mode) { preferences.get("show_guides", show_guides, 1); preferences.get("show_restricted", show_restricted, 1); @@ -1040,7 +1040,7 @@ void fld::Application::make_main_window() { o->box(FL_FLAT_BOX); o->tooltip("Double-click to view or change an item."); main_window->resizable(o); - main_menubar = new fld::widget::App_Menu_Bar(0, 0, FLD_BROWSERWIDTH, FLD_MENUHEIGHT); + main_menubar = new App_Menu_Bar(0, 0, FLD_BROWSERWIDTH, FLD_MENUHEIGHT); main_menubar->menu(main_menu); save_item = (Fl_Menu_Item*)main_menubar->find_item(menu_file_save_cb); history_item = (Fl_Menu_Item*)main_menubar->find_item(menu_file_open_history_cb); @@ -1063,7 +1063,7 @@ void fld::Application::make_main_window() { } -void fld::Application::open_project_filechooser(char *result, int result_size, const char *title) { +void Application::open_project_filechooser(char *result, int result_size, const char *title) { result[0] = '\0'; Fl_Native_File_Chooser dialog; dialog.title(title); @@ -1081,7 +1081,7 @@ void fld::Application::open_project_filechooser(char *result, int result_size, c } -int fld::Application::confirm_project_clear() { +int Application::confirm_project_clear() { if (proj.modflag == 0) return 1; switch (fl_choice("This project has unsaved changes. Do you want to save\n" "the project file before proceeding?", @@ -1097,7 +1097,7 @@ int fld::Application::confirm_project_clear() { } -void fld::Application::flush_text_widgets() { +void Application::flush_text_widgets() { if (Fl::focus() && (Fl::focus()->top_window() == the_panel)) { Fl_Widget *old_focus = Fl::focus(); Fl::focus(0); @@ -1106,7 +1106,7 @@ void fld::Application::flush_text_widgets() { } -char fld::Application::position_window(Fl_Window *w, const char *prefsName, int Visible, int X, int Y, int W, int H) { +char Application::position_window(Fl_Window *w, const char *prefsName, int Visible, int X, int Y, int W, int H) { Fl_Preferences pos(preferences, prefsName); if (prevpos_button->value()) { pos.get("x", X, X); @@ -1124,7 +1124,7 @@ char fld::Application::position_window(Fl_Window *w, const char *prefsName, int } -void fld::Application::save_position(Fl_Window *w, const char *prefsName) { +void Application::save_position(Fl_Window *w, const char *prefsName) { Fl_Preferences pos(preferences, prefsName); pos.set("x", w->x()); pos.set("y", w->y()); @@ -1134,7 +1134,7 @@ void fld::Application::save_position(Fl_Window *w, const char *prefsName) { } -void fld::Application::set_scheme(const char *new_scheme) { +void Application::set_scheme(const char *new_scheme) { if (batch_mode) return; @@ -1150,7 +1150,7 @@ void fld::Application::set_scheme(const char *new_scheme) { } -void fld::Application::init_scheme() { +void Application::init_scheme() { int scheme_index = 0; char *scheme_name = 0; preferences.get("scheme_name", scheme_name, "XXX"); @@ -1175,7 +1175,7 @@ void fld::Application::init_scheme() { #ifdef __APPLE__ -void fld::Application::apple_open_cb(const char *c) { +void Application::apple_open_cb(const char *c) { Fluid.open_project_file(c); } #endif diff --git a/fluid/Fluid.h b/fluid/Fluid.h index 4e5a053a4..1449d3c03 100644 --- a/fluid/Fluid.h +++ b/fluid/Fluid.h @@ -44,14 +44,8 @@ class Fl_Button; class Fl_Check_Button; class Fl_Help_Dialog; -namespace fld { -namespace app { class Layout_List; -} -namespace widget { class App_Menu_Bar; -} - class Project; class Application { @@ -72,11 +66,11 @@ public: // Member Variables /// Application wide preferences Fl_Preferences preferences; /// Project history. - app::History history; + History history; /// Command line arguments - app::Args args; + Args args; /// List of available layouts - app::Layout_List *layout_list; + Layout_List *layout_list; /// Set, if Fluid runs in batch mode, and no user interface is activated. int batch_mode; @@ -105,7 +99,7 @@ public: // Member Variables // TODO: make this into a class: app::GUI Fl_Window *main_window; static Fl_Menu_Item main_menu[]; - fld::widget::App_Menu_Bar *main_menubar; + App_Menu_Bar *main_menubar; Fl_Menu_Item *save_item; Fl_Menu_Item *history_item; Fl_Menu_Item *widgetbin_item; @@ -199,9 +193,7 @@ public: // Methods #endif }; -} // namespace fld - -extern fld::Application Fluid; +extern Application Fluid; #endif // FLUID_FLUID_H diff --git a/fluid/Project.cxx b/fluid/Project.cxx index 51cbbde27..10e4cea5c 100644 --- a/fluid/Project.cxx +++ b/fluid/Project.cxx @@ -35,7 +35,7 @@ /** Initialize a new project. */ -fld::Project::Project() +Project::Project() : undo(*this), tree(*this), i18n(*this), @@ -53,7 +53,7 @@ fld::Project::Project() in_project_dir(0), modflag(0), modflag_c(0), - layout(app::default_layout_preset) + layout(default_layout_preset) { app_work_dir_[0] = '\0'; set_header_file_name(".h"); @@ -64,7 +64,7 @@ fld::Project::Project() /** Clear all project resources. */ -fld::Project::~Project() { +Project::~Project() { if (header_file_name_) free(header_file_name_); if (code_file_name_) free(code_file_name_); if (include_guard_) free(include_guard_); @@ -74,7 +74,7 @@ fld::Project::~Project() { /** Reset all project setting to create a new empty project. */ -void fld::Project::reset() { +void Project::reset() { ::delete_all(); i18n.reset(); @@ -93,7 +93,7 @@ void fld::Project::reset() { /** Tell the project and i18n tab of the settings dialog to refresh themselves. */ -void fld::Project::update_settings_dialog() { +void Project::update_settings_dialog() { if (settings_window) { w_settings_project_tab->do_callback(w_settings_project_tab, LOAD); w_settings_i18n_tab->do_callback(w_settings_i18n_tab, LOAD); @@ -102,17 +102,17 @@ void fld::Project::update_settings_dialog() { // Setters for string members -void fld::Project::set_header_file_name(const char *name) { +void Project::set_header_file_name(const char *name) { if (header_file_name_) free(header_file_name_); header_file_name_ = name ? strdup(name) : 0; } -void fld::Project::set_code_file_name(const char *name) { +void Project::set_code_file_name(const char *name) { if (code_file_name_) free(code_file_name_); code_file_name_ = name ? strdup(name) : 0; } -void fld::Project::set_include_guard(const char *guard) { +void Project::set_include_guard(const char *guard) { if (include_guard_) free(include_guard_); include_guard_ = guard ? strdup(guard) : 0; } @@ -122,7 +122,7 @@ void fld::Project::set_include_guard(const char *guard) { \param[out] buf buffer to store result (ends with '/') \param[in] bufsize size of buffer */ -void fld::Project::projectfile_path(char *buf, int bufsize) const { +void Project::projectfile_path(char *buf, int bufsize) const { buf[0] = '\0'; if (!proj_filename) return; @@ -139,7 +139,7 @@ void fld::Project::projectfile_path(char *buf, int bufsize) const { Get the project file name including extension, for example `test.fl`. \return the file name without path */ -const char *fld::Project::projectfile_name() const { +const char *Project::projectfile_name() const { if (!proj_filename) return 0; return fl_filename_name(proj_filename); } @@ -149,7 +149,7 @@ const char *fld::Project::projectfile_name() const { \param[out] buf buffer to store result (ends with '/') \param[in] bufsize size of buffer */ -void fld::Project::codefile_path(char *buf, int bufsize) const { +void Project::codefile_path(char *buf, int bufsize) const { buf[0] = '\0'; char path[FL_PATH_MAX]; @@ -172,7 +172,7 @@ void fld::Project::codefile_path(char *buf, int bufsize) const { \param[out] buf buffer to store result \param[in] bufsize size of buffer */ -void fld::Project::codefile_name(char *buf, int bufsize) const { +void Project::codefile_name(char *buf, int bufsize) const { buf[0] = '\0'; const char *name = fl_filename_name(code_file_name_); @@ -196,7 +196,7 @@ void fld::Project::codefile_name(char *buf, int bufsize) const { \param[out] buf buffer to store result (ends with '/') \param[in] bufsize size of buffer */ -void fld::Project::headerfile_path(char *buf, int bufsize) const { +void Project::headerfile_path(char *buf, int bufsize) const { buf[0] = '\0'; char path[FL_PATH_MAX]; @@ -219,7 +219,7 @@ void fld::Project::headerfile_path(char *buf, int bufsize) const { \param[out] buf buffer to store result \param[in] bufsize size of buffer */ -void fld::Project::headerfile_name(char *buf, int bufsize) const { +void Project::headerfile_name(char *buf, int bufsize) const { buf[0] = '\0'; const char *name = fl_filename_name(header_file_name_); @@ -243,7 +243,7 @@ void fld::Project::headerfile_name(char *buf, int bufsize) const { \param[out] buf buffer to store result (ends with '/') \param[in] bufsize size of buffer */ -void fld::Project::stringsfile_path(char *buf, int bufsize) const { +void Project::stringsfile_path(char *buf, int bufsize) const { if (Fluid.batch_mode) { strlcpy(buf, Fluid.launch_path(), bufsize); } else { @@ -256,7 +256,7 @@ void fld::Project::stringsfile_path(char *buf, int bufsize) const { \param[out] buf buffer to store result \param[in] bufsize size of buffer */ -void fld::Project::stringsfile_name(char *buf, int bufsize) const { +void Project::stringsfile_name(char *buf, int bufsize) const { buf[0] = '\0'; if (!proj_filename) return; @@ -279,7 +279,7 @@ void fld::Project::stringsfile_name(char *buf, int bufsize) const { \param[out] buf buffer to store result \param[in] bufsize size of buffer */ -void fld::Project::basename(char *buf, int bufsize) const { +void Project::basename(char *buf, int bufsize) const { buf[0] = '\0'; if (!proj_filename) return; @@ -304,7 +304,7 @@ void fld::Project::basename(char *buf, int bufsize) const { \see leave_project_dir(), pwd, in_project_dir */ -void fld::Project::enter_project_dir() { +void Project::enter_project_dir() { if (in_project_dir < 0) { fprintf(stderr, "** Fluid internal error: enter_project_dir() calls unmatched\n"); return; @@ -338,7 +338,7 @@ void fld::Project::enter_project_dir() { Change the current working directory to the previous directory. \see enter_project_dir(), pwd, in_project_dir */ -void fld::Project::leave_project_dir() { +void Project::leave_project_dir() { if (in_project_dir == 0) { fprintf(stderr, "** Fluid internal error: leave_project_dir() calls unmatched\n"); return; @@ -356,7 +356,7 @@ void fld::Project::leave_project_dir() { /** Clear the project filename. */ -void fld::Project::clear_filename() { +void Project::clear_filename() { set_filename(0); } @@ -364,7 +364,7 @@ void fld::Project::clear_filename() { Set the filename of the current .fl design. \param[in] c the new absolute filename and path (may be NULL to clear) */ -void fld::Project::set_filename(const char *c) { +void Project::set_filename(const char *c) { if (proj_filename) free((void *)proj_filename); proj_filename = (c && *c) ? strdup(c) : 0; @@ -377,7 +377,7 @@ void fld::Project::set_filename(const char *c) { /** Write the strings that are used in i18n. */ -void fld::Project::write_strings() { +void Project::write_strings() { Fluid.flush_text_widgets(); if (!proj_filename) { Fluid.save_project_file(0); @@ -392,7 +392,7 @@ void fld::Project::write_strings() { char filename[FL_PATH_MAX]; snprintf(filename, FL_PATH_MAX, "%s%s", path, name); - int x = fld::io::write_strings(*this, filename); + int x = ::write_strings(*this, filename); if (Fluid.batch_mode) { if (x) { fprintf(stderr, "%s : %s\n", filename, strerror(errno)); @@ -425,7 +425,7 @@ void fld::Project::write_strings() { \param[in] mfc default -1 to let \c mf control \c modflag_c, 0 to mark the code files current, 1 to mark it out of date. -2 to ignore changes to mf. */ -void fld::Project::set_modflag(int mf, int mfc) { +void Project::set_modflag(int mf, int mfc) { const char *code_ext = 0; char new_title[FL_PATH_MAX]; diff --git a/fluid/Project.h b/fluid/Project.h index f920c6ff3..e68ad6d4e 100644 --- a/fluid/Project.h +++ b/fluid/Project.h @@ -27,12 +27,8 @@ // ---- project class declaration -namespace fld { - -namespace app { - class Layout_Preset; - extern Layout_Preset *default_layout_preset; -} // namespace app +class Layout_Preset; +extern Layout_Preset *default_layout_preset; /** Data and settings for a FLUID project file. @@ -41,13 +37,13 @@ class Project { public: // Member Variables // Undo actions for this Project. - proj::Undo undo; + Undo undo; // Manage the node tree of the project. - node::Tree tree; + Tree tree; // Project internationalization. - proj::I18n i18n; + I18n i18n; /// If set, generate code to include the header file form the c++ file int include_H_from_C; @@ -83,7 +79,7 @@ public: // Member Variables int modflag_c; /// Currently used layout preset. - app::Layout_Preset *layout; + Layout_Preset *layout; public: // Methods Project(); @@ -122,6 +118,4 @@ public: // Methods void set_modflag(int mf, int mfc = -1); }; -} // namespace fld - #endif // FLUID_PROJECT_H diff --git a/fluid/app/Image_Asset.cxx b/fluid/app/Image_Asset.cxx index 36fa4d443..31847a416 100644 --- a/fluid/app/Image_Asset.cxx +++ b/fluid/app/Image_Asset.cxx @@ -109,7 +109,7 @@ static struct { \param fmt short name of file contents for error message \return 0 if the file could not be opened or read */ -size_t Image_Asset::write_static_binary(fld::io::Code_Writer& f, const char* fmt) { +size_t Image_Asset::write_static_binary(Code_Writer& f, const char* fmt) { size_t nData = 0; Fluid.proj.enter_project_dir(); FILE *in = fl_fopen(filename(), "rb"); @@ -143,7 +143,7 @@ size_t Image_Asset::write_static_binary(fld::io::Code_Writer& f, const char* fmt \param fmt short name of file contents for error message \return 0 if the file could not be opened or read */ -size_t Image_Asset::write_static_text(fld::io::Code_Writer& f, const char* fmt) { +size_t Image_Asset::write_static_text(Code_Writer& f, const char* fmt) { size_t nData = 0; Fluid.proj.enter_project_dir(); FILE *in = fl_fopen(filename(), "rb"); @@ -180,7 +180,7 @@ size_t Image_Asset::write_static_text(fld::io::Code_Writer& f, const char* fmt) \param fmt short name of file contents for error message \return 0 if the file could not be opened or read */ -void Image_Asset::write_static_rgb(fld::io::Code_Writer& f, const char* idata_name) { +void Image_Asset::write_static_rgb(Code_Writer& f, const char* idata_name) { // Write image data... f.write_c("\n"); f.write_c_once("#include <FL/Fl_Image.H>\n"); @@ -206,7 +206,7 @@ void Image_Asset::write_static_rgb(fld::io::Code_Writer& f, const char* idata_na \param f Write code to this C++ source code file \param compressed write data in the original compressed file format */ -void Image_Asset::write_static(fld::io::Code_Writer& f, int compressed) { +void Image_Asset::write_static(Code_Writer& f, int compressed) { if (!image_) return; const char *idata_name = f.unique_id(this, "idata", fl_filename_name(filename()), 0); if (initializer_function_) free(initializer_function_); @@ -340,7 +340,7 @@ void Image_Asset::write_static(fld::io::Code_Writer& f, int compressed) { \param f The C++ source code file to write the warning message to. \param fmt The format string for the image file type. */ -void Image_Asset::write_file_error(fld::io::Code_Writer& f, const char *fmt) { +void Image_Asset::write_file_error(Code_Writer& f, const char *fmt) { f.write_c("#warning Cannot read %s file \"%s\": %s\n", fmt, filename(), strerror(errno)); Fluid.proj.enter_project_dir(); f.write_c("// Searching in path \"%s\"\n", fl_getcwd(0, FL_PATH_MAX)); @@ -367,7 +367,7 @@ void Image_Asset::write_file_error(fld::io::Code_Writer& f, const char *fmt) { \param image_class Name of the Fl_Image class, for example Fl_GIF_Image. \param format Format string for additional parameters for the constructor. */ -void Image_Asset::write_initializer(fld::io::Code_Writer& f, const char *image_class, const char *format, ...) { +void Image_Asset::write_initializer(Code_Writer& f, const char *image_class, const char *format, ...) { va_list ap; va_start(ap, format); f.write_c("static Fl_Image *%s() {\n", initializer_function_); @@ -395,7 +395,7 @@ void Image_Asset::write_initializer(fld::io::Code_Writer& f, const char *image_c \param var Name of the Fl_Widget or Fl_Menu_Item to attach the image to. \param inactive If true, use deimage() instead of image(). */ -void Image_Asset::write_code(fld::io::Code_Writer& f, int bind, const char *var, int inactive) { +void Image_Asset::write_code(Code_Writer& f, int bind, const char *var, int inactive) { if (image_) { f.write_c("%s%s->%s%s( %s() );\n", f.indent(), @@ -421,7 +421,7 @@ void Image_Asset::write_code(fld::io::Code_Writer& f, int bind, const char *var, \param f Write the C++ code to this file. \param inactive Unused. */ -void Image_Asset::write_inline(fld::io::Code_Writer& f, int inactive) { +void Image_Asset::write_inline(Code_Writer& f, int inactive) { (void)inactive; if (image_) { f.write_c("%s()", initializer_function_); diff --git a/fluid/app/Image_Asset.h b/fluid/app/Image_Asset.h index 1d6909a70..c393109d3 100644 --- a/fluid/app/Image_Asset.h +++ b/fluid/app/Image_Asset.h @@ -38,20 +38,20 @@ private: // member variables private: // methods Image_Asset(const char *name); // no public constructor ~Image_Asset(); // no public destructor - size_t write_static_binary(fld::io::Code_Writer& f, const char* fmt); - size_t write_static_text(fld::io::Code_Writer& f, const char* fmt); - void write_static_rgb(fld::io::Code_Writer& f, const char* idata_name); + size_t write_static_binary(Code_Writer& f, const char* fmt); + size_t write_static_text(Code_Writer& f, const char* fmt); + void write_static_rgb(Code_Writer& f, const char* idata_name); public: // methods static Image_Asset* find(const char *); void dec_ref(); // reference counting & automatic free void inc_ref(); Fl_Shared_Image *image() const { return image_; } - void write_static(fld::io::Code_Writer& f, int compressed); - void write_initializer(fld::io::Code_Writer& f, const char *type_name, const char *format, ...); - void write_code(fld::io::Code_Writer& f, int bind, const char *var, int inactive = 0); - void write_inline(fld::io::Code_Writer& f, int inactive = 0); - void write_file_error(fld::io::Code_Writer& f, const char *fmt); + void write_static(Code_Writer& f, int compressed); + void write_initializer(Code_Writer& f, const char *type_name, const char *format, ...); + void write_code(Code_Writer& f, int bind, const char *var, int inactive = 0); + void write_inline(Code_Writer& f, int inactive = 0); + void write_file_error(Code_Writer& f, const char *fmt); const char *filename() const { return filename_ ? filename_ : ""; } }; diff --git a/fluid/app/Menu.cxx b/fluid/app/Menu.cxx index 54db5801f..fc5fad4b2 100644 --- a/fluid/app/Menu.cxx +++ b/fluid/app/Menu.cxx @@ -49,7 +49,7 @@ void about_cb(Fl_Widget *, void *) { Fluid.about(); } void help_cb(Fl_Widget *, void *) { Fluid.show_help("fluid.html"); } -static void save_template_cb(Fl_Widget *, void *) { fld::app::save_template(); } +static void save_template_cb(Fl_Widget *, void *) { save_template(); } void mergeback_cb(Fl_Widget *, void *); void manual_cb(Fl_Widget *, void *) { @@ -85,7 +85,7 @@ void toggle_widgetbin_cb(Fl_Widget *, void *) { Fluid.toggle_widget_bin(); } \todo Shortcuts are all over the place (Alt, Ctrl, Command, Shift-Ctrl, function keys), and there should be a help page listing all shortcuts. */ -Fl_Menu_Item fld::Application::main_menu[] = { +Fl_Menu_Item Application::main_menu[] = { {"&File",0,0,0,FL_SUBMENU}, {"&New", FL_COMMAND+'n', menu_file_new_cb}, {"&Open...", FL_COMMAND+'o', menu_file_open_cb}, @@ -113,8 +113,8 @@ Fl_Menu_Item fld::Application::main_menu[] = { {"&Quit", FL_COMMAND+'q', exit_cb}, {0}, {"&Edit",0,0,0,FL_SUBMENU}, - {"&Undo", FL_COMMAND+'z', fld::proj::Undo::undo_cb}, - {"&Redo", FL_COMMAND+FL_SHIFT+'z', fld::proj::Undo::redo_cb, 0, FL_MENU_DIVIDER}, + {"&Undo", FL_COMMAND+'z', Undo::undo_cb}, + {"&Redo", FL_COMMAND+FL_SHIFT+'z', Undo::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}, diff --git a/fluid/app/Snap_Action.cxx b/fluid/app/Snap_Action.cxx index 39a328b24..db68d6dd1 100644 --- a/fluid/app/Snap_Action.cxx +++ b/fluid/app/Snap_Action.cxx @@ -45,10 +45,10 @@ void select_layout_suite_cb(Fl_Widget *, void *user_data); -int fld::app::Snap_Action::eex = 0; -int fld::app::Snap_Action::eey = 0; +int Snap_Action::eex = 0; +int Snap_Action::eey = 0; -static fld::app::Layout_Preset fltk_app = { +static Layout_Preset fltk_app = { 15, 15, 15, 15, 0, 0, // window: l, r, t, b, gx, gy 10, 10, 10, 10, 0, 0, // group: l, r, t, b, gx, gy 25, 25, // tabs: t, b @@ -56,7 +56,7 @@ static fld::app::Layout_Preset fltk_app = { 20, 4, 8, // widget_y: min, inc, gap 0, 14, -1, 14 // labelfont/size, textfont/size }; -static fld::app::Layout_Preset fltk_dlg = { +static Layout_Preset fltk_dlg = { 10, 10, 10, 10, 0, 0, // window: l, r, t, b, gx, gy 10, 10, 10, 10, 0, 0, // group: l, r, t, b, gx, gy 20, 20, // tabs: t, b @@ -64,7 +64,7 @@ static fld::app::Layout_Preset fltk_dlg = { 20, 5, 5, // widget_y: min, inc, gap 0, 11, -1, 11 // labelfont/size, textfont/size }; -static fld::app::Layout_Preset fltk_tool = { +static Layout_Preset fltk_tool = { 10, 10, 10, 10, 0, 0, // window: l, r, t, b, gx, gy 10, 10, 10, 10, 0, 0, // group: l, r, t, b, gx, gy 18, 18, // tabs: t, b @@ -73,7 +73,7 @@ static fld::app::Layout_Preset fltk_tool = { 0, 10, -1, 10 // labelfont/size, textfont/size }; -static fld::app::Layout_Preset grid_app = { +static Layout_Preset grid_app = { 12, 12, 12, 12, 12, 12, // window: l, r, t, b, gx, gy 12, 12, 12, 12, 12, 12, // group: l, r, t, b, gx, gy 24, 24, // tabs: t, b @@ -82,7 +82,7 @@ static fld::app::Layout_Preset grid_app = { 0, 14, -1, 14 // labelfont/size, textfont/size }; -static fld::app::Layout_Preset grid_dlg = { +static Layout_Preset grid_dlg = { 10, 10, 10, 10, 10, 10, // window: l, r, t, b, gx, gy 10, 10, 10, 10, 10, 10, // group: l, r, t, b, gx, gy 20, 20, // tabs: t, b @@ -91,7 +91,7 @@ static fld::app::Layout_Preset grid_dlg = { 0, 12, -1, 12 // labelfont/size, textfont/size }; -static fld::app::Layout_Preset grid_tool = { +static Layout_Preset grid_tool = { 8, 8, 8, 8, 8, 8, // window: l, r, t, b, gx, gy 8, 8, 8, 8, 8, 8, // group: l, r, t, b, gx, gy 16, 16, // tabs: t, b @@ -100,9 +100,9 @@ static fld::app::Layout_Preset grid_tool = { 0, 10, -1, 10 // labelfont/size, textfont/size }; -fld::app::Layout_Preset *fld::app::default_layout_preset = &fltk_app; +Layout_Preset *default_layout_preset = &fltk_app; -static fld::app::Layout_Suite static_suite_list[] = { +static Layout_Suite static_suite_list[] = { { (char*)"FLTK", (char*)"@fd_beaker FLTK", { &fltk_app, &fltk_dlg, &fltk_tool }, FLD_TOOL_STORE_INTERNAL }, { (char*)"Grid", (char*)"@fd_beaker Grid", { &grid_app, &grid_dlg, &grid_tool }, FLD_TOOL_STORE_INTERNAL } }; @@ -154,12 +154,12 @@ void edit_layout_preset_cb(Fl_Button *w, void *user_data) { } } -// ---- fld::app::Layout_Suite ------------------------------------------------ MARK: - +// ---- Layout_Suite ------------------------------------------------ MARK: - /** Write presets to a Preferences database. */ -void fld::app::Layout_Preset::write(Fl_Preferences &prefs) { +void Layout_Preset::write(Fl_Preferences &prefs) { assert(this); Fl_Preferences p_win(prefs, "Window"); p_win.set("left_margin", left_window_margin); @@ -199,7 +199,7 @@ void fld::app::Layout_Preset::write(Fl_Preferences &prefs) { /** Read presets from a Preferences database. */ -void fld::app::Layout_Preset::read(Fl_Preferences &prefs) { +void Layout_Preset::read(Fl_Preferences &prefs) { assert(this); Fl_Preferences p_win(prefs, "Window"); p_win.get("left_margin", left_window_margin, 15); @@ -239,7 +239,7 @@ void fld::app::Layout_Preset::read(Fl_Preferences &prefs) { /** Write presets to an .fl project file. */ -void fld::app::Layout_Preset::write(fld::io::Project_Writer *out) { +void Layout_Preset::write(Project_Writer *out) { out->write_string(" preset { 1\n"); // preset format version out->write_string(" %d %d %d %d %d %d\n", left_window_margin, right_window_margin, @@ -261,7 +261,7 @@ void fld::app::Layout_Preset::write(fld::io::Project_Writer *out) { /** Read presets from an .fl project file. */ -void fld::app::Layout_Preset::read(fld::io::Project_Reader *in) { +void Layout_Preset::read(Project_Reader *in) { const char *key; key = in->read_word(1); if (key && !strcmp(key, "{")) { @@ -317,7 +317,7 @@ void fld::app::Layout_Preset::read(fld::io::Project_Reader *in) { /** Return the preferred text size, but make sure it's not 0. */ -int fld::app::Layout_Preset::textsize_not_null() { +int Layout_Preset::textsize_not_null() { // try the user selected text size if (textsize > 0) return textsize; // if the user did not set one, try the label size @@ -327,12 +327,12 @@ int fld::app::Layout_Preset::textsize_not_null() { } -// ---- fld::app::Layout_Suite ------------------------------------------------ MARK: - +// ---- Layout_Suite ------------------------------------------------ MARK: - /** Write a presets suite to a Preferences database. */ -void fld::app::Layout_Suite::write(Fl_Preferences &prefs) { +void Layout_Suite::write(Fl_Preferences &prefs) { assert(this); assert(name_); prefs.set("name", name_); @@ -347,7 +347,7 @@ void fld::app::Layout_Suite::write(Fl_Preferences &prefs) { /** Read a presets suite from a Preferences database. */ -void fld::app::Layout_Suite::read(Fl_Preferences &prefs) { +void Layout_Suite::read(Fl_Preferences &prefs) { assert(this); int i; for (i = 0; i < 3; ++i) { @@ -360,7 +360,7 @@ void fld::app::Layout_Suite::read(Fl_Preferences &prefs) { /** Write a presets suite to an .fl project file. */ -void fld::app::Layout_Suite::write(fld::io::Project_Writer *out) { +void Layout_Suite::write(Project_Writer *out) { out->write_string(" suite {\n"); out->write_string(" name "); out->write_word(name_); out->write_string("\n"); int i; @@ -373,7 +373,7 @@ void fld::app::Layout_Suite::write(fld::io::Project_Writer *out) { /** Read a presets suite from an .fl project file. */ -void fld::app::Layout_Suite::read(fld::io::Project_Reader *in) { +void Layout_Suite::read(Project_Reader *in) { const char *key; key = in->read_word(1); if (key && !strcmp(key, "{")) { @@ -401,7 +401,7 @@ void fld::app::Layout_Suite::read(fld::io::Project_Reader *in) { \brief Update the menu_label to show a symbol representing the storage location. Also updates the FLUID user interface. */ -void fld::app::Layout_Suite::update_label() { +void Layout_Suite::update_label() { const char *sym = ""; switch (storage_) { case FLD_TOOL_STORE_INTERNAL: sym = "@fd_beaker "; break; @@ -421,7 +421,7 @@ void fld::app::Layout_Suite::update_label() { \brief Update the Suite name and the Suite menu_label. Also updates the FLUID user interface. */ -void fld::app::Layout_Suite::name(const char *n) { +void Layout_Suite::name(const char *n) { if (name_) ::free(name_); if (n) @@ -434,7 +434,7 @@ void fld::app::Layout_Suite::name(const char *n) { /** Initialize the class for first use. */ -void fld::app::Layout_Suite::init() { +void Layout_Suite::init() { name_ = 0; menu_label = 0; layout[0] = layout[1] = layout[2] = 0; @@ -444,7 +444,7 @@ void fld::app::Layout_Suite::init() { /** Free all allocated resources. */ -fld::app::Layout_Suite::~Layout_Suite() { +Layout_Suite::~Layout_Suite() { if (storage_ == FLD_TOOL_STORE_INTERNAL) return; if (name_) ::free(name_); int i; @@ -453,7 +453,7 @@ fld::app::Layout_Suite::~Layout_Suite() { } } -// ---- fld::app::Layout_List ------------------------------------------------- MARK: - +// ---- Layout_List ------------------------------------------------- MARK: - /** Draw a little FLUID beaker symbol. @@ -596,7 +596,7 @@ void fd_file(Fl_Color c) { /** Instantiate the class that holds a list of all layouts and manages the UI. */ -fld::app::Layout_List::Layout_List() +Layout_List::Layout_List() : main_menu_(main_layout_submenu_), choice_menu_(static_choice_menu), list_(static_suite_list), @@ -615,16 +615,16 @@ fld::app::Layout_List::Layout_List() /** Release allocated resources. */ -fld::app::Layout_List::~Layout_List() { +Layout_List::~Layout_List() { assert(this); if (!list_is_static_) { ::free(main_menu_); ::free(choice_menu_); int i; for (i = 0; i < list_size_; i++) { - fld::app::Layout_Suite &suite = list_[i]; + Layout_Suite &suite = list_[i]; if (suite.storage_ != FLD_TOOL_STORE_INTERNAL) - suite.fld::app::Layout_Suite::~Layout_Suite(); + suite.Layout_Suite::~Layout_Suite(); } ::free(list_); } @@ -633,7 +633,7 @@ fld::app::Layout_List::~Layout_List() { /** Update the Setting dialog and menus to reflect the current Layout selection state. */ -void fld::app::Layout_List::update_dialogs() { +void Layout_List::update_dialogs() { static Fl_Menu_Item *preset_menu = 0; if (!preset_menu) { preset_menu = (Fl_Menu_Item*)Fluid.main_menubar->find_item(select_layout_preset_cb); @@ -657,7 +657,7 @@ void fld::app::Layout_List::update_dialogs() { /** Refresh the label pointers for both pulldown menus. */ -void fld::app::Layout_List::update_menu_labels() { +void Layout_List::update_menu_labels() { int i; for (i =0; i<list_size_; i++) { main_menu_[i].label(list_[i].menu_label); @@ -668,7 +668,7 @@ void fld::app::Layout_List::update_menu_labels() { /** Load all user layouts from the FLUID user preferences. */ -int fld::app::Layout_List::load(const char *filename) { +int Layout_List::load(const char *filename) { remove_all(FLD_TOOL_STORE_FILE); Fl_Preferences prefs(filename, "layout.fluid.fltk.org", 0, Fl_Preferences::C_LOCALE); read(prefs, FLD_TOOL_STORE_FILE); @@ -678,7 +678,7 @@ int fld::app::Layout_List::load(const char *filename) { /** Save all user layouts to the FLUID user preferences. */ -int fld::app::Layout_List::save(const char *filename) { +int Layout_List::save(const char *filename) { assert(this); Fl_Preferences prefs(filename, "layout.fluid.fltk.org", 0, (Fl_Preferences::Root)(Fl_Preferences::C_LOCALE|Fl_Preferences::CLEAR)); prefs.clear(); @@ -689,7 +689,7 @@ int fld::app::Layout_List::save(const char *filename) { /** Write Suite and Layout selection and selected layout data to Preferences database. */ -void fld::app::Layout_List::write(Fl_Preferences &prefs, fld::Tool_Store storage) { +void Layout_List::write(Fl_Preferences &prefs, Tool_Store storage) { Fl_Preferences prefs_list(prefs, "Layouts"); prefs_list.clear(); prefs_list.set("current_suite", list_[current_suite()].name_); @@ -697,7 +697,7 @@ void fld::app::Layout_List::write(Fl_Preferences &prefs, fld::Tool_Store storage int n = 0; int i; for (i = 0; i < list_size_; ++i) { - fld::app::Layout_Suite &suite = list_[i]; + Layout_Suite &suite = list_[i]; if (suite.storage_ == storage) { Fl_Preferences prefs_suite(prefs_list, Fl_Preferences::Name(n++)); suite.write(prefs_suite); @@ -708,7 +708,7 @@ void fld::app::Layout_List::write(Fl_Preferences &prefs, fld::Tool_Store storage /** Read Suite and Layout selection and selected layout data to Preferences database. */ -void fld::app::Layout_List::read(Fl_Preferences &prefs, fld::Tool_Store storage) { +void Layout_List::read(Fl_Preferences &prefs, Tool_Store storage) { Fl_Preferences prefs_list(prefs, "Layouts"); char *cs_ptr = 0; int cp = 0; @@ -737,7 +737,7 @@ void fld::app::Layout_List::read(Fl_Preferences &prefs, fld::Tool_Store storage) /** Write Suite and Layout selection and project layout data to an .fl project file. */ -void fld::app::Layout_List::write(fld::io::Project_Writer *out) { +void Layout_List::write(Project_Writer *out) { // Don't write the Snap field if no custom layout was used int i; if ((current_suite()==0) && (current_preset()==0)) { @@ -751,7 +751,7 @@ void fld::app::Layout_List::write(fld::io::Project_Writer *out) { out->write_string(" current_suite "); out->write_word(list_[current_suite()].name_); out->write_string("\n"); out->write_string(" current_preset %d\n", current_preset()); for (i =0; i<list_size_; i++) { - fld::app::Layout_Suite &suite = list_[i]; + Layout_Suite &suite = list_[i]; if (suite.storage_ == FLD_TOOL_STORE_PROJECT) suite.write(out); } @@ -761,7 +761,7 @@ void fld::app::Layout_List::write(fld::io::Project_Writer *out) { /** Read Suite and Layout selection and project layout data from an .fl project file. */ -void fld::app::Layout_List::read(fld::io::Project_Reader *in) { +void Layout_List::read(Project_Reader *in) { const char *key; key = in->read_word(1); if (key && !strcmp(key, "{")) { @@ -798,7 +798,7 @@ void fld::app::Layout_List::read(fld::io::Project_Reader *in) { Set the current Suite. \param[in] ix index into list of suites */ -void fld::app::Layout_List::current_suite(int ix) { +void Layout_List::current_suite(int ix) { assert(ix >= 0); assert(ix < list_size_); current_suite_ = ix; @@ -810,11 +810,11 @@ void fld::app::Layout_List::current_suite(int ix) { \param[in] arg_name name of the selected suite \return if no name is given or the name is not found, keep the current suite selected */ -void fld::app::Layout_List::current_suite(const char *arg_name) { +void Layout_List::current_suite(const char *arg_name) { if (!arg_name || !arg_name[0]) return; int i; for (i = 0; i < list_size_; ++i) { - fld::app::Layout_Suite &suite = list_[i]; + Layout_Suite &suite = list_[i]; if (suite.name_ && (strcmp(suite.name_, arg_name) == 0)) { current_suite(i); break; @@ -826,7 +826,7 @@ void fld::app::Layout_List::current_suite(const char *arg_name) { Select a Preset within the current Suite. \param[in] ix 0 = application, 1 = dialog, 2 = toolbox */ -void fld::app::Layout_List::current_preset(int ix) { +void Layout_List::current_preset(int ix) { assert(ix >= 0); assert(ix < 3); current_preset_ = ix; @@ -836,7 +836,7 @@ void fld::app::Layout_List::current_preset(int ix) { /** Allocate enough space for n entries in the list. */ -void fld::app::Layout_List::capacity(int n) { +void Layout_List::capacity(int n) { static Fl_Menu_Item *suite_menu = 0; if (!suite_menu) suite_menu = (Fl_Menu_Item*)Fluid.main_menubar->find_item(layout_suite_marker); @@ -844,7 +844,7 @@ void fld::app::Layout_List::capacity(int n) { int old_n = list_size_; int i; - fld::app::Layout_Suite *new_list = (fld::app::Layout_Suite*)::calloc(n, sizeof(fld::app::Layout_Suite)); + Layout_Suite *new_list = (Layout_Suite*)::calloc(n, sizeof(Layout_Suite)); for (i = 0; i < old_n; i++) new_list[i] = list_[i]; if (!list_is_static_) ::free(list_); @@ -872,21 +872,21 @@ void fld::app::Layout_List::capacity(int n) { \brief Clone the currently selected suite and append it to the list. Selects the new layout and updates the UI. */ -int fld::app::Layout_List::add(const char *name) { +int Layout_List::add(const char *name) { if (list_size_ == list_capacity_) { capacity(list_capacity_ * 2); } int n = list_size_; - fld::app::Layout_Suite &old_suite = list_[current_suite_]; - fld::app::Layout_Suite &new_suite = list_[n]; + Layout_Suite &old_suite = list_[current_suite_]; + Layout_Suite &new_suite = list_[n]; new_suite.init(); new_suite.name(name); int i; for (i =0; i<3; ++i) { - new_suite.layout[i] = new fld::app::Layout_Preset; - ::memcpy(new_suite.layout[i], old_suite.layout[i], sizeof(fld::app::Layout_Preset)); + new_suite.layout[i] = new Layout_Preset; + ::memcpy(new_suite.layout[i], old_suite.layout[i], sizeof(Layout_Preset)); } - fld::Tool_Store new_storage = old_suite.storage_; + Tool_Store new_storage = old_suite.storage_; if (new_storage == FLD_TOOL_STORE_INTERNAL) new_storage = FLD_TOOL_STORE_USER; new_suite.storage(new_storage); @@ -903,7 +903,7 @@ int fld::app::Layout_List::add(const char *name) { /** Rename the current Suite. */ -void fld::app::Layout_List::rename(const char *name) { +void Layout_List::rename(const char *name) { int n = current_suite(); list_[n].name(name); main_menu_[n].label(list_[n].menu_label); @@ -914,7 +914,7 @@ void fld::app::Layout_List::rename(const char *name) { Remove the given suite. \param[in] ix index into list of suites */ -void fld::app::Layout_List::remove(int ix) { +void Layout_List::remove(int ix) { int tail = list_size_-ix-1; if (tail) { int i; @@ -932,7 +932,7 @@ void fld::app::Layout_List::remove(int ix) { Remove all Suites that use the given storage attribute. \param[in] storage storage attribute, see FLD_TOOL_STORE_INTERNAL, etc. */ -void fld::app::Layout_List::remove_all(fld::Tool_Store storage) { +void Layout_List::remove_all(Tool_Store storage) { int i; for (i =list_size_-1; i>=0; --i) { if (list_[i].storage_ == storage) @@ -959,19 +959,19 @@ static int nearest(int x, int left, int grid, int right=0x7fff) { return grid_x; } -static bool in_window(fld::app::Snap_Data &d) { +static bool in_window(Snap_Data &d) { return (d.wgt && d.wgt->parent == d.win); } -static bool in_group(fld::app::Snap_Data &d) { +static bool in_group(Snap_Data &d) { return (d.wgt && d.wgt->parent && d.wgt->parent->is_a(FLD_NODE_TYPE_Group) && d.wgt->parent != d.win); } -static bool in_tabs(fld::app::Snap_Data &d) { +static bool in_tabs(Snap_Data &d) { return (d.wgt && d.wgt->parent && d.wgt->parent->is_a(FLD_NODE_TYPE_Tabs)); } -static Fl_Group *parent(fld::app::Snap_Data &d) { +static Fl_Group *parent(Snap_Data &d) { return (d.wgt->o->parent()); } @@ -1002,7 +1002,7 @@ static Fl_Group *parent(fld::app::Snap_Data &d) { \return -1 if this point is closer than any previous check, and this is the new distance to beat. */ -int fld::app::Snap_Action::check_x_(fld::app::Snap_Data &d, int x_ref, int x_snap) { +int Snap_Action::check_x_(Snap_Data &d, int x_ref, int x_snap) { int dd = x_ref + d.dx - x_snap; int d2 = abs(dd); if (d2 > d.x_dist) return 1; @@ -1015,9 +1015,9 @@ int fld::app::Snap_Action::check_x_(fld::app::Snap_Data &d, int x_ref, int x_sna /** \brief Check if a snap action has reached a preferred y position. - \see fld::app::Snap_Action::check_x_(fld::app::Snap_Data &d, int x_ref, int x_snap) + \see Snap_Action::check_x_(Snap_Data &d, int x_ref, int x_snap) */ -int fld::app::Snap_Action::check_y_(fld::app::Snap_Data &d, int y_ref, int y_snap) { +int Snap_Action::check_y_(Snap_Data &d, int y_ref, int y_snap) { int dd = y_ref + d.dy - y_snap; int d2 = abs(dd); if (d2 > d.y_dist) return 1; @@ -1030,9 +1030,9 @@ int fld::app::Snap_Action::check_y_(fld::app::Snap_Data &d, int y_ref, int y_sna /** \brief Check if a snap action has reached a preferred x and y position. - \see fld::app::Snap_Action::check_x_(fld::app::Snap_Data &d, int x_ref, int x_snap) + \see Snap_Action::check_x_(Snap_Data &d, int x_ref, int x_snap) */ -void fld::app::Snap_Action::check_x_y_(fld::app::Snap_Data &d, int x_ref, int x_snap, int y_ref, int y_snap) { +void Snap_Action::check_x_y_(Snap_Data &d, int x_ref, int x_snap, int y_ref, int y_snap) { int ddx = x_ref + d.dx - x_snap; int d2x = abs(ddx); int ddy = y_ref + d.dy - y_snap; @@ -1053,7 +1053,7 @@ void fld::app::Snap_Action::check_x_y_(fld::app::Snap_Data &d, int x_ref, int x_ should be drawn. \param[inout] d current event data */ -bool fld::app::Snap_Action::matches(fld::app::Snap_Data &d) { +bool Snap_Action::matches(Snap_Data &d) { switch (type) { case 1: return (d.drag & mask) && (eex == ex) && (d.dx == dx); case 2: return (d.drag & mask) && (eey == ey) && (d.dy == dy); @@ -1066,7 +1066,7 @@ bool fld::app::Snap_Action::matches(fld::app::Snap_Data &d) { \brief Run through all possible snap actions and store the winning coordinates in eex and eey. \param[inout] d current event data */ -void fld::app::Snap_Action::check_all(fld::app::Snap_Data &data) { +void Snap_Action::check_all(Snap_Data &data) { int i; for (i =0; list[i]; i++) { if (list[i]->mask & data.drag) @@ -1083,7 +1083,7 @@ void fld::app::Snap_Action::check_all(fld::app::Snap_Data &data) { coordinate, all of them will be drawn. \param[inout] d current event data */ -void fld::app::Snap_Action::draw_all(fld::app::Snap_Data &data) { +void Snap_Action::draw_all(Snap_Data &data) { int i; for (i =0; list[i]; i++) { if (list[i]->matches(data)) @@ -1092,8 +1092,8 @@ void fld::app::Snap_Action::draw_all(fld::app::Snap_Data &data) { } /** Return a sensible step size for resizing a widget. */ -void fld::app::Snap_Action::get_resize_stepsize(int &x_step, int &y_step) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; +void Snap_Action::get_resize_stepsize(int &x_step, int &y_step) { + Layout_Preset *layout = Fluid.proj.layout; if ((layout->widget_inc_w > 1) && (layout->widget_inc_h > 1)) { x_step = layout->widget_inc_w; y_step = layout->widget_inc_h; @@ -1107,8 +1107,8 @@ void fld::app::Snap_Action::get_resize_stepsize(int &x_step, int &y_step) { } /** Return a sensible step size for moving a widget. */ -void fld::app::Snap_Action::get_move_stepsize(int &x_step, int &y_step) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; +void Snap_Action::get_move_stepsize(int &x_step, int &y_step) { + Layout_Preset *layout = Fluid.proj.layout; if ((layout->group_grid_x > 1) && (layout->group_grid_y > 1)) { x_step = layout->group_grid_x; y_step = layout->group_grid_y; @@ -1122,8 +1122,8 @@ void fld::app::Snap_Action::get_move_stepsize(int &x_step, int &y_step) { } /** Fix the given size to the same or next bigger snap position. */ -void fld::app::Snap_Action::better_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; +void Snap_Action::better_size(int &w, int &h) { + Layout_Preset *layout = Fluid.proj.layout; int x_min = 1, y_min = 1, x_inc = 1, y_inc = 1; get_resize_stepsize(x_inc, y_inc); if (x_inc < 1) x_inc = 1; @@ -1148,7 +1148,7 @@ void fld::app::Snap_Action::better_size(int &w, int &h) { /** Base class for all actions that drag the left side or the entire widget. */ -class Fd_Snap_Left : public fld::app::Snap_Action { +class Fd_Snap_Left : public Snap_Action { public: Fd_Snap_Left() { type = 1; mask = FD_LEFT|FD_DRAG; } }; @@ -1156,7 +1156,7 @@ public: /** Base class for all actions that drag the right side or the entire widget. */ -class Fd_Snap_Right : public fld::app::Snap_Action { +class Fd_Snap_Right : public Snap_Action { public: Fd_Snap_Right() { type = 1; mask = FD_RIGHT|FD_DRAG; } }; @@ -1164,7 +1164,7 @@ public: /** Base class for all actions that drag the top side or the entire widget. */ -class Fd_Snap_Top : public fld::app::Snap_Action { +class Fd_Snap_Top : public Snap_Action { public: Fd_Snap_Top() { type = 2; mask = FD_TOP|FD_DRAG; } }; @@ -1172,7 +1172,7 @@ public: /** Base class for all actions that drag the bottom side or the entire widget. */ -class Fd_Snap_Bottom : public fld::app::Snap_Action { +class Fd_Snap_Bottom : public Snap_Action { public: Fd_Snap_Bottom() { type = 2; mask = FD_BOTTOM|FD_DRAG; } }; @@ -1184,8 +1184,8 @@ public: */ class Fd_Snap_Left_Window_Edge : public Fd_Snap_Left { public: - void check(fld::app::Snap_Data &d) { clr(); check_x_(d, d.bx, 0); } - void draw(fld::app::Snap_Data &d) { draw_left_brace(d.win->o); } + void check(Snap_Data &d) { clr(); check_x_(d, d.bx, 0); } + void draw(Snap_Data &d) { draw_left_brace(d.win->o); } }; Fd_Snap_Left_Window_Edge snap_left_window_edge; @@ -1194,8 +1194,8 @@ Fd_Snap_Left_Window_Edge snap_left_window_edge; */ class Fd_Snap_Right_Window_Edge : public Fd_Snap_Right { public: - void check(fld::app::Snap_Data &d) { clr(); check_x_(d, d.br, d.win->o->w()); } - void draw(fld::app::Snap_Data &d) { draw_right_brace(d.win->o); } + void check(Snap_Data &d) { clr(); check_x_(d, d.br, d.win->o->w()); } + void draw(Snap_Data &d) { draw_right_brace(d.win->o); } }; Fd_Snap_Right_Window_Edge snap_right_window_edge; @@ -1204,8 +1204,8 @@ Fd_Snap_Right_Window_Edge snap_right_window_edge; */ class Fd_Snap_Top_Window_Edge : public Fd_Snap_Top { public: - void check(fld::app::Snap_Data &d) { clr(); check_y_(d, d.by, 0); } - void draw(fld::app::Snap_Data &d) { draw_top_brace(d.win->o); } + void check(Snap_Data &d) { clr(); check_y_(d, d.by, 0); } + void draw(Snap_Data &d) { draw_top_brace(d.win->o); } }; Fd_Snap_Top_Window_Edge snap_top_window_edge; @@ -1214,8 +1214,8 @@ Fd_Snap_Top_Window_Edge snap_top_window_edge; */ class Fd_Snap_Bottom_Window_Edge : public Fd_Snap_Bottom { public: - void check(fld::app::Snap_Data &d) { clr(); check_y_(d, d.bt, d.win->o->h()); } - void draw(fld::app::Snap_Data &d) { draw_bottom_brace(d.win->o); } + void check(Snap_Data &d) { clr(); check_y_(d, d.bt, d.win->o->h()); } + void draw(Snap_Data &d) { draw_bottom_brace(d.win->o); } }; Fd_Snap_Bottom_Window_Edge snap_bottom_window_edge; @@ -1224,11 +1224,11 @@ Fd_Snap_Bottom_Window_Edge snap_bottom_window_edge; */ class Fd_Snap_Left_Window_Margin : public Fd_Snap_Left { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_window(d)) check_x_(d, d.bx, Fluid.proj.layout->left_window_margin); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_h_arrow(d.bx, (d.by+d.bt)/2, 0); } }; @@ -1236,11 +1236,11 @@ Fd_Snap_Left_Window_Margin snap_left_window_margin; class Fd_Snap_Right_Window_Margin : public Fd_Snap_Right { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_window(d)) check_x_(d, d.br, d.win->o->w()-Fluid.proj.layout->right_window_margin); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_h_arrow(d.br, (d.by+d.bt)/2, d.win->o->w()-1); } }; @@ -1248,11 +1248,11 @@ Fd_Snap_Right_Window_Margin snap_right_window_margin; class Fd_Snap_Top_Window_Margin : public Fd_Snap_Top { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_window(d)) check_y_(d, d.by, Fluid.proj.layout->top_window_margin); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_v_arrow((d.bx+d.br)/2, d.by, 0); } }; @@ -1260,11 +1260,11 @@ Fd_Snap_Top_Window_Margin snap_top_window_margin; class Fd_Snap_Bottom_Window_Margin : public Fd_Snap_Bottom { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_window(d)) check_y_(d, d.bt, d.win->o->h()-Fluid.proj.layout->bottom_window_margin); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_v_arrow((d.bx+d.br)/2, d.bt, d.win->o->h()-1); } }; @@ -1277,11 +1277,11 @@ Fd_Snap_Bottom_Window_Margin snap_bottom_window_margin; */ class Fd_Snap_Left_Group_Edge : public Fd_Snap_Left { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_group(d)) check_x_(d, d.bx, parent(d)->x()); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_left_brace(parent(d)); } }; @@ -1289,11 +1289,11 @@ Fd_Snap_Left_Group_Edge snap_left_group_edge; class Fd_Snap_Right_Group_Edge : public Fd_Snap_Right { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_group(d)) check_x_(d, d.br, parent(d)->x() + parent(d)->w()); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_right_brace(parent(d)); } }; @@ -1301,11 +1301,11 @@ Fd_Snap_Right_Group_Edge snap_right_group_edge; class Fd_Snap_Top_Group_Edge : public Fd_Snap_Top { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_group(d)) check_y_(d, d.by, parent(d)->y()); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_top_brace(parent(d)); } }; @@ -1313,11 +1313,11 @@ Fd_Snap_Top_Group_Edge snap_top_group_edge; class Fd_Snap_Bottom_Group_Edge : public Fd_Snap_Bottom { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_group(d)) check_y_(d, d.bt, parent(d)->y() + parent(d)->h()); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_bottom_brace(parent(d)); } }; @@ -1329,11 +1329,11 @@ Fd_Snap_Bottom_Group_Edge snap_bottom_group_edge; */ class Fd_Snap_Left_Group_Margin : public Fd_Snap_Left { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_group(d)) check_x_(d, d.bx, parent(d)->x() + Fluid.proj.layout->left_group_margin); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_left_brace(parent(d)); draw_h_arrow(d.bx, (d.by+d.bt)/2, parent(d)->x()); } @@ -1342,11 +1342,11 @@ Fd_Snap_Left_Group_Margin snap_left_group_margin; class Fd_Snap_Right_Group_Margin : public Fd_Snap_Right { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_group(d)) check_x_(d, d.br, parent(d)->x()+parent(d)->w()-Fluid.proj.layout->right_group_margin); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_right_brace(parent(d)); draw_h_arrow(d.br, (d.by+d.bt)/2, parent(d)->x()+parent(d)->w()-1); } @@ -1355,11 +1355,11 @@ Fd_Snap_Right_Group_Margin snap_right_group_margin; class Fd_Snap_Top_Group_Margin : public Fd_Snap_Top { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_group(d) && !in_tabs(d)) check_y_(d, d.by, parent(d)->y()+Fluid.proj.layout->top_group_margin); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_top_brace(parent(d)); draw_v_arrow((d.bx+d.br)/2, d.by, parent(d)->y()); } @@ -1368,11 +1368,11 @@ Fd_Snap_Top_Group_Margin snap_top_group_margin; class Fd_Snap_Bottom_Group_Margin : public Fd_Snap_Bottom { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_group(d) && !in_tabs(d)) check_y_(d, d.bt, parent(d)->y()+parent(d)->h()-Fluid.proj.layout->bottom_group_margin); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_bottom_brace(parent(d)); draw_v_arrow((d.bx+d.br)/2, d.bt, parent(d)->y()+parent(d)->h()-1); } @@ -1386,7 +1386,7 @@ Fd_Snap_Bottom_Group_Margin snap_bottom_group_margin; */ class Fd_Snap_Top_Tabs_Margin : public Fd_Snap_Top_Group_Margin { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_tabs(d)) check_y_(d, d.by, parent(d)->y()+Fluid.proj.layout->top_tabs_margin); } @@ -1395,7 +1395,7 @@ Fd_Snap_Top_Tabs_Margin snap_top_tabs_margin; class Fd_Snap_Bottom_Tabs_Margin : public Fd_Snap_Bottom_Group_Margin { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { clr(); if (in_tabs(d)) check_y_(d, d.bt, parent(d)->y()+parent(d)->h()-Fluid.proj.layout->bottom_tabs_margin); } @@ -1407,12 +1407,12 @@ Fd_Snap_Bottom_Tabs_Margin snap_bottom_tabs_margin; /** Base class for grid based snapping. */ -class Fd_Snap_Grid : public fld::app::Snap_Action { +class Fd_Snap_Grid : public Snap_Action { protected: int nearest_x, nearest_y; public: Fd_Snap_Grid() { type = 3; mask = FD_LEFT|FD_TOP|FD_DRAG; } - void check_grid(fld::app::Snap_Data &d, int left, int grid_x, int right, int top, int grid_y, int bottom) { + void check_grid(Snap_Data &d, int left, int grid_x, int right, int top, int grid_y, int bottom) { if ((grid_x <= 1) || (grid_y <= 1)) return; int suggested_x = d.bx + d.dx; nearest_x = nearest(suggested_x, left, grid_x, right); @@ -1425,7 +1425,7 @@ public: else check_x_y_(d, d.bx, nearest_x, d.by, nearest_y); } - bool matches(fld::app::Snap_Data &d) { + bool matches(Snap_Data &d) { if (d.drag == FD_LEFT) return (eex == ex); if (d.drag == FD_TOP) return (eey == ey) && (d.dx == dx); return (d.drag & mask) && (eex == ex) && (d.dx == dx) && (eey == ey) && (d.dy == dy); @@ -1437,14 +1437,14 @@ public: */ class Fd_Snap_Window_Grid : public Fd_Snap_Grid { public: - void check(fld::app::Snap_Data &d) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + void check(Snap_Data &d) { + Layout_Preset *layout = Fluid.proj.layout; clr(); if (in_window(d)) check_grid(d, layout->left_window_margin, layout->window_grid_x, d.win->o->w()-layout->right_window_margin, layout->top_window_margin, layout->window_grid_y, d.win->o->h()-layout->bottom_window_margin); } - void draw(fld::app::Snap_Data &d) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + void draw(Snap_Data &d) { + Layout_Preset *layout = Fluid.proj.layout; draw_grid(nearest_x, nearest_y, layout->window_grid_x, layout->window_grid_y); } }; @@ -1455,17 +1455,17 @@ Fd_Snap_Window_Grid snap_window_grid; */ class Fd_Snap_Group_Grid : public Fd_Snap_Grid { public: - void check(fld::app::Snap_Data &d) { + void check(Snap_Data &d) { if (in_group(d)) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; clr(); Fl_Widget *g = parent(d); check_grid(d, g->x()+layout->left_group_margin, layout->group_grid_x, g->x()+g->w()-layout->right_group_margin, g->y()+layout->top_group_margin, layout->group_grid_y, g->y()+g->h()-layout->bottom_group_margin); } } - void draw(fld::app::Snap_Data &d) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + void draw(Snap_Data &d) { + Layout_Preset *layout = Fluid.proj.layout; draw_grid(nearest_x, nearest_y, layout->group_grid_x, layout->group_grid_y); } }; @@ -1476,13 +1476,13 @@ Fd_Snap_Group_Grid snap_group_grid; /** Base class the check distance to other widgets in the same group. */ -class Fd_Snap_Sibling : public fld::app::Snap_Action { +class Fd_Snap_Sibling : public Snap_Action { protected: Fl_Widget *best_match; public: Fd_Snap_Sibling() : best_match(0) { } - virtual int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) = 0; - void check(fld::app::Snap_Data &d) { + virtual int sibling_check(Snap_Data &d, Fl_Widget *s) = 0; + void check(Snap_Data &d) { clr(); best_match = 0; if (!d.wgt) return; @@ -1517,10 +1517,10 @@ public: class Fd_Snap_Siblings_Left_Same : public Fd_Snap_Sibling { public: Fd_Snap_Siblings_Left_Same() { type = 1; mask = FD_LEFT|FD_DRAG; } - int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + int sibling_check(Snap_Data &d, Fl_Widget *s) { return check_x_(d, d.bx, s->x()); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { if (best_match) draw_left_brace(best_match); } }; @@ -1532,11 +1532,11 @@ Fd_Snap_Siblings_Left_Same snap_siblings_left_same; class Fd_Snap_Siblings_Left : public Fd_Snap_Sibling { public: Fd_Snap_Siblings_Left() { type = 1; mask = FD_LEFT|FD_DRAG; } - int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + int sibling_check(Snap_Data &d, Fl_Widget *s) { return MIN(check_x_(d, d.bx, s->x()+s->w()), check_x_(d, d.bx, s->x()+s->w()+Fluid.proj.layout->widget_gap_x) ); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { if (best_match) draw_right_brace(best_match); } }; @@ -1545,10 +1545,10 @@ Fd_Snap_Siblings_Left snap_siblings_left; class Fd_Snap_Siblings_Right_Same : public Fd_Snap_Sibling { public: Fd_Snap_Siblings_Right_Same() { type = 1; mask = FD_RIGHT|FD_DRAG; } - int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + int sibling_check(Snap_Data &d, Fl_Widget *s) { return check_x_(d, d.br, s->x()+s->w()); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { if (best_match) draw_right_brace(best_match); } }; @@ -1557,11 +1557,11 @@ Fd_Snap_Siblings_Right_Same snap_siblings_right_same; class Fd_Snap_Siblings_Right : public Fd_Snap_Sibling { public: Fd_Snap_Siblings_Right() { type = 1; mask = FD_RIGHT|FD_DRAG; } - int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + int sibling_check(Snap_Data &d, Fl_Widget *s) { return MIN(check_x_(d, d.br, s->x()), check_x_(d, d.br, s->x()-Fluid.proj.layout->widget_gap_x)); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { if (best_match) draw_left_brace(best_match); } }; @@ -1570,10 +1570,10 @@ Fd_Snap_Siblings_Right snap_siblings_right; class Fd_Snap_Siblings_Top_Same : public Fd_Snap_Sibling { public: Fd_Snap_Siblings_Top_Same() { type = 2; mask = FD_TOP|FD_DRAG; } - int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + int sibling_check(Snap_Data &d, Fl_Widget *s) { return check_y_(d, d.by, s->y()); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { if (best_match) draw_top_brace(best_match); } }; @@ -1582,11 +1582,11 @@ Fd_Snap_Siblings_Top_Same snap_siblings_top_same; class Fd_Snap_Siblings_Top : public Fd_Snap_Sibling { public: Fd_Snap_Siblings_Top() { type = 2; mask = FD_TOP|FD_DRAG; } - int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + int sibling_check(Snap_Data &d, Fl_Widget *s) { return MIN(check_y_(d, d.by, s->y()+s->h()), check_y_(d, d.by, s->y()+s->h()+Fluid.proj.layout->widget_gap_y)); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { if (best_match) draw_bottom_brace(best_match); } }; @@ -1595,10 +1595,10 @@ Fd_Snap_Siblings_Top snap_siblings_top; class Fd_Snap_Siblings_Bottom_Same : public Fd_Snap_Sibling { public: Fd_Snap_Siblings_Bottom_Same() { type = 2; mask = FD_BOTTOM|FD_DRAG; } - int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + int sibling_check(Snap_Data &d, Fl_Widget *s) { return check_y_(d, d.bt, s->y()+s->h()); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { if (best_match) draw_bottom_brace(best_match); } }; @@ -1607,11 +1607,11 @@ Fd_Snap_Siblings_Bottom_Same snap_siblings_bottom_same; class Fd_Snap_Siblings_Bottom : public Fd_Snap_Sibling { public: Fd_Snap_Siblings_Bottom() { type = 2; mask = FD_BOTTOM|FD_DRAG; } - int sibling_check(fld::app::Snap_Data &d, Fl_Widget *s) { + int sibling_check(Snap_Data &d, Fl_Widget *s) { return MIN(check_y_(d, d.bt, s->y()), check_y_(d, d.bt, s->y()-Fluid.proj.layout->widget_gap_y)); } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { if (best_match) draw_top_brace(best_match); } }; @@ -1623,11 +1623,11 @@ Fd_Snap_Siblings_Bottom snap_siblings_bottom; /** Snap horizontal resizing to min_w or min_w and a multiple of inc_w. */ -class Fd_Snap_Widget_Ideal_Width : public fld::app::Snap_Action { +class Fd_Snap_Widget_Ideal_Width : public Snap_Action { public: Fd_Snap_Widget_Ideal_Width() { type = 1; mask = FD_LEFT|FD_RIGHT; } - void check(fld::app::Snap_Data &d) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + void check(Snap_Data &d) { + Layout_Preset *layout = Fluid.proj.layout; clr(); if (!d.wgt) return; int iw = 15, ih = 15; @@ -1644,17 +1644,17 @@ public: check_x_(d, d.bx, d.br-iw); } } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_width(d.bx, d.bt+7, d.br, 0); } }; Fd_Snap_Widget_Ideal_Width snap_widget_ideal_width; -class Fd_Snap_Widget_Ideal_Height : public fld::app::Snap_Action { +class Fd_Snap_Widget_Ideal_Height : public Snap_Action { public: Fd_Snap_Widget_Ideal_Height() { type = 2; mask = FD_TOP|FD_BOTTOM; } - void check(fld::app::Snap_Data &d) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + void check(Snap_Data &d) { + Layout_Preset *layout = Fluid.proj.layout; clr(); if (!d.wgt) return; int iw, ih; @@ -1671,7 +1671,7 @@ public: check_y_(d, d.by, d.bt-ih); } } - void draw(fld::app::Snap_Data &d) { + void draw(Snap_Data &d) { draw_height(d.br+7, d.by, d.bt, 0); } }; @@ -1686,7 +1686,7 @@ Fd_Snap_Widget_Ideal_Height snap_widget_ideal_height; action in the list wins. All snap actions with the same distance and same winning coordinates are drawn in the overlay plane. */ -fld::app::Snap_Action *fld::app::Snap_Action::list[] = { +Snap_Action *Snap_Action::list[] = { &snap_left_window_edge, &snap_right_window_edge, &snap_top_window_edge, diff --git a/fluid/app/Snap_Action.h b/fluid/app/Snap_Action.h index 7c1e3fabc..f48b1490a 100644 --- a/fluid/app/Snap_Action.h +++ b/fluid/app/Snap_Action.h @@ -26,15 +26,8 @@ class Fl_Preferences; extern Fl_Menu_Item main_layout_submenu_[]; -namespace fld { -namespace io { -class Project_Reader; // fld::io:: -class Project_Writer; // fld::io:: -} // namespace io -} // namespace fld - -namespace fld { -namespace app { +class Project_Reader; +class Project_Writer; /** \brief Collection of layout settings. @@ -77,8 +70,8 @@ public: void write(Fl_Preferences &prefs); void read(Fl_Preferences &prefs); - void write(fld::io::Project_Writer*); - void read(fld::io::Project_Reader*); + void write(Project_Writer*); + void read(Project_Reader*); int textsize_not_null(); }; @@ -98,13 +91,13 @@ public: char *name_; ///< name of the suite char *menu_label; ///< label text used in pulldown menu Layout_Preset *layout[3]; ///< presets for application, dialog, and toolbox windows - fld::Tool_Store storage_; ///< storage location (see FLD_TOOL_STORE_INTERNAL, etc.) + Tool_Store storage_; ///< storage location (see FLD_TOOL_STORE_INTERNAL, etc.) void write(Fl_Preferences &prefs); void read(Fl_Preferences &prefs); - void write(fld::io::Project_Writer*); - void read(fld::io::Project_Reader*); + void write(Project_Writer*); + void read(Project_Reader*); void update_label(); - void storage(fld::Tool_Store s) { storage_ = s; update_label(); } + void storage(Tool_Store s) { storage_ = s; update_label(); } void name(const char *n); void init(); ~Layout_Suite(); @@ -147,13 +140,13 @@ public: int load(const char *filename); int save(const char *filename); - void write(Fl_Preferences &prefs, fld::Tool_Store storage); - void read(Fl_Preferences &prefs, fld::Tool_Store storage); - void write(fld::io::Project_Writer*); - void read(fld::io::Project_Reader*); + void write(Fl_Preferences &prefs, Tool_Store storage); + void read(Fl_Preferences &prefs, Tool_Store storage); + void write(Project_Writer*); + void read(Project_Reader*); int add(Layout_Suite*); void remove(int index); - void remove_all(fld::Tool_Store storage); + void remove_all(Tool_Store storage); Layout_Preset *at(int); int size(); }; @@ -198,8 +191,6 @@ public: static void better_size(int &w, int &h); }; -} // namespace app -} // namespace fld #endif // _FLUID_FD_SNAP_ACTION_H diff --git a/fluid/app/args.cxx b/fluid/app/args.cxx index 70faebafc..ef7652060 100644 --- a/fluid/app/args.cxx +++ b/fluid/app/args.cxx @@ -26,7 +26,7 @@ #include "../src/flstring.h" -fld::app::Args::Args() +Args::Args() : update_file(0), compile_file(0), compile_strings(0), @@ -46,7 +46,7 @@ fld::app::Args::Args() \return 0 if the args were handled successfully, -1 if there was an error and the usage message was shown. */ -int fld::app::Args::load(int argc, char **argv) { +int Args::load(int argc, char **argv) { int i = 1; Fl::args_to_utf8(argc, argv); // for MSYS2/MinGW if ( (Fl::args(argc, argv, i, arg_cb) == 0) // unsupported argument found @@ -79,7 +79,7 @@ int fld::app::Args::load(int argc, char **argv) { } -int fld::app::Args::arg_cb(int argc, char** argv, int& i) { +int Args::arg_cb(int argc, char** argv, int& i) { return Fluid.args.arg(argc, argv, i); } @@ -91,7 +91,7 @@ int fld::app::Args::arg_cb(int argc, char** argv, int& i) { \param[inout] i current argument index \return number of arguments used; if 0, the argument is not supported */ -int fld::app::Args::arg(int argc, char** argv, int& i) { +int Args::arg(int argc, char** argv, int& i) { if (argv[i][0] != '-') return 0; if (argv[i][1] == 'd' && !argv[i][2]) { diff --git a/fluid/app/args.h b/fluid/app/args.h index 1165c4f58..601cc91c9 100644 --- a/fluid/app/args.h +++ b/fluid/app/args.h @@ -19,9 +19,6 @@ #include <FL/filename.H> -namespace fld { -namespace app { - class Args { // Callback. static int arg_cb(int argc, char** argv, int& i); @@ -48,7 +45,4 @@ public: int load(int argc, char **argv); }; -} // namespace app -} // namespace fld - #endif // FLUID_APP_ARGS_H diff --git a/fluid/app/history.cxx b/fluid/app/history.cxx index 91b2f0b99..3b252598d 100644 --- a/fluid/app/history.cxx +++ b/fluid/app/history.cxx @@ -22,7 +22,7 @@ #include "../src/flstring.h" -fld::app::History::History() { +History::History() { int i, j; for (i = 0; i < 10; i++) { for (j = 0; j < FL_PATH_MAX; j++) { @@ -40,7 +40,7 @@ fld::app::History::History() { It also computes and stores the relative filepaths for display in the main menu. */ -void fld::app::History::load() { +void History::load() { int i; int max_files; @@ -71,7 +71,7 @@ void fld::app::History::load() { \param[in] project_file path and filename of .fl project file, will be converted into an absolute file path based on the current working directory. */ -void fld::app::History::update(const char *project_file) { +void History::update(const char *project_file) { int i; int max_files; diff --git a/fluid/app/history.h b/fluid/app/history.h index 99200757a..92e494226 100644 --- a/fluid/app/history.h +++ b/fluid/app/history.h @@ -19,9 +19,6 @@ #include <FL/filename.H> -namespace fld { -namespace app { - class History { public: /// Stores the absolute filename of the last 10 project files, saved in app preferences. @@ -36,7 +33,4 @@ public: void update(const char *project_file); }; -} // namespace app -} // namespace fld - #endif // FLUID_APP_HISTORY_H diff --git a/fluid/app/shell_command.cxx b/fluid/app/shell_command.cxx index 0a9a04121..fc5d0ffe9 100644 --- a/fluid/app/shell_command.cxx +++ b/fluid/app/shell_command.cxx @@ -441,7 +441,7 @@ Fd_Shell_Command::Fd_Shell_Command(const char *in_name) Fd_Shell_Command::Fd_Shell_Command(const char *in_name, const char *in_label, Fl_Shortcut in_shortcut, - fld::Tool_Store in_storage, + Tool_Store in_storage, int in_condition, const char *in_condition_data, const char *in_command, @@ -561,7 +561,7 @@ void Fd_Shell_Command::read(Fl_Preferences &prefs) { prefs.get("shortcut", tmp, 0); shortcut = (Fl_Shortcut)tmp; prefs.get("storage", tmp, -1); - if (tmp != -1) storage = (fld::Tool_Store)tmp; + if (tmp != -1) storage = (Tool_Store)tmp; prefs.get("condition", condition, ALWAYS); prefs.get("condition_data", str_ptr, ""); @@ -586,7 +586,7 @@ void Fd_Shell_Command::write(Fl_Preferences &prefs, int save_location) { if (flags != 0) prefs.set("flags", flags); } -void Fd_Shell_Command::read(class fld::io::Project_Reader *in) { +void Fd_Shell_Command::read(class Project_Reader *in) { const char *c = in->read_word(1); if (strcmp(c, "{")!=0) return; // expecting start of group storage = FLD_TOOL_STORE_PROJECT; @@ -612,7 +612,7 @@ void Fd_Shell_Command::read(class fld::io::Project_Reader *in) { } } -void Fd_Shell_Command::write(class fld::io::Project_Writer *out) { +void Fd_Shell_Command::write(class Project_Writer *out) { out->write_string("\n command {"); out->write_string("\n name "); out->write_word(name ? name : ""); out->write_string("\n label "); out->write_word(label ? label : ""); @@ -676,7 +676,7 @@ void Fd_Shell_Command_List::clear() { /** remove all shell commands of the given storage location from the list. */ -void Fd_Shell_Command_List::clear(fld::Tool_Store storage) { +void Fd_Shell_Command_List::clear(Tool_Store storage) { int i; for (i=list_size-1; i>=0; i--) { if (list[i]->storage == storage) { @@ -688,7 +688,7 @@ void Fd_Shell_Command_List::clear(fld::Tool_Store storage) { /** Read shell configuration from a preferences group. */ -void Fd_Shell_Command_List::read(Fl_Preferences &prefs, fld::Tool_Store storage) { +void Fd_Shell_Command_List::read(Fl_Preferences &prefs, Tool_Store storage) { int i, n; // import the old shell commands from previous user settings if (&Fluid.preferences == &prefs) { @@ -729,7 +729,7 @@ void Fd_Shell_Command_List::read(Fl_Preferences &prefs, fld::Tool_Store storage) /** Write shell configuration to a preferences group. */ -void Fd_Shell_Command_List::write(Fl_Preferences &prefs, fld::Tool_Store storage) { +void Fd_Shell_Command_List::write(Fl_Preferences &prefs, Tool_Store storage) { int i, index; Fl_Preferences shell_commands(prefs, "shell_commands"); shell_commands.delete_all_groups(); @@ -745,7 +745,7 @@ void Fd_Shell_Command_List::write(Fl_Preferences &prefs, fld::Tool_Store storage /** Read shell configuration from a project file. */ -void Fd_Shell_Command_List::read(fld::io::Project_Reader *in) { +void Fd_Shell_Command_List::read(Project_Reader *in) { const char *c = in->read_word(1); if (strcmp(c, "{")!=0) return; // expecting start of group clear(FLD_TOOL_STORE_PROJECT); @@ -765,7 +765,7 @@ void Fd_Shell_Command_List::read(fld::io::Project_Reader *in) { /** Write shell configuration to a project file. */ -void Fd_Shell_Command_List::write(fld::io::Project_Writer *out) { +void Fd_Shell_Command_List::write(Project_Writer *out) { int i, n_in_project_file = 0; for (i=0; i<list_size; i++) { if (list[i]->storage == FLD_TOOL_STORE_PROJECT) diff --git a/fluid/app/shell_command.h b/fluid/app/shell_command.h index 716a87349..234477151 100644 --- a/fluid/app/shell_command.h +++ b/fluid/app/shell_command.h @@ -34,15 +34,9 @@ # include <unistd.h> #endif -namespace fld { -namespace io { - class Project_Reader; class Project_Writer; -} // namespace io -} // namespace fld - struct Fl_Menu_Item; class Fl_Widget; class Fl_Preferences; @@ -93,7 +87,7 @@ public: char *name; char *label; Fl_Shortcut shortcut; - fld::Tool_Store storage; + Tool_Store storage; int condition; char *condition_data; char *command; @@ -106,7 +100,7 @@ public: Fd_Shell_Command(const char *in_name, const char *in_label, Fl_Shortcut in_shortcut, - fld::Tool_Store in_storage, + Tool_Store in_storage, int in_condition, const char *in_condition_data, const char *in_command, @@ -121,8 +115,8 @@ public: void run(); void read(Fl_Preferences &prefs); void write(Fl_Preferences &prefs, int save_location); - void read(class fld::io::Project_Reader*); - void write(class fld::io::Project_Writer*); + void read(class Project_Reader*); + void write(class Project_Writer*); void update_shell_menu(); int is_active(); }; @@ -142,11 +136,11 @@ public: void insert(int index, Fd_Shell_Command *cmd); void remove(int index); void clear(); - void clear(fld::Tool_Store store); - void read(Fl_Preferences &prefs, fld::Tool_Store storage); - void write(Fl_Preferences &prefs, fld::Tool_Store storage); - void read(class fld::io::Project_Reader*); - void write(class fld::io::Project_Writer*); + void clear(Tool_Store store); + void read(Fl_Preferences &prefs, Tool_Store storage); + void write(Fl_Preferences &prefs, Tool_Store storage); + void read(class Project_Reader*); + void write(class Project_Writer*); void rebuild_shell_menu(); void update_settings_dialog(); diff --git a/fluid/app/templates.cxx b/fluid/app/templates.cxx index 9b2253001..96534ae01 100644 --- a/fluid/app/templates.cxx +++ b/fluid/app/templates.cxx @@ -32,7 +32,7 @@ Save a design template. \todo We should document the concept of templates. */ -void fld::app::save_template() { +void save_template() { // Setup the template panel... if (!template_panel) make_template_panel(); @@ -93,7 +93,7 @@ void fld::app::save_template() { "Replace", 0, c) == 0) return; } - if (!fld::io::write_file(Fluid.proj, filename)) { + if (!write_file(Fluid.proj, filename)) { fl_alert("Error writing %s: %s", filename, strerror(errno)); return; } diff --git a/fluid/app/templates.h b/fluid/app/templates.h index cedec9f76..2f4d972d0 100644 --- a/fluid/app/templates.h +++ b/fluid/app/templates.h @@ -17,13 +17,7 @@ #ifndef FLUID_APP_TEMPLATES_H #define FLUID_APP_TEMPLATES_H -namespace fld { -namespace app { - void save_template(); -} // namespace app -} // namespace fld - #endif // FLUID_APP_TEMPLATES_H diff --git a/fluid/fld_tool_store.h b/fluid/fld_tool_store.h index cfe325def..3f16ba68e 100644 --- a/fluid/fld_tool_store.h +++ b/fluid/fld_tool_store.h @@ -10,16 +10,12 @@ #ifndef FLUID_FLD_TOOL_STORE_H #define FLUID_FLD_TOOL_STORE_H -namespace fld { - /** Indicate the storage location for tools like layout suites and shell macros. \see class Fd_Shell_Command, class Layout_Suite */ typedef int Tool_Store; -} // namespace fld - enum { FLD_TOOL_STORE_INTERNAL = 0, ///< stored inside FLUID app FLD_TOOL_STORE_USER, ///< suite is stored in the user wide FLUID settings diff --git a/fluid/io/Code_Writer.cxx b/fluid/io/Code_Writer.cxx index ffa63514a..f81da6ca7 100644 --- a/fluid/io/Code_Writer.cxx +++ b/fluid/io/Code_Writer.cxx @@ -141,7 +141,7 @@ int is_id(char c) { \param[in] label else if label is set, it is appended, skipping non-keyword characters \return buffer to a unique identifier, managed by Code_Writer, so caller must NOT free() it */ -const char* fld::io::Code_Writer::unique_id(void* o, const char* type, const char* name, const char* label) { +const char* Code_Writer::unique_id(void* o, const char* type, const char* name, const char* label) { char buffer[128]; char* q = buffer; char* q_end = q + 128 - 8 - 1; // room for hex number and NUL @@ -186,7 +186,7 @@ const char* fld::io::Code_Writer::unique_id(void* o, const char* type, const cha \param[in] set generate this indent depth \return pointer to a static string */ -const char *fld::io::Code_Writer::indent(int set) { +const char *Code_Writer::indent(int set) { static const char* spaces = " "; int i = set * 2; if (i>64) i = 64; @@ -198,7 +198,7 @@ const char *fld::io::Code_Writer::indent(int set) { Return a C string that indents code to the current source file depth. \return pointer to a static string */ -const char *fld::io::Code_Writer::indent() { +const char *Code_Writer::indent() { return indent(indentation); } @@ -208,7 +208,7 @@ const char *fld::io::Code_Writer::indent() { change the `indentation` variable; offset can be negative \return pointer to a static string */ -const char *fld::io::Code_Writer::indent_plus(int offset) { +const char *Code_Writer::indent_plus(int offset) { return indent(indentation+offset); } @@ -219,7 +219,7 @@ const char *fld::io::Code_Writer::indent_plus(int offset) { \param[in] format printf-style formatting text, followed by a vararg list \return 1 if the text was written to the file, 0 if it was previously written. */ -int fld::io::Code_Writer::write_h_once(const char *format, ...) { +int Code_Writer::write_h_once(const char *format, ...) { va_list args; char buf[1024]; va_start(args, format); @@ -239,7 +239,7 @@ int fld::io::Code_Writer::write_h_once(const char *format, ...) { \param[in] format printf-style formatting text, followed by a vararg list \return 1 if the text was written to the file, 0 if it was previously written. */ -int fld::io::Code_Writer::write_c_once(const char *format, ...) { +int Code_Writer::write_c_once(const char *format, ...) { va_list args; char buf[1024]; va_start(args, format); @@ -264,7 +264,7 @@ int fld::io::Code_Writer::write_c_once(const char *format, ...) { \param[in] pp ay pointer \return true if found in the tree, false if added to the tree */ -bool fld::io::Code_Writer::c_contains(void *pp) { +bool Code_Writer::c_contains(void *pp) { if (ptr_in_code.contains(pp)) { return true; } @@ -289,7 +289,7 @@ bool fld::io::Code_Writer::c_contains(void *pp) { \see f.write_cstring(const char*) */ -void fld::io::Code_Writer::write_cstring(const char *s, int length) { +void Code_Writer::write_cstring(const char *s, int length) { const char *next_line = "\"\n\""; if (varused_test) { varused = 1; @@ -370,7 +370,7 @@ void fld::io::Code_Writer::write_cstring(const char *s, int length) { \param[in] s write this string \see f.write_cstring(const char*, int) */ -void fld::io::Code_Writer::write_cstring(const char *s) { +void Code_Writer::write_cstring(const char *s) { write_cstring(s, (int)strlen(s)); } @@ -382,7 +382,7 @@ void fld::io::Code_Writer::write_cstring(const char *s) { \param[in] s a block of binary data, interpreted as unsigned bytes \param[in] length size of the block in bytes */ -void fld::io::Code_Writer::write_cdata(const char *s, int length) { +void Code_Writer::write_cdata(const char *s, int length) { if (varused_test) { varused = 1; return; @@ -420,7 +420,7 @@ void fld::io::Code_Writer::write_cdata(const char *s, int length) { \param[in] format printf-style formatting text \param[in] args list of arguments */ -void fld::io::Code_Writer::vwrite_c(const char* format, va_list args) { +void Code_Writer::vwrite_c(const char* format, va_list args) { if (varused_test) { varused = 1; return; @@ -432,7 +432,7 @@ void fld::io::Code_Writer::vwrite_c(const char* format, va_list args) { Print a formatted line to the source file. \param[in] format printf-style formatting text, followed by a vararg list */ -void fld::io::Code_Writer::write_c(const char* format,...) { +void Code_Writer::write_c(const char* format,...) { va_list args; va_start(args, format); vwrite_c(format, args); @@ -447,7 +447,7 @@ void fld::io::Code_Writer::write_c(const char* format,...) { \param[in] c line of code \param[in] com optional commentary */ -void fld::io::Code_Writer::write_cc(const char *indent, int n, const char *c, const char *com) { +void Code_Writer::write_cc(const char *indent, int n, const char *c, const char *com) { write_c("%s%.*s", indent, n, c); char cc = c[n-1]; if (cc!='}' && cc!=';') @@ -461,7 +461,7 @@ void fld::io::Code_Writer::write_cc(const char *indent, int n, const char *c, co Print a formatted line to the header file. \param[in] format printf-style formatting text, followed by a vararg list */ -void fld::io::Code_Writer::write_h(const char* format,...) { +void Code_Writer::write_h(const char* format,...) { if (varused_test) return; va_list args; va_start(args, format); @@ -477,7 +477,7 @@ void fld::io::Code_Writer::write_h(const char* format,...) { \param[in] c line of code \param[in] com optional commentary */ -void fld::io::Code_Writer::write_hc(const char *indent, int n, const char* c, const char *com) { +void Code_Writer::write_hc(const char *indent, int n, const char* c, const char *com) { write_h("%s%.*s", indent, n, c); char cc = c[n-1]; if (cc!='}' && cc!=';') @@ -494,7 +494,7 @@ void fld::io::Code_Writer::write_hc(const char *indent, int n, const char* c, co \param[in] inTrailWith append this character if the last line did not end with a newline, usually 0 or newline. */ -void fld::io::Code_Writer::write_c_indented(const char *textlines, int inIndent, char inTrailWith) { +void Code_Writer::write_c_indented(const char *textlines, int inIndent, char inTrailWith) { if (textlines) { indentation += inIndent; for (;;) { @@ -567,7 +567,7 @@ bool is_comment_before_class_member(Node *q) { \param[in] p write this type and all its children \return pointer to the next sibling */ -Node* fld::io::Code_Writer::write_static(Node* p) { +Node* Code_Writer::write_static(Node* p) { if (write_codeview) p->header_static_start = (int)ftell(header_file); if (write_codeview) p->code_static_start = (int)ftell(code_file); p->write_static(*this); @@ -589,7 +589,7 @@ Node* fld::io::Code_Writer::write_static(Node* p) { \param[in] p write this node and all its children \return pointer to the next sibling */ -Node* fld::io::Code_Writer::write_code(Node* p) { +Node* Code_Writer::write_code(Node* p) { // write all code that comes before the children code // (but don't write the last comment until the very end) if (!(p==Fluid.proj.tree.last && p->is_a(FLD_NODE_TYPE_Comment))) { @@ -658,7 +658,7 @@ Node* fld::io::Code_Writer::write_code(Node* p) { \param[in] t filename of the header file \return 0 if the operation failed, 1 if it was successful */ -int fld::io::Code_Writer::write_code(const char *s, const char *t, bool to_codeview) { +int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) { write_codeview = to_codeview; unique_id_list.clear(); indentation = 0; @@ -873,7 +873,7 @@ int fld::io::Code_Writer::write_code(const char *s, const char *t, bool to_codev This avoids repeating these words if the mode is already set. \param[in] state 0 for private, 1 for public, 2 for protected */ -void fld::io::Code_Writer::write_public(int state) { +void Code_Writer::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; @@ -889,7 +889,7 @@ void fld::io::Code_Writer::write_public(int state) { /** Create and initialize a new C++ source code writer. */ -fld::io::Code_Writer::Code_Writer(Project &proj) +Code_Writer::Code_Writer(Project &proj) : proj_ { proj } { block_crc_ = crc32(0, 0, 0); @@ -898,7 +898,7 @@ fld::io::Code_Writer::Code_Writer(Project &proj) /** Release all resources. */ -fld::io::Code_Writer::~Code_Writer() +Code_Writer::~Code_Writer() { if (block_buffer_) ::free(block_buffer_); } @@ -911,7 +911,7 @@ fld::io::Code_Writer::~Code_Writer() \param[in] type FD_TAG_GENERIC, FD_TAG_CODE, FD_TAG_MENU_CALLBACK, or FD_TAG_WIDGET_CALLBACK \param[in] uid the unique id of the current type */ -void fld::io::Code_Writer::tag(Mergeback::Tag prev_type, Mergeback::Tag next_type, unsigned short uid) { +void Code_Writer::tag(Mergeback::Tag prev_type, Mergeback::Tag next_type, unsigned short uid) { if (proj_.write_mergeback_data) { ::Mergeback::print_tag(code_file, prev_type, next_type, uid, (uint32_t)block_crc_); } @@ -929,7 +929,7 @@ void fld::io::Code_Writer::tag(Mergeback::Tag prev_type, Mergeback::Tag next_typ if we are the start of a line, used to find leading whitespace \return the new CRC */ -unsigned long fld::io::Code_Writer::block_crc(const void *data, int n, unsigned long in_crc, bool *inout_line_start) { +unsigned long Code_Writer::block_crc(const void *data, int n, unsigned long in_crc, bool *inout_line_start) { if (!data) return 0; if (n==-1) n = (int)strlen((const char*)data); bool line_start = true; @@ -956,7 +956,7 @@ unsigned long fld::io::Code_Writer::block_crc(const void *data, int n, unsigned \param[in] data a pointer to the data block \param[in] n the size of the data in bytes, or -1 to use strlen() */ -void fld::io::Code_Writer::crc_add(const void *data, int n) { +void Code_Writer::crc_add(const void *data, int n) { block_crc_ = block_crc(data, n, block_crc_, &block_line_start_); } @@ -965,7 +965,7 @@ void fld::io::Code_Writer::crc_add(const void *data, int n) { \param[in] format printf style formatting string \return see fprintf(FILE *, *const char*, ...) */ -int fld::io::Code_Writer::crc_printf(const char *format, ...) { +int Code_Writer::crc_printf(const char *format, ...) { va_list args; va_start(args, format); int ret = crc_vprintf(format, args); @@ -979,7 +979,7 @@ int fld::io::Code_Writer::crc_printf(const char *format, ...) { \param[in] args list of arguments \return see fprintf(FILE *, *const char*, ...) */ -int fld::io::Code_Writer::crc_vprintf(const char *format, va_list args) { +int Code_Writer::crc_vprintf(const char *format, va_list args) { if (proj_.write_mergeback_data) { int n = vsnprintf(block_buffer_, block_buffer_size_, format, args); if (n > block_buffer_size_) { @@ -1000,7 +1000,7 @@ int fld::io::Code_Writer::crc_vprintf(const char *format, va_list args) { \param[in] text any text, no requirements to end in a newline or such \return see fputs(const char*, FILE*) */ -int fld::io::Code_Writer::crc_puts(const char *text) { +int Code_Writer::crc_puts(const char *text) { if (proj_.write_mergeback_data) { crc_add(text); } @@ -1009,11 +1009,11 @@ int fld::io::Code_Writer::crc_puts(const char *text) { /** Write a single ASCII character to the code file. If MergeBack is enabled, the CRC calculation is continued. - \note to write UTF-8 characters, use fld::io::Code_Writer::crc_puts(const char *text) + \note to write UTF-8 characters, use Code_Writer::crc_puts(const char *text) \param[in] c any character between 0 and 127 inclusive \return see fputc(int, FILE*) */ -int fld::io::Code_Writer::crc_putc(int c) { +int Code_Writer::crc_putc(int c) { if (proj_.write_mergeback_data) { uchar uc = (uchar)c; crc_add(&uc, 1); diff --git a/fluid/io/Code_Writer.h b/fluid/io/Code_Writer.h index bd99395e5..4b0ed6794 100644 --- a/fluid/io/Code_Writer.h +++ b/fluid/io/Code_Writer.h @@ -74,12 +74,8 @@ struct Fd_Pointer_Set { int is_id(char c); -namespace fld { - class Project; -namespace io { - class Code_Writer { private: @@ -161,7 +157,4 @@ public: static unsigned long block_crc(const void *data, int n=-1, unsigned long in_crc=0, bool *inout_line_start=0); }; -} // namespace io -} // namespace fld - #endif // FLUID_IO_CODE_WRITER_H diff --git a/fluid/io/Project_Reader.cxx b/fluid/io/Project_Reader.cxx index 54baa9a85..043aebcfa 100644 --- a/fluid/io/Project_Reader.cxx +++ b/fluid/io/Project_Reader.cxx @@ -44,7 +44,7 @@ // This file contains code to read and write .fl files. /// If set, we read an old fdesign file and widget y coordinates need to be flipped. -int fld::io::fdesign_flip = 0; +int fdesign_flip = 0; /** \brief Read a .fl project file. @@ -56,7 +56,7 @@ int fld::io::fdesign_flip = 0; \param[in] strategy add new nodes after current or as last child \return 0 if the operation failed, 1 if it succeeded */ -int fld::io::read_file(Project &proj, const char *filename, int merge, Strategy strategy) { +int read_file(Project &proj, const char *filename, int merge, Strategy strategy) { Project_Reader f(proj); strategy.source(Strategy::FROM_FILE); return f.read_project(filename, merge, strategy); @@ -82,7 +82,7 @@ static int hexdigit(int x) { Oh how I wish sometimes we would upgrade to modern C++. \param[in] length minimum length in bytes */ -void fld::io::Project_Reader::expand_buffer(int length) { +void Project_Reader::expand_buffer(int length) { if (length >= buflen) { if (!buflen) { buflen = length+1; @@ -96,13 +96,13 @@ void fld::io::Project_Reader::expand_buffer(int length) { } /** \brief Construct local project reader. */ -fld::io::Project_Reader::Project_Reader(Project &proj) +Project_Reader::Project_Reader(Project &proj) : proj_(proj) { } /** \brief Release project reader resources. */ -fld::io::Project_Reader::~Project_Reader() +Project_Reader::~Project_Reader() { // fname is not copied, so do not free it if (buffer) @@ -114,7 +114,7 @@ fld::io::Project_Reader::~Project_Reader() \param[in] s filename, if 0, read from stdin instead \return 0 if the operation failed, 1 if it succeeded */ -int fld::io::Project_Reader::open_read(const char *s) { +int Project_Reader::open_read(const char *s) { lineno = 1; if (!s) { fin = stdin; @@ -133,7 +133,7 @@ int fld::io::Project_Reader::open_read(const char *s) { Close the .fl file. \return 0 if the operation failed, 1 if it succeeded */ -int fld::io::Project_Reader::close_read() { +int Project_Reader::close_read() { if (fin != stdin) { int x = fclose(fin); fin = 0; @@ -146,7 +146,7 @@ int fld::io::Project_Reader::close_read() { Return the name part of the current filename and path. \return a pointer into a string that is not owned by this class */ -const char *fld::io::Project_Reader::filename_name() { +const char *Project_Reader::filename_name() { return fl_filename_name(fname); } @@ -156,7 +156,7 @@ const char *fld::io::Project_Reader::filename_name() { values, and \\o### octal values. \return a character in the ASCII range */ -int fld::io::Project_Reader::read_quoted() { // read whatever character is after a \ . +int Project_Reader::read_quoted() { // read whatever character is after a \ . int c,d,x; switch(c = nextchar()) { case '\n': lineno++; return -1; @@ -201,7 +201,7 @@ int fld::io::Project_Reader::read_quoted() { // read whatever character is a previous call, and there is no need to waste time searching for them. \return the last node that was created */ -Node *fld::io::Project_Reader::read_children(Node *p, int merge, Strategy strategy, char skip_options) { +Node *Project_Reader::read_children(Node *p, int merge, Strategy strategy, char skip_options) { Fluid.proj.tree.current = p; Node *last_child_read = 0; Node *t = 0; @@ -385,7 +385,7 @@ Node *fld::io::Project_Reader::read_children(Node *p, int merge, Strategy strate \param[in] strategy add new nodes after current or as last child \return 0 if the operation failed, 1 if it succeeded */ -int fld::io::Project_Reader::read_project(const char *filename, int merge, Strategy strategy) { +int Project_Reader::read_project(const char *filename, int merge, Strategy strategy) { Node *o; proj_.undo.suspend(); read_version = 0.0; @@ -435,7 +435,7 @@ int fld::io::Project_Reader::read_project(const char *filename, int merge, Strat operations. \param[in] format printf style format string, followed by an argument list */ -void fld::io::Project_Reader::read_error(const char *format, ...) { +void Project_Reader::read_error(const char *format, ...) { va_list args; va_start(args, format); if (!fin) { // FIXME: this line suppresses any error messages in interactive mode @@ -468,7 +468,7 @@ void fld::io::Project_Reader::read_error(const char *format, ...) { overwrite this buffer. If wantbrace is not set, but we read a leading '{', the returned string will be stripped of its leading and trailing braces. */ -const char *fld::io::Project_Reader::read_word(int wantbrace) { +const char *Project_Reader::read_word(int wantbrace) { int x; // skip all the whitespace before it: @@ -538,7 +538,7 @@ const char *fld::io::Project_Reader::read_word(int wantbrace) { /** Read a word and interpret it as an integer value. \return integer value, or 0 if the word is not an integer */ -int fld::io::Project_Reader::read_int() { +int Project_Reader::read_int() { const char *word = read_word(); if (word) { return atoi(word); @@ -554,7 +554,7 @@ int fld::io::Project_Reader::read_int() { \param[out] value string \return 0 if end of file, else 1 */ -int fld::io::Project_Reader::read_fdesign_line(const char*& name, const char*& value) { +int Project_Reader::read_fdesign_line(const char*& name, const char*& value) { int length = 0; int x; // find a colon: @@ -681,7 +681,7 @@ static void forms_end(Fl_Group *g, int flip) { FLTK widgets. \see http://xforms-toolkit.org */ -void fld::io::Project_Reader::read_fdesign() { +void Project_Reader::read_fdesign() { int fdesign_magic = atoi(read_word()); fdesign_flip = (fdesign_magic < 13000); Widget_Node *window = 0; diff --git a/fluid/io/Project_Reader.h b/fluid/io/Project_Reader.h index fe66be689..a68b7a237 100644 --- a/fluid/io/Project_Reader.h +++ b/fluid/io/Project_Reader.h @@ -26,12 +26,8 @@ class Node; -namespace fld { - class Project; -namespace io { - extern int fdesign_flip; int read_file(Project &proj, const char *, int merge, Strategy strategy=Strategy::FROM_FILE_AS_LAST_CHILD); @@ -77,7 +73,4 @@ public: void read_fdesign(); }; -} // namespace io -} // namespace fld - #endif // FLUID_IO_PROJECT_READER_H diff --git a/fluid/io/Project_Writer.cxx b/fluid/io/Project_Writer.cxx index e2f670f8f..f67a877cb 100644 --- a/fluid/io/Project_Writer.cxx +++ b/fluid/io/Project_Writer.cxx @@ -41,7 +41,7 @@ is used to implement copy and paste. \return 0 if the operation failed, 1 if it succeeded */ -int fld::io::write_file(Project &proj, const char *filename, int selected_only, bool to_codeview) { +int write_file(Project &proj, const char *filename, int selected_only, bool to_codeview) { Project_Writer out(proj); return out.write_project(filename, selected_only, to_codeview); } @@ -49,13 +49,13 @@ int fld::io::write_file(Project &proj, const char *filename, int selected_only, // ---- Project_Writer ---------------------------------------------- MARK: - /** \brief Construct local project writer. */ -fld::io::Project_Writer::Project_Writer(Project &proj) +Project_Writer::Project_Writer(Project &proj) : proj_(proj) { } /** \brief Release project writer resources. */ -fld::io::Project_Writer::~Project_Writer() +Project_Writer::~Project_Writer() { } @@ -65,7 +65,7 @@ fld::io::Project_Writer::~Project_Writer() \param[in] s the filename or 0 for stdout \return 1 if successful. 0 if the operation failed */ -int fld::io::Project_Writer::open_write(const char *s) { +int Project_Writer::open_write(const char *s) { if (!s) { fout = stdout; } else { @@ -81,7 +81,7 @@ int fld::io::Project_Writer::open_write(const char *s) { Don't close, if data was sent to stdout. \return 1 if succeeded, 0 if fclose failed */ -int fld::io::Project_Writer::close_write() { +int Project_Writer::close_write() { if (fout != stdout) { int x = fclose(fout); fout = stdout; @@ -97,7 +97,7 @@ int fld::io::Project_Writer::close_write() { \param[in] sv if set, this file will be used by codeview \return 0 if the operation failed, 1 if it succeeded */ -int fld::io::Project_Writer::write_project(const char *filename, int selected_only, bool sv) { +int Project_Writer::write_project(const char *filename, int selected_only, bool sv) { write_codeview_ = sv; proj_.undo.suspend(); if (!open_write(filename)) { @@ -148,7 +148,7 @@ int fld::io::Project_Writer::write_project(const char *filename, int selected_on Write a string to the .fl file, quoting characters if necessary. \param[in] w NUL terminated text */ -void fld::io::Project_Writer::write_word(const char *w) { +void Project_Writer::write_word(const char *w) { if (needspace) putc(' ', fout); needspace = 1; if (!w || !*w) {fprintf(fout,"{}"); return;} @@ -186,7 +186,7 @@ void fld::io::Project_Writer::write_word(const char *w) { unless the format starts with a newline character \\n. \param[in] format printf style formatting string followed by a list of arguments */ -void fld::io::Project_Writer::write_string(const char *format, ...) { +void Project_Writer::write_string(const char *format, ...) { va_list args; va_start(args, format); if (needspace && *format != '\n') fputc(' ',fout); @@ -199,7 +199,7 @@ void fld::io::Project_Writer::write_string(const char *format, ...) { Start a new line in the .fl file and indent it for a given nesting level. \param[in] n indent level */ -void fld::io::Project_Writer::write_indent(int n) { +void Project_Writer::write_indent(int n) { fputc('\n',fout); while (n--) {fputc(' ',fout); fputc(' ',fout);} needspace = 0; @@ -208,7 +208,7 @@ void fld::io::Project_Writer::write_indent(int n) { /** Write a '{' to the .fl file at the given indenting level. */ -void fld::io::Project_Writer::write_open() { +void Project_Writer::write_open() { if (needspace) fputc(' ',fout); fputc('{',fout); needspace = 0; @@ -218,7 +218,7 @@ void fld::io::Project_Writer::write_open() { Write a '}' to the .fl file at the given indenting level. \param[in] n indent level */ -void fld::io::Project_Writer::write_close(int n) { +void Project_Writer::write_close(int n) { if (needspace) write_indent(n); fputc('}',fout); needspace = 1; diff --git a/fluid/io/Project_Writer.h b/fluid/io/Project_Writer.h index 845f77f1e..cfb3b31c8 100644 --- a/fluid/io/Project_Writer.h +++ b/fluid/io/Project_Writer.h @@ -23,12 +23,8 @@ class Node; -namespace fld { - class Project; -namespace io { - int write_file(Project &proj, const char *, int selected_only = 0, bool to_codeview = false); class Project_Writer @@ -60,7 +56,4 @@ public: bool write_codeview() const { return write_codeview_; } }; -} // namespace io -} // namespace fld - #endif // FLUID_IO_PROJECT_WRITER_H diff --git a/fluid/io/String_Writer.cxx b/fluid/io/String_Writer.cxx index 891fc5a25..dc7424c3d 100644 --- a/fluid/io/String_Writer.cxx +++ b/fluid/io/String_Writer.cxx @@ -58,7 +58,7 @@ static int write_escaped_strings(FILE *out, const char *text) { \param[in] filename file path and name to a file that will hold the strings \return 1 if the file could not be opened for writing, or the result of `fclose`. */ -int fld::io::write_strings(Project &proj, const char *filename) { +int write_strings(Project &proj, const char *filename) { Node *p; Widget_Node *w; int i; diff --git a/fluid/io/String_Writer.h b/fluid/io/String_Writer.h index 8402836c1..428cde33f 100644 --- a/fluid/io/String_Writer.h +++ b/fluid/io/String_Writer.h @@ -17,15 +17,8 @@ #ifndef FLUID_IO_STRING_WRITER_H #define FLUID_IO_STRING_WRITER_H -namespace fld { - class Project; -namespace io { - int write_strings(Project &proj, const char *filename); -} // namespace io -} // namespace fld - #endif // FLUID_IO_STRING_WRITER_H diff --git a/fluid/nodes/Button_Node.cxx b/fluid/nodes/Button_Node.cxx index 877c5588d..1b4cbe2e5 100644 --- a/fluid/nodes/Button_Node.cxx +++ b/fluid/nodes/Button_Node.cxx @@ -57,17 +57,17 @@ Fl_Menu_Item *Button_Node::subtypes() { } void Button_Node::ideal_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; h = layout->labelsize + 8; w = layout->labelsize * 4 + 8; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } Fl_Widget *Button_Node::widget(int x, int y, int w, int h) { return new Fl_Button(x, y, w, h, "Button"); } -void Button_Node::write_properties(fld::io::Project_Writer &f) { +void Button_Node::write_properties(Project_Writer &f) { Widget_Node::write_properties(f); Fl_Button *btn = (Fl_Button*)o; if (btn->compact()) { @@ -76,7 +76,7 @@ void Button_Node::write_properties(fld::io::Project_Writer &f) { } } -void Button_Node::read_property(fld::io::Project_Reader &f, const char *c) { +void Button_Node::read_property(Project_Reader &f, const char *c) { Fl_Button *btn = (Fl_Button*)o; if (!strcmp(c, "compact")) { btn->compact((uchar)atol(f.read_word())); @@ -95,10 +95,10 @@ void Button_Node::copy_properties() { // ---- Return Button ---- void Return_Button_Node::ideal_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; h = layout->labelsize + 8; w = layout->labelsize * 4 + 8 + h; // make room for the symbol - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } Fl_Widget *Return_Button_Node::widget(int x, int y, int w, int h) { @@ -120,10 +120,10 @@ Repeat_Button_Node Repeat_Button_Node::prototype; // ---- Light Button ---- void Light_Button_Node::ideal_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; h = layout->labelsize + 8; w = layout->labelsize * 4 + 8 + layout->labelsize; // make room for the light - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } Fl_Widget *Light_Button_Node::widget(int x, int y, int w, int h) { @@ -136,10 +136,10 @@ Light_Button_Node Light_Button_Node::prototype; // ---- Check Button ---- void Check_Button_Node::ideal_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; h = layout->labelsize + 8; w = layout->labelsize * 4 + 8 + layout->labelsize; // make room for the symbol - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } Fl_Widget *Check_Button_Node::widget(int x, int y, int w, int h) { @@ -152,10 +152,10 @@ Check_Button_Node Check_Button_Node::prototype; // ---- Round Button ---- void Round_Button_Node::ideal_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; h = layout->labelsize + 8; w = layout->labelsize * 4 + 8 + layout->labelsize; // make room for the symbol - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } Fl_Widget *Round_Button_Node::widget(int x, int y, int w, int h) { diff --git a/fluid/nodes/Button_Node.h b/fluid/nodes/Button_Node.h index 4ee88d1e1..eab3a1d40 100644 --- a/fluid/nodes/Button_Node.h +++ b/fluid/nodes/Button_Node.h @@ -38,8 +38,8 @@ public: int is_button() const { return 1; } Type type() const { return FLD_NODE_TYPE_Button; } bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Button) ? true : super::is_a(inType); } - void write_properties(fld::io::Project_Writer &f); - void read_property(fld::io::Project_Reader &f, const char *); + void write_properties(Project_Writer &f); + void read_property(Project_Reader &f, const char *); void copy_properties(); }; diff --git a/fluid/nodes/Function_Node.cxx b/fluid/nodes/Function_Node.cxx index daf5822c0..c5dcf7596 100644 --- a/fluid/nodes/Function_Node.cxx +++ b/fluid/nodes/Function_Node.cxx @@ -227,7 +227,7 @@ Node *Function_Node::make(Strategy strategy) { - "C" is written if we want a C signature instead of C++ - "return_type" is followed by the return type of the function */ -void Function_Node::write_properties(fld::io::Project_Writer &f) { +void Function_Node::write_properties(Project_Writer &f) { Node::write_properties(f); switch (public_) { case 0: f.write_string("private"); break; @@ -244,7 +244,7 @@ void Function_Node::write_properties(fld::io::Project_Writer &f) { Read function specific properties fron an .fl file. \param[in] c read from this string */ -void Function_Node::read_property(fld::io::Project_Reader &f, const char *c) { +void Function_Node::read_property(Project_Reader &f, const char *c) { if (!strcmp(c,"private")) { public_ = 0; } else if (!strcmp(c,"protected")) { @@ -321,9 +321,9 @@ static void clean_function_for_implementation(char *out, const char *function_na /** Write the code for the source and the header file. This writes the code that goes \b before all children of this class. - \see write_code2(fld::io::Code_Writer& f) + \see write_code2(Code_Writer& f) */ -void Function_Node::write_code1(fld::io::Code_Writer& f) { +void Function_Node::write_code1(Code_Writer& f) { constructor=0; havewidgets = 0; Node *child; @@ -457,9 +457,9 @@ void Function_Node::write_code1(fld::io::Code_Writer& f) { /** Write the code for the source and the header file. This writes the code that goes \b after all children of this class. - \see write_code1(fld::io::Code_Writer& f) + \see write_code1(Code_Writer& f) */ -void Function_Node::write_code2(fld::io::Code_Writer& f) { +void Function_Node::write_code2(Code_Writer& f) { Node *child; const char *var = "w"; char havechildren = 0; @@ -556,7 +556,7 @@ void Code_Node::open() { /** Grab changes from an external editor and write this node. */ -void Code_Node::write(fld::io::Project_Writer &f) { +void Code_Node::write(Project_Writer &f) { // External editor changes? If so, load changes into ram, update mtime/size if ( handle_editor_changes() == 1 ) { Fluid.main_window->redraw(); // tell fluid to redraw; edits may affect tree's contents @@ -567,7 +567,7 @@ void Code_Node::write(fld::io::Project_Writer &f) { /** Write the code block with the correct indentation. */ -void Code_Node::write_code1(fld::io::Code_Writer& f) { +void Code_Node::write_code1(Code_Writer& f) { // External editor changes? If so, load changes into ram, update mtime/size if ( handle_editor_changes() == 1 ) { Fluid.main_window->redraw(); // tell fluid to redraw; edits may affect tree's contents @@ -673,7 +673,7 @@ Node *CodeBlock_Node::make(Strategy strategy) { - "after" is followed by the code that comes after the children The "before" code is stored in the name() field. */ -void CodeBlock_Node::write_properties(fld::io::Project_Writer &f) { +void CodeBlock_Node::write_properties(Project_Writer &f) { Node::write_properties(f); if (end_code()[0]) { f.write_string("after"); @@ -684,7 +684,7 @@ void CodeBlock_Node::write_properties(fld::io::Project_Writer &f) { /** Read the node specific properties. */ -void CodeBlock_Node::read_property(fld::io::Project_Reader &f, const char *c) { +void CodeBlock_Node::read_property(Project_Reader &f, const char *c) { if (!strcmp(c,"after")) { end_code(f.read_word()); } else { @@ -702,7 +702,7 @@ void CodeBlock_Node::open() { /** Write the "before" code. */ -void CodeBlock_Node::write_code1(fld::io::Code_Writer& f) { +void CodeBlock_Node::write_code1(Code_Writer& f) { const char* c = name(); f.write_c("%s%s {\n", f.indent(), c ? c : ""); f.indentation++; @@ -711,7 +711,7 @@ void CodeBlock_Node::write_code1(fld::io::Code_Writer& f) { /** Write the "after" code. */ -void CodeBlock_Node::write_code2(fld::io::Code_Writer& f) { +void CodeBlock_Node::write_code2(Code_Writer& f) { f.indentation--; if (end_code()[0]) f.write_c("%s} %s\n", f.indent(), end_code()); @@ -775,7 +775,7 @@ Node *Decl_Node::make(Strategy strategy) { - "private"/"public"/"protected" - "local"/"global" if this is static or not */ -void Decl_Node::write_properties(fld::io::Project_Writer &f) { +void Decl_Node::write_properties(Project_Writer &f) { Node::write_properties(f); switch (public_) { case 0: f.write_string("private"); break; @@ -791,7 +791,7 @@ void Decl_Node::write_properties(fld::io::Project_Writer &f) { /** Read the specific properties. */ -void Decl_Node::read_property(fld::io::Project_Reader &f, const char *c) { +void Decl_Node::read_property(Project_Reader &f, const char *c) { if (!strcmp(c,"public")) { public_ = 1; } else if (!strcmp(c,"private")) { @@ -819,7 +819,7 @@ void Decl_Node::open() { \todo There are a lot of side effect in this node depending on the given text and the parent node. They need to be understood and documented. */ -void Decl_Node::write_code1(fld::io::Code_Writer& f) { +void Decl_Node::write_code1(Code_Writer& f) { const char* c = name(); if (!c) return; // handle a few keywords differently if inside a class @@ -934,7 +934,7 @@ Node *Data_Node::make(Strategy strategy) { - "filename" followed by the filename of the file to inline - "textmode" if data is written in ASCII vs. binary */ -void Data_Node::write_properties(fld::io::Project_Writer &f) { +void Data_Node::write_properties(Project_Writer &f) { Decl_Node::write_properties(f); if (filename()[0]) { f.write_string("filename"); @@ -943,28 +943,19 @@ void Data_Node::write_properties(fld::io::Project_Writer &f) { switch (output_format_) { case 1: f.write_string("textmode"); break; case 2: f.write_string("compressed"); break; - case 3: f.write_string("std_binary"); break; - case 4: f.write_string("std_textmode"); break; - case 5: f.write_string("std_compressed"); break; } } /** Read specific properties. */ -void Data_Node::read_property(fld::io::Project_Reader &f, const char *c) { +void Data_Node::read_property(Project_Reader &f, const char *c) { if (!strcmp(c,"filename")) { storestring(f.read_word(), filename_, 1); } else if (!strcmp(c,"textmode")) { output_format_ = 1; } else if (!strcmp(c,"compressed")) { output_format_ = 2; - } else if (!strcmp(c,"std_binary")) { - output_format_ = 3; - } else if (!strcmp(c,"std_textmode")) { - output_format_ = 4; - } else if (!strcmp(c,"std_compressed")) { - output_format_ = 5; } else { Decl_Node::read_property(f, c); } @@ -980,7 +971,7 @@ void Data_Node::open() { /** Write the content of the external file inline into the source code. */ -void Data_Node::write_code1(fld::io::Code_Writer& f) { +void Data_Node::write_code1(Code_Writer& f) { const char *message = 0; const char *c = name(); if (!c) return; @@ -1002,7 +993,7 @@ void Data_Node::write_code1(fld::io::Code_Writer& f) { if (nData) { data = (char*)calloc(nData, 1); if (fread(data, nData, 1, f)==0) { /* use default */ } - if ((output_format_ == 2) || (output_format_ == 5)) { + if (output_format_ == 2) { uncompressedDataSize = nData; uLong nzData = compressBound(nData); Bytef *zdata = (Bytef*)::malloc(nzData); @@ -1020,47 +1011,27 @@ void Data_Node::write_code1(fld::io::Code_Writer& f) { } if (is_in_class()) { f.write_public(public_); - if ((output_format_ == 1) || (output_format_ == 4)) { + if (output_format_ == 1) { f.write_c("\n"); write_comment_c(f); - if (output_format_ == 1) { - f.write_h("%sstatic const char *%s;\n", f.indent(1), c); - f.write_c("const char *%s::%s = /* text inlined from %s */\n", class_name(1), c, fn); - } else { - f.write_h_once("#include <string>"); - f.write_h("%sstatic const std::string %s;\n", f.indent(1), c); - f.write_c("const std::string %s::%s = /* text inlined from %s */\n", class_name(1), c, fn); - } + f.write_h("%sstatic const char *%s;\n", f.indent(1), c); + f.write_c("const char *%s::%s = /* text inlined from %s */\n", class_name(1), c, fn); if (message) f.write_c("#error %s %s\n", message, fn); f.write_cstring(data, nData); - } else if ((output_format_ == 2) || (output_format_ == 5)) { + } else if (output_format_ == 2) { f.write_h("%sstatic int %s_size;\n", f.indent(1), c); f.write_c("\n"); write_comment_c(f); f.write_c("int %s::%s_size = %d;\n", class_name(1), c, uncompressedDataSize); - if (output_format_ == 2) { - f.write_h("%sstatic unsigned char %s[%d];\n", f.indent(1), c, nData); - f.write_c("unsigned char %s::%s[%d] = /* data compressed and inlined from %s */\n", class_name(1), c, nData, fn); - } else { - f.write_h_once("#include <stdint.h>"); - f.write_h_once("#include <vector>"); - f.write_h("%sstatic std::vector<uint8_t> %s;\n", f.indent(1), c); - f.write_c("std::vector<uint8_t> %s::%s = /* data compressed and inlined from %s */\n", class_name(1), c, fn); - } + f.write_h("%sstatic unsigned char %s[%d];\n", f.indent(1), c, nData); + f.write_c("unsigned char %s::%s[%d] = /* data compressed and inlined from %s */\n", class_name(1), c, nData, fn); if (message) f.write_c("#error %s %s\n", message, fn); f.write_cdata(data, nData); } else { f.write_c("\n"); write_comment_c(f); - if (output_format_ == 0) { - f.write_h("%sstatic unsigned char %s[%d];\n", f.indent(1), c, nData); - f.write_c("unsigned char %s::%s[%d] = /* data inlined from %s */\n", class_name(1), c, nData, fn); - } else { - f.write_h_once("#include <stdint.h>"); - f.write_h_once("#include <vector>"); - f.write_h("%sstatic std::vector<uint8_t> %s;\n", f.indent(1), c); - f.write_c("std::vector<uint8_t> %s::%s = /* data inlined from %s */\n", class_name(1), c, fn); - } + f.write_h("%sstatic unsigned char %s[%d];\n", f.indent(1), c, nData); + f.write_c("unsigned char %s::%s[%d] = /* data inlined from %s */\n", class_name(1), c, nData, fn); if (message) f.write_c("#error %s %s\n", message, fn); f.write_cdata(data, nData); } @@ -1069,47 +1040,27 @@ void Data_Node::write_code1(fld::io::Code_Writer& f) { // the "header only" option does not apply here! if (public_) { if (static_) { - if ((output_format_ == 1) || (output_format_ == 4)) { + if (output_format_ == 1) { f.write_c("\n"); write_comment_c(f); - if (output_format_ == 1) { - f.write_h("extern const char *%s;\n", c); - f.write_c("const char *%s = /* text inlined from %s */\n", c, fn); - } else { - f.write_h_once("#include <string>"); - f.write_h("extern const std::string %s;\n", c); - f.write_c("const std::string %s = /* text inlined from %s */\n", c, fn); - } + f.write_h("extern const char *%s;\n", c); + f.write_c("const char *%s = /* text inlined from %s */\n", c, fn); if (message) f.write_c("#error %s %s\n", message, fn); f.write_cstring(data, nData); - } else if ((output_format_ == 2) || (output_format_ == 5)) { + } else if (output_format_ == 2) { f.write_h("extern int %s_size;\n", c); f.write_c("\n"); write_comment_c(f); f.write_c("int %s_size = %d;\n", c, uncompressedDataSize); - if (output_format_ == 2) { - f.write_h("extern unsigned char %s[%d];\n", c, nData); - f.write_c("unsigned char %s[%d] = /* data compressed and inlined from %s */\n", c, nData, fn); - } else { - f.write_h_once("#include <stdint.h>"); - f.write_h_once("#include <vector>"); - f.write_h("extern std::vector<uint8_t> %s;\n", c); - f.write_c("std::vector<uint8_t> %s = /* data compressed and inlined from %s */\n", c, fn); - } + f.write_h("extern unsigned char %s[%d];\n", c, nData); + f.write_c("unsigned char %s[%d] = /* data compressed and inlined from %s */\n", c, nData, fn); if (message) f.write_c("#error %s %s\n", message, fn); f.write_cdata(data, nData); } else { f.write_c("\n"); write_comment_c(f); - if (output_format_ == 0) { - f.write_h("extern unsigned char %s[%d];\n", c, nData); - f.write_c("unsigned char %s[%d] = /* data inlined from %s */\n", c, nData, fn); - } else { - f.write_h_once("#include <stdint.h>"); - f.write_h_once("#include <vector>"); - f.write_h("extern std::vector<uint8_t> %s;\n", c); - f.write_c("std::vector<uint8_t> %s = /* data inlined from %s */\n", c, fn); - } + f.write_h("extern unsigned char %s[%d];\n", c, nData); + f.write_c("unsigned char %s[%d] = /* data inlined from %s */\n", c, nData, fn); if (message) f.write_c("#error %s %s\n", message, fn); f.write_cdata(data, nData); } @@ -1125,41 +1076,21 @@ void Data_Node::write_code1(fld::io::Code_Writer& f) { } else { f.write_c("\n"); write_comment_c(f); - if ((output_format_ == 1) || (output_format_ == 4)) { - if (output_format_ == 1) { - if (static_) f.write_c("static "); - f.write_c("const char *%s = /* text inlined from %s */\n", c, fn); - } else { - f.write_c_once("#include <string>"); - if (static_) f.write_c("static "); - f.write_c("const std::string %s = /* text inlined from %s */\n", c, fn); - } + if (output_format_ == 1) { + if (static_) f.write_c("static "); + f.write_c("const char *%s = /* text inlined from %s */\n", c, fn); if (message) f.write_c("#error %s %s\n", message, fn); f.write_cstring(data, nData); - } else if ((output_format_ == 2) || (output_format_ == 5)) { + } else if (output_format_ == 2) { if (static_) f.write_c("static "); f.write_c("int %s_size = %d;\n", c, uncompressedDataSize); - if (output_format_ == 2) { - if (static_) f.write_c("static "); - f.write_c("unsigned char %s[%d] = /* data compressed and inlined from %s */\n", c, nData, fn); - } else { - f.write_c_once("#include <stdint.h>"); - f.write_c_once("#include <vector>"); - if (static_) f.write_c("static "); - f.write_c("std::vector<uint8_t> %s = /* data compressed and inlined from %s */\n", c, fn); - } + if (static_) f.write_c("static "); + f.write_c("unsigned char %s[%d] = /* data compressed and inlined from %s */\n", c, nData, fn); if (message) f.write_c("#error %s %s\n", message, fn); f.write_cdata(data, nData); } else { - if (output_format_ == 0) { - if (static_) f.write_c("static "); - f.write_c("unsigned char %s[%d] = /* data inlined from %s */\n", c, nData, fn); - } else { - f.write_c_once("#include <stdint.h>"); - f.write_c_once("#include <vector>"); - if (static_) f.write_c("static "); - f.write_c("std::vector<uint8_t> %s = /* data inlined from %s */\n", c, fn); - } + if (static_) f.write_c("static "); + f.write_c("unsigned char %s[%d] = /* data inlined from %s */\n", c, nData, fn); if (message) f.write_c("#error %s %s\n", message, fn); f.write_cdata(data, nData); } @@ -1234,7 +1165,7 @@ Node *DeclBlock_Node::make(Strategy strategy) { - "public"/"protected" - "after" followed by the second code block. */ -void DeclBlock_Node::write_properties(fld::io::Project_Writer &f) { +void DeclBlock_Node::write_properties(Project_Writer &f) { Node::write_properties(f); // deprecated if (is_public()) f.write_string("public"); @@ -1248,7 +1179,7 @@ void DeclBlock_Node::write_properties(fld::io::Project_Writer &f) { /** Read the specific properties. */ -void DeclBlock_Node::read_property(fld::io::Project_Reader &f, const char *c) { +void DeclBlock_Node::read_property(Project_Reader &f, const char *c) { if(!strcmp(c,"public")) { write_map_ |= CODE_IN_HEADER; } else if(!strcmp(c,"protected")) { @@ -1273,7 +1204,7 @@ void DeclBlock_Node::open() { Write the \b before static code to the source file, and to the header file if declared public. The before code is stored in the name() field. */ -void DeclBlock_Node::write_static(fld::io::Code_Writer& f) { +void DeclBlock_Node::write_static(Code_Writer& f) { const char* c = name(); if (c && *c) { if (write_map_ & STATIC_IN_HEADER) @@ -1286,7 +1217,7 @@ void DeclBlock_Node::write_static(fld::io::Code_Writer& f) { /** Write the \b after static code to the source file, and to the header file if declared public. */ -void DeclBlock_Node::write_static_after(fld::io::Code_Writer& f) { +void DeclBlock_Node::write_static_after(Code_Writer& f) { if (end_code()[0]) { if (write_map_ & STATIC_IN_HEADER) f.write_h("%s\n", end_code()); @@ -1299,7 +1230,7 @@ void DeclBlock_Node::write_static_after(fld::io::Code_Writer& f) { Write the \b before code to the source file, and to the header file if declared public. The before code is stored in the name() field. */ -void DeclBlock_Node::write_code1(fld::io::Code_Writer& f) { +void DeclBlock_Node::write_code1(Code_Writer& f) { const char* c = name(); if (c && *c) { if (write_map_ & CODE_IN_HEADER) @@ -1312,7 +1243,7 @@ void DeclBlock_Node::write_code1(fld::io::Code_Writer& f) { /** Write the \b after code to the source file, and to the header file if declared public. */ -void DeclBlock_Node::write_code2(fld::io::Code_Writer& f) { +void DeclBlock_Node::write_code2(Code_Writer& f) { if (end_code()[0]) { if (write_map_ & CODE_IN_HEADER) f.write_h("%s\n", end_code()); @@ -1363,7 +1294,7 @@ Node *Comment_Node::make(Strategy strategy) { - "in_source"/"not_in_source" if the comment will be written to the source code - "in_header"/"not_in_header" if the comment will be written to the header file */ -void Comment_Node::write_properties(fld::io::Project_Writer &f) { +void Comment_Node::write_properties(Project_Writer &f) { Node::write_properties(f); if (in_c_) f.write_string("in_source"); else f.write_string("not_in_source"); if (in_h_) f.write_string("in_header"); else f.write_string("not_in_header"); @@ -1372,7 +1303,7 @@ void Comment_Node::write_properties(fld::io::Project_Writer &f) { /** Read extra properties. */ -void Comment_Node::read_property(fld::io::Project_Reader &f, const char *c) { +void Comment_Node::read_property(Project_Reader &f, const char *c) { if (!strcmp(c,"in_source")) { in_c_ = 1; } else if (!strcmp(c,"not_in_source")) { @@ -1418,7 +1349,7 @@ void Comment_Node::open() { /** Write the comment to the files. */ -void Comment_Node::write_code1(fld::io::Code_Writer& f) { +void Comment_Node::write_code1(Code_Writer& f) { const char* c = name(); if (!c) return; if (!in_c_ && !in_h_) return; @@ -1514,7 +1445,7 @@ Node *Class_Node::make(Strategy strategy) { - ":" followed by the super class - "private"/"protected" */ -void Class_Node::write_properties(fld::io::Project_Writer &f) { +void Class_Node::write_properties(Project_Writer &f) { Node::write_properties(f); if (base_class()[0]) { f.write_string(":"); @@ -1529,7 +1460,7 @@ void Class_Node::write_properties(fld::io::Project_Writer &f) { /** Read additional properties. */ -void Class_Node::read_property(fld::io::Project_Reader &f, const char *c) { +void Class_Node::read_property(Project_Reader &f, const char *c) { if (!strcmp(c,"private")) { public_ = 0; } else if (!strcmp(c,"protected")) { @@ -1551,7 +1482,7 @@ void Class_Node::open() { /** Write the header code that declares this class. */ -void Class_Node::write_code1(fld::io::Code_Writer& f) { +void Class_Node::write_code1(Code_Writer& f) { parent_class = current_class; current_class = this; write_public_state = 0; @@ -1570,7 +1501,7 @@ void Class_Node::write_code1(fld::io::Code_Writer& f) { /** Write the header code that ends the declaration of this class. */ -void Class_Node::write_code2(fld::io::Code_Writer& f) { +void Class_Node::write_code2(Code_Writer& f) { f.write_h("};\n"); current_class = parent_class; } diff --git a/fluid/nodes/Function_Node.h b/fluid/nodes/Function_Node.h index cc1444a26..528e3a5a0 100644 --- a/fluid/nodes/Function_Node.h +++ b/fluid/nodes/Function_Node.h @@ -60,8 +60,8 @@ public: ~Function_Node(); Node *make(Strategy strategy); - void write_code1(fld::io::Code_Writer& f); - void write_code2(fld::io::Code_Writer& f); + void write_code1(Code_Writer& f); + void write_code2(Code_Writer& f); void open(); int ismain() {return name_ == 0;} const char *type_name() {return "Function";} @@ -71,8 +71,8 @@ public: int is_public() const; Type type() const { return FLD_NODE_TYPE_Function; } bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Function) ? true : super::is_a(inType); } - void write_properties(fld::io::Project_Writer &f); - void read_property(fld::io::Project_Reader &f, const char *); + void write_properties(Project_Writer &f); + void read_property(Project_Reader &f, const char *); int has_signature(const char *, const char*) const; const char *return_type() const { return return_type_ ? return_type_ : ""; } void return_type(const char *t) { storestring(t, return_type_); } @@ -101,9 +101,9 @@ public: ~Code_Node() = default; Node *make(Strategy strategy); - void write(fld::io::Project_Writer &f); - void write_code1(fld::io::Code_Writer& f); - void write_code2(fld::io::Code_Writer& f) { } + void write(Project_Writer &f); + void write_code1(Code_Writer& f); + void write_code2(Code_Writer& f) { } void open(); const char *type_name() {return "code";} int is_code_block() const {return 0;} @@ -137,8 +137,8 @@ public: ~CodeBlock_Node(); Node *make(Strategy strategy); - void write_code1(fld::io::Code_Writer& f); - void write_code2(fld::io::Code_Writer& f); + void write_code1(Code_Writer& f); + void write_code2(Code_Writer& f); void open(); const char *type_name() {return "codeblock";} int is_code_block() const {return 1;} @@ -146,8 +146,8 @@ public: int is_public() const { return -1; } Type type() const { return FLD_NODE_TYPE_CodeBlock; } bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_CodeBlock) ? true : super::is_a(inType); } - void write_properties(fld::io::Project_Writer &f); - void read_property(fld::io::Project_Reader &f, const char *); + void write_properties(Project_Writer &f); + void read_property(Project_Reader &f, const char *); const char *end_code() const { return end_code_ ? end_code_ : ""; } void end_code(const char *c) { storestring(c, end_code_); } }; @@ -169,12 +169,12 @@ public: ~Decl_Node() = default; Node *make(Strategy strategy); - void write_code1(fld::io::Code_Writer& f); - void write_code2(fld::io::Code_Writer& f) { } + void write_code1(Code_Writer& f); + void write_code2(Code_Writer& f) { } void open(); const char *type_name() {return "decl";} - void write_properties(fld::io::Project_Writer &f); - void read_property(fld::io::Project_Reader &f, const char *); + void write_properties(Project_Writer &f); + void read_property(Project_Reader &f, const char *); int is_public() const; Type type() const { return FLD_NODE_TYPE_Decl; } bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Decl) ? true : super::is_a(inType); } @@ -201,12 +201,12 @@ public: ~Data_Node(); Node *make(Strategy strategy); - void write_code1(fld::io::Code_Writer& f); - void write_code2(fld::io::Code_Writer& f) {} + void write_code1(Code_Writer& f); + void write_code2(Code_Writer& f) {} void open(); const char *type_name() {return "data";} - void write_properties(fld::io::Project_Writer &f); - void read_property(fld::io::Project_Reader &f, const char *); + void write_properties(Project_Writer &f); + void read_property(Project_Reader &f, const char *); Type type() const { return FLD_NODE_TYPE_Data; } bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Data) ? true : super::is_a(inType); } void filename(const char *fn) { storestring(fn, filename_); } @@ -238,14 +238,14 @@ public: ~DeclBlock_Node(); Node *make(Strategy strategy); - void write_static(fld::io::Code_Writer& f); - void write_static_after(fld::io::Code_Writer& f); - void write_code1(fld::io::Code_Writer& f); - void write_code2(fld::io::Code_Writer& f); + void write_static(Code_Writer& f); + void write_static_after(Code_Writer& f); + void write_code1(Code_Writer& f); + void write_code2(Code_Writer& f); void open(); const char *type_name() {return "declblock";} - void write_properties(fld::io::Project_Writer &f); - void read_property(fld::io::Project_Reader &f, const char *); + void write_properties(Project_Writer &f); + void read_property(Project_Reader &f, const char *); int can_have_children() const {return 1;} int is_decl_block() const {return 1;} int is_public() const; @@ -275,12 +275,12 @@ public: ~Comment_Node() = default; Node *make(Strategy strategy); - void write_code1(fld::io::Code_Writer& f); - void write_code2(fld::io::Code_Writer& f) { } + void write_code1(Code_Writer& f); + void write_code2(Code_Writer& f) { } void open(); const char *type_name() {return "comment";} - void write_properties(fld::io::Project_Writer &f); - void read_property(fld::io::Project_Reader &f, const char *); + void write_properties(Project_Writer &f); + void read_property(Project_Reader &f, const char *); int is_public() const { return 1; } Type type() const { return FLD_NODE_TYPE_Comment; } bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Comment) ? true : super::is_a(inType); } @@ -312,8 +312,8 @@ public: Class_Node* parent_class; // save class if nested Node *make(Strategy strategy); - void write_code1(fld::io::Code_Writer& f); - void write_code2(fld::io::Code_Writer& f); + void write_code1(Code_Writer& f); + void write_code2(Code_Writer& f); void open(); const char *type_name() {return "class";} int can_have_children() const {return 1;} @@ -322,8 +322,8 @@ public: int is_public() const; Type type() const { return FLD_NODE_TYPE_Class; } bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Class) ? true : super::is_a(inType); } - void write_properties(fld::io::Project_Writer &f); - void read_property(fld::io::Project_Reader &f, const char *); + void write_properties(Project_Writer &f); + void read_property(Project_Reader &f, const char *); /** Get base class access and name. */ const char *base_class() const { return base_class_ ? base_class_ : ""; } diff --git a/fluid/nodes/Grid_Node.cxx b/fluid/nodes/Grid_Node.cxx index 6759c33f2..d33e72cb1 100644 --- a/fluid/nodes/Grid_Node.cxx +++ b/fluid/nodes/Grid_Node.cxx @@ -348,7 +348,7 @@ void Grid_Node::copy_properties_for_children() { d->layout(); } -void Grid_Node::write_properties(fld::io::Project_Writer &f) +void Grid_Node::write_properties(Project_Writer &f) { super::write_properties(f); Fl_Grid* grid = (Fl_Grid*)o; @@ -413,7 +413,7 @@ void Grid_Node::write_properties(fld::io::Project_Writer &f) } } -void Grid_Node::read_property(fld::io::Project_Reader &f, const char *c) +void Grid_Node::read_property(Project_Reader &f, const char *c) { Fl_Grid* grid = (Fl_Grid*)o; int i; @@ -464,7 +464,7 @@ void Grid_Node::read_property(fld::io::Project_Reader &f, const char *c) } } -void Grid_Node::write_parent_properties(fld::io::Project_Writer &f, Node *child, bool encapsulate) { +void Grid_Node::write_parent_properties(Project_Writer &f, Node *child, bool encapsulate) { Fl_Grid *grid; Fl_Widget *child_widget; Fl_Grid::Cell *cell; @@ -511,7 +511,7 @@ void Grid_Node::write_parent_properties(fld::io::Project_Writer &f, Node *child, // NOTE: we have to do this in a loop just as ::read_property() in case a new // property is added. In the current setup, all the remaining properties // will be skipped -void Grid_Node::read_parent_property(fld::io::Project_Reader &f, Node *child, const char *property) { +void Grid_Node::read_parent_property(Project_Reader &f, Node *child, const char *property) { if (!child->is_true_widget()) { super::read_parent_property(f, child, property); return; @@ -550,7 +550,7 @@ void Grid_Node::read_parent_property(fld::io::Project_Reader &f, Node *child, co } } -void Grid_Node::write_code1(fld::io::Code_Writer& f) { +void Grid_Node::write_code1(Code_Writer& f) { const char *var = name() ? name() : "o"; Fl_Grid* grid = (Fl_Grid*)o; Widget_Node::write_code1(f); @@ -614,7 +614,7 @@ void Grid_Node::write_code1(fld::io::Code_Writer& f) { } } -void Grid_Node::write_code2(fld::io::Code_Writer& f) { +void Grid_Node::write_code2(Code_Writer& f) { const char *var = name() ? name() : "o"; Fl_Grid* grid = (Fl_Grid*)o; bool first_cell = true; diff --git a/fluid/nodes/Grid_Node.h b/fluid/nodes/Grid_Node.h index 3caf77354..62fdea11c 100644 --- a/fluid/nodes/Grid_Node.h +++ b/fluid/nodes/Grid_Node.h @@ -57,16 +57,16 @@ public: Fl_Widget *widget(int X,int Y,int W,int H); Type type() const { return FLD_NODE_TYPE_Grid; } bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Grid) ? true : super::is_a(inType); } - void write_properties(fld::io::Project_Writer &f); - void read_property(fld::io::Project_Reader &f, const char *); - void write_parent_properties(fld::io::Project_Writer &f, Node *child, bool encapsulate); - void read_parent_property(fld::io::Project_Reader &f, Node *child, const char *property); + void write_properties(Project_Writer &f); + void read_property(Project_Reader &f, const char *); + void write_parent_properties(Project_Writer &f, Node *child, bool encapsulate); + void read_parent_property(Project_Reader &f, Node *child, const char *property); Fl_Widget *enter_live_mode(int top=0); void leave_live_mode(); void copy_properties(); void copy_properties_for_children(); - void write_code1(fld::io::Code_Writer& f); - void write_code2(fld::io::Code_Writer& f); + void write_code1(Code_Writer& f); + void write_code2(Code_Writer& f); void add_child(Node*, Node*); void move_child(Node*, Node*); void remove_child(Node*); diff --git a/fluid/nodes/Group_Node.cxx b/fluid/nodes/Group_Node.cxx index d4dc93780..7ba2b8b84 100644 --- a/fluid/nodes/Group_Node.cxx +++ b/fluid/nodes/Group_Node.cxx @@ -197,14 +197,14 @@ void Group_Node::ideal_size(int &w, int &h) { w = 140; h = 140; } - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } -void Group_Node::write_code1(fld::io::Code_Writer& f) { +void Group_Node::write_code1(Code_Writer& f) { Widget_Node::write_code1(f); } -void Group_Node::write_code2(fld::io::Code_Writer& f) { +void Group_Node::write_code2(Code_Writer& f) { const char *var = name() ? name() : "o"; write_extra_code(f); f.write_c("%s%s->end();\n", f.indent(), var); @@ -357,7 +357,7 @@ void Flex_Node::copy_properties_for_children() { d->layout(); } -void Flex_Node::write_properties(fld::io::Project_Writer &f) +void Flex_Node::write_properties(Project_Writer &f) { Group_Node::write_properties(f); Fl_Flex* flex = (Fl_Flex*)o; @@ -383,7 +383,7 @@ void Flex_Node::write_properties(fld::io::Project_Writer &f) } } -void Flex_Node::read_property(fld::io::Project_Reader &f, const char *c) +void Flex_Node::read_property(Project_Reader &f, const char *c) { Fl_Flex* flex = (Fl_Flex*)o; suspend_auto_layout = 1; @@ -433,7 +433,7 @@ void Flex_Node::postprocess_read() suspend_auto_layout = 0; } -void Flex_Node::write_code2(fld::io::Code_Writer& f) { +void Flex_Node::write_code2(Code_Writer& f) { const char *var = name() ? name() : "o"; Fl_Flex* flex = (Fl_Flex*)o; int lm, tm, rm, bm; @@ -725,7 +725,7 @@ Fl_Widget *Table_Node::enter_live_mode(int) { void Table_Node::ideal_size(int &w, int &h) { w = 160; h = 120; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } // ---- Tabs_Node --------------------------------------------------- MARK: - diff --git a/fluid/nodes/Group_Node.h b/fluid/nodes/Group_Node.h index bf630815c..957bbbdd7 100644 --- a/fluid/nodes/Group_Node.h +++ b/fluid/nodes/Group_Node.h @@ -56,8 +56,8 @@ public: Fl_Widget *widget(int X,int Y,int W,int H) { Fl_Group_Proxy *g = new Fl_Group_Proxy(X,Y,W,H); Fl_Group::current(0); return g;} Widget_Node *_make() {return new Group_Node();} - void write_code1(fld::io::Code_Writer& f); - void write_code2(fld::io::Code_Writer& f); + void write_code1(Code_Writer& f); + void write_code2(Code_Writer& f); void add_child(Node*, Node*); void move_child(Node*, Node*); void remove_child(Node*); @@ -122,13 +122,13 @@ public: Fl_Flex *g = new Fl_Flex_Proxy(X,Y,W,H); Fl_Group::current(0); return g;} Type type() const { return FLD_NODE_TYPE_Flex; } bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Flex) ? true : super::is_a(inType); } - void write_properties(fld::io::Project_Writer &f); - void read_property(fld::io::Project_Reader &f, const char *); + void write_properties(Project_Writer &f); + void read_property(Project_Reader &f, const char *); Fl_Widget *enter_live_mode(int top=0); void copy_properties(); void copy_properties_for_children(); void postprocess_read(); - void write_code2(fld::io::Code_Writer& f); + void write_code2(Code_Writer& f); // void add_child(Node*, Node*); // void move_child(Node*, Node*); void remove_child(Node*); diff --git a/fluid/nodes/Menu_Node.cxx b/fluid/nodes/Menu_Node.cxx index 6f837a9ba..b45015bea 100644 --- a/fluid/nodes/Menu_Node.cxx +++ b/fluid/nodes/Menu_Node.cxx @@ -302,7 +302,7 @@ 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* Menu_Item_Node::menu_name(fld::io::Code_Writer& f, int& i) { +const char* Menu_Item_Node::menu_name(Code_Writer& f, int& i) { i = 0; Node* t = prev; while (t && t->is_a(FLD_NODE_TYPE_Menu_Item)) { @@ -317,7 +317,7 @@ const char* Menu_Item_Node::menu_name(fld::io::Code_Writer& f, int& i) { return f.unique_id(t, "menu", t->name(), t->label()); } -void Menu_Item_Node::write_static(fld::io::Code_Writer& f) { +void Menu_Item_Node::write_static(Code_Writer& f) { if (image && label() && label()[0]) { f.write_h_once("#include <FL/Fl.H>"); f.write_h_once("#include <FL/Fl_Multi_Label.H>"); @@ -451,7 +451,7 @@ void Menu_Item_Node::write_static(fld::io::Code_Writer& f) { f.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(fld::io::Code_Writer& f) + // The actual assignment is in write_code1(Code_Writer& f) f.write_c("Fl_Menu_Item* %s::%s;\n", k, c); } } @@ -473,7 +473,7 @@ int Menu_Item_Node::flags() { return i; } -void Menu_Item_Node::write_item(fld::io::Code_Writer& f) { +void Menu_Item_Node::write_item(Code_Writer& f) { static const char * const labeltypes[] = { "FL_NORMAL_LABEL", "FL_NO_LABEL", @@ -548,7 +548,7 @@ void Menu_Item_Node::write_item(fld::io::Code_Writer& f) { f.write_c("},\n"); } -void start_menu_initialiser(fld::io::Code_Writer& f, int &initialized, const char *name, int index) { +void start_menu_initialiser(Code_Writer& f, int &initialized, const char *name, int index) { if (!initialized) { initialized = 1; f.write_c("%s{ Fl_Menu_Item* o = &%s[%d];\n", f.indent(), name, index); @@ -556,7 +556,7 @@ void start_menu_initialiser(fld::io::Code_Writer& f, int &initialized, const cha } } -void Menu_Item_Node::write_code1(fld::io::Code_Writer& f) { +void Menu_Item_Node::write_code1(Code_Writer& f) { int i; const char* mname = menu_name(f, i); if (!prev->is_a(FLD_NODE_TYPE_Menu_Item)) { @@ -652,7 +652,7 @@ void Menu_Item_Node::write_code1(fld::io::Code_Writer& f) { } } -void Menu_Item_Node::write_code2(fld::io::Code_Writer&) {} +void Menu_Item_Node::write_code2(Code_Writer&) {} //////////////////////////////////////////////////////////////// // This is the base class for widgets that contain a menu (ie @@ -744,7 +744,7 @@ Node* Menu_Base_Node::click_test(int, int) { return this; } -void Menu_Manager_Node::write_code2(fld::io::Code_Writer& f) { +void Menu_Manager_Node::write_code2(Code_Writer& f) { if (next && next->is_a(FLD_NODE_TYPE_Menu_Item)) { f.write_c("%s%s->menu(%s);\n", f.indent(), name() ? name() : "o", f.unique_id(this, "menu", name(), label())); @@ -860,7 +860,7 @@ const char *Menu_Bar_Node::sys_menubar_proxy_name() { } -void Menu_Bar_Node::write_static(fld::io::Code_Writer& f) { +void Menu_Bar_Node::write_static(Code_Writer& f) { super::write_static(f); if (is_sys_menu_bar()) { f.write_h_once("#include <FL/Fl_Sys_Menu_Bar.H>"); @@ -880,7 +880,7 @@ void Menu_Bar_Node::write_static(fld::io::Code_Writer& f) { } } -void Menu_Bar_Node::write_code1(fld::io::Code_Writer& f) { +void Menu_Bar_Node::write_code1(Code_Writer& f) { super::write_code1(f); if (is_sys_menu_bar() && is_in_class()) { f.write_c("%s((%s*)%s)->_parent_class = (void*)this;\n", @@ -888,7 +888,7 @@ void Menu_Bar_Node::write_code1(fld::io::Code_Writer& f) { } } -//void Menu_Bar_Node::write_code2(fld::io::Code_Writer& f) { +//void Menu_Bar_Node::write_code2(Code_Writer& f) { // super::write_code2(f); //} diff --git a/fluid/nodes/Menu_Node.h b/fluid/nodes/Menu_Node.h index b0e46afca..66232cbef 100644 --- a/fluid/nodes/Menu_Node.h +++ b/fluid/nodes/Menu_Node.h @@ -60,12 +60,12 @@ public: int is_button() const {return 1;} // this gets shortcut to work Fl_Widget* widget(int,int,int,int) {return 0;} Widget_Node* _make() {return 0;} - virtual const char* menu_name(fld::io::Code_Writer& f, int& i); + virtual const char* menu_name(Code_Writer& f, int& i); int flags(); - void write_static(fld::io::Code_Writer& f); - void write_item(fld::io::Code_Writer& f); - void write_code1(fld::io::Code_Writer& f); - void write_code2(fld::io::Code_Writer& f); + void write_static(Code_Writer& f); + void write_item(Code_Writer& f); + void write_code1(Code_Writer& f); + void write_code2(Code_Writer& f); int is_true_widget() const { return 0; } Type type() const { return FLD_NODE_TYPE_Menu_Item; } bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Menu_Item) ? true : super::is_a(inType); } @@ -141,10 +141,10 @@ class Menu_Manager_Node : public Widget_Node typedef Widget_Node super; public: void ideal_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; h = layout->textsize_not_null() + 8; w = layout->textsize_not_null() * 6 + 8; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } int can_have_children() const {return 1;} int menusize; @@ -154,7 +154,7 @@ public: void move_child(Node*, Node*) { build_menu(); } void remove_child(Node*) { build_menu();} Node* click_test(int x, int y) = 0; - void write_code2(fld::io::Code_Writer& f); + void write_code2(Code_Writer& f); void copy_properties() = 0; Type type() const { return FLD_NODE_TYPE_Menu_Manager_; } bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Menu_Manager_) ? true : super::is_a(inType); } @@ -294,9 +294,9 @@ public: const char *alt_type_name() {return "fltk::MenuBar";} Fl_Widget *widget(int X,int Y,int W,int H) {return new Fl_Menu_Bar(X,Y,W,H);} Widget_Node *_make() {return new Menu_Bar_Node();} - void write_static(fld::io::Code_Writer& f); - void write_code1(fld::io::Code_Writer& f); -// void write_code2(fld::io::Code_Writer& f); + void write_static(Code_Writer& f); + void write_code1(Code_Writer& f); +// void write_code2(Code_Writer& f); Type type() const { return FLD_NODE_TYPE_Menu_Bar; } bool is_a(Type inType) const { return (inType==FLD_NODE_TYPE_Menu_Bar) ? true : super::is_a(inType); } int is_sys_menu_bar(); diff --git a/fluid/nodes/Node.cxx b/fluid/nodes/Node.cxx index 79bd04b3b..8bcad077d 100644 --- a/fluid/nodes/Node.cxx +++ b/fluid/nodes/Node.cxx @@ -895,7 +895,7 @@ void Node::move_before(Node* g) { // write a widget and all its children: -void Node::write(fld::io::Project_Writer &f) { +void Node::write(Project_Writer &f) { if (f.write_codeview()) proj1_start = (int)ftell(f.file()) + 1; if (f.write_codeview()) proj2_start = (int)ftell(f.file()) + 1; f.write_indent(level); @@ -927,7 +927,7 @@ void Node::write(fld::io::Project_Writer &f) { if (f.write_codeview()) proj2_end = (int)ftell(f.file()); } -void Node::write_properties(fld::io::Project_Writer &f) { +void Node::write_properties(Project_Writer &f) { // repeat this for each attribute: if (Fluid.proj.write_mergeback_data && uid_) { f.write_word("uid"); @@ -961,7 +961,7 @@ void Node::write_properties(fld::io::Project_Writer &f) { if (selected) f.write_word("selected"); } -void Node::read_property(fld::io::Project_Reader &f, const char *c) { +void Node::read_property(Project_Reader &f, const char *c) { if (!strcmp(c,"uid")) { const char *hex = f.read_word(); int x = 0; @@ -1026,13 +1026,13 @@ void Node::read_property(fld::io::Project_Reader &f, const char *c) { Lastly, this method should call the super class to give it a chance to append its own properties. - \see Grid_Node::write_parent_properties(fld::io::Project_Writer &f, Node *child, bool encapsulate) + \see Grid_Node::write_parent_properties(Project_Writer &f, Node *child, bool encapsulate) \param[in] f the project file writer \param[in] child write properties for this child, make sure it has the correct type \param[in] encapsulate write the `parent_properties {}` block if true before writing any properties */ -void Node::write_parent_properties(fld::io::Project_Writer &f, Node *child, bool encapsulate) { +void Node::write_parent_properties(Project_Writer &f, Node *child, bool encapsulate) { (void)f; (void)child; (void)encapsulate; // nothing to do here // put the following code into your implementation of write_parent_properties @@ -1059,14 +1059,14 @@ void Node::write_parent_properties(fld::io::Project_Writer &f, Node *child, bool method reads back those properties. This function is virtual, so if a Type does not support a property, it will propagate to its super class. - \see Node::write_parent_properties(fld::io::Project_Writer &f, Node *child, bool encapsulate) - \see Grid_Node::read_parent_property(fld::io::Project_Reader &f, Node *child, const char *property) + \see Node::write_parent_properties(Project_Writer &f, Node *child, bool encapsulate) + \see Grid_Node::read_parent_property(Project_Reader &f, Node *child, const char *property) \param[in] f the project file writer \param[in] child read properties for this child \param[in] property the name of a property, or "}" when we reach the end of the list */ -void Node::read_parent_property(fld::io::Project_Reader &f, Node *child, const char *property) { +void Node::read_parent_property(Project_Reader &f, Node *child, const char *property) { (void)child; f.read_error("Unknown parent property \"%s\"", property); } @@ -1078,7 +1078,7 @@ int Node::read_fdesign(const char*, const char*) {return 0;} Write a comment into the header file. \param[in] pre indent the comment by this string */ -void Node::write_comment_h(fld::io::Code_Writer& f, const char *pre) +void Node::write_comment_h(Code_Writer& f, const char *pre) { if (comment() && *comment()) { f.write_h("%s/**\n", pre); @@ -1101,7 +1101,7 @@ void Node::write_comment_h(fld::io::Code_Writer& f, const char *pre) /** Write a comment into the source file. */ -void Node::write_comment_c(fld::io::Code_Writer& f, const char *pre) +void Node::write_comment_c(Code_Writer& f, const char *pre) { if (comment() && *comment()) { f.write_c("%s/**\n", pre); @@ -1126,7 +1126,7 @@ void Node::write_comment_c(fld::io::Code_Writer& f, const char *pre) /** Write a comment into the source file. */ -void Node::write_comment_inline_c(fld::io::Code_Writer& f, const char *pre) +void Node::write_comment_inline_c(Code_Writer& f, const char *pre) { if (comment() && *comment()) { const char *s = comment(); @@ -1207,7 +1207,7 @@ int Node::user_defined(const char* cbname) const { return 0; } -const char *Node::callback_name(fld::io::Code_Writer& f) { +const char *Node::callback_name(Code_Writer& f) { if (is_name(callback())) return callback(); return f.unique_id(this, "cb", name(), label()); } @@ -1260,18 +1260,18 @@ bool Node::is_in_class() const { return false; } -void Node::write_static(fld::io::Code_Writer&) { +void Node::write_static(Code_Writer&) { } -void Node::write_static_after(fld::io::Code_Writer&) { +void Node::write_static_after(Code_Writer&) { } -void Node::write_code1(fld::io::Code_Writer& f) { +void Node::write_code1(Code_Writer& f) { f.write_h("// Header for %s\n", title()); f.write_c("// Code for %s\n", title()); } -void Node::write_code2(fld::io::Code_Writer&) { +void Node::write_code2(Code_Writer&) { } /** Set a uid that is unique within the project. diff --git a/fluid/nodes/Node.h b/fluid/nodes/Node.h index a20dd7258..91a1ad84f 100644 --- a/fluid/nodes/Node.h +++ b/fluid/nodes/Node.h @@ -26,15 +26,9 @@ class Node; class Group_Node; class Window_Node; -namespace fld { -namespace io { - class Project_Reader; class Project_Writer; -} // namespace io -} // namespace fld - /** Declare where a new type is placed and how to create it. @@ -53,8 +47,8 @@ class Project_Writer; Add a hierarchy of Types void Node::add(Node *p, Strategy strategy) int read_file(const char *filename, int merge, Strategy strategy) - Node *fld::io::Project_Reader::read_children(Node *p, int merge, Strategy strategy, char skip_options) - int fld::io::Project_Reader::read_project(const char *filename, int merge, Strategy strategy) + Node *Project_Reader::read_children(Node *p, int merge, Strategy strategy, char skip_options) + int Project_Reader::read_project(const char *filename, int merge, Strategy strategy) */ typedef struct Strategy { enum Flags { @@ -195,7 +189,7 @@ public: // things that should not be public: Node *first_child(); Node *factory; - const char *callback_name(fld::io::Code_Writer& f); + const char *callback_name(Code_Writer& f); // text positions of this type in code, header, and project file (see codeview) int code_static_start, code_static_end; @@ -256,22 +250,22 @@ public: virtual void open(); // what happens when you double-click // read and write data to a saved file: - virtual void write(fld::io::Project_Writer &f); - virtual void write_properties(fld::io::Project_Writer &f); - virtual void read_property(fld::io::Project_Reader &f, const char *); - virtual void write_parent_properties(fld::io::Project_Writer &f, Node *child, bool encapsulate); - virtual void read_parent_property(fld::io::Project_Reader &f, Node *child, const char *property); + virtual void write(Project_Writer &f); + virtual void write_properties(Project_Writer &f); + virtual void read_property(Project_Reader &f, const char *); + virtual void write_parent_properties(Project_Writer &f, Node *child, bool encapsulate); + virtual void read_parent_property(Project_Reader &f, Node *child, const char *property); virtual int read_fdesign(const char*, const char*); virtual void postprocess_read() { } // write code, these are called in order: - virtual void write_static(fld::io::Code_Writer& f); // write static stuff to .c file - virtual void write_static_after(fld::io::Code_Writer& f); // write static stuff after children - virtual void write_code1(fld::io::Code_Writer& f); // code and .h before children - virtual void write_code2(fld::io::Code_Writer& f); // code and .h after children - void write_comment_h(fld::io::Code_Writer& f, const char *ind=""); // write the commentary text into the header file - void write_comment_c(fld::io::Code_Writer& f, const char *ind=""); // write the commentary text into the source file - void write_comment_inline_c(fld::io::Code_Writer& f, const char *ind=0); // write the commentary text + virtual void write_static(Code_Writer& f); // write static stuff to .c file + virtual void write_static_after(Code_Writer& f); // write static stuff after children + virtual void write_code1(Code_Writer& f); // code and .h before children + virtual void write_code2(Code_Writer& f); // code and .h after children + void write_comment_h(Code_Writer& f, const char *ind=""); // write the commentary text into the header file + void write_comment_c(Code_Writer& f, const char *ind=""); // write the commentary text into the source file + void write_comment_inline_c(Code_Writer& f, const char *ind=0); // write the commentary text // live mode virtual Fl_Widget *enter_live_mode(int top=0); // build widgets needed for live mode diff --git a/fluid/nodes/Tree.cxx b/fluid/nodes/Tree.cxx index e11c399e2..5ac203ff6 100644 --- a/fluid/nodes/Tree.cxx +++ b/fluid/nodes/Tree.cxx @@ -19,7 +19,7 @@ #include "Project.h" -fld::node::Tree::Iterator::Iterator(Node *t, bool only_selected) +Tree::Iterator::Iterator(Node *t, bool only_selected) : type_(t) , only_selected_(only_selected) { @@ -32,7 +32,7 @@ fld::node::Tree::Iterator::Iterator(Node *t, bool only_selected) } } -fld::node::Tree::Iterator &fld::node::Tree::Iterator::operator++() { +Tree::Iterator &Tree::Iterator::operator++() { if (only_selected_) { do { type_ = type_->next; @@ -43,7 +43,7 @@ fld::node::Tree::Iterator &fld::node::Tree::Iterator::operator++() { return *this; } -fld::node::Tree::WIterator::WIterator(Node *t, bool only_selected) +Tree::WIterator::WIterator(Node *t, bool only_selected) : type_(t) , only_selected_(only_selected) { @@ -60,7 +60,7 @@ fld::node::Tree::WIterator::WIterator(Node *t, bool only_selected) } } -fld::node::Tree::WIterator& fld::node::Tree::WIterator::operator++() { +Tree::WIterator& Tree::WIterator::operator++() { if (only_selected_) { do { type_ = type_->next; @@ -74,7 +74,7 @@ fld::node::Tree::WIterator& fld::node::Tree::WIterator::operator++() { } -fld::node::Tree::Tree(Project &proj) +Tree::Tree(Project &proj) : proj_(proj) { (void)proj_; } @@ -87,7 +87,7 @@ fld::node::Tree::Tree(Project &proj) \param[in] uid any number between 0 and 65535 \return the node with this uid, or 0 if not found */ -Node *fld::node::Tree::find_by_uid(unsigned short uid) { +Node *Tree::find_by_uid(unsigned short uid) { for (Node *tp: all_nodes()) { if (tp->get_uid() == uid) return tp; } @@ -101,7 +101,7 @@ Node *fld::node::Tree::find_by_uid(unsigned short uid) { \param[in] crsr cursor position in text \return the node we found or 0 */ -Node *fld::node::Tree::find_in_text(int text_type, int crsr) { +Node *Tree::find_in_text(int text_type, int crsr) { for (Node *node: all_nodes()) { switch (text_type) { case 0: diff --git a/fluid/nodes/Tree.h b/fluid/nodes/Tree.h index b166c7f0b..052553fa2 100644 --- a/fluid/nodes/Tree.h +++ b/fluid/nodes/Tree.h @@ -21,12 +21,8 @@ class Node; -namespace fld { - class Project; -namespace node { - class Tree { // A class that can iterate over the entire scene graph. @@ -99,8 +95,6 @@ public: Node *find_in_text(int text_type, int crsr); }; -} // namespace node -} // namespace fld #endif // FLUID_NODES_TREE_H diff --git a/fluid/nodes/Widget_Node.cxx b/fluid/nodes/Widget_Node.cxx index 757155335..51ccf8bb0 100644 --- a/fluid/nodes/Widget_Node.cxx +++ b/fluid/nodes/Widget_Node.cxx @@ -98,7 +98,7 @@ const char* subclassname(Node* l) { void Widget_Node::ideal_size(int &w, int &h) { w = 120; h = 100; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } /** @@ -461,88 +461,88 @@ void label_cb(Fl_Input* i, void* v) { int widget_i = 0; -static int vars_i_cb(const fld::widget::Formula_Input*, void* v) { +static int vars_i_cb(const Formula_Input*, void* v) { return widget_i; } -static int vars_x_cb(const fld::widget::Formula_Input*, void* v) { +static int vars_x_cb(const Formula_Input*, void* v) { Node* t = (Node*)v; if (t->is_widget()) return ((Widget_Node*)t)->o->x(); return 0; } -static int vars_y_cb(const fld::widget::Formula_Input*, void* v) { +static int vars_y_cb(const Formula_Input*, void* v) { Node* t = (Node*)v; if (t->is_widget()) return ((Widget_Node*)t)->o->y(); return 0; } -static int vars_w_cb(const fld::widget::Formula_Input*, void* v) { +static int vars_w_cb(const Formula_Input*, void* v) { Node* t = (Node*)v; if (t->is_widget()) return ((Widget_Node*)t)->o->w(); return 0; } -static int vars_h_cb(const fld::widget::Formula_Input*, void* v) { +static int vars_h_cb(const Formula_Input*, void* v) { Node* t = (Node*)v; if (t->is_widget()) return ((Widget_Node*)t)->o->h(); return 0; } -static int vars_px_cb(const fld::widget::Formula_Input*, void* v) { +static int vars_px_cb(const Formula_Input*, void* v) { Node* t = ((Node*)v)->parent; if (t && t->is_widget()) return ((Widget_Node*)t)->o->x(); return 0; } -static int vars_py_cb(const fld::widget::Formula_Input*, void* v) { +static int vars_py_cb(const Formula_Input*, void* v) { Node* t = ((Node*)v)->parent; if (t && t->is_widget()) return ((Widget_Node*)t)->o->y(); return 0; } -static int vars_pw_cb(const fld::widget::Formula_Input*, void* v) { +static int vars_pw_cb(const Formula_Input*, void* v) { Node* t = ((Node*)v)->parent; if (t && t->is_widget()) return ((Widget_Node*)t)->o->w(); return 0; } -static int vars_ph_cb(const fld::widget::Formula_Input*, void* v) { +static int vars_ph_cb(const Formula_Input*, void* v) { Node* t = ((Node*)v)->parent; if (t && t->is_widget()) return ((Widget_Node*)t)->o->h(); return 0; } -static int vars_sx_cb(const fld::widget::Formula_Input*, void* v) { +static int vars_sx_cb(const Formula_Input*, void* v) { Node* t = ((Node*)v)->prev_sibling(); if (t && t->is_widget()) return ((Widget_Node*)t)->o->x(); return 0; } -static int vars_sy_cb(const fld::widget::Formula_Input*, void* v) { +static int vars_sy_cb(const Formula_Input*, void* v) { Node* t = ((Node*)v)->prev_sibling(); if (t && t->is_widget()) return ((Widget_Node*)t)->o->y(); return 0; } -static int vars_sw_cb(const fld::widget::Formula_Input*, void* v) { +static int vars_sw_cb(const Formula_Input*, void* v) { Node* t = ((Node*)v)->prev_sibling(); if (t && t->is_widget()) return ((Widget_Node*)t)->o->w(); return 0; } -static int vars_sh_cb(const fld::widget::Formula_Input*, void* v) { +static int vars_sh_cb(const Formula_Input*, void* v) { Node* t = ((Node*)v)->prev_sibling(); if (t && t->is_widget()) return ((Widget_Node*)t)->o->h(); @@ -571,27 +571,27 @@ static void calculate_bbox(Node* p) { } } -static int vars_cx_cb(const fld::widget::Formula_Input*, void* v) { +static int vars_cx_cb(const Formula_Input*, void* v) { calculate_bbox((Node*)v); return bbox_x; } -static int vars_cy_cb(const fld::widget::Formula_Input*, void* v) { +static int vars_cy_cb(const Formula_Input*, void* v) { calculate_bbox((Node*)v); return bbox_y; } -static int vars_cw_cb(const fld::widget::Formula_Input*, void* v) { +static int vars_cw_cb(const Formula_Input*, void* v) { calculate_bbox((Node*)v); return bbox_r - bbox_x; } -static int vars_ch_cb(const fld::widget::Formula_Input*, void* v) { +static int vars_ch_cb(const Formula_Input*, void* v) { calculate_bbox((Node*)v); return bbox_b - bbox_y; } -fld::widget::Formula_Input_Vars widget_vars[] = { +Formula_Input_Vars widget_vars[] = { { "i", vars_i_cb }, // zero based counter of selected widgets { "x", vars_x_cb }, // position and size of current widget { "y", vars_y_cb }, @@ -1566,7 +1566,7 @@ int isdeclare(const char* c) { return 0; } -void Widget_Node::write_static(fld::io::Code_Writer& f) { +void Widget_Node::write_static(Code_Writer& f) { const char* t = subclassname(this); const char* sc = subclass(); if (!sc || !sc[0] || (is_class() && strncmp(t, "Fl_", 3)==0)) { @@ -1659,7 +1659,7 @@ void Widget_Node::write_static(fld::io::Code_Writer& f) { } } -void Widget_Node::write_code1(fld::io::Code_Writer& f) { +void Widget_Node::write_code1(Code_Writer& f) { const char* t = subclassname(this); const char* c = array_name(this); if (c) { @@ -1787,7 +1787,7 @@ void Widget_Node::write_code1(fld::io::Code_Writer& f) { write_widget_code(f); } -void Widget_Node::write_color(fld::io::Code_Writer& f, const char* field, Fl_Color color) { +void Widget_Node::write_color(Code_Writer& f, const char* field, Fl_Color color) { const char* color_name = 0; switch (color) { case FL_FOREGROUND_COLOR: color_name = "FL_FOREGROUND_COLOR"; break; @@ -1825,8 +1825,8 @@ void Widget_Node::write_color(fld::io::Code_Writer& f, const char* field, Fl_Col } } -// this is split from write_code1(fld::io::Code_Writer& f) for Window_Node: -void Widget_Node::write_widget_code(fld::io::Code_Writer& f) { +// this is split from write_code1(Code_Writer& f) for Window_Node: +void Widget_Node::write_widget_code(Code_Writer& f) { Fl_Widget* tplate = ((Widget_Node*)factory)->o; const char* var = is_class() ? "this" : name() ? name() : "o"; @@ -2033,27 +2033,27 @@ void Widget_Node::write_widget_code(fld::io::Code_Writer& f) { } } -void Widget_Node::write_extra_code(fld::io::Code_Writer& f) { +void Widget_Node::write_extra_code(Code_Writer& f) { int n; for (n =0; n < NUM_EXTRA_CODE; n++) if (extra_code(n) && extra_code(n)[0] && !isdeclare(extra_code(n))) f.write_c("%s%s\n", f.indent(), extra_code(n)); } -void Widget_Node::write_block_close(fld::io::Code_Writer& f) { +void Widget_Node::write_block_close(Code_Writer& f) { f.indentation--; f.write_c("%s} // %s* %s\n", f.indent(), subclassname(this), name() ? name() : "o"); } -void Widget_Node::write_code2(fld::io::Code_Writer& f) { +void Widget_Node::write_code2(Code_Writer& f) { write_extra_code(f); write_block_close(f); } //////////////////////////////////////////////////////////////// -void Widget_Node::write_properties(fld::io::Project_Writer &f) { +void Widget_Node::write_properties(Project_Writer &f) { Node::write_properties(f); f.write_indent(level+1); switch (public_) { @@ -2188,7 +2188,7 @@ void Widget_Node::write_properties(fld::io::Project_Writer &f) { } } -void Widget_Node::read_property(fld::io::Project_Reader &f, const char* c) { +void Widget_Node::read_property(Project_Reader &f, const char* c) { int x,y,w,h; Fl_Font ft; int s; Fl_Color cc; if (!strcmp(c,"private")) { public_ = 0; @@ -2401,7 +2401,7 @@ int Widget_Node::read_fdesign(const char* propname, const char* value) { if (!strcmp(propname,"box")) { float x,y,w,h; if (sscanf(value,"%f %f %f %f",&x,&y,&w,&h) == 4) { - if (fld::io::fdesign_flip) { + if (fdesign_flip) { Node* p; for (p = parent; p && !p->is_a(FLD_NODE_TYPE_Window); p = p->parent) {/*empty*/} if (p && p->is_widget()) y = ((Widget_Node*)p)->o->h()-(y+h); diff --git a/fluid/nodes/Widget_Node.h b/fluid/nodes/Widget_Node.h index 6259c079a..901315390 100644 --- a/fluid/nodes/Widget_Node.h +++ b/fluid/nodes/Widget_Node.h @@ -69,13 +69,13 @@ protected: /// disabling the output of the "hide" property by the Widget Type. uchar override_visible_; - void write_static(fld::io::Code_Writer& f); - void write_code1(fld::io::Code_Writer& f); - void write_widget_code(fld::io::Code_Writer& f); - void write_extra_code(fld::io::Code_Writer& f); - void write_block_close(fld::io::Code_Writer& f); - void write_code2(fld::io::Code_Writer& f); - void write_color(fld::io::Code_Writer& f, const char*, Fl_Color); + void write_static(Code_Writer& f); + void write_code1(Code_Writer& f); + void write_widget_code(Code_Writer& f); + void write_extra_code(Code_Writer& f); + void write_block_close(Code_Writer& f); + void write_code2(Code_Writer& f); + void write_color(Code_Writer& f, const char*, Fl_Color); /// Pointer to widget representing this node in live mode. Fl_Widget* live_widget; @@ -145,8 +145,8 @@ public: int is_true_widget() const { return 1; } int is_public() const; - void write_properties(fld::io::Project_Writer &f); - void read_property(fld::io::Project_Reader &f, const char *); + void write_properties(Project_Writer &f); + void read_property(Project_Reader &f, const char *); int read_fdesign(const char*, const char*); Fl_Widget* enter_live_mode(int top=0); diff --git a/fluid/nodes/Window_Node.cxx b/fluid/nodes/Window_Node.cxx index 5cdda615d..a4fef0976 100644 --- a/fluid/nodes/Window_Node.cxx +++ b/fluid/nodes/Window_Node.cxx @@ -81,7 +81,7 @@ void i18n_type_cb(Fl_Choice *c, void *v) { c->value(static_cast<int>(Fluid.proj.i18n.type)); } else { Fluid.proj.undo.checkpoint(); - Fluid.proj.i18n.type = static_cast<fld::I18n_Type>(c->value()); + Fluid.proj.i18n.type = static_cast<I18n_Type>(c->value()); Fluid.proj.set_modflag(1); } switch (Fluid.proj.i18n.type) { @@ -344,7 +344,7 @@ void Window_Node::ideal_size(int &w, int &h) { Fl::screen_work_area(sx, sy, sw, sh, screen); w = MIN(w, sw*3/4); h = MIN(h, sh*3/4); } - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } @@ -364,7 +364,7 @@ void Overlay_Window::resize(int X,int Y,int W,int H) { if (X!=x() || Y!=y() || W!=w() || H!=h()) { // Set a checkpoint on the first resize event, ignore further resizes until // a different type of checkpoint is triggered. - if (Fluid.proj.undo.checkpoint(fld::proj::FLD_UNDO_ONCETYPE_WINDOW_RESIZE)) + if (Fluid.proj.undo.checkpoint(FLD_UNDO_ONCETYPE_WINDOW_RESIZE)) Fluid.proj.set_modflag(1); } @@ -410,8 +410,8 @@ void Window_Node::newdx() { break; } } - fld::app::Snap_Data data = { mydx, mydy, bx, by, br, bt, drag, 4, 4, mydx, mydy, (Widget_Node*)selection, this }; - fld::app::Snap_Action::check_all(data); + Snap_Data data = { mydx, mydy, bx, by, br, bt, drag, 4, 4, mydx, mydy, (Widget_Node*)selection, this }; + Snap_Action::check_all(data); if (data.x_dist < 4) mydx = data.dx_out; if (data.y_dist < 4) mydy = data.dy_out; } @@ -663,8 +663,8 @@ void Window_Node::draw_overlay() { fl_rectf(mysx,myst-5,5,5); if (Fluid.show_guides && (drag & (FD_DRAG|FD_TOP|FD_LEFT|FD_BOTTOM|FD_RIGHT))) { - fld::app::Snap_Data data = { dx, dy, sx, sy, sr, st, drag, 4, 4, dx, dy, (Widget_Node*)selection, this}; - fld::app::Snap_Action::draw_all(data); + Snap_Data data = { dx, dy, sx, sy, sr, st, drag, 4, 4, dx, dy, (Widget_Node*)selection, this}; + Snap_Action::draw_all(data); } } @@ -1182,9 +1182,9 @@ int Window_Node::handle(int event) { if (Fl::event_state(FL_COMMAND)) { int x_step, y_step; if (drag & (FD_RIGHT|FD_BOTTOM)) - fld::app::Snap_Action::get_resize_stepsize(x_step, y_step); + Snap_Action::get_resize_stepsize(x_step, y_step); else - fld::app::Snap_Action::get_move_stepsize(x_step, y_step); + Snap_Action::get_move_stepsize(x_step, y_step); dx *= x_step; dy *= y_step; } @@ -1219,7 +1219,7 @@ int Window_Node::handle(int event) { Write the C++ code that comes before the children of the window are written. \param f the source code output stream */ -void Window_Node::write_code1(fld::io::Code_Writer& f) { +void Window_Node::write_code1(Code_Writer& f) { Widget_Node::write_code1(f); } @@ -1228,7 +1228,7 @@ void Window_Node::write_code1(fld::io::Code_Writer& f) { Write the C++ code that comes after the children of the window are written. \param f the source code output stream */ -void Window_Node::write_code2(fld::io::Code_Writer& f) { +void Window_Node::write_code2(Code_Writer& f) { const char *var = is_class() ? "this" : name() ? name() : "o"; // make the window modal or non-modal if (modal) { @@ -1263,7 +1263,7 @@ void Window_Node::write_code2(fld::io::Code_Writer& f) { write_block_close(f); } -void Window_Node::write_properties(fld::io::Project_Writer &f) { +void Window_Node::write_properties(Project_Writer &f) { Widget_Node::write_properties(f); if (modal) f.write_string("modal"); else if (non_modal) f.write_string("non_modal"); @@ -1274,7 +1274,7 @@ void Window_Node::write_properties(fld::io::Project_Writer &f) { if (o->visible() || override_visible_) f.write_string("visible"); } -void Window_Node::read_property(fld::io::Project_Reader &f, const char *c) { +void Window_Node::read_property(Project_Reader &f, const char *c) { if (!strcmp(c,"modal")) { modal = 1; } else if (!strcmp(c,"non_modal")) { @@ -1362,7 +1362,7 @@ Node *Widget_Class_Node::make(Strategy strategy) { return myo; } -void Widget_Class_Node::write_properties(fld::io::Project_Writer &f) { +void Widget_Class_Node::write_properties(Project_Writer &f) { Window_Node::write_properties(f); if (wc_relative==1) f.write_string("position_relative"); @@ -1370,7 +1370,7 @@ void Widget_Class_Node::write_properties(fld::io::Project_Writer &f) { f.write_string("position_relative_rescale"); } -void Widget_Class_Node::read_property(fld::io::Project_Reader &f, const char *c) { +void Widget_Class_Node::read_property(Project_Reader &f, const char *c) { if (!strcmp(c,"position_relative")) { wc_relative = 1; } else if (!strcmp(c,"position_relative_rescale")) { @@ -1393,9 +1393,9 @@ static const char *trimclassname(const char *n) { } -void Widget_Class_Node::write_code1(fld::io::Code_Writer& f) { +void Widget_Class_Node::write_code1(Code_Writer& f) { #if 0 - Widget_Node::write_code1(fld::io::Code_Writer& f); + Widget_Node::write_code1(Code_Writer& f); #endif // 0 current_widget_class = this; @@ -1463,7 +1463,7 @@ void Widget_Class_Node::write_code1(fld::io::Code_Writer& f) { Write the C++ code that comes after the children of the window are written. \param f the source code output stream */ -void Widget_Class_Node::write_code2(fld::io::Code_Writer& f) { +void Widget_Class_Node::write_code2(Code_Writer& f) { // make the window modal or non-modal if (modal) { f.write_c("%sset_modal();\n", f.indent()); diff --git a/fluid/nodes/Window_Node.h b/fluid/nodes/Window_Node.h index 3c916576d..744847666 100644 --- a/fluid/nodes/Window_Node.h +++ b/fluid/nodes/Window_Node.h @@ -70,8 +70,8 @@ protected: void newposition(Widget_Node *,int &x,int &y,int &w,int &h); int handle(int); void setlabel(const char *); - void write_code1(fld::io::Code_Writer& f); - void write_code2(fld::io::Code_Writer& f); + void write_code1(Code_Writer& f); + void write_code2(Code_Writer& f); Widget_Node *_make() {return 0;} // we don't call this Fl_Widget *widget(int,int,int,int) {return 0;} int recalc; // set by fix_overlay() @@ -108,8 +108,8 @@ public: void fix_overlay(); // Update the bounding box, etc uchar *read_image(int &ww, int &hh); // Read an image of the window - void write_properties(fld::io::Project_Writer &f); - void read_property(fld::io::Project_Reader &f, const char *); + void write_properties(Project_Writer &f); + void read_property(Project_Reader &f, const char *); int read_fdesign(const char*, const char*); void add_child(Node*, Node*); @@ -145,11 +145,11 @@ public: char write_public_state; // true when public: has been printed char wc_relative; // if 1, reposition all children, if 2, reposition and resize - void write_properties(fld::io::Project_Writer &f); - void read_property(fld::io::Project_Reader &f, const char *); + void write_properties(Project_Writer &f); + void read_property(Project_Reader &f, const char *); - void write_code1(fld::io::Code_Writer& f); - void write_code2(fld::io::Code_Writer& f); + void write_code1(Code_Writer& f); + void write_code2(Code_Writer& f); Node *make(Strategy strategy); const char *type_name() {return "widget_class";} Type type() const { return FLD_NODE_TYPE_Widget_Class; } diff --git a/fluid/nodes/factory.cxx b/fluid/nodes/factory.cxx index c901c9945..06c8eee90 100644 --- a/fluid/nodes/factory.cxx +++ b/fluid/nodes/factory.cxx @@ -122,7 +122,7 @@ public: void ideal_size(int &w, int &h) { w = 120; h = 160; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } const char *type_name() { return "Fl_Browser_"; } const char *alt_type_name() { return "fltk::Browser_"; } @@ -257,7 +257,7 @@ public: void ideal_size(int &w, int &h) { w = 120; h = 160; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } const char *type_name() { return "Fl_Tree"; } const char *alt_type_name() { return "fltk::TreeBrowser"; } @@ -312,7 +312,7 @@ public: void ideal_size(int &w, int &h) { w = 160; h = 120; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } const char *type_name() { return "Fl_Help_View"; } const char *alt_type_name() { return "fltk::HelpView"; } @@ -392,10 +392,10 @@ private: } public: void ideal_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; h = layout->textsize_not_null() + 8; w = layout->textsize_not_null() * 4 + 4 * h; // make room for the arrows - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } const char *type_name() { return "Fl_Counter"; } const char *alt_type_name() { return "fltk::Counter"; } @@ -422,10 +422,10 @@ public: static Adjuster_Node prototype; public: void ideal_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; h = layout->labelsize + 8; w = 3 * h; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } const char *type_name() { return "Fl_Adjuster"; } const char *alt_type_name() { return "fltk::Adjuster"; } @@ -462,7 +462,7 @@ private: public: void ideal_size(int &w, int &h) { w = 60; h = 60; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } const char *type_name() { return "Fl_Dial"; } const char *alt_type_name() { return "fltk::Dial"; } @@ -497,10 +497,10 @@ private: Fl_Menu_Item *subtypes() { return roller_type_menu; } public: void ideal_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; w = layout->labelsize + 8; h = 4 * w; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } const char *type_name() { return "Fl_Roller"; } const char *alt_type_name() { return "fltk::Roller"; } @@ -541,10 +541,10 @@ private: Fl_Menu_Item *subtypes() { return slider_type_menu; } public: void ideal_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; w = layout->labelsize + 8; h = 4 * w; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } const char *type_name() { return "Fl_Slider"; } const char *alt_type_name() { return "fltk::Slider"; } @@ -651,10 +651,10 @@ private: } public: void ideal_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; h = layout->textsize_not_null() + 8; w = layout->textsize_not_null() * 4 + 8; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } const char *type_name() { return "Fl_Value_Input"; } const char *alt_type_name() { return "fltk::ValueInput"; } @@ -694,10 +694,10 @@ private: } public: void ideal_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; h = layout->textsize_not_null() + 8; w = layout->textsize_not_null() * 4 + 8; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } const char *type_name() { return "Fl_Value_Output"; } const char *alt_type_name() { return "fltk::ValueOutput"; } @@ -753,10 +753,10 @@ private: } public: void ideal_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; h = layout->textsize_not_null() + 8; w = layout->textsize_not_null() * 6 + 8; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } const char *type_name() { return "Fl_Input"; } const char *alt_type_name() { return "fltk::Input"; } @@ -795,10 +795,10 @@ private: Fl_Menu_Item *subtypes() { return 0; } // Don't inherit. public: void ideal_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; h = layout->textsize_not_null() + 8 + 10; // Directoy bar is additional 10 pixels high w = layout->textsize_not_null() * 10 + 8; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } const char *type_name() { return "Fl_File_Input"; } const char *alt_type_name() { return "fltk::FileInput"; } @@ -879,10 +879,10 @@ private: } public: void ideal_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; h = layout->textsize_not_null() * 4 + 8; w = layout->textsize_not_null() * 10 + 8; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } const char *type_name() { return "Fl_Text_Display"; } const char *alt_type_name() { return "fltk::TextDisplay"; } @@ -1045,7 +1045,7 @@ public: public: void ideal_size(int &w, int &h) { w = 100; h = 100; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } const char *type_name() { return "Fl_Box"; } const char *alt_type_name() { return "fltk::Widget"; } @@ -1074,7 +1074,7 @@ public: public: void ideal_size(int &w, int &h) { w = 80; h = 80; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } const char *type_name() { return "Fl_Clock"; } const char *alt_type_name() { return "fltk::Clock"; } @@ -1103,10 +1103,10 @@ public: static Progress_Node prototype; public: void ideal_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; h = layout->labelsize + 8; w = layout->labelsize * 12; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } const char *type_name() { return "Fl_Progress"; } const char *alt_type_name() { return "fltk::ProgressBar"; } @@ -1155,10 +1155,10 @@ private: } public: void ideal_size(int &w, int &h) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; h = layout->textsize_not_null() + 8; w = layout->textsize_not_null() * 4 + 8; - fld::app::Snap_Action::better_size(w, h); + Snap_Action::better_size(w, h); } const char *type_name() { return "Fl_Spinner"; } const char *alt_type_name() { return "fltk::Spinner"; } @@ -1284,11 +1284,11 @@ static Node *known_types[] = { Node *add_new_widget_from_user(Node *inPrototype, Strategy strategy, bool and_open) { Fluid.proj.undo.checkpoint(); Fluid.proj.undo.suspend(); - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; Node *t = ((Node*)inPrototype)->make(strategy); if (t) { if (t->is_widget() && !t->is_a(FLD_NODE_TYPE_Window)) { - fld::app::Layout_Preset *layout = Fluid.proj.layout; + Layout_Preset *layout = Fluid.proj.layout; Widget_Node *wt = (Widget_Node *)t; bool changed = false; diff --git a/fluid/panels/codeview_panel.cxx b/fluid/panels/codeview_panel.cxx index 728ee986c..37e8b873f 100644 --- a/fluid/panels/codeview_panel.cxx +++ b/fluid/panels/codeview_panel.cxx @@ -171,7 +171,7 @@ void update_codeview_cb(class Fl_Button*, void*) { } if (cv_project->visible_r()) { - fld::io::write_file(Fluid.proj, cv_design_filename, false, true); + write_file(Fluid.proj, cv_design_filename, false, true); int top = cv_project->top_line(); cv_project->buffer()->loadfile(cv_design_filename); cv_project->scroll(top, 0); @@ -181,7 +181,7 @@ void update_codeview_cb(class Fl_Button*, void*) { fl_strlcpy(fn, Fluid.get_tmpdir(), FL_PATH_MAX); fl_strlcat(fn, "strings", FL_PATH_MAX); fl_filename_setext(fn, FL_PATH_MAX, exts[(int)(Fluid.proj.i18n.type)]); - fld::io::write_strings(Fluid.proj, fn); + write_strings(Fluid.proj, fn); int top = cv_strings->top_line(); cv_strings->buffer()->loadfile(fn); cv_strings->scroll(top, 0); @@ -194,7 +194,7 @@ void update_codeview_cb(class Fl_Button*, void*) { Fluid.proj.set_header_file_name(cv_header_filename); // generate the code and load the files - fld::io::Code_Writer f(Fluid.proj); + Code_Writer f(Fluid.proj); // generate files if (f.write_code(cv_source_filename, cv_header_filename, true)) { @@ -271,13 +271,13 @@ Fl_Tabs *cv_tab=(Fl_Tabs *)0; Fl_Group *cv_source_tab=(Fl_Group *)0; -fld::widget::Code_Viewer *cv_source=(fld::widget::Code_Viewer *)0; +Code_Viewer *cv_source=(Code_Viewer *)0; -fld::widget::Code_Viewer *cv_header=(fld::widget::Code_Viewer *)0; +Code_Viewer *cv_header=(Code_Viewer *)0; -fld::widget::Text_Viewer *cv_strings=(fld::widget::Text_Viewer *)0; +Text_Viewer *cv_strings=(Text_Viewer *)0; -fld::widget::Text_Viewer *cv_project=(fld::widget::Text_Viewer *)0; +Text_Viewer *cv_project=(Text_Viewer *)0; Fl_Group *cv_find_row=(Fl_Group *)0; @@ -406,7 +406,7 @@ Fl_Double_Window* make_codeview() { cv_tab->callback((Fl_Callback*)update_codeview_position_cb); { cv_source_tab = new Fl_Group(10, 35, 500, 415, "Source"); cv_source_tab->labelsize(13); - { fld::widget::Code_Viewer* o = cv_source = new fld::widget::Code_Viewer(10, 40, 500, 410); + { Code_Viewer* o = cv_source = new Code_Viewer(10, 40, 500, 410); cv_source->box(FL_DOWN_FRAME); cv_source->color(FL_BACKGROUND2_COLOR); cv_source->selection_color(FL_SELECTION_COLOR); @@ -421,14 +421,14 @@ Fl_Double_Window* make_codeview() { Fl_Group::current()->resizable(cv_source); o->linenumber_width(60); o->linenumber_size(o->Fl_Text_Display::textsize()); - } // fld::widget::Code_Viewer* cv_source + } // Code_Viewer* cv_source cv_source_tab->end(); Fl_Group::current()->resizable(cv_source_tab); } // Fl_Group* cv_source_tab { Fl_Group* o = new Fl_Group(10, 35, 500, 415, "Header"); o->labelsize(13); o->hide(); - { fld::widget::Code_Viewer* o = cv_header = new fld::widget::Code_Viewer(10, 40, 500, 410); + { Code_Viewer* o = cv_header = new Code_Viewer(10, 40, 500, 410); cv_header->box(FL_DOWN_FRAME); cv_header->color(FL_BACKGROUND2_COLOR); cv_header->selection_color(FL_SELECTION_COLOR); @@ -443,13 +443,13 @@ Fl_Double_Window* make_codeview() { Fl_Group::current()->resizable(cv_header); o->linenumber_width(60); o->linenumber_size(o->Fl_Text_Display::textsize()); - } // fld::widget::Code_Viewer* cv_header + } // Code_Viewer* cv_header o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(10, 35, 500, 415, "Strings"); o->labelsize(13); o->hide(); - { fld::widget::Text_Viewer* o = cv_strings = new fld::widget::Text_Viewer(10, 40, 500, 410); + { Text_Viewer* o = cv_strings = new Text_Viewer(10, 40, 500, 410); cv_strings->box(FL_DOWN_FRAME); cv_strings->color(FL_BACKGROUND2_COLOR); cv_strings->selection_color(FL_SELECTION_COLOR); @@ -464,13 +464,13 @@ Fl_Double_Window* make_codeview() { Fl_Group::current()->resizable(cv_strings); o->linenumber_width(60); o->linenumber_size(o->Fl_Text_Display::textsize()); - } // fld::widget::Text_Viewer* cv_strings + } // Text_Viewer* cv_strings o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(10, 35, 500, 415, "Project"); o->labelsize(13); o->hide(); - { fld::widget::Text_Viewer* o = cv_project = new fld::widget::Text_Viewer(10, 40, 500, 410); + { Text_Viewer* o = cv_project = new Text_Viewer(10, 40, 500, 410); cv_project->box(FL_DOWN_FRAME); cv_project->color(FL_BACKGROUND2_COLOR); cv_project->selection_color(FL_SELECTION_COLOR); @@ -485,7 +485,7 @@ Fl_Double_Window* make_codeview() { Fl_Group::current()->resizable(cv_project); o->linenumber_width(60); o->linenumber_size(o->Fl_Text_Display::textsize()); - } // fld::widget::Text_Viewer* cv_project + } // Text_Viewer* cv_project o->end(); } // Fl_Group* o cv_tab->end(); diff --git a/fluid/panels/codeview_panel.fl b/fluid/panels/codeview_panel.fl index 1d5a0cad6..90128afd9 100644 --- a/fluid/panels/codeview_panel.fl +++ b/fluid/panels/codeview_panel.fl @@ -48,13 +48,13 @@ decl {\#include <FL/Fl_Button.H>} {private local decl {\#include "../src/flstring.h"} {private local } -decl {char *cv_source_filename = nullptr;} {private local +decl {char *cv_source_filename = 0;} {private local } -decl {char *cv_header_filename = nullptr;} {private local +decl {char *cv_header_filename = 0;} {private local } -decl {char *cv_design_filename = nullptr;} {private local +decl {char *cv_design_filename = 0;} {private local } decl {int cv_code_choice;} {public local @@ -201,7 +201,7 @@ and load those into the Code Viewer widgets.} open return_type void } if (cv_project->visible_r()) { - fld::io::write_file(Fluid.proj, cv_design_filename, false, true); + write_file(Fluid.proj, cv_design_filename, false, true); int top = cv_project->top_line(); cv_project->buffer()->loadfile(cv_design_filename); cv_project->scroll(top, 0); @@ -211,18 +211,20 @@ and load those into the Code Viewer widgets.} open return_type void fl_strlcpy(fn, Fluid.get_tmpdir().c_str(), FL_PATH_MAX); fl_strlcat(fn, "strings", FL_PATH_MAX); fl_filename_setext(fn, FL_PATH_MAX, exts[static_cast<int>(Fluid.proj.i18n.type)]); - fld::io::write_strings(Fluid.proj, fn); + write_strings(Fluid.proj, fn); int top = cv_strings->top_line(); cv_strings->buffer()->loadfile(fn); cv_strings->scroll(top, 0); } else if (cv_source->visible_r() || cv_header->visible_r()) { - std::string code_file_name_bak = Fluid.proj.code_file_name; - Fluid.proj.code_file_name = cv_source_filename; - std::string header_file_name_bak = Fluid.proj.header_file_name; - Fluid.proj.header_file_name = cv_header_filename; + char code_file_name_bak[FL_PATH_MAX]; + fl_strlcpy(code_file_name_bak, Fluid.proj.code_file_name(), FL_PATH_MAX); + Fluid.proj.set_code_file_name(cv_source_filename); + char header_file_name_bak[FL_PATH_MAX]; + fl_strlcpy(header_file_name_bak, Fluid.proj.header_file_name(), FL_PATH_MAX); + Fluid.proj.set_header_file_name(cv_header_filename); // generate the code and load the files - fld::io::Code_Writer f(Fluid.proj); + Code_Writer f(Fluid.proj); // generate files if (f.write_code(cv_source_filename, cv_header_filename, true)) { @@ -238,8 +240,8 @@ and load those into the Code Viewer widgets.} open return_type void update_codeview_position(); } - Fluid.proj.code_file_name = code_file_name_bak; - Fluid.proj.header_file_name = header_file_name_bak; + Fluid.proj.set_code_file_name(code_file_name_bak); + Fluid.proj.set_header_file_name(header_file_name_bak); }} {selected } } @@ -313,7 +315,7 @@ Function {make_codeview()} {open code0 {\#include "widgets/Code_Viewer.h"} code1 {o->linenumber_width(60);} code2 {o->linenumber_size(o->Fl_Text_Display::textsize());} - class {fld::widget::Code_Viewer} + class {Code_Viewer} } } Fl_Group {} { @@ -325,7 +327,7 @@ Function {make_codeview()} {open code0 {\#include "widgets/Code_Viewer.h"} code1 {o->linenumber_width(60);} code2 {o->linenumber_size(o->Fl_Text_Display::textsize());} - class {fld::widget::Code_Viewer} + class {Code_Viewer} } } Fl_Group {} { @@ -337,7 +339,7 @@ Function {make_codeview()} {open code0 {\#include "widgets/Text_Viewer.h"} code1 {o->linenumber_width(60);} code2 {o->linenumber_size(o->Fl_Text_Display::textsize());} - class {fld::widget::Text_Viewer} + class {Text_Viewer} } } Fl_Group {} { @@ -349,7 +351,7 @@ Function {make_codeview()} {open code0 {\#include "widgets/Text_Viewer.h"} code1 {o->linenumber_width(60);} code2 {o->linenumber_size(o->Fl_Text_Display::textsize());} - class {fld::widget::Text_Viewer} + class {Text_Viewer} } } } @@ -362,7 +364,7 @@ Function {make_codeview()} {open } Fl_Input cv_find_text { label {Find:} - callback {Fl_Text_Display *e = nullptr; + callback {Fl_Text_Display *e = 0; if (cv_source->visible_r()) { e = cv_source; } else if (cv_header->visible_r()) { @@ -384,7 +386,7 @@ if (e) { } Fl_Button {} { label {<<} - callback {Fl_Text_Display *e = nullptr; + callback {Fl_Text_Display *e = 0; if (cv_source->visible_r()) { e = cv_source; } else if (cv_header->visible_r()) { @@ -410,7 +412,7 @@ if (e) { } Fl_Button {} { label {>>} - callback {Fl_Text_Display *e = nullptr; + callback {Fl_Text_Display *e = 0; if (cv_source->visible_r()) { e = cv_source; } else if (cv_header->visible_r()) { @@ -437,7 +439,7 @@ if (e) { Fl_Button {} { label Reveal callback {if (codeview_panel && codeview_panel->visible()) { - Node *node = nullptr; + Node *node = 0; if (cv_source->visible_r()) node = Fluid.proj.tree.find_in_text(0, cv_source->insert_position()); else if (cv_header->visible_r()) diff --git a/fluid/panels/codeview_panel.h b/fluid/panels/codeview_panel.h index ba30336df..5c482a54a 100644 --- a/fluid/panels/codeview_panel.h +++ b/fluid/panels/codeview_panel.h @@ -34,11 +34,11 @@ extern Fl_Tabs *cv_tab; #include <FL/Fl_Group.H> extern Fl_Group *cv_source_tab; #include "widgets/Code_Viewer.h" -extern fld::widget::Code_Viewer *cv_source; -extern fld::widget::Code_Viewer *cv_header; +extern Code_Viewer *cv_source; +extern Code_Viewer *cv_header; #include "widgets/Text_Viewer.h" -extern fld::widget::Text_Viewer *cv_strings; -extern fld::widget::Text_Viewer *cv_project; +extern Text_Viewer *cv_strings; +extern Text_Viewer *cv_project; extern Fl_Group *cv_find_row; #include <FL/Fl_Button.H> extern Fl_Button *cv_find_text_case; diff --git a/fluid/panels/function_panel.cxx b/fluid/panels/function_panel.cxx index a5aa35f12..3acebb603 100644 --- a/fluid/panels/function_panel.cxx +++ b/fluid/panels/function_panel.cxx @@ -78,7 +78,7 @@ Fl_Window* make_widgetbin() { o->callback((Fl_Callback*)type_make_cb, (void*)("CodeBlock")); o->image(pixmap[(int)FLD_NODE_TYPE_CodeBlock]); } // Fl_Button* o - { fld::widget::Bin_Window_Button* o = new fld::widget::Bin_Window_Button(55, 46, 24, 24); + { Bin_Window_Button* o = new Bin_Window_Button(55, 46, 24, 24); o->tooltip("Widget Class"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -91,7 +91,7 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Widget_Class]); - } // fld::widget::Bin_Window_Button* o + } // Bin_Window_Button* o { Fl_Button* o = new Fl_Button(5, 71, 24, 24); o->tooltip("Declaration"); o->box(FL_THIN_UP_BOX); @@ -114,7 +114,7 @@ Fl_Window* make_widgetbin() { } // Fl_Group* o { Fl_Group* o = new Fl_Group(87, 19, 79, 79, "Groups"); o->labelsize(12); - { fld::widget::Bin_Window_Button* o = new fld::widget::Bin_Window_Button(89, 21, 24, 24); + { Bin_Window_Button* o = new Bin_Window_Button(89, 21, 24, 24); o->tooltip("Window"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -127,8 +127,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Window]); - } // fld::widget::Bin_Window_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(114, 21, 24, 24); + } // Bin_Window_Button* o + { Bin_Button* o = new Bin_Button(114, 21, 24, 24); o->tooltip("Group"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -141,8 +141,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Group]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(139, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(139, 21, 24, 24); o->tooltip("Pack"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -155,8 +155,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Pack]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(89, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(89, 46, 24, 24); o->tooltip("Tabs"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -169,8 +169,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Tabs]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(114, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(114, 46, 24, 24); o->tooltip("Scroll"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -183,8 +183,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Scroll]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(139, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(139, 46, 24, 24); o->tooltip("Flex"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -197,8 +197,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Flex]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(89, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(89, 71, 24, 24); o->tooltip("Tile"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -211,8 +211,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Tile]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(114, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(114, 71, 24, 24); o->tooltip("Wizard"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -225,8 +225,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Wizard]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(139, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(139, 71, 24, 24); o->tooltip("Grid"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -239,12 +239,12 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Grid]); - } // fld::widget::Bin_Button* o + } // Bin_Button* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(171, 19, 54, 79, "Buttons"); o->labelsize(12); - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(173, 21, 24, 24); + { Bin_Button* o = new Bin_Button(173, 21, 24, 24); o->tooltip("Button"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -257,8 +257,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Button]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(198, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(198, 21, 24, 24); o->tooltip("Return Button"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -271,8 +271,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Return_Button]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(173, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(173, 46, 24, 24); o->tooltip("Light Button"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -285,8 +285,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Light_Button]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(198, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(198, 46, 24, 24); o->tooltip("Repeat Button"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -299,8 +299,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Repeat_Button]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(173, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(173, 71, 24, 24); o->tooltip("Check Button"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -313,8 +313,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Check_Button]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(198, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(198, 71, 24, 24); o->tooltip("Round Button"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -327,12 +327,12 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Round_Button]); - } // fld::widget::Bin_Button* o + } // Bin_Button* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(230, 19, 104, 79, "Valuators"); o->labelsize(12); - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(232, 21, 24, 24); + { Bin_Button* o = new Bin_Button(232, 21, 24, 24); o->tooltip("Slider"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -345,8 +345,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Slider]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(257, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(257, 21, 24, 24); o->tooltip("Scroll Bar"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -359,8 +359,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Scrollbar]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(282, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(282, 21, 24, 24); o->tooltip("Value Slider"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -373,8 +373,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Value_Slider]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(307, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(307, 21, 24, 24); o->tooltip("Value Output"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -387,8 +387,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Value_Output]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(232, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(232, 46, 24, 24); o->tooltip("Adjuster"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -401,8 +401,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Adjuster]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(257, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(257, 46, 24, 24); o->tooltip("Counter"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -415,8 +415,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Counter]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(282, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(282, 46, 24, 24); o->tooltip("Dial"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -429,8 +429,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Dial]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(232, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(232, 71, 24, 24); o->tooltip("Roller"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -443,8 +443,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Roller]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(257, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(257, 71, 24, 24); o->tooltip("Spinner"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -457,8 +457,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Spinner]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(282, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(282, 71, 24, 24); o->tooltip("Value Input"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -471,12 +471,12 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Value_Input]); - } // fld::widget::Bin_Button* o + } // Bin_Button* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(339, 19, 54, 79, "Text"); o->labelsize(12); - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(341, 21, 24, 24); + { Bin_Button* o = new Bin_Button(341, 21, 24, 24); o->tooltip("Input"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -489,8 +489,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Input]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(366, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(366, 21, 24, 24); o->tooltip("Output"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -503,8 +503,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Output]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(341, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(341, 46, 24, 24); o->tooltip("Text Edit"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -517,8 +517,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Text_Editor]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(366, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(366, 46, 24, 24); o->tooltip("Text Display"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -531,8 +531,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Text_Display]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(341, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(341, 71, 24, 24); o->tooltip("File Input"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -545,8 +545,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_File_Input]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(366, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(366, 71, 24, 24); o->tooltip("Terminal"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -559,12 +559,12 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Terminal]); - } // fld::widget::Bin_Button* o + } // Bin_Button* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(398, 19, 79, 79, "Menus"); o->labelsize(12); - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(400, 22, 24, 24); + { Bin_Button* o = new Bin_Button(400, 22, 24, 24); o->tooltip("Input Choice"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -577,8 +577,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Input_Choice]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(425, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(425, 21, 24, 24); o->tooltip("Menu Item"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -591,8 +591,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Menu_Item]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(450, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(450, 21, 24, 24); o->tooltip("Menu Bar"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -605,8 +605,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Menu_Bar]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(400, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(400, 46, 24, 24); o->tooltip("Menu Button"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -619,8 +619,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Menu_Button]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(425, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(425, 46, 24, 24); o->tooltip("Checkbox Menu Item"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -633,8 +633,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Checkbox_Menu_Item]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(450, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(450, 46, 24, 24); o->tooltip("Sub Menu"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -647,8 +647,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Submenu]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(400, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(400, 71, 24, 24); o->tooltip("Choice"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -661,8 +661,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Choice]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(425, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(425, 71, 24, 24); o->tooltip("Radio Menu Item"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -675,12 +675,12 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Radio_Menu_Item]); - } // fld::widget::Bin_Button* o + } // Bin_Button* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(482, 19, 54, 79, "Browsers"); o->labelsize(12); - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(484, 21, 24, 24); + { Bin_Button* o = new Bin_Button(484, 21, 24, 24); o->tooltip("Browser"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -693,8 +693,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Browser]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(509, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(509, 21, 24, 24); o->tooltip("Tree"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -707,8 +707,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Tree]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(484, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(484, 46, 24, 24); o->tooltip("Check Browser"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -721,8 +721,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Check_Browser]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(509, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(509, 46, 24, 24); o->tooltip("Help Browser"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -735,8 +735,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Help_View]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(484, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(484, 71, 24, 24); o->tooltip("File Browser"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -749,8 +749,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_File_Browser]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(509, 71, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(509, 71, 24, 24); o->tooltip("Table"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -763,12 +763,12 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Table]); - } // fld::widget::Bin_Button* o + } // Bin_Button* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(540, 19, 55, 79, "Misc"); o->labelsize(12); - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(542, 21, 24, 24); + { Bin_Button* o = new Bin_Button(542, 21, 24, 24); o->tooltip("Box"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -781,8 +781,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Box]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(567, 21, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(567, 21, 24, 24); o->tooltip("Clock"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -795,8 +795,8 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Clock]); - } // fld::widget::Bin_Button* o - { fld::widget::Bin_Button* o = new fld::widget::Bin_Button(542, 46, 24, 24); + } // Bin_Button* o + { Bin_Button* o = new Bin_Button(542, 46, 24, 24); o->tooltip("Progress"); o->box(FL_THIN_UP_BOX); o->color(FL_BACKGROUND_COLOR); @@ -809,7 +809,7 @@ Fl_Window* make_widgetbin() { o->align(Fl_Align(FL_ALIGN_CENTER)); o->when(FL_WHEN_RELEASE); o->image(pixmap[(int)FLD_NODE_TYPE_Progress]); - } // fld::widget::Bin_Button* o + } // Bin_Button* o o->end(); } // Fl_Group* o widgetbin_panel->set_non_modal(); diff --git a/fluid/panels/function_panel.fl b/fluid/panels/function_panel.fl index 6bb28907e..4e1010c77 100644 --- a/fluid/panels/function_panel.fl +++ b/fluid/panels/function_panel.fl @@ -105,7 +105,7 @@ else callback type_make_cb tooltip {Widget Class} xywh {55 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Widget_Class]);} - class {fld::widget::Bin_Window_Button} + class {Bin_Window_Button} } Fl_Button {} { user_data {"decl"} @@ -135,63 +135,63 @@ else callback type_make_cb tooltip Window xywh {89 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Window]);} - class {fld::widget::Bin_Window_Button} + class {Bin_Window_Button} } Fl_Button {} { user_data {"Fl_Group"} callback type_make_cb tooltip Group xywh {114 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Group]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Pack"} callback type_make_cb tooltip Pack xywh {139 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Pack]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Tabs"} callback type_make_cb tooltip Tabs xywh {89 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Tabs]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Scroll"} callback type_make_cb tooltip Scroll xywh {114 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Scroll]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Flex"} callback type_make_cb tooltip Flex xywh {139 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Flex]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Tile"} callback type_make_cb tooltip Tile xywh {89 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Tile]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Wizard"} callback type_make_cb tooltip Wizard xywh {114 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Wizard]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Grid"} callback type_make_cb tooltip Grid xywh {139 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Grid]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } } Fl_Group {} { @@ -203,42 +203,42 @@ else callback type_make_cb tooltip Button xywh {173 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Button]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Return_Button"} callback type_make_cb tooltip {Return Button} xywh {198 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Return_Button]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Light_Button"} callback type_make_cb tooltip {Light Button} xywh {173 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Light_Button]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Repeat_Button"} callback type_make_cb tooltip {Repeat Button} xywh {198 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Repeat_Button]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Check_Button"} callback type_make_cb tooltip {Check Button} xywh {173 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Check_Button]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Round_Button"} callback type_make_cb tooltip {Round Button} xywh {198 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Round_Button]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } } Fl_Group {} { @@ -250,70 +250,70 @@ else callback type_make_cb tooltip Slider xywh {232 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Slider]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Scrollbar"} callback type_make_cb tooltip {Scroll Bar} xywh {257 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Scrollbar]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Value_Slider"} callback type_make_cb tooltip {Value Slider} xywh {282 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Value_Slider]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Value_Output"} callback type_make_cb tooltip {Value Output} xywh {307 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Value_Output]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Adjuster"} callback type_make_cb tooltip Adjuster xywh {232 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Adjuster]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Counter"} callback type_make_cb tooltip Counter xywh {257 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Counter]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Dial"} callback type_make_cb tooltip Dial xywh {282 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Dial]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Roller"} callback type_make_cb tooltip Roller xywh {232 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Roller]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Spinner"} callback type_make_cb tooltip Spinner xywh {257 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Spinner]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Value_Input"} callback type_make_cb tooltip {Value Input} xywh {282 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Value_Input]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } } Fl_Group {} { @@ -325,42 +325,42 @@ else callback type_make_cb tooltip Input xywh {341 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Input]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Output"} callback type_make_cb tooltip Output xywh {366 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Output]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Text_Editor"} callback type_make_cb tooltip {Text Edit} xywh {341 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Text_Editor]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Text_Display"} callback type_make_cb tooltip {Text Display} xywh {366 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Text_Display]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_File_Input"} callback type_make_cb tooltip {File Input} xywh {341 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_File_Input]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Terminal"} callback type_make_cb tooltip Terminal xywh {366 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Terminal]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } } Fl_Group {} { @@ -372,56 +372,56 @@ else callback type_make_cb tooltip {Input Choice} xywh {400 22 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Input_Choice]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"menuitem"} callback type_make_cb tooltip {Menu Item} xywh {425 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Menu_Item]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Menu_Bar"} callback type_make_cb tooltip {Menu Bar} xywh {450 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Menu_Bar]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Menu_Button"} callback type_make_cb tooltip {Menu Button} xywh {400 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Menu_Button]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"checkmenuitem"} callback type_make_cb tooltip {Checkbox Menu Item} xywh {425 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Checkbox_Menu_Item]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"submenu"} callback type_make_cb tooltip {Sub Menu} xywh {450 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Submenu]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Choice"} callback type_make_cb tooltip Choice xywh {400 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Choice]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"radiomenuitem"} callback type_make_cb tooltip {Radio Menu Item} xywh {425 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Radio_Menu_Item]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } } Fl_Group {} { @@ -433,42 +433,42 @@ else callback type_make_cb tooltip Browser xywh {484 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Browser]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Tree"} callback type_make_cb tooltip Tree xywh {509 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Tree]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Check_Browser"} callback type_make_cb tooltip {Check Browser} xywh {484 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Check_Browser]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Help_View"} callback type_make_cb tooltip {Help Browser} xywh {509 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Help_View]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_File_Browser"} callback type_make_cb tooltip {File Browser} xywh {484 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_File_Browser]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Table"} callback type_make_cb tooltip Table xywh {509 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Table]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } } Fl_Group {} { @@ -480,21 +480,21 @@ else callback type_make_cb tooltip Box xywh {542 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Box]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Clock"} callback type_make_cb tooltip Clock xywh {567 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Clock]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } Fl_Button {} { user_data {"Fl_Progress"} callback type_make_cb tooltip Progress xywh {542 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)FLD_NODE_TYPE_Progress]);} - class {fld::widget::Bin_Button} + class {Bin_Button} } } } diff --git a/fluid/panels/settings_panel.cxx b/fluid/panels/settings_panel.cxx index 66df11816..1494bd357 100644 --- a/fluid/panels/settings_panel.cxx +++ b/fluid/panels/settings_panel.cxx @@ -544,7 +544,7 @@ Fl_Menu_Button *w_layout_menu=(Fl_Menu_Button *)0; static void cb_w_layout_menu(Fl_Menu_Button*, void* v) { if (v == LOAD) { - fld::app::Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; + Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; int i; if (suite.storage_ == FLD_TOOL_STORE_INTERNAL) { w_layout_menu_rename->deactivate(); @@ -572,25 +572,25 @@ static void cb_w_layout_menu_rename(Fl_Menu_*, void*) { } static void cb_w_layout_menu_storage(Fl_Menu_*, void*) { - fld::app::Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; + Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; suite.storage(FLD_TOOL_STORE_INTERNAL); Fluid.layout_list->update_dialogs(); } static void cb_w_layout_menu_storage1(Fl_Menu_*, void*) { - fld::app::Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; + Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; suite.storage(FLD_TOOL_STORE_USER); Fluid.layout_list->update_dialogs(); } static void cb_w_layout_menu_storage2(Fl_Menu_*, void*) { - fld::app::Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; + Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; suite.storage(FLD_TOOL_STORE_PROJECT); Fluid.layout_list->update_dialogs(); } static void cb_w_layout_menu_storage3(Fl_Menu_*, void*) { - fld::app::Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; + Layout_Suite &suite = (*Fluid.layout_list)[Fluid.layout_list->current_suite()]; suite.storage(FLD_TOOL_STORE_FILE); Fluid.layout_list->update_dialogs(); } @@ -1122,7 +1122,7 @@ static void cb_Store(Fl_Choice* o, void* v) { int selected = w_settings_shell_list_selected; if (v == LOAD) { if (selected) { - fld::Tool_Store ts = g_shell_config->list[selected-1]->storage; + Tool_Store ts = g_shell_config->list[selected-1]->storage; o->value(o->find_item_with_argument((long)ts)); } else { o->value(o->find_item_with_argument((long)FLD_TOOL_STORE_USER)); @@ -1130,7 +1130,7 @@ static void cb_Store(Fl_Choice* o, void* v) { } else { if (selected) { Fd_Shell_Command *cmd = g_shell_config->list[selected-1]; - fld::Tool_Store ts = (fld::Tool_Store)(o->mvalue()->argument()); + Tool_Store ts = (Tool_Store)(o->mvalue()->argument()); if (cmd->storage == FLD_TOOL_STORE_PROJECT) Fluid.proj.set_modflag(1); cmd->storage = ts; //w_settings_shell_list->text(selected, cmd->name); @@ -2447,18 +2447,18 @@ Fl_Choice *w_settings_user_commenttext=(Fl_Choice *)0; static void cb_Reset(Fl_Button* o, void* v) { if (v == LOAD) return; - fld::widget::Node_Browser::label_color = 72; - fld::widget::Node_Browser::label_font = FL_HELVETICA; - fld::widget::Node_Browser::class_color = FL_FOREGROUND_COLOR; - fld::widget::Node_Browser::class_font = FL_HELVETICA_BOLD; - fld::widget::Node_Browser::func_color = FL_FOREGROUND_COLOR; - fld::widget::Node_Browser::func_font = FL_HELVETICA; - fld::widget::Node_Browser::name_color = FL_FOREGROUND_COLOR; - fld::widget::Node_Browser::name_font = FL_HELVETICA; - fld::widget::Node_Browser::code_color = FL_FOREGROUND_COLOR; - fld::widget::Node_Browser::code_font = FL_HELVETICA; - fld::widget::Node_Browser::comment_color = FL_DARK_GREEN; - fld::widget::Node_Browser::comment_font = FL_DARK_GREEN; + Node_Browser::label_color = 72; + Node_Browser::label_font = FL_HELVETICA; + Node_Browser::class_color = FL_FOREGROUND_COLOR; + Node_Browser::class_font = FL_HELVETICA_BOLD; + Node_Browser::func_color = FL_FOREGROUND_COLOR; + Node_Browser::func_font = FL_HELVETICA; + Node_Browser::name_color = FL_FOREGROUND_COLOR; + Node_Browser::name_font = FL_HELVETICA; + Node_Browser::code_color = FL_FOREGROUND_COLOR; + Node_Browser::code_font = FL_HELVETICA; + Node_Browser::comment_color = FL_DARK_GREEN; + Node_Browser::comment_font = FL_DARK_GREEN; o->parent()->do_callback(o->parent(), LOAD); widget_browser->redraw(); widget_browser->save_prefs(); @@ -3423,17 +3423,17 @@ Fl_Double_Window* make_settings_window() { o->labelfont(1); o->labelsize(12); o->textsize(11); - o->callback((Fl_Callback*)cb_Comments, (void*)(&fld::widget::Node_Browser::label_font)); + o->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::label_font)); Fl_Group::current()->resizable(o); o->menu(fontmenu); } // Fl_Choice* o { Fl_Button* o = new Fl_Button(271, 112, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_Browser::label_color)); + o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::label_color)); } // Fl_Button* o { Fl_Menu_Button* o = new Fl_Menu_Button(322, 112, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_Browser::label_color)); + o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::label_color)); o->menu(colormenu); } // Fl_Menu_Button* o o->end(); @@ -3449,17 +3449,17 @@ Fl_Double_Window* make_settings_window() { o->labelfont(1); o->labelsize(12); o->textsize(11); - o->callback((Fl_Callback*)cb_Comments, (void*)(&fld::widget::Node_Browser::class_font)); + o->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::class_font)); Fl_Group::current()->resizable(o); o->menu(fontmenu); } // Fl_Choice* o { Fl_Button* o = new Fl_Button(271, 137, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_Browser::class_color)); + o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::class_color)); } // Fl_Button* o { Fl_Menu_Button* o = new Fl_Menu_Button(322, 137, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_Browser::class_color)); + o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::class_color)); o->menu(colormenu); } // Fl_Menu_Button* o o->end(); @@ -3475,17 +3475,17 @@ Fl_Double_Window* make_settings_window() { o->labelfont(1); o->labelsize(12); o->textsize(11); - o->callback((Fl_Callback*)cb_Comments, (void*)(&fld::widget::Node_Browser::func_font)); + o->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::func_font)); Fl_Group::current()->resizable(o); o->menu(fontmenu); } // Fl_Choice* o { Fl_Button* o = new Fl_Button(271, 162, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_Browser::func_color)); + o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::func_color)); } // Fl_Button* o { Fl_Menu_Button* o = new Fl_Menu_Button(322, 162, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_Browser::func_color)); + o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::func_color)); o->menu(colormenu); } // Fl_Menu_Button* o o->end(); @@ -3501,17 +3501,17 @@ Fl_Double_Window* make_settings_window() { o->labelfont(1); o->labelsize(12); o->textsize(11); - o->callback((Fl_Callback*)cb_Comments, (void*)(&fld::widget::Node_Browser::name_font)); + o->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::name_font)); Fl_Group::current()->resizable(o); o->menu(fontmenu); } // Fl_Choice* o { Fl_Button* o = new Fl_Button(271, 187, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_Browser::name_color)); + o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::name_color)); } // Fl_Button* o { Fl_Menu_Button* o = new Fl_Menu_Button(322, 187, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_Browser::name_color)); + o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::name_color)); o->menu(colormenu); } // Fl_Menu_Button* o o->end(); @@ -3527,17 +3527,17 @@ Fl_Double_Window* make_settings_window() { o->labelfont(1); o->labelsize(12); o->textsize(11); - o->callback((Fl_Callback*)cb_Comments, (void*)(&fld::widget::Node_Browser::code_font)); + o->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::code_font)); Fl_Group::current()->resizable(o); o->menu(fontmenu); } // Fl_Choice* o { Fl_Button* o = new Fl_Button(271, 212, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_Browser::code_color)); + o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::code_color)); } // Fl_Button* o { Fl_Menu_Button* o = new Fl_Menu_Button(322, 212, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_Browser::code_color)); + o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::code_color)); o->menu(colormenu); } // Fl_Menu_Button* o o->end(); @@ -3553,17 +3553,17 @@ Fl_Double_Window* make_settings_window() { w_settings_user_commenttext->labelfont(1); w_settings_user_commenttext->labelsize(12); w_settings_user_commenttext->textsize(11); - w_settings_user_commenttext->callback((Fl_Callback*)cb_Comments, (void*)(&fld::widget::Node_Browser::comment_font)); + w_settings_user_commenttext->callback((Fl_Callback*)cb_Comments, (void*)(&Node_Browser::comment_font)); Fl_Group::current()->resizable(w_settings_user_commenttext); o->menu(fontmenu); } // Fl_Choice* w_settings_user_commenttext { Fl_Button* o = new Fl_Button(271, 237, 51, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&fld::widget::Node_Browser::comment_color)); + o->callback((Fl_Callback*)cb_Color_Chip, (void*)(&Node_Browser::comment_color)); } // Fl_Button* o { Fl_Menu_Button* o = new Fl_Menu_Button(322, 237, 18, 20); o->labelsize(12); - o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&fld::widget::Node_Browser::comment_color)); + o->callback((Fl_Callback*)cb_Color_Choice, (void*)(&Node_Browser::comment_color)); o->menu(colormenu); } // Fl_Menu_Button* o o->end(); diff --git a/fluid/panels/settings_panel.fl b/fluid/panels/settings_panel.fl index 86513bafd..00d28e7fd 100644 --- a/fluid/panels/settings_panel.fl +++ b/fluid/panels/settings_panel.fl @@ -98,8 +98,6 @@ decl {\#include "../src/flstring.h"} {private global decl {\#include <string.h>} {private global } -decl {using namespace fld::widget;} {private global -} decl {extern struct Fl_Menu_Item *dbmanager_item;} {public local } @@ -500,10 +498,11 @@ an include guard in header file: if (v == LOAD) return; -std::string old_name = "Copy of "; -old_name.append(Fluid.layout_list[Fluid.layout_list.current_suite()].name_); -const char *new_name = fl_input("Enter a name for the new layout:", old_name.c_str()); -if (new_name == nullptr) +char old_name[256]; +snprintf(old_name, sizeof(old_name), "Copy of %s", + Fluid.layout_list[Fluid.layout_list.current_suite()].name_); +const char *new_name = fl_input("Enter a name for the new layout:", old_name); +if (new_name == 0) return; Fluid.layout_list.add(new_name); @@ -512,7 +511,7 @@ Fluid.layout_list.update_dialogs();} } Fl_Menu_Button w_layout_menu { callback {if (v == LOAD) { - fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; + Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; if (suite.storage_ == FLD_TOOL_STORE_INTERNAL) { w_layout_menu_rename->deactivate(); for (int i=1; i<4; i++) w_layout_menu_storage[i]->deactivate(); @@ -530,9 +529,9 @@ Fluid.layout_list.update_dialogs();} label {Rename...} callback {// Rename the current layout suite -std::string old_name = Fluid.layout_list[Fluid.layout_list.current_suite()].name_; -const char *new_name = fl_input("Enter a new name for the layout:", old_name.c_str()); -if (new_name == nullptr) +const char *old_name = Fluid.layout_list[Fluid.layout_list.current_suite()].name_; +const char *new_name = fl_input("Enter a new name for the layout:", old_name); +if (new_name == 0) return; Fluid.layout_list.rename(new_name); @@ -541,28 +540,28 @@ Fluid.layout_list.update_dialogs();} } MenuItem {w_layout_menu_storage[0]} { label {@fd_beaker FLUID Built-In} - callback {fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; + callback {Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; suite.storage(FLD_TOOL_STORE_INTERNAL); Fluid.layout_list.update_dialogs();} xywh {0 0 31 20} type Radio deactivate } MenuItem {w_layout_menu_storage[1]} { label {@fd_user User Preference} - callback {fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; + callback {Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; suite.storage(FLD_TOOL_STORE_USER); Fluid.layout_list.update_dialogs();} xywh {0 0 31 20} type Radio } MenuItem {w_layout_menu_storage[2]} { label {@fd_project Store in .fl Project File} - callback {fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; + callback {Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; suite.storage(FLD_TOOL_STORE_PROJECT); Fluid.layout_list.update_dialogs();} xywh {0 0 31 20} type Radio } MenuItem {w_layout_menu_storage[3]} { label {@fd_file Store in External File} - callback {fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; + callback {Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()]; suite.storage(FLD_TOOL_STORE_FILE); Fluid.layout_list.update_dialogs();} xywh {0 0 31 20} type Radio divider @@ -591,13 +590,9 @@ Fluid.layout_list.update_dialogs();} fnfc.type(Fl_Native_File_Chooser::BROWSE_SAVE_FILE); fnfc.options(Fl_Native_File_Chooser::SAVEAS_CONFIRM | Fl_Native_File_Chooser::USE_FILTER_EXT); fnfc.filter("FLUID Layouts\\t*.fll\\n"); - std::string filename = Fluid.layout_list.filename_; - fnfc.directory(fl_filename_path_str(filename).c_str()); - fnfc.preset_file(fl_filename_name_str(filename).c_str()); if (fnfc.show() != 0) return; const char *new_filename = fnfc.filename(); if (!new_filename) return; - Fluid.layout_list.filename_ = new_filename; Fluid.layout_list.save(new_filename);} xywh {0 0 31 20} divider code0 {\#include <FL/Fl_Native_File_Chooser.H>} @@ -1020,7 +1015,7 @@ if (v==LOAD) { } else { if (!selected) return; int ret = fl_choice("Delete the shell command\\n\\"%s\\"?\\n\\nThis can not be undone.", - "Delete", "Cancel", nullptr, g_shell_config->list[selected-1]->name.c_str()); + "Delete", "Cancel", 0, g_shell_config->list[selected-1]->name.c_str()); if (ret==1) return; if (g_shell_config->at(selected-1)->storage == FLD_TOOL_STORE_PROJECT) Fluid.proj.set_modflag(1); g_shell_config->remove(selected-1); @@ -1179,7 +1174,7 @@ if (v == LOAD) { callback {int selected = w_settings_shell_list_selected; if (v == LOAD) { if (selected) { - fld::Tool_Store ts = g_shell_config->list[selected-1]->storage; + Tool_Store ts = g_shell_config->list[selected-1]->storage; o->value(o->find_item_with_argument((long)ts)); } else { o->value(o->find_item_with_argument((long)FLD_TOOL_STORE_USER)); @@ -1187,7 +1182,7 @@ if (v == LOAD) { } else { if (selected) { Fd_Shell_Command *cmd = g_shell_config->list[selected-1]; - fld::Tool_Store ts = (fld::Tool_Store)(o->mvalue()->argument()); + Tool_Store ts = (Tool_Store)(o->mvalue()->argument()); if (cmd->storage == FLD_TOOL_STORE_PROJECT) Fluid.proj.set_modflag(1); cmd->storage = ts; //w_settings_shell_list->text(selected, cmd->name.c_str()); @@ -1319,7 +1314,7 @@ if (mi) { int pos = w_settings_shell_command->insert_position(); w_settings_shell_command->buffer()->insert(pos, word); } - w_settings_shell_command->do_callback(w_settings_shell_command, (void*)nullptr); + w_settings_shell_command->do_callback(w_settings_shell_command, (void*)0); }} open tooltip {a list of text replacements available for the shell script} xywh {318 373 22 22} labelsize 12 textsize 12 } { diff --git a/fluid/panels/widget_panel.cxx b/fluid/panels/widget_panel.cxx index 33720b5ac..d7e4ced55 100644 --- a/fluid/panels/widget_panel.cxx +++ b/fluid/panels/widget_panel.cxx @@ -43,7 +43,7 @@ extern void color_common(Fl_Color c); extern void color2_common(Fl_Color c); extern void textcolor_common(Fl_Color c); extern int widget_i; -extern fld::widget::Formula_Input_Vars widget_vars[]; +extern Formula_Input_Vars widget_vars[]; extern int numselected; extern Fl_Menu_Item boxmenu[]; extern int haderror; @@ -91,9 +91,9 @@ static void cb_image_panel_data(Fl_Box* o, void* v) { //fl ▲ ----------=~-=-~-~---~-----------~=--~~~-~~=--~-=--=-= ▲ fl// } -fld::widget::Formula_Input *image_panel_imagew=(fld::widget::Formula_Input *)0; +Formula_Input *image_panel_imagew=(Formula_Input *)0; -static void cb_image_panel_imagew(fld::widget::Formula_Input* o, void* v) { +static void cb_image_panel_imagew(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~~--~=---~-~=-=~~~-~~- ▼ fl// if (v == LOAD) { if (current_widget->is_widget() && !current_widget->is_a(FLD_NODE_TYPE_Window)) { @@ -124,9 +124,9 @@ static void cb_image_panel_imagew(fld::widget::Formula_Input* o, void* v) { //fl ▲ ----------~==~=~-~~=~~----------~-~-=-=~~-~=~~-~=~~-~- ▲ fl// } -fld::widget::Formula_Input *image_panel_imageh=(fld::widget::Formula_Input *)0; +Formula_Input *image_panel_imageh=(Formula_Input *)0; -static void cb_image_panel_imageh(fld::widget::Formula_Input* o, void* v) { +static void cb_image_panel_imageh(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~-~=-~~-=-=~~~--~----= ▼ fl// if (v == LOAD) { if (current_widget->is_widget() && !current_widget->is_a(FLD_NODE_TYPE_Window)) { @@ -233,9 +233,9 @@ static void cb_image_panel_dedata(Fl_Box* o, void* v) { //fl ▲ ----------~=~=-~~---=~------------~~=-~~=-=-=~=~--=--~ ▲ fl// } -fld::widget::Formula_Input *image_panel_deimagew=(fld::widget::Formula_Input *)0; +Formula_Input *image_panel_deimagew=(Formula_Input *)0; -static void cb_image_panel_deimagew(fld::widget::Formula_Input* o, void* v) { +static void cb_image_panel_deimagew(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~~--=~=~=~=~-=~--=~~=- ▼ fl// if (v == LOAD) { if (current_widget->is_widget() && !current_widget->is_a(FLD_NODE_TYPE_Window)) { @@ -266,9 +266,9 @@ static void cb_image_panel_deimagew(fld::widget::Formula_Input* o, void* v) { //fl ▲ ----------~=-~--=-=~=~----------~-~-~~--~~-=-==~~==-~= ▲ fl// } -fld::widget::Formula_Input *image_panel_deimageh=(fld::widget::Formula_Input *)0; +Formula_Input *image_panel_deimageh=(Formula_Input *)0; -static void cb_image_panel_deimageh(fld::widget::Formula_Input* o, void* v) { +static void cb_image_panel_deimageh(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~~=-=---~-~~-=-=~-~--- ▼ fl// if (v == LOAD) { if (current_widget->is_widget() && !current_widget->is_a(FLD_NODE_TYPE_Window)) { @@ -379,7 +379,7 @@ Fl_Double_Window* make_image_panel() { } // Fl_Box* image_panel_data { Fl_Group* o = new Fl_Group(75, 75, 170, 20); o->callback((Fl_Callback*)propagate_load); - { image_panel_imagew = new fld::widget::Formula_Input(75, 75, 55, 20, "Width:"); + { image_panel_imagew = new Formula_Input(75, 75, 55, 20, "Width:"); image_panel_imagew->tooltip("Scale image to this width in pixel units"); image_panel_imagew->box(FL_DOWN_BOX); image_panel_imagew->color(FL_BACKGROUND2_COLOR); @@ -392,8 +392,8 @@ Fl_Double_Window* make_image_panel() { image_panel_imagew->callback((Fl_Callback*)cb_image_panel_imagew); image_panel_imagew->align(Fl_Align(FL_ALIGN_TOP_LEFT)); image_panel_imagew->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* image_panel_imagew - { image_panel_imageh = new fld::widget::Formula_Input(135, 75, 55, 20, "Height:"); + } // Formula_Input* image_panel_imagew + { image_panel_imageh = new Formula_Input(135, 75, 55, 20, "Height:"); image_panel_imageh->tooltip("Scale image to this height in pixel units"); image_panel_imageh->box(FL_DOWN_BOX); image_panel_imageh->color(FL_BACKGROUND2_COLOR); @@ -406,7 +406,7 @@ Fl_Double_Window* make_image_panel() { image_panel_imageh->callback((Fl_Callback*)cb_image_panel_imageh); image_panel_imageh->align(Fl_Align(FL_ALIGN_TOP_LEFT)); image_panel_imageh->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* image_panel_imageh + } // Formula_Input* image_panel_imageh { Fl_Button* o = new Fl_Button(195, 75, 50, 20, "Reset"); o->tooltip("Reset scale to original size"); o->labelsize(11); @@ -455,7 +455,7 @@ Fl_Double_Window* make_image_panel() { } // Fl_Box* image_panel_dedata { Fl_Group* o = new Fl_Group(75, 215, 170, 20); o->callback((Fl_Callback*)propagate_load); - { image_panel_deimagew = new fld::widget::Formula_Input(75, 215, 55, 20, "Width:"); + { image_panel_deimagew = new Formula_Input(75, 215, 55, 20, "Width:"); image_panel_deimagew->tooltip("Scale image to this width in pixel units"); image_panel_deimagew->box(FL_DOWN_BOX); image_panel_deimagew->color(FL_BACKGROUND2_COLOR); @@ -468,8 +468,8 @@ Fl_Double_Window* make_image_panel() { image_panel_deimagew->callback((Fl_Callback*)cb_image_panel_deimagew); image_panel_deimagew->align(Fl_Align(FL_ALIGN_TOP_LEFT)); image_panel_deimagew->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* image_panel_deimagew - { image_panel_deimageh = new fld::widget::Formula_Input(135, 215, 55, 20, "Height:"); + } // Formula_Input* image_panel_deimagew + { image_panel_deimageh = new Formula_Input(135, 215, 55, 20, "Height:"); image_panel_deimageh->tooltip("Scale image to this height in pixel units"); image_panel_deimageh->box(FL_DOWN_BOX); image_panel_deimageh->color(FL_BACKGROUND2_COLOR); @@ -482,7 +482,7 @@ Fl_Double_Window* make_image_panel() { image_panel_deimageh->callback((Fl_Callback*)cb_image_panel_deimageh); image_panel_deimageh->align(Fl_Align(FL_ALIGN_TOP_LEFT)); image_panel_deimageh->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* image_panel_deimageh + } // Formula_Input* image_panel_deimageh { Fl_Button* o = new Fl_Button(195, 215, 50, 20, "Reset"); o->tooltip("Reset scale to original size"); o->labelsize(11); @@ -719,9 +719,9 @@ Fl_Menu_Item menu_1[] = { {0,0,0,0,0,0,0,0,0} }; -fld::widget::Formula_Input *widget_x_input=(fld::widget::Formula_Input *)0; +Formula_Input *widget_x_input=(Formula_Input *)0; -static void cb_widget_x_input(fld::widget::Formula_Input* o, void* v) { +static void cb_widget_x_input(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~~=-~~~~~~=-~-~~----~- ▼ fl// if (v == LOAD) { if (current_widget->is_true_widget()) { @@ -753,9 +753,9 @@ static void cb_widget_x_input(fld::widget::Formula_Input* o, void* v) { //fl ▲ ----------=~=~--~~-=-~----------~~=~=--~~~-=~=~-=~~==- ▲ fl// } -fld::widget::Formula_Input *widget_y_input=(fld::widget::Formula_Input *)0; +Formula_Input *widget_y_input=(Formula_Input *)0; -static void cb_widget_y_input(fld::widget::Formula_Input* o, void* v) { +static void cb_widget_y_input(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~~--~=--~-~=-~=~~~=~~= ▼ fl// if (v == LOAD) { if (current_widget->is_true_widget()) { @@ -786,9 +786,9 @@ static void cb_widget_y_input(fld::widget::Formula_Input* o, void* v) { //fl ▲ ----------~==--=~=--=-----------~~=~--~~=~-~---=~-=-~= ▲ fl// } -fld::widget::Formula_Input *widget_w_input=(fld::widget::Formula_Input *)0; +Formula_Input *widget_w_input=(Formula_Input *)0; -static void cb_widget_w_input(fld::widget::Formula_Input* o, void* v) { +static void cb_widget_w_input(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ---=~~--~==-=-~-=-~-=~ ▼ fl// if (v == LOAD) { if (current_widget->is_true_widget()) { @@ -819,9 +819,9 @@ static void cb_widget_w_input(fld::widget::Formula_Input* o, void* v) { //fl ▲ ----------~=~-=~~--~------------~--~-==-~~~~~==-=--=-= ▲ fl// } -fld::widget::Formula_Input *widget_h_input=(fld::widget::Formula_Input *)0; +Formula_Input *widget_h_input=(Formula_Input *)0; -static void cb_widget_h_input(fld::widget::Formula_Input* o, void* v) { +static void cb_widget_h_input(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback -~-=-==~--~=-~--=----- ▼ fl// if (v == LOAD) { if (current_widget->is_true_widget()) { @@ -2342,9 +2342,9 @@ static void cb_wComment(Fl_Text_Editor* o, void* v) { //fl ▲ ----------=~---~~-=--~----------~~-~--=~~~-~~==~~=~~~- ▲ fl// } -fld::widget::Code_Editor *wCallback=(fld::widget::Code_Editor *)0; +Code_Editor *wCallback=(Code_Editor *)0; -static void cb_wCallback(fld::widget::Code_Editor* o, void* v) { +static void cb_wCallback(Code_Editor* o, void* v) { //fl ▼ ---------------------- callback ~--~-~-~~-=~~-~=~=-~~= ▼ fl// if (v == LOAD) { const char *cbtext = current_widget->callback(); @@ -2563,9 +2563,6 @@ Fl_Menu_Item menu_7[] = { {"binary: unsigned char[]", 0, 0, (void*)(0), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, {"text: const char*", 0, 0, (void*)(1), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, {"compressed: unsigned char[]", 0, 0, (void*)(2), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, - {"binary: std::vector<uint8_t>", 0, 0, (void*)(3), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, - {"text: std::string", 0, 0, (void*)(4), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, - {"compressed: std::vector<uint8_t>", 0, 0, (void*)(5), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, {0,0,0,0,0,0,0,0,0} }; @@ -3202,7 +3199,7 @@ static void cb_1b(Fl_Tile* o, void* v) { //fl ▲ ----------=~-=~--~~=~=-----------~~----=--~=~~-~-----= ▲ fl// } -static void cb_Declaration(fld::widget::Code_Editor* o, void* v) { +static void cb_Declaration(Code_Editor* o, void* v) { //fl ▼ ---------------------- callback ---==--~~-=-=-~=----=- ▼ fl// if (!current_node || !current_node->is_a(FLD_NODE_TYPE_Decl)) return; Decl_Node* nd = (Decl_Node*)current_node; @@ -3331,7 +3328,7 @@ static void cb_code_tabs(Fl_Tabs* o, void* v) { Fl_Group *code_tabs_main=(Fl_Group *)0; -static void cb_1c(fld::widget::Code_Editor* o, void* v) { +static void cb_1c(Code_Editor* o, void* v) { //fl ▼ ---------------------- callback ~-=--~=~~==~=~=~-~--=~ ▼ fl// if (!current_node || !current_node->is_a(FLD_NODE_TYPE_Code)) return; Code_Node* nd = (Code_Node*)current_node; @@ -3454,7 +3451,7 @@ static void cb_1f(Fl_Tile* o, void* v) { //fl ▲ ----------=~~=~~-~---~-----------~~----=--~=~~-~-----= ▲ fl// } -static void cb_Function(fld::widget::Code_Editor* o, void* v) { +static void cb_Function(Code_Editor* o, void* v) { //fl ▼ ---------------------- callback --=~=----~=~~-=~-==--~ ▼ fl// if (!current_node || !current_node->is_a(FLD_NODE_TYPE_Function)) return; Function_Node* nd = (Function_Node*)current_node; @@ -3478,7 +3475,7 @@ static void cb_Function(fld::widget::Code_Editor* o, void* v) { //fl ▲ ----------=~=~=-=--~=~-----------~=-=~~~~~-=~~~=-=-~-- ▲ fl// } -static void cb_Return(fld::widget::Code_Editor* o, void* v) { +static void cb_Return(Code_Editor* o, void* v) { //fl ▼ ---------------------- callback -~=--~-~=~=~~~---=~~=~ ▼ fl// if (!current_node || !current_node->is_a(FLD_NODE_TYPE_Function)) return; Function_Node* nd = (Function_Node*)current_node; @@ -3708,7 +3705,7 @@ Fl_Double_Window* make_widget_panel() { o->labelsize(11); o->callback((Fl_Callback*)position_group_cb); o->align(Fl_Align(FL_ALIGN_LEFT)); - { widget_x_input = new fld::widget::Formula_Input(95, 150, 55, 20, "X:"); + { widget_x_input = new Formula_Input(95, 150, 55, 20, "X:"); widget_x_input->tooltip("The X position of the widget as a number or formula.\nFormulas can be simple " "math, including the variables\nx, px, sx, cx, and i"); widget_x_input->box(FL_DOWN_BOX); @@ -3722,8 +3719,8 @@ Fl_Double_Window* make_widget_panel() { widget_x_input->callback((Fl_Callback*)cb_widget_x_input); widget_x_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_x_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_x_input - { widget_y_input = new fld::widget::Formula_Input(155, 150, 55, 20, "Y:"); + } // Formula_Input* widget_x_input + { widget_y_input = new Formula_Input(155, 150, 55, 20, "Y:"); widget_y_input->tooltip("The Y position of the widget as a number or formula.\nFormulas can be simple " "math, including the variables\ny, py, sy, cy, and i"); widget_y_input->box(FL_DOWN_BOX); @@ -3737,8 +3734,8 @@ Fl_Double_Window* make_widget_panel() { widget_y_input->callback((Fl_Callback*)cb_widget_y_input); widget_y_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_y_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_y_input - { widget_w_input = new fld::widget::Formula_Input(215, 150, 55, 20, "Width:"); + } // Formula_Input* widget_y_input + { widget_w_input = new Formula_Input(215, 150, 55, 20, "Width:"); widget_w_input->tooltip("The width of the widget as a number or formula.\nFormulas can be simple math," " including the variables\nw, pw, sw, cw, and i"); widget_w_input->box(FL_DOWN_BOX); @@ -3752,8 +3749,8 @@ Fl_Double_Window* make_widget_panel() { widget_w_input->callback((Fl_Callback*)cb_widget_w_input); widget_w_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_w_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_w_input - { widget_h_input = new fld::widget::Formula_Input(275, 150, 55, 20, "Height:"); + } // Formula_Input* widget_w_input + { widget_h_input = new Formula_Input(275, 150, 55, 20, "Height:"); widget_h_input->tooltip("The height of the widget as a number or formula.\nFormulas can be simple math" ", including the variables\nh, ph, sh, ch, and i"); widget_h_input->box(FL_DOWN_BOX); @@ -3767,7 +3764,7 @@ Fl_Double_Window* make_widget_panel() { widget_h_input->callback((Fl_Callback*)cb_widget_h_input); widget_h_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_h_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_h_input + } // Formula_Input* widget_h_input { Fl_Choice* o = new Fl_Choice(335, 150, 64, 20, "Children:"); o->tooltip("When instantiating a widget class, the children can either be fixed in their " "original position, automatically be repositioned, or both repsositioned and re" @@ -4371,7 +4368,7 @@ Fl_Double_Window* make_widget_panel() { } // Fl_Group* o { Fl_Group* o = new Fl_Group(95, 223, 310, 82); o->box(FL_FLAT_BOX); - { wCallback = new fld::widget::Code_Editor(95, 225, 310, 80, "Callback:"); + { wCallback = new Code_Editor(95, 225, 310, 80, "Callback:"); wCallback->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."); wCallback->box(FL_DOWN_BOX); @@ -4387,7 +4384,7 @@ Fl_Double_Window* make_widget_panel() { wCallback->align(Fl_Align(FL_ALIGN_LEFT)); wCallback->when(FL_WHEN_RELEASE); Fl_Group::current()->resizable(wCallback); - } // fld::widget::Code_Editor* wCallback + } // Code_Editor* wCallback o->end(); } // Fl_Group* o o->end(); @@ -4825,7 +4822,7 @@ Fl_Double_Window* make_widget_panel() { o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { fld::widget::Code_Editor* o = new fld::widget::Code_Editor(95, 75, 310, 100, "Declaration:"); + { Code_Editor* o = new Code_Editor(95, 75, 310, 100, "Declaration:"); o->tooltip("a declaration: `int x;`, an external symbol: `extern int foo();`,\na `#` dire" "ctive: `#include <foo.h>`, a typedef `typedef char byte;`,\n or a `using` stat" "ement, etc."); @@ -4842,7 +4839,7 @@ Fl_Double_Window* make_widget_panel() { o->when(FL_WHEN_RELEASE); Fl_Group::current()->resizable(o); o->add_key_binding(FL_Tab, 0, use_tab_navigation); - } // fld::widget::Code_Editor* o + } // Code_Editor* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(15, 180, 390, 105); @@ -4924,7 +4921,7 @@ Fl_Double_Window* make_widget_panel() { { code_tabs_main = new Fl_Group(10, 30, 400, 330, "Code"); code_tabs_main->labelsize(11); code_tabs_main->callback((Fl_Callback*)propagate_load); - { fld::widget::Code_Editor* o = new fld::widget::Code_Editor(15, 40, 390, 315); + { Code_Editor* o = new Code_Editor(15, 40, 390, 315); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -4940,7 +4937,7 @@ Fl_Double_Window* make_widget_panel() { Fl_Group::current()->resizable(o); o->linenumber_width(60); o->linenumber_size(o->Fl_Text_Display::textsize()); - } // fld::widget::Code_Editor* o + } // Code_Editor* o code_tabs_main->end(); Fl_Group::current()->resizable(code_tabs_main); } // Fl_Group* code_tabs_main @@ -4998,7 +4995,7 @@ o->linenumber_size(o->Fl_Text_Display::textsize()); o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { fld::widget::Code_Editor* o = new fld::widget::Code_Editor(95, 100, 310, 50, "Function\nName and\nArgs:"); + { Code_Editor* o = new Code_Editor(95, 100, 310, 50, "Function\nName and\nArgs:"); o->tooltip("function name and args, or blank for `main(..)`"); o->box(FL_DOWN_FRAME); o->color(FL_BACKGROUND2_COLOR); @@ -5013,7 +5010,7 @@ o->linenumber_size(o->Fl_Text_Display::textsize()); o->when(FL_WHEN_RELEASE); Fl_Group::current()->resizable(o); o->add_key_binding(FL_Tab, 0, use_tab_navigation); - } // fld::widget::Code_Editor* o + } // Code_Editor* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(15, 155, 390, 60); @@ -5022,7 +5019,7 @@ o->linenumber_size(o->Fl_Text_Display::textsize()); o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { fld::widget::Code_Editor* o = new fld::widget::Code_Editor(95, 160, 310, 50, "Return Type:"); + { Code_Editor* o = new Code_Editor(95, 160, 310, 50, "Return Type:"); o->tooltip("return type, or blank to return outermost widget"); o->box(FL_DOWN_FRAME); o->color(FL_BACKGROUND2_COLOR); @@ -5037,7 +5034,7 @@ o->linenumber_size(o->Fl_Text_Display::textsize()); o->when(FL_WHEN_RELEASE); Fl_Group::current()->resizable(o); o->add_key_binding(FL_Tab, 0, use_tab_navigation); - } // fld::widget::Code_Editor* o + } // Code_Editor* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(15, 215, 390, 105); diff --git a/fluid/panels/widget_panel.fl b/fluid/panels/widget_panel.fl index 0fb788ff2..a98916654 100644 --- a/fluid/panels/widget_panel.fl +++ b/fluid/panels/widget_panel.fl @@ -84,7 +84,7 @@ decl {\#include <ctype.h>} {uid 43de private global decl {\#include <stdlib.h> // free()} {uid 053c private global } -decl {\#include <functional> // std::function} {uid 29a1 private global +decl {\#include <string.h>} {uid 29a1 private global } decl {\#define ZERO_ENTRY 1000} {uid e18b private global @@ -99,7 +99,7 @@ extern void color_common(Fl_Color c); extern void color2_common(Fl_Color c); extern void textcolor_common(Fl_Color c); extern int widget_i; -extern fld::widget::Formula_Input_Vars widget_vars[];} {uid 81c9 private global +extern Formula_Input_Vars widget_vars[];} {uid 81c9 private global } decl {extern int numselected; @@ -116,32 +116,34 @@ Function {use_tab_navigation(int, Fl_Text_Editor*)} {uid 42b9 } } -Function {update_current(Fl_Input* o, void *v, - std::function<std::string()> getter, - std::function<void(std::string)> setter)} {uid a6e0 open private return_type void +Function {update_current_input(Fl_Input* o, void *v, + const char *cur_val, void (*setter_fn)(void*, const char*), void *nd)} {uid a6e0 open private return_type void } { code {if (v == LOAD) { - o->value( getter().c_str() ); + o->value(cur_val ? cur_val : ""); } else { - std::string v = o->value(); - if (v != getter()) { - setter(v); + const char *nv = o->value(); + if (!cur_val) cur_val = ""; + if (!nv) nv = ""; + if (strcmp(nv, cur_val) != 0) { + setter_fn(nd, nv); Fluid.proj.set_modflag(1); } }} {uid e438 } } -Function {update_current(Fl_Text_Editor* o, void *v, - std::function<std::string()> getter, - std::function<void(std::string)> setter)} {uid 7c05 open private return_type void +Function {update_current_editor(Fl_Text_Editor* o, void *v, + const char *cur_val, void (*setter_fn)(void*, const char*), void *nd)} {uid 7c05 open private return_type void } { code {if (v == LOAD) { - o->buffer()->text( getter().c_str() ); + o->buffer()->text(cur_val ? cur_val : ""); } else { - std::string v = o->buffer()->text(); - if (v != getter()) { - setter(v); + const char *nv = o->buffer()->text(); + if (!cur_val) cur_val = ""; + if (!nv) nv = ""; + if (strcmp(nv, cur_val) != 0) { + setter_fn(nd, nv); Fluid.proj.set_modflag(1); } }} {uid c364 @@ -217,7 +219,7 @@ Function {make_image_panel()} {uid b832 if (mod) Fluid.proj.set_modflag(1); }} tooltip {Scale image to this width in pixel units} xywh {75 75 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input image_panel_imageh {uid e676 label {Height:} @@ -247,7 +249,7 @@ Function {make_image_panel()} {uid b832 if (mod) Fluid.proj.set_modflag(1); }} tooltip {Scale image to this height in pixel units} xywh {135 75 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Button {} {uid 4df5 label Reset @@ -367,7 +369,7 @@ Function {make_image_panel()} {uid b832 if (mod) Fluid.proj.set_modflag(1); }} tooltip {Scale image to this width in pixel units} xywh {75 215 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input image_panel_deimageh {uid c6c4 label {Height:} @@ -397,7 +399,7 @@ Function {make_image_panel()} {uid b832 if (mod) Fluid.proj.set_modflag(1); }} tooltip {Scale image to this height in pixel units} xywh {135 215 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Button {} {uid a381 label Reset @@ -850,7 +852,7 @@ Use Ctrl-J for newlines.} xywh {95 40 190 20} labelfont 1 labelsize 11 when 15 t tooltip {The X position of the widget as a number or formula. Formulas can be simple math, including the variables x, px, sx, cx, and i} xywh {95 150 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input widget_y_input {uid 5985 label {Y:} @@ -883,7 +885,7 @@ x, px, sx, cx, and i} xywh {95 150 55 20} labelsize 11 align 5 textsize 11 tooltip {The Y position of the widget as a number or formula. Formulas can be simple math, including the variables y, py, sy, cy, and i} xywh {155 150 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input widget_w_input {uid 2e88 label {Width:} @@ -916,7 +918,7 @@ y, py, sy, cy, and i} xywh {155 150 55 20} labelsize 11 align 5 textsize 11 tooltip {The width of the widget as a number or formula. Formulas can be simple math, including the variables w, pw, sw, cw, and i} xywh {215 150 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input widget_h_input {uid 2382 label {Height:} @@ -949,7 +951,7 @@ w, pw, sw, cw, and i} xywh {215 150 55 20} labelsize 11 align 5 textsize 11 tooltip {The height of the widget as a number or formula. Formulas can be simple math, including the variables h, ph, sh, ch, and i} xywh {275 150 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Choice {} {uid 4f6a label {Children:} @@ -2495,7 +2497,7 @@ wCallback->do_callback(wCallback, v);} open }} 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 225 310 80} box DOWN_BOX labelfont 1 labelsize 11 align 4 textfont 4 textsize 11 resizable code0 {\#include "widgets/Code_Editor.h"} - class {fld::widget::Code_Editor} + class {Code_Editor} } } } @@ -2737,21 +2739,6 @@ if (v == LOAD) { user_data 2 user_data_type long xywh {10 10 100 20} labelsize 11 } - MenuItem {} {uid a638 - label {binary: std::vector<uint8_t>} - user_data 3 user_data_type long - xywh {10 10 100 20} labelsize 11 - } - MenuItem {} {uid c0e7 - label {text: std::string} - user_data 4 user_data_type long - xywh {10 10 100 20} labelsize 11 - } - MenuItem {} {uid 8d7a - label {compressed: std::vector<uint8_t>} - user_data 5 user_data_type long - xywh {10 10 100 20} labelsize 11 - } } Fl_Box {} {uid 4a0a xywh {363 75 42 20} resizable @@ -2781,10 +2768,18 @@ if (v == LOAD) { label {Filename:} callback {if (!current_node || !current_node->is_a(FLD_NODE_TYPE_Data)) return; Data_Node* nd = (Data_Node*)current_node; -update_current(o, v, - [nd](){return nd->filename();}, - [nd](std::string s){nd->filename(s);} -);} +if (v == LOAD) { + o->value(nd->filename() ? nd->filename() : ""); +} else { + const char *nv = o->value(); + const char *cur = nd->filename(); + if (!cur) cur = ""; + if (!nv) nv = ""; + if (strcmp(nv, cur) != 0) { + nd->filename(nv); + Fluid.proj.set_modflag(1); + } +}} tooltip {name and path of file that will be inlined} xywh {95 125 270 20} labelfont 1 labelsize 11 align 132 textfont 4 textsize 11 resizable } Fl_Button {} {uid a0fe @@ -3196,10 +3191,18 @@ if (v == LOAD) { label {End Code:} callback {if (!current_node || !current_node->is_a(FLD_NODE_TYPE_DeclBlock)) return; DeclBlock_Node* nd = (DeclBlock_Node*)current_node; -update_current(o, v, - [nd](){return nd->end_code();}, - [nd](std::string s){nd->end_code(s);} -);} +if (v == LOAD) { + o->value(nd->end_code() ? nd->end_code() : ""); +} else { + const char *nv = o->value(); + const char *cur = nd->end_code(); + if (!cur) cur = ""; + if (!nv) nv = ""; + if (strcmp(nv, cur) != 0) { + nd->end_code(nv); + Fluid.proj.set_modflag(1); + } +}} tooltip {`\#endif` or similar declaration code block} xywh {95 75 305 20} labelfont 1 labelsize 11 textfont 4 textsize 11 } Fl_Group {} {uid 9b63 @@ -3456,7 +3459,7 @@ a `\#` directive: `\#include <foo.h>`, a typedef `typedef char byte;`, or a `using` statement, etc.} xywh {95 75 310 100} labelfont 1 labelsize 11 align 132 textsize 11 resizable code0 {\#include "widgets/Code_Editor.h"} code1 {o->add_key_binding(FL_Tab, 0, use_tab_navigation);} - class {fld::widget::Code_Editor} + class {Code_Editor} } } Fl_Group {} {uid 160e @@ -3525,10 +3528,18 @@ if (v == LOAD) { label {End Code:} callback {if (!current_node || !current_node->is_a(FLD_NODE_TYPE_CodeBlock)) return; CodeBlock_Node* nd = (CodeBlock_Node*)current_node; -update_current(o, v, - [nd](){return nd->end_code();}, - [nd](std::string s){nd->end_code(s);} -);} +if (v == LOAD) { + o->value(nd->end_code() ? nd->end_code() : ""); +} else { + const char *nv = o->value(); + const char *cur = nd->end_code(); + if (!cur) cur = ""; + if (!nv) nv = ""; + if (strcmp(nv, cur) != 0) { + nd->end_code(nv); + Fluid.proj.set_modflag(1); + } +}} tooltip {condition end: `while (x==1);`, or empty} xywh {95 75 305 20} labelfont 1 labelsize 11 textfont 4 textsize 11 } Fl_Text_Editor {} {uid 13f0 @@ -3595,7 +3606,7 @@ Code_Node* nd = (Code_Node*)current_node; code1 {\#include "widgets/Code_Editor.h"} code2 {o->linenumber_width(60); o->linenumber_size(o->Fl_Text_Display::textsize());} - class {fld::widget::Code_Editor} + class {Code_Editor} } } } @@ -3743,7 +3754,7 @@ if (v == LOAD) { tooltip {function name and args, or blank for `main(..)`} xywh {95 100 310 50} labelfont 1 labelsize 11 align 132 textsize 11 resizable code0 {\#include "widgets/Code_Editor.h"} code1 {o->add_key_binding(FL_Tab, 0, use_tab_navigation);} - class {fld::widget::Code_Editor} + class {Code_Editor} } } Fl_Group {} {uid 3cb7 @@ -3754,14 +3765,22 @@ if (v == LOAD) { label {Return Type:} callback {if (!current_node || !current_node->is_a(FLD_NODE_TYPE_Function)) return; Function_Node* nd = (Function_Node*)current_node; -update_current(o, v, - [nd](){return nd->return_type();}, - [nd](std::string s){nd->return_type(s);} -);} +if (v == LOAD) { + o->buffer()->text(nd->return_type() ? nd->return_type() : ""); +} else { + const char *nv = o->buffer()->text(); + const char *cur = nd->return_type(); + if (!cur) cur = ""; + if (!nv) nv = ""; + if (strcmp(nv, cur) != 0) { + nd->return_type(nv); + Fluid.proj.set_modflag(1); + } +}} tooltip {return type, or blank to return outermost widget} xywh {95 160 310 50} labelfont 1 labelsize 11 align 132 textsize 11 resizable code0 {\#include "widgets/Code_Editor.h"} code1 {o->add_key_binding(FL_Tab, 0, use_tab_navigation);} - class {fld::widget::Code_Editor} + class {Code_Editor} } } Fl_Group {} {uid 01de diff --git a/fluid/panels/widget_panel.h b/fluid/panels/widget_panel.h index 98d1066b7..48462350d 100644 --- a/fluid/panels/widget_panel.h +++ b/fluid/panels/widget_panel.h @@ -31,14 +31,14 @@ extern Fl_Group *image_panel_imagegroup; #include <FL/Fl_Box.H> #include <FL/Fl_Shared_Image.H> extern Fl_Box *image_panel_data; -extern fld::widget::Formula_Input *image_panel_imagew; -extern fld::widget::Formula_Input *image_panel_imageh; +extern Formula_Input *image_panel_imagew; +extern Formula_Input *image_panel_imageh; #include <FL/Fl_Button.H> #include <FL/Fl_Check_Button.H> extern Fl_Group *image_panel_deimagegroup; extern Fl_Box *image_panel_dedata; -extern fld::widget::Formula_Input *image_panel_deimagew; -extern fld::widget::Formula_Input *image_panel_deimageh; +extern Formula_Input *image_panel_deimagew; +extern Formula_Input *image_panel_deimageh; extern Fl_Button *image_panel_close; Fl_Double_Window* make_image_panel(); void run_image_panel(); @@ -61,10 +61,10 @@ extern void align_cb(Fl_Button*, void*); extern void align_text_image_cb(Fl_Choice*, void*); extern void align_position_cb(Fl_Choice*, void*); extern void position_group_cb(Fl_Group*, void*); -extern fld::widget::Formula_Input *widget_x_input; -extern fld::widget::Formula_Input *widget_y_input; -extern fld::widget::Formula_Input *widget_w_input; -extern fld::widget::Formula_Input *widget_h_input; +extern Formula_Input *widget_x_input; +extern Formula_Input *widget_y_input; +extern Formula_Input *widget_w_input; +extern Formula_Input *widget_h_input; extern Fl_Group *wp_gui_flexp; #include <FL/Fl_Value_Input.H> extern Fl_Value_Input *widget_flex_size; @@ -100,7 +100,7 @@ extern Fl_Input *v_input[4]; #include <FL/Fl_Text_Editor.H> extern Fl_Text_Editor *wComment; #include "widgets/Code_Editor.h" -extern fld::widget::Code_Editor *wCallback; +extern Code_Editor *wCallback; extern Fl_Group *wp_cpp_callback; extern Fl_Menu_Item whenmenu[]; #include <FL/Fl_Input_Choice.H> diff --git a/fluid/panels/widget_panel/Grid_Child_Tab.cxx b/fluid/panels/widget_panel/Grid_Child_Tab.cxx index 674b17bd7..a1d72b9f6 100644 --- a/fluid/panels/widget_panel/Grid_Child_Tab.cxx +++ b/fluid/panels/widget_panel/Grid_Child_Tab.cxx @@ -6,11 +6,11 @@ #include "nodes/Grid_Node.h" extern Grid_Child_Tab *widget_tab_grid_child; -void Grid_Child_Tab::cb_widget_grid_row_input_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_widget_grid_row_input_i(Formula_Input* o, void* v) { grid_child_cb(o, v, 8); if (v!=LOAD) widget_tab_grid_child->do_callback(widget_tab_grid_child, LOAD); } -void Grid_Child_Tab::cb_widget_grid_row_input(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_widget_grid_row_input(Formula_Input* o, void* v) { ((Grid_Child_Tab*)(o->parent()->parent()))->cb_widget_grid_row_input_i(o,v); } @@ -34,11 +34,11 @@ void Grid_Child_Tab::cb_1(Fl_Button* o, void* v) { ((Grid_Child_Tab*)(o->parent()->parent()->parent()))->cb_1_i(o,v); } -void Grid_Child_Tab::cb_widget_grid_col_input_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_widget_grid_col_input_i(Formula_Input* o, void* v) { grid_child_cb(o, v, 9); if (v!=LOAD) widget_tab_grid_child->do_callback(widget_tab_grid_child, LOAD); } -void Grid_Child_Tab::cb_widget_grid_col_input(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_widget_grid_col_input(Formula_Input* o, void* v) { ((Grid_Child_Tab*)(o->parent()->parent()))->cb_widget_grid_col_input_i(o,v); } @@ -174,25 +174,25 @@ Fl_Menu_Item Grid_Child_Tab::menu_Vertical[] = { {0,0,0,0,0,0,0,0,0} }; -void Grid_Child_Tab::cb_Width_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_Width_i(Formula_Input* o, void* v) { grid_child_cb(o, v, 12); } -void Grid_Child_Tab::cb_Width(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_Width(Formula_Input* o, void* v) { ((Grid_Child_Tab*)(o->parent()->parent()))->cb_Width_i(o,v); } -void Grid_Child_Tab::cb_Height_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_Height_i(Formula_Input* o, void* v) { grid_child_cb(o, v, 13); } -void Grid_Child_Tab::cb_Height(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_Height(Formula_Input* o, void* v) { ((Grid_Child_Tab*)(o->parent()->parent()))->cb_Height_i(o,v); } -void Grid_Child_Tab::cb_widget_grid_rowspan_input_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_widget_grid_rowspan_input_i(Formula_Input* o, void* v) { grid_child_cb(o, v, 10); if (v!=LOAD) widget_tab_grid_child->do_callback(widget_tab_grid_child, LOAD); } -void Grid_Child_Tab::cb_widget_grid_rowspan_input(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_widget_grid_rowspan_input(Formula_Input* o, void* v) { ((Grid_Child_Tab*)(o->parent()->parent()))->cb_widget_grid_rowspan_input_i(o,v); } @@ -216,11 +216,11 @@ void Grid_Child_Tab::cb_5(Fl_Button* o, void* v) { ((Grid_Child_Tab*)(o->parent()->parent()->parent()))->cb_5_i(o,v); } -void Grid_Child_Tab::cb_widget_grid_colspan_input_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_widget_grid_colspan_input_i(Formula_Input* o, void* v) { grid_child_cb(o, v, 11); if (v!=LOAD) widget_tab_grid_child->do_callback(widget_tab_grid_child, LOAD); } -void Grid_Child_Tab::cb_widget_grid_colspan_input(fld::widget::Formula_Input* o, void* v) { +void Grid_Child_Tab::cb_widget_grid_colspan_input(Formula_Input* o, void* v) { ((Grid_Child_Tab*)(o->parent()->parent()))->cb_widget_grid_colspan_input_i(o,v); } @@ -255,7 +255,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { widget_grid_row_input = new fld::widget::Formula_Input(85, 30, 40, 20, "Row:"); + { widget_grid_row_input = new Formula_Input(85, 30, 40, 20, "Row:"); widget_grid_row_input->box(FL_DOWN_BOX); widget_grid_row_input->color(FL_BACKGROUND2_COLOR); widget_grid_row_input->selection_color(FL_SELECTION_COLOR); @@ -267,7 +267,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : widget_grid_row_input->callback((Fl_Callback*)cb_widget_grid_row_input); widget_grid_row_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_grid_row_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_grid_row_input + } // Formula_Input* widget_grid_row_input { Fl_Group* o = new Fl_Group(125, 30, 30, 20); { Fl_Button* o = new Fl_Button(125, 30, 15, 20, "-"); o->compact(1); @@ -283,7 +283,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : } // Fl_Button* o o->end(); } // Fl_Group* o - { widget_grid_col_input = new fld::widget::Formula_Input(165, 30, 40, 20, "Column:"); + { widget_grid_col_input = new Formula_Input(165, 30, 40, 20, "Column:"); widget_grid_col_input->box(FL_DOWN_BOX); widget_grid_col_input->color(FL_BACKGROUND2_COLOR); widget_grid_col_input->selection_color(FL_SELECTION_COLOR); @@ -295,7 +295,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : widget_grid_col_input->callback((Fl_Callback*)cb_widget_grid_col_input); widget_grid_col_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_grid_col_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_grid_col_input + } // Formula_Input* widget_grid_col_input { Fl_Group* o = new Fl_Group(205, 30, 30, 20); { Fl_Button* o = new Fl_Button(205, 30, 15, 20, "-"); o->compact(1); @@ -359,7 +359,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : wp_gridc_size->labelsize(11); wp_gridc_size->callback((Fl_Callback*)propagate_load); wp_gridc_size->align(Fl_Align(FL_ALIGN_LEFT)); - { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(85, 105, 55, 20, "Width:"); + { Formula_Input* o = new Formula_Input(85, 105, 55, 20, "Width:"); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -371,8 +371,8 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : o->callback((Fl_Callback*)cb_Width); o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); o->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* o - { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(145, 105, 55, 20, "Height:"); + } // Formula_Input* o + { Formula_Input* o = new Formula_Input(145, 105, 55, 20, "Height:"); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -384,7 +384,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : o->callback((Fl_Callback*)cb_Height); o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); o->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* o + } // Formula_Input* o { Fl_Box* o = new Fl_Box(385, 105, 1, 20); o->hide(); Fl_Group::current()->resizable(o); @@ -396,7 +396,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { widget_grid_rowspan_input = new fld::widget::Formula_Input(85, 140, 40, 20, "Row Span:"); + { widget_grid_rowspan_input = new Formula_Input(85, 140, 40, 20, "Row Span:"); widget_grid_rowspan_input->box(FL_DOWN_BOX); widget_grid_rowspan_input->color(FL_BACKGROUND2_COLOR); widget_grid_rowspan_input->selection_color(FL_SELECTION_COLOR); @@ -408,7 +408,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : widget_grid_rowspan_input->callback((Fl_Callback*)cb_widget_grid_rowspan_input); widget_grid_rowspan_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_grid_rowspan_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_grid_rowspan_input + } // Formula_Input* widget_grid_rowspan_input { Fl_Group* o = new Fl_Group(125, 140, 30, 20); { Fl_Button* o = new Fl_Button(125, 140, 15, 20, "-"); o->compact(1); @@ -424,7 +424,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : } // Fl_Button* o o->end(); } // Fl_Group* o - { widget_grid_colspan_input = new fld::widget::Formula_Input(165, 140, 40, 20, "Col. Span:"); + { widget_grid_colspan_input = new Formula_Input(165, 140, 40, 20, "Col. Span:"); widget_grid_colspan_input->box(FL_DOWN_BOX); widget_grid_colspan_input->color(FL_BACKGROUND2_COLOR); widget_grid_colspan_input->selection_color(FL_SELECTION_COLOR); @@ -436,7 +436,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : widget_grid_colspan_input->callback((Fl_Callback*)cb_widget_grid_colspan_input); widget_grid_colspan_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_grid_colspan_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_grid_colspan_input + } // Formula_Input* widget_grid_colspan_input { Fl_Group* o = new Fl_Group(205, 140, 30, 20); { Fl_Button* o = new Fl_Button(205, 140, 15, 20, "-"); o->compact(1); @@ -467,7 +467,7 @@ Grid_Child_Tab::Grid_Child_Tab(int X, int Y, int W, int H, const char *L) : resize(X, Y, W, H); } -void Grid_Child_Tab::grid_child_cb(fld::widget::Formula_Input* i, void* v, int what) { +void Grid_Child_Tab::grid_child_cb(Formula_Input* i, void* v, int what) { if ( !current_widget || !current_widget->parent || !current_widget->parent->is_a(FLD_NODE_TYPE_Grid)) diff --git a/fluid/panels/widget_panel/Grid_Child_Tab.fl b/fluid/panels/widget_panel/Grid_Child_Tab.fl index 4bd3744d6..dc6b0a5e7 100644 --- a/fluid/panels/widget_panel/Grid_Child_Tab.fl +++ b/fluid/panels/widget_panel/Grid_Child_Tab.fl @@ -33,7 +33,7 @@ widget_class Grid_Child_Tab { callback {grid_child_cb(o, v, 8); if (v!=LOAD) widget_tab_grid_child->do_callback(widget_tab_grid_child, LOAD);} xywh {85 30 40 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Group {} {open xywh {125 30 30 20} @@ -62,7 +62,7 @@ widget_class Grid_Child_Tab { callback {grid_child_cb(o, v, 9); if (v!=LOAD) widget_tab_grid_child->do_callback(widget_tab_grid_child, LOAD);} xywh {165 30 40 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Group {} {open xywh {205 30 30 20} @@ -243,13 +243,13 @@ widget_class Grid_Child_Tab { label {Width:} callback {grid_child_cb(o, v, 12);} xywh {85 105 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input {} { label {Height:} callback {grid_child_cb(o, v, 13);} xywh {145 105 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Box {} { xywh {385 105 1 20} hide resizable @@ -265,7 +265,7 @@ widget_class Grid_Child_Tab { callback {grid_child_cb(o, v, 10); if (v!=LOAD) widget_tab_grid_child->do_callback(widget_tab_grid_child, LOAD);} xywh {85 140 40 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Group {} {open xywh {125 140 30 20} @@ -294,7 +294,7 @@ widget_class Grid_Child_Tab { callback {grid_child_cb(o, v, 11); if (v!=LOAD) widget_tab_grid_child->do_callback(widget_tab_grid_child, LOAD);} xywh {165 140 40 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Group {} {open xywh {205 140 30 20} @@ -325,7 +325,7 @@ widget_class Grid_Child_Tab { Fl_Box {} { xywh {85 320 300 5} labelsize 11 hide resizable } - Function {grid_child_cb(fld::widget::Formula_Input* i, void* v, int what)} {open return_type void + Function {grid_child_cb(Formula_Input* i, void* v, int what)} {open return_type void } { code {if ( !current_widget || !current_widget->parent diff --git a/fluid/panels/widget_panel/Grid_Child_Tab.h b/fluid/panels/widget_panel/Grid_Child_Tab.h index 93cfda78b..6970c69bd 100644 --- a/fluid/panels/widget_panel/Grid_Child_Tab.h +++ b/fluid/panels/widget_panel/Grid_Child_Tab.h @@ -13,19 +13,19 @@ extern void propagate_load(Fl_Group*, void*); class Grid_Child_Tab : public Fl_Group { public: Grid_Child_Tab(int X, int Y, int W, int H, const char *L = 0); - fld::widget::Formula_Input *widget_grid_row_input; + Formula_Input *widget_grid_row_input; private: - inline void cb_widget_grid_row_input_i(fld::widget::Formula_Input*, void*); - static void cb_widget_grid_row_input(fld::widget::Formula_Input*, void*); + inline void cb_widget_grid_row_input_i(Formula_Input*, void*); + static void cb_widget_grid_row_input(Formula_Input*, void*); inline void cb__i(Fl_Button*, void*); static void cb_(Fl_Button*, void*); inline void cb_1_i(Fl_Button*, void*); static void cb_1(Fl_Button*, void*); public: - fld::widget::Formula_Input *widget_grid_col_input; + Formula_Input *widget_grid_col_input; private: - inline void cb_widget_grid_col_input_i(fld::widget::Formula_Input*, void*); - static void cb_widget_grid_col_input(fld::widget::Formula_Input*, void*); + inline void cb_widget_grid_col_input_i(Formula_Input*, void*); + static void cb_widget_grid_col_input(Formula_Input*, void*); inline void cb_2_i(Fl_Button*, void*); static void cb_2(Fl_Button*, void*); inline void cb_3_i(Fl_Button*, void*); @@ -51,29 +51,29 @@ private: public: Fl_Group *wp_gridc_size; private: - inline void cb_Width_i(fld::widget::Formula_Input*, void*); - static void cb_Width(fld::widget::Formula_Input*, void*); - inline void cb_Height_i(fld::widget::Formula_Input*, void*); - static void cb_Height(fld::widget::Formula_Input*, void*); + inline void cb_Width_i(Formula_Input*, void*); + static void cb_Width(Formula_Input*, void*); + inline void cb_Height_i(Formula_Input*, void*); + static void cb_Height(Formula_Input*, void*); public: - fld::widget::Formula_Input *widget_grid_rowspan_input; + Formula_Input *widget_grid_rowspan_input; private: - inline void cb_widget_grid_rowspan_input_i(fld::widget::Formula_Input*, void*); - static void cb_widget_grid_rowspan_input(fld::widget::Formula_Input*, void*); + inline void cb_widget_grid_rowspan_input_i(Formula_Input*, void*); + static void cb_widget_grid_rowspan_input(Formula_Input*, void*); inline void cb_4_i(Fl_Button*, void*); static void cb_4(Fl_Button*, void*); inline void cb_5_i(Fl_Button*, void*); static void cb_5(Fl_Button*, void*); public: - fld::widget::Formula_Input *widget_grid_colspan_input; + Formula_Input *widget_grid_colspan_input; private: - inline void cb_widget_grid_colspan_input_i(fld::widget::Formula_Input*, void*); - static void cb_widget_grid_colspan_input(fld::widget::Formula_Input*, void*); + inline void cb_widget_grid_colspan_input_i(Formula_Input*, void*); + static void cb_widget_grid_colspan_input(Formula_Input*, void*); inline void cb_6_i(Fl_Button*, void*); static void cb_6(Fl_Button*, void*); inline void cb_7_i(Fl_Button*, void*); static void cb_7(Fl_Button*, void*); public: - void grid_child_cb(fld::widget::Formula_Input* i, void* v, int what); + void grid_child_cb(Formula_Input* i, void* v, int what); }; #endif diff --git a/fluid/panels/widget_panel/Grid_Tab.cxx b/fluid/panels/widget_panel/Grid_Tab.cxx index 4730f0789..2540d95a5 100644 --- a/fluid/panels/widget_panel/Grid_Tab.cxx +++ b/fluid/panels/widget_panel/Grid_Tab.cxx @@ -6,7 +6,7 @@ #include "nodes/Grid_Node.h" extern Grid_Tab *widget_tab_grid; -void Grid_Tab::cb_widget_grid_rows_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_widget_grid_rows_i(Formula_Input* o, void* v) { // grid_rows_cb Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; @@ -31,7 +31,7 @@ void Grid_Tab::cb_widget_grid_rows_i(fld::widget::Formula_Input* o, void* v) { } } } -void Grid_Tab::cb_widget_grid_rows(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_widget_grid_rows(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()))->cb_widget_grid_rows_i(o,v); } @@ -55,7 +55,7 @@ void Grid_Tab::cb_1(Fl_Button* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_1_i(o,v); } -void Grid_Tab::cb_widget_grid_cols_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_widget_grid_cols_i(Formula_Input* o, void* v) { // grid_rows_cb Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; @@ -80,7 +80,7 @@ void Grid_Tab::cb_widget_grid_cols_i(fld::widget::Formula_Input* o, void* v) { } } } -void Grid_Tab::cb_widget_grid_cols(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_widget_grid_cols(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()))->cb_widget_grid_cols_i(o,v); } @@ -250,7 +250,7 @@ void Grid_Tab::cb_Row1(Fl_Group* o, void* v) { ((Grid_Tab*)(o->parent()))->cb_Row1_i(o,v); } -void Grid_Tab::cb_widget_grid_curr_row_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_widget_grid_curr_row_i(Formula_Input* o, void* v) { Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; int r = o->value(), old_r = r; @@ -263,7 +263,7 @@ void Grid_Tab::cb_widget_grid_curr_row_i(fld::widget::Formula_Input* o, void* v) widget_grid_curr_row_attributes->do_callback(widget_grid_curr_row_attributes, LOAD); } } -void Grid_Tab::cb_widget_grid_curr_row(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_widget_grid_curr_row(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()))->cb_widget_grid_curr_row_i(o,v); } @@ -287,7 +287,7 @@ void Grid_Tab::cb_5(Fl_Button* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_5_i(o,v); } -void Grid_Tab::cb_Height_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Height_i(Formula_Input* o, void* v) { Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; int r = widget_grid_curr_row->value(); @@ -304,11 +304,11 @@ void Grid_Tab::cb_Height_i(fld::widget::Formula_Input* o, void* v) { } } } -void Grid_Tab::cb_Height(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Height(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Height_i(o,v); } -void Grid_Tab::cb_Weight_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Weight_i(Formula_Input* o, void* v) { Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; int r = widget_grid_curr_row->value(); @@ -325,11 +325,11 @@ void Grid_Tab::cb_Weight_i(fld::widget::Formula_Input* o, void* v) { } } } -void Grid_Tab::cb_Weight(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Weight(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Weight_i(o,v); } -void Grid_Tab::cb_Gap_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Gap_i(Formula_Input* o, void* v) { Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; int r = widget_grid_curr_row->value(); @@ -346,11 +346,11 @@ void Grid_Tab::cb_Gap_i(fld::widget::Formula_Input* o, void* v) { } } } -void Grid_Tab::cb_Gap(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Gap(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Gap_i(o,v); } -void Grid_Tab::cb_widget_grid_curr_col_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_widget_grid_curr_col_i(Formula_Input* o, void* v) { Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; int c = o->value(), old_c = c; @@ -363,7 +363,7 @@ void Grid_Tab::cb_widget_grid_curr_col_i(fld::widget::Formula_Input* o, void* v) widget_grid_curr_col_attributes->do_callback(widget_grid_curr_col_attributes, LOAD); } } -void Grid_Tab::cb_widget_grid_curr_col(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_widget_grid_curr_col(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()))->cb_widget_grid_curr_col_i(o,v); } @@ -387,7 +387,7 @@ void Grid_Tab::cb_7(Fl_Button* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_7_i(o,v); } -void Grid_Tab::cb_Width_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Width_i(Formula_Input* o, void* v) { Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; int c = widget_grid_curr_col->value(); @@ -404,11 +404,11 @@ void Grid_Tab::cb_Width_i(fld::widget::Formula_Input* o, void* v) { } } } -void Grid_Tab::cb_Width(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Width(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Width_i(o,v); } -void Grid_Tab::cb_Weight1_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Weight1_i(Formula_Input* o, void* v) { Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; int c = widget_grid_curr_col->value(); @@ -425,11 +425,11 @@ void Grid_Tab::cb_Weight1_i(fld::widget::Formula_Input* o, void* v) { } } } -void Grid_Tab::cb_Weight1(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Weight1(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Weight1_i(o,v); } -void Grid_Tab::cb_Gap1_i(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Gap1_i(Formula_Input* o, void* v) { Fl_Grid *grid = Grid_Node::selected(); if (!grid) return; int c = widget_grid_curr_col->value(); @@ -446,7 +446,7 @@ void Grid_Tab::cb_Gap1_i(fld::widget::Formula_Input* o, void* v) { } } } -void Grid_Tab::cb_Gap1(fld::widget::Formula_Input* o, void* v) { +void Grid_Tab::cb_Gap1(Formula_Input* o, void* v) { ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Gap1_i(o,v); } @@ -460,7 +460,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { widget_grid_rows = new fld::widget::Formula_Input(85, 30, 40, 20, "Rows:"); + { widget_grid_rows = new Formula_Input(85, 30, 40, 20, "Rows:"); widget_grid_rows->tooltip("Number of horizontal rows in the Grid group"); widget_grid_rows->box(FL_DOWN_BOX); widget_grid_rows->color(FL_BACKGROUND2_COLOR); @@ -473,7 +473,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : widget_grid_rows->callback((Fl_Callback*)cb_widget_grid_rows); widget_grid_rows->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_grid_rows->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_grid_rows + } // Formula_Input* widget_grid_rows { Fl_Group* o = new Fl_Group(125, 30, 30, 20); { Fl_Button* o = new Fl_Button(125, 30, 15, 20, "-"); o->compact(1); @@ -489,7 +489,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : } // Fl_Button* o o->end(); } // Fl_Group* o - { widget_grid_cols = new fld::widget::Formula_Input(165, 30, 40, 20, "Columns:"); + { widget_grid_cols = new Formula_Input(165, 30, 40, 20, "Columns:"); widget_grid_cols->tooltip("Number of vertical columns in the Grid group"); widget_grid_cols->box(FL_DOWN_BOX); widget_grid_cols->color(FL_BACKGROUND2_COLOR); @@ -502,7 +502,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : widget_grid_cols->callback((Fl_Callback*)cb_widget_grid_cols); widget_grid_cols->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_grid_cols->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_grid_cols + } // Formula_Input* widget_grid_cols { Fl_Group* o = new Fl_Group(205, 30, 30, 20); { Fl_Button* o = new Fl_Button(205, 30, 15, 20, "-"); o->compact(1); @@ -602,7 +602,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->labelsize(11); o->callback((Fl_Callback*)cb_Row1); o->align(Fl_Align(FL_ALIGN_LEFT)); - { widget_grid_curr_row = new fld::widget::Formula_Input(85, 145, 40, 20, "Index"); + { widget_grid_curr_row = new Formula_Input(85, 145, 40, 20, "Index"); widget_grid_curr_row->box(FL_DOWN_BOX); widget_grid_curr_row->color(FL_BACKGROUND2_COLOR); widget_grid_curr_row->selection_color(FL_SELECTION_COLOR); @@ -614,7 +614,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : widget_grid_curr_row->callback((Fl_Callback*)cb_widget_grid_curr_row); widget_grid_curr_row->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_grid_curr_row->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_grid_curr_row + } // Formula_Input* widget_grid_curr_row { Fl_Group* o = new Fl_Group(125, 145, 30, 20); o->callback((Fl_Callback*)propagate_load); { Fl_Button* o = new Fl_Button(125, 145, 15, 20, "-"); @@ -636,7 +636,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : } // Fl_Box* o { widget_grid_curr_row_attributes = new Fl_Group(170, 145, 175, 20); widget_grid_curr_row_attributes->callback((Fl_Callback*)propagate_load); - { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(170, 145, 55, 20, "Height:"); + { Formula_Input* o = new Formula_Input(170, 145, 55, 20, "Height:"); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -648,8 +648,8 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->callback((Fl_Callback*)cb_Height); o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); o->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* o - { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(230, 145, 55, 20, "Weight:"); + } // Formula_Input* o + { Formula_Input* o = new Formula_Input(230, 145, 55, 20, "Weight:"); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -661,8 +661,8 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->callback((Fl_Callback*)cb_Weight); o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); o->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* o - { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(290, 145, 55, 20, "Gap:"); + } // Formula_Input* o + { Formula_Input* o = new Formula_Input(290, 145, 55, 20, "Gap:"); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -674,7 +674,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->callback((Fl_Callback*)cb_Gap); o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); o->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* o + } // Formula_Input* o widget_grid_curr_row_attributes->end(); } // Fl_Group* widget_grid_curr_row_attributes { Fl_Box* o = new Fl_Box(390, 145, 1, 20); @@ -688,7 +688,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { widget_grid_curr_col = new fld::widget::Formula_Input(85, 180, 40, 20, "Index"); + { widget_grid_curr_col = new Formula_Input(85, 180, 40, 20, "Index"); widget_grid_curr_col->box(FL_DOWN_BOX); widget_grid_curr_col->color(FL_BACKGROUND2_COLOR); widget_grid_curr_col->selection_color(FL_SELECTION_COLOR); @@ -700,7 +700,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : widget_grid_curr_col->callback((Fl_Callback*)cb_widget_grid_curr_col); widget_grid_curr_col->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_grid_curr_col->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_grid_curr_col + } // Formula_Input* widget_grid_curr_col { Fl_Group* o = new Fl_Group(125, 180, 30, 20); { Fl_Button* o = new Fl_Button(125, 180, 15, 20, "-"); o->compact(1); @@ -721,7 +721,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : } // Fl_Box* o { widget_grid_curr_col_attributes = new Fl_Group(170, 180, 175, 20); widget_grid_curr_col_attributes->callback((Fl_Callback*)propagate_load); - { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(170, 180, 55, 20, "Width:"); + { Formula_Input* o = new Formula_Input(170, 180, 55, 20, "Width:"); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -733,8 +733,8 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->callback((Fl_Callback*)cb_Width); o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); o->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* o - { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(230, 180, 55, 20, "Weight:"); + } // Formula_Input* o + { Formula_Input* o = new Formula_Input(230, 180, 55, 20, "Weight:"); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -746,8 +746,8 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->callback((Fl_Callback*)cb_Weight1); o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); o->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* o - { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(290, 180, 55, 20, "Gap:"); + } // Formula_Input* o + { Formula_Input* o = new Formula_Input(290, 180, 55, 20, "Gap:"); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -759,7 +759,7 @@ Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) : o->callback((Fl_Callback*)cb_Gap1); o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); o->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* o + } // Formula_Input* o widget_grid_curr_col_attributes->end(); } // Fl_Group* widget_grid_curr_col_attributes { Fl_Box* o = new Fl_Box(390, 180, 1, 20); diff --git a/fluid/panels/widget_panel/Grid_Tab.fl b/fluid/panels/widget_panel/Grid_Tab.fl index 422ddf789..231d67361 100644 --- a/fluid/panels/widget_panel/Grid_Tab.fl +++ b/fluid/panels/widget_panel/Grid_Tab.fl @@ -54,7 +54,7 @@ if (v == LOAD) { } }} tooltip {Number of horizontal rows in the Grid group} xywh {85 30 40 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Group {} {open xywh {125 30 30 20} @@ -104,7 +104,7 @@ if (v == LOAD) { } }} tooltip {Number of vertical columns in the Grid group} xywh {165 30 40 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Group {} {open xywh {205 30 30 20} @@ -296,7 +296,7 @@ if (v == LOAD) { widget_grid_curr_row_attributes->do_callback(widget_grid_curr_row_attributes, LOAD); }} xywh {85 145 40 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Group {} { callback propagate_load open @@ -347,7 +347,7 @@ if (v == LOAD) { } }} xywh {170 145 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input {} { label {Weight:} @@ -367,7 +367,7 @@ if (v == LOAD) { } }} xywh {230 145 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input {} { label {Gap:} @@ -387,7 +387,7 @@ if (v == LOAD) { } }} xywh {290 145 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } } Fl_Box {} { @@ -413,7 +413,7 @@ if (v == LOAD) { widget_grid_curr_col_attributes->do_callback(widget_grid_curr_col_attributes, LOAD); }} xywh {85 180 40 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Group {} {open xywh {125 180 30 20} @@ -463,7 +463,7 @@ if (v == LOAD) { } }} xywh {170 180 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input {} { label {Weight:} @@ -483,7 +483,7 @@ if (v == LOAD) { } }} xywh {230 180 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } Fl_Input {} { label {Gap:} @@ -503,7 +503,7 @@ if (v == LOAD) { } }} xywh {290 180 55 20} labelsize 11 align 5 textsize 11 - class {fld::widget::Formula_Input} + class {Formula_Input} } } Fl_Box {} { diff --git a/fluid/panels/widget_panel/Grid_Tab.h b/fluid/panels/widget_panel/Grid_Tab.h index 4b06a9e43..c562f345a 100644 --- a/fluid/panels/widget_panel/Grid_Tab.h +++ b/fluid/panels/widget_panel/Grid_Tab.h @@ -13,19 +13,19 @@ extern void propagate_load(Fl_Group*, void*); class Grid_Tab : public Fl_Group { public: Grid_Tab(int X, int Y, int W, int H, const char *L = 0); - fld::widget::Formula_Input *widget_grid_rows; + Formula_Input *widget_grid_rows; private: - inline void cb_widget_grid_rows_i(fld::widget::Formula_Input*, void*); - static void cb_widget_grid_rows(fld::widget::Formula_Input*, void*); + inline void cb_widget_grid_rows_i(Formula_Input*, void*); + static void cb_widget_grid_rows(Formula_Input*, void*); inline void cb__i(Fl_Button*, void*); static void cb_(Fl_Button*, void*); inline void cb_1_i(Fl_Button*, void*); static void cb_1(Fl_Button*, void*); public: - fld::widget::Formula_Input *widget_grid_cols; + Formula_Input *widget_grid_cols; private: - inline void cb_widget_grid_cols_i(fld::widget::Formula_Input*, void*); - static void cb_widget_grid_cols(fld::widget::Formula_Input*, void*); + inline void cb_widget_grid_cols_i(Formula_Input*, void*); + static void cb_widget_grid_cols(Formula_Input*, void*); inline void cb_2_i(Fl_Button*, void*); static void cb_2(Fl_Button*, void*); inline void cb_3_i(Fl_Button*, void*); @@ -51,10 +51,10 @@ private: inline void cb_Row1_i(Fl_Group*, void*); static void cb_Row1(Fl_Group*, void*); public: - fld::widget::Formula_Input *widget_grid_curr_row; + Formula_Input *widget_grid_curr_row; private: - inline void cb_widget_grid_curr_row_i(fld::widget::Formula_Input*, void*); - static void cb_widget_grid_curr_row(fld::widget::Formula_Input*, void*); + inline void cb_widget_grid_curr_row_i(Formula_Input*, void*); + static void cb_widget_grid_curr_row(Formula_Input*, void*); inline void cb_4_i(Fl_Button*, void*); static void cb_4(Fl_Button*, void*); inline void cb_5_i(Fl_Button*, void*); @@ -62,17 +62,17 @@ private: public: Fl_Group *widget_grid_curr_row_attributes; private: - inline void cb_Height_i(fld::widget::Formula_Input*, void*); - static void cb_Height(fld::widget::Formula_Input*, void*); - inline void cb_Weight_i(fld::widget::Formula_Input*, void*); - static void cb_Weight(fld::widget::Formula_Input*, void*); - inline void cb_Gap_i(fld::widget::Formula_Input*, void*); - static void cb_Gap(fld::widget::Formula_Input*, void*); + inline void cb_Height_i(Formula_Input*, void*); + static void cb_Height(Formula_Input*, void*); + inline void cb_Weight_i(Formula_Input*, void*); + static void cb_Weight(Formula_Input*, void*); + inline void cb_Gap_i(Formula_Input*, void*); + static void cb_Gap(Formula_Input*, void*); public: - fld::widget::Formula_Input *widget_grid_curr_col; + Formula_Input *widget_grid_curr_col; private: - inline void cb_widget_grid_curr_col_i(fld::widget::Formula_Input*, void*); - static void cb_widget_grid_curr_col(fld::widget::Formula_Input*, void*); + inline void cb_widget_grid_curr_col_i(Formula_Input*, void*); + static void cb_widget_grid_curr_col(Formula_Input*, void*); inline void cb_6_i(Fl_Button*, void*); static void cb_6(Fl_Button*, void*); inline void cb_7_i(Fl_Button*, void*); @@ -80,11 +80,11 @@ private: public: Fl_Group *widget_grid_curr_col_attributes; private: - inline void cb_Width_i(fld::widget::Formula_Input*, void*); - static void cb_Width(fld::widget::Formula_Input*, void*); - inline void cb_Weight1_i(fld::widget::Formula_Input*, void*); - static void cb_Weight1(fld::widget::Formula_Input*, void*); - inline void cb_Gap1_i(fld::widget::Formula_Input*, void*); - static void cb_Gap1(fld::widget::Formula_Input*, void*); + inline void cb_Width_i(Formula_Input*, void*); + static void cb_Width(Formula_Input*, void*); + inline void cb_Weight1_i(Formula_Input*, void*); + static void cb_Weight1(Formula_Input*, void*); + inline void cb_Gap1_i(Formula_Input*, void*); + static void cb_Gap1(Formula_Input*, void*); }; #endif diff --git a/fluid/proj/i18n.cxx b/fluid/proj/i18n.cxx index 71ba892a1..c726a56d0 100644 --- a/fluid/proj/i18n.cxx +++ b/fluid/proj/i18n.cxx @@ -23,7 +23,7 @@ static char *dup_str(const char *s) { return s ? fl_strdup(s) : 0; } -fld::proj::I18n::I18n(Project &p) : project_(p) { +I18n::I18n(Project &p) : project_(p) { type = FLD_I18N_TYPE_NONE; gnu_include = fl_strdup("<libintl.h>"); gnu_conditional = 0; @@ -35,7 +35,7 @@ fld::proj::I18n::I18n(Project &p) : project_(p) { posix_set = fl_strdup("1"); } -fld::proj::I18n::~I18n() { +I18n::~I18n() { if (gnu_include) free(gnu_include); if (gnu_conditional) free(gnu_conditional); if (gnu_function) free(gnu_function); @@ -46,42 +46,42 @@ fld::proj::I18n::~I18n() { if (posix_set) free(posix_set); } -void fld::proj::I18n::set_gnu_include(const char *s) { +void I18n::set_gnu_include(const char *s) { if (gnu_include) free(gnu_include); gnu_include = dup_str(s); } -void fld::proj::I18n::set_gnu_conditional(const char *s) { +void I18n::set_gnu_conditional(const char *s) { if (gnu_conditional) free(gnu_conditional); gnu_conditional = dup_str(s); } -void fld::proj::I18n::set_gnu_function(const char *s) { +void I18n::set_gnu_function(const char *s) { if (gnu_function) free(gnu_function); gnu_function = dup_str(s); } -void fld::proj::I18n::set_gnu_static_function(const char *s) { +void I18n::set_gnu_static_function(const char *s) { if (gnu_static_function) free(gnu_static_function); gnu_static_function = dup_str(s); } -void fld::proj::I18n::set_posix_include(const char *s) { +void I18n::set_posix_include(const char *s) { if (posix_include) free(posix_include); posix_include = dup_str(s); } -void fld::proj::I18n::set_posix_conditional(const char *s) { +void I18n::set_posix_conditional(const char *s) { if (posix_conditional) free(posix_conditional); posix_conditional = dup_str(s); } -void fld::proj::I18n::set_posix_file(const char *s) { +void I18n::set_posix_file(const char *s) { if (posix_file) free(posix_file); posix_file = dup_str(s); } -void fld::proj::I18n::set_posix_set(const char *s) { +void I18n::set_posix_set(const char *s) { if (posix_set) free(posix_set); posix_set = dup_str(s); } @@ -89,7 +89,7 @@ void fld::proj::I18n::set_posix_set(const char *s) { /** Reset all project setting to create a new empty project. */ -void fld::proj::I18n::reset() { +void I18n::reset() { type = FLD_I18N_TYPE_NONE; set_gnu_include("<libintl.h>"); @@ -103,9 +103,9 @@ void fld::proj::I18n::reset() { set_posix_set("1"); } -void fld::proj::I18n::read(io::Project_Reader &f, const char *key) { +void I18n::read(Project_Reader &f, const char *key) { if (!strcmp(key, "i18n_type")) { - type = (fld::I18n_Type)(atoi(f.read_word())); + type = (I18n_Type)(atoi(f.read_word())); } else if (!strcmp(key, "i18n_gnu_function")) { set_gnu_function(f.read_word()); } else if (!strcmp(key, "i18n_gnu_static_function")) { @@ -129,7 +129,7 @@ void fld::proj::I18n::read(io::Project_Reader &f, const char *key) { } } -void fld::proj::I18n::write(io::Project_Writer &f) const { +void I18n::write(Project_Writer &f) const { if ((type != FLD_I18N_TYPE_NONE)) { f.write_string("\ni18n_type %d", (int)(type)); switch (type) { diff --git a/fluid/proj/i18n.h b/fluid/proj/i18n.h index 65ef72bf6..262a6347c 100644 --- a/fluid/proj/i18n.h +++ b/fluid/proj/i18n.h @@ -21,8 +21,6 @@ #include <stdlib.h> #include <string.h> -namespace fld { - class Project; /** @@ -30,22 +28,14 @@ class Project; */ typedef int I18n_Type; -} // namespace fld - enum { FLD_I18N_TYPE_NONE = 0, ///< No i18n, all strings are litearals FLD_I18N_TYPE_GNU, ///< GNU gettext internationalization FLD_I18N_TYPE_POSIX ///< Posix catgets internationalization }; -namespace fld { - -namespace io { class Project_Reader; class Project_Writer; -} - -namespace proj { /** Data and settings for a FLUID project file. @@ -56,7 +46,7 @@ public: Project &project_; /// One of the available internationalization types. - fld::I18n_Type type; + I18n_Type type; /// Include file for GNU i18n, writes an #include statement into the source /// file. This is usually `<libintl.h>` or `"gettext.h"` for GNU gettext. char *gnu_include; @@ -83,8 +73,8 @@ public: // Methods I18n(Project &p); ~I18n(); void reset(); - void read(io::Project_Reader &f, const char *key); - void write(io::Project_Writer &f) const; + void read(Project_Reader &f, const char *key); + void write(Project_Writer &f) const; void set_gnu_include(const char *s); void set_gnu_conditional(const char *s); @@ -96,9 +86,6 @@ public: // Methods void set_posix_set(const char *s); }; -} // namespace proj - -} // namespace fld #endif // FLUID_PROJ_I18N_H diff --git a/fluid/proj/mergeback.cxx b/fluid/proj/mergeback.cxx index 2d553aedb..827a9505b 100644 --- a/fluid/proj/mergeback.cxx +++ b/fluid/proj/mergeback.cxx @@ -91,7 +91,7 @@ extern void redraw_browser(); Returns 0 if nothing changed, and 1 if it merged any changes back, and -1 if there were conflicts. - \note this function is currently part of fld::io::Code_Writer to get easy access + \note this function is currently part of Code_Writer to get easy access to our crc32 code that also wrote the code file originally. \param[in] s path and filename of the source code file @@ -100,7 +100,7 @@ extern void redraw_browser(); \return -2 if no code file was found \return see above */ -static int merge_back(fld::Project &proj, const char *s, const char *p, Mergeback::Task task) { +static int merge_back(Project &proj, const char *s, const char *p, Mergeback::Task task) { if (proj.write_mergeback_data) { Mergeback mergeback(proj); return mergeback.merge_back(s, p, task); @@ -111,7 +111,7 @@ static int merge_back(fld::Project &proj, const char *s, const char *p, Mergebac } /** Allocate and initialize MergeBack class. */ -Mergeback::Mergeback(fld::Project &proj) +Mergeback::Mergeback(Project &proj) : proj_(proj), code(0), line_no(0), @@ -253,7 +253,7 @@ void Mergeback::analyse_callback(unsigned long code_crc, unsigned long tag_crc, if (cb && len) memcpy(cb_nl, cb, len); cb_nl[len] = '\n'; cb_nl[len + 1] = '\0'; - unsigned long project_crc = fld::io::Code_Writer::block_crc(cb_nl); + unsigned long project_crc = Code_Writer::block_crc(cb_nl); free(cb_nl); // check if the code and project crc are the same, so this modification was already applied if (project_crc!=code_crc) { @@ -281,7 +281,7 @@ void Mergeback::analyse_code(unsigned long code_crc, unsigned long tag_crc, int if (code && len) memcpy(code_nl, code, len); code_nl[len] = '\n'; code_nl[len + 1] = '\0'; - unsigned long project_crc = fld::io::Code_Writer::block_crc(code_nl); + unsigned long project_crc = Code_Writer::block_crc(code_nl); free(code_nl); // check if the code and project crc are the same, so this modification was already applied if (project_crc!=code_crc) { @@ -448,7 +448,7 @@ int Mergeback::analyse() { const char *tag = find_mergeback_tag(line); if (!tag) { // if this line has no tag, add the contents to the CRC and continue - code_crc = fld::io::Code_Writer::block_crc(line, -1, code_crc, &line_start); + code_crc = Code_Writer::block_crc(line, -1, code_crc, &line_start); } else { // if this line has a tag, read all tag data Tag tag_type = FLD_MERGEBACK_TAG_UNUSED_; @@ -494,7 +494,7 @@ int Mergeback::apply_callback(long block_end, long block_start, unsigned long co if (cb && len) memcpy(cb_nl, cb, len); cb_nl[len] = '\n'; cb_nl[len + 1] = '\0'; - unsigned long project_crc = fld::io::Code_Writer::block_crc(cb_nl); + unsigned long project_crc = Code_Writer::block_crc(cb_nl); free(cb_nl); if (project_crc!=code_crc) { char *block = read_and_unindent_block(block_start, block_end); @@ -518,7 +518,7 @@ int Mergeback::apply_code(long block_end, long block_start, unsigned long code_c if (code && len) memcpy(code_nl, code, len); code_nl[len] = '\n'; code_nl[len + 1] = '\0'; - unsigned long project_crc = fld::io::Code_Writer::block_crc(code_nl); + unsigned long project_crc = Code_Writer::block_crc(code_nl); free(code_nl); if (project_crc!=code_crc) { char *block = read_and_unindent_block(block_start, block_end); @@ -557,7 +557,7 @@ int Mergeback::apply() { const char *tag = find_mergeback_tag(line); if (!tag) { // if this line has no tag, add the contents to the CRC and continue - code_crc = fld::io::Code_Writer::block_crc(line, -1, code_crc, &line_start); + code_crc = Code_Writer::block_crc(line, -1, code_crc, &line_start); block_end = ::ftell(code); } else { // if this line has a tag, read all tag data @@ -654,7 +654,7 @@ int Mergeback::merge_back(const char *s, const char *p, Task task) { \return 0 if MergeBack is not enabled, or the result of the merge_back function. \see Mergeback::merge_back(const char *s, const char *p, Task task) */ -int mergeback_code_files(fld::Project &proj, Mergeback::Feedback feedback) +int mergeback_code_files(Project &proj, Mergeback::Feedback feedback) { static bool recursion_lock = false; if (recursion_lock) return 2; diff --git a/fluid/proj/mergeback.h b/fluid/proj/mergeback.h index 04a9dc902..c1e877d60 100644 --- a/fluid/proj/mergeback.h +++ b/fluid/proj/mergeback.h @@ -22,7 +22,7 @@ #include <stdint.h> #include <stdio.h> -namespace fld { class Project; } +class Project; /** Class that implements the MergeBack functionality. \see merge_back(const char *s, int task) @@ -50,7 +50,7 @@ public: enum Feedback { QUIET = 0, CHATTY = 1 }; protected: /// Apply mergeback for this project. - fld::Project &proj_; + Project &proj_; /// Pointer to the C++ code file. FILE *code; /// Current line number in the C++ code file. @@ -80,7 +80,7 @@ protected: static bool read_tag(const char *tag, Tag *prev_type, uint16_t *uid, uint32_t *crc); public: - Mergeback(fld::Project &proj); + Mergeback(Project &proj); ~Mergeback(); int merge_back(const char *s, const char *p, Task task); int ask_user_to_merge(const char *s, const char *p); diff --git a/fluid/proj/undo.cxx b/fluid/proj/undo.cxx index d3444c91a..829b2d4d4 100644 --- a/fluid/proj/undo.cxx +++ b/fluid/proj/undo.cxx @@ -47,11 +47,11 @@ extern Fl_Window* the_panel; -fld::proj::Undo::Undo(fld::Project &p) +Undo::Undo(Project &p) : proj_( p ) { } -fld::proj::Undo::~Undo() { +Undo::~Undo() { // TODO: delete old undo files when calling the destructor. } @@ -60,7 +60,7 @@ fld::proj::Undo::~Undo() { // The filename is constructed in a static internal buffer and // this buffer is overwritten by every call of this function. // The return value is a pointer to this internal string. -char *fld::proj::Undo::filename(int level) { +char *Undo::filename(int level) { if (!path_len_) { Fluid.preferences.getUserdataPath(path_, sizeof(path_)); path_len_ = (unsigned int)strlen(path_); @@ -75,7 +75,7 @@ char *fld::proj::Undo::filename(int level) { // Redo menu callback -void fld::proj::Undo::redo() { +void Undo::redo() { // int undo_item = main_menubar->find_index(undo_cb); // int redo_item = main_menubar->find_index(redo_cb); once_type_ = FLD_UNDO_ONCETYPE_ALWAYS; @@ -91,7 +91,7 @@ void fld::proj::Undo::redo() { widget_browser->new_list(); } int reload_panel = (the_panel && the_panel->visible()); - if (!fld::io::read_file(proj_, filename(current_ + 1), 0)) { + if (!read_file(proj_, filename(current_ + 1), 0)) { // Unable to read checkpoint file, don't redo... widget_browser->rebuild(); proj_.update_settings_dialog(); @@ -119,7 +119,7 @@ void fld::proj::Undo::redo() { } // Undo menu callback -void fld::proj::Undo::undo() { +void Undo::undo() { // int undo_item = main_menubar->find_index(undo_cb); // int redo_item = main_menubar->find_index(redo_cb); once_type_ = FLD_UNDO_ONCETYPE_ALWAYS; @@ -130,7 +130,7 @@ void fld::proj::Undo::undo() { } if (current_ == last_) { - fld::io::write_file(proj_, filename(current_)); + write_file(proj_, filename(current_)); } suspend(); @@ -142,7 +142,7 @@ void fld::proj::Undo::undo() { widget_browser->new_list(); } int reload_panel = (the_panel && the_panel->visible()); - if (!fld::io::read_file(proj_, filename(current_ - 1), 0)) { + if (!read_file(proj_, filename(current_ - 1), 0)) { // Unable to read checkpoint file, don't undo... widget_browser->rebuild(); proj_.update_settings_dialog(); @@ -180,7 +180,7 @@ void fld::proj::Undo::undo() { \param[in] type set a new type, or set to 0 to clear the once_type without setting a checkpoint \return 1 if the checkpoint was set, 0 if this is a repeating event */ -int fld::proj::Undo::checkpoint(OnceType type) { +int Undo::checkpoint(OnceType type) { if (type == FLD_UNDO_ONCETYPE_ALWAYS) { once_type_ = FLD_UNDO_ONCETYPE_ALWAYS; return 0; @@ -197,7 +197,7 @@ int fld::proj::Undo::checkpoint(OnceType type) { } // Save current file to undo buffer -void fld::proj::Undo::checkpoint() { +void Undo::checkpoint() { // printf("checkpoint(): current_=%d, paused_=%d, modflag=%d\n", // current_, paused_, modflag); @@ -210,7 +210,7 @@ void fld::proj::Undo::checkpoint() { // Save the current UI to a checkpoint file... const char *file = filename(current_); - if (!fld::io::write_file(proj_, file)) { + if (!write_file(proj_, file)) { // Don't attempt to do undo stuff if we can't write a checkpoint file... perror(file); return; @@ -231,7 +231,7 @@ void fld::proj::Undo::checkpoint() { } // Clear undo buffer -void fld::proj::Undo::clear() { +void Undo::clear() { // int undo_item = main_menubar->find_index(undo_cb); // int redo_item = main_menubar->find_index(redo_cb); // Remove old checkpoint files... @@ -251,19 +251,19 @@ void fld::proj::Undo::clear() { } // Resume undo checkpoints -void fld::proj::Undo::resume() { +void Undo::resume() { paused_--; } // Suspend undo checkpoints -void fld::proj::Undo::suspend() { +void Undo::suspend() { paused_++; } -void fld::proj::Undo::undo_cb(Fl_Widget *, void *) { +void Undo::undo_cb(Fl_Widget *, void *) { Fluid.proj.undo.undo(); } -void fld::proj::Undo::redo_cb(Fl_Widget *, void *) { +void Undo::redo_cb(Fl_Widget *, void *) { Fluid.proj.undo.redo(); } diff --git a/fluid/proj/undo.h b/fluid/proj/undo.h index de038908a..a50346faf 100644 --- a/fluid/proj/undo.h +++ b/fluid/proj/undo.h @@ -21,12 +21,8 @@ class Fl_Widget; -namespace fld { - class Project; -namespace proj { - enum { FLD_UNDO_ONCETYPE_ALWAYS = 0, FLD_UNDO_ONCETYPE_WINDOW_RESIZE @@ -88,8 +84,6 @@ public: static void undo_cb(Fl_Widget *, void *); }; -} // namespace fld -} // namespace proj #endif // !undo_h diff --git a/fluid/tools/ExternalCodeEditor_WIN32.cxx b/fluid/tools/ExternalCodeEditor_WIN32.cxx index ea9178c63..8c09ca614 100644 --- a/fluid/tools/ExternalCodeEditor_WIN32.cxx +++ b/fluid/tools/ExternalCodeEditor_WIN32.cxx @@ -28,8 +28,6 @@ #include <stdio.h> // snprintf() #include <stdlib.h> -using namespace fld; - // Static local data static int L_editors_open = 0; // keep track of #editors open static Fl_Timeout_Handler L_update_timer_cb = 0; // app's update timer callback diff --git a/fluid/widgets/App_Menu_Bar.cxx b/fluid/widgets/App_Menu_Bar.cxx index cb0dae33f..30377eb68 100644 --- a/fluid/widgets/App_Menu_Bar.cxx +++ b/fluid/widgets/App_Menu_Bar.cxx @@ -29,11 +29,11 @@ extern void mergeback_cb(Fl_Widget *, void *); /** - Create a fld::widget::App_Menu_Bar widget. + Create a App_Menu_Bar widget. \param[in] X, Y, W, H position and size of the widget \param[in] L optional label */ -fld::widget::App_Menu_Bar::App_Menu_Bar(int X, int Y, int W, int H, const char *L) +App_Menu_Bar::App_Menu_Bar(int X, int Y, int W, int H, const char *L) : Fl_Menu_Bar(X, Y, W, H, L) { } @@ -41,7 +41,7 @@ fld::widget::App_Menu_Bar::App_Menu_Bar(int X, int Y, int W, int H, const char * /** Set menu item visibility and active state before menu pops up. */ -int fld::widget::App_Menu_Bar::handle(int event) +int App_Menu_Bar::handle(int event) { Fl_Menu_Item *mi = 0; if (event == FL_BEFORE_MENU) { diff --git a/fluid/widgets/App_Menu_Bar.h b/fluid/widgets/App_Menu_Bar.h index d9547c38f..f5792dd3f 100644 --- a/fluid/widgets/App_Menu_Bar.h +++ b/fluid/widgets/App_Menu_Bar.h @@ -23,9 +23,6 @@ #include <FL/Fl_Menu_Bar.H> -namespace fld { -namespace widget { - /** A text viewer with an additional highlighting color scheme. */ @@ -35,7 +32,4 @@ public: int handle(int event); }; -} // namespace widget -} // namespace fld - #endif // FLUID_WIDGETS_APP_MENU_BAR_H diff --git a/fluid/widgets/Bin_Button.cxx b/fluid/widgets/Bin_Button.cxx index 1a14433e2..325313f1c 100644 --- a/fluid/widgets/Bin_Button.cxx +++ b/fluid/widgets/Bin_Button.cxx @@ -28,7 +28,7 @@ -/** \class fld::widget::Bin_Button +/** \class Bin_Button The Bin_Button button is a button that can be used in the widget bin to allow the user to drag and drop widgets into a window or group. This feature makes it easy for the user to position a widget at a specific location within @@ -38,7 +38,7 @@ /** Convert mouse dragging into a drag and drop event. */ -int fld::widget::Bin_Button::handle(int inEvent) +int Bin_Button::handle(int inEvent) { int ret = 0; switch (inEvent) { @@ -67,7 +67,7 @@ int fld::widget::Bin_Button::handle(int inEvent) return Fl_Button::handle(inEvent); } -/** \class fld::widget::Bin_Window_Button +/** \class Bin_Window_Button The Bin_Window_Button button is used in the widget bin to create new windows by dragging and dropping. When the button is dragged and dropped onto the desktop, a new window will be created at the drop location. @@ -79,7 +79,7 @@ int fld::widget::Bin_Button::handle(int inEvent) /** Convert mouse dragging into a drag and drop event. */ -int fld::widget::Bin_Window_Button::handle(int inEvent) +int Bin_Window_Button::handle(int inEvent) { static Fl_Window *drag_win = 0; int ret = 0; diff --git a/fluid/widgets/Bin_Button.h b/fluid/widgets/Bin_Button.h index aac415ff8..9d3c468d2 100644 --- a/fluid/widgets/Bin_Button.h +++ b/fluid/widgets/Bin_Button.h @@ -19,9 +19,6 @@ #include <FL/Fl_Button.H> -namespace fld { -namespace widget { - // Adding drag and drop for dragging widgets into windows. class Bin_Button : public Fl_Button { public: @@ -38,7 +35,4 @@ public: Fl_Button(X,Y,W,H,l) { } }; -} // namespace widget -} // namespace fld - #endif // FLUID_WIDGETS_BIN_BUTTON_H diff --git a/fluid/widgets/Code_Editor.cxx b/fluid/widgets/Code_Editor.cxx index 1551ed3e2..b30b08db1 100644 --- a/fluid/widgets/Code_Editor.cxx +++ b/fluid/widgets/Code_Editor.cxx @@ -33,7 +33,7 @@ Lookup table for all supported styles. Every table entry describes a rendering style for the corresponding text. */ -Fl_Text_Display::Style_Table_Entry fld::widget::Code_Editor::styletable[] = { // Style table +Fl_Text_Display::Style_Table_Entry Code_Editor::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 @@ -51,7 +51,7 @@ Fl_Text_Display::Style_Table_Entry fld::widget::Code_Editor::styletable[] = { \param[in] in_len byte length to parse \param[in] in_style starting style letter */ -void fld::widget::Code_Editor::style_parse(const char *in_tbuff, // text buffer to parse +void Code_Editor::style_parse(const char *in_tbuff, // text buffer to parse char *in_sbuff, // style buffer we modify int in_len, // byte length to parse char in_style) { // starting style letter @@ -104,7 +104,7 @@ void fld::widget::Code_Editor::style_parse(const char *in_tbuff, // text /** Update unfinished styles. */ -void fld::widget::Code_Editor::style_unfinished_cb(int, void*) { +void Code_Editor::style_unfinished_cb(int, void*) { } /** @@ -114,7 +114,7 @@ void fld::widget::Code_Editor::style_unfinished_cb(int, void*) { \param[in] nDeleted number of bytes deleted \param[in] cbArg pointer back to the code editor */ -void fld::widget::Code_Editor::style_update(int pos, int nInserted, int nDeleted, +void Code_Editor::style_update(int pos, int nInserted, int nDeleted, int /*nRestyled*/, const char * /*deletedText*/, void *cbArg) { Code_Editor *editor = (Code_Editor*)cbArg; @@ -165,7 +165,7 @@ void fld::widget::Code_Editor::style_update(int pos, int nInserted, int nDeleted Find the right indentation depth after pressing the Enter key. \param[in] e pointer back to the code editor */ -int fld::widget::Code_Editor::auto_indent(int, Code_Editor* e) { +int Code_Editor::auto_indent(int, Code_Editor* e) { if (e->buffer()->selected()) { e->insert_position(e->buffer()->primary_selection()->start()); e->buffer()->remove_selection(); @@ -203,7 +203,7 @@ int fld::widget::Code_Editor::auto_indent(int, Code_Editor* e) { \param[in] X, Y, W, H position and size of the widget \param[in] L optional label */ -fld::widget::Code_Editor::Code_Editor(int X, int Y, int W, int H, const char *L) : +Code_Editor::Code_Editor(int X, int Y, int W, int H, const char *L) : Fl_Text_Editor(X, Y, W, H, L) { buffer(new Fl_Text_Buffer); @@ -231,7 +231,7 @@ fld::widget::Code_Editor::Code_Editor(int X, int Y, int W, int H, const char *L) /** Destroy a Code_Editor widget. */ -fld::widget::Code_Editor::~Code_Editor() { +Code_Editor::~Code_Editor() { Fl_Text_Buffer *buf = mStyleBuffer; mStyleBuffer = 0; delete buf; @@ -246,7 +246,7 @@ fld::widget::Code_Editor::~Code_Editor() { This works by updating the fontsizes in the style table. \param[in] s the new general height of the text font */ -void fld::widget::Code_Editor::textsize(Fl_Fontsize s) { +void Code_Editor::textsize(Fl_Fontsize s) { Fl_Text_Editor::textsize(s); // call base class method // now attempt to update our styletable to honor the new size... int entries = sizeof(styletable) / sizeof(styletable[0]); diff --git a/fluid/widgets/Code_Editor.h b/fluid/widgets/Code_Editor.h index 3ee654da1..db90c32f9 100644 --- a/fluid/widgets/Code_Editor.h +++ b/fluid/widgets/Code_Editor.h @@ -27,9 +27,6 @@ #include <FL/Fl_Text_Editor.H> -namespace fld { -namespace widget { - // ---- Code_Editor declaration /** @@ -65,8 +62,6 @@ public: int scroll_col() { return mHorizOffset; } }; -} // namespace widget -} // namespace fld #endif // FLUID_WIDGETS_CODE_EDITOR_H diff --git a/fluid/widgets/Code_Viewer.cxx b/fluid/widgets/Code_Viewer.cxx index 978ed178e..fc456ea74 100644 --- a/fluid/widgets/Code_Viewer.cxx +++ b/fluid/widgets/Code_Viewer.cxx @@ -26,11 +26,11 @@ /** - Create a fld::widget::Code_Viewer widget. + Create a Code_Viewer widget. \param[in] X, Y, W, H position and size of the widget \param[in] L optional label */ -fld::widget::Code_Viewer::Code_Viewer(int X, int Y, int W, int H, const char *L) +Code_Viewer::Code_Viewer(int X, int Y, int W, int H, const char *L) : Code_Editor(X, Y, W, H, L) { default_key_function(kf_ignore); @@ -41,7 +41,7 @@ fld::widget::Code_Viewer::Code_Viewer(int X, int Y, int W, int H, const char *L) /** Tricking Fl_Text_Display into using bearable colors for this specific task. */ -void fld::widget::Code_Viewer::draw() +void Code_Viewer::draw() { Fl_Color c = Fl::get_color(FL_SELECTION_COLOR); Fl::set_color(FL_SELECTION_COLOR, fl_color_average(FL_BACKGROUND_COLOR, FL_FOREGROUND_COLOR, 0.9f)); diff --git a/fluid/widgets/Code_Viewer.h b/fluid/widgets/Code_Viewer.h index a65a66f58..7c183f1d2 100644 --- a/fluid/widgets/Code_Viewer.h +++ b/fluid/widgets/Code_Viewer.h @@ -25,9 +25,6 @@ #include "widgets/Code_Editor.h" -namespace fld { -namespace widget { - /** A widget derived from Code_Editor with highlighting for code blocks. @@ -46,7 +43,4 @@ protected: int handle(int ev) { return Fl_Text_Display::handle(ev); } }; -} // namespace widget -} // namespace fld - #endif // FLUID_WIDGETS_CODE_VIEWER_H diff --git a/fluid/widgets/Formula_Input.cxx b/fluid/widgets/Formula_Input.cxx index 06f5e3672..c7daefc5e 100644 --- a/fluid/widgets/Formula_Input.cxx +++ b/fluid/widgets/Formula_Input.cxx @@ -26,7 +26,7 @@ -/** \class fld::widget::Formula_Input +/** \class Formula_Input The Formula_Input widget is an input field for entering widget coordinates and sizes. It includes basic math capabilities and allows the use of variables in formulas. This widget is useful for specifying precise positions and @@ -36,18 +36,18 @@ /** Create an input field. */ -fld::widget::Formula_Input::Formula_Input(int x, int y, int w, int h, const char *l) +Formula_Input::Formula_Input(int x, int y, int w, int h, const char *l) : Fl_Input(x, y, w, h, l) { Fl_Input::callback((Fl_Callback*)callback_handler_cb); text("0"); } -void fld::widget::Formula_Input::callback_handler_cb(Formula_Input *This, void *v) { +void Formula_Input::callback_handler_cb(Formula_Input *This, void *v) { This->callback_handler(v); } -void fld::widget::Formula_Input::callback_handler(void *v) { +void Formula_Input::callback_handler(void *v) { if (user_callback_) (*user_callback_)(this, v); // do *not* update the value to show the evaluated formula here, because the @@ -63,7 +63,7 @@ void fld::widget::Formula_Input::callback_handler(void *v) { the last character of the variable name when returning. \return the integer value that was found or calculated */ -int fld::widget::Formula_Input::eval_var(uchar *&s) const { +int Formula_Input::eval_var(uchar *&s) const { if (!vars_) return 0; // find the end of the variable name @@ -86,7 +86,7 @@ int fld::widget::Formula_Input::eval_var(uchar *&s) const { \param prio priority of current operation \return the value so far */ -int fld::widget::Formula_Input::eval(uchar *&s, int prio) const { +int Formula_Input::eval(uchar *&s, int prio) const { int v = 0, sgn = 1; uchar c = *s++; @@ -158,7 +158,7 @@ int fld::widget::Formula_Input::eval(uchar *&s, int prio) const { \param s formula as a C string \return the calculated value */ -int fld::widget::Formula_Input::eval(const char *s) const +int Formula_Input::eval(const char *s) const { // duplicate the text, so we can modify it uchar *buf = (uchar*)fl_strdup(s); @@ -180,14 +180,14 @@ int fld::widget::Formula_Input::eval(const char *s) const /** Evaluate the formula and return the result. */ -int fld::widget::Formula_Input::value() const { +int Formula_Input::value() const { return eval(text()); } /** Set the field to an integer value, replacing previous texts. */ -void fld::widget::Formula_Input::value(int v) { +void Formula_Input::value(int v) { char buf[32]; fl_snprintf(buf, sizeof(buf), "%d", v); text(buf); @@ -196,7 +196,7 @@ void fld::widget::Formula_Input::value(int v) { /** Allow vertical mouse dragging and mouse wheel to interactively change the value. */ -int fld::widget::Formula_Input::handle(int event) { +int Formula_Input::handle(int event) { switch (event) { case FL_MOUSEWHEEL: if (Fl::event_dy()) { @@ -212,7 +212,7 @@ int fld::widget::Formula_Input::handle(int event) { /** Set the list of the available variables \param vars array of variables, last entry `has name_` set to `0` \param user_data is forwarded to the Variable callback */ -void fld::widget::Formula_Input::variables(Formula_Input_Vars *vars, void *user_data) { +void Formula_Input::variables(Formula_Input_Vars *vars, void *user_data) { vars_ = vars; vars_user_data_ = user_data; } diff --git a/fluid/widgets/Formula_Input.h b/fluid/widgets/Formula_Input.h index 53321ff21..ebe46973d 100644 --- a/fluid/widgets/Formula_Input.h +++ b/fluid/widgets/Formula_Input.h @@ -19,9 +19,6 @@ #include <FL/Fl_Input.H> -namespace fld { -namespace widget { - class Formula_Input; // Callback signature for function returning the value of a variable. @@ -63,11 +60,8 @@ public: /** Set the general callback for this widget. */ void callback(Fl_Callback *cb) { user_callback_ = cb; } - void variables(fld::widget::Formula_Input_Vars *vars, void *user_data); + void variables(Formula_Input_Vars *vars, void *user_data); int handle(int); }; -} // namespace widget -} // namespace fld - #endif // FLUID_WIDGETS_FORMULA_INPUT_H diff --git a/fluid/widgets/Node_Browser.cxx b/fluid/widgets/Node_Browser.cxx index 7482298b5..4aa3660ab 100644 --- a/fluid/widgets/Node_Browser.cxx +++ b/fluid/widgets/Node_Browser.cxx @@ -28,7 +28,7 @@ // ---- global variables /// Global access to the widget browser. -fld::widget::Node_Browser *widget_browser = 0; +Node_Browser *widget_browser = 0; @@ -49,18 +49,18 @@ fld::widget::Node_Browser *widget_browser = 0; // ---- static variables -Fl_Color fld::widget::Node_Browser::label_color = 72; -Fl_Font fld::widget::Node_Browser::label_font = FL_HELVETICA; -Fl_Color fld::widget::Node_Browser::class_color = FL_FOREGROUND_COLOR; -Fl_Font fld::widget::Node_Browser::class_font = FL_HELVETICA_BOLD; -Fl_Color fld::widget::Node_Browser::func_color = FL_FOREGROUND_COLOR; -Fl_Font fld::widget::Node_Browser::func_font = FL_HELVETICA; -Fl_Color fld::widget::Node_Browser::name_color = FL_FOREGROUND_COLOR; -Fl_Font fld::widget::Node_Browser::name_font = FL_HELVETICA; -Fl_Color fld::widget::Node_Browser::code_color = FL_FOREGROUND_COLOR; -Fl_Font fld::widget::Node_Browser::code_font = FL_HELVETICA; -Fl_Color fld::widget::Node_Browser::comment_color = FL_DARK_GREEN; -Fl_Font fld::widget::Node_Browser::comment_font = FL_HELVETICA; +Fl_Color Node_Browser::label_color = 72; +Fl_Font Node_Browser::label_font = FL_HELVETICA; +Fl_Color Node_Browser::class_color = FL_FOREGROUND_COLOR; +Fl_Font Node_Browser::class_font = FL_HELVETICA_BOLD; +Fl_Color Node_Browser::func_color = FL_FOREGROUND_COLOR; +Fl_Font Node_Browser::func_font = FL_HELVETICA; +Fl_Color Node_Browser::name_color = FL_FOREGROUND_COLOR; +Fl_Font Node_Browser::name_font = FL_HELVETICA; +Fl_Color Node_Browser::code_color = FL_FOREGROUND_COLOR; +Fl_Font Node_Browser::code_font = FL_HELVETICA; +Fl_Color Node_Browser::comment_color = FL_DARK_GREEN; +Fl_Font Node_Browser::comment_font = FL_HELVETICA; // ---- global functions @@ -75,7 +75,7 @@ void redraw_browser() { Shortcut to create the widget browser. */ Fl_Widget *make_widget_browser(int x,int y,int w,int h) { - return (widget_browser = new fld::widget::Node_Browser(x,y,w,h)); + return (widget_browser = new Node_Browser(x,y,w,h)); } /** @@ -213,7 +213,7 @@ static char *copy_trunc(char *p, const char *str, int maxl, int quote, int trunc \todo It would be nice to be able to grab one or more nodes and move them within the hierarchy. */ -fld::widget::Node_Browser::Node_Browser(int X,int Y,int W,int H,const char*l) : +Node_Browser::Node_Browser(int X,int Y,int W,int H,const char*l) : Fl_Browser_(X,Y,W,H,l) { type(FL_MULTI_BROWSER); @@ -225,7 +225,7 @@ fld::widget::Node_Browser::Node_Browser(int X,int Y,int W,int H,const char*l) : Override the method to find the first item in the list of elements. \return the first item */ -void *fld::widget::Node_Browser::item_first() const { +void *Node_Browser::item_first() const { return Fluid.proj.tree.first; } @@ -234,7 +234,7 @@ void *fld::widget::Node_Browser::item_first() const { \param l this item \return the next item, irregardless of tree depth, or 0 at the end */ -void *fld::widget::Node_Browser::item_next(void *l) const { +void *Node_Browser::item_next(void *l) const { return ((Node*)l)->next; } @@ -243,7 +243,7 @@ void *fld::widget::Node_Browser::item_next(void *l) const { \param l this item \return the previous item, irregardless of tree depth, or 0 at the start */ -void *fld::widget::Node_Browser::item_prev(void *l) const { +void *Node_Browser::item_prev(void *l) const { return ((Node*)l)->prev; } @@ -253,7 +253,7 @@ void *fld::widget::Node_Browser::item_prev(void *l) const { \return 1 if selected, 0 if not \todo what is the difference between selected and new_selected, and why do we do this? */ -int fld::widget::Node_Browser::item_selected(void *l) const { +int Node_Browser::item_selected(void *l) const { return ((Node*)l)->new_selected; } @@ -262,7 +262,7 @@ int fld::widget::Node_Browser::item_selected(void *l) const { \param l this item \param[in] v 1 if selecting, 0 if not */ -void fld::widget::Node_Browser::item_select(void *l,int v) { +void Node_Browser::item_select(void *l,int v) { ((Node*)l)->new_selected = v; } @@ -271,7 +271,7 @@ void fld::widget::Node_Browser::item_select(void *l,int v) { \param l this item \return height in FLTK units (used to be pixels before high res screens) */ -int fld::widget::Node_Browser::item_height(void *l) const { +int Node_Browser::item_height(void *l) const { Node *t = (Node*)l; if (t->visible) { if (Fluid.show_comments && t->comment()) @@ -286,7 +286,7 @@ int fld::widget::Node_Browser::item_height(void *l) const { Override the method to return the estimated height of all items. \return height in FLTK units */ -int fld::widget::Node_Browser::incr_height() const { +int Node_Browser::incr_height() const { return textsize() + 5 + linespacing(); } @@ -311,7 +311,7 @@ int fld::widget::Node_Browser::incr_height() const { \param X,Y these give the position in window coordinates of the top left corner of this line */ -void fld::widget::Node_Browser::item_draw(void *v, int X, int Y, int, int) const { +void Node_Browser::item_draw(void *v, int X, int Y, int, int) const { // cast to a more general type Node *l = (Node *)v; @@ -455,7 +455,7 @@ void fld::widget::Node_Browser::item_draw(void *v, int X, int Y, int, int) const \param v this item \return width in FLTK units */ -int fld::widget::Node_Browser::item_width(void *v) const { +int Node_Browser::item_width(void *v) const { char buf[500]; // edit buffer: large enough to hold 80 UTF-8 chars + nul @@ -490,7 +490,7 @@ int fld::widget::Node_Browser::item_width(void *v) const { /** Callback to tell the Fluid UI when the list of selected items changed. */ -void fld::widget::Node_Browser::callback() { +void Node_Browser::callback() { selection_changed((Node*)selection()); } @@ -508,7 +508,7 @@ void fld::widget::Node_Browser::callback() { \param[in] e the incoming event type \return 0 if the event is not supported, and 1 if the event was "used up" */ -int fld::widget::Node_Browser::handle(int e) { +int Node_Browser::handle(int e) { static Node *title; Node *l; int X,Y,W,H; bbox(X,Y,W,H); @@ -576,7 +576,7 @@ int fld::widget::Node_Browser::handle(int e) { /** Save the current scrollbar position during rebuild. */ -void fld::widget::Node_Browser::save_scroll_position() { +void Node_Browser::save_scroll_position() { saved_h_scroll_ = hposition(); saved_v_scroll_ = vposition(); } @@ -584,7 +584,7 @@ void fld::widget::Node_Browser::save_scroll_position() { /** Restore the previous scrollbar position after rebuild. */ -void fld::widget::Node_Browser::restore_scroll_position() { +void Node_Browser::restore_scroll_position() { hposition(saved_h_scroll_); vposition(saved_v_scroll_); } @@ -594,7 +594,7 @@ void fld::widget::Node_Browser::restore_scroll_position() { This clears internal caches, recalculates the scroll bar sizes, and sends a redraw() request to the widget. */ -void fld::widget::Node_Browser::rebuild() { +void Node_Browser::rebuild() { save_scroll_position(); new_list(); damage(FL_DAMAGE_SCROLL); @@ -606,7 +606,7 @@ void fld::widget::Node_Browser::rebuild() { Rebuild the browser layout and make sure that the given item is visible. \param[in] inNode pointer to a widget node derived from Node. */ -void fld::widget::Node_Browser::display(Node *inNode) { +void Node_Browser::display(Node *inNode) { if (!inNode) { // Alternative: find the first (last?) visible selected item. return; @@ -640,7 +640,7 @@ void fld::widget::Node_Browser::display(Node *inNode) { vposition(newV); } -void fld::widget::Node_Browser::load_prefs() { +void Node_Browser::load_prefs() { int c; Fl_Preferences p(Fluid.preferences, "widget_browser"); p.get("label_color", c, 72); label_color = c; @@ -657,7 +657,7 @@ void fld::widget::Node_Browser::load_prefs() { p.get("comment_font", c, FL_HELVETICA); comment_font = c; } -void fld::widget::Node_Browser::save_prefs() { +void Node_Browser::save_prefs() { Fl_Preferences p(Fluid.preferences, "widget_browser"); p.set("label_color", (int)label_color); p.set("label_font", (int)label_font); diff --git a/fluid/widgets/Node_Browser.h b/fluid/widgets/Node_Browser.h index 5ca0ae566..aa7182575 100644 --- a/fluid/widgets/Node_Browser.h +++ b/fluid/widgets/Node_Browser.h @@ -21,9 +21,6 @@ class Node; -namespace fld { -namespace widget { - class Node_Browser : public Fl_Browser_ { friend class Node; @@ -73,9 +70,6 @@ public: static Fl_Font comment_font; }; -} // namespace widget -} // namespace fld - extern void redraw_browser(); extern Fl_Widget *make_widget_browser(int x,int y,int w,int h); extern void redraw_widget_browser(Node *caller); @@ -84,6 +78,6 @@ extern void select_only(Node *o); extern void deselect(); extern void reveal_in_browser(Node *t); -extern fld::widget::Node_Browser *widget_browser; +extern Node_Browser *widget_browser; #endif // FLUID_WIDGETS_NODE_BROWSER_H diff --git a/fluid/widgets/Style_Parser.cxx b/fluid/widgets/Style_Parser.cxx index 9188e565e..6af057ac6 100644 --- a/fluid/widgets/Style_Parser.cxx +++ b/fluid/widgets/Style_Parser.cxx @@ -130,7 +130,7 @@ static void* search_types(char *find) { // Applies the current style, advances to next text + style char. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_over_char(int handle_crlf) { +int Style_Parser::parse_over_char(int handle_crlf) { char c = *tbuff; // End of line? @@ -157,7 +157,7 @@ int fld::widget::Style_Parser::parse_over_char(int handle_crlf) { // Parse over white space using current style // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_over_white() { +int Style_Parser::parse_over_white() { while ( len > 0 && strchr(" \t", *tbuff)) { if ( !parse_over_char() ) return 0; } return 1; @@ -166,7 +166,7 @@ int fld::widget::Style_Parser::parse_over_white() { // Parse over non-white alphabetic text // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_over_alpha() { +int Style_Parser::parse_over_alpha() { while ( len > 0 && isalpha(*tbuff) ) { if ( !parse_over_char() ) return 0; } return 1; @@ -175,7 +175,7 @@ int fld::widget::Style_Parser::parse_over_alpha() { // Parse to end of line in specified style. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_to_eol(char s) { +int Style_Parser::parse_to_eol(char s) { char save = style; style = s; while ( *tbuff != '\n' ) @@ -187,7 +187,7 @@ int fld::widget::Style_Parser::parse_to_eol(char s) { // Parse a block comment until end of comment or buffer. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_block_comment() { +int Style_Parser::parse_block_comment() { char save = style; style = 'C'; // block comment style while ( len > 0 ) { @@ -203,7 +203,7 @@ int fld::widget::Style_Parser::parse_block_comment() { } // Copy keyword from tbuff -> keyword[] buffer -void fld::widget::Style_Parser::buffer_keyword() { +void Style_Parser::buffer_keyword() { char *key = keyword; char *kend = key + sizeof(keyword) - 1; // end of buffer const char *s; @@ -216,7 +216,7 @@ void fld::widget::Style_Parser::buffer_keyword() { // Parse over specified 'key'word in specified style 's'. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_over_key(const char *key, char s) { +int Style_Parser::parse_over_key(const char *key, char s) { char save = style; style = s; // Parse over the keyword while applying style to sbuff @@ -230,7 +230,7 @@ int fld::widget::Style_Parser::parse_over_key(const char *key, char s) { // Parse over angle brackets <..> in specified style. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_over_angles(char s) { +int Style_Parser::parse_over_angles(char s) { if ( *tbuff != '<' ) return 1; // not <..>, early exit char save = style; style = s; @@ -246,7 +246,7 @@ int fld::widget::Style_Parser::parse_over_angles(char s) { // spi.keyword[] will contain parsed word. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_keyword() { +int Style_Parser::parse_keyword() { // Parse into 'keyword' buffer buffer_keyword(); char *key = keyword; @@ -263,7 +263,7 @@ int fld::widget::Style_Parser::parse_keyword() { // Style parse a quoted string, either "" or ''. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_quoted_string(char quote_char, // e.g. '"' or '\'' +int Style_Parser::parse_quoted_string(char quote_char, // e.g. '"' or '\'' char in_style) { // style for quoted text style = in_style; // start string style if ( !parse_over_char() ) return 0; // parse over opening quote @@ -290,7 +290,7 @@ int fld::widget::Style_Parser::parse_quoted_string(char quote_char, // e.g. '"' // Style parse a directive (#include, #define..) // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_directive() { +int Style_Parser::parse_directive() { style = 'E'; // start directive style if ( !parse_over_char() ) return 0; // Parse over '#' if ( !parse_over_white() ) return 0; // Parse over any whitespace after '#' @@ -304,7 +304,7 @@ int fld::widget::Style_Parser::parse_directive() { // Style parse a line comment to end of line. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_line_comment() { +int Style_Parser::parse_line_comment() { return parse_to_eol('B'); } @@ -313,7 +313,7 @@ int fld::widget::Style_Parser::parse_line_comment() { // a continuation of a line, such as in a multiline #directive. // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_escape() { +int Style_Parser::parse_escape() { const char no_crlf = 0; if ( !parse_over_char(no_crlf) ) return 0; // backslash if ( !parse_over_char(no_crlf) ) return 0; // char escaped @@ -323,7 +323,7 @@ int fld::widget::Style_Parser::parse_escape() { // Parse all other non-specific characters // Returns 0 if hit end of buffer, 1 otherwise. // -int fld::widget::Style_Parser::parse_all_else() { +int Style_Parser::parse_all_else() { last = isalnum(*tbuff) || *tbuff == '_' || *tbuff == '.'; return parse_over_char(); } diff --git a/fluid/widgets/Style_Parser.h b/fluid/widgets/Style_Parser.h index fff38c529..7e054b856 100644 --- a/fluid/widgets/Style_Parser.h +++ b/fluid/widgets/Style_Parser.h @@ -18,9 +18,6 @@ #ifndef FLUID_WIDGETS_STYLE_PARSER_H #define FLUID_WIDGETS_STYLE_PARSER_H -namespace fld { -namespace widget { - // Class to manage style parsing, friend of Code_Editor class Style_Parser { public: @@ -53,7 +50,4 @@ public: int parse_all_else(); // all other code }; -} // namespace widget -} // namespace fld - #endif // FLUID_WIDGETS_STYLE_PARSER_H diff --git a/fluid/widgets/Text_Viewer.cxx b/fluid/widgets/Text_Viewer.cxx index 3cd89d4d8..f1e0bcdbb 100644 --- a/fluid/widgets/Text_Viewer.cxx +++ b/fluid/widgets/Text_Viewer.cxx @@ -24,11 +24,11 @@ /** - Create a fld::widget::Text_Viewer widget. + Create a Text_Viewer widget. \param[in] X, Y, W, H position and size of the widget \param[in] L optional label */ -fld::widget::Text_Viewer::Text_Viewer(int X, int Y, int W, int H, const char *L) +Text_Viewer::Text_Viewer(int X, int Y, int W, int H, const char *L) : Fl_Text_Display(X, Y, W, H, L) { buffer(new Fl_Text_Buffer); @@ -37,7 +37,7 @@ fld::widget::Text_Viewer::Text_Viewer(int X, int Y, int W, int H, const char *L) /** Avoid memory leaks. */ -fld::widget::Text_Viewer::~Text_Viewer() { +Text_Viewer::~Text_Viewer() { Fl_Text_Buffer *buf = mBuffer; buffer(0); delete buf; @@ -46,7 +46,7 @@ fld::widget::Text_Viewer::~Text_Viewer() { /** Tricking Fl_Text_Display into using bearable colors for this specific task. */ -void fld::widget::Text_Viewer::draw() +void Text_Viewer::draw() { Fl_Color c = Fl::get_color(FL_SELECTION_COLOR); Fl::set_color(FL_SELECTION_COLOR, fl_color_average(FL_BACKGROUND_COLOR, FL_FOREGROUND_COLOR, 0.9f)); diff --git a/fluid/widgets/Text_Viewer.h b/fluid/widgets/Text_Viewer.h index dac23e855..ff2a04771 100644 --- a/fluid/widgets/Text_Viewer.h +++ b/fluid/widgets/Text_Viewer.h @@ -23,9 +23,6 @@ #include <FL/Fl_Text_Display.H> -namespace fld { -namespace widget { - /** A text viewer with an additional highlighting color scheme. */ @@ -39,7 +36,4 @@ public: int top_line() { return get_absolute_top_line_number(); } }; -} // namespace widget -} // namespace fld - #endif // FLUID_WIDGETS_TEXT_VIEWER_H diff --git a/lib/libfltk.a b/lib/libfltk.a Binary files differindex 9c6174ab2..b1e7b1bce 100644 --- a/lib/libfltk.a +++ b/lib/libfltk.a diff --git a/lib/libfltk_forms.a b/lib/libfltk_forms.a Binary files differindex d7cfbf6f2..56a57f213 100644 --- a/lib/libfltk_forms.a +++ b/lib/libfltk_forms.a diff --git a/lib/libfltk_gl.a b/lib/libfltk_gl.a Binary files differindex 3c508cb29..0f94b4c7d 100644 --- a/lib/libfltk_gl.a +++ b/lib/libfltk_gl.a diff --git a/lib/libfltk_images.a b/lib/libfltk_images.a Binary files differindex cca36a01d..1c4f76ad8 100644 --- a/lib/libfltk_images.a +++ b/lib/libfltk_images.a diff --git a/lib/libfltk_jpeg.a b/lib/libfltk_jpeg.a Binary files differindex 93154edd0..78678caa4 100644 --- a/lib/libfltk_jpeg.a +++ b/lib/libfltk_jpeg.a diff --git a/lib/libfltk_png.a b/lib/libfltk_png.a Binary files differindex be74ef7da..0de9c641d 100644 --- a/lib/libfltk_png.a +++ b/lib/libfltk_png.a diff --git a/lib/libfltk_z.a b/lib/libfltk_z.a Binary files differindex 1c06eabbd..be5dcbf27 100644 --- a/lib/libfltk_z.a +++ b/lib/libfltk_z.a diff --git a/src/Fl_Cairo.cxx b/src/Fl_Cairo.cxx index d35546a16..61a4a2d60 100644 --- a/src/Fl_Cairo.cxx +++ b/src/Fl_Cairo.cxx @@ -196,7 +196,7 @@ cairo_t *Fl_Private_cairo_make_current(void *gc, int W, int H) { \see Fl::cairo_autolink_context(bool) \see Fl::cairo_make_current(Fl_Window*); */ -FL_EXPORT extern void Fl::cairo_flush(cairo_t *c) { +void Fl::cairo_flush(cairo_t *c) { // flush Cairo drawings cairo_surface_t *s = cairo_get_target(c); cairo_surface_flush(s); diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index acddc4e91..996cb3acd 100644 --- a/src/Fl_Menu.cxx +++ b/src/Fl_Menu.cxx @@ -1594,7 +1594,8 @@ const Fl_Menu_Item* Fl_Menu_Item::popup( */ const Fl_Menu_Item* Fl_Menu_Item::find_shortcut(int* ip, const bool require_alt) const { const Fl_Menu_Item* m = this; - if (m) for (int ii = 0; m->text; m = next_visible_or_not(m), ii++) { + int ii; + if (m) for (ii = 0; m->text; m = next_visible_or_not(m), ii++) { if (m->active()) { if (Fl::test_shortcut(m->shortcut_) || (!is_special_labeltype(m->labeltype_) && Fl_Widget::test_shortcut(m->text, require_alt)) diff --git a/src/Fl_Private.H b/src/Fl_Private.H index c4cfdcef5..a4ba9d6e6 100644 --- a/src/Fl_Private.H +++ b/src/Fl_Private.H @@ -26,7 +26,7 @@ /* FLTK private global variables and functions. - All prefixed with Fl_Private_ instead of using namespace. + All prefixed with Fl_Private_ to keep them separate from the Fl class. */ FL_EXPORT extern int Fl_Private_use_high_res_GL_; diff --git a/src/Fl_Text_Buffer.cxx b/src/Fl_Text_Buffer.cxx index 8411342d1..3924fbbac 100644 --- a/src/Fl_Text_Buffer.cxx +++ b/src/Fl_Text_Buffer.cxx @@ -2058,7 +2058,8 @@ int Fl_Text_Buffer::outputfile(const char *file, FILE *fp; if (!(fp = fl_fopen(file, "w"))) return 1; - for (int n; (n = min(end - start, buflen)); start += n) { + int n; + for (; (n = min(end - start, buflen)); start += n) { const char *p = text_range(start, start + n); int r = (int) fwrite(p, 1, n, fp); free((void *) p); diff --git a/src/Fl_Widget.cxx b/src/Fl_Widget.cxx index aba540802..94dd2f9b5 100644 --- a/src/Fl_Widget.cxx +++ b/src/Fl_Widget.cxx @@ -165,7 +165,7 @@ Fl_Widget *Fl::readqueue() { specific widget from the default callback queue (Fl::readqueue()). It is only called from Fl_Widget's destructor if the widget doesn't have an own callback. - Note: There's no need to have this in the Fl:: namespace. + Note: There's no need to have this in the Fl class. */ static void cleanup_readqueue(Fl_Widget *w) { diff --git a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx index 62f89c38c..1f5607a6b 100644 --- a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx +++ b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx @@ -653,7 +653,8 @@ void Fl_Cairo_Graphics_Driver::draw_image(Fl_Draw_Image_Cb call, void *data, int int l; for (l = 0; l < ih; l++) { call(data, 0, l, iw, array + l*D*iw); - if (D%2 == 0) for (int i = 0; i < iw; i++) { + int i; + if (D%2 == 0) for (i = 0; i < iw; i++) { *(array + l*D*iw + i*D + D-1) = 0xff; } } diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx index 92b0e0ef6..f87a438d8 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx @@ -962,7 +962,8 @@ Fl_Xlib_Font_Descriptor::~Fl_Xlib_Font_Descriptor() { if (this == fl_graphics_driver->font_descriptor()) fl_graphics_driver->font_descriptor(NULL); // XftFontClose(fl_display, font); #if USE_PANGO - if (width) for (int i = 0; i < 64; i++) delete[] width[i]; + int i; + if (width) for (i = 0; i < 64; i++) delete[] width[i]; delete[] width; #endif } diff --git a/src/filename_absolute.cxx b/src/filename_absolute.cxx index 4573a34c1..b02df25f0 100644 --- a/src/filename_absolute.cxx +++ b/src/filename_absolute.cxx @@ -125,7 +125,7 @@ int Fl_System_Driver::filename_absolute(char *to, int tolen, const char *from, c /** Makes a filename relative to the current working directory. Return the \a from path made relative to the working directory, similar to - C++17 `std::filesystem::path::lexically_relative`. This function can also be + This function makes a path relative to the working directory. It can also be called with a fourth argument for a user supplied \a base directory path These conversions are purely lexical. They do not check that the paths exist, @@ -164,10 +164,6 @@ int Fl_System_Driver::filename_absolute(char *to, int tolen, const char *from, c \param[in] from absolute filename \return 0 if no change, non zero otherwise \see fl_filename_relative(char *to, int tolen, const char *from, const char *base) - <!-- FIXME: added in 1.5 or higher ... - \see fl_filename_relative(const std::string &from, const std::string &base) - \see fl_filename_relative(const std::string &from) - --> */ int fl_filename_relative(char *to, int tolen, const char *from) { diff --git a/src/filename_ext.cxx b/src/filename_ext.cxx index a4d86937b..3f5ffa0cb 100644 --- a/src/filename_ext.cxx +++ b/src/filename_ext.cxx @@ -29,7 +29,6 @@ \return a pointer to the extension (including '.') if one was found, or a pointer to the terminating NUL character (effectively a pointer to an empty string) if no extension was found. - \see fl_filename_ext_str(const std::string &filename) */ const char *fl_filename_ext(const char *buf) { return Fl::system_driver()->filename_ext(buf); diff --git a/src/fl_boxtype.cxx b/src/fl_boxtype.cxx index fe2dba385..d179aa2a3 100644 --- a/src/fl_boxtype.cxx +++ b/src/fl_boxtype.cxx @@ -542,7 +542,7 @@ int Fl::box_dh(Fl_Boxtype t) {return fl_box_table[t].dh;} false if it is at least partially transparent. \since 1.5.0 */ -extern bool Fl::box_bg(Fl_Boxtype bt) { +bool Fl::box_bg(Fl_Boxtype bt) { return fl_box_table[bt].bg(); } diff --git a/src/gl_draw.cxx b/src/gl_draw.cxx index 95436a610..931847da6 100644 --- a/src/gl_draw.cxx +++ b/src/gl_draw.cxx @@ -523,7 +523,8 @@ void Fl_Gl_Window_Driver::draw_string_with_texture(const char* str, int n) gl_scale = (gwin ? gwin->pixels_per_unit() : 1); if (!gl_fifo) gl_fifo = new gl_texture_fifo(); if (!gl_fifo->textures_generated) { - if (has_texture_rectangle) for (int i = 0; i < gl_fifo->size_; i++) glGenTextures(1, &(gl_fifo->fifo[i].texName)); + int i; + if (has_texture_rectangle) for (i = 0; i < gl_fifo->size_; i++) glGenTextures(1, &(gl_fifo->fifo[i].texName)); gl_fifo->textures_generated = 1; } int index = gl_fifo->already_known(str, n); |
