Author: tom
Date: Wed Dec 17 04:50:44 2008
New Revision: 3545

URL: http://svn.slimdevices.com?rev=3545&root=Jive&view=rev
Log:
pango: 
textarea: work-in-progress: hack so only one "jive line" is created which 
includes all text.

Modified:
    7.4/branches/pango/squeezeplay/src/squeezeplay/src/ui/jive_textarea.c

Modified: 7.4/branches/pango/squeezeplay/src/squeezeplay/src/ui/jive_textarea.c
URL: 
http://svn.slimdevices.com/7.4/branches/pango/squeezeplay/src/squeezeplay/src/ui/jive_textarea.c?rev=3545&root=Jive&r1=3544&r2=3545&view=diff
==============================================================================
--- 7.4/branches/pango/squeezeplay/src/squeezeplay/src/ui/jive_textarea.c 
(original)
+++ 7.4/branches/pango/squeezeplay/src/squeezeplay/src/ui/jive_textarea.c Wed 
Dec 17 04:50:44 2008
@@ -307,6 +307,7 @@
        for (i = top_line; i < bottom_line; i++) {
                JiveSurface *tsrf;
                int x;
+               int width;
 
                int line = peer->lines[i];
                int next = peer->lines[i+1];
@@ -324,15 +325,18 @@
                        x = jive_widget_halign((JiveWidget *)peer, peer->align, 
line_width);
                }
 
+        //todo: get actual width - think this is wrong
+        width = peer->w.bounds.w - peer->w.padding.left - 
peer->w.padding.right;
+
                /* shadow text */
                if (peer->is_sh) {
-                       tsrf = jive_font_draw_text(peer->font, peer->sh, 
&text[line]);
+                       tsrf = jive_font_draw_text_wrap(peer->font, peer->sh, 
&text[line], width);
                        jive_surface_blit(tsrf, srf, x + 1, y + 1);
                        jive_surface_free(tsrf);
                }
 
                /* foreground text */
-               tsrf = jive_font_draw_text(peer->font, peer->fg, &text[line]);
+               tsrf = jive_font_draw_text_wrap(peer->font, peer->fg, 
&text[line], width);
                jive_surface_blit(tsrf, srf, x, y);
                jive_surface_free(tsrf);
 
@@ -439,20 +443,20 @@
                unsigned code = utf8decode(&next);
 
                switch (code) {
-               case '\n':
-                       // Line break
-                       ptr = next;
-                       word_break = NULL;
-
-                       if (max_lines == num_lines) {
-                               max_lines += 100;
-                               lines = realloc(lines, sizeof(int) * max_lines);
-                       }
-
-                       line_start = ptr;
-                       lines[num_lines++] = (ptr - text);
-                       line_width = 0;
-                       continue;
+//             case '\n':
+//                     // Line break
+//                     ptr = next;
+//                     word_break = NULL;
+//
+//                     if (max_lines == num_lines) {
+//                             max_lines += 100;
+//                             lines = realloc(lines, sizeof(int) * max_lines);
+//                     }
+//
+//                     line_start = ptr;
+//                     lines[num_lines++] = (ptr - text);
+//                     line_width = 0;
+//                     continue;
 
                case ' ':
                case ',':
@@ -468,6 +472,9 @@
                line_width += jive_font_width(peer->font, (char *)ptr);
                *next = c;
 
+        ptr = next;
+        continue;
+
                // Line is less than widget width
                if (line_width < width) {
                        ptr = next;

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to