Blender V2.61 - r43446
|
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include "GL.h"
#include "MEM_guardedalloc.h"
#include "GHOST_C-api.h"
#include "BLF_api.h"
#include "Util.h"
#include "Basic.h"
#include "ScrollBar.h"
#include "EventToBuf.h"
#include "WindowData.h"
Go to the source code of this file.
#define FALSE 0 |
***** BEGIN GPL LICENSE BLOCK *****
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. All rights reserved.
The Original Code is: all of this file.
Contributor(s): none yet.
***** END GPL LICENSE BLOCK *****
Definition at line 27 of file MultiTest.c.
Referenced by extrawindow_new(), loggerwindow_new(), and mainwindow_new().
#define SCROLLBAR_PAD 2 |
Definition at line 358 of file MultiTest.c.
Referenced by loggerwindow_recalc_regions().
#define SCROLLBAR_WIDTH 14 |
Definition at line 359 of file MultiTest.c.
Referenced by loggerwindow_recalc_regions().
#define TEXTAREA_PAD 2 |
Definition at line 360 of file MultiTest.c.
Referenced by loggerwindow_recalc_regions().
typedef struct _LoggerWindow LoggerWindow |
Definition at line 66 of file MultiTest.c.
typedef struct _MultiTestApp MultiTestApp |
Definition at line 65 of file MultiTest.c.
static void extrawindow_do_draw | ( | ExtraWindow * | ew | ) | [static] |
Definition at line 628 of file MultiTest.c.
References GHOST_ActivateWindowDrawingContext(), GHOST_SwapWindowBuffers(), ExtraWindow::size, and ExtraWindow::win.
Referenced by extrawindow_handle().
static void extrawindow_do_key | ( | ExtraWindow * | ew, |
GHOST_TKey | key, | ||
int | press | ||
) | [static] |
Definition at line 659 of file MultiTest.c.
References ExtraWindow::app, GHOST_kKeyE, and multitestapp_toggle_extra_window().
Referenced by extrawindow_handle().
static void extrawindow_do_reshape | ( | ExtraWindow * | ew | ) | [static] |
Definition at line 640 of file MultiTest.c.
References bounds(), GHOST_ActivateWindowDrawingContext(), GHOST_GetClientBounds(), GHOST_GetHeightRectangle(), GHOST_GetWidthRectangle(), ExtraWindow::size, and ExtraWindow::win.
Referenced by extrawindow_handle().
void extrawindow_free | ( | ExtraWindow * | ew | ) |
Definition at line 756 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().
static void extrawindow_handle | ( | void * | priv, |
GHOST_EventHandle | evt | ||
) | [static] |
Definition at line 700 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(), and multitestapp_get_logger().
Referenced by extrawindow_new().
ExtraWindow* extrawindow_new | ( | MultiTestApp * | app | ) |
Definition at line 735 of file MultiTest.c.
References MakeCursor::app, ExtraWindow::app, extrawindow_handle(), FALSE, GHOST_CreateWindow(), GHOST_kDrawingContextTypeOpenGL, GHOST_kWindowStateNormal, GHOST_SetWindowUserData(), MEM_callocN(), multitestapp_get_system(), NULL, ExtraWindow::win, and windowdata_new().
Referenced by multitestapp_toggle_extra_window().
static void extrawindow_spin_cursor | ( | ExtraWindow * | ew, |
GHOST_TUns64 | time | ||
) | [static] |
Definition at line 668 of file MultiTest.c.
References angle(), cos(), GHOST_SetCustomCursorShape(), i, sin(), and ExtraWindow::win.
Referenced by extrawindow_handle().
static void loggerwindow_do_button | ( | LoggerWindow * | lw, |
int | which, | ||
int | press | ||
) | [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 void loggerwindow_do_draw | ( | LoggerWindow * | lw | ) | [static] |
Definition at line 404 of file MultiTest.c.
References BLF_draw(), BLF_position(), _LoggerWindow::font, _LoggerWindow::fontheight, _LoggerWindow::fonttexid, GHOST_ActivateWindowDrawingContext(), GHOST_SwapWindowBuffers(), i, _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 void loggerwindow_do_key | ( | LoggerWindow * | lw, |
GHOST_TKey | key, | ||
int | press | ||
) | [static] |
Definition at line 502 of file MultiTest.c.
References _LoggerWindow::app, GHOST_kKeyQ, and multitestapp_exit().
Referenced by loggerwindow_handle().
static void loggerwindow_do_move | ( | LoggerWindow * | lw, |
int | x, | ||
int | y | ||
) | [static] |
Definition at line 469 of file MultiTest.c.
References GHOST_InvalidateWindow(), _LoggerWindow::lmouse, _LoggerWindow::scroll, scrollbar_is_scrolling(), scrollbar_keep_scrolling(), and _LoggerWindow::win.
Referenced by loggerwindow_handle().
static void loggerwindow_do_reshape | ( | LoggerWindow * | lw | ) | [static] |
Definition at line 392 of file MultiTest.c.
References bounds(), GHOST_ActivateWindowDrawingContext(), GHOST_GetClientBounds(), GHOST_GetHeightRectangle(), GHOST_GetWidthRectangle(), 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 601 of file MultiTest.c.
References _LoggerWindow::app, GHOST_DisposeWindow(), GHOST_GetWindowUserData(), i, _LoggerWindow::loglines, MEM_freeN(), multitestapp_get_system(), _LoggerWindow::nloglines, _LoggerWindow::win, and windowdata_free().
Referenced by multitestapp_free().
static void loggerwindow_handle | ( | void * | priv, |
GHOST_EventHandle | evt | ||
) | [static] |
Definition at line 511 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, _LoggerWindow::win, GHOST_TEventCursorData::x, and GHOST_TEventCursorData::y.
Referenced by loggerwindow_new().
void loggerwindow_log | ( | LoggerWindow * | lw, |
char * | line | ||
) |
Definition at line 590 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 547 of file MultiTest.c.
References MakeCursor::app, _LoggerWindow::app, BLF_height(), BLF_load_mem(), BLF_size(), datatoc_bfont_ttf, datatoc_bfont_ttf_size, FALSE, _LoggerWindow::font, _LoggerWindow::fontheight, _LoggerWindow::fonttexid, GHOST_CreateWindow(), GHOST_GetMainDisplayDimensions(), GHOST_kDrawingContextTypeOpenGL, GHOST_kWindowStateNormal, GHOST_SetWindowUserData(), loggerwindow_do_reshape(), loggerwindow_handle(), _LoggerWindow::loglines, _LoggerWindow::logsize, MEM_callocN(), MEM_mallocN(), multitestapp_get_system(), _LoggerWindow::nloglines, NULL, rect_height(), _LoggerWindow::scroll, scrollbar_new(), _LoggerWindow::win, and windowdata_new().
Referenced by multitestapp_new().
static void loggerwindow_recalc_regions | ( | LoggerWindow * | lw | ) | [static] |
Definition at line 361 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 void loggerwindow_setup_window_gl | ( | LoggerWindow * | lw | ) | [static] |
Definition at line 380 of file MultiTest.c.
References _LoggerWindow::size.
Referenced by loggerwindow_do_reshape().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 879 of file MultiTest.c.
References MakeCursor::app, BLF_init(), multitestapp_free(), multitestapp_new(), and multitestapp_run().
static void mainwindow_do_button | ( | MainWindow * | mw, |
int | which, | ||
int | press | ||
) | [static] |
Definition at line 237 of file MultiTest.c.
References GHOST_InvalidateWindow(), GHOST_kButtonMaskLeft, MainWindow::lmbut, MainWindow::lmouse, MainWindow::tmouse, and MainWindow::win.
Referenced by mainwindow_handle().
static void mainwindow_do_draw | ( | MainWindow * | mw | ) | [static] |
Definition at line 150 of file MultiTest.c.
References GHOST_ActivateWindowDrawingContext(), GHOST_SwapWindowBuffers(), MainWindow::lmbut, MainWindow::tmouse, and MainWindow::win.
Referenced by mainwindow_handle().
static void mainwindow_do_key | ( | MainWindow * | mw, |
GHOST_TKey | key, | ||
int | press | ||
) | [static] |
Definition at line 185 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(), i, mainwindow_log(), multitestapp_exit(), multitestapp_toggle_extra_window(), and MainWindow::win.
Referenced by mainwindow_handle().
static void mainwindow_do_move | ( | MainWindow * | mw, |
int | x, | ||
int | y | ||
) | [static] |
Definition at line 228 of file MultiTest.c.
References GHOST_InvalidateWindow(), MainWindow::lmbut, MainWindow::lmouse, MainWindow::tmouse, and MainWindow::win.
Referenced by mainwindow_handle().
static void mainwindow_do_reshape | ( | MainWindow * | mw | ) | [static] |
Definition at line 166 of file MultiTest.c.
References bounds(), GHOST_ActivateWindowDrawingContext(), GHOST_GetClientBounds(), GHOST_GetHeightRectangle(), GHOST_GetWidthRectangle(), MainWindow::size, and MainWindow::win.
Referenced by mainwindow_handle().
void mainwindow_free | ( | MainWindow * | mw | ) |
Definition at line 320 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().
static void mainwindow_handle | ( | void * | priv, |
GHOST_EventHandle | evt | ||
) | [static] |
Definition at line 249 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, MainWindow::win, GHOST_TEventCursorData::x, and GHOST_TEventCursorData::y.
Referenced by mainwindow_new().
static void mainwindow_log | ( | MainWindow * | mw, |
char * | str | ||
) | [static] |
Definition at line 146 of file MultiTest.c.
References MainWindow::app, loggerwindow_log(), and multitestapp_get_logger().
Referenced by mainwindow_do_key(), mainwindow_handle(), and mainwindow_timer_proc().
MainWindow* mainwindow_new | ( | MultiTestApp * | app | ) |
Definition at line 297 of file MultiTest.c.
References MainWindow::app, MakeCursor::app, FALSE, GHOST_CreateWindow(), GHOST_InstallTimer(), GHOST_kDrawingContextTypeOpenGL, GHOST_kWindowStateNormal, GHOST_SetWindowUserData(), mainwindow_handle(), mainwindow_timer_proc(), MEM_callocN(), multitestapp_get_system(), NULL, MainWindow::win, and windowdata_new().
Referenced by multitestapp_new().
static void mainwindow_timer_proc | ( | GHOST_TimerTaskHandle | task, |
GHOST_TUns64 | time | ||
) | [static] |
Definition at line 289 of file MultiTest.c.
References GHOST_GetTimerTaskUserData(), and mainwindow_log().
Referenced by mainwindow_new().
static int multitest_event_handler | ( | GHOST_EventHandle | evt, |
GHOST_TUserDataPtr | data | ||
) | [static] |
Definition at line 777 of file MultiTest.c.
References MakeCursor::app, data, eventtype_to_string(), _MultiTestApp::exit, fatal(), GHOST_GetEventType(), GHOST_GetEventWindow(), GHOST_GetWindowUserData(), GHOST_kEventQuit, GHOST_ValidWindow(), _MultiTestApp::logger, loggerwindow_log(), _MultiTestApp::sys, and windowdata_handle().
Referenced by multitestapp_new().
void multitestapp_exit | ( | MultiTestApp * | app | ) |
Definition at line 859 of file MultiTest.c.
References _MultiTestApp::exit.
Referenced by loggerwindow_do_key(), and mainwindow_do_key().
void multitestapp_free | ( | MultiTestApp * | app | ) |
Definition at line 870 of file MultiTest.c.
References GHOST_DisposeSystem(), _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 846 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 838 of file MultiTest.c.
References _MultiTestApp::logger.
Referenced by extrawindow_handle(), and mainwindow_log().
GHOST_SystemHandle multitestapp_get_system | ( | MultiTestApp * | app | ) |
Definition at line 842 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 813 of file MultiTest.c.
References MakeCursor::app, _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 863 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 851 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, | ||
float * | col, | ||
int | width | ||
) |
Definition at line 78 of file MultiTest.c.
Referenced by rect_bevel_smooth().
void rect_bevel_smooth | ( | int | rect[2][2], |
int | width | ||
) |
Definition at line 110 of file MultiTest.c.
References addon::engine::free(), i, and rect_bevel_side().
Referenced by loggerwindow_do_draw().
char datatoc_bfont_ttf[] |
Definition at line 7 of file bfont.ttf.c.
Referenced by loggerwindow_new(), main(), and uiStyleInit().
Definition at line 6 of file bfont.ttf.c.
Referenced by loggerwindow_new(), main(), and uiStyleInit().
char U[1024] = {0} |
Definition at line 53 of file MultiTest.c.