search for: g_utf8_offset_to_point

Displaying 10 results from an estimated 10 matches for "g_utf8_offset_to_point".

2007 Oct 31
0
2 commits - libswfdec/swfdec_sound.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_text_field_movie_html.c
...end of the TextField might use wrong text format on version 7"); } @@ -1335,14 +1334,9 @@ swfdec_text_field_movie_replace_text (SwfdecTextFieldMovie *text, text->formats = g_slist_append (text->formats, findex); } - text->input = g_string_erase (text->input, - g_utf8_offset_to_pointer (text->input->str, start_index) - - text->input->str, - g_utf8_offset_to_pointer (text->input->str, end_index) - - g_utf8_offset_to_pointer (text->input->str, start_index)); - text->input = g_string_insert (text->input, - g_utf8_offset_to_pointer...
2007 Oct 25
0
12 commits - libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c test/trace
...0..8cdd015 100644 --- a/libswfdec/swfdec_text_field_movie.c +++ b/libswfdec/swfdec_text_field_movie.c @@ -1566,15 +1566,6 @@ swfdec_text_field_movie_replace_text (SwfdecTextFieldMovie *text, if (text->style_sheet_input) return; - text->input = g_string_erase (text->input, - g_utf8_offset_to_pointer (text->input->str, start_index) - - text->input->str, - g_utf8_offset_to_pointer (text->input->str, end_index) - - g_utf8_offset_to_pointer (text->input->str, start_index)); - text->input = g_string_insert (text->input, - g_utf8_offset_to_pointer...
2007 Aug 24
0
7 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_string.c test/trace
...*ret) { - SwfdecAsString *string = SWFDEC_AS_STRING (object); + const char *string = swfdec_as_object_to_string (cx, object); gsize len; const char *s; @@ -91,23 +93,24 @@ swfdec_as_string_lastIndexOf (SwfdecAsCo SWFDEC_AS_VALUE_SET_INT (ret, -1); return; } - len = g_utf8_offset_to_pointer (string->string, offset + 1) - string->string; + len = g_utf8_offset_to_pointer (string, offset + 1) - string; } else { len = G_MAXSIZE; } - s = g_strrstr_len (string->string, len, s); + s = g_strrstr_len (string, len, s); if (s) { - SWFDEC_AS_VALUE_SET_INT (ret, g_...
2007 Oct 22
0
5 commits - libswfdec/swfdec_html_parser.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c test/trace
...,7 +1544,14 @@ swfdec_text_field_movie_replace_text (SwfdecTextFieldMovie *text, g_return_if_fail (start_index <= end_index); g_return_if_fail (str != NULL); - text->input = g_string_insert (text->input, start_index, str); + text->input = g_string_erase (text->input, + g_utf8_offset_to_pointer (text->input->str, start_index) - + text->input->str, + g_utf8_offset_to_pointer (text->input->str, end_index) - + g_utf8_offset_to_pointer (text->input->str, start_index)); + text->input = g_string_insert (text->input, + g_utf8_offset_to_pointer...
2007 Jun 28
0
Branch 'as' - 3 commits - libswfdec/swfdec_as_string.c libswfdec/swfdec_as_strings.c test/trace
...LL; + + s = swfdec_as_value_to_string (object->context, &argv[0]); + if (argc == 2) + offset = swfdec_as_value_to_integer (object->context, &argv[1]); + if (offset < 0) + offset = 0; + len = g_utf8_strlen (string->string, -1); + if (offset < len) { + t = strstr (g_utf8_offset_to_pointer (string->string, offset), s); + } + if (t != NULL) { + i = g_utf8_pointer_to_offset (string->string, t); + } + + SWFDEC_AS_VALUE_SET_INT (ret, i); +} + +static void swfdec_as_string_charAt (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsVa...
2007 Nov 02
0
5 commits - libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_xml.c libswfdec/swfdec_xml_node.c
..._field_movie_as.c b/libswfdec/swfdec_text_field_movie_as.c index 673600e..b7d7d18 100644 --- a/libswfdec/swfdec_text_field_movie_as.c +++ b/libswfdec/swfdec_text_field_movie_as.c @@ -1036,6 +1036,11 @@ swfdec_text_field_movie_setTextFormat (SwfdecAsContext *cx, text->input->str, g_utf8_offset_to_pointer (text->input->str, end_index) - text->input->str); + + swfdec_movie_invalidate (SWFDEC_MOVIE (text)); + swfdec_text_field_movie_auto_size (text); + // special case: update the max values, not the current values + swfdec_text_field_movie_update_scroll (text, FALSE); } SW...
2007 Oct 23
0
9 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_html_parser.c libswfdec/swfdec_style_sheet.c libswfdec/swfdec_style_sheet.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_text_field_movie.h
...xt, g_return_if_fail (start_index <= end_index); g_return_if_fail (str != NULL); + /* if there was a style sheet set when setting the text, modifications are + * not allowed */ + if (text->style_sheet_input) + return; + text->input = g_string_erase (text->input, g_utf8_offset_to_pointer (text->input->str, start_index) - text->input->str, @@ -1631,10 +1638,17 @@ swfdec_text_field_movie_set_text (SwfdecTextFieldMovie *text, const char *str, text->formats = g_slist_prepend (text->formats, block); text->input_html = html; - if (html) { + + if (t...
2007 Jun 12
0
Branch 'as' - 3 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_math.c libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_number.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_string.c
...*object, + guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SwfdecAsString *string = SWFDEC_AS_STRING (object); @@ -229,27 +236,25 @@ static const char * swfdec_as_str_sub (SwfdecAsContext *cx, const char *str, guint offset, guint len) { const char *end; - char *dup; str = g_utf8_offset_to_pointer (str, offset); end = g_utf8_offset_to_pointer (str, len); - dup = g_strndup (str, end - str); - str = swfdec_as_context_get_string (cx, dup); - g_free (dup); + str = swfdec_as_context_give_string (cx, g_strndup (str, end - str)); return str; } static void -swfdec_as_string_substr (S...
2007 Dec 10
0
6 commits - libswfdec/Makefile.am libswfdec/swfdec_as_interpret.c libswfdec/swfdec_color_as.c libswfdec/swfdec_graphic_movie.c libswfdec/swfdec_image_decoder.c libswfdec/swfdec_morph_movie.c libswfdec/swfdec_movie_as_drawing.c
...ue; - swfdec_movie_invalidate (SWFDEC_MOVIE (text)); + swfdec_movie_invalidate_last (SWFDEC_MOVIE (text)); swfdec_text_field_movie_auto_size (text); // special case: don't set scrolling } @@ -1140,7 +1140,7 @@ swfdec_text_field_movie_setTextFormat (SwfdecAsContext *cx, g_utf8_offset_to_pointer (text->input->str, end_index) - text->input->str); - swfdec_movie_invalidate (SWFDEC_MOVIE (text)); + swfdec_movie_invalidate_last (SWFDEC_MOVIE (text)); swfdec_text_field_movie_auto_size (text); // special case: update the max values, not the current values swfdec...
2007 Aug 23
0
23 commits - doc/.gitignore doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt libswfdec-gtk/swfdec-gtk.h libswfdec-gtk/swfdec_gtk_keys.c libswfdec-gtk/swfdec_gtk_keys.h libswfdec-gtk/swfdec_gtk_widget.c libswfdec/Makefile.am
...ize len; + const char *s; + + s = swfdec_as_value_to_string (object->context, &argv[0]); + if (argc == 2) { + int offset = swfdec_as_value_to_integer (object->context, &argv[1]); + if (offset < 0) { + SWFDEC_AS_VALUE_SET_INT (ret, -1); + return; + } + len = g_utf8_offset_to_pointer (string->string, offset + 1) - string->string; + } else { + len = G_MAXSIZE; + } + s = g_strrstr_len (string->string, len, s); + if (s) { + SWFDEC_AS_VALUE_SET_INT (ret, g_utf8_pointer_to_offset (string->string, s)); + } else { + SWFDEC_AS_VALUE_SET_INT (ret, -1); + } +...