Skip to content

Commit

Permalink
Rename r_cons_pal_update_event -> r_cons_pal_reload
Browse files Browse the repository at this point in the history
  • Loading branch information
jukuisma committed Jan 17, 2025
1 parent 14d77fb commit e5533e3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions libr/cons/pal.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ R_API void r_cons_pal_random(void) {
rcolor = RCOLOR_AT (i);
*rcolor = r_cons_color_random (ALPHA_FG);
}
r_cons_pal_update_event ();
r_cons_pal_reload ();
}

R_API char *r_cons_pal_parse(const char *str, R_NULLABLE RColor *outcol) {
Expand Down Expand Up @@ -618,7 +618,7 @@ R_API void r_cons_pal_list(int rad, const char *arg) {
}

/* Modify the palette to set a color value.
* r_cons_pal_update_event () must be called after this function
* r_cons_pal_reload () must be called after this function
* so the changes take effect. */
R_API int r_cons_pal_set(const char *key, const char *val) {
size_t i;
Expand Down Expand Up @@ -665,8 +665,7 @@ R_API int r_cons_pal_len(void) {
return keys_len;
}

// R2_600 TODO: rename to RCons.pal_reload() // pal_apply() maybe?
R_API void r_cons_pal_update_event(void) {
R_API void r_cons_pal_reload(void) {
__cons_pal_update_event (r_cons_context ());
}

Expand Down
2 changes: 1 addition & 1 deletion libr/core/cconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -1609,7 +1609,7 @@ static bool cb_color(void *user, void *data) {
}
r_cons_singleton ()->context->color_mode = (node->i_value > COLOR_MODE_16M)
? COLOR_MODE_16M: node->i_value;
r_cons_pal_update_event ();
r_cons_pal_reload ();
r_print_set_flags (core->print, core->print->flags);
r_log_set_colors (node->i_value);
return true;
Expand Down
4 changes: 2 additions & 2 deletions libr/core/cmd_eval.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static bool cmd_load_theme(RCore *core, const char *_arg) {
if (R_STR_ISNOTEMPTY (theme_script)) {
core->cmdfilter = "ec ";
r_core_cmd_lines (core, theme_script);
r_cons_pal_update_event ();
r_cons_pal_reload ();
core->cmdfilter = NULL;
ret = true; // maybe the script fails?
} else {
Expand Down Expand Up @@ -606,7 +606,7 @@ static bool cmd_ec(RCore *core, const char *input) {
// Set color
*q++ = 0;
if (r_cons_pal_set (p, q)) {
r_cons_pal_update_event ();
r_cons_pal_reload ();
}
} else {
char color[32] = {0};
Expand Down
2 changes: 1 addition & 1 deletion libr/include/r_cons.h
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ R_API void r_cons_thready(void);

R_API int r_cons_palette_init(const unsigned char *pal);
R_API int r_cons_pal_set(const char *key, const char *val);
R_API void r_cons_pal_update_event(void);
R_API void r_cons_pal_reload(void);
R_API void r_cons_pal_free(RConsContext *ctx);
R_API void r_cons_pal_init(RConsContext *ctx);
R_API void r_cons_pal_copy(RConsContext *dst, RConsContext *src);
Expand Down

0 comments on commit e5533e3

Please sign in to comment.