Use OVERRIDE macro in more member functions (onProcessMessage, etc.).

This commit is contained in:
David Capello 2011-03-27 20:42:16 -03:00
parent 682e7152b7
commit df01255b51
29 changed files with 152 additions and 127 deletions

View File

@ -22,6 +22,7 @@
#include "app/color.h" #include "app/color.h"
#include "app/color_utils.h" #include "app/color_utils.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/compiler_specific.h"
#include "commands/command.h" #include "commands/command.h"
#include "commands/params.h" #include "commands/params.h"
#include "console.h" #include "console.h"
@ -67,7 +68,7 @@ public:
void setColor(const Color& color); void setColor(const Color& color);
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
void onExit(); void onExit();
void onCloseFrame(); void onCloseFrame();

View File

@ -19,6 +19,7 @@
#ifndef COMMANDS_FILTERS_COLOR_CURVE_EDITOR_H_INCLUDED #ifndef COMMANDS_FILTERS_COLOR_CURVE_EDITOR_H_INCLUDED
#define COMMANDS_FILTERS_COLOR_CURVE_EDITOR_H_INCLUDED #define COMMANDS_FILTERS_COLOR_CURVE_EDITOR_H_INCLUDED
#include "base/compiler_specific.h"
#include "base/signal.h" #include "base/signal.h"
#include "gfx/point.h" #include "gfx/point.h"
#include "gui/widget.h" #include "gui/widget.h"
@ -35,7 +36,7 @@ public:
Signal0<void> CurveEditorChange; Signal0<void> CurveEditorChange;
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
private: private:
gfx::Point* getClosestPoint(int x, int y, int** edit_x, int** edit_y); gfx::Point* getClosestPoint(int x, int y, int** edit_x, int** edit_y);

View File

@ -19,6 +19,7 @@
#ifndef COMMANDS_FILTERS_FILTER_PREVIEW_H_INCLUDED #ifndef COMMANDS_FILTERS_FILTER_PREVIEW_H_INCLUDED
#define COMMANDS_FILTERS_FILTER_PREVIEW_H_INCLUDED #define COMMANDS_FILTERS_FILTER_PREVIEW_H_INCLUDED
#include "base/compiler_specific.h"
#include "gui/widget.h" #include "gui/widget.h"
class FilterManagerImpl; class FilterManagerImpl;
@ -35,7 +36,7 @@ public:
FilterManagerImpl* getFilterManager() const; FilterManagerImpl* getFilterManager() const;
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
private: private:
FilterManagerImpl* m_filterMgr; FilterManagerImpl* m_filterMgr;

View File

