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

« back to all changes in this revision

Viewing changes to libvbi/teletext.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2005-11-08 11:07:34 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051108110734-ygvf6uljvgcjmca7
Tags: 0.9.6-1ubuntu1
* Resynchronise with Debian (Closes: #4022):
  - Fix desktop file to not use absolute path.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
18
 */
19
19
 
20
 
/* $Id: teletext.c,v 1.34 2005/01/31 07:03:11 mschimek Exp $ */
 
20
/* $Id: teletext.c,v 1.36 2005/07/04 21:57:57 mschimek Exp $ */
21
21
 
22
22
#include "site_def.h"
23
23
 
32
32
#include <ctype.h>
33
33
#include <assert.h>
34
34
 
35
 
#include "common/intl-priv.h"
 
35
#include "intl-priv.h"
36
36
#include "cache-priv.h"
37
37
#include "teletext_decoder-priv.h"
38
38
#ifndef ZAPPING8
164
164
 *
165
165
 * @returns
166
166
 * The default character set associated with a Teletext page.
 
167
 * @c NULL if @a pg is no Teletext page.
167
168
 */
168
169
const vbi3_character_set *
169
170
vbi3_page_get_character_set     (const vbi3_page *      pg,
173
174
 
174
175
        PGP_CHECK (NULL);
175
176
 
 
177
        if (pgp->pg.pgno < 0x100)
 
178
                return NULL;
 
179
 
176
180
        return pgp->char_set[level & 1];
177
181
}
178
182
 
290
294
                        }
291
295
                }
292
296
 
293
 
                if (!wide_char) {
 
297
                if (wide_char) {
 
298
                        wide_char = FALSE;
 
299
                } else {
294
300
                        acp[column] = ac;
295
301
 
296
302
                        wide_char = !!(ac.size & VBI3_DOUBLE_WIDTH);
411
417
                        break;
412
418
 
413
419
                default:
414
 
                        assert (!"reached");
 
420
                        assert (0);
415
421
                }
416
422
        }
417
423
}
789
795
        }
790
796
 
791
797
        default:
792
 
                assert (!"reached");
 
798
                assert (0);
793
799
        }
794
800
 
795
801
        success = enhance (pgp, new_type, trip, n_triplets, row, column);
1035
1041
 * see the description of vbi3_page for details.
1036
1042
 *
1037
1043
 * @returns
1038
 
 * Pointer to character data, NULL if @a pg is invalid, @a unicode
1039
 
 * is not a DRCS code, or no DRCS data is available.
 
1044
 * Pointer to character data, NULL if @a pg is invalid, not a Teletext
 
1045
 * page, @a unicode is not a DRCS code, or no DRCS data is available.
1040
1046
 */
