home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek 6
/
Geek-006.iso
/
linux
/
video
/
xmovie-1.5.3.tar.gz
/
xmovie-1.5.3.tar
/
xmovie-1.5.3
/
xmovie
/
theme.C
< prev
next >
Wrap
C/C++ Source or Header
|
2000-11-29
|
7KB
|
291 lines
#include "asset.h"
#include "bcresources.h"
#include "blond/bg_image_png.h"
#include "blond/bar_left_png.h"
#include "blond/bar_mid_png.h"
#include "blond/bar_right_png.h"
#include "blond/cancel_dn_png.h"
#include "blond/cancel_up_png.h"
#include "blond/cancel_uphi_png.h"
#include "blond/checkbox_checked_png.h"
#include "blond/checkbox_checkedhi_png.h"
#include "blond/checkbox_downhi_png.h"
#include "blond/checkbox_up_png.h"
#include "blond/checkbox_uphi_png.h"
#include "blond/files_icon_dn_png.h"
#include "blond/files_icon_hi_png.h"
#include "blond/files_icon_up_png.h"
#include "blond/files_newfolder_dn_png.h"
#include "blond/files_newfolder_hi_png.h"
#include "blond/files_newfolder_up_png.h"
#include "blond/files_prevdir_dn_png.h"
#include "blond/files_prevdir_hi_png.h"
#include "blond/files_prevdir_up_png.h"
#include "blond/files_text_dn_png.h"
#include "blond/files_text_hi_png.h"
#include "blond/files_text_up_png.h"
#include "blond/framebacksmall_downhi_png.h"
#include "blond/framebacksmall_up_png.h"
#include "blond/framebacksmall_uphi_png.h"
#include "blond/framefwdsmall_downhi_png.h"
#include "blond/framefwdsmall_up_png.h"
#include "blond/framefwdsmall_uphi_png.h"
#include "blond/heroine_bg_png.h"
#include "blond/listbutton_dn_png.h"
#include "blond/listbutton_hi_png.h"
#include "blond/listbutton_up_png.h"
#include "blond/ok_dn_png.h"
#include "blond/ok_up_png.h"
#include "blond/ok_uphi_png.h"
#include "blond/pausesmall_downhi_png.h"
#include "blond/pausesmall_up_png.h"
#include "blond/pausesmall_uphi_png.h"
#include "blond/playsmall_downhi_png.h"
#include "blond/playsmall_up_png.h"
#include "blond/playsmall_uphi_png.h"
#include "blond/slider_hi_png.h"
#include "blond/slider_left_png.h"
#include "blond/slider_mid_png.h"
#include "blond/slider_right_png.h"
#include "blond/slider_dn_png.h"
#include "blond/slider_up_png.h"
#include "blond/slider_uphi_png.h"
#include "blond/usethis_dn_png.h"
#include "blond/usethis_up_png.h"
#include "blond/usethis_uphi_png.h"
#include "guicast.h"
#include "mainmenu.h"
#include "mainwindow.h"
#include "mwindowgui.h"
#include "theme.h"
#include "vframe.h"
VFrame *blond_checkbox[5] =
{
new VFrame(checkbox_up_png),
new VFrame(checkbox_uphi_png),
new VFrame(checkbox_checked_png),
new VFrame(checkbox_downhi_png),
new VFrame(checkbox_checkedhi_png)
};
VFrame *blond_listbutton[3] =
{
new VFrame(listbutton_up_png),
new VFrame(listbutton_hi_png),
new VFrame(listbutton_dn_png)
};
VFrame *blond_bg_image = new VFrame(bg_image_png);
VFrame *blond_play[] =
{
new VFrame(playsmall_up_png),
new VFrame(playsmall_uphi_png),
new VFrame(playsmall_downhi_png)
};
VFrame *blond_frame_fwd[] =
{
new VFrame(framefwdsmall_up_png),
new VFrame(framefwdsmall_uphi_png),
new VFrame(framefwdsmall_downhi_png)
};
VFrame *blond_frame_bck[] =
{
new VFrame(framebacksmall_up_png),
new VFrame(framebacksmall_uphi_png),
new VFrame(framebacksmall_downhi_png)
};
VFrame *blond_pause[] =
{
new VFrame(pausesmall_up_png),
new VFrame(pausesmall_uphi_png),
new VFrame(pausesmall_downhi_png)
};
VFrame *blond_slider_data[] =
{
new VFrame(slider_up_png),
new VFrame(slider_uphi_png),
new VFrame(slider_dn_png),
new VFrame(slider_left_png),
new VFrame(slider_mid_png),
new VFrame(slider_right_png)
};
VFrame *blond_ok_images[] =
{
new VFrame(ok_up_png),
new VFrame(ok_uphi_png),
new VFrame(ok_dn_png)
};
VFrame *blond_cancel_images[] =
{
new VFrame(cancel_up_png),
new VFrame(cancel_uphi_png),
new VFrame(cancel_dn_png)
};
VFrame *blond_filebox_text_images[] =
{
new VFrame(files_text_up_png),
new VFrame(files_text_hi_png),
new VFrame(files_text_dn_png)
};
VFrame *blond_filebox_icons_images[] =
{
new VFrame(files_icon_up_png),
new VFrame(files_icon_hi_png),
new VFrame(files_icon_dn_png)
};
VFrame *blond_filebox_updir_images[] =
{
new VFrame(files_prevdir_up_png),
new VFrame(files_prevdir_hi_png),
new VFrame(files_prevdir_dn_png)
};
VFrame *blond_filebox_newfolder_images[] =
{
new VFrame(files_newfolder_up_png),
new VFrame(files_newfolder_hi_png),
new VFrame(files_newfolder_dn_png)
};
Theme::Theme()
{
play = blond_play;
frame_fwd = blond_frame_fwd;
frame_bck = blond_frame_bck;
pause = blond_pause;
}
GoldTheme::GoldTheme()
: Theme()
{
BC_WindowBase::get_resources()->bg_image = 0;
BC_WindowBase::get_resources()->bg_color = 0xb4b487;
// BC_WindowBase::get_resources()->ok_images = blond_ok_images;
// BC_WindowBase::get_resources()->cancel_images = blond_cancel_images;
// BC_WindowBase::get_resources()->checkbox_images = blond_checkbox;
BC_WindowBase::get_resources()->button_up = 0xffc000;
BC_WindowBase::get_resources()->button_highlighted = 0xffe000;
// BC_WindowBase::get_resources()->filebox_text_images = blond_filebox_text_images;
// BC_WindowBase::get_resources()->filebox_icons_images = blond_filebox_icons_images;
// BC_WindowBase::get_resources()->filebox_updir_images = blond_filebox_updir_images;
// BC_WindowBase::get_resources()->filebox_newfolder_images = blond_filebox_newfolder_images;
// BC_WindowBase::get_resources()->listbox_button = blond_listbutton;
BC_WindowBase::get_resources()->horizontal_slider = blond_slider_data;
bar_left = new VFrame(bar_left_png);
bar_mid = new VFrame(bar_mid_png);
bar_right = new VFrame(bar_right_png);
heroine_bg = new VFrame(heroine_bg_png);
}
int GoldTheme::update_positions(MainWindow *mwindow, MWindowGUI *gui, int &w, int &h)
{
int x = 0, y = gui->menu->get_h();
// Get canvas dimensions
canvas_x = x;
canvas_y = y;
// Fix minimum height
if(h <= 0)
{
h = y + bar_left->get_h() + 5;
}
if(mwindow->asset && mwindow->asset->video_data)
{
int full_w, full_h;
mwindow->get_full_size(full_w, full_h);
if(labs(full_w - w) < 50)
{
w = full_w;
}
mwindow->get_canvas_sizes(w);
w = mwindow->canvas_w + canvas_x;
h = canvas_y + mwindow->canvas_h + bar_left->get_h();
}
else
{
mwindow->canvas_w = w;
mwindow->canvas_h = h - bar_left->get_h() - canvas_y;
}
x += 5;
y += mwindow->canvas_h;
time_x = x;
time_y = y + 3;
x += TIMEW;
play_x = x;
play_y = y + 3;
x += blond_play[0]->get_w();
frameback_x = x;
frameback_y = y + 3;
x += blond_frame_bck[0]->get_w();
framefwd_x = x;
framefwd_y = y + 3;
x += blond_frame_fwd[0]->get_w() + bar_mid->get_w();
scroll_x = x;
scroll_y = y + 7;
scroll_w = w - scroll_x - 5;
return 0;
}
int GoldTheme::draw_mwindow_bg(MainWindow *mwindow, MWindowGUI *gui)
{
int x;
gui->draw_background(canvas_x, canvas_y, mwindow->canvas_w, mwindow->canvas_h);
gui->draw_vframe(heroine_bg,
gui->get_w() / 2 - heroine_bg->get_w() / 2,
gui->get_h() / 2 - heroine_bg->get_h() / 2);
scroll_x -= bar_mid->get_w();
for(x = 0; x < scroll_x; )
{
int dest_w = (x + bar_left->get_w() - 1 < scroll_x) ? (bar_left->get_w() - 1) : (scroll_x - x);
gui->draw_vframe(bar_left,
x,
gui->get_h() - bar_left->get_h(),
dest_w);
x += dest_w;
}
gui->draw_vframe(bar_mid,
x,
gui->get_h() - bar_mid->get_h());
x += bar_mid->get_w() - 1;
while(x < gui->get_w())
{
int dest_w = (x + bar_right->get_w() - 1 < gui->get_w()) ? (bar_right->get_w() - 1) : (gui->get_w() - x);
gui->draw_vframe(bar_right,
x,
gui->get_h() - bar_right->get_h(),
dest_w);
x += dest_w;
}
scroll_x += bar_mid->get_w();
gui->flash();
return 0;
}