/*
* CINELERRA
* Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
*/
#include "bcdisplay.h"
tx = nx; ty = ny;
}
-
-void BC_DisplayInfo::test_window(int &x_out,
- int &y_out,
- int &x_out2,
- int &y_out2,
- int x_in,
+
+void BC_DisplayInfo::test_window(int &x_out,
+ int &y_out,
+ int &x_out2,
+ int &y_out2,
+ int x_in,
int y_in)
{
#ifdef SINGLE_THREAD
attr.event_mask = StructureNotifyMask;
attr.win_gravity = SouthEastGravity;
attr.background_pixel = BlackPixel(display,screen);
- Window win = XCreateWindow(display, rootwin,
- x_in, y_in, TEST_SIZE, TEST_SIZE,
- 0, default_depth, InputOutput,
+ Window win = XCreateWindow(display, rootwin,
+ x_in, y_in, TEST_SIZE, TEST_SIZE,
+ 0, default_depth, InputOutput,
vis, mask, &attr);
XSizeHints size_hints;
XGetNormalHints(display, win, &size_hints);
size_hints.y = y_in;
size_hints.width = TEST_SIZE;
size_hints.height = TEST_SIZE;
- XSetStandardProperties(display, win,
+ XSetStandardProperties(display, win,
"x", "x", None, 0, 0, &size_hints);
XClearWindow(display, win);
- XMapWindow(display, win);
+ XMapWindow(display, win);
XFlush(display); XSync(display, 0); usleep(100000);
XEvent event;
if(top_border < 0)
{
BC_DisplayInfo display_info;
- display_info.test_window(left_border, top_border,
+ display_info.test_window(left_border, top_border,
auto_reposition_x, auto_reposition_y, 100, 100);
right_border = left_border;
bottom_border = left_border;
-//printf("BC_DisplayInfo::init_borders border=%d %d auto=%d %d\n",
+//printf("BC_DisplayInfo::init_borders border=%d %d auto=%d %d\n",
// left_border, top_border, auto_reposition_x, auto_reposition_y);
}
}
#ifdef SINGLE_THREAD
display = BC_Display::get_display(display_name);
#else
-
+
// This function must be the first Xlib
// function a multi-threaded program calls
XInitThreads();
#ifdef SINGLE_THREAD
BC_Display::lock_display("BC_DisplayInfo::get_abs_cursor_x");
#endif
- XQueryPointer(display,
- rootwin,
- &temp_win,
+ XQueryPointer(display,
+ rootwin,
&temp_win,
- &abs_x,
- &abs_y,
- &win_x,
- &win_y,
+ &temp_win,
+ &abs_x,
+ &abs_y,
+ &win_x,
+ &win_y,
&temp_mask);
#ifdef SINGLE_THREAD
BC_Display::unlock_display();
#ifdef SINGLE_THREAD
BC_Display::lock_display("BC_DisplayInfo::get_abs_cursor_y");
#endif
- XQueryPointer(display,
- rootwin,
- &temp_win,
+ XQueryPointer(display,
+ rootwin,
+ &temp_win,
&temp_win,
- &abs_x,
- &abs_y,
- &win_x,
- &win_y,
+ &abs_x,
+ &abs_y,
+ &win_x,
+ &win_y,
&temp_mask);
#ifdef SINGLE_THREAD
BC_Display::unlock_display();