form_data->readonly = TRUE;
form_data->read_only = TRUE;
lo_form_textarea(MWContext *context, lo_DocState *state,	PA_Tag *tag, int32 type){	LO_FormElementStruct *form_element;	lo_FormElementTextareaData *form_data;	PA_Block buff;#if defined(XP_MAC)&&defined(MOCHA)	PA_Block keydown, keypress, keyup;#endif /* defined(XP_MAC)&&defined(MOCHA) */	char *str;	form_element = new_form_element(context, state, type);	if (form_element == NULL)	{		return(NULL);	}	form_element->element_data = lo_next_element_data(state, type);	if (form_element->element_data == NULL)	{		lo_FreeElement(context, (LO_Element *)form_element, FALSE);		return(NULL);	}	form_element->element_index =		state->top_state->savedData.FormList->data_index - 1;	form_data = (lo_FormElementTextareaData *)form_element->element_data;	/*	 * IF our starting type is NONE, this is a new element,	 * an we need to initialize the locations that will later	 * hold persistent data.	 */	if (form_data->type == FORM_TYPE_NONE)	{		form_data->FE_Data = NULL;		form_data->current_text = NULL;	}	form_data->type = type;	form_data->name = lo_FetchParamValue(context, tag, PARAM_NAME);	form_data->default_text = NULL;	form_data->rows = DEF_TEXTAREA_ELE_ROWS;	buff = lo_FetchParamValue(context, tag, PARAM_ROWS);	if (buff != NULL)	{		PA_LOCK(str, char *, buff);		form_data->rows = XP_ATOI(str);		PA_UNLOCK(buff);		PA_FREE(buff);		if (form_data->rows < 1)		{			form_data->rows = 1;		}	}	form_data->cols = DEF_TEXTAREA_ELE_COLS;	buff = lo_FetchParamValue(context, tag, PARAM_COLS);	if (buff != NULL)	{		PA_LOCK(str, char *, buff);		form_data->cols = XP_ATOI(str);		PA_UNLOCK(buff);		PA_FREE(buff);		if (form_data->cols < 1)		{			form_data->cols = 1;		}	}	form_data->disabled = FALSE;	buff = lo_FetchParamValue(context, tag, PARAM_DISABLED);	if (buff != NULL)	{		PA_FREE(buff);		form_data->disabled = TRUE;	}	form_data->readonly = FALSE;	buff = lo_FetchParamValue(context, tag, PARAM_READONLY);	if (buff != NULL)	{		PA_FREE(buff);		form_data->readonly = TRUE;	}	form_data->auto_wrap = TEXTAREA_WRAP_OFF;	buff = lo_FetchParamValue(context, tag, PARAM_WRAP);	if (buff != NULL)	{		PA_LOCK(str, char *, buff);		if (pa_TagEqual("off", str))		{			form_data->auto_wrap = TEXTAREA_WRAP_OFF;		}		else if (pa_TagEqual("hard", str))		{			form_data->auto_wrap = TEXTAREA_WRAP_HARD;		}		else if (pa_TagEqual("soft", str))		{			form_data->auto_wrap = TEXTAREA_WRAP_SOFT;		}		/*		 * Make <TEXTAREA WRAP>		 * default to WRAP=SOFT		 */		else		{			form_data->auto_wrap = TEXTAREA_WRAP_SOFT;		}		PA_UNLOCK(buff);		PA_FREE(buff);	}#if defined(XP_MAC)&&defined(MOCHA)    keydown = lo_FetchParamValue(context, tag, PARAM_ONKEYDOWN);    keypress = lo_FetchParamValue(context, tag, PARAM_ONKEYPRESS);    keyup = lo_FetchParamValue(context, tag, PARAM_ONKEYUP);    /* Text fields need this info which needs to be carried across table cell relayouts.       Only the mac FE checks the event_handler_present bit. */    if (keydown || keypress || keyup)	form_element->event_handler_present = TRUE;		if (keydown)		PA_FREE(keydown);	if (keypress)		PA_FREE(keypress);	if (keyup)		PA_FREE(keyup);		#endif /* defined(XP_MAC)&&defined(MOCHA) */	return(form_element);}