Blender V2.61 - r43446
|
#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.
Definition in file wm_window.c.
enum modifierKeyType |
Definition at line 553 of file wm_window.c.
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] |
Definition at line 562 of file wm_window.c.
References ALT, CONTROL, g_system, GHOST_GetModifierKeyState(), GHOST_kModifierKeyLeftAlt, GHOST_kModifierKeyLeftControl, GHOST_kModifierKeyLeftShift, GHOST_kModifierKeyOS, GHOST_kModifierKeyRightAlt, GHOST_kModifierKeyRightControl, GHOST_kModifierKeyRightShift, left(), OS, SHIFT, and simple_enum_gen::val.
Referenced by ghost_event_proc().
char* WM_clipboard_text_get | ( | int | selection | ) |
Definition at line 1014 of file wm_window.c.
References addon::engine::free(), G, GHOST_getClipboard(), MEM_callocN(), NULL, p, and strlen().
Referenced by console_paste_exec(), text_paste_exec(), ui_but_copy_paste(), and ui_textedit_copypaste().
void WM_clipboard_text_set | ( | char * | buf, |
int | selection | ||
) |
Definition at line 1039 of file wm_window.c.
References G, GHOST_putClipboard(), MEM_callocN(), MEM_freeN(), and p.
Referenced by console_copy_exec(), copy_data_path_button_exec(), report_copy_exec(), text_cursor_set_exit(), txt_copy_clipboard(), ui_but_copy_paste(), and ui_textedit_copypaste().
void WM_cursor_warp | ( | wmWindow * | win, |
int | x, | ||
int | y | ||
) |
Definition at line 1168 of file wm_window.c.
References wmWindow::eventstate, g_system, GHOST_ClientToScreen(), GHOST_SetCursorPosition(), wmWindow::ghostwin, wmEvent::prevx, wmEvent::prevy, and wmWindow::sizey.
Referenced by BL_warp_pointer(), initFlyInfo(), and wm_cursor_arrow_move().
wmTimer* WM_event_add_timer | ( | wmWindowManager * | wm, |
wmWindow * | win, | ||
int | event_type, | ||
double | timestep | ||
) | [read] |
Definition at line 977 of file wm_window.c.
References BLI_addtail(), wmTimer::event_type, wmTimer::ltime, MEM_callocN(), wmTimer::ntime, PIL_check_seconds_timer(), wmTimer::stime, wmWindowManager::timers, wmTimer::timestep, and wmTimer::win.
Referenced by button_activate_state(), button_tooltip_timer_reset(), ED_screen_animation_timer(), file_directory_new_exec(), image_record_composite_invoke(), initFlyInfo(), minimize_stretch_invoke(), paint_invoke(), paint_stroke_modal(), panel_activate_state(), screen_opengl_render_invoke(), smooth_view(), ui_handle_menu_event(), view_zoomdrag_invoke(), viewzoom_invoke(), WM_autosave_init(), wm_autosave_timer(), WM_init_game(), WM_jobs_start(), and wm_operator_reports().
void WM_event_remove_timer | ( | wmWindowManager * | wm, |
wmWindow * | UNUSEDwin, | ||
wmTimer * | timer | ||
) |
Definition at line 993 of file wm_window.c.
References BLI_remlink(), wmTimer::customdata, ListBase::first, MEM_freeN(), wmTimer::next, NULL, wmWindowManager::reports, ReportList::reporttimer, and wmWindowManager::timers.
Referenced by button_activate_state(), button_timers_tooltip_remove(), button_tooltip_timer_reset(), ED_screen_animation_timer(), ED_screen_exit(), file_smoothscroll_invoke(), flyEnd(), image_record_composite_exit(), minimize_stretch_exit(), paint_exit(), paint_stroke_modal(), panel_activate_state(), screen_opengl_render_end(), smooth_view(), ui_handle_button_event(), ui_popup_block_free(), update_reports_display_invoke(), view3d_smoothview_invoke(), view_zoomdrag_exit(), viewops_data_free(), wm_autosave_timer(), wm_autosave_timer_ended(), WM_init_game(), wm_jobs_kill_job(), wm_jobs_timer(), wm_operator_reports(), wm_reports_free(), and wm_window_free().
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 | ||
) |
Definition at line 1136 of file wm_window.c.
References g_system, GHOST_GetCursorPosition(), GHOST_ScreenToClient(), wmWindow::ghostwin, and wmWindow::sizey.
Referenced by wm_event_add_ghostevent(), and wm_paintcursor_draw().
void wm_get_screensize | ( | int * | width_r, |
int * | height_r | ||
) |
Definition at line 89 of file wm_window.c.
References g_system, and GHOST_GetMainDisplayDimensions().
Referenced by ghost_event_proc(), WM_init_game(), wm_window_add_ghostwindow(), wm_window_add_ghostwindows(), and wm_window_check_position().
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 | ) |
Definition at line 944 of file wm_window.c.
References g_system, GHOST_AddEventConsumer(), GHOST_CreateEventConsumer(), GHOST_CreateSystem(), and ghost_event_proc().
Referenced by WM_init().
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().
Definition at line 306 of file wm_window.c.
References CTX_wm_window(), wmWindow::eventstate, g_system, GHOST_CreateWindow(), GHOST_kDrawingContextTypeOpenGL, GHOST_kWindowStateNormal, GHOST_SetWindowState(), GHOST_SetWindowUserData(), wmWindow::ghostwin, GPU_DEVICE_ATI, GPU_DRIVER_OPENSOURCE, GPU_extensions_init(), GPU_OS_UNIX, GPU_state_init(), GPU_type_matches(), initialstate, macPrefState, MEM_callocN(), NULL, wmWindow::posx, wmWindow::posy, wmWindow::sizex, wmWindow::sizey, wm_get_screensize(), and wm_window_swap_buffers().
Referenced by wm_window_add_ghostwindows().
void wm_window_add_ghostwindows | ( | bContext * | C, |
wmWindowManager * | wm | ||
) |
Definition at line 370 of file wm_window.c.
References wmWindowManager::defaultconf, wmWindow::eventstate, ListBase::first, wmWindow::ghostwin, wmWindow::handlers, initialstate, MEM_callocN(), wmWindow::modalhandlers, wmWindow::next, NULL, wmWindow::posx, wmWindow::posy, prefsizx, prefsizy, prefstax, prefstay, wmWindow::sizex, wmWindow::sizey, useprefsize, wmWindowManager::windows, wmWindow::windowstate, WM_dropboxmap_find(), WM_event_add_dropbox_handler(), WM_event_add_keymap_handler(), wm_get_screensize(), WM_keymap_find(), wm_set_apple_prefsize(), wm_window_add_ghostwindow(), and wm_window_title().
Referenced by WM_check().
static void wm_window_check_position | ( | rcti * | rect | ) | [static] |
Definition at line 101 of file wm_window.c.
References simple_enum_gen::d, wm_get_screensize(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by WM_window_open_temp().
void wm_window_close | ( | bContext * | C, |
wmWindowManager * | wm, | ||
wmWindow * | win | ||
) |
Definition at line 239 of file wm_window.c.
References BLI_remlink(), CTX_data_main(), CTX_wm_window_set(), ED_screen_exit(), ListBase::first, free_libblock(), wmWindow::handlers, wmWindow::modalhandlers, wmWindow::next, NULL, wmWindow::screen, Main::screen, bScreen::temp, wmWindowManager::windows, wm_draw_window_clear(), WM_event_remove_handlers(), WM_exit(), and wm_window_free().
Referenced by ghost_event_proc(), and WM_write_homefile().
Definition at line 215 of file wm_window.c.
References BLI_strncpy(), bScreen::do_draw, bScreen::do_refresh, wmWindow::drawdata, wmWindow::drawmethod, ED_screen_duplicate(), bScreen::id, ID::name, NULL, wmWindow::posx, wmWindow::posy, wmWindow::screen, wmWindow::screenname, wmWindow::sizex, wmWindow::sizey, bScreen::winid, wmWindow::winid, and wm_window_new().
Referenced by wm_window_duplicate_exec().
int wm_window_duplicate_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) |
Definition at line 520 of file wm_window.c.
References CTX_wm_window(), NA_ADDED, NC_WINDOW, NULL, OPERATOR_FINISHED, WM_check(), WM_event_add_notifier(), and wm_window_copy().
Referenced by WM_OT_window_duplicate().
void wm_window_free | ( | bContext * | C, |
wmWindowManager * | wm, | ||
wmWindow * | win | ||
) |
Definition at line 145 of file wm_window.c.
References CTX_wm_window(), CTX_wm_window_set(), wmWindow::drawdata, wmTimer::event_type, wmWindow::eventstate, ListBase::first, wmWindow::handlers, MEM_freeN(), wmWindow::modalhandlers, wmTimer::next, NULL, TIMERJOBS, wmWindowManager::timers, wmTimer::win, wmWindowManager::winactive, wmWindowManager::windrawable, wm_event_free_all(), WM_event_remove_handlers(), WM_event_remove_timer(), wm_ghostwindow_destroy(), wm_jobs_timer_ended(), and wm_subwindows_free().
Referenced by wm_close_and_free(), and wm_window_close().
int wm_window_fullscreen_toggle_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) |
Definition at line 532 of file wm_window.c.
References CTX_wm_window(), G, GHOST_GetWindowState(), GHOST_kWindowStateFullScreen, GHOST_kWindowStateNormal, GHOST_SetWindowState(), wmWindow::ghostwin, OPERATOR_CANCELLED, OPERATOR_FINISHED, and state.
Referenced by WM_OT_window_fullscreen_toggle().
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 | ||
) |
Definition at line 1092 of file wm_window.c.
References wmWindow::sizex, and wmWindow::sizey.
Referenced by ui_block_position(), ui_popup_block_clip(), ui_popup_bounds_block(), ui_searchbox_create(), and ui_tooltip_create().
void wm_window_get_size_ghost | ( | wmWindow * | win, |
int * | width_r, | ||
int * | height_r | ||
) |
Definition at line 1100 of file wm_window.c.
References bounds(), GHOST_DisposeRectangle(), GHOST_GetClientBounds(), GHOST_GetHeightRectangle(), GHOST_GetWidthRectangle(), and wmWindow::ghostwin.
Referenced by ui_centered_bounds_block().
void wm_window_lower | ( | wmWindow * | win | ) |
Definition at line 1114 of file wm_window.c.
References GHOST_kWindowOrderBottom, GHOST_SetWindowOrder(), and wmWindow::ghostwin.
Referenced by render_view_cancel_exec(), and render_view_show_invoke().
Definition at line 593 of file wm_window.c.
References CTX_wm_manager(), G, G_DEBUG, GHOST_ActivateWindowDrawingContext(), wmWindow::ghostwin, wmWindowManager::windrawable, and wmWindow::winid.
Referenced by ghost_event_proc(), wm_add_default(), wm_draw_update(), and wm_event_do_handlers().
Definition at line 202 of file wm_window.c.
References BLI_addtail(), CTX_wm_manager(), find_free_winid(), MEM_callocN(), wmWindowManager::windows, and wmWindow::winid.
Referenced by wm_add_default(), wm_window_copy(), WM_window_open(), and WM_window_open_temp().
Definition at line 434 of file wm_window.c.
References wmWindow::drawdata, wmWindow::drawmethod, NULL, wmWindow::posx, wmWindow::posy, wmWindow::sizex, wmWindow::sizey, WM_check(), wm_window_new(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by area_dupli_invoke().
Definition at line 455 of file wm_window.c.
References bScreen::areabase, CTX_data_scene(), CTX_wm_area_set(), CTX_wm_manager(), CTX_wm_window_set(), ED_area_newspace(), ED_screen_add(), ED_screen_set(), ELEM, ListBase::first, GHOST_SetTitle(), wmWindow::ghostwin, IFACE_, wmWindow::next, NULL, wmWindow::posx, wmWindow::posy, wmWindow::screen, wmWindow::sizex, wmWindow::sizey, SPACE_FILE, SPACE_IMAGE, SPACE_OUTLINER, SPACE_USERPREF, ScrArea::spacetype, bScreen::temp, WM_check(), wm_window_check_position(), wm_window_new(), wm_window_raise(), WM_WINDOW_RENDER, wm_window_set_size(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by render_view_open(), and userpref_show_invoke().
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 | ) |
Definition at line 1119 of file wm_window.c.
References GHOST_kWindowOrderTop, GHOST_SetWindowOrder(), and wmWindow::ghostwin.
Referenced by render_view_open(), render_view_show_invoke(), and WM_window_open_temp().
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 | ) |
Definition at line 1124 of file wm_window.c.
References GHOST_SwapWindowBuffers(), and wmWindow::ghostwin.
Referenced by BL_SwapBuffers(), wm_draw_update(), and wm_window_add_ghostwindow().
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] |
Definition at line 864 of file wm_window.c.
References CTX_wm_manager(), wmTimer::delta, wmTimer::duration, wmTimer::event_type, wmWindow::eventstate, EVT_DATA_TIMER, ListBase::first, wmTimer::ltime, wmTimer::next, wmTimer::ntime, PIL_check_seconds_timer(), wmTimer::sleep, wmTimer::stime, TIMERAUTOSAVE, TIMERJOBS, wmWindowManager::timers, wmTimer::timestep, wmEvent::type, wmTimer::win, wm_autosave_timer(), wm_event_add(), and wm_jobs_timer().
Referenced by wm_window_process_events().
void wm_window_title | ( | wmWindowManager * | wm, |
wmWindow * | win | ||
) |
Definition at line 272 of file wm_window.c.
References BLI_snprintf(), wmWindowManager::file_saved, G, GHOST_GetTitle(), GHOST_kWindowStateModified, GHOST_kWindowStateUnModified, GHOST_SetTitle(), GHOST_SetWindowModifiedState(), GHOST_SetWindowState(), wmWindow::ghostwin, NULL, wmWindow::screen, str, and bScreen::temp.
Referenced by wm_event_do_notifiers(), and wm_window_add_ghostwindows().
GHOST_SystemHandle g_system = NULL [static] |
Definition at line 79 of file wm_window.c.
Referenced by ghost_event_proc(), query_qual(), WM_cursor_warp(), wm_get_cursor_position(), wm_get_screensize(), wm_ghost_exit(), wm_ghost_init(), wm_ghostwindow_destroy(), wm_window_add_ghostwindow(), wm_window_process_events(), wm_window_process_events_nosleep(), and wm_window_testbreak().
int initialstate = GHOST_kWindowStateNormal |
Definition at line 82 of file wm_window.c.
Referenced by WM_setinitialstate_fullscreen(), WM_setinitialstate_normal(), wm_window_add_ghostwindow(), and wm_window_add_ghostwindows().
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().