2 * Copyright (C) 2006 Benjamin Otte <otte@gnome.org>
3 * 2007 Pekka Lampila <pekka.lampila@iki.fi>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library 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 GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301 USA
21 #ifndef _SWFDEC_TEXT_FIELD_MOVIE_H_
22 #define _SWFDEC_TEXT_FIELD_MOVIE_H_
24 #include <libswfdec/swfdec_movie.h>
25 #include <libswfdec/swfdec_text_field.h>
26 #include <libswfdec/swfdec_style_sheet.h>
27 #include <libswfdec/swfdec_text_format.h>
32 typedef struct _SwfdecTextFieldMovie SwfdecTextFieldMovie
;
33 typedef struct _SwfdecTextFieldMovieClass SwfdecTextFieldMovieClass
;
35 #define SWFDEC_TYPE_TEXT_FIELD_MOVIE (swfdec_text_field_movie_get_type())
36 #define SWFDEC_IS_TEXT_FIELD_MOVIE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_TEXT_FIELD_MOVIE))
37 #define SWFDEC_IS_TEXT_FIELD_MOVIE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_TEXT_FIELD_MOVIE))
38 #define SWFDEC_TEXT_FIELD_MOVIE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_TEXT_FIELD_MOVIE, SwfdecTextFieldMovie))
39 #define SWFDEC_TEXT_FIELD_MOVIE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_TEXT_FIELD_MOVIE, SwfdecTextFieldMovieClass))
44 int last_line_offset_y
;
59 PangoTabArray
* tab_stops
;
65 gboolean newline
; // ends in newline
70 GSList
* blocks
; // SwfdecBlock
71 GSList
* attrs
; // PangoAttribute
76 SwfdecTextFormat
* format
;
79 struct _SwfdecTextFieldMovie
{
82 SwfdecTextField
* text
; /* the text_field object we render */
85 char * asterisks
; /* bunch of asterisks that we display when password mode is enabled */
86 guint asterisks_length
;
87 gboolean input_html
; /* whether orginal input was given as HTML */
89 const char * variable
;
91 SwfdecTextFormat
* format_new
;
94 gboolean condense_white
;
97 SwfdecAsObject
* style_sheet
;
98 const char * style_sheet_input
; /* saved input, so it can be used to apply stylesheet again */
100 gboolean scroll_changed
; /* if any of the scroll attributes have changed and we haven't fired the event yet */
106 gboolean mouse_wheel_enabled
;
108 const char * restrict_
;
110 SwfdecColor border_color
;
111 SwfdecColor background_color
;
113 // FIXME: Temporary using image surface, until there is a way to get cairo_t
114 // outside the rendering functions
115 cairo_surface_t
* surface
;
119 struct _SwfdecTextFieldMovieClass
{
120 SwfdecMovieClass movie_class
;
123 GType
swfdec_text_field_movie_get_type (void);
125 void swfdec_text_field_movie_set_text (SwfdecTextFieldMovie
* movie
,
128 void swfdec_text_field_movie_get_text_size (SwfdecTextFieldMovie
* text
,
131 gboolean
swfdec_text_field_movie_auto_size (SwfdecTextFieldMovie
* text
);
132 void swfdec_text_field_movie_update_scroll (SwfdecTextFieldMovie
* text
,
133 gboolean check_limits
);
134 void swfdec_text_field_movie_set_text_format (SwfdecTextFieldMovie
* text
,
135 SwfdecTextFormat
* format
,
138 SwfdecTextFormat
*swfdec_text_field_movie_get_text_format (SwfdecTextFieldMovie
* text
,
141 const char * swfdec_text_field_movie_get_text (SwfdecTextFieldMovie
* text
);
142 void swfdec_text_field_movie_set_listen_variable (SwfdecTextFieldMovie
* text
,
144 void swfdec_text_field_movie_set_listen_variable_text (SwfdecTextFieldMovie
*text
,
146 void swfdec_text_field_movie_replace_text (SwfdecTextFieldMovie
* text
,
151 /* implemented in swfdec_text_field_movie_as.c */
152 void swfdec_text_field_movie_init_properties (SwfdecAsContext
* cx
);
154 /* implemented in swfdec_html_parser.c */
155 void swfdec_text_field_movie_html_parse (SwfdecTextFieldMovie
* text
,
157 const char * swfdec_text_field_movie_get_html_text (SwfdecTextFieldMovie
* text
);