b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | /******************************************************************************
|
| 2 | *(C) Copyright 2014 Marvell International Ltd.
|
| 3 | * All Rights Reserved
|
| 4 | ******************************************************************************/
|
| 5 | /*******************************************************************************
|
| 6 | *
|
| 7 | * Filename: Button.h
|
| 8 | *
|
| 9 | * Authors: Boaz Sommer
|
| 10 | *
|
| 11 | * Description: An Button class
|
| 12 | *
|
| 13 | * HISTORY:
|
| 14 | *
|
| 15 | *
|
| 16 | *
|
| 17 | * Notes:
|
| 18 | *
|
| 19 | ******************************************************************************/
|
| 20 | #ifndef __BUTTON_H__
|
| 21 | #define __BUTTON_H__
|
| 22 |
|
| 23 | #include "Object.h"
|
| 24 |
|
| 25 | typedef void * BUTTON;
|
| 26 | typedef void (*ButtonOnClickHandler)(int event, void *data);
|
| 27 | typedef struct _ButtonOnClickParams
|
| 28 | {
|
| 29 | ButtonOnClickHandler cb;
|
| 30 | void *cb_data;
|
| 31 | int event;
|
| 32 | } ButtonOnClickParams;
|
| 33 |
|
| 34 | #ifdef __cplusplus
|
| 35 | extern "C" {
|
| 36 | #endif
|
| 37 | BUTTON *ButtonInit (void *dfb);
|
| 38 | void ButtonDeinit (BUTTON *pt);
|
| 39 | void ButtonSetArray (BUTTON *pt, const IMAGE_ARRAY_ITEM *array, int size);
|
| 40 | void ButtonSetFromArray (BUTTON *pt, int key);
|
| 41 | void ButtonSetup (BUTTON *pt, int lx, int ly);
|
| 42 | void ButtonSetup2 (BUTTON *pt, OBJECT_RECT rect);
|
| 43 | void ButtonDraw (BUTTON *pt);
|
| 44 | void ButtonSetupOnClick (BUTTON *pt, ButtonOnClickParams *onClick);
|
| 45 | void ButtonGetGeometry (BUTTON pt, OBJECT_RECT *rect);
|
| 46 | int ButtonGetWidth (BUTTON *pt);
|
| 47 | int ButtonGetHeight (BUTTON *pt);
|
| 48 | void ButtonSetText (BUTTON *pt, const char *text, const char *font_path);
|
| 49 | #ifdef __cplusplus
|
| 50 | }
|
| 51 | #endif
|
| 52 |
|
| 53 | #endif //__BUTTON_H__
|
| 54 |
|