Blender
V3.3
|
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "GL.h"
#include <GL/glew.h>
#include "MEM_guardedalloc.h"
#include "GHOST_C-api.h"
#include "BLF_api.h"
#include "Basic.h"
#include "EventToBuf.h"
#include "ScrollBar.h"
#include "Util.h"
#include "WindowData.h"
#include "GPU_context.h"
#include "GPU_immediate.h"
#include "GPU_init_exit.h"
Go to the source code of this file.
Classes | |
struct | MainWindow |
struct | _LoggerWindow |
struct | ExtraWindow |
struct | _MultiTestApp |
Macros | |
#define | SCROLLBAR_PAD 2 |
#define | SCROLLBAR_WIDTH 14 |
#define | TEXTAREA_PAD 2 |
Typedefs | |
typedef struct _LoggerWindow | LoggerWindow |
typedef struct _MultiTestApp | MultiTestApp |
Variables | |
int | datatoc_bfont_ttf_size |
char const | datatoc_bfont_ttf [] |
#define SCROLLBAR_PAD 2 |
Definition at line 371 of file MultiTest.c.
#define SCROLLBAR_WIDTH 14 |
Definition at line 372 of file MultiTest.c.
#define TEXTAREA_PAD 2 |
Definition at line 373 of file MultiTest.c.
typedef struct _LoggerWindow LoggerWindow |
Definition at line 47 of file MultiTest.c.
typedef struct _MultiTestApp MultiTestApp |
Definition at line 47 of file MultiTest.c.
|
static |
Definition at line 643 of file MultiTest.c.
References GHOST_ActivateWindowDrawingContext(), GHOST_SwapWindowBuffers(), glColor3f, glRecti, ExtraWindow::gpu_context, GPU_context_active_set(), ExtraWindow::size, and ExtraWindow::win.
Referenced by extrawindow_handle().
|
static |
Definition at line 678 of file MultiTest.c.
References ExtraWindow::app, GHOST_kKeyE, and multitestapp_toggle_extra_window().
Referenced by extrawindow_handle().
|
static |
Definition at line 657 of file MultiTest.c.
References bounds(), GHOST_ActivateWindowDrawingContext(), GHOST_GetClientBounds(), GHOST_GetHeightRectangle(), GHOST_GetWidthRectangle(), glLoadIdentity, glMatrixMode, glOrtho, glTranslatef, ExtraWindow::gpu_context, GPU_context_active_set(), ExtraWindow::size, and ExtraWindow::win.
Referenced by extrawindow_handle().
void extrawindow_free | ( | ExtraWindow * | ew | ) |
Definition at line 793 of file MultiTest.c.
References ExtraWindow::app, GHOST_DisposeWindow(), GHOST_GetWindowUserData(), MEM_freeN, multitestapp_get_system(), ExtraWindow::win, and windowdata_free().
Referenced by multitestapp_free_extrawindow().
Definition at line 721 of file MultiTest.c.
References ExtraWindow::app, event_to_buf(), extrawindow_do_draw(), extrawindow_do_key(), extrawindow_do_reshape(), extrawindow_spin_cursor(), GHOST_GetEventData(), GHOST_GetEventTime(), GHOST_GetEventType(), GHOST_kEventCursorMove, GHOST_kEventKeyDown, GHOST_kEventKeyUp, GHOST_kEventWindowClose, GHOST_kEventWindowSize, GHOST_kEventWindowUpdate, GHOST_TEventKeyData::key, loggerwindow_log(), multitestapp_free_extrawindow(), multitestapp_get_logger(), and type.
Referenced by extrawindow_new().
ExtraWindow* extrawindow_new | ( | MultiTestApp * | app | ) |
Definition at line 757 of file MultiTest.c.
References ExtraWindow::app, extrawindow_handle(), GHOST_CreateWindow(), GHOST_kDrawingContextTypeOpenGL, GHOST_kWindowStateNormal, GHOST_SetWindowUserData(), ExtraWindow::gpu_context, GPU_context_create(), GPU_init(), MEM_callocN, multitestapp_get_system(), NULL, ExtraWindow::win, and windowdata_new().
Referenced by multitestapp_toggle_extra_window().
|
static |
Definition at line 688 of file MultiTest.c.
References angle(), KDL::cos(), double(), GHOST_SetCustomCursorShape(), mask(), KDL::sin(), time, v, ExtraWindow::win, x, and y.
Referenced by extrawindow_handle().
|
static |
Definition at line 478 of file MultiTest.c.
References GHOST_InvalidateWindow(), GHOST_kButtonMaskLeft, GHOST_kButtonMaskMiddle, GHOST_kButtonMaskRight, GHOST_kStandardCursorDefault, GHOST_kStandardCursorUpDown, GHOST_SetCursorShape(), _LoggerWindow::lmbut, _LoggerWindow::lmouse, _LoggerWindow::scroll, scrollbar_contains_pt(), scrollbar_is_scrolling(), scrollbar_start_scrolling(), scrollbar_stop_scrolling(), and _LoggerWindow::win.
Referenced by loggerwindow_handle().
|
static |
Definition at line 421 of file MultiTest.c.
References BLF_draw(), BLF_position(), _LoggerWindow::font, _LoggerWindow::fontheight, GHOST_ActivateWindowDrawingContext(), GHOST_SwapWindowBuffers(), glColor3f, _LoggerWindow::gpu_context, GPU_context_active_set(), immDeactivate(), _LoggerWindow::loglines, min_i(), _LoggerWindow::ndisplines, _LoggerWindow::nloglines, rect_bevel_smooth(), _LoggerWindow::scroll, scrollbar_get_rect(), scrollbar_get_thumb(), scrollbar_get_thumbpos(), scrollbar_is_scrolling(), _LoggerWindow::textarea, and _LoggerWindow::win.
Referenced by loggerwindow_handle().
|
static |
Definition at line 506 of file MultiTest.c.
References _LoggerWindow::app, GHOST_kKeyQ, and multitestapp_exit().
Referenced by loggerwindow_handle().
|
static |
Definition at line 468 of file MultiTest.c.
References GHOST_InvalidateWindow(), _LoggerWindow::lmouse, _LoggerWindow::scroll, scrollbar_is_scrolling(), scrollbar_keep_scrolling(), _LoggerWindow::win, x, and y.
Referenced by loggerwindow_handle().
|
static |
Definition at line 407 of file MultiTest.c.
References bounds(), GHOST_ActivateWindowDrawingContext(), GHOST_GetClientBounds(), GHOST_GetHeightRectangle(), GHOST_GetWidthRectangle(), _LoggerWindow::gpu_context, GPU_context_active_set(), loggerwindow_recalc_regions(), loggerwindow_setup_window_gl(), _LoggerWindow::size, and _LoggerWindow::win.
Referenced by loggerwindow_handle(), and loggerwindow_new().
void loggerwindow_free | ( | LoggerWindow * | lw | ) |
Definition at line 615 of file MultiTest.c.
References _LoggerWindow::app, GHOST_DisposeWindow(), GHOST_GetWindowUserData(), _LoggerWindow::loglines, MEM_freeN, multitestapp_get_system(), _LoggerWindow::nloglines, _LoggerWindow::win, and windowdata_free().
Referenced by multitestapp_free().
Definition at line 516 of file MultiTest.c.
References GHOST_TEventButtonData::button, GHOST_GetEventData(), GHOST_GetEventType(), GHOST_kEventButtonDown, GHOST_kEventButtonUp, GHOST_kEventCursorMove, GHOST_kEventKeyDown, GHOST_kEventKeyUp, GHOST_kEventWindowSize, GHOST_kEventWindowUpdate, GHOST_ScreenToClient(), GHOST_TEventKeyData::key, loggerwindow_do_button(), loggerwindow_do_draw(), loggerwindow_do_key(), loggerwindow_do_move(), loggerwindow_do_reshape(), _LoggerWindow::size, type, _LoggerWindow::win, GHOST_TEventCursorData::x, x, GHOST_TEventCursorData::y, and y.
Referenced by loggerwindow_new().
void loggerwindow_log | ( | LoggerWindow * | lw, |
char * | line | ||
) |
Definition at line 603 of file MultiTest.c.
References GHOST_InvalidateWindow(), _LoggerWindow::loglines, _LoggerWindow::logsize, memdbl(), _LoggerWindow::ndisplines, _LoggerWindow::nloglines, _LoggerWindow::scroll, scrollbar_set_thumbpct(), string_dup(), and _LoggerWindow::win.
Referenced by extrawindow_handle(), mainwindow_log(), and multitest_event_handler().
LoggerWindow* loggerwindow_new | ( | MultiTestApp * | app | ) |
Definition at line 553 of file MultiTest.c.
References _LoggerWindow::app, BLF_height(), BLF_load_default(), BLF_size(), _LoggerWindow::font, _LoggerWindow::fontheight, GHOST_CreateWindow(), GHOST_GetMainDisplayDimensions(), GHOST_kDrawingContextTypeOpenGL, GHOST_kWindowStateNormal, GHOST_SetWindowUserData(), _LoggerWindow::gpu_context, GPU_context_create(), GPU_init(), loggerwindow_do_reshape(), loggerwindow_handle(), _LoggerWindow::loglines, _LoggerWindow::logsize, MEM_callocN, MEM_mallocN, multitestapp_get_system(), _LoggerWindow::nloglines, NULL, _LoggerWindow::scroll, scrollbar_new(), _LoggerWindow::win, and windowdata_new().
Referenced by multitestapp_new().
|
static |
Definition at line 374 of file MultiTest.c.
References _LoggerWindow::fontheight, _LoggerWindow::ndisplines, _LoggerWindow::nloglines, _LoggerWindow::scroll, SCROLLBAR_PAD, scrollbar_set_rect(), scrollbar_set_thumbpct(), SCROLLBAR_WIDTH, _LoggerWindow::size, _LoggerWindow::textarea, and TEXTAREA_PAD.
Referenced by loggerwindow_do_reshape().
|
static |
Definition at line 394 of file MultiTest.c.
References glLoadIdentity, glMatrixMode, glOrtho, glTranslatef, and _LoggerWindow::size.
Referenced by loggerwindow_do_reshape().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 931 of file MultiTest.c.
References BLF_init(), multitestapp_free(), multitestapp_new(), and multitestapp_run().
|
static |
Definition at line 233 of file MultiTest.c.
References GHOST_InvalidateWindow(), GHOST_kButtonMaskLeft, MainWindow::lmbut, MainWindow::lmouse, MainWindow::tmouse, and MainWindow::win.
Referenced by mainwindow_handle().
|
static |
Definition at line 138 of file MultiTest.c.
References GHOST_ActivateWindowDrawingContext(), GHOST_SwapWindowBuffers(), glColor3f, glRecti, MainWindow::gpu_context, GPU_context_active_set(), MainWindow::lmbut, MainWindow::tmouse, and MainWindow::win.
Referenced by mainwindow_handle().
|
static |
Definition at line 178 of file MultiTest.c.
References MainWindow::app, GHOST_InvalidateWindow(), GHOST_kKeyC, GHOST_kKeyE, GHOST_kKeyF11, GHOST_kKeyLeftBracket, GHOST_kKeyQ, GHOST_kKeyR, GHOST_kKeyRightBracket, GHOST_kKeyT, GHOST_kStandardCursorNumCursors, GHOST_kWindowOrderBottom, GHOST_SetCursorShape(), GHOST_SetCursorVisibility(), GHOST_SetWindowOrder(), mainwindow_log(), multitestapp_exit(), multitestapp_toggle_extra_window(), and MainWindow::win.
Referenced by mainwindow_handle().
|
static |
Definition at line 223 of file MultiTest.c.
References GHOST_InvalidateWindow(), MainWindow::lmbut, MainWindow::lmouse, MainWindow::tmouse, MainWindow::win, x, and y.
Referenced by mainwindow_handle().
|
static |
Definition at line 157 of file MultiTest.c.
References bounds(), GHOST_ActivateWindowDrawingContext(), GHOST_GetClientBounds(), GHOST_GetHeightRectangle(), GHOST_GetWidthRectangle(), glLoadIdentity, glMatrixMode, glOrtho, glTranslatef, MainWindow::gpu_context, GPU_context_active_set(), MainWindow::size, and MainWindow::win.
Referenced by mainwindow_handle().
void mainwindow_free | ( | MainWindow * | mw | ) |
Definition at line 336 of file MultiTest.c.
References MainWindow::app, GHOST_DisposeWindow(), GHOST_GetWindowUserData(), MEM_freeN, multitestapp_get_system(), MainWindow::win, and windowdata_free().
Referenced by multitestapp_free().
Definition at line 248 of file MultiTest.c.
References GHOST_TEventButtonData::button, event_to_buf(), GHOST_GetEventData(), GHOST_GetEventType(), GHOST_kEventButtonDown, GHOST_kEventButtonUp, GHOST_kEventCursorMove, GHOST_kEventKeyDown, GHOST_kEventKeyUp, GHOST_kEventWindowSize, GHOST_kEventWindowUpdate, GHOST_ScreenToClient(), GHOST_TEventKeyData::key, mainwindow_do_button(), mainwindow_do_draw(), mainwindow_do_key(), mainwindow_do_move(), mainwindow_do_reshape(), mainwindow_log(), MainWindow::size, type, MainWindow::win, GHOST_TEventCursorData::x, x, GHOST_TEventCursorData::y, and y.
Referenced by mainwindow_new().
|
static |
Definition at line 133 of file MultiTest.c.
References MainWindow::app, loggerwindow_log(), multitestapp_get_logger(), and str.
Referenced by mainwindow_do_key(), mainwindow_handle(), and mainwindow_timer_proc().
MainWindow* mainwindow_new | ( | MultiTestApp * | app | ) |
Definition at line 298 of file MultiTest.c.
References MainWindow::app, GHOST_CreateWindow(), GHOST_InstallTimer(), GHOST_kDrawingContextTypeOpenGL, GHOST_kWindowStateNormal, GHOST_SetWindowUserData(), MainWindow::gpu_context, GPU_context_create(), GPU_init(), mainwindow_handle(), mainwindow_timer_proc(), MEM_callocN, multitestapp_get_system(), NULL, MainWindow::win, and windowdata_new().
Referenced by multitestapp_new().
Definition at line 289 of file MultiTest.c.
References GHOST_GetTimerTaskUserData(), mainwindow_log(), blender::compositor::task, and time.
Referenced by mainwindow_new().
|
static |
Definition at line 815 of file MultiTest.c.
References data, eventtype_to_string(), _MultiTestApp::exit, fatal(), GHOST_GetEventType(), GHOST_GetEventWindow(), GHOST_GetWindowUserData(), GHOST_kEventQuitRequest, GHOST_ValidWindow(), _MultiTestApp::logger, loggerwindow_log(), _MultiTestApp::sys, type, and windowdata_handle().
Referenced by multitestapp_new().
void multitestapp_exit | ( | MultiTestApp * | app | ) |
Definition at line 905 of file MultiTest.c.
References _MultiTestApp::exit.
Referenced by loggerwindow_do_key(), and mainwindow_do_key().
void multitestapp_free | ( | MultiTestApp * | app | ) |
Definition at line 918 of file MultiTest.c.
References BLF_exit(), GHOST_DisposeSystem(), GPU_exit(), _MultiTestApp::logger, loggerwindow_free(), _MultiTestApp::main, mainwindow_free(), MEM_freeN, and _MultiTestApp::sys.
Referenced by main().
void multitestapp_free_extrawindow | ( | MultiTestApp * | app | ) |
Definition at line 889 of file MultiTest.c.
References _MultiTestApp::extra, extrawindow_free(), and NULL.
Referenced by extrawindow_handle(), and multitestapp_toggle_extra_window().
LoggerWindow * multitestapp_get_logger | ( | MultiTestApp * | app | ) |
Definition at line 879 of file MultiTest.c.
References _MultiTestApp::logger.
Referenced by extrawindow_handle(), and mainwindow_log().
GHOST_SystemHandle multitestapp_get_system | ( | MultiTestApp * | app | ) |
Definition at line 884 of file MultiTest.c.
References _MultiTestApp::sys.
Referenced by extrawindow_free(), extrawindow_new(), loggerwindow_free(), loggerwindow_new(), mainwindow_free(), and mainwindow_new().
MultiTestApp* multitestapp_new | ( | void | ) |
Definition at line 853 of file MultiTest.c.
References _MultiTestApp::exit, _MultiTestApp::extra, fatal(), GHOST_AddEventConsumer(), GHOST_CreateEventConsumer(), GHOST_CreateSystem(), _MultiTestApp::logger, loggerwindow_new(), _MultiTestApp::main, mainwindow_new(), MEM_mallocN, multitest_event_handler(), NULL, and _MultiTestApp::sys.
Referenced by main().
void multitestapp_run | ( | MultiTestApp * | app | ) |
Definition at line 910 of file MultiTest.c.
References _MultiTestApp::exit, GHOST_DispatchEvents(), GHOST_ProcessEvents(), and _MultiTestApp::sys.
Referenced by main().
void multitestapp_toggle_extra_window | ( | MultiTestApp * | app | ) |
Definition at line 895 of file MultiTest.c.
References _MultiTestApp::extra, extrawindow_new(), and multitestapp_free_extrawindow().
Referenced by extrawindow_do_key(), and mainwindow_do_key().
void rect_bevel_side | ( | int | rect[2][2], |
int | side, | ||
float * | lt, | ||
float * | dk, | ||
const float | col[3], | ||
int | width | ||
) |
Definition at line 62 of file MultiTest.c.
References col, glBegin, glColor3f, glColor3fv, glEnd, glRecti, glVertex2i, pow(), width, x, and y.
Referenced by rect_bevel_smooth().
void rect_bevel_smooth | ( | int | rect[2][2], |
int | width | ||
) |
Definition at line 95 of file MultiTest.c.
References col, float(), free(), rect_bevel_side(), v, and width.
Referenced by loggerwindow_do_draw().
|
extern |
|
extern |