diff options
author | Benji Dial <benji6283@gmail.com> | 2021-03-11 22:00:22 -0500 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2021-03-11 22:00:22 -0500 |
commit | 5fcf57739e68a8b5053e03778aaee0eed445babd (patch) | |
tree | e7a8bab18668d112e58b1b48190195035c71fa8a /src/user/include/cxx/raleigh/w | |
parent | 0f2398d1f622cce37925f52d978d92e6cce1c7a9 (diff) | |
download | portland-os-5fcf57739e68a8b5053e03778aaee0eed445babd.tar.gz |
settings editor, and lots of changes in service of that
Diffstat (limited to 'src/user/include/cxx/raleigh/w')
-rw-r--r-- | src/user/include/cxx/raleigh/w/button.h | 9 | ||||
-rw-r--r-- | src/user/include/cxx/raleigh/w/colorpicker.h | 1 | ||||
-rw-r--r-- | src/user/include/cxx/raleigh/w/entry.h | 7 | ||||
-rw-r--r-- | src/user/include/cxx/raleigh/w/multicontainer.h | 3 | ||||
-rw-r--r-- | src/user/include/cxx/raleigh/w/vbox.h | 2 |
5 files changed, 17 insertions, 5 deletions
diff --git a/src/user/include/cxx/raleigh/w/button.h b/src/user/include/cxx/raleigh/w/button.h index 71ccae2..c56a6e3 100644 --- a/src/user/include/cxx/raleigh/w/button.h +++ b/src/user/include/cxx/raleigh/w/button.h @@ -4,10 +4,12 @@ #include <raleigh/widget.h> namespace raleigh { + typedef void *button_tag_t; class button : public widget { public: - button(widget &inner, void (*on_click)(button &), _pixel_t border_color=RGB(00, 00, 00), - _pixel_t bg_color=RGB(bf, bf, bf), _pixel_t pressed_color=RGB(9f, 9f, 9f)); + button(widget &inner, void (*on_click)(button_tag_t), button_tag_t tag=0, + _pixel_t border_color=RGB(00, 00, 00), _pixel_t bg_color=RGB(bf, bf, bf), + _pixel_t pressed_color=RGB(9f, 9f, 9f)); void notify_window_change() override; void paint(_pixel_t *pixbuf, uint32_t pitch) override; @@ -16,7 +18,8 @@ namespace raleigh { void notify_has_opaque_parent(widget *parent) override; private: widget &inner; - void (*on_click)(button &); + void (*on_click)(button_tag_t); + button_tag_t tag; _pixel_t border_color; _pixel_t bg_color; _pixel_t pressed_color; diff --git a/src/user/include/cxx/raleigh/w/colorpicker.h b/src/user/include/cxx/raleigh/w/colorpicker.h index 471787d..f791b2a 100644 --- a/src/user/include/cxx/raleigh/w/colorpicker.h +++ b/src/user/include/cxx/raleigh/w/colorpicker.h @@ -8,6 +8,7 @@ namespace raleigh { public: colorpicker(_pixel_t default_color=RGB(20, 70, 30), uint8_t resolution=4); _pixel_t get_picked_color() __attribute__ ((pure)); + void set_picked_color(_pixel_t c); void paint(_pixel_t *pixbuf, uint32_t pitch) override; void handle_click(coord window_coords, enum mouse_packet::mouse_button click_type, bool up) override; diff --git a/src/user/include/cxx/raleigh/w/entry.h b/src/user/include/cxx/raleigh/w/entry.h index 001cae2..c86b281 100644 --- a/src/user/include/cxx/raleigh/w/entry.h +++ b/src/user/include/cxx/raleigh/w/entry.h @@ -8,10 +8,15 @@ namespace raleigh { class entry : public widget { public: //default_text's data is copied, so it's okay if it changes or if the memory is freed - entry(uint32_t rows, uint32_t cols, const char *default_text="", + entry(uint32_t rows=25, uint32_t cols=25, const char *default_text="", const char *font="fixed-10", _pixel_t bg=RGB(ff, ff, ff), _pixel_t fg=RGB(00, 00, 00), _pixel_t border_color=RGB(00, 00, 00)); + //not a copy + const char *get_contents(); + //s's data is copied + void set_contents(const char *s); + void notify_window_change() override; void paint(_pixel_t *pixbuf, uint32_t pitch) override; void handle_click(coord window_coords, enum mouse_packet::mouse_button click_type, bool up) override; diff --git a/src/user/include/cxx/raleigh/w/multicontainer.h b/src/user/include/cxx/raleigh/w/multicontainer.h index 8a3497f..729f6a1 100644 --- a/src/user/include/cxx/raleigh/w/multicontainer.h +++ b/src/user/include/cxx/raleigh/w/multicontainer.h @@ -7,6 +7,9 @@ namespace raleigh { class multicontainer : public widget { public: + void add_end(widget &w); + void add_start(widget &w); + void notify_window_change() override; void paint(_pixel_t *pixbuf, uint32_t pitch) override; void handle_click(coord window_coords, enum mouse_packet::mouse_button click_type, bool up) override; diff --git a/src/user/include/cxx/raleigh/w/vbox.h b/src/user/include/cxx/raleigh/w/vbox.h index d51e61d..6bace59 100644 --- a/src/user/include/cxx/raleigh/w/vbox.h +++ b/src/user/include/cxx/raleigh/w/vbox.h @@ -7,7 +7,7 @@ namespace raleigh { class vbox : public multicontainer { public: //do not modify this list afterward - vbox(dllist<widget &> widgets); + vbox(dllist<widget &> widgets=dllist<widget &>()); private: coord determine_size() override; |