mirror of
https://github.com/zlgopen/awtk.git
synced 2025-05-08 19:44:45 +08:00
improve for qnx
This commit is contained in:
parent
8614a30b6b
commit
78ecaabb50
@ -86,6 +86,8 @@ typedef unsigned long uintptr_t;
|
||||
#define SDL_FILESYSTEM_DUMMY 1
|
||||
|
||||
/* Enable the dummy filesystem driver (src/audio/alsa/\*.c) */
|
||||
#ifndef SDL_AUDIO_DRIVER_DUMMY
|
||||
#define SDL_AUDIO_DRIVER_ALSA 1
|
||||
#endif/*SDL_AUDIO_DRIVER_DUMMY*/
|
||||
|
||||
#endif /* SDL_config_minimal_h_ */
|
||||
|
@ -5245,6 +5245,7 @@ History:
|
||||
#endif /* !HAVE_MALLOC */
|
||||
|
||||
#ifdef HAVE_MALLOC
|
||||
#include <stdlib.h>
|
||||
#define real_malloc malloc
|
||||
#define real_calloc calloc
|
||||
#define real_realloc realloc
|
||||
|
@ -21,9 +21,14 @@
|
||||
#include "../../SDL_internal.h"
|
||||
#include "../SDL_sysvideo.h"
|
||||
#include "sdl_qnx.h"
|
||||
#include "SDL_events.h"
|
||||
#include "../../events/SDL_events_c.h"
|
||||
#include "../../events/SDL_mouse_c.h"
|
||||
#include "../../events/SDL_touch_c.h"
|
||||
|
||||
static screen_context_t context;
|
||||
static screen_event_t event;
|
||||
static int prev_pressed = 0;
|
||||
|
||||
/**
|
||||
* Initializes the QNX video plugin.
|
||||
@ -52,6 +57,7 @@ videoInit(_THIS)
|
||||
}
|
||||
|
||||
_this->num_displays = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -211,6 +217,9 @@ static void
|
||||
pumpEvents(_THIS)
|
||||
{
|
||||
int type;
|
||||
int val; /* used for simple property queries */
|
||||
int pair[2]; /* used to query pos, size */
|
||||
screen_event_t screen_ev;
|
||||
|
||||
for (;;) {
|
||||
if (screen_get_event(context, event, 0) < 0) {
|
||||
@ -226,11 +235,33 @@ pumpEvents(_THIS)
|
||||
break;
|
||||
}
|
||||
|
||||
screen_ev = event;
|
||||
switch (type) {
|
||||
case SCREEN_EVENT_KEYBOARD:
|
||||
handleKeyboardEvent(event);
|
||||
break;
|
||||
case SCREEN_EVENT_POINTER: {
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int pressed = 0;
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
screen_get_event_property_iv(screen_ev, SCREEN_PROPERTY_DEVICE, &val);
|
||||
screen_get_event_property_iv(screen_ev, SCREEN_PROPERTY_POSITION, pair);
|
||||
x = pair[0];
|
||||
y = pair[1];
|
||||
screen_get_event_property_iv(screen_ev, SCREEN_PROPERTY_DISPLACEMENT, pair);
|
||||
pressed = val;
|
||||
screen_get_event_property_iv(screen_ev, SCREEN_PROPERTY_MOUSE_HORIZONTAL_WHEEL, &val);
|
||||
screen_get_event_property_iv(screen_ev, SCREEN_PROPERTY_MOUSE_WHEEL, &val);
|
||||
|
||||
if (prev_pressed == pressed) {
|
||||
SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 0, x, y);
|
||||
} else {
|
||||
prev_pressed = pressed;
|
||||
SDL_SendMouseButton(mouse->focus, mouse->mouseID, pressed ? SDL_PRESSED : SDL_RELEASED, 1);
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -269,6 +300,7 @@ showWindow(_THIS, SDL_Window *window)
|
||||
|
||||
screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_VISIBLE,
|
||||
&visible);
|
||||
SDL_SetMouseFocus(window);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -284,6 +316,7 @@ hideWindow(_THIS, SDL_Window *window)
|
||||
|
||||
screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_VISIBLE,
|
||||
&visible);
|
||||
SDL_SetMouseFocus(NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
1
3rd/mbedtls/3rdparty/.gitignore
vendored
1
3rd/mbedtls/3rdparty/.gitignore
vendored
@ -1 +1,2 @@
|
||||
/Makefile
|
||||
/build/
|
||||
|
1
3rd/mbedtls/3rdparty/everest/.gitignore
vendored
1
3rd/mbedtls/3rdparty/everest/.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
*.o
|
||||
Makefile
|
||||
/build/
|
||||
|
1
3rd/mbedtls/include/.gitignore
vendored
1
3rd/mbedtls/include/.gitignore
vendored
@ -2,3 +2,4 @@ Makefile
|
||||
*.sln
|
||||
*.vcxproj
|
||||
mbedtls/check_config
|
||||
/build/
|
||||
|
1
3rd/mbedtls/library/.gitignore
vendored
1
3rd/mbedtls/library/.gitignore
vendored
@ -2,3 +2,4 @@
|
||||
libmbed*
|
||||
*.sln
|
||||
*.vcxproj
|
||||
/build/
|
||||
|
@ -1,5 +1,7 @@
|
||||
# 最新动态
|
||||
|
||||
2025/01/11
|
||||
* improve for qnx
|
||||
2025/01/08
|
||||
* 修改定义WITH_LCD_MONO宏的时候会链接到SDL的文件(感谢智明提供补丁)
|
||||
* 完善 draggable_create(感谢俊杰发现问题)
|
||||
|
@ -185,7 +185,6 @@ static SDL_HitTestResult hit_test_imp(SDL_Window* window, const SDL_Point* pt, v
|
||||
static ret_t native_window_sdl_set_window_hit_test(native_window_t* win, xy_t x, xy_t y, wh_t w,
|
||||
wh_t h) {
|
||||
native_window_sdl_t* sdl = NATIVE_WINDOW_SDL(win);
|
||||
SDL_Rect area = {x, y, w, h};
|
||||
|
||||
sdl->hit_test_rect.x = x;
|
||||
sdl->hit_test_rect.y = x;
|
||||
@ -691,7 +690,11 @@ ret_t native_window_sdl_init(bool_t shared, uint32_t w, uint32_t h) {
|
||||
|
||||
SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1");
|
||||
SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1");
|
||||
#if defined(SDL_AUDIO_DISABLED)
|
||||
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS) != 0) {
|
||||
#else
|
||||
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS | SDL_INIT_AUDIO) != 0) {
|
||||
#endif /*SDL_AUDIO_DISABLED*/
|
||||
log_debug("Failed to initialize SDL: %s", SDL_GetError());
|
||||
exit(0);
|
||||
return RET_FAIL;
|
||||
|
@ -169,10 +169,16 @@ static ret_t fs_os_dir_read(fs_dir_t* dir, fs_item_t* item) {
|
||||
|
||||
memset(item, 0x00, sizeof(fs_item_t));
|
||||
if (ent != NULL) {
|
||||
#ifdef QNX
|
||||
/*FIXME*/
|
||||
item->is_reg_file = 1;
|
||||
#else
|
||||
uint8_t type = ent->d_type;
|
||||
item->is_dir = (type & DT_DIR) != 0;
|
||||
item->is_link = (type & DT_LNK) != 0;
|
||||
item->is_reg_file = (type & DT_REG) != 0;
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
str_t str;
|
||||
str_init(&str, wcslen(ent->d_name) * 4 + 1);
|
||||
|
@ -22,7 +22,6 @@
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#endif /*WIN32_LEAN_AND_MEAN*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "tkc/socket_helper.h"
|
||||
#include "streams/inet/istream_udp.h"
|
||||
|
@ -535,14 +535,19 @@ ret_t serial_wait_for_data(serial_handle_t handle, uint32_t timeout_ms) {
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/signal.h>
|
||||
#include <errno.h>
|
||||
#include <paths.h>
|
||||
#include <sysexits.h>
|
||||
#include <termios.h>
|
||||
#include <sys/param.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#ifndef QNX
|
||||
#include <sysexits.h>
|
||||
#include <sys/signal.h>
|
||||
#else
|
||||
#include <signal.h>
|
||||
#endif/*QNX*/
|
||||
|
||||
#if defined(__linux__)
|
||||
#include <linux/serial.h>
|
||||
#endif
|
||||
@ -934,6 +939,7 @@ ret_t serial_config(serial_handle_t handle, uint32_t baudrate, bytesize_t bytesi
|
||||
options.c_cflag |= (CNEW_RTSCTS);
|
||||
else
|
||||
options.c_cflag &= (unsigned long)~(CNEW_RTSCTS);
|
||||
#elif defined(QNX)
|
||||
#else
|
||||
#error "OS Support seems wrong."
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user