@ -7,19 +7,9 @@
#ifndef GUI_BASE_H_INCLUDED #ifndef GUI_BASE_H_INCLUDED
#define GUI_BASE_H_INCLUDED #define GUI_BASE_H_INCLUDED
/* get the system's definition of NULL */ // Get the system's definition of NULL
#include <stddef.h> #include <stddef.h>
/* get bool, false and true definitions for C */
#ifndef __cplusplus
#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
#endif
#undef bool
#define bool unsigned char
#endif
#ifndef TRUE #ifndef TRUE
#define TRUE (-1) #define TRUE (-1)
#define FALSE (0) #define FALSE (0)
@ -51,7 +41,7 @@ class Frame;
class Theme; class Theme;
class Widget; class Widget;
/* alignment */ // Alignment.
#define JI_HORIZONTAL 0x0001 #define JI_HORIZONTAL 0x0001
#define JI_VERTICAL 0x0002 #define JI_VERTICAL 0x0002
#define JI_LEFT 0x0004 #define JI_LEFT 0x0004
@ -63,27 +53,27 @@ class Widget;
#define JI_HOMOGENEOUS 0x0100 #define JI_HOMOGENEOUS 0x0100
#define JI_WORDWRAP 0x0200 #define JI_WORDWRAP 0x0200
/* widget flags */ // Widget flags.
#define JI_HIDDEN 0x0001 /* is hidden (not visible, not clickeable) */ #define JI_HIDDEN 0x0001 // Is hidden (not visible, not clickeable).
#define JI_SELECTED 0x0002 /* is selected */ #define JI_SELECTED 0x0002 // Is selected.
#define JI_DISABLED 0x0004 /* is disabled (not usable) */ #define JI_DISABLED 0x0004 // Is disabled (not usable).
#define JI_HASFOCUS 0x0008 /* has the input focus */ #define JI_HASFOCUS 0x0008 // Has the input focus.
#define JI_HASMOUSE 0x0010 /* has the mouse */ #define JI_HASMOUSE 0x0010 // Has the mouse.
#define JI_HASCAPTURE 0x0020 /* captured the mouse */ #define JI_HASCAPTURE 0x0020 // Captured the mouse .
#define JI_FOCUSREST 0x0040 /* want the focus (is a rest for focus) */ #define JI_FOCUSREST 0x0040 // Want the focus (is a rest for focus).
#define JI_MAGNETIC 0x0080 /* attract the focus */ #define JI_MAGNETIC 0x0080 // Attract the focus.
#define JI_EXPANSIVE 0x0100 /* is expansive (want more space) */ #define JI_EXPANSIVE 0x0100 // Is expansive (want more space).
#define JI_DECORATIVE 0x0200 /* to decorate windows */ #define JI_DECORATIVE 0x0200 // To decorate windows.
#define JI_INITIALIZED 0x0400 /* the widget was already initialized by a theme */ #define JI_INITIALIZED 0x0400 // The widget was already initialized by a theme.
#define JI_NOTEXT 0x0800 /* the widget does not have text */ #define JI_NOTEXT 0x0800 // The widget does not have text.
#define JI_DIRTY 0x1000 /* the widget (or one child) is dirty (update_region != empty) */ #define JI_DIRTY 0x1000 // The widget (or one child) is dirty (update_region != empty).
/* widget types */ // Widget types.
enum { enum {
/* undefined (or anonymous) widget type */ // Undefined (or anonymous) widget type.
JI_WIDGET, JI_WIDGET,
/* known widgets */ // Known widgets.
JI_BOX, JI_BOX,
JI_BUTTON, JI_BUTTON,
JI_CHECK, JI_CHECK,
@ -110,51 +100,51 @@ enum {
JI_VIEW_VIEWPORT, JI_VIEW_VIEWPORT,
JI_FRAME, JI_FRAME,
/* user widgets */ // User widgets.
JI_USER_WIDGET, JI_USER_WIDGET,
}; };
/* Jinete Message types */ // JINETE Message types.
enum { enum {
/* general messages */ // General messages.
JM_OPEN, /* windows is open */ JM_OPEN, // Windows is open.
JM_CLOSE, /* windows is closed */ JM_CLOSE, // Windows is closed.
JM_DESTROY, /* widget is destroyed */ JM_DESTROY, // Widget is destroyed.
JM_DRAW, /* widget needs be repainted */ JM_DRAW, // Widget needs be repainted.
JM_SIGNAL, /* signal from some widget */ JM_SIGNAL, // Signal from some widget.
JM_TIMER, /* a timer timeout */ JM_TIMER, // A timer timeout.
JM_REQSIZE, /* request size */ JM_REQSIZE, // Request size.
JM_SETPOS, /* set position */ JM_SETPOS, // Set position.
JM_WINMOVE, /* window movement */ JM_WINMOVE, // Window movement.
JM_DEFERREDFREE, /* deferred jwidget_free call */ JM_DEFERREDFREE, // Deferred jwidget_free call.
JM_DIRTYCHILDREN, /* dirty children */ JM_DIRTYCHILDREN, // Dirty children.
JM_QUEUEPROCESSING, /* only sent to manager which indicate JM_QUEUEPROCESSING, // Only sent to manager which indicate
the last message in the queue */ // the last message in the queue.
/* keyboard related messages */ // Keyboard related messages.
JM_KEYPRESSED, /* when a any key is pressed */ JM_KEYPRESSED, // When a any key is pressed.
JM_KEYRELEASED, /* when a any key is released */ JM_KEYRELEASED, // When a any key is released.
JM_FOCUSENTER, /* widget gets the focus */ JM_FOCUSENTER, // Widget gets the focus.
JM_FOCUSLEAVE, /* widget losts the focus */ JM_FOCUSLEAVE, // Widget losts the focus.
/* mouse related messages */ // Mouse related messages.
JM_BUTTONPRESSED, /* user makes click inside a widget */ JM_BUTTONPRESSED, // User makes click inside a widget.
JM_BUTTONRELEASED, /* user releases mouse button in a widget */ JM_BUTTONRELEASED, // User releases mouse button in a widget.
JM_DOUBLECLICK, /* user makes double click in some widget */ JM_DOUBLECLICK, // User makes double click in some widget.
JM_MOUSEENTER, /* a widget gets mouse pointer */ JM_MOUSEENTER, // A widget gets mouse pointer.
JM_MOUSELEAVE, /* a widget losts mouse pointer */ JM_MOUSELEAVE, // A widget losts mouse pointer.
JM_MOTION, /* user moves the mouse on some widget */ JM_MOTION, // User moves the mouse on some widget.
JM_SETCURSOR, /* a widget needs to setup the mouse cursor */ JM_SETCURSOR, // A widget needs to setup the mouse cursor.
JM_WHEEL, /* user moves the wheel */ JM_WHEEL, // User moves the wheel.
/* XXX drag'n'drop operation? */ // xxx drag'n'drop operation?.
/* JM_DND_, */ // JM_DND_
/* other messages */ // Other messages.
JM_REGISTERED_MESSAGES JM_REGISTERED_MESSAGES
}; };
/* signals */ // Signals.
enum { enum {
// Generic signals // Generic signals
JI_SIGNAL_ENABLE, JI_SIGNAL_ENABLE,
@ -185,9 +175,9 @@ enum {
JI_SIGNAL_WINDOW_RESIZE, JI_SIGNAL_WINDOW_RESIZE,
}; };
/* flags for jwidget_get_drawable_region */ // Flags for jwidget_get_drawable_region.
#define JI_GDR_CUTTOPWINDOWS 1 /* cut areas where are windows on top */ #define JI_GDR_CUTTOPWINDOWS 1 // Cut areas where are windows on top.
#define JI_GDR_USECHILDAREA 2 /* use areas where are children */ #define JI_GDR_USECHILDAREA 2 // Use areas where are children.
typedef unsigned int JID; typedef unsigned int JID;
@ -218,4 +208,4 @@ public:
~Jinete(); ~Jinete();
}; };
#endif #endif // GUI_BASE_H_INCLUDED

