Diff

Differences From Artifact [77c6f00e8d]:

To Artifact [2d769e72a7]:


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