Ticket #3566: 3566-0002-Split-MSG_ACTION-into-MSG_ACTION-and-MSG_NOTIFY.patch

File 3566-0002-Split-MSG_ACTION-into-MSG_ACTION-and-MSG_NOTIFY.patch, 8.4 KB (added by mooffie, 9 years ago)
  • lib/widget/check.c

    From f6f6e09f79d90ecd5d1fc3d7ec4c6d06a006a3f3 Mon Sep 17 00:00:00 2001
    From: Mooffie <mooffie@gmail.com>
    Date: Thu, 21 Jan 2016 10:04:46 +0200
    Subject: [PATCH 2/2] Split MSG_ACTION into MSG_ACTION and MSG_NOTIFY.
    
    ---
     lib/widget/check.c         | 2 +-
     lib/widget/listbox.c       | 2 +-
     lib/widget/radio.c         | 4 ++--
     lib/widget/widget-common.h | 6 +++---
     src/editor/editcmd.c       | 2 +-
     src/filemanager/boxes.c    | 6 +++---
     src/filemanager/chmod.c    | 8 ++------
     src/filemanager/find.c     | 2 +-
     src/filemanager/hotlist.c  | 9 +--------
     src/filemanager/layout.c   | 2 +-
     src/filemanager/panelize.c | 9 +--------
     11 files changed, 17 insertions(+), 35 deletions(-)
    
    diff --git a/lib/widget/check.c b/lib/widget/check.c
    index 3ad7e05..65771dc 100644
    a b check_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d 
    7676            return MSG_NOT_HANDLED; 
    7777        c->state ^= C_BOOL; 
    7878        c->state ^= C_CHANGE; 
    79         send_message (WIDGET (w)->owner, w, MSG_ACTION, 0, NULL); 
     79        send_message (WIDGET (w)->owner, w, MSG_NOTIFY, 0, NULL); 
    8080        send_message (w, sender, MSG_FOCUS, ' ', data); 
    8181        return MSG_HANDLED; 
    8282 
  • lib/widget/listbox.c

    diff --git a/lib/widget/listbox.c b/lib/widget/listbox.c
    index 9d8e965..38e9ac6 100644
    a b static void 
    391391listbox_on_change (WListbox * l) 
    392392{ 
    393393    listbox_draw (l, TRUE); 
    394     send_message (WIDGET (l)->owner, l, MSG_ACTION, l->pos, NULL); 
     394    send_message (WIDGET (l)->owner, l, MSG_NOTIFY, l->pos, NULL); 
    395395} 
    396396 
    397397/* --------------------------------------------------------------------------------------------- */ 
  • lib/widget/radio.c

    diff --git a/lib/widget/radio.c b/lib/widget/radio.c
    index f40570e..b206f50 100644
    a b radio_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d 
    8585        { 
    8686        case ' ': 
    8787            r->sel = r->pos; 
    88             send_message (w->owner, w, MSG_ACTION, 0, NULL); 
     88            send_message (w->owner, w, MSG_NOTIFY, 0, NULL); 
    8989            send_message (w, sender, MSG_FOCUS, ' ', data); 
    9090            return MSG_HANDLED; 
    9191 
    radio_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d 
    110110        } 
    111111 
    112112    case MSG_CURSOR: 
    113         send_message (w->owner, w, MSG_ACTION, 0, NULL); 
     113        send_message (w->owner, w, MSG_NOTIFY, 0, NULL); 
    114114        send_message (w, sender, MSG_FOCUS, ' ', data); 
    115115        widget_move (r, r->pos, 1); 
    116116        return MSG_HANDLED; 
  • lib/widget/widget-common.h

    diff --git a/lib/widget/widget-common.h b/lib/widget/widget-common.h
    index 0398a1e..57fb984 100644
    a b typedef enum 
    3333    MSG_HOTKEY_HANDLED,         /* A widget has got the hotkey */ 
    3434    MSG_UNHANDLED_KEY,          /* Key that no widget handled */ 
    3535    MSG_POST_KEY,               /* The key has been handled */ 
    36     MSG_ACTION,                 /* Send to widget to handle command or 
    37                                  * state of check- and radiobuttons has changed 
    38                                  * and listbox current entry has changed */ 
     36    MSG_ACTION,                 /* Send to widget to handle command */ 
     37    MSG_NOTIFY,                 /* Typically sent to dialog to inform it of state-change 
     38                                 * of listboxes, check- and radiobuttons. */ 
    3939    MSG_CURSOR,                 /* Sent to widget to position the cursor */ 
    4040    MSG_IDLE,                   /* The idle state is active */ 
    4141    MSG_RESIZE,                 /* Screen size has changed */ 
  • src/editor/editcmd.c

    diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c
    index 0d2d6e1..0c8dfd6 100644
    a b edit_save_mode_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm 
    160160{ 
    161161    switch (msg) 
    162162    { 
    163     case MSG_ACTION: 
     163    case MSG_NOTIFY: 
    164164        if (sender != NULL && sender->id == edit_save_mode_radio_id) 
    165165        { 
    166166            Widget *ww; 
  • src/filemanager/boxes.c

    diff --git a/src/filemanager/boxes.c b/src/filemanager/boxes.c
    index 1860735..fef947a 100644
    a b configure_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, voi 
    129129{ 
    130130    switch (msg) 
    131131    { 
    132     case MSG_ACTION: 
     132    case MSG_NOTIFY: 
    133133        /* message from "Single press" checkbutton */ 
    134134        if (sender != NULL && sender->id == configure_old_esc_mode_id) 
    135135        { 
    panel_listing_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, 
    306306        } 
    307307        return MSG_NOT_HANDLED; 
    308308 
    309     case MSG_ACTION: 
     309    case MSG_NOTIFY: 
    310310        if (sender != NULL && sender->id == panel_listing_types_id) 
    311311        { 
    312312            WCheck *ch; 
    confvfs_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void 
    427427{ 
    428428    switch (msg) 
    429429    { 
    430     case MSG_ACTION: 
     430    case MSG_NOTIFY: 
    431431        /* message from "Always use ftp proxy" checkbutton */ 
    432432        if (sender != NULL && sender->id == ftpfs_always_use_proxy_id) 
    433433        { 
  • src/filemanager/chmod.c

    diff --git a/src/filemanager/chmod.c b/src/filemanager/chmod.c
    index b51ce40..715e457 100644
    a b chmod_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d 
    220220 
    221221    switch (msg) 
    222222    { 
    223     case MSG_ACTION: 
     223    case MSG_NOTIFY: 
    224224        { 
    225225            /* handle checkboxes */ 
    226226            int i; 
    227227 
    228             /* close dialog due to SIGINT (ctrl-g) */ 
    229             if (sender == NULL && parm == CK_Cancel) 
    230                 return MSG_NOT_HANDLED; 
    231  
    232             /* whether action was sent by checkbox? */ 
     228            /* whether notification was sent by checkbox? */ 
    233229            for (i = 0; i < check_perm_num; i++) 
    234230                if (sender == WIDGET (check_perm[i].check)) 
    235231                    break; 
  • src/filemanager/find.c

    diff --git a/src/filemanager/find.c b/src/filemanager/find.c
    index e0956d0..009f49e 100644
    a b find_parm_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, voi 
    428428 
    429429    switch (msg) 
    430430    { 
    431     case MSG_ACTION: 
     431    case MSG_NOTIFY: 
    432432        if (sender == WIDGET (content_use_cbox)) 
    433433        { 
    434434            gboolean disable = !(content_use_cbox->state & C_BOOL); 
  • src/filemanager/hotlist.c

    diff --git a/src/filemanager/hotlist.c b/src/filemanager/hotlist.c
    index db96ce8..0a7edad 100644
    a b hotlist_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void 
    577577    switch (msg) 
    578578    { 
    579579    case MSG_INIT: 
     580    case MSG_NOTIFY:           /* MSG_NOTIFY is fired by the listbox to tell us the item has changed. */ 
    580581        update_path_name (); 
    581582        return MSG_HANDLED; 
    582583 
    hotlist_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void 
    593594        dlg_set_size (h, LINES - (h == hotlist_dlg ? 2 : 6), COLS - 6); 
    594595        return MSG_HANDLED; 
    595596 
    596     case MSG_ACTION: 
    597         if (sender == NULL) 
    598             return MSG_NOT_HANDLED; 
    599  
    600         /* The listbox tells us the item has changed. */ 
    601         update_path_name (); 
    602         return MSG_HANDLED; 
    603  
    604597    default: 
    605598        return dlg_default_callback (w, sender, msg, parm, data); 
    606599    } 
  • src/filemanager/layout.c

    diff --git a/src/filemanager/layout.c b/src/filemanager/layout.c
    index cb4e1be..37e6878 100644
    a b layout_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void * 
    371371        } 
    372372        return MSG_HANDLED; 
    373373 
    374     case MSG_ACTION: 
     374    case MSG_NOTIFY: 
    375375        if (sender == WIDGET (radio_widget)) 
    376376        { 
    377377            if (panels_layout.horizontal_split != radio_widget->sel) 
  • src/filemanager/panelize.c

    diff --git a/src/filemanager/panelize.c b/src/filemanager/panelize.c
    index 8050244..5742fea 100644
    a b panelize_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void 
    113113    switch (msg) 
    114114    { 
    115115    case MSG_INIT: 
    116         update_command (); 
    117         return MSG_HANDLED; 
    118  
    119     case MSG_ACTION: 
    120         if (sender == NULL) 
    121             return MSG_NOT_HANDLED; 
    122  
    123         /* The listbox tells us the item has changed. */ 
     116    case MSG_NOTIFY:           /* MSG_NOTIFY is fired by the listbox to tell us the item has changed. */ 
    124117        update_command (); 
    125118        return MSG_HANDLED; 
    126119