Skip to content

Commit

Permalink
remove std::array
Browse files Browse the repository at this point in the history
  • Loading branch information
goblinhack committed Apr 21, 2024
1 parent a084f84 commit ec36470
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 137 deletions.
29 changes: 9 additions & 20 deletions src/my_wid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,8 @@ int wid_get_height(Widp);
int wid_get_tl_x(Widp);
int wid_get_tl_y(Widp);
int wid_get_width(Widp);

int wid_get_style(Widp);

std::list< Widp > wid_find_all_at(const point p);
std::list< Widp > wid_find_all_containing(const std::string &name);
std::list< Widp > wid_find_all_containing(Widp w, const std::string &name);
std::list< Widp > wid_find_all(Widp w, const std::string &name);

std::string to_string(Widp);
std::string wid_get_name(Widp);
std::string wid_name(Widp);
Expand Down Expand Up @@ -106,9 +100,8 @@ int wid_get_br_y(Widp w);
int wid_get_tl_x(Widp w);
int wid_get_tl_y(Widp w);

int wid_count(Widp w, int depth);
int wid_get_int_context(Widp);
std::string wid_get_string_context(Widp);
int wid_count(Widp w, int depth);
int wid_get_int_context(Widp);

uint8_t wid_get_do_not_lower(Widp);
uint8_t wid_get_do_not_raise(Widp);
Expand Down Expand Up @@ -230,7 +223,6 @@ void wid_set_received_input(Widp, uint8_t val);
void wid_set_shape_none(Widp);
void wid_set_shape_square(Widp);
void wid_set_show_cursor(Widp, uint8_t val);
void wid_set_string_context(Widp w, std::string);
void wid_set_style(Widp w, int style);
void wid_set_tex_br(Widp, fsize val);
void wid_set_text_bot(Widp, uint8_t val);
Expand Down Expand Up @@ -263,10 +255,10 @@ typedef struct {
//
// Colors
//
std::array< color, WID_COLOR_MAX > colors;
std::array< uint8_t, WID_COLOR_MAX > color_set;
int style;
uint8_t style_set;
color colors[ WID_COLOR_MAX ];
uint8_t color_set[ WID_COLOR_MAX ];
int style;
uint8_t style_set;
} wid_cfg;

class tree_wid_key
Expand Down Expand Up @@ -464,14 +456,13 @@ class Wid
//
// Config layers:
//
std::array< wid_cfg, WID_MODE_LAST > cfg {};
wid_cfg cfg[ WID_MODE_LAST ] {};

//
// Client context
//
std::string string_context;
int int_context {-1};
void *void_context {};
int int_context {-1};
void *void_context {};

//
// Text placement.
Expand Down Expand Up @@ -547,8 +538,6 @@ extern bool wid_mouse_two_clicks;
extern const int wid_destroy_delay_ms;
extern int wid_mouse_visible;

extern std::array< std::array< Widp, TERM_HEIGHT_MAX >, TERM_WIDTH_MAX > wid_on_screen_at;

extern ts_t wid_ignore_events_briefly_ts;
extern ts_t wid_last_mouse_motion;
extern ts_t wid_last_over_event;
Expand Down
Loading

0 comments on commit ec36470

Please sign in to comment.