return result;
}
-#define COLOR_W 100
-#define COLOR_H 30
+#define COLOR_W xS(100)
+#define COLOR_H yS(30)
GradientWindow::GradientWindow(GradientMain *plugin)
- : PluginClientWindow(plugin, 350, 290, 350, 290, 0)
+ : PluginClientWindow(plugin, xS(350), yS(290), xS(350), yS(290), 0)
{
this->plugin = plugin;
angle = 0;
void GradientWindow::create_objects()
{
+ int xs10 = xS(10);
+ int ys10 = yS(10);
int margin = plugin->get_theme()->widget_border;
- int x = 10, y = 10;
+ int x = xs10, y = ys10;
BC_Title *title;
add_subwindow(title = new BC_Title(x, y, _("Shape:")));
delete center_y; center_y = 0;
if( !angle ) {
add_subwindow(angle_title = new BC_Title(x, y, _("Angle:")));
- add_subwindow(angle = new GradientAngle(plugin, x + angle_title->get_w() + 10, y));
+ add_subwindow(angle = new GradientAngle(plugin, x + angle_title->get_w() + xS(10), y));
}
}
else {
if( !center_x ) {
add_subwindow(center_x_title = new BC_Title(x, y, _("Center X:")));
add_subwindow(center_x = new GradientCenterX(plugin,
- x + center_x_title->get_w() + 10, y));
- x += center_x_title->get_w() + 10 + center_x->get_w() + 10;
+ x + center_x_title->get_w() + xS(10), y));
+ x += center_x_title->get_w() + xS(10) + center_x->get_w() + xS(10);
add_subwindow(center_y_title = new BC_Title(x, y, _("Center Y:")));
add_subwindow(center_y = new GradientCenterY(plugin,
- x + center_y_title->get_w() + 10, y));
+ x + center_y_title->get_w() + xS(10), y));
}
}
show_window();
}
GradientShape::GradientShape(GradientMain *plugin, GradientWindow *gui, int x, int y)
- : BC_PopupMenu(x, y, 100, to_text(plugin->config.shape), 1)
+ : BC_PopupMenu(x, y, xS(100), to_text(plugin->config.shape), 1)
{
this->plugin = plugin;
this->gui = gui;
GradientCenterX::GradientCenterX(GradientMain *plugin, int x, int y)
- : BC_FPot(x, y, plugin->config.center_x, 0, 100)
+ : BC_FPot(x, y, plugin->config.center_x, 0, xS(100))
{
this->plugin = plugin;
}
GradientCenterY::GradientCenterY(GradientMain *plugin, int x, int y)
- : BC_FPot(x, y, plugin->config.center_y, 0, 100)
+ : BC_FPot(x, y, plugin->config.center_y, 0, xS(100))
{
this->plugin = plugin;
}
GradientRate::GradientRate(GradientMain *plugin, int x, int y)
- : BC_PopupMenu(x, y, 100, to_text(plugin->config.rate), 1)
+ : BC_PopupMenu(x, y, xS(100), to_text(plugin->config.rate), 1)
{
this->plugin = plugin;
}
GradientInRadius::GradientInRadius(GradientMain *plugin, int x, int y)
- : BC_FSlider(x, y, 0, 200, 200,
+ : BC_FSlider(x, y, 0, xS(200), yS(200),
0.f, 100.f, (float)plugin->config.in_radius)
{
this->plugin = plugin;
GradientOutRadius::GradientOutRadius(GradientMain *plugin, int x, int y)
- : BC_FSlider(x, y, 0, 200, 200,
+ : BC_FSlider(x, y, 0, xS(200), yS(200),
0.f, 100.f, (float)plugin->config.out_radius)
{
this->plugin = plugin;
{
this->plugin = plugin;
this->gui = gui;
- for( int i=0; i<3; ++i ) {
- vframes[i] = new VFrame(COLOR_W, COLOR_H, BC_RGB888);
- vframes[i]->clear_frame();
- }
}
GradientInColorButton::~GradientInColorButton()
{
- for( int i=0; i<3; ++i )
- delete vframes[i];
}
void GradientInColorButton::handle_done_event(int result)
{
this->plugin = plugin;
this->gui = gui;
- for( int i=0; i<3; ++i ) {
- vframes[i] = new VFrame(COLOR_W, COLOR_H, BC_RGB888);
- vframes[i]->clear_frame();
- }
}
GradientOutColorButton::~GradientOutColorButton()
{
- for( int i=0; i<3; ++i )
- delete vframes[i];
}
void GradientOutColorButton::handle_done_event(int result)
{
if( result ) {
- gui->lock_window("GradientInColorButton::handle_done_event");
+ gui->lock_window("GradientOutColorButton::handle_done_event");
update_gui(orig_color, orig_alpha);
gui->unlock_window();
handle_new_color(orig_color, orig_alpha);
int out1, out2, out3, out4;
YUV::yuv.rgb_to_yuv_8(in_r,in_g,in_b, in1,in2,in3);
in4 = plugin->config.in_a;
- int out_r = plugin->config.in_r;
- int out_g = plugin->config.in_g;
- int out_b = plugin->config.in_b;
+ int out_r = plugin->config.out_r;
+ int out_g = plugin->config.out_g;
+ int out_b = plugin->config.out_b;
YUV::yuv.rgb_to_yuv_8(out_r,out_g,out_b, out1,out2,out3);
out4 = plugin->config.out_a;
CREATE_GRADIENT(unsigned char, int, 3, 0xff)
int out1, out2, out3, out4;
YUV::yuv.rgb_to_yuv_8(in_r,in_g,in_b, in1,in2,in3);
in4 = plugin->config.in_a;
- int out_r = plugin->config.in_r;
- int out_g = plugin->config.in_g;
- int out_b = plugin->config.in_b;
+ int out_r = plugin->config.out_r;
+ int out_g = plugin->config.out_g;
+ int out_b = plugin->config.out_b;
YUV::yuv.rgb_to_yuv_8(out_r,out_g,out_b, out1,out2,out3);
out4 = plugin->config.out_a;
CREATE_GRADIENT(unsigned char, int, 4, 0xff)