View File

@ -7,6 +7,7 @@
#ifndef GUI_BOX_H_INCLUDED #ifndef GUI_BOX_H_INCLUDED
#define GUI_BOX_H_INCLUDED #define GUI_BOX_H_INCLUDED
#include "base/compiler_specific.h"
#include "gui/widget.h" #include "gui/widget.h"
class Box : public Widget class Box : public Widget
@ -16,9 +17,9 @@ public:
protected: protected:
// Events // Events
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev); void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
void onPaint(PaintEvent& ev); void onPaint(PaintEvent& ev) OVERRIDE;
private: private:
void box_set_position(JRect rect); void box_set_position(JRect rect);

View File

@ -7,8 +7,10 @@
#ifndef GUI_BUTTON_H_INCLUDED #ifndef GUI_BUTTON_H_INCLUDED
#define GUI_BUTTON_H_INCLUDED #define GUI_BUTTON_H_INCLUDED
#include "base/compiler_specific.h"
#include "base/signal.h" #include "base/signal.h"
#include "gui/widget.h" #include "gui/widget.h"
#include <vector> #include <vector>
struct BITMAP; struct BITMAP;
@ -53,9 +55,9 @@ public:
protected: protected:
// Events // Events
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev); void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
void onPaint(PaintEvent& ev); void onPaint(PaintEvent& ev) OVERRIDE;
// New events // New events
virtual void onClick(Event& ev); virtual void onClick(Event& ev);
@ -99,7 +101,7 @@ public:
protected: protected:
// Events // Events
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
private: private:
int m_radioGroup; int m_radioGroup;

