2 * irreco - Ir Remote Control
3 * Copyright (C) 2007 Arto Karppinen (arto.karppinen@iki.fi)
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 * @addtogroup IrrecoButton
27 * Header file of @ref IrrecoButton.
30 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
32 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
34 * Make sure that typedefs are available before we include anything elese.
36 * This makes sure that whatever other structures that depend on structures
37 * defined in this file will compile OK recardles of header inclusion order.
39 #ifndef __IRRECO_BUTTON_H_TYPEDEF__
40 #define __IRRECO_BUTTON_H_TYPEDEF__
41 typedef struct _IrrecoButton IrrecoButton
;
42 typedef struct _IrrecoButtonLayout IrrecoButtonLayout
;
43 typedef void (*IrrecoButtonCallback
) (IrrecoButton
* irreco_button
,
46 IRRECO_BACKGROUND_DEFAULT
= 0,
47 IRRECO_BACKGROUND_COLOR
,
48 IRRECO_BACKGROUND_IMAGE
49 } IrrecoButtonLayoutBgType
;
51 #endif /* __IRRECO_BUTTON_H_TYPEDEF__ */
55 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
57 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
58 #ifndef __IRRECO_BUTTON_H__
59 #define __IRRECO_BUTTON_H__
61 #include "irreco_data.h"
62 #include "irreco_button_layout.h"
63 #include "irreco_cmd_chain_manager.h"
64 #include "irreco_hardkey_map.h"
65 #include "irreco_theme_button.h"
68 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
70 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
75 typedef enum _IrrecoButtonType
{
76 IRRECO_BTYPE_NONE
= 0,
77 IRRECO_BTYPE_GTK_BUTTON
, /* Vanilla GTK button. */
78 IRRECO_BTYPE_SINGLE_IMAGE
, /* Image button without secondary image. */
79 IRRECO_BTYPE_DOUBLE_IMAGE
/* Image button. */
85 typedef enum _IrrecoButtonState
{
92 * Button specific data.
94 struct _IrrecoButton
{
97 /* Button configuration. */
98 IrrecoThemeButton
*style
;
103 IrrecoCmdChainManager
*cmd_chain_manager
;
104 IrrecoCmdChainId cmd_chain_id
;
105 /*IrrecoCmdChain *cmd_chain;*/
108 IrrecoButtonLayout
*irreco_layout
;
109 IrrecoButtonType type
;
111 GtkWidget
*widget_up
;
112 GtkWidget
*widget_down
;
113 GtkWidget
*widget_label
;
116 IrrecoButtonState state
;
121 gulong motion_handler_id
;
122 gulong press_handler_id
;
123 gulong release_handler_id
;
124 gulong destroy_handler_id
;
125 gulong size_request_handler_id
;
126 gulong extra_handler_id
;
131 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
133 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
134 IrrecoButton
*irreco_button_create(IrrecoButtonLayout
* irreco_layout
,
138 IrrecoThemeButton
* style
,
139 IrrecoCmdChainManager
* manager
);
140 void irreco_button_destroy(IrrecoButton
* irreco_button
);
141 void irreco_button_set_title(IrrecoButton
* irreco_button
, const gchar
* title
);
142 void irreco_button_set_cmd_chain_id(IrrecoButton
* irreco_button
,
143 IrrecoCmdChainId cmd_chain_id
);
144 void irreco_button_set_cmd_chain(IrrecoButton
* irreco_button
,
145 IrrecoCmdChain
* cmd_chain
);
146 IrrecoCmdChain
*irreco_button_get_cmd_chain(IrrecoButton
* irreco_button
);
147 void irreco_button_set_style(IrrecoButton
* irreco_button
,
148 IrrecoThemeButton
* style
);
149 void irreco_button_create_widget(IrrecoButton
* irreco_button
);
150 void irreco_button_destroy_widget(IrrecoButton
* irreco_button
);
151 void irreco_button_down(IrrecoButton
* irreco_button
);
152 void irreco_button_up(IrrecoButton
* irreco_button
);
153 void irreco_button_move(IrrecoButton
* irreco_button
, gint
* x
, gint
* y
);
154 void irreco_button_to_front(IrrecoButton
* irreco_button
);
155 void irreco_button_flash(IrrecoButton
* irreco_button
);
156 void irreco_button_layout_set_name(IrrecoButtonLayout
* irreco_layout
,
158 void irreco_button_layout_set_size(IrrecoButtonLayout
* irreco_layout
, gint width
,
162 #endif /* __IRRECO_BUTTON_H__ */