Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes | Protected Attributes | Friends
qt_window_widget_rep Class Reference

Wrapper for QTMWindow, TeXmacs' QMainWindow. More...

#include <qt_other_widgets.hpp>

Inheritance diagram for qt_window_widget_rep:
Inheritance graph
[legend]
Collaboration diagram for qt_window_widget_rep:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 qt_window_widget_rep (QWidget *_wid)
 ~qt_window_widget_rep ()
virtual void send (slot s, blackbox val)
virtual blackbox query (slot s, int type_id)
virtual widget read (slot s, blackbox index)
virtual void write (slot s, blackbox index, widget w)
virtual void notify (slot s, blackbox new_val)
 qt_window_widget_rep (QWidget *_wid, command q)
 ~qt_window_widget_rep ()
virtual void send (slot s, blackbox val)
virtual blackbox query (slot s, int type_id)
virtual widget read (slot s, blackbox index)
virtual void write (slot s, blackbox index, widget w)
virtual void notify (slot s, blackbox new_val)
virtual tm_ostreamprint (tm_ostream &out)
virtual void connect (slot s, widget w2, slot s2)
virtual void deconnect (slot s, widget w2, slot s2)

Public Attributes

QWidget * wid
command quit
int ref_count

Protected Attributes

list< widget_connectionin
list< widget_connectionout

Friends

class widget

Detailed Description

Wrapper for QTMWindow, TeXmacs' QMainWindow.

Definition at line 81 of file qt_other_widgets.hpp.


Constructor & Destructor Documentation

Definition at line 31 of file qt_window_widget.cpp.

{
  nr_windows--;
}

Definition at line 22 of file qt_window_widget.cpp.

                                                                   :
widget_rep(), wid(_wid), quit(q)
{
  wid->setProperty ("texmacs_window_widget",
                    QVariant::fromValue ((void*) this));
  (void) q;
  nr_windows++;
}

Member Function Documentation

void widget_rep::connect ( slot  s,
widget  w2,
slot  s2 
) [virtual, inherited]

