Skip to content

Commit

Permalink
add an API to configure the PI mode
Browse files Browse the repository at this point in the history
  • Loading branch information
GorgonMeducer committed Nov 27, 2024
1 parent b70732c commit 7287c76
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ARM.Arm-2D.pdsc
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
</RTE_Components_h>
</component>

<component Cclass="Acceleration" Cgroup="Arm-2D Helper" Csub="PFB" Cversion="2.4.8" condition="Arm-2D-CORE">
<component Cclass="Acceleration" Cgroup="Arm-2D Helper" Csub="PFB" Cversion="2.4.9" condition="Arm-2D-CORE">
<description>Helper services for LCD adaptor(s), e.g. Generic Partial Framebuffer, Scene Player etc.</description>
<files>
<file category="include" name="Helper/Include/" />
Expand Down
19 changes: 19 additions & 0 deletions Helper/Include/arm_2d_helper_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,25 @@ extern
ARM_NONNULL(1)
arm_2d_tile_t *__arm_2d_list_core_get_inner_tile(__arm_2d_list_core_t *ptThis);

/*!
* \brief enable or disable the PI mode for the indicator
*
* \param[in] ptThis the target list core object
* \param[in] bEnable a boolean value to enable or disable the PI mode
* \param[in] ptNewCFG an optional new PI configuration
* \note If the PI mode has never been enabled before, when the first time of calling
* this function, the ptNewCFG must point to a valid configuration structure
*
* \return true the PI mode was previously enabled
* \return false the PI mode was previously disabled
*/
extern
ARM_NONNULL(1)
bool __arm_2d_list_core_indicator_pi_mode_config(
__arm_2d_list_core_t *ptThis,
bool bEnable,
arm_2d_helper_pi_slider_cfg_t *ptNewCFG);

/*!
* \brief show a given list core
* \param[in] ptThis the target list core object
Expand Down
25 changes: 25 additions & 0 deletions Helper/Source/arm_2d_helper_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,31 @@ bool __arm_2d_list_core_is_list_scrolling(__arm_2d_list_core_t *ptThis)
return this.Runtime.bScrolling;
}

ARM_NONNULL(1)
bool __arm_2d_list_core_indicator_pi_mode_config(
__arm_2d_list_core_t *ptThis,
bool bEnable,
arm_2d_helper_pi_slider_cfg_t *ptNewCFG)
{
assert(NULL != ptThis);
bool bPrevious = this.tCFG.bUsePISliderForSelectionIndicator;

if (!bEnable) {
this.tCFG.bUsePISliderForSelectionIndicator = false;
} else if (NULL != ptNewCFG) {

this.tCFG.bUsePISliderForSelectionIndicator = true;

if (NULL != ptNewCFG) {
/* we cannot trust this pointer, because the address could be a temporary one*/
this.tCFG.ptPISliderCFG = ptNewCFG;

arm_2d_helper_pi_slider_init(&this.Runtime.tPISlider, ptNewCFG, this.nOffset);
}
}

return bPrevious;
}

ARM_NONNULL(1,2)
arm_2d_list_item_t *__arm_2d_list_core_get_item(
Expand Down

0 comments on commit 7287c76

Please sign in to comment.