Ejemplo n.º 1
0
void MCAdPostMessage(MCAd *p_ad, MCAdEventType p_type)
{
    MCCustomEvent *t_event;
    t_event = new MCAdEvent(p_ad, p_type);
    if (t_event != nil)
        MCEventQueuePostCustom(t_event);
}
Ejemplo n.º 2
0
void MCSensorPostChangeMessage(MCSensorType p_sensor)
{
    MCCustomEvent *t_event = nil;
    t_event = FetchSensorEvent(p_sensor);
    if (t_event != nil)
        MCEventQueuePostCustom(t_event);
}
Ejemplo n.º 3
0
static bool MCS_loadurl_callback(void *p_context, MCSystemUrlStatus p_status, const void *p_data)
{
    MCSLoadUrlState *context;
    context = static_cast<MCSLoadUrlState *>(p_context);

    context -> status = p_status;

    if (p_status == kMCSystemUrlStatusError)
        MCMemoryDelete(context->data.bytes);
    else if (p_status == kMCSystemUrlStatusLoading)
    {
        const MCString *t_data = static_cast<const MCString*>(p_data);
        MCMemoryReallocate(context->data.bytes, context->data.size + t_data->getlength(), context->data.bytes);
        MCMemoryCopy(static_cast<uint8_t*>(context->data.bytes) + context->data.size, t_data->getstring(), t_data->getlength());
        context->data.size += t_data->getlength();
    }

    send_url_progress(context -> object, p_status, context -> url, context -> data . size, context -> total, (const char *)p_data);

    if (p_status == kMCSystemUrlStatusError || p_status == kMCSystemUrlStatusFinished)
    {
        MCUrlLoadEvent *t_event;
        t_event = MCUrlLoadEvent::CreateUrlLoadEvent(context->object, context->message, context->url, p_status, context->data.bytes, context->data.size, static_cast<const char *>(p_data));
        if (t_event)
            MCEventQueuePostCustom(t_event);
        context->object->Release();
        MCCStringFree(context->url);
        MCNameDelete(context->message);
        MCMemoryDelete(context);
    }
    return true;
}
Ejemplo n.º 4
0
static void send_url_progress(MCObjectHandle *p_object, MCSystemUrlStatus p_status, const char *p_url, int32_t p_amount, int32_t& x_total, const char *p_data)
{
    if (p_status == kMCSystemUrlStatusNegotiated)
        x_total = *(int32_t*)p_data;

    MCUrlProgressEvent *t_event;
    t_event = MCUrlProgressEvent::CreateUrlProgressEvent(p_object, p_url, p_status, p_amount, x_total, p_data);
    if (t_event)
        MCEventQueuePostCustom(t_event);
}
Ejemplo n.º 5
0
bool MCStorePostProductRequestError(MCStringRef p_product, MCStringRef p_error)
{
    bool t_success;
    MCCustomEvent *t_event = nil;
    t_event = new MCStoreProductRequestErrorEvent(p_product, p_error);
    t_success = t_event != nil;
    
    if (t_success)
        MCEventQueuePostCustom(t_event);
    
    return t_success;
}
Ejemplo n.º 6
0
bool MCStorePostProductRequestResponse(MCStringRef p_product_id)
{
    bool t_success;
    MCCustomEvent *t_event = nil;
    t_event = new MCStoreProductRequestResponseEvent(p_product_id);
    t_success = t_event != nil;
    
    if (t_success)
        MCEventQueuePostCustom(t_event);
    
    return t_success;
}
Ejemplo n.º 7
0
JNIEXPORT void JNICALL Java_com_runrev_android_nativecontrol_ScrollerControl_doScrollChanged(JNIEnv *env, jobject object, jint left, jint top)
{
    MCAndroidControl *t_control = nil;
    char *t_url = nil;
    
    if (MCAndroidControl::FindByView(object, t_control))
    {
        MCAndroidScrollerControl *t_scroller = (MCAndroidScrollerControl*)t_control;
        if (t_scroller->CanPostScrollEvent())
        {
            t_scroller->SetCanPostScrollEvent(false);
            MCCustomEvent *t_event;
            t_event = new (nothrow) MCNativeScrollerScrollEvent(t_scroller);
            MCEventQueuePostCustom(t_event);
        }
    }
}
Ejemplo n.º 8
0
JNIEXPORT void JNICALL Java_com_runrev_android_nativecontrol_VideoControl_doPropertyAvailable(JNIEnv *env, jobject object, jint availableProperty)
{
    MCLog("doPropertyAvailable", nil);
    MCAndroidControl *t_control = nil;
    
    if (MCAndroidControl::FindByView(object, t_control))
    {
        const char *t_prop_name = nil;
        switch (availableProperty)
        {
            case kMCPlayerAvailablePropertyDuration:
                t_prop_name = "duration";
                break;
            case kMCPlayerAvailablePropertyNaturalSize:
                t_prop_name = "naturalSize";
                break;
        }
        MCAndroidPlayerControl *t_player = (MCAndroidPlayerControl*)t_control;
        MCCustomEvent *t_event;
        t_event = new MCNativePlayerPropertyAvailableEvent(t_player, t_prop_name);
        MCEventQueuePostCustom(t_event);
    }
}
Ejemplo n.º 9
0
void MCSensorPostErrorMessage(MCSensorType p_sensor, MCStringRef p_error)
{
    MCCustomEvent *t_event = nil;
	t_event = new (nothrow) MCSensorErrorEvent(p_sensor, p_error);
	MCEventQueuePostCustom(t_event);
}
Ejemplo n.º 10
0
void MCAndroidOrientationChanged(int orientation)
{
//	MCLog("MCAndroidOrientationChanged(%d)", orientation);
	MCCustomEvent *t_orientation_event = new MCOrientationChangedEvent();
	MCEventQueuePostCustom(t_orientation_event);
}