This repository has been archived by the owner on Sep 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Cory Fields
committed
Aug 3, 2012
1 parent
02b7a0c
commit a905a54
Showing
5 changed files
with
121 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
SRCS= \ | ||
WinEventsAndroid.cpp \ | ||
|
||
LIB=windowing_android.a | ||
|
||
include ../../../Makefile.include | ||
-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright (C) 2010 Team XBMC | ||
* http://www.xbmc.org | ||
* | ||
* This Program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2, or (at your option) | ||
* any later version. | ||
* | ||
* This Program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with XBMC; see the file COPYING. If not, write to | ||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
* http://www.gnu.org/copyleft/gpl.html | ||
* | ||
*/ | ||
|
||
#include "system.h" | ||
#include "windowing/WinEvents.h" | ||
#include "WinEventsAndroid.h" | ||
#include "input/XBMC_vkeys.h" | ||
#include "Application.h" | ||
#include "windowing/WindowingFactory.h" | ||
#include "threads/CriticalSection.h" | ||
#include "utils/log.h" | ||
|
||
static CCriticalSection g_inputCond; | ||
|
||
PHANDLE_EVENT_FUNC CWinEventsBase::m_pEventFunc = NULL; | ||
|
||
static std::vector<XBMC_Event> events; | ||
|
||
void CWinEventsAndroid::DeInit() | ||
{ | ||
} | ||
|
||
void CWinEventsAndroid::Init() | ||
{ | ||
} | ||
|
||
void CWinEventsAndroid::MessagePush(XBMC_Event *newEvent) | ||
{ | ||
CSingleLock lock(g_inputCond); | ||
events.push_back(*newEvent); | ||
} | ||
|
||
bool CWinEventsAndroid::MessagePump() | ||
{ | ||
bool ret = false; | ||
std::vector<XBMC_Event> copy_events; | ||
{ // double-buffered events to avoid constant locking for OnEvent(). | ||
CSingleLock lock(g_inputCond); | ||
copy_events = events; | ||
events.clear(); | ||
} | ||
|
||
for (std::vector<XBMC_Event>::iterator iter = copy_events.begin(); iter != copy_events.end(); iter++) | ||
{ | ||
ret |= g_application.OnEvent(*iter); | ||
} | ||
|
||
return ret; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (C) 2010 Team XBMC | ||
* http://www.xbmc.org | ||
* | ||
* This Program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2, or (at your option) | ||
* any later version. | ||
* | ||
* This Program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with XBMC; see the file COPYING. If not, write to | ||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
* http://www.gnu.org/copyleft/gpl.html | ||
* | ||
*/ | ||
|
||
#pragma once | ||
|
||
#ifndef WINDOW_EVENTS_ANDROID_H | ||
#define WINDOW_EVENTS_ANDROID_H | ||
|
||
#include "windowing/WinEvents.h" | ||
#include "input/MouseStat.h" | ||
|
||
class CWinEventsAndroid : public CWinEventsBase | ||
{ | ||
public: | ||
static void Init(); | ||
static void DeInit(); | ||
static void MessagePush(XBMC_Event *newEvent); | ||
static bool MessagePump(); | ||
|
||
protected: | ||
|
||
}; | ||
|
||
#endif // WINDOW_EVENTS_ANDROID_H |