Blender V2.61 - r43446
Classes | Typedefs | Functions | Variables

view2d.c File Reference

#include <float.h>
#include <limits.h>
#include <math.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_scene_types.h"
#include "DNA_userdef_types.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_screen.h"
#include "BKE_global.h"
#include "WM_api.h"
#include "BIF_gl.h"
#include "BLF_api.h"
#include "ED_anim_api.h"
#include "ED_screen.h"
#include "UI_interface.h"
#include "UI_view2d.h"
#include "interface_intern.h"

Go to the source code of this file.

Classes

struct  View2DGrid
struct  View2DScrollers
struct  View2DString

Typedefs

typedef struct View2DString View2DString

Functions

static int view2d_scroll_mapped (int scroll)
static void view2d_masks (View2D *v2d)
void UI_view2d_region_reinit (View2D *v2d, short type, int winx, int winy)
void UI_view2d_curRect_validate_resize (View2D *v2d, int resize)
void UI_view2d_curRect_validate (View2D *v2d)
void UI_view2d_sync (bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
void UI_view2d_curRect_reset (View2D *v2d)
void UI_view2d_totRect_set_resize (View2D *v2d, int width, int height, int resize)
void UI_view2d_totRect_set (View2D *v2d, int width, int height)
int UI_view2d_tab_set (View2D *v2d, int tab)
static void view2d_map_cur_using_mask (View2D *v2d, rctf *curmasked)
void UI_view2d_view_ortho (View2D *v2d)
void UI_view2d_view_orthoSpecial (ARegion *ar, View2D *v2d, short xaxis)
void UI_view2d_view_restore (const bContext *C)
static void step_to_grid (float *step, int *power, int unit)
View2DGridUI_view2d_grid_calc (Scene *scene, View2D *v2d, short xunits, short xclamp, short yunits, short yclamp, int UNUSED(winx), int winy)
void UI_view2d_grid_draw (View2D *v2d, View2DGrid *grid, int flag)
void UI_view2d_constant_grid_draw (View2D *v2d)
void UI_view2d_grid_size (View2DGrid *grid, float *r_dx, float *r_dy)
void UI_view2d_grid_free (View2DGrid *grid)
View2DScrollersUI_view2d_scrollers_calc (const bContext *C, View2D *v2d, short xunits, short xclamp, short yunits, short yclamp)
static void scroll_printstr (Scene *scene, float x, float y, float val, int power, short unit, char dir)
void UI_view2d_scrollers_draw (const bContext *C, View2D *v2d, View2DScrollers *vs)
void UI_view2d_scrollers_free (View2DScrollers *scrollers)
void UI_view2d_listview_cell_to_view (View2D *v2d, short columnwidth, short rowheight, float startx, float starty, int column, int row, rctf *rect)
void UI_view2d_listview_view_to_cell (View2D *v2d, short columnwidth, short rowheight, float startx, float starty, float viewx, float viewy, int *column, int *row)
void UI_view2d_listview_visible_cells (View2D *v2d, short columnwidth, short rowheight, float startx, float starty, int *column_min, int *column_max, int *row_min, int *row_max)
void UI_view2d_region_to_view (View2D *v2d, int x, int y, float *viewx, float *viewy)
void UI_view2d_view_to_region (View2D *v2d, float x, float y, int *regionx, int *regiony)
void UI_view2d_to_region_no_clip (View2D *v2d, float x, float y, int *regionx, int *regiony)
View2DUI_view2d_fromcontext (const bContext *C)
View2DUI_view2d_fromcontext_rwin (const bContext *C)
void UI_view2d_getscale (View2D *v2d, float *x, float *y)
short UI_view2d_mouse_in_scrollers (const bContext *C, View2D *v2d, int x, int y)
void UI_view2d_text_cache_add (View2D *v2d, float x, float y, const char *str, const char col[4])
void UI_view2d_text_cache_rectf (View2D *v2d, rctf *rect, const char *str, const char col[4])
void UI_view2d_text_cache_draw (ARegion *ar)

Variables

static ListBase strings = {NULL, NULL}

Detailed Description

Definition in file view2d.c.


Typedef Documentation

typedef struct View2DString View2DString

Function Documentation

static void scroll_printstr ( Scene scene,
float  x,
float  y,
float  val,
int  power,
short  unit,
char  dir 
) [static]
static void step_to_grid ( float *  step,
int *  power,
int  unit 
) [static]

Definition at line 1069 of file view2d.c.

References pow(), and V2D_UNIT_FRAMES.

Referenced by UI_view2d_grid_calc().

void UI_view2d_constant_grid_draw ( View2D v2d)
void UI_view2d_curRect_reset ( View2D v2d)
void UI_view2d_curRect_validate ( View2D v2d)
void UI_view2d_curRect_validate_resize ( View2D v2d,
int  resize 
)
View2D* UI_view2d_fromcontext ( const bContext C)

Definition at line 1949 of file view2d.c.

References CTX_wm_area(), CTX_wm_region(), NULL, and ARegion::v2d.

View2D* UI_view2d_fromcontext_rwin ( const bContext C)
void UI_view2d_getscale ( View2D v2d,
float *  x,
float *  y 
)
View2DGrid* UI_view2d_grid_calc ( Scene scene,
View2D v2d,
short  xunits,
short  xclamp,
short  yunits,
short  yclamp,
int   UNUSEDwinx,
int  winy 
)
void UI_view2d_grid_draw ( View2D v2d,
View2DGrid grid,
int  flag 
)
void UI_view2d_grid_free ( View2DGrid grid)
void UI_view2d_grid_size ( View2DGrid grid,
float *  r_dx,
float *  r_dy 
)

Definition at line 1332 of file view2d.c.

References View2DGrid::dx, and View2DGrid::dy.

Referenced by draw_fcurve_curve().

void UI_view2d_listview_cell_to_view ( View2D v2d,
short  columnwidth,
short  rowheight,
float  startx,
float  starty,
int  column,
int  row,
rctf rect 
)
void UI_view2d_listview_view_to_cell ( View2D v2d,
short  columnwidth,
short  rowheight,
float  startx,
float  starty,
float  viewx,
float  viewy,
int *  column,
int *  row 
)
void UI_view2d_listview_visible_cells ( View2D v2d,
short  columnwidth,
short  rowheight,
float  startx,
float  starty,
int *  column_min,
int *  column_max,
int *  row_min,
int *  row_max 
)
short UI_view2d_mouse_in_scrollers ( const bContext C,
View2D v2d,
int  x,
int  y 
)
void UI_view2d_region_reinit ( View2D v2d,
short  type,
int  winx,
int  winy 
)

Definition at line 166 of file view2d.c.

References View2D::align, View2D::cur, View2D::flag, init(), View2D::keepofs, View2D::keeptot, View2D::keepzoom, View2D::max, View2D::maxzoom, View2D::min, View2D::minzoom, uiStyle::panelzoom, View2D::scroll, View2D::tot, UI_GetStyle(), UI_view2d_curRect_validate_resize(), UI_view2d_totRect_set_resize(), V2D_ALIGN_NO_NEG_X, V2D_ALIGN_NO_NEG_Y, V2D_ALIGN_NO_POS_Y, V2D_COMMONVIEW_HEADER, V2D_COMMONVIEW_LIST, V2D_COMMONVIEW_PANELS_UI, V2D_COMMONVIEW_STACK, V2D_COMMONVIEW_STANDARD, V2D_IS_INITIALISED, V2D_KEEPASPECT, V2D_KEEPTOT_BOUNDS, V2D_KEEPTOT_STRICT, V2D_KEEPZOOM, V2D_LIMITZOOM, V2D_LOCKOFS_Y, V2D_LOCKZOOM_X, V2D_LOCKZOOM_Y, V2D_SCROLL_BOTTOM, V2D_SCROLL_HORIZONTAL_HIDE, V2D_SCROLL_RIGHT, V2D_SCROLL_VERTICAL_HIDE, V2D_SCROLL_WIDTH, view2d_masks(), View2D::winx, View2D::winy, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by action_channel_area_init(), action_main_area_init(), buttons_header_area_init(), clip_main_area_init(), clip_preview_area_init(), console_main_area_init(), ED_region_header_init(), ED_region_panels_init(), file_main_area_draw(), file_main_area_init(), file_ui_area_init(), graph_channel_area_init(), graph_main_area_init(), info_main_area_init(), logic_main_area_init(), nla_channel_area_init(), nla_main_area_init(), node_main_area_init(), outliner_main_area_init(), script_main_area_init(), sequencer_main_area_init(), sequencer_preview_area_init(), text_main_area_init(), time_main_area_init(), and userpref_main_area_draw().

void UI_view2d_region_to_view ( View2D v2d,
int  x,
int  y,
float *  viewx,
float *  viewy 
)

Definition at line 1870 of file view2d.c.

References View2D::cur, div, View2D::mask, rctf::xmax, rcti::xmax, rctf::xmin, rcti::xmin, rctf::ymax, rcti::ymax, rctf::ymin, and rcti::ymin.

Referenced by actkeys_select_leftright_invoke(), animchannels_mouseclick_invoke(), animchannels_rename_invoke(), border_select_exec(), borderselect_action(), borderselect_anim_channels(), borderselect_graphkeys(), borderselect_nla_strips(), CalcSnapGeometry(), circle_select_exec(), createTransActionData(), createTransNlaData(), createTransSeqData(), cut_links_exec(), do_node_add(), ed_marker_border_select_exec(), ed_marker_select(), file_hilight_set(), find_file_mouse_rect(), find_nearest_seq(), frame_from_event(), gp_stroke_convertcoords(), grab_clone_modal(), graphkeys_click_insert_invoke(), graphkeys_select_leftright_invoke(), graphview_cursor_setprops(), image_sample_apply(), image_sample_line_exec(), imapaint_paint_stroke(), mouse_action_keys(), mouse_frame_side(), mouse_nla_strips(), nlachannels_mouseclick_invoke(), nlaedit_select_leftright_invoke(), node_add_file_invoke(), node_border_select_invoke(), node_borderselect_exec(), node_link_invoke(), node_link_modal(), node_mouse_select(), node_resize_invoke(), node_resize_modal(), outliner_item_activate(), outliner_item_openclose(), outliner_item_rename(), outliner_operation(), previewrange_define_exec(), select_invoke(), select_linked_internal(), select_loop_invoke(), sequencer_borderselect_exec(), sequencer_generic_invoke_xy__internal(), sequencer_select_invoke(), set_2d_cursor_invoke(), set_tile_invoke(), TimeSlide(), TimeTranslate(), view_borderzoom_exec(), view_ghost_border_exec(), view_zoomdrag_invoke(), view_zoomin_invoke(), and view_zoomout_invoke().

View2DScrollers* UI_view2d_scrollers_calc ( const bContext C,
View2D v2d,
short  xunits,
short  xclamp,
short  yunits,
short  yclamp 
)
void UI_view2d_scrollers_draw ( const bContext C,
View2D v2d,
View2DScrollers vs 
)
void UI_view2d_scrollers_free ( View2DScrollers scrollers)
void UI_view2d_sync ( bScreen screen,
ScrArea area,
View2D v2dcur,
int  flag 
)
int UI_view2d_tab_set ( View2D v2d,
int  tab 
)
void UI_view2d_text_cache_add ( View2D v2d,
float  x,
float  y,
const char *  str,
const char  col[4] 
)
void UI_view2d_text_cache_draw ( ARegion ar)
void UI_view2d_text_cache_rectf ( View2D v2d,
rctf rect,
const char *  str,
const char  col[4] 
)
void UI_view2d_to_region_no_clip ( View2D v2d,
float  x,
float  y,
int *  regionx,
int *  regiony 
)
void UI_view2d_totRect_set ( View2D v2d,
int  width,
int  height 
)
void UI_view2d_totRect_set_resize ( View2D v2d,
int  width,
int  height,
int  resize 
)
void UI_view2d_view_ortho ( View2D v2d)
void UI_view2d_view_orthoSpecial ( ARegion ar,
View2D v2d,
short  xaxis 
)
void UI_view2d_view_restore ( const bContext C)
void UI_view2d_view_to_region ( View2D v2d,
float  x,
float  y,
int *  regionx,
int *  regiony 
)
static void view2d_map_cur_using_mask ( View2D v2d,
rctf curmasked 
) [static]
static void view2d_masks ( View2D v2d) [static]
static int view2d_scroll_mapped ( int  scroll) [static]

Variable Documentation

ListBase strings = {NULL, NULL} [static]