mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 06:32:42 +00:00
Rename old _ji_* functions
This commit is contained in:
parent
3171bd5ce7
commit
cb0cdb3197
@ -354,7 +354,7 @@ void gui_setup_screen(bool reload_font)
|
||||
}
|
||||
|
||||
if (reinit)
|
||||
_ji_reinit_theme_in_all_widgets();
|
||||
reinitThemeForAllWidgets();
|
||||
|
||||
// Set the configuration
|
||||
save_gui_config();
|
||||
@ -369,7 +369,7 @@ static void reload_default_font()
|
||||
skin_theme->reload_fonts();
|
||||
|
||||
// Set all widgets fonts
|
||||
_ji_set_font_of_all_widgets(theme->default_font);
|
||||
setFontOfAllWidgets(theme->default_font);
|
||||
}
|
||||
|
||||
void load_window_pos(Widget* window, const char *section)
|
||||
|
@ -1597,9 +1597,9 @@ void SkinTheme::paintComboBoxButton(PaintEvent& ev)
|
||||
|
||||
void SkinTheme::draw_textbox(Widget* widget, JRect clip)
|
||||
{
|
||||
_ji_theme_textbox_draw(ji_screen, widget, NULL, NULL,
|
||||
getColor(ThemeColor::TextBoxFace),
|
||||
getColor(ThemeColor::TextBoxText));
|
||||
drawTextBox(ji_screen, widget, NULL, NULL,
|
||||
getColor(ThemeColor::TextBoxFace),
|
||||
getColor(ThemeColor::TextBoxText));
|
||||
}
|
||||
|
||||
void SkinTheme::paintView(PaintEvent& ev)
|
||||
|
@ -41,7 +41,7 @@ FONT* ji_font_load_bmp(const char* filepathname)
|
||||
|
||||
if (bmp) {
|
||||
bmp = ji_apply_guiscale(bmp);
|
||||
f = _ji_bitmap2font(bmp);
|
||||
f = bitmapToFont(bmp);
|
||||
destroy_bitmap(bmp);
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ static int bitmap_font_count(BITMAP* bmp)
|
||||
|
||||
namespace ui {
|
||||
|
||||
FONT *_ji_bitmap2font(BITMAP *bmp)
|
||||
FONT* bitmapToFont(BITMAP* bmp)
|
||||
{
|
||||
FONT *f;
|
||||
int begin = ' ';
|
||||
|
@ -28,12 +28,12 @@ void _ji_widgets_exit()
|
||||
delete widgets;
|
||||
}
|
||||
|
||||
void _ji_add_widget(Widget* widget)
|
||||
void addWidget(Widget* widget)
|
||||
{
|
||||
widgets->push_back(widget);
|
||||
}
|
||||
|
||||
void _ji_remove_widget(Widget* widget)
|
||||
void removeWidget(Widget* widget)
|
||||
{
|
||||
std::list<Widget*>::iterator it =
|
||||
std::find(widgets->begin(), widgets->end(), widget);
|
||||
@ -42,7 +42,7 @@ void _ji_remove_widget(Widget* widget)
|
||||
widgets->erase(it);
|
||||
}
|
||||
|
||||
void _ji_set_font_of_all_widgets(FONT* f)
|
||||
void setFontOfAllWidgets(FONT* f)
|
||||
{
|
||||
for (std::list<Widget*>::iterator it=widgets->begin(), end=widgets->end();
|
||||
it != end; ++it) {
|
||||
@ -50,7 +50,7 @@ void _ji_set_font_of_all_widgets(FONT* f)
|
||||
}
|
||||
}
|
||||
|
||||
void _ji_reinit_theme_in_all_widgets()
|
||||
void reinitThemeForAllWidgets()
|
||||
{
|
||||
// Reinitialize the theme of each widget
|
||||
for (std::list<Widget*>::iterator it=widgets->begin(), end=widgets->end();
|
||||
|
@ -18,33 +18,22 @@ namespace ui {
|
||||
class Widget;
|
||||
class Window;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// jintern.c
|
||||
// intern.cpp
|
||||
|
||||
void _ji_add_widget(Widget* widget);
|
||||
void _ji_remove_widget(Widget* widget);
|
||||
void addWidget(Widget* widget);
|
||||
void removeWidget(Widget* widget);
|
||||
|
||||
void _ji_set_font_of_all_widgets(FONT* f);
|
||||
void _ji_reinit_theme_in_all_widgets();
|
||||
void setFontOfAllWidgets(FONT* f);
|
||||
void reinitThemeForAllWidgets();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// jwindow.c
|
||||
|
||||
bool _jwindow_is_moving();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// theme.cpp
|
||||
|
||||
void _ji_theme_draw_sprite_color(BITMAP *bmp, BITMAP *sprite,
|
||||
int x, int y, ui::Color color);
|
||||
void drawTextBox(BITMAP* bmp, Widget* textbox,
|
||||
int* w, int* h, ui::Color bg, ui::Color fg);
|
||||
|
||||
void _ji_theme_textbox_draw(BITMAP *bmp, Widget* textbox,
|
||||
int *w, int *h, ui::Color bg, ui::Color fg);
|
||||
// fontbmp.c
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// jfontbmp.c
|
||||
|
||||
struct FONT *_ji_bitmap2font(BITMAP *bmp);
|
||||
struct FONT* bitmapToFont(BITMAP* bmp);
|
||||
|
||||
} // namespace ui
|
||||
|
||||
|
@ -156,7 +156,7 @@ void TextBox::onPreferredSize(PreferredSizeEvent& ev)
|
||||
//w = widget->border_width.l + widget->border_width.r;
|
||||
//h = widget->border_width.t + widget->border_width.b;
|
||||
|
||||
_ji_theme_textbox_draw(NULL, this, &w, &h, ColorNone, ColorNone);
|
||||
drawTextBox(NULL, this, &w, &h, ColorNone, ColorNone);
|
||||
|
||||
if (this->getAlign() & JI_WORDWRAP) {
|
||||
View* view = View::getView(this);
|
||||
@ -170,7 +170,7 @@ void TextBox::onPreferredSize(PreferredSizeEvent& ev)
|
||||
}
|
||||
|
||||
w = MAX(min, width);
|
||||
_ji_theme_textbox_draw(NULL, this, &w, &h, ColorNone, ColorNone);
|
||||
drawTextBox(NULL, this, &w, &h, ColorNone, ColorNone);
|
||||
|
||||
w = min;
|
||||
}
|
||||
|
@ -94,19 +94,8 @@ BITMAP* ji_apply_guiscale(BITMAP* original)
|
||||
return original;
|
||||
}
|
||||
|
||||
void _ji_theme_draw_sprite_color(BITMAP *bmp, BITMAP *sprite,
|
||||
int x, int y, int color)
|
||||
{
|
||||
int u, v, mask = bitmap_mask_color(sprite);
|
||||
|
||||
for (v=0; v<sprite->h; v++)
|
||||
for (u=0; u<sprite->w; u++)
|
||||
if (getpixel(sprite, u, v) != mask)
|
||||
putpixel(bmp, x+u, y+v, color);
|
||||
}
|
||||
|
||||
void _ji_theme_textbox_draw(BITMAP *bmp, Widget* widget,
|
||||
int *w, int *h, ui::Color bg, ui::Color fg)
|
||||
void drawTextBox(BITMAP* bmp, Widget* widget,
|
||||
int* w, int* h, ui::Color bg, ui::Color fg)
|
||||
{
|
||||
View* view = View::getView(widget);
|
||||
char *text = (char*)widget->getText(); // TODO warning: removing const modifier
|
||||
|
@ -41,7 +41,7 @@ int ji_register_widget_type()
|
||||
|
||||
Widget::Widget(int type)
|
||||
{
|
||||
_ji_add_widget(this);
|
||||
addWidget(this);
|
||||
|
||||
this->type = type;
|
||||
this->rc = jrect_new(0, 0, 0, 0);
|
||||
@ -103,8 +103,8 @@ Widget::~Widget()
|
||||
// Delete the preferred size
|
||||
delete m_preferredSize;
|
||||
|
||||
/* low level free */
|
||||
_ji_remove_widget(this);
|
||||
// Low level free
|
||||
removeWidget(this);
|
||||
}
|
||||
|
||||
void Widget::deferDelete()
|
||||
|
Loading…
x
Reference in New Issue
Block a user