<commit_before>use NativeCall;

sub LIB {
	given $*VM{'config'}{'load_ext'} {
		when '.so' { return 'libImlib2.so' }		# Linux
		when '.bundle' { return 'libImlib2.dylib' }	# Mac OS
		default { return 'libImlib2' }
	}
}

enum TextDirection <
	TEXT_TO_RIGHT
	TEXT_TO_LEFT
	TEXT_TO_DOWN
	TEXT_TO_UP
	TEXT_TO_ANGLE>;

enum LoadError <
	LOAD_ERROR_NONE
	LOAD_ERROR_FILE_DOES_NOT_EXIST
	LOAD_ERROR_FILE_IS_DIRECTORY
	LOAD_ERROR_PERMISSION_DENIED_TO_READ
	LOAD_ERROR_NO_LOADER_FOR_FILE_FORMAT
	LOAD_ERROR_PATH_TOO_LONG
	LOAD_ERROR_PATH_COMPONENT_NON_EXISTANT
	LOAD_ERROR_PATH_COMPONENT_NOT_DIRECTORY
	LOAD_ERROR_PATH_POINTS_OUTSIDE_ADDRESS_SPACE
	LOAD_ERROR_TOO_MANY_SYMBOLIC_LINKS
	LOAD_ERROR_OUT_OF_MEMORY
	LOAD_ERROR_OUT_OF_FILE_DESCRIPTORS
	LOAD_ERROR_PERMISSION_DENIED_TO_WRITE
	LOAD_ERROR_OUT_OF_DISK_SPACE
	LOAD_ERROR_UNKNOWN>;

enum RotationMode <
	ROTATE_NONE
	ROTATE_90_DEGREES
	ROTATE_180_DEGREES
	ROTATE_270_DEGREES>;

enum OperationMode <OP_COPY OP_ADD OP_SUBTRACT OP_RESHADE>;
enum FlipMode <FLIP_HORIZONTAL FLIP_VERTICAL FLIP_DIAGONAL>;
enum TileMode <TILE_HORIZONTAL TILE_VERTICAL TILE_BOTH>;

class Imlib2::Border is repr('CStruct') {
	has int32 $.left_border;
	has int32 $.right_border;
	has int32 $.top_border;
	has int32 $.bottom_border;

	method init(Int $l, Int $r, Int $t, Int $b) {
		$!left_border = $l;
		$!right_border = $r;
		$!top_border = $t;
		$!bottom_border = $b;<commit_msg>Update Imlib2.pm<commit_after>use NativeCall;

sub LIB {
	given $*VM{'config'}{'load_ext'} {
		when '.so' { return 'libImlib2.so' }		# Linux
		when '.bundle' { return 'libImlib2.dylib' }	# Mac OS
		default { return 'libImlib2' }
	}
}

enum TextDirection <
	TEXT_TO_RIGHT
	TEXT_TO_LEFT
	TEXT_TO_DOWN
	TEXT_TO_UP
	TEXT_TO_ANGLE>;

enum LoadError <
	LOAD_ERROR_NONE
	LOAD_ERROR_FILE_DOES_NOT_EXIST
	LOAD_ERROR_FILE_IS_DIRECTORY
	LOAD_ERROR_PERMISSION_DENIED_TO_READ
	LOAD_ERROR_NO_LOADER_FOR_FILE_FORMAT
	LOAD_ERROR_PATH_TOO_LONG
	LOAD_ERROR_PATH_COMPONENT_NON_EXISTANT
	LOAD_ERROR_PATH_COMPONENT_NOT_DIRECTORY
	LOAD_ERROR_PATH_POINTS_OUTSIDE_ADDRESS_SPACE
	LOAD_ERROR_TOO_MANY_SYMBOLIC_LINKS
	LOAD_ERROR_OUT_OF_MEMORY
	LOAD_ERROR_OUT_OF_FILE_DESCRIPTORS
	LOAD_ERROR_PERMISSION_DENIED_TO_WRITE
	LOAD_ERROR_OUT_OF_DISK_SPACE
	LOAD_ERROR_UNKNOWN>;

enum RotationMode <
	ROTATE_NONE
	ROTATE_90_DEGREES
	ROTATE_180_DEGREES
	ROTATE_270_DEGREES>;

enum OperationMode <OP_COPY OP_ADD OP_SUBTRACT OP_RESHADE>;
enum FlipMode <FLIP_HORIZONTAL FLIP_VERTICAL FLIP_DIAGONAL>;
enum TileMode <TILE_HORIZONTAL TILE_VERTICAL TILE_BOTH>;

class Imlib2::Border is repr('CStruct') {
	has int32 $.left_border;
	has int32 $.right_border;
	has int32 $.top_border;
	has int32 $.bottom_border;

	method init(Int $l, Int $r, Int $t, Int $b) {
		$!left_border = 0;
		$!right_border = 0;
		$!top_border = 0;
		$!bottom_border = 0;
{'fraction_non_alphanumeric': 0.07538406573776349, 'fraction_numerical': 0.01607717041800643, 'mean_word_length': 6.7134986225895315, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2040800', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1213, 'n_words': 198}