Back to index

texmacs  1.0.7.15
Functions | Variables
basic.cpp File Reference
#include "string.hpp"
#include "scheme.hpp"
#include "Freetype/tt_file.hpp"
#include "dictionary.hpp"
#include "sys_utils.hpp"

Go to the source code of this file.

Functions

bool debug (int which, bool write_flag)
int debug_off ()
void debug_on (int status)
static void debug_set (int which, bool on)
void debug_set (string s, bool on)
static bool debug_get (int which)
bool debug_get (string s)
int new_type_identifier ()
tm_ostreamoperator<< (tm_ostream &out, display_control ctrl)
bool gui_is_x ()
bool gui_is_qt ()
bool os_win32 ()
bool os_mingw ()
bool os_macos ()
bool use_macos_fonts ()
static const char * default_look_and_feel_impl ()
const char * default_look_and_feel ()

Variables

static int debug_status = 0
static int current_indent = 0

Function Documentation

bool debug ( int  which,
bool  write_flag 
)

Definition at line 25 of file basic.cpp.

                                   {
  if (write_flag) {
    debug_status= debug_status | (1 << which);
    return 0;
  }
  else return (debug_status & (1 << which)) > 0;
}

Here is the caller graph for this function:

static bool debug_get ( int  which) [static]

Definition at line 68 of file basic.cpp.

                      {
  return (debug_status & (1 << which)) != 0;
}

Here is the caller graph for this function:

bool debug_get ( string  s)

Definition at line 73 of file basic.cpp.

                     {
  if (s == "auto") return debug_get (DEBUG_FLAG_AUTO);
  else if (s == "verbose") return debug_get (DEBUG_FLAG_VERBOSE);
  else if (s == "events") return debug_get (DEBUG_FLAG_EVENTS);
  else if (s == "std") return debug_get (DEBUG_FLAG_STD);
  else if (s == "io") return debug_get (DEBUG_FLAG_IO);
  else if (s == "bench") return debug_get (DEBUG_FLAG_BENCH);
  else if (s == "history") return debug_get (DEBUG_FLAG_HISTORY);
  else if (s == "qt") return debug_get (DEBUG_FLAG_QT);
  else if (s == "keyboard") return debug_get (DEBUG_FLAG_KEYBOARD);
  else if (s == "packrat") return debug_get (DEBUG_FLAG_PACKRAT);
  else if (s == "flatten") return debug_get (DEBUG_FLAG_FLATTEN);
  else if (s == "correct") return debug_get (DEBUG_FLAG_CORRECT);
  else return false;
}

Here is the call graph for this function:

int debug_off ( )

Definition at line 34 of file basic.cpp.

             {
  int status= debug_status;
  debug_status= 0;
  return status;
}
void debug_on ( int  status)

Definition at line 41 of file basic.cpp.

static void debug_set ( int  which,
bool  on 
) [static]

Definition at line 46 of file basic.cpp.

                               {
  if (on) debug_status= debug_status | (1 << which);
  else debug_status= debug_status & (~(1 << which));
}

Here is the caller graph for this function:

void debug_set ( string  s,
bool  on 
)

Definition at line 52 of file basic.cpp.

                              {
  if (s == "auto") debug_set (DEBUG_FLAG_AUTO, on);
  else if (s == "verbose") debug_set (DEBUG_FLAG_VERBOSE, on);
  else if (s == "events") debug_set (DEBUG_FLAG_EVENTS, on);
  else if (s == "std") debug_set (DEBUG_FLAG_STD, on);
  else if (s == "io") debug_set (DEBUG_FLAG_IO, on);
  else if (s == "bench") debug_set (DEBUG_FLAG_BENCH, on);
  else if (s == "history") debug_set (DEBUG_FLAG_HISTORY, on);
  else if (s == "qt") debug_set (DEBUG_FLAG_QT, on);
  else if (s == "keyboard") debug_set (DEBUG_FLAG_KEYBOARD, on);
  else if (s == "packrat") debug_set (DEBUG_FLAG_PACKRAT, on);
  else if (s == "flatten") debug_set (DEBUG_FLAG_FLATTEN, on);
  else if (s == "correct") debug_set (DEBUG_FLAG_CORRECT, on);
}

Here is the call graph for this function:

const char* default_look_and_feel ( )

Definition at line 200 of file basic.cpp.

                         {
  static const char* ret= default_look_and_feel_impl ();
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static const char* default_look_and_feel_impl ( ) [static]

Definition at line 188 of file basic.cpp.

                              {
  if (os_mingw () || os_win32 ()) return "windows";
  else if (os_macos ()) return "macos";
  else if (get_env ("KDE_FULL_SESSION") != "") return "kde";
  else if (get_env ("GNOME_DESKTOP_SESSION_ID") != "") return "gnome";
  else if (eval_system ("pidof ksmserver") != "") return "kde";
  else if (eval_system ("pidof gnome-session") != "") return "gnome";
  //else if (eval_system ("pidof xfce-mcs-manage") != "") return "xfce";
  else return "emacs";
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool gui_is_qt ( )

Definition at line 138 of file basic.cpp.

             {
#ifdef QTTEXMACS
  return true;
#else
  return false;
#endif
}

Here is the caller graph for this function:

bool gui_is_x ( )

Definition at line 129 of file basic.cpp.

            {
#ifdef QTTEXMACS
  return false;
#else
  return true;
#endif
}

Here is the caller graph for this function:

Definition at line 94 of file basic.cpp.

                       {
  static int id= 0;
  id--;
  return id;
}
tm_ostream& operator<< ( tm_ostream out,
display_control  ctrl 
)

Definition at line 103 of file basic.cpp.

                                                    {
  int i;
  switch (ctrl) {
  case INDENT:
    out << "  ";
    current_indent += 2;
    break;
  case UNINDENT:
    out << "\b\b";
    current_indent -= 2;
    break;
  case HRULE:
    for (i=current_indent; i<78; i++) out << "-";
  case LF:
    out << "\n";
    for (i=0; i<current_indent; i++) out << " ";
    break;    
  }
  return out;
}
bool os_macos ( )

Definition at line 165 of file basic.cpp.

            {
#if defined (OS_MACOS)
  return true;
#else
  return false;
#endif
}

Here is the caller graph for this function:

bool os_mingw ( )

Definition at line 156 of file basic.cpp.

            {
#if defined (__MINGW__) || defined (__MINGW32__)
  return true;
#else
  return false;
#endif
}

Here is the caller graph for this function:

bool os_win32 ( )

Definition at line 147 of file basic.cpp.

            {
#if defined (OS_WIN32)
  return true;
#else
  return false;
#endif
}

Here is the caller graph for this function:

bool use_macos_fonts ( )

Definition at line 174 of file basic.cpp.

                   {
#ifdef OS_MACOS
  if (gui_is_qt ()) return true;
  string s= get_preference ("look and feel");
  if (s != "default" && s != "macos") return false;
  string l= get_output_language ();
  if (l == "bulgarian" || l == "russian" || l == "ukrainian") return false;
  return tt_font_exists ("LucidaGrande");
#else
  return false;
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

int current_indent = 0 [static]

Definition at line 100 of file basic.cpp.

int debug_status = 0 [static]

Definition at line 22 of file basic.cpp.