diff options
| author | maxim nikonov <maxim.nikonov@hqo.co> | 2026-02-06 19:04:24 +0500 |
|---|---|---|
| committer | maxim nikonov <maxim.nikonov@hqo.co> | 2026-02-06 19:04:24 +0500 |
| commit | 793fa5a91f24358aa7ce21abf6ee4e93a17b04ee (patch) | |
| tree | e81d1e60ffdf068ac1e93e8d36d9c2046b2d7c50 /fluid/widgets | |
| parent | b4995f979d127cea667b4e2b71c91e9db4ab52ef (diff) | |
wip
Diffstat (limited to 'fluid/widgets')
| -rw-r--r-- | fluid/widgets/App_Menu_Bar.cxx | 6 | ||||
| -rw-r--r-- | fluid/widgets/App_Menu_Bar.h | 6 | ||||
| -rw-r--r-- | fluid/widgets/Bin_Button.cxx | 8 | ||||
| -rw-r--r-- | fluid/widgets/Bin_Button.h | 6 | ||||
| -rw-r--r-- | fluid/widgets/Code_Editor.cxx | 16 | ||||
| -rw-r--r-- | fluid/widgets/Code_Editor.h | 5 | ||||
| -rw-r--r-- | fluid/widgets/Code_Viewer.cxx | 6 | ||||
| -rw-r--r-- | fluid/widgets/Code_Viewer.h | 6 | ||||
| -rw-r--r-- | fluid/widgets/Formula_Input.cxx | 22 | ||||
| -rw-r--r-- | fluid/widgets/Formula_Input.h | 8 | ||||
| -rw-r--r-- | fluid/widgets/Node_Browser.cxx | 64 | ||||
| -rw-r--r-- | fluid/widgets/Node_Browser.h | 8 | ||||
| -rw-r--r-- | fluid/widgets/Style_Parser.cxx | 28 | ||||
| -rw-r--r-- | fluid/widgets/Style_Parser.h | 6 | ||||
| -rw-r--r-- | fluid/widgets/Text_Viewer.cxx | 8 | ||||
| -rw-r--r-- | fluid/widgets/Text_Viewer.h | 6 |
16 files changed, 81 insertions, 128 deletions
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 |
