sams ladspa icons, fix icon drag image, awdw layout, main prints build ts
[goodguy/history.git] / cinelerra-5.1 / guicast / bcwindowbase.C
index 6599369e1b2276e71eac074dcbeb3154e938631c..d8c60421006f0b87eecc6521ab8b2fd703d3895d 100644 (file)
@@ -177,6 +177,7 @@ BC_WindowBase::~BC_WindowBase()
                         &BC_WindowBase::mediumfont,
                         &BC_WindowBase::largefont,
                         &BC_WindowBase::bigfont,
+                        &BC_WindowBase::clockfont,
                };
                for( int i=sizeof(xfont)/sizeof(xfont[0]); --i>=0; )
                        XFreeFont(display, this->*xfont[i]);
@@ -193,6 +194,7 @@ BC_WindowBase::~BC_WindowBase()
                         &BC_WindowBase::bold_smallfont_xft,
                         &BC_WindowBase::bold_mediumfont_xft,
                         &BC_WindowBase::bold_largefont_xft,
+                        &BC_WindowBase::clockfont_xft,
                };
                for( int i=sizeof(xft_font)/sizeof(xft_font[0]); --i>=0; ) {
                        XftFont *xft = (XftFont *)(this->*xft_font[i]);
@@ -385,22 +387,10 @@ int BC_WindowBase::initialize()
                        FocusChangeMask
 
 
-int BC_WindowBase::create_window(BC_WindowBase *parent_window,
-                               const char *title,
-                               int x,
-                               int y,
-                               int w,
-                               int h,
-                               int minw,
-                               int minh,
-                               int allow_resize,
-                               int private_color,
-                               int hide,
-                               int bg_color,
-                               const char *display_name,
-                               int window_type,
-                               BC_Pixmap *bg_pixmap,
-                               int group_it)
+int BC_WindowBase::create_window(BC_WindowBase *parent_window, const char *title,
+               int x, int y, int w, int h, int minw, int minh, int allow_resize,
+               int private_color, int hide, int bg_color, const char *display_name,
+               int window_type, BC_Pixmap *bg_pixmap, int group_it)
 {
        XSetWindowAttributes attr;
        unsigned long mask;
@@ -1043,6 +1033,10 @@ locking_message = event->xclient.message_type;
                break;
 
        case ButtonPress:
+               if(motion_events)
+               {
+                       dispatch_motion_event();
+               }
                get_key_masks(event->xbutton.state);
                cursor_x = event->xbutton.x;
                cursor_y = event->xbutton.y;
@@ -1087,6 +1081,10 @@ locking_message = event->xclient.message_type;
                break;
 
        case ButtonRelease:
+               if(motion_events)
+               {
+                       dispatch_motion_event();
+               }
                get_key_masks(event->xbutton.state);
                button_number = event->xbutton.button;
                event_win = event->xany.window;
@@ -1824,7 +1822,7 @@ int BC_WindowBase::show_tooltip(const char *text, int x, int y, int w, int h)
        if( wy >= (y1-=h) ) wy = y1;
 // avoid tip under cursor (flickers)
        int abs_x, abs_y;
-       get_abs_cursor_xy(abs_x,abs_y, 0);
+       get_abs_cursor(abs_x,abs_y, 0);
        if( wx < abs_x && abs_x < wx+w && wy < abs_y && abs_y < wy+h ) {
                if( wx-abs_x < wy-abs_y )
                        wx = abs_x+1;
@@ -3752,13 +3750,13 @@ int BC_WindowBase::dispatch_selection_clear()
 }
 
 
-void BC_WindowBase::get_relative_cursor_xy(int &x, int &y, int lock_window)
+void BC_WindowBase::get_relative_cursor(int &x, int &y, int lock_window)
 {
        int abs_x, abs_y, win_x, win_y;
        unsigned int temp_mask;
        Window temp_win;
 
-       if(lock_window) this->lock_window("BC_WindowBase::get_relative_cursor_xy");
+       if(lock_window) this->lock_window("BC_WindowBase::get_relative_cursor");
        XQueryPointer(top_level->display, top_level->win,
           &temp_win, &temp_win, &abs_x, &abs_y, &win_x, &win_y,
           &temp_mask);
@@ -3770,23 +3768,23 @@ void BC_WindowBase::get_relative_cursor_xy(int &x, int &y, int lock_window)
 int BC_WindowBase::get_relative_cursor_x(int lock_window)
 {
        int x, y;
-       get_relative_cursor_xy(x, y, lock_window);
+       get_relative_cursor(x, y, lock_window);
        return x;
 }
 int BC_WindowBase::get_relative_cursor_y(int lock_window)
 {
        int x, y;
-       get_relative_cursor_xy(x, y, lock_window);
+       get_relative_cursor(x, y, lock_window);
        return y;
 }
 
-void BC_WindowBase::get_abs_cursor_xy(int &abs_x, int &abs_y, int lock_window)
+void BC_WindowBase::get_abs_cursor(int &abs_x, int &abs_y, int lock_window)
 {
        int win_x, win_y;
        unsigned int temp_mask;
        Window temp_win;
 
-       if(lock_window) this->lock_window("BC_WindowBase::get_abs_cursor_xy");
+       if(lock_window) this->lock_window("BC_WindowBase::get_abs_cursor");
        XQueryPointer(top_level->display, top_level->win,
                &temp_win, &temp_win, &abs_x, &abs_y, &win_x, &win_y,
                &temp_mask);
@@ -3795,20 +3793,20 @@ void BC_WindowBase::get_abs_cursor_xy(int &abs_x, int &abs_y, int lock_window)
 int BC_WindowBase::get_abs_cursor_x(int lock_window)
 {
        int abs_x, abs_y;
-       get_abs_cursor_xy(abs_x, abs_y, lock_window);
+       get_abs_cursor(abs_x, abs_y, lock_window);
        return abs_x;
 }
 int BC_WindowBase::get_abs_cursor_y(int lock_window)
 {
        int abs_x, abs_y;
-       get_abs_cursor_xy(abs_x, abs_y, lock_window);
+       get_abs_cursor(abs_x, abs_y, lock_window);
        return abs_y;
 }
 
-void BC_WindowBase::get_pop_cursor_xy(int &px, int &py, int lock_window)
+void BC_WindowBase::get_pop_cursor(int &px, int &py, int lock_window)
 {
        int margin = 100;
-       get_abs_cursor_xy(px, py, lock_window);
+       get_abs_cursor(px, py, lock_window);
        if( px < margin ) px = margin;
        if( py < margin ) py = margin;
        int wd = get_screen_w(lock_window,-1) - margin;
@@ -3819,13 +3817,13 @@ void BC_WindowBase::get_pop_cursor_xy(int &px, int &py, int lock_window)
 int BC_WindowBase::get_pop_cursor_x(int lock_window)
 {
        int px, py;
-       get_pop_cursor_xy(px, py, lock_window);
+       get_pop_cursor(px, py, lock_window);
        return px;
 }
 int BC_WindowBase::get_pop_cursor_y(int lock_window)
 {
        int px, py;
-       get_pop_cursor_xy(px, py, lock_window);
+       get_pop_cursor(px, py, lock_window);
        return py;
 }
 
@@ -3863,7 +3861,7 @@ int BC_WindowBase::get_cursor_over_window()
 int BC_WindowBase::cursor_above()
 {
        int rx, ry;
-       get_relative_cursor_xy(rx, ry);
+       get_relative_cursor(rx, ry);
        return rx < 0 || rx >= get_w() ||
                ry < 0 || ry >= get_h() ? 0 : 1;
 }