JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNRepos_hotcopy
(JNIEnv *env, jobject jthis, jobject jpath, jobject jtargetPath,
 jboolean jcleanLogs, jboolean jincremental, jobject jnotifyCallback)
{
  JNIEntry(SVNRepos, hotcopy);
  SVNRepos *cl = SVNRepos::getCppObject(jthis);
  if (cl == NULL)
    {
      JNIUtil::throwError(_("bad C++ this"));
      return;
    }

  File path(jpath);
  if (JNIUtil::isExceptionThrown())
    return;

  File targetPath(jtargetPath);
  if (JNIUtil::isExceptionThrown())
    return;

  ReposNotifyCallback notifyCallback(jnotifyCallback);

  cl->hotcopy(path, targetPath, jcleanLogs ? true : false,
              jincremental ? true : false,
              jnotifyCallback != NULL ? &notifyCallback : NULL);
}
	CG::InteractionResult Dropdown::mouseButtonEvent(const MouseButtonEvent &ev) {
		CG::InteractionResult result;

		if (ev.eventType != MouseButtonEvent::PRESSED || ev.button != 0) {
			return result;
		}

		if (isActive()) {
			setActiveState(false);

			result.contolStateChanged = true;

			int currentSelection = _getSelectionLineAtLocation(ev.x, ev.y);

			if (currentSelection != NOTHING_SELECTED) {
				result.newDataAvailable = true;
				result.newControlState = _selectionOptions.at(currentSelection).id;
				result.newStateLabel = _selectionOptions.at(currentSelection).label;

				setSelectedOption(currentSelection);

				notifyCallback();
			}

		} else {
			if (boundingBox.inside(ev.x, ev.y)) {
				setActiveState(true);
				result.contolStateChanged = true;
			}
		}

		return result;
	}
Exemplo n.º 3
0
status_t BnTestClient::onTransact(uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) {
    switch(code) {
        case NOTIFY_CALLBACK: {
            notifyCallback(data.readInt32());
            return NO_ERROR;
        } break;
        default:
            return BBinder::onTransact(code, data, reply, flags);
    }              
}
JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNRepos_load(
    JNIEnv *env, jobject jthis, jobject jpath, jobject jinputData,
    jobject jrevisionStart, jobject jrevisionEnd,
    jboolean jignoreUUID, jboolean jforceUUID,
    jboolean jusePreCommitHook, jboolean jusePostCommitHook,
    jboolean jvalidateProps, jboolean jignoreDates, jboolean jnormalizeProps,
    jstring jrelativePath, jobject jnotifyCallback)
{
  JNIEntry(SVNRepos, load);
  SVNRepos *cl = SVNRepos::getCppObject(jthis);
  if (cl == NULL)
    {
      JNIUtil::throwError(_("bad C++ this"));
      return;
    }

  File path(jpath);
  if (JNIUtil::isExceptionThrown())
    return;

  InputStream inputData(jinputData);
  if (JNIUtil::isExceptionThrown())
    return;

  JNIStringHolder relativePath(jrelativePath);
  if (JNIUtil::isExceptionThrown())
    return;

  Revision revisionStart(jrevisionStart);
  if (JNIUtil::isExceptionThrown())
    return;

  Revision revisionEnd(jrevisionEnd, true);
  if (JNIUtil::isExceptionThrown())
    return;

  ReposNotifyCallback notifyCallback(jnotifyCallback);

  cl->load(path, inputData, revisionStart, revisionEnd,
           jignoreUUID ? true : false,
           jforceUUID ? true : false,
           jusePreCommitHook ? true : false,
           jusePostCommitHook ? true : false,
           jvalidateProps ? true : false,
           jignoreDates ? true : false,
           jnormalizeProps ? true : false,
           relativePath,
           (jnotifyCallback != NULL ? &notifyCallback : NULL));
}
	CG::InteractionResult CheckBox::mouseButtonEvent(const MouseButtonEvent &ev) {

		CG::InteractionResult result;

		if ((ev.eventType == MouseButtonEvent::PRESSED) && (boundingBox.inside(ev.x, ev.y))) {
			_checked = !_checked;
			result.newDataAvailable = true;
			result.newControlState = _checked ? 1 : 0;

			notifyControlNeedsRedraw();
			notifyCallback();
		}

		return result;
	}
