[DEV] MacOs build
This commit is contained in:
parent
916c7f31a3
commit
5fae28a6ed
@ -7,8 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#import <ewol/renderer/MacOs/AppDelegate.h>
|
#import <ewol/context/MacOs/AppDelegate.h>
|
||||||
#import <ewol/renderer/MacOs/OpenglView.h>
|
#import <ewol/context/MacOs/OpenglView.h>
|
||||||
|
|
||||||
#include <ewol/debug.h>
|
#include <ewol/debug.h>
|
||||||
|
|
||||||
|
@ -9,18 +9,18 @@
|
|||||||
|
|
||||||
#include <ewol/debug.h>
|
#include <ewol/debug.h>
|
||||||
#include <ewol/ewol.h>
|
#include <ewol/ewol.h>
|
||||||
#include <ewol/key.h>
|
#include <ewol/key/key.h>
|
||||||
#include <ewol/commandLine.h>
|
#include <ewol/context/commandLine.h>
|
||||||
#include <etk/UString.h>
|
#include <etk/UString.h>
|
||||||
#include <etk/unicode.h>
|
#include <etk/unicode.h>
|
||||||
#include <etk/os/FSNode.h>
|
#include <etk/os/FSNode.h>
|
||||||
#include <ewol/widget/Manager.h>
|
#include <ewol/widget/Manager.h>
|
||||||
|
|
||||||
#include <ewol/resources/ResourceManager.h>
|
#include <ewol/resource/Manager.h>
|
||||||
#include <ewol/context/Context.h>
|
#include <ewol/context/Context.h>
|
||||||
|
|
||||||
#include <ewol/renderer/MacOs/Interface.h>
|
#include <ewol/context/MacOs/Interface.h>
|
||||||
#include <ewol/renderer/MacOs/Context.h>
|
#include <ewol/context/MacOs/Context.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -50,12 +50,12 @@ int64_t ewol::getTime(void) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MacOSInterface : public ewol::eContext {
|
class MacOSInterface : public ewol::Context {
|
||||||
private:
|
private:
|
||||||
ewol::SpecialKey m_guiKeyBoardMode;
|
ewol::key::Special m_guiKeyBoardMode;
|
||||||
public:
|
public:
|
||||||
MacOSInterface(int32_t _argc, const char* _argv[]) :
|
MacOSInterface(int32_t _argc, const char* _argv[]) :
|
||||||
ewol::eContext(_argc, _argv) {
|
ewol::Context(_argc, _argv) {
|
||||||
mm_main(_argc, _argv);
|
mm_main(_argc, _argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ class MacOSInterface : public ewol::eContext {
|
|||||||
void MAC_SetMouseMotion(int32_t _id, float _x, float _y) {
|
void MAC_SetMouseMotion(int32_t _id, float _x, float _y) {
|
||||||
OS_SetMouseMotion(_id, vec2(_x, _y));
|
OS_SetMouseMotion(_id, vec2(_x, _y));
|
||||||
}
|
}
|
||||||
void MAC_SetKeyboard(ewol::SpecialKey _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey) {
|
void MAC_SetKeyboard(ewol::key::Special _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey) {
|
||||||
if (_unichar == etk::UChar::Delete) {
|
if (_unichar == etk::UChar::Delete) {
|
||||||
_unichar = etk::UChar::Suppress;
|
_unichar = etk::UChar::Suppress;
|
||||||
} else if (_unichar == etk::UChar::Suppress) {
|
} else if (_unichar == etk::UChar::Suppress) {
|
||||||
@ -108,7 +108,7 @@ class MacOSInterface : public ewol::eContext {
|
|||||||
OS_SetKeyboard(_keyboardMode, _unichar, !_isDown, _isAReapeateKey);
|
OS_SetKeyboard(_keyboardMode, _unichar, !_isDown, _isAReapeateKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void MAC_SetKeyboardMove(ewol::SpecialKey& _special,
|
void MAC_SetKeyboardMove(ewol::key::Special& _special,
|
||||||
enum ewol::key::keyboard _move,
|
enum ewol::key::keyboard _move,
|
||||||
bool _isDown) {
|
bool _isDown) {
|
||||||
OS_SetKeyboardMove(_special, _move, _isDown);
|
OS_SetKeyboardMove(_special, _move, _isDown);
|
||||||
@ -149,14 +149,14 @@ void MacOs::setMouseMotion(int32_t _id, float _x, float _y) {
|
|||||||
interface->MAC_SetMouseMotion(_id, _x, _y);
|
interface->MAC_SetMouseMotion(_id, _x, _y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacOs::setKeyboard(ewol::SpecialKey _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey) {
|
void MacOs::setKeyboard(ewol::key::Special _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey) {
|
||||||
if (interface == NULL) {
|
if (interface == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
interface->MAC_SetKeyboard(_keyboardMode, _unichar, _isDown, _isAReapeateKey);
|
interface->MAC_SetKeyboard(_keyboardMode, _unichar, _isDown, _isAReapeateKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacOs::setKeyboardMove(ewol::SpecialKey& _keyboardMode, enum ewol::key::keyboard _move, bool _isDown) {
|
void MacOs::setKeyboardMove(ewol::key::Special& _keyboardMode, enum ewol::key::keyboard _move, bool _isDown) {
|
||||||
if (interface == NULL) {
|
if (interface == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#ifndef __MAC_OS_CONTEXT_H__
|
#ifndef __MAC_OS_CONTEXT_H__
|
||||||
#define __MAC_OS_CONTEXT_H__
|
#define __MAC_OS_CONTEXT_H__
|
||||||
|
|
||||||
#include <ewol/key.h>
|
#include <ewol/key/key.h>
|
||||||
|
|
||||||
namespace MacOs {
|
namespace MacOs {
|
||||||
// return true if a flush is needed
|
// return true if a flush is needed
|
||||||
@ -21,8 +21,8 @@ namespace MacOs {
|
|||||||
void resize(float _x, float _y);
|
void resize(float _x, float _y);
|
||||||
void setMouseState(int32_t _id, bool _isDown, float _x, float _y);
|
void setMouseState(int32_t _id, bool _isDown, float _x, float _y);
|
||||||
void setMouseMotion(int32_t _id, float _x, float _y);
|
void setMouseMotion(int32_t _id, float _x, float _y);
|
||||||
void setKeyboard(ewol::SpecialKey _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey);
|
void setKeyboard(ewol::key::Special _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey);
|
||||||
void setKeyboardMove(ewol::SpecialKey& _keyboardMode, enum ewol::key::keyboard _move, bool _isDown);
|
void setKeyboardMove(ewol::key::Special& _keyboardMode, enum ewol::key::keyboard _move, bool _isDown);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -7,10 +7,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#include "ewol/renderer/MacOs/Interface.h"
|
#include "ewol/context/MacOs/Interface.h"
|
||||||
|
|
||||||
#import <ewol/renderer/MacOs/OpenglView.h>
|
#import <ewol/context/MacOs/OpenglView.h>
|
||||||
#import <ewol/renderer/MacOs/AppDelegate.h>
|
#import <ewol/context/MacOs/AppDelegate.h>
|
||||||
|
|
||||||
int mm_main(int argc, const char *argv[]) {
|
int mm_main(int argc, const char *argv[]) {
|
||||||
[NSAutoreleasePool new];
|
[NSAutoreleasePool new];
|
||||||
|
@ -7,15 +7,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#import <ewol/renderer/MacOs/OpenglView.h>
|
#import <ewol/context/MacOs/OpenglView.h>
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
#include <ewol/renderer/MacOS/Context.h>
|
#include <ewol/context/MacOS/Context.h>
|
||||||
#include <ewol/debug.h>
|
#include <ewol/debug.h>
|
||||||
#include <ewol/Dimension.h>
|
#include <ewol/Dimension.h>
|
||||||
|
|
||||||
@implementation OpenGLView
|
@implementation OpenGLView
|
||||||
|
|
||||||
static ewol::SpecialKey guiKeyBoardMode;
|
static ewol::key::Special guiKeyBoardMode;
|
||||||
|
|
||||||
- (void) prepareOpenGL
|
- (void) prepareOpenGL
|
||||||
{
|
{
|
||||||
@ -29,7 +29,7 @@ static ewol::SpecialKey guiKeyBoardMode;
|
|||||||
NSSize displayPixelSize = [[description objectForKey:NSDeviceSize] sizeValue];
|
NSSize displayPixelSize = [[description objectForKey:NSDeviceSize] sizeValue];
|
||||||
CGSize displayPhysicalSize = CGDisplayScreenSize([[description objectForKey:@"NSScreenNumber"] unsignedIntValue]);
|
CGSize displayPhysicalSize = CGDisplayScreenSize([[description objectForKey:@"NSScreenNumber"] unsignedIntValue]);
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
@ -245,79 +245,79 @@ static ewol::SpecialKey guiKeyBoardMode;
|
|||||||
|
|
||||||
if (([theEvent modifierFlags] & NSAlphaShiftKeyMask) != 0) {
|
if (([theEvent modifierFlags] & NSAlphaShiftKeyMask) != 0) {
|
||||||
EWOL_DEBUG("NSAlphaShiftKeyMask");
|
EWOL_DEBUG("NSAlphaShiftKeyMask");
|
||||||
if (guiKeyBoardMode.capLock == 0) {
|
if (guiKeyBoardMode.getCapsLock() == false) {
|
||||||
guiKeyBoardMode.capLock = 1;
|
guiKeyBoardMode.setCapsLock(true);
|
||||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::keyEvent::keyboardCapLock, true);
|
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardCapLock, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (guiKeyBoardMode.capLock == 1) {
|
if (guiKeyBoardMode.getCapsLock() == true) {
|
||||||
guiKeyBoardMode.capLock = 0;
|
guiKeyBoardMode.setCapsLock(false);
|
||||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::keyEvent::keyboardCapLock, false);
|
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardCapLock, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (([theEvent modifierFlags] & NSShiftKeyMask) != 0) {
|
if (([theEvent modifierFlags] & NSShiftKeyMask) != 0) {
|
||||||
EWOL_DEBUG("NSShiftKeyMask");
|
EWOL_DEBUG("NSShiftKeyMask");
|
||||||
if (guiKeyBoardMode.shift == 0) {
|
if (guiKeyBoardMode.getShift() == false) {
|
||||||
guiKeyBoardMode.shift = 1;
|
guiKeyBoardMode.setShift(true);
|
||||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::keyEvent::keyboardShiftLeft, true);
|
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardShiftLeft, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (guiKeyBoardMode.shift == 1) {
|
if (guiKeyBoardMode.getShift() == true) {
|
||||||
guiKeyBoardMode.shift = 0;
|
guiKeyBoardMode.setShift(false);
|
||||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::keyEvent::keyboardShiftLeft, false);
|
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardShiftLeft, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (([theEvent modifierFlags] & NSControlKeyMask) != 0) {
|
if (([theEvent modifierFlags] & NSControlKeyMask) != 0) {
|
||||||
EWOL_DEBUG("NSControlKeyMask");
|
EWOL_DEBUG("NSControlKeyMask");
|
||||||
if (guiKeyBoardMode.ctrl == 0) {
|
if (guiKeyBoardMode.getCtrl() == false) {
|
||||||
guiKeyBoardMode.ctrl = 1;
|
guiKeyBoardMode.setCtrl(true);
|
||||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::keyEvent::keyboardCtrlLeft, true);
|
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardCtrlLeft, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (guiKeyBoardMode.ctrl == 1) {
|
if (guiKeyBoardMode.getCtrl() == true) {
|
||||||
guiKeyBoardMode.ctrl = 0;
|
guiKeyBoardMode.setCtrl(false);
|
||||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::keyEvent::keyboardCtrlLeft, false);
|
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardCtrlLeft, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (([theEvent modifierFlags] & NSAlternateKeyMask) != 0) {
|
if (([theEvent modifierFlags] & NSAlternateKeyMask) != 0) {
|
||||||
EWOL_DEBUG("NSAlternateKeyMask");
|
EWOL_DEBUG("NSAlternateKeyMask");
|
||||||
if (guiKeyBoardMode.alt == 0) {
|
if (guiKeyBoardMode.getAlt() == false) {
|
||||||
guiKeyBoardMode.alt = 1;
|
guiKeyBoardMode.setAlt(true);
|
||||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::keyEvent::keyboardAlt, true);
|
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardAlt, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (guiKeyBoardMode.alt == 1) {
|
if (guiKeyBoardMode.getAlt() == true) {
|
||||||
guiKeyBoardMode.alt = 0;
|
guiKeyBoardMode.setAlt(false);
|
||||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::keyEvent::keyboardAlt, false);
|
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardAlt, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (([theEvent modifierFlags] & NSCommandKeyMask) != 0) {
|
if (([theEvent modifierFlags] & NSCommandKeyMask) != 0) {
|
||||||
EWOL_DEBUG("NSCommandKeyMask");
|
EWOL_DEBUG("NSCommandKeyMask");
|
||||||
if (guiKeyBoardMode.meta == 0) {
|
if (guiKeyBoardMode.getMeta() == false) {
|
||||||
guiKeyBoardMode.meta = 1;
|
guiKeyBoardMode.setMeta(true);
|
||||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::keyEvent::keyboardMetaLeft, true);
|
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardMetaLeft, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (guiKeyBoardMode.meta == 1) {
|
if (guiKeyBoardMode.getMeta() == true) {
|
||||||
guiKeyBoardMode.meta = 0;
|
guiKeyBoardMode.setMeta(false);
|
||||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::keyEvent::keyboardMetaLeft, false);
|
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardMetaLeft, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (([theEvent modifierFlags] & NSNumericPadKeyMask) != 0) {
|
if (([theEvent modifierFlags] & NSNumericPadKeyMask) != 0) {
|
||||||
EWOL_DEBUG("NSNumericPadKeyMask");
|
EWOL_DEBUG("NSNumericPadKeyMask");
|
||||||
if (guiKeyBoardMode.numLock == 0) {
|
if (guiKeyBoardMode.getNumLock() == false) {
|
||||||
guiKeyBoardMode.numLock = 1;
|
guiKeyBoardMode.setNumLock(true);
|
||||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::keyEvent::keyboardNumLock, true);
|
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardNumLock, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (guiKeyBoardMode.numLock == 1) {
|
if (guiKeyBoardMode.getNumLock() == true) {
|
||||||
guiKeyBoardMode.numLock = 0;
|
guiKeyBoardMode.setNumLock(false);
|
||||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::keyEvent::keyboardNumLock, false);
|
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardNumLock, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (([theEvent modifierFlags] & NSHelpKeyMask) != 0) {
|
if (([theEvent modifierFlags] & NSHelpKeyMask) != 0) {
|
||||||
@ -325,8 +325,8 @@ static ewol::SpecialKey guiKeyBoardMode;
|
|||||||
}
|
}
|
||||||
if (([theEvent modifierFlags] & NSFunctionKeyMask) != 0) {
|
if (([theEvent modifierFlags] & NSFunctionKeyMask) != 0) {
|
||||||
EWOL_DEBUG("NSFunctionKeyMask");
|
EWOL_DEBUG("NSFunctionKeyMask");
|
||||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::keyEvent::keyboardContextMenu, true);
|
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardContextMenu, true);
|
||||||
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::keyEvent::keyboardContextMenu, false);
|
MacOs::setKeyboardMove(guiKeyBoardMode, ewol::key::keyboardContextMenu, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
testApplDirectMinimal
Executable file
BIN
testApplDirectMinimal
Executable file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user