Blender V2.61 - r43446
Enumerations | Functions | Variables

wm_window.c File Reference

#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "DNA_listBase.h"
#include "DNA_screen_types.h"
#include "DNA_windowmanager_types.h"
#include "RNA_access.h"
#include "MEM_guardedalloc.h"
#include "GHOST_C-api.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "BKE_blender.h"
#include "BKE_context.h"
#include "BKE_library.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BIF_gl.h"
#include "WM_api.h"
#include "WM_types.h"
#include "wm.h"
#include "wm_draw.h"
#include "wm_window.h"
#include "wm_subwindow.h"
#include "wm_event_system.h"
#include "ED_screen.h"
#include "ED_fileselect.h"
#include "PIL_time.h"
#include "GPU_draw.h"
#include "GPU_extensions.h"
#include "UI_interface.h"

Go to the source code of this file.

Enumerations

enum  modifierKeyType { SHIFT = 's', CONTROL = 'c', ALT = 'a', OS = 'C' }

Functions

void wm_get_screensize (int *width_r, int *height_r)
static void wm_window_check_position (rcti *rect)
static void wm_ghostwindow_destroy (wmWindow *win)
void wm_window_free (bContext *C, wmWindowManager *wm, wmWindow *win)
static int find_free_winid (wmWindowManager *wm)
wmWindowwm_window_new (bContext *C)
wmWindowwm_window_copy (bContext *C, wmWindow *winorig)
void wm_window_close (bContext *C, wmWindowManager *wm, wmWindow *win)
void wm_window_title (wmWindowManager *wm, wmWindow *win)
static void wm_window_add_ghostwindow (bContext *C, const char *title, wmWindow *win)
void wm_window_add_ghostwindows (bContext *C, wmWindowManager *wm)
wmWindowWM_window_open (bContext *C, rcti *rect)
void WM_window_open_temp (bContext *C, rcti *position, int type)
int wm_window_duplicate_exec (bContext *C, wmOperator *UNUSED(op))
int wm_window_fullscreen_toggle_exec (bContext *C, wmOperator *UNUSED(op))
static int query_qual (modifierKeyType qual)
void wm_window_make_drawable (bContext *C, wmWindow *win)
static int ghost_event_proc (GHOST_EventHandle evt, GHOST_TUserDataPtr private)
static int wm_window_timer (const bContext *C)
void wm_window_process_events (const bContext *C)
void wm_window_process_events_nosleep (void)
void wm_window_testbreak (void)
void wm_ghost_init (bContext *C)
void wm_ghost_exit (void)
void WM_event_timer_sleep (wmWindowManager *wm, wmWindow *UNUSED(win), wmTimer *timer, int dosleep)
wmTimerWM_event_add_timer (wmWindowManager *wm, wmWindow *win, int event_type, double timestep)
void WM_event_remove_timer (wmWindowManager *wm, wmWindow *UNUSED(win), wmTimer *timer)
char * WM_clipboard_text_get (int selection)
void WM_clipboard_text_set (char *buf, int selection)
void WM_progress_set (wmWindow *win, float progress)
void WM_progress_clear (wmWindow *win)
void wm_window_get_position (wmWindow *win, int *posx_r, int *posy_r)
void wm_window_get_size (wmWindow *win, int *width_r, int *height_r)
void wm_window_get_size_ghost (wmWindow *win, int *width_r, int *height_r)
void wm_window_set_size (wmWindow *win, int width, int height)
void wm_window_lower (wmWindow *win)
void wm_window_raise (wmWindow *win)
void wm_window_swap_buffers (wmWindow *win)
void wm_get_cursor_position (wmWindow *win, int *x, int *y)
void WM_setprefsize (int stax, int stay, int sizx, int sizy)
void WM_setinitialstate_fullscreen (void)
void WM_setinitialstate_normal (void)
void WM_cursor_warp (wmWindow *win, int x, int y)

Variables

static GHOST_SystemHandle g_system = NULL
static int prefsizx = 0
static int prefsizy = 0
static int prefstax = 0
static int prefstay = 0
static int initialstate = GHOST_kWindowStateNormal
static unsigned short useprefsize = 0

Detailed Description

Definition in file wm_window.c.


Enumeration Type Documentation

Enumerator:
SHIFT 
CONTROL 
ALT 
OS 

Definition at line 553 of file wm_window.c.


Function Documentation

static int find_free_winid ( wmWindowManager wm) [static]

Definition at line 189 of file wm_window.c.

