~ubuntu-branches/ubuntu/maverick/zapping/maverick

« back to all changes in this revision

Viewing changes to src/zvbi.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-03-08 23:19:08 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050308231908-oip7rfv6lcmo8c0e
Tags: 0.9.2-2ubuntu1
Rebuilt for Python transition (2.3 -> 2.4)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#define __ZVBI_H__
26
26
 
27
27
#ifdef HAVE_CONFIG_H
28
 
#  include <config.h>
 
28
#  include "config.h"
29
29
#endif
30
30
 
31
31
#ifdef HAVE_LIBZVBI
35
35
 
36
36
#include "tveng.h"
37
37
#include "zmodel.h"
38
 
 
39
 
enum ttx_message {
40
 
  TTX_NONE=0, /* No messages */
41
 
  TTX_PAGE_RECEIVED, /* The monitored page has been received */
42
 
  TTX_NETWORK_CHANGE, /* New network info feeded into the decoder */
43
 
  TTX_PROG_INFO_CHANGE, /* New program info feeded into the decoder */
44
 
  TTX_TRIGGER, /* Trigger event, ttx_message_data.link filled */
45
 
  TTX_CHANNEL_SWITCHED, /* zvbi_channel_switched was called, the cache
46
 
                           has been cleared */
47
 
  TTX_BROKEN_PIPE /* No longer connected to the TTX decoder */
48
 
};
49
 
 
50
 
typedef struct {
51
 
  enum ttx_message msg;
52
 
  union {
53
 
    vbi_link    link; /* A trigger link */
54
 
  } data;
55
 
} ttx_message_data;
56
 
 
57
 
extern vbi_pgno zvbi_page; /* page, subpage for subtitles */
58
 
extern vbi_subno zvbi_subpage;
59
 
 
60
 
/*
61
 
 * Register a client as TTX receiver, and returns the id that the
62
 
 * client should use to identify itself.
63
 
 */
64
 
int register_ttx_client(void);
65
 
 
66
 
/*
67
 
 * Gets the next message in the queue, or TTX_NONE if nothing
68
 
 * available.
69
 
 * Provide a valid pointer in data, it can be filled in.
70
 
 */
71
 
enum ttx_message peek_ttx_message(int id, ttx_message_data *data);
72
 
 
73
 
/*
74
 
 * Like peek, but waits until something is available
75
 
 * Provide a valid pointer in data, it can be filled in.
76
 
 */
77
 
enum ttx_message get_ttx_message(int id, ttx_message_data *data);
78
 
 
79
 
/*
80
 
 * Unregisters a client, telling that it won't continue porocessing
81
 
 * data
82
 
 */
83
 
void unregister_ttx_client(int id);
84
 
 
85
 
/*
86
 
 * Tells the renderer whether to reveal hidden chars.
87
 
 */
88
 
void set_ttx_parameters(int id, int reveal);
89
 
 
90
 
/*
91
 
 * Sets the given page as the page the client is interested in.
92
 
 * Use ANY_SUB in subpage for getting all subpages
93
 
 */
94
 
void monitor_ttx_page(int id/*client*/, int page, int subpage);
95
 
 
96
 
/*
97
 
 * Render the provided page to the client, and send the RECEIVED
98
 
 * event. Set it as the currently monitored page.
99
 
 */
100
 
void monitor_ttx_this(int id, vbi_page *pg);
101
 
 
102
 
/*
103
 
 * Freezes the current page, no more RECEIVED events are sent until
104
 
 * it's unfreezed.
105
 
 */
106
 
void ttx_freeze(int id);
107
 
 
108
 
/*
109
 
 * Allows sending RECEIVED events to the client.
110
 
 */
111
 
void ttx_unfreeze(int id);
112
 
 
113
 
/*
114
 
 * Returns a pointer to the formatted page the client is rendering
115
 
 */
116
 
vbi_page* get_ttx_fmt_page(int id);
117
 
 
118
 
