@designliquido/delegua-interface-grafica 0.0.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +234 -6
- package/delegua-modulo.d.ts +154 -0
- package/delegua-modulo.d.ts.map +1 -0
- package/delegua-modulo.js +385 -0
- package/delegua-modulo.js.map +1 -0
- package/{fontes/index.ts → index.d.ts} +1 -0
- package/index.d.ts.map +1 -0
- package/index.js +20 -0
- package/index.js.map +1 -0
- package/infraestruturas/electron/infraestrutura-electron.d.ts +37 -0
- package/infraestruturas/electron/infraestrutura-electron.d.ts.map +1 -0
- package/{fontes/infraestruturas/electron/infraestrutura-electron.ts → infraestruturas/electron/infraestrutura-electron.js} +61 -69
- package/infraestruturas/electron/infraestrutura-electron.js.map +1 -0
- package/infraestruturas/gtk/index.d.ts +2 -0
- package/infraestruturas/gtk/index.d.ts.map +1 -0
- package/infraestruturas/gtk/index.js +18 -0
- package/infraestruturas/gtk/index.js.map +1 -0
- package/infraestruturas/gtk/infraestrutura-gtk.d.ts +48 -0
- package/infraestruturas/gtk/infraestrutura-gtk.d.ts.map +1 -0
- package/infraestruturas/gtk/infraestrutura-gtk.js +130 -0
- package/infraestruturas/gtk/infraestrutura-gtk.js.map +1 -0
- package/infraestruturas/index.d.ts +8 -0
- package/infraestruturas/index.d.ts.map +1 -0
- package/infraestruturas/index.js +24 -0
- package/infraestruturas/index.js.map +1 -0
- package/infraestruturas/java-swing/index.d.ts +2 -0
- package/infraestruturas/java-swing/index.d.ts.map +1 -0
- package/infraestruturas/java-swing/index.js +18 -0
- package/infraestruturas/java-swing/index.js.map +1 -0
- package/infraestruturas/java-swing/infraestrutura-java-swing.d.ts +51 -0
- package/infraestruturas/java-swing/infraestrutura-java-swing.d.ts.map +1 -0
- package/infraestruturas/java-swing/infraestrutura-java-swing.js +130 -0
- package/infraestruturas/java-swing/infraestrutura-java-swing.js.map +1 -0
- package/infraestruturas/macos/index.d.ts +2 -0
- package/infraestruturas/macos/index.d.ts.map +1 -0
- package/infraestruturas/macos/index.js +18 -0
- package/infraestruturas/macos/index.js.map +1 -0
- package/infraestruturas/macos/infraestrutura-macos.d.ts +48 -0
- package/infraestruturas/macos/infraestrutura-macos.d.ts.map +1 -0
- package/infraestruturas/macos/infraestrutura-macos.js +130 -0
- package/infraestruturas/macos/infraestrutura-macos.js.map +1 -0
- package/infraestruturas/processo-externo/index.d.ts +2 -0
- package/infraestruturas/processo-externo/index.d.ts.map +1 -0
- package/infraestruturas/processo-externo/index.js +18 -0
- package/infraestruturas/processo-externo/index.js.map +1 -0
- package/infraestruturas/processo-externo/infraestrutura-processo-externo.d.ts +40 -0
- package/infraestruturas/processo-externo/infraestrutura-processo-externo.d.ts.map +1 -0
- package/infraestruturas/processo-externo/infraestrutura-processo-externo.js +211 -0
- package/infraestruturas/processo-externo/infraestrutura-processo-externo.js.map +1 -0
- package/infraestruturas/vazia/infraestrutura-vazia.d.ts +33 -0
- package/infraestruturas/vazia/infraestrutura-vazia.d.ts.map +1 -0
- package/infraestruturas/vazia/infraestrutura-vazia.js +64 -0
- package/infraestruturas/vazia/infraestrutura-vazia.js.map +1 -0
- package/infraestruturas/webview/infraestrutura-webview.d.ts +45 -0
- package/infraestruturas/webview/infraestrutura-webview.d.ts.map +1 -0
- package/infraestruturas/webview/infraestrutura-webview.js +381 -0
- package/infraestruturas/webview/infraestrutura-webview.js.map +1 -0
- package/infraestruturas/windows/index.d.ts +2 -0
- package/infraestruturas/windows/index.d.ts.map +1 -0
- package/infraestruturas/windows/index.js +18 -0
- package/infraestruturas/windows/index.js.map +1 -0
- package/infraestruturas/windows/infraestrutura-windows.d.ts +48 -0
- package/infraestruturas/windows/infraestrutura-windows.d.ts.map +1 -0
- package/infraestruturas/windows/infraestrutura-windows.js +130 -0
- package/infraestruturas/windows/infraestrutura-windows.js.map +1 -0
- package/interface-grafica.d.ts +117 -0
- package/interface-grafica.d.ts.map +1 -0
- package/{fontes/interface-grafica.ts → interface-grafica.js} +50 -69
- package/interface-grafica.js.map +1 -0
- package/{fontes/interfaces/componente-interface-grafica-interface.ts → interfaces/componente-interface-grafica-interface.d.ts} +1 -0
- package/interfaces/componente-interface-grafica-interface.d.ts.map +1 -0
- package/interfaces/componente-interface-grafica-interface.js +3 -0
- package/interfaces/componente-interface-grafica-interface.js.map +1 -0
- package/{fontes/interfaces/index.ts → interfaces/index.d.ts} +1 -0
- package/interfaces/index.d.ts.map +1 -0
- package/interfaces/index.js +19 -0
- package/interfaces/index.js.map +1 -0
- package/{fontes/interfaces/infraestrutura-grafica-interface.ts → interfaces/infraestrutura-grafica-interface.d.ts} +5 -12
- package/interfaces/infraestrutura-grafica-interface.d.ts.map +1 -0
- package/interfaces/infraestrutura-grafica-interface.js +3 -0
- package/interfaces/infraestrutura-grafica-interface.js.map +1 -0
- package/package.json +12 -4
- package/.release-it.json +0 -15
- package/fontes/delegua-modulo.ts +0 -238
- package/fontes/infraestruturas/electron/README.md +0 -92
- package/fontes/infraestruturas/index.ts +0 -2
- package/fontes/infraestruturas/vazia/README.md +0 -53
- package/fontes/infraestruturas/vazia/infraestrutura-vazia.ts +0 -61
- package/jest.config.ts +0 -21
- package/testes/interface-grafica.test.ts +0 -159
- package/tsconfig.json +0 -22
- package/tsconfig.spec.json +0 -21
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Biblioteca de interface gráfica para a linguagem [Delégua](https://github.com/DesignLiquido/delegua).
|
|
4
4
|
|
|
5
|
-
Permite criar janelas, botões, rótulos, caixas de texto e contêineres de layout diretamente em código Delégua, com suporte a eventos como cliques e alterações de texto.
|
|
5
|
+
Permite criar janelas, botões, rótulos, caixas de texto e contêineres de layout diretamente em código Delégua, com suporte a eventos como cliques e alterações de texto. Também oferece layout livre com coordenadas absolutas e dimensionamento explícito de componentes.
|
|
6
6
|
|
|
7
7
|
## Instalação
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ npm install @designliquido/delegua-interface-grafica
|
|
|
12
12
|
|
|
13
13
|
## Uso em código Delégua
|
|
14
14
|
|
|
15
|
-
```
|
|
15
|
+
```delegua
|
|
16
16
|
var ig = importar("interfaceGrafica")
|
|
17
17
|
|
|
18
18
|
var janela = ig.janela(800, 600, "Meu Programa")
|
|
@@ -29,6 +29,31 @@ ig.aoClicar(botao, aoClicar)
|
|
|
29
29
|
ig.iniciar()
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
## Layouts disponíveis
|
|
33
|
+
|
|
34
|
+
- `caixaVertical(pai)` e `caixaHorizontal(pai)` mantêm o modelo de fluxo/empilhamento.
|
|
35
|
+
- `caixaLivre(pai)` cria uma área de layout absoluto para posicionar componentes com `x` e `y`.
|
|
36
|
+
- `definirPosicao(componente, x, y)` e `definirTamanho(componente, largura, altura)` usam pixels.
|
|
37
|
+
|
|
38
|
+
Exemplo com geometria:
|
|
39
|
+
|
|
40
|
+
```delegua
|
|
41
|
+
var ig = importar("interfaceGrafica")
|
|
42
|
+
|
|
43
|
+
var janela = ig.janela(800, 600, "Layout Livre")
|
|
44
|
+
var areaLivre = ig.caixaLivre(janela)
|
|
45
|
+
|
|
46
|
+
var caixa = ig.caixaTexto(areaLivre, "")
|
|
47
|
+
var botao = ig.botao(areaLivre, "Confirmar")
|
|
48
|
+
|
|
49
|
+
ig.definirPosicao(caixa, 24, 32)
|
|
50
|
+
ig.definirTamanho(caixa, 220, 32)
|
|
51
|
+
ig.definirPosicao(botao, 24, 80)
|
|
52
|
+
ig.definirTamanho(botao, 120, 36)
|
|
53
|
+
|
|
54
|
+
ig.iniciar()
|
|
55
|
+
```
|
|
56
|
+
|
|
32
57
|
## Métodos disponíveis
|
|
33
58
|
|
|
34
59
|
| Método | Descrição |
|
|
@@ -39,13 +64,22 @@ ig.iniciar()
|
|
|
39
64
|
| `caixaTexto(pai, textoInicial?)` | Cria uma caixa de texto editável. |
|
|
40
65
|
| `caixaVertical(pai)` | Cria um contêiner com layout vertical (de cima para baixo). |
|
|
41
66
|
| `caixaHorizontal(pai)` | Cria um contêiner com layout horizontal (da esquerda para direita). |
|
|
67
|
+
| `caixaLivre(pai)` | Cria um contêiner com layout livre para posicionamento por coordenadas. |
|
|
42
68
|
| `definirTexto(componente, texto)` | Altera o texto de um rótulo ou caixa de texto. |
|
|
43
69
|
| `obterTexto(componente)` | Lê o texto atual de um rótulo ou caixa de texto. |
|
|
70
|
+
| `definirPosicao(componente, x, y)` | Define a posição do componente em pixels. |
|
|
71
|
+
| `definirTamanho(componente, largura, altura)` | Define largura e altura do componente em pixels. |
|
|
44
72
|
| `aoClicar(componente, funcao)` | Registra uma função a ser chamada ao clicar no componente. |
|
|
45
73
|
| `aoAlterar(componente, funcao)` | Registra uma função a ser chamada quando o texto do componente mudar. A função recebe o novo texto como argumento. |
|
|
46
74
|
| `iniciar()` | Inicia o laço de eventos. Bloqueia até a janela ser fechada. |
|
|
47
75
|
| `encerrar()` | Encerra a interface gráfica e fecha todas as janelas. |
|
|
48
76
|
|
|
77
|
+
## Regras de geometria
|
|
78
|
+
|
|
79
|
+
- Posicionamento absoluto é garantido para componentes cujo pai imediato seja uma `caixaLivre`.
|
|
80
|
+
- `x`, `y`, `largura` e `altura` são interpretados em pixels.
|
|
81
|
+
- Em backends nativos, tentativas de posicionar um componente em um contêiner de fluxo podem resultar em erro explícito do host.
|
|
82
|
+
|
|
49
83
|
## Arquitetura
|
|
50
84
|
|
|
51
85
|
A biblioteca é dividida em duas camadas:
|
|
@@ -55,10 +89,55 @@ A biblioteca é dividida em duas camadas:
|
|
|
55
89
|
|
|
56
90
|
### Infraestruturas disponíveis
|
|
57
91
|
|
|
58
|
-
| Classe |
|
|
59
|
-
|
|
60
|
-
| `InfraestruturaElectron` |
|
|
61
|
-
| `
|
|
92
|
+
| Classe | Ambiente | Descrição |
|
|
93
|
+
|--------|----------|-----------|
|
|
94
|
+
| `InfraestruturaElectron` | Processo renderer do Electron | Cria elementos DOM diretamente no `document.body` da janela Electron. Selecionada automaticamente quando `document` está disponível. |
|
|
95
|
+
| `InfraestruturaGtk` *(experimental)* | Node.js + host GTK externo | Encaminha comandos de UI para um processo externo GTK via JSON em stdin/stdout. Recomendado para ambientes Linux-first. Suporta `caixaLivre` e `definir-geometria` no protocolo. |
|
|
96
|
+
| `InfraestruturaJavaSwing` *(experimental)* | Node.js + host Java externo | Encaminha comandos de UI para um processo externo Java Swing via JSON em stdin/stdout. Requer um host Swing compatível com o protocolo da biblioteca. Suporta `caixaLivre` e `definir-geometria`. |
|
|
97
|
+
| `InfraestruturaWindows` *(experimental)* | Node.js + host Windows externo | Encaminha comandos de UI para um processo externo Windows (WPF/WinUI/WinForms) via JSON em stdin/stdout. Recomendado para ambientes Windows-first. Suporta `caixaLivre` e `definir-geometria`. |
|
|
98
|
+
| `InfraestruturaVazia` | Qualquer (fallback) | Sem operações visuais; mantém estado de texto em memória. Usada em testes unitários e quando nenhuma outra infraestrutura se aplica. |
|
|
99
|
+
| `InfraestruturaWebView` | Extensão VS Code | Renderiza a janela em um `WebviewPanel` do VS Code, comunicando-se via `postMessage`. Requer chamada prévia a `definirFabricaPainelWebView()` em `@designliquido/delegua-node`. Suporta `caixaLivre` e geometria explícita. |
|
|
100
|
+
| `InfraestruturaMacOS` *(experimental)* | Node.js + host macOS externo | Encaminha comandos de UI para um processo externo AppKit/Cocoa via JSON em stdin/stdout. Suporta `caixaLivre` e `definir-geometria`. |
|
|
101
|
+
| `InfraestruturaElectronSpawn` *(em `delegua-node`)* | Linha de comando (Node.js) | Spawna um processo Electron filho e comunica-se via stdin/stdout com o mesmo protocolo JSON de `InfraestruturaWebView`. Selecionada automaticamente quando o pacote `electron` está instalado. |
|
|
102
|
+
|
|
103
|
+
### Como a infraestrutura é escolhida em `delegua-node`
|
|
104
|
+
|
|
105
|
+
Ao importar `interfaceGrafica` em um programa Delégua, `delegua-node` escolhe a infraestrutura na seguinte ordem de prioridade:
|
|
106
|
+
|
|
107
|
+
1. **`InfraestruturaWebView`** — se a extensão VS Code tiver registrado uma fábrica de painel via `definirFabricaPainelWebView()` (veja abaixo).
|
|
108
|
+
2. **`InfraestruturaElectron`** — se `document` estiver disponível (processo renderer do Electron).
|
|
109
|
+
3. **`InfraestruturaElectronSpawn`** *(em `delegua-node`)* — se o pacote `electron` estiver instalado (local ou globalmente). Spawna um processo Electron filho e comunica-se via stdin/stdout.
|
|
110
|
+
4. **`InfraestruturaVazia`** — fallback final; emite um aviso no console e não exibe nenhuma janela.
|
|
111
|
+
|
|
112
|
+
### Executando programas com interface gráfica
|
|
113
|
+
|
|
114
|
+
#### Linha de comando (Node.js puro)
|
|
115
|
+
|
|
116
|
+
Rodar um programa Delégua diretamente pelo terminal (`delegua meu-programa.delegua`) cai no **fallback `InfraestruturaVazia`**: o programa executa sem erros, mas nenhuma janela é exibida. Isso é esperado — Node.js não tem DOM.
|
|
117
|
+
|
|
118
|
+
#### Dentro do VS Code (extensão Delégua)
|
|
119
|
+
|
|
120
|
+
A extensão Delégua para VS Code pode exibir a janela em um painel nativo chamando `definirFabricaPainelWebView()` antes de executar o programa:
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
import { definirFabricaPainelWebView } from '@designliquido/delegua-node';
|
|
124
|
+
|
|
125
|
+
// no método activate() da extensão:
|
|
126
|
+
definirFabricaPainelWebView(() =>
|
|
127
|
+
vscode.window.createWebviewPanel(
|
|
128
|
+
'delegua-interface-grafica',
|
|
129
|
+
'Interface Gráfica – Delégua',
|
|
130
|
+
vscode.ViewColumn.One,
|
|
131
|
+
{ enableScripts: true }
|
|
132
|
+
)
|
|
133
|
+
);
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Com isso, `ig.iniciar()` abre um painel dentro do próprio VS Code e todos os eventos (cliques, alterações de texto) funcionam normalmente.
|
|
137
|
+
|
|
138
|
+
#### Processo renderer do Electron
|
|
139
|
+
|
|
140
|
+
Se o programa Delégua for executado diretamente dentro de um processo renderer Electron (onde `document` está disponível), `InfraestruturaElectron` é selecionada automaticamente e a janela é renderizada como um overlay DOM sobre a página existente.
|
|
62
141
|
|
|
63
142
|
Para usar uma infraestrutura diferente (ou criar a sua própria), implemente `InfraestruturaGraficaInterface` e passe a instância ao construtor de `InterfaceGrafica`:
|
|
64
143
|
|
|
@@ -72,6 +151,155 @@ class MinhaInfraestrutura implements InfraestruturaGraficaInterface {
|
|
|
72
151
|
const ig = new InterfaceGrafica(new MinhaInfraestrutura());
|
|
73
152
|
```
|
|
74
153
|
|
|
154
|
+
### Selecionando backend Java Swing por variáveis de ambiente
|
|
155
|
+
|
|
156
|
+
O módulo `DeleguaModuloInterfaceGrafica` pode inicializar o backend Swing automaticamente quando a variável abaixo estiver definida:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
DELEGUA_INTERFACE_GRAFICA_BACKEND=java-swing
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Variáveis opcionais para o host Swing:
|
|
163
|
+
|
|
164
|
+
- `DELEGUA_INTERFACE_GRAFICA_SWING_COMANDO` (padrão: `java`)
|
|
165
|
+
- `DELEGUA_INTERFACE_GRAFICA_SWING_ARGUMENTOS` (padrão: `-jar delegua-interface-grafica-swing-host.jar`)
|
|
166
|
+
- `DELEGUA_INTERFACE_GRAFICA_SWING_JAR` (atalho para montar automaticamente `-jar <caminho>` quando `DELEGUA_INTERFACE_GRAFICA_SWING_ARGUMENTOS` não estiver definido)
|
|
167
|
+
- `DELEGUA_INTERFACE_GRAFICA_SWING_CWD` (diretório de trabalho para o processo)
|
|
168
|
+
|
|
169
|
+
Se o backend Swing falhar ao iniciar, a biblioteca faz fallback automático para `InfraestruturaVazia` com aviso em `console.warn`.
|
|
170
|
+
|
|
171
|
+
### Selecionando backend GTK por variáveis de ambiente
|
|
172
|
+
|
|
173
|
+
O módulo `DeleguaModuloInterfaceGrafica` pode inicializar o backend GTK automaticamente quando:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
DELEGUA_INTERFACE_GRAFICA_BACKEND=gtk
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Variáveis opcionais para o host GTK:
|
|
180
|
+
|
|
181
|
+
- `DELEGUA_INTERFACE_GRAFICA_GTK_COMANDO` (padrão: `delegua-interface-grafica-gtk-host`)
|
|
182
|
+
- `DELEGUA_INTERFACE_GRAFICA_GTK_ARGUMENTOS` (argumentos separados por espaço)
|
|
183
|
+
- `DELEGUA_INTERFACE_GRAFICA_GTK_CWD` (diretório de trabalho para o processo)
|
|
184
|
+
|
|
185
|
+
Se o backend GTK falhar ao iniciar, a biblioteca faz fallback automático para `InfraestruturaVazia` com aviso em `console.warn`.
|
|
186
|
+
|
|
187
|
+
### Selecionando backend Windows por variáveis de ambiente
|
|
188
|
+
|
|
189
|
+
O módulo `DeleguaModuloInterfaceGrafica` pode inicializar o backend Windows automaticamente quando:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
DELEGUA_INTERFACE_GRAFICA_BACKEND=windows
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Variáveis opcionais para o host Windows:
|
|
196
|
+
|
|
197
|
+
- `DELEGUA_INTERFACE_GRAFICA_WINDOWS_COMANDO` (padrão: `delegua-interface-grafica-windows-host.exe`)
|
|
198
|
+
- `DELEGUA_INTERFACE_GRAFICA_WINDOWS_ARGUMENTOS` (argumentos separados por espaço)
|
|
199
|
+
- `DELEGUA_INTERFACE_GRAFICA_WINDOWS_CWD` (diretório de trabalho para o processo)
|
|
200
|
+
|
|
201
|
+
Se o backend Windows falhar ao iniciar, a biblioteca faz fallback automático para `InfraestruturaVazia` com aviso em `console.warn`.
|
|
202
|
+
|
|
203
|
+
### Protocolo do host externo
|
|
204
|
+
|
|
205
|
+
A especificação do protocolo de mensagens entre TypeScript e hosts externos está em:
|
|
206
|
+
|
|
207
|
+
- `docs/protocolo-processo-externo-v1.md`
|
|
208
|
+
|
|
209
|
+
Um esqueleto inicial do host Java Swing foi adicionado em:
|
|
210
|
+
|
|
211
|
+
- `host-java-swing/`
|
|
212
|
+
|
|
213
|
+
Um esqueleto inicial do host GTK foi adicionado em:
|
|
214
|
+
|
|
215
|
+
- `host-gtk/`
|
|
216
|
+
|
|
217
|
+
Um esqueleto inicial do host Windows foi adicionado em:
|
|
218
|
+
|
|
219
|
+
- `host-windows/`
|
|
220
|
+
|
|
221
|
+
Um esqueleto inicial do host macOS foi adicionado em:
|
|
222
|
+
|
|
223
|
+
- `host-macos/`
|
|
224
|
+
|
|
225
|
+
### Teste E2E opcional com host Java real
|
|
226
|
+
|
|
227
|
+
Por padrão, os testes E2E de Swing ficam desativados para não depender de Java/JAR em todos os ambientes.
|
|
228
|
+
|
|
229
|
+
Para executar:
|
|
230
|
+
|
|
231
|
+
1. Gere o JAR do host Java Swing.
|
|
232
|
+
2. Defina as variáveis de ambiente:
|
|
233
|
+
- `DELEGUA_SWING_E2E=1`
|
|
234
|
+
- `DELEGUA_SWING_E2E_JAR=<caminho-absoluto-do-jar>`
|
|
235
|
+
- opcional: `DELEGUA_SWING_E2E_COMANDO=java`
|
|
236
|
+
3. Rode `yarn testes-unitarios`.
|
|
237
|
+
|
|
238
|
+
O teste E2E está em `testes/infraestrutura-java-swing-e2e.test.ts`.
|
|
239
|
+
|
|
240
|
+
Esse teste agora também cobre `caixaLivre`, `definirPosicao()` e `definirTamanho()`.
|
|
241
|
+
|
|
242
|
+
Alternativa automatizada (compila host + roda E2E):
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
yarn testes-e2e-java-swing
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Requisitos para esse comando:
|
|
249
|
+
|
|
250
|
+
- Gradle instalado no ambiente, ou
|
|
251
|
+
- `gradlew`/`gradlew.bat` presente em `host-java-swing/`.
|
|
252
|
+
|
|
253
|
+
Opcionalmente, personalize o comando Gradle com `DELEGUA_SWING_E2E_GRADLE_CMD`.
|
|
254
|
+
|
|
255
|
+
### Teste E2E opcional com host GTK real
|
|
256
|
+
|
|
257
|
+
Por padrão, os testes E2E de GTK ficam desativados para não depender de Rust + GTK nativo em todos os ambientes.
|
|
258
|
+
|
|
259
|
+
Para executar manualmente:
|
|
260
|
+
|
|
261
|
+
1. Compile o host GTK.
|
|
262
|
+
2. Defina as variáveis de ambiente:
|
|
263
|
+
- `DELEGUA_GTK_E2E=1`
|
|
264
|
+
- `DELEGUA_GTK_E2E_CMD=<caminho-absoluto-do-executavel>`
|
|
265
|
+
3. Rode `yarn testes-unitarios`.
|
|
266
|
+
|
|
267
|
+
O teste E2E está em `testes/infraestrutura-gtk-e2e.test.ts`.
|
|
268
|
+
|
|
269
|
+
Esse teste agora também cobre `caixaLivre`, `definirPosicao()` e `definirTamanho()`.
|
|
270
|
+
|
|
271
|
+
Alternativa automatizada (compila host + roda E2E):
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
yarn testes-e2e-gtk
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Opcionalmente, personalize o comando cargo com `DELEGUA_GTK_E2E_CARGO_CMD`.
|
|
278
|
+
|
|
279
|
+
### Teste E2E opcional com host Windows real
|
|
280
|
+
|
|
281
|
+
Por padrão, os testes E2E de Windows ficam desativados para não depender de .NET/host nativo em todos os ambientes.
|
|
282
|
+
|
|
283
|
+
Para executar manualmente:
|
|
284
|
+
|
|
285
|
+
1. Publique o host Windows.
|
|
286
|
+
2. Defina as variáveis de ambiente:
|
|
287
|
+
- `DELEGUA_WINDOWS_E2E=1`
|
|
288
|
+
- `DELEGUA_WINDOWS_E2E_EXE=<caminho-absoluto-do-executavel>`
|
|
289
|
+
3. Rode `yarn testes-unitarios`.
|
|
290
|
+
|
|
291
|
+
O teste E2E está em `testes/infraestrutura-windows-e2e.test.ts`.
|
|
292
|
+
|
|
293
|
+
Esse teste agora também cobre `caixaLivre`, `definirPosicao()` e `definirTamanho()`.
|
|
294
|
+
|
|
295
|
+
Alternativa automatizada (publica host + roda E2E):
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
yarn testes-e2e-windows
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
Opcionalmente, personalize o comando .NET com `DELEGUA_WINDOWS_E2E_DOTNET_CMD`.
|
|
302
|
+
|
|
75
303
|
## Desenvolvimento
|
|
76
304
|
|
|
77
305
|
```bash
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
export declare const DeleguaModuloInterfaceGrafica: {
|
|
2
|
+
janela: {
|
|
3
|
+
tipoRetorno: string;
|
|
4
|
+
funcao: any;
|
|
5
|
+
argumentos: {
|
|
6
|
+
nome: string;
|
|
7
|
+
tipo: string;
|
|
8
|
+
}[];
|
|
9
|
+
documentacao: string;
|
|
10
|
+
exemploCodigo: string;
|
|
11
|
+
};
|
|
12
|
+
botao: {
|
|
13
|
+
tipoRetorno: string;
|
|
14
|
+
funcao: any;
|
|
15
|
+
argumentos: {
|
|
16
|
+
nome: string;
|
|
17
|
+
tipo: string;
|
|
18
|
+
}[];
|
|
19
|
+
documentacao: string;
|
|
20
|
+
exemploCodigo: string;
|
|
21
|
+
};
|
|
22
|
+
rotulo: {
|
|
23
|
+
tipoRetorno: string;
|
|
24
|
+
funcao: any;
|
|
25
|
+
argumentos: {
|
|
26
|
+
nome: string;
|
|
27
|
+
tipo: string;
|
|
28
|
+
}[];
|
|
29
|
+
documentacao: string;
|
|
30
|
+
exemploCodigo: string;
|
|
31
|
+
};
|
|
32
|
+
caixaTexto: {
|
|
33
|
+
tipoRetorno: string;
|
|
34
|
+
funcao: any;
|
|
35
|
+
argumentos: ({
|
|
36
|
+
nome: string;
|
|
37
|
+
tipo: string;
|
|
38
|
+
opcional?: undefined;
|
|
39
|
+
valorPadrao?: undefined;
|
|
40
|
+
} | {
|
|
41
|
+
nome: string;
|
|
42
|
+
tipo: string;
|
|
43
|
+
opcional: boolean;
|
|
44
|
+
valorPadrao: string;
|
|
45
|
+
})[];
|
|
46
|
+
documentacao: string;
|
|
47
|
+
exemploCodigo: string;
|
|
48
|
+
};
|
|
49
|
+
caixaVertical: {
|
|
50
|
+
tipoRetorno: string;
|
|
51
|
+
funcao: any;
|
|
52
|
+
argumentos: {
|
|
53
|
+
nome: string;
|
|
54
|
+
tipo: string;
|
|
55
|
+
}[];
|
|
56
|
+
documentacao: string;
|
|
57
|
+
exemploCodigo: string;
|
|
58
|
+
};
|
|
59
|
+
caixaHorizontal: {
|
|
60
|
+
tipoRetorno: string;
|
|
61
|
+
funcao: any;
|
|
62
|
+
argumentos: {
|
|
63
|
+
nome: string;
|
|
64
|
+
tipo: string;
|
|
65
|
+
}[];
|
|
66
|
+
documentacao: string;
|
|
67
|
+
exemploCodigo: string;
|
|
68
|
+
};
|
|
69
|
+
caixaLivre: {
|
|
70
|
+
tipoRetorno: string;
|
|
71
|
+
funcao: any;
|
|
72
|
+
argumentos: {
|
|
73
|
+
nome: string;
|
|
74
|
+
tipo: string;
|
|
75
|
+
}[];
|
|
76
|
+
documentacao: string;
|
|
77
|
+
exemploCodigo: string;
|
|
78
|
+
};
|
|
79
|
+
definirTexto: {
|
|
80
|
+
tipoRetorno: string;
|
|
81
|
+
funcao: any;
|
|
82
|
+
argumentos: {
|
|
83
|
+
nome: string;
|
|
84
|
+
tipo: string;
|
|
85
|
+
}[];
|
|
86
|
+
documentacao: string;
|
|
87
|
+
exemploCodigo: string;
|
|
88
|
+
};
|
|
89
|
+
obterTexto: {
|
|
90
|
+
tipoRetorno: string;
|
|
91
|
+
funcao: any;
|
|
92
|
+
argumentos: {
|
|
93
|
+
nome: string;
|
|
94
|
+
tipo: string;
|
|
95
|
+
}[];
|
|
96
|
+
documentacao: string;
|
|
97
|
+
exemploCodigo: string;
|
|
98
|
+
};
|
|
99
|
+
definirPosicao: {
|
|
100
|
+
tipoRetorno: string;
|
|
101
|
+
funcao: any;
|
|
102
|
+
argumentos: {
|
|
103
|
+
nome: string;
|
|
104
|
+
tipo: string;
|
|
105
|
+
}[];
|
|
106
|
+
documentacao: string;
|
|
107
|
+
exemploCodigo: string;
|
|
108
|
+
};
|
|
109
|
+
definirTamanho: {
|
|
110
|
+
tipoRetorno: string;
|
|
111
|
+
funcao: any;
|
|
112
|
+
argumentos: {
|
|
113
|
+
nome: string;
|
|
114
|
+
tipo: string;
|
|
115
|
+
}[];
|
|
116
|
+
documentacao: string;
|
|
117
|
+
exemploCodigo: string;
|
|
118
|
+
};
|
|
119
|
+
aoClicar: {
|
|
120
|
+
tipoRetorno: string;
|
|
121
|
+
funcao: any;
|
|
122
|
+
argumentos: {
|
|
123
|
+
nome: string;
|
|
124
|
+
tipo: string;
|
|
125
|
+
}[];
|
|
126
|
+
documentacao: string;
|
|
127
|
+
exemploCodigo: string;
|
|
128
|
+
};
|
|
129
|
+
aoAlterar: {
|
|
130
|
+
tipoRetorno: string;
|
|
131
|
+
funcao: any;
|
|
132
|
+
argumentos: {
|
|
133
|
+
nome: string;
|
|
134
|
+
tipo: string;
|
|
135
|
+
}[];
|
|
136
|
+
documentacao: string;
|
|
137
|
+
exemploCodigo: string;
|
|
138
|
+
};
|
|
139
|
+
iniciar: {
|
|
140
|
+
tipoRetorno: string;
|
|
141
|
+
funcao: any;
|
|
142
|
+
argumentos: any[];
|
|
143
|
+
documentacao: string;
|
|
144
|
+
exemploCodigo: string;
|
|
145
|
+
};
|
|
146
|
+
encerrar: {
|
|
147
|
+
tipoRetorno: string;
|
|
148
|
+
funcao: any;
|
|
149
|
+
argumentos: any[];
|
|
150
|
+
documentacao: string;
|
|
151
|
+
exemploCodigo: string;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
//# sourceMappingURL=delegua-modulo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegua-modulo.d.ts","sourceRoot":"","sources":["../fontes/delegua-modulo.ts"],"names":[],"mappings":"AA8HA,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkSzC,CAAC"}
|