Changeset 47519e1b for fmtext.c


Ignore:
Timestamp:
Jan 2, 2008, 2:42:05 AM (16 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
c60ade2
Parents:
2febcae
Message:
text entry:
* first pass at utf-8 text entry. This is not yet complete, and it certainly has bugs.
  The following is an incomplete list of functions that will probably misbehave if you use them.
  - owl_editwin_move_to_nextword()
  - owl_editwin_move_to_previousword()
  - owl_editwin_delete_nextword()
  - owl_editwin_delete_previousword()
  - owl_editwin_delete_to_endofline()
  - owl_editwin_fill_paragraph()

format text:
* owl_fmtext_curs_waddstr() contract restored to match trunk.
* owl_fmtext_curs_waddstr_without_search() added.

misc:
* Importing Markus Kuhn's wcwidth.c from
  http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
* Change wcwidth() calls to mk_wcwidth()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fmtext.c

    r5376a95 r47519e1b  
    248248 * must already be initiatlized with curses
    249249 */
    250 void owl_fmtext_curs_waddstr(owl_fmtext *f, WINDOW *w, int do_search)
     250void _owl_fmtext_curs_waddstr(owl_fmtext *f, WINDOW *w, int do_search) /*noproto*/
    251251{
    252252  /* char *tmpbuff; */
     
    264264  search_results = (do_search
    265265                    ? owl_fmtext_search(f, owl_global_get_search_string(&g))
    266                     : NULL);
    267   if (search_results) search_len = strlen(owl_global_get_search_string(&g));
     266                    : 0);
     267  search_len = (search_results
     268                ? strlen(owl_global_get_search_string(&g))
     269                : 0);
    268270  s = f->textbuff;
    269271  /* Set default attributes. */
     
    350352}
    351353
     354void owl_fmtext_curs_waddstr(owl_fmtext *f, WINDOW *w)
     355{
     356  _owl_fmtext_curs_waddstr(f, w, owl_global_is_search_active(&g));
     357}
     358
     359void owl_fmtext_curs_waddstr_without_search(owl_fmtext *f, WINDOW *w)
     360{
     361  _owl_fmtext_curs_waddstr(f, w, 0);
     362}
    352363
    353364/* start with line 'aline' (where the first line is 0) and print
     
    413424    st = 0;
    414425    padding = 0;
     426    chwidth = 0;
    415427    ptr_c = ptr_s;
    416428    while(col <= bcol && ptr_c < ptr_e) {
    417429      gunichar c = g_utf8_get_char(ptr_c);
    418430      if (!_owl_fmtext_is_format_char(c)) {
    419         chwidth = wcwidth(c);
     431        chwidth = mk_wcwidth(c);
    420432     
    421433        if (col + chwidth > bcol)
Note: See TracChangeset for help on using the changeset viewer.