View File

@ -6,12 +6,13 @@
#include "config.h" #include "config.h"
#include <allegro.h> #include "base/compiler_specific.h"
#include "gfx/size.h" #include "gfx/size.h"
#include "gui/gui.h" #include "gui/gui.h"
#include "gui/preferred_size_event.h" #include "gui/preferred_size_event.h"
#include <allegro.h>
using namespace gfx; using namespace gfx;
class ComboBoxButton : public Button class ComboBoxButton : public Button
@ -19,7 +20,7 @@ class ComboBoxButton : public Button
public: public:
ComboBoxButton() : Button("") { } ComboBoxButton() : Button("") { }
void onPaint(PaintEvent& ev) void onPaint(PaintEvent& ev) OVERRIDE
{ {
getTheme()->paintComboBoxButton(ev); getTheme()->paintComboBoxButton(ev);
} }

View File

@ -7,9 +7,11 @@
#ifndef GUI_COMBOBOX_H_INCLUDED #ifndef GUI_COMBOBOX_H_INCLUDED
#define GUI_COMBOBOX_H_INCLUDED #define GUI_COMBOBOX_H_INCLUDED
#include "base/compiler_specific.h"
#include "gui/widget.h" #include "gui/widget.h"
#include <vector>
#include <string> #include <string>
#include <vector>
class Button; class Button;
class Entry; class Entry;
@ -55,8 +57,8 @@ public:
JRect getListBoxPos(); JRect getListBoxPos();
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev); void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
private: private:
void onButtonClick(Event& ev); void onButtonClick(Event& ev);

View File

@ -7,6 +7,7 @@
#ifndef GUI_CUSTOM_LABEL_H_INCLUDED #ifndef GUI_CUSTOM_LABEL_H_INCLUDED
#define GUI_CUSTOM_LABEL_H_INCLUDED #define GUI_CUSTOM_LABEL_H_INCLUDED
#include "base/compiler_specific.h"
#include "gui/label.h" #include "gui/label.h"
class CustomLabel : public Label class CustomLabel : public Label
@ -15,7 +16,7 @@ public:
CustomLabel(const char *text); CustomLabel(const char *text);
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
}; };

View File

@ -7,6 +7,7 @@
#ifndef GUI_ENTRY_H_INCLUDED #ifndef GUI_ENTRY_H_INCLUDED
#define GUI_ENTRY_H_INCLUDED #define GUI_ENTRY_H_INCLUDED
#include "base/compiler_specific.h"
#include "base/signal.h" #include "base/signal.h"
#include "gui/widget.h" #include "gui/widget.h"
@ -37,9 +38,9 @@ public:
protected: protected:
// Events // Events
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev); void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
void onPaint(PaintEvent& ev); void onPaint(PaintEvent& ev) OVERRIDE;
// New Events // New Events
void onEntryChange(); void onEntryChange();

View File

@ -7,6 +7,7 @@
#ifndef GUI_FRAME_H_INCLUDED #ifndef GUI_FRAME_H_INCLUDED
#define GUI_FRAME_H_INCLUDED #define GUI_FRAME_H_INCLUDED
#include "base/compiler_specific.h"
#include "base/signal.h" #include "base/signal.h"
#include "gui/widget.h" #include "gui/widget.h"
@ -55,9 +56,9 @@ public:
Signal1<void, CloseEvent&> Close; Signal1<void, CloseEvent&> Close;
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev); void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
void onPaint(PaintEvent& ev); void onPaint(PaintEvent& ev) OVERRIDE;
private: private:
void window_set_position(JRect rect); void window_set_position(JRect rect);

View File

