#include <fastgl.h>
Inheritance diagram for fgl::FGApp:


alpha.cpp, bgroup.cpp, bitmap.cpp, buttons.cpp, calc.cpp, cdialog.cpp, connect.cpp, cursor.cpp, double.cpp, editor.cpp, events.cpp, fdialog.cpp, fgcolor.cpp, font.cpp, fontsel.cpp, gears16.cpp, geartrain.cpp, gif.cpp, gradient.cpp, hello.cpp, listbox.cpp, mandel.cpp, modal.cpp, morph3d.cpp, pane.cpp, radio.cpp, regress.cpp, tabpage.cpp, timer.cpp, ttf.cpp, updown.cpp, and widget.cpp.
Public Member Functions | |
| int | RemoveMousePointer (void) |
| void | ShowMousePointer (void) |
| int | get_key (void) |
| void | SetDelayProc (void(*fnc)(void)) |
| void | UpdateMousePointer (void) |
| FGApp (int m, int &argc, char **&argv, int bck, int appFlags=APP_ENABLEALTX) | |
| virtual | ~FGApp () |
| void __fastcall | Run (MainHwnd hwnd=0) |
| void __fastcall | FGYield (void) |
| void | SetTimerProc (TimerProc p, int t=1000) |
| MODAL_RETURN __fastcall | RunModal (FGWindow *which) |
| const FGMouseCursor * | CursorLoad (const FGMouseCursor *cur) |
| int | EnableBuffering (int mode) |
| int | Flip (void) |
| void | DisableBuffering (void) |
| ENUM_OS | GetOS (void) |
| void | ResetInputDevice (void) |
| void | LockInput (void) |
| void | UnlockInput (void) |
| virtual void | OnKeyPress (int) |
| virtual void | OnMouseMove (int, int) |
| virtual void | OnClick (int, int) |
| virtual void | OnDoubleClick (int, int) |
| virtual void | OnMiddleButton (int, int) |
| virtual void | OnContextPopup (int, int) |
| virtual void | OnWheel (int x, int y, int delta) |
| virtual void | OnStartDrag (int, int, int) |
| virtual void | OnEndDrag (int, int, int, int, int) |
| virtual void | OnCursorOut (int) |
| virtual bool | OnIdle (void) |
| virtual void | OnTimer (int secs) |
| virtual void | OnTabSwitch (const char *) |
Static Public Member Functions | |
| static FGWindow * | GetCurrentWindow (void) |
| static void | SaveScreen (void) |
| static void | DisableCtrlBreak (void) |
| static void | SetWindowMoveStyle (int a) |
| static void __fastcall | SendToApp (FGEvent *x) |
| static void | AppDone (void) |
| static void | AppClose (void) |
| static FGWindow * | GetRootWindow (void) |
| static int | GetMouseX (void) |
| static int | GetMouseY (void) |
| static bool | IsShift (void) |
| static bool | IsCtrl (void) |
| static bool | IsAlt (void) |
| static void | set_mmx (void) |
| static void | reset_mmx (void) |
| static int | test_mmx (void) |
| static void | SetCaption (char *new_name) |
| static void | GetDragVector (int &x, int &y, int &w, int &h) |
| static void | SetDragShape (void(*a)(int, int, int, int)=0) |
| static void | SetRepeatDelay (int c1, int c2) |
| static void | SetInputDevice (FGInputDevice *idev) |
Static Public Attributes | |
| static const FGMouseCursor * | __fg_cursor = idc_normal |
| static int | flags |
| static int | video |
| static int | background |
| static int | Argc |
| static char ** | Argv |
| static char * | name |
| static char * | homedir = 0 |
| static char | currdir [pathsize] |
| static int | ttf_support = 0 |
Static Protected Member Functions | |
| static void | SetCurrentWindow (FGWindow *novy) |
| static void | RemoveIterator (FGWindow *wnd) |
| static FGWindowIterator | GetIterator (FGWindow *Colise) |
| static FGWindowRIterator | GetRIterator (FGWindow *Colise) |
| static FGWindow * | WindowFind (FGEvent *e) |
| static FGWindow * | GetLastWindow (void) |
| static FGWindow * | WindowFind (int idw) |
| static void __fastcall | intersect (FGWindow *This, int, int, int, int) |
| static __fastcall int | _over (int, int, int, int, int xx, int yy, int ww, int hh) |
| static FGWindow * | OverSprite (FGWindowRIterator This, FGWindowRIterator _od, int x, int y, int w, int h) |
| static FGWindow *__fastcall | OdkryteOkno (FGWindowRIterator This, FGWindowRIterator pokial, int x, int y, int w, int h) |
| static void __fastcall | DestroyWindow (void) |
| static int | NumberOfWindow (void) |
| static void | AddWindowToList (FGWindow *wnd, int where) |
|
||||||||||||||||||||||||
|
Construct the instance of applicaton object. There is allowed only one instantion per process only. The following steps are executed at the constructor time:
AppFlags values - should be OR-ed together:
|
|
|
This is called when the application terminates. It performs the following steps:
|
|
||||||||||||
|
add Window to the list, where = { FRONT, BACK }
|
|
|
Close the inner most FGApp loop only. |
|
|
Call this methods, for example, from menu item "EXIT". When it is once called, it will causes jump out of the main application loop - return from Run().
|
|
|
Load & set the new mouse pointer. |
|
|
internal |
|
|
Disable video buffering and release the used video memory. |
|
|
By default, after <CTRL+C> hitting application normally shutdowns. You can switch this behaviour on/off by single calling this method. |
|
|
Enable drawing into the off-screen video RAM. This feature is intended for flickerless full screen animation. Parameter mode is one of these predefined: enum { FG_DOUBLEBUFFER, FG_TRIPLEBUFFER, FG_QUADBUFFER }; More buffers may help for speed but is X-times memory hungry and not the all videocards supports it. On exit, return number of true allocated buffers (0 if error). You can still use BUFFERING mode when function fail but screen will flicker - all drawing goes to the visible screen. |
|
|
Peeks the user input, translate to EVENT if any and push this EVENT to the event list. You can use this procedure to allowing mouse move when system is busy in your code and don't respond to user. By example, when some progressbar is running. |
|
|
Call this routine when all objects of the scene are drawn. The buffer will be showed at the next screen vertical retrace. Return 0 if fail - no buffering is allowed/initialized. |
|
|
Test keyboard immediately. Try peek any KEY from the INPUT and return 0 if none, or its keycode. |
|
|
Returns current focussed FGWindow if any.
|
|
||||||||||||||||||||
|
Set variables with actual data. It is dependent on the app flag APP_MAGNIFIFIER.
|
|
|
Returns current mouse coordinate in X axis.
|
|
|
Returns current mouse coordinate in Y axis.
|
|
|
Return current Operating system code. Code is one from these OS types. |
|
|
Returns pointer to the ROOT window or 0 if one is not initialized. Be sure before using this function, that you add switch APP_ROOTWINDOW to the FGApp constructor else program will be aborted. You can draw using this pointer with standard window stuff (WindowLine (), WindowText () etc.) NOTE: You can't use any Controls into this window, it is only for drawing! You can initialize one in FGApp constructor time by passing APP_ROOTWINDOW as flags.
|
|
||||||||||||||||||||||||
|
params are real size & position of cleared window
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||||||||||||
|
Called from WindowRepaint() for the window overlap testing.
|
|
||||||||||||
|
overload this member when you want catch the click on left mouse's button event.
|
|
||||||||||||
|
overload this member when you want catch the click on right mouse's button event.
|
|
|
overload this member when you want catch the cursor arrives screen boundary.
|
|
||||||||||||
|
overload this member when you want catch the double click on left mouse's button event.
|
|
||||||||||||||||||||||||
|
overload this member when you want catch the end of mouse drag.
|
|
|
The wrapper for an application idle proc.
|
|
|
overload this member when you want catch any keypress event.
|
|
||||||||||||
|
overload this member when you want catch the click on middle mouse's button event.
|
|
||||||||||||
|
overload this member when you want catch any mousemove event.
|
|
||||||||||||||||
|
overload this member when you want catch the start of mouse drag.
|
|
|
override this member when you want to handle the TabPage switch
|
|
|
The wrapper for application timer proc.
|
|
||||||||||||||||
|
overload this member when you want catch the mouses wheel spin.
|
|
||||||||||||||||||||||||||||
|
Test overlaping window, called from OdkryteOkno only.
|
|
|
Hide mouse pointer if needed. |
|
|
When you create the instance of the FGApp class and you sets callback for "DelayProc" , it is a right time to call the main application loop. System starts processing the user input (keyboard & mouse) until you call AppDone(). The mouse's movements are automatically convert to move its pointer at the screen and you don't care about it. When you press left button at the FGControl (by example FGPushButton), system detects it, and sends right event to the appropriate window. When you press button on an empty area of the window, this one will get event CLICKLEFTEVENT. This events are send to the application procedure, when one is defined.
|
|
|
Run modal this FGWindow until closed or any FGControl.
|
|
|
Save the whole screen to the image file in the current directory, name is created as current time in HEX form. This function is called by application automagically when you press PRINT_SCREEN key. |
|
|
When you define the application procedure also, you can send to this procedure any event by this method. |
|
|
Set caption when application running in windowed mode (X11 or WIN32 GDI).
|
|
|
Set the procedure that will be call many times per second when application will be idle. When the system is waiting to user input, it waits into inner loop. Because this time, I add to the library little hack. You can define some very little bit of code, procedure that will be called many times per second. Call with parameter 0 to switch this feature off.
|
|
|
Set procedure that will be called when you drag&drop to draw out dragging object. This procedures has four argument x,y for position in the current window and offset_y, offset_x are current offset from [x,y]. To restore default, use with argument 0. For more see the RAD project - source rad_prj.cpp. |
|
||||||||||||
|
Use this for fine calibration for HOLD_EVENT event. |
|
||||||||||||
|
This is another call-back procedure that will be call per each 't' msec. Your user-defined procedure expects one int parameter - number of second from the start of your program. Call with parameter 0 switch this feature off. NOTE! resolution is cca. 20ms
|
|
|
To change window drawing when WindowMove event is performed.
|
|
|
Redraw mouse pointer unconditionally. |
|
|
try support of MMX for your CPU
|
|
|
Redraw mouse pointer if needed. |
|
|
Finds the FGWindow by ID.
|
|
|
Returns the FGWindow for that the events has been emited.
|
|
|
Standard C 'argc' on startup.
|
|
|
Standard C 'argv' on startup.
|
|
|
The color of application background.
|
|
|
The application's starts directory.
|
|
|
Internal flags.
|
|
|
Home directory (e.g. '/home/user' or '/root' ).
|
|
|
Name of the application exefile.
|
|
|
true/false if TrueType fonts are supported.
|
|
|
Videomode number that is used for application.
|
1.4.0