Skip to content

Commit 754a918

Browse files
committed
Added miniwin constants
1 parent 934c9d7 commit 754a918

File tree

1 file changed

+293
-0
lines changed

1 file changed

+293
-0
lines changed

scripting/lua_methods.cpp

Lines changed: 293 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6782,6 +6782,297 @@ static flags_pair send_to_destinations [] =
67826782
};
67836783

67846784

6785+
// Constants: miniwin.xxxx
6786+
6787+
static flags_pair miniwindow_flags [] =
6788+
{
6789+
6790+
// positions for WindowCreate, SetForegroundImage, SetBackgroundImage, WindowPosition
6791+
{ "pos_stretch_to_view", 0 },
6792+
{ "pos_stretch_to_view_with_aspect", 1 },
6793+
{ "pos_stretch_to_owner", 2 },
6794+
{ "pos_stretch_to_owner_with_aspect", 3 },
6795+
{ "pos_top_left", 4 },
6796+
{ "pos_top_center", 5 },
6797+
{ "pos_top_right", 6 },
6798+
{ "pos_center_right", 7 },
6799+
{ "pos_bottom_right", 8 },
6800+
{ "pos_bottom_center", 9 },
6801+
{ "pos_bottom_left", 10 },
6802+
{ "pos_center_left", 11 },
6803+
{ "pos_center_all", 12 },
6804+
{ "pos_tile", 13 },
6805+
6806+
// flags for WindowCreate
6807+
6808+
{ "create_underneath", MINIWINDOW_DRAW_UNDERNEATH },
6809+
{ "create_absolute_location", MINIWINDOW_ABSOLUTE_LOCATION },
6810+
{ "create_transparent", MINIWINDOW_TRANSPARENT },
6811+
{ "create_ignore_mouse", MINIWINDOW_IGNORE_MOUSE },
6812+
6813+
6814+
// pen styles for drawing shapes
6815+
6816+
{ "pen_solid", PS_SOLID }, // solid pen
6817+
{ "pen_dash", PS_DASH }, // -------
6818+
{ "pen_dot", PS_DOT }, // .......
6819+
{ "pen_dash_dot", PS_DASHDOT }, // _._._._
6820+
{ "pen_dash_dot_dot", PS_DASHDOTDOT }, // _.._.._
6821+
{ "pen_null", PS_NULL }, // no pen
6822+
{ "pen_inside_frame", PS_INSIDEFRAME }, // solid, inside the shape
6823+
6824+
// brush styles for drawing shapes
6825+
6826+
{ "brush_solid", 0 },
6827+
{ "brush_null", 1 },
6828+
{ "brush_hatch_horizontal", 2 },
6829+
{ "brush_hatch_vertical", 3 },
6830+
{ "brush_hatch_forwards_diagonal", 4 },
6831+
{ "brush_hatch_backwards_diagonal",5 },
6832+
{ "brush_hatch_cross", 6 },
6833+
{ "brush_hatch_cross_diagonal", 7 },
6834+
{ "brush_fine_pattern", 8 },
6835+
{ "brush_medium_pattern", 9 },
6836+
{ "brush_coarse_pattern", 10 },
6837+
{ "brush_waves_horizontal", 11 },
6838+
{ "brush_waves_vertical", 12 },
6839+
6840+
6841+
// WindowRectOp action parameter (argument 2)
6842+
6843+
{ "rect_frame", 1 },
6844+
{ "rect_fill", 2 },
6845+
{ "rect_invert", 3 },
6846+
{ "rect_3d_rect", 4 },
6847+
{ "rect_draw_edge", 5 },
6848+
{ "rect_flood_fill_border", 6 },
6849+
{ "rect_flood_fill_surface", 7 },
6850+
6851+
// WindowRectOp colour1 parameter (argument 7) for action 5 (rect_draw_edge)
6852+
6853+
{ "rect_edge_raised", EDGE_RAISED },
6854+
{ "rect_edge_etched", EDGE_ETCHED },
6855+
{ "rect_edge_bump", EDGE_BUMP },
6856+
{ "rect_edge_sunken", EDGE_SUNKEN },
6857+
6858+
// WindowRectOp colour2 parameter (argument 8) for action 5 (rect_draw_edge)
6859+
6860+
{ "rect_edge_at_top_left", BF_TOPLEFT },
6861+
{ "rect_edge_at_top_right", BF_TOPRIGHT },
6862+
{ "rect_edge_at_bottom_left", BF_BOTTOMLEFT },
6863+
{ "rect_edge_at_bottom_right", BF_BOTTOMRIGHT },
6864+
{ "rect_edge_at_all", BF_RECT },
6865+
6866+
{ "rect_diagonal_end_top_left", BF_DIAGONAL_ENDTOPLEFT },
6867+
{ "rect_diagonal_end_top_right", BF_DIAGONAL_ENDTOPRIGHT },
6868+
{ "rect_diagonal_end_bottom_left", BF_DIAGONAL_ENDBOTTOMLEFT },
6869+
{ "rect_diagonal_end_bottom_right", BF_DIAGONAL_ENDBOTTOMRIGHT },
6870+
6871+
// WindowRectOp other colour2 flags (or in) (argument 8) for action 5 (rect_draw_edge)
6872+
6873+
{ "rect_option_fill_middle", BF_MIDDLE },
6874+
{ "rect_option_softer_buttons", BF_SOFT },
6875+
{ "rect_option_flat_borders", BF_FLAT },
6876+
{ "rect_option_monochrom_borders", BF_MONO },
6877+
6878+
6879+
6880+
// WindowCircleOp action parameter (argument 2)
6881+
6882+
{ "circle_ellipse", 1 },
6883+
{ "circle_rectangle", 2 },
6884+
{ "circle_round_rectangle", 3 },
6885+
{ "circle_chord", 4 },
6886+
{ "circle_pie", 5 },
6887+
6888+
6889+
// WindowGradient mode parameter (argument 8)
6890+
6891+
{ "gradient_horizontal", 1 },
6892+
{ "gradient_vertical", 2 },
6893+
{ "gradient_texture", 3 },
6894+
6895+
// WindowFont charset
6896+
6897+
{ "font_charset_ansi", ANSI_CHARSET },
6898+
{ "font_charset_default", DEFAULT_CHARSET },
6899+
{ "font_charset_symbol", SYMBOL_CHARSET },
6900+
6901+
// WindowFont PitchAndFamily
6902+
6903+
{ "font_family_any", FF_DONTCARE },
6904+
{ "font_family_roman", FF_ROMAN },
6905+
{ "font_family_swiss", FF_SWISS },
6906+
{ "font_family_modern", FF_MODERN },
6907+
{ "font_family_script", FF_SCRIPT },
6908+
{ "font_family_decorative", FF_DECORATIVE },
6909+
6910+
6911+
{ "font_pitch_default", DEFAULT_PITCH },
6912+
{ "font_pitch_fixed", FIXED_PITCH },
6913+
{ "font_pitch_variable", VARIABLE_PITCH },
6914+
{ "font_pitch_monospaced", MONO_FONT },
6915+
6916+
{ "font_truetype", TRUETYPE_FONTTYPE },
6917+
6918+
// WindowDrawImage mode (argument 7)
6919+
6920+
{ "image_copy", 1 },
6921+
{ "image_stretch", 2 },
6922+
{ "image_transparent_copy", 3 },
6923+
6924+
6925+
// WindowImageOp actions (argument 2)
6926+
6927+
{ "image_fill_ellipse", 1 },
6928+
{ "image_fill_rectangle", 2 },
6929+
{ "image_fill_round_fill_rectangle", 3 },
6930+
6931+
// WindowFilter operations (argument 6)
6932+
6933+
{ "filter_noise", 1 },
6934+
{ "filter_monochrome_noise", 2 },
6935+
{ "filter_blur", 3 },
6936+
{ "filter_sharpen", 4 },
6937+
{ "filter_find_edges", 5 },
6938+
{ "filter_emboss", 6 },
6939+
{ "filter_brightness", 7 },
6940+
{ "filter_contrast", 8 },
6941+
{ "filter_gamma", 9 },
6942+
{ "filter_red_brightness", 10 },
6943+
{ "filter_red_contrast", 11 },
6944+
{ "filter_red_gamma", 12 },
6945+
{ "filter_green_brightness", 13 },
6946+
{ "filter_green_contrast", 14 },
6947+
{ "filter_green_gamma", 15 },
6948+
{ "filter_blue_brightness", 16 },
6949+
{ "filter_blue_contrast", 17 },
6950+
{ "filter_blue_gamma", 18 },
6951+
{ "filter_grayscale", 19 },
6952+
{ "filter_normal_grayscale", 20 },
6953+
{ "filter_brightness_multiply", 21 },
6954+
{ "filter_red_brightness_multiply", 22 },
6955+
{ "filter_green_brightness_multiply",23 },
6956+
{ "filter_blue_brightness_multiply", 24 },
6957+
{ "filter_lesser_blur", 25 },
6958+
{ "filter_minor_blur", 26 },
6959+
{ "filter_average", 27 },
6960+
6961+
// WindowBlendImage modes (argument 7)
6962+
6963+
{ "blend_normal", 1 },
6964+
{ "blend_average", 2 },
6965+
{ "blend_interpolate", 3 },
6966+
{ "blend_dissolve", 4 },
6967+
{ "blend_darken", 5 },
6968+
{ "blend_multiply", 6 },
6969+
{ "blend_colour_burn", 7 },
6970+
{ "blend_linear_burn", 8 },
6971+
{ "blend_inverse_colour_burn", 9 },
6972+
{ "blend_subtract", 10 },
6973+
{ "blend_lighten", 11 },
6974+
{ "blend_screen", 12 },
6975+
{ "blend_colour_dodge", 13 },
6976+
{ "blend_linear_dodge", 14 },
6977+
{ "blend_inverse_colour_dodge", 15 },
6978+
{ "blend_add", 16 },
6979+
{ "blend_overlay", 17 },
6980+
{ "blend_soft_light", 18 },
6981+
{ "blend_hard_light", 19 },
6982+
{ "blend_vivid_light", 20 },
6983+
{ "blend_linear_light", 21 },
6984+
{ "blend_pin_light", 22 },
6985+
{ "blend_hard_mix", 23 },
6986+
{ "blend_difference", 24 },
6987+
{ "blend_exclusion", 25 },
6988+
{ "blend_reflect", 26 },
6989+
{ "blend_glow", 27 },
6990+
{ "blend_freeze", 28 },
6991+
{ "blend_heat", 29 },
6992+
{ "blend_negation", 30 },
6993+
{ "blend_phoenix", 31 },
6994+
{ "blend_stamp", 32 },
6995+
{ "blend_xor", 33 },
6996+
{ "blend_and", 34 },
6997+
{ "blend_or", 35 },
6998+
{ "blend_red", 36 },
6999+
{ "blend_green", 37 },
7000+
{ "blend_blue", 38 },
7001+
{ "blend_yellow", 39 },
7002+
{ "blend_cyan", 40 },
7003+
{ "blend_magenta", 41 },
7004+
{ "blend_green_limited_by_red", 42 },
7005+
{ "blend_green_limited_by_blue", 43 },
7006+
{ "blend_green_limited_by_average_of_red_and_blue",44 },
7007+
{ "blend_blue_limited_by_red", 45 },
7008+
{ "blend_blue_limited_by_green", 46 },
7009+
{ "blend_blue_limited_by_average_of_red_and_green",47 },
7010+
{ "blend_red_limited_by_green", 48 },
7011+
{ "blend_red_limited_by_blue", 49 },
7012+
{ "blend_red_limited_by_average_of_green_and_blue",50 },
7013+
{ "blend_red_only", 51 },
7014+
{ "blend_green_only", 52 },
7015+
{ "blend_blue_only", 53 },
7016+
{ "blend_discard_red", 54 },
7017+
{ "blend_discard_green", 55 },
7018+
{ "blend_discard_blue", 56 },
7019+
{ "blend_all_red", 57 },
7020+
{ "blend_all_green", 58 },
7021+
{ "blend_all_blue", 59 },
7022+
{ "blend_hue_mode", 60 },
7023+
{ "blend_saturation_mode", 61 },
7024+
{ "blend_colour_mode", 62 },
7025+
{ "blend_luminance_mode", 63 },
7026+
{ "blend_hsl", 64 },
7027+
7028+
7029+
// WindowAddHotspot cursor modes
7030+
7031+
{ "cursor_none", -1 },
7032+
{ "cursor_arrow", 0 },
7033+
{ "cursor_hand", 1 },
7034+
{ "cursor_ibeam", 2 },
7035+
{ "cursor_plus", 3 },
7036+
{ "cursor_wait", 4 },
7037+
{ "cursor_up", 5 },
7038+
{ "cursor_nw_se_arrow", 6 },
7039+
{ "cursor_ne_sw_arrow", 7 },
7040+
{ "cursor_ew_arrow", 8 },
7041+
{ "cursor_ns_arrow", 9 },
7042+
{ "cursor_both_arrow", 10 },
7043+
{ "cursor_x", 11 },
7044+
{ "cursor_help", 12 },
7045+
7046+
7047+
// AddHotspot flags (argument 14)
7048+
7049+
{ "hotspot_report_all_mouseovers", 0x01 },
7050+
7051+
// hotspot callback flags
7052+
7053+
{ "hotspot_got_shift", 0x01 },
7054+
{ "hotspot_got_control", 0x02 },
7055+
{ "hotspot_got_alt", 0x04 },
7056+
{ "hotspot_got_lh_mouse", 0x10 },
7057+
{ "hotspot_got_rh_mouse", 0x20 },
7058+
{ "hotspot_got_dbl_click", 0x40 },
7059+
{ "hotspot_got_not_first", 0x80 },
7060+
7061+
// WindowMergeImageAlpha Mode (argument 8)
7062+
7063+
{ "merge_straight", 0 },
7064+
{ "merge_transparent", 1 },
7065+
7066+
// drag handler callback flags
7067+
7068+
{ "drag_got_shift", 0x01 },
7069+
{ "drag_got_control", 0x02 },
7070+
{ "drag_got_alt", 0x04 },
7071+
7072+
// { "y_x", 1 },
7073+
{ NULL, 0 }
7074+
};
7075+
67857076
extern const struct luaL_reg *ptr_xmllib;
67867077

67877078
/*
@@ -6867,6 +7158,8 @@ int RegisterLuaRoutines (lua_State *L)
68677158
MakeIntFlagsTable (L, "error_desc", error_descriptions);
68687159
// send-to table
68697160
MakeFlagsTable (L, "sendto", send_to_destinations);
7161+
// miniwindow constants table
7162+
MakeFlagsTable (L, "miniwin", miniwindow_flags);
68707163

68717164
// colour names
68727165

0 commit comments

Comments
 (0)