Example #1
0
/* berechnet die Breite der Y-Achsen Beschriftung */
static gint get_y_label_width(CoordSystem *coord, PangoLayout *layout)
{
    gint pos, neg, title;

    pos = get_number_size(coord->max_y, coord->fract_y, WIDTH, layout);
    neg = get_number_size(coord->min_y, coord->fract_y, WIDTH, layout);
    title = get_text_size(WIDTH, layout, "%s [%s]",
                          coord->y_title, coord->y_unit);

    return max_n(3, pos, neg, title);
}
Example #2
0
/* berechnet die Höhe der X-Achsen Beschriftung */
static gint get_x_label_height(CoordSystem *coord, PangoLayout *layout)
{
    gint pos, neg, title;

    pos = get_number_size(coord->max_x, coord->fract_x, HEIGHT, layout);
    neg = get_number_size(coord->min_x, coord->fract_x, HEIGHT, layout);
    layout_printf(layout, "%s [%s]", coord->x_title, coord->x_unit);
    title = get_text_size(HEIGHT, layout, "%s [%s]",
                          coord->x_title, coord->x_unit);

    return max_n(3, pos, neg, title);
}
Example #3
0
File: libsql.c Project: kulhos/pip
/*-------------------------------------------------------------------*/
int ProfileConnect (	const unsigned char *param_user_id,
			const unsigned char *password,
			const unsigned char *mtm_address,
			char  unsigned *profile_reply,
			const unsigned char *tlo)
{
#define number_offset 6

        int error_code, timeout = 60, i, j, k, num_size;
        STR_DESCRIPTOR request, reply;
        char reply_buffer[MAX_MSG_SIZE],request_buffer[MAX_MSG_SIZE+1];
	MTM_MSG_HEADER  *mess_header;
	unsigned char *(header_and_message[6]);
	unsigned char *(header_strings[6]);
        unsigned char *(message_strings1[10]);
        unsigned char *(message_strings2[10]);
	unsigned char *temp_buffer;

        request.str  = request_buffer;
    
        k = 0;
        strcpy ((char *)passed_mtm_address,(char *)mtm_address);
	ClConnect(2, mtm_address, &k);
        error_code = error_check (k,CLCONNECT,(unsigned char*)0,profile_reply);
	if (error_code != OK)
	   return error_code;

        memset(reply_buffer,0,sizeof(reply_buffer));
        memset(request_buffer,0,sizeof(request_buffer));
	j = setup_login_request(&request, param_user_id, password,
            mtm_address, tlo);

        k=0;
        logging (&request,"\nCLIENT LOGON REQUEST\n");
   	ClExchmsg(4, &request, &reply, timeout, &k);
        logging (&reply,"\nSERVER RESPONSE TO CLIENT LOGON REQUEST\n");

        error_code = error_check (k,CLLOGIN,&reply,profile_reply);  
	if (error_code != OK)
	   return error_code;

	num_size = get_number_size(reply.length-2);
        i = move_number(reply_buffer, reply.length-2);
	memcpy(reply_buffer+i,reply.str+1,reply.length-2);
	reply.str = reply_buffer;

	parse_string(reply.str,header_and_message);

	parse_string(header_and_message[1],header_strings);

	parse_string(header_and_message[2],message_strings1);

	parse_string(message_strings1[2],message_strings2);

	setup_token(message_strings2[1],profile_reply);


	return 0;	
}