Wondows : start the moving of the windows ith X11 system ==> not really obvious

This commit is contained in:
Edouard Dupin 2011-10-31 13:49:31 +01:00
parent 109c363c84
commit 0265f54413
4 changed files with 80 additions and 8 deletions

View File

@ -269,7 +269,6 @@ namespace guiAbstraction {
}
//code to remove decoration
/*
{
Hints hints;
@ -284,7 +283,6 @@ namespace guiAbstraction {
EWOL_ERROR("Can not get the property for the rmoving decoration of the X11 system ....");
}
}
*/
return true;
}
@ -430,6 +428,7 @@ namespace guiAbstraction {
case ConfigureNotify:
EWOL_DEBUG("X11 event : " << event.type << " = \"ConfigureNotify\" Origin(" << event.xconfigure.x << "," << event.xconfigure.y << ") Size(" << event.xconfigure.width << "," << event.xconfigure.height << ")");
m_uniqueWindows->CalculateSize((double)event.xconfigure.width, (double)event.xconfigure.height);
m_uniqueWindows->SetOrigin(event.xconfigure.x, event.xconfigure.y);
break;
case Expose:
EWOL_DEBUG("X11 event : " << event.type << " = \"Expose\"");
@ -603,6 +602,16 @@ namespace guiAbstraction {
{
m_run = false;
}
void ChangeSize(int32_t w, int32_t h)
{
XResizeWindow(m_display, WindowHandle, w, h);
}
void ChangePos(int32_t x, int32_t y)
{
XMoveWindow(m_display, WindowHandle, x, y);
}
};
};
@ -671,3 +680,21 @@ void guiAbstraction::UnInit(void)
}
void guiAbstraction::ChangeSize(int32_t w, int32_t h)
{
if (true == guiAbstractionIsInit) {
myX11Access->ChangeSize(w, h);
} else {
EWOL_CRITICAL("X11 ==> not init ... ");
}
}
void guiAbstraction::ChangePos(int32_t x, int32_t y)
{
if (true == guiAbstractionIsInit) {
myX11Access->ChangePos(x, y);
} else {
EWOL_CRITICAL("X11 ==> not init ... ");
}
}

View File

@ -36,6 +36,8 @@ namespace guiAbstraction
void Stop(void);
void UnInit(void);
void SetDisplayOnWindows(ewol::Windows * newOne);
void ChangeSize(int32_t w, int32_t h);
void ChangePos(int32_t x, int32_t y);
};

View File

@ -70,4 +70,9 @@ void ewol::DisplayWindows(ewol::Windows * windows)
}
void ewol::Stop(void)
{
guiAbstraction::Stop();
}

View File

@ -29,9 +29,28 @@
#include <ewolOObject.h>
#include <ewolTexture.h>
#include <ewolFont.h>
#include <ewol.h>
#if __PLATFORM__ == X11
#include "guiX11.h"
#elif __PLATFORM__ == DoubleBuffer
#include "guiDoubleBuffer.h"
#elif __PLATFORM__ == Android
#include "guiAndroid.h"
#elif __PLATFORM__ == AndroidTablet
#include "guiAndroidTablet.h"
#elif __PLATFORM__ == IPhone
#include "guiIPhone.h"
#elif __PLATFORM__ == IPad
#include "guiIPad.h"
#else
#error you need to specify a platform ...
#endif
#include <GL/gl.h>
#undef __class__
#define __class__ "ewol::Windows"
@ -76,15 +95,33 @@ bool ewol::Windows::CalculateSize(double availlableX, double availlableY)
bool ewol::Windows::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, double x, double y)
{
/*
if( EVENT_INPUT_TYPE_UP == typeEvent
&& 1 == IdInput)
if( x >= 60
&& y <=20)
{
EWOL_INFO("Request ???");
static int32_t test=0;
static int32_t lastX=x;
static int32_t lastY=x;
if( 1 == IdInput
&& EVENT_INPUT_TYPE_DOWN == typeEvent) {
test = 1;
lastX=x;
lastY=y;
EWOL_DEBUG("EVENT DOWN ... ");
} else if( 1 == IdInput
&& EVENT_INPUT_TYPE_UP == typeEvent) {
test = 0;
EWOL_DEBUG("EVENT UP ... ");
} else if(EVENT_INPUT_TYPE_MOVE == typeEvent) {
EWOL_DEBUG("EVENT MOVE ... ");
if (test==1) {
EWOL_DEBUG("change POS ... ");
guiAbstraction::ChangePos(m_origin.x + (x - lastX), m_origin.y + (y - lastY));
lastX=x;
lastY=y;
}
}
}
return true;
*/
return false;
}
@ -137,6 +174,7 @@ bool ewol::Windows::OnEventArea(const char * generateEventId, double x, double y
//EWOL_DEBUG("Receive event : \"" << generateEventId << "\"");
if(ewolEventWindowsClose == generateEventId) {
EWOL_INFO("Request close of the windows");
ewol::Stop();
eventIsOK = true;
} else if(ewolEventWindowsMinimize == generateEventId) {
EWOL_INFO("Request Minimize of the windows");