Definition at line 150 of file widget.cpp.

                                               {
  widget_connection con (this, s, w2.rep, s2);
  insert (out, con);
  insert (w2->in, con);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void widget_rep::deconnect ( slot  s,
widget  w2,
slot  s2 
) [virtual, inherited]

Definition at line 157 of file widget.cpp.

                                                 {
  widget_connection con (this, s, w2.rep, s2);
  remove (out, con);
  remove (w2->in, con);
}
virtual void qt_window_widget_rep::notify ( slot  s,
blackbox  new_val 
) [virtual]

Reimplemented from widget_rep.

void qt_window_widget_rep::notify ( slot  s,
blackbox  new_val 
) [virtual]

Reimplemented from widget_rep.

Definition at line 156 of file qt_window_widget.cpp.

                                                      {
  if (DEBUG_QT)
    cout << "qt_window_widget_rep::notify " << slot_name(s) << LF;
  widget_rep::notify (s, new_val);
}

Here is the call graph for this function:

tm_ostream & widget_rep::print ( tm_ostream out) [virtual, inherited]

Reimplemented in wk_widget_rep.

Definition at line 207 of file widget.cpp.

                                  {
  return out << "widget";
}
virtual blackbox qt_window_widget_rep::query ( slot  s,
int  type_id 
) [virtual]

Reimplemented from widget_rep.

blackbox qt_window_widget_rep::query ( slot  s,
int  type_id 
) [virtual]

Reimplemented from widget_rep.

Definition at line 120 of file qt_window_widget.cpp.

                                                {
  if (DEBUG_QT)
    cout << "qt_window_widget_rep::query " << slot_name(s) << LF;
  switch (s) {
    case SLOT_IDENTIFIER:
      TYPE_CHECK (type_id == type_helper<int>::id);
        // we need only to know if the widget is attached to some gui window
      return close_box<int> (wid? 1: 0);
        // return close_box<int> ((int)wid);
    case SLOT_POSITION:
    {
      typedef pair<SI,SI> coord2;
      TYPE_CHECK (type_id == type_helper<coord2>::id);
      QPoint pt= wid->pos();
      if (DEBUG_QT)
        cout << "Position (" << pt.x() << "," << pt.y() << ")\n";
      return close_box<coord2> (from_qpoint (pt));
    }
    case SLOT_SIZE:
    {
      typedef pair<SI,SI> coord2;
      TYPE_CHECK (type_id == type_helper<coord2>::id);
      QSize s= wid->size();
      return close_box<coord2> (from_qsize (s));
    }
    default:
      FAILED ("cannot handle slot type");
      return blackbox ();
  }
}

Here is the call graph for this function:

virtual widget qt_window_widget_rep::read ( slot  s,
blackbox  index 
) [virtual]

Reimplemented from widget_rep.

widget qt_window_widget_rep::read ( slot  s,
blackbox  index 
) [virtual]

Reimplemented from widget_rep.

Definition at line 163 of file qt_window_widget.cpp.

                                                  {
  (void) index;
  if (DEBUG_QT)
    cout << "qt_window_widget_rep::read " << slot_name(s) << LF;
  switch (s) {
    default:
      FAILED ("cannot handle slot type");
      return widget();
  }
}

Here is the call graph for this function:

virtual void qt_window_widget_rep::send ( slot  s,
blackbox  val 
) [virtual]

Reimplemented from widget_rep.

void qt_window_widget_rep::send ( slot  s,
blackbox  val 
) [virtual]

Reimplemented from widget_rep.

Definition at line 37 of file qt_window_widget.cpp.

                                                {
  if (DEBUG_QT)
    cout << "qt_window_widget_rep::send " << slot_name (s) << LF;
  
  switch (s) {
    case SLOT_SIZE:
    {
      TYPE_CHECK (type_box (val) == type_helper<coord2>::id);
      coord2 p= open_box<coord2> (val);
      if (wid) {
        QSize size= to_qsize (p);
        wid->resize (size);
      }
    }
      break;
      
    case SLOT_POSITION:
    {
      TYPE_CHECK (type_box (val) == type_helper<coord2>::id);
      coord2 p= open_box<coord2> (val);
      if (wid) {
        QPoint pt = to_qpoint (p);
        pt.ry() += 40;
          // to avoid window under menu bar on MAC when moving at (0,0)
        if (DEBUG_QT) 
          cout << "Moving to (" << pt.x() << "," 
          << pt.y() << ")" << LF;
        wid->move (pt);
      }
    }
      break;
      
    case SLOT_VISIBILITY:
    {
      check_type<bool> (val, "SLOT_VISIBILITY");
      bool flag = open_box<bool> (val);
      if (wid) {
        if (flag) {
          wid->show();
          // wid->activateWindow();
          //WEIRD: in Ubuntu uncommenting the above line causes the main window 
          //to be opened in the background.
          wid->raise();
        }
        else wid->hide();
      }
    }
      break;
      
    case SLOT_NAME:
    {   
      check_type<string> (val, "SLOT_NAME");
      string name = open_box<string> (val);
      if (wid) wid->setWindowTitle (to_qstring (tm_var_encode(name)));
    }
      break;
      
    case SLOT_FULL_SCREEN:
    {
      check_type<bool> (val, "SLOT_FULL_SCREEN");
      QTMWindow *win = qobject_cast<QTMWindow*>(wid);
      if (win && win->tm_widget()) {
        win->tm_widget()->set_full_screen(open_box<bool> (val));
      }
        //win->set_full_screen (open_box<bool> (val));
    }
      break;
      
    case SLOT_UPDATE:
      NOT_IMPLEMENTED ;
        //send_update (THIS, val);
      break;
    case SLOT_REFRESH:
        //NOT_IMPLEMENTED ;
        //send_refresh (THIS, val);
      break;
      
    default:
      FAILED ("cannot handle slot type");
  }
}

Here is the call graph for this function:

virtual void qt_window_widget_rep::write ( slot  s,
blackbox  index,
widget  w 
) [virtual]

Reimplemented from widget_rep.

void qt_window_widget_rep::write ( slot  s,
blackbox  index,
widget  w 
) [virtual]

Reimplemented from widget_rep.

Definition at line 175 of file qt_window_widget.cpp.

                                                             {
  (void) w; (void) index;
  if (DEBUG_QT)
    cout << "qt_window_widget_rep::write " << slot_name(s) << LF;
  
  switch (s) {
    default:
      FAILED ("cannot handle slot type");
  }
}

Here is the call graph for this function:


Friends And Related Function Documentation

friend class widget [friend, inherited]

Definition at line 59 of file widget.hpp.


Member Data Documentation

list<widget_connection> widget_rep::in [protected, inherited]

Definition at line 36 of file widget.hpp.

list<widget_connection> widget_rep::out [protected, inherited]

Definition at line 37 of file widget.hpp.

Definition at line 26 of file qt_window_widget.hpp.

int abstract_struct::ref_count [inherited]

Definition at line 142 of file basic.hpp.

Definition at line 84 of file qt_other_widgets.hpp.


The documentation for this class was generated from the following files: