271
272
273
274
275
276
277
|
};
namespace pp {
Module *CreateModule() {
return(new CACKeyModule());
}
}
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
|
};
namespace pp {
Module *CreateModule() {
return(new CACKeyModule());
}
}
#include "ppapi/c/ppb_core.h"
static PP_Bool isMainThread(void) {
return((PP_Bool) true);
}
extern "C" const void *ifaces(const char *name) {
fprintf(stderr, "Asked to give an interface for \"%s\"\n", name);
if (strcmp(name, "PPB_Core;1.0") == 0) {
static struct PPB_Core_1_0 x = {0};
x.IsMainThread = isMainThread;
fprintf(stderr, "Returning x\n");
return(&x);
}
return(NULL);
}
extern "C" int main(int argc, char **argv) {
pp::Module *mod;
pp::Instance *inst;
PP_Instance instance = 0;
mod = new CACKeyModule();
mod->InternalInit(mod->pp_module(), ifaces);
inst = new CACKeyInstance(instance, mod->core());
{
pp::Var *message;
pp::VarDictionary messageDict;
messageDict.Set("target", "cackey");
messageDict.Set("command", "init");
message = new pp::Var(messageDict.pp_var());
inst->HandleMessage(*message);
}
printf("Hello, World !, inst = %p\n", inst);
return(0);
}
|