From 756da05c384e3d9258fc07cf9441d899238503f1 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 3 Jan 2021 11:50:41 +0100 Subject: Add dggui namespace to libdggui components. --- dggui/button.cc | 4 +- dggui/button.h | 5 +- dggui/button_base.cc | 5 +- dggui/button_base.h | 5 +- dggui/canvas.h | 4 +- dggui/checkbox.cc | 4 +- dggui/checkbox.h | 5 +- dggui/colour.cc | 4 +- dggui/colour.h | 4 +- dggui/combobox.cc | 4 +- dggui/combobox.h | 4 +- dggui/dialog.cc | 4 +- dggui/dialog.h | 4 +- dggui/drawable.h | 4 +- dggui/eventhandler.cc | 4 +- dggui/eventhandler.h | 4 +- dggui/font.cc | 4 +- dggui/font.h | 5 +- dggui/frame.cc | 4 +- dggui/frame.h | 20 ++++---- dggui/guievent.h | 4 +- dggui/helpbutton.cc | 4 +- dggui/helpbutton.h | 4 +- dggui/image.cc | 4 +- dggui/image.h | 5 +- dggui/imagecache.cc | 4 +- dggui/imagecache.h | 4 +- dggui/knob.cc | 4 +- dggui/knob.h | 5 +- dggui/label.cc | 5 +- dggui/label.h | 5 +- dggui/layout.cc | 4 +- dggui/layout.h | 4 +- dggui/led.cc | 5 +- dggui/led.h | 5 +- dggui/lineedit.cc | 5 +- dggui/lineedit.h | 4 +- dggui/listbox.cc | 5 +- dggui/listbox.h | 4 +- dggui/listboxbasic.cc | 5 +- dggui/listboxbasic.h | 9 ++-- dggui/listboxthin.cc | 4 +- dggui/listboxthin.h | 6 +-- dggui/nativewindow.h | 4 +- dggui/nativewindow_cocoa.h | 4 +- dggui/nativewindow_cocoa.mm | 112 ++++++++++++++++++++++---------------------- dggui/nativewindow_pugl.cc | 4 +- dggui/nativewindow_pugl.h | 4 +- dggui/nativewindow_win32.cc | 4 +- dggui/nativewindow_win32.h | 5 +- dggui/nativewindow_x11.cc | 4 +- dggui/nativewindow_x11.h | 4 +- dggui/painter.cc | 4 +- dggui/painter.h | 4 +- dggui/pixelbuffer.cc | 4 +- dggui/pixelbuffer.h | 4 +- dggui/powerbutton.cc | 4 +- dggui/powerbutton.h | 4 +- dggui/progressbar.cc | 4 +- dggui/progressbar.h | 4 +- dggui/resource.cc | 4 +- dggui/resource.h | 8 ++-- dggui/resource_data.h | 5 +- dggui/scrollbar.cc | 5 +- dggui/scrollbar.h | 9 ++-- dggui/slider.cc | 4 +- dggui/slider.h | 4 +- dggui/stackedwidget.cc | 4 +- dggui/stackedwidget.h | 4 +- dggui/tabbutton.cc | 4 +- dggui/tabbutton.h | 4 +- dggui/tabwidget.cc | 4 +- dggui/tabwidget.h | 4 +- dggui/textedit.cc | 4 +- dggui/textedit.h | 4 +- dggui/texture.cc | 4 +- dggui/texture.h | 4 +- dggui/texturedbox.cc | 4 +- dggui/texturedbox.h | 4 +- dggui/toggle.cc | 4 +- dggui/toggle.h | 4 +- dggui/tooltip.cc | 4 +- dggui/tooltip.h | 4 +- dggui/uitranslation.cc | 6 ++- dggui/uitranslation.h | 5 ++ dggui/utf8.cc | 5 ++ dggui/utf8.h | 5 ++ dggui/verticalline.cc | 5 +- dggui/verticalline.h | 9 ++-- dggui/widget.cc | 4 +- dggui/widget.h | 4 +- dggui/window.cc | 4 +- dggui/window.h | 4 +- 93 files changed, 294 insertions(+), 246 deletions(-) (limited to 'dggui') diff --git a/dggui/button.cc b/dggui/button.cc index 30bda82..39e9eaa 100644 --- a/dggui/button.cc +++ b/dggui/button.cc @@ -31,7 +31,7 @@ #include #include -namespace GUI +namespace dggui { Button::Button(Widget* parent) @@ -85,4 +85,4 @@ void Button::repaintEvent(RepaintEvent* repaintEvent) p.drawText(x, y, font, text, enabled); } -} // GUI:: +} // dggui:: diff --git a/dggui/button.h b/dggui/button.h index 52f22e2..f1b6584 100644 --- a/dggui/button.h +++ b/dggui/button.h @@ -30,7 +30,8 @@ #include "font.h" #include "texturedbox.h" -namespace GUI { +namespace dggui +{ class Button : public ButtonBase { @@ -61,4 +62,4 @@ private: Font font{":resources/fontemboss.png"}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/button_base.cc b/dggui/button_base.cc index bf441f5..4625b55 100644 --- a/dggui/button_base.cc +++ b/dggui/button_base.cc @@ -26,7 +26,8 @@ */ #include "button_base.h" -namespace GUI { +namespace dggui +{ ButtonBase::ButtonBase(Widget *parent) : Widget(parent) @@ -113,4 +114,4 @@ void ButtonBase::mouseEnterEvent() } } -} // GUI:: +} // dggui:: diff --git a/dggui/button_base.h b/dggui/button_base.h index c872d9b..72f693b 100644 --- a/dggui/button_base.h +++ b/dggui/button_base.h @@ -32,7 +32,8 @@ #include "widget.h" -namespace GUI { +namespace dggui +{ class ButtonBase : public Widget @@ -75,4 +76,4 @@ protected: State button_state{State::Up}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/canvas.h b/dggui/canvas.h index d6e8f99..1b0b5b2 100644 --- a/dggui/canvas.h +++ b/dggui/canvas.h @@ -28,7 +28,7 @@ #include "pixelbuffer.h" -namespace GUI +namespace dggui { //! Abstract class that can be used by the Painter to draw on. @@ -41,4 +41,4 @@ public: virtual PixelBufferAlpha& getPixelBuffer() = 0; }; -} // GUI:: +} // dggui:: diff --git a/dggui/checkbox.cc b/dggui/checkbox.cc index f3601bd..8911862 100644 --- a/dggui/checkbox.cc +++ b/dggui/checkbox.cc @@ -28,7 +28,7 @@ #include "painter.h" -namespace GUI +namespace dggui { CheckBox::CheckBox(Widget* parent) @@ -61,4 +61,4 @@ void CheckBox::repaintEvent(RepaintEvent* repaintEvent) } } -} // GUI:: +} // dggui:: diff --git a/dggui/checkbox.h b/dggui/checkbox.h index 6627304..1a323b6 100644 --- a/dggui/checkbox.h +++ b/dggui/checkbox.h @@ -29,7 +29,8 @@ #include "toggle.h" #include "texture.h" -namespace GUI { +namespace dggui +{ class CheckBox : public Toggle { public: @@ -46,4 +47,4 @@ private: Texture knob; }; -} // GUI:: +} // dggui:: diff --git a/dggui/colour.cc b/dggui/colour.cc index 7fd649c..6d510f9 100644 --- a/dggui/colour.cc +++ b/dggui/colour.cc @@ -28,7 +28,7 @@ #include -namespace GUI +namespace dggui { Colour::Colour() @@ -79,4 +79,4 @@ bool Colour::operator!=(const Colour& other) const return !(*this == other); } -} // GUI:: +} // dggui:: diff --git a/dggui/colour.h b/dggui/colour.h index 0bc8659..aea286c 100644 --- a/dggui/colour.h +++ b/dggui/colour.h @@ -29,7 +29,7 @@ #include #include -namespace GUI +namespace dggui { class Colour @@ -58,4 +58,4 @@ private: std::array pixel{{255, 255, 255, 255}}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/combobox.cc b/dggui/combobox.cc index aa2058e..33765e2 100644 --- a/dggui/combobox.cc +++ b/dggui/combobox.cc @@ -33,7 +33,7 @@ #define BORDER 10 -namespace GUI +namespace dggui { void ComboBox::listboxSelectHandler() @@ -231,4 +231,4 @@ void ComboBox::buttonEvent(ButtonEvent* buttonEvent) listbox.setVisible(!listbox.visible()); } -} // GUI:: +} // dggui:: diff --git a/dggui/combobox.h b/dggui/combobox.h index 778d54c..a3ef8ac 100644 --- a/dggui/combobox.h +++ b/dggui/combobox.h @@ -35,7 +35,7 @@ #include "painter.h" #include "texturedbox.h" -namespace GUI +namespace dggui { class ComboBox @@ -73,4 +73,4 @@ private: ListBoxThin listbox; }; -} // GUI:: +} // dggui:: diff --git a/dggui/dialog.cc b/dggui/dialog.cc index 9ba579d..74d9200 100644 --- a/dggui/dialog.cc +++ b/dggui/dialog.cc @@ -26,7 +26,7 @@ */ #include "dialog.h" -namespace GUI +namespace dggui { Dialog::Dialog(Widget* parent, bool modal) @@ -51,4 +51,4 @@ bool Dialog::isModal() const return is_modal; } -} // GUI:: +} // dggui:: diff --git a/dggui/dialog.h b/dggui/dialog.h index 1b0c6da..a9911c5 100644 --- a/dggui/dialog.h +++ b/dggui/dialog.h @@ -28,7 +28,7 @@ #include "window.h" -namespace GUI +namespace dggui { //! This class is used the base window for pop-up dialogs, such as a file @@ -60,4 +60,4 @@ private: Widget* parent{nullptr}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/drawable.h b/dggui/drawable.h index 95492d6..84e33db 100644 --- a/dggui/drawable.h +++ b/dggui/drawable.h @@ -29,7 +29,7 @@ #include #include -namespace GUI +namespace dggui { class Colour; @@ -49,4 +49,4 @@ public: virtual bool hasAlpha() const = 0; }; -} // GUI:: +} // dggui:: diff --git a/dggui/eventhandler.cc b/dggui/eventhandler.cc index fd333b8..b2cf616 100644 --- a/dggui/eventhandler.cc +++ b/dggui/eventhandler.cc @@ -30,7 +30,7 @@ #include "painter.h" #include "dialog.h" -namespace GUI +namespace dggui { EventHandler::EventHandler(NativeWindow& nativeWindow, Window& window) @@ -294,4 +294,4 @@ void EventHandler::unregisterDialog(Dialog* dialog) } -} // GUI:: +} // dggui:: diff --git a/dggui/eventhandler.h b/dggui/eventhandler.h index 8d6f492..6a2b48f 100644 --- a/dggui/eventhandler.h +++ b/dggui/eventhandler.h @@ -34,7 +34,7 @@ #include "guievent.h" #include "nativewindow.h" -namespace GUI +namespace dggui { class Window; @@ -75,4 +75,4 @@ private: std::list dialogs; }; -} // GUI:: +} // dggui:: diff --git a/dggui/font.cc b/dggui/font.cc index 0500e81..e59cb41 100644 --- a/dggui/font.cc +++ b/dggui/font.cc @@ -28,7 +28,7 @@ #include -namespace GUI +namespace dggui { Font::Font(const std::string& fontfile) @@ -133,4 +133,4 @@ PixelBufferAlpha *Font::render(const std::string& text) const return pb; } -} // GUI:: +} // dggui:: diff --git a/dggui/font.h b/dggui/font.h index 2e3f87a..6ce1f5c 100644 --- a/dggui/font.h +++ b/dggui/font.h @@ -32,7 +32,8 @@ #include "pixelbuffer.h" #include "image.h" -namespace GUI { +namespace dggui +{ class Font { public: @@ -61,4 +62,4 @@ private: int spacing{1}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/frame.cc b/dggui/frame.cc index d375b6d..3a163f1 100644 --- a/dggui/frame.cc +++ b/dggui/frame.cc @@ -28,7 +28,7 @@ #include "painter.h" -namespace GUI +namespace dggui { FrameWidget::FrameWidget(Widget* parent, bool has_switch, bool has_help_text) @@ -143,4 +143,4 @@ void FrameWidget::sizeChanged(int width, int height) help_button.move(width - 4 - 16, help_button.y()); } -} // GUI:: +} // dggui:: diff --git a/dggui/frame.h b/dggui/frame.h index db26ea9..dc8e17a 100644 --- a/dggui/frame.h +++ b/dggui/frame.h @@ -33,7 +33,7 @@ #include "helpbutton.h" #include "widget.h" -namespace GUI +namespace dggui { class FrameWidget @@ -76,8 +76,8 @@ private: // label Font font; std::string title; - GUI::Colour label_colour{0.1}; - GUI::Colour label_colour_disabled{0.5}; + dggui::Colour label_colour{0.1}; + dggui::Colour label_colour_disabled{0.5}; std::size_t label_width; // switch @@ -89,18 +89,18 @@ private: // grey box int bar_height; - GUI::Colour grey_box_colour{0.7}; - GUI::Colour grey_box_colour_disabled{0.7}; - GUI::Colour background_colour{0.85, 0.8}; + dggui::Colour grey_box_colour{0.7}; + dggui::Colour grey_box_colour_disabled{0.7}; + dggui::Colour background_colour{0.85, 0.8}; // // content // // content frame - GUI::Colour frame_colour_top{0.95}; - GUI::Colour frame_colour_bottom{0.4}; - GUI::Colour frame_colour_side{0.6}; + dggui::Colour frame_colour_top{0.95}; + dggui::Colour frame_colour_bottom{0.4}; + dggui::Colour frame_colour_side{0.6}; // content box Widget* content{nullptr}; @@ -112,4 +112,4 @@ private: int content_height; }; -} // GUI:: +} // dggui:: diff --git a/dggui/guievent.h b/dggui/guievent.h index 4ad0798..aae0ae1 100644 --- a/dggui/guievent.h +++ b/dggui/guievent.h @@ -30,7 +30,7 @@ #include #include -namespace GUI +namespace dggui { enum class EventType @@ -209,4 +209,4 @@ struct Rect } }; -} // GUI:: +} // dggui:: diff --git a/dggui/helpbutton.cc b/dggui/helpbutton.cc index fa061a6..cc03112 100644 --- a/dggui/helpbutton.cc +++ b/dggui/helpbutton.cc @@ -30,7 +30,7 @@ #include -namespace GUI +namespace dggui { HelpButton::HelpButton(Widget* parent) @@ -72,4 +72,4 @@ void HelpButton::showHelpText() tip.show(); } -} // GUI:: +} // dggui:: diff --git a/dggui/helpbutton.h b/dggui/helpbutton.h index 6e97eca..639799a 100644 --- a/dggui/helpbutton.h +++ b/dggui/helpbutton.h @@ -30,7 +30,7 @@ #include "button_base.h" #include "tooltip.h" -namespace GUI +namespace dggui { class HelpButton @@ -55,4 +55,4 @@ private: Tooltip tip; }; -} // GUI:: +} // dggui:: diff --git a/dggui/image.cc b/dggui/image.cc index 118203e..d821bee 100644 --- a/dggui/image.cc +++ b/dggui/image.cc @@ -36,7 +36,7 @@ #include "resource.h" #include "lodepng/lodepng.h" -namespace GUI +namespace dggui { Image::Image(const char* data, size_t size) @@ -213,4 +213,4 @@ bool Image::isValid() const return valid; } -} // GUI:: +} // dggui:: diff --git a/dggui/image.h b/dggui/image.h index d162a75..a6bf43e 100644 --- a/dggui/image.h +++ b/dggui/image.h @@ -33,7 +33,8 @@ #include "colour.h" #include "resource.h" -namespace GUI { +namespace dggui +{ class Image : public Drawable @@ -72,4 +73,4 @@ protected: bool has_alpha{false}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/imagecache.cc b/dggui/imagecache.cc index d3130fe..fa2197b 100644 --- a/dggui/imagecache.cc +++ b/dggui/imagecache.cc @@ -30,7 +30,7 @@ #include "image.h" -namespace GUI +namespace dggui { ScopedImageBorrower::ScopedImageBorrower(ImageCache& imageCache, @@ -100,4 +100,4 @@ void ImageCache::giveBack(const std::string& filename) } } -} // GUI:: +} // dggui:: diff --git a/dggui/imagecache.h b/dggui/imagecache.h index d31a844..15ecaf3 100644 --- a/dggui/imagecache.h +++ b/dggui/imagecache.h @@ -30,7 +30,7 @@ #include #include -namespace GUI +namespace dggui { class Image; @@ -69,4 +69,4 @@ protected: std::map> imageCache; }; -} // GUI:: +} // dggui:: diff --git a/dggui/knob.cc b/dggui/knob.cc index 25200a7..4f8ead0 100644 --- a/dggui/knob.cc +++ b/dggui/knob.cc @@ -36,7 +36,7 @@ namespace const double pi = std::atan(1.0) * 4.0; } -namespace GUI +namespace dggui { Knob::Knob(Widget *parent) @@ -252,4 +252,4 @@ void Knob::internalSetValue(float new_value) redraw(); } -} // GUI:: +} // dggui:: diff --git a/dggui/knob.h b/dggui/knob.h index fc71511..851c9c6 100644 --- a/dggui/knob.h +++ b/dggui/knob.h @@ -32,7 +32,8 @@ #include "texture.h" #include "font.h" -namespace GUI { +namespace dggui +{ class Knob : public Widget { public: @@ -85,4 +86,4 @@ private: Font font; }; -} // GUI:: +} // dggui:: diff --git a/dggui/label.cc b/dggui/label.cc index b5239ec..fc3f60e 100644 --- a/dggui/label.cc +++ b/dggui/label.cc @@ -31,7 +31,8 @@ #include -namespace GUI { +namespace dggui +{ Label::Label(Widget *parent) : Widget(parent) @@ -93,4 +94,4 @@ void Label::repaintEvent(RepaintEvent* repaintEvent) } } -} // GUI:: +} // dggui:: diff --git a/dggui/label.h b/dggui/label.h index 45b4176..453bc4f 100644 --- a/dggui/label.h +++ b/dggui/label.h @@ -33,7 +33,8 @@ #include #include -namespace GUI { +namespace dggui +{ enum class TextAlignment { left, @@ -66,4 +67,4 @@ private: std::unique_ptr colour; }; -} // GUI:: +} // dggui:: diff --git a/dggui/layout.cc b/dggui/layout.cc index 61e4f77..3b99456 100644 --- a/dggui/layout.cc +++ b/dggui/layout.cc @@ -30,7 +30,7 @@ #include -namespace GUI +namespace dggui { LayoutItem::LayoutItem() @@ -383,4 +383,4 @@ void GridLayout::moveAndResize( } } -} // GUI:: +} // dggui:: diff --git a/dggui/layout.h b/dggui/layout.h index 210c86e..860ecc2 100644 --- a/dggui/layout.h +++ b/dggui/layout.h @@ -32,7 +32,7 @@ #include -namespace GUI +namespace dggui { class Layout; @@ -192,4 +192,4 @@ private: LayoutItem& item, GridRange const& range, CellSize cell_size) const; }; -} // GUI:: +} // dggui:: diff --git a/dggui/led.cc b/dggui/led.cc index f77e31a..6e1059c 100644 --- a/dggui/led.cc +++ b/dggui/led.cc @@ -28,7 +28,8 @@ #include "painter.h" -namespace GUI { +namespace dggui +{ LED::LED(Widget *parent) : Widget(parent) @@ -94,4 +95,4 @@ void LED::repaintEvent(RepaintEvent* repaintEvent) p.drawFilledCircle(w / 3, h / 3, size / 6); } -} // GUI:: +} // dggui:: diff --git a/dggui/led.h b/dggui/led.h index 14ab6ef..7a1f55f 100644 --- a/dggui/led.h +++ b/dggui/led.h @@ -28,7 +28,8 @@ #include "widget.h" -namespace GUI { +namespace dggui +{ class LED : public Widget { public: @@ -51,4 +52,4 @@ private: state_t state; }; -} // GUI:: +} // dggui:: diff --git a/dggui/lineedit.cc b/dggui/lineedit.cc index 14cc234..7e8bf86 100644 --- a/dggui/lineedit.cc +++ b/dggui/lineedit.cc @@ -31,7 +31,8 @@ #define BORDER 10 -namespace GUI { +namespace dggui +{ LineEdit::LineEdit(Widget *parent) : Widget(parent) @@ -282,4 +283,4 @@ void LineEdit::repaintEvent(RepaintEvent *repaintEvent) } } -} // GUI:: +} // dggui:: diff --git a/dggui/lineedit.h b/dggui/lineedit.h index 86ad986..c702c47 100644 --- a/dggui/lineedit.h +++ b/dggui/lineedit.h @@ -33,7 +33,7 @@ #include "painter.h" #include "texturedbox.h" -namespace GUI +namespace dggui { class LineEdit @@ -84,4 +84,4 @@ private: bool readonly; }; -} // GUI:: +} // dggui:: diff --git a/dggui/listbox.cc b/dggui/listbox.cc index 28c074e..4513895 100644 --- a/dggui/listbox.cc +++ b/dggui/listbox.cc @@ -29,7 +29,8 @@ #include "painter.h" #include "font.h" -namespace GUI { +namespace dggui +{ ListBox::ListBox(Widget *parent) : Widget(parent) @@ -102,4 +103,4 @@ void ListBox::resize(std::size_t width, std::size_t height) height - (7 + 7)); } -} // GUI:: +} // dggui:: diff --git a/dggui/listbox.h b/dggui/listbox.h index 0d9ad4d..75a4ea0 100644 --- a/dggui/listbox.h +++ b/dggui/listbox.h @@ -34,7 +34,7 @@ #include "listboxbasic.h" #include "texturedbox.h" -namespace GUI +namespace dggui { class ListBox @@ -71,4 +71,4 @@ private: 7, 63, 7}; // dy1, dy2, dy3 }; -} // GUI:: +} // dggui:: diff --git a/dggui/listboxbasic.cc b/dggui/listboxbasic.cc index b2637eb..dd58944 100644 --- a/dggui/listboxbasic.cc +++ b/dggui/listboxbasic.cc @@ -29,7 +29,8 @@ #include "painter.h" #include "font.h" -namespace GUI { +namespace dggui +{ ListBoxBasic::ListBoxBasic(Widget *parent) : Widget(parent) @@ -359,4 +360,4 @@ void ListBoxBasic::resize(std::size_t width, std::size_t height) scroll.resize(scroll.width(), height); } -} // GUI:: +} // dggui:: diff --git a/dggui/listboxbasic.h b/dggui/listboxbasic.h index 27822e6..3d6515d 100644 --- a/dggui/listboxbasic.h +++ b/dggui/listboxbasic.h @@ -36,9 +36,12 @@ #include "painter.h" #include "scrollbar.h" -namespace GUI { +namespace dggui +{ -class ListBoxBasic : public Widget { +class ListBoxBasic + : public Widget +{ public: class Item { public: @@ -91,4 +94,4 @@ protected: int btn_size; }; -} // GUI:: +} // dggui:: diff --git a/dggui/listboxthin.cc b/dggui/listboxthin.cc index d224f11..b92def3 100644 --- a/dggui/listboxthin.cc +++ b/dggui/listboxthin.cc @@ -29,7 +29,7 @@ #include "painter.h" #include "font.h" -namespace GUI +namespace dggui { ListBoxThin::ListBoxThin(Widget *parent) @@ -98,4 +98,4 @@ void ListBoxThin::resize(std::size_t height, std::size_t width) height - (1 + 1)); } -} // GUI:: +} // dggui:: diff --git a/dggui/listboxthin.h b/dggui/listboxthin.h index e861745..0305a04 100644 --- a/dggui/listboxthin.h +++ b/dggui/listboxthin.h @@ -36,7 +36,7 @@ #include "listboxbasic.h" #include "texturedbox.h" -namespace GUI +namespace dggui { class ListBoxThin @@ -55,7 +55,7 @@ public: std::string selectedValue(); // From Widget: - virtual void repaintEvent(GUI::RepaintEvent* repaintEvent) override; + virtual void repaintEvent(RepaintEvent* repaintEvent) override; virtual void resize(std::size_t height, std::size_t width) override; // Forwarded notifier from ListBoxBasic::basic @@ -72,4 +72,4 @@ private: 1, 1, 1}; // dy1, dy2, dy3 }; -} // GUI:: +} // dggui:: diff --git a/dggui/nativewindow.h b/dggui/nativewindow.h index 400ff57..07c3559 100644 --- a/dggui/nativewindow.h +++ b/dggui/nativewindow.h @@ -34,7 +34,7 @@ #include "guievent.h" -namespace GUI +namespace dggui { struct Point; @@ -97,4 +97,4 @@ public: virtual Point translateToScreen(const Point& point) = 0; }; -} // GUI:: +} // dggui:: diff --git a/dggui/nativewindow_cocoa.h b/dggui/nativewindow_cocoa.h index 8dc73e6..e17d4af 100644 --- a/dggui/nativewindow_cocoa.h +++ b/dggui/nativewindow_cocoa.h @@ -30,7 +30,7 @@ #include "nativewindow.h" -namespace GUI +namespace dggui { class Window; @@ -75,4 +75,4 @@ private: float scale{1.0}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/nativewindow_cocoa.mm b/dggui/nativewindow_cocoa.mm index 7b6ecc8..3214f57 100644 --- a/dggui/nativewindow_cocoa.mm +++ b/dggui/nativewindow_cocoa.mm @@ -69,11 +69,11 @@ { @public NSWindow* window; - GUI::NativeWindowCocoa* native; + dggui::NativeWindowCocoa* native; } - (id) initWithWindow:(NSWindow*)ref - native:(GUI::NativeWindowCocoa*)_native; + native:(dggui::NativeWindowCocoa*)_native; - (void) dealloc; - (void) windowDidResize; - (void) windowWillResize; @@ -83,7 +83,7 @@ @implementation DGListener - (id) initWithWindow:(NSWindow*)ref - native:(GUI::NativeWindowCocoa*)_native + native:(dggui::NativeWindowCocoa*)_native { [super init]; @@ -146,7 +146,7 @@ return; } - auto closeEvent = std::make_shared(); + auto closeEvent = std::make_shared(); native->pushBackEvent(closeEvent); } @@ -162,7 +162,7 @@ int depthBits; @private - GUI::NativeWindowCocoa* native; + dggui::NativeWindowCocoa* native; NSTrackingArea* trackingArea; } @@ -188,7 +188,7 @@ - (void) keyUp:(NSEvent*)event; - (void) dealloc; -- (void) bindNative:(GUI::NativeWindowCocoa*)native; +- (void) bindNative:(dggui::NativeWindowCocoa*)native; - (void) unbindNative; @end @@ -228,7 +228,7 @@ [super mouseEntered:event]; auto frame = [self frame]; NSPoint loc = [event locationInWindow]; - auto mouseEnterEvent = std::make_shared(); + auto mouseEnterEvent = std::make_shared(); mouseEnterEvent->x = loc.x - frame.origin.x; mouseEnterEvent->y = frame.size.height - loc.y - frame.origin.y; native->pushBackEvent(mouseEnterEvent); @@ -240,7 +240,7 @@ [super mouseExited:event]; auto frame = [self frame]; NSPoint loc = [event locationInWindow]; - auto mouseLeaveEvent = std::make_shared(); + auto mouseLeaveEvent = std::make_shared(); mouseLeaveEvent->x = loc.x - frame.origin.x; mouseLeaveEvent->y = frame.size.height - loc.y - frame.origin.y; native->pushBackEvent(mouseLeaveEvent); @@ -251,7 +251,7 @@ { auto frame = [self frame]; NSPoint loc = [event locationInWindow]; - auto mouseMoveEvent = std::make_shared(); + auto mouseMoveEvent = std::make_shared(); mouseMoveEvent->x = loc.x - frame.origin.x; mouseMoveEvent->y = frame.size.height - loc.y - frame.origin.y; native->pushBackEvent(mouseMoveEvent); @@ -262,24 +262,24 @@ auto frame = [self frame]; NSPoint loc = [event locationInWindow]; - auto buttonEvent = std::make_shared(); + auto buttonEvent = std::make_shared(); buttonEvent->x = loc.x - frame.origin.x; buttonEvent->y = frame.size.height - loc.y - frame.origin.y; switch((int)[event buttonNumber]) { case 0: - buttonEvent->button = GUI::MouseButton::left; + buttonEvent->button = dggui::MouseButton::left; break; case 1: - buttonEvent->button = GUI::MouseButton::right; + buttonEvent->button = dggui::MouseButton::right; break; case 2: - buttonEvent->button = GUI::MouseButton::middle; + buttonEvent->button = dggui::MouseButton::middle; break; default: return; } - buttonEvent->direction = GUI::Direction::down; + buttonEvent->direction = dggui::Direction::down; buttonEvent->doubleClick = [event clickCount] == 2; native->pushBackEvent(buttonEvent); @@ -291,24 +291,24 @@ auto frame = [self frame]; NSPoint loc = [event locationInWindow]; - auto buttonEvent = std::make_shared(); + auto buttonEvent = std::make_shared(); buttonEvent->x = loc.x - frame.origin.x; buttonEvent->y = frame.size.height - loc.y - frame.origin.y; switch((int)[event buttonNumber]) { case 0: - buttonEvent->button = GUI::MouseButton::left; + buttonEvent->button = dggui::MouseButton::left; break; case 1: - buttonEvent->button = GUI::MouseButton::right; + buttonEvent->button = dggui::MouseButton::right; break; case 2: - buttonEvent->button = GUI::MouseButton::middle; + buttonEvent->button = dggui::MouseButton::middle; break; default: return; } - buttonEvent->direction = GUI::Direction::up; + buttonEvent->direction = dggui::Direction::up; buttonEvent->doubleClick = false; native->pushBackEvent(buttonEvent); @@ -362,7 +362,7 @@ auto frame = [self frame]; NSPoint loc = [event locationInWindow]; - auto scrollEvent = std::make_shared(); + auto scrollEvent = std::make_shared(); scrollEvent->x = loc.x - frame.origin.x; scrollEvent->y = frame.size.height - loc.y - frame.origin.y; scrollEvent->delta = [event deltaY] * -1.0f; @@ -376,31 +376,31 @@ const NSString* chars = [event characters]; const char* str = [chars UTF8String]; - auto keyEvent = std::make_shared(); + auto keyEvent = std::make_shared(); switch([event keyCode]) { - case 123: keyEvent->keycode = GUI::Key::left; break; - case 124: keyEvent->keycode = GUI::Key::right; break; - case 126: keyEvent->keycode = GUI::Key::up; break; - case 125: keyEvent->keycode = GUI::Key::down; break; - case 117: keyEvent->keycode = GUI::Key::deleteKey; break; - case 51: keyEvent->keycode = GUI::Key::backspace; break; - case 115: keyEvent->keycode = GUI::Key::home; break; - case 119: keyEvent->keycode = GUI::Key::end; break; - case 121: keyEvent->keycode = GUI::Key::pageDown; break; - case 116: keyEvent->keycode = GUI::Key::pageUp; break; - case 36: keyEvent->keycode = GUI::Key::enter; break; - default: keyEvent->keycode = GUI::Key::unknown; break; + case 123: keyEvent->keycode = dggui::Key::left; break; + case 124: keyEvent->keycode = dggui::Key::right; break; + case 126: keyEvent->keycode = dggui::Key::up; break; + case 125: keyEvent->keycode = dggui::Key::down; break; + case 117: keyEvent->keycode = dggui::Key::deleteKey; break; + case 51: keyEvent->keycode = dggui::Key::backspace; break; + case 115: keyEvent->keycode = dggui::Key::home; break; + case 119: keyEvent->keycode = dggui::Key::end; break; + case 121: keyEvent->keycode = dggui::Key::pageDown; break; + case 116: keyEvent->keycode = dggui::Key::pageUp; break; + case 36: keyEvent->keycode = dggui::Key::enter; break; + default: keyEvent->keycode = dggui::Key::unknown; break; } - if(strlen(str) && keyEvent->keycode == GUI::Key::unknown) + if(strlen(str) && keyEvent->keycode == dggui::Key::unknown) { - keyEvent->keycode = GUI::Key::character; + keyEvent->keycode = dggui::Key::character; } keyEvent->text = str; // TODO: UTF8 decode - keyEvent->direction = GUI::Direction::down; + keyEvent->direction = dggui::Direction::down; native->pushBackEvent(keyEvent); [super keyDown: event]; @@ -410,31 +410,31 @@ { const NSString* chars = [event characters]; const char* str = [chars UTF8String]; - auto keyEvent = std::make_shared(); + auto keyEvent = std::make_shared(); switch([event keyCode]) { - case 123: keyEvent->keycode = GUI::Key::left; break; - case 124: keyEvent->keycode = GUI::Key::right; break; - case 126: keyEvent->keycode = GUI::Key::up; break; - case 125: keyEvent->keycode = GUI::Key::down; break; - case 117: keyEvent->keycode = GUI::Key::deleteKey; break; - case 51: keyEvent->keycode = GUI::Key::backspace; break; - case 115: keyEvent->keycode = GUI::Key::home; break; - case 119: keyEvent->keycode = GUI::Key::end; break; - case 121: keyEvent->keycode = GUI::Key::pageDown; break; - case 116: keyEvent->keycode = GUI::Key::pageUp; break; - case 36: keyEvent->keycode = GUI::Key::enter; break; - default: keyEvent->keycode = GUI::Key::unknown; break; + case 123: keyEvent->keycode = dggui::Key::left; break; + case 124: keyEvent->keycode = dggui::Key::right; break; + case 126: keyEvent->keycode = dggui::Key::up; break; + case 125: keyEvent->keycode = dggui::Key::down; break; + case 117: keyEvent->keycode = dggui::Key::deleteKey; break; + case 51: keyEvent->keycode = dggui::Key::backspace; break; + case 115: keyEvent->keycode = dggui::Key::home; break; + case 119: keyEvent->keycode = dggui::Key::end; break; + case 121: keyEvent->keycode = dggui::Key::pageDown; break; + case 116: keyEvent->keycode = dggui::Key::pageUp; break; + case 36: keyEvent->keycode = dggui::Key::enter; break; + default: keyEvent->keycode = dggui::Key::unknown; break; } - if(strlen(str) && keyEvent->keycode == GUI::Key::unknown) + if(strlen(str) && keyEvent->keycode == dggui::Key::unknown) { - keyEvent->keycode = GUI::Key::character; + keyEvent->keycode = dggui::Key::character; } keyEvent->text = str; // TODO: UTF8 decode - keyEvent->direction = GUI::Direction::up; + keyEvent->direction = dggui::Direction::up; native->pushBackEvent(keyEvent); [super keyUp: event]; @@ -445,7 +445,7 @@ [super dealloc]; } -- (void)bindNative:(GUI::NativeWindowCocoa*)_native +- (void)bindNative:(dggui::NativeWindowCocoa*)_native { native = _native; } @@ -457,7 +457,7 @@ @end -namespace GUI +namespace dggui { struct priv @@ -818,7 +818,7 @@ void NativeWindowCocoa::resized() updateLayerOffset(); } - auto resizeEvent = std::make_shared(); + auto resizeEvent = std::make_shared(); resizeEvent->width = 42; // size is not actually used resizeEvent->height = 42; // size is not actually used pushBackEvent(resizeEvent); @@ -829,4 +829,4 @@ void NativeWindowCocoa::pushBackEvent(std::shared_ptr event) event_queue.push_back(event); } -} // GUI:: +} // dggui:: diff --git a/dggui/nativewindow_pugl.cc b/dggui/nativewindow_pugl.cc index f94b82b..68b1ea9 100644 --- a/dggui/nativewindow_pugl.cc +++ b/dggui/nativewindow_pugl.cc @@ -42,7 +42,7 @@ #include -namespace GUI +namespace dggui { NativeWindowPugl::NativeWindowPugl(void* native_window, Window& window) @@ -379,4 +379,4 @@ void NativeWindowPugl::onKeyboard(PuglView* view, bool press, uint32_t key) native->eventq.push_back(e); } -} // GUI:: +} // dggui:: diff --git a/dggui/nativewindow_pugl.h b/dggui/nativewindow_pugl.h index 6a667f4..c76b157 100644 --- a/dggui/nativewindow_pugl.h +++ b/dggui/nativewindow_pugl.h @@ -34,7 +34,7 @@ extern "C" #include -namespace GUI +namespace dggui { class Event; @@ -80,4 +80,4 @@ private: std::uint32_t last_click{0}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/nativewindow_win32.cc b/dggui/nativewindow_win32.cc index 4b31130..db785e9 100644 --- a/dggui/nativewindow_win32.cc +++ b/dggui/nativewindow_win32.cc @@ -32,7 +32,7 @@ #include "window.h" -namespace GUI +namespace dggui { static BOOL trackMouse(HWND hwnd) @@ -581,4 +581,4 @@ Point NativeWindowWin32::translateToScreen(const Point& point) return { p.x, p.y }; } -} // GUI:: +} // dggui:: diff --git a/dggui/nativewindow_win32.h b/dggui/nativewindow_win32.h index 046b38a..f4748fe 100644 --- a/dggui/nativewindow_win32.h +++ b/dggui/nativewindow_win32.h @@ -34,7 +34,8 @@ #include typedef HWND WNDID; -namespace GUI { +namespace dggui +{ class Window; class Event; @@ -75,4 +76,4 @@ private: bool always_on_top{false}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/nativewindow_x11.cc b/dggui/nativewindow_x11.cc index 33dde7b..04f1b35 100644 --- a/dggui/nativewindow_x11.cc +++ b/dggui/nativewindow_x11.cc @@ -41,7 +41,7 @@ #include "window.h" -namespace GUI +namespace dggui { #define _NET_WM_STATE_REMOVE 0 // remove/unset property @@ -712,4 +712,4 @@ void NativeWindowX11::updateImageFromBuffer(std::size_t x1, std::size_t y1, } } -} // GUI:: +} // dggui:: diff --git a/dggui/nativewindow_x11.h b/dggui/nativewindow_x11.h index cb56fbc..bed86bd 100644 --- a/dggui/nativewindow_x11.h +++ b/dggui/nativewindow_x11.h @@ -33,7 +33,7 @@ #include "nativewindow.h" -namespace GUI +namespace dggui { class Window; @@ -96,4 +96,4 @@ private: EventQueue event_queue; }; -} // GUI:: +} // dggui:: diff --git a/dggui/painter.cc b/dggui/painter.cc index f746f83..c326601 100644 --- a/dggui/painter.cc +++ b/dggui/painter.cc @@ -35,7 +35,7 @@ #include "image.h" #include "canvas.h" -namespace GUI +namespace dggui { Painter::Painter(Canvas& canvas) @@ -641,4 +641,4 @@ void Painter::drawBar(int x, int y, const Bar& bar, int width, int height) bar.right->width(), height); } -} // GUI:: +} // dggui:: diff --git a/dggui/painter.h b/dggui/painter.h index 9bf7fbf..09c490d 100644 --- a/dggui/painter.h +++ b/dggui/painter.h @@ -31,7 +31,7 @@ #include "colour.h" #include "pixelbuffer.h" -namespace GUI +namespace dggui { class Font; @@ -100,4 +100,4 @@ void Painter::draw(Iterator begin, Iterator end, int x_offset, int y_offset, Col } } -} // GUI:: +} // dggui:: diff --git a/dggui/pixelbuffer.cc b/dggui/pixelbuffer.cc index 3c666cd..531ac22 100644 --- a/dggui/pixelbuffer.cc +++ b/dggui/pixelbuffer.cc @@ -32,7 +32,7 @@ #include #include -namespace GUI +namespace dggui { PixelBuffer::PixelBuffer(std::size_t width, std::size_t height) @@ -366,4 +366,4 @@ const std::uint8_t* PixelBufferAlpha::getLine(std::size_t x, std::size_t y) cons return buf + (x + y * width) * 4; } -} // GUI:: +} // dggui:: diff --git a/dggui/pixelbuffer.h b/dggui/pixelbuffer.h index 5c11d14..58fec00 100644 --- a/dggui/pixelbuffer.h +++ b/dggui/pixelbuffer.h @@ -34,7 +34,7 @@ #include "guievent.h" -namespace GUI +namespace dggui { class PixelBuffer @@ -98,4 +98,4 @@ public: bool has_last{false}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/powerbutton.cc b/dggui/powerbutton.cc index 5bf2a2c..8a204f2 100644 --- a/dggui/powerbutton.cc +++ b/dggui/powerbutton.cc @@ -28,7 +28,7 @@ #include "painter.h" -namespace GUI +namespace dggui { PowerButton::PowerButton(Widget* parent) : Toggle(parent) @@ -85,4 +85,4 @@ void PowerButton::repaintEvent(RepaintEvent* repaintEvent) } } -} // GUI:: +} // dggui:: diff --git a/dggui/powerbutton.h b/dggui/powerbutton.h index 14dbeca..a752c53 100644 --- a/dggui/powerbutton.h +++ b/dggui/powerbutton.h @@ -29,7 +29,7 @@ #include "texture.h" #include "toggle.h" -namespace GUI +namespace dggui { class PowerButton : public Toggle @@ -55,4 +55,4 @@ private: Texture disabled_clicked{getImageCache(), ":resources/bypass_button.png", 80, 0, 16, 16}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/progressbar.cc b/dggui/progressbar.cc index dd3e130..1f833f9 100644 --- a/dggui/progressbar.cc +++ b/dggui/progressbar.cc @@ -26,7 +26,7 @@ */ #include "progressbar.h" -namespace GUI +namespace dggui { ProgressBar::ProgressBar(Widget *parent) @@ -101,4 +101,4 @@ void ProgressBar::repaintEvent(RepaintEvent* repaintEvent) } -} // GUI:: +} // dggui:: diff --git a/dggui/progressbar.h b/dggui/progressbar.h index 76cc6fd..a67687b 100644 --- a/dggui/progressbar.h +++ b/dggui/progressbar.h @@ -32,7 +32,7 @@ #include "painter.h" #include "texturedbox.h" -namespace GUI +namespace dggui { enum class ProgressBarState @@ -86,4 +86,4 @@ private: std::size_t value{0}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/resource.cc b/dggui/resource.cc index 52aca0a..1e4d95e 100644 --- a/dggui/resource.cc +++ b/dggui/resource.cc @@ -43,7 +43,7 @@ extern const rc_data_t* rc_data; -namespace GUI +namespace dggui { // TODO: Replace with std::filesystem::is_regular_file once we update the @@ -191,4 +191,4 @@ bool Resource::valid() return isValid; } -} // GUI:: +} // dggui:: diff --git a/dggui/resource.h b/dggui/resource.h index 5f7b3b4..f298287 100644 --- a/dggui/resource.h +++ b/dggui/resource.h @@ -28,9 +28,11 @@ #include -namespace GUI { +namespace dggui +{ -class Resource { +class Resource +{ public: Resource(const std::string& name); @@ -47,4 +49,4 @@ protected: size_t internalSize{0}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/resource_data.h b/dggui/resource_data.h index d685e13..0da3720 100644 --- a/dggui/resource_data.h +++ b/dggui/resource_data.h @@ -26,8 +26,9 @@ */ #pragma once -typedef struct { +struct rc_data_t +{ const char *name; unsigned int size; const char *data; -} rc_data_t; +}; diff --git a/dggui/scrollbar.cc b/dggui/scrollbar.cc index 9a17d1d..e78aab3 100644 --- a/dggui/scrollbar.cc +++ b/dggui/scrollbar.cc @@ -30,7 +30,8 @@ #include "painter.h" -namespace GUI { +namespace dggui +{ ScrollBar::ScrollBar(Widget *parent) : Widget(parent) @@ -211,4 +212,4 @@ void ScrollBar::buttonEvent(ButtonEvent* buttonEvent) dragging = (buttonEvent->direction == Direction::down); } -} // GUI:: +} // dggui:: diff --git a/dggui/scrollbar.h b/dggui/scrollbar.h index 5e60673..9bc4de8 100644 --- a/dggui/scrollbar.h +++ b/dggui/scrollbar.h @@ -32,9 +32,12 @@ #include "texture.h" #include "notifier.h" -namespace GUI { +namespace dggui +{ -class ScrollBar : public Widget { +class ScrollBar + : public Widget +{ friend class ListBoxBasic; public: ScrollBar(Widget *parent); @@ -71,4 +74,4 @@ private: Texture bg_img{getImageCache(), ":resources/widget.png", 7, 7, 1, 63}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/slider.cc b/dggui/slider.cc index 15a82b3..bb42f34 100644 --- a/dggui/slider.cc +++ b/dggui/slider.cc @@ -31,7 +31,7 @@ #include #include -namespace GUI +namespace dggui { Slider::Slider(Widget* parent) : Widget(parent) @@ -214,4 +214,4 @@ void Slider::recomputeCurrentValue(float x) } } -} // GUI:: +} // dggui:: diff --git a/dggui/slider.h b/dggui/slider.h index 90905fd..b249c91 100644 --- a/dggui/slider.h +++ b/dggui/slider.h @@ -30,7 +30,7 @@ #include "texturedbox.h" #include "widget.h" -namespace GUI +namespace dggui { class Slider @@ -150,4 +150,4 @@ private: void recomputeCurrentValue(float x); }; -} // GUI:: +} // dggui:: diff --git a/dggui/stackedwidget.cc b/dggui/stackedwidget.cc index 05f8f3c..a89dc04 100644 --- a/dggui/stackedwidget.cc +++ b/dggui/stackedwidget.cc @@ -26,7 +26,7 @@ */ #include "stackedwidget.h" -namespace GUI +namespace dggui { StackedWidget::StackedWidget(Widget *parent) @@ -148,4 +148,4 @@ void StackedWidget::sizeChanged(int width, int height) } } -} // GUI:: +} // dggui:: diff --git a/dggui/stackedwidget.h b/dggui/stackedwidget.h index 24213f7..a08065b 100644 --- a/dggui/stackedwidget.h +++ b/dggui/stackedwidget.h @@ -31,7 +31,7 @@ #include "widget.h" #include "notifier.h" -namespace GUI +namespace dggui { //! A StackedWidget is a widget containing a list of widgets but only showing @@ -78,4 +78,4 @@ private: std::list widgets; }; -} // GUI:: +} // dggui:: diff --git a/dggui/tabbutton.cc b/dggui/tabbutton.cc index 6a27f61..a2b0549 100644 --- a/dggui/tabbutton.cc +++ b/dggui/tabbutton.cc @@ -28,7 +28,7 @@ #include "painter.h" -namespace GUI +namespace dggui { static TabID getNextTabID() @@ -129,4 +129,4 @@ void TabButton::clickHandler() switchTabNotifier(tab_widget); } -} // GUI:: +} // dggui:: diff --git a/dggui/tabbutton.h b/dggui/tabbutton.h index 1e9371a..ac9a37c 100644 --- a/dggui/tabbutton.h +++ b/dggui/tabbutton.h @@ -32,7 +32,7 @@ #include "font.h" #include "texturedbox.h" -namespace GUI +namespace dggui { class ScrollEvent; @@ -82,4 +82,4 @@ private: Font font{":resources/fontemboss.png"}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/tabwidget.cc b/dggui/tabwidget.cc index 635f1bd..1714472 100644 --- a/dggui/tabwidget.cc +++ b/dggui/tabwidget.cc @@ -28,7 +28,7 @@ #include "painter.h" -namespace GUI +namespace dggui { TabWidget::TabWidget(Widget *parent) @@ -211,4 +211,4 @@ const TabButton* TabWidget::getButtonFromWidget(const Widget* tab_widget) return nullptr; } -} // GUI:: +} // dggui:: diff --git a/dggui/tabwidget.h b/dggui/tabwidget.h index 129826a..750ed59 100644 --- a/dggui/tabwidget.h +++ b/dggui/tabwidget.h @@ -31,7 +31,7 @@ #include "stackedwidget.h" #include "texture.h" -namespace GUI +namespace dggui { class TabWidget @@ -81,4 +81,4 @@ private: std::size_t tab_width{64}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/textedit.cc b/dggui/textedit.cc index 9688b82..f8aeab7 100644 --- a/dggui/textedit.cc +++ b/dggui/textedit.cc @@ -28,7 +28,7 @@ #include "painter.h" -namespace GUI +namespace dggui { TextEdit::TextEdit(Widget* parent) : Widget(parent), scroll(this) @@ -198,4 +198,4 @@ void TextEdit::scrolled(int value) redraw(); } -} // GUI:: +} // dggui:: diff --git a/dggui/textedit.h b/dggui/textedit.h index 17a04ff..c07774b 100644 --- a/dggui/textedit.h +++ b/dggui/textedit.h @@ -35,7 +35,7 @@ #include "texturedbox.h" #include "widget.h" -namespace GUI +namespace dggui { class TextEdit @@ -89,4 +89,4 @@ private: std::vector preprocessed_text; }; -} // GUI:: +} // dggui:: diff --git a/dggui/texture.cc b/dggui/texture.cc index 8cd7040..788835f 100644 --- a/dggui/texture.cc +++ b/dggui/texture.cc @@ -26,7 +26,7 @@ */ #include "texture.h" -namespace GUI +namespace dggui { Texture::Texture(ImageCache& image_cache, const std::string& filename, @@ -69,4 +69,4 @@ bool Texture::hasAlpha() const return true; } -} // GUI:: +} // dggui:: diff --git a/dggui/texture.h b/dggui/texture.h index c751ed4..d75b47a 100644 --- a/dggui/texture.h +++ b/dggui/texture.h @@ -32,7 +32,7 @@ #include "imagecache.h" #include "image.h" -namespace GUI +namespace dggui { class Texture @@ -61,4 +61,4 @@ private: Colour outOfRange{0.0f, 0.0f, 0.0f, 0.0f}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/texturedbox.cc b/dggui/texturedbox.cc index e48353a..c19b8d6 100644 --- a/dggui/texturedbox.cc +++ b/dggui/texturedbox.cc @@ -28,7 +28,7 @@ #include -namespace GUI +namespace dggui { TexturedBox::TexturedBox(ImageCache& image_cache, const std::string& filename, @@ -144,4 +144,4 @@ bool TexturedBox::hasAlpha() const return true; } -} // GUI:: +} // dggui:: diff --git a/dggui/texturedbox.h b/dggui/texturedbox.h index 7aa3967..48febba 100644 --- a/dggui/texturedbox.h +++ b/dggui/texturedbox.h @@ -30,7 +30,7 @@ #include "imagecache.h" #include "texture.h" -namespace GUI +namespace dggui { class TexturedBox @@ -116,4 +116,4 @@ private: Colour outOfRange{0.0f, 0.0f, 0.0f, 0.0f}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/toggle.cc b/dggui/toggle.cc index 39587de..e655a65 100644 --- a/dggui/toggle.cc +++ b/dggui/toggle.cc @@ -26,7 +26,7 @@ */ #include "toggle.h" -namespace GUI +namespace dggui { Toggle::Toggle(Widget* parent) : Widget(parent) @@ -107,4 +107,4 @@ void Toggle::internalSetChecked(bool checked) redraw(); } -} // GUI:: +} // dggui:: diff --git a/dggui/toggle.h b/dggui/toggle.h index 3466459..0fa844b 100644 --- a/dggui/toggle.h +++ b/dggui/toggle.h @@ -30,7 +30,7 @@ #include -namespace GUI +namespace dggui { class Toggle : public Widget @@ -67,4 +67,4 @@ private: void internalSetChecked(bool checked); }; -} // GUI:: +} // dggui:: diff --git a/dggui/tooltip.cc b/dggui/tooltip.cc index e251ed5..b55b45e 100644 --- a/dggui/tooltip.cc +++ b/dggui/tooltip.cc @@ -31,7 +31,7 @@ #include "window.h" #include -namespace GUI +namespace dggui { Tooltip::Tooltip(Widget *parent) @@ -197,4 +197,4 @@ void Tooltip::buttonEvent(ButtonEvent* buttonEvent) } } -} // GUI:: +} // dggui:: diff --git a/dggui/tooltip.h b/dggui/tooltip.h index 9d1619d..1ba1cd8 100644 --- a/dggui/tooltip.h +++ b/dggui/tooltip.h @@ -36,7 +36,7 @@ #include "texturedbox.h" #include "font.h" -namespace GUI +namespace dggui { class Tooltip @@ -75,4 +75,4 @@ private: Widget* activating_widget; }; -} // GUI:: +} // dggui:: diff --git a/dggui/uitranslation.cc b/dggui/uitranslation.cc index 0546be8..c12d646 100644 --- a/dggui/uitranslation.cc +++ b/dggui/uitranslation.cc @@ -30,6 +30,9 @@ #include "resource.h" +namespace dggui +{ + UITranslation::UITranslation() { auto lang = Translation::getISO639LanguageName(); @@ -37,7 +40,7 @@ UITranslation::UITranslation() std::string res = ":locale/"; res += lang + ".mo"; - GUI::Resource mo(res); + Resource mo(res); if(!mo.valid()) { printf("Locale not in resources - use default\n"); @@ -48,4 +51,5 @@ UITranslation::UITranslation() load(mo.data(), mo.size()); } +} // ::dggui #endif // WITH_NLS diff --git a/dggui/uitranslation.h b/dggui/uitranslation.h index 5341255..3258e21 100644 --- a/dggui/uitranslation.h +++ b/dggui/uitranslation.h @@ -31,6 +31,9 @@ #include #ifdef WITH_NLS +namespace dggui +{ + class UITranslation : public Translation { @@ -38,4 +41,6 @@ public: UITranslation(); ~UITranslation() = default; }; + +} // ::dggui #endif diff --git a/dggui/utf8.cc b/dggui/utf8.cc index 747e726..c516f52 100644 --- a/dggui/utf8.cc +++ b/dggui/utf8.cc @@ -26,6 +26,9 @@ */ #include "utf8.h" +namespace dggui +{ + UTF8::UTF8() { // Encode Map @@ -359,3 +362,5 @@ std::string UTF8::toLatin1(std::string const& s) return ret; } + +} // ::dggui diff --git a/dggui/utf8.h b/dggui/utf8.h index 04c26b1..c7cf2ac 100644 --- a/dggui/utf8.h +++ b/dggui/utf8.h @@ -29,6 +29,9 @@ #include #include +namespace dggui +{ + // Class to convert utf8 to latin1 and the other way around. class UTF8 { @@ -45,3 +48,5 @@ private: std::unordered_map map_encode; std::unordered_map map_decode; }; + +} // ::dggui diff --git a/dggui/verticalline.cc b/dggui/verticalline.cc index 6a3a98a..d068b82 100644 --- a/dggui/verticalline.cc +++ b/dggui/verticalline.cc @@ -28,7 +28,8 @@ #include "painter.h" -namespace GUI { +namespace dggui +{ VerticalLine::VerticalLine(Widget *parent) : Widget(parent) @@ -48,4 +49,4 @@ void VerticalLine::repaintEvent(RepaintEvent* repaintEvent) vline, width(), vline.height()); } -} // GUI:: +} // dggui:: diff --git a/dggui/verticalline.h b/dggui/verticalline.h index 3403244..2479d0d 100644 --- a/dggui/verticalline.h +++ b/dggui/verticalline.h @@ -29,9 +29,12 @@ #include "widget.h" #include "image.h" -namespace GUI { +namespace dggui +{ -class VerticalLine : public Widget { +class VerticalLine + : public Widget +{ public: VerticalLine(Widget* parent); virtual ~VerticalLine() = default; @@ -44,4 +47,4 @@ private: Image vline; }; -} // GUI:: +} // dggui:: diff --git a/dggui/widget.cc b/dggui/widget.cc index da6b1e2..077fa72 100644 --- a/dggui/widget.cc +++ b/dggui/widget.cc @@ -31,7 +31,7 @@ #include "painter.h" #include "window.h" -namespace GUI +namespace dggui { Widget::Widget(Widget* parent) @@ -294,4 +294,4 @@ std::size_t Widget::translateToWindowY() return window_y; } -} // GUI:: +} // dggui:: diff --git a/dggui/widget.h b/dggui/widget.h index b9436b7..bf391c5 100644 --- a/dggui/widget.h +++ b/dggui/widget.h @@ -34,7 +34,7 @@ #include -namespace GUI +namespace dggui { struct Point @@ -136,4 +136,4 @@ protected: bool dirty{true}; }; -} // GUI:: +} // dggui:: diff --git a/dggui/window.cc b/dggui/window.cc index 5e0ad31..19af2ad 100644 --- a/dggui/window.cc +++ b/dggui/window.cc @@ -44,7 +44,7 @@ #include "nativewindow_pugl.h" #endif // !UI_PUGL -namespace GUI +namespace dggui { Window::Window(void* native_window) @@ -263,4 +263,4 @@ bool Window::updateBuffer() return true; } -} // GUI:: +} // dggui:: diff --git a/dggui/window.h b/dggui/window.h index 6031500..5f6952f 100644 --- a/dggui/window.h +++ b/dggui/window.h @@ -34,7 +34,7 @@ #include "eventhandler.h" #include "imagecache.h" -namespace GUI +namespace dggui { class Window @@ -116,4 +116,4 @@ protected: ImageCache image_cache; }; -} // GUI:: +} // dggui:: -- cgit v1.2.3