@ -7,7 +7,9 @@
#ifndef GUI_GRID_H_INCLUDED #ifndef GUI_GRID_H_INCLUDED
#define GUI_GRID_H_INCLUDED #define GUI_GRID_H_INCLUDED
#include "base/compiler_specific.h"
#include "gui/widget.h" #include "gui/widget.h"
#include <vector> #include <vector>
class Grid : public Widget class Grid : public Widget
@ -20,9 +22,9 @@ public:
protected: protected:
// Events // Events
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev); void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
void onPaint(PaintEvent& ev); void onPaint(PaintEvent& ev) OVERRIDE;
private: private:
struct Cell { struct Cell {

View File

@ -7,6 +7,7 @@
#ifndef GUI_IMAGE_VIEW_H_INCLUDED #ifndef GUI_IMAGE_VIEW_H_INCLUDED
#define GUI_IMAGE_VIEW_H_INCLUDED #define GUI_IMAGE_VIEW_H_INCLUDED
#include "base/compiler_specific.h"
#include "gui/widget.h" #include "gui/widget.h"
struct BITMAP; struct BITMAP;
@ -17,8 +18,8 @@ public:
ImageView(BITMAP* bmp, int align); ImageView(BITMAP* bmp, int align);
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
void onPaint(PaintEvent& ev); void onPaint(PaintEvent& ev) OVERRIDE;
private: private:
BITMAP* m_bmp; BITMAP* m_bmp;

View File

@ -7,6 +7,7 @@
#ifndef GUI_LABEL_H_INCLUDED #ifndef GUI_LABEL_H_INCLUDED
#define GUI_LABEL_H_INCLUDED #define GUI_LABEL_H_INCLUDED
#include "base/compiler_specific.h"
#include "gui/widget.h" #include "gui/widget.h"
class Label : public Widget class Label : public Widget
@ -18,8 +19,8 @@ public:
void setTextColor(int color); void setTextColor(int color);
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
void onPaint(PaintEvent& ev); void onPaint(PaintEvent& ev) OVERRIDE;
private: private:
int m_textColor; int m_textColor;

View File

@ -7,8 +7,10 @@
#ifndef GUI_LINK_LABEL_H_INCLUDED #ifndef GUI_LINK_LABEL_H_INCLUDED
#define GUI_LINK_LABEL_H_INCLUDED #define GUI_LINK_LABEL_H_INCLUDED
#include "base/compiler_specific.h"
#include "base/signal.h" #include "base/signal.h"
#include "gui/custom_label.h" #include "gui/custom_label.h"
#include <string> #include <string>
class LinkLabel : public CustomLabel class LinkLabel : public CustomLabel
@ -22,8 +24,8 @@ public:
Signal0<void> Click; Signal0<void> Click;
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
void onPaint(PaintEvent& ev); void onPaint(PaintEvent& ev) OVERRIDE;
}; };

View File

@ -7,6 +7,7 @@
#ifndef GUI_POPUP_FRAME_H_INCLUDED #ifndef GUI_POPUP_FRAME_H_INCLUDED
#define GUI_POPUP_FRAME_H_INCLUDED #define GUI_POPUP_FRAME_H_INCLUDED
#include "base/compiler_specific.h"
#include "gui/frame.h" #include "gui/frame.h"
class PopupFrame : public Frame class PopupFrame : public Frame
@ -18,9 +19,9 @@ public:
void setHotRegion(JRegion region); void setHotRegion(JRegion region);
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev); void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
void onPaint(PaintEvent& ev); void onPaint(PaintEvent& ev) OVERRIDE;
private: private:
bool m_close_on_buttonpressed; bool m_close_on_buttonpressed;

View File

@ -7,6 +7,7 @@
#ifndef GUI_SCROLL_BAR_H_INCLUDED #ifndef GUI_SCROLL_BAR_H_INCLUDED
#define GUI_SCROLL_BAR_H_INCLUDED #define GUI_SCROLL_BAR_H_INCLUDED
#include "base/compiler_specific.h"
#include "gui/widget.h" #include "gui/widget.h"
class ScrollBar : public Widget class ScrollBar : public Widget
@ -25,7 +26,7 @@ public:
protected: protected:
// Events // Events
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
private: private:
void getScrollBarInfo(int* _pos, int* _len, int* _bar_size, int* _viewport_size); void getScrollBarInfo(int* _pos, int* _len, int* _bar_size, int* _viewport_size);

View File

