Esempio n. 1
0
SoCallbackAction::Response
SoToVRMLActionP::vrmltransform_cb(void * closure, SoCallbackAction * action, const SoNode * node)
{
  push_cb(closure, action, node);
  const SoVRMLTransform * oldt = coin_assert_cast<const SoVRMLTransform *>(node);
  SoTransform * newt = NEW_NODE(SoTransform, node);

  newt->translation = oldt->translation.getValue();
  newt->rotation = oldt->rotation.getValue();
  newt->scaleFactor = oldt->scale.getValue();
  newt->scaleOrientation = oldt->scaleOrientation.getValue();
  newt->center = oldt->center.getValue();
  THISP(closure)->get_current_tail()->addChild(newt);
  return SoCallbackAction::CONTINUE;
}
Esempio n. 2
0
/**
 * Send a command to x3270.
 *
 * @param[in] cmd       command to send, not including the newline and
 * @param[in] callback  callback function for completion
 * @param[in] handle    handle to pass to completion callback function
 * @param[in] content_type How to handle content
 *
 * @return sendto_t
 */
sendto_t
hio_to3270(const char *cmd, sendto_callback_t *callback, void *dhandle,
	content_t content_type)
{
    static sms_cb_t httpd_cb = { "HTTPD", IA_SCRIPT, hio_data, hio_complete };
    size_t sl;
    session_t *s = httpd_mhandle(dhandle);

    sl = strlen(cmd);
    if (sl == 0) {
	/* No empty commands, please. */
	return SENDTO_INVALID;
    }

    /* Remove any trailing NL or CR/LF. */
    if (cmd[sl - 1] == '\n') {
	sl--;
    }
    if (sl && cmd[sl - 1] == '\r') {
	sl--;
    }
    if (!sl || strchr(cmd, '\r') != NULL || strchr(cmd, '\n') != NULL) {
	/* No empty commands, and no embedded CRs or LFs. */
	return SENDTO_INVALID;
    }

    /* Enqueue the command. */
    s->pending.callback = callback;
    s->pending.content_type = content_type;
    s->pending.done = false;
    push_cb(cmd, sl, &httpd_cb, s);

    /*
     * It's possible for the command to have completed already.
     * If so, return SENDTO_COMPLETE.
     * Otherwise, it's just queued; return SENDTO_PENDING.
     */
    return s->pending.done? SENDTO_COMPLETE: SENDTO_PENDING;
}
Esempio n. 3
0
SoCallbackAction::Response
SoToVRMLActionP::vrmlshape_cb(void * closure, SoCallbackAction * action, const SoNode * node)
{
  push_cb(closure, action, node);
  return SoCallbackAction::CONTINUE;
}