Remove JMessage and jmessage union, use Message* and Message instead.

This commit is contained in:
David Capello 2011-04-02 13:14:07 -03:00
parent 19ea79b41e
commit ff897fea34
76 changed files with 241 additions and 244 deletions

View File

@ -52,7 +52,7 @@ using namespace tools;
static Frame* window = NULL;
static bool brush_preview_msg_proc(JWidget widget, JMessage msg);
static bool brush_preview_msg_proc(JWidget widget, Message* msg);
static bool window_close_hook(JWidget widget, void *data);
static bool brush_type_change_hook(JWidget widget, void *data);
@ -345,7 +345,7 @@ void ConfigureTools::onExecute(Context* context)
window->open_window_bg();
}
static bool brush_preview_msg_proc(JWidget widget, JMessage msg)
static bool brush_preview_msg_proc(JWidget widget, Message* msg)
{
switch (msg->type) {

View File

@ -69,7 +69,7 @@ public:
void setColor(const Color& color);
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
void onExit();
void onCloseFrame();
@ -317,7 +317,7 @@ void PaletteEntryEditor::setColor(const Color& color)
m_hexColorEntry.setColor(color);
}
bool PaletteEntryEditor::onProcessMessage(JMessage msg)
bool PaletteEntryEditor::onProcessMessage(Message* msg)
{
if (msg->type == JM_TIMER &&
msg->timer.timer_id == m_redrawTimerId) {

View File

@ -176,7 +176,7 @@ void PreviewCommand::onExecute(Context* context)
if (keypressed()) {
int readkey_value = readkey();
JMessage msg = jmessage_new_key_related(JM_KEYPRESSED, readkey_value);
Message* msg = jmessage_new_key_related(JM_KEYPRESSED, readkey_value);
Command* command = get_command_from_key_message(msg);
jmessage_free(msg);

View File

@ -92,7 +92,7 @@ ColorCurveEditor::ColorCurveEditor(ColorCurve* curve, int x1, int y1, int x2, in
/* m_curve->type = CURVE_SPLINE; */
}
bool ColorCurveEditor::onProcessMessage(JMessage msg)
bool ColorCurveEditor::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -36,7 +36,7 @@ public:
Signal0<void> CurveEditorChange;
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
private:
gfx::Point* getClosestPoint(int x, int y, int** edit_x, int** edit_y);

View File

@ -64,7 +64,7 @@ FilterManagerImpl* FilterPreview::getFilterManager() const
return m_filterMgr;
}
bool FilterPreview::onProcessMessage(JMessage msg)
bool FilterPreview::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -36,7 +36,7 @@ public:
FilterManagerImpl* getFilterManager() const;
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
private:
FilterManagerImpl* m_filterMgr;

View File

@ -111,7 +111,7 @@ public:
State getState() const { return m_state; }
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
private:
void setCursor(int x, int y);
@ -230,7 +230,7 @@ AnimationEditor::~AnimationEditor()
base_free(m_layers);
}
bool AnimationEditor::onProcessMessage(JMessage msg)
bool AnimationEditor::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -67,10 +67,10 @@ static void goback_command(Widget* widget);
static void goforward_command(Widget* widget);
static void goup_command(Widget* widget);
static bool fileview_msg_proc(Widget* widget, JMessage msg);
static bool location_msg_proc(Widget* widget, JMessage msg);
static bool filetype_msg_proc(Widget* widget, JMessage msg);
static bool filename_msg_proc(Widget* widget, JMessage msg);
static bool fileview_msg_proc(Widget* widget, Message* msg);
static bool location_msg_proc(Widget* widget, Message* msg);
static bool filetype_msg_proc(Widget* widget, Message* msg);
static bool filename_msg_proc(Widget* widget, Message* msg);
// Slot for App::Exit signal
static void on_exit_delete_navigation_history()
@ -569,7 +569,7 @@ static void goup_command(Widget* widget)
}
/* hook for the 'fileview' widget in the dialog */
static bool fileview_msg_proc(Widget* widget, JMessage msg)
static bool fileview_msg_proc(Widget* widget, Message* msg)
{
if (msg->type == JM_SIGNAL) {
switch (msg->signal.num) {
@ -611,7 +611,7 @@ static bool fileview_msg_proc(Widget* widget, JMessage msg)
}
// Hook for the 'location' combo-box
static bool location_msg_proc(Widget* widget, JMessage msg)
static bool location_msg_proc(Widget* widget, Message* msg)
{
if (msg->type == JM_SIGNAL) {
ComboBox* combobox = dynamic_cast<ComboBox*>(widget);
@ -649,7 +649,7 @@ static bool location_msg_proc(Widget* widget, JMessage msg)
}
// Hook for the 'filetype' combo-box
static bool filetype_msg_proc(Widget* widget, JMessage msg)
static bool filetype_msg_proc(Widget* widget, Message* msg)
{
if (msg->type == JM_SIGNAL) {
ComboBox* combobox = dynamic_cast<ComboBox*>(widget);
@ -681,7 +681,7 @@ static bool filetype_msg_proc(Widget* widget, JMessage msg)
return false;
}
static bool filename_msg_proc(Widget* widget, JMessage msg)
static bool filename_msg_proc(Widget* widget, Message* msg)
{
if (msg->type == JM_KEYRELEASED && msg->key.ascii >= 32) {
// Check if all keys are released

View File

@ -32,7 +32,7 @@ static void fill_listbox(RepoDlg *repo_dlg);
static void kill_listbox(RepoDlg *repo_dlg);
static int repo_listbox_type();
static bool repo_listbox_msg_proc(JWidget widget, JMessage msg);
static bool repo_listbox_msg_proc(JWidget widget, Message* msg);
static void use_command(Button* widget, RepoDlg* repo_dlg);
static void add_command(Button* widget, RepoDlg* repo_dlg);
@ -147,7 +147,7 @@ static int repo_listbox_type()
return type;
}
static bool repo_listbox_msg_proc(JWidget widget, JMessage msg)
static bool repo_listbox_msg_proc(JWidget widget, Message* msg)
{
RepoDlg* repo_dlg = reinterpret_cast<RepoDlg*>(jwidget_get_data(widget, repo_listbox_type()));

View File

@ -33,13 +33,13 @@ struct jaccel;
struct jhook;
struct jlink;
struct jlist;
union jmessage;
struct jrect;
struct jregion;
class Frame;
class Theme;
class Widget;
class Frame;
class Theme;
class Widget;
union Message;
// Alignment.
#define JI_HORIZONTAL 0x0001
@ -187,7 +187,6 @@ typedef struct jaccel* JAccel;
typedef struct jhook* JHook;
typedef struct jlink* JLink;
typedef struct jlist* JList;
typedef union jmessage* JMessage;
typedef struct jstream* JStream;
typedef struct jrect* JRect;
typedef struct jregion* JRegion;
@ -198,7 +197,7 @@ typedef struct jxmlnode* JXmlNode;
typedef struct jxmlelem* JXmlElem;
typedef struct jxmltext* JXmlText;
typedef bool (*JMessageFunc) (JWidget widget, JMessage msg);
typedef bool (*MessageFunc) (JWidget widget, Message* msg);
typedef void (*JDrawFunc) (JWidget widget, JRect clip);
class Jinete

View File

@ -18,7 +18,7 @@
using namespace gfx;
static bool box_msg_proc(JWidget widget, JMessage msg);
static bool box_msg_proc(JWidget widget, Message* msg);
static void box_request_size(JWidget widget, int *w, int *h);
static void box_set_position(JWidget widget, JRect rect);
@ -29,7 +29,7 @@ Box::Box(int align)
initTheme();
}
bool Box::onProcessMessage(JMessage msg)
bool Box::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -17,7 +17,7 @@ public:
protected:
// Events
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
void onPaint(PaintEvent& ev) OVERRIDE;

View File

@ -70,7 +70,7 @@ void ButtonBase::onClick(Event& ev)
Click(ev);
}
bool ButtonBase::onProcessMessage(JMessage msg)
bool ButtonBase::onProcessMessage(Message* msg)
{
switch (msg->type) {
@ -374,7 +374,7 @@ void RadioButton::deselectRadioGroup()
}
}
bool RadioButton::onProcessMessage(JMessage msg)
bool RadioButton::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -55,7 +55,7 @@ public:
protected:
// Events
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
void onPaint(PaintEvent& ev) OVERRIDE;
@ -101,7 +101,7 @@ public:
protected:
// Events
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
private:
int m_radioGroup;

View File

@ -37,8 +37,8 @@ struct ComboBox::Item
#define IS_VALID_ITEM(combobox, index) \
(index >= 0 && index < combobox->getItemCount())
static bool combobox_entry_msg_proc(JWidget widget, JMessage msg);
static bool combobox_listbox_msg_proc(JWidget widget, JMessage msg);
static bool combobox_entry_msg_proc(JWidget widget, Message* msg);
static bool combobox_listbox_msg_proc(JWidget widget, Message* msg);
ComboBox::ComboBox()
: Widget(JI_COMBOBOX)
@ -248,7 +248,7 @@ Button* ComboBox::getButtonWidget()
return m_button;
}
bool ComboBox::onProcessMessage(JMessage msg)
bool ComboBox::onProcessMessage(Message* msg)
{
switch (msg->type) {
@ -321,7 +321,7 @@ void ComboBox::onPreferredSize(PreferredSizeEvent& ev)
ev.setPreferredSize(reqSize);
}
static bool combobox_entry_msg_proc(JWidget widget, JMessage msg)
static bool combobox_entry_msg_proc(JWidget widget, Message* msg)
{
ComboBox* combobox = reinterpret_cast<ComboBox*>(widget->user_data[0]);
@ -369,7 +369,7 @@ static bool combobox_entry_msg_proc(JWidget widget, JMessage msg)
return false;
}
static bool combobox_listbox_msg_proc(JWidget widget, JMessage msg)
static bool combobox_listbox_msg_proc(JWidget widget, Message* msg)
{
ComboBox* combobox = reinterpret_cast<ComboBox*>(widget->user_data[0]);

View File

@ -57,7 +57,7 @@ public:
JRect getListBoxPos();
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
private:

View File

@ -14,7 +14,7 @@ CustomLabel::CustomLabel(const char *text)
{
}
bool CustomLabel::onProcessMessage(JMessage msg)
bool CustomLabel::onProcessMessage(Message* msg)
{
return Label::onProcessMessage(msg);
}

View File

@ -16,7 +16,7 @@ public:
CustomLabel(const char *text);
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
};

View File

@ -162,7 +162,7 @@ void Entry::getEntryThemeInfo(int* scroll, int* caret, int* state,
}
}
bool Entry::onProcessMessage(JMessage msg)
bool Entry::onProcessMessage(Message* msg)
{
switch (msg->type) {
@ -391,7 +391,7 @@ void Entry::onEntryChange()
jwidget_emit_signal(this, JI_SIGNAL_ENTRY_CHANGE);
}
int Entry::getCaretFromMouse(JMessage msg)
int Entry::getCaretFromMouse(Message* msg)
{
int c, x, w, mx, caret = m_caret;

View File

@ -38,7 +38,7 @@ public:
protected:
// Events
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
void onPaint(PaintEvent& ev) OVERRIDE;
@ -64,7 +64,7 @@ private:
};
};
int getCaretFromMouse(JMessage msg);
int getCaretFromMouse(Message* msg);
void executeCmd(EntryCmd::Type cmd, int ascii, bool shift_pressed);
void forwardWord();
void backwardWord();

View File

@ -260,7 +260,7 @@ bool Frame::is_toplevel()
return false;
}
bool Frame::onProcessMessage(JMessage msg)
bool Frame::onProcessMessage(Message* msg)
{
switch (msg->type) {
@ -547,7 +547,7 @@ void Frame::move_window(JRect rect, bool use_blit)
JRegion window_refresh_region;
JRect old_pos;
JRect man_pos;
JMessage msg;
Message* msg;
jmanager_dispatch_messages(manager);

View File

@ -53,7 +53,7 @@ public:
Signal1<void, CloseEvent&> Close;
protected:
virtual bool onProcessMessage(JMessage msg) OVERRIDE;
virtual bool onProcessMessage(Message* msg) OVERRIDE;
virtual void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
virtual void onPaint(PaintEvent& ev) OVERRIDE;
virtual void onHitTest(HitTestEvent& ev);

View File

@ -93,7 +93,7 @@ void Grid::addChildInCell(Widget* child, int hspan, int vspan, int align)
}
}
bool Grid::onProcessMessage(JMessage msg)
bool Grid::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -22,7 +22,7 @@ public:
protected:
// Events
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
void onPaint(PaintEvent& ev) OVERRIDE;

View File

@ -15,17 +15,17 @@
* Because each widget could has various hooks, each one has a unique
* type-id (you can use the @ref ji_register_widget_type routine to
* get one), and an associated routine to process messages
* (JMessageFunc).
* (MessageFunc).
*
* Also, the hook can have extra associated data to be used by the
* routine @c msg_proc.
*
* @see ji_register_widget_type, JMessageFunc
* @see ji_register_widget_type, MessageFunc
*/
struct jhook
{
int type;
JMessageFunc msg_proc;
MessageFunc msg_proc;
void *data;
};

View File

@ -16,7 +16,7 @@
#include "gui/system.h"
#include "gui/theme.h"
static bool image_msg_proc(JWidget widget, JMessage msg);
static bool image_msg_proc(JWidget widget, Message* msg);
ImageView::ImageView(BITMAP* bmp, int align)
: Widget(JI_IMAGE_VIEW)
@ -24,7 +24,7 @@ ImageView::ImageView(BITMAP* bmp, int align)
setAlign(align);
}
bool ImageView::onProcessMessage(JMessage msg)
bool ImageView::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -18,7 +18,7 @@ public:
ImageView(BITMAP* bmp, int align);
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
void onPaint(PaintEvent& ev) OVERRIDE;
private:

View File

@ -30,7 +30,7 @@ void Label::setTextColor(int color)
m_textColor = color;
}
bool Label::onProcessMessage(JMessage msg)
bool Label::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -19,7 +19,7 @@ public:
void setTextColor(int color);
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
void onPaint(PaintEvent& ev) OVERRIDE;
private:

View File

@ -25,7 +25,7 @@ LinkLabel::LinkLabel(const char* url, const char* text)
{
}
bool LinkLabel::onProcessMessage(JMessage msg)
bool LinkLabel::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -24,7 +24,7 @@ public:
Signal0<void> Click;
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
void onPaint(PaintEvent& ev) OVERRIDE;
};

