added Item$ = "__SmIC__="+FileName$ to COLUMNBOX ADD, add a filemode: r+ ( read/write )

This commit is contained in:
Jim
2015-05-05 21:04:32 -07:00
parent cd2a1ddb30
commit 83339084fe
13 changed files with 639 additions and 348 deletions

View File

@@ -47,7 +47,7 @@ GPP_OPT = $(DBG) $(OPT) -I. -DHAVE_CONFIG -DUNIX $(HAIKUOPT)
## Libraries
##
##LIBPATH = -L/boot/home/config/lib
LIBPATHS = $(shell findpaths B_FIND_PATH_LIB_DIRECTORY)
LIBPATHS = $(shell findpaths -a `getarch` B_FIND_PATH_LIB_DIRECTORY)
LIBPATH=$(addprefix -L,$(LIBPATHS))
##LIBPATH = -L`finddir B_SYSTEM_LIB_DIRECTORY` ##/boot/system/lib
LIB = -lbe -lroot -ltranslation -ltracker -lmedia

View File

@@ -277,14 +277,45 @@ void BYabField::SetString(const char* val, int height)
fString.CopyInto(myPath, 9, fString.Length()-9);
#ifdef ZETA
fBitmap = new BBitmap(BRect(0, 0, 15, 15), B_RGBA32);
BEntry fEntry = BEntry( myPath.String() );
BEntry fEntry = BEntry(myPath.String());
BBitmap icon = &GetTrackerIcon(fEntry, 16);
*fBitmap = icon;
#else
fBitmap = new BBitmap(BRect(0, 0, 31, 31), B_RGBA32);
fBitmap = new BBitmap(BRect(0, 0,31, 31), B_RGBA32);
BNode *fNode = new BNode(myPath.String());
BNodeInfo fInfo(fNode);
fInfo.GetTrackerIcon(fBitmap, B_LARGE_ICON);
int i;
i=32;
icon_size ics;
ics=(icon_size)i;
fInfo.GetTrackerIcon( fBitmap, ics );
//fInfo.GetTrackerIcon(fBitmap, B_MINI_ICON);
delete fNode;
#endif
}
else if( ! fString.FindFirst("__SmIC__=") )
{
BString myPath;
fString.CopyInto(myPath, 9, fString.Length()-9);
#ifdef ZETA
fBitmap = new BBitmap(BRect(0, 0, 15, 15), B_RGBA32);
BEntry fEntry = BEntry(myPath.String());
BBitmap icon = &GetTrackerIcon(fEntry, 16);
*fBitmap = icon;
#else
fBitmap = new BBitmap(BRect(0, 0, 15, 15), B_RGBA32);
BNode *fNode = new BNode(myPath.String());
BNodeInfo fInfo(fNode);
int i;
i=16;
icon_size ics;
ics=(icon_size)i;
fInfo.GetTrackerIcon( fBitmap, ics );
//fInfo.GetTrackerIcon(fBitmap, B_MINI_ICON);
delete fNode;
#endif
}

View File

@@ -707,7 +707,7 @@ void function(struct command *current,YabInterface* yab) /* performs a function
case fTELL:
i=(int)(a1->value);
if (badstream(i,0)) return;
if (!(stream_modes[i] & (smREAD | smWRITE))) {
if (!(stream_modes[i] & (smREAD | smWRITE| smREADWRITE))) {
sprintf(string,"stream %d not opened",i);
error(ERROR,string);
value=0;
@@ -1681,7 +1681,7 @@ static double peek(char *dest, YabInterface *yab) /* peek into internals */
static int peekfile(int stream) /* read a byte from stream */
{
if (stream && badstream(stream,0)) return 0;
if (stream && !(stream_modes[stream] & smREAD)) {
if (stream && !(stream_modes[stream] & smREAD | smREADWRITE)) {
sprintf(string,"stream %d not open for reading",stream);
error(ERROR,string);
return 0;

View File

@@ -626,17 +626,17 @@ void myopen(struct command *cmd) /* open specified file for given name */
char *name=NULL;
char *mode=NULL;
char **pmode;
static char *valid_modes[]={"r","w","a","rb","wb","ab",""};
static int smodes[]={smREAD,smWRITE,smWRITE,smREAD,smWRITE,smWRITE};
static char *valid_modes[]={"r+","r","w","a","rb","wb","ab",""};
static int smodes[]={smREADWRITE,smREAD,smWRITE,smWRITE,smREAD,smWRITE,smWRITE,smREAD};
int smode;
struct stackentry *p;
int has_mode,has_stream,printer=0;
/* decode cmd->tag */
has_stream=cmd->tag&OPEN_HAS_STREAM;
has_mode=cmd->tag&OPEN_HAS_MODE;
/* printer=cmd->tag&OPEN_PRINTER;*/
if (has_mode)
mode=my_strdup(pop(stSTRING)->pointer);
else
@@ -817,7 +817,7 @@ void myseek(struct command *cmd) /* reposition file pointer */
}
my_free(mode);
if (abs(s)==STDIO_STREAM || badstream(s,0)) return;
if (!(stream_modes[s] & (smREAD | smWRITE))) {
if (!(stream_modes[s] & (smREAD | smWRITE | smREADWRITE))) {
sprintf(errorstring,"stream %d not open",s);
errorcode=11;
return;
@@ -906,7 +906,7 @@ int checkstream(void) /* test if currst is still valid */
input=(currstr>0);
if (!stdio) {
if (input && !(stream_modes[abs(currstr)] & smREAD)) {
if (input && !(stream_modes[abs(currstr)] & smREAD| smREADWRITE)) {
sprintf(string,"stream %d not open for reading",abs(currstr));
error(ERROR,string);
return FALSE;

View File

@@ -26,9 +26,7 @@ can be found at www.yabasic.de
/* ------------- defines ---------------- */
#define DONE {current=current->next;break;} /* reduces type-work */
#define COPYRIGHT "original yabasic Copyright 1995-2006 by Marc-Oliver Ihm\n
\tyab improvements Copyright 2006-2014 by Jan Bungeroth\n
\tyab improvements Copyright 2013-2015 by Jim Saxton\n"
#define COPYRIGHT "original yabasic Copyright 1995-2006 by Marc-Oliver Ihm\n\tyab improvements Copyright 2006-2014 by Jan Bungeroth\n\tyab improvements Copyright 2013-2015 by Jim Saxton\n"
#define BANNER \
"\n yab is yabasic for Haiku. This is version " VERSION ",\n built on "\
ARCHITECTURE " on " BUILD_TIME "\n\n " COPYRIGHT "\n\n"
@@ -920,7 +918,7 @@ static void initialize(void)
stream_modes[i]=smCLOSED;
}
streams[0]=stdin;
stream_modes[0]=smREAD | smWRITE;
stream_modes[0]=smREAD | smWRITE | smREADWRITE;
#ifdef UNIX
/* printerfile=NULL; /* no ps-file yet */
#endif

View File

@@ -287,7 +287,7 @@ enum endreasons { /* ways to end the program */
};
enum streammodes { /* ways to access a stream */
smCLOSED=0,smREAD=1,smWRITE=2,smPRINT=4
smCLOSED=0,smREAD=1,smWRITE=2,smPRINT=4,smREADWRITE=3
};
enum functions { /* functions in yabasic (sorted by number of arguments) */