grafX2/src/fileseltools.h
2020-02-15 11:46:36 +01:00

51 lines
2.1 KiB
C

/* vim:expandtab:ts=2 sw=2:
*/
/* Grafx2 - The Ultimate 256-color bitmap paint program
Copyright 2018-2020 Thomas Bernard
Copyright 2007 Adrien Destugues
Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud)
Grafx2 is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2
of the License.
Grafx2 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Grafx2; if not, see <http://www.gnu.org/licenses/>
*/
//////////////////////////////////////////////////////////////////////////////
///@file fileseltools.h
/// Utility functions for the Fileselector window
//////////////////////////////////////////////////////////////////////////////
#ifndef FILESELTOOLS_H_INCLUDED
#define FILESELTOOLS_H_INCLUDED
T_Fileselector_item * Add_element_to_list(T_Fileselector *list, const char * full_name, const char *short_name, enum FSOBJECT_TYPE type, enum ICON_TYPES icon);
///
/// Formats a display name for a file, directory, or similar name (drive, volume).
/// @param fname full file name from the file system
/// @param max_length numbers of characters to display
/// @param type 0 for file, 1 for directory, 2 for drive
/// @return a pointer to a single static buffer of maximum 40 characters
/// including the '\\0'.
char * Format_filename(const char * fname, word max_length, int type);
///
/// Formats a display name for a file, directory, or similar name (drive, volume).
/// @param fname full file name from the file system
/// @param max_length numbers of characters to display
/// @param type 0 for file, 1 for directory, 2 for drive
/// @return a pointer to a single static buffer of maximum 40 wide characters
/// including the '\\0'.
word * Format_filename_unicode(const word * fname, word max_length, int type);
#endif