View File

@ -21,12 +21,12 @@
using namespace gfx;
static bool listbox_msg_proc(JWidget widget, JMessage msg);
static bool listbox_msg_proc(JWidget widget, Message* msg);
static void listbox_request_size(JWidget widget, int *w, int *h);
static void listbox_set_position(JWidget widget, JRect rect);
static void listbox_dirty_children(JWidget widget);
static bool listitem_msg_proc(JWidget widget, JMessage msg);
static bool listitem_msg_proc(JWidget widget, Message* msg);
static void listitem_request_size(JWidget widget, int *w, int *h);
JWidget jlistbox_new()
@ -143,7 +143,7 @@ void jlistbox_center_scroll(JWidget widget)
}
}
static bool listbox_msg_proc(JWidget widget, JMessage msg)
static bool listbox_msg_proc(JWidget widget, Message* msg)
{
switch (msg->type) {
@ -356,7 +356,7 @@ static void listbox_dirty_children(JWidget widget)
}
}
static bool listitem_msg_proc(JWidget widget, JMessage msg)
static bool listitem_msg_proc(JWidget widget, Message* msg)
{
switch (msg->type) {

View File

@ -109,21 +109,21 @@ static char old_readed_key[KEY_MAX]; /* keyboard status of previous
static unsigned key_repeated[KEY_MAX];
/* manager widget */
static bool manager_msg_proc(JWidget widget, JMessage msg);
static bool manager_msg_proc(JWidget widget, Message* msg);
static void manager_request_size(JWidget widget, int *w, int *h);
static void manager_set_position(JWidget widget, JRect rect);
static void manager_pump_queue(JWidget widget);
/* auxiliary */
static void generate_setcursor_message();
static void remove_msgs_for(JWidget widget, JMessage msg);
static void remove_msgs_for(JWidget widget, Message* msg);
static int some_parent_is_focusrest(JWidget widget);
static JWidget find_magnetic_widget(JWidget widget);
static JMessage new_mouse_msg(int type, JWidget destination);
static void broadcast_key_msg(JWidget manager, JMessage msg);
static Message* new_mouse_msg(int type, JWidget destination);
static void broadcast_key_msg(JWidget manager, Message* msg);
/* keyboard focus movement stuff */
static bool move_focus(JWidget manager, JMessage msg);
static bool move_focus(JWidget manager, Message* msg);
static int count_widgets_accept_focus(JWidget widget);
static bool childs_accept_focus(JWidget widget, bool first);
static JWidget next_widget(JWidget widget);
@ -258,7 +258,7 @@ bool jmanager_generate_messages(JWidget manager)
JWidget widget;
JWidget window;
int mousemove;
JMessage msg;
Message* msg;
JLink link;
int c;
@ -561,7 +561,7 @@ bool jmanager_generate_messages(JWidget manager)
void jmanager_dispatch_messages(JWidget manager)
{
JMessage msg;
Message* msg;
ASSERT(manager != NULL);
@ -607,7 +607,7 @@ int jmanager_add_timer(JWidget widget, int interval)
void jmanager_remove_timer(int timer_id)
{
JMessage message;
Message* message;
JLink link, next;
ASSERT(timer_id >= 0 && timer_id < (int)timers.size());
@ -618,12 +618,12 @@ void jmanager_remove_timer(int timer_id)
/* remove messages of this timer in the queue */
JI_LIST_FOR_EACH_SAFE(msg_queue, link, next) {
message = reinterpret_cast<JMessage>(link->data);
message = reinterpret_cast<Message*>(link->data);
if (!message->any.used &&
message->any.type == JM_TIMER &&
message->timer.timer_id == timer_id) {
printf("REMOVING A TIMER MESSAGE FROM THE QUEUE!!\n"); fflush(stdout);
jmessage_free(reinterpret_cast<JMessage>(link->data));
jmessage_free(reinterpret_cast<Message*>(link->data));
jlist_delete_link(msg_queue, link);
}
}
@ -666,7 +666,7 @@ bool jmanager_timer_is_running(int timer_id)
* routine. The message will be automatically freed through
* @ref jmessage_free
*/
void jmanager_enqueue_message(JMessage msg)
void jmanager_enqueue_message(Message* msg)
{
int c;
@ -730,7 +730,7 @@ void jmanager_set_focus(JWidget widget)
JList widget_parents = NULL;
JWidget common_parent = NULL;
JLink link, link2;
JMessage msg;
Message* msg;
if (widget)
widget_parents = widget->getParents(false);
@ -800,7 +800,7 @@ void jmanager_set_mouse(JWidget widget)
JList widget_parents = NULL;
JWidget common_parent = NULL;
JLink link, link2;
JMessage msg;
Message* msg;
if (widget)
widget_parents = widget->getParents(false);
@ -919,7 +919,7 @@ void jmanager_free_widget(JWidget widget)
jmanager_free_focus();
}
void jmanager_remove_message(JMessage msg)
void jmanager_remove_message(Message* msg)
{
jlist_remove(msg_queue, msg);
}
@ -928,7 +928,7 @@ void jmanager_remove_messages_for(JWidget widget)
{
JLink link;
JI_LIST_FOR_EACH(msg_queue, link)
remove_msgs_for(widget, reinterpret_cast<JMessage>(link->data));
remove_msgs_for(widget, reinterpret_cast<Message*>(link->data));
}
void jmanager_refresh_screen()
@ -981,7 +981,7 @@ void jmanager_remove_msg_filter_for(JWidget widget)
/* configures the window for begin the loop */
void _jmanager_open_window(JWidget manager, Frame* window)
{
JMessage msg;
Message* msg;
// free all widgets of special states
if (window->is_wantfocus()) {
@ -1008,7 +1008,7 @@ void _jmanager_open_window(JWidget manager, Frame* window)
void _jmanager_close_window(JWidget manager, Frame* window, bool redraw_background)
{
JMessage msg;
Message* msg;
JRegion reg1;
if (!manager->hasChild(window))
@ -1075,7 +1075,7 @@ void _jmanager_close_window(JWidget manager, Frame* window, bool redraw_backgrou
Manager
**********************************************************************/
static bool manager_msg_proc(JWidget widget, JMessage msg)
static bool manager_msg_proc(JWidget widget, Message* msg)
{
switch (msg->type) {
@ -1182,9 +1182,9 @@ static void manager_set_position(JWidget widget, JRect rect)
static void manager_pump_queue(JWidget widget_manager)
{
JMessage msg, first_msg;
Message* msg, *first_msg;
JLink link, link2, next;
JWidget widget;
Widget* widget;
bool done;
#ifdef LIMIT_DISPATCH_TIME
int t = ji_clock;
@ -1202,7 +1202,7 @@ static void manager_pump_queue(JWidget widget_manager)
#endif
/* the message to process */
msg = reinterpret_cast<JMessage>(link->data);
msg = reinterpret_cast<Message*>(link->data);
/* go to next message */
if (msg->any.used) {
@ -1353,7 +1353,7 @@ void jmanager_invalidate_region(JWidget widget, JRegion region)
static void generate_setcursor_message()
{
JWidget dst;
JMessage msg;
Message* msg;
if (capture_widget)
dst = capture_widget;
@ -1368,7 +1368,7 @@ static void generate_setcursor_message()
jmouse_set_cursor(JI_CURSOR_NORMAL);
}
static void remove_msgs_for(JWidget widget, JMessage msg)
static void remove_msgs_for(JWidget widget, Message* msg)
{
JLink link, next;
@ -1406,9 +1406,9 @@ static JWidget find_magnetic_widget(JWidget widget)
return NULL;
}
static JMessage new_mouse_msg(int type, JWidget widget)
static Message* new_mouse_msg(int type, JWidget widget)
{
JMessage msg = jmessage_new(type);
Message* msg = jmessage_new(type);
if (!msg)
return NULL;
@ -1427,7 +1427,7 @@ static JMessage new_mouse_msg(int type, JWidget widget)
return msg;
}
static void broadcast_key_msg(JWidget manager, JMessage msg)
static void broadcast_key_msg(JWidget manager, Message* msg)
{
/* send the message to the widget with capture */
if (capture_widget) {
@ -1447,7 +1447,7 @@ static void broadcast_key_msg(JWidget manager, JMessage msg)
Focus Movement
***********************************************************************/
static bool move_focus(JWidget manager, JMessage msg)
static bool move_focus(JWidget manager, Message* msg)
{
int (*cmp)(JWidget, int, int) = NULL;
Widget* focus = NULL;

View File

@ -29,7 +29,7 @@ bool jmanager_timer_is_running(int timer_id);
/* routines that uses the ji_get_default_manager() */
void jmanager_enqueue_message(JMessage msg);
void jmanager_enqueue_message(Message* msg);
JWidget jmanager_get_top_window();
@ -46,7 +46,7 @@ void jmanager_free_focus();
void jmanager_free_mouse();
void jmanager_free_capture();
void jmanager_free_widget(JWidget widget);
void jmanager_remove_message(JMessage msg);
void jmanager_remove_message(Message* msg);
void jmanager_remove_messages_for(JWidget widget);
void jmanager_refresh_screen();

View File

@ -103,15 +103,15 @@ struct MenuItem
int submenu_timer; // Timer to open the submenu
};
static bool menu_msg_proc(Widget* widget, JMessage msg);
static bool menu_msg_proc(Widget* widget, Message* msg);
static void menu_request_size(Widget* widget, int *w, int *h);
static void menu_set_position(Widget* widget, JRect rect);
static bool menubox_msg_proc(Widget* widget, JMessage msg);
static bool menubox_msg_proc(Widget* widget, Message* msg);
static void menubox_request_size(Widget* widget, int *w, int *h);
static void menubox_set_position(Widget* widget, JRect rect);
static bool menuitem_msg_proc(Widget* widget, JMessage msg);
static bool menuitem_msg_proc(Widget* widget, Message* msg);
static void menuitem_request_size(Widget* widget, int *w, int *h);
static Widget* get_base_menubox(Widget* widget);
@ -127,10 +127,10 @@ static void close_menuitem(Widget* menuitem, bool last_of_close_chain);
static void close_popup(Widget* menubox);
static void close_all(Widget* menu);
static void exe_menuitem(Widget* menuitem);
static bool window_msg_proc(Widget* widget, JMessage msg);
static bool window_msg_proc(Widget* widget, Message* msg);
static Widget* check_for_letter(Widget* menu, int ascii);
static Widget* check_for_accel(Widget* menu, JMessage msg);
static Widget* check_for_accel(Widget* menu, Message* msg);
static Widget* find_nextitem(Widget* menu, Widget* menuitem);
static Widget* find_previtem(Widget* menu, Widget* menuitem);
@ -349,7 +349,7 @@ void jmenu_popup(Widget* menu, int x, int y)
jwidget_free(window);
}
static bool menu_msg_proc(Widget* widget, JMessage msg)
static bool menu_msg_proc(Widget* widget, Message* msg)
{
switch (msg->type) {
@ -444,7 +444,7 @@ static void menu_set_position(Widget* widget, JRect rect)
jrect_free(cpos);
}
static bool menubox_msg_proc(Widget* widget, JMessage msg)
static bool menubox_msg_proc(Widget* widget, Message* msg)
{
Widget* menu = jmenubox_get_menu(widget);
@ -813,7 +813,7 @@ static void menubox_set_position(Widget* widget, JRect rect)
}
}
static bool menuitem_msg_proc(Widget* widget, JMessage msg)
static bool menuitem_msg_proc(Widget* widget, Message* msg)
{
MenuItem *menuitem = MITEM(widget);
@ -1214,7 +1214,7 @@ static void open_menuitem(Widget* menuitem, bool select_first)
{
Widget* menu;
Widget* child;
JMessage msg;
Message* msg;
JLink link;
Base *base;
@ -1269,7 +1269,7 @@ static void open_menuitem(Widget* menuitem, bool select_first)
static void close_menuitem(Widget* menuitem, bool last_of_close_chain)
{
Widget* menu, *child;
JMessage msg;
Message* msg;
JLink link;
Base *base;
@ -1312,7 +1312,7 @@ static void close_menuitem(Widget* menuitem, bool last_of_close_chain)
static void close_popup(Widget* menubox)
{
JMessage msg = jmessage_new(JM_CLOSE_POPUP);
Message* msg = jmessage_new(JM_CLOSE_POPUP);
jmessage_add_dest(msg, menubox);
jmanager_enqueue_message(msg);
}
@ -1367,12 +1367,12 @@ static void close_all(Widget* menu)
static void exe_menuitem(Widget* menuitem)
{
// Send the message
JMessage msg = jmessage_new(JM_EXE_MENUITEM);
Message* msg = jmessage_new(JM_EXE_MENUITEM);
jmessage_add_dest(msg, menuitem);
jmanager_enqueue_message(msg);
}
static bool window_msg_proc(Widget* widget, JMessage msg)
static bool window_msg_proc(Widget* widget, Message* msg)
{
switch (msg->type) {
@ -1407,7 +1407,7 @@ static Widget* check_for_letter(Widget* menu, int ascii)
return NULL;
}
static Widget* check_for_accel(Widget* menu, JMessage msg)
static Widget* check_for_accel(Widget* menu, Message* msg)
{
Widget* menuitem;
JLink link;

View File

@ -23,9 +23,9 @@ int ji_register_message_type()
return registered_messages++;
}
JMessage jmessage_new(int type)
Message* jmessage_new(int type)
{
JMessage msg = (union jmessage*)base_malloc0(sizeof(union jmessage));
Message* msg = (Message*)base_malloc0(sizeof(Message));
if (!msg)
return NULL;
@ -46,9 +46,9 @@ JMessage jmessage_new(int type)
return msg;
}
JMessage jmessage_new_key_related(int type, int readkey_value)
Message* jmessage_new_key_related(int type, int readkey_value)
{
JMessage msg = jmessage_new(type);
Message* msg = jmessage_new(type);
msg->key.scancode = (readkey_value >> 8) & 0xff;
msg->key.ascii = readkey_value & 0xff;
@ -65,17 +65,17 @@ JMessage jmessage_new_key_related(int type, int readkey_value)
return msg;
}
JMessage jmessage_new_copy(const JMessage msg)
Message* jmessage_new_copy(const Message* msg)
{
JMessage copy;
Message* copy;
ASSERT(msg != NULL);
copy = (union jmessage*)base_malloc(sizeof(union jmessage));
copy = (Message*)base_malloc(sizeof(Message));
if (!copy)
return NULL;
memcpy(copy, msg, sizeof(union jmessage));
memcpy(copy, msg, sizeof(Message));
copy->any.widgets = jlist_copy(msg->any.widgets);
copy->any.used = false;
@ -83,17 +83,15 @@ JMessage jmessage_new_copy(const JMessage msg)
return copy;
}
JMessage jmessage_new_copy_without_dests(const JMessage msg)
Message* jmessage_new_copy_without_dests(const Message* msg)
{
JMessage copy;
ASSERT(msg != NULL);
copy = (union jmessage*)base_malloc(sizeof(union jmessage));
Message* copy = (Message*)base_malloc(sizeof(Message));
if (!copy)
return NULL;
memcpy(copy, msg, sizeof(union jmessage));
memcpy(copy, msg, sizeof(Message));
copy->any.widgets = jlist_new();
copy->any.used = false;
@ -101,7 +99,7 @@ JMessage jmessage_new_copy_without_dests(const JMessage msg)
return copy;
}
void jmessage_free(JMessage msg)
void jmessage_free(Message* msg)
{
ASSERT(msg != NULL);
@ -109,7 +107,7 @@ void jmessage_free(JMessage msg)
base_free(msg);
}
void jmessage_add_dest(JMessage msg, JWidget widget)
void jmessage_add_dest(Message* msg, JWidget widget)
{
ASSERT(msg != NULL);
ASSERT_VALID_WIDGET(widget);
@ -117,7 +115,7 @@ void jmessage_add_dest(JMessage msg, JWidget widget)
jlist_append(msg->any.widgets, widget);
}
void jmessage_add_pre_dest(JMessage msg, JWidget widget)
void jmessage_add_pre_dest(Message* msg, JWidget widget)
{
ASSERT(msg != NULL);
ASSERT_VALID_WIDGET(widget);
@ -125,7 +123,7 @@ void jmessage_add_pre_dest(JMessage msg, JWidget widget)
jlist_prepend(msg->any.widgets, widget);
}
void jmessage_broadcast_to_children(JMessage msg, JWidget widget)
void jmessage_broadcast_to_children(Message* msg, JWidget widget)
{
JLink link;
@ -138,7 +136,7 @@ void jmessage_broadcast_to_children(JMessage msg, JWidget widget)
jmessage_add_dest(msg, widget);
}
void jmessage_broadcast_to_parents(JMessage msg, JWidget widget)
void jmessage_broadcast_to_parents(Message* msg, JWidget widget)
{
ASSERT(msg != NULL);
ASSERT_VALID_WIDGET(widget);

View File

@ -20,7 +20,7 @@
return _jm_##name; \
} \
struct jmessage_any
struct MessageAny
{
int type; /* type of message */
JList widgets; /* destination widgets */
@ -28,15 +28,15 @@ struct jmessage_any
int shifts; /* key shifts pressed when message was created */
};
struct jmessage_deffree /* deferred jwidget_free call */
struct MessageDefFree /* deferred jwidget_free call */
{
struct jmessage_any any;
MessageAny any;
JWidget widget_to_free;
};
struct jmessage_key
struct MessageKey
{
struct jmessage_any any;
MessageAny any;
unsigned scancode : 8; /* Allegro scancode */
unsigned ascii : 8; /* ASCII code */
unsigned repeat; /* repeat=0 means the first time the key is pressed */
@ -44,16 +44,16 @@ struct jmessage_key
bool propagate_to_parent : 1;
};
struct jmessage_draw
struct MessageDraw
{
struct jmessage_any any;
MessageAny any;
int count; /* cound=0 if it's last msg of draw-chain */
struct jrect rect; /* area to draw */
};
struct jmessage_mouse
struct MessageMouse
{
struct jmessage_any any;
MessageAny any;
int x, y; /* mouse position */
unsigned flags : 4; /* all buttons */
bool left : 1; /* left button */
@ -61,73 +61,73 @@ struct jmessage_mouse
bool middle : 1; /* middle button */
};
struct jmessage_signal
struct MessageSignal
{
struct jmessage_any any;
MessageAny any;
int num; /* signal number */
JWidget from; /* signal generator */
};
struct jmessage_timer
struct MessageTimer
{
struct jmessage_any any;
MessageAny any;
int count; /* accumulated calls */
int timer_id; /* number of timer */
};
struct jmessage_setpos
struct MessageSetPos
{
struct jmessage_any any;
MessageAny any;
struct jrect rect; /* set position */
};
struct jmessage_reqsize
struct MessageReqSize
{
struct jmessage_any any;
MessageAny any;
int w, h; /* requested size */
};
struct jmessage_drawrgn
struct MessageDrawRgn
{
struct jmessage_any any;
MessageAny any;
JRegion region; /* region to redraw */
};
struct jmessage_user
struct MessageUser
{
struct jmessage_any any;
MessageAny any;
int a, b, c;
void *dp;
};
union jmessage
union Message
{
int type;
struct jmessage_any any;
struct jmessage_deffree deffree;
struct jmessage_key key;
struct jmessage_draw draw;
struct jmessage_mouse mouse;
struct jmessage_signal signal;
struct jmessage_timer timer;
struct jmessage_setpos setpos;
struct jmessage_reqsize reqsize;
struct jmessage_drawrgn drawrgn;
struct jmessage_user user;
MessageAny any;
MessageDefFree deffree;
MessageKey key;
MessageDraw draw;
MessageMouse mouse;
MessageSignal signal;
MessageTimer timer;
MessageSetPos setpos;
MessageReqSize reqsize;
MessageDrawRgn drawrgn;
MessageUser user;
};
int ji_register_message_type();
JMessage jmessage_new(int type);
JMessage jmessage_new_key_related(int type, int readkey_value);
JMessage jmessage_new_copy(const JMessage msg);
JMessage jmessage_new_copy_without_dests(const JMessage msg);
void jmessage_free(JMessage msg);
Message* jmessage_new(int type);
Message* jmessage_new_key_related(int type, int readkey_value);
Message* jmessage_new_copy(const Message* msg);
Message* jmessage_new_copy_without_dests(const Message* msg);
void jmessage_free(Message* msg);
void jmessage_add_dest(JMessage msg, JWidget widget);
void jmessage_add_pre_dest(JMessage msg, JWidget widget);
void jmessage_add_dest(Message* msg, JWidget widget);
void jmessage_add_pre_dest(Message* msg, JWidget widget);
void jmessage_broadcast_to_children(JMessage msg, JWidget widget);
void jmessage_broadcast_to_parents(JMessage msg, JWidget widget);
void jmessage_broadcast_to_children(Message* msg, JWidget widget);
void jmessage_broadcast_to_parents(Message* msg, JWidget widget);
#endif

View File

@ -21,7 +21,7 @@ struct Panel
double pos;
};
static bool panel_msg_proc(JWidget widget, JMessage msg);
static bool panel_msg_proc(JWidget widget, Message* msg);
static void panel_request_size(JWidget widget, int *w, int *h);
static void panel_set_position(JWidget widget, JRect rect);
@ -56,7 +56,7 @@ void jpanel_set_pos(JWidget widget, double pos)
widget->invalidate();
}
static bool panel_msg_proc(JWidget widget, JMessage msg)
static bool panel_msg_proc(JWidget widget, Message* msg)
{
switch (msg->type) {

View File

@ -74,7 +74,7 @@ void PopupFrame::makeFixed()
set_moveable(false);
}
bool PopupFrame::onProcessMessage(JMessage msg)
bool PopupFrame::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -22,7 +22,7 @@ public:
void makeFixed();
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
void onPaint(PaintEvent& ev) OVERRIDE;

View File

@ -43,7 +43,7 @@ void ScrollBar::getScrollBarThemeInfo(int* pos, int* len)
getScrollBarInfo(pos, len, NULL, NULL);
}
bool ScrollBar::onProcessMessage(JMessage msg)
bool ScrollBar::onProcessMessage(Message* msg)
{
#define MOUSE_IN(x1, y1, x2, y2) \
((msg->mouse.x >= (x1)) && (msg->mouse.x <= (x2)) && \

View File

@ -26,7 +26,7 @@ public:
protected:
// Events
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
private:
void getScrollBarInfo(int* _pos, int* _len, int* _bar_size, int* _viewport_size);

View File

@ -15,7 +15,7 @@
using namespace gfx;
static bool separator_msg_proc(JWidget widget, JMessage msg);
static bool separator_msg_proc(JWidget widget, Message* msg);
JWidget ji_separator_new(const char* text, int align)
{
@ -29,7 +29,7 @@ JWidget ji_separator_new(const char* text, int align)
return widget;
}
static bool separator_msg_proc(JWidget widget, JMessage msg)
static bool separator_msg_proc(JWidget widget, Message* msg)
{
switch (msg->type) {

View File

@ -61,7 +61,7 @@ void Slider::getSliderThemeInfo(int* min, int* max, int* value)
if (value) *value = m_value;
}
bool Slider::onProcessMessage(JMessage msg)
bool Slider::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -31,7 +31,7 @@ public:
protected:
// Events
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
void onPaint(PaintEvent& ev) OVERRIDE;

View File

@ -20,7 +20,7 @@
#include "gui/view.h"
#include "gui/widget.h"
static bool textbox_msg_proc(JWidget widget, JMessage msg);
static bool textbox_msg_proc(JWidget widget, Message* msg);
static void textbox_request_size(JWidget widget, int *w, int *h);
JWidget jtextbox_new(const char *text, int align)
@ -36,7 +36,7 @@ JWidget jtextbox_new(const char *text, int align)
return widget;
}
static bool textbox_msg_proc(JWidget widget, JMessage msg)
static bool textbox_msg_proc(JWidget widget, Message* msg)
{
switch (msg->type) {

View File

@ -28,7 +28,7 @@ struct TipData
};
static int tip_type();
static bool tip_hook(JWidget widget, JMessage msg);
static bool tip_hook(JWidget widget, Message* msg);
void jwidget_add_tooltip_text(JWidget widget, const char *text, int arrowAlign)
{
@ -64,7 +64,7 @@ static int tip_type()
}
/* hook for the widget in which we added a tooltip */
static bool tip_hook(JWidget widget, JMessage msg)
static bool tip_hook(JWidget widget, Message* msg)
{
TipData* tip = reinterpret_cast<TipData*>(jwidget_get_data(widget, tip_type()));
@ -234,7 +234,7 @@ void TipWindow::setArrowAlign(int arrowAlign)
m_arrowAlign = arrowAlign;
}
bool TipWindow::onProcessMessage(JMessage msg)
bool TipWindow::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -23,7 +23,7 @@ public:
void setArrowAlign(int arrowAlign);
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
void onPaint(PaintEvent& ev) OVERRIDE;

View File

@ -236,7 +236,7 @@ View* View::getView(Widget* widget)
return 0;
}
bool View::onProcessMessage(JMessage msg)
bool View::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -46,7 +46,7 @@ public:
protected:
// Events
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
private:
static void displaceWidgets(Widget* widget, int x, int y);

View File

@ -22,7 +22,7 @@ Viewport::Viewport()
initTheme();
}
bool Viewport::onProcessMessage(JMessage msg)
bool Viewport::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -19,7 +19,7 @@ public:
protected:
// Events
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
private:
void set_position(JRect rect);

View File

@ -95,7 +95,7 @@ void jwidget_free(JWidget widget)
Widget::~Widget()
{
JLink link, next;
JMessage msg;
Message* msg;
/* send destroy message */
msg = jmessage_new(JM_DESTROY);
@ -142,7 +142,7 @@ Widget::~Widget()
void jwidget_free_deferred(JWidget widget)
{
JMessage msg;
Message* msg;
ASSERT_VALID_WIDGET(widget);
@ -174,7 +174,7 @@ void Widget::initTheme()
* @see jhook
*/
void jwidget_add_hook(JWidget widget, int type,
JMessageFunc msg_proc, void *data)
MessageFunc msg_proc, void *data)
{
JHook hook;
@ -1030,7 +1030,7 @@ void jwidget_set_border(JWidget widget, int l, int t, int r, int b)
void jwidget_set_rect(JWidget widget, JRect rect)
{
JMessage msg;
Message* msg;
ASSERT_VALID_WIDGET(widget);
@ -1070,7 +1070,7 @@ void jwidget_flush_redraw(JWidget widget)
{
std::queue<Widget*> processing;
int c, nrects;
JMessage msg;
Message* msg;
JLink link;
JRect rc;
@ -1236,7 +1236,7 @@ bool jwidget_emit_signal(JWidget widget, int signal_num)
ASSERT_VALID_WIDGET(widget);
if (!widget->emit_signals) {
JMessage msg;
Message* msg;
bool ret;
#ifdef REPORT_SIGNALS
@ -1266,7 +1266,7 @@ bool jwidget_emit_signal(JWidget widget, int signal_num)
/**********************************************************************/
/* manager handler */
bool Widget::sendMessage(JMessage msg)
bool Widget::sendMessage(Message* msg)
{
bool done = false;
JHook hook;
@ -1467,7 +1467,7 @@ bool jwidget_check_underscored(JWidget widget, int scancode)
/**********************************************************************/
/* widget message procedure */
bool Widget::onProcessMessage(JMessage msg)
bool Widget::onProcessMessage(Message* msg)
{
JWidget widget = this;
@ -1611,7 +1611,7 @@ bool Widget::onProcessMessage(JMessage msg)
*/
void Widget::onPreferredSize(PreferredSizeEvent& ev)
{
JMessage msg = jmessage_new(JM_REQSIZE);
Message* msg = jmessage_new(JM_REQSIZE);
sendMessage(msg);
Size sz(msg->reqsize.w, msg->reqsize.h);
jmessage_free(msg);

View File

@ -40,7 +40,7 @@ void jwidget_free_deferred(JWidget widget);
/* hooks */
void jwidget_add_hook(JWidget widget, int type,
JMessageFunc msg_proc, void *data);
MessageFunc msg_proc, void *data);
JHook jwidget_get_hook(JWidget widget, int type);
void *jwidget_get_data(JWidget widget, int type);
@ -279,7 +279,7 @@ public:
// GUI MANAGER
// ===============================================================
bool sendMessage(JMessage msg);
bool sendMessage(Message* msg);
void closeWindow();
void broadcastMouseMessage(WidgetsList& targets);
@ -312,7 +312,7 @@ protected:
// MESSAGE PROCESSING
// ===============================================================
virtual bool onProcessMessage(JMessage msg);
virtual bool onProcessMessage(Message* msg);
// ===============================================================
// EVENTS

View File

@ -109,7 +109,7 @@ struct Shortcut
~Shortcut();
void add_shortcut(const char* shortcut_string);
bool is_pressed(JMessage msg);
bool is_pressed(Message* msg);
bool is_pressed_from_key_array();
};
@ -160,8 +160,8 @@ static void reload_default_font();
static void load_gui_config(int& w, int& h, int& bpp, bool& fullscreen, bool& maximized);
static void save_gui_config();
static bool button_with_icon_msg_proc(JWidget widget, JMessage msg);
static bool manager_msg_proc(JWidget widget, JMessage msg);
static bool button_with_icon_msg_proc(JWidget widget, Message* msg);
static bool manager_msg_proc(JWidget widget, Message* msg);
static void on_palette_change_signal();
@ -695,7 +695,7 @@ static int hook_type()
return type;
}
static bool hook_msg_proc(JWidget widget, JMessage msg)
static bool hook_msg_proc(JWidget widget, Message* msg)
{
switch (msg->type) {
@ -898,7 +898,7 @@ JAccel add_keyboard_shortcut_to_quicktool(const char* shortcut_string, tools::To
return shortcut->accel;
}
Command* get_command_from_key_message(JMessage msg)
Command* get_command_from_key_message(Message* msg)
{
for (std::vector<Shortcut*>::iterator
it = shortcuts->begin(); it != shortcuts->end(); ++it) {
@ -971,7 +971,7 @@ void Shortcut::add_shortcut(const char* shortcut_string)
jaccel_add_keys_from_string(this->accel, buf);
}
bool Shortcut::is_pressed(JMessage msg)
bool Shortcut::is_pressed(Message* msg)
{
if (accel) {
return jaccel_check(accel,
@ -1087,7 +1087,7 @@ void* get_monitor_data(Monitor* monitor)
}
// Manager event handler.
static bool manager_msg_proc(JWidget widget, JMessage msg)
static bool manager_msg_proc(JWidget widget, Message* msg)
{
switch (msg->type) {

View File

@ -113,7 +113,7 @@ JAccel add_keyboard_shortcut_to_execute_command(const char* shortcut, const char
JAccel add_keyboard_shortcut_to_change_tool(const char* shortcut, tools::Tool* tool);
JAccel add_keyboard_shortcut_to_quicktool(const char* shortcut, tools::Tool* tool);
Command* get_command_from_key_message(JMessage msg);
Command* get_command_from_key_message(Message* msg);
JAccel get_accel_to_execute_command(const char* command, Params* params = NULL);
JAccel get_accel_to_change_tool(tools::Tool* tool);
tools::Tool* get_selected_quicktool();

View File

@ -2046,7 +2046,7 @@ void SkinTheme::paintIcon(Widget* widget, Graphics* g, IButtonIcon* iconInterfac
}
/* controls the "X" button in a window to close it */
bool SkinTheme::theme_frame_button_msg_proc(JWidget widget, JMessage msg)
bool SkinTheme::theme_frame_button_msg_proc(JWidget widget, Message* msg)
{
switch (msg->type) {

View File

@ -179,8 +179,8 @@ private:
void paintIcon(Widget* widget, Graphics* g, IButtonIcon* iconInterface, int x, int y);
static bool theme_frame_button_msg_proc(JWidget widget, JMessage msg);
static bool theme_combobox_button_msg_proc(JWidget widget, JMessage msg);
static bool theme_frame_button_msg_proc(JWidget widget, Message* msg);
static bool theme_combobox_button_msg_proc(JWidget widget, Message* msg);
static FONT* loadFont(const char* userFont, const std::string& path);

View File

@ -49,7 +49,7 @@ ColorBar::ScrollableView::ScrollableView()
jwidget_set_border(this, l, t, r, b);
}
bool ColorBar::ScrollableView::onProcessMessage(JMessage msg)
bool ColorBar::ScrollableView::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -63,7 +63,7 @@ private:
public:
ScrollableView();
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
};
Button m_paletteButton;

View File

@ -85,7 +85,7 @@ void ColorButton::setColor(const Color& color)
invalidate();
}
bool ColorButton::onProcessMessage(JMessage msg)
bool ColorButton::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -43,7 +43,7 @@ public:
protected:
// Events
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
void onPaint(PaintEvent& ev) OVERRIDE;

View File

@ -71,9 +71,9 @@
using namespace gfx;
using namespace tools;
static bool editor_view_msg_proc(JWidget widget, JMessage msg);
static bool editor_view_msg_proc(JWidget widget, Message* msg);
static ToolLoopManager::Pointer pointer_from_msg(JMessage msg)
static ToolLoopManager::Pointer pointer_from_msg(Message* msg)
{
ToolLoopManager::Pointer::Button button =
(msg->mouse.right ? ToolLoopManager::Pointer::Right:
@ -612,7 +612,7 @@ void Editor::setMaskColorForPixelsMovement(const Color& color)
@param msg A mouse message received in Editor::onProcessMessage()
*/
void Editor::controlInfiniteScroll(JMessage msg)
void Editor::controlInfiniteScroll(Message* msg)
{
View* view = View::getView(this);
Rect vp = view->getViewportBounds();
@ -780,7 +780,7 @@ void Editor::editor_update_quicktool()
//////////////////////////////////////////////////////////////////////
// Message handler for the a view widget that contains an editor
static bool editor_view_msg_proc(JWidget widget, JMessage msg)
static bool editor_view_msg_proc(JWidget widget, Message* msg)
{
switch (msg->type) {
@ -823,7 +823,7 @@ enum WHEEL_ACTION { WHEEL_NONE,
WHEEL_BG,
WHEEL_FRAME };
bool Editor::onProcessMessage(JMessage msg)
bool Editor::onProcessMessage(Message* msg)
{
ASSERT((m_state == EDITOR_STATE_DRAWING && m_toolLoopManager != NULL) ||
(m_state != EDITOR_STATE_DRAWING && m_toolLoopManager == NULL));
@ -1983,7 +1983,7 @@ public:
}
};
ToolLoop* Editor::createToolLoopImpl(Context* context, JMessage msg)
ToolLoop* Editor::createToolLoopImpl(Context* context, Message* msg)
{
Tool* current_tool = context->getSettings()->getCurrentTool();
if (!current_tool)

View File

@ -184,13 +184,13 @@ public:
int editor_click_cancel();
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
void onCurrentToolChange();
private:
void drawGrid(const gfx::Rect& gridBounds, const Color& color);
void controlInfiniteScroll(JMessage msg);
void controlInfiniteScroll(Message* msg);
void dropPixels();
tools::Tool* getCurrentEditorTool();
@ -200,7 +200,7 @@ private:
void editor_update_candraw();
void setZoomAndCenterInMouse(int zoom, int mouse_x, int mouse_y);
tools::ToolLoop* createToolLoopImpl(Context* context, JMessage msg);
tools::ToolLoop* createToolLoopImpl(Context* context, Message* msg);
void for_each_pixel_of_pen(int screen_x, int screen_y,
int sprite_x, int sprite_y, int color,

View File

@ -77,7 +77,7 @@ typedef struct ThumbnailData
} ThumbnailData;
static FileView* fileview_data(JWidget widget);
static bool fileview_msg_proc(JWidget widget, JMessage msg);
static bool fileview_msg_proc(JWidget widget, Message* msg);
static void fileview_get_fileitem_size(JWidget widget, IFileItem* fi, int *w, int *h);
static void fileview_make_selected_fileitem_visible(JWidget widget);
static void fileview_regenerate_list(JWidget widget);
@ -192,7 +192,7 @@ static FileView* fileview_data(JWidget widget)
return reinterpret_cast<FileView*>(jwidget_get_data(widget, fileview_type()));
}
static bool fileview_msg_proc(JWidget widget, JMessage msg)
static bool fileview_msg_proc(JWidget widget, Message* msg)
{
FileView* fileview = fileview_data(widget);

View File

@ -50,7 +50,7 @@ struct MenuItem
};
static int menuitem_type();
static bool menuitem_msg_proc(JWidget widget, JMessage msg);
static bool menuitem_msg_proc(JWidget widget, Message* msg);
/**
* A widget that represent a menu item of the application.
@ -94,7 +94,7 @@ static int menuitem_type()
return type;
}
static bool menuitem_msg_proc(JWidget widget, JMessage msg)
static bool menuitem_msg_proc(JWidget widget, Message* msg)
{
switch (msg->type) {

View File

@ -365,7 +365,7 @@ Color PaletteView::getColorByPosition(int target_x, int target_y)
return Color::fromMask();
}
bool PaletteView::onProcessMessage(JMessage msg)
bool PaletteView::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -60,7 +60,7 @@ public:
Signal1<void, int> IndexChange;
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
private:
void request_size(int* w, int* h);

View File

@ -60,7 +60,7 @@ void PopupFramePin::onPinClick(Event& ev)
}
}
bool PopupFramePin::onProcessMessage(JMessage msg)
bool PopupFramePin::onProcessMessage(Message* msg)
{
switch (msg->type) {

View File

@ -28,7 +28,7 @@ public:
PopupFramePin(const char* text, bool close_on_buttonpressed);
protected:
virtual bool onProcessMessage(JMessage msg) OVERRIDE;
virtual bool onProcessMessage(Message* msg) OVERRIDE;
virtual void onHitTest(HitTestEvent& ev) OVERRIDE;
// The pin. Your derived class must add this pin in some place of

View File

@ -58,7 +58,7 @@ enum AniAction {
ACTION_LAST,
};
static bool tipwindow_msg_proc(JWidget widget, JMessage msg);
static bool tipwindow_msg_proc(JWidget widget, Message* msg);
static void slider_change_hook(Slider* slider);
static void ani_button_command(Button* widget, AniAction action);
@ -354,7 +354,7 @@ float Progress::getPos() const
//////////////////////////////////////////////////////////////////////
// StatusBar message handler
bool StatusBar::onProcessMessage(JMessage msg)
bool StatusBar::onProcessMessage(Message* msg)
{
switch (msg->type) {
@ -725,7 +725,7 @@ bool StatusBar::onProcessMessage(JMessage msg)
return Widget::onProcessMessage(msg);
}
static bool tipwindow_msg_proc(JWidget widget, JMessage msg)
static bool tipwindow_msg_proc(JWidget widget, Message* msg)
{
switch (msg->type) {

View File

@ -74,7 +74,7 @@ public:
void removeProgress(Progress* progress);
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
private:
void onCurrentToolChange();

View File

@ -37,7 +37,7 @@
#define HAS_ARROWS(tabs) ((m_button_left->getParent() == (tabs)))
static bool tabs_button_msg_proc(JWidget widget, JMessage msg);
static bool tabs_button_msg_proc(JWidget widget, Message* msg);
static int tabs_type()
{
@ -192,7 +192,7 @@ void* Tabs::getSelectedTab()
return NULL;
}
bool Tabs::onProcessMessage(JMessage msg)
bool Tabs::onProcessMessage(Message* msg)
{
SkinTheme* theme = static_cast<SkinTheme*>(this->getTheme());
@ -634,7 +634,7 @@ void Tabs::stopAni()
jmanager_stop_timer(m_timerId);
}
static bool tabs_button_msg_proc(JWidget widget, JMessage msg)
static bool tabs_button_msg_proc(JWidget widget, Message* msg)
{
JWidget parent;
Tabs* tabs = NULL;

View File

@ -85,7 +85,7 @@ public:
void stopScrolling();
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
private:
void startAni(Ani ani);

View File

@ -78,7 +78,7 @@ public:
void closeTipWindow();
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
private:
int getToolGroupIndex(ToolGroup* group);
@ -107,7 +107,7 @@ public:
Signal1<void, Tool*> ToolSelected;
protected:
bool onProcessMessage(JMessage msg) OVERRIDE;
bool onProcessMessage(Message* msg) OVERRIDE;
private:
Rect getToolBounds(int index);
@ -177,7 +177,7 @@ bool ToolBar::isToolVisible(Tool* tool)
return (m_selected_in_group[tool->getGroup()] == tool);
}
bool ToolBar::onProcessMessage(JMessage msg)
bool ToolBar::onProcessMessage(Message* msg)
{
switch (msg->type) {
@ -610,7 +610,7 @@ void ToolStrip::saveOverlappedArea(const Rect& bounds)
bounds.w, bounds.h);
}
bool ToolStrip::onProcessMessage(JMessage msg)
bool ToolStrip::onProcessMessage(Message* msg)
{
switch (msg->type) {