fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
  SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation)  

Fl_mac.cxx File Reference

#include <pthread.h>
#include <config.h>
#include <FL/Fl.H>
#include <FL/x.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Tooltip.H>
#include <FL/Fl_Sys_Menu_Bar.H>
#include <stdio.h>
#include <stdlib.h>
#include "flstring.h"
#include <unistd.h>
#include <FL/fl_draw.H>
Include dependency graph for Fl_mac.cxx:

Go to the source code of this file.

Classes

class  DataReady
struct  DataReady::FD
struct  MacTimeout

Defines

#define USE_PASTEBOARD   1
#define CONSOLIDATE_MOTION   0
#define DEBUGMSG(msg)
#define DEBUGPERRORMSG(msg)
#define DEBUGTEXT(txt)   NULL
#define POLLIN   1
#define POLLOUT   4
#define POLLERR   8

Enumerations

enum  { kEventClassFLTK = 'fltk' }
enum  { kEventFLTKBreakLoop = 1, kEventFLTKDataReady }

Functions

Fl_Windowfl_find (Window)
void fl_fix_focus ()
void fl_reset_spot ()
void fl_set_spot (int font, int size, int X, int Y, int W, int H, Fl_Window *win)
void fl_set_status (int x, int y, int w, int h)
int fl_ready ()
OSStatus HandleMenu (HICommand *cmd)
int fl_wait (double time)
pascal OSStatus carbonTextHandler (EventHandlerCallRef nextHandler, EventRef event, void *userData)
pascal OSStatus carbonKeyboardHandler (EventHandlerCallRef nextHandler, EventRef event, void *userData)
void fl_open_callback (void(*cb)(const char *))
 Register a function called for each file dropped onto an application icon.
OSErr CPSEnableForegroundOperation (ProcessSerialNumber *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5)
void fl_open_display ()
void fl_close_display ()
unsigned short mac2fltk (ulong macKey)
const char * fl_filename_name (const char *name)
void fl_font (class Fl_Font_Descriptor *)
void fl_quartz_restore_line_style_ ()
int MacUnlinkWindow (Fl_X *ip, Fl_X *start)
void MacDestroyWindow (Fl_Window *w, WindowPtr p)
void MacMapWindow (Fl_Window *w, WindowPtr p)
void MacUnmapWindow (Fl_Window *w, WindowPtr p)

Variables

int fl_screen
CGContextRef fl_gc = 0
Handle fl_system_menu
Fl_Sys_Menu_Barfl_sys_menu_bar = 0
CursHandle fl_default_cursor
WindowRef fl_capture = 0
ulong fl_event_time
char fl_key_vector [32]
bool fl_show_iconic
int fl_disable_transient_for
const Fl_Windowfl_modal_for
Fl_Region fl_window_region = 0
Window fl_window
EventRef fl_os_event
void(* fl_lock_function )() = nothing
void(* fl_unlock_function )() = nothing
Fl_Windowfl_dnd_target_window = 0
Fl_Color fl_color_
 The current color.
class Fl_Font_Descriptorfl_fontsize
const CFStringRef flavorNames []
const CFStringEncoding encodings []
const size_t handledFlavorsCount = sizeof(encodings)/sizeof(CFStringEncoding)
Fl_Widgetfl_selection_requestor = 0
char * fl_selection_buffer [2]
int fl_selection_length [2]

Define Documentation

#define CONSOLIDATE_MOTION   0

Definition at line 56 of file Fl_mac.cxx.

#define DEBUGMSG (   msg)
#define DEBUGPERRORMSG (   msg)

Definition at line 80 of file Fl_mac.cxx.

Referenced by DataReady::CheckData(), and DataReady::DataReadyThread().

#define DEBUGTEXT (   txt)    NULL

Definition at line 81 of file Fl_mac.cxx.

Referenced by DataReady::StartThread(), and DataReady::~DataReady().

#define POLLERR   8

Definition at line 223 of file Fl_mac.cxx.

Referenced by DataReady::AddFD(), DataReady::HandleData(), and DataReady::RemoveFD().

#define POLLIN   1

Definition at line 221 of file Fl_mac.cxx.

Referenced by DataReady::AddFD(), DataReady::HandleData(), and DataReady::RemoveFD().

#define POLLOUT   4

Definition at line 222 of file Fl_mac.cxx.

Referenced by DataReady::AddFD(), DataReady::HandleData(), and DataReady::RemoveFD().

#define USE_PASTEBOARD   1

Definition at line 49 of file Fl_mac.cxx.


Enumeration Type Documentation

anonymous enum
Enumerator:
kEventClassFLTK 

Definition at line 124 of file Fl_mac.cxx.

anonymous enum
Enumerator:
kEventFLTKBreakLoop 
kEventFLTKDataReady 

Definition at line 125 of file Fl_mac.cxx.


Function Documentation

pascal OSStatus carbonKeyboardHandler ( EventHandlerCallRef  nextHandler,
EventRef  event,
void *  userData 
)
pascal OSStatus carbonTextHandler ( EventHandlerCallRef  nextHandler,
EventRef  event,
void *  userData 
)
OSErr CPSEnableForegroundOperation ( ProcessSerialNumber *  psn,
UInt32  _arg2,
UInt32  _arg3,
UInt32  _arg4,
UInt32  _arg5 
)

initialize the Mac toolboxes, dock status, and set the default menubar

Referenced by fl_open_display().

void fl_close_display ( )

get rid of allocated resources

