Back to index

texmacs  1.0.7.15
Defines | Typedefs | Functions | Variables
gui.hpp File Reference
#include "tree.hpp"
#include "bitmap_font.hpp"
#include "timer.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define INTERRUPT_EVENT   0
#define INTERRUPTED_EVENT   1
#define ANY_EVENT   2
#define DRAG_EVENT   3
#define MOTION_EVENT   4
#define MENU_EVENT   5

Typedefs

typedef unsigned int color

Functions

void gui_open (int &argc, char **argv)
void gui_interpose (void(*)(void))
void gui_start_loop ()
void gui_close ()
void gui_root_extents (SI &width, SI &height)
void gui_maximal_extents (SI &width, SI &height)
void gui_refresh ()
color rgb_color (int r, int g, int b, int a=255)
void get_rgb_color (color col, int &r, int &g, int &b, int &a)
color named_color (string s, int a=255)
string get_named_color (color c)
void set_default_font (string name)
font get_default_font (bool tt=false, bool mini=false, bool bold=false)
font get_default_styled_font (int style)
void load_system_font (string family, int size, int dpi, font_metric &fnm, font_glyphs &fng)
bool set_selection (string cb, tree t, string s, string format)
bool get_selection (string cb, tree &t, string &s, string format)
void clear_selection (string cb)
void beep ()
void needs_update ()
bool check_event (int type)
void image_gc (string name="*")
void show_help_balloon (widget balloon, SI x, SI y)
void show_wait_indicator (widget base, string message, string argument)
void external_event (string type, time_t t)

Variables

color black
color white
color red
color green
color blue
color yellow
color magenta
color orange
color brown
color pink
color light_grey
color grey
color dark_grey

Define Documentation

#define ANY_EVENT   2

Definition at line 105 of file gui.hpp.

#define DRAG_EVENT   3

Definition at line 106 of file gui.hpp.

#define INTERRUPT_EVENT   0

Definition at line 103 of file gui.hpp.

#define INTERRUPTED_EVENT   1

Definition at line 104 of file gui.hpp.

#define MENU_EVENT   5

Definition at line 108 of file gui.hpp.

#define MOTION_EVENT   4

Definition at line 107 of file gui.hpp.


Typedef Documentation

typedef unsigned int color

Definition at line 26 of file gui.hpp.


Function Documentation

void beep ( )