1041
1047
const uint8_t *
1042
1048
vbi3_page_get_drcs_data         (const vbi3_page *      pg,
1081
1087
        unsigned int            n_triplets;
1082
1088
 
1083
1089
        /** Current text row. */
1084
 
        vbi3_char *             acp;
 
1090
        vbi3_char *             curr_line;
1085
1091
 
1086
1092
        /** Cursor position at object invocation. */
1087
1093
        unsigned int            inv_row;
1173
1179
                vbi3_char c;
1174
1180
                int raw;
1175
1181
 
1176
 
                c = st->acp[column];
 
1182
                c = st->curr_line[column];
1177
1183
 
1178
1184
                if (st->mac.attr & VBI3_UNDERLINE) {
1179
1185
                        unsigned int attr = st->ac.attr;
1226
1232
                                c.size = VBI3_NORMAL_SIZE;
1227
1233
                }
1228
1234
 
1229
 
                st->acp[column++] = c;
 
1235
                st->curr_line[column++] = c;
1230
1236
 
1231
1237
                if (OBJECT_TYPE_PASSIVE == st->type)
1232
1238
                        break;
1434
1440
                st->active_column = column;
1435
1441
 
1436
1442
                pos = (st->inv_row + st->active_row) * st->pgp->pg.columns;
1437
 
                st->acp = &st->pgp->pg.text[pos];
 
1443
                st->curr_line = &st->pgp->pg.text[pos];
1438
1444
 
1439
1445
                break;
1440
1446
 
1895
1901
 
1896
1902
                if (st->trip->data & 2) {
1897
1903
                        if (st->pgp->cp->flags & (C5_NEWSFLASH | C6_SUBTITLE))
1898
 
                                st->ac.opacity = VBI3_SEMI_TRANSPARENT;
 
1904
                                st->ac.opacity = VBI3_TRANSLUCENT;
1899
1905
                        else
1900
1906
                                st->ac.opacity = VBI3_TRANSPARENT_SPACE;
1901
1907
                } else {
2089
2095
        st.active_row           = 0;
2090
2096
        st.active_column        = 0;
2091
2097
 
2092
 
        st.acp                  = pgp->pg.text + inv_row * pgp->pg.columns;
 
2098
        st.curr_line            = pgp->pg.text + inv_row * pgp->pg.columns;
2093
2099
 
2094
2100
        st.offset_row           = 0;
2095
2101
        st.offset_column        = 0;
2217
2223
                                acp->opacity = VBI3_TRANSPARENT_SPACE;
2218
2224
                                acp->unicode = 0x0020;
2219
2225
                        } else if (acp->background == VBI3_TRANSPARENT_BLACK) {
2220
 
                                acp->opacity = VBI3_SEMI_TRANSPARENT;
 
2226
                                acp->opacity = VBI3_TRANSLUCENT;
2221
2227
                        } else {
2222
2228
                                /* transparent foreground not implemented */
2223
2229
                        }
3381
3387
 * DONT vbi3_link_destroy().
3382
3388
 * @param indx Number 0 ... 5 of the link.
3383
3389
 * 
3384
 
 * When a vbi3_page has been formatted with TOP or FLOF
 
3390
 * When a Teletext vbi3_page has been formatted with TOP or FLOF
3385
3391
 * navigation enabled the last row may contain four links
3386
3392
 * to other pages. Apart of being hyperlinks (see
3387
3393
 * vbi3_page_hyperlink()) you can also query the links by
3503
3509
                                va_arg (format_options, vbi3_bool) ? 1 : 25;
3504
3510
                        break;
3505
3511
 
3506
 
                case VBI3_41_COLUMNS:
 
3512
                case VBI3_PADDING:
3507
3513
                        pgp->pg.columns =
3508
3514
                                va_arg (format_options, vbi3_bool) ? 41 : 40;
3509
3515
                        break;
3599
3605
        /* Opacity */
3600
3606
 
3601
3607
        pgp->page_opacity[1] = VBI3_OPAQUE;
3602
 
        pgp->boxed_opacity[1] = VBI3_SEMI_TRANSPARENT;
 
3608
        pgp->boxed_opacity[1] = VBI3_TRANSLUCENT;
3603
3609
 
3604
3610
        if (cp->flags & (C5_NEWSFLASH | C6_SUBTITLE | C10_INHIBIT_DISPLAY))
3605
3611
                pgp->page_opacity[1] = VBI3_TRANSPARENT_SPACE;
3912
3918
        PGP_CHECK (NULL);
3913
3919
 
3914
3920
        if (!(new_pgp = vbi3_malloc (sizeof (*new_pgp)))) {
3915
 
                vbi3_log_printf (VBI3_DEBUG, __FUNCTION__, "Out of memory");
 
3921
                error ("Out of memory (%u bytes)", sizeof (*new_pgp));
3916
3922
                return NULL;
3917
3923
        }
3918
3924
 
4030
4036
        pgp = PARENT (pg, vbi3_page_priv, pg);
4031
4037
 
4032
4038
        if (pg->priv != pgp) {
4033
 
                vbi3_log_printf (VBI3_DEBUG, __FUNCTION__,
4034
 
                                "vbi3_page %p not allocated by libzvbi", pg);
 
4039
                debug ("vbi3_page %p not allocated by libzvbi", pg);
4035
4040
                return;
4036
4041
        }
4037
4042
 
4095
4100
        vbi3_page_priv *pgp;
4096
4101
 
4097
4102
        if (!(pgp = vbi3_malloc (sizeof (*pgp)))) {
4098
 
                vbi3_log_printf (VBI3_DEBUG, __FUNCTION__, "Out of memory");
 
4103
                error ("Out of memory (%u bytes)", sizeof (pgp));
4099
4104
                return NULL;
4100
4105
        }
4101
4106