2016-02-19 21:41:02 +00:00
|
|
|
//
|
|
|
|
|
// "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $"
|
|
|
|
|
//
|
2016-02-26 16:18:27 +00:00
|
|
|
// Definition of Apple Cocoa window driver
|
2016-02-19 21:41:02 +00:00
|
|
|
// for the Fast Light Tool Kit (FLTK).
|
|
|
|
|
//
|
|
|
|
|
// Copyright 2010-2016 by Bill Spitzak and others.
|
|
|
|
|
//
|
|
|
|
|
// This library is free software. Distribution and use rights are outlined in
|
|
|
|
|
// the file "COPYING" which should have been included with this file. If this
|
|
|
|
|
// file is missing or damaged, see the license at:
|
|
|
|
|
//
|
|
|
|
|
// http://www.fltk.org/COPYING.php
|
|
|
|
|
//
|
|
|
|
|
// Please report all bugs and problems on the following page:
|
|
|
|
|
//
|
|
|
|
|
// http://www.fltk.org/str.php
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
/**
|
2016-02-26 16:18:27 +00:00
|
|
|
\file Fl_WinAPI_Window_Driver.H
|
|
|
|
|
\brief Definition of MSWindows window driver.
|
2016-02-19 21:41:02 +00:00
|
|
|
*/
|
|
|
|
|
|
2016-02-26 16:18:27 +00:00
|
|
|
#ifndef FL_WINAPI_WINDOW_DRIVER_H
|
|
|
|
|
#define FL_WINAPI_WINDOW_DRIVER_H
|
2016-02-19 21:41:02 +00:00
|
|
|
|
2016-02-19 22:21:02 +00:00
|
|
|
#include <FL/Fl_Window_Driver.H>
|
2016-03-10 22:26:40 +00:00
|
|
|
#include <windows.h>
|
2016-02-19 21:41:02 +00:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Move everything here that manages the native window interface.
|
|
|
|
|
|
|
|
|
|
There is one window driver for each Fl_Window. Window drivers manage window
|
|
|
|
|
actions such as resizing, events, decoration, fullscreen modes, etc. . All
|
|
|
|
|
drawing and rendering is managed by the Surface device and the associated
|
|
|
|
|
graphics driver.
|
|
|
|
|
|
|
|
|
|
- window specific event handling
|
|
|
|
|
- window types and styles, depth, etc.
|
|
|
|
|
- decorations
|
|
|
|
|
|
|
|
|
|
? where do we handle the interface between OpenGL/DirectX and Cocoa/WIN32/Glx?
|
|
|
|
|
*/
|
|
|
|
|
|
2016-03-10 22:26:40 +00:00
|
|
|
|
2016-03-10 17:19:34 +00:00
|
|
|
struct Fl_Window_Driver::shape_data_type {
|
|
|
|
|
int lw_; ///< width of shape image
|
|
|
|
|
int lh_; ///< height of shape image
|
|
|
|
|
Fl_Image* shape_; ///< shape image
|
|
|
|
|
Fl_Bitmap *todelete_; ///< auxiliary bitmap image
|
|
|
|
|
};
|
|
|
|
|
|
2016-02-26 16:18:27 +00:00
|
|
|
class FL_EXPORT Fl_WinAPI_Window_Driver : public Fl_Window_Driver
|
2016-02-19 21:41:02 +00:00
|
|
|
{
|
2016-03-22 13:27:22 +00:00
|
|
|
friend class Fl_Window;
|
|
|
|
|
struct icon_data {
|
|
|
|
|
const void *legacy_icon;
|
|
|
|
|
Fl_RGB_Image **icons;
|
|
|
|
|
int count;
|
|
|
|
|
HICON big_icon;
|
|
|
|
|
HICON small_icon;
|
|
|
|
|
};
|
2016-03-10 17:19:34 +00:00
|
|
|
private:
|
2016-03-12 22:24:20 +00:00
|
|
|
RECT border_width_title_bar_height(int &bx, int &by, int &bt);
|
2016-03-10 17:19:34 +00:00
|
|
|
void shape_bitmap_(Fl_Image* b);
|
|
|
|
|
void shape_alpha_(Fl_Image* img, int offset);
|
2016-02-19 21:41:02 +00:00
|
|
|
public:
|
2016-02-26 16:18:27 +00:00
|
|
|
Fl_WinAPI_Window_Driver(Fl_Window*);
|
2016-03-10 18:45:50 +00:00
|
|
|
~Fl_WinAPI_Window_Driver();
|
2016-03-12 22:24:20 +00:00
|
|
|
|
2016-03-22 13:27:22 +00:00
|
|
|
struct icon_data *icon_;
|
2016-03-12 22:24:20 +00:00
|
|
|
// --- window data
|
|
|
|
|
virtual int decorated_w();
|
|
|
|
|
virtual int decorated_h();
|
|
|
|
|
|
2016-03-13 22:16:37 +00:00
|
|
|
// --- window management
|
|
|
|
|
virtual void flush_double();
|
|
|
|
|
virtual void flush_overlay();
|
|
|
|
|
virtual void draw_begin();
|
2016-03-21 17:06:03 +00:00
|
|
|
virtual void make_current();
|
2016-03-21 17:55:10 +00:00
|
|
|
virtual void label(const char *name,const char *iname);
|
2016-03-13 22:16:37 +00:00
|
|
|
|
2016-03-10 17:19:34 +00:00
|
|
|
virtual void shape(const Fl_Image* img);
|
2016-03-10 22:26:40 +00:00
|
|
|
virtual void icons(const Fl_RGB_Image *icons[], int count);
|
|
|
|
|
virtual const void *icon() const;
|
|
|
|
|
virtual void icon(const void * ic);
|
|
|
|
|
virtual void free_icons();
|
2016-03-11 07:07:42 +00:00
|
|
|
// this one is implemented in Fl_win32.cxx
|
|
|
|
|
virtual void capture_titlebar_and_borders(Fl_Shared_Image*& top, Fl_Shared_Image*& left, Fl_Shared_Image*& bottom, Fl_Shared_Image*& right);
|
2016-03-11 08:31:36 +00:00
|
|
|
virtual void wait_for_expose();
|
2016-02-19 21:41:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2016-02-26 16:18:27 +00:00
|
|
|
#endif // FL_WINAPI_WINDOW_DRIVER_H
|
2016-02-19 21:41:02 +00:00
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// End of "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $".
|
|
|
|
|
//
|