mirror of
https://github.com/fltk/fltk.git
synced 2026-05-30 04:55:29 +08:00
Completing access to FL_BLINE in Fl_Browser.
May be used by derived classes like Fl_File_Browser for fast access.
This commit is contained in:
+5
-2
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Browser header file for the Fast Light Tool Kit (FLTK).
|
// Browser header file for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
// Copyright 1998-2023 by Bill Spitzak and others.
|
// Copyright 1998-2026 by Bill Spitzak and others.
|
||||||
//
|
//
|
||||||
// This library is free software. Distribution and use rights are outlined in
|
// This library is free software. Distribution and use rights are outlined in
|
||||||
// the file "COPYING" which should have been included with this file. If this
|
// the file "COPYING" which should have been included with this file. If this
|
||||||
@@ -135,9 +135,12 @@ protected:
|
|||||||
void*& bline_data(FL_BLINE* b) const;
|
void*& bline_data(FL_BLINE* b) const;
|
||||||
const void* bline_data(const FL_BLINE* b) const;
|
const void* bline_data(const FL_BLINE* b) const;
|
||||||
char& bline_flags(FL_BLINE* b) const;
|
char& bline_flags(FL_BLINE* b) const;
|
||||||
const char bline_flags(const FL_BLINE* b) const;
|
char bline_flags(const FL_BLINE* b) const;
|
||||||
char* bline_txt(FL_BLINE* b) const;
|
char* bline_txt(FL_BLINE* b) const;
|
||||||
const char* bline_txt(const FL_BLINE* b) const;
|
const char* bline_txt(const FL_BLINE* b) const;
|
||||||
|
Fl_Image*& bline_icon(FL_BLINE* b) const;
|
||||||
|
const Fl_Image* bline_icon(const FL_BLINE* b) const;
|
||||||
|
short bline_length(const FL_BLINE* b) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
+45
-8
@@ -40,18 +40,55 @@ struct FL_BLINE { // data is in a linked list of these
|
|||||||
FL_BLINE* next;
|
FL_BLINE* next;
|
||||||
void* data;
|
void* data;
|
||||||
Fl_Image* icon;
|
Fl_Image* icon;
|
||||||
short length; // sizeof(txt)-1, may be longer than string
|
short length; // allocated size of txt[] (excl. null terminator); current string may be shorter
|
||||||
char flags; // selected, displayed
|
char flags; // selected, displayed
|
||||||
char txt[1]; // start of allocated array
|
char txt[1]; // start of allocated array
|
||||||
};
|
};
|
||||||
|
|
||||||
/** FL_BLINE access without publishing struct FL_BLINE */
|
/** Get writable reference to FL_BLINE data. */
|
||||||
void*& Fl_Browser::bline_data(FL_BLINE* b) const { return b->data; }
|
void*& Fl_Browser::bline_data(FL_BLINE* b) const {
|
||||||
const void* Fl_Browser::bline_data(const FL_BLINE* b) const { return b->data; }
|
return b->data;
|
||||||
char& Fl_Browser::bline_flags(FL_BLINE* b) const { return b->flags; }
|
}
|
||||||
const char Fl_Browser::bline_flags(const FL_BLINE* b) const { return b->flags; }
|
|
||||||
char* Fl_Browser::bline_txt(FL_BLINE* b) const { return b->txt; }
|
/** Get FL_BLINE data. */
|
||||||
const char* Fl_Browser::bline_txt(const FL_BLINE* b) const { return b->txt; }
|
const void* Fl_Browser::bline_data(const FL_BLINE* b) const {
|
||||||
|
return b->data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Get writable reference to FL_BLINE flags. */
|
||||||
|
char& Fl_Browser::bline_flags(FL_BLINE* b) const {
|
||||||
|
return b->flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Get FL_BLINE flags. */
|
||||||
|
char Fl_Browser::bline_flags(const FL_BLINE* b) const {
|
||||||
|
return b->flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Get writable reference to FL_BLINE text. */
|
||||||
|
char* Fl_Browser::bline_txt(FL_BLINE* b) const {
|
||||||
|
return b->txt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Get FL_BLINE text. */
|
||||||
|
const char* Fl_Browser::bline_txt(const FL_BLINE* b) const {
|
||||||
|
return b->txt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Get writable reference to FL_BLINE icon. */
|
||||||
|
Fl_Image*& Fl_Browser::bline_icon(FL_BLINE* b) const {
|
||||||
|
return b->icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Get FL_BLINE icon. */
|
||||||
|
const Fl_Image* Fl_Browser::bline_icon(const FL_BLINE* b) const {
|
||||||
|
return b->icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Get FL_BLINE allocated text buffer size (excl. null terminator). */
|
||||||
|
short Fl_Browser::bline_length(const FL_BLINE* b) const {
|
||||||
|
return b->length;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user