Blender V2.61 - r43446
Classes | Defines | Typedefs | Enumerations | Functions

interface_panel.c File Reference

#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "MEM_guardedalloc.h"
#include "PIL_time.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "DNA_userdef_types.h"
#include "BKE_context.h"
#include "BKE_screen.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_screen.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "interface_intern.h"

Go to the source code of this file.

Classes

struct  uiHandlePanelData
struct  PanelSort

Defines

#define ANIMATION_TIME   0.30
#define ANIMATION_INTERVAL   0.02
#define PNL_LAST_ADDED   1
#define PNL_ACTIVE   2
#define PNL_WAS_ACTIVE   4
#define PNL_ANIM_ALIGN   8
#define PNL_NEW_ADDED   16
#define PNL_FIRST   32
#define PNL_ICON   UI_UNIT_X

Typedefs

typedef enum uiHandlePanelState uiHandlePanelState
typedef struct uiHandlePanelData uiHandlePanelData
typedef struct PanelSort PanelSort

Enumerations

enum  uiHandlePanelState {
  PANEL_STATE_DRAG, PANEL_STATE_DRAG_SCALE, PANEL_STATE_WAIT_UNTAB, PANEL_STATE_ANIMATION,
  PANEL_STATE_EXIT
}

Functions

static void panel_activate_state (const bContext *C, Panel *pa, uiHandlePanelState state)
static int panel_aligned (ScrArea *sa, ARegion *ar)
static int panels_re_align (ScrArea *sa, ARegion *ar, Panel **r_pa)
static void ui_panel_copy_offset (Panel *pa, Panel *papar)
PaneluiBeginPanel (ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, int *open)
void uiEndPanel (uiBlock *block, int width, int height)
static void ui_offset_panel_block (uiBlock *block)
void UI_DrawTriIcon (float x, float y, char dir)
static void ui_draw_tria_rect (rctf *rect, char dir)
static void ui_draw_anti_x (float x1, float y1, float x2, float y2)
static void ui_draw_x_icon (float x, float y)
static void ui_draw_panel_scalewidget (rcti *rect)
static void ui_draw_panel_dragwidget (rctf *rect)
static void ui_draw_aligned_panel_header (uiStyle *style, uiBlock *block, rcti *rect, char dir)
static void rectf_scale (rctf *rect, float scale)
void ui_draw_aligned_panel (uiStyle *style, uiBlock *block, rcti *rect)
static int get_panel_header (Panel *pa)
static int get_panel_size_y (Panel *pa)
static int get_panel_real_ofsy (Panel *pa)
static int get_panel_real_ofsx (Panel *pa)
static int find_leftmost_panel (const void *a1, const void *a2)
static int find_highest_panel (const void *a1, const void *a2)
static int compare_panel (const void *a1, const void *a2)
static int uiAlignPanelStep (ScrArea *sa, ARegion *ar, float fac, int drag)
static void ui_panels_size (ScrArea *sa, ARegion *ar, int *x, int *y)
static void ui_do_animate (const bContext *C, Panel *panel)
void uiBeginPanels (const bContext *UNUSED(C), ARegion *ar)
void uiEndPanels (const bContext *C, ARegion *ar, int *x, int *y)
void uiDrawPanels (const bContext *C, ARegion *ar)
static void check_panel_overlap (ARegion *ar, Panel *panel)
static void ui_do_drag (const bContext *C, wmEvent *event, Panel *panel)
static void ui_handle_panel_header (const bContext *C, uiBlock *block, int mx, int my, int event)
int ui_handler_panel_region (bContext *C, wmEvent *event)
static int ui_handler_panel (bContext *C, wmEvent *event, void *userdata)
static void ui_handler_remove_panel (bContext *C, void *userdata)

Detailed Description

Definition in file interface_panel.c.


Define Documentation

#define ANIMATION_INTERVAL   0.02

Definition at line 69 of file interface_panel.c.

Referenced by panel_activate_state().

#define ANIMATION_TIME   0.30

Definition at line 68 of file interface_panel.c.

Referenced by ui_do_animate().

#define PNL_ACTIVE   2
#define PNL_ANIM_ALIGN   8

Definition at line 74 of file interface_panel.c.

Referenced by panels_re_align(), and uiEndPanel().

#define PNL_FIRST   32

Definition at line 76 of file interface_panel.c.

Referenced by ui_draw_aligned_panel(), and uiEndPanels().

#define PNL_ICON   UI_UNIT_X

Definition at line 386 of file interface_panel.c.

Referenced by ui_draw_aligned_panel_header(), and ui_handle_panel_header().

#define PNL_LAST_ADDED   1

Definition at line 71 of file interface_panel.c.

Referenced by uiBeginPanel().

#define PNL_NEW_ADDED   16

Definition at line 75 of file interface_panel.c.

Referenced by uiBeginPanel(), and uiEndPanel().

#define PNL_WAS_ACTIVE   4

Definition at line 73 of file interface_panel.c.

Referenced by panels_re_align(), and uiBeginPanels().


Typedef Documentation

typedef struct PanelSort PanelSort

Enumeration Type Documentation

Enumerator:
PANEL_STATE_DRAG 
PANEL_STATE_DRAG_SCALE 
PANEL_STATE_WAIT_UNTAB 
PANEL_STATE_ANIMATION 
PANEL_STATE_EXIT 

