I agree with el.pescado's answer, but you can also try to fake it. Count the number of lines in the edited file. Put one screen of text in the buffer and fill in the remaining lines so that the buffer has the same number of lines as the file.
changed , , , . , , , , , .
, ( , Python ):
visible_rect = textview.get_visible_rect()
top = textview.get_iter_at_location(visible_rect.x, visible_rect.y)
bottom = textview.get_iter_at_location(visible_rect.x, visible_rect.y + visible_rect.height)
top_line, bottom_line = top.get_line(), bottom.get_line()