/*
119
 
 * Returns a pointer to the scaled version of the page. Consider the
120
 
 * returned pixbuf as volatile, i.e., any other ttx_ call on the same
121
 
 * client can invalidate the returned pointer.
122
 
 * Can return NULL if the scaled version doesn't exist, etc...
123
 
 */
124
 
GdkPixbuf * get_scaled_ttx_page(int id);
125
 
 
126
 
/*
127
 
 * Resizes the rendered size of the page
128
 
 */
129
 
void resize_ttx_page(int id, int w, int h);
130
 
 
131
 
/*
132
 
 * Renders the currently monitored page into the given drawable.
133
 
 */
134
 
void render_ttx_page(int id, GdkDrawable *drawable, GdkGC *gc,
135
 
                     gint src_x, gint src_y,
136
 
                     gint dest_x, gint dest_y,
137
 
                     gint w, gint h);
138
 
 
139
 
/*
140
 
 * Renders into the given bitmap (that must have appropiate
141
 
 * dimensions) the transparency info of the current page.
142
 
 */
143
 
void render_ttx_mask(int id, GdkBitmap *bitmap);
144
 
 
145
 
/**
146
 
 * Updates the blinking items in the page.
147
 
 */
148
 
void refresh_ttx_page(int id, GtkWidget *drawable);
149
 
 
150
 
/* Startups the VBI engine (doesn't open devices) */
151
 
void startup_zvbi(void);
152
 
 
153
 
/* Shuts down the VBI engine */
154
 
void shutdown_zvbi(void);
 
38
#include "frequencies.h"
 
39
 
 
40
typedef void
 
41
zvbi_decoder_fn                 (const vbi_sliced *     sliced,
 
42
                                 unsigned int           n_lines,
 
43
                                 double                 timestamp);
 
44
typedef void
 
45
zvbi_chsw_fn                    (const tveng_tuned_channel *channel,
 
46
                                 guint                  scanning);
 
47
 
 
48
extern void
 
49
zvbi_add_decoder                (zvbi_decoder_fn *      decoder,
 
50
                                 zvbi_chsw_fn *         chsw);
 
51
extern void
 
52
zvbi_remove_decoder             (zvbi_decoder_fn *      decoder,
 
53
                                 zvbi_chsw_fn *         chsw);
 
54
 
 
55
extern void
 
56
startup_zvbi                    (void);
 
57
extern void
 
58
shutdown_zvbi                   (void);
155
59
 
156
60
/* Open the configured VBI device, FALSE on error */
157
61
gboolean
158
 
zvbi_open_device(char *device);
159
 
 
 
62
zvbi_open_device                (const char *           dev_name);
160
63
/* Closes the VBI device */
161
64
void
162
 
zvbi_close_device(void);
163
 
 
164
 
/*
165
 
  Returns the global vbi object, or NULL if vbi isn't enabled or
166
 
  doesn't work. You can safely use this function to test if VBI works
167
 
  (it will return NULL if it doesn't).
168
 
*/
 
65
zvbi_close_device               (void);
 
66
/* Returns the global vbi object, or NULL if vbi isn't enabled or
 
67
   doesn't work. You can safely use this function to test if VBI works
 
68
   (it will return NULL if it doesn't). */
169
69
vbi_decoder *
170
 
zvbi_get_object(void);
171
 
 
172
 
/*
173
 
  Returns the model for the vbi object. You can hook into this to know
174
 
  when the vbi object is created or destroyed.
175
 
*/
 
70
zvbi_get_object                 (void);
 
71
/* Returns the model for the vbi object. You can hook into this to know
 
72
   when the vbi object is created or destroyed. */
176
73
ZModel *
177
 
zvbi_get_model(void);
178
 
 
179
 
/*
180
 
  Builds a dialog showing the info we get from the VBI device
181
 
  a) network info, b) program info
182
 
*/
183
 
GtkWidget *zvbi_build_network_info(void);
184
 
