if(!result)
{
- for(int i = 0; i < mwindow->vwindows.size(); i++)
+ for(int i = 0; !result && i < mwindow->vwindows.size(); i++)
{
VWindow *vwindow = mwindow->vwindows.get(i);
+ if( !vwindow ) continue;
if( !vwindow->is_running() ) continue;
+ if( vwindow->gui->is_hidden() ) continue;
vwindow->gui->lock_window("AWindowAssets::drag_stop_event");
- result = vwindow->gui->drag_stop();
+ if( vwindow->gui->cursor_above() &&
+ vwindow->gui->get_cursor_over_window() ) {
+ result = vwindow->gui->drag_stop();
+ }
vwindow->gui->unlock_window();
}
}
inactive = 0;
crop_translate = 0;
eyedrop_visible = 0;
+ highlighted = 0;
}
CWindowGUI::~CWindowGUI()
{
if(get_hidden()) return;
- if(mwindow->session->current_operation == DRAG_ASSET ||
- mwindow->session->current_operation == DRAG_VTRANSITION ||
- mwindow->session->current_operation == DRAG_VEFFECT)
- {
- int old_status = mwindow->session->ccanvas_highlighted;
- int cursor_x = get_relative_cursor_x();
- int cursor_y = get_relative_cursor_y();
-
- mwindow->session->ccanvas_highlighted = get_cursor_over_window() &&
- cursor_x >= canvas->x &&
- cursor_x < canvas->x + canvas->w &&
- cursor_y >= canvas->y &&
- cursor_y < canvas->y + canvas->h;
-
-
- if(old_status != mwindow->session->ccanvas_highlighted)
- canvas->draw_refresh();
- }
+ if(mwindow->session->current_operation != DRAG_ASSET &&
+ mwindow->session->current_operation != DRAG_VTRANSITION &&
+ mwindow->session->current_operation != DRAG_VEFFECT) return;
+ int need_highlight = cursor_above() && get_cursor_over_window();
+ if( highlighted == need_highlight ) return;
+ highlighted = need_highlight;
+ canvas->draw_refresh();
}
int CWindowGUI::drag_stop()
{
int result = 0;
if(get_hidden()) return 0;
-
- if((mwindow->session->current_operation == DRAG_ASSET ||
- mwindow->session->current_operation == DRAG_VTRANSITION ||
- mwindow->session->current_operation == DRAG_VEFFECT) &&
- mwindow->session->ccanvas_highlighted)
- {
-// Hide highlighting
- mwindow->session->ccanvas_highlighted = 0;
- canvas->draw_refresh();
- result = 1;
- }
- else
- return 0;
+ if( !highlighted ) return 0;
+ if( mwindow->session->current_operation != DRAG_ASSET &&
+ mwindow->session->current_operation != DRAG_VTRANSITION &&
+ mwindow->session->current_operation != DRAG_VEFFECT) return 0;
+ highlighted = 0;
+ canvas->draw_refresh();
+ result = 1;
if(mwindow->session->current_operation == DRAG_ASSET)
{
get_canvas()->set_opaque();
}
- if(mwindow->session->ccanvas_highlighted)
+ if(gui->highlighted)
{
get_canvas()->set_color(WHITE);
get_canvas()->set_inverse();
// Must recalculate the origin when pressing shift.
// Switch toggle on and off to recalculate origin.
int translating_zoom;
+ int highlighted;
};
// Read the file format & index state.
if(test_indexable->is_asset)
{
- Asset *asset = (Asset*)test_indexable;
- asset->read(&xml);
-
+ Asset asset, *test_asset = (Asset *)test_indexable;
+ asset.read(&xml);
//printf("IndexFile::read_info %d %f\n", __LINE__, asset->get_frame_rate());
- if(asset->format == FILE_UNKNOWN)
+ if( asset.format == FILE_UNKNOWN ||
+ test_asset->format != asset.format )
{
if(debug) printf("IndexFile::read_info %d\n", __LINE__);
return 1;
track_highlighted = 0;
plugin_highlighted = 0;
pluginset_highlighted = 0;
- vcanvas_highlighted = 0;
- ccanvas_highlighted = 0;
edit_highlighted = 0;
current_operation = NO_OPERATION;
drag_pluginservers = new ArrayList<PluginServer*>;
#include "pluginset.inc"
#include "pluginserver.inc"
#include "track.inc"
+#include "vwindowgui.inc"
// Options not in EDL but not changed in preferences
class MainSession
PluginSet *pluginset_highlighted;
// The plugin after the point where the plugin is going to be dropped.
Plugin *plugin_highlighted;
-// Viewer canvas highlighted
- int vcanvas_highlighted;
-// Compositor canvas highlighted
- int ccanvas_highlighted;
// Current drag operation
int current_operation;
meters = 0;
// source = 0;
strcpy(loaded_title, "");
+ highlighted = 0;
}
VWindowGUI::~VWindowGUI()
// Window hidden
if(get_hidden()) return;
if(mwindow->session->current_operation != DRAG_ASSET) return;
-
- int old_status = mwindow->session->vcanvas_highlighted;
-
- int cursor_x = get_relative_cursor_x();
- int cursor_y = get_relative_cursor_y();
-
- mwindow->session->vcanvas_highlighted = (get_cursor_over_window() &&
- cursor_x >= canvas->x &&
- cursor_x < canvas->x + canvas->w &&
- cursor_y >= canvas->y &&
- cursor_y < canvas->y + canvas->h);
-
-
-//printf("VWindowGUI::drag_motion 1 %d %d %d %d %d\n", __LINE__,
-// mwindow->session->vcanvas_highlighted, get_cursor_over_window(), cursor_x, cursor_y);
-
- if(old_status != mwindow->session->vcanvas_highlighted)
- canvas->draw_refresh();
+ int need_highlight = cursor_above() && get_cursor_over_window() ? 1 : 0;
+ if( highlighted == need_highlight ) return;
+ highlighted = need_highlight;
+ canvas->draw_refresh();
}
int VWindowGUI::drag_stop()
{
if(get_hidden()) return 0;
- if(mwindow->session->vcanvas_highlighted &&
+ if(highlighted &&
mwindow->session->current_operation == DRAG_ASSET)
{
- mwindow->session->vcanvas_highlighted = 0;
+ highlighted = 0;
canvas->draw_refresh();
Indexable *indexable = mwindow->session->drag_assets->size() ?
void VWindowCanvas::draw_overlays()
{
- if(mwindow->session->vcanvas_highlighted)
+ if( gui->highlighted )
{
get_canvas()->set_color(WHITE);
get_canvas()->set_inverse();
VWindowInPoint *in_point;
VWindowOutPoint *out_point;
char loaded_title[BCTEXTLEN];
+ int highlighted;
private:
void get_scrollbars(int &canvas_x, int &canvas_y, int &canvas_w, int &canvas_h);
};
{
w = get_text_width(MEDIUMFONT, item->text) + LISTBOX_MARGIN * 2;
h = row_height;
+ int ih = get_icon_h(item);
+ if( h < ih ) h = ih;
}
return 0;
}
gui->set_color(row_color);
gui->draw_box(x, y, column_width, h);
gui->set_color(BLACK);
- int yy = y, xx = x + column_width-1;
- gui->draw_line(x, yy, xx, yy);
- yy = y + row_height;
+ int xx = x + column_width-1;
+ gui->draw_line(x, y, xx, y);
+ int hh = row_height;
+ if( display_format == LISTBOX_ICON_LIST ) {
+ int ih = get_icon_h(item);
+ if( ih > hh ) hh = ih;
+ }
+ int yy = y + hh-1;
gui->draw_line(x, yy, xx, yy);
}
static inline void Aal_to_alpF(float *S, float F, float *row, int w, int bpp){
if(S){
- while(w--){
- float a = *S*F;
- row[3] = a;
- row+=bpp;
- }
+ while(w--){ row[3] = *S++ * F; row+=bpp; }
}else{
float a = F;
while(w--){ row[3] = a; row+=bpp; }