Definition at line 486 of file aqua_gui.mm.

        {
  // Issue a beep
  NSBeep();
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool check_event ( int  type)

Definition at line 496 of file aqua_gui.mm.

{ return the_gui->check_event(type); }

Here is the call graph for this function:

Here is the caller graph for this function:

void clear_selection ( string  cb)

Definition at line 475 of file aqua_gui.mm.

                             {
  the_gui->clear_selection (key);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void external_event ( string  type,
time_t  t 
)

Definition at line 524 of file aqua_gui.mm.

                                       {
  // External events, such as pushing a button of a remote infrared commander
#if 0
  QTMWidget *tm_focus = qobject_cast<QTMWidget*>(qApp->focusWidget());
  if (tm_focus) {
    simple_widget_rep *wid = tm_focus->tm_widget();
    if (wid) the_gui -> process_keypress (wid, type, t);
  }
#endif
}

Here is the call graph for this function:

font get_default_font ( bool  tt = false,
bool  mini = false,
bool  bold = false 
)

Definition at line 432 of file aqua_gui.mm.

                                                 {
  (void) tt; (void) mini;
  // 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";
  return NULL;
  //return tex_font (this, "ecrm", 10, 300, 0);
}

Here is the caller graph for this function:

font get_default_styled_font ( int  style)

Definition at line 212 of file widget.cpp.

                                    {
  bool tt  = (style & WIDGET_STYLE_MONOSPACED) != 0;
  bool mini= (style & WIDGET_STYLE_MINI) != 0;
  bool bold= (style & WIDGET_STYLE_BOLD) != 0;
  return get_default_font (tt, mini, bold);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 219 of file x_init.cpp.

                          {
  int r, g, b, a;
  get_rgb_color (c, r, g, b, a);
  return "#" *
    as_hexadecimal (r, 2) *
    as_hexadecimal (g, 2) *
    as_hexadecimal (b, 2);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void get_rgb_color ( color  col,
int &  r,
int &  g,
int &  b,
int &  a 
)

Definition at line 132 of file x_init.cpp.

                                                          {
  if (true_color) {
    a= (col >> 24) & 255;
    r= (col >> 16) & 255;
    g= (col >> 8 ) & 255;
    b=  col        & 255;
    if (reverse_colors) reverse (r, g, b);
  }
  else {
    a= (col >> 24) & 255;
    col= col & 0xffffff;
    if (col <= ((color) GREYS)) {
      r= (col*255)/GREYS;
      g= (col*255)/GREYS;
      b= (col*255)/GREYS;
    }
    else {
      int rr, gg, bb;
      col-= (GREYS+1);
      bb  = col % CFACTOR;
      gg  = (col/CFACTOR) % CFACTOR;
      rr  = (col/(CFACTOR*CFACTOR)) % CFACTOR;
      r   = (rr*255)/CSCALES;
      g   = (gg*255)/CSCALES;
      b   = (bb*255)/CSCALES;
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool get_selection ( string  cb,
tree t,
string s,
string  format 
)

Definition at line 468 of file aqua_gui.mm.

                                                              { 
  (void) format;
  return the_gui->get_selection (key, t, s);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void gui_close ( )

Definition at line 392 of file aqua_gui.mm.

{
  ASSERT (the_gui != NULL, "gui not yet open");
  [pool release];
  tm_delete (the_gui);
  the_gui=NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void gui_interpose ( void(*)(void)  )

Definition at line 211 of file aqua_gui.mm.

Here is the caller graph for this function:

void gui_maximal_extents ( SI width,
SI height 
)

Definition at line 407 of file aqua_gui.mm.

                                            {
  // get the maximal size of a window (can be larger than the screen size)
  the_gui->get_max_size (width, height);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void gui_open ( int &  argc,
char **  argv 
)

Definition at line 370 of file aqua_gui.mm.

{
  if (!NSApp) {
    // initialize app
    [NSApplication sharedApplication];
    [NSBundle loadNibNamed:@"MainMenu" owner:NSApp];
  }
  if (!pool) {
    // create autorelease pool 
    pool = [[NSAutoreleasePool alloc] init];
  } else [pool retain];
  
  the_gui = tm_new <aqua_gui_rep> (argc2, argv2);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void gui_refresh ( )

Definition at line 412 of file aqua_gui.mm.

{
  // update and redraw all windows (e.g. on change of output language)
  // FIXME: add suitable code
}

Here is the call graph for this function:

Here is the caller graph for this function:

void gui_root_extents ( SI width,
SI height 
)

Definition at line 401 of file aqua_gui.mm.

                                         {   
       // get the screen size
  the_gui->get_extents (width, height);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void gui_start_loop ( )

Definition at line 386 of file aqua_gui.mm.

{
  the_gui->event_loop ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void image_gc ( string  name = "*")

Definition at line 501 of file aqua_gui.mm.

                            {
  // Garbage collect images of a given name (may use wildcards)
  // This routine only needs to be implemented if you use your own image cache
  the_aqua_renderer()->image_gc(name); 
}

Here is the call graph for this function:

void load_system_font ( string  family,
int  size,
int  dpi,
font_metric fnm,
font_glyphs &  fng 
)

Definition at line 446 of file aqua_gui.mm.

{
       (void) family; (void) size; (void) dpi; (void) fnm; (void) fng;
       if (DEBUG_EVENTS) cout << "load_system_font(): SHOULD NOT BE CALLED\n";
}

Here is the caller graph for this function:

color named_color ( string  s,
int  a = 255 
)

Definition at line 213 of file x_init.cpp.

                              {
  color c= named_color_bis (s);
  return (a << 24) + (c & 0xffffff);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void needs_update ( )

Definition at line 492 of file aqua_gui.mm.

                {
  aqua_update_flag= true;
}

Here is the caller graph for this function:

color rgb_color ( int  r,
int  g,
int  b,
int  a = 255 
)

Definition at line 116 of file x_init.cpp.

                                       {
  if (true_color) {
    if (reverse_colors) reverse (r, g, b);
    return (a << 24) + (r << 16) + (g << 8) + b;
  }
  else if ((r==g) && (g==b))
    return (a << 24) + ((r*GREYS+ 128)/255);
  else {
    r= (r*CSCALES+ 128)/255;
    g= (g*CSCALES+ 128)/255;
    b= (b*CSCALES+ 128)/255;
    return (a << 24) + r*CFACTOR*CFACTOR + g*CFACTOR + b + GREYS + 1;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void set_default_font ( string  name)

Definition at line 425 of file aqua_gui.mm.

                               {
       (void) name;
  // set the name of the default font
  // this is ignored since Qt handles fonts for the widgets
}

Here is the caller graph for this function:

bool set_selection ( string  cb,
tree  t,
string  s,
string  format 
)

Definition at line 460 of file aqua_gui.mm.

                                                            {
  (void) format;
  return the_gui->set_selection (key, t, s);
}

Here is the call graph for this function:

void show_help_balloon ( widget  balloon,
SI  x,
SI  y 
)

Definition at line 508 of file aqua_gui.mm.

                                               { 
  // Display a help balloon at position (x, y); the help balloon should
  // disappear as soon as the user presses a key or moves the mouse
  (void) balloon; (void) x; (void) y;
}

Here is the caller graph for this function:

void show_wait_indicator ( widget  base,
string  message,
string  argument 
)

Definition at line 515 of file aqua_gui.mm.

                                                                   {
  // Display a wait indicator with a message and an optional argument
  // The indicator might for instance be displayed at the center of
  // the base widget which triggered the lengthy operation;
  // the indicator should be removed if the message is empty
  the_gui->show_wait_indicator(base,message,argument); 
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 32 of file x_init.cpp.

Definition at line 32 of file x_init.cpp.

Definition at line 33 of file x_init.cpp.

Definition at line 34 of file x_init.cpp.

Definition at line 32 of file x_init.cpp.

Definition at line 34 of file x_init.cpp.

Definition at line 34 of file x_init.cpp.

Definition at line 33 of file x_init.cpp.

Definition at line 33 of file x_init.cpp.

Definition at line 33 of file x_init.cpp.

Definition at line 32 of file x_init.cpp.

Definition at line 32 of file x_init.cpp.

Definition at line 33 of file x_init.cpp.