Ignore:
File:
1 edited

Legend:

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

    rb769ca0 r3c54869  
    11/*
    2  * Copyright (c) 2026 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    142142}
    143143
    144 /** Set push button ops.
    145  *
    146  * These allow overriding the function for painting the button or
    147  * painting the button decoration.
    148  *
    149  * @param pbutton Push button
    150  * @param ops Push button ops
     144/** Set push button decoration ops.
     145 *
     146 * @param pbutton Push button
     147 * @param ops Push button decoration callbacks
    151148 * @param arg Decoration ops argument
    152149 */
    153 void ui_pbutton_set_ops(ui_pbutton_t *pbutton, ui_pbutton_ops_t *ops, void *arg)
    154 {
    155         pbutton->ops = ops;
    156         pbutton->ops_arg = arg;
     150void ui_pbutton_set_decor_ops(ui_pbutton_t *pbutton,
     151    ui_pbutton_decor_ops_t *ops, void *arg)
     152{
     153        pbutton->decor_ops = ops;
     154        pbutton->decor_arg = arg;
    157155}
    158156
     
    381379        }
    382380
    383         if (pbutton->ops != NULL && pbutton->ops->decor_paint != NULL) {
     381        if (pbutton->decor_ops != NULL && pbutton->decor_ops->paint != NULL) {
    384382                /* Custom decoration */
    385                 rc = pbutton->ops->decor_paint(pbutton, pbutton->ops_arg,
     383                rc = pbutton->decor_ops->paint(pbutton, pbutton->decor_arg,
    386384                    &pos);
    387385                if (rc != EOK)
     
    505503errno_t ui_pbutton_paint(ui_pbutton_t *pbutton)
    506504{
    507         if (pbutton->ops != NULL && pbutton->ops->paint != NULL) {
    508                 /* Custom paint routine */
    509                 return pbutton->ops->paint(pbutton, pbutton->ops_arg);
    510         } else if (pbutton->res->textmode) {
     505        if (pbutton->res->textmode)
    511506                return ui_pbutton_paint_text(pbutton);
    512         } else {
     507        else
    513508                return ui_pbutton_paint_gfx(pbutton);
    514         }
    515509}
    516510
Note: See TracChangeset for help on using the changeset viewer.