allegro_dialog_sys/
lib.rs

1// Copyright (c) 2014 by SiegeLord
2//
3// All rights reserved. Distributed under ZLib. For full terms see the file LICENSE.
4
5pub use allegro_dialog::*;
6
7pub mod allegro_dialog
8{
9	#![allow(non_camel_case_types)]
10	use allegro_sys::{ALLEGRO_DISPLAY, ALLEGRO_EVENT_SOURCE};
11	use allegro_util::c_bool;
12	use libc::*;
13
14	allegro_util::opaque!(ALLEGRO_FILECHOOSER);
15	allegro_util::opaque!(ALLEGRO_TEXTLOG);
16
17	pub const ALLEGRO_FILECHOOSER_FILE_MUST_EXIST: u32 = 1;
18	pub const ALLEGRO_FILECHOOSER_SAVE: u32 = 2;
19	pub const ALLEGRO_FILECHOOSER_FOLDER: u32 = 4;
20	pub const ALLEGRO_FILECHOOSER_PICTURES: u32 = 8;
21	pub const ALLEGRO_FILECHOOSER_SHOW_HIDDEN: u32 = 16;
22	pub const ALLEGRO_FILECHOOSER_MULTIPLE: u32 = 32;
23
24	pub const ALLEGRO_MESSAGEBOX_WARN: u32 = 1;
25	pub const ALLEGRO_MESSAGEBOX_ERROR: u32 = 2;
26	pub const ALLEGRO_MESSAGEBOX_OK_CANCEL: u32 = 4;
27	pub const ALLEGRO_MESSAGEBOX_YES_NO: u32 = 8;
28	pub const ALLEGRO_MESSAGEBOX_QUESTION: u32 = 16;
29
30	pub const ALLEGRO_TEXTLOG_NO_CLOSE: u32 = 1;
31	pub const ALLEGRO_TEXTLOG_MONOSPACE: u32 = 2;
32
33	pub const ALLEGRO_EVENT_NATIVE_DIALOG_CLOSE: c_uint = 600;
34
35	unsafe extern "C" {
36		pub fn al_init_native_dialog_addon() -> c_bool;
37		pub fn al_shutdown_native_dialog_addon();
38		pub fn al_create_native_file_dialog(
39			initial_path: *const c_char, title: *const c_char, patterns: *const c_char, mode: c_int,
40		) -> *mut ALLEGRO_FILECHOOSER;
41		pub fn al_show_native_file_dialog(
42			display: *mut ALLEGRO_DISPLAY, dialog: *mut ALLEGRO_FILECHOOSER,
43		) -> c_bool;
44		pub fn al_get_native_file_dialog_count(dialog: *const ALLEGRO_FILECHOOSER) -> c_int;
45		pub fn al_get_native_file_dialog_path(
46			dialog: *const ALLEGRO_FILECHOOSER, index: size_t,
47		) -> *const c_char;
48		pub fn al_destroy_native_file_dialog(dialog: *mut ALLEGRO_FILECHOOSER);
49		pub fn al_show_native_message_box(
50			display: *mut ALLEGRO_DISPLAY, title: *const c_char, heading: *const c_char,
51			text: *const c_char, buttons: *const c_char, flags: c_int,
52		) -> c_int;
53		pub fn al_open_native_text_log(title: *const c_char, flags: c_int) -> *mut ALLEGRO_TEXTLOG;
54		pub fn al_close_native_text_log(textlog: *mut ALLEGRO_TEXTLOG);
55		pub fn al_append_native_text_log(textlog: *mut ALLEGRO_TEXTLOG, format: *const c_char, ...);
56		pub fn al_get_native_text_log_event_source(
57			textlog: *mut ALLEGRO_TEXTLOG,
58		) -> *mut ALLEGRO_EVENT_SOURCE;
59		pub fn al_get_allegro_native_dialog_version() -> u32;
60	}
61}