Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes
aqua_gui_rep Class Reference

#include <aqua_gui.h>

Collaboration diagram for aqua_gui_rep:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 aqua_gui_rep (int &argc, char **argv)
virtual ~aqua_gui_rep ()
void get_extents (SI &width, SI &height)
void get_max_size (SI &width, SI &height)
void event_loop ()
virtual bool get_selection (string key, tree &t, string &s)
virtual bool set_selection (string key, tree t, string s)
virtual void clear_selection (string key)
void image_gc (string name="*")
void set_mouse_pointer (string name)
void set_mouse_pointer (string curs_name, string mask_name)
void show_wait_indicator (widget w, string message, string arg)
bool check_event (int type)
void update ()
void update_fast ()

Public Attributes

bool interrupted
time_t interrupt_time
char * selection
hashmap< string, treeselection_t
hashmap< string, stringselection_s

Detailed Description

Definition at line 29 of file aqua_gui.h.


Constructor & Destructor Documentation

aqua_gui_rep::aqua_gui_rep ( int &  argc,
char **  argv 
)

Definition at line 39 of file aqua_gui.mm.

                                                : 
  interrupted(false), selection(NULL)
{
  (void) argc; (void) argv;
//  argc               = argc2;
//  argv               = argv2;
  interrupted        = false;
  interrupt_time     = texmacs_time ();
  
  set_output_language (get_locale_language ());
  // out_lan= get_locale_language ();
//  (void) default_font ();
}

Here is the call graph for this function:

Definition at line 350 of file aqua_gui.mm.

{ 
} 

Member Function Documentation

bool aqua_gui_rep::check_event ( int  type)

Definition at line 199 of file aqua_gui.mm.

                                   {
  return false;
}

Here is the caller graph for this function:

void aqua_gui_rep::clear_selection ( string  key) [virtual]

Definition at line 126 of file aqua_gui.mm.

                                         {
  selection_t->reset (key);
  selection_s->reset (key);
  if ((key == "primary") && (selection != NULL)) {
    tm_delete_array (selection);
       // FIXME: should we do something with the pasteboard?
    selection= NULL;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 302 of file aqua_gui.mm.

{
//     TMInterposer* i = [[TMInterposer alloc ] init];
       //[[NSApp mainMenu] addItem:[[[FScriptMenuItem alloc] init] autorelease]];
//     update();
       [[[TMHelper alloc] init] autorelease];
       [NSApp run];
//     [i release];
}
#else
{
//     [[NSApp mainMenu] addItem:[[[FScriptMenuItem alloc] init] autorelease]];
       [NSApp finishLaunching];
       {
       NSEvent *event = nil;
    time_credit= 1000000;

  while (1) {
    timeout_time= texmacs_time () + time_credit;

    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
                     NSDate *dateSlow = [NSDate dateWithTimeIntervalSinceNow:0.5];
              event= //[NSDate distantFuture] [NSApp nextEventMatchingMask:NSAnyEventMask untilDate: dateSlow 
                                                                                                                 inMode:NSDefaultRunLoopMode dequeue:YES];              
              while (event)
              {
                     [NSApp sendEvent:event];
              //     update();
                     //NSDate *dateFast = [NSDate dateWithTimeIntervalSinceNow:0.001];
                     event= // dateFast [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] 
                                                                                                                        inMode:NSDefaultRunLoopMode dequeue:YES];
              }
              interrupted = false;
    if (!event)  {
       update();
      time_credit= min (1000000, 2 * time_credit);
      aqua_update_flag= false;
    }
    [pool release];
  }  
       }
}

Here is the caller graph for this function:

void aqua_gui_rep::get_extents ( SI width,
SI height 
)

Definition at line 56 of file aqua_gui.mm.

                                                {
  NSRect bounds = [[NSScreen mainScreen] visibleFrame];
  
  width = ((SI) bounds.size.width)  * PIXEL;
  height= ((SI) bounds.size.height) * PIXEL;
}

Here is the caller graph for this function:

void aqua_gui_rep::get_max_size ( SI width,
SI height 
)

Definition at line 64 of file aqua_gui.mm.

                                                 {
  width = 8000 * PIXEL;
  height= 6000 * PIXEL;
}

Here is the caller graph for this function:

bool aqua_gui_rep::get_selection ( string  key,
tree t,
string s 
) [virtual]

Definition at line 74 of file aqua_gui.mm.

                                                           {
  t= "none";
  s= "";
  if (selection_t->contains (key)) {
    t= copy (selection_t [key]);
    s= copy (selection_s [key]);
    return true;
  }
  if (key != "primary") return false;
  
       NSPasteboard *pb = [NSPasteboard generalPasteboard];
       NSArray *types = [NSArray arrayWithObject:NSStringPboardType];
       NSString *bestType = [pb availableTypeFromArray:types];

       if (bestType != nil) {
              NSString* data = [pb stringForType:bestType];
              if (data) {
              char *buf = (char*)[data UTF8String];
                     unsigned size = strlen(buf);
              s << string(buf, size);
              }
       }


  t= tuple ("extern", s);
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void aqua_gui_rep::image_gc ( string  name = "*")

Definition at line 141 of file aqua_gui.mm.

{ (void) name; }

Definition at line 143 of file aqua_gui.mm.

{ (void) name; }
void aqua_gui_rep::set_mouse_pointer ( string  curs_name,
string  mask_name 
)

Definition at line 145 of file aqua_gui.mm.

{ (void) curs_name; (void) mask_name; } ;
bool aqua_gui_rep::set_selection ( string  key,
tree  t,
string  s 
) [virtual]

Definition at line 103 of file aqua_gui.mm.

                                                         {
  selection_t (key)= copy (t);
  selection_s (key)= copy (s);
  if (key == "primary") {
    //if (is_nil (windows_l)) return false;
    //Window win= windows_l->item;
    if (selection!=NULL) tm_delete_array (selection);
    //XSetSelectionOwner (dpy, XA_PRIMARY, win, CurrentTime);
    //if (XGetSelectionOwner(dpy, XA_PRIMARY)==None) return false;
    selection= as_charp (s);
       
       NSPasteboard *pb = [NSPasteboard generalPasteboard];
       NSArray *types = [NSArray arrayWithObjects:
              NSStringPboardType, nil];
       [pb declareTypes:types owner:nil];
       [pb setString:[NSString stringWithCString:selection] forType:NSStringPboardType];
       
       
  }
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void aqua_gui_rep::show_wait_indicator ( widget  w,
string  message,
string  arg 
)

Definition at line 205 of file aqua_gui.mm.

                                                                       {
}

Here is the caller graph for this function:

Definition at line 219 of file aqua_gui.mm.

{
//  NSLog(@"UPDATE----------------------------");
  ::update();
}

Member Data Documentation

Definition at line 32 of file aqua_gui.h.

Definition at line 31 of file aqua_gui.h.

Definition at line 34 of file aqua_gui.h.

Definition at line 36 of file aqua_gui.h.

Definition at line 35 of file aqua_gui.h.


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