2021-12-08 17:52:15 +03:00
|
|
|
//
|
|
|
|
// FLUID main entry for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2023-03-18 19:33:27 +03:00
|
|
|
// Copyright 1998-2023 by Bill Spitzak and others.
|
2021-12-08 17:52:15 +03:00
|
|
|
//
|
|
|
|
// This library is free software. Distribution and use rights are outlined in
|
|
|
|
// the file "COPYING" which should have been included with this file. If this
|
|
|
|
// file is missing or damaged, see the license at:
|
|
|
|
//
|
|
|
|
// https://www.fltk.org/COPYING.php
|
|
|
|
//
|
|
|
|
// Please see the following page on how to report bugs and issues:
|
|
|
|
//
|
|
|
|
// https://www.fltk.org/bugs.php
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef _FLUID_FLUID_H
|
|
|
|
#define _FLUID_FLUID_H
|
|
|
|
|
|
|
|
#include <FL/filename.H>
|
|
|
|
#include <FL/Fl_Preferences.H>
|
|
|
|
#include <FL/Fl_Menu_Item.H>
|
2022-11-26 03:35:50 +03:00
|
|
|
#include <FL/Fl_String.H>
|
2021-12-08 17:52:15 +03:00
|
|
|
|
|
|
|
#define BROWSERWIDTH 300
|
|
|
|
#define BROWSERHEIGHT 500
|
|
|
|
#define WINWIDTH 300
|
|
|
|
#define MENUHEIGHT 25
|
|
|
|
#define WINHEIGHT (BROWSERHEIGHT+MENUHEIGHT)
|
|
|
|
|
|
|
|
class Fl_Double_Window;
|
|
|
|
class Fl_Window;
|
|
|
|
class Fl_Menu_Bar;
|
|
|
|
class Fl_Type;
|
|
|
|
class Fl_Choice;
|
|
|
|
class Fl_Button;
|
|
|
|
|
|
|
|
extern int force_parent;
|
|
|
|
|
|
|
|
extern Fl_Preferences fluid_prefs;
|
|
|
|
extern Fl_Menu_Item Main_Menu[];
|
|
|
|
extern Fl_Menu_Bar *main_menubar;
|
|
|
|
extern Fl_Window *main_window;
|
|
|
|
|
|
|
|
extern int show_guides;
|
|
|
|
extern int show_comments;
|
|
|
|
|
|
|
|
extern int G_use_external_editor;
|
|
|
|
extern int G_debug;
|
|
|
|
extern char G_external_editor_command[512];
|
|
|
|
|
|
|
|
extern int reading_file;
|
|
|
|
|
|
|
|
// File history info...
|
|
|
|
extern char absolute_history[10][FL_PATH_MAX];
|
|
|
|
extern char relative_history[10][FL_PATH_MAX];
|
|
|
|
extern void load_history();
|
|
|
|
extern void update_history(const char *);
|
|
|
|
|
|
|
|
extern Fl_Menu_Item *save_item;
|
|
|
|
extern Fl_Menu_Item *history_item;
|
|
|
|
extern Fl_Menu_Item *widgetbin_item;
|
|
|
|
extern Fl_Menu_Item *sourceview_item;
|
2021-12-08 22:52:33 +03:00
|
|
|
extern Fl_Menu_Item *overlay_item;
|
2023-03-18 19:33:27 +03:00
|
|
|
extern Fl_Button *overlay_button;
|
|
|
|
extern Fl_Menu_Item *guides_item;
|
|
|
|
extern Fl_Button *guides_button;
|
2021-12-08 17:52:15 +03:00
|
|
|
|
|
|
|
extern int modflag;
|
|
|
|
|
2022-11-15 19:48:06 +03:00
|
|
|
extern void enter_project_dir();
|
|
|
|
extern void leave_project_dir();
|
2021-12-08 17:52:15 +03:00
|
|
|
|
|
|
|
extern int update_file; // fluid -u
|
|
|
|
extern int compile_file; // fluid -c
|
|
|
|
extern int compile_strings; // fluic -cs
|
|
|
|
extern int batch_mode;
|
|
|
|
|
2023-03-18 19:33:27 +03:00
|
|
|
extern int pasteoffset;
|
2021-12-08 17:52:15 +03:00
|
|
|
extern int pasteoffset;
|
|
|
|
|
2022-11-26 03:35:50 +03:00
|
|
|
// ---- project settings
|
|
|
|
|
2023-01-01 22:05:42 +03:00
|
|
|
class Fluid_Project {
|
2022-11-26 03:35:50 +03:00
|
|
|
public:
|
2023-01-01 22:05:42 +03:00
|
|
|
Fluid_Project();
|
|
|
|
~Fluid_Project();
|
2022-11-26 03:35:50 +03:00
|
|
|
void reset();
|
2023-03-19 22:04:01 +03:00
|
|
|
void update_settings_dialog();
|
2022-11-26 03:35:50 +03:00
|
|
|
|
|
|
|
int i18n_type;
|
2023-02-23 17:42:05 +03:00
|
|
|
Fl_String i18n_include;
|
|
|
|
Fl_String i18n_conditional;
|
|
|
|
Fl_String i18n_function;
|
|
|
|
Fl_String i18n_static_function;
|
|
|
|
Fl_String i18n_file;
|
|
|
|
Fl_String i18n_set;
|
|
|
|
Fl_String i18n_program;
|
2022-11-26 03:35:50 +03:00
|
|
|
int include_H_from_C;
|
|
|
|
int use_FL_COMMAND;
|
|
|
|
int utf8_in_src;
|
|
|
|
int avoid_early_includes;
|
2022-11-26 21:09:12 +03:00
|
|
|
int header_file_set;
|
|
|
|
int code_file_set;
|
2023-02-23 17:42:05 +03:00
|
|
|
Fl_String header_file_name;
|
|
|
|
Fl_String code_file_name;
|
2022-11-26 03:35:50 +03:00
|
|
|
};
|
|
|
|
|
2023-01-01 22:05:42 +03:00
|
|
|
extern Fluid_Project g_project;
|
2022-11-26 03:35:50 +03:00
|
|
|
|
2023-02-23 17:42:05 +03:00
|
|
|
extern Fl_String g_code_filename_arg;
|
|
|
|
extern Fl_String g_header_filename_arg;
|
2022-11-29 02:04:47 +03:00
|
|
|
|
2021-12-08 17:52:15 +03:00
|
|
|
// ---- public functions
|
|
|
|
|
|
|
|
extern void set_filename(const char *c);
|
2021-12-10 03:22:15 +03:00
|
|
|
extern void set_modflag(int mf, int mfc=-1);
|
2021-12-08 17:52:15 +03:00
|
|
|
|
|
|
|
// ---- public callback functions
|
|
|
|
|
|
|
|
extern void save_cb(Fl_Widget *, void *v);
|
|
|
|
extern void save_template_cb(Fl_Widget *, void *);
|
|
|
|
extern void revert_cb(Fl_Widget *,void *);
|
|
|
|
extern void exit_cb(Fl_Widget *,void *);
|
|
|
|
|
|
|
|
#ifdef __APPLE__
|
|
|
|
extern void apple_open_cb(const char *c);
|
|
|
|
#endif // __APPLE__
|
|
|
|
|
|
|
|
extern void open_cb(Fl_Widget *, void *v);
|
|
|
|
extern void open_history_cb(Fl_Widget *, void *v);
|
|
|
|
extern void new_cb(Fl_Widget *, void *v);
|
|
|
|
extern void new_from_template_cb(Fl_Widget *w, void *v);
|
|
|
|
|
|
|
|
extern int write_code_files();
|
|
|
|
extern void write_strings_cb(Fl_Widget *, void *);
|
|
|
|
extern void align_widget_cb(Fl_Widget *, long);
|
|
|
|
extern void toggle_widgetbin_cb(Fl_Widget *, void *);
|
|
|
|
|
2023-03-18 19:33:27 +03:00
|
|
|
inline int fd_min(int a, int b) { return (a < b ? a : b); }
|
|
|
|
inline int fd_min(int a, int b, int c) { return fd_min(a, fd_min(b, c)); }
|
|
|
|
|
2021-12-08 17:52:15 +03:00
|
|
|
#endif // _FLUID_FLUID_H
|