示例#1
0
/**
 * Initialise the CSS content handler
 */
nserror nscss_init(void)
{
	nserror error;

	error = content_factory_register_handler("text/css", 
			&css_content_handler);
	if (error != NSERROR_OK) 
		goto error;

	return NSERROR_OK;

error:
	nscss_fini();

	return error;
}
示例#2
0
nserror amiga_dt_picture_init(void)
{
	char dt_mime[50];
	struct DataType *dt, *prevdt = NULL;
	lwc_string *type;
	lwc_error lerror;
	nserror error;
	BPTR fh = 0;
	struct Node *node = NULL;

	while((dt = ObtainDataType(DTST_RAM, NULL,
			DTA_DataType, prevdt,
			DTA_GroupID, GID_PICTURE, // we only support images for now
			TAG_DONE)) != NULL)
	{
		ReleaseDataType(prevdt);
		prevdt = dt;

		do {
			node = ami_mime_from_datatype(dt, &type, node);

			if(node)
			{
				error = content_factory_register_handler(
					lwc_string_data(type), 
					&amiga_dt_picture_content_handler);

				if (error != NSERROR_OK)
					return error;
			}

		}while (node != NULL);

	}

	ReleaseDataType(prevdt);

	return NSERROR_OK;
}
示例#3
0
文件: css.c 项目: pombredanne/NetSurf
/**
 * Initialise the CSS content handler
 */
nserror nscss_init(void)
{
	lwc_error lerror;
	nserror error;

	lerror = lwc_intern_string("charset", SLEN("charset"), &css_charset);
	if (lerror != lwc_error_ok) {
		error = NSERROR_NOMEM;
		goto error;
	}

	error = content_factory_register_handler("text/css", 
			&css_content_handler);
	if (error != NSERROR_OK) 
		goto error;

	return NSERROR_OK;

error:
	nscss_fini();

	return error;
}