Back to index

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

#include <aqua_widget.h>

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

List of all members.

Public Member Functions

 aqua_view_widget_rep (NSView *v)
 ~aqua_view_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 widget plain_window_widget (string s)
virtual widget make_popup_widget ()
virtual widget popup_window_widget (string s)
virtual TMMenuItemas_menuitem ()
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

NSViewview
int ref_count

Protected Attributes

list< widget_connectionin
list< widget_connectionout

Friends

class widget

Detailed Description

Definition at line 44 of file aqua_widget.h.


Constructor & Destructor Documentation

Definition at line 79 of file aqua_widget.mm.

                                                    : 
  aqua_widget_rep(), view(v) { 
  [v retain]; 
}

Definition at line 84 of file aqua_widget.mm.

                                             { 
  [view release]; 
}

Member Function Documentation

TMMenuItem * aqua_widget_rep::as_menuitem ( ) [virtual, inherited]

Reimplemented in simple_widget_rep, aqua_menu_rep, aqua_balloon_widget_rep, aqua_image_widget_rep, and aqua_text_widget_rep.

Definition at line 69 of file aqua_widget.mm.

                             { 
  return [TMMenuItem alloc];  
}
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);
}
widget aqua_widget_rep::make_popup_widget ( ) [virtual, inherited]

Reimplemented in aqua_menu_rep, and aqua_menu_rep.

Definition at line 56 of file aqua_widget.mm.

                                    {
  return this;
}
void aqua_view_widget_rep::notify ( slot  s,
blackbox  new_val 
) [virtual]

Reimplemented from widget_rep.

Reimplemented in simple_widget_rep, and simple_widget_rep.

Definition at line 173 of file aqua_widget.mm.

                                                      {
  aqua_widget_rep::notify (s, new_val);
}

Reimplemented from aqua_widget_rep.

Definition at line 203 of file aqua_widget.mm.

{
  NSRect screen_frame = [[NSScreen mainScreen] visibleFrame];
       
  NSWindow *nsw = [[[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,100,100) 
                                 styleMask:NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask
                                 backing:NSBackingStoreBuffered
                                 defer:NO] autorelease];
  // NSView *view = ((aqua_view_widget_rep*)w.rep)->get_nsview();
  //   NSRect frame = [[nsw contentView] frame];
  //   [view setFrame:frame];
  [nsw setContentView:view];
  [nsw setTitle:to_nsstring(s)];
  [nsw setAcceptsMouseMovedEvents:YES];
  //   [[nsw contentView] addSubview:view];
  //   [nsw setToolbar:((aqua_tm_widget_rep*)w.rep)->toolbar];
  widget wid =  tm_new <aqua_window_widget_rep> (nsw);
  return wid; 
}
widget aqua_widget_rep::popup_window_widget ( string  s) [virtual, inherited]

Reimplemented in aqua_menu_rep, and aqua_menu_rep.

Definition at line 61 of file aqua_widget.mm.

                                              {
  (void) s;
  return widget();
}

Here is the caller 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";
}
blackbox aqua_view_widget_rep::query ( slot  s,
int  type_id 
) [virtual]

Reimplemented from widget_rep.

Reimplemented in simple_widget_rep, and simple_widget_rep.

Definition at line 146 of file aqua_widget.mm.

                                                {
  switch (s) {
  case SLOT_IDENTIFIER:
    TYPE_CHECK (type_id == type_helper<int>::id);
    return close_box<int> ([view window] ? 1 : 0);
  case SLOT_RENDERER:
    TYPE_CHECK (type_id == type_helper<renderer>::id);
    return close_box<renderer> ((renderer) the_aqua_renderer());
  case SLOT_POSITION:  
    {
      typedef pair<SI,SI> coord2;
      TYPE_CHECK (type_id == type_helper<coord2>::id);
      NSPoint pos = [view frame].origin;
      return close_box<coord2> (from_nspoint(pos));
    }
    
  default:
    FAILED ("cannot handle slot type");
    return blackbox ();
  }
}

Here is the call graph for this function:

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

Reimplemented from widget_rep.

Reimplemented in simple_widget_rep, and simple_widget_rep.

Definition at line 182 of file aqua_widget.mm.

                                                  {
  switch (s) {
  case SLOT_WINDOW:
    check_type_void (index, "SLOT_WINDOW");
    return [(TMWindowController*)[[view window] windowController] widget];
  default:
    FAILED ("cannot handle slot type");
    return widget();
  }
}

Here is the call graph for this function:

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

Reimplemented from widget_rep.

Reimplemented in simple_widget_rep, and simple_widget_rep.

Definition at line 91 of file aqua_widget.mm.

                                                {
  switch (s) {
  case SLOT_NAME:
    {  
      check_type<string> (val, "SLOT_NAME");
      string name = open_box<string> (val);
      NSWindow *win = [view window];
      if (win) {
       [win setTitle:to_nsstring(name)];
      }
    }
    break;
  case SLOT_INVALIDATE:
    {
      TYPE_CHECK (type_box (val) == type_helper<coord4>::id);
      coord4 p= open_box<coord4> (val);
      NSRect rect = to_nsrect(p);
      if (DEBUG_EVENTS) NSLog(@"invalidating %@",NSStringFromRect(rect));
      [view setNeedsDisplayInRect:rect];
    }
    break;
  case SLOT_INVALIDATE_ALL:
    {
      ASSERT (is_nil (val), "type mismatch");
      [view setNeedsDisplay:YES];
    }
    break;
  case SLOT_MOUSE_GRAB:
    NOT_IMPLEMENTED;
    //               send_mouse_grab (THIS, val);
    break;
  case SLOT_MOUSE_POINTER:
    NOT_IMPLEMENTED;
    //               send_mouse_pointer (THIS, val);
    break;
    
  case SLOT_KEYBOARD_FOCUS:
    //               send_keyboard_focus (THIS, val);
    {
      TYPE_CHECK (type_box (val) == type_helper<bool>::id);
      if (open_box<bool>(val)) the_keyboard_focus = this;
    }
    break;
       
  default:
    cout << "slot type= " << slot_name (s) << "\n";
    FAILED ("cannot handle slot type");
  }
}

Here is the call graph for this function:

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

Reimplemented from widget_rep.

Reimplemented in simple_widget_rep, and simple_widget_rep.

Definition at line 194 of file aqua_widget.mm.

                                                             {
  switch (s) {
  default:
    FAILED ("cannot handle slot type");
  }
}

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.

int abstract_struct::ref_count [inherited]

Definition at line 142 of file basic.hpp.

Definition at line 46 of file aqua_widget.h.


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