home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / XAP / XFILEMAN / XFILEMAN.TAR / xfilemanager / struct.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-24  |  5.9 KB  |  198 lines

  1. /*
  2.  * Copyright 1993 by Ove Kalkan, Cremlingen, Germany
  3.  *
  4.  * Permission to use, copy, modify, distribute and sell this software and it's
  5.  * documentation for any purpose is hereby granted without fee, rpovided that
  6.  * the above copyright notice and this permission appear in supporting
  7.  * documentation, and that the name of Ove Kalkan not to be used in
  8.  * advertising or publicity pertaining to distributiopn of the software without
  9.  * specific, written prior permission. Ove Kalkan makes no representations
  10.  * about the suitability of this software for any purpose. It is provided
  11.  * as is without express or implied warranty.
  12.  *
  13.  * OVE KALKAN DISPLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  14.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABLILITY AND FITNESS, IN NO
  15.  * EVENT SHALL OVE KALKAN BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  16.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  17.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18.  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19.  * PERFORMANCE OF THIS SOFTWARE.
  20.  *
  21.  * $Header: filename,v 1.0 yyyy/mm/dd hh:mm:ss loginname Exp $
  22.  */
  23.  
  24. /*
  25.  * This file contains all important global structure defines
  26.  */
  27.  
  28. #ifndef    STRUCT_H
  29. #define    STRUCT_H
  30.  
  31. typedef struct dir_glyph{
  32.     Dimension        x, y;        /* Position des Glyphs im Icondirectory */
  33.     String            name;        /* Wenn Null, dann Root-Directory */
  34.     Boolean            open;        /* Ob die Unterdirectoires gezeigt werden */
  35.     unsigned char        flags;        /* Dir-Flags */
  36.  
  37.     struct dir_glyph    *parent;    /* Das Parentdir */
  38.     Dimension        dir_count;    /* Anzahl der Unterdirectories in diesem
  39.                            Verzeichnis */
  40.     struct dir_glyph    **dir;        /* Feld mit Zeigern auf die
  41.                            Unterdirectories */
  42.     char            *link;        /* Fuer Linktarget, sonst NULL */
  43. } Dir_Glyph;
  44.  
  45. /*
  46.  * FS_Types
  47.  */
  48. #define    FS_NORMAL    0    /* Ein normales Filesystem */
  49. #define    FS_TAR        1    /* Ein Tar-File */
  50. #define    FS_CTAR        2    /* Ein komprimiertes Tar-File */
  51.  
  52.  
  53. /*
  54.  * Dir-Flags
  55.  */
  56. #define    DIR_READABLE    1
  57. #define    DIR_WRITEABLE    2
  58. #define    DIR_LINK    4
  59. #define    DIR_HIDDEN    8
  60.  
  61. /*
  62.  * Hier die File-Struktur fuer das neben dem Dir-Fenster gezeigte 
  63.  * FileFenster
  64.  */
  65. typedef struct {
  66.     unsigned char    prog_type;        /* Programm-Type */
  67.     unsigned int    size;            /* Groesse des Files */
  68.     ushort        mode;            /* File Mode */
  69.     uid_t        uid;            /* Id des Owners */
  70.     gid_t        gid;            /* Id der Gruppe */
  71.     char        *name;            /* Name of File */
  72. } File_Glyph;
  73.  
  74. typedef struct {
  75.     Dimension    max_length;        /* Laengster Filename */
  76.     Dimension    total_count;        /* Anzahl der Files im Dir gesamt */
  77.     unsigned int    size;            /* Bytes der Files in diesem Folder */
  78.     unsigned char    fs_type;        /* Filesystsem-type */
  79.  
  80.     Widget        window;            /* Das Fenster der Fileliste */
  81.     Widget        label;            /* der Label */
  82.     Widget        vp;            /* der Viewport */
  83.     Widget        shell;            /* Das Shellfenster */
  84.     Widget        info;            /* File-Count info */
  85.  
  86.     Dir_Glyph    *dir;            /* Das Directory */
  87.  
  88.     char        *filter;        /* String or NULL */
  89.     Dimension    file_count;        /* Anzahl der Files */
  90.     File_Glyph    **file;            /* Die Files */
  91. } Folder_Glyph;
  92.  
  93.  
  94. /*
  95.  * File-Flags
  96.  */
  97. #define    FILE_PLAIN    100
  98. #define    FILE_LOCK    101
  99. #define    FILE_LINK    102
  100. #define    FILE_EXEC    103
  101. #define    FILE_TAR    104
  102. #define    FILE_CTAR    105
  103. #define    FILE_GHOST    106
  104.  
  105. #define    FILE_LDIR    198
  106. #define    FILE_DIR    199
  107. #define    FILE_ROOT    200
  108.  
  109. typedef    struct {
  110.     char        *cmd;            /* Programm das ausgefuerht werden soll */
  111.     char        *suffix;        /* Alle moeglichen Suffixe des Dateityps */
  112.     unsigned char    type;            /* prog_type */
  113.     char        *pmap_file;        /* File mit dem Icon */
  114.     Pixmap        *pmap;            /* Icon des Files */
  115.     char        *description;        /* Beschreibung */
  116. } Suffix_Glyph;
  117.  
  118. typedef    struct {
  119.     char        type;            /* Filetype fuer den pmap */
  120.     Pixmap        *pmap;            /* als Icon verwendet wird */
  121. } Pixmap_Glyph;
  122.  
  123. /*
  124.  * Structure mit den Defaultsettings
  125.  */
  126. typedef struct    {
  127.     /* Das Rootdir mit dem angefangen wird, z.B. "/" oder "/users" */
  128.     char        *root_dir;        /* Das Root-Directory */
  129.  
  130.     /* Graphic resources */
  131.     Pixel        select_color;        /* Farbe selektierter Items */
  132.     XFontStruct    *icon_font;        /* Font fuer die Icons */
  133.     char        *icon_dir;        /* Wo die Icons zu finden sind */
  134.  
  135.     /* Das Trashcandir oder NULL */
  136.     char        *trashcan;        /* Fuer ein sicheres Loeschen */
  137.  
  138.     /* Einige Resources fuer das Handling */
  139.     Boolean        multi_window;        /* Folder oeffnet neues Fenster */
  140.     Dimension    click_interval;        /* Doppelclick Zeitinterval */
  141.     Boolean        drag_copy;        /* Wenn True wird nicht gefragt beim Copy-Drag */
  142.     Boolean        drag_move;        /* Wenn True wird nicht gefragt beim Move-Drag */
  143.     Boolean        drag_exec;        /* Wie Oben */
  144.     Boolean        drag_delete;        /* Wie oben */
  145.     Boolean        save_ws_on_exit;    /* Sichern des Workspaces beim Verlassen */
  146.  
  147.     /* Hier was fuer den Workspace */
  148.     Dimension    icon_grid;        /* Abstaende in denen die Icons angeordnet werden */
  149.     Dimension    snap_grid;        /* Fuer das Iconplacing */
  150. } xfm_struct;
  151.  
  152.  
  153. /*
  154.  * Info_struktur, gibt auskunft darueber, wo sich der Mauszeiger befindet
  155.  * und welches Item selectiert, etc. wurde
  156.  */
  157. typedef    struct    {
  158.     Widget        window;            /* Fenster */
  159.     Folder_Glyph    *folder;        /* Wenn nicht folder, dann NULL */
  160.     Dimension    selc_v;            /* Das gerade selectierte Item */
  161.  
  162.     Dir_Glyph    *selc_g;        /* Wenn im Dir-Path selectiert */
  163. } Info_Glyph;
  164.  
  165.  
  166. /*
  167.  * Die Workspace Struct
  168.  */
  169. typedef struct    {
  170.     char        *label;            /* Label eines WS-Entries */
  171.     char        *file;            /* Name des Files, das ausgefuehrt wird*/
  172.     Dimension    x,y;            /* Iconposition */
  173.     Dimension    w,h;            /* Icongroesse */
  174.     char        *pmap_file;        /* Iconfile */
  175.     Pixmap        pmap;            /* Das Icon */
  176.     Pixmap        shape;            /* Das Shape fuer das Icon beim Verschieben */
  177.     Boolean        can_arg;        /* Ob Dropable */
  178.     Boolean        must_arg;        /* Ob ohne Argument */
  179.     Boolean        do_ask;            /* Box vor Ausfuehrung */
  180. } WSE_Glyph;
  181.  
  182. typedef    struct    {
  183.     Widget        window;            /* Das Icon */
  184.     Widget        shell;            /* Das Shellwindow */
  185.  
  186.     int        fx,fy;            /* Position des Fensters auf dem Screen */
  187.     int        fw,fh;            /* Fenstergroesse */
  188.     Dimension    width;
  189.     Dimension    wse_count;        /* Zahl der Eintraege im Workspace */
  190.     WSE_Glyph    **wse;            /* Icons im Workspace */
  191. } WS_Glyph;
  192.  
  193. #ifndef S_ISLNK
  194. #define    S_ISLNK(_M) ((_M & S_IFMT)==S_IFLNK)   /* test for symbolic link */
  195. #endif
  196. #endif
  197.  
  198.