References ListBase::first, wmWindow::next, wmWindowManager::windows, and wmWindow::winid.

Referenced by wm_window_new().

static int ghost_event_proc ( GHOST_EventHandle  evt,
GHOST_TUserDataPtr  private 
) [static]

Definition at line 607 of file wm_window.c.

References wmWindow::active, wmWindow::addmousemove, ALT, wmEvent::alt, GHOST_TEventKeyData::ascii, CONTROL, GHOST_TStringArray::count, wmEvent::ctrl, CTX_wm_manager(), CTX_wm_window(), CTX_wm_window_set(), GHOST_TEventDragnDropData::data, data, GHOST_TEventDragnDropData::dataType, wmWindowManager::drags, ED_file_extension_icon(), wmWindow::eventstate, EVT_DATA_LISTBASE, EVT_DROP, G, G_DEBUG, g_system, GHOST_DisposeRectangle(), GHOST_GetClientBounds(), GHOST_GetCursorPosition(), GHOST_GetEventData(), GHOST_GetEventTime(), GHOST_GetEventType(), GHOST_GetEventWindow(), GHOST_GetRectangle(), GHOST_GetWindowState(), GHOST_GetWindowUserData(), GHOST_kDragnDropTypeFilenames, GHOST_kEventDraggingDropDone, GHOST_kEventKeyUp, GHOST_kEventOpenMainFile, GHOST_kEventQuit, GHOST_kEventWindowActivate, GHOST_kEventWindowClose, GHOST_kEventWindowDeactivate, GHOST_kEventWindowMove, GHOST_kEventWindowSize, GHOST_kEventWindowUpdate, GHOST_kKeyLeftAlt, GHOST_kKeyLeftControl, GHOST_kKeyLeftShift, GHOST_kKeyOS, GHOST_kWindowStateFullScreen, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, GHOST_ScreenToClient(), GHOST_ValidWindow(), wmWindow::ghostwin, GHOST_TEventKeyData::key, wmEvent::keymodifier, KM_RELEASE, MOUSEMOVE, NA_EDITED, NC_SCREEN, NC_WINDOW, NULL, OS, wmEvent::oskey, wmWindow::posx, wmWindow::posy, query_qual(), RNA_string_set(), SHIFT, wmEvent::shift, wmWindow::sizex, wmWindow::sizey, state, GHOST_TStringArray::strings, GHOST_TEventKeyData::utf8_buf, wmWindowManager::winactive, WM_DRAG_PATH, wm_draw_window_clear(), wm_event_add(), wm_event_add_ghostevent(), WM_event_add_notifier(), WM_event_start_drag(), WM_exit(), wm_get_screensize(), WM_OP_EXEC_DEFAULT, WM_operator_name_call(), WM_operator_properties_create(), WM_operator_properties_free(), wm_window_close(), wm_window_make_drawable(), wmEvent::x, and wmEvent::y.

Referenced by wm_ghost_init().

static int query_qual ( modifierKeyType  qual) [static]
char* WM_clipboard_text_get ( int  selection)
void WM_clipboard_text_set ( char *  buf,
int  selection 
)
void WM_cursor_warp ( wmWindow win,
int  x,
int  y 
)
wmTimer* WM_event_add_timer ( wmWindowManager wm,
wmWindow win,
int  event_type,
double  timestep 
) [read]
void WM_event_remove_timer ( wmWindowManager wm,
wmWindow UNUSEDwin,
wmTimer timer 
)
void WM_event_timer_sleep ( wmWindowManager wm,
wmWindow UNUSEDwin,
wmTimer timer,
int  dosleep 
)

Definition at line 965 of file wm_window.c.

References ListBase::first, wmTimer::next, wmTimer::sleep, and wmWindowManager::timers.

Referenced by ED_screen_refresh(), and ED_screen_set().

void wm_get_cursor_position ( wmWindow win,
int *  x,
int *  y 
)
void wm_get_screensize ( int *  width_r,
int *  height_r 
)
void wm_ghost_exit ( void  )

Definition at line 954 of file wm_window.c.

References g_system, GHOST_DisposeSystem(), and NULL.

Referenced by WM_exit_ext().

void wm_ghost_init ( bContext C)
static void wm_ghostwindow_destroy ( wmWindow win) [static]

Definition at line 135 of file wm_window.c.

References g_system, GHOST_DisposeWindow(), wmWindow::ghostwin, and NULL.

Referenced by wm_window_free().

void WM_progress_clear ( wmWindow win)

Definition at line 1079 of file wm_window.c.

References GHOST_EndProgressBar(), and wmWindow::ghostwin.

Referenced by wm_jobs_timer().

void WM_progress_set ( wmWindow win,
float  progress 
)

Definition at line 1074 of file wm_window.c.

References GHOST_SetProgressBar(), and wmWindow::ghostwin.

Referenced by wm_jobs_timer().

void WM_setinitialstate_fullscreen ( void  )

Definition at line 1157 of file wm_window.c.

References GHOST_kWindowStateFullScreen, and initialstate.

Referenced by without_borders().

void WM_setinitialstate_normal ( void  )

Definition at line 1162 of file wm_window.c.

References GHOST_kWindowStateNormal, and initialstate.

Referenced by with_borders().

void WM_setprefsize ( int  stax,
int  stay,
int  sizx,
int  sizy 
)

Definition at line 1147 of file wm_window.c.

References prefsizx, prefsizy, prefstax, prefstay, and useprefsize.

Referenced by prefsize(), and wm_set_apple_prefsize().

static void wm_window_add_ghostwindow ( bContext C,
const char *  title,
wmWindow win 
) [static]
void wm_window_add_ghostwindows ( bContext C,
wmWindowManager wm 
)
static void wm_window_check_position ( rcti rect) [static]
void wm_window_close ( bContext C,
wmWindowManager wm,
wmWindow win 
)
wmWindow* wm_window_copy ( bContext C,
wmWindow winorig 
)
int wm_window_duplicate_exec ( bContext C,
wmOperator UNUSEDop 
)
void wm_window_free ( bContext C,
wmWindowManager wm,
wmWindow win 
)
int wm_window_fullscreen_toggle_exec ( bContext C,
wmOperator UNUSEDop 
)
void wm_window_get_position ( wmWindow win,
int *  posx_r,
int *  posy_r 
)

Definition at line 1086 of file wm_window.c.

References wmWindow::posx, and wmWindow::posy.

void wm_window_get_size ( wmWindow win,
int *  width_r,
int *  height_r 
)
void wm_window_get_size_ghost ( wmWindow win,
int *  width_r,
int *  height_r 
)
void wm_window_lower ( wmWindow win)
void wm_window_make_drawable ( bContext C,
wmWindow win 
)
wmWindow* wm_window_new ( bContext C)
wmWindow* WM_window_open ( bContext C,
rcti rect 
) [read]
void WM_window_open_temp ( bContext C,
rcti position,
int  type 
)
void wm_window_process_events ( const bContext C)

Definition at line 903 of file wm_window.c.

References g_system, GHOST_DispatchEvents(), GHOST_ProcessEvents(), PIL_sleep_ms(), and wm_window_timer().

Referenced by WM_main().

void wm_window_process_events_nosleep ( void  )

Definition at line 917 of file wm_window.c.

References g_system, GHOST_DispatchEvents(), and GHOST_ProcessEvents().

Referenced by StartKetsjiShell().

void wm_window_raise ( wmWindow win)
void wm_window_set_size ( wmWindow win,
int  width,
int  height 
)

Definition at line 1109 of file wm_window.c.

References GHOST_SetClientSize(), and wmWindow::ghostwin.

Referenced by WM_window_open_temp().

void wm_window_swap_buffers ( wmWindow win)
void wm_window_testbreak ( void  )

Definition at line 924 of file wm_window.c.

References g_system, GHOST_DispatchEvents(), GHOST_ProcessEvents(), and PIL_check_seconds_timer().

Referenced by WM_init().

static int wm_window_timer ( const bContext C) [static]
void wm_window_title ( wmWindowManager wm,
wmWindow win 
)

Variable Documentation

GHOST_SystemHandle g_system = NULL [static]
int initialstate = GHOST_kWindowStateNormal
int prefsizx = 0 [static]

Definition at line 82 of file wm_window.c.

Referenced by WM_setprefsize(), and wm_window_add_ghostwindows().

int prefsizy = 0

Definition at line 82 of file wm_window.c.

Referenced by WM_setprefsize(), and wm_window_add_ghostwindows().

int prefstax = 0

Definition at line 82 of file wm_window.c.

Referenced by WM_setprefsize(), and wm_window_add_ghostwindows().

int prefstay = 0

Definition at line 82 of file wm_window.c.

Referenced by WM_setprefsize(), and wm_window_add_ghostwindows().

unsigned short useprefsize = 0 [static]

Definition at line 83 of file wm_window.c.

Referenced by WM_setprefsize(), and wm_window_add_ghostwindows().