Changeset 5639bf2


Ignore:
Timestamp:
Jun 21, 2003, 11:17:28 AM (17 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
be0a79f
Parents:
b1299da
Message:
'M' now displays a message using the default style regardless
  of the current style.
Removed some memory leaks introduced in new use of styles.
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    rc3ab155 r5639bf2  
    13751375
    13761376
     1377/* print the current message in a popup window.
     1378 * Use the 'default' style regardless of whatever
     1379 * style the user may be using
     1380 */
    13771381void owl_function_curmsg_to_popwin()
    13781382{
     
    13801384  owl_view *v;
    13811385  owl_message *m;
    1382 
    1383   v = owl_global_get_current_view(&g);
    1384 
     1386  owl_style *s;
     1387  owl_fmtext fm;
     1388
     1389  v=owl_global_get_current_view(&g);
     1390  s=owl_global_get_style_by_name(&g, "default");
    13851391  pw=owl_global_get_popwin(&g);
    13861392
     
    13921398  }
    13931399
    1394   owl_function_popless_fmtext(owl_message_get_fmtext(m));
     1400  owl_fmtext_init_null(&fm);
     1401  owl_style_get_formattext(s, &fm, m);
     1402
     1403  owl_function_popless_fmtext(&fm);
     1404  owl_fmtext_free(&fm);
    13951405}
    13961406
  • style.c

    rbd3f232 r5639bf2  
    2525}
    2626
     27/* Use style 's' to format message 'm' into fmtext 'fm'.
     28 * 'fm' should already be be initialzed
     29 */
    2730void owl_style_get_formattext(owl_style *s, owl_fmtext *fm, owl_message *m)
    2831{
  • stylefunc.c

    rc3ab155 r5639bf2  
    33static const char fileIdent[] = "$Id$";
    44
     5/* In all of these functions, 'fm' is expected to already be
     6 * initialized.
     7 */
     8   
    59void owl_stylefunc_basic(owl_fmtext *fm, owl_message *m)
    610{
     
    109113    indent=owl_malloc(strlen(text)+owl_text_num_lines(text)*OWL_MSGTAB+10);
    110114    owl_text_indent(indent, text, OWL_MSGTAB);
    111     owl_fmtext_init_null(fm);
    112115    owl_fmtext_append_normal(fm, OWL_TABSTR);
    113116    owl_fmtext_append_normal(fm, "To: ");
     
    134137   
    135138    if (owl_message_is_loginout(m)) {
    136       owl_fmtext_init_null(fm);
    137139      owl_fmtext_append_normal(fm, OWL_TABSTR);
    138140      if (owl_message_is_login(m)) {
     
    147149      indent=owl_malloc(strlen(owl_message_get_body(m))+owl_text_num_lines(owl_message_get_body(m))*OWL_MSGTAB+10);
    148150      owl_text_indent(indent, owl_message_get_body(m), OWL_MSGTAB);
    149       owl_fmtext_init_null(fm);
    150151      owl_fmtext_append_bold(fm, OWL_TABSTR);
    151152      owl_fmtext_append_bold(fm, "AIM from ");
     
    160161      indent=owl_malloc(strlen(owl_message_get_body(m))+owl_text_num_lines(owl_message_get_body(m))*OWL_MSGTAB+10);
    161162      owl_text_indent(indent, owl_message_get_body(m), OWL_MSGTAB);
    162       owl_fmtext_init_null(fm);
    163163      owl_fmtext_append_normal(fm, OWL_TABSTR);
    164164      owl_fmtext_append_normal(fm, "AIM sent to ");
     
    179179    indent=owl_malloc(strlen(text)+owl_text_num_lines(text)*OWL_MSGTAB+10);
    180180    owl_text_indent(indent, text, OWL_MSGTAB);
    181     owl_fmtext_init_null(fm);
    182181    owl_fmtext_append_normal(fm, OWL_TABSTR);
    183182    owl_fmtext_append_bold(fm, "OWL ADMIN ");
     
    222221   
    223222    /* set the message for printing */
    224     owl_fmtext_init_null(fm);
    225223    owl_fmtext_append_normal(fm, OWL_TABSTR);
    226224   
     
    301299    indent=owl_malloc(strlen(text)+owl_text_num_lines(text)*OWL_MSGTAB+10);
    302300    owl_text_indent(indent, text, OWL_MSGTAB);
    303     owl_fmtext_init_null(fm);
    304301    owl_fmtext_append_normal(fm, OWL_TABSTR);
    305302    owl_fmtext_append_normal(fm, "Zephyr sent to ");
     
    326323   
    327324    if (owl_message_is_loginout(m)) {
    328       owl_fmtext_init_null(fm);
    329325      owl_fmtext_append_normal(fm, OWL_TABSTR);
    330326      if (owl_message_is_login(m)) {
     
    339335      indent=owl_malloc(strlen(owl_message_get_body(m))+owl_text_num_lines(owl_message_get_body(m))*OWL_MSGTAB+10);
    340336      owl_text_indent(indent, owl_message_get_body(m), OWL_MSGTAB);
    341       owl_fmtext_init_null(fm);
    342337      owl_fmtext_append_bold(fm, OWL_TABSTR);
    343338      owl_fmtext_append_bold(fm, "AIM from ");
     
    352347      indent=owl_malloc(strlen(owl_message_get_body(m))+owl_text_num_lines(owl_message_get_body(m))*OWL_MSGTAB+10);
    353348      owl_text_indent(indent, owl_message_get_body(m), OWL_MSGTAB);
    354       owl_fmtext_init_null(fm);
    355349      owl_fmtext_append_normal(fm, OWL_TABSTR);
    356350      owl_fmtext_append_normal(fm, "AIM sent to ");
     
    371365    indent=owl_malloc(strlen(text)+owl_text_num_lines(text)*OWL_MSGTAB+10);
    372366    owl_text_indent(indent, text, OWL_MSGTAB);
    373     owl_fmtext_init_null(fm);
    374367    owl_fmtext_append_normal(fm, OWL_TABSTR);
    375368    owl_fmtext_append_bold(fm, "OWL ADMIN ");
Note: See TracChangeset for help on using the changeset viewer.