Changeset dc0f6e4c in mainline for uspace/lib/ui/src/wdecor.c


Ignore:
Timestamp:
2023-10-24T16:50:46Z (17 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Parents:
29ed06d
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-22 20:38:41)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-24 16:50:46)
Message:

Deduplicate identical enums for window resizing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/wdecor.c

    r29ed06d rdc0f6e4c  
    650650 * @param pos_id Positioning device ID
    651651 */
    652 void ui_wdecor_resize(ui_wdecor_t *wdecor, ui_wdecor_rsztype_t rsztype,
     652void ui_wdecor_resize(ui_wdecor_t *wdecor, display_wnd_rsztype_t rsztype,
    653653    gfx_coord2_t *pos, sysarg_t pos_id)
    654654{
     
    912912 * @return Resize type
    913913 */
    914 ui_wdecor_rsztype_t ui_wdecor_get_rsztype(ui_wdecor_t *wdecor,
     914display_wnd_rsztype_t ui_wdecor_get_rsztype(ui_wdecor_t *wdecor,
    915915    gfx_coord2_t *pos)
    916916{
     
    923923        /* Window not resizable? */
    924924        if ((wdecor->style & ui_wds_resizable) == 0)
    925                 return ui_wr_none;
     925                return display_wr_none;
    926926
    927927        /* Window is maximized? */
    928928        if (wdecor->maximized)
    929                 return ui_wr_none;
     929                return display_wr_none;
    930930
    931931        /* Position not inside window? */
    932932        if (!gfx_pix_inside_rect(pos, &wdecor->rect))
    933                 return ui_wr_none;
     933                return display_wr_none;
    934934
    935935        /* Position is within edge width from the outside */
     
    950950        /* Top-left corner */
    951951        if (edge && cleft && ctop)
    952                 return ui_wr_top_left;
     952                return display_wr_top_left;
    953953
    954954        /* Top-right corner */
    955955        if (edge && cright && ctop)
    956                 return ui_wr_top_right;
     956                return display_wr_top_right;
    957957
    958958        /* Bottom-left corner */
    959959        if (edge && cleft && cbottom)
    960                 return ui_wr_bottom_left;
     960                return display_wr_bottom_left;
    961961
    962962        /* Bottom-right corner */
    963963        if (edge && cright && cbottom)
    964                 return ui_wr_bottom_right;
     964                return display_wr_bottom_right;
    965965
    966966        /* Left edge */
    967967        if (eleft)
    968                 return ui_wr_left;
     968                return display_wr_left;
    969969
    970970        /* Right edge */
    971971        if (eright)
    972                 return ui_wr_right;
     972                return display_wr_right;
    973973
    974974        /* Top edge */
    975975        if (etop)
    976                 return ui_wr_top;
     976                return display_wr_top;
    977977
    978978        /* Bottom edge */
    979979        if (ebottom)
    980                 return ui_wr_bottom;
    981 
    982         return ui_wr_none;
     980                return display_wr_bottom;
     981
     982        return display_wr_none;
    983983}
    984984
     
    990990 * @return Cursor to use for this resize type
    991991 */
    992 ui_stock_cursor_t ui_wdecor_cursor_from_rsztype(ui_wdecor_rsztype_t rsztype)
     992ui_stock_cursor_t ui_wdecor_cursor_from_rsztype(display_wnd_rsztype_t rsztype)
    993993{
    994994        switch (rsztype) {
    995         case ui_wr_none:
     995        case display_wr_none:
    996996                return ui_curs_arrow;
    997997
    998         case ui_wr_top:
    999         case ui_wr_bottom:
     998        case display_wr_top:
     999        case display_wr_bottom:
    10001000                return ui_curs_size_ud;
    10011001
    1002         case ui_wr_left:
    1003         case ui_wr_right:
     1002        case display_wr_left:
     1003        case display_wr_right:
    10041004                return ui_curs_size_lr;
    10051005
    1006         case ui_wr_top_left:
    1007         case ui_wr_bottom_right:
     1006        case display_wr_top_left:
     1007        case display_wr_bottom_right:
    10081008                return ui_curs_size_uldr;
    10091009
    1010         case ui_wr_top_right:
    1011         case ui_wr_bottom_left:
     1010        case display_wr_top_right:
     1011        case display_wr_bottom_left:
    10121012                return ui_curs_size_urdl;
    10131013
     
    10741074        gfx_coord2_t pos;
    10751075        sysarg_t pos_id;
    1076         ui_wdecor_rsztype_t rsztype;
     1076        display_wnd_rsztype_t rsztype;
    10771077        ui_stock_cursor_t cursor;
    10781078
     
    10891089
    10901090        /* Press on window border? */
    1091         if (rsztype != ui_wr_none && event->type == POS_PRESS)
     1091        if (rsztype != display_wr_none && event->type == POS_PRESS)
    10921092                ui_wdecor_resize(wdecor, rsztype, &pos, pos_id);
    10931093}
Note: See TracChangeset for help on using the changeset viewer.