| jbutton.h | | jbutton.h | |
| | | | |
| skipping to change at line 49 | | skipping to change at line 49 | |
| * \author Jeff Ferr | | * \author Jeff Ferr | |
| */ | | */ | |
| class Button : public Component{ | | class Button : public Component{ | |
| | | | |
| private: | | private: | |
| std::vector<ButtonListener *> _button_listeners; | | std::vector<ButtonListener *> _button_listeners; | |
| std::vector<std::string> _name_list; | | std::vector<std::string> _name_list; | |
| int _index; | | int _index; | |
| | | | |
| protected: | | protected: | |
|
| jalign_t _align; | | jhorizontal_align_t _halign; | |
| | | jvertical_align_t _valign; | |
| | | bool _wrap; | |
| | | | |
| public: | | public: | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| Button(std::string label, int x = 0, int y = 0, int width =
0, int height = 0); | | Button(std::string label, int x = 0, int y = 0, int width =
DEFAULT_COMPONENT_WIDTH, int height = DEFAULT_COMPONENT_HEIGHT); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual ~Button(); | | virtual ~Button(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetText(std::string text); | | virtual void SetText(std::string text); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void AddName(std::string); | | virtual void AddName(std::string); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveName(int index); | | virtual void RemoveName(int index); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetCurrentNameIndex(int index); | | virtual void SetCurrentNameIndex(int index); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void NextName(); | | virtual void NextName(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void PreviousName(); | | virtual void PreviousName(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetAlign(jalign_t align); | | virtual void SetHorizontalAlign(jhorizontal_align_t align); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| jalign_t GetAlign(); | | virtual jhorizontal_align_t GetHorizontalAlign(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| std::string GetName(); | | virtual void SetVerticalAlign(jvertical_align_t align); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jvertical_align_t GetVerticalAlign(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual std::string GetText(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void Paint(Graphics *g); | | virtual void Paint(Graphics *g); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| | | | |
| skipping to change at line 140 | | skipping to change at line 154 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual bool ProcessEvent(MouseEvent *event); | | virtual bool ProcessEvent(MouseEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RegisterButtonListener(ButtonListener *listener); | | virtual void RegisterButtonListener(ButtonListener *listener
); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveButtonListener(ButtonListener *listener); | | virtual void RemoveButtonListener(ButtonListener *listener); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void DispatchEvent(ButtonEvent *event); | | virtual void DispatchButtonEvent(ButtonEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| std::vector<ButtonListener *> & GetButtonListeners(); | | virtual std::vector<ButtonListener *> & GetButtonListeners()
; | |
| | | | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 15 change blocks. |
| 15 lines changed or deleted | | 29 lines changed or added | |
|
| jcheckbutton.h | | jcheckbutton.h | |
| | | | |
| skipping to change at line 50 | | skipping to change at line 50 | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| * \author Jeff Ferr | | * \author Jeff Ferr | |
| */ | | */ | |
| class CheckButton : public Component{ | | class CheckButton : public Component{ | |
| | | | |
| private: | | private: | |
| std::vector<CheckButtonListener *> _check_listeners; | | std::vector<CheckButtonListener *> _check_listeners; | |
|
| std::string _label; | | std::string _text; | |
| jcheckbox_type_t _type; | | jcheckbox_type_t _type; | |
|
| | | jhorizontal_align_t _halign; | |
| | | jvertical_align_t _valign; | |
| bool _checked, | | bool _checked, | |
|
| _just_check; | | _just_check, | |
| | | _wrap; | |
| | | | |
| public: | | public: | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| CheckButton(jcheckbox_type_t type, std::string label, int x
= 0, int y = 0, int width = 0, int height = 0); | | CheckButton(jcheckbox_type_t type, std::string text, int x =
0, int y = 0, int width = DEFAULT_COMPONENT_WIDTH, int height = DEFAULT_CO
MPONENT_HEIGHT); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual ~CheckButton(); | | virtual ~CheckButton(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetType(jcheckbox_type_t type); | | virtual void SetText(std::string text); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| jcheckbox_type_t GetType(); | | virtual std::string GetText(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| bool IsSelected(); | | virtual void SetType(jcheckbox_type_t type); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetSelected(bool b); | | virtual jcheckbox_type_t GetType(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual bool IsSelected(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetSelected(bool b); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetHorizontalAlign(jhorizontal_align_t align); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jhorizontal_align_t GetHorizontalAlign(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetVerticalAlign(jvertical_align_t align); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jvertical_align_t GetVerticalAlign(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void Paint(Graphics *g); | | virtual void Paint(Graphics *g); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| | | | |
| skipping to change at line 114 | | skipping to change at line 153 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual bool ProcessEvent(MouseEvent *event); | | virtual bool ProcessEvent(MouseEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RegisterCheckButtonListener(CheckButtonListener *listen
er); | | virtual void RegisterCheckButtonListener(CheckButtonListener
*listener); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveCheckButtonListener(CheckButtonListener *listener
); | | virtual void RemoveCheckButtonListener(CheckButtonListener *
listener); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void DispatchEvent(CheckButtonEvent *event); | | virtual void DispatchCheckButtonEvent(CheckButtonEvent *even
t); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| std::vector<CheckButtonListener *> & GetCheckButtonListeners
(); | | virtual std::vector<CheckButtonListener *> & GetCheckButtonL
isteners(); | |
| | | | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 12 change blocks. |
| 11 lines changed or deleted | | 50 lines changed or added | |
|
| jcombobox.h | | jcombobox.h | |
| | | | |
| skipping to change at line 24 | | skipping to change at line 24 | |
| *
* | | *
* | |
| * You should have received a copy of the GNU General Public License
* | | * You should have received a copy of the GNU General Public License
* | |
| * along with this program; if not, write to the
* | | * along with this program; if not, write to the
* | |
| * Free Software Foundation, Inc.,
* | | * Free Software Foundation, Inc.,
* | |
| * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| #ifndef J_COMBOBOX_H | | #ifndef J_COMBOBOX_H | |
| #define J_COMBOBOX_H | | #define J_COMBOBOX_H | |
| | | | |
| #include "jselectlistener.h" | | #include "jselectlistener.h" | |
|
| #include "jcomponent.h" | | #include "jitemcomponent.h" | |
| #include "jmenu.h" | | #include "jmenu.h" | |
| | | | |
| #include <iostream> | | #include <iostream> | |
| #include <cstdlib> | | #include <cstdlib> | |
| #include <map> | | #include <map> | |
| | | | |
| #include <math.h> | | #include <math.h> | |
| #include <stdio.h> | | #include <stdio.h> | |
| #include <stdlib.h> | | #include <stdlib.h> | |
| #include <unistd.h> | | #include <unistd.h> | |
| #include <math.h> | | #include <math.h> | |
| #include <time.h> | | #include <time.h> | |
| | | | |
| namespace jgui { | | namespace jgui { | |
| | | | |
|
| class MenuItem; | | class ComboBox : public jgui::ItemComponent, public jgui::SelectListener{ | |
| class ComboMenuComponent; | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| * \author Jeff Ferr | | | |
| */ | | | |
| class ComboMenu : public jgui::Frame, public jgui::FrameInputListener{ | | | |
| | | | |
| friend class ComboMenuComponent; | | | |
| | | | |
| private: | | | |
| jthread::Mutex _menu_mutex; | | | |
| | | | |
| std::vector<ComboMenu *> _menus; | | | |
| std::vector<MenuListener *> _menu_listeners; | | | |
| MenuItem *_current_item; | | | |
| ComboMenuComponent *_list; | | | |
| int _visible_items; | | | |
| jmenu_align_t _menu_align; | | | |
| | | | |
| private: | | private: | |
|
| /** | | Menu *_menu; | |
| * \brief | | jhorizontal_align_t _halign; | |
| * | | jvertical_align_t _valign; | |
| */ | | int _old_index; | |
| virtual void MousePressed(MouseEvent *event); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual void MouseReleased(MouseEvent *event); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual void MouseClicked(MouseEvent *event); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual void MouseMoved(MouseEvent *event); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual void MouseWheel(MouseEvent *event); | | | |
| | | | |
| public: | | public: | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| ComboMenu(int x, int y, int width, int visible_items); | | ComboBox(int x = 0, int y = 0, int width = DEFAULT_COMPONENT | |
| | | _WIDTH, int height = DEFAULT_COMPONENT_HEIGHT, int visible_items = 5); | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual ~ComboMenu(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual bool Show(bool modal = true); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual void SetTitle(std::string title); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetComboMenuAlign(jmenu_align_t align); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| int GetItemsSize(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| int GetVisibleItems(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetLoop(bool loop); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetCurrentIndex(int i); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void AddMenuItem(MenuItem *item); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| MenuItem * GetCurrentItem(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| int GetCurrentIndex(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RemoveItem(int index); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RemoveAll(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| jcolor_t GetItemColor(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetItemColor(jcolor_t color); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetForegroundColor(jcolor_t color); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetBackgroundColor(jcolor_t color); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetItemColor(int red, int green, int blue, int alpha); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetForegroundColor(int red, int green, int blue, int al | | | |
| pha); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetBackgroundColor(int red, int green, int blue, int al | | | |
| pha); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RegisterMenuListener(MenuListener *listener); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RemoveMenuListener(MenuListener *listener); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void DispatchEvent(MenuEvent *event); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| std::vector<MenuListener *> & GetMenuListeners(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual void InputChanged(KeyEvent *event); | | | |
| }; | | | |
| | | | |
| class ComboMenuComponent : public Component{ | | | |
| | | | |
| friend class ComboMenu; | | | |
| | | | |
| private: | | | |
| std::vector<MenuItem *>_items; | | | |
| OffScreenImage *prefetch; | | | |
| ComboMenu *_menu; | | | |
| int bx, | | | |
| by, | | | |
| bwidth, | | | |
| bheight, | | | |
| _item_size, | | | |
| _index, | | | |
| _visible_items, | | | |
| _paint_count, | | | |
| _vertical_gap, | | | |
| _horizontal_gap; | | | |
| jcolor_t _item_color; | | | |
| float delta; | | | |
| bool _input_locked, | | | |
| _arrows_visible, | | | |
| _loop; | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetComboMenu(ComboMenu *menu); | | | |
| | | | |
|
| public: | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| ComboMenuComponent(int x, int y, int width, int visible_item
s); | | virtual ~ComboBox(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual ~ComboMenuComponent(); | | virtual void SetVisibleItems(int max_items); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetGap(int hgap, int vgap); | | virtual void SetHorizontalAlign(jhorizontal_align_t align); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetLoop(bool loop); | | virtual jhorizontal_align_t GetHorizontalAlign(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetCurrentIndex(int i); | | virtual void SetVerticalAlign(jvertical_align_t align); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void AddEmptyItem(); | | virtual jvertical_align_t GetVerticalAlign(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void AddItem(std::string text); | | virtual void ItemSelected(SelectEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void AddItem(std::string text, std::string image); | | virtual void ItemChanged(SelectEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void AddItem(std::string text, bool checked); | | virtual bool ProcessEvent(KeyEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void AddMenuItem(MenuItem *item); | | virtual bool ProcessEvent(MouseEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| MenuItem * GetMenuItem(int index); | | virtual jcolor_t GetItemColor(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| MenuItem * GetCurrentMenuItem(); | | virtual void SetItemColor(jcolor_t color); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| int GetCurrentIndex(); | | virtual void SetItemColor(int red, int green, int blue, int
alpha); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| int GetItemsSize(); | | virtual jcolor_t GetItemFocusColor(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveItem(int index); | | virtual void SetItemFocusColor(jcolor_t color); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveAll(); | | virtual void SetItemFocusColor(int red, int green, int blue,
int alpha); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| jcolor_t GetItemColor(); | | virtual int GetItemsSize(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetItemColor(jcolor_t color); | | virtual void SetLoop(bool loop); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetItemColor(int red, int green, int blue, int alpha); | | virtual void SetCurrentIndex(int i); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void Paint(Graphics *g); | | virtual void AddEmptyItem(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual bool ProcessEvent(KeyEvent *event); | | virtual void AddTextItem(std::string text); | |
| | | | |
| }; | | | |
| class ComboBox : public Component, public MenuListener{//, public jthread:: | | | |
| Thread{ | | | |
| | | | |
| private: | | | |
| std::vector<SelectListener *> _select_listeners; | | | |
| ComboMenu *_menu; | | | |
| int _arrow_size, | | | |
| _old_index; | | | |
| | | | |
|
| public: | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| ComboBox(int x = 0, int y = 0, int width = 0, int height = 0
, int visible_items = 3); | | virtual void AddImageItem(std::string text, std::string imag
e); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual ~ComboBox(); | | virtual void AddCheckedItem(std::string text, bool checked); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetArrowSize(int size); | | virtual void AddItem(Item *item); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| int GetArrowSize(); | | virtual void AddItem(Item *item, int index); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetVisibleItems(int max_items); | | virtual void AddItems(std::vector<Item *> &items); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetLoop(bool b); | | virtual void RemoveItem(Item *item); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetIndex(int i); | | virtual void RemoveItem(int index); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| std::string GetValue(); | | virtual void RemoveItems(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| int GetIndex(); | | virtual Item * GetItem(int index); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void Add(std::string text); | | virtual std::vector<Item *> & GetItems(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void Remove(int index); | | virtual Item * GetCurrentItem(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveAll(); | | virtual int GetCurrentIndex(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void Paint(Graphics *g); | | virtual void Paint(Graphics *g); | |
| | | | |
|
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual void ItemSelected(MenuEvent *event); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual void ItemChanged(MenuEvent *event); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RegisterSelectListener(SelectListener *listener); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RemoveSelectListener(SelectListener *listener); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void DispatchEvent(SelectEvent *event); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| std::vector<SelectListener *> & GetSelectListeners(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual void Run(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual bool ProcessEvent(KeyEvent *event); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual bool ProcessEvent(MouseEvent *event); | | | |
| | | | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 40 change blocks. |
| 334 lines changed or deleted | | 41 lines changed or added | |
|
| jcomponent.h | | jcomponent.h | |
| | | | |
| skipping to change at line 42 | | skipping to change at line 42 | |
| #include "jkeyevent.h" | | #include "jkeyevent.h" | |
| #include "jmouseevent.h" | | #include "jmouseevent.h" | |
| | | | |
| #include <string> | | #include <string> | |
| #include <vector> | | #include <vector> | |
| | | | |
| #include <stdlib.h> | | #include <stdlib.h> | |
| #include <unistd.h> | | #include <unistd.h> | |
| #include <stdio.h> | | #include <stdio.h> | |
| | | | |
|
| #define DEFAULT_COMPONENT_WIDTH 100 | | #define DEFAULT_COMPONENT_WIDTH 192 | |
| #define DEFAULT_COMPONENT_HEIGHT 40 | | #define DEFAULT_COMPONENT_HEIGHT 54 | |
| | | | |
| #define CENTER_VERTICAL_TEXT \ | | | |
| (_font==NULL)?0:(_font->GetHeight()>_size.height)?0:((_size.height-_ | | | |
| font->GetHeight())/2) | | | |
| | | | |
| /* | | | |
| #define CENTER_VERTICAL_ERROR \ | | | |
| (int)(_font->GetHeight()/(2.25*(double)GFXHandler::GetInstance()->Ge | | | |
| tScreenHeight()/(double)DEFAULT_SCALE_HEIGHT)) | | | |
| | | | |
| #define CENTER_VERTICAL_TEXT \ | | | |
| (_font==NULL)?0:(_font->GetHeight()>_height)?0:((_height-_font->GetH | | | |
| eight())/2-CENTER_VERTICAL_ERROR)<0?0:((_height-_font->GetHeight())/2-CENTE | | | |
| R_VERTICAL_ERROR) | | | |
| */ | | | |
| | | | |
| namespace jgui { | | namespace jgui { | |
| | | | |
| enum jcomponent_alignment_t { | | enum jcomponent_alignment_t { | |
| TOP_ALIGNMENT = 0, | | TOP_ALIGNMENT = 0, | |
| CENTER_ALIGNMENT = 1, | | CENTER_ALIGNMENT = 1, | |
| BOTTOM_ALIGNMENT = 2, | | BOTTOM_ALIGNMENT = 2, | |
| LEFT_ALIGNMENT = 0, | | LEFT_ALIGNMENT = 0, | |
| RIGHT_ALIGNMENT = 2 | | RIGHT_ALIGNMENT = 2 | |
| }; | | }; | |
| | | | |
| skipping to change at line 101 | | skipping to change at line 90 | |
| // for any height H the difference between H and <code>getBaseline(w
, H)</code> is the same. For example, a <code> | | // for any height H the difference between H and <code>getBaseline(w
, H)</code> is the same. For example, a <code> | |
| // JLabel</code> containing non-empty text with a vertical alignment
of <code>BOTTOM</code> should have a baseline | | // JLabel</code> containing non-empty text with a vertical alignment
of <code>BOTTOM</code> should have a baseline | |
| // type of <code>CONSTANT_DESCENT</code>. | | // type of <code>CONSTANT_DESCENT</code>. | |
| CB_CONSTANT_DESCENT, | | CB_CONSTANT_DESCENT, | |
| // Indicates the baseline remains a fixed distance from the center o
f the component. That is, for any height H the | | // Indicates the baseline remains a fixed distance from the center o
f the component. That is, for any height H the | |
| // difference between <code>getBaseline(w, H)</code> and <code>H / 2
</code> is the same (plus or minus one depending | | // difference between <code>getBaseline(w, H)</code> and <code>H / 2
</code> is the same (plus or minus one depending | |
| // upon rounding error). <p> Because of possible rounding errors it
is recommended you ask for the baseline with two | | // upon rounding error). <p> Because of possible rounding errors it
is recommended you ask for the baseline with two | |
| // consecutive heights and use the return value to determine if you
need to pad calculations by 1. The following shows | | // consecutive heights and use the return value to determine if you
need to pad calculations by 1. The following shows | |
| // how to calculate the baseline for any height: | | // how to calculate the baseline for any height: | |
| // <pre> | | // <pre> | |
|
| // Dimension preferredSize = component.getPreferredSize(); | | // jregion_t preferredSize = component->GetPreferredSize(); | |
| // int baseline = getBaseline(preferredSize.width, preferredSi | | // int baseline = GetBaseline(preferredSize.width, preferredSize. | |
| ze.height); | | height); | |
| // int nextBaseline = getBaseline(preferredSize.width, preferr | | // int nextBaseline = GetBaseline(preferredSize.width, preferredS | |
| edSize.height + 1); | | ize.height + 1); | |
| // // Amount to add to height when calculating | | // // Amount to add to height when calculating where ba | |
| where baseline lands for a particular height: | | seline lands for a particular height: | |
| // int padding = 0; | | // int padding = 0; | |
| // // Where the baseline is relative to the mi | | // // Where the baseline is relative to the mid point | |
| d point | | // int baselineOffset = baseline - height / 2; | |
| // int baselineOffset = baseline - height / 2; | | // if (preferredSize.height % 2 == 0 && baseline != nex | |
| // if (preferredSize.height % 2 == 0 && | | tBaseline) { | |
| ; | | // padding = 1; | |
| // baseline != nextBaseline) { | | // } else if (preferredSize.height % 2 == 1 && baseline | |
| // padding = 1; | | == nextBaseline) { | |
| // } else if (preferredSize.height % 2 == 1 &a | | // baselineOffset--; | |
| mp;& | | // padding = 1; | |
| // baseline == nextBaseline) { | | // } | |
| // baselineOffset--; | | // // The following calculates where the baseline lands | |
| // padding = 1; | | for the height z: | |
| // } | | // int calculatedBaseline = (z + padding) / 2 + baselin | |
| // // The following calculates where the basel | | eOffset; | |
| ine lands for the height z: | | | |
| // int calculatedBaseline = (z + padding) / 2 | | | |
| + baselineOffset; | | | |
| // </pre> | | // </pre> | |
| CB_CENTER_OFFSET, | | CB_CENTER_OFFSET, | |
| // Indicates the baseline resize behavior can not be expressed using
any of the other constants. | | // Indicates the baseline resize behavior can not be expressed using
any of the other constants. | |
| // This may also indicate the baseline varies with the width of the
component. This is also returned | | // This may also indicate the baseline varies with the width of the
component. This is also returned | |
| // by components that do not have a baseline. | | // by components that do not have a baseline. | |
| CB_OTHER | | CB_OTHER | |
| }; | | }; | |
| | | | |
| class FocusListener; | | class FocusListener; | |
| class FocusEvent; | | class FocusEvent; | |
| | | | |
| skipping to change at line 156 | | skipping to change at line 143 | |
| std::vector<ComponentListener *> _component_listeners; | | std::vector<ComponentListener *> _component_listeners; | |
| Component *_left, | | Component *_left, | |
| *_right, | | *_right, | |
| *_up, | | *_up, | |
| *_down; | | *_down; | |
| jgui::Container *_parent; | | jgui::Container *_parent; | |
| jgui::Font *_font; | | jgui::Font *_font; | |
| jpoint_t _location; | | jpoint_t _location; | |
| jsize_t _size, | | jsize_t _size, | |
| _minimum_size, | | _minimum_size, | |
|
| _maximum_size, | | _maximum_size; | |
| _preferred_size; | | jcolor_t _bgcolor, | |
| jcolor_t _bg_color, | | _fgcolor, | |
| _fg_color, | | _focus_bgcolor, | |
| _bgfocus_color, | | _focus_fgcolor, | |
| _fgfocus_color, | | | |
| _border_color, | | _border_color, | |
|
| _borderfocus_color; | | _focus_border_color; | |
| jcomponent_alignment_t _alignment_x, | | jcomponent_alignment_t _alignment_x, | |
|
_alignment_y; | |
_alignment_y; | |
| jcomponent_orientation_t _orientation; | | jcomponent_orientation_t _orientation; | |
| jcomponent_border_t _border; | | jcomponent_border_t _border; | |
| int _gradient_level, | | int _gradient_level, | |
| _vertical_gap, | | _vertical_gap, | |
| _horizontal_gap, | | _horizontal_gap, | |
| _border_size; | | _border_size; | |
| bool _has_focus, | | bool _has_focus, | |
|
| _is_visible, | | _is_visible, | |
| _ignore_repaint, | | _ignore_repaint, | |
| _truncate_string, | | _background_visible, | |
| _background_visible, | | _is_focusable, | |
| _is_focusable, | | _enabled, | |
| _enabled, | | _theme_enabled, | |
| _theme_enabled, | | _is_opaque, | |
| _is_opaque, | | _is_valid; | |
| _is_valid; | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| std::string TruncateString(std::string text, int width); | | | |
| | | | |
| protected: | | protected: | |
| /** | | /** | |
| * \brief render surface using component_border_t parameter | | * \brief render surface using component_border_t parameter | |
| * | | * | |
| */ | | */ | |
| void FillRectangle(Graphics *g, int x, int y, int width, int
height); | | void FillRectangle(Graphics *g, int x, int y, int width, int
height); | |
| | | | |
| public: | | public: | |
| /** | | /** | |
| | | | |
| skipping to change at line 213 | | skipping to change at line 192 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual ~Component(); | | virtual ~Component(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| static int CountLines(std::string text, int width, Font *fon | | | |
| t); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual Container * GetParent(); | | virtual Container * GetParent(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual int GetBaseline(int width, int height); | | virtual int GetBaseline(int width, int height); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| | | | |
| skipping to change at line 327 | | skipping to change at line 300 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void SetGap(int hgap, int vgap); | | virtual void SetGap(int hgap, int vgap); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void SetParent(Container *parent); | | virtual void SetHorizontalGap(int hgap); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void SetBackgroundVisible(bool b); | | virtual void SetVerticalGap(int vgap); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void SetTruncated(bool b); | | virtual int GetHorizontalGap(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual int GetVerticalGap(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetParent(Container *parent); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetBackgroundVisible(bool b); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void SetEnabled(bool b); | | virtual void SetEnabled(bool b); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| | | | |
| skipping to change at line 435 | | skipping to change at line 426 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void SetBorderSize(int size); | | virtual void SetBorderSize(int size); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void SetMinimumSize(jsize_t size); | | virtual int GetBorderSize(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void SetMaximumSize(jsize_t size); | | virtual void SetMinimumSize(jsize_t size); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void SetPreferredSize(jsize_t size); | | virtual void SetMaximumSize(jsize_t size); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual jsize_t GetMinimumSize(); | | virtual jsize_t GetMinimumSize(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| | | | |
| skipping to change at line 717 | | skipping to change at line 708 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual jcolor_t GetBorderColor(); | | virtual jcolor_t GetBorderColor(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| | | virtual jcolor_t GetBorderFocusColor(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| virtual void SetFocusable(bool b); | | virtual void SetFocusable(bool b); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual bool IsFocusable(); | | virtual bool IsFocusable(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| | | | |
| skipping to change at line 741 | | skipping to change at line 738 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void Paint(Graphics *g); | | virtual void Paint(Graphics *g); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void PaintBorder(Graphics *g); | | virtual void PaintEdges(Graphics *g); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void Repaint(bool all = false); | | virtual void Repaint(bool all = false); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RegisterFocusListener(FocusListener *listener); | | virtual void RegisterFocusListener(FocusListener *listener); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveFocusListener(FocusListener *listener); | | virtual void RemoveFocusListener(FocusListener *listener); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void DispatchEvent(FocusEvent *event); | | virtual void DispatchFocusEvent(FocusEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| std::vector<FocusListener *> & GetFocusListeners(); | | virtual std::vector<FocusListener *> & GetFocusListeners(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RegisterComponentListener(ComponentListener *listener); | | virtual void RegisterComponentListener(ComponentListener *li
stener); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveComponentListener(ComponentListener *listener); | | virtual void RemoveComponentListener(ComponentListener *list
ener); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void DispatchEvent(ComponentEvent *event); | | virtual void DispatchComponentEvent(ComponentEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| std::vector<ComponentListener *> & GetComponentListeners(); | | virtual std::vector<ComponentListener *> & GetComponentListe
ners(); | |
| | | | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 22 change blocks. |
| 86 lines changed or deleted | | 77 lines changed or added | |
|
| jgfxhandler.h | | jgfxhandler.h | |
| | | | |
| skipping to change at line 53 | | skipping to change at line 53 | |
| ARROW_CURSOR, | | ARROW_CURSOR, | |
| SIZECORNER_CURSOR, | | SIZECORNER_CURSOR, | |
| SIZEALL_CURSOR, | | SIZEALL_CURSOR, | |
| SIZENS_CURSOR, | | SIZENS_CURSOR, | |
| SIZEWE_CURSOR, | | SIZEWE_CURSOR, | |
| SIZENWSE_CURSOR, | | SIZENWSE_CURSOR, | |
| SIZENESW_CURSOR, | | SIZENESW_CURSOR, | |
| WAIT_CURSOR | | WAIT_CURSOR | |
| }; | | }; | |
| | | | |
|
| class OffScreenImage; | | | |
| class Window; | | class Window; | |
| class WindowManager; | | class WindowManager; | |
|
| | | class Font; | |
| | | class OffScreenImage; | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| * \author Jeff Ferr | | * \author Jeff Ferr | |
| */ | | */ | |
| class GFXHandler : public virtual jcommon::Object{ | | class GFXHandler : public virtual jcommon::Object{ | |
| | | | |
| friend class Window; | | friend class Window; | |
| friend class WindowManager; | | friend class WindowManager; | |
|
| | | friend class Font; | |
| protected: | | friend class OffScreenImage; | |
| GFXHandler(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| int InitEngine(); | | | |
| | | | |
| private: | | private: | |
|
| static GFXHandler * instance; | | static GFXHandler * _instance; | |
| | | | |
| jthread::Mutex _mutex; | | | |
| jcursor_style_t _cursor; | | | |
| | | | |
| #ifdef DIRECTFB_UI | | #ifdef DIRECTFB_UI | |
| IDirectFB *_dfb; | | IDirectFB *_dfb; | |
| IDirectFBDisplayLayer *_layer; | | IDirectFBDisplayLayer *_layer; | |
| | | | |
| struct cursor_params_t { | | struct cursor_params_t { | |
| OffScreenImage *cursor; | | OffScreenImage *cursor; | |
| int hot_x; | | int hot_x; | |
| int hot_y; | | int hot_y; | |
| }; | | }; | |
| | | | |
| std::map<jcursor_style_t, struct cursor_params_t> _cursors; | | std::map<jcursor_style_t, struct cursor_params_t> _cursors; | |
| #endif | | #endif | |
| | | | |
|
| | | std::vector<OffScreenImage *> _offscreenimages; | |
| | | std::vector<Font *> _fonts; | |
| | | Font *_default_font; | |
| | | jthread::Mutex _mutex; | |
| | | jcursor_style_t _cursor; | |
| int r, | | int r, | |
| g, | | g, | |
| b, | | b, | |
| a; | | a; | |
| int screenWidth, | | int screenWidth, | |
|
| screenHeight, | | screenHeight, | |
| scaleWidth, | | scaleWidth, | |
| scaleHeight; | | scaleHeight; | |
| | | | |
| private: | | private: | |
|
| friend class Font; | | /** | |
| friend class OffScreenImage; | | * \brief | |
| | | * | |
| | | */ | |
| | | GFXHandler(); | |
| | | | |
|
| std::vector<Font *> _fonts; | | /** | |
| std::vector<OffScreenImage *> _offscreenimages; | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void InitEngine(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void InitCursors(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| void Add(Font *); | | void Add(Font *); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| | | | |
| skipping to change at line 166 | | skipping to change at line 174 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual ~GFXHandler(); | | virtual ~GFXHandler(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| | | static std::string GetID(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| static GFXHandler * GetInstance(); | | static GFXHandler * GetInstance(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| static std::string GetID(); | | virtual void * GetGraphicEngine(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void * GetGraphicEngine(); | | virtual void SetDefaultFont(Font *font); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void SetWorkingScreenSize(int width, int height); | | virtual Font * GetDefaultFont(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual int GetScreenWidth(); | | virtual void SetWorkingScreenSize(int width, int height); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual int GetScreenHeight(); | | virtual int GetScreenWidth(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual jpoint_t GetMousePosition(); | | virtual int GetScreenHeight(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void SetMousePosition(int x, int y); | | virtual jpoint_t GetMousePosition(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void InitCursors(); | | virtual void SetMousePosition(int x, int y); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void SetCursorEnabled(bool b); | | virtual void SetCursorEnabled(bool b); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| | | | |
End of changes. 17 change blocks. |
| 29 lines changed or deleted | | 43 lines changed or added | |
|
| jgraphics.h | | jgraphics.h | |
| | | | |
| skipping to change at line 39 | | skipping to change at line 39 | |
| #include <vector> | | #include <vector> | |
| #include <ctype.h> | | #include <ctype.h> | |
| #include <string> | | #include <string> | |
| #include <math.h> | | #include <math.h> | |
| #include <list> | | #include <list> | |
| | | | |
| #ifdef DIRECTFB_UI | | #ifdef DIRECTFB_UI | |
| #include <directfb.h> | | #include <directfb.h> | |
| #endif | | #endif | |
| | | | |
|
| #define TRUNC_COLOR(red, green, blue, alpha) \ | | #define DEFAULT_SCALE_WIDTH 1920 | |
| if (red < 0) { \ | | #define DEFAULT_SCALE_HEIGHT 1080 | |
| red = 0; \ | | | |
| } | | #define DEFAULT_FONT_SIZE 20 | |
| \ | | | |
| | | #define TRUNC_COLOR(r, g, b, a) \ | |
| \ | | r = (r < 0)?0:(r > 0xff)?0xff:r; \ | |
| if (green < 0) { \ | | g = (g < 0)?0:(g > 0xff)?0xff:g; \ | |
| green = 0; \ | | b = (b < 0)?0:(b > 0xff)?0xff:b; \ | |
| } | | a = (a < 0)?0:(a > 0xff)?0xff:a; \ | |
| \ | | | |
| | | | |
| \ | | | |
| if (blue < 0) { \ | | | |
| blue = 0; \ | | | |
| } | | | |
| \ | | | |
| | | | |
| \ | | | |
| if (alpha < 0) { \ | | | |
| alpha = 0; \ | | | |
| } | | | |
| \ | | | |
| | | | |
| \ | | | |
| if (red > 0xff) { \ | | | |
| red = 0xff; \ | | | |
| } | | | |
| \ | | | |
| | | | |
| \ | | | |
| if (green > 0xff) { \ | | | |
| green = 0xff; \ | | | |
| } | | | |
| \ | | | |
| | | | |
| \ | | | |
| if (blue > 0xff) { \ | | | |
| blue = 0xff; \ | | | |
| } | | | |
| \ | | | |
| | | | |
| \ | | | |
| if (alpha > 0xff) { \ | | | |
| alpha = 0xff; \ | | | |
| } | | | |
| \ | | | |
| | | | |
| #define SCALE_TO_SCREEN(x, y, z) \ | | #define SCALE_TO_SCREEN(x, y, z) \ | |
| (int)floor(((double)x*(double)y)/(double)z) | | (int)floor(((double)x*(double)y)/(double)z) | |
| | | | |
| #define SCREEN_TO_SCALE(x, z, y) \ | | #define SCREEN_TO_SCALE(x, z, y) \ | |
| (int)floor(((double)x*(double)y)/(double)z) | | (int)floor(((double)x*(double)y)/(double)z) | |
| | | | |
|
| #define DEFAULT_SCALE_WIDTH 1920 | | | |
| #define DEFAULT_SCALE_HEIGHT 1080 | | | |
| | | | |
| namespace jgui{ | | namespace jgui{ | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| enum jporter_duff_flags_t { | | enum jporter_duff_flags_t { | |
| PDF_NONE = 0x0001, // fs: sa fd: 1.0-sa
(defaults) | | PDF_NONE = 0x0001, // fs: sa fd: 1.0-sa
(defaults) | |
| PDF_CLEAR = 0x0002, // fs: 0.0 fd: 0.0 | | PDF_CLEAR = 0x0002, // fs: 0.0 fd: 0.0 | |
| PDF_SRC = 0x0004, // fs: 1.0 fd: 0.0 | | PDF_SRC = 0x0004, // fs: 1.0 fd: 0.0 | |
| | | | |
| skipping to change at line 132 | | skipping to change at line 107 | |
| BF_DEINTERLACE = 0x10, | | BF_DEINTERLACE = 0x10, | |
| BF_SRC_COLORKEY = 0x20, | | BF_SRC_COLORKEY = 0x20, | |
| BF_DST_COLORKEY = 0x40, | | BF_DST_COLORKEY = 0x40, | |
| BF_XOR = 0x80 | | BF_XOR = 0x80 | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| | | enum jhorizontal_align_t { | |
| | | LEFT_HALIGN, | |
| | | CENTER_HALIGN, | |
| | | RIGHT_HALIGN, | |
| | | JUSTIFY_HALIGN | |
| | | }; | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | enum jvertical_align_t { | |
| | | TOP_VALIGN, | |
| | | CENTER_VALIGN, | |
| | | BOTTOM_VALIGN, | |
| | | JUSTIFY_VALIGN | |
| | | }; | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| enum jline_type_t { | | enum jline_type_t { | |
| RECT_LINE = 0x01, | | RECT_LINE = 0x01, | |
| ROUND_LINE = 0x02 | | ROUND_LINE = 0x02 | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| enum jline_style_t { | | enum jline_style_t { | |
| SOLID_LINE = 0x01, | | SOLID_LINE = 0x01, | |
| DASH_LINE = 0x02, | | DASH_LINE = 0x02, | |
| DASH_DOT_LINE = 0x04, | | DASH_DOT_LINE = 0x04, | |
| DOT_LINE = 0x08 | | DOT_LINE = 0x08 | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| enum jalign_t { | | | |
| LEFT_ALIGN, | | | |
| CENTER_ALIGN, | | | |
| RIGHT_ALIGN, | | | |
| JUSTIFY_ALIGN | | | |
| }; | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| struct jpoint_t { | | struct jpoint_t { | |
| int x; | | int x; | |
| int y; | | int y; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| struct jsize_t { | | struct jsize_t { | |
| | | | |
| skipping to change at line 262 | | skipping to change at line 248 | |
| | | | |
| private: | | private: | |
| struct edge_t { | | struct edge_t { | |
| int yUpper; | | int yUpper; | |
| double xIntersect; | | double xIntersect; | |
| double dxPerScan; | | double dxPerScan; | |
| struct edge_t *next; | | struct edge_t *next; | |
| }; | | }; | |
| | | | |
| private: | | private: | |
|
| static Font *_default_font; | | | |
| | | | |
| jthread::Mutex graphics_mutex; | | jthread::Mutex graphics_mutex; | |
| | | | |
| #ifdef DIRECTFB_UI | | #ifdef DIRECTFB_UI | |
| IDirectFBSurface *surface; | | IDirectFBSurface *surface; | |
| #endif | | #endif | |
| | | | |
| struct jregion_t _clip; | | struct jregion_t _clip; | |
| struct jpoint_t _translate; | | struct jpoint_t _translate; | |
| struct jsize_t _screen; | | struct jsize_t _screen; | |
| struct jsize_t _scale; | | struct jsize_t _scale; | |
| | | | |
| skipping to change at line 308 | | skipping to change at line 292 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual ~Graphics(); | | virtual ~Graphics(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| static void SetDefaultFont(Font *font); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| static Font * GetDefaultFont(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual void * GetNativeSurface(); | | virtual void * GetNativeSurface(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void SetNativeSurface(void *surface); | | virtual void SetNativeSurface(void *surface); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| | | | |
| skipping to change at line 680 | | skipping to change at line 652 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void DrawString(std::string s, int x, int y); | | virtual void DrawString(std::string s, int x, int y); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void DrawString(std::string full_text, int x, int y,
int width, int height, jalign_t align = JUSTIFY_ALIGN); | | virtual void DrawString(std::string full_text, int x, int y,
int width, int height, jhorizontal_align_t halign = JUSTIFY_HALIGN, jverti
cal_align_t valign = CENTER_VALIGN); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual uint32_t GetRGB(int xp, int yp, uint32_t pixel = 0xf
f000000); | | virtual uint32_t GetRGB(int xp, int yp, uint32_t pixel = 0xf
f000000); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| | | | |
| skipping to change at line 716 | | skipping to change at line 688 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void Reset(); | | virtual void Reset(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void Lock(); | | virtual void Lock(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void Unlock(); | | virtual void Unlock(); | |
| | | | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 9 change blocks. |
| 78 lines changed or deleted | | 35 lines changed or added | |
|
| jgridbaglayout.h | | jgridbaglayout.h | |
| | | | |
| skipping to change at line 287 | | skipping to change at line 287 | |
| this->descent = 0; | | this->descent = 0; | |
| this->centerPadding = 0; | | this->centerPadding = 0; | |
| this->centerOffset = 0; | | this->centerOffset = 0; | |
| this->baselineResizeBehavior = CB_OTHER; | | this->baselineResizeBehavior = CB_OTHER; | |
| } | | } | |
| | | | |
| virtual ~GridBagConstraints() | | virtual ~GridBagConstraints() | |
| { | | { | |
| } | | } | |
| | | | |
|
| bool IsVerticallyResizable() | | virtual bool IsVerticallyResizable() | |
| { | | { | |
| return (fill == GBLC_BOTH || fill == GBLC_VERTICAL); | | return (fill == GBLC_BOTH || fill == GBLC_VERTICAL); | |
| } | | } | |
| }; | | }; | |
| | | | |
|
| class GridBagLayoutInfo { | | class GridBagLayoutInfo{ | |
| | | | |
| public: | | public: | |
| int width, | | int width, | |
| height;
// number of cells: horizontal and vertical | | height;
// number of cells: horizontal and vertical | |
| int startx, | | int startx, | |
| starty;
// starting point for layout | | starty;
// starting point for layout | |
| int *minWidth, // largest minWidth
in each column | | int *minWidth, // largest minWidth
in each column | |
| *minHeight,
// largest minHeight in
each row | | *minHeight,
// largest minHeight in
each row | |
| *maxAscent,
// Max ascent (baseline
) | | *maxAscent,
// Max ascent (baseline
) | |
| *maxDescent;
// Max descent (height - baseli
ne) | | *maxDescent;
// Max descent (height - baseli
ne) | |
| | | | |
| skipping to change at line 372 | | skipping to change at line 372 | |
| | | | |
| if (weightY != NULL) { | | if (weightY != NULL) { | |
| delete weightY; | | delete weightY; | |
| } | | } | |
| | | | |
| if (baselineType != NULL) { | | if (baselineType != NULL) { | |
| delete baselineType; | | delete baselineType; | |
| } | | } | |
| } | | } | |
| | | | |
|
| bool HasConstantDescent(int row) | | virtual bool HasConstantDescent(int row) | |
| { | | { | |
| int ordinal = 0; // TODO:: Component.BaselineResizeB
ehavior.CONSTANT_DESCENT.ordinal(); | | int ordinal = 0; // TODO:: Component.BaselineResizeB
ehavior.CONSTANT_DESCENT.ordinal(); | |
| | | | |
| return ((baselineType[row] & (1 << ordinal)) != 0); | | return ((baselineType[row] & (1 << ordinal)) != 0); | |
| } | | } | |
| | | | |
|
| bool HasBaseline(int row) | | virtual bool HasBaseline(int row) | |
| { | | { | |
| return (hasBaseline && baselineType[row] != 0); | | return (hasBaseline && baselineType[row] != 0); | |
| } | | } | |
| }; | | }; | |
| | | | |
| class GridBagLayout : public Layout{ | | class GridBagLayout : public Layout{ | |
| | | | |
| private: | | private: | |
| std::map<Component *, GridBagConstraints *> comptable; | | std::map<Component *, GridBagConstraints *> comptable; | |
| GridBagConstraints *defaultConstraints; | | GridBagConstraints *defaultConstraints; | |
| | | | |
| skipping to change at line 415 | | skipping to change at line 415 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual ~GridBagLayout(); | | virtual ~GridBagLayout(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetConstraints(Component *comp, GridBagConstraints *con
straints); | | virtual void SetConstraints(Component *comp, GridBagConstrai
nts *constraints); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| GridBagConstraints * GetConstraints(Component *comp); | | virtual GridBagConstraints * GetConstraints(Component *comp)
; | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| GridBagConstraints * LookupConstraints(Component *comp); | | virtual GridBagConstraints * LookupConstraints(Component *co
mp); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveConstraints(Component *comp); | | virtual void RemoveConstraints(Component *comp); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| jpoint_t GetLayoutOrigin(); | | virtual jpoint_t GetLayoutOrigin(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void AddLayoutComponent(Component *comp, GridBagConstraints
*constraints); | | virtual void AddLayoutComponent(Component *comp, GridBagCons
traints *constraints); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveLayoutComponent(Component *comp); | | virtual void RemoveLayoutComponent(Component *comp); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| GridBagLayoutInfo * GetLayoutInfo(Container *parent, int siz
eflag); | | virtual GridBagLayoutInfo * GetLayoutInfo(Container *parent,
int sizeflag); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| int64_t * PreInitMaximumArraySizes(Container *parent); | | virtual int64_t * PreInitMaximumArraySizes(Container *parent
); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| bool CalculateBaseline(Component *c, GridBagConstraints *con
straints, jsize_t size); | | virtual bool CalculateBaseline(Component *c, GridBagConstrai
nts *constraints, jsize_t size); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void AdjustForGravity(GridBagConstraints *constraints, jregi
on_t *r); | | virtual void AdjustForGravity(GridBagConstraints *constraint
s, jregion_t *r); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void AlignOnBaseline(GridBagConstraints *cons, jregion_t *r,
int cellY, int cellHeight); | | virtual void AlignOnBaseline(GridBagConstraints *cons, jregi
on_t *r, int cellY, int cellHeight); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void AlignAboveBaseline(GridBagConstraints *cons, jregion_t
*r, int cellY, int cellHeight); | | virtual void AlignAboveBaseline(GridBagConstraints *cons, jr
egion_t *r, int cellY, int cellHeight); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void AlignBelowBaseline(GridBagConstraints *cons, jregion_t
*r, int cellY, int cellHeight); | | virtual void AlignBelowBaseline(GridBagConstraints *cons, jr
egion_t *r, int cellY, int cellHeight); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void CenterVertically(GridBagConstraints *cons, jregion_t *r
, int cellHeight); | | virtual void CenterVertically(GridBagConstraints *cons, jreg
ion_t *r, int cellHeight); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| jsize_t GetMinSize(Container *parent, GridBagLayoutInfo *inf
o); | | virtual jsize_t GetMinSize(Container *parent, GridBagLayoutI
nfo *info); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void ArrangeGrid(Container *parent); | | virtual void ArrangeGrid(Container *parent); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual jsize_t GetMinimumLayoutSize(Container *parent); | | virtual jsize_t GetMinimumLayoutSize(Container *parent); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| | | | |
End of changes. 21 change blocks. |
| 21 lines changed or deleted | | 21 lines changed or added | |
|
| jindexedbuffer.h | | jindexedbuffer.h | |
| | | | |
| skipping to change at line 30 | | skipping to change at line 30 | |
| #ifndef J_INDEXEDBUFFER_H | | #ifndef J_INDEXEDBUFFER_H | |
| #define J_INDEXEDBUFFER_H | | #define J_INDEXEDBUFFER_H | |
| | | | |
| #include "jsemaphore.h" | | #include "jsemaphore.h" | |
| #include "jcondition.h" | | #include "jcondition.h" | |
| #include "jmutex.h" | | #include "jmutex.h" | |
| #include "jobject.h" | | #include "jobject.h" | |
| | | | |
| #include <cstring> | | #include <cstring> | |
| | | | |
|
| | | #include <stdint.h> | |
| | | #include <limits.h> | |
| | | | |
| #ifdef _WIN32 | | #ifdef _WIN32 | |
| #include <windows.h> | | #include <windows.h> | |
| #else | | #else | |
| #endif | | #endif | |
| | | | |
| #define MAX_BUFFER_SIZE 1048576 | | #define MAX_BUFFER_SIZE 1048576 | |
| | | | |
| #define MIN_CHUNK_SIZE 1024 | | #define MIN_CHUNK_SIZE 1024 | |
|
| #define MAX_CHUNK_SIZE 1048576 | | #define MAX_CHUNK_SIZE INT_MAX | |
| | | | |
| namespace jthread { | | namespace jthread { | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| enum jbuffer_type_t { | | enum jbuffer_type_t { | |
| BUFFER_BLOCK, | | BUFFER_BLOCK, | |
| BUFFER_NONBLOCK | | BUFFER_NONBLOCK | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * \brief Buffer node. | | * \brief Buffer node. | |
| * | | * | |
| */ | | */ | |
| struct jringbuffer_t { | | struct jringbuffer_t { | |
|
| uint8_t*data; // buffer | | uint8_t *data; // buffer | |
| int size; // size of buffer | | int size; // size of buffer | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * \brief IndexedBuffer. | | * \brief IndexedBuffer. | |
| * | | * | |
| * WARNNING:: add -DSINGLE_WAIT_CONDITION to Makefile flags | | * WARNNING:: add -DSINGLE_WAIT_CONDITION to Makefile flags | |
| * | | * | |
| * @author Jeff Ferr | | * @author Jeff Ferr | |
| */ | | */ | |
| | | | |
| skipping to change at line 93 | | skipping to change at line 96 | |
| Mutex _mutex; | | Mutex _mutex; | |
| #ifdef _WIN32 | | #ifdef _WIN32 | |
| /** \brief */ | | /** \brief */ | |
| Semaphore _semaphore; | | Semaphore _semaphore; | |
| #else | | #else | |
| /** \brief */ | | /** \brief */ | |
| Condition _semaphore; | | Condition _semaphore; | |
| #endif | | #endif | |
| | | | |
| public: | | public: | |
|
| /** | | /** | |
| * \brief Construtor. | | * \brief Construtor. | |
| * | | * | |
| */ | | */ | |
| IndexedBuffer(int size = 256, int chunk = MIN_CHUNK_SIZE, jbuffer_t | | IndexedBuffer(int size = 256, int chunk = MIN_CHUNK_SIZE, jb | |
| ype_t type = BUFFER_BLOCK); | | uffer_type_t type = BUFFER_BLOCK); | |
| | | | |
|
| /** | | /** | |
| * \brief Destrutor virtual. | | * \brief Destrutor virtual. | |
| * | | * | |
| */ | | */ | |
| virtual ~IndexedBuffer(); | | virtual ~IndexedBuffer(); | |
| | | | |
|
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| void Reset(); | | void Reset(); | |
| | | | |
|
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| void Release(); | | void Release(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | void SetChunkSize(int size); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | void SetNodesSize(int size); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | int GetChunkSize(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | int GetNodesSize(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| int GetIndex(int *rindex, int *pindex); | | int GetIndex(int *rindex, int *pindex); | |
| | | | |
|
| /** | | /** | |
| * \brief Returns the current size of buffer. | | * \brief Returns the current size of buffer. | |
| * | | * | |
| * \return -1 caso os indices sejam invalidos, 0 caso esteja
vazio, caso contrario | | * \return -1 caso os indices sejam invalidos, 0 caso esteja
vazio, caso contrario | |
| * retorna o tamanho atual do buffer. | | * retorna o tamanho atual do buffer. | |
|
| * | | * | |
| */ | | */ | |
| int GetAvailable(int *rindex, int *pindex); | | int GetAvailable(int *rindex, int *pindex); | |
| | | | |
|
| /** | | /** | |
| * \brief Read a chunk. | | * \brief Read a chunk. | |
| * | | * | |
| * \param data Data deve conter no minimo o tamanho de chunk
. A funcao retorna o tamanho lido em size. | | * \param data Data deve conter no minimo o tamanho de chunk
. A funcao retorna o tamanho lido em size. | |
|
| * | | * | |
| */ | | */ | |
| int Read(jringbuffer_t *data, int *rindex, int *pindex); | | int Read(jringbuffer_t *data, int *rindex, int *pindex); | |
| | | | |
|
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| int Write(const uint8_t*data, int size); | | int Write(uint8_t *data, int size); | |
| | | | |
|
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| int Write(jringbuffer_t *data); | | int Write(jringbuffer_t *data); | |
| | | | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 13 change blocks. |
| 43 lines changed or deleted | | 70 lines changed or added | |
|
| jinputmanager.h | | jinputmanager.h | |
| | | | |
| skipping to change at line 65 | | skipping to change at line 65 | |
| _event = NULL; | | _event = NULL; | |
| } | | } | |
| | | | |
| static void ProcessEvent(KeyListener *listener, KeyEvent *ev
ent) | | static void ProcessEvent(KeyListener *listener, KeyEvent *ev
ent) | |
| { | | { | |
| listener->KeyPressed(event); | | listener->KeyPressed(event); | |
| | | | |
| delete event; | | delete event; | |
| } | | } | |
| | | | |
|
| void SetListener(KeyListener *listener, KeyEvent *event) | | virtual void SetListener(KeyListener *listener, KeyEvent *ev
ent) | |
| { | | { | |
| _listener = listener; | | _listener = listener; | |
| _event = event; | | _event = event; | |
| } | | } | |
| | | | |
| virtual void Run() | | virtual void Run() | |
| { | | { | |
| KeyProcess::ProcessEvent(_listener, _event); | | KeyProcess::ProcessEvent(_listener, _event); | |
| } | | } | |
| | | | |
| | | | |
| skipping to change at line 112 | | skipping to change at line 112 | |
| listener->MouseReleased(event); | | listener->MouseReleased(event); | |
| } else if (event->GetType() == JMOUSE_MOVED_EVENT) { | | } else if (event->GetType() == JMOUSE_MOVED_EVENT) { | |
| listener->MouseMoved(event); | | listener->MouseMoved(event); | |
| } else if (event->GetType() == JMOUSE_WHEEL_EVENT) { | | } else if (event->GetType() == JMOUSE_WHEEL_EVENT) { | |
| listener->MouseWheel(event); | | listener->MouseWheel(event); | |
| } | | } | |
| | | | |
| delete event; | | delete event; | |
| } | | } | |
| | | | |
|
| void SetListener(MouseListener *listener, MouseEvent *event) | | virtual void SetListener(MouseListener *listener, MouseEvent
*event) | |
| { | | { | |
| _listener = listener; | | _listener = listener; | |
| _event = event; | | _event = event; | |
| } | | } | |
| | | | |
| virtual void Run() | | virtual void Run() | |
| { | | { | |
| MouseProcess::ProcessEvent(_listener, _event); | | MouseProcess::ProcessEvent(_listener, _event); | |
| } | | } | |
| | | | |
| | | | |
| skipping to change at line 195 | | skipping to change at line 195 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| static InputManager * GetInstance(); | | static InputManager * GetInstance(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetWorkingScreenSize(int width, int height); | | virtual void SetWorkingScreenSize(int width, int height); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SkipKeyEvents(bool b); | | virtual void SkipKeyEvents(bool b); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SkipMouseEvents(bool b); | | virtual void SkipMouseEvents(bool b); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetKeyEventsEnabled(bool b); | | virtual void SetKeyEventsEnabled(bool b); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetMouseEventsEnabled(bool b); | | virtual void SetMouseEventsEnabled(bool b); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| bool IsKeyEventsEnabled(); | | virtual bool IsKeyEventsEnabled(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| bool IsMouseEventsEnabled(); | | virtual bool IsMouseEventsEnabled(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void PostEvent(KeyEvent *event); | | virtual void PostEvent(KeyEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void PostEvent(MouseEvent *event); | | virtual void PostEvent(MouseEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RegisterKeyListener(KeyListener *listener); | | virtual void RegisterKeyListener(KeyListener *listener); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveKeyListener(KeyListener *listener); | | virtual void RemoveKeyListener(KeyListener *listener); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void DispatchEvent(KeyEvent *event); | | virtual void DispatchKeyEvent(KeyEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| std::vector<KeyListener *> & GetKeyListeners(); | | virtual std::vector<KeyListener *> & GetKeyListeners(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RegisterMouseListener(MouseListener *listener); | | virtual void RegisterMouseListener(MouseListener *listener); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveMouseListener(MouseListener *listener); | | virtual void RemoveMouseListener(MouseListener *listener); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void DispatchEvent(MouseEvent *event); | | virtual void DispatchMouseEvent(MouseEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| std::vector<MouseListener *> & GetMouseListeners(); | | virtual std::vector<MouseListener *> & GetMouseListeners(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void WaitEvents(); | | virtual void WaitEvents(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void Run(); | | virtual void Run(); | |
| | | | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
End of changes. 20 change blocks. |
| 20 lines changed or deleted | | 20 lines changed or added | |
|
| jkeyboard.h | | jkeyboard.h | |
| | | | |
| skipping to change at line 62 | | skipping to change at line 62 | |
| FULL_WEB_KEYBOARD | | FULL_WEB_KEYBOARD | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| * \author Jeff Ferr | | * \author Jeff Ferr | |
| */ | | */ | |
| class Keyboard : public jgui::Frame, public jgui::ButtonListener, public jg
ui::FrameInputListener, public jgui::TextListener { | | class Keyboard : public jgui::Frame, public jgui::ButtonListener, public jg
ui::FrameInputListener, public jgui::TextListener { | |
| | | | |
|
| public: | | | |
| private: | | private: | |
| jthread::Mutex _key_mutex; | | jthread::Mutex _key_mutex; | |
| | | | |
| std::vector<KeyboardListener *> _keyboard_listeners; | | std::vector<KeyboardListener *> _keyboard_listeners; | |
| std::vector<Button *> _buttons; | | std::vector<Button *> _buttons; | |
| TextArea *display; | | TextArea *display; | |
| Component *_current_button; | | Component *_current_button; | |
| | | | |
| jkeyboard_type_t _type; | | jkeyboard_type_t _type; | |
| std::string _text; | | std::string _text; | |
| | | | |
| skipping to change at line 86 | | skipping to change at line 85 | |
| bheight, | | bheight, | |
| _state; | | _state; | |
| float delta; | | float delta; | |
| bool started, | | bool started, | |
| _shift_pressed, | | _shift_pressed, | |
| _show_text, | | _show_text, | |
| _response, | | _response, | |
| _input_locked, | | _input_locked, | |
| _is_password; | | _is_password; | |
| | | | |
|
| public: | | private: | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| Keyboard(int x, int y, jkeyboard_type_t type, bool text_visi
ble = true, bool is_password = false); | | void BuildWebKeyboard(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual ~Keyboard(); | | void BuildFullAlphaNumericKeyboard(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void BuildWebKeyboard(); | | void BuildSmallAlphaNumericKeyboard(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void BuildFullAlphaNumericKeyboard(); | | void BuildFullNumericKeyboard(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void BuildSmallAlphaNumericKeyboard(); | | void BuildSmallNumericKeyboard(); | |
| | | | |
|
| | | public: | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void BuildFullNumericKeyboard(); | | Keyboard(int x, int y, jkeyboard_type_t type, bool text_visi
ble = true, bool is_password = false); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void BuildSmallNumericKeyboard(); | | virtual ~Keyboard(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void SetMaxTextSize(int max); | | virtual void SetTextSize(int max); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void Clear(); | | virtual int GetTextSize(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void SetWrap(bool b); | | virtual void SetWrap(bool b); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| | | | |
| skipping to change at line 187 | | skipping to change at line 187 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void TextChanged(TextEvent *event); | | virtual void TextChanged(TextEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| std::vector<KeyboardListener *> & GetKeyboardListeners(); | | virtual std::vector<KeyboardListener *> & GetKeyboardListene
rs(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RegisterKeyboardListener(KeyboardListener *listener); | | virtual void RegisterKeyboardListener(KeyboardListener *list
ener); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveKeyboardListener(KeyboardListener *listener); | | virtual void RemoveKeyboardListener(KeyboardListener *listen
er); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void DispatchEvent(KeyboardEvent *event); | | virtual void DispatchKeyboardEvent(KeyboardEvent *event); | |
| | | | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 16 change blocks. |
| 15 lines changed or deleted | | 15 lines changed or added | |
|
| jlistbox.h | | jlistbox.h | |
| | | | |
| skipping to change at line 23 | | skipping to change at line 23 | |
| * GNU General Public License for more details.
* | | * GNU General Public License for more details.
* | |
| *
* | | *
* | |
| * You should have received a copy of the GNU General Public License
* | | * You should have received a copy of the GNU General Public License
* | |
| * along with this program; if not, write to the
* | | * along with this program; if not, write to the
* | |
| * Free Software Foundation, Inc.,
* | | * Free Software Foundation, Inc.,
* | |
| * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| #ifndef J_LISTBOX_H | | #ifndef J_LISTBOX_H | |
| #define J_LISTBOX_H | | #define J_LISTBOX_H | |
| | | | |
|
| #include "jbutton.h" | | | |
| #include "jtextarea.h" | | | |
| #include "jselectlistener.h" | | #include "jselectlistener.h" | |
|
| #include "jcomponent.h" | | #include "jitemcomponent.h" | |
| #include "jbuttonlistener.h" | | #include "jbuttonlistener.h" | |
| #include "joffscreenimage.h" | | #include "joffscreenimage.h" | |
| | | | |
| #include "jthread.h" | | #include "jthread.h" | |
| #include "jmutex.h" | | #include "jmutex.h" | |
| | | | |
| #include <string> | | #include <string> | |
| #include <iostream> | | #include <iostream> | |
| #include <vector> | | #include <vector> | |
| | | | |
| #include <stdlib.h> | | #include <stdlib.h> | |
| #include <unistd.h> | | #include <unistd.h> | |
| #include <stdio.h> | | #include <stdio.h> | |
| | | | |
| namespace jgui { | | namespace jgui { | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| enum jlist_item_type_t { | | | |
| TEXT_ITEM, | | | |
| IMAGE_ITEM, | | | |
| EMPTY_ITEM | | | |
| }; | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| enum jlist_scroll_type_t { | | enum jlist_scroll_type_t { | |
| NONE_SCROLL, | | NONE_SCROLL, | |
| SCROLL_ARROW, | | SCROLL_ARROW, | |
| SCROLL_BAR | | SCROLL_BAR | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| | | | |
| skipping to change at line 78 | | skipping to change at line 66 | |
| NONE_SELECTION, | | NONE_SELECTION, | |
| SINGLE_SELECTION, | | SINGLE_SELECTION, | |
| MULTI_SELECTION | | MULTI_SELECTION | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| * \author Jeff Ferr | | * \author Jeff Ferr | |
| */ | | */ | |
|
| class ListBox : public ButtonListener, public Component{ | | class ListBox : public jgui::ItemComponent{ | |
| | | | |
| private: | | | |
| struct listbox_t { | | | |
| std::string text; | | | |
| bool check; | | | |
| jlist_item_type_t type; | | | |
| jgui::OffScreenImage *image; | | | |
| }; | | | |
| | | | |
| private: | | private: | |
|
| std::vector<SelectListener *> _listbox_listeners; | | | |
| std::vector<listbox_t> _items; | | | |
| int bx, | | | |
| by, | | | |
| bwidth, | | | |
| bheight, | | | |
| _item_size, | | | |
| _index, | | | |
| _top_index, | | | |
| _selected_index; | | | |
| jcolor_t _item_color; | | | |
| float delta; | | | |
| bool _input_locked, | | | |
| _centered_interaction, | | | |
| _loop; | | | |
| jalign_t _align; | | | |
| jlist_scroll_type_t _scroll; | | jlist_scroll_type_t _scroll; | |
| jlist_selection_type_t _selection; | | jlist_selection_type_t _selection; | |
|
| | | int _item_size, | |
| | | _top_index, | |
| | | _selected_index; | |
| | | bool _input_locked, | |
| | | _centered_interaction; | |
| | | | |
| public: | | public: | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| ListBox(int x = 0, int y = 0, int width = 0, int height = 0)
; | | ListBox(int x = 0, int y = 0, int width = 0, int height = 0)
; | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual ~ListBox(); | | virtual ~ListBox(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetCenteredInteraction(bool b); | | virtual void SetCenteredInteraction(bool b); | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetScrollType(jlist_scroll_type_t type); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetSelectionType(jlist_selection_type_t type); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| int GetVisibleItems(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetLoop(bool loop); | | | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetAlign(jalign_t align); | | virtual void SetScrollType(jlist_scroll_type_t type); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| jalign_t GetAlign(); | | virtual void SetSelectionType(jlist_selection_type_t type); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetCurrentIndex(int i); | | virtual int GetVisibleItems(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| bool IsSelected(int i); | | virtual bool IsSelected(int i); | |
| | | | |
| /** | | /** | |
| * \brief Invert current selection state from item. Use with
IsSelected() to avoid | | * \brief Invert current selection state from item. Use with
IsSelected() to avoid | |
| * unexpected states. | | * unexpected states. | |
| * | | * | |
| */ | | */ | |
|
| void SetSelected(int i); | | virtual void SetSelected(int i); | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void Select(int i); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void Deselect(int i); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void AddEmptyItem(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void AddItem(std::string text); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void AddItem(std::string text, std::string image); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| std::string GetValue(int index); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| std::string GetCurrentValue(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| int GetCurrentIndex(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| int GetSelectedIndex(); | | | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| int GetItemsSize(); | | virtual void Select(int i); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveItem(int index); | | virtual void Deselect(int i); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveAll(); | | virtual int GetSelectedIndex(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| int GetItemSize(); | | virtual int GetItemSize(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetItemSize(int size); | | virtual void SetItemSize(int size); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| jcolor_t GetItemColor(); | | virtual void SetCurrentIndex(int i); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetItemColor(jcolor_t color); | | virtual void SetForegroundColor(int red, int green, int blue
, int alpha); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetItemColor(int red, int green, int blue, int alpha); | | virtual void SetForegroundFocusColor(int red, int green, int
blue, int alpha); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual bool ProcessEvent(KeyEvent *event); | | virtual bool ProcessEvent(KeyEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual bool ProcessEvent(MouseEvent *event); | | virtual bool ProcessEvent(MouseEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void Paint(Graphics *g); | | virtual jsize_t GetPreferredSize(); | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RegisterSelectListener(SelectListener *listener); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RemoveSelectListener(SelectListener *listener); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void DispatchEvent(SelectEvent *event); | | | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| std::vector<SelectListener *> & GetSelectListeners(); | | virtual void Paint(Graphics *g); | |
| | | | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 22 change blocks. |
| 150 lines changed or deleted | | 23 lines changed or added | |
|
| jmenu.h | | jmenu.h | |
| | | | |
| skipping to change at line 23 | | skipping to change at line 23 | |
| * GNU General Public License for more details.
* | | * GNU General Public License for more details.
* | |
| *
* | | *
* | |
| * You should have received a copy of the GNU General Public License
* | | * You should have received a copy of the GNU General Public License
* | |
| * along with this program; if not, write to the
* | | * along with this program; if not, write to the
* | |
| * Free Software Foundation, Inc.,
* | | * Free Software Foundation, Inc.,
* | |
| * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| #ifndef J_MENU_H | | #ifndef J_MENU_H | |
| #define J_MENU_H | | #define J_MENU_H | |
| | | | |
|
| #include "jmenulistener.h" | | | |
| #include "jframe.h" | | #include "jframe.h" | |
|
| #include "jlistbox.h" | | #include "jframeinputlistener.h" | |
| #include "jmenuexception.h" | | | |
| #include "joffscreenimage.h" | | #include "joffscreenimage.h" | |
| #include "jmouselistener.h" | | #include "jmouselistener.h" | |
|
| | | #include "jitemcomponent.h" | |
| | | #include "jthememanager.h" | |
| | | | |
| #include <string> | | #include <string> | |
| #include <iostream> | | #include <iostream> | |
| #include <vector> | | #include <vector> | |
| | | | |
| #include <stdlib.h> | | #include <stdlib.h> | |
| #include <unistd.h> | | #include <unistd.h> | |
| #include <stdio.h> | | #include <stdio.h> | |
| | | | |
| namespace jgui { | | namespace jgui { | |
| | | | |
| skipping to change at line 52 | | skipping to change at line 52 | |
| * | | * | |
| */ | | */ | |
| enum jmenu_align_t { | | enum jmenu_align_t { | |
| MENU_ALIGN, | | MENU_ALIGN, | |
| SUBMENU_ALIGN | | SUBMENU_ALIGN | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
|
| */ | | | |
| enum jmenuitem_type_t { | | | |
| TEXT_MENU_ITEM, | | | |
| IMAGE_MENU_ITEM, | | | |
| CHECK_MENU_ITEM, | | | |
| EMPTY_MENU_ITEM | | | |
| }; | | | |
| | | | |
| class MenuItem; | | | |
| class MenuComponent; | | | |
| class ComboMenuComponent; | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| * \author Jeff Ferr | | * \author Jeff Ferr | |
| */ | | */ | |
|
| class Menu : public jgui::Frame, public jgui::FrameInputListener{ | | class Menu : public jgui::ItemComponent, public jgui::FrameInputListener, p | |
| | | ublic jgui::ThemeListener{ | |
| friend class MenuComponent; | | | |
| | | | |
| private: | | private: | |
| jthread::Mutex _menu_mutex; | | jthread::Mutex _menu_mutex; | |
|
| | | jthread::Condition _menu_sem; | |
| | | | |
| std::vector<Menu *> _menus; | | std::vector<Menu *> _menus; | |
|
| std::vector<MenuListener *> _menu_listeners; | | jgui::Frame *_frame; | |
| MenuItem *_current_item; | | jgui::OffScreenImage *prefetch; | |
| MenuComponent *_list; | | | |
| jmenu_align_t _menu_align; | | jmenu_align_t _menu_align; | |
|
| int _visible_items; | | std::string _title; | |
| | | int _top_index, | |
| | | _item_size, | |
| | | _visible_items, | |
| | | _centered_interaction; | |
| | | | |
| private: | | private: | |
|
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| virtual void MousePressed(MouseEvent *event); | | virtual void MousePressed(MouseEvent *event); | |
|
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| virtual void MouseReleased(MouseEvent *event); | | virtual void MouseReleased(MouseEvent *event); | |
|
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| virtual void MouseClicked(MouseEvent *event); | | virtual void MouseClicked(MouseEvent *event); | |
|
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| virtual void MouseMoved(MouseEvent *event); | | virtual void MouseMoved(MouseEvent *event); | |
|
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| virtual void MouseWheel(MouseEvent *event); | | virtual void MouseWheel(MouseEvent *event); | |
| | | | |
| public: | | public: | |
|
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| Menu(int x, int y, int width, int visible_items); | | Menu(int x, int y, int width, int visible_items); | |
|
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| virtual ~Menu(); | | virtual ~Menu(); | |
| | | | |
|
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| virtual void SetTitle(std::string title); | | virtual void SetTitle(std::string title); | |
|
| virtual bool Show(bool modal = true); | | | |
| | | | |
| void SetMenuAlign(jmenu_align_t align); | | | |
| int GetItemsSize(); | | | |
| int GetVisibleItems(); | | | |
| void SetLoop(bool loop); | | | |
| void SetCurrentIndex(int i); | | | |
| void AddMenuItem(MenuItem *item); | | | |
| void AddMenuItem(MenuItem *item, int index); | | | |
| void AddMenuItems(std::vector<MenuItem *> &items); | | | |
| Menu * GetCurrentMenu(); | | | |
| MenuItem * GetCurrentItem(); | | | |
| int GetCurrentIndex(); | | | |
| void RemoveAll(); | | | |
| | | | |
|
| jcolor_t GetItemColor(); | | /** | |
| | | * \brief | |
| void SetItemColor(jcolor_t color); | | * | |
| void SetBackgroundColor(jcolor_t color); | | */ | |
| void SetForegroundColor(jcolor_t color); | | virtual void SetBounds(int x, int y, int w, int h); | |
| void SetItemColor(int red, int green, int blue, int alpha); | | | |
| void SetBackgroundColor(int red, int green, int blue, int al | | | |
| pha); | | | |
| void SetForegroundColor(int red, int green, int blue, int al | | | |
| pha); | | | |
| | | | |
| void RegisterMenuListener(MenuListener *listener); | | | |
| void RemoveMenuListener(MenuListener *listener); | | | |
| void DispatchEvent(MenuEvent *event); | | | |
| std::vector<MenuListener *> & GetMenuListeners(); | | | |
| | | | |
| virtual void Paint(Graphics *g); | | | |
| virtual void InputChanged(KeyEvent *event); | | | |
| }; | | | |
| | | | |
| class MenuItem : public virtual jcommon::Object{ | | | |
| | | | |
|
| friend class MenuComponent; | | /** | |
| friend class ComboMenuComponent; | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetLocation(int x, int y); | |
| | | | |
|
| private: | | /** | |
| std::vector<MenuItem *> _childs; | | * \brief | |
| Menu *_parent; | | * | |
| OffScreenImage *_prefetch; | | */ | |
| std::string _value, | | virtual void SetSize(int w, int h); | |
| _image; | | | |
| jmenuitem_type_t _type; | | | |
| bool _is_checked, | | | |
| _is_visible, | | | |
| _enabled; | | | |
| | | | |
|
| public: | | /** | |
| MenuItem() | | * \brief | |
| { | | * | |
| jcommon::Object::SetClassName("jcommon::MenuItem"); | | */ | |
| | | virtual void Move(int x, int y); | |
| | | | |
|
| _enabled = true; | | /** | |
| _parent = NULL; | | * \brief | |
| _prefetch = NULL; | | * | |
| _is_checked = false; | | */ | |
| _is_visible = true; | | virtual jpoint_t GetLocation(); | |
| _type = EMPTY_MENU_ITEM; | | | |
| } | | | |
| | | | |
|
| MenuItem(std::string value) | | /** | |
| { | | * \brief | |
| jcommon::Object::SetClassName("jcommon::MenuItem"); | | * | |
| | | */ | |
| | | virtual jsize_t GetSize(); | |
| | | | |
|
| _enabled = true; | | /** | |
| _parent = NULL; | | * \brief | |
| _prefetch = NULL; | | * | |
| _value = value; | | */ | |
| _is_checked = false; | | virtual int GetX(); | |
| _is_visible = true; | | | |
| _type = TEXT_MENU_ITEM; | | | |
| } | | | |
| | | | |
|
| MenuItem(std::string value, std::string image) | | /** | |
| { | | * \brief | |
| jcommon::Object::SetClassName("jcommon::MenuItem"); | | * | |
| | | */ | |
| | | virtual int GetY(); | |
| | | | |
|
| _enabled = true; | | /** | |
| _parent = NULL; | | * \brief | |
| _prefetch = NULL; | | * | |
| _image = image; | | */ | |
| _value = value; | | virtual int GetWidth(); | |
| _is_checked = false; | | | |
| _is_visible = true; | | | |
| _type = IMAGE_MENU_ITEM; | | | |
| } | | | |
| | | | |
|
| MenuItem(std::string value, bool checked) | | /** | |
| { | | * \brief | |
| jcommon::Object::SetClassName("jcommon::MenuItem"); | | * | |
| | | */ | |
| | | virtual int GetHeight(); | |
| | | | |
|
| _enabled = true; | | /** | |
| _parent = NULL; | | * \brief | |
| _prefetch = NULL; | | * | |
| _value = value; | | */ | |
| _is_checked = checked; | | virtual bool Show(bool modal = true); | |
| _is_visible = true; | | | |
| _type = CHECK_MENU_ITEM; | | | |
| } | | | |
| | | | |
|
| ~MenuItem() | | /** | |
| { | | * \brief | |
| } | | * | |
| | | */ | |
| | | virtual bool Hide(); | |
| | | | |
|
| Menu * GetParent() | | /** | |
| { | | * \brief | |
| return _parent; | | * | |
| } | | */ | |
| | | virtual void Release(); | |
| | | | |
|
| std::vector<MenuItem *> & GetSubItems() | | /** | |
| { | | * \brief | |
| return _childs; | | * | |
| } | | */ | |
| | | virtual void SetCenteredInteraction(bool b); | |
| | | | |
|
| void SetEnabled(bool b) | | /** | |
| { | | * \brief | |
| _enabled = b; | | * | |
| } | | */ | |
| | | virtual void SetMenuAlign(jmenu_align_t align); | |
| | | | |
|
| bool GetEnabled() | | /** | |
| { | | * \brief | |
| return _enabled; | | * | |
| } | | */ | |
| | | virtual int GetVisibleItems(); | |
| | | | |
|
| void SetVisible(bool b) | | /** | |
| { | | * \brief | |
| _is_visible = b; | | * | |
| } | | */ | |
| | | virtual Menu * GetCurrentMenu(); | |
| | | | |
|
| bool IsVisible() | | /** | |
| { | | * \brief | |
| return _is_visible; | | * | |
| } | | */ | |
| | | virtual void SetItemColor(int red, int green, int blue, int | |
| | | alpha); | |
| | | | |
|
| bool IsSelected() | | /** | |
| { | | * \brief | |
| return _is_checked; | | * | |
| } | | */ | |
| | | virtual void SetItemForegroundColor(int red, int green, int | |
| | | blue, int alpha); | |
| | | | |
|
| void SetSelected(bool b) | | /** | |
| { | | * \brief | |
| if (_is_checked == b) { | | * | |
| return; | | */ | |
| } | | virtual void SetBackgroundColor(int red, int green, int blue | |
| | | , int alpha); | |
| | | | |
|
| _is_checked = b; | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetForegroundColor(int red, int green, int blue | |
| | | , int alpha); | |
| | | | |
| /* | | /* | |
|
| if (_parent != NULL) { | | * \brief | |
| _parent->Repaint(); | | * | |
| } | | */ | |
| */ | | virtual void SetCurrentIndex(int i); | |
| } | | | |
| | | | |
| void SetParent(Menu *parent) | | | |
| { | | | |
| _parent = parent; | | | |
| } | | | |
| | | | |
| void AddSubItem(MenuItem *item) | | | |
| { | | | |
| if (_type == jgui::CHECK_MENU_ITEM) { | | | |
| throw MenuException("Item cannot accept childs"); | | | |
| } | | | |
| | | | |
| _childs.push_back(item); | | | |
| } | | | |
| | | | |
| void AddSubItem(MenuItem *item, int index) | | | |
| { | | | |
| if (index > (int)_childs.size()) { | | | |
| index = _childs.size(); | | | |
| } | | | |
| | | | |
| _childs.insert(_childs.begin()+index, item); | | | |
| } | | | |
| | | | |
| void AddSubItems(std::vector<MenuItem *> items) | | | |
| { | | | |
| for (std::vector<MenuItem *>::iterator i=items.begin(); i!=i | | | |
| tems.end(); i++) { | | | |
| _childs.push_back((*i)); | | | |
| } | | | |
| } | | | |
| | | | |
| void RemoveSubItem(int index) | | | |
| { | | | |
| if (_childs.size() > 0 && index < (int)_childs.size()) { | | | |
| _childs.erase(_childs.begin()+index); | | | |
| } | | | |
| } | | | |
| | | | |
| void RemoveSubItem(MenuItem *item) | | | |
| { | | | |
| std::vector<MenuItem *>::iterator i = std::find(_childs.begi | | | |
| n(), _childs.end(), item); | | | |
| | | | |
| if (i != _childs.end()) { | | | |
| _childs.erase(i); | | | |
| } | | | |
| } | | | |
| | | | |
| std::string GetValue() | | | |
| { | | | |
| return _value; | | | |
| } | | | |
| | | | |
| std::string GetImage() | | | |
| { | | | |
| return _image; | | | |
| } | | | |
| | | | |
| jmenuitem_type_t GetType() | | | |
| { | | | |
| return _type; | | | |
| } | | | |
| | | | |
|
| }; | | /* | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual Item * GetCurrentItem(); | |
| | | | |
|
| class MenuComponent : public Component{ | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual int GetCurrentIndex(); | |
| | | | |
|
| friend class Menu; | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void Repaint(); | |
| | | | |
|
| private: | | /** | |
| std::vector<MenuItem *>_items; | | * \brief | |
| OffScreenImage *prefetch; | | * | |
| Menu *_menu; | | */ | |
| int bx, | | virtual void Paint(Graphics *g); | |
| by, | | | |
| bwidth, | | | |
| bheight, | | | |
| _item_size, | | | |
| _index, | | | |
| _top_index, | | | |
| _visible_items, | | | |
| _paint_count, | | | |
| _vertical_gap, | | | |
| _horizontal_gap; | | | |
| jcolor_t _item_color; | | | |
| float delta; | | | |
| bool _input_locked, | | | |
| _arrows_visible, | | | |
| _loop, | | | |
| _centered_interaction; | | | |
| | | | |
|
| void SetMenu(Menu *menu); | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void InputChanged(KeyEvent *event); | |
| | | | |
|
| public: | | /** | |
| MenuComponent(int x, int y, int width, int visible_items); | | * \brief | |
| virtual ~MenuComponent(); | | * | |
| | | */ | |
| | | virtual void RegisterInputListener(FrameInputListener *liste | |
| | | ner); | |
| | | | |
|
| void SetCenteredInteraction(bool b); | | /** | |
| void SetLoop(bool loop); | | * \brief | |
| jcolor_t GetItemColor(); | | * | |
| void SetItemColor(jcolor_t color); | | */ | |
| void SetItemColor(int red, int green, int blue, int alpha); | | virtual void RemoveInputListener(FrameInputListener *listene | |
| void SetCurrentIndex(int i); | | r); | |
| void AddEmptyItem(); | | | |
| void AddItem(std::string text); | | | |
| void AddItem(std::string text, std::string image); | | | |
| void AddItem(std::string text, bool checked); | | | |
| void AddMenuItem(MenuItem *item); | | | |
| MenuItem * GetMenuItem(int index); | | | |
| MenuItem * GetCurrentMenuItem(); | | | |
| int GetCurrentIndex(); | | | |
| int GetItemsSize(); | | | |
| void RemoveItem(int index); | | | |
| void RemoveAll(); | | | |
| | | | |
|
| virtual bool ProcessEvent(KeyEvent *event); | | /** | |
| virtual void Paint(Graphics *g); | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual std::vector<FrameInputListener *> & GetFrameInputLis | |
| | | teners(); | |
| | | | |
|
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void ThemeChanged(ThemeEvent *event); | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 48 change blocks. |
| 269 lines changed or deleted | | 211 lines changed or added | |
|
| jmenugroup.h | | jmenugroup.h | |
| | | | |
| skipping to change at line 25 | | skipping to change at line 25 | |
| * You should have received a copy of the GNU General Public License
* | | * You should have received a copy of the GNU General Public License
* | |
| * along with this program; if not, write to the
* | | * along with this program; if not, write to the
* | |
| * Free Software Foundation, Inc.,
* | | * Free Software Foundation, Inc.,
* | |
| * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| #ifndef J_MENUGROUP_H | | #ifndef J_MENUGROUP_H | |
| #define J_MENUGROUP_H | | #define J_MENUGROUP_H | |
| | | | |
| #include "jeventobject.h" | | #include "jeventobject.h" | |
| #include "jmenu.h" | | #include "jmenu.h" | |
|
| #include "jmenulistener.h" | | #include "jselectlistener.h" | |
| | | | |
| #include <iostream> | | #include <iostream> | |
| #include <cstdlib> | | #include <cstdlib> | |
| #include <map> | | #include <map> | |
| | | | |
| namespace jgui { | | namespace jgui { | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| * \author Jeff Ferr | | * \author Jeff Ferr | |
| */ | | */ | |
|
| class MenuGroup : public MenuListener{ | | class MenuGroup : public SelectListener{ | |
| | | | |
| private: | | private: | |
|
| std::vector<MenuItem *> _items; | | std::vector<Item *> _items; | |
| Menu *_menu; | | Menu *_menu; | |
| | | | |
| protected: | | protected: | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void ItemSelected(MenuEvent *event); | | virtual void ItemSelected(SelectEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void ItemChanged(MenuEvent *event); | | virtual void ItemChanged(SelectEvent *event); | |
| | | | |
| public: | | public: | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| MenuGroup(Menu *menu); | | MenuGroup(Menu *menu); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual ~MenuGroup(); | | virtual ~MenuGroup(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void Add(MenuItem *item); | | virtual void Add(Item *item); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void Remove(MenuItem *item); | | virtual void Remove(Item *item); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void Select(MenuItem *item); | | virtual void Select(Item *item); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| MenuItem * GetSelected(); | | virtual Item * GetSelected(); | |
| | | | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 9 change blocks. |
| 9 lines changed or deleted | | 9 lines changed or added | |
|
| jscrollbar.h | | jscrollbar.h | |
| | | | |
| skipping to change at line 53 | | skipping to change at line 53 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| * \author Jeff Ferr | | * \author Jeff Ferr | |
| */ | | */ | |
| class ScrollBar : public jgui::Component{ | | class ScrollBar : public jgui::Component{ | |
| | | | |
| private: | | private: | |
| std::vector<AdjustmentListener *> _adjust_listeners; | | std::vector<AdjustmentListener *> _adjust_listeners; | |
| double _position, | | double _position, | |
|
| _minimum_tick, | | _minimum_tick, | |
| _maximum_tick, | | _maximum_tick, | |
| _old_position; | | _old_position; | |
| int _index, | | int _index, | |
|
| _stone_size, | | _stone_size, | |
| _arrows_size, | | _count_paint; | |
| _count_paint; | | | |
| bool _label_visible, | | bool _label_visible, | |
|
| _indeterminate, | | _indeterminate, | |
| _running; | | _running; | |
| jscroll_orientation_t _type; | | jscroll_orientation_t _type; | |
| | | | |
| public: | | public: | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| ScrollBar(int x = 0, int y = 0, int width = 0, int height =
0); | | ScrollBar(int x = 0, int y = 0, int width = DEFAULT_COMPONEN
T_WIDTH, int height = DEFAULT_COMPONENT_HEIGHT); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual ~ScrollBar(); | | virtual ~ScrollBar(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetOrientation(jscroll_orientation_t type); | | virtual void SetOrientation(jscroll_orientation_t type); | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| jscroll_orientation_t GetOrientation(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetStoneSize(int size); | | | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetArrowsSize(int size); | | virtual jscroll_orientation_t GetOrientation(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| int GetStoneSize(); | | virtual void SetStoneSize(int size); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| int GetArrowsSize(); | | virtual int GetStoneSize(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| double GetPosition(); | | virtual double GetPosition(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| double GetMinorTickSpacing(); | | virtual double GetMinorTickSpacing(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| double GetMajorTickSpacing(); | | virtual double GetMajorTickSpacing(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetPosition(double i); | | virtual void SetPosition(double i); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetMinorTickSpacing(double i); | | virtual void SetMinorTickSpacing(double i); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetMajorTickSpacing(double i); | | virtual void SetMajorTickSpacing(double i); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void Paint(Graphics *g); | | virtual void RegisterAdjustmentListener(AdjustmentListener *
listener); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual bool ProcessEvent(KeyEvent *event); | | virtual void RemoveAdjustmentListener(AdjustmentListener *li
stener); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual bool ProcessEvent(MouseEvent *event); | | virtual void DispatchAdjustmentEvent(AdjustmentEvent *event)
; | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RegisterAdjustmentListener(AdjustmentListener *listener
); | | virtual std::vector<AdjustmentListener *> & GetAdjustmentLis
teners(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveAdjustmentListener(AdjustmentListener *listener); | | virtual void Paint(Graphics *g); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void DispatchEvent(AdjustmentEvent *event); | | virtual bool ProcessEvent(KeyEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| std::vector<AdjustmentListener *> & GetAdjustmentListeners()
; | | virtual bool ProcessEvent(MouseEvent *event); | |
| | | | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 21 change blocks. |
| 38 lines changed or deleted | | 25 lines changed or added | |
|
| jslider.h | | jslider.h | |
| | | | |
| skipping to change at line 64 | | skipping to change at line 64 | |
| _indeterminate, | | _indeterminate, | |
| _running, | | _running, | |
| _inverted; | | _inverted; | |
| jscroll_orientation_t _type; | | jscroll_orientation_t _type; | |
| | | | |
| public: | | public: | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| Slider(int x = 0, int y = 0, int width = 0, int height = 0); | | Slider(int x = 0, int y = 0, int width = DEFAULT_COMPONENT_W
IDTH, int height = DEFAULT_COMPONENT_HEIGHT); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual ~Slider(); | | virtual ~Slider(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetStoneSize(int size); | | virtual void SetStoneSize(int size); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetOrientation(jscroll_orientation_t type); | | virtual void SetOrientation(jscroll_orientation_t type); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| double GetPosition(); | | virtual double GetPosition(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetPosition(double i); | | virtual void SetPosition(double i); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetInverted(bool b); | | virtual void SetInverted(bool b); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| double GetMinorTickSpacing(); | | virtual double GetMinorTickSpacing(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| double GetMajorTickSpacing(); | | virtual double GetMajorTickSpacing(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetMinorTickSpacing(double i); | | virtual void SetMinorTickSpacing(double i); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetMajorTickSpacing(double i); | | virtual void SetMajorTickSpacing(double i); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual bool ProcessEvent(KeyEvent *event); | | virtual bool ProcessEvent(KeyEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| | | | |
| skipping to change at line 148 | | skipping to change at line 148 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void Paint(Graphics *g); | | virtual void Paint(Graphics *g); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RegisterAdjustmentListener(AdjustmentListener *listener
); | | virtual void RegisterAdjustmentListener(AdjustmentListener *
listener); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveAdjustmentListener(AdjustmentListener *listener); | | virtual void RemoveAdjustmentListener(AdjustmentListener *li
stener); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void DispatchEvent(AdjustmentEvent *event); | | virtual void DispatchAdjustmentEvent(AdjustmentEvent *event)
; | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| std::vector<AdjustmentListener *> & GetAdjustmentListeners()
; | | virtual std::vector<AdjustmentListener *> & GetAdjustmentLis
teners(); | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 14 change blocks. |
| 14 lines changed or deleted | | 14 lines changed or added | |
|
| jsocketinputstream.h | | jsocketinputstream.h | |
| | | | |
| skipping to change at line 50 | | skipping to change at line 50 | |
| | | | |
| /** | | /** | |
| * \brief SocketInputStream. | | * \brief SocketInputStream. | |
| * | | * | |
| * \author Jeff Ferr | | * \author Jeff Ferr | |
| */ | | */ | |
| class SocketInputStream : public jio::InputStream{ | | class SocketInputStream : public jio::InputStream{ | |
| | | | |
| private: | | private: | |
| #ifdef _WIN32 | | #ifdef _WIN32 | |
|
| SOCKET _fd; | | /** \brief */ | |
| | | SOCKET _fd; | |
| #else | | #else | |
|
| int _fd; | | /** \brief */ | |
| | | int _fd; | |
| #endif | | #endif | |
|
| /** \brief */ | | /** \brief */ | |
| char *_buffer; | | char *_buffer; | |
| /** \brief */ | | /** \brief */ | |
| int _buffer_length; | | int _buffer_length; | |
| /** \brief */ | | /** \brief */ | |
| int _current_index; | | int _current_index; | |
| /** \brief */ | | /** \brief */ | |
| int _end_index; | | int _end_index; | |
| /** \brief */ | | /** \brief */ | |
| long long _receive_bytes; | | int64_t _receive_bytes; | |
| /** \brief */ | | /** \brief */ | |
| bool _stream; | | bool _stream; | |
| /** \brief */ | | /** \brief */ | |
| sockaddr_in _server_sock; | | sockaddr_in _server_sock; | |
| /** \brief */ | | /** \brief */ | |
| bool *_is_closed; | | bool *_is_closed; | |
| /** \brief */ | | /** \brief */ | |
| Connection *_connection; | | Connection *_connection; | |
| | | | |
|
| public: | | public: | |
| /** | | /** | |
| * \brief Construtor. | | * \brief Construtor. | |
| * | | * | |
| */ | | */ | |
| SocketInputStream(Connection *conn_, bool *is_closed_, int size_ = | | SocketInputStream(Connection *conn_, bool *is_closed | |
| 65535); | | _, int size_ = 65535); | |
| | | | |
|
| /** | | /** | |
| * \brief Construtor. | | * \brief Construtor. | |
| * | | * | |
| */ | | */ | |
| SocketInputStream(Connection *conn_, bool *is_closed_, sockaddr_in | | SocketInputStream(Connection *conn_, bool *is_closed | |
| server_sock_, int size_ = 65535); | | _, sockaddr_in server_sock_, int size_ = 65535); | |
| | | | |
|
| /** | | /** | |
| * \brief Destrutor virtual. | | * \brief Destrutor virtual. | |
| * | | * | |
| */ | | */ | |
| virtual ~SocketInputStream(); | | virtual ~SocketInputStream(); | |
| | | | |
|
| /** | | /** | |
| * \brief jio::InputStream | | * \brief jio::InputStream | |
| * | | * | |
| */ | | */ | |
| virtual bool IsEmpty(); | | virtual bool IsEmpty(); | |
| | | | |
|
| /** | | /** | |
| * \brief jio::InputStream | | * \brief jio::InputStream | |
| * | | * | |
| */ | | */ | |
| virtual long long Available(); | | virtual int64_t Available(); | |
| | | | |
|
| /** | | /** | |
| * \brief jio::InputStream | | * \brief jio::InputStream | |
| * | | * | |
| */ | | */ | |
| virtual long long GetSize(); | | virtual int64_t GetSize(); | |
| | | | |
|
| /** | | /** | |
| * \brief jio::InputStream | | * \brief jio::InputStream | |
| * | | * | |
| */ | | */ | |
| virtual long long GetPosition(); | | virtual int64_t GetPosition(); | |
| | | | |
|
| /** | | /** | |
| * \brief jio::InputStream | | * \brief jio::InputStream | |
| * | | * | |
| */ | | */ | |
| virtual void Skip(long long skip); | | virtual void Skip(int64_t skip); | |
| | | | |
|
| /** | | /** | |
| * \brief jio::InputStream | | * \brief jio::InputStream | |
| * | | * | |
| */ | | */ | |
| virtual void Reset(); | | virtual void Reset(); | |
| | | | |
|
| /** | | /** | |
| * \brief jio::InputStream | | * \brief jio::InputStream | |
| * | | * | |
| */ | | */ | |
| virtual void Close(); | | virtual void Close(); | |
| | | | |
|
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| * \return the number of bytes received, or 0 if the peer ha | | * \return the number of bytes received, or 0 if the | |
| s shutdown. | | peer has shutdown. | |
| * | | * | |
| * \exception SocketException an error occurred. | | * \exception SocketException an error occurred. | |
| * | | * | |
| */ | | */ | |
| virtual int Read(); | | virtual int Read(); | |
| | | | |
|
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| * \return the number of bytes received, or 0 if the peer ha | | * \return the number of bytes received, or 0 if the | |
| s shutdown. | | peer has shutdown. | |
| * | | * | |
| * \exception SocketException an error occurred. | | * \exception SocketException an error occurred. | |
| * | | * | |
| */ | | */ | |
| virtual long long Read(char *data_, long long data_length_); | | virtual int64_t Read(char *data_, int64_t data_lengt | |
| | | h_); | |
| | | | |
|
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| long long GetReceiveBytes(); | | int64_t GetReceiveBytes(); | |
| | | | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 16 change blocks. |
| 98 lines changed or deleted | | 101 lines changed or added | |
|
| jsocketoption.h | | jsocketoption.h | |
| | | | |
| skipping to change at line 195 | | skipping to change at line 195 | |
| void SetRoute(bool opt_); | | void SetRoute(bool opt_); | |
| | | | |
| /** | | /** | |
| * \brief Set or get the broadcast flag. When enabled, datagram soc
kets receive packets | | * \brief Set or get the broadcast flag. When enabled, datagram soc
kets receive packets | |
| * sent to a broadcast address and they are allowed to send p
ackets to a broadcast | | * sent to a broadcast address and they are allowed to send p
ackets to a broadcast | |
| * address. This option has no effect on stream-oriented sockets. | | * address. This option has no effect on stream-oriented sockets. | |
| * | | * | |
| */ | | */ | |
| void SetBroadcast(bool opt_); | | void SetBroadcast(bool opt_); | |
| | | | |
|
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | void SetNoDelay(bool b_); | |
| | | | |
| /** | | /** | |
| * \brief Sets or gets the maximum socket send buffer in bytes | | * \brief Sets or gets the maximum socket send buffer in bytes | |
| * | | * | |
| */ | | */ | |
| void SetSendMaximumBuffer(int length_); | | void SetSendMaximumBuffer(int length_); | |
| | | | |
| /** | | /** | |
| * \brief Sets or gets the maximum socket receive buffer in bytes. | | * \brief Sets or gets the maximum socket receive buffer in bytes. | |
| * | | * | |
| */ | | */ | |
| | | | |
| skipping to change at line 272 | | skipping to change at line 278 | |
| * \brief Header is included ? | | * \brief Header is included ? | |
| * | | * | |
| */ | | */ | |
| void SetHeaderInclude(bool opt_); | | void SetHeaderInclude(bool opt_); | |
| | | | |
| /** | | /** | |
| * \brief Return the receive timestamp of the last packet passed to
the user. | | * \brief Return the receive timestamp of the last packet passed to
the user. | |
| * This is useful for accurate round trip time measurements. | | * This is useful for accurate round trip time measurements. | |
| * | | * | |
| */ | | */ | |
|
| long long GetTimeStamp(); | | int64_t GetTimeStamp(); | |
| | | | |
| /** | | /** | |
| * \brief Get MTU. | | * \brief Get MTU. | |
| * | | * | |
| */ | | */ | |
| int GetMaximunTransferUnit(); | | int GetMaximunTransferUnit(); | |
| | | | |
| /** | | /** | |
| * \brief Change the O_ASYNC flag to enable or disable asynchronous
IO mode of the socket. | | * \brief Change the O_ASYNC flag to enable or disable asynchronous
IO mode of the socket. | |
| * Asynchronous IO mode means that the SIGIO signal or the signal s
et with F_SETSIG is raised | | * Asynchronous IO mode means that the SIGIO signal or the signal s
et with F_SETSIG is raised | |
| | | | |
End of changes. 2 change blocks. |
| 1 lines changed or deleted | | 7 lines changed or added | |
|
| jspin.h | | jspin.h | |
| | | | |
| skipping to change at line 24 | | skipping to change at line 24 | |
| *
* | | *
* | |
| * You should have received a copy of the GNU General Public License
* | | * You should have received a copy of the GNU General Public License
* | |
| * along with this program; if not, write to the
* | | * along with this program; if not, write to the
* | |
| * Free Software Foundation, Inc.,
* | | * Free Software Foundation, Inc.,
* | |
| * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| #ifndef J_SPIN_H | | #ifndef J_SPIN_H | |
| #define J_SPIN_H | | #define J_SPIN_H | |
| | | | |
| #include "jselectlistener.h" | | #include "jselectlistener.h" | |
|
| #include "jcomponent.h" | | #include "jitemcomponent.h" | |
| | | | |
| #include <iostream> | | #include <iostream> | |
| #include <cstdlib> | | #include <cstdlib> | |
| #include <map> | | #include <map> | |
| | | | |
| #include <math.h> | | #include <math.h> | |
| #include <stdio.h> | | #include <stdio.h> | |
| #include <stdlib.h> | | #include <stdlib.h> | |
| #include <unistd.h> | | #include <unistd.h> | |
| #include <math.h> | | #include <math.h> | |
| | | | |
| skipping to change at line 53 | | skipping to change at line 53 | |
| enum jspin_type_t { | | enum jspin_type_t { | |
| HORIZONTAL_SPIN, | | HORIZONTAL_SPIN, | |
| VERTICAL_SPIN | | VERTICAL_SPIN | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| * \author Jeff Ferr | | * \author Jeff Ferr | |
| */ | | */ | |
|
| class Spin : public Component{ | | class Spin : public jgui::ItemComponent{ | |
| | | | |
| private: | | private: | |
| std::vector<SelectListener *> _select_listeners; | | std::vector<SelectListener *> _select_listeners; | |
|
| std::vector<std::string> _list; | | | |
| int _index, | | | |
| _arrows_size; | | | |
| bool _loop; | | | |
| jspin_type_t _type; | | jspin_type_t _type; | |
| | | | |
|
| | | private: | |
| | | void NextItem(); | |
| | | void PreviousItem(); | |
| | | | |
| public: | | public: | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| Spin(int x = 0, int y = 0, int width = 0, int height = 0); | | Spin(int x = 0, int y = 0, int width = DEFAULT_COMPONENT_WID
TH, int height = DEFAULT_COMPONENT_HEIGHT); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual ~Spin(); | | virtual ~Spin(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetArrowsSize(int size); | | virtual void SetType(jspin_type_t type); | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| int GetArrowsSize(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetType(jspin_type_t type); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| jspin_type_t GetType(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetLoop(bool b); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetIndex(int i); | | | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void Add(std::string text); | | virtual jspin_type_t GetType(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void Remove(int index); | | virtual void AddEmptyItem(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveAll(); | | virtual void AddTextItem(std::string text); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| std::string GetValue(); | | virtual void AddImageItem(std::string text, std::string imag
e); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| int GetIndex(); | | virtual void AddCheckedItem(std::string text, bool checked); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void Paint(Graphics *g); | | virtual void Paint(Graphics *g); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual bool ProcessEvent(MouseEvent *event); | | virtual bool ProcessEvent(MouseEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual bool ProcessEvent(KeyEvent *event); | | virtual bool ProcessEvent(KeyEvent *event); | |
| | | | |
|
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RegisterSelectListener(SelectListener *listener); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RemoveSelectListener(SelectListener *listener); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void DispatchEvent(SelectEvent *event); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| std::vector<SelectListener *> & GetSelectListeners(); | | | |
| | | | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 12 change blocks. |
| 67 lines changed or deleted | | 13 lines changed or added | |
|
| jtable.h | | jtable.h | |
| | | | |
| skipping to change at line 46 | | skipping to change at line 46 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| * \author Jeff Ferr | | * \author Jeff Ferr | |
| */ | | */ | |
| class Cell : public virtual jcommon::Object{ | | class Cell : public virtual jcommon::Object{ | |
| | | | |
| private: | | private: | |
| Table *_table; | | Table *_table; | |
| std::string _value; | | std::string _value; | |
|
| jalign_t _align; | | | |
| int _bgcell_red, | | int _bgcell_red, | |
| _bgcell_green, | | _bgcell_green, | |
| _bgcell_blue, | | _bgcell_blue, | |
| _bgcell_alpha; | | _bgcell_alpha; | |
| int _fgcell_red, | | int _fgcell_red, | |
| _fgcell_green, | | _fgcell_green, | |
| _fgcell_blue, | | _fgcell_blue, | |
| _fgcell_alpha; | | _fgcell_alpha; | |
|
| | | jhorizontal_align_t _halign; | |
| | | jvertical_align_t _valign; | |
| | | | |
| Cell(Table *table); | | Cell(Table *table); | |
| | | | |
| public: | | public: | |
| virtual ~Cell(); | | virtual ~Cell(); | |
| | | | |
|
| void SetAlign(jalign_t align); | | /** | |
| jalign_t GetAlign(); | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetValue(std::string value); | |
| | | | |
|
| void SetValue(std::string value); | | /** | |
| std::string GetValue(); | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual std::string GetValue(); | |
| | | | |
|
| void SetCellBackgroundColor(jcolor_t color); | | /** | |
| void SetCellForegroundColor(jcolor_t color); | | * \brief | |
| void SetCellBackgroundColor(int r, int g, int b, int a); | | * | |
| void SetCellForegroundColor(int r, int g, int b, int a); | | */ | |
| | | virtual void SetCellBackgroundColor(jcolor_t color); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetCellForegroundColor(jcolor_t color); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetCellBackgroundColor(int r, int g, int b, int | |
| | | a); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetCellForegroundColor(int r, int g, int b, int | |
| | | a); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetHorizontalAlign(jhorizontal_align_t align); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jhorizontal_align_t GetHorizontalAlign(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetVerticalAlign(jvertical_align_t align); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jvertical_align_t GetVerticalAlign(); | |
| | | | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| * \author Jeff Ferr | | * \author Jeff Ferr | |
| */ | | */ | |
| class Table : public Component, public virtual jcommon::Object{ | | class Table : public Component, public virtual jcommon::Object{ | |
| | | | |
| | | | |
| skipping to change at line 116 | | skipping to change at line 166 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual ~Table(); | | virtual ~Table(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetLoop(bool loop); | | virtual void SetLoop(bool loop); | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| int GetNumberOfColumns(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| int GetNumberOfRows(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetNumberOfColumns(int size); | | | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetNumberOfRows(int size); | | virtual int GetNumberOfColumns(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void InsertColumn(std::string text, int index = -1); | | virtual int GetNumberOfRows(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void InsertRow(std::string text, int index = -1); | | virtual void SetNumberOfColumns(int size); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveColumn(int index); | | virtual void SetNumberOfRows(int size); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveRow(int index); | | virtual void InsertColumn(std::string text, int index = -1); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetHeaderValue(std::string text, int index); | | virtual void InsertRow(std::string text, int index = -1); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| std::string GetHeaderValue(int index); | | virtual void RemoveColumn(int index); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetHeaderVisible(bool visible); | | virtual void RemoveRow(int index); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| bool IsHeaderVisible(); | | virtual void SetHeaderValue(std::string text, int index); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| int GetCurrentColumn(); | | virtual std::string GetHeaderValue(int index); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| int GetCurrentRow(); | | virtual void SetHeaderVisible(bool visible); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| Cell * GetCurrentCell(); | | virtual bool IsHeaderVisible(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetCurrentCell(int row, int column); | | virtual int GetCurrentColumn(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| Cell * GetCell(int row, int column); | | virtual int GetCurrentRow(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetCell(Cell *cell, int row, int column); | | virtual Cell * GetCurrentCell(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| jcolor_t GetItemColor(); | | virtual void SetCurrentCell(int row, int column); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetItemColor(jcolor_t color); | | virtual Cell * GetCell(int row, int column); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetItemColor(int red, int green, int blue, int alpha); | | virtual void SetCell(Cell *cell, int row, int column); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetGridColor(jcolor_t color); | | virtual void SetGridColor(jcolor_t color); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetGridColor(int r, int g, int b, int a); | | virtual void SetGridColor(int r, int g, int b, int a); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetColumnSize(int index, int size); | | virtual void SetColumnSize(int index, int size); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| int GetColumnSize(int index); | | virtual int GetColumnSize(int index); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetRowSize(int index, int size); | | virtual void SetRowSize(int index, int size); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| int GetRowSize(int index); | | virtual int GetRowSize(int index); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual bool ProcessEvent(KeyEvent *event); | | virtual bool ProcessEvent(KeyEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| | | | |
End of changes. 30 change blocks. |
| 52 lines changed or deleted | | 86 lines changed or added | |
|
| jtextarea.h | | jtextarea.h | |
| | | | |
| skipping to change at line 23 | | skipping to change at line 23 | |
| * GNU General Public License for more details.
* | | * GNU General Public License for more details.
* | |
| *
* | | *
* | |
| * You should have received a copy of the GNU General Public License
* | | * You should have received a copy of the GNU General Public License
* | |
| * along with this program; if not, write to the
* | | * along with this program; if not, write to the
* | |
| * Free Software Foundation, Inc.,
* | | * Free Software Foundation, Inc.,
* | |
| * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| #ifndef J_TEXTAREA_H | | #ifndef J_TEXTAREA_H | |
| #define J_TEXTAREA_H | | #define J_TEXTAREA_H | |
| | | | |
|
| #include "jruntimeexception.h" | | #include "jtextcomponent.h" | |
| #include "jstringtokenizer.h" | | | |
| #include "jstringutils.h" | | | |
| | | | |
| #include "jtextlistener.h" | | | |
| #include "jcomponent.h" | | | |
| | | | |
| #include <iostream> | | #include <iostream> | |
| #include <cstdlib> | | #include <cstdlib> | |
| #include <cstring> | | #include <cstring> | |
| #include <map> | | #include <map> | |
| | | | |
| #include <math.h> | | #include <math.h> | |
| #include <stdio.h> | | #include <stdio.h> | |
| #include <stdlib.h> | | #include <stdlib.h> | |
| #include <unistd.h> | | #include <unistd.h> | |
| #include <math.h> | | #include <math.h> | |
| #include <time.h> | | #include <time.h> | |
| | | | |
| namespace jgui { | | namespace jgui { | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
|
| */ | | | |
| enum jcursor_type_t { | | | |
| NONE_CURSOR, | | | |
| UNDERSCORE_CURSOR, | | | |
| STICK_CURSOR, | | | |
| BLOCK_CURSOR | | | |
| }; | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| * \author Jeff Ferr | | * \author Jeff Ferr | |
| */ | | */ | |
|
| class TextArea : public Component{ | | class TextArea : public jgui::TextComponent{ | |
| | | | |
| private: | | private: | |
|
| std::vector<TextListener *> _text_listeners; | | int _line_op; // 0-nop, 1-inc, 2-dec | |
| std::string _text, | | bool _is_wrap; | |
| _selected_text; | | | |
| int _max_text_length, | | | |
| _position, | | | |
| _line_op, // 0-nop, 1-inc, 2-dec | | | |
| _begin_index, | | | |
| _end_index; | | | |
| bool _is_wrap, | | | |
| _cursor_visible, | | | |
| _is_editable; | | | |
| char _echo_char; | | | |
| jcursor_type_t _cursor_type; | | | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| void IncLine(); | | void IncLine(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| void DecLine(); | | void DecLine(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void GetLines(std::vector<std::string> *texts); | | void GetLines(std::vector<std::string> &texts); | |
| | | | |
| public: | | public: | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| TextArea(int x = 0, int y = 0, int width = 0, int height = 0
, int max_text = -1); | | TextArea(int x = 0, int y = 0, int width = 0, int height = 0
); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual ~TextArea(); | | virtual ~TextArea(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetEchoChar(char echo_char); | | virtual void ScrollUp(); | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| char GetEchoChar(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| bool EchoCharIsSet(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetEditable(bool b); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| bool IsEditable(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetCaretPosition(int pos); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| int GetCaretPosition(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetCaretVisible(bool visible); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetCaretType(jcursor_type_t t); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| jcursor_type_t GetCaretType(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void Clear(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void Backspace(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void Delete(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetMaxTextSize(int max); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void IncCaretPosition(int size); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void DecCaretPosition(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void Insert(std::string text, int pos = -1); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void Append(std::string text); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetText(std::string text); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| std::string GetText(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| bool SetSelectedText(int begin, int end); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| std::string GetSelectedText(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void ScrollUp(); | | | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void ScrollDown(); | | virtual void ScrollDown(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void SetWrap(bool b); | | virtual void SetWrap(bool b); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| | | | |
| skipping to change at line 276 | | skipping to change at line 117 | |
| * | | * | |
| */ | | */ | |
| virtual bool ProcessEvent(KeyEvent *event); | | virtual bool ProcessEvent(KeyEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual bool ProcessEvent(MouseEvent *event); | | virtual bool ProcessEvent(MouseEvent *event); | |
| | | | |
|
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RegisterTextListener(TextListener *listener); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RemoveTextListener(TextListener *listener); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void DispatchEvent(TextEvent *event); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| std::vector<TextListener *> & GetTextListeners(); | | | |
| | | | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 9 change blocks. |
| 191 lines changed or deleted | | 8 lines changed or added | |
|
| jtextfield.h | | jtextfield.h | |
| | | | |
| skipping to change at line 23 | | skipping to change at line 23 | |
| * GNU General Public License for more details.
* | | * GNU General Public License for more details.
* | |
| *
* | | *
* | |
| * You should have received a copy of the GNU General Public License
* | | * You should have received a copy of the GNU General Public License
* | |
| * along with this program; if not, write to the
* | | * along with this program; if not, write to the
* | |
| * Free Software Foundation, Inc.,
* | | * Free Software Foundation, Inc.,
* | |
| * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| #ifndef J_TEXTFIELD_H | | #ifndef J_TEXTFIELD_H | |
| #define J_TEXTFIELD_H | | #define J_TEXTFIELD_H | |
| | | | |
|
| #include "jruntimeexception.h" | | #include "jtextcomponent.h" | |
| #include "jstringtokenizer.h" | | | |
| #include "jstringutils.h" | | | |
| | | | |
| #include "jtextarea.h" | | | |
| #include "jtextlistener.h" | | | |
| #include "jcomponent.h" | | | |
| | | | |
| #include <iostream> | | #include <iostream> | |
| #include <cstdlib> | | #include <cstdlib> | |
| #include <map> | | #include <map> | |
| | | | |
| #include <math.h> | | #include <math.h> | |
| #include <stdio.h> | | #include <stdio.h> | |
| #include <stdlib.h> | | #include <stdlib.h> | |
| #include <unistd.h> | | #include <unistd.h> | |
| #include <math.h> | | #include <math.h> | |
| #include <time.h> | | #include <time.h> | |
| | | | |
| namespace jgui { | | namespace jgui { | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| * \author Jeff Ferr | | * \author Jeff Ferr | |
| */ | | */ | |
|
| class TextField : public Component{ | | class TextField : public jgui::TextComponent{ | |
| | | | |
| private: | | | |
| std::vector<TextListener *> _text_listeners; | | | |
| std::string _text, | | | |
| _selected_text; | | | |
| int _max_text_length, | | | |
| _position, | | | |
| _begin_index, | | | |
| _end_index; | | | |
| jalign_t _align; | | | |
| bool _cursor_visible, | | | |
| _is_editable; | | | |
| char _echo_char; | | | |
| jcursor_type_t _cursor; | | | |
| | | | |
| public: | | public: | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| TextField(int x = 0, int y = 0, int width = 0, int height =
0, int max_text = -1); | | TextField(int x = 0, int y = 0, int width = DEFAULT_COMPONEN
T_WIDTH, int height = DEFAULT_COMPONENT_HEIGHT); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual ~TextField(); | | virtual ~TextField(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetEchoChar(char echo_char); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| char GetEchoChar(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| bool EchoCharIsSet(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetEditable(bool b); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| bool IsEditable(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetAlign(jalign_t align); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| jalign_t GetAlign(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetCaretType(jcursor_type_t t); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetCaretVisible(bool visible); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void Clear(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void Backspace(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void Delete(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetMaxTextSize(int max); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void IncCaretPosition(int size); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void DecCaretPosition(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetText(std::string text); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void Append(std::string text); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void Insert(std::string text, int pos = -1); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| std::string GetText(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| bool SetSelectedText(int begin, int end); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| std::string GetSelectedText(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual void Paint(Graphics *g); | | virtual void Paint(Graphics *g); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual bool ProcessEvent(MouseEvent *event); | | virtual bool ProcessEvent(MouseEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual bool ProcessEvent(KeyEvent *event); | | virtual bool ProcessEvent(KeyEvent *event); | |
| | | | |
|
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RegisterTextListener(TextListener *listener); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RemoveTextListener(TextListener *listener); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void DispatchEvent(TextEvent *event); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| std::vector<TextListener *> & GetTextListeners(); | | | |
| | | | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 5 change blocks. |
| 173 lines changed or deleted | | 3 lines changed or added | |
|
| jtheme.h | | jtheme.h | |
| | | | |
| skipping to change at line 36 | | skipping to change at line 36 | |
| #include <string> | | #include <string> | |
| | | | |
| #include <stdlib.h> | | #include <stdlib.h> | |
| #include <unistd.h> | | #include <unistd.h> | |
| #include <stdio.h> | | #include <stdio.h> | |
| | | | |
| namespace jgui { | | namespace jgui { | |
| | | | |
| class Component; | | class Component; | |
| class Window; | | class Window; | |
|
| | | class ItemComponent; | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| * \author Jeff Ferr | | * \author Jeff Ferr | |
| */ | | */ | |
| class Theme : public jcommon::Object{ | | class Theme : public jcommon::Object{ | |
| | | | |
| friend class ThemeManager; | | friend class ThemeManager; | |
| friend class Component; | | friend class Component; | |
| friend class Window; | | friend class Window; | |
|
| | | friend class ItemComponent; | |
| friend class Frame; | | friend class Frame; | |
| | | | |
| private: | | private: | |
|
| | | Font *_window_font, | |
| | | *_component_font; | |
| | | jinsets_t _insets; | |
| jcolor_t _window_bgcolor, | | jcolor_t _window_bgcolor, | |
| _window_fgcolor, | | _window_fgcolor, | |
| _window_border_color, | | _window_border_color, | |
| _component_bgcolor, | | _component_bgcolor, | |
| _component_fgcolor, | | _component_fgcolor, | |
| _component_border_color, | | _component_border_color, | |
| _component_border_focus_col
or, | | _component_border_focus_col
or, | |
| _component_focus_bgcolor, | | _component_focus_bgcolor, | |
|
| _component_focus_fgcolor; | | _component_focus_fgcolor, | |
| int _gradient_level, | | _item_color, | |
| _window_border_size, | | _item_focus_color, | |
| _component_border_size; | | _item_selected_color, | |
| jinsets_t _insets; | | _item_selected_fgcolor, | |
| Font *_window_font, | | _item_fgcolor, | |
| *_component_font; | | _item_focus_fgcolor; | |
| jcomponent_border_t _component_border, | | jcomponent_border_t _component_border, | |
|
| _wi | | | |
| ndow_border; | | _window_border; | |
| | | int _window_border_size, | |
| | | _component_border_size; | |
| | | | |
|
| | | public: | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void Update(Component *parent); | | Theme(); | |
| | | | |
|
| public: | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| Theme(); | | virtual ~Theme(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual ~Theme(); | | virtual void Update(Component *parent); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void SetWindowBackgroundColor(int red, int green, in
t blue, int alpha); | | virtual void SetWindowBackgroundColor(int red, int green, in
t blue, int alpha); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| | | | |
| skipping to change at line 145 | | skipping to change at line 152 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void SetComponentForegroundFocusColor(int red, int g
reen, int blue, int alpha); | | virtual void SetComponentForegroundFocusColor(int red, int g
reen, int blue, int alpha); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| | | virtual void SetItemColor(int red, int green, int blue, int | |
| | | alpha); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetItemFocusColor(int red, int green, int blue, | |
| | | int alpha); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetSelectedItemColor(int red, int green, int bl | |
| | | ue, int alpha); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetSelectedItemForegroundColor(int red, int gre | |
| | | en, int blue, int alpha); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetItemForegroundColor(int red, int green, int | |
| | | blue, int alpha); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetItemForegroundFocusColor(int red, int green, | |
| | | int blue, int alpha); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| virtual void SetComponentBorder(jcomponent_border_t border); | | virtual void SetComponentBorder(jcomponent_border_t border); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void SetWindowBorder(jcomponent_border_t border); | | virtual void SetWindowBorder(jcomponent_border_t border); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| | | | |
| skipping to change at line 187 | | skipping to change at line 230 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void SetComponentFont(Font *font); | | virtual void SetComponentFont(Font *font); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void SetGradientLevel(int level); | | virtual jcolor_t GetWindowBackgroundColor(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jcolor_t GetWindowForegroundColor(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jcolor_t GetWindowBorderColor(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jcolor_t GetComponentBackgroundColor(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jcolor_t GetComponentForegroundColor(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jcolor_t GetComponentBorderColor(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jcolor_t GetComponentBorderFocusColor(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jcolor_t GetComponentBackgroundFocusColor(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jcolor_t GetComponentForegroundFocusColor(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jcolor_t GetItemColor(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jcolor_t GetItemFocusColor(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jcolor_t GetSelectedItemColor(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jcolor_t GetSelectedItemForegroundColor(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jcolor_t GetItemForegroundColor(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jcolor_t GetItemForegroundFocusColor(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jcomponent_border_t GetComponentBorder(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jcomponent_border_t GetWindowBorder(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual jinsets_t GetWindowInsets(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual int GetWindowBorderSize(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual int GetComponentBorderSize(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual Font * GetWindowFont(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual Font * GetComponentFont(); | |
| | | | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 12 change blocks. |
| 14 lines changed or deleted | | 189 lines changed or added | |
|
| jtree.h | | jtree.h | |
| | | | |
| skipping to change at line 24 | | skipping to change at line 24 | |
| *
* | | *
* | |
| * You should have received a copy of the GNU General Public License
* | | * You should have received a copy of the GNU General Public License
* | |
| * along with this program; if not, write to the
* | | * along with this program; if not, write to the
* | |
| * Free Software Foundation, Inc.,
* | | * Free Software Foundation, Inc.,
* | |
| * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| #ifndef J_TREE_H | | #ifndef J_TREE_H | |
| #define J_TREE_H | | #define J_TREE_H | |
| | | | |
| #include "jmenu.h" | | #include "jmenu.h" | |
|
| | | #include "jitemcomponent.h" | |
| | | | |
| #include <string> | | #include <string> | |
| #include <iostream> | | #include <iostream> | |
| #include <vector> | | #include <vector> | |
| | | | |
| #include <stdlib.h> | | #include <stdlib.h> | |
| #include <unistd.h> | | #include <unistd.h> | |
| #include <stdio.h> | | #include <stdio.h> | |
| | | | |
| namespace jgui { | | namespace jgui { | |
| | | | |
|
| class TreeItem; | | | |
| class TreeComponent; | | | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| * \author Jeff Ferr | | * \author Jeff Ferr | |
| */ | | */ | |
|
| class Tree : public jgui::Component{ | | class Tree : public jgui::ItemComponent{ | |
| | | | |
| friend class TreeComponent; | | | |
| | | | |
| private: | | private: | |
| jthread::Mutex _tree_mutex; | | jthread::Mutex _tree_mutex; | |
| | | | |
|
| std::vector<Tree *> _trees; | | jgui::OffScreenImage *_icon_plus, | |
| std::vector<MenuListener *> _tree_listeners; | | *_icon_minus; | |
| TreeItem *_current_item; | | std::string _title; | |
| TreeComponent *_list; | | int _top_index, | |
| int _visible_items; | | _item_size, | |
| jmenu_align_t _menu_align; | | _centered_interaction; | |
| jcolor_t _item_color; | | | |
| | | | |
| public: | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| Tree(int x = 0, int y = 0, int width = 0, int visible_items | | | |
| = 3); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual ~Tree(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetTreeAlign(jmenu_align_t align); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| int GetItemsSize(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| int GetVisibleItems(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetLoop(bool loop); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| jcolor_t GetItemColor(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetItemColor(jcolor_t color); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetItemColor(int red, int green, int blue, int alpha); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetCurrentIndex(int i); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void AddTreeItem(TreeItem *item); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| TreeItem * GetCurrentItem(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| int GetCurrentIndex(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RemoveItem(int index); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RemoveAll(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RegisterMenuListener(MenuListener *listener); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void RemoveMenuListener(MenuListener *listener); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void DispatchEvent(MenuEvent *event); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| std::vector<MenuListener *> & GetMenuListeners(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual bool ProcessEvent(KeyEvent *event); | | | |
| | | | |
| }; | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| * \author Jeff Ferr | | | |
| */ | | | |
| class TreeItem{ | | | |
| | | | |
| friend class TreeComponent; | | | |
| friend class ComboTreeComponent; | | | |
| | | | |
| private: | | | |
| std::vector<TreeItem *> _childs; | | | |
| Tree *_parent; | | | |
| OffScreenImage *_prefetch; | | | |
| std::string _value, | | | |
| _image; | | | |
| jmenuitem_type_t _type; | | | |
| bool _is_checked, | | | |
| _is_visible, | | | |
| _enabled; | | | |
| | | | |
| public: | | | |
| TreeItem() | | | |
| { | | | |
| _enabled = true; | | | |
| _parent = NULL; | | | |
| _prefetch = NULL; | | | |
| _is_checked = false; | | | |
| _is_visible = true; | | | |
| _type = EMPTY_MENU_ITEM; | | | |
| } | | | |
| | | | |
| TreeItem(std::string value) | | | |
| { | | | |
| _enabled = true; | | | |
| _parent = NULL; | | | |
| _prefetch = NULL; | | | |
| _value = value; | | | |
| _is_checked = false; | | | |
| _is_visible = true; | | | |
| _type = TEXT_MENU_ITEM; | | | |
| } | | | |
| | | | |
| TreeItem(std::string value, std::string image) | | | |
| { | | | |
| _enabled = true; | | | |
| _parent = NULL; | | | |
| _prefetch = NULL; | | | |
| _image = image; | | | |
| _value = value; | | | |
| _is_checked = false; | | | |
| _is_visible = true; | | | |
| _type = IMAGE_MENU_ITEM; | | | |
| } | | | |
| | | | |
| TreeItem(std::string value, bool checked) | | | |
| { | | | |
| _enabled = true; | | | |
| _parent = NULL; | | | |
| _prefetch = NULL; | | | |
| _value = value; | | | |
| _is_checked = checked; | | | |
| _is_visible = true; | | | |
| _type = CHECK_MENU_ITEM; | | | |
| } | | | |
| | | | |
| ~TreeItem() | | | |
| { | | | |
| } | | | |
| | | | |
| Tree * GetParent() | | | |
| { | | | |
| return _parent; | | | |
| } | | | |
| | | | |
| std::vector<TreeItem *> & GetSubItems() | | | |
| { | | | |
| return _childs; | | | |
| } | | | |
| | | | |
| void SetEnabled(bool b) | | | |
| { | | | |
| _enabled = b; | | | |
| } | | | |
| | | | |
| bool GetEnabled() | | | |
| { | | | |
| return _enabled; | | | |
| } | | | |
| | | | |
| void SetVisible(bool b) | | | |
| { | | | |
| _is_visible = b; | | | |
| } | | | |
| | | | |
| bool IsVisible() | | | |
| { | | | |
| return _is_visible; | | | |
| } | | | |
| | | | |
| void SetSelected(bool b) | | | |
| { | | | |
| _is_checked = b; | | | |
| } | | | |
| | | | |
| void SetParent(Tree *parent) | | | |
| { | | | |
| _parent = parent; | | | |
| } | | | |
| | | | |
| void AddSubItem(TreeItem *item) | | | |
| { | | | |
| if (_type == jgui::CHECK_MENU_ITEM) { | | | |
| throw MenuException("Item cannot accept chil | | | |
| ds"); | | | |
| } | | | |
| | | | |
| _childs.push_back(item); | | | |
| } | | | |
| | | | |
| std::string GetValue() | | | |
| { | | | |
| return _value; | | | |
| } | | | |
| | | | |
| std::string GetImage() | | | |
| { | | | |
| return _image; | | | |
| } | | | |
| | | | |
| jmenuitem_type_t GetType() | | | |
| { | | | |
| return _type; | | | |
| } | | | |
| | | | |
| bool IsSelected() | | | |
| { | | | |
| return _is_checked; | | | |
| } | | | |
| | | | |
| }; | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| * \author Jeff Ferr | | | |
| */ | | | |
| class TreeComponent : public Component{ | | | |
| | | | |
| friend class Tree; | | | |
| | | | |
| private: | | private: | |
|
| std::vector<TreeItem *>_items; | | | |
| OffScreenImage *prefetch; | | | |
| Tree *_tree; | | | |
| int bx, | | | |
| by, | | | |
| bwidth, | | | |
| bheight, | | | |
| _item_size, | | | |
| _index, | | | |
| _visible_items, | | | |
| _paint_count, | | | |
| _vertical_gap, | | | |
| _horizontal_gap; | | | |
| jcolor_t _item_color; | | | |
| float delta; | | | |
| bool _input_locked, | | | |
| _arrows_visible, | | | |
| _loop; | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetTree(Tree *tree); | | | |
| | | | |
| public: | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| TreeComponent(int x, int y, int width, int visible_items); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual ~TreeComponent(); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetGap(int hgap, int vgap); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetLoop(bool loop); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| jcolor_t GetItemColor(); | | | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void SetItemColor(jcolor_t color); | | virtual void MousePressed(MouseEvent *event); | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetItemColor(int red, int green, int blue, int alpha); | | | |
| | | | |
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| void SetCurrentIndex(int i); | | | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void AddEmptyItem(); | | virtual void MouseReleased(MouseEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void AddItem(std::string text); | | virtual void MouseClicked(MouseEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void AddItem(std::string text, std::string image); | | virtual void MouseMoved(MouseEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void AddItem(std::string text, bool checked); | | virtual void MouseWheel(MouseEvent *event); | |
| | | | |
|
| | | public: | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void AddTreeItem(TreeItem *item); | | Tree(int x = 0, int y = 0, int width = 0, int visible_items
= 3); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| TreeItem * GetTreeItem(int index); | | virtual ~Tree(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| TreeItem * GetCurrentTreeItem(); | | virtual void SetTitle(std::string title); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| int GetCurrentIndex(); | | virtual void SetCenteredInteraction(bool b); | |
| | | | |
|
| /** | | /* | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| int GetItemsSize(); | | virtual Item * GetCurrentItem(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveItem(int index); | | virtual int GetCurrentIndex(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveAll(); | | virtual void Paint(Graphics *g); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual bool ProcessEvent(KeyEvent *event); | | virtual bool ProcessEvent(KeyEvent *event); | |
| | | | |
|
| /** | | | |
| * \brief | | | |
| * | | | |
| */ | | | |
| virtual void Paint(Graphics *g); | | | |
| | | | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 20 change blocks. |
| 375 lines changed or deleted | | 22 lines changed or added | |
|
| jwindow.h | | jwindow.h | |
| | | | |
| skipping to change at line 26 | | skipping to change at line 26 | |
| * along with this program; if not, write to the
* | | * along with this program; if not, write to the
* | |
| * Free Software Foundation, Inc.,
* | | * Free Software Foundation, Inc.,
* | |
| * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| #ifndef J_WINDOW_H | | #ifndef J_WINDOW_H | |
| #define J_WINDOW_H | | #define J_WINDOW_H | |
| | | | |
| #include "jcontainer.h" | | #include "jcontainer.h" | |
| #include "jwindowlistener.h" | | #include "jwindowlistener.h" | |
| #include "joffscreenimage.h" | | #include "joffscreenimage.h" | |
|
| | | #include "jthemelistener.h" | |
| #include "jmutex.h" | | #include "jmutex.h" | |
| | | | |
| #include <stdint.h> | | #include <stdint.h> | |
| #include <string.h> | | #include <string.h> | |
| | | | |
| namespace jgui{ | | namespace jgui{ | |
| | | | |
| class Graphics; | | class Graphics; | |
| class InputManager; | | class InputManager; | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| * \author Jeff Ferr | | * \author Jeff Ferr | |
| */ | | */ | |
|
| class Window : public Container{ | | class Window : public jgui::Container, public jgui::ThemeListener{ | |
| | | | |
| friend class InputManager; | | friend class InputManager; | |
| friend class WindowManager; | | friend class WindowManager; | |
| | | | |
| protected: | | protected: | |
| #ifdef DIRECTFB_UI | | #ifdef DIRECTFB_UI | |
| IDirectFBWindow *window; | | IDirectFBWindow *window; | |
| IDirectFBSurface *surface; | | IDirectFBSurface *surface; | |
| #endif | | #endif | |
| | | | |
| | | | |
| skipping to change at line 80 | | skipping to change at line 81 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual ~Window(); | | virtual ~Window(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| Graphics * GetGraphics(); | | virtual Graphics * GetGraphics(); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void * GetNativeWindow(); | | virtual void * GetNativeWindow(); | |
| | | | |
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void SetWorkingScreenSize(int width, int height); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void SetOpacity(int i); | | virtual void SetOpacity(int i); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| | | | |
| skipping to change at line 146 | | skipping to change at line 153 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void SetBounds(int x1, int y1, int w1, int h1); | | virtual void SetBounds(int x1, int y1, int w1, int h1); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| virtual void SetPosition(int x1, int y1); | | virtual void SetLocation(int x1, int y1); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void SetSize(int w, int h); | | virtual void SetSize(int w, int h); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| | | | |
| skipping to change at line 242 | | skipping to change at line 249 | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
| virtual void DumpScreen(std::string dir, std::string pre); | | virtual void DumpScreen(std::string dir, std::string pre); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RegisterWindowListener(WindowListener *listener); | | virtual void RegisterWindowListener(WindowListener *listener
); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void RemoveWindowListener(WindowListener *listener); | | virtual void RemoveWindowListener(WindowListener *listener); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| void DispatchEvent(WindowEvent *event); | | virtual void DispatchWindowEvent(WindowEvent *event); | |
| | | | |
| /** | | /** | |
| * \brief | | * \brief | |
| * | | * | |
| */ | | */ | |
|
| std::vector<WindowListener *> & GetWindowListeners(); | | virtual std::vector<WindowListener *> & GetWindowListeners()
; | |
| | | | |
|
| | | /** | |
| | | * \brief | |
| | | * | |
| | | */ | |
| | | virtual void ThemeChanged(ThemeEvent *event); | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 10 change blocks. |
| 8 lines changed or deleted | | 20 lines changed or added | |
|