@ -7,6 +7,7 @@
#ifndef GUI_SLIDER_H_INCLUDED #ifndef GUI_SLIDER_H_INCLUDED
#define GUI_SLIDER_H_INCLUDED #define GUI_SLIDER_H_INCLUDED
#include "base/compiler_specific.h"
#include "base/signal.h" #include "base/signal.h"
#include "gui/widget.h" #include "gui/widget.h"
@ -30,9 +31,9 @@ public:
protected: protected:
// Events // Events
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev); void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
void onPaint(PaintEvent& ev); void onPaint(PaintEvent& ev) OVERRIDE;
// New events // New events
virtual void onChange(); virtual void onChange();

View File

@ -7,6 +7,7 @@
#ifndef GUI_TOOLTIPS_H_INCLUDED #ifndef GUI_TOOLTIPS_H_INCLUDED
#define GUI_TOOLTIPS_H_INCLUDED #define GUI_TOOLTIPS_H_INCLUDED
#include "base/compiler_specific.h"
#include "gui/base.h" #include "gui/base.h"
#include "gui/frame.h" #include "gui/frame.h"
@ -22,9 +23,9 @@ public:
void setArrowAlign(int arrowAlign); void setArrowAlign(int arrowAlign);
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev); void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
void onPaint(PaintEvent& ev); void onPaint(PaintEvent& ev) OVERRIDE;
private: private:
bool m_close_on_buttonpressed; bool m_close_on_buttonpressed;

View File

@ -7,6 +7,7 @@
#ifndef GUI_VIEW_H_INCLUDED #ifndef GUI_VIEW_H_INCLUDED
#define GUI_VIEW_H_INCLUDED #define GUI_VIEW_H_INCLUDED
#include "base/compiler_specific.h"
#include "gfx/point.h" #include "gfx/point.h"
#include "gfx/size.h" #include "gfx/size.h"
#include "gui/scroll_bar.h" #include "gui/scroll_bar.h"
@ -45,7 +46,7 @@ public:
protected: protected:
// Events // Events
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
private: private:
static void displaceWidgets(Widget* widget, int x, int y); static void displaceWidgets(Widget* widget, int x, int y);

View File

@ -7,6 +7,7 @@
#ifndef GUI_VIEWPORT_H_INCLUDED #ifndef GUI_VIEWPORT_H_INCLUDED
#define GUI_VIEWPORT_H_INCLUDED #define GUI_VIEWPORT_H_INCLUDED
#include "base/compiler_specific.h"
#include "gui/widget.h" #include "gui/widget.h"
class Viewport : public Widget class Viewport : public Widget
@ -18,7 +19,7 @@ public:
protected: protected:
// Events // Events
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
private: private:
void set_position(JRect rect); void set_position(JRect rect);

View File

@ -20,6 +20,7 @@
#define WIDGETS_COLOR_BAR_H_INCLUDED #define WIDGETS_COLOR_BAR_H_INCLUDED
#include "app/color.h" #include "app/color.h"
#include "base/compiler_specific.h"
#include "base/signal.h" #include "base/signal.h"
#include "gui/box.h" #include "gui/box.h"
#include "gui/button.h" #include "gui/button.h"
@ -62,7 +63,7 @@ private:
public: public:
ScrollableView(); ScrollableView();
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
}; };
Button m_paletteButton; Button m_paletteButton;

View File

@ -20,6 +20,7 @@
#define WIDGETS_COLOR_BUTTON_H_INCLUDED #define WIDGETS_COLOR_BUTTON_H_INCLUDED
#include "app/color.h" #include "app/color.h"
#include "base/compiler_specific.h"
#include "base/signal.h" #include "base/signal.h"
#include "gui/button.h" #include "gui/button.h"
@ -42,9 +43,9 @@ public:
protected: protected:
// Events // Events
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev); void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
void onPaint(PaintEvent& ev); void onPaint(PaintEvent& ev) OVERRIDE;
private: private:
void openSelectorDialog(); void openSelectorDialog();

View File

