const char *
COMgetName (COMobject cObj)
{
  nsresult rv;
  nsISupports *_cObj = NS_STATIC_CAST (nsISupports *, cObj);
  nsCOMPtr <swarmITyping> typing (do_QueryInterface (_cObj));

  if (!typing)
    {
      nsCOMPtr <nsIXPConnectJSObjectHolder> jsObj (do_QueryInterface (_cObj));

      if (jsObj)
        return "[wrapped JavaScript]";
      else
        abort ();
    }
  else
    {
      nsCID *cid;

      rv = typing->GetCID (&cid);
      if (NS_FAILED (rv))
        abort ();

      return COMgetComponentName (cid);
    }
}
COMclass
COMgetClass (COMobject cObj)
{
  nsresult rv;
  nsISupports *_cObj = NS_STATIC_CAST (nsISupports *, cObj);
  nsCOMPtr <swarmITyping> typing (do_QueryInterface (_cObj));

  if (!typing)
    return NULL;
  else
    {
      nsCID *cid;

      rv = typing->GetCID (&cid);
      if (NS_FAILED (rv))
        abort ();

      return (COMclass) cid;
    }
}
Exemplo n.º 3
0
void Input::handle(sf::Uint32 unicode) {
	auto text = getString();
	bool allowed = true;
	if (unicode == '\b') {
		// handle backspace
		text = text.substring(0u, text.getSize() - 1u);
	} else {
		allowed = isAllowed(unicode);
		if (allowed) {
			// add character
			text += unicode;
		}
	}
	if (allowed) {
		setString(text);
	}
	if (typing != nullptr) {
		typing(unicode, allowed);
	}
}
Exemplo n.º 4
0
int main()
{

    Sleep(5000);

    for (; logout==0;)
    {
        ReadyToRead();

        ReadText();

        action();

        typing();


        logout = 1;
    }

    return 0;
}