aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/.gui.luadoc
blob: 56e576df336f40ead1a2b1e63a5cb0d7353fd702 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
-- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE.
-- This is a DUMMY FILE used for making LuaDoc for built-in functions in the
-- global gui table.

--- The core gui table.
module('gui')

-- Markdown:
-- ## Fields
--
-- * `title` [string]: The title of the Textadept window.
-- * `focused_doc_pointer` [number]: The pointer to the document associated with
--   the buffer of the currently focused view. (Read-only)
-- * `menubar` [table]: A table of GTK menus defining a menubar. (Write-only)
-- * `context_menu`: A GTK menu defining the editor's context menu.
-- * `clipboard_text` [string]: The text on the clipboard. (Read-only)
-- * `statusbar_text` [string]: The text displayed by the statusbar.
-- * `docstatusbar_text` [string]: The text displayed by the doc statusbar.
--   (Write-only)
-- * `size` [table]: The size of the Textadept window (`{ width, height }`).

---
-- Goes to the specified view.
-- Activates the 'view_*_switch' signal.
-- @param n A relative or absolute view index.
-- @param absolute Flag indicating if n is an absolute index or not.
function goto_view(n, absolute) end

---
-- Gets the current split view structure.
-- @return table of split views. Each split view entry is a table with 4
--   fields: 1, 2, vertical, and size. 1 and 2 have values of either
--   split view entries or the index of the buffer shown in each view.
--   vertical is a flag indicating if the split is vertical or not, and
--   size is the integer position of the split resizer.
function get_split_table() end

---
-- Creates a GTK menu, returning the userdata.
-- @param menu_table A table defining the menu. It is an ordered list of tables
--   with a string menu item and integer menu ID.
--   The string menu item is handled as follows:
--     'gtk-*' - a stock menu item is created based on the GTK stock-id.
--     'separator' - a menu separator item is created.
--     Otherwise a regular menu item with a mnemonic is created.
--   Submenus are just nested menu-structure tables. Their title text is defined
--   with a 'title' key.
function gtkmenu(menu_table) end

---
-- Checks if the buffer being indexed is the currently focused buffer.
-- This is necessary because any buffer actions are performed in the focused
-- views' buffer, which may not be the buffer being indexed. Throws an error
-- if the check fails.
-- @param buffer The buffer in question.
function check_focused_buffer(buffer) end

---
-- Helper function for printing messages to buffers.
-- Splits the view and opens a new buffer for printing messages. If the message
-- buffer is already open and a view is currently showing it, the message is
-- printed to that view. Otherwise the view is split, goes to the open message
-- buffer, and prints to it.
-- @param buffer_type String type of message buffer.
-- @param ... Message strings.
-- @usage gui._print(L('[Error Buffer]'), error_message)
-- @usage gui._print(L('[Message Buffer]'), message)
function _print(buffer_type, ...) end

---
-- Prints messages to the Textadept message buffer.
-- Opens a new buffer (if one hasn't already been opened) for printing messages.
-- @param ... Message strings.
function print(...) end

---
-- Displays a dialog with a list of buffers to switch to and switches to the
-- selected one, if any.
function switch_buffer() end

---
-- Displays a CocoaDialog of a specified type with the given string arguments.
-- Each argument is like a string in Lua's 'arg' table. Tables of strings are
-- allowed as arguments and are expanded in place. This is useful for
-- filteredlist dialogs with many items.
-- @return string CocoaDialog result.
function dialog(kind, ...) end

---
-- Shortcut function for gui.dialog('filtered_list', ...) with 'Ok' and 'Cancel'
-- buttons.
-- @param title The title for the filteredlist dialog.
-- @param columns A column name or list of column names.
-- @param items An item or list of items.
-- @param int_return If true, returns the integer index of the selected item in
--   the filteredlist. Defaults to false, which returns the string item. Not
--   compatible with a '--select-multiple' filteredlist.
-- @param ... Additional parameters to pass to gui.dialog().
-- @return Either a string or integer on success; nil otherwise.
-- @usage gui.filteredlist('Title', 'Foo', { 'Bar', 'Baz' })
-- @usage gui.filteredlist('Title', { 'Foo', 'Bar' }, { 'a', 'b', 'c', 'd' },
--                         false, '--output-column', '2')
function filteredlist(title, columns, items, int_return, ...) end