gui_buttons.h
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:14k
源码类别:

MTK

开发平台:

C/C++

  1. /*******************************************************************************
  2. *  Modification Notice:
  3. *  --------------------------
  4. *  This software is modified by MediaTek Inc. and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *******************************************************************************/
  35.  /*******************************************************************************
  36.  * Filename:
  37.  * ---------
  38.  *   gui_buttons.h
  39.  *
  40.  * Project:
  41.  * --------
  42.  *   Maui_Software
  43.  *
  44.  * Description:
  45.  * ------------
  46.  *  Button - UI component 
  47.  *
  48.  * Author:
  49.  * -------
  50.  * -------
  51.  * -------
  52.  *
  53.  *------------------------------------------------------------------------------
  54.  * $Log$
  55.  *
  56.  * removed!
  57.  * removed!
  58.  * 
  59.  *
  60.  * removed!
  61.  * removed!
  62.  * 
  63.  *
  64.  *******************************************************************************/
  65. /**
  66.  * Copyright Notice
  67.  * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
  68.  * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
  69.  *  (It is illegal to remove this copyright notice from this software or any
  70.  *  portion of it)
  71.  */
  72. /**********************************************************************************
  73.    Filename:      gui_buttons.h
  74.    Author:        manju
  75.    Date Created:  August-13-2002
  76.    Contains:      PixTel UI routines header for buttons
  77. **********************************************************************************/
  78. #ifndef __GUI_BUTTONS_H__
  79. #define __GUI_BUTTONS_H__
  80. #include "MMI_features.h"
  81. #include "gui.h"
  82. /* MTK Leo add,20040318, for new simulator */
  83. #include "gui_theme_struct.h"
  84. #ifdef __cplusplus
  85. extern "C"
  86. {
  87. #endif /* __cplusplus */ 
  88. #ifdef __MMI_TOUCH_SCREEN__
  89. #include "kal_non_specific_general_types.h"
  90. #include "TouchScreenGprot.h"
  91.     typedef enum
  92.     {
  93.         GUI_BUTTON_PEN_NONE,            /* No event is generated. (but the low-level pen events might be still accepted) */
  94.         GUI_BUTTON_PEN_DOWN,            /* Pen down on button */
  95.         GUI_BUTTON_PEN_REPEAT,          /* Pen Repeat inside button */
  96.         GUI_BUTTON_PEN_LONGTAP,         /* Pen LongTap inside button */
  97.         GUI_BUTTON_PEN_UP_INSIDE,       /* Pen down on button */
  98.         GUI_BUTTON_PEN_UP_OUTSIDE,      /* Pen up outside button */
  99.         GUI_BUTTON_PEN_MOVE_OUTSIDE,    /* Pen is moved outside button */
  100.         GUI_BUTTON_PEN_MOVE_INSIDE      /* Pen is moved into the button  */
  101.     } gui_button_pen_enum;
  102.     typedef struct
  103.     {
  104.         U8 pen_inside;
  105.     } gui_button_pen_state_struct;
  106. #endif /* __MMI_TOUCH_SCREEN__ */ 
  107.     typedef void (*gui_button_clear_background_hdlr) (void *button_object);
  108.     /* UI button structure                    */
  109.     extern UI_button_theme *current_button_theme;
  110. #define UI_BUTTON_TYPE_NORMAL                   0x00000000
  111. #define UI_BUTTON_TYPE_TOGGLE                   0x00000001
  112. #define UI_BUTTON_STATE_UP                      0x00000000
  113. #define UI_BUTTON_STATE_DOWN                    0x00000100
  114. #define UI_BUTTON_STATE_NORMAL                  0x00000000
  115. #define UI_BUTTON_STATE_DISABLED                0x00000200
  116. #define UI_BUTTON_STATE_FOCUSSED                0x00000400
  117. #define UI_BUTTON_STATE_CLICKED                 0x00000800
  118. #define UI_BUTTON_SHIFT_BUTTON1                 0x00001000
  119. #define UI_BUTTON_SHIFT_BUTTON2                 0x00002000
  120. #define UI_BUTTON_DISABLE_BACKGND_DISPLAY       0x00004000
  121. #define UI_BUTTON_DISABLE_TEXT_DISPLAY          0x00008000
  122. #define UI_BUTTON_CENTER_TEXT_X                 0x00010000
  123. #define UI_BUTTON_CENTER_TEXT_Y                 0x00020000
  124. #define UI_BUTTON_SHIFT_TEXT                    0x00040000
  125. #define UI_BUTTON_SHIFT_ICON                    0x00080000
  126. #define UI_BUTTON_CENTER_ICON_X                 0x00100000
  127. #define UI_BUTTON_CENTER_ICON_Y                 0x00200000
  128. #define UI_BUTTON_NO_UNDER_BAR                  0x00400000
  129. #define UI_BUTTON_ALIGN_ICON_TEXT               0x00800000
  130. #define UI_BUTTON_LEFT_ALIGN                    0x01000000
  131. #define UI_BUTTON_RIGHT_ALIGN                   0x02000000
  132. /* Always send GUI_BUTTON_PEN_UP_INSIDE even when pen is up outside the button */
  133. #define UI_BUTTON_ALWAYS_SEND_PEN_UP_INSIDE     0x04000000
  134. /* Do not shift button when pressed down */
  135. #define UI_BUTTON_NO_SHIFT_BUTTON               0x08000000
  136.     typedef struct _button
  137.     {
  138.         S32 x, y;
  139.         S32 width, height;
  140.         UI_filled_area *normal_up_filler;
  141.         UI_filled_area *normal_down_filler;
  142.         UI_filled_area *disabled_up_filler;
  143.         UI_filled_area *disabled_down_filler;
  144.         UI_filled_area *clicked_up_filler;
  145.         UI_filled_area *clicked_down_filler;
  146.         UI_filled_area *focussed_up_filler;
  147.         UI_filled_area *focussed_down_filler;
  148.         U32 flags;
  149.         gui_button_clear_background_hdlr clear_background_fp;
  150.     #ifdef __MMI_TOUCH_SCREEN__
  151.         gui_button_pen_state_struct pen_state;
  152.     #endif 
  153.     } button;
  154.     extern void gui_set_button_current_theme(button *b);
  155.     extern void gui_set_button_theme(button *b, UI_button_theme *t);
  156.     extern void gui_create_button(button *b, S32 x, S32 y, S32 width, S32 height);
  157.     extern void gui_show_button(button *b);
  158. #ifdef __MMI_TOUCH_SCREEN__
  159.     extern BOOL gui_button_translate_pen_event(
  160.                     button *b,
  161.                     mmi_pen_event_type_enum pen_event,
  162.                     S16 x,
  163.                     S16 y,
  164.                     gui_button_pen_enum *button_event);
  165. #endif /* __MMI_TOUCH_SCREEN__ */ 
  166.     /* UI text_button structure               */
  167.     extern UI_text_button_theme *current_text_button_theme;
  168.     typedef struct _text_button
  169.     {
  170.         S32 x, y;
  171.         S32 width, height;
  172.         UI_filled_area *normal_up_filler;
  173.         UI_filled_area *normal_down_filler;
  174.         UI_filled_area *disabled_up_filler;
  175.         UI_filled_area *disabled_down_filler;
  176.         UI_filled_area *clicked_up_filler;
  177.         UI_filled_area *clicked_down_filler;
  178.         UI_filled_area *focussed_up_filler;
  179.         UI_filled_area *focussed_down_filler;
  180.         U32 flags;
  181.         S32 text_x, text_y, text_height;
  182.         UI_string_type text;
  183.         color normal_up_text_color;
  184.         color normal_down_text_color;
  185.         color disabled_up_text_color;
  186.         color disabled_down_text_color;
  187.         color focussed_up_text_color;
  188.         color focussed_down_text_color;
  189.         color clicked_up_text_color;
  190.         color clicked_down_text_color;
  191.         UI_font_type text_font;
  192.         gui_button_clear_background_hdlr clear_background_fp;
  193.     #ifdef __MMI_TOUCH_SCREEN__
  194.         gui_button_pen_state_struct pen_state;
  195.     #endif 
  196.     } text_button;
  197.     extern void gui_set_text_button_current_theme(text_button *b);
  198.     extern void gui_set_text_button_theme(text_button *b, UI_text_button_theme *t);
  199.     extern void gui_set_text_button_BG_theme(text_button *b, UI_button_theme *t);
  200.     extern void gui_create_text_button(text_button *b, S32 x, S32 y, S32 width, S32 height, UI_string_type text);
  201.     extern void gui_text_button_set_text_position(text_button *b, S32 x, S32 y);
  202.     extern void gui_show_text_button(text_button *b);
  203. #ifdef __MMI_TOUCH_SCREEN__
  204.     extern BOOL gui_text_button_translate_pen_event(
  205.                     text_button *b,
  206.                     mmi_pen_event_type_enum pen_event,
  207.                     S16 x,
  208.                     S16 y,
  209.                     gui_button_pen_enum *button_event);
  210. #endif /* __MMI_TOUCH_SCREEN__ */ 
  211.     extern UI_icon_button_theme *current_icon_button_theme;
  212.     typedef struct _icon_button
  213.     {
  214.         S32 x, y;
  215.         S32 width, height;
  216.         UI_filled_area *normal_up_filler;
  217.         UI_filled_area *normal_down_filler;
  218.         UI_filled_area *disabled_up_filler;
  219.         UI_filled_area *disabled_down_filler;
  220.         UI_filled_area *clicked_up_filler;
  221.         UI_filled_area *clicked_down_filler;
  222.         UI_filled_area *focussed_up_filler;
  223.         UI_filled_area *focussed_down_filler;
  224.         U32 flags;
  225.         PU8 normal_up_icon;
  226.         PU8 normal_down_icon;
  227.         PU8 disabled_up_icon;
  228.         PU8 disabled_down_icon;
  229.         PU8 clicked_up_icon;
  230.         PU8 clicked_down_icon;
  231.         PU8 focussed_up_icon;
  232.         PU8 focussed_down_icon;
  233.         S32 icon_x, icon_y;
  234.         UI_transparent_color_type icon_transparent_color;
  235.         gui_button_clear_background_hdlr clear_background_fp;
  236.     #ifdef __MMI_TOUCH_SCREEN__
  237.         gui_button_pen_state_struct pen_state;
  238.     #endif 
  239.     } icon_button;
  240.     extern void gui_set_icon_button_current_theme(icon_button *b);
  241.     extern void gui_set_icon_button_theme(icon_button *b, UI_icon_button_theme *t);
  242.     extern void gui_set_icon_button_BG_theme(icon_button *b, UI_button_theme *t);
  243.     extern void gui_create_icon_button(icon_button *b, S32 x, S32 y, S32 width, S32 height, PU8 button_icon);
  244.     extern void gui_resize_icon_button(icon_button *b, S32 width, S32 height);
  245.     extern void gui_move_icon_button(icon_button *b, S32 x, S32 y);
  246.     extern void gui_icon_button_set_icon_positon(icon_button *b, S32 x, S32 y);
  247.     extern void gui_icon_button_set_icon(
  248.                     icon_button *b,
  249.                     PU8 button_icon,
  250.                     UI_transparent_color_type icon_transparent_color);
  251.     extern void gui_show_icon_button(icon_button *b);
  252. #ifdef __MMI_TOUCH_SCREEN__
  253.     extern BOOL gui_icon_button_translate_pen_event(
  254.                     icon_button *b,
  255.                     mmi_pen_event_type_enum pen_event,
  256.                     S16 x,
  257.                     S16 y,
  258.                     gui_button_pen_enum *button_event);
  259. #endif /* __MMI_TOUCH_SCREEN__ */ 
  260.     /* UI icon text button structure             */
  261.     extern UI_icontext_button_theme *current_icontext_button_theme;
  262.     typedef struct _icontext_button
  263.     {
  264.         S32 x, y;
  265.         S32 width, height;
  266.         UI_filled_area *normal_up_filler;
  267.         UI_filled_area *normal_down_filler;
  268.         UI_filled_area *disabled_up_filler;
  269.         UI_filled_area *disabled_down_filler;
  270.         UI_filled_area *clicked_up_filler;
  271.         UI_filled_area *clicked_down_filler;
  272.         UI_filled_area *focussed_up_filler;
  273.         UI_filled_area *focussed_down_filler;
  274.         U32 flags;
  275.         PU8 normal_up_icon;
  276.         PU8 normal_down_icon;
  277.         PU8 disabled_up_icon;
  278.         PU8 disabled_down_icon;
  279.         PU8 clicked_up_icon;
  280.         PU8 clicked_down_icon;
  281.         PU8 focussed_up_icon;
  282.         PU8 focussed_down_icon;
  283.         S32 icon_x, icon_y;
  284.         UI_transparent_color_type icon_transparent_color;
  285.         S32 text_x, text_y, text_height, text_width;
  286.         UI_string_type text;
  287.         color normal_up_text_color;
  288.         color normal_down_text_color;
  289.         color disabled_up_text_color;
  290.         color disabled_down_text_color;
  291.         color focussed_up_text_color;
  292.         color focussed_down_text_color;
  293.         color clicked_up_text_color;
  294.         color clicked_down_text_color;
  295.         UI_font_type text_font;
  296.         gui_button_clear_background_hdlr clear_background_fp;
  297.     #ifdef __MMI_TOUCH_SCREEN__
  298.         gui_button_pen_state_struct pen_state;
  299.     #endif 
  300.     } icontext_button;
  301.     extern void gui_set_icontext_button_current_theme(icontext_button *b);
  302.     extern void gui_set_icontext_button_theme(icontext_button *b, UI_icontext_button_theme *t);
  303.     extern void gui_set_icontext_button_BG_theme(icontext_button *b, UI_button_theme *t);
  304.     extern void gui_create_icontext_button(
  305.                     icontext_button *b,
  306.                     S32 x,
  307.                     S32 y,
  308.                     S32 width,
  309.                     S32 height,
  310.                     UI_string_type text,
  311.                     PU8 button_icon);
  312.     extern void gui_resize_icontext_button(icontext_button *b, S32 width, S32 height);
  313.     extern void gui_move_icontext_button(icontext_button *b, S32 x, S32 y);
  314.     extern void gui_icontext_button_set_icon_positon(icontext_button *b, S32 x, S32 y);
  315.     extern void gui_icontext_button_set_text_position(icontext_button *b, S32 x, S32 y);
  316.     extern void gui_icontext_button_set_icon(
  317.                     icontext_button *b,
  318.                     PU8 button_icon,
  319.                     UI_transparent_color_type icon_transparent_color);
  320.     extern void gui_show_icontext_button(icontext_button *b);
  321. #ifdef __MMI_TOUCH_SCREEN__
  322.     extern BOOL gui_icontext_button_translate_pen_event(
  323.                     icontext_button *b,
  324.                     mmi_pen_event_type_enum pen_event,
  325.                     S16 x,
  326.                     S16 y,
  327.                     gui_button_pen_enum *button_event);
  328. #endif /* __MMI_TOUCH_SCREEN__ */ 
  329. #ifdef __cplusplus
  330. }
  331. #endif 
  332. #endif /* __GUI_BUTTONS_H__ */