Merge Webkit at r58956: Plugin code has switched to C99 integer types. See http://trac.webkit.org/changeset/58590

Change-Id: Id521afd66935db6149a341f89ab6b4d7440e4695
This commit is contained in:
Ben Murdoch
2010-05-12 14:09:26 +01:00
parent edb8628b41
commit 3b6f45dbd2
16 changed files with 42 additions and 42 deletions

View File

@@ -48,7 +48,7 @@ class SubPlugin {
public: public:
SubPlugin(NPP inst) : m_inst(inst) {} SubPlugin(NPP inst) : m_inst(inst) {}
virtual ~SubPlugin() {} virtual ~SubPlugin() {}
virtual int16 handleEvent(const ANPEvent* evt) = 0; virtual int16_t handleEvent(const ANPEvent* evt) = 0;
virtual bool supportsDrawingModel(ANPDrawingModel) = 0; virtual bool supportsDrawingModel(ANPDrawingModel) = 0;
int getPluginWidth(); int getPluginWidth();

View File

@@ -35,12 +35,12 @@ extern ANPPaintInterfaceV0 gPaintI;
extern ANPPathInterfaceV0 gPathI; extern ANPPathInterfaceV0 gPathI;
extern ANPWindowInterfaceV0 gWindowI; extern ANPWindowInterfaceV0 gWindowI;
static uint16 rnd16(float x, int inset) { static uint16_t rnd16(float x, int inset) {
int ix = (int)roundf(x) + inset; int ix = (int)roundf(x) + inset;
if (ix < 0) { if (ix < 0) {
ix = 0; ix = 0;
} }
return static_cast<uint16>(ix); return static_cast<uint16_t>(ix);
} }
static void inval(NPP instance, const ANPRectF& r, bool doAA) { static void inval(NPP instance, const ANPRectF& r, bool doAA) {
@@ -173,7 +173,7 @@ void BallAnimation::showEntirePluginOnScreen() {
gWindowI.clearVisibleRects(instance); gWindowI.clearVisibleRects(instance);
} }
int16 BallAnimation::handleEvent(const ANPEvent* evt) { int16_t BallAnimation::handleEvent(const ANPEvent* evt) {
NPP instance = this->inst(); NPP instance = this->inst();
switch (evt->eventType) { switch (evt->eventType) {

View File

@@ -33,7 +33,7 @@ public:
BallAnimation(NPP inst); BallAnimation(NPP inst);
virtual ~BallAnimation(); virtual ~BallAnimation();
virtual bool supportsDrawingModel(ANPDrawingModel); virtual bool supportsDrawingModel(ANPDrawingModel);
virtual int16 handleEvent(const ANPEvent* evt); virtual int16_t handleEvent(const ANPEvent* evt);
private: private:
void drawPlugin(const ANPBitmap& bitmap, const ANPRectI& clip); void drawPlugin(const ANPBitmap& bitmap, const ANPRectI& clip);
void showEntirePluginOnScreen(); void showEntirePluginOnScreen();

View File

@@ -44,12 +44,12 @@ static void inval(NPP instance) {
browser->invalidaterect(instance, NULL); browser->invalidaterect(instance, NULL);
} }
static uint16 rnd16(float x, int inset) { static uint16_t rnd16(float x, int inset) {
int ix = (int)roundf(x) + inset; int ix = (int)roundf(x) + inset;
if (ix < 0) { if (ix < 0) {
ix = 0; ix = 0;
} }
return static_cast<uint16>(ix); return static_cast<uint16_t>(ix);
} }
static void inval(NPP instance, const ANPRectF& r, bool doAA) { static void inval(NPP instance, const ANPRectF& r, bool doAA) {
@@ -272,7 +272,7 @@ ANPPaint* AudioPlugin::getPaint(ANPRectF* input) {
return (input == m_activeRect) ? m_paintActiveRect : m_paintRect; return (input == m_activeRect) ? m_paintActiveRect : m_paintRect;
} }
int16 AudioPlugin::handleEvent(const ANPEvent* evt) { int16_t AudioPlugin::handleEvent(const ANPEvent* evt) {
NPP instance = this->inst(); NPP instance = this->inst();
switch (evt->eventType) { switch (evt->eventType) {

View File

@@ -42,7 +42,7 @@ public:
AudioPlugin(NPP inst); AudioPlugin(NPP inst);
virtual ~AudioPlugin(); virtual ~AudioPlugin();
virtual bool supportsDrawingModel(ANPDrawingModel); virtual bool supportsDrawingModel(ANPDrawingModel);
virtual int16 handleEvent(const ANPEvent* evt); virtual int16_t handleEvent(const ANPEvent* evt);
private: private:
void draw(ANPCanvas*); void draw(ANPCanvas*);
void drawPlugin(const ANPBitmap& bitmap, const ANPRectI& clip); void drawPlugin(const ANPBitmap& bitmap, const ANPRectI& clip);

View File

@@ -179,7 +179,7 @@ void BackgroundPlugin::drawPlugin(int surfaceWidth, int surfaceHeight) {
gSurfaceI.unlock(env, m_surface); gSurfaceI.unlock(env, m_surface);
} }
int16 BackgroundPlugin::handleEvent(const ANPEvent* evt) { int16_t BackgroundPlugin::handleEvent(const ANPEvent* evt) {
switch (evt->eventType) { switch (evt->eventType) {
case kDraw_ANPEventType: case kDraw_ANPEventType:
gLogI.log(kError_ANPLogType, " ------ %p the plugin did not request draw events", inst()); gLogI.log(kError_ANPLogType, " ------ %p the plugin did not request draw events", inst());
@@ -233,10 +233,10 @@ void BackgroundPlugin::test_logging() {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#define TIMER_INTERVAL 50 #define TIMER_INTERVAL 50
static void timer_oneshot(NPP instance, uint32 timerID); static void timer_oneshot(NPP instance, uint32_t timerID);
static void timer_repeat(NPP instance, uint32 timerID); static void timer_repeat(NPP instance, uint32_t timerID);
static void timer_neverfires(NPP instance, uint32 timerID); static void timer_neverfires(NPP instance, uint32_t timerID);
static void timer_latency(NPP instance, uint32 timerID); static void timer_latency(NPP instance, uint32_t timerID);
void BackgroundPlugin::test_timers() { void BackgroundPlugin::test_timers() {
NPP instance = this->inst(); NPP instance = this->inst();
@@ -255,18 +255,18 @@ void BackgroundPlugin::test_timers() {
browser->scheduletimer(instance, TIMER_INTERVAL, true, timer_latency); browser->scheduletimer(instance, TIMER_INTERVAL, true, timer_latency);
mStartTime = mPrevTime = getMSecs(); mStartTime = mPrevTime = getMSecs();
// test unschedule immediately // test unschedule immediately
uint32 id = browser->scheduletimer(instance, 100, false, timer_neverfires); uint32_t id = browser->scheduletimer(instance, 100, false, timer_neverfires);
browser->unscheduletimer(instance, id); browser->unscheduletimer(instance, id);
// test double unschedule (should be no-op) // test double unschedule (should be no-op)
browser->unscheduletimer(instance, id); browser->unscheduletimer(instance, id);
} }
static void timer_oneshot(NPP instance, uint32 timerID) { static void timer_oneshot(NPP instance, uint32_t timerID) {
gLogI.log(kDebug_ANPLogType, "-------- oneshot timer\n"); gLogI.log(kDebug_ANPLogType, "-------- oneshot timer\n");
} }
static void timer_repeat(NPP instance, uint32 timerID) { static void timer_repeat(NPP instance, uint32_t timerID) {
BackgroundPlugin *obj = ((BackgroundPlugin*) ((PluginObject*) instance->pdata)->activePlugin); BackgroundPlugin *obj = ((BackgroundPlugin*) ((PluginObject*) instance->pdata)->activePlugin);
gLogI.log(kDebug_ANPLogType, "-------- repeat timer %d\n", gLogI.log(kDebug_ANPLogType, "-------- repeat timer %d\n",
@@ -276,11 +276,11 @@ static void timer_repeat(NPP instance, uint32 timerID) {
} }
} }
static void timer_neverfires(NPP instance, uint32 timerID) { static void timer_neverfires(NPP instance, uint32_t timerID) {
gLogI.log(kError_ANPLogType, "-------- timer_neverfires!!!\n"); gLogI.log(kError_ANPLogType, "-------- timer_neverfires!!!\n");
} }
static void timer_latency(NPP instance, uint32 timerID) { static void timer_latency(NPP instance, uint32_t timerID) {
BackgroundPlugin *obj = ((BackgroundPlugin*) ((PluginObject*) instance->pdata)->activePlugin); BackgroundPlugin *obj = ((BackgroundPlugin*) ((PluginObject*) instance->pdata)->activePlugin);
obj->mTimerLatencyCurrentCount += 1; obj->mTimerLatencyCurrentCount += 1;

View File

@@ -32,7 +32,7 @@ class BackgroundPlugin : public SurfaceSubPlugin {
public: public:
BackgroundPlugin(NPP inst); BackgroundPlugin(NPP inst);
virtual ~BackgroundPlugin(); virtual ~BackgroundPlugin();
virtual int16 handleEvent(const ANPEvent* evt); virtual int16_t handleEvent(const ANPEvent* evt);
virtual jobject getSurface(); virtual jobject getSurface();
// Timer Testing Variables // Timer Testing Variables

View File

@@ -43,12 +43,12 @@ static void inval(NPP instance) {
browser->invalidaterect(instance, NULL); browser->invalidaterect(instance, NULL);
} }
static uint16 rnd16(float x, int inset) { static uint16_t rnd16(float x, int inset) {
int ix = (int)roundf(x) + inset; int ix = (int)roundf(x) + inset;
if (ix < 0) { if (ix < 0) {
ix = 0; ix = 0;
} }
return static_cast<uint16>(ix); return static_cast<uint16_t>(ix);
} }
static void inval(NPP instance, const ANPRectF& r, bool doAA) { static void inval(NPP instance, const ANPRectF& r, bool doAA) {
@@ -199,7 +199,7 @@ void FormPlugin::drawPassword(ANPCanvas* canvas, TextInput passwordInput) {
} }
} }
int16 FormPlugin::handleEvent(const ANPEvent* evt) { int16_t FormPlugin::handleEvent(const ANPEvent* evt) {
NPP instance = this->inst(); NPP instance = this->inst();
switch (evt->eventType) { switch (evt->eventType) {

View File

@@ -39,7 +39,7 @@ public:
FormPlugin(NPP inst); FormPlugin(NPP inst);
virtual ~FormPlugin(); virtual ~FormPlugin();
virtual bool supportsDrawingModel(ANPDrawingModel); virtual bool supportsDrawingModel(ANPDrawingModel);
virtual int16 handleEvent(const ANPEvent* evt); virtual int16_t handleEvent(const ANPEvent* evt);
private: private:
void draw(ANPCanvas*); void draw(ANPCanvas*);
void drawPlugin(const ANPBitmap& bitmap, const ANPRectI& clip); void drawPlugin(const ANPBitmap& bitmap, const ANPRectI& clip);

View File

@@ -41,19 +41,19 @@ JavaVM* gVM;
#define EXPORT __attribute__((visibility("default"))) #define EXPORT __attribute__((visibility("default")))
NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc,
char* argn[], char* argv[], NPSavedData* saved); char* argn[], char* argv[], NPSavedData* saved);
NPError NPP_Destroy(NPP instance, NPSavedData** save); NPError NPP_Destroy(NPP instance, NPSavedData** save);
NPError NPP_SetWindow(NPP instance, NPWindow* window); NPError NPP_SetWindow(NPP instance, NPWindow* window);
NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream,
NPBool seekable, uint16* stype); NPBool seekable, uint16_t* stype);
NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason); NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason);
int32 NPP_WriteReady(NPP instance, NPStream* stream); int32_t NPP_WriteReady(NPP instance, NPStream* stream);
int32 NPP_Write(NPP instance, NPStream* stream, int32 offset, int32 len, int32_t NPP_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len,
void* buffer); void* buffer);
void NPP_StreamAsFile(NPP instance, NPStream* stream, const char* fname); void NPP_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
void NPP_Print(NPP instance, NPPrint* platformPrint); void NPP_Print(NPP instance, NPPrint* platformPrint);
int16 NPP_HandleEvent(NPP instance, void* event); int16_t NPP_HandleEvent(NPP instance, void* event);
void NPP_URLNotify(NPP instance, const char* URL, NPReason reason, void NPP_URLNotify(NPP instance, const char* URL, NPReason reason,
void* notifyData); void* notifyData);
NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value); NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value);
@@ -151,7 +151,7 @@ const char *NP_GetMIMEDescription(void)
return "application/x-testbrowserplugin:tst:Test plugin mimetype is application/x-testbrowserplugin"; return "application/x-testbrowserplugin:tst:Test plugin mimetype is application/x-testbrowserplugin";
} }
NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc,
char* argn[], char* argv[], NPSavedData* saved) char* argn[], char* argv[], NPSavedData* saved)
{ {
@@ -290,7 +290,7 @@ NPError NPP_SetWindow(NPP instance, NPWindow* window)
return NPERR_NO_ERROR; return NPERR_NO_ERROR;
} }
NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype) NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype)
{ {
*stype = NP_ASFILEONLY; *stype = NP_ASFILEONLY;
return NPERR_NO_ERROR; return NPERR_NO_ERROR;
@@ -301,12 +301,12 @@ NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason)
return NPERR_NO_ERROR; return NPERR_NO_ERROR;
} }
int32 NPP_WriteReady(NPP instance, NPStream* stream) int32_t NPP_WriteReady(NPP instance, NPStream* stream)
{ {
return 0; return 0;
} }
int32 NPP_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer) int32_t NPP_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer)
{ {
return 0; return 0;
} }
@@ -319,7 +319,7 @@ void NPP_Print(NPP instance, NPPrint* platformPrint)
{ {
} }
int16 NPP_HandleEvent(NPP instance, void* event) int16_t NPP_HandleEvent(NPP instance, void* event)
{ {
PluginObject *obj = reinterpret_cast<PluginObject*>(instance->pdata); PluginObject *obj = reinterpret_cast<PluginObject*>(instance->pdata);
const ANPEvent* evt = reinterpret_cast<const ANPEvent*>(event); const ANPEvent* evt = reinterpret_cast<const ANPEvent*>(event);

View File

@@ -43,12 +43,12 @@ static void inval(NPP instance) {
browser->invalidaterect(instance, NULL); browser->invalidaterect(instance, NULL);
} }
static uint16 rnd16(float x, int inset) { static uint16_t rnd16(float x, int inset) {
int ix = (int)roundf(x) + inset; int ix = (int)roundf(x) + inset;
if (ix < 0) { if (ix < 0) {
ix = 0; ix = 0;
} }
return static_cast<uint16>(ix); return static_cast<uint16_t>(ix);
} }
static void inval(NPP instance, const ANPRectF& r, bool doAA) { static void inval(NPP instance, const ANPRectF& r, bool doAA) {
@@ -163,7 +163,7 @@ ANPPaint* NavigationPlugin::getPaint(ANPRectF* input) {
return (input == m_activeNav) ? m_paintActive : m_paintDisabled; return (input == m_activeNav) ? m_paintActive : m_paintDisabled;
} }
int16 NavigationPlugin::handleEvent(const ANPEvent* evt) { int16_t NavigationPlugin::handleEvent(const ANPEvent* evt) {
NPP instance = this->inst(); NPP instance = this->inst();
switch (evt->eventType) { switch (evt->eventType) {

View File

@@ -33,7 +33,7 @@ public:
NavigationPlugin(NPP inst); NavigationPlugin(NPP inst);
virtual ~NavigationPlugin(); virtual ~NavigationPlugin();
virtual bool supportsDrawingModel(ANPDrawingModel); virtual bool supportsDrawingModel(ANPDrawingModel);
virtual int16 handleEvent(const ANPEvent* evt); virtual int16_t handleEvent(const ANPEvent* evt);
private: private:
void draw(ANPCanvas*); void draw(ANPCanvas*);
void drawPlugin(const ANPBitmap& bitmap, const ANPRectI& clip); void drawPlugin(const ANPBitmap& bitmap, const ANPRectI& clip);

View File

@@ -273,7 +273,7 @@ void PaintPlugin::destroySurface() {
} }
} }
int16 PaintPlugin::handleEvent(const ANPEvent* evt) { int16_t PaintPlugin::handleEvent(const ANPEvent* evt) {
switch (evt->eventType) { switch (evt->eventType) {
case kTouch_ANPEventType: { case kTouch_ANPEventType: {
float x = (float) evt->data.touch.x; float x = (float) evt->data.touch.x;

View File

@@ -33,7 +33,7 @@ class PaintPlugin : public SurfaceSubPlugin {
public: public:
PaintPlugin(NPP inst); PaintPlugin(NPP inst);
virtual ~PaintPlugin(); virtual ~PaintPlugin();
virtual int16 handleEvent(const ANPEvent* evt); virtual int16_t handleEvent(const ANPEvent* evt);
virtual jobject getSurface(); virtual jobject getSurface();
private: private:

View File

@@ -103,7 +103,7 @@ void VideoPlugin::destroySurface() {
} }
} }
int16 VideoPlugin::handleEvent(const ANPEvent* evt) { int16_t VideoPlugin::handleEvent(const ANPEvent* evt) {
switch (evt->eventType) { switch (evt->eventType) {
case kLifecycle_ANPEventType: { case kLifecycle_ANPEventType: {
switch (evt->data.lifecycle.action) { switch (evt->data.lifecycle.action) {

View File

@@ -32,7 +32,7 @@ class VideoPlugin : public SurfaceSubPlugin {
public: public:
VideoPlugin(NPP inst); VideoPlugin(NPP inst);
virtual ~VideoPlugin(); virtual ~VideoPlugin();
virtual int16 handleEvent(const ANPEvent* evt); virtual int16_t handleEvent(const ANPEvent* evt);
virtual jobject getSurface(); virtual jobject getSurface();
private: private: