mirror of
https://github.com/wavetermdev/wails.git
synced 2026-04-22 15:26:15 -07:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d8e7df4226 | |||
| b83b386169 | |||
| a0503653ac | |||
| 7895cc8675 | |||
| abf5d3256c | |||
| 0a3d94988f | |||
| 1968630e6d | |||
| 1d4b74ef27 | |||
| 61e6ce81aa | |||
| 00020e165f | |||
| 31bb5b0460 | |||
| 4052c20f12 | |||
| dbb37e4ab5 | |||
| 09f86fd066 | |||
| 615ba63e56 | |||
| 13005bd116 | |||
| 66d2dce2e6 |
@@ -1,10 +1,11 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
//go:build linux && !qt
|
||||
// +build linux,!qt
|
||||
|
||||
package desktop
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/wailsapp/wails/v2/internal/binding"
|
||||
"github.com/wailsapp/wails/v2/internal/frontend"
|
||||
"github.com/wailsapp/wails/v2/internal/frontend/desktop/linux"
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
//go:build qt
|
||||
// +build qt
|
||||
|
||||
package desktop
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/wailsapp/wails/v2/internal/binding"
|
||||
"github.com/wailsapp/wails/v2/internal/frontend"
|
||||
"github.com/wailsapp/wails/v2/internal/frontend/desktop/qt"
|
||||
"github.com/wailsapp/wails/v2/internal/logger"
|
||||
"github.com/wailsapp/wails/v2/pkg/options"
|
||||
)
|
||||
|
||||
func NewFrontend(ctx context.Context, appoptions *options.App, logger *logger.Logger, appBindings *binding.Bindings, dispatcher frontend.Dispatcher) frontend.Frontend {
|
||||
return qt.NewFrontend(ctx, appoptions, logger, appBindings, dispatcher)
|
||||
}
|
||||
+2
-1
@@ -4,8 +4,9 @@
|
||||
package linux
|
||||
|
||||
import (
|
||||
"github.com/wailsapp/wails/v2/internal/frontend"
|
||||
"unsafe"
|
||||
|
||||
"github.com/wailsapp/wails/v2/internal/frontend"
|
||||
)
|
||||
|
||||
/*
|
||||
-1
@@ -105,7 +105,6 @@ const startURL = "wails://wails/"
|
||||
var secondInstanceBuffer = make(chan options.SecondInstanceData, 1)
|
||||
|
||||
type Frontend struct {
|
||||
|
||||
// Context
|
||||
ctx context.Context
|
||||
|
||||
+5
-2
@@ -32,8 +32,11 @@ void addAccelerator(GtkWidget* menuItem, GtkAccelGroup* group, guint key, GdkMod
|
||||
}
|
||||
*/
|
||||
import "C"
|
||||
import "github.com/wailsapp/wails/v2/pkg/menu"
|
||||
import "unsafe"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/wailsapp/wails/v2/pkg/menu"
|
||||
)
|
||||
|
||||
var menuIdCounter int
|
||||
var menuItemToId map[*menu.MenuItem]int
|
||||
+3
-2
@@ -5,10 +5,11 @@ package linux
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/godbus/dbus/v5"
|
||||
"github.com/wailsapp/wails/v2/pkg/options"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/godbus/dbus/v5"
|
||||
"github.com/wailsapp/wails/v2/pkg/options"
|
||||
)
|
||||
|
||||
type dbusHandler func(string)
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,79 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern void appExited(int code);
|
||||
|
||||
/* Application */
|
||||
void *Application_new(char *app_name);
|
||||
void Application_exec(void *app_ptr);
|
||||
void Application_quit(void *app_ptr);
|
||||
char *Application_get_screens(void *app_ptr); // Returns a json blob
|
||||
/* End Application */
|
||||
|
||||
/* Window */
|
||||
typedef struct Window {
|
||||
void *window;
|
||||
void *window_layout;
|
||||
void *web_engine_view;
|
||||
} Window;
|
||||
|
||||
typedef struct Point {
|
||||
int x;
|
||||
int y;
|
||||
} Point;
|
||||
|
||||
typedef struct RGBA {
|
||||
int r;
|
||||
int g;
|
||||
int b;
|
||||
int a;
|
||||
} RGBA;
|
||||
|
||||
Window *Window_new(void *app_ptr, char *start_url);
|
||||
void Window_set_title(void *win_ptr, char *title);
|
||||
void Window_resize(void *win_ptr, int width, int height);
|
||||
void Window_set_minimum_size(void *win_ptr, int width, int height);
|
||||
void Window_set_maximum_size(void *win_ptr, int width, int height);
|
||||
void Window_set_background_color(void *win_ptr, RGBA color);
|
||||
Point Window_get_size(void *win_ptr);
|
||||
void Window_hide(void *win_ptr);
|
||||
int Window_get_flags(void *win_ptr);
|
||||
void Window_set_flag(void *win_ptr, int flag, bool on);
|
||||
void Window_show(void *win_ptr);
|
||||
int Window_get_state(void *win_ptr);
|
||||
void Window_fullscreen(void *win_ptr);
|
||||
void Window_maximize(void *win_ptr);
|
||||
void Window_close(void *win_ptr);
|
||||
void Window_center(void *win_ptr);
|
||||
void Window_center(void *win_ptr);
|
||||
void Window_unminimize(void *win_ptr);
|
||||
Point Window_get_position(void *win_ptr);
|
||||
void Window_set_position(void *win_ptr, Point position);
|
||||
const char *Window_run_message_dialog(void *win_ptr, int dialog_type, char *title, char *message);
|
||||
const char *Window_open_file_dialog(void *win_ptr, bool isDirectory, bool isMultiple, bool isSave, char *dialog_options);
|
||||
/* End Window */
|
||||
|
||||
/* WebEngineView */
|
||||
void WebEngineView_load_url(void *web_engine_ptr, char *url);
|
||||
void WebEngineView_reload(void *web_engine_ptr);
|
||||
void WebEngineView_run_js(void *web_engine_ptr, char *script);
|
||||
void WebEngineView_print_page(void *web_engine_ptr);
|
||||
/* End WebEngineView */
|
||||
|
||||
/* Clipboard */
|
||||
const char *Clipboard_get_text(void *app_ptr);
|
||||
void Clipboard_set_text(void *app_ptr, char *text);
|
||||
/* End Clipboard */
|
||||
|
||||
void fix_signal(int signum);
|
||||
void install_signal_handlers();
|
||||
|
||||
void cfree(void* ptr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user