/*
* 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 "bcclipboard.h"
if(display_name && display_name[0] == 0) display_name = NULL;
if((display = XOpenDisplay(display_name)) == NULL)
{
- printf("BC_Display::BC_Display: cannot connect to X server %s\n",
+ printf("BC_Display::BC_Display: cannot connect to X server %s\n",
display_name);
if(getenv("DISPLAY") == NULL)
{
// Start event handling
event_thread = new BC_WindowEvents(this);
- event_thread->start();
+ event_thread->start();
event_lock = new Mutex("BC_Display::event_lock", 1);
void BC_Display::dump_windows()
{
- for(int i = 0; i < windows.size(); i++)
- {
- printf("BC_Display::dump_windows %d window=%p window->win=%p\n",
- i,
- windows.get(i),
- windows.get(i)->win);
+ for(int i = 0; i < windows.size(); i++) {
+ printf("BC_Display::dump_windows %d window=%p window->win=0x%08jx\n",
+ i, windows.get(i), windows.get(i)->win);
}
}
//printf("BC_Display::new_window %d\n", __LINE__);
if(!clipboard)
{
- clipboard = new BC_Clipboard("");
+ clipboard = new BC_Clipboard(window);
clipboard->start_clipboard();
}
for(int i = 0; i < windows.size(); i++)
{
BC_WindowBase *window = windows.get(i);
-if(debug) printf("BC_Display::loop %d %d %d %d\n",
-__LINE__,
-window->resize_events,
-window->motion_events,
+if(debug) printf("BC_Display::loop %d %d %d %d\n",
+__LINE__,
+window->resize_events,
+window->motion_events,
window->translation_events);
if(window->resize_events)
- window->dispatch_resize_event(window->last_resize_w,
+ window->dispatch_resize_event(window->last_resize_w,
window->last_resize_h);
if(window->motion_events)
window->dispatch_motion_event();
{
const int debug = 0;
XEvent *event = get_event();
-if(debug) printf("BC_Display::handle_event %d type=%d\n",
-__LINE__,
+if(debug) printf("BC_Display::handle_event %d type=%d\n",
+__LINE__,
event->type);
lock_display("BC_Display::handle_event");
if(debug) printf("BC_Display::handle_event %d\n", __LINE__);
unlock_display();
if(debug) printf("BC_Display::handle_event %d\n", __LINE__);
-
+
delete event;
if(debug) printf("BC_Display::handle_event %d\n", __LINE__);
}
}
}
-int BC_Display::unset_all_repeaters(BC_WindowBase *window)
+void BC_Display::unset_all_repeaters(BC_WindowBase *window)
{
for(int i = 0; i < repeaters.total; i++)
{
void BC_Display::lock_display(const char *location)
{
pthread_mutex_lock(&BC_Display::display_lock);
- int result = ++BC_Display::display_global->window_locked;
+ ++BC_Display::display_global->window_locked;
pthread_mutex_unlock(&BC_Display::display_lock);
//printf("BC_Display::lock_display %d %s result=%d\n", __LINE__, location, result);
void BC_Display::unlock_display()
{
pthread_mutex_lock(&BC_Display::display_lock);
- int result = --BC_Display::display_global->window_locked;
+ --BC_Display::display_global->window_locked;
// if(BC_Display::display_global->window_locked < 0)
// BC_Display::display_global->window_locked = 0;
pthread_mutex_unlock(&BC_Display::display_lock);
//printf("BC_Display::unlock_display %d result=%d\n", __LINE__, result);
- /* if(result == 1) */ XUnlockDisplay(BC_Display::display_global->display);
+ XUnlockDisplay(BC_Display::display_global->display);
}