Mercurial > dwindows
view platform/dirent.h @ 2300:6e47d510dbbb
GTK4: Since GTK4 needs to add the popup menu to the parent widget...
We need to remove it after the popup closes, so we trap the "close" signal
and try to remove the popup from the parent. Since the "close" signal gets
called before the menu's "activate" signal, we have to delay unparenting
until after the "activate" signal handler is run. Otherwise the menu
objects won't be valid for the "activate" handler, therefore we add an idle
callback to unparent the widget when the rest of the processing is done.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 08 Feb 2021 10:49:50 +0000 |
parents | 71e0a3ad07f7 |
children |
line wrap: on
line source
#ifdef __UNIX__ #include <dirent.h> #else #ifndef __DIRENT_H__ #define __DIRENT_H__ #include "dwcompat.h" #include <stdio.h> #ifdef MAXPATHLEN #undef MAXPATHLEN #endif #define MAXPATHLEN (FILENAME_MAX*4) #define MAXNAMLEN FILENAME_MAX #ifdef __cplusplus extern "C" { #endif /* attribute stuff */ #ifndef A_RONLY # define A_RONLY 0x01 # define A_HIDDEN 0x02 # define A_SYSTEM 0x04 # define A_LABEL 0x08 # define A_DIR 0x10 # define A_ARCHIVE 0x20 #endif #ifdef __WATCOMC__ #undef DIR #undef direct #undef dirent #define DIR DIRW #endif struct dirent { int d_ino; /* Dummy */ int d_reclen; /* Dummy, same as d_namlen */ int d_namlen; /* length of name */ char d_name[MAXNAMLEN + 1]; unsigned long long d_size; unsigned long d_attribute; /* attributes (see above) */ unsigned short d_time; /* modification time */ unsigned short d_date; /* modification date */ }; typedef struct _dirdescr DIR; /* the structs do not have to be defined here */ extern DIR * API _opendir(const char *); #define opendir(a) _opendir(a) extern DIR *API _openxdir(const char *, unsigned); #define openxdir(a, b) _openxdir(a, b) extern struct dirent * API _readdir(DIR *); #define readdir(a) _readdir(a) extern void API _seekdir(DIR *, long); #define seekdir(a, b) _seekdir(a, b) extern long API _telldir(DIR *); #define telldir(a) _telldir(a) extern void API _closedir(DIR *); #define closedir(a) _closedir(a) #define rewinddir(dirp) _seekdir(dirp, 0L) extern char * API _abs_path(const char *name, char *buffer, int len); #define abs_path(a, b, c) _abs_path(a, b, c) #ifndef S_IFMT #define S_IFMT ( S_IFDIR | S_IFREG ) #endif #ifndef S_ISDIR #define S_ISDIR( m ) (((m) & S_IFMT) == S_IFDIR) #endif #ifndef S_ISREG #define S_ISREG( m ) (((m) & S_IFMT) == S_IFREG) #endif #ifdef __cplusplus } #endif #endif #endif