Prima

 view release on metacpan or  search on metacpan

include/win32/win32guts.h  view on Meta::CPAN

#ifndef _WIN32_H_
#define _WIN32_H_
#include <windows.h>
#include <winspool.h>
#include <wtypes.h>
#define Rect xxRect
#define Color xxColor
#define Point xxPoint
#ifdef _MSC_VER
#undef __inline__
#define __inline__ inline
#undef __extension__
#define __extension__
#endif
#include <gdiplus/gdiplus.h>
#undef Rect
#undef Color
#undef Point
#include "apricot.h"

#ifdef __cplusplus
extern "C" {
#endif


#define SEVERE_DEBUG
typedef HANDLE WINHANDLE;
typedef HANDLE SOCKETHANDLE;
#undef  HWND_DESKTOP
#define HWND_DESKTOP         guts. desktop_window


#ifdef UNICODE
#error This version of apc_Win32 does not support Unicode
#endif

#define DEFAULT_SYSTEM_FONT              "System"
#define DEFAULT_WIDGET_FONT              (((DWORD)(LOBYTE(LOWORD(guts.version)))>5)?"Segoe UI":"MS Shell Dlg")
#define DEFAULT_WIDGET_FONT_SIZE         (((DWORD)(LOBYTE(LOWORD(guts.version)))>5)?9:8)
#define COLOR_TOLERANCE                  4
#define HASMATE_MAGIC                    0xDEAF0CE1
#define MENU_ID_AUTOSTART                100
#define TID_USERMAX                      32767
#define REG_STORAGE                      "SOFTWARE\\Perl\\Prima"
#define MAXREGLEN                        1024

#define WM_WRITE_TO_LOG                   ( WM_USER + 0)
#define WM_PRIMA_CREATE                   ( WM_USER + 1)
#define WM_POSTAL                         ( WM_USER + 2)
#define WM_DLGENTERMODAL                  ( WM_USER + 3)
#define WM_ZORDERSYNC                     ( WM_USER + 4)
#define WM_MOUSEENTER                     ( WM_USER + 6)
#define WM_MOUSEEXIT                      ( WM_USER + 7)
#define WM_SETVISIBLE                     ( WM_USER + 8)
#define WM_KEYPACKET                      ( WM_USER + 9)
#define WM_LMOUSECLICK                    ( WM_USER + 10)
#define WM_MMOUSECLICK                    ( WM_USER + 11)
#define WM_RMOUSECLICK                    ( WM_USER + 12)
#define WM_FORCEFOCUS                     ( WM_USER + 13)
#define WM_SYNCMOVE                       ( WM_USER + 14)
#define WM_SOCKET                         ( WM_USER + 15)
#define WM_SOCKET_REHASH                  ( WM_USER + 16)
#define WM_EXTERNAL                       ( WM_USER + 17)
#define WM_HASMATE                        ( WM_USER + 18)
#define WM_FILE                           ( WM_USER + 19)
#define WM_FILE_REHASH                    ( WM_USER + 20)
#define WM_REPAINT_LAYERED                ( WM_USER + 21)
#define WM_DRAG_RESPONSE                  ( WM_USER + 22)
#define WM_XMOUSECLICK                    ( WM_USER + 23)
#define WM_SIGNAL                         ( WM_USER + 24)
#define WM_SYNTHETIC_EVENT                ( WM_USER + 25)
#define WM_SYSHANDLE                      ( WM_USER + 26)
#define WM_SYSHANDLE_REHASH               ( WM_USER + 27)
#define WM_NOOP                           ( WM_USER + 28)
#define WM_TERMINATE                      ( WM_USER + 99)
#define WM_FIRST_USER_MESSAGE             ( WM_USER +100)
#define WM_LAST_USER_MESSAGE              ( WM_USER +900)

#ifndef WM_DPICHANGED
#define WM_DPICHANGED                     0x02E0
#endif

#define WC_CUSTOM       0
#define WC_DLG          1
#define WC_APPLICATION  2
#define WC_FRAME        3
#define WC_MENU         4
#define WC_POPUP        5

#define stbPen          0x01

include/win32/win32guts.h  view on Meta::CPAN

#define SHIFT_POINT(P) SHIFT_XY(P.x,P.y)

typedef struct _HandleOptions_ {
	unsigned aptWM_PAINT             : 1;       // true if inside WM_PAINT
	unsigned aptWinPS                : 1;       // window PS was passed to paint
	unsigned aptCompatiblePS         : 1;       // PS is screen-compatible
	unsigned aptFontExists           : 1;       // font is selected on HPS
	unsigned aptCursorVis            : 1;       // cursor visible flag
	unsigned aptFocused              : 1;       // set if control if focused
	unsigned aptFirstClick           : 1;       // set if control can process WM_BUTTONXDOWN without pre-activation
	unsigned aptClipOwner            : 1;       // if set, parent of this window is HWND_DESKTOP
	unsigned aptLockVisState         : 1;       // visible/locked flag
	unsigned aptTransparent          : 1;       // transparency flag
	unsigned aptSyncPaint            : 1;       // WS_SYNCPAINT analog
	unsigned aptVisible              : 1;       // visibility flag
	unsigned aptTaskList             : 1;       // Window flag - set if in task list
	unsigned aptDeviceBitmap         : 1;       // == kind_of( CDeviceBitmap)
	unsigned aptBitmap               : 1;       // buffered widget
	unsigned aptImage                : 1;       // == kind_of( CImage)
	unsigned aptIcon                 : 1;       // == kind_of( CIcon)
	unsigned aptPrinter              : 1;       // == kind_of( CPrinter)
	unsigned aptExtraFont            : 1;       // extra font styles ( angle, shear) has been applied
	unsigned aptDCChangeLock         : 1;       // locks SelectObject() calls
	unsigned aptEnabled              : 1;       // enabled flag
	unsigned aptTextOpaque           : 1;       // gp text drawing flag
	unsigned aptTextOutBaseline      : 1;       // gp text drawing flag
	unsigned aptWinPosDetermined     : 1;       // 0 when size is set, but position is not
	unsigned aptOnTop                : 1;       // HWND_TOPMOST is set
	unsigned aptLayered              : 1;       // WS_EX_LAYERED
	unsigned aptRepaintPending       : 1;       // for optLayered
	unsigned aptMovePending          : 1;       // for optLayered
	unsigned aptLayeredPaint         : 1;       // painting children of layered window
	unsigned aptLayeredRequested     : 1;       // Prima wants layered
	unsigned aptClipByChildren       : 1;       // cached clipping by children
	unsigned aptIgnoreSizeMessages   : 1;       // during window recreation
	unsigned aptGDIPlus              : 1;       // uses GDI+
	unsigned aptWantWorldTransform   : 1;       // SetWorldTransform is wanted for text
	unsigned aptUsedWorldTransform   : 1;       // SetWorldTransform(matrix) mode is on currently
	unsigned aptCachedWorldTransform : 1;       // SetWorldTransform doesn't need to be called repeatedly
} HandleOptions;

#define CLIPBOARD_MAIN 0
#define CLIPBOARD_DND  1

typedef struct _WinGuts
{
	HINSTANCE      instance;            // application instance
	int            cmd_show;            // run command state
	int            app_lock;            // application lock count
	int            pointer_lock;        // pointer lock count
	DWORD          main_thread_id;      // Id of main thread
	Point          display_resolution;  // screen resolution in ppi
	char           default_fixed_font    [256];
	char           default_variable_font [256];
	char           default_system_font   [256];
	Font           window_font;         // window default font
	Font           menu_font;           // menu default font
	Font           msg_font;            // message default font
	Font           cap_font;            // caption default font
	BITMAPINFO     display_bm_info;     // display bpp & size
	HWND           desktop_window;      // GetDesktopWindow() result
	Bool           insert_mode;         // fake insert mode
	Point          icon_size_large;
	Point          icon_size_small;
	Point          pointer_size;
	BYTE           key_state[ 256];      // application key buffer state
	BYTE           empty_key_state[ 256];// just zeros
	BYTE          *current_key_state;    // current virtual key buffer state
	HKL            key_layout;           // key layout, most likely latin for Ctrl+Key mapping
	NONCLIENTMETRICSW ncmData;           // windows system data
	List           transp;               // transparent controls list
	int            top_windows;          // count of top-level windows in app
	Bool           sys_focus_disabled;   // focus system disabled
	Bool           sys_focus_granted;    // SetFocus() was called inside apc_widget_set_focused
	Bool           sys_focus_dialog;     // system dialog is in action
	UINT           error_mode;           // SetErrorMode() result
	DWORD          version;              // GetVersion() cached result
	Point          cmDOUBLECLK;          // cached SM_CxDOUBLECLK values
	int            mouse_timer;          // is mouse timer started
	Bool           popup_active;         // flag to avoid double popup activation
	Bool           pointer_invisible;
	HWND           console;              // win32-bound console window
	Bool           dont_xlate_message;   // one-time stopper to TranslateMessage() call
	int            utf8_prepend_0x202D;  // newer windows do automatic bidi conversion, this is to cancel it
	WCHAR *      (*alloc_utf8_to_wchar_visual)(const char*,int,int*);
	ULONG_PTR      gdiplus_token;        // GDI+ handle
	Handle         clipboards[2];
	Bool           ole_initialized;
	void*          dnd_data_sender;      // IDropTarget.DragEnter.DataObject dnd storage object
	void*          dnd_data_receiver;    // CLIPBOARD_DND storage object
	Bool           dnd_inside_event;     // to distinguish whether the clipboard is read-only or not
	Bool           dnd_default_cursors;
	void*          drag_source;          // not null if dragging
	Handle         drag_source_widget;   //
	Handle         drag_target;          // last successful drop
	WORD           language_id;          // default shaping language
	char           language_descr[32];
	Bool           application_stop_signal;
	long           apc_error;
	Bool           wc2mb_is_fragile;     // cannot properly process current ACP

	int            get_pixel_needs_emulation; // 0 - not tried, -1 - no, 1 - yes
	HDC            get_pixel_dc_src, get_pixel_dc_dst;

	unsigned long  program_start_ts ;            // epoch
	unsigned int   mouse_double_click_delay;     // ms
	unsigned long  last_mouse_click_ts;          // (time - epoch) * 1000 + msec
	HWND           last_mouse_click_source;
	LPARAM         last_mouse_click_position;
	unsigned int   last_mouse_click_number;
	Byte           last_mouse_click_fingerprint; // kmXXX | mbXXX
} WinGuts, *PWinGuts;

typedef struct _WindowData
{
	int            border_icons;
	int            border_style;
	Point          hidden_pos;
	Point          hidden_size;
	int            state;
	Handle         old_foc;



( run in 0.411 second using v1.01-cache-2.11-cpan-39bf76dae61 )