use onWindowFocusChanged(bool) instead of onResume()/onPause()

we should use onWindowFocusChanged(bool) to detect if the app is currently
visitible to the user or not. because onPause()/onResume() leads to false
positives on some android versions (e.g. Kindle Fire). if you lock those
devices, while the app running, everything is fine (onPause() is handled
properly). but as soon as you wake up the device, and the lock screen gets
visible, the app is resumed and the music is played (onResume() is
called to early).

this is a) not the best behaviour and b) such games will be rejected on the
samsung app store. onWindowFocusChanged(bool) is, like onPause()/onResume(),
available since API level 1 and it should be safe to simply switch.
tilemap supports XML layer format
Merge pull request #4 from cocos2d/master

Merge from the latest version of cocos2d
Added config macro for "spine" extension
a potential bug in Layer.

https://github.com/cocos2d/cocos2d-x/issues/2948
Update CCLayer.cpp

change "_accelerometerEnabled = false"
to "setAccelerometerEnabled(false)"
in method init().
a potential bug in ScrollView

check _touches in setTouchEnabled
Add ProtocolUser for custom system plugins.
Merge branch 'develop' into ForUser

Conflicts:
	plugin/protocols/platform/android/PluginFactory.cpp
	plugin/protocols/proj.android/jni/Android.mk
Merge branch 'develop' into ForUser
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into ccx_filesystem
issue #2317, Adjust ProtocolUser for actual situation.
issue #2317, Add plugin qh360 .
closed #2317, Add sample project HelloUser.
Merge branch 'develop' into ForUser
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into develop
jsbidings for mac
Merge branch 'develop' into js_mac
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into develop
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into ccx_filesystem