[DEV] finish port for IOs and MacOs
This commit is contained in:
parent
b6c3c9c58a
commit
3d34dd3565
@ -7,12 +7,12 @@
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#include "ewol/context/IOs/Interface.h"
|
||||
#include "gale/context/IOs/Interface.h"
|
||||
|
||||
#import <ewol/context/IOs/OpenglView.h>
|
||||
#import <ewol/context/IOs/AppDelegate.h>
|
||||
#include <ewol/context/IOs/Context.h>
|
||||
#include <ewol/debug.h>
|
||||
#import <gale/context/IOs/OpenglView.h>
|
||||
#import <gale/context/IOs/AppDelegate.h>
|
||||
#include <gale/context/IOs/Context.h>
|
||||
#include <gale/debug.h>
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
@ -33,8 +33,8 @@
|
||||
glView.contentMode = UIViewContentModeRedraw;
|
||||
[window addSubview:glView];
|
||||
[window makeKeyAndVisible];
|
||||
// Create interface of ewol here ....
|
||||
NSLog(@"CREATE EWOL interface creation\n");
|
||||
// Create interface of gale here ....
|
||||
NSLog(@"CREATE GALE interface creation\n");
|
||||
IOs::createInterface();
|
||||
IOs::resize(currentSize.width, currentSize.height);
|
||||
IOs::start();
|
||||
@ -50,7 +50,7 @@
|
||||
- (void)applicationWillResignActive:(UIApplication *)application {
|
||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||
EWOL_INFO("move windows in applicationWillResignActive");
|
||||
GALE_INFO("move windows in applicationWillResignActive");
|
||||
[glView speedSlow];
|
||||
IOs::background();
|
||||
}
|
||||
@ -58,29 +58,29 @@
|
||||
- (void)applicationDidEnterBackground:(UIApplication *)application {
|
||||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
EWOL_INFO("move windows in applicationDidEnterBackground");
|
||||
GALE_INFO("move windows in applicationDidEnterBackground");
|
||||
[glView stopDisplayLink];
|
||||
IOs::suspend();
|
||||
}
|
||||
|
||||
- (void)applicationWillEnterForeground:(UIApplication *)application {
|
||||
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
||||
EWOL_INFO("move windows in applicationWillEnterForeground");
|
||||
GALE_INFO("move windows in applicationWillEnterForeground");
|
||||
IOs::resume();
|
||||
[glView startDisplayLink];
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application {
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
EWOL_INFO("move windows in applicationDidBecomeActive");
|
||||
GALE_INFO("move windows in applicationDidBecomeActive");
|
||||
[glView speedNormal];
|
||||
IOs::foreground();
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(UIApplication *)application {
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
// Create interface of ewol here ....
|
||||
EWOL_INFO("move windows in applicationWillTerminate");
|
||||
// Create interface of gale here ....
|
||||
GALE_INFO("move windows in applicationWillTerminate");
|
||||
IOs::stop();
|
||||
IOs::releaseInterface();
|
||||
}
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <gale/context/commandLine.h>
|
||||
#include <etk/types.h>
|
||||
#include <etk/os/FSNode.h>
|
||||
#include <gale/widget/Manager.h>
|
||||
|
||||
#include <gale/resource/Manager.h>
|
||||
#include <gale/context/Context.h>
|
||||
@ -99,7 +98,7 @@ public:
|
||||
_id,
|
||||
vec2(_x, _y));
|
||||
}
|
||||
void MAC_SetKeyboard(gale::key::Special _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey) {
|
||||
void MAC_SetKeyboard(gale::key::Special _special, int32_t _unichar, bool _isDown, bool _isARepeateKey) {
|
||||
if (_unichar == u32char::Delete) {
|
||||
_unichar = u32char::Suppress;
|
||||
} else if (_unichar == u32char::Suppress) {
|
||||
@ -113,24 +112,24 @@ public:
|
||||
enum gale::key::keyboard move;
|
||||
switch(_unichar) {
|
||||
case 0:
|
||||
move = gale::key::keyboardUp;
|
||||
move = gale::key::keyboard_up;
|
||||
break;
|
||||
case 1:
|
||||
move = gale::key::keyboardDown;
|
||||
move = gale::key::keyboard_down;
|
||||
break;
|
||||
case 2:
|
||||
move = gale::key::keyboardLeft;
|
||||
move = gale::key::keyboard_left;
|
||||
break;
|
||||
case 3:
|
||||
move = gale::key::keyboardRight;
|
||||
move = gale::key::keyboard_right;
|
||||
break;
|
||||
}
|
||||
OS_setKeyboard(_keyboardMode,
|
||||
OS_setKeyboard(_special,
|
||||
move,
|
||||
(_isDown==false?gale::key::status_down:gale::key::status_up),
|
||||
_isARepeateKey);
|
||||
} else {
|
||||
OS_setKeyboard(_keyboardMode,
|
||||
OS_setKeyboard(_special,
|
||||
gale::key::keyboard_char,
|
||||
(_isDown==false?gale::key::status_down:gale::key::status_up),
|
||||
_isARepeateKey,
|
||||
@ -140,7 +139,7 @@ public:
|
||||
void MAC_SetKeyboardMove(gale::key::Special& _special,
|
||||
enum gale::key::keyboard _move,
|
||||
bool _isDown) {
|
||||
OS_setKeyboard(_keyboardMode,
|
||||
OS_setKeyboard(_special,
|
||||
_move,
|
||||
(_isDown==true?gale::key::status_down:gale::key::status_up));
|
||||
}
|
||||
@ -197,18 +196,18 @@ void IOs::setInputMotion(int32_t _id, float _x, float _y) {
|
||||
interface->MAC_SetInputMotion(_id, _x, _y);
|
||||
}
|
||||
|
||||
void IOs::setKeyboard(gale::key::Special _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey) {
|
||||
void IOs::setKeyboard(gale::key::Special _special, int32_t _unichar, bool _isDown, bool _isARepeateKey) {
|
||||
if (interface == nullptr) {
|
||||
return;
|
||||
}
|
||||
interface->MAC_SetKeyboard(_keyboardMode, _unichar, _isDown, _isAReapeateKey);
|
||||
interface->MAC_SetKeyboard(_special, _unichar, _isDown, _isARepeateKey);
|
||||
}
|
||||
|
||||
void IOs::setKeyboardMove(gale::key::Special& _keyboardMode, enum gale::key::keyboard _move, bool _isDown) {
|
||||
void IOs::setKeyboardMove(gale::key::Special& _special, enum gale::key::keyboard _move, bool _isDown) {
|
||||
if (interface == nullptr) {
|
||||
return;
|
||||
}
|
||||
interface->MAC_SetKeyboardMove(_keyboardMode, _move, _isDown);
|
||||
interface->MAC_SetKeyboardMove(_special, _move, _isDown);
|
||||
}
|
||||
|
||||
void IOs::start() {
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <ewol/context/IOs/AppDelegate.h>
|
||||
#import <gale/context/IOs/AppDelegate.h>
|
||||
//#import "AppDelegate.h"
|
||||
|
||||
|
||||
|
@ -7,15 +7,15 @@
|
||||
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
#import <OpenGLES/EAGLDrawable.h>
|
||||
#include <ewol/context/IOs/Context.h>
|
||||
#include <ewol/Dimension.h>
|
||||
#include <gale/context/IOs/Context.h>
|
||||
#include <gale/Dimension.h>
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#import "OpenglView.h"
|
||||
#include <ewol/debug.h>
|
||||
#include <gale/debug.h>
|
||||
|
||||
|
||||
@interface OpenglView ()
|
||||
@ -123,7 +123,7 @@
|
||||
}
|
||||
|
||||
- (void)setNeedsDisplay {
|
||||
EWOL_INFO("**** setNeedsDisplay:" << vec2(self.frame.size.width, self.frame.size.height));
|
||||
GALE_INFO("**** setNeedsDisplay:" << vec2(self.frame.size.width, self.frame.size.height));
|
||||
// TODO : SIZE change ...
|
||||
|
||||
}
|
||||
@ -133,13 +133,13 @@
|
||||
m_currentSize = CGSizeMake(screenBounds.size.width * screenScale, screenBounds.size.height * screenScale);
|
||||
//self.frame.size = m_currentSize;
|
||||
|
||||
EWOL_INFO("**** screen size:" << vec2(m_currentSize.width, m_currentSize.height));
|
||||
GALE_INFO("**** screen size:" << vec2(m_currentSize.width, m_currentSize.height));
|
||||
float ratio = [self getScreenPPP];
|
||||
EWOL_INFO("**** pixel ratio: " << ratio);
|
||||
ewol::Dimension::setPixelRatio(vec2(1.0f/ratio, 1.0f/ratio), ewol::Dimension::Inch);
|
||||
GALE_INFO("**** pixel ratio: " << ratio);
|
||||
gale::Dimension::setPixelRatio(vec2(1.0f/ratio, 1.0f/ratio), gale::Dimension::Inch);
|
||||
IOs::resize(m_currentSize.width, m_currentSize.height);
|
||||
CGRect localBounds = [self bounds];
|
||||
EWOL_INFO("**** localBounds:" << vec2(localBounds.size.width, localBounds.size.height));
|
||||
GALE_INFO("**** localBounds:" << vec2(localBounds.size.width, localBounds.size.height));
|
||||
|
||||
}
|
||||
- (void)setupLayer {
|
||||
@ -243,7 +243,7 @@
|
||||
CGRect localBounds = [self bounds];
|
||||
CGFloat screenScale = [[UIScreen mainScreen] scale];
|
||||
vec2 positionEvent(touchLocation.x*screenScale, (localBounds.size.height - touchLocation.y)*screenScale);
|
||||
EWOL_DEBUG(touches.count << " touchesBegan: " << positionEvent);
|
||||
GALE_DEBUG(touches.count << " touchesBegan: " << positionEvent);
|
||||
IOs::setInputState(1, true, positionEvent.x(), positionEvent.y());
|
||||
}
|
||||
|
||||
@ -253,7 +253,7 @@
|
||||
CGRect localBounds = [self bounds];
|
||||
CGFloat screenScale = [[UIScreen mainScreen] scale];
|
||||
vec2 positionEvent(touchLocation.x*screenScale, (localBounds.size.height - touchLocation.y)*screenScale);
|
||||
EWOL_DEBUG(touches.count << " touchesEnded: " << positionEvent);
|
||||
GALE_DEBUG(touches.count << " touchesEnded: " << positionEvent);
|
||||
IOs::setInputState(1, false, positionEvent.x(), positionEvent.y());
|
||||
}
|
||||
|
||||
@ -263,7 +263,7 @@
|
||||
CGRect localBounds = [self bounds];
|
||||
CGFloat screenScale = [[UIScreen mainScreen] scale];
|
||||
vec2 positionEvent(touchLocation.x*screenScale, (localBounds.size.height - touchLocation.y)*screenScale);
|
||||
EWOL_DEBUG(touches.count << " touchesMoved: " << positionEvent);
|
||||
GALE_DEBUG(touches.count << " touchesMoved: " << positionEvent);
|
||||
IOs::setInputMotion(1, positionEvent.x(), positionEvent.y());
|
||||
}
|
||||
|
||||
|
@ -7,10 +7,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#import <ewol/context/MacOs/AppDelegate.h>
|
||||
#import <ewol/context/MacOs/OpenglView.h>
|
||||
#import <gale/context/MacOs/AppDelegate.h>
|
||||
#import <gale/context/MacOs/OpenglView.h>
|
||||
|
||||
#include <ewol/debug.h>
|
||||
#include <gale/debug.h>
|
||||
|
||||
@implementation MacOsAppDelegate
|
||||
@synthesize window=_window;
|
||||
@ -25,7 +25,7 @@
|
||||
Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||
*/
|
||||
EWOL_INFO("move windows in applicationWillResignActive");
|
||||
GALE_INFO("move windows in applicationWillResignActive");
|
||||
}
|
||||
|
||||
- (void)applicationDidEnterBackground:(MacOsAppDelegate *)application {
|
||||
@ -33,21 +33,21 @@
|
||||
Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
*/
|
||||
EWOL_INFO("move windows in applicationDidEnterBackground");
|
||||
GALE_INFO("move windows in applicationDidEnterBackground");
|
||||
}
|
||||
|
||||
- (void)applicationWillEnterForeground:(MacOsAppDelegate *)application {
|
||||
/*
|
||||
Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
||||
*/
|
||||
EWOL_INFO("move windows in applicationWillEnterForeground");
|
||||
GALE_INFO("move windows in applicationWillEnterForeground");
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(MacOsAppDelegate *)application {
|
||||
/*
|
||||
Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
*/
|
||||
EWOL_INFO("move windows in applicationDidBecomeActive");
|
||||
GALE_INFO("move windows in applicationDidBecomeActive");
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(MacOsAppDelegate *)application {
|
||||
@ -56,7 +56,7 @@
|
||||
Save data if appropriate.
|
||||
See also applicationDidEnterBackground:.
|
||||
*/
|
||||
EWOL_INFO("move windows in applicationWillTerminate");
|
||||
GALE_INFO("move windows in applicationWillTerminate");
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
@ -66,7 +66,7 @@
|
||||
|
||||
|
||||
- (void)sendEvent:(NSEvent *)event {
|
||||
EWOL_WARNING(" EVENT ... ");
|
||||
GALE_WARNING(" EVENT ... ");
|
||||
}
|
||||
|
||||
|
||||
|
@ -24,7 +24,9 @@ namespace MacOs {
|
||||
void setKeyboard(gale::key::Special _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey);
|
||||
void setKeyboardMove(gale::key::Special& _keyboardMode, enum gale::key::keyboard _move, bool _isDown, bool _isAReapeateKey);
|
||||
void stopRequested();
|
||||
/*
|
||||
void setRedrawCallback(const std::function<void()>& _func);
|
||||
*/
|
||||
};
|
||||
|
||||
#endif
|
@ -7,20 +7,19 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/key/key.h>
|
||||
#include <ewol/context/commandLine.h>
|
||||
#include <ewol/context/clipBoard.h>
|
||||
#include <gale/debug.h>
|
||||
#include <gale/gale.h>
|
||||
#include <gale/key/key.h>
|
||||
#include <gale/context/commandLine.h>
|
||||
#include <gale/context/clipBoard.h>
|
||||
#include <etk/types.h>
|
||||
#include <etk/os/FSNode.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
#include <ewol/resource/Manager.h>
|
||||
#include <ewol/context/Context.h>
|
||||
#include <gale/resource/Manager.h>
|
||||
#include <gale/context/Context.h>
|
||||
|
||||
#include <ewol/context/MacOs/Interface.h>
|
||||
#include <ewol/context/MacOs/Context.h>
|
||||
#include <gale/context/MacOs/Interface.h>
|
||||
#include <gale/context/MacOs/Context.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@ -34,7 +33,7 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int64_t ewol::getTime() {
|
||||
int64_t gale::getTime() {
|
||||
struct timespec now;
|
||||
clock_serv_t cclock;
|
||||
mach_timespec_t mts;
|
||||
@ -43,7 +42,7 @@ int64_t ewol::getTime() {
|
||||
mach_port_deallocate(mach_task_self(), cclock);
|
||||
now.tv_sec = mts.tv_sec;
|
||||
now.tv_nsec = mts.tv_nsec;
|
||||
//EWOL_VERBOSE("current time : " << now.tv_sec << "s " << now.tv_usec << "us");
|
||||
//GALE_VERBOSE("current time : " << now.tv_sec << "s " << now.tv_usec << "us");
|
||||
return (int64_t)((int64_t)now.tv_sec*(int64_t)1000000 + (int64_t)now.tv_nsec/(int64_t)1000);
|
||||
}
|
||||
|
||||
@ -52,12 +51,12 @@ int64_t ewol::getTime() {
|
||||
|
||||
|
||||
|
||||
class MacOSInterface : public ewol::Context {
|
||||
class MacOSInterface : public gale::Context {
|
||||
private:
|
||||
ewol::key::Special m_guiKeyBoardMode;
|
||||
gale::key::Special m_guiKeyBoardMode;
|
||||
public:
|
||||
MacOSInterface(ewol::context::Application* _application, int _argc, const char* _argv[]) :
|
||||
ewol::Context(_application, _argc, _argv) {
|
||||
MacOSInterface(gale::Application* _application, int _argc, const char* _argv[]) :
|
||||
gale::Context(_application, _argc, _argv) {
|
||||
mm_main(_argc, _argv);
|
||||
}
|
||||
|
||||
@ -85,7 +84,7 @@ class MacOSInterface : public ewol::Context {
|
||||
_id,
|
||||
vec2(_x, _y));
|
||||
}
|
||||
void MAC_SetKeyboard(ewol::key::Special _special, int32_t _unichar, bool _isDown, bool _isAReapeateKey) {
|
||||
void MAC_SetKeyboard(gale::key::Special _special, int32_t _unichar, bool _isDown, bool _isAReapeateKey) {
|
||||
if (char32_t(_unichar) == u32char::Delete) {
|
||||
_unichar = u32char::Suppress;
|
||||
} else if (char32_t(_unichar) == u32char::Suppress) {
|
||||
@ -94,21 +93,21 @@ class MacOSInterface : public ewol::Context {
|
||||
if (char32_t(_unichar) == u32char::CarrierReturn) {
|
||||
_unichar = u32char::Return;
|
||||
}
|
||||
//EWOL_DEBUG("key: " << _unichar << " up=" << !_isDown);
|
||||
//GALE_DEBUG("key: " << _unichar << " up=" << !_isDown);
|
||||
if (_unichar <= 4) {
|
||||
enum ewol::key::keyboard move;
|
||||
enum gale::key::keyboard move;
|
||||
switch(_unichar) {
|
||||
case 0:
|
||||
move = ewol::key::keyboardUp;
|
||||
move = gale::key::keyboard_up;
|
||||
break;
|
||||
case 1:
|
||||
move = ewol::key::keyboardDown;
|
||||
move = gale::key::keyboard_down;
|
||||
break;
|
||||
case 2:
|
||||
move = ewol::key::keyboardLeft;
|
||||
move = gale::key::keyboard_left;
|
||||
break;
|
||||
case 3:
|
||||
move = ewol::key::keyboardRight;
|
||||
move = gale::key::keyboard_right;
|
||||
break;
|
||||
}
|
||||
OS_setKeyboard(_special, move, (_isDown==false?gale::key::status_down:gale::key::status_up), _isAReapeateKey);
|
||||
@ -116,8 +115,8 @@ class MacOSInterface : public ewol::Context {
|
||||
OS_setKeyboard(_special, gale::key::keyboard_char, (_isDown==false?gale::key::status_down:gale::key::status_up), _isAReapeateKey, _unichar);
|
||||
}
|
||||
}
|
||||
void MAC_SetKeyboardMove(ewol::key::Special& _special,
|
||||
enum ewol::key::keyboard _move,
|
||||
void MAC_SetKeyboardMove(gale::key::Special& _special,
|
||||
enum gale::key::keyboard _move,
|
||||
bool _isDown,
|
||||
bool _isAReapeateKey) {
|
||||
OS_setKeyboard(_special, _move, (_isDown==true?gale::key::status_down:gale::key::status_up), _isAReapeateKey);
|
||||
@ -132,31 +131,31 @@ class MacOSInterface : public ewol::Context {
|
||||
void stop() {
|
||||
mm_stopApplication();
|
||||
}
|
||||
void clipBoardGet(enum ewol::context::clipBoard::clipboardListe _clipboardID) {
|
||||
if (_clipboardID == ewol::context::clipBoard::clipboardStd) {
|
||||
void clipBoardGet(enum gale::context::clipBoard::clipboardListe _clipboardID) {
|
||||
if (_clipboardID == gale::context::clipBoard::clipboardStd) {
|
||||
NSPasteboard* myPasteboard = [NSPasteboard generalPasteboard];
|
||||
NSString* myString = [myPasteboard stringForType:NSPasteboardTypeString];
|
||||
std::string val([myString UTF8String]);
|
||||
ewol::context::clipBoard::setSystem(_clipboardID, val);
|
||||
gale::context::clipBoard::setSystem(_clipboardID, val);
|
||||
if (val.size() != 0) {
|
||||
OS_ClipBoardArrive(_clipboardID);
|
||||
}
|
||||
} else {
|
||||
ewol::Context::clipBoardGet(_clipboardID);
|
||||
gale::Context::clipBoardGet(_clipboardID);
|
||||
}
|
||||
}
|
||||
void clipBoardSet(enum ewol::context::clipBoard::clipboardListe _clipboardID) {
|
||||
if (_clipboardID == ewol::context::clipBoard::clipboardStd) {
|
||||
void clipBoardSet(enum gale::context::clipBoard::clipboardListe _clipboardID) {
|
||||
if (_clipboardID == gale::context::clipBoard::clipboardStd) {
|
||||
NSPasteboard* myPasteboard = [NSPasteboard generalPasteboard];
|
||||
[myPasteboard clearContents];
|
||||
//EWOL_ERROR(" copy: " << ewol::context::clipBoard::get(_clipboardID));
|
||||
NSString *text = [[NSString alloc] initWithUTF8String:ewol::context::clipBoard::get(_clipboardID).c_str()];
|
||||
//GALE_ERROR(" copy: " << gale::context::clipBoard::get(_clipboardID));
|
||||
NSString *text = [[NSString alloc] initWithUTF8String:gale::context::clipBoard::get(_clipboardID).c_str()];
|
||||
BOOL err = [myPasteboard setString:text forType:NSPasteboardTypeString];
|
||||
if (err == FALSE) {
|
||||
EWOL_ERROR("copy to clipboard can not be done ...");
|
||||
GALE_ERROR("copy to clipboard can not be done ...");
|
||||
}
|
||||
} else {
|
||||
ewol::Context::clipBoardSet(_clipboardID);
|
||||
gale::Context::clipBoardSet(_clipboardID);
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,14 +195,14 @@ void MacOs::setMouseMotion(int32_t _id, float _x, float _y) {
|
||||
interface->MAC_SetMouseMotion(_id, _x, _y);
|
||||
}
|
||||
|
||||
void MacOs::setKeyboard(ewol::key::Special _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey) {
|
||||
void MacOs::setKeyboard(gale::key::Special _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey) {
|
||||
if (interface == nullptr) {
|
||||
return;
|
||||
}
|
||||
interface->MAC_SetKeyboard(_keyboardMode, _unichar, _isDown, _isAReapeateKey);
|
||||
}
|
||||
|
||||
void MacOs::setKeyboardMove(ewol::key::Special& _keyboardMode, enum ewol::key::keyboard _move, bool _isDown, bool _isAReapeateKey) {
|
||||
void MacOs::setKeyboardMove(gale::key::Special& _keyboardMode, enum gale::key::keyboard _move, bool _isDown, bool _isAReapeateKey) {
|
||||
if (interface == nullptr) {
|
||||
return;
|
||||
}
|
||||
@ -216,29 +215,29 @@ void MacOs::stopRequested() {
|
||||
}
|
||||
interface->MAC_Stop();
|
||||
}
|
||||
|
||||
/*
|
||||
void MacOs::setRedrawCallback(const std::function<void()>& _func) {
|
||||
if (interface == nullptr) {
|
||||
return;
|
||||
}
|
||||
interface->getWidgetManager().setCallbackonRedrawNeeded(_func);
|
||||
}
|
||||
|
||||
*/
|
||||
/**
|
||||
* @brief Main of the program
|
||||
* @param std IO
|
||||
* @return std IO
|
||||
*/
|
||||
int ewol::run(ewol::context::Application* _application, int _argc, const char* _argv[]) {
|
||||
int gale::run(gale::Application* _application, int _argc, const char* _argv[]) {
|
||||
etk::init(_argc, _argv);
|
||||
interface = new MacOSInterface(_application, _argc, _argv);
|
||||
if (nullptr == interface) {
|
||||
EWOL_CRITICAL("Can not create the X11 interface ... MEMORY allocation error");
|
||||
GALE_CRITICAL("Can not create the X11 interface ... MEMORY allocation error");
|
||||
return -2;
|
||||
}
|
||||
|
||||
int32_t retValue = interface->Run();
|
||||
EWOL_INFO("Stop running");
|
||||
GALE_INFO("Stop running");
|
||||
delete(interface);
|
||||
interface = nullptr;
|
||||
return retValue;
|
||||
|
@ -7,17 +7,17 @@
|
||||
*/
|
||||
#include "Context.h"
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#include "ewol/context/MacOs/Interface.h"
|
||||
#include "gale/context/MacOs/Interface.h"
|
||||
|
||||
#import <ewol/context/MacOs/OpenglView.h>
|
||||
#import <ewol/context/MacOs/Windows.h>
|
||||
#import <ewol/context/MacOs/AppDelegate.h>
|
||||
#import <ewol/debug.h>
|
||||
#import <gale/context/MacOs/OpenglView.h>
|
||||
#import <gale/context/MacOs/Windows.h>
|
||||
#import <gale/context/MacOs/AppDelegate.h>
|
||||
#import <gale/debug.h>
|
||||
|
||||
id window = nil;
|
||||
|
||||
void callbackSomeThingToDo() {
|
||||
//EWOL_CRITICAL("ksdjlkqjsdlfkjsqdlkfjslqkdjflqksjdf");
|
||||
//GALE_CRITICAL("ksdjlkqjsdlfkjsqdlkfjslqkdjflqksjdf");
|
||||
[window UpdateScreenRequested];
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ int mm_main(int _argc, const char* _argv[]) {
|
||||
// -- basic windows creation :
|
||||
// ---------------------------------------------------------------
|
||||
// create a windows of size 800/600
|
||||
window = [ [ [EwolMainWindows alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600)
|
||||
window = [ [ [GaleMainWindows alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600)
|
||||
styleMask:(NSTitledWindowMask|NSMiniaturizableWindowMask|NSClosableWindowMask) backing:NSBackingStoreBuffered defer:NO]
|
||||
autorelease];
|
||||
[window setAcceptsMouseMovedEvents:YES];
|
||||
@ -90,15 +90,15 @@ int mm_main(int _argc, const char* _argv[]) {
|
||||
int mm_run(void) {
|
||||
//MacOs::setRedrawCallback(std::bind(callbackSomeThingToDo));
|
||||
[NSApp run];
|
||||
EWOL_DEBUG("END of application");
|
||||
GALE_DEBUG("END of application");
|
||||
// return no error
|
||||
return 0;
|
||||
}
|
||||
|
||||
void mm_stopApplication() {
|
||||
EWOL_DEBUG("NSApp terminate start.");
|
||||
[window closeRequestEwol];
|
||||
GALE_DEBUG("NSApp terminate start.");
|
||||
[window closeRequestGale];
|
||||
[NSApp stop:nil];
|
||||
EWOL_DEBUG("NSApp terminate done");
|
||||
GALE_DEBUG("NSApp terminate done");
|
||||
}
|
||||
|
||||
|
@ -7,18 +7,18 @@
|
||||
*/
|
||||
|
||||
|
||||
#import <ewol/context/MacOs/OpenglView.h>
|
||||
#import <gale/context/MacOs/OpenglView.h>
|
||||
#include <OpenGL/gl.h>
|
||||
#include <ewol/context/MacOS/Context.h>
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/Dimension.h>
|
||||
#include <gale/context/MacOS/Context.h>
|
||||
#include <gale/debug.h>
|
||||
#include <gale/Dimension.h>
|
||||
|
||||
|
||||
@implementation OpenGLView
|
||||
|
||||
|
||||
- (void) prepareOpenGL {
|
||||
EWOL_INFO("prepare");
|
||||
GALE_INFO("prepare");
|
||||
GLint swapInt = 1;
|
||||
[[self openGLContext] setValues:&swapInt forParameter:NSOpenGLCPSwapInterval];
|
||||
// set system dpi size :
|
||||
@ -27,9 +27,9 @@
|
||||
NSSize displayPixelSize = [[description objectForKey:NSDeviceSize] sizeValue];
|
||||
CGSize displayPhysicalSize = CGDisplayScreenSize([[description objectForKey:@"NSScreenNumber"] unsignedIntValue]);
|
||||
|
||||
ewol::Dimension::setPixelRatio(vec2((float)displayPixelSize.width/(float)displayPhysicalSize.width,
|
||||
gale::Dimension::setPixelRatio(vec2((float)displayPixelSize.width/(float)displayPhysicalSize.width,
|
||||
(float)displayPixelSize.height/(float)displayPhysicalSize.height),
|
||||
ewol::Dimension::Millimeter);
|
||||
gale::Dimension::Millimeter);
|
||||
_refreshTimer=[ [ NSTimer scheduledTimerWithTimeInterval:0.017 target:self selector:@selector(animationTimerFired:) userInfo:nil repeats:YES ] retain ] ;
|
||||
_redraw = true;
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
-(void) drawRect: (NSRect) bounds {
|
||||
if ( ! _refreshTimer ) {
|
||||
_refreshTimer=[ [ NSTimer scheduledTimerWithTimeInterval:0.017 target:self selector:@selector(animationTimerFired:) userInfo:nil repeats:YES ] retain ] ;
|
||||
EWOL_WARNING("create timer ... ");
|
||||
GALE_WARNING("create timer ... ");
|
||||
}
|
||||
MacOs::draw(false);
|
||||
}
|
||||
@ -53,12 +53,12 @@
|
||||
if (_redraw == true) {
|
||||
//_redraw = false;
|
||||
[self setNeedsDisplay:YES];
|
||||
//EWOL_WARNING("view refresh ..." );
|
||||
//GALE_WARNING("view refresh ..." );
|
||||
}
|
||||
}
|
||||
|
||||
-(void)reshape {
|
||||
EWOL_INFO("view reshape (" << [self frame].size.width << "," << [self frame].size.height << ")" );
|
||||
GALE_INFO("view reshape (" << [self frame].size.width << "," << [self frame].size.height << ")" );
|
||||
// window resize; width and height are in pixel coordinates
|
||||
// but they are floats
|
||||
float width = [self frame].size.width;
|
||||
|
@ -7,17 +7,17 @@
|
||||
*/
|
||||
|
||||
|
||||
#import <ewol/context/MacOs/Windows.h>
|
||||
#include <ewol/context/MacOS/Context.h>
|
||||
#include <ewol/key/key.h>
|
||||
#import <gale/context/MacOs/Windows.h>
|
||||
#include <gale/context/MacOS/Context.h>
|
||||
#include <gale/key/key.h>
|
||||
|
||||
#include <ewol/debug.h>
|
||||
#include <gale/debug.h>
|
||||
|
||||
@implementation EwolMainWindows
|
||||
@implementation GaleMainWindows
|
||||
|
||||
+ (id)alloc {
|
||||
id windowsID = [super alloc];
|
||||
EWOL_DEBUG("ALLOCATE ...");
|
||||
GALE_DEBUG("ALLOCATE ...");
|
||||
return windowsID;
|
||||
}
|
||||
|
||||
@ -26,37 +26,37 @@
|
||||
|
||||
//[NSApp setDelegate: self];
|
||||
|
||||
EWOL_DEBUG("INIT ...");
|
||||
GALE_DEBUG("INIT ...");
|
||||
// set the windows at a specific position :
|
||||
[windowsID cascadeTopLeftFromPoint:NSMakePoint(50,50)];
|
||||
EWOL_DEBUG("ALLOCATE ...");
|
||||
GALE_DEBUG("ALLOCATE ...");
|
||||
// set the windows resizable
|
||||
[windowsID setStyleMask:[windowsID styleMask] | NSResizableWindowMask];
|
||||
EWOL_DEBUG("ALLOCATE ...");
|
||||
GALE_DEBUG("ALLOCATE ...");
|
||||
// oposite : [window setStyleMask:[window styleMask] & ~NSResizableWindowMask];
|
||||
// set the title
|
||||
id appName = [[NSProcessInfo processInfo] processName];
|
||||
EWOL_DEBUG("ALLOCATE ...");
|
||||
GALE_DEBUG("ALLOCATE ...");
|
||||
[windowsID setTitle:appName];
|
||||
EWOL_DEBUG("ALLOCATE ...");
|
||||
GALE_DEBUG("ALLOCATE ...");
|
||||
|
||||
[windowsID setAcceptsMouseMovedEvents:YES];
|
||||
EWOL_DEBUG("ALLOCATE ...");
|
||||
GALE_DEBUG("ALLOCATE ...");
|
||||
// ???
|
||||
[windowsID makeKeyAndOrderFront:nil];
|
||||
EWOL_DEBUG("ALLOCATE ...");
|
||||
GALE_DEBUG("ALLOCATE ...");
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
EWOL_DEBUG("ALLOCATE ...");
|
||||
GALE_DEBUG("ALLOCATE ...");
|
||||
|
||||
NSRect window_frame = [windowsID frame];
|
||||
EWOL_DEBUG("ALLOCATE ...");
|
||||
GALE_DEBUG("ALLOCATE ...");
|
||||
|
||||
_view=[[OpenGLView alloc]initWithFrame:window_frame]; //NSMakeRect(0, 0, 800, 600)];
|
||||
EWOL_DEBUG("ALLOCATE ...");
|
||||
GALE_DEBUG("ALLOCATE ...");
|
||||
[windowsID setContentView:_view];
|
||||
EWOL_DEBUG("ALLOCATE ...");
|
||||
GALE_DEBUG("ALLOCATE ...");
|
||||
[_view setAutoresizesSubviews:YES];
|
||||
EWOL_DEBUG("ALLOCATE ...");
|
||||
GALE_DEBUG("ALLOCATE ...");
|
||||
|
||||
// Override point for customization after application launch.
|
||||
//[window addSubview:view];
|
||||
@ -64,22 +64,22 @@
|
||||
//[window makeKeyAndVisible];
|
||||
|
||||
//[windowsID setDelegate:view];
|
||||
EWOL_DEBUG("ALLOCATE ...");
|
||||
GALE_DEBUG("ALLOCATE ...");
|
||||
return windowsID;
|
||||
}
|
||||
|
||||
|
||||
+ (void)dealloc {
|
||||
EWOL_ERROR("FREE ...");
|
||||
GALE_ERROR("FREE ...");
|
||||
//[_window release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
+ (void)performClose:(id)sender {
|
||||
EWOL_ERROR("perform close ...");
|
||||
GALE_ERROR("perform close ...");
|
||||
}
|
||||
|
||||
static ewol::key::Special guiKeyBoardMode;
|
||||
static gale::key::Special guiKeyBoardMode;
|
||||
|
||||
|
||||
-(void)localKeyEvent:(NSEvent*)theEvent isDown:(bool)_isDown {
|
||||
@ -90,25 +90,25 @@ static ewol::key::Special guiKeyBoardMode;
|
||||
NSString *str = [theEvent charactersIgnoringModifiers];
|
||||
// TODO : set if for every char in the string !!!
|
||||
unichar c = [str characterAtIndex:0];
|
||||
EWOL_VERBOSE("Key Event " << c << " = '" << char(c) << "' isDown=" << _isDown);
|
||||
GALE_VERBOSE("Key Event " << c << " = '" << char(c) << "' isDown=" << _isDown);
|
||||
bool find = true;
|
||||
enum ewol::key::keyboard keyInput;
|
||||
enum gale::key::keyboard keyInput;
|
||||
switch (c) {
|
||||
case 63232: keyInput = ewol::key::keyboardUp; break;
|
||||
case 63233: keyInput = ewol::key::keyboardDown; break;
|
||||
case 63234: keyInput = ewol::key::keyboardLeft; break;
|
||||
case 63235: keyInput = ewol::key::keyboardRight; break;
|
||||
case 63276: keyInput = ewol::key::keyboardPageUp; break;
|
||||
case 63277: keyInput = ewol::key::keyboardPageDown; break;
|
||||
case 63273: keyInput = ewol::key::keyboardStart; break;
|
||||
case 63275: keyInput = ewol::key::keyboardEnd; break;
|
||||
case 63232: keyInput = gale::key::keyboard_up; break;
|
||||
case 63233: keyInput = gale::key::keyboard_down; break;
|
||||
case 63234: keyInput = gale::key::keyboard_left; break;
|
||||
case 63235: keyInput = gale::key::keyboard_right; break;
|
||||
case 63276: keyInput = gale::key::keyboard_pageUp; break;
|
||||
case 63277: keyInput = gale::key::keyboard_pageDown; break;
|
||||
case 63273: keyInput = gale::key::keyboard_start; break;
|
||||
case 63275: keyInput = gale::key::keyboard_end; break;
|
||||
/*
|
||||
case 78: keyInput = ewol::key::keyboardStopDefil; break;
|
||||
case 127: keyInput = ewol::key::keyboardWait; break;
|
||||
case 78: keyInput = gale::key::keyboard_stopDefil; break;
|
||||
case 127: keyInput = gale::key::keyboard_wait; break;
|
||||
*/
|
||||
case 63302:
|
||||
find = false;
|
||||
keyInput = ewol::key::keyboardInsert;
|
||||
keyInput = gale::key::keyboard_insert;
|
||||
if(_isDown == false) {
|
||||
if (true == guiKeyBoardMode.getInsert()) {
|
||||
guiKeyBoardMode.setInsert(false);
|
||||
@ -116,24 +116,24 @@ static ewol::key::Special guiKeyBoardMode;
|
||||
guiKeyBoardMode.setInsert(true);
|
||||
}
|
||||
}
|
||||
EWOL_VERBOSE("Key Event " << c << " = '" << char(c) << "' isDown=" << _isDown);
|
||||
GALE_VERBOSE("Key Event " << c << " = '" << char(c) << "' isDown=" << _isDown);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, keyInput, true, thisIsAReapeateKey);
|
||||
EWOL_VERBOSE("Key Event " << c << " = '" << char(c) << "' isDown=" << !_isDown);
|
||||
GALE_VERBOSE("Key Event " << c << " = '" << char(c) << "' isDown=" << !_isDown);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, keyInput, false, thisIsAReapeateKey);
|
||||
break;
|
||||
//case 84: keyInput = ewol::key::keyboardCenter; break; // Keypad
|
||||
case 63236: keyInput = ewol::key::keyboardF1; break;
|
||||
case 63237: keyInput = ewol::key::keyboardF2; break;
|
||||
case 63238: keyInput = ewol::key::keyboardF3; break;
|
||||
case 63239: keyInput = ewol::key::keyboardF4; break;
|
||||
case 63240: keyInput = ewol::key::keyboardF5; break;
|
||||
case 63241: keyInput = ewol::key::keyboardF6; break;
|
||||
case 63242: keyInput = ewol::key::keyboardF7; break;
|
||||
case 63243: keyInput = ewol::key::keyboardF8; break;
|
||||
case 63244: keyInput = ewol::key::keyboardF9; break;
|
||||
case 63245: keyInput = ewol::key::keyboardF10; break;
|
||||
case 63246: keyInput = ewol::key::keyboardF11; break;
|
||||
case 63247: keyInput = ewol::key::keyboardF12; break;
|
||||
//case 84: keyInput = gale::key::keyboardCenter; break; // Keypad
|
||||
case 63236: keyInput = gale::key::keyboard_f1; break;
|
||||
case 63237: keyInput = gale::key::keyboard_f2; break;
|
||||
case 63238: keyInput = gale::key::keyboard_f3; break;
|
||||
case 63239: keyInput = gale::key::keyboard_f4; break;
|
||||
case 63240: keyInput = gale::key::keyboard_f5; break;
|
||||
case 63241: keyInput = gale::key::keyboard_f6; break;
|
||||
case 63242: keyInput = gale::key::keyboard_f7; break;
|
||||
case 63243: keyInput = gale::key::keyboard_f8; break;
|
||||
case 63244: keyInput = gale::key::keyboard_f9; break;
|
||||
case 63245: keyInput = gale::key::keyboard_f10; break;
|
||||
case 63246: keyInput = gale::key::keyboard_f11; break;
|
||||
case 63247: keyInput = gale::key::keyboard_f12; break;
|
||||
case 63272: // Suppress
|
||||
find = false;
|
||||
MacOs::setKeyboard(guiKeyBoardMode, u32char::Delete, _isDown, thisIsAReapeateKey);
|
||||
@ -149,7 +149,7 @@ static ewol::key::Special guiKeyBoardMode;
|
||||
str = [theEvent characters];
|
||||
c = [str characterAtIndex:0];
|
||||
}
|
||||
EWOL_VERBOSE("Key Event " << c << " = '" << char(c) << "' isDown=" << _isDown);
|
||||
GALE_VERBOSE("Key Event " << c << " = '" << char(c) << "' isDown=" << _isDown);
|
||||
MacOs::setKeyboard(guiKeyBoardMode, c, _isDown, thisIsAReapeateKey);
|
||||
if (true==thisIsAReapeateKey) {
|
||||
MacOs::setKeyboard(guiKeyBoardMode, c, !_isDown, thisIsAReapeateKey);
|
||||
@ -158,7 +158,7 @@ static ewol::key::Special guiKeyBoardMode;
|
||||
break;
|
||||
}
|
||||
if (find == true) {
|
||||
EWOL_VERBOSE("eventKey Move type : " << keyInput );
|
||||
GALE_VERBOSE("eventKey Move type : " << keyInput );
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, keyInput, _isDown, thisIsAReapeateKey);
|
||||
if (true == thisIsAReapeateKey) {
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, keyInput, !_isDown, thisIsAReapeateKey);
|
||||
@ -177,93 +177,93 @@ static ewol::key::Special guiKeyBoardMode;
|
||||
|
||||
- (void)flagsChanged:(NSEvent *)theEvent {
|
||||
if (([theEvent modifierFlags] & NSAlphaShiftKeyMask) != 0) {
|
||||
EWOL_VERBOSE("NSAlphaShiftKeyMask");
|
||||
GALE_VERBOSE("NSAlphaShiftKeyMask");
|
||||
if (guiKeyBoardMode.getCapsLock() == false) {
|
||||
guiKeyBoardMode.setCapsLock(true);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardCapLock, true, false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, gale::key::keyboard_capLock, true, false);
|
||||
}
|
||||
} else {
|
||||
if (guiKeyBoardMode.getCapsLock() == true) {
|
||||
guiKeyBoardMode.setCapsLock(false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardCapLock, false, false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, gale::key::keyboard_capLock, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (([theEvent modifierFlags] & NSShiftKeyMask) != 0) {
|
||||
EWOL_VERBOSE("NSShiftKeyMask");
|
||||
GALE_VERBOSE("NSShiftKeyMask");
|
||||
if (guiKeyBoardMode.getShift() == false) {
|
||||
guiKeyBoardMode.setShift(true);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardShiftLeft, true, false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, gale::key::keyboard_shiftLeft, true, false);
|
||||
}
|
||||
} else {
|
||||
if (guiKeyBoardMode.getShift() == true) {
|
||||
guiKeyBoardMode.setShift(false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardShiftLeft, false, false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, gale::key::keyboard_shiftLeft, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (([theEvent modifierFlags] & NSControlKeyMask) != 0) {
|
||||
//EWOL_VERBOSE("NSControlKeyMask");
|
||||
//GALE_VERBOSE("NSControlKeyMask");
|
||||
if (guiKeyBoardMode.getCtrl() == false) {
|
||||
EWOL_VERBOSE("NSControlKeyMask DOWN");
|
||||
GALE_VERBOSE("NSControlKeyMask DOWN");
|
||||
guiKeyBoardMode.setCtrl(true);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardCtrlLeft, true, false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, gale::key::keyboard_ctrlLeft, true, false);
|
||||
}
|
||||
} else {
|
||||
if (guiKeyBoardMode.getCtrl() == true) {
|
||||
EWOL_VERBOSE("NSControlKeyMask UP");
|
||||
GALE_VERBOSE("NSControlKeyMask UP");
|
||||
guiKeyBoardMode.setCtrl(false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardCtrlLeft, false, false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, gale::key::keyboard_ctrlLeft, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (([theEvent modifierFlags] & NSAlternateKeyMask) != 0) {
|
||||
EWOL_VERBOSE("NSAlternateKeyMask");
|
||||
GALE_VERBOSE("NSAlternateKeyMask");
|
||||
if (guiKeyBoardMode.getAlt() == false) {
|
||||
guiKeyBoardMode.setAlt(true);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardAlt, true, false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, gale::key::keyboard_alt, true, false);
|
||||
}
|
||||
} else {
|
||||
if (guiKeyBoardMode.getAlt() == true) {
|
||||
guiKeyBoardMode.setAlt(false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardAlt, false, false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, gale::key::keyboard_alt, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (([theEvent modifierFlags] & NSCommandKeyMask) != 0) {
|
||||
EWOL_VERBOSE("NSCommandKeyMask");
|
||||
GALE_VERBOSE("NSCommandKeyMask");
|
||||
if (guiKeyBoardMode.getMeta() == false) {
|
||||
guiKeyBoardMode.setMeta(true);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardMetaLeft, true, false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, gale::key::keyboard_metaLeft, true, false);
|
||||
}
|
||||
} else {
|
||||
if (guiKeyBoardMode.getMeta() == true) {
|
||||
guiKeyBoardMode.setMeta(false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardMetaLeft, false, false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, gale::key::keyboard_metaLeft, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (([theEvent modifierFlags] & NSNumericPadKeyMask) != 0) {
|
||||
EWOL_VERBOSE("NSNumericPadKeyMask");
|
||||
GALE_VERBOSE("NSNumericPadKeyMask");
|
||||
if (guiKeyBoardMode.getNumLock() == false) {
|
||||
guiKeyBoardMode.setNumLock(true);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardNumLock, true, false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, gale::key::keyboard_numLock, true, false);
|
||||
}
|
||||
} else {
|
||||
if (guiKeyBoardMode.getNumLock() == true) {
|
||||
guiKeyBoardMode.setNumLock(false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardNumLock, false, false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, gale::key::keyboard_numLock, false, false);
|
||||
}
|
||||
}
|
||||
if (([theEvent modifierFlags] & NSHelpKeyMask) != 0) {
|
||||
EWOL_VERBOSE("NSHelpKeyMask");
|
||||
GALE_VERBOSE("NSHelpKeyMask");
|
||||
}
|
||||
if (([theEvent modifierFlags] & NSFunctionKeyMask) != 0) {
|
||||
EWOL_VERBOSE("NSFunctionKeyMask");
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardContextMenu, true, false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardContextMenu, false, false);
|
||||
GALE_VERBOSE("NSFunctionKeyMask");
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, gale::key::keyboard_contextMenu, true, false);
|
||||
MacOs::setKeyboardMove(guiKeyBoardMode, gale::key::keyboard_contextMenu, false, false);
|
||||
}
|
||||
EWOL_VERBOSE("EVENT : " << int32_t([theEvent modifierFlags]));
|
||||
GALE_VERBOSE("EVENT : " << int32_t([theEvent modifierFlags]));
|
||||
}
|
||||
|
||||
// this generate all the event entry availlable ==> like a big keep focus ...
|
||||
@ -276,46 +276,46 @@ static ewol::key::Special guiKeyBoardMode;
|
||||
|
||||
-(void)mouseMoved:(NSEvent *)event {
|
||||
NSPoint point = [event locationInWindow];
|
||||
EWOL_VERBOSE("mouseMoved : " << (float)point.x << " " << (float)point.y);
|
||||
GALE_VERBOSE("mouseMoved : " << (float)point.x << " " << (float)point.y);
|
||||
MacOs::setMouseMotion(0, point.x, point.y);
|
||||
}
|
||||
-(void)mouseEntered:(NSEvent *)event {
|
||||
NSPoint point = [event locationInWindow];
|
||||
EWOL_INFO("mouseEntered : " << (float)point.x << " " << (float)point.y);
|
||||
GALE_INFO("mouseEntered : " << (float)point.x << " " << (float)point.y);
|
||||
}
|
||||
-(void)mouseExited:(NSEvent *)event {
|
||||
NSPoint point = [event locationInWindow];
|
||||
EWOL_INFO("mouseExited : " << (float)point.x << " " << (float)point.y);
|
||||
GALE_INFO("mouseExited : " << (float)point.x << " " << (float)point.y);
|
||||
}
|
||||
|
||||
-(void)mouseDown:(NSEvent *)event {
|
||||
NSPoint point = [event locationInWindow];
|
||||
EWOL_VERBOSE("mouseDown : " << (float)point.x << " " << (float)point.y);
|
||||
GALE_VERBOSE("mouseDown : " << (float)point.x << " " << (float)point.y);
|
||||
MacOs::setMouseState(1, true, point.x, point.y);
|
||||
}
|
||||
-(void)mouseDragged:(NSEvent *)event {
|
||||
NSPoint point = [event locationInWindow];
|
||||
EWOL_VERBOSE("mouseDragged : " << (float)point.x << " " << (float)point.y);
|
||||
GALE_VERBOSE("mouseDragged : " << (float)point.x << " " << (float)point.y);
|
||||
MacOs::setMouseMotion(1, point.x, point.y);
|
||||
}
|
||||
-(void)mouseUp:(NSEvent *)event {
|
||||
NSPoint point = [event locationInWindow];
|
||||
EWOL_VERBOSE("mouseUp : " << (float)point.x << " " << (float)point.y);
|
||||
GALE_VERBOSE("mouseUp : " << (float)point.x << " " << (float)point.y);
|
||||
MacOs::setMouseState(1, false, point.x, point.y);
|
||||
}
|
||||
-(void)rightMouseDown:(NSEvent *)event {
|
||||
NSPoint point = [event locationInWindow];
|
||||
EWOL_VERBOSE("rightMouseDown : " << (float)point.x << " " << (float)point.y);
|
||||
GALE_VERBOSE("rightMouseDown : " << (float)point.x << " " << (float)point.y);
|
||||
MacOs::setMouseState(3, true, point.x, point.y);
|
||||
}
|
||||
-(void)rightMouseDragged:(NSEvent *)event {
|
||||
NSPoint point = [event locationInWindow];
|
||||
EWOL_VERBOSE("rightMouseDragged : " << (float)point.x << " " << (float)point.y);
|
||||
GALE_VERBOSE("rightMouseDragged : " << (float)point.x << " " << (float)point.y);
|
||||
MacOs::setMouseMotion(3, point.x, point.y);
|
||||
}
|
||||
-(void)rightMouseUp:(NSEvent *)event {
|
||||
NSPoint point = [event locationInWindow];
|
||||
EWOL_VERBOSE("rightMouseUp : " << (float)point.x << " " << (float)point.y);
|
||||
GALE_VERBOSE("rightMouseUp : " << (float)point.x << " " << (float)point.y);
|
||||
MacOs::setMouseState(3, false, point.x, point.y);
|
||||
}
|
||||
-(void)otherMouseDown:(NSEvent *)event {
|
||||
@ -344,7 +344,7 @@ static ewol::key::Special guiKeyBoardMode;
|
||||
btNumber = 15;
|
||||
break;
|
||||
}
|
||||
EWOL_VERBOSE("otherMouseDown : " << (float)point.x << " " << (float)point.y);
|
||||
GALE_VERBOSE("otherMouseDown : " << (float)point.x << " " << (float)point.y);
|
||||
MacOs::setMouseState(btNumber, true, point.x, point.y);
|
||||
}
|
||||
-(void)otherMouseDragged:(NSEvent *)event {
|
||||
@ -373,13 +373,13 @@ static ewol::key::Special guiKeyBoardMode;
|
||||
btNumber = 15;
|
||||
break;
|
||||
}
|
||||
EWOL_VERBOSE("otherMouseDragged : " << (float)point.x << " " << (float)point.y);
|
||||
GALE_VERBOSE("otherMouseDragged : " << (float)point.x << " " << (float)point.y);
|
||||
MacOs::setMouseMotion(btNumber, point.x, point.y);
|
||||
}
|
||||
-(void)otherMouseUp:(NSEvent *)event {
|
||||
NSPoint point = [event locationInWindow];
|
||||
int32_t btNumber = [event buttonNumber];
|
||||
EWOL_VERBOSE("otherMouseUp: id=" << btNumber );
|
||||
GALE_VERBOSE("otherMouseUp: id=" << btNumber );
|
||||
switch (btNumber) {
|
||||
case 2: // 2 : Middle button
|
||||
btNumber = 2;
|
||||
@ -403,12 +403,12 @@ static ewol::key::Special guiKeyBoardMode;
|
||||
btNumber = 15;
|
||||
break;
|
||||
}
|
||||
EWOL_VERBOSE("otherMouseUp : " << (float)point.x << " " << (float)point.y << " bt id=" << btNumber );
|
||||
GALE_VERBOSE("otherMouseUp : " << (float)point.x << " " << (float)point.y << " bt id=" << btNumber );
|
||||
MacOs::setMouseState(btNumber, false, point.x, point.y);
|
||||
}
|
||||
- (void)scrollWheel:(NSEvent *)event {
|
||||
NSPoint point = [event locationInWindow];
|
||||
EWOL_VERBOSE("scrollWheel : " << (float)point.x << " " << (float)point.y << " delta(" << (float)([event deltaX]) << "," << (float)([event deltaY]) << ")");
|
||||
GALE_VERBOSE("scrollWheel : " << (float)point.x << " " << (float)point.y << " delta(" << (float)([event deltaX]) << "," << (float)([event deltaY]) << ")");
|
||||
float deltaY = [event deltaY];
|
||||
int32_t idEvent = 4;
|
||||
if (deltaY < 0) {
|
||||
@ -423,14 +423,14 @@ static ewol::key::Special guiKeyBoardMode;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)closeRequestEwol {
|
||||
EWOL_VERBOSE("closeRequestEwol: BEGIN");
|
||||
- (void)closeRequestGale {
|
||||
GALE_VERBOSE("closeRequestGale: BEGIN");
|
||||
[super close];
|
||||
EWOL_VERBOSE("closeRequestEwol: END");
|
||||
GALE_VERBOSE("closeRequestGale: END");
|
||||
}
|
||||
|
||||
- (void)close {
|
||||
EWOL_VERBOSE("close:");
|
||||
GALE_VERBOSE("close:");
|
||||
MacOs::stopRequested();
|
||||
}
|
||||
|
||||
|
@ -252,9 +252,12 @@ void gale::openGL::clearDepth(float _value) {
|
||||
#ifdef GALE_SIMULATION_OPENGL_AVAILLABLE
|
||||
if (s_simulationMode == false) {
|
||||
#endif
|
||||
#if !(defined(__TARGET_OS__Android) || defined(__TARGET_OS__MacOs))
|
||||
#if !((defined(__TARGET_OS__Android) || defined(__TARGET_OS__IOs)))
|
||||
glClearDepth(_value);
|
||||
#endif
|
||||
#if defined(__TARGET_OS__IOs)
|
||||
glClearDepthf(_value);
|
||||
#endif
|
||||
#ifdef GALE_SIMULATION_OPENGL_AVAILLABLE
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user