@ -20,6 +20,7 @@
#define WIDGETS_EDITOR_H_INCLUDED #define WIDGETS_EDITOR_H_INCLUDED
#include "app/color.h" #include "app/color.h"
#include "base/compiler_specific.h"
#include "base/signal.h" #include "base/signal.h"
#include "document.h" #include "document.h"
#include "gui/base.h" #include "gui/base.h"
@ -205,7 +206,7 @@ public:
int editor_click_cancel(); int editor_click_cancel();
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
void onCurrentToolChange(); void onCurrentToolChange();
private: private:

View File

@ -19,11 +19,12 @@
#ifndef WIDGETS_PALETTE_VIEW_H_INCLUDED #ifndef WIDGETS_PALETTE_VIEW_H_INCLUDED
#define WIDGETS_PALETTE_VIEW_H_INCLUDED #define WIDGETS_PALETTE_VIEW_H_INCLUDED
#include <allegro/color.h> #include "base/compiler_specific.h"
#include "base/signal.h" #include "base/signal.h"
#include "gui/widget.h" #include "gui/widget.h"
#include <allegro/color.h>
// TODO use some JI_SIGNAL_USER // TODO use some JI_SIGNAL_USER
#define SIGNAL_PALETTE_EDITOR_CHANGE 0x10005 #define SIGNAL_PALETTE_EDITOR_CHANGE 0x10005
@ -59,7 +60,7 @@ public:
Signal1<void, int> IndexChange; Signal1<void, int> IndexChange;
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
private: private:
void request_size(int* w, int* h); void request_size(int* w, int* h);

View File

@ -22,6 +22,7 @@
#include <vector> #include <vector>
#include "app/color.h" #include "app/color.h"
#include "base/compiler_specific.h"
#include "gui/base.h" #include "gui/base.h"
#include "gui/widget.h" #include "gui/widget.h"
@ -72,7 +73,7 @@ public:
void removeProgress(Progress* progress); void removeProgress(Progress* progress);
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
private: private:
void onCurrentToolChange(); void onCurrentToolChange();

View File

@ -19,7 +19,9 @@
#ifndef WIDGETS_TABS_H_INCLUDED #ifndef WIDGETS_TABS_H_INCLUDED
#define WIDGETS_TABS_H_INCLUDED #define WIDGETS_TABS_H_INCLUDED
#include "base/compiler_specific.h"
#include "gui/widget.h" #include "gui/widget.h"
#include <vector> #include <vector>
class Tabs; class Tabs;
@ -83,7 +85,7 @@ public:
void stopScrolling(); void stopScrolling();
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
private: private:
void startAni(Ani ani); void startAni(Ani ani);

View File

@ -18,12 +18,11 @@
#include "config.h" #include "config.h"
#include <allegro.h> #include "widgets/toolbar.h"
#include <map>
#include <string>
#include "app.h" #include "app.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/signal.h" #include "base/signal.h"
#include "commands/command.h" #include "commands/command.h"
#include "commands/commands.h" #include "commands/commands.h"
@ -36,7 +35,10 @@
#include "ui_context.h" #include "ui_context.h"
#include "widgets/groupbut.h" #include "widgets/groupbut.h"
#include "widgets/statebar.h" #include "widgets/statebar.h"
#include "widgets/toolbar.h"
#include <allegro.h>
#include <map>
#include <string>
using namespace gfx; using namespace gfx;
@ -75,7 +77,7 @@ public:
void closeTipWindow(); void closeTipWindow();
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
private: private:
int getToolGroupIndex(ToolGroup* group); int getToolGroupIndex(ToolGroup* group);
@ -104,7 +106,7 @@ public:
Signal1<void, Tool*> ToolSelected; Signal1<void, Tool*> ToolSelected;
protected: protected:
bool onProcessMessage(JMessage msg); bool onProcessMessage(JMessage msg) OVERRIDE;
private: private:
Rect getToolBounds(int index); Rect getToolBounds(int index);

View File

@ -21,6 +21,8 @@
#include "gui/base.h" #include "gui/base.h"
class Tool;
JWidget toolbar_new(); JWidget toolbar_new();
bool toolbar_is_tool_visible(JWidget toolbar, Tool* tool); bool toolbar_is_tool_visible(JWidget toolbar, Tool* tool);