Definition at line 1573 of file Fl_mac.cxx.

Fl_Window* fl_find ( Window  )

Definition at line 616 of file Fl.cxx.

References Fl_X::first, Fl::modal(), Fl_X::next, Fl_X::w, Fl_Widget::window(), and Fl_X::xid.

void fl_fix_focus ( )

Definition at line 872 of file Fl.cxx.

void fl_font ( class Fl_Font_Descriptor )

Definition at line 216 of file fl_font_mac.cxx.

void fl_open_display ( )

Definition at line 1493 of file Fl_mac.cxx.

References CPSEnableForegroundOperation(), fl_default_cursor, and NULL.

void fl_quartz_restore_line_style_ ( )
int fl_ready ( )

Check if there is actually a message pending!

Definition at line 480 of file Fl_mac.cxx.

References NULL.

int fl_wait ( double  time)

This public function handles all events. It wait a maximum of 'time' secods for an event. This version returns 1 if events other than the timeout timer were processed.

Todo:
there is no socket handling in this code whatsoever

Definition at line 793 of file Fl_mac.cxx.

OSStatus HandleMenu ( HICommand *  cmd)

handle Apple Menu items (can be created using the Fl_Sys_Menu_Bar returns eventNotHandledErr if the menu item could not be handled

Definition at line 490 of file Fl_mac.cxx.

References FL_MENU_DIVIDER, FL_MENU_RADIO, FL_MENU_TOGGLE, FL_MENU_VALUE, Fl_Menu_Item::flags, i, m, Fl_Menu_::picked(), Fl_Menu_Item::radio(), and Fl_Menu_Item::text.

unsigned short mac2fltk ( ulong  macKey)

convert Mac keystrokes to FLTK

Definition at line 1634 of file Fl_mac.cxx.

void MacDestroyWindow ( Fl_Window w,
WindowPtr  p 
)

Definition at line 2844 of file Fl_mac.cxx.

References MacUnmapWindow(), and Fl_Widget::parent().

void MacMapWindow ( Fl_Window w,
WindowPtr  p 
)

Definition at line 2850 of file Fl_mac.cxx.

References Fl_X::i(), Fl_Widget::parent(), Fl_Widget::redraw(), and Fl_Widget::window().

int MacUnlinkWindow ( Fl_X ip,
Fl_X start 
)

Definition at line 2805 of file Fl_mac.cxx.

References Fl_X::first, Fl_X::next, and start.

Referenced by MacUnmapWindow().

void MacUnmapWindow ( Fl_Window w,
WindowPtr  p 
)

Definition at line 2860 of file Fl_mac.cxx.

References Fl_X::i(), MacUnlinkWindow(), and Fl_Widget::parent().

Referenced by MacDestroyWindow().


Variable Documentation

const CFStringEncoding encodings[]
Initial value:
 { 
  kCFStringEncodingUTF16, 
  kCFStringEncodingUTF8, 
  kCFStringEncodingMacRoman}

Definition at line 2576 of file Fl_mac.cxx.

Referenced by XGetUtf8FontAndGlyph(), XUtf8DrawRtlString(), XUtf8DrawString(), XUtf8TextWidth(), and XUtf8UcsWidth().

WindowRef fl_capture = 0

Definition at line 101 of file Fl_mac.cxx.

Referenced by Fl::grab(), and Fl_Window::show().

CursHandle fl_default_cursor

Definition at line 100 of file Fl_mac.cxx.

Definition at line 105 of file Fl_mac.cxx.

Referenced by Fl_X::make(), and Fl_X::make_xid().

Definition at line 1857 of file Fl_mac.cxx.

Definition at line 102 of file Fl_mac.cxx.

Definition at line 150 of file fl_font_mac.cxx.

CGContextRef fl_gc = 0

Definition at line 97 of file Fl_mac.cxx.

char fl_key_vector[32]

Definition at line 103 of file Fl_mac.cxx.

void(* fl_lock_function)() = nothing

Definition at line 210 of file Fl_mac.cxx.

Referenced by carbonKeyboardHandler(), carbonTextHandler(), and fl_wait().

Definition at line 106 of file Fl_mac.cxx.

EventRef fl_os_event

Definition at line 110 of file Fl_mac.cxx.

int fl_screen

Definition at line 96 of file Fl_mac.cxx.

Definition at line 2584 of file Fl_mac.cxx.

Definition at line 2585 of file Fl_mac.cxx.

Definition at line 2583 of file Fl_mac.cxx.

Definition at line 104 of file Fl_mac.cxx.

Definition at line 99 of file Fl_mac.cxx.

Definition at line 98 of file Fl_mac.cxx.

void(* fl_unlock_function)() = nothing

Definition at line 211 of file Fl_mac.cxx.

Referenced by carbonKeyboardHandler(), carbonTextHandler(), and fl_wait().

Definition at line 108 of file Fl_mac.cxx.

Definition at line 107 of file Fl_mac.cxx.

Referenced by Fl_Window::make_current().

const CFStringRef flavorNames[]
Initial value:
 {
  CFSTR("public.utf16-plain-text"), 
  CFSTR("public.utf8-plain-text"),
  CFSTR("com.apple.traditional-mac-plain-text") }

Definition at line 2572 of file Fl_mac.cxx.

const size_t handledFlavorsCount = sizeof(encodings)/sizeof(CFStringEncoding)

Definition at line 2580 of file Fl_mac.cxx.

Referenced by Fl::paste().