Beispiel #1
0
void    gml_ul( const gmltag * entry )
{
    char    *   p;
    bool        compact;

    p = scan_start;
    p++;
    while( *p == ' ' ) {
        p++;
    }
    scan_start = p;                     // over spaces
    if( !strnicmp( "compact", p, 7 ) ) {
        compact = true;
        scan_start = p + 7;
    }
    if( ProcFlags.need_li_lp ) {
        xx_nest_err( err_no_li_lp );
    }
    gml_xl_lp_common( entry, t_UL );

    nest_cb->compact = compact;

    nest_cb->li_number    = 0;
    nest_cb->left_indent  = conv_hor_unit( &layout_work.ul.left_indent );
    nest_cb->right_indent = conv_hor_unit( &layout_work.ul.right_indent );
    nest_cb->lay_tag      = &layout_work.ul;

    nest_cb->lm = g_cur_left;
    nest_cb->rm = g_page_right;

    scan_start = scan_stop + 1;
    return;
}
Beispiel #2
0
void    gml_gl( const gmltag * entry )  // not tested TBD
{
    char    *   p;
    bool        compact;

    p = scan_start;
    p++;
    while( *p == ' ' ) {
        p++;
    }
    scan_start = p;                     // over spaces
    if( !strnicmp( "compact", p, 7 ) ) {
        compact = true;
        scan_start = p + 7;
    } else {
        compact = false;
    }
    gml_xl_lp_common( entry, t_GL );

    nest_cb->compact = compact;

    nest_cb->li_number    = 0;
    nest_cb->left_indent  = conv_hor_unit( &layout_work.gl.left_indent );
    nest_cb->right_indent = conv_hor_unit( &layout_work.gl.right_indent );
    nest_cb->lay_tag      = &layout_work.gl;

    nest_cb->lm = g_cur_left;
    nest_cb->rm = g_page_right;

    scan_start = scan_stop + 1;
    return;
}
Beispiel #3
0
void gml_ul( const gmltag * entry )
{
    bool                compact;
    char            *   p;
    ul_lay_level    *   ul_layout   = NULL;

    p = scan_start + 1;
    while( *p == ' ' ) {
        p++;
    }
    scan_start = p;                     // over spaces
    if( !strnicmp( "compact", p, 7 ) ) {
        compact = true;
        scan_start = p + 7;
    } else {
        compact = false;
    }
    if( ProcFlags.need_li_lp ) {
        xx_nest_err( err_no_li_lp );
    }
    gml_xl_lp_common( t_UL );

    ul_layout = layout_work.ul.first;
    while( (ul_layout != NULL) && (ul_cur_level < ul_layout->level) ) {
        ul_layout = ul_layout->next;
    }

    if( ul_layout == NULL ) {
        internal_err( __FILE__, __LINE__ );
    }

    if( ul_cur_level < layout_work.ul.max_level ) {
        ul_cur_level++;
    } else {
        ul_cur_level = 1;
    }

    nest_cb->compact = compact;

    nest_cb->li_number = 0;
    nest_cb->left_indent = conv_hor_unit( &ul_layout->left_indent, g_curr_font )
                            + nest_cb->prev->left_indent + nest_cb->prev->align;
    nest_cb->right_indent = -1 * conv_hor_unit( &ul_layout->right_indent, g_curr_font )
                            + nest_cb->prev->right_indent;
    nest_cb->xl_pre_skip = ul_layout->pre_skip;
    nest_cb->lay_tag = ul_layout;

    nest_cb->lm = g_cur_left;
    nest_cb->rm = g_page_right;

    spacing = (int8_t) ul_layout->spacing;

    scan_start = scan_stop + 1;
    return;
}
Beispiel #4
0
void gml_gl( const gmltag * entry )  // not tested TBD
{
    bool                compact;
    char            *   p;
    gl_lay_level    *   gl_layout   = NULL;

    p = scan_start;
    p++;
    while( *p == ' ' ) {
        p++;
    }
    scan_start = p;                     // over spaces
    if( !strnicmp( "compact", p, 7 ) ) {
        compact = true;
        scan_start = p + 7;
    } else {
        compact = false;
    }
    gml_xl_lp_common( t_GL );

    gl_layout = layout_work.gl.first;
    while( (gl_layout != NULL) && (gl_cur_level < gl_layout->level) ) {
        gl_layout = gl_layout->next;
    }

    if( gl_layout == NULL ) {
        internal_err( __FILE__, __LINE__ );
    }

    if( gl_cur_level < layout_work.gl.max_level ) {
        gl_cur_level++;
    } else {
        gl_cur_level = 1;
    }

    nest_cb->compact = compact;

    nest_cb->li_number = 0;
    nest_cb->align = conv_hor_unit( &gl_layout->align, g_curr_font );
    nest_cb->left_indent = conv_hor_unit( &gl_layout->left_indent, g_curr_font )
                            + nest_cb->prev->left_indent + nest_cb->prev->align;
    nest_cb->right_indent = -1 * conv_hor_unit( &gl_layout->right_indent, g_curr_font )
                            + nest_cb->prev->right_indent;
    nest_cb->xl_pre_skip = gl_layout->pre_skip;
    nest_cb->lay_tag = gl_layout;

    nest_cb->lm = g_cur_left;
    nest_cb->rm = g_page_right;

    spacing = (int8_t) gl_layout->spacing;

    scan_start = scan_stop + 1;
    return;
}
Beispiel #5
0
void    gml_lp( const gmltag * entry )
{
    char        *   p;
    su          *   list_skip_su;
    su          *   lp_skip_su;
    su          *   pre_skip_su;

    scan_err = false;
    p = scan_start;

    if( nest_cb == NULL ) {
        xx_nest_err( err_li_lp_no_list );   // tag must be in a list
        scan_start = scan_stop + 1;
        return;
    }

    list_skip_su = &nest_cb->xl_pre_skip;   // nest_cb on entry, not LP nest_cb
    lp_skip_su = &layout_work.lp.pre_skip;

    gml_xl_lp_common( t_LP );

    if( g_line_indent == 0 ) {
        ProcFlags.para_starting = false;    // clear for this tag's first break
    }
    scr_process_break();

    nest_cb->compact = false;

    nest_cb->li_number    = 0;
    nest_cb->left_indent  = conv_hor_unit( &layout_work.lp.left_indent, g_curr_font );
    nest_cb->right_indent = -1 * conv_hor_unit( &layout_work.lp.right_indent, g_curr_font );
    nest_cb->lay_tag      = &layout_work.lp;

    nest_cb->lm = nest_cb->prev->lm + nest_cb->prev->left_indent;
    nest_cb->rm = nest_cb->prev->rm + nest_cb->prev->right_indent;

    spacing = (int8_t) layout_work.lp.spacing;

    ProcFlags.keep_left_margin = true;  // keep special Note indent
    post_space = 0;

    if( ProcFlags.need_li_lp ) {        // :LP first tag in list
        pre_skip_su = greater_su( lp_skip_su, list_skip_su, spacing );
    } else {
        pre_skip_su = lp_skip_su;
    }
    set_skip_vars( pre_skip_su, NULL, &layout_work.lp.post_skip, 1, g_curr_font );

    g_cur_left = nest_cb->lm + nest_cb->left_indent;// left start
                                        // possibly indent first line
    g_line_indent = conv_hor_unit( &(layout_work.lp.line_indent), g_curr_font );
    g_cur_h_start = g_cur_left + g_line_indent;

    g_page_right = nest_cb->rm + nest_cb->right_indent;

    nest_cb->left_indent += nest_cb->prev->left_indent;
    nest_cb->right_indent += nest_cb->prev->right_indent;

    ju_x_start = g_cur_h_start;

    ProcFlags.need_li_lp = false;       // :LI or :LP seen
    ProcFlags.para_starting = true;     // for next break, not this tag's break

    if( *p == '.' ) p++;                // possible tag end
    while( *p == ' ' ) p++;             // skip initial spaces
    if( *p ) {
        process_text( p, g_curr_font ); // if text follows
    }

    scan_start = scan_stop + 1;
    return;
}
Beispiel #6
0
void    gml_lp( const gmltag * entry )
{
    char        *   p;
    su          *   list_skip_su;
    su          *   lp_skip_su;
    su          *   pre_skip_su;

    scan_err = false;
    p = scan_start;

    if( nest_cb == NULL ) {
        xx_nest_err( err_li_lp_no_list );   // tag must be in a list
        scan_start = scan_stop + 1;
        return;
    }

    switch( nest_cb->c_tag ) {
    case t_OL :
        list_skip_su = &((ol_lay_tag *)(nest_cb->lay_tag))->pre_skip;
        break;
    case t_SL :
        list_skip_su = &((sl_lay_tag *)(nest_cb->lay_tag))->pre_skip;
        break;
    case t_UL :
        list_skip_su = &((ul_lay_tag *)(nest_cb->lay_tag))->pre_skip;
        break;
    case t_DL :             // TBD
        list_skip_su = &((dl_lay_tag *)(nest_cb->lay_tag))->pre_skip;
        break;
    case t_GL :             // TBD
        list_skip_su = &((gl_lay_tag *)(nest_cb->lay_tag))->pre_skip;
        break;
    default:
        break;
    }
    lp_skip_su = &layout_work.lp.pre_skip;

    gml_xl_lp_common( entry, t_LP );

    nest_cb->compact = false;

    nest_cb->li_number    = 0;
    nest_cb->left_indent  = conv_hor_unit( &layout_work.lp.left_indent );
    nest_cb->right_indent = conv_hor_unit( &layout_work.lp.right_indent );
    nest_cb->lay_tag      = &layout_work.lp;

    nest_cb->lm = nest_cb->prev->lm + nest_cb->prev->left_indent;
    nest_cb->rm = nest_cb->prev->rm - nest_cb->prev->right_indent;

    scr_process_break();

    spacing = ((lp_lay_tag *)(nest_cb->lay_tag))->spacing;

    ProcFlags.keep_left_margin = true;  // keep special Note indent
    post_space = 0;

    if( ProcFlags.need_li_lp ) {        // :LP first tag in list
        pre_skip_su = greater_su( lp_skip_su, list_skip_su, spacing );
    } else {
        pre_skip_su = &((lp_lay_tag *)(nest_cb->lay_tag))->pre_skip;
    }
    set_skip_vars( NULL, pre_skip_su,
                   &((ol_lay_tag *)(nest_cb->lay_tag))->post_skip,
                   1, g_curr_font );

    g_cur_left = nest_cb->lm + nest_cb->left_indent;// left start
                                        // possibly indent first line
    g_cur_h_start = g_cur_left + conv_hor_unit( &(layout_work.lp.line_indent) );

    g_page_right = nest_cb->rm - nest_cb->right_indent;

    ju_x_start = g_cur_h_start;

    if( *p == '.' ) p++;                // over '.'
    while( *p == ' ' ) p++;             // skip initial spaces
    ProcFlags.need_li_lp = false;       // :LI or :LP seen
    if( *p ) {
        process_text( p, g_curr_font ); // if text follows
    }

    scan_start = scan_stop + 1;
    return;
}