Exemplo n.º 6
0
status_t BnCameraClient::onTransact(
    uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
    switch(code) {
        case NOTIFY_CALLBACK: {
            ALOGV("NOTIFY_CALLBACK");
            CHECK_INTERFACE(ICameraClient, data, reply);
            int32_t msgType = data.readInt32();
            int32_t ext1    = data.readInt32();
            int32_t ext2    = 0;
            if ((msgType == CAMERA_MSG_PREVIEW_FRAME) && (ext1 == CAMERA_FRAME_DATA_FD)) {
                ext2 = data.readFileDescriptor();
                ALOGD("onTransact: CAMERA_MSG_PREVIEW_FRAME fd = %d", ext2);
            } else {
                ext2 = data.readInt32();
            }
            notifyCallback(msgType, ext1, ext2);
            return NO_ERROR;
        } break;
        case DATA_CALLBACK: {
            ALOGV("DATA_CALLBACK");
            CHECK_INTERFACE(ICameraClient, data, reply);
            int32_t msgType = data.readInt32();
            sp<IMemory> imageData = interface_cast<IMemory>(data.readStrongBinder());
            camera_frame_metadata_t *metadata = NULL;
            if (data.dataAvail() > 0) {
                metadata = new camera_frame_metadata_t;
                metadata->number_of_faces = data.readInt32();
                metadata->faces = (camera_face_t *) data.readInplace(
                        sizeof(camera_face_t) * metadata->number_of_faces);
            }
            dataCallback(msgType, imageData, metadata);
            if (metadata) delete metadata;
            return NO_ERROR;
        } break;
        case DATA_CALLBACK_TIMESTAMP: {
            ALOGV("DATA_CALLBACK_TIMESTAMP");
            CHECK_INTERFACE(ICameraClient, data, reply);
            nsecs_t timestamp = data.readInt64();
            int32_t msgType = data.readInt32();
            sp<IMemory> imageData = interface_cast<IMemory>(data.readStrongBinder());
            dataCallbackTimestamp(timestamp, msgType, imageData);
            return NO_ERROR;
        } break;
        default:
            return BBinder::onTransact(code, data, reply, flags);
    }
}
status_t BnPeriperalManagerCb::onTransact(uint32_t code, const Parcel &data,
                                               Parcel *reply, uint32_t flags) {
    switch (code) {
    case NOTIFY_CALLBACK: {
        CHECK_INTERFACE(IPeriperalManagerCb, data, reply);
        int32_t event = data.readInt32();
        notifyCallback(event);
        data.readExceptionCode();
        return NO_ERROR;
    }
    break;

    default:
        return BBinder::onTransact(code, data, reply, flags);
    }
}
status_t BnHelloWorldClient::onTransact( uint32_t code,
                                 const Parcel & data,
                                 Parcel * reply,
                                 uint32_t flags)
{
    switch(code)
    {
        case NOTIFY_CALLBACK: {
            printf("bn notifyCallback.\n");
            CHECK_INTERFACE(IHelloWorldClient,data,reply);
            int32_t msgType = data.readInt32();
            int32_t ext1 = data.readInt32();
            int32_t ext2 = data.readInt32();
            notifyCallback(msgType, ext1, ext2);
            return NO_ERROR;
        } break;
        default:
            return BBinder::onTransact(code, data, reply, flags);
    }
}
Exemplo n.º 9
0
NotifyObject::NotifyObject(MainWindow *mainWin) : QObject(mainWin)
{
    this->mainWin = mainWin;

    // DBus interfaces

    QDBusConnection dbus = QDBusConnection::sessionBus();

    notifierBus = new DBusNotificationsIf(HD_NOTIFICATION_MANAGER_DBUS_NAME,
                                          HD_NOTIFICATION_MANAGER_DBUS_PATH,
                                          dbus,this);

    sndVibBus = new DBusNokiaHildonSVNDIf(HD_SV_NOTIFICATION_DAEMON_DBUS_NAME,
                                          HD_SV_NOTIFICATION_DAEMON_DBUS_PATH,
                                          dbus,this);

    connect(notifierBus,SIGNAL(ActionInvoked(uint,QString)),
            this,SLOT(notifyCallback(uint,QString)));

    connect(notifierBus,SIGNAL(NotificationClosed(uint,uint)),
            this,SLOT(deleteNotify(uint,uint)));
}
JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNRepos_dump
(JNIEnv *env, jobject jthis, jobject jpath, jobject jdataout,
 jobject jrevisionStart, jobject jrevisionEnd, jboolean jincremental,
 jboolean juseDeltas, jobject jnotifyCallback)
{
  JNIEntry(SVNRepos, dump);
  SVNRepos *cl = SVNRepos::getCppObject(jthis);
  if (cl == NULL)
    {
      JNIUtil::throwError(_("bad C++ this"));
      return;
    }

  File path(jpath);
  if (JNIUtil::isExceptionThrown())
    return;

  OutputStream dataOut(jdataout);
  if (JNIUtil::isExceptionThrown())
    return;

  Revision revisionStart(jrevisionStart);
  if (JNIUtil::isExceptionThrown())
    return;

  Revision revisionEnd(jrevisionEnd);
  if (JNIUtil::isExceptionThrown())
    return;

  ReposNotifyCallback notifyCallback(jnotifyCallback);

  cl->dump(path, dataOut, revisionStart, revisionEnd,
           jincremental ? true : false, juseDeltas ? true : false,
           jnotifyCallback != NULL ? &notifyCallback : NULL);
}
Exemplo n.º 11
0
void Camera::binderDied(const wp<IBinder>& who) {
    ALOGW("ICamera died");
    notifyCallback(CAMERA_MSG_ERROR, CAMERA_ERROR_SERVER_DIED, 0);
}
Exemplo n.º 12
0
void CameraBase<TCam, TCamTraits>::binderDied(const wp<IBinder>& who) {
    ALOGW("mediaserver's remote binder Camera object died");
    notifyCallback(CAMERA_MSG_ERROR, CAMERA_ERROR_SERVER_DIED, /*ext2*/0);
}