Beispiel #1
0
void MCScreenDC::getkeysdown(MCExecPoint &ep)
{
	BYTE keystates[256];
	ep.clear();
	if (GetKeyboardState((PBYTE)&keystates) == 0) // should use an async function?
		return;
	MCmodifierstate = querymods();
	bool first = true;
	KeySym ksym;
	uint2 i;
	for (i = 0; i < 256; i++)
	{
		if (keystates[i] & 0x80)
		{
			ksym = i;
			if (i <= VK_LAST)
			{
				if (MCmodifierstate & MS_SHIFT || GetKeyState(VK_CAPITAL) & 0x1)
					ksym = shift_keysyms[i];
				else
					ksym = keysyms[i];
			}
			if (ksym > 0)
			{
				ep.concatuint(ksym, EC_COMMA, first);
				first = false;
			}
		}
	}
}
Beispiel #2
0
void MCScreenDC::getkeysdown(MCExecPoint &ep)
{
	char kstring[U4L];
	char km[32];
	ep.clear();
	MCmodifierstate = querymods();
	XQueryKeymap(dpy, km);
	bool first = true;
	uint2 i;
	KeySym ksym;
	for (i = 0; i < 256; i++)
	{
		if (isKeyPressed(km, i))
		{
			ksym = i;
			if (MCmodifierstate & MS_SHIFT || MCmodifierstate & MS_CAPS_LOCK)
				ksym = XKeycodeToKeysym(dpy, i, 1);
			else
				ksym  = XKeycodeToKeysym(dpy, i, 0);
			if (ksym > 0)
			{
				ep.concatuint(ksym, EC_COMMA, first);
				first = false;
			}
		}
	}
}
Beispiel #3
0
//list ciphers and default key lengths for each
void list_ciphers_cb(const OBJ_NAME *name,void *buffer)
{
	if(!islower((unsigned char)*name->name))
		return;
	MCExecPoint *ep = (MCExecPoint *)buffer;
	if (*name->name)
	{
		ep->concatcstring(name->name,EC_RETURN,isfirstcipher);
		isfirstcipher = false;

		const EVP_CIPHER *cipher=EVP_get_cipherbyname(name->name);
		if (cipher)
			ep->concatuint(EVP_CIPHER_key_length(cipher) * 8, EC_COMMA, false);
	}
}
Beispiel #4
0
void MCOldFontlist::getfontsizes(const char *fname, MCExecPoint &ep)
{
	ep.clear();
	if (MCnoui)
		return;
	MCOldFontnode dummynode;
	dummynode.buildtable();
	MCOldFonttablenode *fnptr = dummynode.findtablenode(fname);
	if (fnptr != NULL)
	{
		uint2 i;
		char buffer[U2L];
		for (i = 0 ; i < fnptr->nplain ; i++)
			ep.concatuint(fnptr -> psizes[i], EC_RETURN, i == 0);
	}
}
Exec_stat MCProperty::mode_eval(MCExecPoint& ep)
{
	switch(which)
	{
	case P_REV_MESSAGE_BOX_LAST_OBJECT:
		if (MCmessageboxlastobject != NULL && MCmessageboxlastobject->Exists())
		{
			MCmessageboxlastobject->Get()->names(P_LONG_ID, ep, 0);
			ep.concatnameref(MCmessageboxlasthandler, EC_COMMA, false);
			ep.concatuint(MCmessageboxlastline, EC_COMMA, false);
			if (MCmessageboxlastobject->Get()->getparentscript() != nil)
			{
				MCExecPoint ep2;
				MCmessageboxlastobject->Get()->getparentscript()->GetObject()->names(P_LONG_ID, ep2, 0);
				ep.concatmcstring(ep2.getsvalue(), EC_COMMA, false);
			}
		}
		else
			ep.clear();
		break;
	case P_REV_MESSAGE_BOX_REDIRECT:
		if (MCmessageboxredirect != NULL)
			MCmessageboxredirect -> names(P_LONG_ID, ep, 0);
		else
			ep . clear();
		break;
	case P_REV_LICENSE_LIMITS:
		ep.clear();
		break;
	case P_REV_CRASH_REPORT_SETTINGS:
		ep.clear();
		break;
	case P_REV_LICENSE_INFO:
	{
		if (ep . isempty())
		{
			static const char *s_class_types[] =
			{
				"",
				"Community",
				"Commercial",
				"Professional",
			};

			static const char *s_deploy_targets[] =
			{
				"Windows",
				"Mac OS X",
				"Linux",
				"iOS",
				"Android",
				"Windows Mobile",
				"Linux Mobile",
				"Server",
				"iOS Embedded",
				"Android Embedded",
			};

			ep . clear();
			ep . concatcstring(MClicenseparameters . license_name, EC_RETURN, true);
			ep . concatcstring(MClicenseparameters . license_organization, EC_RETURN, false);
			ep . concatcstring(s_class_types[MClicenseparameters . license_class], EC_RETURN, false);
			ep . concatuint(MClicenseparameters . license_multiplicity, EC_RETURN, false);
			
			ep . appendnewline();
			if (MClicenseparameters . deploy_targets != 0)
			{
				bool t_first;
				t_first = true;
				for(uint32_t i = 0; i < 9; i++)
				{
					if ((MClicenseparameters . deploy_targets & (1 << i)) != 0)
					{
						ep . concatcstring(s_deploy_targets[i], EC_COMMA, t_first);
						t_first = false;
					}
				}
			}

			ep . appendnewline();
			if (MClicenseparameters . addons != nil)
			{
				MCHashentry *t_entry;
				uint32_t t_index;
				bool t_first;
				t_first = true;
				t_entry = NULL;
				t_index = 0;
				for(;;)
				{
					t_entry = MClicenseparameters . addons -> get_array() -> getnextkey(t_index, t_entry);
					if (t_entry == NULL)
						break;

					ep . concatcstring(t_entry -> string, EC_COMMA, t_first);
					t_first = false;
				}
			}

			ep . concatcstring(MCnullmcstring == MClicenseparameters . license_token ? "Global" : "Local", EC_RETURN, false);
		}
		else
		{
			if (MClicenseparameters . addons == nil ||
				MClicenseparameters . addons -> fetch_element(ep, ep . getsvalue(), false) != ES_NORMAL)
				ep . clear();
		}
	}
	break;
#ifdef FEATURE_PROPERTY_LISTENER
	// MM-2012-09-05: [[ Property Listener ]]
	case P_REV_OBJECT_LISTENERS:
		MCInternalObjectListenerListListeners(ep);
		break;
	case P_REV_PROPERTY_LISTENER_THROTTLE_TIME:
		ep.setnvalue(MCpropertylistenerthrottletime);
		break;
#endif			
	default:
		return ES_NOT_HANDLED;
	}

	return ES_NORMAL;
}