[DEBUG] correct the help tag in cmdline
This commit is contained in:
parent
049a853387
commit
1b72284d26
@ -9,6 +9,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <etk/types.h>
|
#include <etk/types.h>
|
||||||
|
#include <etk/etk.h>
|
||||||
|
|
||||||
#include <etk/tool.h>
|
#include <etk/tool.h>
|
||||||
#include <etk/os/FSNode.h>
|
#include <etk/os/FSNode.h>
|
||||||
@ -329,7 +330,14 @@ ewol::Context::Context(ewol::context::Application* _application, int32_t _argc,
|
|||||||
m_displayFps=true;
|
m_displayFps=true;
|
||||||
} else if ( m_commandLine.get(iii) == "-h"
|
} else if ( m_commandLine.get(iii) == "-h"
|
||||||
|| m_commandLine.get(iii) == "--help") {
|
|| m_commandLine.get(iii) == "--help") {
|
||||||
// TODO ...
|
EWOL_PRINT("ewol - help : ");
|
||||||
|
EWOL_PRINT(" " << etk::getApplicationName() << " [options]");
|
||||||
|
EWOL_PRINT(" --ewol-fps: Display the current fps of the display");
|
||||||
|
EWOL_PRINT(" -h/--help: Display this help");
|
||||||
|
EWOL_PRINT(" example:");
|
||||||
|
EWOL_PRINT(" " << etk::getApplicationName() << " --ewol-fps");
|
||||||
|
// this is a global help system does not remove it
|
||||||
|
continue;
|
||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ namespace MacOs {
|
|||||||
void setKeyboard(ewol::key::Special _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey);
|
void setKeyboard(ewol::key::Special _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey);
|
||||||
void setKeyboardMove(ewol::key::Special& _keyboardMode, enum ewol::key::keyboard _move, bool _isDown, bool _isAReapeateKey);
|
void setKeyboardMove(ewol::key::Special& _keyboardMode, enum ewol::key::keyboard _move, bool _isDown, bool _isAReapeateKey);
|
||||||
void stopRequested();
|
void stopRequested();
|
||||||
|
void setRedrawCallback(const std::function<void()>& _func);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -211,6 +211,13 @@ void MacOs::stopRequested() {
|
|||||||
interface->MAC_Stop();
|
interface->MAC_Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacOs::setRedrawCallback(const std::function<void()>& _func) {
|
||||||
|
if (interface == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
interface->getWidgetManager().setCallbackonRedrawNeeded(_func);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Main of the program
|
* @brief Main of the program
|
||||||
* @param std IO
|
* @param std IO
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* @license APACHE v2.0 (see license file)
|
* @license APACHE v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
#include "Context.h"
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#include "ewol/context/MacOs/Interface.h"
|
#include "ewol/context/MacOs/Interface.h"
|
||||||
|
|
||||||
@ -16,6 +16,11 @@
|
|||||||
|
|
||||||
id window = nil;
|
id window = nil;
|
||||||
|
|
||||||
|
void callbackSomeThingToDo() {
|
||||||
|
//EWOL_CRITICAL("ksdjlkqjsdlfkjsqdlkfjslqkdjflqksjdf");
|
||||||
|
[window UpdateScreenRequested];
|
||||||
|
}
|
||||||
|
|
||||||
int mm_main(int _argc, const char* _argv[]) {
|
int mm_main(int _argc, const char* _argv[]) {
|
||||||
[NSAutoreleasePool new];
|
[NSAutoreleasePool new];
|
||||||
|
|
||||||
@ -74,23 +79,16 @@ int mm_main(int _argc, const char* _argv[]) {
|
|||||||
NSRect window_frame = [window frame];
|
NSRect window_frame = [window frame];
|
||||||
|
|
||||||
OpenGLView* view=[[OpenGLView alloc]initWithFrame:window_frame]; //NSMakeRect(0, 0, 800, 600)];
|
OpenGLView* view=[[OpenGLView alloc]initWithFrame:window_frame]; //NSMakeRect(0, 0, 800, 600)];
|
||||||
NSTrackingArea *track = [[NSTrackingArea alloc] initWithRect:window_frame options: NSTrackingMouseMoved | NSTrackingActiveWhenFirstResponder | NSTrackingActiveInKeyWindow
|
NSTrackingArea *track = [[NSTrackingArea alloc] initWithRect:window_frame options: NSTrackingMouseMoved | NSTrackingActiveWhenFirstResponder | NSTrackingActiveInKeyWindow
|
||||||
owner:window userInfo:nil];
|
owner:window userInfo:nil];
|
||||||
[view addTrackingArea:track];
|
[view addTrackingArea:track];
|
||||||
[window setContentView:view];
|
[window setContentView:view];
|
||||||
[view setAutoresizesSubviews:YES];
|
[view setAutoresizesSubviews:YES];
|
||||||
|
|
||||||
// Override point for customization after application launch.
|
|
||||||
//[window addSubview:view];
|
|
||||||
//[window addChildWindow:view];
|
|
||||||
//[window makeKeyAndVisible];
|
|
||||||
|
|
||||||
//[window setDelegate:view];
|
|
||||||
// return no error
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mm_run(void) {
|
int mm_run(void) {
|
||||||
|
//MacOs::setRedrawCallback(std::bind(callbackSomeThingToDo));
|
||||||
[NSApp run];
|
[NSApp run];
|
||||||
EWOL_DEBUG("END of application");
|
EWOL_DEBUG("END of application");
|
||||||
// return no error
|
// return no error
|
||||||
|
@ -13,7 +13,9 @@
|
|||||||
|
|
||||||
@interface OpenGLView : NSOpenGLView<NSWindowDelegate> {
|
@interface OpenGLView : NSOpenGLView<NSWindowDelegate> {
|
||||||
NSTimer* _refreshTimer;
|
NSTimer* _refreshTimer;
|
||||||
|
bool _redraw;
|
||||||
}
|
}
|
||||||
- (void)prepareOpenGL;
|
- (void)prepareOpenGL;
|
||||||
- (void)drawRect:(NSRect) bounds;
|
- (void)drawRect:(NSRect) bounds;
|
||||||
|
- (void)UpdateScreenRequested;
|
||||||
@end
|
@end
|
||||||
|
@ -30,13 +30,17 @@
|
|||||||
ewol::Dimension::setPixelRatio(vec2((float)displayPixelSize.width/(float)displayPhysicalSize.width,
|
ewol::Dimension::setPixelRatio(vec2((float)displayPixelSize.width/(float)displayPhysicalSize.width,
|
||||||
(float)displayPixelSize.height/(float)displayPhysicalSize.height),
|
(float)displayPixelSize.height/(float)displayPhysicalSize.height),
|
||||||
ewol::Dimension::Millimeter);
|
ewol::Dimension::Millimeter);
|
||||||
//_refreshTimer=[ [ NSTimer scheduledTimerWithTimeInterval:0.017 target:self selector:@selector(animationTimerFired:) userInfo:nil repeats:YES ] retain ] ;
|
_refreshTimer=[ [ NSTimer scheduledTimerWithTimeInterval:0.017 target:self selector:@selector(animationTimerFired:) userInfo:nil repeats:YES ] retain ] ;
|
||||||
|
_redraw = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
- (void)UpdateScreenRequested {
|
||||||
|
_redraw = true;
|
||||||
|
}
|
||||||
|
|
||||||
-(void) drawRect: (NSRect) bounds {
|
-(void) drawRect: (NSRect) bounds {
|
||||||
if ( ! _refreshTimer ) {
|
if ( ! _refreshTimer ) {
|
||||||
//_refreshTimer=[ [ NSTimer scheduledTimerWithTimeInterval:0.017 target:self selector:@selector(animationTimerFired:) userInfo:nil repeats:YES ] retain ] ;
|
_refreshTimer=[ [ NSTimer scheduledTimerWithTimeInterval:0.017 target:self selector:@selector(animationTimerFired:) userInfo:nil repeats:YES ] retain ] ;
|
||||||
EWOL_WARNING("create timer ... ");
|
EWOL_WARNING("create timer ... ");
|
||||||
}
|
}
|
||||||
MacOs::draw(false);
|
MacOs::draw(false);
|
||||||
@ -46,8 +50,11 @@
|
|||||||
* Service the animation timer.
|
* Service the animation timer.
|
||||||
*/
|
*/
|
||||||
- (void) animationTimerFired: (NSTimer *) timer {
|
- (void) animationTimerFired: (NSTimer *) timer {
|
||||||
[self setNeedsDisplay:YES];
|
if (_redraw == true) {
|
||||||
EWOL_WARNING("view refresh ..." );
|
//_redraw = false;
|
||||||
|
[self setNeedsDisplay:YES];
|
||||||
|
//EWOL_WARNING("view refresh ..." );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)reshape {
|
-(void)reshape {
|
||||||
|
@ -7,9 +7,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#import <ewol/context/MacOs/OpenglView.h>
|
||||||
|
|
||||||
@interface EwolMainWindows : NSWindow {
|
@interface EwolMainWindows : NSWindow {
|
||||||
|
OpenGLView* _view;
|
||||||
}
|
}
|
||||||
+ (id)alloc;
|
+ (id)alloc;
|
||||||
- (id)init;
|
- (id)init;
|
||||||
@ -32,6 +33,7 @@
|
|||||||
- (void)keyDown:(NSEvent *)theEvent;
|
- (void)keyDown:(NSEvent *)theEvent;
|
||||||
- (void)flagsChanged:(NSEvent *)theEvent;
|
- (void)flagsChanged:(NSEvent *)theEvent;
|
||||||
- (void)closeRequestEwol;
|
- (void)closeRequestEwol;
|
||||||
|
- (void)UpdateScreenRequested;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#import <ewol/context/MacOs/Windows.h>
|
#import <ewol/context/MacOs/Windows.h>
|
||||||
#import <ewol/context/MacOs/OpenglView.h>
|
|
||||||
#include <ewol/context/MacOS/Context.h>
|
#include <ewol/context/MacOS/Context.h>
|
||||||
#include <ewol/key/key.h>
|
#include <ewol/key/key.h>
|
||||||
|
|
||||||
@ -52,11 +51,11 @@
|
|||||||
NSRect window_frame = [windowsID frame];
|
NSRect window_frame = [windowsID frame];
|
||||||
EWOL_DEBUG("ALLOCATE ...");
|
EWOL_DEBUG("ALLOCATE ...");
|
||||||
|
|
||||||
OpenGLView* view=[[OpenGLView alloc]initWithFrame:window_frame]; //NSMakeRect(0, 0, 800, 600)];
|
_view=[[OpenGLView alloc]initWithFrame:window_frame]; //NSMakeRect(0, 0, 800, 600)];
|
||||||
EWOL_DEBUG("ALLOCATE ...");
|
EWOL_DEBUG("ALLOCATE ...");
|
||||||
[windowsID setContentView:view];
|
[windowsID setContentView:_view];
|
||||||
EWOL_DEBUG("ALLOCATE ...");
|
EWOL_DEBUG("ALLOCATE ...");
|
||||||
[view setAutoresizesSubviews:YES];
|
[_view setAutoresizesSubviews:YES];
|
||||||
EWOL_DEBUG("ALLOCATE ...");
|
EWOL_DEBUG("ALLOCATE ...");
|
||||||
|
|
||||||
// Override point for customization after application launch.
|
// Override point for customization after application launch.
|
||||||
@ -79,7 +78,6 @@
|
|||||||
+ (void)performClose:(id)sender {
|
+ (void)performClose:(id)sender {
|
||||||
EWOL_ERROR("perform close ...");
|
EWOL_ERROR("perform close ...");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static ewol::key::Special guiKeyBoardMode;
|
static ewol::key::Special guiKeyBoardMode;
|
||||||
|
|
||||||
@ -436,6 +434,9 @@ static ewol::key::Special guiKeyBoardMode;
|
|||||||
MacOs::stopRequested();
|
MacOs::stopRequested();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)UpdateScreenRequested {
|
||||||
|
[_view UpdateScreenRequested];
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@ -157,48 +157,18 @@ void ewol::widget::Manager::focusRemoveIfRemove(const std::shared_ptr<ewol::Widg
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
void ewol::widget::Manager::setCallbackonRedrawNeeded(const std::function<void()>& _func) {
|
||||||
void ewol::widget::Manager::periodicCall(int64_t _localTime) {
|
m_funcRedrawNeeded = _func;
|
||||||
int64_t previousTime = m_lastPeriodicCallTime;
|
|
||||||
m_lastPeriodicCallTime = _localTime;
|
|
||||||
if (m_listOfPeriodicWidget.size() <= 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
float deltaTime = (float)(_localTime - previousTime)/1000000.0;
|
|
||||||
|
|
||||||
ewol::event::Time myTime(_localTime, m_applWakeUpTime, deltaTime, deltaTime);
|
|
||||||
|
|
||||||
EWOL_VERBOSE("periodic : " << _localTime);
|
|
||||||
for (int32_t iii=m_listOfPeriodicWidget.size()-1; iii >= 0 ; iii--) {
|
|
||||||
auto tmpWidget = m_listOfPeriodicWidget[iii].lock();
|
|
||||||
if (nullptr != tmpWidget) {
|
|
||||||
int64_t deltaTimeCallUser = tmpWidget->systemGetCallDeltaTime();
|
|
||||||
if (deltaTimeCallUser <= 0) {
|
|
||||||
myTime.setDeltaCall(deltaTime);
|
|
||||||
EWOL_VERBOSE("[" << iii << "] periodic : " << myTime);
|
|
||||||
tmpWidget->systemSetLastCallTime(_localTime);
|
|
||||||
tmpWidget->periodicCall(myTime);
|
|
||||||
} else {
|
|
||||||
int64_t lastCallTime = tmpWidget->systemGetLastCallTime();
|
|
||||||
if (lastCallTime == 0) {
|
|
||||||
lastCallTime = _localTime;
|
|
||||||
}
|
|
||||||
float deltaLocalTime = (float)(_localTime-lastCallTime)/1000000.0;;
|
|
||||||
if (deltaLocalTime >= lastCallTime) {
|
|
||||||
myTime.setDeltaCall(deltaLocalTime);
|
|
||||||
EWOL_VERBOSE("[" << iii << "] periodic : " << myTime);
|
|
||||||
tmpWidget->systemSetLastCallTime(_localTime);
|
|
||||||
tmpWidget->periodicCall(myTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
void ewol::widget::Manager::markDrawingIsNeeded() {
|
void ewol::widget::Manager::markDrawingIsNeeded() {
|
||||||
|
if (m_haveRedraw == true) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
m_haveRedraw = true;
|
m_haveRedraw = true;
|
||||||
|
if (m_funcRedrawNeeded != nullptr) {
|
||||||
|
m_funcRedrawNeeded();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ewol::widget::Manager::isDrawingNeeded() {
|
bool ewol::widget::Manager::isDrawingNeeded() {
|
||||||
|
@ -36,9 +36,12 @@ namespace ewol {
|
|||||||
void focusRelease(); // release focus from the current widget to the default
|
void focusRelease(); // release focus from the current widget to the default
|
||||||
std::shared_ptr<ewol::Widget> focusGet();
|
std::shared_ptr<ewol::Widget> focusGet();
|
||||||
void focusRemoveIfRemove(const std::shared_ptr<ewol::Widget>& _newWidget);
|
void focusRemoveIfRemove(const std::shared_ptr<ewol::Widget>& _newWidget);
|
||||||
|
private:
|
||||||
|
std::function<void()> m_funcRedrawNeeded;
|
||||||
|
public:
|
||||||
void markDrawingIsNeeded();
|
void markDrawingIsNeeded();
|
||||||
bool isDrawingNeeded();
|
bool isDrawingNeeded();
|
||||||
|
void setCallbackonRedrawNeeded(const std::function<void()>& _func);
|
||||||
|
|
||||||
// element that generate the list of elements
|
// element that generate the list of elements
|
||||||
void addWidgetCreator(const std::string& _name, creator_tf _pointer);
|
void addWidgetCreator(const std::string& _name, creator_tf _pointer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user