GtkWidget *zvbi_build_program_info(void);
185
 
 
186
 
/*
187
 
  Returns the g_strdup'ed name of the current station,
188
 
  if known, or NULL. The returned value should be g_free'ed
189
 
*/
190
 
gchar *
191
 
zvbi_get_name(void);
192
 
 
193
 
/*
194
 
  Clears the station_name_known flag. Useful when you are changing
195
 
  freqs fast and you want to know the current station
196
 
*/
197
 
void
198
 
zvbi_name_unknown(void);
199
 
 
200
 
/*
201
 
  Called when changing channels, inputs, etc, tells the decoding engine
202
 
  to flush the cache, triggers, etc.
203
 
*/
204
 
void
205
 
zvbi_channel_switched(void);
206
 
 
207
 
/*
208
 
  Reset our knowledge about network and program,
209
 
  update main title and info dialogs.
210
 
*/
211
 
void
212
 
zvbi_reset_network_info(void);
213
 
void
214
 
zvbi_reset_program_info(void);
215
 
 
216
 
/*
217
 
  Returns the current program title ("Foo", "Bar", "Unknown"),
218
 
  the returned string must be g_free'ed
219
 
*/
220
 
gchar *
221
 
zvbi_current_title(void);
222
 
 
223
 
/*
224
 
  Returns the current program rating ("TV-MA", "Not rated"),
225
 
  don't free, just a pointer.
226
 
*/
227
 
gchar *
228
 
zvbi_current_rating(void);
229
 
 
230
 
/*
231
 
  Returns the currently selected
232
 
  Teletext implementation level (for vbi_fetch_*)
233
 
*/
 
74
zvbi_get_model                  (void);
 
75
/* Returns the g_strdup'ed name of the current station, if known, or
 
76
   NULL. The returned value should be g_free'ed. */
 
77
gchar *
 
78
zvbi_get_name                   (void);
 
79
gchar *
 
80
zvbi_get_current_network_name   (void);
 
81
/* Clears the station_name_known flag. Useful when you are changing
 
82
   freqs fast and you want to know the current station */
 
83
void
 
84
zvbi_name_unknown               (void);
 
85
/* Called when changing channels, inputs, etc, tells the decoding engine
 
86
   to flush the cache, triggers, etc. */
 
87
void
 
88
zvbi_channel_switched           (void);
 
89
/* Reset our knowledge about network and program,
 
90
   update main title and info dialogs. */
 
91
void
 
92
zvbi_reset_network_info         (void);
 
93
void
 
94
zvbi_reset_program_info         (void);
 
95
/* Returns the current program title ("Foo", "Bar", "Unknown"),
 
96
   the returned string must be g_free'ed */
 
97
gchar *
 
98
zvbi_current_title              (void);
 
99
/* Returns the current program rating ("TV-MA", "Not rated"),
 
100
   don't free, just a pointer. */
 
101
const gchar *
 
102
zvbi_current_rating             (void);
 
103
/* Returns the currently selected
 
104
   Teletext implementation level (for vbi_fetch_*) */
234
105
vbi_wst_level
235
 
zvbi_teletext_level (void);
236
 
 
237
 
#endif /* HAVE_LIBZVBI */
 
106
zvbi_teletext_level             (void);
 
107
 
 
108
#else /* !HAVE_LIBZVBI */
 
109
 
 
110
/* Startups the VBI engine (doesn't open devices) */
 
111
void
 
112
startup_zvbi                    (void);
 
113
/* Shuts down the VBI engine */
 
114
void
 
115
shutdown_zvbi                   (void);
 
116
 
 
117
typedef int vbi_pgno;
 
118
 
 
119
#endif /* !HAVE_LIBZVBI */
 
120
 
 
121
/* Modifies the gui according to VBI availability. */
 
122
void
 
123
vbi_gui_sensitive               (gboolean               on);
 
124
 
238
125
#endif /* zvbi.h */