Merge branch 'master' into showwindow

Conflicts:
	src/window.c
This commit is contained in:
Camilla Berglund
2012-09-06 15:11:50 +02:00
21 changed files with 88 additions and 2109 deletions
-48
View File
@@ -473,17 +473,10 @@ static void processSingleEvent(void)
// A keyboard key was pressed
window = findWindow(event.xkey.window);
if (window == NULL)
{
fprintf(stderr, "Cannot find GLFW window structure for KeyPress event\n");
return;
}
// Translate and report key press
_glfwInputKey(window, translateKey(event.xkey.keycode), GLFW_PRESS);
// Translate and report character input
_glfwInputChar(window, translateChar(&event.xkey));
break;
}
@@ -492,10 +485,7 @@ static void processSingleEvent(void)
// A keyboard key was released
window = findWindow(event.xkey.window);
if (window == NULL)
{
fprintf(stderr, "Cannot find GLFW window structure for KeyRelease event\n");
return;
}
// Do not report key releases for key repeats. For key repeats we
// will get KeyRelease/KeyPress pairs with similar or identical
@@ -523,9 +513,7 @@ static void processSingleEvent(void)
}
}
// Translate and report key release
_glfwInputKey(window, translateKey(event.xkey.keycode), GLFW_RELEASE);
break;
}
@@ -534,10 +522,7 @@ static void processSingleEvent(void)
// A mouse button was pressed or a scrolling event occurred
window = findWindow(event.xbutton.window);
if (window == NULL)
{
fprintf(stderr, "Cannot find GLFW window structure for ButtonPress event\n");
return;
}
if (event.xbutton.button == Button1)
_glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_LEFT, GLFW_PRESS);
@@ -566,10 +551,7 @@ static void processSingleEvent(void)
// A mouse button was released
window = findWindow(event.xbutton.window);
if (window == NULL)
{
fprintf(stderr, "Cannot find GLFW window structure for ButtonRelease event\n");
return;
}
if (event.xbutton.button == Button1)
{
@@ -597,10 +579,7 @@ static void processSingleEvent(void)
// The cursor entered the window
window = findWindow(event.xcrossing.window);
if (window == NULL)
{
fprintf(stderr, "Cannot find GLFW window structure for EnterNotify event\n");
return;
}
if (window->cursorMode == GLFW_CURSOR_HIDDEN)
hideCursor(window);
@@ -614,10 +593,7 @@ static void processSingleEvent(void)
// The cursor left the window
window = findWindow(event.xcrossing.window);
if (window == NULL)
{
fprintf(stderr, "Cannot find GLFW window structure for LeaveNotify event\n");
return;
}
if (window->cursorMode == GLFW_CURSOR_HIDDEN)
showCursor(window);
@@ -631,10 +607,7 @@ static void processSingleEvent(void)
// The cursor was moved
window = findWindow(event.xmotion.window);
if (window == NULL)
{
fprintf(stderr, "Cannot find GLFW window structure for MotionNotify event\n");
return;
}
if (event.xmotion.x != window->X11.cursorPosX ||
event.xmotion.y != window->X11.cursorPosY)
@@ -672,10 +645,7 @@ static void processSingleEvent(void)
// The window configuration changed somehow
window = findWindow(event.xconfigure.window);
if (window == NULL)
{
fprintf(stderr, "Cannot find GLFW window structure for ConfigureNotify event\n");
return;
}
_glfwInputWindowSize(window,
event.xconfigure.width,
@@ -693,10 +663,7 @@ static void processSingleEvent(void)
// Custom client message, probably from the window manager
window = findWindow(event.xclient.window);
if (window == NULL)
{
fprintf(stderr, "Cannot find GLFW window structure for ClientMessage event\n");
return;
}
if ((Atom) event.xclient.data.l[0] == _glfwLibrary.X11.wmDeleteWindow)
{
@@ -727,10 +694,7 @@ static void processSingleEvent(void)
// The window was mapped
window = findWindow(event.xmap.window);
if (window == NULL)
{
fprintf(stderr, "Cannot find GLFW window structure for MapNotify event\n");
return;
}
_glfwInputWindowVisibility(window, GL_TRUE);
_glfwInputWindowIconify(window, GL_FALSE);
@@ -742,10 +706,7 @@ static void processSingleEvent(void)
// The window was unmapped
window = findWindow(event.xmap.window);
if (window == NULL)
{
fprintf(stderr, "Cannot find GLFW window structure for UnmapNotify event\n");
return;
}
_glfwInputWindowVisibility(window, GL_FALSE);
_glfwInputWindowIconify(window, GL_TRUE);
@@ -757,10 +718,7 @@ static void processSingleEvent(void)
// The window gained focus
window = findWindow(event.xfocus.window);
if (window == NULL)
{
fprintf(stderr, "Cannot find GLFW window structure for FocusIn event\n");
return;
}
_glfwInputWindowFocus(window, GL_TRUE);
@@ -775,10 +733,7 @@ static void processSingleEvent(void)
// The window lost focus
window = findWindow(event.xfocus.window);
if (window == NULL)
{
fprintf(stderr, "Cannot find GLFW window structure for FocusOut event\n");
return;
}
_glfwInputWindowFocus(window, GL_FALSE);
@@ -793,10 +748,7 @@ static void processSingleEvent(void)
// The window's contents was damaged
window = findWindow(event.xexpose.window);
if (window == NULL)
{
fprintf(stderr, "Cannot find GLFW window structure for Expose event\n");
return;
}
_glfwInputWindowDamage(window);
break;