Definition at line 78 of file interface_panel.c.


Function Documentation

static void check_panel_overlap ( ARegion ar,
Panel panel 
) [static]
static int compare_panel ( const void *  a1,
const void *  a2 
) [static]

Definition at line 676 of file interface_panel.c.

References PanelSort::pa, and Panel::sortorder.

Referenced by uiAlignPanelStep().

static int find_highest_panel ( const void *  a1,
const void *  a2 
) [static]
static int find_leftmost_panel ( const void *  a1,
const void *  a2 
) [static]

Definition at line 647 of file interface_panel.c.

References Panel::ofsx, PanelSort::pa, and Panel::sortorder.

Referenced by uiAlignPanelStep().

static int get_panel_header ( Panel pa) [static]

Definition at line 604 of file interface_panel.c.

References PanelType::flag, PNL_HEADER, PNL_NO_HEADER, and Panel::type.

Referenced by get_panel_real_ofsx().

static int get_panel_real_ofsx ( Panel pa) [static]
static int get_panel_real_ofsy ( Panel pa) [static]

Definition at line 622 of file interface_panel.c.

References Panel::flag, Panel::ofsy, Panel::paneltab, PNL_CLOSEDY, and Panel::sizey.

Referenced by ui_panels_size(), and uiAlignPanelStep().

static int get_panel_size_y ( Panel pa) [static]

Definition at line 612 of file interface_panel.c.

References PanelType::flag, PNL_HEADER, PNL_NO_HEADER, Panel::sizey, and Panel::type.

Referenced by ui_panels_size(), and uiAlignPanelStep().

static void panel_activate_state ( const bContext C,
Panel pa,
uiHandlePanelState  state 
) [static]
static int panel_aligned ( ScrArea sa,
ARegion ar 
) [static]
static int panels_re_align ( ScrArea sa,
ARegion ar,
Panel **  r_pa 
) [static]
static void rectf_scale ( rctf rect,
float  scale 
) [static]

Definition at line 469 of file interface_panel.c.

References rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by ui_draw_aligned_panel().

static void ui_do_animate ( const bContext C,
Panel panel 
) [static]
static void ui_do_drag ( const bContext C,
wmEvent event,
Panel panel 
) [static]
void ui_draw_aligned_panel ( uiStyle style,
uiBlock block,
rcti rect 
)
static void ui_draw_aligned_panel_header ( uiStyle style,
uiBlock block,
rcti rect,
char  dir 
) [static]
static void ui_draw_anti_x ( float  x1,
float  y1,
float  x2,
float  y2 
) [static]

Definition at line 359 of file interface_panel.c.

References fdrawline().

Referenced by ui_draw_x_icon().

static void ui_draw_panel_dragwidget ( rctf rect) [static]

Definition at line 412 of file interface_panel.c.

References fdrawline(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by ui_draw_aligned_panel().

static void ui_draw_panel_scalewidget ( rcti rect) [static]

Definition at line 388 of file interface_panel.c.

References fdrawline(), PNL_HEADER, rcti::xmax, and rcti::ymin.

Referenced by ui_draw_aligned_panel().

static void ui_draw_tria_rect ( rctf rect,
char  dir 
) [static]

Definition at line 347 of file interface_panel.c.

References ui_draw_anti_tria(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by ui_draw_aligned_panel().

static void ui_draw_x_icon ( float  x,
float  y 
) [static]

Definition at line 379 of file interface_panel.c.

References ui_draw_anti_x().

Referenced by ui_draw_aligned_panel().

void UI_DrawTriIcon ( float  x,
float  y,
char  dir 
)

Definition at line 333 of file interface_panel.c.

References ui_draw_anti_tria().

Referenced by node_draw_basis(), node_draw_hidden(), and ui_draw_menu_back().

static void ui_handle_panel_header ( const bContext C,
uiBlock block,
int  mx,
int  my,
int  event 
) [static]
static int ui_handler_panel ( bContext C,
wmEvent event,
void *  userdata 
) [static]
int ui_handler_panel_region ( bContext C,
wmEvent event 
)
static void ui_handler_remove_panel ( bContext C,
void *  userdata 
) [static]

Definition at line 1232 of file interface_panel.c.

References panel_activate_state(), and PANEL_STATE_EXIT.

Referenced by panel_activate_state().

static void ui_offset_panel_block ( uiBlock block) [static]
static void ui_panel_copy_offset ( Panel pa,
Panel papar 
) [static]

Definition at line 167 of file interface_panel.c.

References Panel::ofsx, Panel::ofsy, and Panel::sizey.

Referenced by uiAlignPanelStep(), and uiBeginPanel().

static void ui_panels_size ( ScrArea sa,
ARegion ar,
int *  x,
int *  y 
) [static]
static int uiAlignPanelStep ( ScrArea sa,
ARegion ar,
float  fac,
int  drag 
) [static]
Panel* uiBeginPanel ( ScrArea sa,
ARegion ar,
uiBlock block,
PanelType pt,
int *  open 
) [read]
void uiBeginPanels ( const bContext UNUSEDC,
ARegion ar 
)
void uiDrawPanels ( const bContext C,
ARegion ar 
)
void uiEndPanel ( uiBlock block,
int  width,
int  height 
)
void uiEndPanels ( const bContext C,
ARegion ar,
int *  x,
int *  y 
)