[DEV] mac work again but not ended anymore
This commit is contained in:
parent
21f0a6856a
commit
5ca92a90cb
2
external/etk
vendored
2
external/etk
vendored
@ -1 +1 @@
|
|||||||
Subproject commit bb085be53d88d727686a5e23aa7c3e2cb2caf7f5
|
Subproject commit 1826eb6fd917c330ecabbfb7333a509044673964
|
@ -7,8 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#import <ewol/renderer/os/gui.MacOs.AppDelegate.h>
|
#import <ewol/renderer/MacOs/AppDelegate.h>
|
||||||
#import <ewol/renderer/os/gui.MacOs.OpenglView.h>
|
#import <ewol/renderer/MacOs/OpenglView.h>
|
||||||
|
|
||||||
@implementation MacOsAppDelegate
|
@implementation MacOsAppDelegate
|
||||||
|
|
||||||
|
@ -10,15 +10,17 @@
|
|||||||
#include <ewol/debug.h>
|
#include <ewol/debug.h>
|
||||||
#include <ewol/ewol.h>
|
#include <ewol/ewol.h>
|
||||||
#include <ewol/key.h>
|
#include <ewol/key.h>
|
||||||
#include <ewol/config.h>
|
|
||||||
#include <ewol/commandLine.h>
|
#include <ewol/commandLine.h>
|
||||||
#include <etk/UString.h>
|
#include <etk/UString.h>
|
||||||
#include <etk/unicode.h>
|
#include <etk/unicode.h>
|
||||||
|
#include <etk/os/FSNode.h>
|
||||||
#include <ewol/widget/WidgetManager.h>
|
#include <ewol/widget/WidgetManager.h>
|
||||||
|
|
||||||
#include <ewol/renderer/ResourceManager.h>
|
#include <ewol/resources/ResourceManager.h>
|
||||||
#include <ewol/renderer/eSystem.h>
|
#include <ewol/renderer/eContext.h>
|
||||||
|
|
||||||
|
#include <ewol/renderer/MacOs/Interface.h>
|
||||||
|
#include <ewol/renderer/MacOs/Context.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -30,7 +32,7 @@
|
|||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
|
|
||||||
|
|
||||||
int64_t guiInterface::GetTime(void)
|
int64_t ewol::GetTime(void)
|
||||||
{
|
{
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
clock_serv_t cclock;
|
clock_serv_t cclock;
|
||||||
@ -45,144 +47,120 @@ int64_t guiInterface::GetTime(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "guiInterface"
|
#define __class__ "MacOSInterface"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static ewol::SpecialKey guiKeyBoardMode;
|
class MacOSInterface : public ewol::eContext
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Set the new title of the windows
|
|
||||||
* @param title New desired title
|
|
||||||
* @return ---
|
|
||||||
*/
|
|
||||||
void guiInterface::SetTitle(etk::UString& title)
|
|
||||||
{
|
{
|
||||||
EWOL_INFO("X11: Set Title (START)");
|
private:
|
||||||
EWOL_INFO("X11: Set Title (END)");
|
ewol::SpecialKey m_guiKeyBoardMode;
|
||||||
}
|
public:
|
||||||
|
MacOSInterface(int32_t _argc, const char* _argv[]) :
|
||||||
void guiInterface::SetIcon(etk::UString inputFile)
|
ewol::eContext(_argc, _argv)
|
||||||
{
|
{
|
||||||
EWOL_TODO("plop");
|
mm_main(_argc, _argv);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void RemoveDecoration(void)
|
|
||||||
{
|
|
||||||
EWOL_TODO("X11:RemoveDecoration");
|
|
||||||
}
|
|
||||||
|
|
||||||
void AddDecoration(void)
|
|
||||||
{
|
|
||||||
EWOL_TODO("X11:AddDecoration");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
|
||||||
// ClipBoard AREA :
|
|
||||||
// -------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
void guiInterface::ClipBoardGet(ewol::clipBoard::clipboardListe_te clipboardID)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void guiInterface::ClipBoardSet(ewol::clipBoard::clipboardListe_te clipboardID)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#undef __class__
|
|
||||||
#define __class__ "guiInterface"
|
|
||||||
|
|
||||||
|
|
||||||
void guiInterface::Stop(void)
|
|
||||||
{
|
|
||||||
EWOL_INFO("X11-API: Stop");
|
|
||||||
}
|
|
||||||
|
|
||||||
void guiInterface::KeyboardShow(void)
|
|
||||||
{
|
|
||||||
// nothing to do : No keyboard on computer ...
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void guiInterface::KeyboardHide(void)
|
|
||||||
{
|
|
||||||
// nothing to do : No keyboard on computer ...
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void guiInterface::ChangeSize(ivec2 size)
|
|
||||||
{
|
|
||||||
EWOL_INFO("X11-API: ChangeSize=" << size);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void guiInterface::ChangePos(ivec2 pos)
|
|
||||||
{
|
|
||||||
EWOL_INFO("X11-API: ChangePos=" << pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void guiInterface::GetAbsPos(ivec2& pos)
|
|
||||||
{
|
|
||||||
EWOL_INFO("X11-API: GetAbsPos");
|
|
||||||
}
|
|
||||||
|
|
||||||
// select the current cursor to display :
|
|
||||||
static ewol::cursorDisplay_te l_currentCursor = ewol::cursorArrow;
|
|
||||||
|
|
||||||
void guiInterface::SetCursor(ewol::cursorDisplay_te newCursor)
|
|
||||||
{
|
|
||||||
if (newCursor != l_currentCursor) {
|
|
||||||
EWOL_DEBUG("X11-API: Set New Cursor : " << newCursor);
|
|
||||||
// set the new one :
|
|
||||||
l_currentCursor = newCursor;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void guiInterface::GrabPointerEvents(bool isGrabbed, vec2 forcedPosition)
|
int32_t Run(void)
|
||||||
|
{
|
||||||
|
return mm_run();
|
||||||
|
}
|
||||||
|
public:
|
||||||
|
//interface MacOS :
|
||||||
|
|
||||||
|
bool MAC_Draw(bool _displayEveryTime)
|
||||||
|
{
|
||||||
|
return OS_Draw(_displayEveryTime);
|
||||||
|
}
|
||||||
|
void MAC_Resize(float _x, float _y)
|
||||||
|
{
|
||||||
|
OS_Resize(vec2(_x,_y));
|
||||||
|
}
|
||||||
|
void MAC_SetMouseState(int32_t _id, bool _isDown, float _x, float _y)
|
||||||
|
{
|
||||||
|
OS_SetMouseState(_id, _isDown, vec2(_x, _y));
|
||||||
|
}
|
||||||
|
void MAC_SetMouseMotion(int32_t _id, float _x, float _y)
|
||||||
|
{
|
||||||
|
OS_SetMouseMotion(_id, vec2(_x, _y));
|
||||||
|
}
|
||||||
|
void MAC_SetKeyboard(ewol::SpecialKey _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey)
|
||||||
|
{
|
||||||
|
if (_unichar == '\r') {
|
||||||
|
_unichar = '\n';
|
||||||
|
}
|
||||||
|
EWOL_DEBUG("key: " << _unichar << " up=" << !_isDown);
|
||||||
|
OS_SetKeyboard(_keyboardMode, _unichar, !_isDown, _isAReapeateKey);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
MacOSInterface* interface = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool MacOs::Draw(bool _displayEveryTime)
|
||||||
{
|
{
|
||||||
|
if (interface == NULL) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return interface->MAC_Draw(_displayEveryTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <ewol/renderer/os/gui.MacOs.Interface.h>
|
void MacOs::Resize(float _x, float _y)
|
||||||
|
{
|
||||||
|
if (interface == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
interface->MAC_Resize(_x, _y);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MacOs::SetMouseState(int32_t _id, bool _isDown, float _x, float _y)
|
||||||
|
{
|
||||||
|
if (interface == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
interface->MAC_SetMouseState(_id, _isDown, _x, _y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacOs::SetMouseMotion(int32_t _id, float _x, float _y)
|
||||||
|
{
|
||||||
|
if (interface == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
interface->MAC_SetMouseMotion(_id, _x, _y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacOs::SetKeyboard(ewol::SpecialKey _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey)
|
||||||
|
{
|
||||||
|
if (interface == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
interface->MAC_SetKeyboard(_keyboardMode, _unichar, _isDown, _isAReapeateKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Main of the program
|
* @brief Main of the program
|
||||||
* @param std IO
|
* @param std IO
|
||||||
* @return std IO
|
* @return std IO
|
||||||
*/
|
*/
|
||||||
int guiInterface::main(int argc, const char *argv[])
|
int ewol::Run(int _argc, const char *_argv[])
|
||||||
{
|
{
|
||||||
//start the basic thread :
|
etk::SetArgZero(_argv[0]);
|
||||||
eSystem::Init();
|
interface = new MacOSInterface(_argc, _argv);
|
||||||
// Run ...
|
if (NULL == interface) {
|
||||||
int ret = mm_main(argc, argv);
|
EWOL_CRITICAL("Can not create the X11 interface ... MEMORY allocation error");
|
||||||
EWOL_INFO("Return main value=" << ret);
|
return -2;
|
||||||
// close X11 :
|
}
|
||||||
guiInterface::Stop();
|
|
||||||
// uninit ALL :
|
|
||||||
eSystem::UnInit();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
int32_t retValue = interface->Run();
|
||||||
void guiInterface::ForceOrientation(ewol::orientation_te orientation)
|
delete(interface);
|
||||||
{
|
interface = NULL;
|
||||||
// nothing to do ...
|
return retValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -190,3 +168,4 @@ void guiInterface::ForceOrientation(ewol::orientation_te orientation)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
31
sources/ewol/renderer/MacOs/Context.h
Normal file
31
sources/ewol/renderer/MacOs/Context.h
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/**
|
||||||
|
* @author Edouard DUPIN
|
||||||
|
*
|
||||||
|
* @copyright 2011, Edouard DUPIN, all right reserved
|
||||||
|
*
|
||||||
|
* @license BSD v3 (see license file)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __MAC_OS_CONTEXT_H__
|
||||||
|
#define __MAC_OS_CONTEXT_H__
|
||||||
|
|
||||||
|
#include <ewol/key.h>
|
||||||
|
|
||||||
|
namespace MacOs
|
||||||
|
{
|
||||||
|
|
||||||
|
// return true if a flush is needed
|
||||||
|
bool Draw(bool _displayEveryTime);
|
||||||
|
/**
|
||||||
|
* @brief The OS inform that the current windows has change his size.
|
||||||
|
* @param[in] _size new size of the windows.
|
||||||
|
*/
|
||||||
|
void Resize(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 SetKeyboard(ewol::SpecialKey _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -14,6 +14,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int mm_main(int argc, const char *argv[]);
|
int mm_main(int argc, const char *argv[]);
|
||||||
|
int mm_run(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -6,26 +6,11 @@
|
|||||||
* @license BSD v3 (see license file)
|
* @license BSD v3 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#import <ewol/renderer/os/gui.MacOs.Interface.h>
|
#include "ewol/renderer/MacOs/Interface.h"
|
||||||
#include <ewol/renderer/os/gui.MacOs.AppDelegate.h>
|
|
||||||
|
|
||||||
int mm_main(int argc, const char *argv[])
|
#import <ewol/renderer/MacOs/OpenglView.h>
|
||||||
{
|
#import <ewol/renderer/MacOs/AppDelegate.h>
|
||||||
return NSApplicationMain(argc, (const char **)argv);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
#include "ewol/renderer/os/gui.MacOs.Interface.h"
|
|
||||||
|
|
||||||
#import <ewol/renderer/os/gui.MacOs.OpenglView.h>
|
|
||||||
#import <ewol/renderer/os/gui.MacOs.AppDelegate.h>
|
|
||||||
|
|
||||||
int mm_main(int argc, const char *argv[])
|
int mm_main(int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
@ -92,58 +77,14 @@ int mm_main(int argc, const char *argv[])
|
|||||||
//[window makeKeyAndVisible];
|
//[window makeKeyAndVisible];
|
||||||
|
|
||||||
[window setDelegate:view];
|
[window setDelegate:view];
|
||||||
// start application :
|
// return no error
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int mm_run(void)
|
||||||
|
{
|
||||||
[NSApp run];
|
[NSApp run];
|
||||||
// return no error
|
// return no error
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
NSView* view0 = ...; // a view made with IB
|
|
||||||
NSView* view1 = ... ;// another view made with IB
|
|
||||||
NSWindow* window = [self window];
|
|
||||||
|
|
||||||
NSRect window_frame = [window frame];
|
|
||||||
|
|
||||||
NSView* cv = [[[NSView alloc] initWithFrame:window_frame] autorelease];
|
|
||||||
[window setContentView:cv];
|
|
||||||
[cv setAutoresizesSubviews:YES];
|
|
||||||
|
|
||||||
// add subview so it fits within the contentview frame
|
|
||||||
{
|
|
||||||
NSView* v = view0;
|
|
||||||
NSRect vframe = [v frame];
|
|
||||||
[v setHidden:YES];
|
|
||||||
[v setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
|
|
||||||
|
|
||||||
NSView* tmp_superview = [[[NSView alloc] initWithFrame:vframe] autorelease];
|
|
||||||
[tmp_superview addSubview:v];
|
|
||||||
[tmp_superview setAutoresizesSubviews:YES];
|
|
||||||
[tmp_superview setFrame:window_frame];
|
|
||||||
|
|
||||||
[v removeFromSuperview];
|
|
||||||
[cv addSubview:v];
|
|
||||||
}
|
|
||||||
|
|
||||||
// add subview so it fits within the contentview frame
|
|
||||||
{
|
|
||||||
NSView* v = view1;
|
|
||||||
NSRect vframe = [v frame];
|
|
||||||
[v setHidden:YES];
|
|
||||||
[v setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
|
|
||||||
|
|
||||||
NSView* tmp_superview = [[[NSView alloc] initWithFrame:vframe] autorelease];
|
|
||||||
[tmp_superview addSubview:v];
|
|
||||||
[tmp_superview setAutoresizesSubviews:YES];
|
|
||||||
[tmp_superview setFrame:window_frame];
|
|
||||||
|
|
||||||
[v removeFromSuperview];
|
|
||||||
[cv addSubview:v];
|
|
||||||
}
|
|
||||||
|
|
||||||
[view0 setHidden:NO];
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#import <ewol/renderer/os/gui.MacOs.OpenglView.h>
|
#import <ewol/renderer/MacOs/OpenglView.h>
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
#include <ewol/renderer/eSystem.h>
|
#include <ewol/renderer/MacOS/Context.h>
|
||||||
#include <ewol/debug.h>
|
#include <ewol/debug.h>
|
||||||
#include <ewol/Dimension.h>
|
#include <ewol/Dimension.h>
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ static ewol::SpecialKey guiKeyBoardMode;
|
|||||||
|
|
||||||
-(void) drawRect: (NSRect) bounds
|
-(void) drawRect: (NSRect) bounds
|
||||||
{
|
{
|
||||||
eSystem::Draw(true);
|
MacOs::Draw(true);
|
||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ static ewol::SpecialKey guiKeyBoardMode;
|
|||||||
// but they are floats
|
// but they are floats
|
||||||
float width = [self frame].size.width;
|
float width = [self frame].size.width;
|
||||||
float height = [self frame].size.height;
|
float height = [self frame].size.height;
|
||||||
eSystem::Resize(width,height);
|
MacOs::Resize(width,height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -58,22 +58,22 @@ static ewol::SpecialKey guiKeyBoardMode;
|
|||||||
NSPoint point = [event locationInWindow];
|
NSPoint point = [event locationInWindow];
|
||||||
//float x = [event locationInWindow].x; //point.x;
|
//float x = [event locationInWindow].x; //point.x;
|
||||||
//EWOL_INFO("mouseDown : " << (float)point.x << " " << (float)point.y);
|
//EWOL_INFO("mouseDown : " << (float)point.x << " " << (float)point.y);
|
||||||
eSystem::SetMouseState(1, true, point.x, point.y);
|
MacOs::SetMouseState(1, true, point.x, point.y);
|
||||||
}
|
}
|
||||||
-(void)mouseDragged:(NSEvent *)event {
|
-(void)mouseDragged:(NSEvent *)event {
|
||||||
NSPoint point = [event locationInWindow];
|
NSPoint point = [event locationInWindow];
|
||||||
//EWOL_INFO("mouseDragged : " << (float)point.x << " " << (float)point.y);
|
//EWOL_INFO("mouseDragged : " << (float)point.x << " " << (float)point.y);
|
||||||
eSystem::SetMouseMotion(1, point.x, point.y);
|
MacOs::SetMouseMotion(1, point.x, point.y);
|
||||||
}
|
}
|
||||||
-(void)mouseUp:(NSEvent *)event {
|
-(void)mouseUp:(NSEvent *)event {
|
||||||
NSPoint point = [event locationInWindow];
|
NSPoint point = [event locationInWindow];
|
||||||
//EWOL_INFO("mouseUp : " << (float)point.x << " " << (float)point.y);
|
//EWOL_INFO("mouseUp : " << (float)point.x << " " << (float)point.y);
|
||||||
eSystem::SetMouseState(1, false, point.x, point.y);
|
MacOs::SetMouseState(1, false, point.x, point.y);
|
||||||
}
|
}
|
||||||
-(void)mouseMoved:(NSEvent *)event {
|
-(void)mouseMoved:(NSEvent *)event {
|
||||||
NSPoint point = [event locationInWindow];
|
NSPoint point = [event locationInWindow];
|
||||||
//EWOL_INFO("mouseMoved : " << (float)point.x << " " << (float)point.y);
|
//EWOL_INFO("mouseMoved : " << (float)point.x << " " << (float)point.y);
|
||||||
eSystem::SetMouseMotion(0, point.x, point.y);
|
MacOs::SetMouseMotion(0, point.x, point.y);
|
||||||
}
|
}
|
||||||
-(void)mouseEntered:(NSEvent *)event {
|
-(void)mouseEntered:(NSEvent *)event {
|
||||||
NSPoint point = [event locationInWindow];
|
NSPoint point = [event locationInWindow];
|
||||||
@ -86,17 +86,17 @@ static ewol::SpecialKey guiKeyBoardMode;
|
|||||||
-(void)rightMouseDown:(NSEvent *)event {
|
-(void)rightMouseDown:(NSEvent *)event {
|
||||||
NSPoint point = [event locationInWindow];
|
NSPoint point = [event locationInWindow];
|
||||||
//EWOL_INFO("rightMouseDown : " << (float)point.x << " " << (float)point.y);
|
//EWOL_INFO("rightMouseDown : " << (float)point.x << " " << (float)point.y);
|
||||||
eSystem::SetMouseState(3, true, point.x, point.y);
|
MacOs::SetMouseState(3, true, point.x, point.y);
|
||||||
}
|
}
|
||||||
-(void)rightMouseDragged:(NSEvent *)event {
|
-(void)rightMouseDragged:(NSEvent *)event {
|
||||||
NSPoint point = [event locationInWindow];
|
NSPoint point = [event locationInWindow];
|
||||||
//EWOL_INFO("rightMouseDragged : " << (float)point.x << " " << (float)point.y);
|
//EWOL_INFO("rightMouseDragged : " << (float)point.x << " " << (float)point.y);
|
||||||
eSystem::SetMouseMotion(3, point.x, point.y);
|
MacOs::SetMouseMotion(3, point.x, point.y);
|
||||||
}
|
}
|
||||||
-(void)rightMouseUp:(NSEvent *)event {
|
-(void)rightMouseUp:(NSEvent *)event {
|
||||||
NSPoint point = [event locationInWindow];
|
NSPoint point = [event locationInWindow];
|
||||||
//EWOL_INFO("rightMouseUp : " << (float)point.x << " " << (float)point.y);
|
//EWOL_INFO("rightMouseUp : " << (float)point.x << " " << (float)point.y);
|
||||||
eSystem::SetMouseState(3, false, point.x, point.y);
|
MacOs::SetMouseState(3, false, point.x, point.y);
|
||||||
}
|
}
|
||||||
-(void)otherMouseDown:(NSEvent *)event {
|
-(void)otherMouseDown:(NSEvent *)event {
|
||||||
NSPoint point = [event locationInWindow];
|
NSPoint point = [event locationInWindow];
|
||||||
@ -123,8 +123,8 @@ static ewol::SpecialKey guiKeyBoardMode;
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (float iii=abs(deltaY) ; iii>=0.0f ; iii-=1.0f) {
|
for (float iii=abs(deltaY) ; iii>=0.0f ; iii-=1.0f) {
|
||||||
eSystem::SetMouseState(idEvent, true , point.x, point.y);
|
MacOs::SetMouseState(idEvent, true , point.x, point.y);
|
||||||
eSystem::SetMouseState(idEvent, false, point.x, point.y);
|
MacOs::SetMouseState(idEvent, false, point.x, point.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -146,16 +146,18 @@ static ewol::SpecialKey guiKeyBoardMode;
|
|||||||
thisIsAReapeateKey = true;
|
thisIsAReapeateKey = true;
|
||||||
}
|
}
|
||||||
NSString *str = [theEvent charactersIgnoringModifiers];
|
NSString *str = [theEvent charactersIgnoringModifiers];
|
||||||
|
// TODO : set if for every char in the string !!!
|
||||||
unichar c = [str characterAtIndex:0];
|
unichar c = [str characterAtIndex:0];
|
||||||
|
/*
|
||||||
if (c < ' ' || c > '~') { // only ASCII please
|
if (c < ' ' || c > '~') { // only ASCII please
|
||||||
c = 0;
|
c = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
EWOL_DEBUG("KeyDown " << (char)c);
|
*/
|
||||||
eSystem::SetKeyboard(guiKeyBoardMode, (char)c, true, thisIsAReapeateKey);
|
//EWOL_DEBUG("KeyDown " << (char)c);
|
||||||
|
MacOs::SetKeyboard(guiKeyBoardMode, (char)c, true, thisIsAReapeateKey);
|
||||||
if (true==thisIsAReapeateKey) {
|
if (true==thisIsAReapeateKey) {
|
||||||
eSystem::SetKeyboard(guiKeyBoardMode, (char)c, false, thisIsAReapeateKey);
|
MacOs::SetKeyboard(guiKeyBoardMode, (char)c, false, thisIsAReapeateKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,17 +166,18 @@ static ewol::SpecialKey guiKeyBoardMode;
|
|||||||
if ([theEvent isARepeat]) {
|
if ([theEvent isARepeat]) {
|
||||||
thisIsAReapeateKey = true;
|
thisIsAReapeateKey = true;
|
||||||
}
|
}
|
||||||
EWOL_DEBUG("KeyUp ");
|
//EWOL_DEBUG("KeyUp ");
|
||||||
NSString *str = [theEvent charactersIgnoringModifiers];
|
NSString *str = [theEvent charactersIgnoringModifiers];
|
||||||
unichar c = [str characterAtIndex:0];
|
unichar c = [str characterAtIndex:0];
|
||||||
|
/*
|
||||||
if (c < ' ' || c > '~') { // only ASCII please
|
if (c < ' ' || c > '~') { // only ASCII please
|
||||||
c = 0;
|
c = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
eSystem::SetKeyboard(guiKeyBoardMode, (char)c, false, thisIsAReapeateKey);
|
*/
|
||||||
|
MacOs::SetKeyboard(guiKeyBoardMode, (char)c, false, thisIsAReapeateKey);
|
||||||
if (true==thisIsAReapeateKey) {
|
if (true==thisIsAReapeateKey) {
|
||||||
eSystem::SetKeyboard(guiKeyBoardMode, (char)c, true, thisIsAReapeateKey);
|
MacOs::SetKeyboard(guiKeyBoardMode, (char)c, true, thisIsAReapeateKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include <ewol/commandLine.h>
|
#include <ewol/commandLine.h>
|
||||||
#include <etk/UString.h>
|
#include <etk/UString.h>
|
||||||
#include <etk/unicode.h>
|
#include <etk/unicode.h>
|
||||||
|
#include <etk/os/FSNode.h>
|
||||||
#include <ewol/widget/WidgetManager.h>
|
#include <ewol/widget/WidgetManager.h>
|
||||||
|
|
||||||
#include <ewol/resources/ResourceManager.h>
|
#include <ewol/resources/ResourceManager.h>
|
||||||
@ -1285,6 +1286,7 @@ class X11Interface : public ewol::eContext
|
|||||||
*/
|
*/
|
||||||
int ewol::Run(int _argc, const char *_argv[])
|
int ewol::Run(int _argc, const char *_argv[])
|
||||||
{
|
{
|
||||||
|
etk::SetArgZero(_argv[0]);
|
||||||
X11Interface* interface = new X11Interface(_argc, _argv);
|
X11Interface* interface = new X11Interface(_argc, _argv);
|
||||||
if (NULL == interface) {
|
if (NULL == interface) {
|
||||||
EWOL_CRITICAL("Can not create the X11 interface ... MEMORY allocation error");
|
EWOL_CRITICAL("Can not create the X11 interface ... MEMORY allocation error");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user