📄 iodlg.h
字号:
/******************************************************************
* SEAL 2.0 *
* Copyright (c) 1999-2002 SEAL Developers. All Rights Reserved. *
* *
* Web site: http://sealsystem.sourceforge.net/ *
* E-mail (current maintainer): orudge@users.sourceforge.net *
******************************************************************/
/*
This program 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; either version 2 of the License, or
(at your option) any later version.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __IODS_H_INCLUDED__
#define __IODS_H_INCLUDED__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdarg.h>
#include "dialogs.h"
/* input/output standard strings */
#ifndef TXT_NEW
#define TXT_NEW INI_TEXT("New")
#endif
#ifndef TXT_DIRECTORY
#define TXT_DIRECTORY INI_TEXT("Directory")
#endif
/*#ifndef TXT_LINKTOFILE
#define TXT_LINKTOFILE INI_TEXT("Link to file")
#endif
#ifndef TXT_LINKTODIRECTORY
#define TXT_LINKTODIRECTORY INI_TEXT("Link to directory")
#endif
#ifndef TXT_LINKS
#define TXT_LINKS INI_TEXT("Links")
#endif*/
#ifndef TXT_FILETYPE
#define TXT_FILETYPE INI_TEXT("File type")
#endif
#ifndef TXT_CHANGENAME
#define TXT_CHANGENAME INI_TEXT("Change name")
#endif
/*#ifndef TXT_ICONFORLINK
#define TXT_ICONFORLINK INI_TEXT("Icon for link")
#endif */
#ifndef TXT_OPEN
#define TXT_OPEN INI_TEXT("Open")
#endif
#ifndef TXT_SAVE
#define TXT_SAVE INI_TEXT("Save")
#endif
#ifndef TXT_COPY
#define TXT_COPY INI_TEXT("Copy")
#endif
#ifndef TXT_DELETE
#define TXT_DELETE INI_TEXT("Delete")
#endif
#ifndef TXT_PASTE
#define TXT_PASTE INI_TEXT("Paste")
#endif
#ifndef TXT_PROPERTIES
#define TXT_PROPERTIES INI_TEXT("Properties")
#endif
#ifndef TXT_NEWDIRECTORY
#define TXT_NEWDIRECTORY INI_TEXT("New directory")
#endif
#ifndef TXT_FILENAME
#define TXT_FILENAME INI_TEXT("File name")
#endif
#ifndef TXT_DIRNAME
#define TXT_DIRNAME INI_TEXT("Directory name")
#endif
#ifndef TXT_DATE
#define TXT_DATE INI_TEXT("Date")
#endif
#ifndef TXT_TIME
#define TXT_TIME INI_TEXT("Time")
#endif
#ifndef TXT_SIZE
#define TXT_SIZE INI_TEXT("Size")
#endif
#ifndef TXT_PATH
#define TXT_PATH INI_TEXT("Path")
#endif
#ifndef TXT_NOTFOUND
#define TXT_NOTFOUND INI_TEXT("Not found")
#endif
#ifndef TXT_ATTRIB
#define TXT_ATTRIB INI_TEXT("Attrib")
#endif
#ifndef TXT_NUMBEROFFILES
#define TXT_NUMBEROFFILES INI_TEXT("Number of files")
#endif
#ifndef TXT_NUMBEROFDIRECTORIES
#define TXT_NUMBEROFDIRECTORIES INI_TEXT("Number of directories")
#endif
#ifndef TXT_PROCESSSTATUS
#define TXT_PROCESSSTATUS INI_TEXT("Process status")
#endif
#ifndef TXT_DONE
#define TXT_DONE INI_TEXT("Done")
#endif
#ifndef TXT_HALTED
#define TXT_HALTED INI_TEXT("Halted")
#endif
#ifndef TXT_PLEASEWAIT
#define TXT_PLEASEWAIT INI_TEXT("Please wait")
#endif
#ifndef TXT_COPYTOFILE
#define TXT_COPYTOFILE INI_TEXT("Copy to file")
#endif
#ifndef TXT_COPYTODIRECTORY
#define TXT_COPYTODIRECTORY INI_TEXT("Copy to directory")
#endif
#ifndef TXT_AREYOUSUREYOUWANTTODELETE
#define TXT_AREYOUSUREYOUWANTTODELETE INI_TEXT("Are you sure you want to delete")
#endif
#ifndef TXT_THESEFILES
#define TXT_THESEFILES INI_TEXT("These files")
#endif
#ifndef TXT_AREYOUSUREYOUWANTTOCOPY
#define TXT_AREYOUSUREYOUWANTTOCOPY INI_TEXT("Are you sure you want to copy")
#endif
#ifndef TXT_FILE
#define TXT_FILE INI_TEXT("File")
#endif
#ifndef TXT_INTO
#define TXT_INTO INI_TEXT("Into")
#endif
#ifndef TXT_COPYINGFILES
#define TXT_COPYINGFILES INI_TEXT("Copying files")
#endif
#ifndef TXT_DELETINGFILES
#define TXT_DELETINGFILES INI_TEXT("Deleting files")
#endif
#ifndef TXT_COPYINGFILESTO
#define TXT_COPYINGFILESTO INI_TEXT("Copying files to")
#endif
#ifndef TXT_DELETINGFILESFROM
#define TXT_DELETINGFILESFROM INI_TEXT("Deleting files from")
#endif
#ifndef TXT_FILECOULDNTBERENAME
#define TXT_FILECOULDNTBERENAME INI_TEXT("File couldn't be rename")
#endif
#ifndef TXT_AREYOUSTUPID
#define TXT_AREYOUSTUPID INI_TEXT("Are you stupid")
#endif
#ifndef TXT_FILE
#define TXT_FILE INI_TEXT("File")
#endif
#ifndef TXT_NOTFOUND
#define TXT_NOTFOUND INI_TEXT("Not found")
#endif
#ifndef TXT_CHECKTHEFILENAMEANDTRYAGAIN
#define TXT_CHECKTHEFILENAMEANDTRYAGAIN INI_TEXT("Check the filename and try again")
#endif
#ifndef TXT_EXIST
#define TXT_EXIST INI_TEXT("Exist")
#endif
#ifndef TXT_OPENFILE
#define TXT_OPENFILE INI_TEXT("Open file")
#endif
#ifndef TXT_SAVEFILEAS
#define TXT_SAVEFILEAS INI_TEXT("Save file as")
#endif
#ifndef TXT_WOULDYOULIKETOOVERWRITEIT
#define TXT_WOULDYOULIKETOOVERWRITEIT INI_TEXT("Would you like to overwrite it")
#endif
#ifndef TXT_REFERENCETODIRECTORY
#define TXT_REFERENCETODIRECTORY INI_TEXT("Reference to directory")
#endif
/* input/output info strings */
#ifndef TXT_INFOLINKTOFILE
#define TXT_INFOLINKTOFILE INI_TEXT("")
#endif
#ifndef TXT_INFOLINKTODIRECTORY
#define TXT_INFOLINKTODIRECTORY INI_TEXT("")
#endif
#ifndef TXT_INFOCHANGENAME
#define TXT_INFOCHANGENAME INI_TEXT("")
#endif
#ifndef TXT_INFOOPEN
#define TXT_INFOOPEN INI_TEXT("")
#endif
#ifndef TXT_INFONEWDIRECTORY
#define TXT_INFONEWDIRECTORY INI_TEXT("")
#endif
#ifndef TXT_INFOCOPY
#define TXT_INFOCOPY INI_TEXT("")
#endif
#ifndef TXT_INFODEL
#define TXT_INFODEL INI_TEXT("")
#endif
#ifndef TXT_INFOPASTE
#define TXT_INFOPASTE INI_TEXT("")
#endif
#ifndef TXT_INFOPROPERTIES
#define TXT_INFOPROPERTIES INI_TEXT("")
#endif
#ifndef TXT_INFOCOPYTOFILE
#define TXT_INFOCOPYTOFILE INI_TEXT("")
#endif
#ifndef TXT_INFOCOPYTODIRECTORY
#define TXT_INFOCOPYTODIRECTORY INI_TEXT("")
#endif
/* input/output messages */
#ifndef MSG_SELECTEDFILELISTBOXITEM
#define MSG_SELECTEDFILELISTBOXITEM 105
#endif
/* local messages */
/* message for copying file into other one in function
menu_file_copy_where
*/
#ifndef MSG_COPYTOFILE
#define MSG_COPYTOFILE 106
#endif
/* message for copying files into directort in function
menu_file_copy_where
*/
#ifndef MSG_COPYTODIR
#define MSG_COPYTODIR 107
#endif
/* message for getting properties about file / directory */
#ifndef MSG_PROPERTIES
#define MSG_PROPERTIES 108
#endif
/* message for changing name of file / directory */
#ifndef MSG_CHANGENAME
#define MSG_CHANGENAME 109
#endif
/* message for making new directory */
#ifndef MSG_NEWDIRECTORY
#define MSG_NEWDIRECTORY 110
#endif
/* message called in filelistbox_translate_event for dir opening */
#ifndef MSG_OPENDIR
#define MSG_OPENDIR 111
#endif
#ifndef MSG_PARENTDIR
#define MSG_PARENTDIR 112
#endif
#ifndef MSG_LSTDIRSELECTED
#define MSG_LSTDIRSELECTED 113
#endif
/* filelistbox flags */
/* this flags are used for setting up the options of the filelistbox. they
continued from the LIF_XXXX - listbox flags, you will find in dialogs.h */
/* filelistbox can open the file */
#define FL_OPEN 0x00010 /* listbox flags before */
/* filelistbox can save the file */
#define FL_SAVE 0x00020
/* filelistbox can return the name of opened directory if you pressed OK */
#define FL_DIROPEN 0x00040
/* filehistory item structure */
typedef struct t_filehistory_item *p_filehistory_item;
/*
this structire of item is used for displaying items in filelistbox or filehistory
objects. It continued from t_listbox_item as you can see. It's only increased by
file info about the item ( because each item repesented one file/directory ) and
function "properties" that's called when the properties are called for the specfic
file. "set_data" is used whenever something is copying into the file.
*/
/* filelistbox item structure */
typedef struct t_filelistbox_item *p_filelistbox_item;
typedef struct t_filelistbox_item {
/* inherited variables from the t_listbox_item */
struct t_listbox_item obclass;
/* info about the file/dir that represents this item...see _iodir.h */
struct t_file info;
/* function, calling whenever properties about the file are called */
l_bool (*properties)(l_text filename);
/* function, calling whenever something is copying into the file */
l_int (*set_data) ( p_object o, t_file *dst, t_file *src, l_dword *ind );
} t_filelistbox_item;
/* get the hour from the t_filelistbox_item.info.time */
#define ff_hour(t) (((t) >> 11) & 0x1f)
/* get the min from the t_filelistbox_item.info.time */
#define ff_min(t) (((t) >> 5) & 0x3f)
/* get the sec from the t_filelistbox_item.info.time */
#define ff_sec(t) (((t) & 0x1f) << 1)
/* get the day from the t_filelistbox_item.info.date */
#define ff_day(d) ((d) & 0x1f)
/* get the month from the t_filelistbox_item.info.date */
#define ff_month(d) (((d) >> 5) & 0x0f)
/* get the year from the t_filelistbox_item.info.date */
#define ff_year(d) ((((d) >> 9) & 0x7f) + 1980)
/* t_filelistbox */
/*
object filelistbox is used for displaying and controling the box of items that
contains information about files / directories. Each entry ( item ) of the
t_filelistbox.obclass.list contains information about an item that contains pointer
to one t_filelistbox_item entry. Whenever you press the item you can copy/paste it
by the menu or by the DRAG & DROP system.
*/
typedef struct t_filelistbox *p_filelistbox;
typedef struct t_filelistbox {
/* inherite variables / functions from t_listbox, t_view, t_object classes */
struct t_listbox obclass;
/* define current path of box */
l_text path;
/* define the name of the file, that's selected. If the directory, then it's
extension until it's not changed in the t_filetextline object
*/
l_text file;
/*
attributes of files / directories that can show current box. see _iodir.h.
*/
l_int attrib;
/*
this function is called whenever is file selected. Function contains pointer to
the function you set in the initializing. By this way it's possible to support
quick browser accross images for example. This function is called by one argument
that represents the file that was selected.
*/
void (*file_sel)();
/*
reload list of the items for path "path" and for extension "file". It redraw the
box and set all to initial values.
*/
void (*load_list) ( p_filelistbox o, l_text path, l_text file );
/*
show the menu that's visible whenever the 3rd button on the mouse is pressed under
any file / directory. It returns the message that was called. If nothing, it
returns MSG_CANCEL.
*/
l_dword (*file_menu) ( p_filelistbox o );
/*
this function is called from the "filelistbox_translate_event" function and
handle operations about directories or files for specfic attributes. It's called
whenever is item pressed and opened.
*/
l_int (*file_handle_ex) ( p_filelistbox o, l_text opath, l_text ofile, l_int attrib, l_text filename );
/*
it call function file_handle_ex for current values of selected item.
*/
l_int (*file_handle) ( p_filelistbox o );
/*
function, used for the changing of the current file / directory name. returns true
if the name was succesfull changed, otherwise it returns false.
*/
l_bool (*change_name) ( p_filelistbox o );
/*
return the real name of the file that was selected
*/
l_text (*get_file) ( p_filelistbox o );
/*
function for making new directory. If directory was successfull made, it returns
true, otherwise it returns false.
*/
l_bool (*new_directory) ( p_filelistbox o );
/*
function for making new link to directory. If this link was successfull made,
it returns true, otherwise it returns false.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -