Ejemplo n.º 1
0
static void
form_scrolling_extent(HyperDocPage *page)
{

    /*
     * Check to see if there is a scrolling region
     */

    if (page->scrolling) {
        /*
         * If there is then compute all the proper locations
         */

        gExtentRegion = Scrolling;
        right_margin_space = non_scroll_right_margin_space + gScrollbarWidth;
        init_extents();
        text_y = line_height;
        compute_text_extent(page->scrolling->next);
        if (!gInLine)
            text_y = text_y - past_line_height;
        else if (present_line_height > line_height)
            text_y = text_y + present_line_height - line_height;
        page->scrolling->height = text_y;
    }
}
Ejemplo n.º 2
0
void
compute_scrolling_extent(HyperDocPage *page)
{
    /* Check to see if there is a scrolling region  */

    if (!page->scrolling) {
        return;
    }
    noop_count = 0;

    /* If there is then compute all the proper locations */
    gExtentRegion = Scrolling;
    right_margin_space = non_scroll_right_margin_space + gScrollbarWidth;
    init_extents();
    text_y = line_height;
    gLineNode = page->scrolling->next;
    compute_text_extent(page->scrolling->next);

    /*
     * the following is an attempt to fix the bug where one cannot scroll
     * down to a bitmap that is opened at the bottom of a page.
     */

    /*
     * TTT trial if(!gInLine)
     */
    if (0) {
        text_y = text_y - past_line_height;
    }
    else if (present_line_height > line_height)
        text_y = text_y + present_line_height - line_height;
    page->scrolling->height = text_y;

}
Ejemplo n.º 3
0
void
compute_header_extent(HyperDocPage *page)
{

    /*
     * Hopefully we will soon be able to actually compute the needed height
     * for the header here
     */

    int ty; /* UNUSED */

    gExtentRegion = Header;
    right_margin_space = non_scroll_right_margin_space;
    init_extents();
    ty = text_y = 3 * top_margin + line_height + max(page->title->height, twheight);
    gLineNode = page->header->next;
    compute_text_extent(page->header->next);
    page->header->height = text_height(page->header->next, Endheader);
    if (page->header->height) {
        page->header->height += 1 / 2 * line_height;
        page->top_scroll_margin = (gInLine) ? text_y : text_y - past_line_height;
        if (!(page->page_flags & NOLINES))
            page->top_scroll_margin += (int) line_height / 2;
        page->top_scroll_margin += gWindow->border_width + 2 * top_margin;
    }
    else {
        page->top_scroll_margin = page->title->height + gWindow->border_width +
            2 * scroll_top_margin;
    }
}
Ejemplo n.º 4
0
static void
form_header_extent(HyperDocPage *page)
{

    /*
     * Hopefully I will soon be able to actually compute the needed height
     * for the header here
     */
    gExtentRegion = Header;
    right_margin_space = non_scroll_right_margin_space;
    init_extents();
    text_y = top_margin + line_height;
    compute_text_extent(page->header->next);
    page->header->height = (gInLine) ? text_y : text_y - past_line_height;
    if (!(page->page_flags & NOLINES))
        page->header->height += (int) line_height / 2;
    page->header->height += gWindow->border_width;
}
Ejemplo n.º 5
0
static void
form_footer_extent(HyperDocPage *page)
{
    if (page->footer) {
        gExtentRegion = Footer;
        right_margin_space = non_scroll_right_margin_space;
        init_extents();

        compute_text_extent(page->footer->next);

        /*
         * I inserted the 2nd arg to text_height below because it
         * was missing. Perhaps there is a better value for it.
         */

        page->footer->height = text_height(page->footer->next,
            page->footer->next->type);
        if ((!page->page_flags & NOLINES))
            page->footer->height += (int) line_height / 2;
    }
}
Ejemplo n.º 6
0
uint64_t	Inode::go_to_extent_blk()
{
  uint64_t	t;
  uint16_t	length;
  uint64_t	blk_nb;

  if (!__extents)
    __extents = init_extents();
  length = __extents_list.front().first;
  blk_nb = __extents_list.front().second;
  if (__offset_in_extent >= length)
    {
      __extents_list.pop_front();
      if (__extents_list.empty())
	return 0;
      blk_nb = __extents_list.front().second;
      __offset_in_extent = 0;
    }
  t = __offset_in_extent + blk_nb;
  __offset_in_extent++;
  return t;
}
Ejemplo n.º 7
0
void
compute_footer_extent(HyperDocPage * page)
{
    if (page->footer) {
        gExtentRegion = Footer;
        right_margin_space = non_scroll_right_margin_space;
        init_extents();
        present_line_height = line_height;
        text_y = line_height;
        gLineNode = page->footer->next;
        compute_text_extent(page->footer->next);
        page->footer->height = text_height(page->footer->next, Endfooter);
        if (page->footer->height) {
            if ((!page->page_flags & NOLINES))
                page->footer->height += (int) line_height / 2;
            page->bot_scroll_margin = gWindow->height -
                page->footer->height - bottom_margin
                - gWindow->border_width + top_margin;
        }
        else
            page->bot_scroll_margin = gWindow->height;
    }
}