Haiku API Bindings
Mime
Not logged in

Documentation | StorageKit | Mime

SYNOPSIS

Perl

use HaikuR1::Mime qw(get_device_icon B_LARGE_ICON);

my $bitmap = get_device_icon($device_name, B_LARGE_ICON);

Python

from HaikuR1.Mime import get_device_icon, B_LARGE_ICON

bitmap = get_device_icon(device_name, B_LARGE_ICON)

DESCRIPTION

Exposes the mime function and constants.

For more information on Mime, see the Haiku Book class description.

FUNCTIONS

Icons

get_device_icon

get_named_icon

Gets the indicated icon. The versions that take an icon size return the icon as a Bitmap. The other versions return two items: the raw data and the icon type. (At the moment, type is always 'B_VECTOR_ICON_TYPE.)

The Bitmap versions actually call the raw data versions and convert the data into a Bitmap. If no vector icon is found, get_device_icon will also check for legacy icons.

Note that named icons are stored in one of four directories: B_USER_NONPACKAGED_DATA_DIRECTORY, B_USER_DATA_DIRECTORY, B_SYSTEM_NONPACKAGED_DATA_DIRECTORY, and B_SYSTEM_DATA_DIRECTORY (and they are checked in this order).

Perl

get_device_icon($device, $which);
get_device_icon($device);
get_named_icon($name, $which);
get_named_icon($name);

Python

get_device_icon(device, which)
get_device_icon(device)
get_named_icon(name, which)
get_named_icon(name)

MIME info

update_mime_info

create_app_meta_mime

update_mime_info updates the MIME info for one or more files. create_app_meta_mime creates an entry in the File Types database for an application.

Perl

update_mime_info($path, $recursive, $synchronous, $force);
create_app_meta_mime($path, $recursive, $synchronous, $force);

Python

update_mime_info(path,recursive,synchronous,force)
create_app_meta_mime(path,recursive,synchronous,force)

CONSTANTS

Force

Perl

use HaikuR1::Mime qw(:force)

Python

Python does not support export tags.

Icon size

Perl

use HaikuR1::Mime qw(:icon_size)

Python

Python does not support export tags.