Ejemplo n.º 1
0
Exec_stat MCHandleAdGetTopLeft(void *context, MCParameter *p_parameters)
{
	bool t_success;
	t_success = true;
    
    MCExecPoint ep(nil, nil, nil);
    MCExecContext t_ctxt(ep);
	t_ctxt . SetTheResultToEmpty();
    
	char *t_ad;
	t_ad = nil;
	if (t_success)
		t_success = MCParseParameters(p_parameters, "s", &t_ad);
	
    MCAdTopLeft t_top_left = {0,0};
	if (t_success)
		t_success = MCAdGetTopLeftOfAd(t_ctxt, t_ad, t_top_left);
    
    if (t_success)
    {
        MCAutoRawCString t_top_left_string;
        t_success = MCCStringFormat(t_top_left_string, "%u,%u", t_top_left.x, t_top_left.y);
        if (t_success)
            if (t_top_left_string.Borrow() != nil)
                ep.copysvalue(t_top_left_string.Borrow());
    }
    
    if (t_success)
        MCresult->store(ep, False);
    
    MCCStringFree(t_ad);
    
    return t_ctxt.GetStat();
}
Ejemplo n.º 2
0
Exec_stat MCHandleAdSetTopLeft(void *context, MCParameter *p_parameters)
{
	bool t_success;
	t_success = true;
    
    MCExecPoint ep(nil, nil, nil);
    MCExecContext t_ctxt(ep);
	t_ctxt . SetTheResultToEmpty();
    
	char *t_ad;
	t_ad = nil;
    char *t_top_left_string;
    t_top_left_string = nil;
	if (t_success)
		t_success = MCParseParameters(p_parameters, "ss", &t_ad, &t_top_left_string);
    
    MCAdTopLeft t_top_left = {0,0};
    if (t_success)
        t_success = sscanf(t_top_left_string, "%u,%u", &t_top_left.x, &t_top_left.y);
    
	if (t_success)
		MCAdSetTopLeftOfAd(t_ctxt, t_ad, t_top_left);
    
    MCCStringFree(t_top_left_string);
    MCCStringFree(t_ad);
    
    return t_ctxt.GetStat();
}
Ejemplo n.º 3
0
Exec_stat MCHandleAdGetVisible(void *context, MCParameter *p_parameters)
{
	bool t_success;
	t_success = true;
    
    MCExecPoint ep(nil, nil, nil);
    MCExecContext t_ctxt(ep);
	t_ctxt . SetTheResultToEmpty();
    
	char *t_ad;
	t_ad = nil;
	if (t_success)
		t_success = MCParseParameters(p_parameters, "s", &t_ad);
	
    bool t_visible;
    t_visible = false;
	if (t_success)
		t_success = MCAdGetVisibleOfAd(t_ctxt, t_ad, t_visible);
    
    if (t_success)
        MCresult->sets(MCU_btos(t_visible));
    
    MCCStringFree(t_ad);
    
    return t_ctxt.GetStat();
}
Ejemplo n.º 4
0
Exec_stat MCHandleStartActivityIndicator(void *p_context, MCParameter *p_parameters)
{
#ifdef /* MCHandleStartActivityIndicator */ LEGACY_EXEC
    MCActivityIndicatorType t_indicator_type;
    t_indicator_type = kMCActivityIndicatorWhite;
    
    char *t_style;
    t_style = nil;
    
    MCLocation t_location;
    t_location.x = -1;
    t_location.y = -1;
    
    MCExecPoint ep(nil, nil, nil);
    if (p_parameters != nil)
    {
        p_parameters->eval(ep);
        // Provide backwards compatibility here for "whiteLarge" rather than "large white".
        if (MCCStringEqualCaseless (ep.getsvalue().getstring(), "whiteLarge"))
            MCCStringClone("large white", t_style);
        else
            t_style = ep.getsvalue().clone();
        if (t_style != nil)
            p_parameters = p_parameters->getnext();
    }
    
    if (p_parameters != nil)
    {
        p_parameters->eval(ep);
        if (ep.getformat() != VF_STRING || ep.ston() == ES_NORMAL)
        {
            t_location.x = ep.getint4();
            p_parameters = p_parameters->getnext();
            if (p_parameters != nil)
            {
                p_parameters->eval(ep);
                if (ep.getformat() != VF_STRING || ep.ston() == ES_NORMAL)
                {
                    t_location.y = ep.getint4();
                    p_parameters = p_parameters->getnext();
                }
            }
        }
        if (t_location.y == -1)
            t_location.x = -1;
    }

    MCExecContext t_ctxt(ep);
	t_ctxt . SetTheResultToEmpty();

	if (t_style != nil)
		t_indicator_type = MCActivityIndicatorTypeFromCString(t_style);
    MCActivityIndicatorExecStart(t_ctxt, t_indicator_type, t_location);
    return t_ctxt.GetStat();
#endif /* MCHandleStartActivityIndicator */
}
Ejemplo n.º 5
0
Exec_stat MCHandleCreateContact(void *context, MCParameter *p_parameters) // ABNewPersonViewController
{
    int32_t r_result;
    MCExecPoint ep(nil, nil, nil);
    MCExecContext t_ctxt(ep);
    t_ctxt.SetTheResultToEmpty();
    // Call the Exec implementation
    MCCreateContactExec(t_ctxt);
    // Set return value
	return t_ctxt.GetStat();
}
Ejemplo n.º 6
0
Exec_stat MCHandleStopActivityIndicator(void *p_context, MCParameter *p_parameters)
{
#ifdef /* MCHandleStopActivityIndicator */ LEGACY_EXEC
    MCExecPoint ep(nil, nil, nil);
    
    MCExecContext t_ctxt(ep);
	t_ctxt . SetTheResultToEmpty();
    
    MCActivityIndicatorExecStop(t_ctxt);
    
    return t_ctxt.GetStat();
#endif /* MCHandleStopActivityIndicator */
}
Ejemplo n.º 7
0
Exec_stat MCHandleAddContact(void *context, MCParameter *p_parameters)
{
    MCExecPoint ep(nil, nil, nil);
    // Handle parameters. We are doing that in a dedicated call
	MCVariableValue *t_contact;
	
	/* UNCHECKED */ MCParseParameters(p_parameters, "a", &t_contact);

    MCExecContext t_ctxt(ep);
    // Call the Exec implementation
    MCAddContactExec(t_ctxt, t_contact);
    // Set return value
    return t_ctxt.GetStat();
}
Ejemplo n.º 8
0
Exec_stat MCHandleAdCreate(void *context, MCParameter *p_parameters)
{
	bool t_success;
	t_success = true;
		
    MCExecPoint ep(nil, nil, nil);
    MCExecContext t_ctxt(ep);
	t_ctxt . SetTheResultToEmpty();
    	
	char *t_ad;
	t_ad = nil;
	if (t_success)
		t_success = MCParseParameters(p_parameters, "s", &t_ad);	
    
    MCAdType t_type;
    t_type = kMCAdTypeUnknown;
    if (t_success)
    {
        char *t_type_string;
        t_type_string = nil;
        if (MCParseParameters(p_parameters, "s", &t_type_string))
            t_type = MCAdTypeFromCString(t_type_string);
        MCCStringFree(t_type_string);
    }
    
    MCAdTopLeft t_top_left = {0,0};
    if (t_success)
    {
        char *t_top_left_string;
        t_top_left_string = nil;
        if (MCParseParameters(p_parameters, "s", &t_top_left_string))
            /* UNCHECKED */ sscanf(t_top_left_string, "%u,%u", &t_top_left.x, &t_top_left.y);
        MCCStringFree(t_top_left_string);
    }
    
    MCVariableValue *t_meta_data;
    t_meta_data = nil;
    if (t_success)
        MCParseParameters(p_parameters, "a", &t_meta_data);

	if (t_success)
		MCAdExecCreateAd(t_ctxt, t_ad, t_type, t_top_left, t_meta_data);
    
    MCCStringFree(t_ad);
	    
    return t_ctxt.GetStat();
}
Ejemplo n.º 9
0
Exec_stat MCHandleRemoveContact(void *context, MCParameter *p_parameters)
{
    MCExecPoint ep(nil, nil, nil);
	ep . clear();
    int32_t t_contact_id = 0;
    // Handle parameters.
    if (p_parameters)
    {
        p_parameters->eval(ep);
        t_contact_id = atoi (ep.getsvalue().getstring());
    }
    MCExecContext t_ctxt(ep);
    t_ctxt.SetTheResultToEmpty();
    // Call the Exec implementation
    MCRemoveContactExec(t_ctxt, t_contact_id);
    // Set return value
    return t_ctxt.GetStat();
}
Ejemplo n.º 10
0
Exec_stat MCHandleFindContact(void *context, MCParameter *p_parameters)
{
    const char *t_contact_name = NULL;
    const char *r_result = NULL;
    MCExecPoint ep(nil, nil, nil);
	ep . clear();
    // Handle parameters.
    if (p_parameters)
    {
        p_parameters->eval(ep);
        t_contact_name = ep.getcstring();
    }
    MCExecContext t_ctxt(ep);
    t_ctxt.SetTheResultToEmpty();
    // Call the Exec implementation
    MCFindContactExec(t_ctxt, t_contact_name);
    // Set return value
    return t_ctxt.GetStat();
}
Ejemplo n.º 11
0
Exec_stat MCHandleGetContactData(void *context, MCParameter *p_parameters)
{
    MCExecPoint ep(nil, nil, nil);
	ep . clear();
    int32_t t_contact_id = 0;
    // Handle parameters.
    if (p_parameters)
    {
        p_parameters->eval(ep);
        t_contact_id = atoi (ep.getsvalue().getstring());
    }
    MCExecContext t_ctxt(ep);
    t_ctxt.SetTheResultToEmpty();
    // Call the Exec implementation
    MCGetContactDataExec(t_ctxt, t_contact_id);
    if (MCresult->isempty())
        MCresult->store(ep, True);
	return t_ctxt.GetStat();
}
Ejemplo n.º 12
0
Exec_stat MCHandleAdDelete(void *context, MCParameter *p_parameters)
{
	bool t_success;
	t_success = true;
    
    MCExecPoint ep(nil, nil, nil);
    MCExecContext t_ctxt(ep);
	t_ctxt . SetTheResultToEmpty();
    
	char *t_ad;
	t_ad = nil;
	if (t_success)
		t_success = MCParseParameters(p_parameters, "s", &t_ad);
	
	if (t_success)
		MCAdExecDeleteAd(t_ctxt, t_ad);
    
    MCCStringFree(t_ad);
    
    return t_ctxt.GetStat();
}
Ejemplo n.º 13
0
Exec_stat MCHandleAdRegister(void *context, MCParameter *p_parameters)
{
	bool t_success;
	t_success = true;
    
    MCExecPoint ep(nil, nil, nil);
    MCExecContext t_ctxt(ep);
	t_ctxt . SetTheResultToEmpty();
    
	char *t_key;
	t_key = nil;
	if (t_success)
		t_success = MCParseParameters(p_parameters, "s", &t_key);
	
	if (t_success)
		MCAdExecRegisterWithInneractive(t_ctxt, t_key);
    
    MCCStringFree(t_key);
    
    return t_ctxt.GetStat();
}
Ejemplo n.º 14
0
Exec_stat MCHandleAds(void *context, MCParameter *p_parameters)
{
    bool t_success;
    t_success = true;
    
    MCExecPoint ep(nil, nil, nil);
    MCExecContext t_ctxt(ep);
	t_ctxt . SetTheResultToEmpty();
        
    if (t_success)
    {
        MCAutoRawCString t_ads;
        t_success = MCAdGetAds(t_ctxt, t_ads);
        if (t_success && t_ads.Borrow() != nil)
            ep.copysvalue(t_ads.Borrow());
    }

    if (t_success)
        MCresult->store(ep, False);
    
    return t_ctxt.GetStat();
}
Ejemplo n.º 15
0
// MM-2013-02-04: [[ Bug 10642 ]] Added new optional opacity parameter to busy indicator.
Exec_stat MCHandleStartBusyIndicator(void *p_context, MCParameter *p_parameters)
{
#ifdef /* MCHandleStartBusyIndicator */ LEGACY_EXEC
    MCBusyIndicatorType t_indicator_type;
    MCExecPoint ep(nil, nil, nil);
    
    if (p_parameters)
    {
        p_parameters -> eval(ep);
        t_indicator_type = MCBusyIndicatorTypeFromCString(ep . getcstring());
        p_parameters = p_parameters -> getnext();
    }
    
    const char *t_label;
    t_label = nil;
    if (p_parameters)
    {
        p_parameters -> eval(ep);
        t_label = ep . getcstring();
        p_parameters = p_parameters -> getnext();
    }
    
    int32_t t_opacity;
    t_opacity = -1;
    if (p_parameters)
    {
        p_parameters -> eval(ep);
        t_opacity = ep . getint4();
        if (t_opacity < 0 || t_opacity > 100)
            t_opacity = -1;
    }
    
    MCExecContext t_ctxt(ep);
	t_ctxt . SetTheResultToEmpty();
    MCBusyIndicatorExecStart(t_ctxt, kMCBusyIndicatorSquare, t_label, t_opacity);
    return t_ctxt.GetStat();
#endif /* MCHandleStartBusyIndicator */
}