&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]);
&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]);
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;
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;
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;
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;
}
-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);
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);
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;
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;
}
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;
}