From 07139488aeee09e7c0d15b92b13fb8dd7eaba4b7 Mon Sep 17 00:00:00 2001 From: mgubi Date: Thu, 26 Nov 2009 12:29:45 +0000 Subject: [PATCH] added DEBUG_QT flag git-svn-id: svn://svn.savannah.gnu.org/texmacs/trunk@2832 64cb5145-927a-446d-8aed-2fb7b4773692 --- src/src/Kernel/Abstractions/basic.hpp | 3 +- src/src/Plugins/Qt/QTMWidget.cpp | 28 +++++++------- src/src/Plugins/Qt/QTMWindow.cpp | 4 +- src/src/Plugins/Qt/qt_dialogues.cpp | 38 +++++++++---------- src/src/Plugins/Qt/qt_gui.cpp | 10 ++--- src/src/Plugins/Qt/qt_menu.cpp | 6 +-- src/src/Plugins/Qt/qt_widget.cpp | 70 +++++++++++++++++------------------ src/src/Texmacs/Texmacs/texmacs.cpp | 2 + 8 files changed, 82 insertions(+), 79 deletions(-) diff --git a/src/src/Kernel/Abstractions/basic.hpp b/src/src/Kernel/Abstractions/basic.hpp index f5508897..d99b996a 100644 --- a/src/src/Kernel/Abstractions/basic.hpp +++ b/src/src/Kernel/Abstractions/basic.hpp @@ -54,7 +54,7 @@ typedef void* pointer; enum { DEBUG_FLAG_AUTO, DEBUG_FLAG_VERBOSE, DEBUG_FLAG_EVENTS, DEBUG_FLAG_STD, DEBUG_FLAG_IO, DEBUG_FLAG_BENCH, - DEBUG_FLAG_HISTORY }; + DEBUG_FLAG_HISTORY, DEBUG_FLAG_QT }; bool debug (int which, bool write_flag= false); int debug_off (); void debug_on (int status); @@ -65,6 +65,7 @@ void debug_on (int status); #define DEBUG_IO (debug (DEBUG_FLAG_IO)) #define DEBUG_BENCH (debug (DEBUG_FLAG_BENCH)) #define DEBUG_HISTORY (debug (DEBUG_FLAG_HISTORY)) +#define DEBUG_QT (debug (DEBUG_FLAG_QT)) #ifdef DEBUG_ASSERT #include diff --git a/src/src/Plugins/Qt/QTMWidget.cpp b/src/src/Plugins/Qt/QTMWidget.cpp index d2509509..ce956bea 100644 --- a/src/src/Plugins/Qt/QTMWidget.cpp +++ b/src/src/Plugins/Qt/QTMWidget.cpp @@ -156,7 +156,7 @@ QTMWidget::postponedUpdate () { // It is a confirmed Qt/Mac bug (#251792). See // http://www.qtsoftware.com/developer/task-tracker/index_html?method=entry&id=251792 //FIXME: This is a workaround for the update(rect) bug. Mac specific. - if (DEBUG_EVENTS) { + if (DEBUG_QT) { cout << "postponedUpdate (ALL)\n"; } update(); @@ -164,7 +164,7 @@ QTMWidget::postponedUpdate () { #else while (!is_nil (delayed_rects)) { QRect rect = delayed_rects->item; - if (DEBUG_EVENTS) { + if (DEBUG_QT) { cout << "postponedUpdate (" << rect.x() << "," << rect.y() << "," << rect.width() @@ -192,7 +192,7 @@ QTMWidget::paintEvent (QPaintEvent* event) { QRect rect = event->rect (); bool partial_redraw = false; - if (DEBUG_EVENTS) { + if (DEBUG_QT) { QPainter p(this); QBrush brush (QColor ("red")); p.fillRect (rect, brush); @@ -245,7 +245,7 @@ QTMWidget::paintEvent (QPaintEvent* event) { (rect.x()+rect.width())*PIXEL, -rect.y()*PIXEL); if (r->interrupted()) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "Interrupted\n"; qt_update_flag= true; partial_redraw = true; @@ -270,7 +270,7 @@ QTMWidget::paintEvent (QPaintEvent* event) { if (partial_redraw) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "Postponed redrawing\n"; delayed_rects= list (rect, delayed_rects); QTimer::singleShot (1, this, SLOT (postponedUpdate ())); @@ -284,13 +284,13 @@ QTMWidget::keyPressEvent (QKeyEvent* event) { timeout_time= texmacs_time () + time_credit; static bool fInit = false; if (!fInit) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "Initializing keymap\n"; initkeymap(); fInit= true; } - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "keypressed\n"; simple_widget_rep *wid = tm_widget(); if (!wid) return; @@ -299,7 +299,7 @@ QTMWidget::keyPressEvent (QKeyEvent* event) { int key = event->key(); Qt::KeyboardModifiers mods = event->modifiers(); - if (DEBUG_EVENTS) { + if (DEBUG_QT) { cout << "key : " << key << LF; cout << "text : " << event->text().toAscii().data() << LF; cout << "count: " << event->text().count() << LF; @@ -373,7 +373,7 @@ QTMWidget::keyPressEvent (QKeyEvent* event) { if (mods & Qt::MetaModifier) r= "Mod4-" * r; // The "Windows" key #endif - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "key press: " << r << LF; //int start= texmacs_time (); wid -> handle_keypress (r, texmacs_time()); @@ -429,7 +429,7 @@ QTMWidget::mousePressEvent (QMouseEvent* event) { unsigned int mstate= mouse_state (event, false); string s= "press-" * mouse_decode (mstate); wid -> handle_mouse (s, point.x (), point.y (), mstate, texmacs_time ()); - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "mouse event: " << s << " at " << point.x () << ", " << point.y () << LF; } @@ -443,7 +443,7 @@ QTMWidget::mouseReleaseEvent (QMouseEvent* event) { unsigned int mstate= mouse_state (event, true); string s= "release-" * mouse_decode (mstate); wid -> handle_mouse (s, point.x (), point.y (), mstate, texmacs_time ()); - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "mouse event: " << s << " at " << point.x () << ", " << point.y () << LF; } @@ -457,7 +457,7 @@ QTMWidget::mouseMoveEvent (QMouseEvent* event) { unsigned int mstate= mouse_state (event, false); string s= "move"; wid -> handle_mouse (s, point.x (), point.y (), mstate, texmacs_time ()); - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "mouse event: " << s << " at " << point.x () << ", " << point.y () << LF; } @@ -477,7 +477,7 @@ QTMWidget::event (QEvent* event) { void QTMWidget::focusInEvent ( QFocusEvent * event ) { - if (DEBUG_EVENTS) cout << "FOCUSIN" << LF; + if (DEBUG_QT) cout << "FOCUSIN" << LF; simple_widget_rep *wid = tm_widget (); if (wid) { wid -> handle_keyboard_focus (true, texmacs_time ()); @@ -488,7 +488,7 @@ QTMWidget::focusInEvent ( QFocusEvent * event ) void QTMWidget::focusOutEvent ( QFocusEvent * event ) { - if (DEBUG_EVENTS) cout << "FOCUSOUT" << LF; + if (DEBUG_QT) cout << "FOCUSOUT" << LF; simple_widget_rep *wid = tm_widget (); if (wid) { wid -> handle_keyboard_focus (false, texmacs_time ()); diff --git a/src/src/Plugins/Qt/QTMWindow.cpp b/src/src/Plugins/Qt/QTMWindow.cpp index b829cf36..25a0d4c3 100644 --- a/src/src/Plugins/Qt/QTMWindow.cpp +++ b/src/src/Plugins/Qt/QTMWindow.cpp @@ -20,7 +20,7 @@ void QTMWindow::closeEvent ( QCloseEvent *event ) { - if (DEBUG_EVENTS) cout << "CLOSE WINDOW" << LF; + if (DEBUG_QT) cout << "CLOSE WINDOW" << LF; qt_tm_widget_rep *wid = tm_widget (); if (wid) { wid -> quit (); @@ -32,7 +32,7 @@ void QTMWindow::closeEvent ( QCloseEvent *event ) void QTMScrollArea::resizeEvent( QResizeEvent* event ) { - if (DEBUG_EVENTS) cout << "RESIZE SCROLLAREA" << LF; + if (DEBUG_QT) cout << "RESIZE SCROLLAREA" << LF; //FIXME: the following is an hack needed to trigger widget resize at the // texmacs level when the scrollarea is resized. needed because the // texmacs canvas minimal geometry in papyrus mode depends on the diff --git a/src/src/Plugins/Qt/qt_dialogues.cpp b/src/src/Plugins/Qt/qt_dialogues.cpp index 79f2f1d3..85263f6b 100755 --- a/src/src/Plugins/Qt/qt_dialogues.cpp +++ b/src/src/Plugins/Qt/qt_dialogues.cpp @@ -25,7 +25,7 @@ extern char *slot_name(slot s); // in qt_widget.cpp #define TYPE_CHECK(b) ASSERT (b, "type mismatch") #define NOT_IMPLEMENTED \ - { if (DEBUG_EVENTS) cout << "STILL NOT IMPLEMENTED\n"; } + { if (DEBUG_QT) cout << "STILL NOT IMPLEMENTED\n"; } #pragma mark qt_chooser_widget_rep @@ -62,7 +62,7 @@ qt_chooser_widget_rep::qt_chooser_widget_rep mgn (_mgn), position (coord2 (0, 0)), size (coord2 (100, 100)), file ("") { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_chooser_widget_rep::qt_chooser_widget_rep type=\"" << type << "\" mgn=\"" << mgn << "\"" << LF; } @@ -71,7 +71,7 @@ qt_chooser_widget_rep::~qt_chooser_widget_rep() {} void qt_chooser_widget_rep::send (slot s, blackbox val) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_chooser_widget_rep::send " << slot_name(s) << LF; switch (s) { case SLOT_VISIBILITY: @@ -97,7 +97,7 @@ qt_chooser_widget_rep::send (slot s, blackbox val) { case SLOT_STRING_INPUT: // send_string (THIS, "input", val); TYPE_CHECK (type_box (val) == type_helper::id); - if (DEBUG_EVENTS) cout << "string input: " << open_box (val) << LF; + if (DEBUG_QT) cout << "string input: " << open_box (val) << LF; NOT_IMPLEMENTED break; case SLOT_INPUT_TYPE: @@ -113,7 +113,7 @@ qt_chooser_widget_rep::send (slot s, blackbox val) { case SLOT_FILE: //send_string (THIS, "file", val); TYPE_CHECK (type_box (val) == type_helper::id); - if (DEBUG_EVENTS) cout << "file: " << open_box (val) << LF; + if (DEBUG_QT) cout << "file: " << open_box (val) << LF; file = open_box (val); break; case SLOT_DIRECTORY: @@ -129,7 +129,7 @@ qt_chooser_widget_rep::send (slot s, blackbox val) { blackbox qt_chooser_widget_rep::query (slot s, int type_id) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_chooser_widget_rep::query " << slot_name(s) << LF; switch (s) { case SLOT_POSITION: @@ -147,7 +147,7 @@ qt_chooser_widget_rep::query (slot s, int type_id) { case SLOT_STRING_INPUT: { TYPE_CHECK (type_id == type_helper::id); - if (DEBUG_EVENTS) cout << "String: " << file << LF; + if (DEBUG_QT) cout << "String: " << file << LF; return close_box (file); } default: @@ -157,7 +157,7 @@ qt_chooser_widget_rep::query (slot s, int type_id) { void qt_chooser_widget_rep::notify (slot s, blackbox new_val) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "[qt_chooser_widget_rep ]"; switch (s) { default: ; @@ -167,7 +167,7 @@ qt_chooser_widget_rep::notify (slot s, blackbox new_val) { widget qt_chooser_widget_rep::read (slot s, blackbox index) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_chooser_widget_rep::read " << slot_name(s) << LF; switch (s) { case SLOT_WINDOW: @@ -189,7 +189,7 @@ qt_chooser_widget_rep::read (slot s, blackbox index) { void qt_chooser_widget_rep::write (slot s, blackbox index, widget w) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "[qt_chooser_widget] "; switch (s) { default: @@ -221,7 +221,7 @@ qt_chooser_widget_rep::perform_dialog () { QPoint pos = to_qpoint(position); //cout << "Size :" << size.x1 << "," << size.x2 << LF; - if (DEBUG_EVENTS) { + if (DEBUG_QT) { cout << "Position :" << pos.x() << "," << pos.y() << LF; cout << "Dir: " << directory * "/" * file << LF; } @@ -308,7 +308,7 @@ public: void qt_field_widget_rep::send (slot s, blackbox val) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_field_widget_rep::send " << slot_name(s) << LF; switch (s) { case SLOT_STRING_INPUT: @@ -335,7 +335,7 @@ qt_field_widget_rep::send (slot s, blackbox val) { blackbox qt_field_widget_rep::query (slot s, int type_id) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_field_widget_rep::query " << slot_name(s) << LF; switch (s) { case SLOT_STRING_INPUT: @@ -370,7 +370,7 @@ qt_input_widget_rep::~qt_input_widget_rep() {} void qt_input_widget_rep::send (slot s, blackbox val) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_input_widget_rep::send " << slot_name(s) << LF; switch (s) { @@ -402,7 +402,7 @@ qt_input_widget_rep::send (slot s, blackbox val) { blackbox qt_input_widget_rep::query (slot s, int type_id) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_input_widget_rep::query " << slot_name(s) << LF; switch (s) { case SLOT_POSITION: @@ -426,7 +426,7 @@ qt_input_widget_rep::query (slot s, int type_id) { void qt_input_widget_rep::notify (slot s, blackbox new_val) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "[qt_input_widget_rep] "; switch (s) { default: ; @@ -436,7 +436,7 @@ qt_input_widget_rep::notify (slot s, blackbox new_val) { widget qt_input_widget_rep::read (slot s, blackbox index) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_input_widget_rep::read " << slot_name(s) << LF; switch (s) { case SLOT_WINDOW: @@ -452,7 +452,7 @@ qt_input_widget_rep::read (slot s, blackbox index) { void qt_input_widget_rep::write (slot s, blackbox index, widget w) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "[qt_input_widget_rep] "; switch (s) { default: @@ -541,7 +541,7 @@ widget inputs_list_widget (command call_back, array prompts) { // a dialogue widget with Ok and Cancel buttons and a series of textual // input widgets with specified prompts - if (DEBUG_EVENTS) cout << "inputs_list_widget\n"; + if (DEBUG_QT) cout << "inputs_list_widget\n"; return tm_new (call_back, prompts); } diff --git a/src/src/Plugins/Qt/qt_gui.cpp b/src/src/Plugins/Qt/qt_gui.cpp index 635ddd41..79becea4 100755 --- a/src/src/Plugins/Qt/qt_gui.cpp +++ b/src/src/Plugins/Qt/qt_gui.cpp @@ -464,14 +464,14 @@ void gui_root_extents (SI& width, SI& height) { // get the screen size the_gui->get_extents (width, height); - if (DEBUG_EVENTS) cout << "gui_root_extents (" << width << "," << height << ")" << LF; + if (DEBUG_QT) cout << "gui_root_extents (" << width << "," << height << ")" << LF; } void gui_maximal_extents (SI& width, SI& height) { // get the maximal size of a window (can be larger than the screen size) the_gui->get_max_size (width, height); - if (DEBUG_EVENTS) cout << "gui_maximal_extents (" << width << "," << height << ")" << LF; + if (DEBUG_QT) cout << "gui_maximal_extents (" << width << "," << height << ")" << LF; } void @@ -541,7 +541,7 @@ get_default_font (bool tt) { // get the default font or monospaced font (if tt is true) // return a null font since this function is not called in the Qt port. - if (DEBUG_EVENTS) cout << "get_default_font(): SHOULD NOT BE CALLED\n"; + if (DEBUG_QT) cout << "get_default_font(): SHOULD NOT BE CALLED\n"; return NULL; //return tex_font (this, "ecrm", 10, 300, 0); } @@ -554,7 +554,7 @@ load_system_font (string family, int size, int dpi, font_metric& fnm, font_glyphs& fng) { (void) family; (void) size; (void) dpi; (void) fnm; (void) fng; - if (DEBUG_EVENTS) cout << "load_system_font(): SHOULD NOT BE CALLED\n"; + if (DEBUG_QT) cout << "load_system_font(): SHOULD NOT BE CALLED\n"; } /****************************************************************************** @@ -631,7 +631,7 @@ show_wait_indicator (widget base, string message, string argument) { font x_font (string family, int size, int dpi) { (void) family; (void) size; (void) dpi; - if (DEBUG_EVENTS) cout << "x_font(): SHOULD NOT BE CALLED\n"; + if (DEBUG_QT) cout << "x_font(): SHOULD NOT BE CALLED\n"; return NULL; } diff --git a/src/src/Plugins/Qt/qt_menu.cpp b/src/src/Plugins/Qt/qt_menu.cpp index 5478c12c..01d816c7 100755 --- a/src/src/Plugins/Qt/qt_menu.cpp +++ b/src/src/Plugins/Qt/qt_menu.cpp @@ -108,7 +108,7 @@ qt_menu_rep::popup_window_widget (string s) { void qt_menu_rep::send (slot s, blackbox val) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_menu_rep::send " << slot_name(s) << LF; switch (s) { case SLOT_POSITION: @@ -243,7 +243,7 @@ public: QWidget* QTMTileAction::createWidget(QWidget* parent) { - if (DEBUG_EVENTS) cout << "QTMTileAction::createWidget\n"; + if (DEBUG_QT) cout << "QTMTileAction::createWidget\n"; QWidget* wid= new QWidget (parent); QGridLayout* l= new QGridLayout (wid); wid->setLayout (l); @@ -361,7 +361,7 @@ menu_button (widget w, command cmd, string pre, string ks, bool ok) { if (N(ks) > 0) { string qtks = conv (ks); QKeySequence qks (to_qstring (qtks)); - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "ks: " << ks << " " << qks.toString().toAscii().data() << "\n"; a->setShortcut (qks); } diff --git a/src/src/Plugins/Qt/qt_widget.cpp b/src/src/Plugins/Qt/qt_widget.cpp index f31b6818..42c9b518 100755 --- a/src/src/Plugins/Qt/qt_widget.cpp +++ b/src/src/Plugins/Qt/qt_widget.cpp @@ -40,7 +40,7 @@ #define TYPE_CHECK(b) ASSERT (b, "type mismatch") #define NOT_IMPLEMENTED \ - { if (DEBUG_EVENTS) cout << "STILL NOT IMPLEMENTED\n"; } + { if (DEBUG_QT) cout << "STILL NOT IMPLEMENTED\n"; } extern int nr_windows; // the run-loop should exit when the number of windows is zero @@ -144,13 +144,13 @@ qt_view_widget_rep::~qt_view_widget_rep() { // - Qt spectify that widgets with a parent are deleted by the parent. // - Out policy is that qt_view_widget_rep owns the QWidget (so it is responsible to delete it) // are these two requirements compatible ? - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_view_widget_rep::~qt_view_widget_rep()\n"; } void qt_view_widget_rep::send (slot s, blackbox val) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_view_widget_rep::send " << slot_name (s) << LF; switch (s) { case SLOT_NAME: @@ -168,7 +168,7 @@ qt_view_widget_rep::send (slot s, blackbox val) { TYPE_CHECK (type_box (val) == type_helper::id); coord4 p= open_box (val); QRect rect = to_qrect(p); - if (DEBUG_EVENTS) cout << "Invalidating rect " << rect << LF; + if (DEBUG_QT) cout << "Invalidating rect " << rect << LF; view->update (rect); } break; @@ -191,7 +191,7 @@ qt_view_widget_rep::send (slot s, blackbox val) { //send_keyboard_focus (THIS, val); TYPE_CHECK (type_box (val) == type_helper::id); if (open_box (val)) the_keyboard_focus = this; - if (DEBUG_EVENTS) cout << "Ignored!\n"; + if (DEBUG_QT) cout << "Ignored!\n"; break; default: @@ -205,7 +205,7 @@ qt_view_widget_rep::send (slot s, blackbox val) { blackbox qt_view_widget_rep::query (slot s, int type_id) { - if ((DEBUG_EVENTS) && (s != SLOT_RENDERER)) + if ((DEBUG_QT) && (s != SLOT_RENDERER)) cout << "qt_view_widget_rep::query " << slot_name(s) << LF; switch (s) { @@ -219,7 +219,7 @@ qt_view_widget_rep::query (slot s, int type_id) { typedef pair coord2; TYPE_CHECK (type_id == type_helper::id); QPoint pt= view->pos(); - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "Position (" << pt.x() << "," << pt.y() << ")\n"; return close_box (from_qpoint (pt)); } @@ -241,7 +241,7 @@ qt_view_widget_rep::query (slot s, int type_id) { TYPE_CHECK (type_id == type_helper::id); QRect rect = view->visibleRegion().boundingRect(); coord4 c = from_qrect (rect); - if (DEBUG_EVENTS) cout << "visibleRegion " << rect << LF; + if (DEBUG_QT) cout << "visibleRegion " << rect << LF; return close_box (c); } #endif @@ -260,7 +260,7 @@ qt_view_widget_rep::query (slot s, int type_id) { void qt_view_widget_rep::notify (slot s, blackbox new_val) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_view_widget_rep::notify " << slot_name(s) << LF; qt_widget_rep::notify (s, new_val); } @@ -271,7 +271,7 @@ qt_view_widget_rep::notify (slot s, blackbox new_val) { widget qt_view_widget_rep::read (slot s, blackbox index) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_view_widget_rep::read " << slot_name(s) << LF; switch (s) { @@ -294,7 +294,7 @@ qt_view_widget_rep::read (slot s, blackbox index) { void qt_view_widget_rep::write (slot s, blackbox index, widget w) { (void) index; (void) w; - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_view_widget_rep::write " << slot_name (s) << LF; switch (s) { default: @@ -368,7 +368,7 @@ qt_tm_widget_rep::qt_tm_widget_rep(int mask, command _quit): } qt_tm_widget_rep::~qt_tm_widget_rep () { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_tm_widget_rep::~qt_tm_widget_rep\n"; } @@ -386,7 +386,7 @@ void qt_tm_widget_rep::updateVisibility() void qt_tm_widget_rep::send (slot s, blackbox val) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_tm_widget_rep::send " << slot_name (s) << LF; switch (s) { @@ -470,7 +470,7 @@ qt_tm_widget_rep::send (slot s, blackbox val) { // convert from main widget to canvas coordinates // QPoint pt2= tm_mainwindow()->mapToGlobal (pt); // pt= tm_scrollarea()->widget()->mapFromGlobal (pt2); - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "Position (" << pt.x() << "," << pt.y() << ")\n "; #if 0 cout << "scrollarea (" @@ -516,7 +516,7 @@ qt_tm_widget_rep::send (slot s, blackbox val) { TYPE_CHECK (type_box (val) == type_helper::id); if (QTMWidget* tmw= qobject_cast (tm_canvas())) { int new_sf = open_box (val); - if (DEBUG_EVENTS) cout << "New shrinking factor :" << new_sf << LF; + if (DEBUG_QT) cout << "New shrinking factor :" << new_sf << LF; tmw->tm_widget()->handle_set_shrinking_factor (new_sf); } break; @@ -533,7 +533,7 @@ QTMInteractiveInputHelper::doit () { blackbox qt_tm_widget_rep::query (slot s, int type_id) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_tm_widget_rep::query " << slot_name (s) << LF; switch (s) { @@ -541,7 +541,7 @@ qt_tm_widget_rep::query (slot s, int type_id) { { TYPE_CHECK (type_id == type_helper::id); QPoint pt= tm_canvas()->pos(); - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "Position (" << pt.x() << "," << pt.y() << ")\n"; return close_box (from_qpoint (pt)); } @@ -551,7 +551,7 @@ qt_tm_widget_rep::query (slot s, int type_id) { TYPE_CHECK (type_id == type_helper::id); QRect rect= tm_canvas()->geometry(); coord4 c= from_qrect (rect); - if (DEBUG_EVENTS) cout << "Canvas geometry " << rect << LF; + if (DEBUG_QT) cout << "Canvas geometry " << rect << LF; return close_box (c); } @@ -560,7 +560,7 @@ qt_tm_widget_rep::query (slot s, int type_id) { TYPE_CHECK (type_id == type_helper::id); QRect rect= tm_canvas()->visibleRegion().boundingRect(); coord4 c= from_qrect (rect); - if (DEBUG_EVENTS) cout << "Visible Region " << rect << LF; + if (DEBUG_QT) cout << "Visible Region " << rect << LF; return close_box (c); } @@ -601,7 +601,7 @@ qt_tm_widget_rep::query (slot s, int type_id) { widget qt_tm_widget_rep::read (slot s, blackbox index) { - if (DEBUG_EVENTS) cout << "[qt_tm_widget_rep] "; + if (DEBUG_QT) cout << "[qt_tm_widget_rep] "; return qt_view_widget_rep::read (s, index); } @@ -634,7 +634,7 @@ replaceButtons(QToolBar* dest, QWidget* src) { void qt_tm_widget_rep::write (slot s, blackbox index, widget w) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_tm_widget_rep::write " << slot_name (s) << LF; switch (s) { @@ -729,7 +729,7 @@ qt_window_widget_rep::~qt_window_widget_rep () void qt_window_widget_rep::send (slot s, blackbox val) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_window_widget_rep::send " << slot_name (s) << LF; switch (s) { @@ -752,7 +752,7 @@ qt_window_widget_rep::send (slot s, blackbox val) { QPoint pt = to_qpoint (p); pt.ry() += 40; // to avoid window under menu bar on MAC when moving at (0,0) - if (DEBUG_EVENTS) cout << "Moving to (" << pt.x() << "," << pt.y() << ")" << LF; + if (DEBUG_QT) cout << "Moving to (" << pt.x() << "," << pt.y() << ")" << LF; wid->move (pt); } } @@ -803,7 +803,7 @@ qt_window_widget_rep::send (slot s, blackbox val) { blackbox qt_window_widget_rep::query (slot s, int type_id) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_window_widget_rep::query " << slot_name(s) << LF; switch (s) { case SLOT_IDENTIFIER: @@ -816,7 +816,7 @@ qt_window_widget_rep::query (slot s, int type_id) { typedef pair coord2; TYPE_CHECK (type_id == type_helper::id); QPoint pt= wid->pos(); - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "Position (" << pt.x() << "," << pt.y() << ")\n"; return close_box (from_qpoint (pt)); } @@ -839,7 +839,7 @@ qt_window_widget_rep::query (slot s, int type_id) { void qt_window_widget_rep::notify (slot s, blackbox new_val) { - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_window_widget_rep::notify " << slot_name(s) << LF; widget_rep::notify (s, new_val); } @@ -847,7 +847,7 @@ qt_window_widget_rep::notify (slot s, blackbox new_val) { widget qt_window_widget_rep::read (slot s, blackbox index) { (void) index; - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_window_widget_rep::read " << slot_name(s) << LF; switch (s) { default: @@ -859,7 +859,7 @@ qt_window_widget_rep::read (slot s, blackbox index) { void qt_window_widget_rep::write (slot s, blackbox index, widget w) { (void) w; (void) index; - if (DEBUG_EVENTS) + if (DEBUG_QT) cout << "qt_window_widget_rep::write " << slot_name(s) << LF; switch (s) { @@ -925,15 +925,15 @@ simple_widget_rep::handle_repaint (SI x1, SI y1, SI x2, SI y2) { void simple_widget_rep::send (slot s, blackbox val) { - // if (DEBUG_EVENTS) cout << "qt_simple_widget_rep::send " << slot_name(s) << LF; - if (DEBUG_EVENTS) cout << "[qt_simple_widget_rep] "; + // if (DEBUG_QT) cout << "qt_simple_widget_rep::send " << slot_name(s) << LF; + if (DEBUG_QT) cout << "[qt_simple_widget_rep] "; switch (s) { case SLOT_INVALIDATE: { TYPE_CHECK (type_box (val) == type_helper::id); coord4 p= open_box (val); QRect rect = to_qrect(p); - if (DEBUG_EVENTS) cout << "Invalidating rect " << rect << LF; + if (DEBUG_QT) cout << "Invalidating rect " << rect << LF; view->update (rect); } break; @@ -951,7 +951,7 @@ simple_widget_rep::send (slot s, blackbox val) { blackbox simple_widget_rep::query (slot s, int type_id) { - if ((DEBUG_EVENTS) && (s != SLOT_RENDERER)) + if ((DEBUG_QT) && (s != SLOT_RENDERER)) cout << "[qt_simple_widget_rep] "; switch (s) { case SLOT_RENDERER: @@ -971,7 +971,7 @@ simple_widget_rep::query (slot s, int type_id) { void simple_widget_rep::notify (slot s, blackbox new_val) { - if (DEBUG_EVENTS) cout << "[qt_simple_widget_rep] "; + if (DEBUG_QT) cout << "[qt_simple_widget_rep] "; qt_view_widget_rep::notify (s, new_val); } @@ -981,13 +981,13 @@ simple_widget_rep::notify (slot s, blackbox new_val) { widget simple_widget_rep::read (slot s, blackbox index) { - if (DEBUG_EVENTS) cout << "[qt_simple_widget_rep] "; + if (DEBUG_QT) cout << "[qt_simple_widget_rep] "; return qt_view_widget_rep::read (s, index); } void simple_widget_rep::write (slot s, blackbox index, widget w) { - if (DEBUG_EVENTS) cout << "[qt_simple_widget_rep] "; + if (DEBUG_QT) cout << "[qt_simple_widget_rep] "; qt_view_widget_rep::write (s, index, w); } diff --git a/src/src/Texmacs/Texmacs/texmacs.cpp b/src/src/Texmacs/Texmacs/texmacs.cpp index 607bd1a9..b6160c89 100644 --- a/src/src/Texmacs/Texmacs/texmacs.cpp +++ b/src/src/Texmacs/Texmacs/texmacs.cpp @@ -129,12 +129,14 @@ TeXmacs_main (int argc, char** argv) { else if (s == "-debug-io") debug (DEBUG_FLAG_IO, true); else if (s == "-debug-bench") debug (DEBUG_FLAG_BENCH, true); else if (s == "-debug-history") debug (DEBUG_FLAG_HISTORY, true); + else if (s == "-debug-qt") debug (DEBUG_FLAG_QT, true); else if (s == "-debug-all") { debug (DEBUG_FLAG_EVENTS, true); debug (DEBUG_FLAG_STD, true); debug (DEBUG_FLAG_IO, true); debug (DEBUG_FLAG_HISTORY, true); debug (DEBUG_FLAG_BENCH, true); + debug (DEBUG_FLAG_QT, true); } else if ((s == "-fn") || (s == "-font")) { i++; -- 2.11.4.GIT