Compare commits

..
212 Commits
Author SHA1 Message Date
Vincent Wei 70535c6cb4 new surface pixel format for main window: ST_PIXEL_XRGB565 2021-05-19 11:14:05 +08:00
Vincent Wei 4013dbf70a fix a compilation error 2021-05-19 08:49:38 +08:00
Vincent Wei b288e29eef tune links 2021-05-18 09:37:08 +08:00
Vincent Wei 871a99e22b upgrade Doxygen files 2021-05-18 08:37:31 +08:00
Vincent Wei a965f1023c fix a bug 2021-05-12 09:09:31 +08:00
Vincent Wei a6af326b48 return -1 for INV_GLYPH_VALUE in GetGlyphInfo 2021-05-11 11:18:20 +08:00
Vincent Wei 754b8f3014 Enhance GetGlyphInfo to return the FreeType face, font file path, and glyph index 2021-05-11 10:41:54 +08:00
Vincent Wei a85386499e remove unused valid field 2021-05-11 10:41:46 +08:00
Vincent Wei fe48d1cc64 tune release notes for 5.0.6 2021-05-11 09:43:58 +08:00
Vincent Wei c1aab8bf69 make compositing schema enabled by default 2021-05-11 09:42:32 +08:00
Vincent Wei 65d8a31a35 tune format 2021-05-10 08:39:07 +08:00
Vincent Wei e97ae8bcdb tune 2021-05-06 20:29:57 +08:00
Vincent Wei 883410eb14 tune readme 2021-05-06 20:29:08 +08:00
Vincent Wei 0cb72162e4 tune readme 2021-05-06 19:57:09 +08:00
Vincent Wei 2cb6c4bc9c tune readme 2021-05-06 19:55:04 +08:00
Vincent Wei 5b111d3300 tune readme 2021-05-06 19:51:26 +08:00
Vincent Wei 820689f5f9 tune readme 2021-05-06 19:48:18 +08:00
Vincent Wei 2ae51d70fb tune readme 2021-05-06 19:46:13 +08:00
Vincent Wei 86158f938d fix bad definition of COLOR_BLEND_FLAGS_MASK 2021-05-05 22:08:09 +08:00
Vincent Wei 3f99c7b960 fix conditional compilation errors 2021-05-05 20:53:56 +08:00
Vincent Wei b266bd8e0a fix conditional compilation errors 2021-05-05 20:41:09 +08:00
Vincent Wei f6d25f58aa use 0000 for umask to allow a general process can open the named semaphore 2021-05-05 19:54:01 +08:00
Vincent Wei ccbccc2020 use named semaphore for update lock for drm engine 2021-05-05 19:35:18 +08:00
Vincent Wei 736193d355 use update lock (semaphore) for sharedfb schema under MiniGUI-Processes 2021-05-05 18:42:21 +08:00
Vincent Wei 47e32a812e cleanup 2021-05-05 18:04:04 +08:00
Vincent Wei ac769be3cb fix a minor bug 2021-05-05 18:03:10 +08:00
Vincent Wei 4de7e09c22 Add MSG_WAKEUP_CLIENT to wake up a specific client 2021-05-05 16:43:52 +08:00
Vincent Wei e787c6fbde tune 2021-05-05 15:47:21 +08:00
Vincent Wei a0a0330a6c PixmanBlt only works when source surface and destination surface are not same 2021-05-05 15:25:55 +08:00
Vincent Wei 46854579be refactor use of pixman functions: use GAL_BlittingContext 2021-05-05 13:49:59 +08:00
Vincent Wei d31af448ff cleanup 2021-05-05 13:48:28 +08:00
Vincent Wei 91062be2ac define COLOR_BLEND_FIRST and COLOR_BLEND_LAST 2021-05-05 13:45:57 +08:00
Vincent Wei 6907dba86d use STRETCH_EXTRA_INFO instead of only rotation for StretchBltEx 2021-05-04 21:34:15 +08:00
Vincent Wei d4cadc47e0 use STRETCH_EXTRA_INFO instead of only rotation for StretchBltEx 2021-05-04 21:34:01 +08:00
Vincent Wei 0904ae5dc7 fix a compliation warning 2021-05-04 16:06:24 +08:00
Vincent Wei a431b2ae56 tune release notes 2021-05-04 16:04:46 +08:00
Vincent Wei 4c7e1bcecf disable debug output 2021-05-04 16:00:34 +08:00
Vincent Wei 7364a960bc implementation StretchBltEx; check validation of color blending method 2021-05-04 15:57:27 +08:00
Vincent Wei 77bb2f4433 New API: StretchBltEx; tune API description 2021-05-04 15:56:34 +08:00
Vincent Wei 75077509d6 tune 2021-05-04 10:33:02 +08:00
Vincent Wei 9ebf59e4ad pass correct src_x and src_y for pixman_image_composite32 2021-05-04 10:28:05 +08:00
Vincent Wei 20a50bc094 donot use clipping region for lower blitting 2021-05-04 10:27:02 +08:00
Vincent Wei 180bd4480f reset last_ticks 2021-05-04 10:26:34 +08:00
Vincent Wei 947ce61805 use clip region in GAL_PixmanBlit 2021-05-03 23:55:10 +08:00
Vincent Wei 270648fc73 use GAL_UpperBlit instead of GAL_BlitSurface 2021-05-03 23:54:22 +08:00
Vincent Wei 4ebd23bf56 use MSG_TIMEOUT instead of MSG_TIMER for desktop 2021-05-03 21:26:42 +08:00
Vincent Wei 0ea195a7a2 fix bug for pixman_image_composite32 2021-05-03 20:37:43 +08:00
Vincent Wei 5978175ef8 handle zero width/height for BitBlt and StretchBlt 2021-05-03 19:31:46 +08:00
Vincent Wei f8e144d1f2 tune 2021-05-03 19:17:44 +08:00
Vincent Wei 8c92b16d04 treat coordinates for BitBlt and StretchBlt as logical ones 2021-05-03 19:17:18 +08:00
Vincent Wei a9129c5772 set ct_arg to be 0 for CT_ALPHAPIXEL 2021-05-03 19:16:43 +08:00
Vincent Wei 72551be6b0 tune API description 2021-05-03 19:15:59 +08:00
Vincent Wei 7d4cf8a47d return void for GAL_SoftFillRect 2021-05-03 18:29:06 +08:00
Vincent Wei b967f2f18f ignore format with palette in translate_gal_format 2021-05-03 18:27:53 +08:00
Vincent Wei af3ff13513 fix bug when zoom in the source bits in PixmanStretchBlt 2021-04-30 18:57:51 +08:00
Vincent Wei d543f17606 use pixman to implement GAL_FillBox 2021-04-30 18:03:14 +08:00
Vincent Wei e3e79aaf86 optimize transite_to_layer: skip the next frame if it is too slow in each loop 2021-04-30 17:13:58 +08:00
Vincent Wei 44bb22925f fix another bug in GAL_StretchBltLegacy 2021-04-30 17:01:15 +08:00
Vincent Wei e88a3cd3d8 fix bugs of stretchblt 2021-04-30 16:55:51 +08:00
Vincent Wei 1340a8b81e fix a minor bug 2021-04-29 16:40:16 +08:00
Vincent Wei d07e797f92 use pixman to implement BitBlt and StretchBlt 2021-04-29 16:29:37 +08:00
Vincent Wei cdf4ca3612 fix wrong implementation of search_win_tree_bfs 2021-04-25 14:52:49 +08:00
Vincent Wei ac50ae71c4 fix a minor bug 2021-04-24 12:38:02 +08:00
Vincent Wei 88ec285dc5 implement StrecthBltHW and cleanup 2021-04-24 12:36:13 +08:00
Vincent Wei d5f637f206 set background mode to BM_OPAQUE before calling StretchBlt 2021-04-24 12:35:53 +08:00
Vincent Wei f35c63482f Declare TEST API: StrecthBltHW 2021-04-24 12:35:08 +08:00
Vincent Wei 940060c724 fix a bug of PCXVFB: do not enable SyncUpdate method for clients under compositing schema 2021-04-23 15:51:58 +08:00
Vincent Wei 2466167c93 fix bugs in StrechBlt 2021-04-23 15:29:48 +08:00
Vincent Wei 8e556e6ce1 call SetBkMode to restore the BkMode of HDC_SCREEN_SYS to opaque 2021-04-23 15:29:13 +08:00
Vincent Wei 9c44c1eccb tune 2021-04-20 18:17:57 +08:00
Vincent Wei 70aa7516fc update version to 5.0.6 2021-04-20 14:27:30 +08:00
Vincent Wei fcdeea30d9 update version to 5.0.6 2021-04-20 14:26:04 +08:00
Vincent Wei b4fb53b3c3 link to @DEP_LIBS@ 2021-04-20 11:38:04 +08:00
Vincent Wei 4e752a6f8b fix two bugs in fallback compositor 2021-04-15 12:26:23 +08:00
Vincent Wei a2183ed53a add FCM_SCALE to the fallback compositor 2021-04-15 10:04:46 +08:00
Vincent Wei 182f195a57 force to link -ldl for Linux 2021-04-07 15:47:49 +08:00
Vincent Wei a0214a2956 update release notes for version 5.0.6 2021-04-01 16:37:14 +08:00
Vincent Wei 51da6b7204 tune MAX_NR_LAYERS, DEF_NR_TOPMOSTS, and DEF_NR_NORMALS for procs 2021-04-01 15:46:49 +08:00
Vincent Wei 285a8e1101 Implement SetMainWindowGestureFlags and MSG_SETGESTUREFLAGS 2021-04-01 15:42:58 +08:00
Vincent Wei de315cf780 cleanup 2021-03-31 09:05:40 +08:00
Vincent Wei 7642ead8ce release notes for 5.0.6 2021-03-28 21:16:56 +08:00
Vincent Wei 666fba74cd optimize __mg_get_nr_idle_slots 2021-03-28 21:13:05 +08:00
Vincent Wei 4d1077b759 optimize __mg_lookfor_unused_slot 2021-03-28 20:54:56 +08:00
Vincent Wei 561b4c3ffc expose the struct of BLOCKHEAP 2021-03-28 20:54:14 +08:00
Vincent Wei f970fd377e call mg_TerminateCompositor in TerminateGUI 2021-03-28 19:37:53 +08:00
Vincent Wei 383d70b446 call mg_TerminateCompositor in TerminateGUI 2021-03-28 19:37:38 +08:00
Vincent Wei 82edb53d22 include blockheap.h 2021-03-28 19:37:08 +08:00
Vincent Wei bf127a3f4d Fix memory leaks 2021-03-28 19:36:50 +08:00
Vincent Wei c089adf2b7 Optimized the implementation of BlockHeap 2021-03-28 19:36:05 +08:00
Vincent Wei 6a5c9ba048 allocate more free cliprects for the server 2021-03-28 16:52:12 +08:00
Vincent Wei c9c55c74bf call SetRectEmpty on the dirty rect at the end of SyncUpdate 2021-03-28 16:51:23 +08:00
Vincent Wei 5f854d75c7 tune constants 2021-03-28 16:50:45 +08:00
Vincent Wei 3a3d77042a tune 2021-03-27 11:06:37 +08:00
Vincent Wei 49e714431a enhance composite_layers to support null layers 2021-03-27 11:04:44 +08:00
Vincent Wei f64680082c implement new API: ServerGetCurrentCompositor 2021-03-27 11:03:12 +08:00
Vincent Wei f3c1ea0bc4 always regenerate window region for visible window znode 2021-03-26 11:11:44 +08:00
Vincent Wei 31a2d3c185 fix a bug in ServerGetWinZNodeRegion 2021-03-26 11:01:41 +08:00
Vincent Wei 1621cb7bf5 cleanup 2021-03-26 11:01:23 +08:00
Vincent Wei 89fcfe3979 tune implementation of Tooltip Window 2021-03-26 11:01:06 +08:00
Vincent Wei 5dd702017f use malloc/free instead of mg_slice_alloc0/mg_slice_free; cleanup 2021-03-25 16:57:41 +08:00
Vincent Wei 0f1b251c91 adjust SIZE_CLIPRECTHEAP and SIZE_INVRECTHEAP 2021-03-25 16:57:07 +08:00
Vincent Wei 1fab00bf85 tune BLOCKHEAP structure 2021-03-25 16:56:43 +08:00
Vincent Wei c8fcbd1864 cleanup 2021-03-25 15:46:55 +08:00
Vincent Wei 7802d000fe fix bug in __mg_remove_all_znodes_of_client 2021-03-25 15:45:39 +08:00
Vincent Wei 9978a89991 tune code for potential memory leaks 2021-03-25 15:45:07 +08:00
Vincent Wei 87637f68dd optimize 2021-03-25 14:13:28 +08:00
Vincent Wei 727f4ad5c5 initial implementation of composite_layers 2021-03-25 12:02:00 +08:00
Vincent Wei 30f1488c5c use IS_TYPE_SPECIAL 2021-03-25 12:00:44 +08:00
Vincent Wei 28b04af4f5 add ZOF_IF_SPECIAL; add description for COMBPARAMS_FALLBACK 2021-03-25 12:00:19 +08:00
Vincent Wei 62cb29a435 a simple implementation of transite_to_layer and a blank implementation of composite_layers 2021-03-24 21:59:29 +08:00
Vincent Wei 86d6e12f9e tune operations of CompositorOps 2021-03-24 21:57:52 +08:00
Vincent Wei 30147e9e01 call __mg_sync_special_nodes for new layer 2021-03-24 19:22:05 +08:00
Vincent Wei a966689e88 pass zorder_info to dskSetActiveZOrderNode 2021-03-24 19:21:45 +08:00
Vincent Wei 42e1d5db2c pass zorder_info to dskSetActiveZOrderNode 2021-03-24 19:20:55 +08:00
Vincent Wei 877ed4c382 add old_active and next_active in ZORDERINFO; declare __mg_sync_special_nodes 2021-03-24 19:20:32 +08:00
Vincent Wei 5ccb57c19d fix deadlock buf in sync_special_nodes 2021-03-24 15:20:50 +08:00
Vincent Wei 80d03b2f6f fix bugs in __mg_do_change_topmost_layer 2021-03-24 15:20:23 +08:00
Vincent Wei b31d3860e6 change prototype of __mg_do_change_topmost_layer: change mgTopmostLayer in __mg_do_change_topmost_layer function 2021-03-24 15:19:05 +08:00
Vincent Wei 697177266b fix compilation errors 2021-03-24 12:28:23 +08:00
Vincent Wei 48b84e3100 enhance move_to_layer to handle failure of __mg_move_client_to_layer 2021-03-24 11:35:34 +08:00
Vincent Wei 27122b421d use mgDefaultLayer instead of mg_def_layer 2021-03-24 11:34:46 +08:00
Vincent Wei a305dd85da use sync_special_znodes when allocating or freeing a special znode 2021-03-24 11:34:06 +08:00
Vincent Wei 7bc4ae81dc use sync_special_znodes when change the topmost layer and remove a client 2021-03-24 11:33:30 +08:00
Vincent Wei 8675244823 tune macros: IS_TYPE_GENERAL and IS_TYPE_SPECIAL 2021-03-24 11:32:33 +08:00
Vincent Wei af7df5bcea change prototype of __mg_move_client_to_layer 2021-03-24 11:32:09 +08:00
Vincent Wei 0ceee74091 One client can be moved to another layer only if it has not any window 2021-03-24 11:31:38 +08:00
Vincent Wei 0b023c27de tune description of special znode levels 2021-03-24 11:30:18 +08:00
Vincent Wei e1ea9b7209 declare a new global variable: mgDefaultLayer; tune description of MoveToLayer and ServerMoveToLayer 2021-03-24 11:29:37 +08:00
Vincent Wei 9fa7401542 use mg_def_layer for the first layer 2021-03-23 21:03:38 +08:00
Vincent Wei df65816504 reset usage bitmp when removing special znodes 2021-03-23 21:03:02 +08:00
Vincent Wei 62bcaebe14 tune DEF_NR_TOOLTIPS and DEF_NR_MASKRECTS 2021-03-23 19:08:51 +08:00
Vincent Wei d88d508180 add def_zi_shmid in JOINEDCLIENTINFO 2021-03-23 19:08:25 +08:00
Vincent Wei 0178f28f66 init __mg_def_zorder_info; change the z-index of windows in __mg_client_on_layer_changed 2021-03-23 19:07:58 +08:00
Vincent Wei c226242d6d tune description of WS_EX_WINTYPE_TOOLTIP 2021-03-23 19:06:41 +08:00
Vincent Wei 9a09deee91 Tune ServerSetTopmostLayer 2021-03-23 11:40:34 +08:00
Vincent Wei 2190256165 disable def_paint_desktop for compositing schema; tune call of calc_mainwin_pos 2021-03-23 11:39:49 +08:00
Vincent Wei cdba9dbd17 implement __mg_prepare_layer_for_compositing and __mg_end_up_layer_for_compositing 2021-03-23 11:38:43 +08:00
Vincent Wei df3be3bde0 tune on_showing_win and on_hiding_win; implement on_layer_op for switch layers; tune calc_mainwin_pos for change of interface 2021-03-23 11:38:15 +08:00
Vincent Wei 4e43c9cfee declare __mg_prepare_layer_for_compositing and __mg_end_up_layer_for_compositing 2021-03-23 11:37:04 +08:00
Vincent Wei a2d733392f add client identifier argument for calc_mainwin_pos; add new methods: composite_with_layer and transit_to_layer 2021-03-23 11:36:39 +08:00
Vincent Wei 7a5ad30a92 change version to 5.0.6 2021-03-23 11:34:36 +08:00
Vincent Wei d894080582 fix bad Doxygen group name; 2021-03-22 16:00:50 +08:00
Vincent Wei 8bfc65f88f tune 2021-02-02 10:38:26 +08:00
Vincent Wei fbf02782a6 change version to 5.0.5 2021-01-04 10:34:26 +08:00
Vincent Wei 1e88954b79 adjust values of WS_XXX to avoid confilct 2021-01-04 10:34:14 +08:00
Vincent Wei 4e0cd74552 fix a bug of GetNextMainWindow 2020-12-15 17:02:16 +08:00
Vincent Wei 7530c4b5bd use non-blocking read and ignore EV_SYN 2020-11-10 20:34:47 +08:00
Vincent Wei b47d207bd2 fix a bug: misuse fdset in FD_SET and FD_ISSET 2020-11-10 19:49:21 +08:00
Vincent Wei 9ff29ccb94 do not return for EV_KEY 2020-11-10 18:52:44 +08:00
Vincent Wei 6da322ed49 cleanup 2020-11-10 18:32:16 +08:00
Vincent Wei 6e21fed525 tune 2020-11-10 18:28:30 +08:00
Vincent Wei 74747f383c use blocking reading 2020-11-10 18:12:35 +08:00
Vincent Wei bde7d74f02 break the loop for EV_KEY 2020-11-10 18:03:50 +08:00
Vincent Wei cdc818d936 use no blocking read 2020-11-10 17:53:00 +08:00
Vincent Wei 8694a342b9 tune 2020-11-10 17:49:18 +08:00
Vincent Wei dd9e59d82f cleanup 2020-11-10 17:28:03 +08:00
Vincent Wei 1b2b87d187 cleanup 2020-11-10 16:55:55 +08:00
Vincent Wei 36c1f15894 change version to 5.0.4 2020-11-10 16:21:56 +08:00
Vincent Wei c3877bad13 fix a compilation error: use #ifdef _MGSCHEMA_COMPOSITING 2020-11-10 16:10:48 +08:00
Vincent Wei a118a062ec use IAL_MOUSE_LEFTBUTTON instead of COMM_LBUTTON 2020-11-10 16:10:13 +08:00
Vincent Wei 5e34e98b28 fix a bug: save kbd_dev for suspend/resume 2020-11-10 16:02:28 +08:00
Vincent Wei 60ed1c9b3c Merge branch 'rel-5-0' of github.com:VincentWei/minigui into rel-5-0 2020-11-10 15:54:39 +08:00
Vincent Wei e148806743 Merge pull request #57 from ninexue/rel-5-0
Rel 5 0
2020-11-10 15:53:35 +08:00
xueshuming cd0dd795c8 add singletouchkey ial 2020-11-10 15:38:02 +08:00
xueshuming e6468d960c compile for aarch64-arm-gcc 7.5 2020-11-10 15:30:34 +08:00
Vincent Wei 219d72074d release notes for version 5.0.4 2020-11-10 11:17:31 +08:00
Vincent Wei 56779b033d tune comments 2020-11-10 11:12:20 +08:00
Vincent Wei 73dc293c76 new section for IAL engine singletouchkey 2020-11-10 11:06:46 +08:00
Vincent Wei abaee60a55 change version to 5.0.4; show includes for FreeType2 and HarfBuzz. 2020-10-19 10:41:16 +08:00
Vincent Wei 2b99ac28eb fix a potential bug: only increase nr_mask_rects for not empty mask rectangle 2020-10-13 08:15:57 +08:00
Vincent Wei f86fa9d483 fix bugs in ServerGetWinZNodeRegion: must check for possible empty mask rect; bad assignment of maskrect 2020-10-12 19:00:54 +08:00
Vincent Wei 529c78ef90 tune 2020-10-12 18:59:21 +08:00
Vincent Wei bc20a11744 use _ERR_PRINTF 2020-10-12 17:57:52 +08:00
Vincent Wei 6a2f28543d bugfixing: update surface of controls surface in travel_children_with_priv_cdc 2020-10-12 17:26:22 +08:00
Vincent Wei 79c9e16ddb update TOC 2020-09-30 08:51:55 +08:00
Vincent Wei bb62e1ff45 release nots for version 5.0.3 2020-09-30 08:16:07 +08:00
Vincent Wei 95ac2ecfce tune 2020-09-29 17:26:56 +08:00
Vincent Wei 7baf414d73 enable use_shmopen only for Linux 2020-09-29 17:26:44 +08:00
Vincent Wei 70255521f8 Merge pull request #50 from ehello/rel-5-0
chw 's change
2020-09-29 17:15:04 +08:00
Vincent Wei 3dce463697 Merge branch 'rel-5-0' into rel-5-0 2020-09-29 17:12:40 +08:00
chw 43f126635c chw 's change 2020-09-29 14:55:22 +08:00
Vincent Wei c31c970e88 rebuil the private data for all visible z-nodes after selected a new compositor 2020-09-21 08:34:34 +08:00
Vincent Wei 8dcb3349c7 always check expired timers even got EINTR 2020-09-21 08:33:34 +08:00
Vincent Wei b03bc62fef change version to 5.0.3 2020-09-21 08:33:01 +08:00
Vincent Wei a8b46e9e9c add static modifier to refresh_dirty_region method 2020-09-20 15:32:16 +08:00
Vincent Wei 4541934bd5 declare ZNOP_ICONCHANGED for future use 2020-09-07 10:30:44 +08:00
gengyue fa2382c0de modified for ServerGetTopmostZNodeOfType 2020-09-06 11:11:13 +08:00
Vincent Wei 5944085555 return client identifier if ok 2020-09-06 09:48:24 +08:00
Vincent Wei 97f4215330 add new API ServerGetTopmostZNodeOfType and implement it 2020-09-06 09:44:31 +08:00
Vincent Wei 1d81705437 add --enable-mgslicefallback 2020-08-12 20:33:35 +08:00
Vincent Wei 2f48b9df05 initial commit 2020-08-12 20:33:04 +08:00
Vincent Wei 5541ad971d #error for freertos in __mg_os_get_random_seed 2020-08-12 20:32:52 +08:00
Vincent Wei 8d4ced06d6 fix a bug of allocate_more_fd_slots 2020-08-12 20:32:12 +08:00
Vincent Wei 07ba1c50b9 make exectable 2020-08-12 18:46:23 +08:00
Vincent Wei 2f97ddc0a2 tune to use the macro HAVE_ACCESS, and use access instead of _access 2020-08-12 18:46:05 +08:00
Vincent Wei 988d1ca680 remove listenfd.c 2020-08-12 18:45:36 +08:00
Vincent Wei fec1ccef76 check function access 2020-08-12 18:45:22 +08:00
Vincent Wei 884cd66dfa add buildlib-freertos 2020-08-12 18:40:39 +08:00
Vincent Wei f41180d025 fix a bug in RegisterListenFD 2020-08-10 11:07:50 +08:00
Vincent Wei bebe28b95c disable calling of _access for FreeRTOS 2020-08-10 11:02:48 +08:00
Vincent Wei 358c940763 use hb_buffer_set_unicode_funcs 2020-07-23 16:55:01 +08:00
Vincent Wei b3d6c70a45 fix bad default harfbuzz include directory 2020-07-21 20:54:06 +08:00
Vincent Wei 5fc1c1101e fix a bug: do not call function in assert() 2020-06-06 12:04:14 +08:00
Vincent Wei f336b8401b Release notes for version 5.0.2. 2020-06-04 10:15:58 +08:00
Vincent Wei 78a0a8addf move code for initializing cfg_res_path to __sysres_get_system_res_path() 2020-06-04 09:15:15 +08:00
Vincent Wei be5f46f92d cleanup 2020-06-04 09:14:24 +08:00
Vincent Wei 07592ad802 cleanup 2020-06-04 09:13:52 +08:00
Vincent Wei 1764c47131 depress compile warnings 2020-06-03 18:07:52 +08:00
Vincent Wei f83c92d91b implement hb_ext_unicode_funcs 2020-06-03 18:07:26 +08:00
Vincent Wei bf85472935 ignore files created by automake 2020-06-03 18:06:29 +08:00
Vincent Wei ff6856ec1f change version to 5.0.2; use harfbuzz instead of harfbuzzex; set use_shmopen to yes by default 2020-06-03 18:03:16 +08:00
Vincent Wei a4d532f85e fix a bug: always retrun TRUE in subtract_rgn_by_node; change version to 5.0.1 2020-05-12 09:17:39 +08:00
95 changed files with 5780 additions and 2811 deletions
+2 -1
View File
@@ -4,6 +4,8 @@
*.al
*.a
*.so
\#
am--include-marker
Makefile
Makefile.in
.deps/
@@ -23,7 +25,6 @@ Makefile.in
/*config.h
/*config.h.in
/*config.h.in~
/src/font/utils/emoji/
/src/font/utils/ucd/
/src/sysres/font_list
+174 -78
View File
File diff suppressed because it is too large Load Diff
+174 -78
View File
File diff suppressed because it is too large Load Diff
+174 -78
View File
File diff suppressed because it is too large Load Diff
+96 -79
View File
@@ -1,14 +1,14 @@
# MiniGUI
A mature and proven cross-platform GUI system for embedded and smart IoT devices.
A modern and proven cross-platform window system for embedded systems or smart IoT devices.
## TABLE OF CONTENTS
_TABLE OF CONTENTS_
- [TABLE OF CONTENTS](#table-of-contents)
- [INTRODUCTION](#introduction)
+ [What's MiniGUI](#whats-minigui)
+ [MiniGUI Components](#minigui-components)
+ [Open Source Apps Based-on MiniGUI](#open-source-apps-based-on-minigui)
+ [App Frameworks on MiniGUI](#app-frameworks-on-minigui)
+ [MiniGUI and HybridOS](#minigui-and-hybridos)
+ [Source Code Repositories](#source-code-repositories)
- [NEW FEATURES IN VERSION 5.0.x](#new-features-in-version-50x)
@@ -23,6 +23,9 @@ A mature and proven cross-platform GUI system for embedded and smart IoT devices
+ [Building Whole MiniGUI](#building-whole-minigui)
+ [Building MiniGUI Core](#building-minigui-core)
+ [Unit Tests](#unit-tests)
- [Othere Resources](#othere-resources)
+ [MiniGUI Components](#minigui-components)
+ [Open Source Apps Based-on MiniGUI](#open-source-apps-based-on-minigui)
- [HISTORY](#history)
- [AUTHORS AND COPYING](#authors-and-copying)
+ [Special Statement](#special-statement)
@@ -34,83 +37,48 @@ A mature and proven cross-platform GUI system for embedded and smart IoT devices
### What's MiniGUI
MiniGUI is a mature cross-platform windowing system and a GUI (Graphics
User Interface) support system for embedded systems and smart IoT devices.
This is the version 5.0.x of MiniGUI maintained by WEI Yongming.
MiniGUI is released under GPLv3 and the dual-licensing applies to commercial
use.
MiniGUI aims to provide a fast, stable, full-featured, and cross-platform
windowing and GUI support system, which is especially fit for
embedded systems or smart IoT devices based-on Linux/uClinux, eCos, and other
traditional RTOSes, such as RT-Thread, FreeRTOS, RTEMS, VxWorks, ThreadX,
Nucleus, pSOS, uC/OS-II, and OSE.
Nucleus, pSOS, uC/OS-II, OSE, and others.
This is the source tree of MiniGUI Core, which provides the windowing
and graphics interfaces as well as a lot of standard controls (toolkit).
### MiniGUI Components
MiniGUI is released under GPLv3 and the dual-licensing applies to commercial
use. In December 1998, the initiator of FMSoft, Wei Yongming, began to develop
MiniGUI under the GNU General Public License (GPL). In September 2002, the core
developers of MiniGUI founded [FMSoft](https://www.fmsoft.cn) and started the
commercial marketing with the free software. By now, FMSoft still continues to
release MiniGUI as a free software project.
Besides MiniGUI Core, FMSoft also provides some components
for the developers to develop app much easier:
* mGUtils: A MiniGUI component which contains miscellaneous utilities
like `ColorSelectionDialogBox`, `FileOpenDialogBox`, and so on.
* mGPlus: A MiniGUI component which provides support for advanced graphics
functions like path, gradient, anti-aliased stretch, and color combination.
* mGEff: mGEff provides an animation framework for MiniGUI app.
It also provides some popular UI/UE special effects.
* mGNCS: This component provides a new control set for MiniGUI app.
* mGNCS4Touch: This component provides some new controls, which are
compliant to the new control API spec of mGNCS, for devices with
touch screens.
There are also some legacy MiniGUI components. But we will not maintain these
components since MiniGUI v3.2.0:
* mGi: An input method component for MiniGUI. This component provides
some typical input methods (such as soft keyboard, hand-writing, and predict
text input for mobile phone) for MiniGUI apps.
* mGp: A printing component for MiniGUI. By using mGp, you can print
out the graphics created by MiniGUI app to general-purpose printers.
* mG3d: A simple three-dimension component for MiniGUI. This component
provides a simple 3D API for app. You can use mG3d to create simple
3D UI.
MiniGUI is a free software project. In December 1998, the initiator of
FMSoft, Wei Yongming, began to develop MiniGUI under the GNU General Public
License (GPL). In September 2002, the core developers of
MiniGUI founded FMSoft and started the commercial marketing with
the free software. By now, FMSoft still continues to release MiniGUI
as a free software project.
You can download the source code tarball of MiniGUI and the dependent libraries
from the download zone of the site:
For the live demos, source tarballs, and cases of MiniGUI, you can refer
to the following website:
<http://www.minigui.com>
### Open Source Apps Based-on MiniGUI
### App Frameworks on MiniGUI
FMSoft also releases some open source apps for MiniGUI on the site above,
for examples:
MiniGUI and its components provides a lot of controls/widgets to
help your develop GUI apps in C/C++ programming language. However,
alternatively, you can choose one of the following frameworks to
develop your apps in a easy-to-use programming language other than C/C++.
* `mDolphin`, licensed under Apache 2.0, is a full-featured
WEB/WAP browser, which is developed based on the open source browser
core WebKit and uses MiniGUI as its underlying graphics support system.
* `mGallery`, licensed under Apache 2.0, intends to
provide a total solution for PMP (Portable Multimedia Player),
which uses MiniGUI as the graphics platform.
* `mSpider`, licensed under GPL 3.0, intends to provide a
light-weight MiniGUI-based web browser (HTML 3.2 and part JavaScript)
* `mEagle`, licensed under GPL 3.0, is an embedded GIS development platform
which addresses the needs of map browse, query, analysis, etc
* [HybridOS](https://gitlab.fmsoft.cn/HybridOS/hybridos) provides
a complete software stack to develop an app which have rich functions
and excellent expressive in HTML5, CSS3, and JavaScript.
* [hiACEJS](https://gitlab.fmsoft.cn/HybridOS/hiACEJS) provides
a light-weight app framework in JavaScript.
You can also choose [HybridOS Lite](https://gitlab.fmsoft.cn/HybridOS/hybridos-lite)
to develop apps with excellent expressive for cost-sensitive devices in C/C++ language.
### MiniGUI and HybridOS
HybridOS is another large open source project initiated by FMSoft. It is
a totally new open source operating system designed for smart IoT devices
and cloud computing environment.
[HybridOS](https://gitlab.fmsoft.cn/HybridOS/hybridos) is another large open source project
initiated by FMSoft. It is a totally new open source operating system designed for
embedded and smart IoT devices and cloud computing environment.
In practice, MiniGUI and the software which are used to integrated with GPU
constitute the graphics stack of HybridOS.
@@ -165,19 +133,20 @@ FMSoft had created the public repositories for MiniGUI Core, MiniGUI
components, HybridOS, and other open source apps on GitHub. You can visit
them on:
<https://github.com/VincentWei>
and
<https://github.com/FMSoftCN>
<https://gitlab.fmsoft.cn/VincentWei>
We now maintain all documents about MiniGUI on the following public repo:
<https://github.com/VincentWei/minigui-docs>
<https://gitlab.fmsoft.cn/VincentWei/minigui-docs>
You can download the source code tarballs of MiniGUI Core, MiniGUI
components, and the dependent libraries from the download zone of the site:
<http://www.minigui.com/download>
## NEW FEATURES IN VERSION 5.0.x
In version 5.0.0, we introduced some new and exciting features, and refactored
In version 5.0.0, we introduced some exciting new features, and refactored
a lot basic modules of MiniGUI Core.
### Compositing Schema
@@ -292,7 +261,7 @@ so that the old applications can smoothly migrate to the new
version. However, there are still some slight changes you need to take care.
For more information, please refer to `RELEASE-NOTES.md` file:
<https://github.com/VincentWei/minigui/blob/rel-5-0/RELEASE-NOTES.md>
<https://gitlab.fmsoft.cn/VincentWei/minigui/blob/rel-5-0/RELEASE-NOTES.md>
## NEW FEATURES IN VERSION 4.0.x
@@ -323,7 +292,7 @@ in order to support [HybridOS Foundation Class Library].
For more information, please refer to `RELEASE-NOTES.md` file:
<https://github.com/VincentWei/minigui/blob/rel-4-0/RELEASE-NOTES.md>
<https://gitlab.fmsoft.cn/VincentWei/minigui/blob/rel-4-0/RELEASE-NOTES.md>
Because of the changes of some APIs, we recommended strongly that you
use this version for new projects.
@@ -338,7 +307,7 @@ We introduce some new features in MiniGUI Version 3.2.x:
For more information, please refer to `RELEASE-NOTES.md` file:
<https://github.com/VincentWei/minigui/blob/rel-3-2/RELEASE-NOTES.md>
<https://gitlab.fmsoft.cn/VincentWei/minigui/blob/rel-3-2/RELEASE-NOTES.md>
## THE RUNTIME MODES OF MINIGUI
@@ -392,15 +361,16 @@ and MiniGUI components, please fetch one of the following repositories
from GitHub and follow the instructions to build MiniGUI Core,
MiniGUI components, the samples, and the demonstration programs:
<https://github.com/VincentWei/build-minigui-5.0>
[Build MiniGUI 5.0](https://gitlab.fmsoft.cn/VincentWei/build-minigui-5.0)
or
<https://github.com/VincentWei/build-minigui-4.0>
[Build MiniGUI 4.0](https://gitlab.fmsoft.cn/VincentWei/build-minigui-4.0)
or
<https://github.com/VincentWei/build-minigui-3.2>
[Build MiniGUI 3.2](https://gitlab.fmsoft.cn/VincentWei/build-minigui-3.2)
### Building MiniGUI Core
@@ -440,11 +410,57 @@ For more information, please run
Since MiniGUI 4.0.0, we organize the unit test code of MiniGUI APIs in the
following repository:
<https://github.com/VincentWei/mg-tests>
<https://gitlab.fmsoft.cn/VincentWei/mg-tests>
If you are interested in hacking the MiniGUI code, please visit this repository.
## Othere Resources
### MiniGUI Components
Besides MiniGUI Core, FMSoft also provides some components
for the developers to develop app much easier:
* mGUtils: A MiniGUI component which contains miscellaneous utilities
like `ColorSelectionDialogBox`, `FileOpenDialogBox`, and so on.
* mGPlus: A MiniGUI component which provides support for advanced graphics
functions like path, gradient, anti-aliased stretch, and color combination.
* mGEff: mGEff provides an animation framework for MiniGUI app.
It also provides some popular UI/UE special effects.
* mGNCS: This component provides a new control set for MiniGUI app.
* mGNCS4Touch: This component provides some new controls, which are
compliant to the new control API spec of mGNCS, for devices with
touch screens.
There are also some legacy MiniGUI components. But we will not maintain these
components since MiniGUI v3.2.0:
* mGi: An input method component for MiniGUI. This component provides
some typical input methods (such as soft keyboard, hand-writing, and predict
text input for mobile phone) for MiniGUI apps.
* mGp: A printing component for MiniGUI. By using mGp, you can print
out the graphics created by MiniGUI app to general-purpose printers.
* mG3d: A simple three-dimension component for MiniGUI. This component
provides a simple 3D API for app. You can use mG3d to create simple
3D UI.
### Open Source Apps Based-on MiniGUI
FMSoft also releases some open source apps for MiniGUI on the site above,
for examples:
* `mDolphin`, licensed under Apache 2.0, is a full-featured
WEB/WAP browser, which is developed based on the open source browser
core WebKit and uses MiniGUI as its underlying graphics support system.
* `mGallery`, licensed under Apache 2.0, intends to
provide a total solution for PMP (Portable Multimedia Player),
which uses MiniGUI as the graphics platform.
* `mSpider`, licensed under GPL 3.0, intends to provide a
light-weight MiniGUI-based web browser (HTML 3.2 and part JavaScript)
* `mEagle`, licensed under GPL 3.0, is an embedded GIS development platform
which addresses the needs of map browse, query, analysis, etc
## HISTORY
21 years have pasted since MiniGUI was initially created at
@@ -549,6 +565,7 @@ A brief history description of the development progress is listed as follow:
1. Apr., 2019: FMSoft released MiniGUI version 3.2.2.
1. Jul., 2019: FMSoft released MiniGUI version 4.0.0.
1. Mar., 2020: FMSoft released MiniGUI version 5.0.0.
1. May., 2021: FMSoft released MiniGUI version 5.0.6.
## AUTHORS AND COPYING
@@ -556,7 +573,7 @@ The original author of MiniGUI is WEI Yongming, and now MiniGUI is
maintained by FMSoft. For more information, please refer to
<http://www.fmsoft.cn>.
Copyright (C) 2002 ~ 2020, Beijing FMSoft Technologies Co., Ltd.
Copyright (C) 2002 ~ 2021, Beijing FMSoft Technologies Co., Ltd.
Copyright (C) 1998 ~ 2002, WEI Yongming
This program is free software: you can redistribute it and/or modify
+119 -1
View File
@@ -1,5 +1,15 @@
# Release Notes
- [Version 5.0.6](#version-506)
+ [What's new in version 5.0.6](#whats-new-in-version-506)
- [Version 5.0.5](#version-505)
+ [What's new in version 5.0.5](#whats-new-in-version-505)
- [Version 5.0.4](#version-504)
+ [What's new in version 5.0.4](#whats-new-in-version-504)
- [Version 5.0.3](#version-503)
+ [What's new in version 5.0.3](#whats-new-in-version-503)
- [Version 5.0.2](#version-502)
+ [What's new in version 5.0.2](#whats-new-in-version-502)
- [Version 5.0.0](#version-500)
+ [What's new in version 5.0.0](#whats-new-in-version-500)
+ [Compositing schema](#compositing-schema)
@@ -10,6 +20,114 @@
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
+ [Deprecated APIs](#deprecated-apis)
## Version 5.0.6
The MiniGUI development team announces the availability of MiniGUI 5.0.6,
which is the bug fixing release of MiniGUI 5.0.x.
### What's new in version 5.0.6
In this version, we fixed some bugs and made some optimizations and enhancements:
* BUGFIXING:
- Fix bugs of switching layers under MiniGUI-Processes.
- Fix bugs of `FBCon` and `PC_XVFB` engines: the dirty rectangles are
not set empty after calling `SyncUpdate`.
- Fix memory leaks when using block heap.
- Fix a bug in ServerGetWinZNodeRegion.
* ENHANCEMENTS:
- Enhance `GetGlyphInfo` to return the FreeType face, font file path, and glyph
index.
- NEW API `StretchBltEx` to support different scaling filters and rotation.
- Use Pixman to support color blending methods for `BitBlt` and `StretchBlt`.
- Enhance fallback compositor to support animation when switching among layers.
- New API `SetMainWindowGestureFlags` and `MSG_GESTURETEST` message for
gesture test and setting the gesture flags of a specific main window.
- Tune implementation of Tooltip window.
* OPTIMIZATIONS:
- Optimize the fallback compositor for lucent windows.
- Use Pixman to optimize `FillBox`, `BitBlt`, and `StretchBlt`.
- Optimize the management of BLOCKHEAP.
- Optimize the `__mg_lookfor_unused_slot`.
Note that the binary backward-compatibility was broken, two operations added to
`CompositorOps`. You should rebuild all MiniGUI applications.
Also note that the compositing schema is now enabled by default.
## Version 5.0.5
The MiniGUI development team announces the availability of MiniGUI 5.0.5,
which is the bug fixing release of MiniGUI 5.0.x.
### What's new in version 5.0.5
In this version, we fixed some bugs and made some minor enhancements:
* BUGFIXING:
- Adjust the constants for `WS_XXXX` macros to avoid duplicated values.
Note that the binary backward-compatibility was broken. You should
rebuild all MiniGUI applications.
## Version 5.0.4
The MiniGUI development team announces the availability of MiniGUI 5.0.4,
which is the bug fixing release of MiniGUI 5.0.x.
### What's new in version 5.0.4
In this version, we fixed some bugs and made some minor enhancements:
* BUGFIXING:
- Fix bugs in ServerGetWinZNodeRegion: must check for possible empty mask rect
and bad assignment of maskrect
- Fix a potential bug: only increase `nr_mask_rects` for not empty mask rectangle.
- Fix a bug: update surface of controls surface in `travel_children_with_priv_cdc`.
* ENHANCEMENTS:
- New IAL engine: `--enable-singletouchkeyial` to build the IAL engine for
single touch screen and key buttons.
## Version 5.0.3
The MiniGUI development team announces the availability of MiniGUI 5.0.3,
which is the bug fixing release of MiniGUI 5.0.x.
### What's new in version 5.0.3
In this version, we fixed some bugs and made some minor enhancements:
* BUGFIXING:
- Always check expired timers even got `EINTR`.
- Add static modifier to `refresh_dirty_region` method of the fallback compositor.
- Fix a bug in `RegisterListenFD`.
- Fix a bug in `allocate_more_fd_slots`.
* TUNING:
- Rebuild the private data for all visible z-nodes after selected a new compositor.
* ENHANCEMENTS:
- New configuration option: `--enable-mgslicefallback` to build a fallback
implementation of mgslice.
- New API: `ServerGetTopmostZNodeOfType`.
- Merge some code by @ehello (<https://github.com/ehello>) for FreeRTOS.
## Version 5.0.2
The MiniGUI development team announces the availability of MiniGUI 5.0.2,
which is the bug fixing release of MiniGUI 5.0.x.
### What's new in version 5.0.2
In this version, we tuned some code for GCC 9 and fixed some bugs:
* BUGFIXING:
- Initialize `cfg_res_path` in function `__sysres_get_system_res_path()`.
- Always return TRUE in `subtract_rgn_by_node()`.
* ADJUSTMENTS:
- Use upstream Harfbuzz for glyph shaping of complex scripts instead
of the modified version.
* TUNING:
- Tune some code to depress compilation warnings.
## Version 5.0.0
The MiniGUI development team announces the availability of MiniGUI 5.0.0,
@@ -63,7 +181,7 @@ exciting features for MiniGUI:
* ADJUSTMENTS:
- `g_rcScr` now is defined a macro calling function `GetScreenRect()`.
- `mgIsServer` now is define a macro calling function `IsServer()`.
* TUNNING
* TUNING
- Tune the `drm` (DRM) engine to support MiniGUI-Processes runtime mode
and compositing schema.
- Tune the `fbcon` (Linux Frame Buffer) engine to support compositing schema.
+2 -2
View File
@@ -1,11 +1,11 @@
Version 5.0.0 (2019/03/30)
Version 5.0.6 (2021/05/20)
This is the first official release of MiniGUI 5.0.x, the stable version.
Other packages for MiniGUI resource, tools, components, and samples:
- GVFB: `gvfb-1.2.5.tar.gz`
- The resource package: `minigui-res-5.0.0.tar.gz`
- The resource package: `minigui-res-5.0.6.tar.gz`
- mGUtils component: `libmgutils-1.5.0.tar.gz`
- mGPlus component: `libmgplus-1.5.0.tar.gz`
- mGEff component: `libmgeff-1.5.0.tar.gz`
+44
View File
@@ -0,0 +1,44 @@
#!/bin/sh
rm config.cache config.status -f
./configure \
--disable-shared \
--enable-static \
--with-osname=freertos \
--with-targetname=external \
--with-runmode=sa \
--enable-mgslicefallback \
--disable-videopcxvfb \
--disable-videoqvfb \
--disable-videodrm \
--disable-videofbcon \
--enable-videocommlcd \
--enable-dummyial \
--disable-consoleial \
--disable-libinputial \
--enable-commial \
--disable-consoleimps2 \
--disable-mousecalibrate \
--enable-incoreres \
--disable-cursor \
--disable-clipboard \
--disable-adv2dapi \
--disable-savebitmap \
--disable-savescreen \
--disable-dblclk \
--disable-splash \
--disable-latin9support \
--disable-fullunicode \
--disable-rbfsupport \
--disable-vbfsupport \
--disable-upfsupport \
--disable-qpfsupport \
--disable-ttfsupport \
--disable-complexscripts \
--disable-ttfcache \
--disable-jpgsupport \
--disable-pngsupport \
--disable-flatlf \
--disable-textmode \
--disable-shmopen
+41
View File
@@ -0,0 +1,41 @@
#!/bin/sh
rm config.cache config.status -f
./configure \
--disable-shared \
--enable-static \
--with-osname=linux \
--with-targetname=external \
--with-runmode=sa \
--enable-mgslicefallback \
--disable-videopcxvfb \
--disable-videoqvfb \
--disable-videodrm \
--disable-videofbcon \
--enable-videocommlcd \
--enable-dummyial \
--disable-consoleial \
--disable-libinputial \
--enable-commial \
--disable-consoleimps2 \
--disable-mousecalibrate \
--enable-incoreres \
--disable-cursor \
--disable-savebitmap \
--disable-savescreen \
--disable-dblclk \
--disable-splash \
--disable-latin9support \
--disable-fullunicode \
--disable-rbfsupport \
--disable-vbfsupport \
--disable-upfsupport \
--disable-qpfsupport \
--disable-ttfsupport \
--disable-complexscripts \
--disable-ttfcache \
--disable-jpgsupport \
--disable-pngsupport \
--disable-flatlf \
--disable-textmode
+36
View File
@@ -0,0 +1,36 @@
# set your own targaet_os
TARGET_OS=freertos
##################################################
# set your compile tool #
CC=arm-linux-gnueabihf-gcc
CXX=arm-linux-gnueabihf-g++
CPP=arm-linux-gnueabihf-g++
AR=arm-linux-gnueabihf-ar
AS=arm-linux-gnueabihf-as
RANLIB=arm-linux-gnueabihf-ranlib
MAKE=/usr/bin/make
##################################################
ARFLAGS=-rc
COFLAG=-c
OBJ=o
LIBA=a
##################################################
# if you don't want to create dynamic, delete it #
LIBSO=so
SOFLAGS=-fPIC -shared -o
##################################################
##################################################
# set your compile flags and install prefix path #
PREFIX=/usr/local
CFLAGS+=-g -Wall -fPIC
LDFLAGS+=
##################################################
+57 -15
View File
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT(libminigui, 5.0.0)
AC_INIT(libminigui, 5.0.6)
AC_CONFIG_SRCDIR(src/main/main.c)
dnl Set various version strings - taken gratefully from the SDL sources
@@ -16,7 +16,7 @@ dnl Set various version strings - taken gratefully from the SDL sources
#
MINIGUI_MAJOR_VERSION=5
MINIGUI_MINOR_VERSION=0
MINIGUI_MICRO_VERSION=0
MINIGUI_MICRO_VERSION=6
MINIGUI_INTERFACE_AGE=0
MINIGUI_BINARY_AGE=0
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
@@ -77,10 +77,12 @@ AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(time mktime localtime clock_gettime strdup strcasecmp strncasecmp strerror setlocale)
AC_CHECK_FUNCS(posix_memalign memalign valloc memfd_create poll select)
AC_CHECK_FUNCS(posix_memalign memalign valloc memfd_create access poll select)
PKG_CHECK_MODULES(UDEV, [libudev >= 200], have_udev="yes", have_udev="no; need libudev 200+")
DEP_LIBS=""
dnl ========================================================================
dnl User selectable options
@@ -92,7 +94,7 @@ message_string="no"
osname="unspecified"
runtime_mode="procs"
compositing_schema="no"
compositing_schema="yes"
virtual_window="no"
use_shmopen="no"
mgslice_use_fallback="no"
@@ -107,6 +109,7 @@ use_own_stdio="no"
use_own_malloc="no"
use_own_pthread="no"
build_adv2dapi="yes"
use_pixman="yes"
build_updateregion="yes"
build_minimalgdi="no"
@@ -132,6 +135,9 @@ build_console_ms3="no"
build_console_gpm="no"
build_text_mode="yes"
dnl single touch key engines
buid_singletouchkey_ial_engine="yes"
dnl the customized ial engine
build_dlcustom_ial_engine="no"
build_custom_ial_engine="no"
@@ -361,6 +367,10 @@ AC_ARG_ENABLE(adv2dapi,
[ --enable-adv2dapi include advanced 2D graphics APIs <default=yes>],
build_adv2dapi=$enableval)
AC_ARG_ENABLE(pixman,
[ --enable-pixman use pixman to optimmize pixle operations <default=yes>],
use_pixman=$enableval)
AC_ARG_ENABLE(updateregion,
[ --enable-updateregion Use update region for cumulative updating surfaces <default=yes>],
build_updateregion=$enableval)
@@ -477,6 +487,10 @@ AC_ARG_ENABLE(libinputial,
[ --enable-libinputial build the IAL engine based on libinput <default=yes>],
build_libinput_ial_engine=$enableval)
AC_ARG_ENABLE(singletouchkey,
[ --enable-singletouchkey build the IAL engine based on single touch key <default=yes>],
buid_singletouchkey_ial_engine=$enableval)
AC_ARG_ENABLE(consoleial,
[ --enable-consoleial build the console (Linux console) IAL engine <default=yes>],
build_console_ial_engine=$enableval)
@@ -839,7 +853,7 @@ build_ctrl_animation=$enableval)
if test "x$runtime_mode" == "xprocs"; then
AC_ARG_ENABLE(compositing,
[ --enable-compositing enable compositing schema (MiniGUI-Processes runmode only) <default=no>],
[ --enable-compositing enable compositing schema (MiniGUI-Processes runmode only) <default=yes>],
compositing_schema=$enableval)
AC_ARG_ENABLE(shmopen,
@@ -899,8 +913,6 @@ CheckFBCON()
if test "x$have_pciaccess" = "xyes"; then
AC_DEFINE(_MGHAVE_PCIACCESS, 1,
[Define if PCIAccess lib is available])
LDFLAGS="$LDFLAGS -lpciaccess"
fi
fi
fi
@@ -920,7 +932,7 @@ CheckDRM()
[Define if include Linux DRM NEWGAL engine])
VIDEO_SUBDIRS="$VIDEO_SUBDIRS drm"
VIDEO_DRIVERS="$VIDEO_DRIVERS drm/libvideo_drm.la"
DEP_LIBS="$DEP_LIBS -ldrm -ldl"
DEP_LIBS="$DEP_LIBS -ldrm"
DRM_INC_DIR="`$PKG_CONFIG --variable includedir libdrm`/libdrm"
AC_SUBST(DRM_INC_DIR)
else
@@ -1458,7 +1470,6 @@ fi
if test "x$build_dlcustom_ial_engine" = "xyes"; then
AC_DEFINE(_MGIAL_DLCUSTOM, 1, [Define if include dlcustom IAL engine])
DEP_LIBS="$DEP_LIBS -ldl"
fi
if test "x$build_sef_support" = "xyes"; then
@@ -1621,8 +1632,10 @@ case "$with_osname" in
*)
with_osname="linux"
osname="Linux"
use_shmopen="yes"
AC_DEFINE(__LINUX__, 1,
[Define if compile for Linux])
DEP_LIBS="$DEP_LIBS -ldl"
;;
esac
@@ -1961,7 +1974,7 @@ fi
if test "x$build_net_ial_engine" = "xyes"; then
AC_DEFINE(_MGIAL_NET, 1,
[Define if include IAL engine for net's board])
[Define if include IAL engine for network input])
fi
if test "x$build_comm_ial_engine" = "xyes"; then
@@ -2014,6 +2027,11 @@ if test "x$build_libinput_ial_engine" = "xyes"; then
fi
fi
if test "x$buid_singletouchkey_ial_engine" = "xyes"; then
AC_DEFINE(_MGIAL_SINGLETOUCHKEY, 1,
[Define if include single touch key IAL engine])
fi
if test "x$build_console_ial_engine" = "xyes"; then
AC_DEFINE(_MGIAL_CONSOLE, 1,
[Define if include console (Linux console) IAL engine])
@@ -2143,7 +2161,7 @@ if test "x$build_ttf_support" = "xyes"; then
if test "x$build_complex_scripts" = "xyes"; then
dnl Check for HarfBuzz library
AC_CHECK_LIB(harfbuzz, hb_version,
DEP_LIBS="$DEP_LIBS -lharfbuzzex -lfreetype",
DEP_LIBS="$DEP_LIBS -lharfbuzz -lfreetype",
build_complex_scripts="no; support for complex scripts requires libharfbuzz")
else
DEP_LIBS="$DEP_LIBS -lfreetype",
@@ -2223,7 +2241,7 @@ if test "x$build_complex_scripts" = "xyes"; then
[ --with-hb-includes=DIR where the HarfBuzz includes are])
if test "x$with_hb_includes" = "x"; then
HB_INC_DIR="-I/usr/local/include/harfbuzz"
HB_INC_DIR="-I/usr/include/harfbuzz"
else
HB_INC_DIR="-I$with_hb_includes"
fi
@@ -2236,10 +2254,8 @@ if test "x$build_ttf_support" = "xyes"; then
AC_DEFINE(_MGFONT_FT2, 1,
[Define if support TrueType/OpenType fonts based on FreeType2])
with_ft2_includes=""
AC_ARG_WITH(ft2_includes,
[ --with-ft2-includes=DIR where the FreeType2 includes are],
with_ft2_includes=$withval)
[ --with-ft2-includes=DIR where the FreeType2 includes are])
if test "x$with_ft2_includes" = "x"; then
FT2_INC_DIR="-I/usr/include/freetype2"
@@ -2250,6 +2266,26 @@ if test "x$build_ttf_support" = "xyes"; then
AC_SUBST(FT2_INC_DIR)
fi
dnl Check Pixman lib
if test "x$use_pixman" = "xyes"; then
PKG_CHECK_MODULES([PIXMAN], [pixman-1 >= 0.34.0], [foo=bar],
[use_pixman="no; not found pixman."])
fi
if test "x$use_pixman" = "xyes"; then
AC_DEFINE(_MGUSE_PIXMAN, 1,
[Define if use libpixman for optimized pixel operations])
AC_ARG_WITH(pixman_includes,
[ --with-pixman-includes=DIR where the libpixman includes are])
if test "x$with_pixman_includes" != "x"; then
PIXMAN_CFLAGS="-I$with_pixman_includes"
fi
DEP_LIBS="$DEP_LIBS $PIXMAN_LIBS"
AC_SUBST(PIXMAN_CFLAGS)
fi
if test "x$build_bmpf_support" = "xyes"; then
AC_DEFINE(_MGFONT_BMPF, 1,
[Define if support Bitmap fonts])
@@ -2662,6 +2698,7 @@ AC_SUBST(MINIGUI_RUNMODE)
AM_CONDITIONAL(MGRM_PROCESSES, test "x$runtime_mode" = "xprocs")
AM_CONDITIONAL(MGRM_STANDALONE, test "x$runtime_mode" = "xsa")
AM_CONDITIONAL(MGIAL_LIBINPUT, test "x$build_libinput_ial_engine" = "xyes")
AM_CONDITIONAL(MGIAL_SINGLETOUCHKEY, test "x$buid_singletouchkey_ial_engine" = "xyes")
AM_CONDITIONAL(MGIAL_CONSOLE, test "x$build_console_ial_engine" = "xyes")
AM_CONDITIONAL(MGIAL_NEXUS, test "x$build_nexus_ial_engine" = "xyes")
AM_CONDITIONAL(MGIAL_DLCUSTOM, test "x$build_dlcustom_ial_engine" = "xyes")
@@ -2764,6 +2801,7 @@ AC_MSG_NOTICE([
* Target name: ${with_targetname}
* Cursor: ${build_cursor_support}
* Update Region: ${build_updateregion}
* Pixman: ${use_pixman}
## NEWGAL Engines:
* dummy: ${enable_video_dummy}
@@ -2778,6 +2816,7 @@ AC_MSG_NOTICE([
* pc_xvfb: ${enable_video_pc_xvfb}
* usvfb: ${enable_video_usvfb}
* libinput: ${build_libinput_ial_engine}
* singletouchkey: ${buid_singletouchkey_ial_engine}
* console: ${build_console_ial_engine}
* comm: ${build_comm_ial_engine}
@@ -2798,6 +2837,9 @@ AC_MSG_NOTICE([
* CPP flags: ${CPPFLAGS}
* CC flags: ${CFLAGS}
* CXX flags: ${CXXFLAGS}
* Pixman includes: ${PIXMAN_CFLAGS}
* FreeType2 includes: ${FT2_INC_DIR}
* HarfBuzz includes: ${HB_INC_DIR}
* Dep. libraries: ${DEP_LIBS}
])
+13
View File
@@ -83,6 +83,19 @@ double_buffering=true
exdriver=libhidrmdrivers-0.2.so.0
#}}
#{{ifdef _MGIAL_SINGLETOUCHKEY
[singletouchkey]
# The touch device; use none to disable touch event.
touch_dev=/dev/input/event0
# The key device; use none to disable key event.
key_dev=none
# The number of keys; only valid if the key device is not `none` and can be opened.
nr_keys=2
# The maps from Linux keycode to MiniGUI scancode; only valid if `nr_keys` > 0.
keycode2scancode0=20,1
keycode2scancode1=50,2
#}}
#{{ifdef _MGIAL_LIBINPUT
[libinput]
seat=seat0
-1
View File
@@ -237,7 +237,6 @@ MG_EXPORT void GUIAPI NotifyParentEx (HWND hwnd, LINT id, int code,
NotifyParentEx(hwnd, id, code, 0)
/**
* \var typedef int (*STRCMP) (const char* s1, const char* s2, size_t n)
* \brief Type of general strncmp function.
*
* The function compares the two strings \a s1 and \a s2. It returns
-1
View File
@@ -698,7 +698,6 @@ extern "C" {
#define EM_SETREADONLY 0xF0CF
/**
* \var typedef int (*ED_DRAWSEL_FUNC) (HWND hWnd, HDC hdc, int startx, int starty, const char* content, int len, int selout)
* \brief Type of the edit control callback function on drawing selected strings.
*
* \param hWnd Handle of the edit control.
+212 -101
View File
File diff suppressed because it is too large Load Diff
+129 -22
View File
@@ -82,10 +82,16 @@ extern "C" {
#define ZOF_MAXIMIZED 0x00000004 // Since 5.0.0
#define ZOF_MINIMIZED 0x00000008 // Since 5.0.0
/* Since 5.0.6 */
#define ZOF_GESTURE_FLAGS_MASK 0X000000F0
#define ZOF_GF_SWIPE_HORZ 0x00000010
#define ZOF_GF_SWIPE_VERT 0x00000020
/* Since 5.0.0 */
#define ZOF_INTERNAL_FLAGS_MASK 0X000F0000
#define ZOF_IF_REFERENCE 0x00010000
#define ZOF_IF_ALWAYSTOP 0x00020000
#define ZOF_IF_SPECIAL 0x00040000 // Since 5.0.6
#define ZOF_TW_FLAG_MASK 0x00F00000
#define ZOF_TW_TROUNDCNS 0x00100000
@@ -101,9 +107,9 @@ extern "C" {
#define ZOF_TYPE_NORMAL 0x30000000
#define ZOF_TYPE_HIGHER 0x40000000
#define ZOF_TYPE_DOCKER 0x50000000 // Since 5.0.0
#define ZOF_TYPE_SCREENLOCK 0x60000000 // Since 5.0.0;
#define ZOF_TYPE_SCREENLOCK 0x60000000 // Since 5.0.0
#define ZOF_TYPE_GLOBAL 0x70000000
#define ZOF_TYPE_TOOLTIP 0x80000000 // Since 5.0.0; fixed and only one.
#define ZOF_TYPE_TOOLTIP 0x80000000 // Since 5.0.0
#define ZOF_TYPE_POPUPMENU 0x90000000
#define ZOF_TYPE_BOTTOMMOST ZOF_TYPE_LAUNCHER
@@ -351,9 +357,17 @@ extern MG_EXPORT MG_Client* mgClients;
*/
extern MG_EXPORT MG_Layer* mgTopmostLayer;
/**
* \var MG_Layer* mgDefaultLayer
* \brief The pointer to the default layer.
*
* \sa MG_Layer
*/
extern MG_EXPORT MG_Layer* mgDefaultLayer;
/**
* \var MG_Layer* mgLayers
* \brief The pointer to the array of layers.
* \brief The pointer to the layer list.
*
* \sa MG_Layer
*/
@@ -562,6 +576,8 @@ MG_EXPORT BOOL GUIAPI DeleteLayer (BOOL handle_name,
*
* \return TRUE on success, otherwise FALSE.
*
* \note Only one client which has no any window can be moved.
*
* \note The client which created a fixed main window
* (a main window acts as the screen lock, the docker, or the launcher) will
* be moved to the topmost layer automatically.
@@ -669,21 +685,22 @@ typedef void (* ON_NEW_DEL_CLIENT) (int op, int cli);
typedef void (* ON_CHANGE_LAYER) (int op, MG_Layer* layer,
MG_Client* client);
#define ZNOP_ALLOCATE 1
#define ZNOP_FREE 2
#define ZNOP_MOVE2TOP 3
#define ZNOP_SHOW 4
#define ZNOP_HIDE 5
#define ZNOP_MOVEWIN 6
#define ZNOP_SETACTIVE 7
#define ZNOP_ALLOCATE 1
#define ZNOP_FREE 2
#define ZNOP_MOVE2TOP 3
#define ZNOP_SHOW 4
#define ZNOP_HIDE 5
#define ZNOP_MOVEWIN 6
#define ZNOP_SETACTIVE 7
#define ZNOP_ENABLEWINDOW 11
#define ZNOP_DISABLEWINDOW 12
#define ZNOP_STARTDRAG 13
#define ZNOP_CANCELDRAG 14
#define ZNOP_CHANGECAPTION 15
#define ZNOP_REGIONCHANGED 16
#define ZNOP_COMPOSITINGCHANGED 17
#define ZNOP_ENABLEWINDOW 11
#define ZNOP_DISABLEWINDOW 12
#define ZNOP_STARTDRAG 13
#define ZNOP_CANCELDRAG 14
#define ZNOP_CHANGECAPTION 15
#define ZNOP_REGIONCHANGED 16
#define ZNOP_COMPOSITINGCHANGED 17
#define ZNOP_ICONCHANGED 18 /* reserved for future */
/**
* \var typedef void (* ON_ZNODE_OPERATION) (int op, int cli, int idx_znode)
@@ -889,6 +906,39 @@ MG_EXPORT BOOL GUIAPI ServerSetTopmostLayer (MG_Layer* layer);
*/
MG_EXPORT BOOL GUIAPI ServerDeleteLayer (MG_Layer* layer);
/**
* \fn int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type,
* int* cli)
* \brief Get the topmost z-node in the specified layer for the specific
* window type from the server.
*
* This function gets the topmost z-node of the type specified by
* \a type in the specified layer \a layer from the server.
*
* \param layer The pointer to the layer, NULL for the current topmost layer.
* \param type The window type, can be one of the following values:
* - ZOF_TYPE_TOOLTIP
* - ZOF_TYPE_GLOBAL
* - ZOF_TYPE_SCREENLOCK
* - ZOF_TYPE_DOCKER
* - ZOF_TYPE_HIGHER
* - ZOF_TYPE_NORMAL
* - ZOF_TYPE_LAUNCHER
* \param cli The client identifier of the topmost z-node will be returned
* through this pointer. NULL is okay.
*
* \return The index of the topmost z-node of the specified type.
* Zero when there is no z-node in the level; < 0 when error.
*
* \note Server-only function. Note that this function will not return
* the z-node of the desktop, and the desktop always has the z-node index
* of zero.
*
* \sa ServerGetZNodeInfo
*/
MG_EXPORT int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type,
int* cli);
/**
* \fn int GUIAPI ServerGetNextZNode (MG_Layer* layer, int idx_znode,
* int* cli)
@@ -1457,7 +1507,9 @@ MG_EXPORT BOOL GUIAPI ServerDoZNodeOperation (MG_Layer* layer, int idx_znode,
*
* \return TRUE on success, otherwise FALSE.
*
* \note Server-only function. The client which created a fixed main window
* \note Server-only function. Only one client which has no any window can be moved.
*
* \note The client which created a fixed main window
* (a main window acts as the screen lock, the docker, or the launcher) will
* be moved to the topmost layer automatically.
*
@@ -1566,7 +1618,7 @@ typedef struct _CompositorOps {
* a main window with the extended style WS_EX_AUTOPOSITION.
*/
void (*calc_mainwin_pos) (CompositorCtxt* ctxt, MG_Layer* layer,
DWORD zt_type, int first_for_type, CALCPOSINFO* info);
DWORD zt_type, int first_for_type, int cli, CALCPOSINFO* info);
/**
* This operation will be called when there was a layer operation.
@@ -1695,6 +1747,20 @@ typedef struct _CompositorOps {
void (*on_moved_win) (CompositorCtxt* ctxt, MG_Layer* layer,
int zidx, const RECT* rc_org);
/**
* This operation will composite multiple layers on the screen at the same
* time by using the combining paramemters.
*/
unsigned int (*composite_layers) (CompositorCtxt* ctxt, MG_Layer* layers[],
int nr_layers, void* combine_param);
/**
* This operation will be called when transiting to a new topmost layer.
* The compositor can play an animation to transit from the current
* topmost layer to the new topmost layer.
*/
void (*transit_to_layer) (CompositorCtxt* ctxt, MG_Layer* to_layer);
/**
* This operation will be called when the system is maximizing a window.
* The compositor can play an animation in this operation.
@@ -1709,12 +1775,35 @@ typedef struct _CompositorOps {
} CompositorOps;
#define FCM_HORIZONTAL 0x0000
#define FCM_VERTICAL 0x0001
#define FCM_METHOD_MASK 0x00FF
#define FCM_SCALE 0x0100
/** The combining parameters for the callback compositor. */
typedef struct _CombParamsFallback {
/**
* The combining method, can be one of the following values:
* - FCM_HORIZONTAL
* - FCM_VERTICAL
* and/or OR'd with the following value:
* - FCM_SCALE
*/
unsigned int method;
/** The percentage of the screen occupied by the first layer. */
float percent;
/** The scale factor of non-global z-nodes. */
float scale;
} COMBPARAMS_FALLBACK;
/**
* \brief Get the operations of a specific compositor.
*
* This function gets the operations of a specific compositor.
*
* \param name The name of the compositor. MiniGUI reserved `default`
* \param name The name of the compositor. MiniGUI reserved `fallback`
* as the default compositor which is implemented in MiniGUI Core.
* You can use some operations of the default compositor as the
* corresponding operations for your own compositor.
@@ -1774,7 +1863,7 @@ MG_EXPORT BOOL GUIAPI ServerUnregisterCompositor (const char* name);
* \brief Select a compositor as the current compositor.
*
* This function selects a compositor as the current compositor
* and returns the compositor object.
* and returns the compositor operations.
* It also destroies the old compositor object if there is old one.
*
* \param name The name of the compositor. If the argument is NULL,
@@ -1792,7 +1881,25 @@ MG_EXPORT BOOL GUIAPI ServerUnregisterCompositor (const char* name);
MG_EXPORT const CompositorOps* GUIAPI ServerSelectCompositor (
const char* name, CompositorCtxt** ctxt);
#define COMPSOR_OPS_VERSION 1
/**
* \brief Get the name and the context of the current compositor.
*
* This function gets the name and the context of the current
* compositor.
*
* \param ops The buffer used to return the compositor operations.
* \param ctxt The buffer used to return the compositor context.
*
* \return The name of the current compositor; NULL for error.
*
* \note Only called by the server.
*
* Since 5.0.6.
*/
MG_EXPORT const char* GUIAPI ServerGetCurrentCompositor (
const CompositorOps** ops, CompositorCtxt** ctxt);
#define COMPSOR_OPS_VERSION 2
/**
* Implement this stub to return the compositor operations
+138 -72
View File
@@ -1448,6 +1448,17 @@ extern DWORD __mg_interval_time;
*/
#define MSG_HELP 0x006A
/**
* \def MSG_GESTURETEST
* \brief This message will be sent to a main window for gesture test.
*
* The client should call \a SetMainWindowGestureFlags to set the gesture flags
* for a main window after got this message.
*
* Since 5.0.6.
*/
#define MSG_GESTURETEST 0x006B
#define MSG_LASTCREATEMSG 0x006F
/** @} end of creation_msgs */
@@ -2463,6 +2474,9 @@ typedef struct _COMPOSITINGINFO {
/* Since 5.0.0 */
#define MSG_SETAUTOREPEAT 0x0107
/* Since 5.0.6 */
#define MSG_SETGESTUREFLAGS 0x0108
#define MSG_SHOWGLOBALCTRL 0x010A
#define MSG_HIDEGLOBALCTRL 0x010B
@@ -2983,6 +2997,9 @@ typedef struct _WINMASKINFO {
/* Since 5.0.0: for calculating the default position */
#define MSG_CALC_POSITION 0x014B
/* Since 5.0.6: for waking up the client */
#define MSG_WAKEUP_CLIENT 0x014C
/**
* \def MSG_DOESNEEDIME
* \brief Send to a window to query whether the window needs to open
@@ -4280,39 +4297,62 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
*/
#define WS_DISABLED 0x04000000L
/* Main window states -- reserved for future use. */
#define WS_MINIMIZE 0x02000000L
#define WS_MAXIMIZE 0x01000000L
/**
* \def WS_VSCROLL
* \brief Creates a window with vertical scroll bar.
*/
#define WS_VSCROLL 0x02000000L
/* bits in this mask are reuse for main windows and controls;
bits have different meanings for main windows and controls.*/
#define WS_REUSE_MASK 0x00E00000L
/**
* \def WS_HSCROLL
* \brief Creates a window with horizontal scroll bar.
*/
#define WS_HSCROLL 0x01000000L
/* bits in this mask are both for main window and controls */
#define WS_BORDER_MASK 0x00F00000L
/**
* \def WS_DLGFRAME
* \brief The main window has a fixed frame, i.e. user can not
* drag the border of the window.
*/
#define WS_DLGFRAME 0x00800000L
#define WS_DLGFRAME 0x00800000L
/**
* \def WS_THICKFRAME
* \brief Creates a main window with thick frame.
*/
#define WS_THICKFRAME 0x00400000L
#define WS_THICKFRAME 0x00400000L
/**
* \def WS_THINFRAME
* \brief Creates a main window with thin frame.
*/
#define WS_THINFRAME 0x00200000L
#define WS_THINFRAME 0x00200000L
/**
* \def WS_BORDER
* \brief Creates a window with border.
*/
#define WS_BORDER 0x00100000L
/* bits in this mask are reuse for main windows and controls;
bits have different meanings for main windows and controls.*/
#define WS_MISC_MASK 0x000F0000L
/**
* \def WS_CHILD
* \brief Indicates the window is a child.
*/
#define WS_CHILD 0x00080000L
/**
* \def WS_GROUP
* \brief Indicates the control is the leader of a group.
* \note This style is valid only for controls.
*/
#define WS_GROUP 0x00800000L
#define WS_GROUP 0x00040000L
/**
* \def WS_TABSTOP
@@ -4320,7 +4360,11 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
* using Tab key.
* \note This style is valid only for controls.
*/
#define WS_TABSTOP 0x00400000L
#define WS_TABSTOP 0x00020000L
/* Main window states -- reserved for future use. */
#define WS_MINIMIZE 0x00040000L
#define WS_MAXIMIZE 0x00020000L
/**
* \def WS_ALWAYSTOP
@@ -4328,38 +4372,11 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
*
* Since 5.0.0.
*/
#define WS_ALWAYSTOP 0x00100000L
/* bits in this mask are both for main windows and controls */
#define WS_MISC_MASK 0x000F0000L
/**
* \def WS_CHILD
* \brief Indicates the window is a child.
*/
#define WS_CHILD 0x00080000L
/**
* \def WS_VSCROLL
* \brief Creates a window with vertical scroll bar.
*/
#define WS_VSCROLL 0x00040000L
/**
* \def WS_HSCROLL
* \brief Creates a window with horizontal scroll bar.
*/
#define WS_HSCROLL 0x00020000L
/**
* \def WS_BORDER
* \brief Creates a window with border.
*/
#define WS_BORDER 0x00010000L
#define WS_ALWAYSTOP 0x00010000L
/* Obsolete styles, back-compatibility definitions. */
#define WS_OVERLAPPED 0x00000000L
#define WS_ABSSCRPOS 0x00000000L
#define WS_OVERLAPPED 0x00000000L
#define WS_ABSSCRPOS 0x00000000L
#define WS_MAINWIN_ONLY_MASK (WS_CAPTIONBAR_MASK | WS_ALWAYSTOP)
#define WS_CONTROL_ONLY_MASK (WS_CTRLMASK)
@@ -4433,16 +4450,12 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
/**
* \def WS_EX_WINTYPE_TOOLTIP
* \brief The type for a system/global main window.
* \brief The type for a tooltip main window.
*
* Use this style when you want to create a tooltip main window.
* A tooltip main window will be shown above other types of main windows.
*
* \note Under MiniGUI-Processes runtime mode, only the client which creates
* the first main window in the tooltip level can create other main
* windows in this level. For other clients, a main window in the higher
* level will be created.
* \note The maximal number of all main windows in the tooltip level is 8.
* \note The maximal number of all main windows in the tooltip level is 16.
* MiniGUI will create a main windows in higher level if there is no room
* in the tooltip level.
*
@@ -4458,8 +4471,12 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
* A system/global main window will be shown above other types of main windows.
*
* \note Under MiniGUI-Processes runtime mode, only the server (`mginit`) can
* create main windows in the system level, and any main windows created
* by the server is a system main window.
* create main windows in the system level, and any main windows created
* by the server is a system main window.
*
*
* \note Under MiniGUI-Processes runtime mode, the windows in this level will be kept
* visible on all layers.
*
* Since 5.0.0.
*/
@@ -4473,13 +4490,18 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
* screen lock level. A main window in the screen lock level will
* be shown below the system main windows and above the other main windows.
*
* \note Under MiniGUI-Processes runtime mode, only the client which creates
* the first main window in the screen lock level can create other
* main windows in the this level. For other clients, a main window in
* the higher level will be created.
* \note Under MiniGUI-Processes runtime mode, only clients on the default (`mginit`)
* layer can create a main window in this level, and only the client which creates
* the first main window in the screen lock level can create other
* main windows in the this level. For other clients, a main window in
* the higher level will be created.
*
* \note Under MiniGUI-Processes runtime mode, the windows in this level will be kept
* visible on all layers.
*
* \note The maximal number of all main windows in the screen lock level is 8.
* MiniGUI will create a main windows in higher level if there is no room
* in the screen lock level.
* MiniGUI will create a main windows in higher level if there is no room
* in the screen lock level.
*
* Since 5.0.0.
*/
@@ -4494,13 +4516,18 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
* be shown below the main windows in the screen lock level and
* above the main windows in the higher level.
*
* \note Under MiniGUI-Processes runtime mode, only the client which creates
* the first main window in the docker level can create other main windows
* in the docker level. For other clients, a main window in the higher
* level will be created.
* \note Under MiniGUI-Processes runtime mode, only clients on the default (`mginit`)
* layer can create a main window in this levele, and only the client which creates
* the first main window in the docker level can create other main windows
* in the docker level. For other clients, a main window in the higher
* level will be created.
*
* \note Under MiniGUI-Processes runtime mode, the windows in this level will be kept
* visible on all layers.
*
* \note The maximal number of all main windows in the docker level is 8.
* MiniGUI will create a main windows in higher level if there is no room
* in the docker level.
* MiniGUI will create a main windows in higher level if there is no room
* in the docker level.
*
* Since 5.0.0.
*/
@@ -4549,13 +4576,18 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
* be shown below the main windows in the normal level and
* above the wallpaper.
*
* \note Under MiniGUI-Processes runtime mode, only the client which creates
* the first main window in the launcher level can create other
* main windows in the launcher level. For other clients, a main window
* in the normal level will be created.
* \note Under MiniGUI-Processes runtime mode, only clients on the default (`mginit`)
* layer can create a main window in this levele, and only the client which creates
* the first main window in the launcher level can create other
* main windows in the launcher level. For other clients, a main window
* in the normal level will be created.
*
* \note Under MiniGUI-Processes runtime mode, the windows in this level will be kept
* visible on all layers.
*
* \note The maximal number of all main windows in the launcher level is 8.
* MiniGUI will create a main windows in normal level if there is no room
* in the launcher level.
* MiniGUI will create a main windows in normal level if there is no room
* in the launcher level.
*
* Since 5.0.0.
*/
@@ -6884,13 +6916,14 @@ static inline BOOL MainWindowThreadCleanup (HWND hMainWnd)
#define ST_PIXEL_ARGB4444 0x0001
#define ST_PIXEL_ARGB1555 0x0002
#define ST_PIXEL_ARGB8888 0x0003
#define ST_PIXEL_XRGB565 0x0004
/* other flags for future use */
/* for default surface flags */
#define ST_DEFAULT (ST_PIXEL_DEFAULT)
#define CT_SYSTEM_MASK 0X0000FF
#define CT_SYSTEM_MASK 0x0000FF
#define CT_OPAQUE 0x000000
#define CT_COLORKEY 0x000001
#define CT_ALPHACHANNEL 0x000002
@@ -7158,7 +7191,7 @@ MG_EXPORT BOOL GUIAPI SetWindowMaskEx (HWND hWnd, HDC hdc, const BITMAP* mask);
* \param hWnd The handle to the window.
* \param fSet Set or cancel the always top style; TRUE to set, FALSE to cancel.
*
* \return return TRUE on success, otherwise FALSE.
* \return TRUE on success, otherwise FALSE.
*
* \sa GetWindowStyle, WS_ALWAYSTOP
*
@@ -7166,6 +7199,39 @@ MG_EXPORT BOOL GUIAPI SetWindowMaskEx (HWND hWnd, HDC hdc, const BITMAP* mask);
*/
MG_EXPORT BOOL GUIAPI SetMainWindowAlwaysTop (HWND hWnd, BOOL fSet);
#define GF_SWIPE_HORZ ZOF_GF_SWIPE_HORZ
#define GF_SWIPE_VERT ZOF_GF_SWIPE_VERT
/**
* \fn BOOL GUIAPI SetMainWindowGestureFlags (HWND hWnd, DWORD dwFlags)
* \brief Set the gesture flags of a main window.
*
* This function sets the gesture flags of a specific main window.
*
* Generally, a main window which needs a specific gesture should handle
* \a MSG_GESTURETEST and call this function to set the correct gesture flags for
* the main window.
*
* The MiniGUI Core will send the MSG_GESTURETEST message as a notification
* to a main window when it tries to handle a gesture globally. If the main window
* sets the flag of the gesture in a specific time, e.g. 100ms, MiniGUI Core will
* pass the gesture events to the main window other than handle the gesture by itself.
*
* \param hWnd The handle to the main window.
* \param dwFlags The new gesture flags, can be OR'd with the following values:
* - GF_SWIPE_HORZ\n
* The main window handles horizontal swipe gesture.
* - GF_SWIPE_VERT\n
* The main window handles vertical swipe gesture.
*
* \return TRUE on success, otherwise FALSE.
*
* \sa MSG_GESTURETEST
*
* Since 5.0.6
*/
MG_EXPORT BOOL GUIAPI SetMainWindowGestureFlags (HWND hWnd, DWORD dwFlags);
#ifdef _MGSCHEMA_COMPOSITING
/**
@@ -7189,14 +7255,14 @@ MG_EXPORT BOOL GUIAPI SetMainWindowAlwaysTop (HWND hWnd, BOOL fSet);
* the alpha channel value (0~255) along with the parameter \a arg.
* - CT_LOGICALPIXEL\n
* Do the given color logical operation. You should specify the color
* logical raster operation along with the pararmeter \a arg. See \a BitBlt.
* logical raster operation along with the pararmeter \a arg. See \a ColorLogicalOp.
* - CT_ALPHAPIXEL\n
* The alpha component value of the source and/or the destination pixel go
* into effect. You can specify the color blend method along
* with the pararmeter \a arg. See \a ColorBlendMethod. Note that a specific
* compositor may not support this compositing type. The built-in `fallback`
* compositor ignores the blend mode argument and only always uses the
* Porter Duff blend mode: source over destination (COLOR_BLEND_PD_SRC_OVER).
* compositor uses the blend mode argument when using Pixman, otherwise,
* uses the Porter Duff blend mode: source over destination (COLOR_BLEND_PD_SRC_OVER).
* - CT_BLURRED\n
* Apply a Gaussian blur to the background of the main window. You should
* also specify the radius of the blur (0 ~ 255) in pixles along with the
+1 -1
View File
@@ -50,7 +50,7 @@ MGLIBADD = $(COMMON_LADD) \
MGLDFLAGS = -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
lib_LTLIBRARIES=libminigui_@MGLIB_SUFFIX@.la
libminigui_@MGLIB_SUFFIX@_la_LIBADD=$(MGLIBADD)
libminigui_@MGLIB_SUFFIX@_la_LIBADD=$(MGLIBADD) @DEP_LIBS@
libminigui_@MGLIB_SUFFIX@_la_SOURCES=$(MGSOURCES)
libminigui_@MGLIB_SUFFIX@_la_LDFLAGS=$(MGLDFLAGS)
+72 -27
View File
@@ -154,9 +154,31 @@ int GUIAPI GetSockFD2Server (void)
#include "debug.h"
static void check_live (BOOL woken)
{
static DWORD last_ticks;
REQUEST req;
__mg_update_tick_count (NULL);
// Since 5.0.6, only send IAMLIVE if the current ticks > (last_ticks + 100)
if (woken || __mg_tick_counter > last_ticks + 100) {
last_ticks = __mg_tick_counter;
/* Tell server that I am live */
req.id = REQID_IAMLIVE;
req.data = &__mg_tick_counter;
req.len_data = sizeof (unsigned int);
ClientRequest (&req, NULL, 0);
}
}
static void process_socket_message (MSG *msg)
{
if (msg->message == MSG_UPDATECLIWIN &&
if (msg->message == MSG_WAKEUP_CLIENT) {
check_live (TRUE);
}
else if (msg->message == MSG_UPDATECLIWIN &&
__mg_client_check_hwnd (msg->hwnd, __mg_client_id)) {
__mg_update_window (msg->hwnd,
LOSWORD(msg->wParam), HISWORD(msg->wParam),
@@ -366,27 +388,6 @@ sock_error:
return -1;
}
static void check_live (void)
{
REQUEST req;
#if 0 /* deprecated code */
/* Since 5.0.0, call __mg_update_tick_count instead */
if (__mg_tick_counter != SHAREDRES_TIMER_COUNTER) {
AlertDesktopTimerEvent ();
__mg_tick_counter = SHAREDRES_TIMER_COUNTER;
}
#endif /* deprecated code */
__mg_update_tick_count (NULL);
/* Tell server that I am live */
req.id = REQID_IAMLIVE;
req.data = &__mg_tick_counter;
req.len_data = sizeof (unsigned int);
ClientRequest (&req, NULL, 0);
}
BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
{
static DWORD old_timer;
@@ -398,7 +399,7 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
struct timeval sel_timeout;
MSG Msg;
check_live ();
check_live (FALSE);
/* rset gets modified each time around */
rset = msg_queue->rfdset;
@@ -433,14 +434,14 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
static unsigned int old_mouse_move_serial = 0xdeadbeef;
int flag = 0, mouse_x = -1, mouse_y = -1, buttons = -1;
check_live ();
check_live (FALSE);
if (wait && (__mg_tick_counter - old_timer) >= repeat_timeout) {
Msg.hwnd = HWND_DESKTOP;
Msg.message = MSG_TIMEOUT;
Msg.wParam = (WPARAM)__mg_tick_counter;
Msg.lParam = 0;
Msg.time = __mg_tick_counter;
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message any more.
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message here.
// kernel_QueueMessage (msg_queue, &Msg);
old_timer = __mg_tick_counter;
@@ -507,7 +508,7 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
/* go through registered listen fds */
n += __mg_kernel_check_listen_fds (msg_queue, &rset, wsetptr, esetptr);
check_live ();
check_live (FALSE);
if (n > 0) {
old_timer = __mg_tick_counter;
@@ -569,12 +570,23 @@ GHANDLE GUIAPI JoinLayer (const char* layer_name, const char* client_name,
__mg_layer = layer_handle;
zi = (ZORDERINFO*) shmat (joined_info.zo_shmid, 0, SHM_RDONLY);
zi = (ZORDERINFO*) shmat (joined_info.zi_shmid, 0, SHM_RDONLY);
if (zi == (void*)-1) {
return INV_LAYER_HANDLE;
}
__mg_zorder_info = zi;
if (joined_info.zi_shmid == joined_info.def_zi_shmid) {
__mg_def_zorder_info = zi;
}
else {
zi = (ZORDERINFO*) shmat (joined_info.def_zi_shmid, 0, SHM_RDONLY);
if (zi == (void*)-1) {
return INV_LAYER_HANDLE;
}
__mg_def_zorder_info = zi;
}
}
__mg_tick_counter = SHAREDRES_TIMER_COUNTER;
@@ -711,6 +723,39 @@ BOOL __mg_client_on_layer_changed (GHANDLE layer_handle, int zi_shmid)
__mg_layer = layer_handle;
__mg_zorder_info = zi;
#if 0 /* obsolete */
ZORDERNODE* nodes;
int slot;
nodes = GET_ZORDERNODE(zi);
slot = zi->first_tooltip;
for (; slot > 0; slot = nodes[slot].next) {
if (nodes [slot].cli == __mg_client_id) {
PMAINWIN win = (PMAINWIN)nodes [slot].hwnd;
assert (win);
win->idx_znode = slot;
}
}
slot = zi->first_topmost;
for (; slot > 0; slot = nodes[slot].next) {
if (nodes [slot].cli == __mg_client_id) {
PMAINWIN win = (PMAINWIN)nodes [slot].hwnd;
assert (win);
win->idx_znode = slot;
}
}
slot = zi->first_normal;
for (; slot > 0; slot = nodes[slot].next) {
if (nodes [slot].cli == __mg_client_id) {
PMAINWIN win = (PMAINWIN)nodes [slot].hwnd;
assert (win);
win->idx_znode = slot;
}
}
#endif /* obsolete */
return TRUE;
}
+7 -9
View File
@@ -63,21 +63,17 @@
#include "ctrlmisc.h"
#define _ID_TIMER 100
#define _MARGIN 10
static LRESULT ToolTipWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static int iBorder;
switch (message) {
case MSG_CREATE:
{
const WINDOWINFO *info;
int timeout = (int)GetWindowAdditionalData (hWnd);
if (timeout >= 10)
SetTimer (hWnd, _ID_TIMER, timeout / 10);
info = GetWindowInfo (hWnd);
iBorder =
info->we_rdr->calc_we_area (hWnd, LFRDR_METRICS_BORDER, NULL);
SetWindowFont (hWnd,
(PLOGFONT)GetWindowElementAttr(hWnd, WE_FONT_TOOLTIP));
break;
@@ -102,7 +98,7 @@ static LRESULT ToolTipWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
SetTextColor (hdc,
GetWindowElementPixelEx(hWnd, hdc, WE_FGC_TOOLTIP));
TabbedTextOut (hdc, iBorder, iBorder, text);
TabbedTextOut (hdc, _MARGIN, _MARGIN, text);
EndPaint (hWnd, hdc);
return 0;
@@ -164,6 +160,7 @@ HWND CreateToolTipWin (HWND hParentWnd, int x, int y, int timeout_ms,
CreateInfo.dwStyle = WS_VISIBLE;
CreateInfo.dwExStyle = WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_USEPARENTRDR;
CreateInfo.dwExStyle |= WS_EX_WINTYPE_TOOLTIP | WS_EX_TROUNDCNS | WS_EX_BROUNDCNS;
CreateInfo.spCaption = buf ? buf : text;
CreateInfo.hMenu = 0;
CreateInfo.hCursor = GetSystemCursor (IDC_ARROW);
@@ -171,8 +168,8 @@ HWND CreateToolTipWin (HWND hParentWnd, int x, int y, int timeout_ms,
CreateInfo.MainWindowProc = ToolTipWinProc;
CreateInfo.lx = x;
CreateInfo.ty = y;
CreateInfo.rx = CreateInfo.lx + text_size.cx;
CreateInfo.by = CreateInfo.ty + text_size.cy;
CreateInfo.rx = CreateInfo.lx + text_size.cx + _MARGIN * 2;
CreateInfo.by = CreateInfo.ty + text_size.cy + _MARGIN * 2;
CreateInfo.iBkColor =
GetWindowElementPixelEx (hParentWnd, HDC_SCREEN, WE_BGC_TOOLTIP);
CreateInfo.dwAddData = (DWORD) timeout_ms;
@@ -218,7 +215,8 @@ void ResetToolTipWin (HWND hwnd, int x, int y, const char* text, ...)
if (y + text_size.cy > g_rcScr.bottom)
y = g_rcScr.bottom - text_size.cy;
MoveWindow (hwnd, x, y, text_size.cx, text_size.cy, TRUE);
MoveWindow (hwnd, x, y,
text_size.cx + _MARGIN * 2, text_size.cy + _MARGIN * 2, TRUE);
ShowWindow (hwnd, SW_SHOWNORMAL);
}
+4 -2
View File
@@ -1433,10 +1433,12 @@ static LRESULT NewToolbarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
item_info->add_data = item->add_data;
if (item_info->which & MTB_WHICH_TEXT)
strncpy (item_info->text, item->text, NTB_TEXT_LEN);
//strncpy (item_info->text, item->text, NTB_TEXT_LEN);
strcpy (item_info->text, item->text);
if (item_info->which & MTB_WHICH_TIP)
strncpy (item_info->tip, item->tip, NTB_TIP_LEN);
//strncpy (item_info->tip, item->tip, NTB_TIP_LEN);
strcpy (item_info->tip, item->tip);
return NTB_OKAY;
}
+11 -13
View File
@@ -1012,8 +1012,9 @@ void GUIAPI DestroyDynamicDevFont (DEVFONT** devfont)
{
char font_name [LEN_UNIDEVFONT_NAME + 1];
memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1);
strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME);
//memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1);
//strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME);
strcpy(font_name, (*devfont)->name);
font_DelDevFont (font_name);
*devfont = NULL;
@@ -1069,25 +1070,22 @@ static BOOL init_or_term_specifical_fonts (char* etc_section, BOOL is_unload)
added_num ++;
}
else {
/* [DK] Fix Bug #4801, which introduce a absolute path check error in Windows,
* first to load from sytem res path, else load it directly(relative or absolute path).*/
if ((add_dev_font (font_name, font_file, TRUE)) == TRUE)
/* [DK] Fix Bug #4801, which introduce an absolute path check error in Windows,
* first to load from sytem res path, else load it directly (relative or absolute path).*/
if (add_dev_font (font_name, font_file, TRUE))
added_num++;
else if ((0 == __mg_path_joint(font_path, MAX_PATH + 1,
__sysres_get_system_res_path(), font_file))
&& ((add_dev_font (font_name, font_path, TRUE)) == TRUE))
__sysres_get_system_res_path(), font_file)) &&
add_dev_font (font_name, font_path, TRUE))
added_num++;
}
}
if (is_unload || added_num > 0 || added_num == font_num)
{
if (is_unload || added_num > 0 || added_num == font_num) {
return TRUE;
}
else
{
return FALSE;
}
return FALSE;
}
BOOL font_InitSpecificalFonts (char* etc_section)
-1
View File
@@ -88,7 +88,6 @@ typedef int (* MakeHashKeyFunc)(Glyph32 gv);
typedef struct tagFTFACEINFO {
char* filepathname;
FT_Face face;
BOOL valid;
#ifdef _MGFONT_TTF_CACHE
int face_index;
int cmap_index;
+26 -31
View File
@@ -120,47 +120,42 @@ hb_minigui_unicode_decompose (hb_unicode_funcs_t *ufuncs,
return UCharDecompose(ab, a, b);
}
static hb_unicode_funcs_t *_funcs;
static hb_unicode_funcs_t *get_unicode_funcs(void)
{
if (_funcs)
return _funcs;
_funcs = hb_unicode_funcs_create (NULL);
hb_unicode_funcs_set_combining_class_func (_funcs,
hb_minigui_unicode_combining_class, NULL, NULL);
hb_unicode_funcs_set_general_category_func (_funcs,
hb_minigui_unicode_general_category, NULL, NULL);
hb_unicode_funcs_set_mirroring_func (_funcs,
hb_minigui_unicode_mirroring, NULL, NULL);
hb_unicode_funcs_set_script_func (_funcs,
hb_minigui_unicode_script, NULL, NULL);
hb_unicode_funcs_set_compose_func (_funcs,
hb_minigui_unicode_compose, NULL, NULL);
hb_unicode_funcs_set_decompose_func (_funcs,
hb_minigui_unicode_decompose, NULL, NULL);
hb_unicode_funcs_make_immutable (_funcs);
return _funcs;
}
typedef hb_unicode_funcs_t *(*hb_get_unicode_funcs) (void);
extern hb_get_unicode_funcs __hb_extern_get_unicode_funcs;
/* extern hb_unicode_funcs_t *__mg_hb_unifuncs */
hb_unicode_funcs_t *__mg_hb_unifuncs;
void __mg_init_harzbuff_funcs(void)
{
_DBG_PRINTF("%s: called\n", __FUNCTION__);
__hb_extern_get_unicode_funcs = get_unicode_funcs;
if (__mg_hb_unifuncs)
return;
__mg_hb_unifuncs = hb_unicode_funcs_create (NULL);
hb_unicode_funcs_set_combining_class_func (__mg_hb_unifuncs,
hb_minigui_unicode_combining_class, NULL, NULL);
hb_unicode_funcs_set_general_category_func (__mg_hb_unifuncs,
hb_minigui_unicode_general_category, NULL, NULL);
hb_unicode_funcs_set_mirroring_func (__mg_hb_unifuncs,
hb_minigui_unicode_mirroring, NULL, NULL);
hb_unicode_funcs_set_script_func (__mg_hb_unifuncs,
hb_minigui_unicode_script, NULL, NULL);
hb_unicode_funcs_set_compose_func (__mg_hb_unifuncs,
hb_minigui_unicode_compose, NULL, NULL);
hb_unicode_funcs_set_decompose_func (__mg_hb_unifuncs,
hb_minigui_unicode_decompose, NULL, NULL);
hb_unicode_funcs_make_immutable (__mg_hb_unifuncs);
return;
}
void __mg_term_harzbuff_funcs(void)
{
_DBG_PRINTF("%s: called\n", __FUNCTION__);
if (_funcs) {
hb_unicode_funcs_destroy(_funcs);
if (__mg_hb_unifuncs) {
hb_unicode_funcs_destroy(__mg_hb_unifuncs);
}
else {
_ERR_PRINTF("%s: hb_unicode_funcs_t object is NULL\n",
+27 -12
View File
@@ -2401,8 +2401,9 @@ static void wndDrawNCFrame(MAINWIN* pWin, HDC hdc, const RECT* prcInvalid)
}
#endif
if (fGetDC)
if (fGetDC) {
release_effective_dc (pWin, hdc);
}
}
/* this function is CONTROL safe. */
@@ -3039,11 +3040,6 @@ static PMAINWIN search_win_tree_dfs (struct _search_context *ctxt)
while (hosted) {
PMAINWIN found;
ctxt->hosting = hosted;
if ((found = search_win_tree_dfs (ctxt))) {
return found;
}
if (hosted->id == ctxt->id &&
(((ctxt->flags & WIN_SEARCH_FILTER_MAIN) &&
hosted->WinType == TYPE_MAINWIN) ||
@@ -3052,6 +3048,11 @@ static PMAINWIN search_win_tree_dfs (struct _search_context *ctxt)
return hosted;
}
ctxt->hosting = hosted;
if ((found = search_win_tree_dfs (ctxt))) {
return found;
}
hosted = GetNextHosted (hosting, hosted);
}
@@ -3074,12 +3075,13 @@ static PMAINWIN search_win_tree_bfs (struct _search_context *ctxt)
return hosted;
}
ctxt->hosting = hosted;
if ((found = search_win_tree_bfs (ctxt))) {
return found;
if ((ctxt->hosting = GetNextHosted (hosting, hosted))) {
if ((found = search_win_tree_bfs (ctxt))) {
return found;
}
}
hosted = GetNextHosted (hosting, hosted);
hosted = GetFirstHosted (hosted);
}
return NULL;
@@ -3165,8 +3167,8 @@ HWND GUIAPI GetNextChild (HWND hWnd, HWND hChild)
HWND GUIAPI GetNextMainWindow (HWND hMainWnd)
{
MG_CHECK_RET (hMainWnd == HWND_NULL || MG_IS_NORMAL_MAIN_WINDOW (hMainWnd),
HWND_INVALID);
MG_CHECK_RET (hMainWnd != HWND_NULL &&
!MG_IS_NORMAL_MAIN_WINDOW (hMainWnd), HWND_INVALID);
return (HWND)SendMessage (HWND_DESKTOP,
MSG_GETNEXTMAINWIN, (WPARAM)hMainWnd, 0L);
@@ -7026,6 +7028,19 @@ BOOL GUIAPI SetMainWindowAlwaysTop (HWND hMainWnd, BOOL fSet)
MSG_SETALWAYSTOP, (WPARAM)pMainWin, (LPARAM)fSet);
}
/* Since 5.0.6 */
BOOL GUIAPI SetMainWindowGestureFlags (HWND hMainWnd, DWORD dwFlags)
{
PMAINWIN pMainWin;
if (!(pMainWin = checkAndGetMainWinIfMainWin (hMainWnd))) {
return FALSE;
}
return (BOOL)SendMessage (HWND_DESKTOP,
MSG_SETGESTUREFLAGS, (WPARAM)pMainWin, (LPARAM)dwFlags);
}
#ifdef _MGSCHEMA_COMPOSITING
BOOL GUIAPI SetMainWindowCompositing (HWND hMainWnd, int type, DWORD arg)
{
+3 -1
View File
@@ -50,6 +50,7 @@ DFB_SRCS = dfb.h dfb.c
USVFB_SRCS = usvfbinput.c usvfbinput.h
LIBINPUT_SRCS = linux-libinput.c linux-libinput.h
SINGLETOUCHKEY_SRCS = singletouchkey.c singletouchkey.h
if MGIAL_CONSOLE
native_libial_la_LIBADD = native/libnative.la
@@ -76,4 +77,5 @@ libial_la_SOURCES = $(COMMON_SRCS) $(DUMMY_SRCS) $(JZ4740_SRCS) \
$(COMMINPUT_SRCS) $(QVFB_SRCS) $(WVFB_SRCS) \
$(QEMU_SRCS) $(IPAQ_H3600_SRCS) $(IPAQ_H5400_SRCS) \
$(TSLIB_SRCS) $(SHANDONG_LIDE_SRCS) $(CISCO_TOUCHPAD_SRCS) \
$(MSTAR_SRCS) $(DFB_SRCS) $(USVFB_SRCS) $(LIBINPUT_SRCS)
$(MSTAR_SRCS) $(DFB_SRCS) $(USVFB_SRCS) $(LIBINPUT_SRCS) \
$(SINGLETOUCHKEY_SRCS)
+7 -1
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 2002~2020, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
* This program is free software: you can redistribute it and/or modify
@@ -133,6 +133,9 @@
#ifdef _MGIAL_LIBINPUT
#include "linux-libinput.h"
#endif
#ifdef _MGIAL_SINGLETOUCHKEY
#include "singletouchkey.h"
#endif
static INPUT inputs [] =
{
@@ -212,6 +215,9 @@ static INPUT inputs [] =
#ifdef _MGIAL_LIBINPUT
{"libinput", ial_InitLibInput, TermLibInput},
#endif
#ifdef _MGIAL_SINGLETOUCHKEY
{"singletouchkey", ial_InitSingleTouchKey, TermSingleTouchKey},
#endif
/* ... end of general IAL engines */
};
+1 -3
View File
@@ -1243,11 +1243,9 @@ static int wait_event_ex (int maxfd, fd_set *in, fd_set *out, fd_set *except,
break;
}
#if 0
default:
_DBG_PRINTF("IAL>LIBINPUT: got a UNKNOWN event type: %d\n", type);
_WRN_PRINTF("IAL>LIBINPUT: got a UNKNOWN event type: %d\n", type);
break;
#endif
}
libinput_event_destroy(event);
-1
View File
@@ -65,7 +65,6 @@
#include <sys/time.h>
#include <linux/vt.h>
#include <linux/kd.h>
#include <linux/keyboard.h>
#include "gdi.h"
#include "window.h"
+12 -6
View File
@@ -67,8 +67,6 @@
#include "gal.h"
#include "native.h"
static const char* event_dev;
static int EVENT_Open(const char *);
static void EVENT_Close(void);
static void EVENT_GetModifierInfo(int *modifiers);
@@ -85,6 +83,7 @@ KBDDEVICE kbddev_event = {
EVENT_Resume
};
static char* kbd_dev;
static int kbd_fd; /* file descriptor for keyboard */
/*
@@ -144,6 +143,7 @@ static int EVENT_Open (const char *device)
if (kbd_fd < 0)
return -1;
kbd_dev = strdup (device);
return kbd_fd;
}
@@ -153,8 +153,11 @@ static int EVENT_Open (const char *device)
*/
static void EVENT_Close(void)
{
close(kbd_fd);
close (kbd_fd);
kbd_fd = -1;
free (kbd_dev);
kbd_dev = NULL;
}
/*
@@ -203,7 +206,8 @@ static int EVENT_Read(unsigned char *buf, int *modifiers)
*/
static void EVENT_Suspend(void)
{
EVENT_Close();
close (kbd_fd);
kbd_fd = -1;
}
/* deactivate_keyboard:
@@ -211,10 +215,12 @@ static void EVENT_Suspend(void)
*/
static int EVENT_Resume(void)
{
kbd_fd = open (event_dev, O_NONBLOCK);
kbd_fd = open (kbd_dev, O_NONBLOCK);
if (kbd_fd < 0) {
return -1;
}else{
}
else {
return kbd_fd;
}
}
-1
View File
@@ -56,7 +56,6 @@
#include <sys/ioctl.h>
#include <signal.h>
#include <linux/kd.h>
#include <linux/keyboard.h>
#include <errno.h>
#include "common.h"
+252
View File
@@ -0,0 +1,252 @@
//////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT NOTICE
//
// The following open source license statement does not apply to any
// entity in the Exception List published by FMSoft.
//
// For more information, please visit:
//
// https://www.fmsoft.cn/exception-list
//
//////////////////////////////////////////////////////////////////////////////
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2002~2020, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Or,
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/blog/minigui-licensing-policy/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include "common.h"
#ifdef _MGIAL_SINGLETOUCHKEY
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/input.h>
#include "minigui.h"
#include "misc.h"
#include "ial.h"
#include "singletouchkey.h"
#define LEN_TOUCH_DEV 127
static int sg_tp_event_fd = -1, sg_key_event_fd = -1;
static short MOUSEX = 0, MOUSEY = 0, MOUSEBUTTON = 0;
static int get_touch_data (short *x, short *y, short *button)
{
struct input_event data;
while (read (sg_tp_event_fd, &data, sizeof (data)) == sizeof (data)) {
/* do nothing for EV_SYN due to non-blocking read.
if (data.type == EV_SYN) {
if (data.code == SYN_REPORT) {
return 0;
}
else if (data.code == SYN_MT_REPORT) {
continue;
}
else {
return -1;
}
}
*/
if (data.type == EV_KEY) {
switch (data.code) {
case BTN_TOUCH:
if (data.value > 0)
*button = IAL_MOUSE_LEFTBUTTON;
else
*button = 0;
break;
default:
_WRN_PRINTF ("unknow event code for EV_KEY event: 0x%x, 0x%x\n", data.code, data.value);
return -1;
}
}
else if (data.type == EV_ABS) {
switch (data.code) {
case ABS_X:
*x = data.value;
break;
case ABS_Y:
*y = data.value;
break;
case ABS_MT_POSITION_X:
*x = data.value;
break;
case ABS_MT_POSITION_Y:
*y = data.value;
break;
case ABS_MT_TOUCH_MAJOR:
break;
case ABS_MT_WIDTH_MAJOR:
break;
case ABS_MT_TRACKING_ID:
break;
default:
_WRN_PRINTF ("unknow event code for EV_ABS event: 0x%x, 0x%x.\n", data.code, data.value);
break;
}
}
}
return 0;
}
static int mouse_update (void)
{
if (get_touch_data (&MOUSEX, &MOUSEY, &MOUSEBUTTON) == 0)
return 1;
return 0;
}
static void mouse_getxy (int *x, int* y)
{
*x = MOUSEX;
*y = MOUSEY;
}
static int mouse_getbutton (void)
{
if (MOUSEBUTTON == IAL_MOUSE_LEFTBUTTON)
return IAL_MOUSE_LEFTBUTTON;
return 0;
}
static int wait_event (int which, int maxfd, fd_set *in, fd_set *out, fd_set *except,
struct timeval *timeout)
{
fd_set rfds;
int e;
int retvalue = 0;
if (!in) {
in = &rfds;
FD_ZERO (in);
}
FD_SET (sg_tp_event_fd, in);
if (sg_tp_event_fd > maxfd)
maxfd = sg_tp_event_fd;
if (sg_key_event_fd >= 0) {
FD_SET (sg_key_event_fd, in);
if (sg_key_event_fd > maxfd)
maxfd = sg_key_event_fd;
}
e = select (maxfd + 1, in, out, except, timeout);
if (e > 0) {
if (FD_ISSET (sg_tp_event_fd, in)) {
retvalue |= IAL_MOUSEEVENT;
}
if (sg_key_event_fd >= 0 && FD_ISSET (sg_key_event_fd, in)) {
retvalue |= IAL_KEYEVENT;
}
}
else if (e < 0) {
retvalue = -1;
}
else {
retvalue = 0;
}
return retvalue;
}
BOOL ial_InitSingleTouchKey (INPUT* input, const char* mdev, const char* mtype)
{
char touch_dev[LEN_TOUCH_DEV + 1];
if (GetMgEtcValue ("singletouchkey", "touch_dev", touch_dev, LEN_TOUCH_DEV) < 0) {
strcpy (touch_dev, "none");
}
if (strcmp (touch_dev, "none") == 0) {
_WRN_PRINTF ("no touch_dev defined.\n");
return FALSE;
}
sg_tp_event_fd = open (touch_dev, O_RDONLY | O_NONBLOCK);
if (sg_tp_event_fd < 0) {
_WRN_PRINTF ("failed when opening touch event device: %s\n", touch_dev);
return FALSE;
}
input->update_mouse = mouse_update;
input->get_mouse_xy = mouse_getxy;
input->set_mouse_xy = NULL;
input->get_mouse_button = mouse_getbutton;
input->set_mouse_range = NULL;
input->suspend_mouse= NULL;
input->resume_mouse = NULL;
input->update_keyboard = NULL;
input->get_keyboard_state = NULL;
input->suspend_keyboard = NULL;
input->resume_keyboard = NULL;
input->set_leds = NULL;
input->wait_event = wait_event;
return TRUE;
}
void TermSingleTouchKey (void)
{
if (sg_tp_event_fd >= 0)
close (sg_tp_event_fd);
if (sg_key_event_fd >= 0)
close (sg_key_event_fd);
}
#endif /* _MGIAL_SINGLETOUCHKEY */
+68
View File
@@ -0,0 +1,68 @@
///////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT NOTICE
//
// The following open source license statement does not apply to any
// entity in the Exception List published by FMSoft.
//
// For more information, please visit:
//
// https://www.fmsoft.cn/exception-list
//
//////////////////////////////////////////////////////////////////////////////
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2002~2020, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Or,
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/blog/minigui-licensing-policy/>.
*/
/*
** linux-libinput.h: the head file of the IAL engine based on libinput.
**
** Created by Wei YongMing, 2019/06/10
*/
#ifndef GUI_IAL_SINGLETOUCHKEY_H
#define GUI_IAL_SINGLETOUCHKEY_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
BOOL ial_InitSingleTouchKey (INPUT* input, const char* mdev, const char* mtype);
void TermSingleTouchKey (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* GUI_IAL_SINGLETOUCHKEY_H */
+17 -10
View File
@@ -52,21 +52,28 @@
#ifndef GUI_BLOCKHEAP_H
#define GUI_BLOCKHEAP_H
#define BDS_FREE 0x0000
#define BDS_SPECIAL 0x0001
#define BDS_USED 0x0002
#ifndef _MGUI_GDI_H /* included in include/gdi.h */
typedef struct tagBLOCKHEAP {
struct _BLOCKHEAP {
#ifdef _MGRM_THREADS
pthread_mutex_t lock;
#endif
size_t bd_size;
size_t heap_size;
int free;
void* heap;
} BLOCKHEAP;
/* Size of one block element. */
size_t sz_block;
/* Size of the heap in blocks. */
size_t sz_heap;
/* The first free element in the heap. */
size_t sz_usage_bmp;
/* The number of blocks extra allocated. */
size_t nr_alloc;
/* Pointer to the pre-allocated heap. */
unsigned char* heap;
/* Pointer to the usage bitmap. */
unsigned char* usage_bmp;
};
typedef struct _BLOCKHEAP BLOCKHEAP;
typedef BLOCKHEAP* PBLOCKHEAP;
#ifdef __cplusplus
+4 -1
View File
@@ -164,7 +164,8 @@ typedef struct JoinLayerInfo {
typedef struct JoinedClientInfo {
GHANDLE layer;
int cli_id;
int zo_shmid;
int def_zi_shmid;
int zi_shmid;
} JOINEDCLIENTINFO;
typedef struct LayerInfo {
@@ -222,6 +223,8 @@ typedef struct _MovedClientInfo {
#define ID_ZOOP_MASKRECT_SET 17
#define ID_ZOOP_MASKRECT_FREE 18
#define ID_ZOOP_SETGESTUREFLAGS 19 /* since 5.0.6 */
#ifndef MAX_CAPTION_LEN
#define MAX_CAPTION_LEN 39 //40
#endif
+16 -7
View File
@@ -71,19 +71,24 @@
#define NR_DIRTY_RECTS 16
/* constants for layers and z-order nodes */
#define MAX_NR_LAYERS 8
#define MAX_NR_LAYERS 16
/* Since 5.0.0: the number of the fixed znodes - DONOT adjust */
#define NR_FIXED_ZNODES 1
/* the numbers of znodes in different levels - should be mulitples of 8 */
#define DEF_NR_POPUPMENUS 16
#define DEF_NR_TOOLTIPS 8
#define DEF_NR_GLOBALS 15 // reserve slots for fixed znodes
#define DEF_NR_TOOLTIPS 16
#define DEF_NR_GLOBALS 15 // reserve one slot for fixed znode
#define DEF_NR_SCREENLOCKS 8
#define DEF_NR_DOCKERS 8
#define DEF_NR_TOPMOSTS 16
#define DEF_NR_NORMALS 128
#ifdef _MGRM_PROCESSES // per layer basis
# define DEF_NR_TOPMOSTS 8
# define DEF_NR_NORMALS 32
#else
# define DEF_NR_TOPMOSTS 16
# define DEF_NR_NORMALS 128
#endif
#define DEF_NR_LAUNCHERS 8
/* Since 5.0.0: the number of the zorder levels - DONOT adjust */
@@ -102,10 +107,14 @@ enum {
#define ZNIDX_DESKTOP 0
/* The heap size for mask rectangles */
#define DEF_NR_MASKRECT 1024
#ifdef _MGRM_PROCESSES
# define DEF_NR_MASKRECTS 4096
#else
# define DEF_NR_MASKRECTS 1024
#endif
#if IS_COMPOSITING_SCHEMA
/* max number of shared surfaces */
/* max number of shared surfaces (512) */
# define MAX_NR_SHARED_SURF (DEF_NR_NORMALS * (MAX_NR_LAYERS >> 1))
#endif
+2
View File
@@ -713,6 +713,8 @@ void __mg_update_secondary_dc (PMAINWIN pWin, HDC secondary_dc,
HDC __mg_get_common_rgba8888_dc (void);
BOOL __mg_reset_common_rgba8888_dc (int width, int height, int pitch,
void* pixels);
/* Since 5.0.6 */
void __mg_destroy_common_rgba8888_dc (void);
/* Since 5.0.0.
helpers to update the private client DC of window and it's descendants */
+4 -1
View File
@@ -527,7 +527,10 @@ int __mg_free_hook_wins (int cli);
/************************* Initialization/Termination ************************/
void __mg_init_local_sys_text (void);
/* the zorder information of the server */
/* the zorder information for the default layer */
extern ZORDERINFO* __mg_def_zorder_info;
/* the zorder information for the current layer */
extern ZORDERINFO* __mg_zorder_info;
#ifdef _MGRM_STANDALONE
+34 -11
View File
@@ -120,37 +120,60 @@ int __mg_alloc_sem_for_shared_surf (void);
int __mg_free_sem_for_shared_surf (int sem_num);
#endif /* _MGSCHEMA_COMPOSITING */
int __mg_lookfor_unused_slot (unsigned char* bitmap, int len_bmp, int set);
size_t __mg_lookfor_unused_slot (unsigned char* bitmap, size_t len_bmp, int set);
static inline
void __mg_slot_set_use (unsigned char* bitmap, int index) {
void __mg_slot_set_use (unsigned char* bitmap, size_t index) {
bitmap += index >> 3;
*bitmap &= (~(0x80 >> (index % 8)));
}
static inline
int __mg_slot_clear_use (unsigned char* bitmap, int index) {
int __mg_slot_clear_use (unsigned char* bitmap, size_t index) {
bitmap += index >> 3;
*bitmap |= (0x80 >> (index % 8));
return 1;
}
static inline
int __mg_slot_is_used (unsigned char* bitmap, size_t index) {
bitmap += index >> 3;
if (*bitmap & (0x80 >> (index % 8)))
return 0;
*bitmap |= (0x80 >> (index % 8));
return 1;
}
/* get the number of idle mask rectangles */
static inline
int __mg_get_nr_idle_slots (unsigned char* bitmap, int len_bmp)
size_t __mg_get_nr_idle_slots (unsigned char* bitmap, size_t len_bmp)
{
int idle = 0;
int i, j;
size_t idle = 0;
size_t i, j;
for (i = 0; i < len_bmp; i++) {
for (j = 0; j < 8; j++) {
if (*bitmap & (0x80 >> j))
idle++;
if (*bitmap) {
if (*bitmap == 0xFF) {
idle += 8;
}
else {
if (*bitmap & 0xF0) {
for (j = 0; j < 4; j++) {
if (*bitmap & (0x80 >> j))
idle++;
}
}
if (*bitmap & 0x0F) {
for (j = 0; j < 4; j++) {
if (*bitmap & (0x08 >> j))
idle++;
}
}
}
}
bitmap++;
}
return idle;
}
+118 -30
View File
@@ -57,6 +57,7 @@
#include "gdi.h"
#include "constants.h"
#include "blockheap.h"
#if IS_COMPOSITING_SCHEMA
#include <sys/types.h>
@@ -69,6 +70,7 @@
#endif
#define DISABLE_THREADS
#define GAL_mutex int
#define GAL_bool BOOL
@@ -171,6 +173,10 @@ typedef struct _ShadowSurfaceHeader {
RECT dirty_rc;
} GAL_ShadowSurfaceHeader;
#ifdef _MGUSE_PIXMAN
typedef union pixman_image pixman_image_t;
#endif
/*
* This structure should be treated as read-only, except for 'pixels',
* which, if not NULL, contains the raw pixel data for the surface.
@@ -206,7 +212,12 @@ typedef struct GAL_Surface {
unsigned int format_version; /* Private */
/* reference count -- used when freeing surface */
int refcount; /* Read-mostly */
unsigned int refcount; /* Read-mostly */
#ifdef _MGUSE_PIXMAN
pixman_image_t *pix_img; /* The pixman image object for this surface */
void *blit_ctxt; /* blitting context */
#endif
#if IS_COMPOSITING_SCHEMA
/* The pointer to GAL_SharedSurfaceHeader if the surface
@@ -219,22 +230,42 @@ typedef struct GAL_Surface {
/* These are the currently supported flags for the GAL_surface */
/* Available for GAL_CreateRGBSurface() or GAL_SetVideoMode() */
#define GAL_SWSURFACE MEMDC_FLAG_SWSURFACE /* Surface is in system memory */
#define GAL_HWSURFACE MEMDC_FLAG_HWSURFACE /* Surface is in video memory */
#define GAL_ASYNCBLIT 0x00000004 /* Use asynchronous blits if possible */
/* Available for GAL_SetVideoMode() */
#define GAL_ANYFORMAT 0x10000000 /* Allow any video depth/pixel-format */
#define GAL_HWPALETTE 0x20000000 /* Surface has exclusive palette */
#define GAL_DOUBLEBUF 0x40000000 /* Set up double-buffered video mode */
#define GAL_FULLSCREEN 0x80000000 /* Surface is a full screen display */
#define GAL_SWSURFACE 0x00000000 /* Surface is in system memory */
#define GAL_HWSURFACE 0x00000001 /* Surface is in video memory */
#define GAL_ASYNCBLIT 0x00000004 /* Use asynchronous blits if possible */
#define GAL_SRCCOLORKEY 0x00001000 /* Blit uses a source color key */
#define GAL_RLEACCELOK 0x00002000 /* Private flag */
#define GAL_RLEACCEL 0x00004000 /* Surface is RLE encoded */
#define GAL_SRCALPHA 0x00010000 /* Blit uses source alpha blending */
#define GAL_SRCPIXELALPHA 0x00020000 /* Blit uses source per-pixel alpha blending */
/* Used internally (read-only) */
#define GAL_HWACCEL 0x00000100 /* Blit uses hardware acceleration */
#define GAL_SRCCOLORKEY MEMDC_FLAG_SRCCOLORKEY /* Blit uses a source color key */
#define GAL_RLEACCELOK 0x00002000 /* Private flag */
#define GAL_RLEACCEL MEMDC_FLAG_RLEACCEL /* Surface is RLE encoded */
#define GAL_SRCALPHA MEMDC_FLAG_SRCALPHA /* Blit uses source alpha blending */
#define GAL_SRCPIXELALPHA MEMDC_FLAG_SRCPIXELALPHA /* Blit uses source per-pixel alpha blending */
#define GAL_PREALLOC 0x01000000 /* Surface uses preallocated memory */
#define GAL_HWACCEL 0x00000100 /* Blit uses hardware acceleration */
#define GAL_PREALLOC 0x01000000 /* Surface uses preallocated memory */
#define GAL_FORMAT_CHECKED 0x02000000 /* Pixman format checked */
/* Available for GAL_SetVideoMode() */
#define GAL_ANYFORMAT 0x10000000 /* Allow any video depth/pixel-format */
#define GAL_HWPALETTE 0x20000000 /* Surface has exclusive palette */
#define GAL_DOUBLEBUF 0x40000000 /* Set up double-buffered video mode */
#define GAL_FULLSCREEN 0x80000000 /* Surface is a full screen display */
/* Make sure the macros are ok */
#define MGUI_COMPILE_TIME_ASSERT(name, x) \
typedef int MGUI_dummy_ ## name[((x)?1:0) * 2 - 1]
MGUI_COMPILE_TIME_ASSERT(swsurface, GAL_SWSURFACE == MEMDC_FLAG_SWSURFACE);
MGUI_COMPILE_TIME_ASSERT(hwsurface, GAL_HWSURFACE == MEMDC_FLAG_HWSURFACE);
MGUI_COMPILE_TIME_ASSERT(colorkey, GAL_SRCCOLORKEY == MEMDC_FLAG_SRCCOLORKEY);
MGUI_COMPILE_TIME_ASSERT(rleaccel, GAL_RLEACCEL == MEMDC_FLAG_RLEACCEL);
MGUI_COMPILE_TIME_ASSERT(srcalpha, GAL_SRCALPHA == MEMDC_FLAG_SRCALPHA);
MGUI_COMPILE_TIME_ASSERT(srcpixelapha, GAL_SRCPIXELALPHA == MEMDC_FLAG_SRCPIXELALPHA);
#undef MGUI_COMPILE_TIME_ASSERT
/* Evaluates to true if the surface needs to be locked before access */
#define GAL_MUSTLOCK(surface) \
@@ -407,7 +438,7 @@ void GAL_UpdateRect
(GAL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
#ifdef _MGUSE_UPDATE_REGION
BLOCKHEAP __mg_free_update_region_list;
extern BLOCKHEAP __mg_free_update_region_list;
#endif
BOOL GAL_SyncUpdate (GAL_Surface *screen);
@@ -600,6 +631,7 @@ GAL_Surface *GAL_CreateSharedRGBSurface (GAL_VideoDevice* video,
#define ST_PIXEL_ARGB4444 0x0001
#define ST_PIXEL_ARGB1555 0x0002
#define ST_PIXEL_ARGB8888 0x0003
#define ST_PIXEL_XRGB565 0x0004
#endif /* not define ST_PIXEL_MASK */
/* Allocate a shared RGB surface from the current video device. */
@@ -773,6 +805,58 @@ void GAL_GetClipRect (GAL_Surface *surface, GAL_Rect *rect);
GAL_Surface *GAL_ConvertSurface
(GAL_Surface *src, GAL_PixelFormat *fmt, Uint32 flags);
#ifdef _MGUSE_PIXMAN
BOOL GAL_CreatePixmanImage (GAL_Surface *surface);
static inline BOOL GAL_CheckPixmanFormats (GAL_Surface *src, GAL_Surface *dst)
{
if (GAL_CreatePixmanImage (src)) {
if (dst != NULL && dst != src)
return GAL_CreatePixmanImage (dst);
return TRUE;
}
return FALSE;
}
typedef struct GAL_BlittingContext {
uint16_t op;
uint16_t filter;
uint32_t alpha_bits;
pixman_image_t *msk_img;
} GAL_BlittingContext;
int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops);
int GAL_CleanupBlitting (GAL_Surface *src, GAL_Surface *dst);
int GAL_SetupStretchBlit (GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect,
const STRETCH_EXTRA_INFO *sei, DWORD ops);
int GAL_CleanupStretchBlit (GAL_Surface *src, GAL_Surface *dst);
#else /* defined _MGUSE_PIXMAN */
static inline int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops) {
return 0;
}
static inline int GAL_CleanupBlitting (GAL_Surface *src, GAL_Surface *dst) {
return 0;
}
static inline int GAL_SetupStretchBlit (GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect,
const STRETCH_EXTRA_INFO *sei, DWORD ops) {
return 0;
}
static inline int GAL_CleanupStretchBlit (GAL_Surface *src, GAL_Surface *dst) {
return 0;
}
#endif /* not defined _MGUSE_PIXMAN */
/*
* This performs a fast blit from the source surface to the destination
* surface. It assumes that the source and destination rectangles are
@@ -839,21 +923,26 @@ GAL_Surface *GAL_ConvertSurface
* fullscreen application. The lock will also fail until you have access
* to the video memory again.
*/
/* You should call GAL_BlitSurface() unless you know exactly how GAL
blitting works internally and how to use the other blit functions.
*/
#define GAL_BlitSurface GAL_UpperBlit
/* This is the public blit function, GAL_BlitSurface(), and it performs
rectangle validation and clipping before passing it to GAL_LowerBlit()
*/
int GAL_UpperBlit (GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect);
GAL_Surface *dst, GAL_Rect *dstrect, DWORD op);
/* This is a semi-private blit function and it performs low-level surface
blitting only.
*/
int GAL_LowerBlit (GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect);
GAL_Surface *dst, GAL_Rect *dstrect, DWORD op);
/* You should call GAL_BlitSurface() unless you know exactly how GAL
blitting works internally and how to use the other blit functions.
*/
static inline int GAL_BlitSurface (GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect)
{
return GAL_UpperBlit (src, srcrect, dst, dstrect, 0);
}
/*
* This function performs a fast fill of the given rectangle with 'color'
@@ -864,14 +953,12 @@ int GAL_LowerBlit (GAL_Surface *src, GAL_Rect *srcrect,
* can be generated by the GAL_MapRGB() function.
* This function returns 0 on success, or -1 on error.
*/
int GAL_FillRect
(GAL_Surface *dst, const GAL_Rect *dstrect, Uint32 color);
int GAL_FillRect (GAL_Surface *dst, const GAL_Rect *dstrect, Uint32 color);
/*
* This function returns the size of pad-aligned box bitmap.
*/
Uint32 GAL_GetBoxSize
(GAL_Surface *src, Uint32 w, Uint32 h, Uint32* pitch_p);
Uint32 GAL_GetBoxSize (GAL_Surface *src, Uint32 w, Uint32 h, Uint32* pitch_p);
/*
* This function copies pixels in a rect from the surface to a box.
@@ -919,8 +1006,9 @@ GAL_Surface * GAL_DisplayFormat (GAL_Surface *surface);
*/
GAL_Surface * GAL_DisplayFormatAlpha (GAL_Surface *surface);
int GAL_SoftStretch (GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect);
int GAL_StretchBlt (GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect,
const STRETCH_EXTRA_INFO *sei, DWORD ops);
#ifdef _MGSCHEMA_COMPOSITING
extern GAL_Surface* __gal_screen;
+6 -1
View File
@@ -154,7 +154,12 @@ int __mg_get_znode_at_point (const ZORDERINFO* zi, int x, int y, HWND* hwnd);
int __mg_do_reghook_operation (int cli, const REGHOOKINFO* info);
int __mg_handle_mouse_hook (int message, WPARAM wParam, LPARAM lParam);
int __mg_do_change_topmost_layer (void);
#ifdef _MGSCHEMA_COMPOSITING
int __mg_prepare_layer_for_compositing (MG_Layer* layer);
int __mg_end_up_layer_for_compositing (MG_Layer* layer);
#endif
int __mg_do_change_topmost_layer (MG_Layer* new_topmost);
MG_Layer* __mg_find_layer_by_name (const char* name);
+22 -17
View File
@@ -87,7 +87,7 @@ typedef struct _ZORDERNODE {
int nr_dirty_rcs; /* the number of dirty rects */
const RECT* dirty_rcs; /* the pointer to the dirty rectangles */
#else /* defined _MGSCHEMA_COMPOSITING */
unsigned int age; /* znode age */
DWORD age; /* znode age */
RECT dirty_rc; /* dirty rectangle */
#endif /* not defined _MGSCHEMA_COMPOSITING */
@@ -133,6 +133,8 @@ typedef struct _ZORDERINFO {
int first_launcher;
int active_win;
int old_active;
int next_active;
int cli_trackmenu;
@@ -156,12 +158,13 @@ typedef struct _ZORDERINFO {
typedef ZORDERINFO* PZORDERINFO;
#define MAX_NR_SPECIAL_ZNODES(zi) \
(zi->max_nr_tooltips + zi->max_nr_globals + \
(zi->max_nr_globals + \
zi->max_nr_screenlocks + zi->max_nr_dockers + \
zi->max_nr_launchers + NR_FIXED_ZNODES)
#define MAX_NR_GENERAL_ZNODES(zi) \
(zi->max_nr_topmosts + zi->max_nr_normals)
(zi->max_nr_tooltips + zi->max_nr_topmosts + \
zi->max_nr_normals)
#define MAX_NR_ZNODES(zi) \
MAX_NR_SPECIAL_ZNODES(zi) + MAX_NR_GENERAL_ZNODES(zi)
@@ -178,7 +181,7 @@ typedef ZORDERINFO* PZORDERINFO;
(ZORDERNODE*)((char*)((zi)+1)+ (zi)->size_usage_bmp)
#define GET_MASKRECT_USAGEBMP(zi) \
((char *)((zi) + 1) + (zi)->size_usage_bmp + \
((unsigned char *)((zi) + 1) + (zi)->size_usage_bmp + \
sizeof (ZORDERNODE) * (MAX_NR_ZNODES_WITH_PPP(zi)))
#define GET_MASKRECT(zi) \
@@ -187,25 +190,25 @@ typedef ZORDERINFO* PZORDERINFO;
/* round to multiple of 8 to aoivd alignment issue */
#define SIZE_MASKRECT_USAGE_BMP \
ROUND_TO_MULTIPLE((DEF_NR_MASKRECT >> 3), 8)
ROUND_TO_MULTIPLE((DEF_NR_MASKRECTS >> 3), 8)
#define NR_SPECIAL_ZNODES(zi) \
(zi->nr_tooltips + zi->nr_globals + \
(zi->nr_globals + \
zi->nr_screenlocks + zi->nr_dockers + \
zi->nr_launchers + NR_FIXED_ZNODES)
#define NR_GENERAL_ZNODES(zi) \
(zi->nr_topmosts + zi->nr_normals)
(zi->nr_tooltips + zi->nr_topmosts + zi->nr_normals)
#define NR_ZNODES(zi) \
NR_SPECIAL_ZNODES(zi) + NR_GENERAL_ZNODES(zi)
/* Since 5.0.0: more levels */
#define SIZE_USAGE_BMP_GENERAL(max_nr_t, max_nr_n) \
((7 + (max_nr_t) + (max_nr_n)) >> 3)
((7 + DEF_NR_TOOLTIPS + (max_nr_t) + (max_nr_n)) >> 3)
#define SIZE_USAGE_BMP_SPECIAL(max_nr_g) \
((7 + DEF_NR_TOOLTIPS + max_nr_g + \
((7 + max_nr_g + \
DEF_NR_SCREENLOCKS + DEF_NR_DOCKERS + \
DEF_NR_LAUNCHERS + NR_FIXED_ZNODES) >> 3)
@@ -234,15 +237,15 @@ typedef ZORDERINFO* PZORDERINFO;
MG_UNLIKELY ((idx) > MAX_NR_ZNODES(zi))
#define IS_TYPE_GENERAL(type) \
(type == ZOF_TYPE_HIGHER || \
type == ZOF_TYPE_NORMAL)
((type) == ZOF_TYPE_TOOLTIP || \
(type) == ZOF_TYPE_HIGHER || \
(type) == ZOF_TYPE_NORMAL)
#define IS_TYPE_SPECIAL(type) \
(type == ZOF_TYPE_TOOLTIP || \
type == ZOF_TYPE_GLOBAL || \
type == ZOF_TYPE_SCREENLOCK || \
type == ZOF_TYPE_DOCKER || \
type == ZOF_TYPE_LAUNCHER)
((type) == ZOF_TYPE_GLOBAL || \
(type) == ZOF_TYPE_SCREENLOCK || \
(type) == ZOF_TYPE_DOCKER || \
(type) == ZOF_TYPE_LAUNCHER)
#define ZOF_TYPE_TO_LEVEL_IDX(type) ((int)(8 - ((type) >> 28)))
@@ -250,12 +253,14 @@ typedef ZORDERINFO* PZORDERINFO;
extern "C" {
#endif /* __cplusplus */
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals);
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals, BOOL with_maskrc_heap);
void __kernel_free_z_order_info (ZORDERINFO* zi);
int __kernel_get_window_region (HWND pWin, CLIPRGN* region);
int __kernel_get_next_znode (const ZORDERINFO* zi, int from);
int __kernel_get_prev_znode (const ZORDERINFO* zi, int from);
void __mg_sync_special_nodes (ZORDERINFO* from, ZORDERINFO* to);
#ifdef __cplusplus
}
#endif /* __cplusplus */
+85 -62
View File
@@ -59,103 +59,91 @@
#include "common.h"
#include "minigui.h"
#include "gdi.h"
#include "constants.h"
#include "blockheap.h"
#include "misc.h"
void InitBlockDataHeap (PBLOCKHEAP heap, size_t bd_size, size_t heap_size)
BOOL InitBlockDataHeap (PBLOCKHEAP heap, size_t sz_block, size_t sz_heap)
{
#ifdef _MGRM_THREADS
pthread_mutex_init (&heap->lock, NULL);
#endif
heap->sz_usage_bmp = (sz_heap + 7) >> 3;
heap->sz_block = ROUND_TO_MULTIPLE (sz_block, SIZEOF_PTR);
heap->sz_heap = heap->sz_usage_bmp << 3;
heap->nr_alloc = 0;
if (heap->sz_heap == 0 || heap->sz_block == 0)
goto failed;
if ((heap->heap = calloc (heap->sz_heap, heap->sz_block)) == NULL)
goto failed;
if ((heap->usage_bmp = calloc (heap->sz_usage_bmp, sizeof (char))) == NULL) {
free (heap->heap);
goto failed;
}
memset (heap->usage_bmp, 0xFF, heap->sz_usage_bmp);
return TRUE;
failed:
heap->heap = NULL;
heap->bd_size = bd_size + sizeof (DWORD);
heap->heap_size = heap_size;
heap->usage_bmp = NULL;
return FALSE;
}
void* BlockDataAlloc (PBLOCKHEAP heap)
{
int i;
char* block_data = NULL;
int free_slot;
unsigned char* block_data = NULL;
#ifdef _MGRM_THREADS
pthread_mutex_lock (&heap->lock);
#endif
if (heap->heap == NULL) {
if (!(heap->heap = calloc (heap->heap_size, heap->bd_size)))
goto ret;
heap->free = 0;
free_slot = __mg_lookfor_unused_slot (heap->usage_bmp, heap->sz_usage_bmp, 1);
if (free_slot >= 0) {
block_data = heap->heap + heap->sz_block * free_slot;
_DBG_PRINTF ("Allocated one block in the block heap: %p (%d)\n",
heap, free_slot);
goto ret;
}
block_data = (char*) heap->heap + heap->bd_size*heap->free;
for (i = heap->free; i < heap->heap_size; i++) {
if (*((DWORD*)block_data) == BDS_FREE) {
heap->free = i + 1;
*((DWORD*)block_data) = BDS_USED;
#if 0
fprintf (stderr, "heap: %p, Allocated: %d, free: %d.\n", heap, i, heap->free);
fprintf (stderr, "Heap: (bd_size: %d, heap_size: %d, heap: %p).\n",
heap->bd_size, heap->heap_size, heap->heap);
#endif
goto ret;
}
block_data += heap->bd_size;
}
#if 0
if (!(block_data = calloc (1, heap->bd_size)))
if ((block_data = calloc (1, heap->sz_block)) == NULL)
goto ret;
#else
if (!(block_data = mg_slice_alloc0 (heap->bd_size)))
goto ret;
#endif
*((DWORD*)block_data) = BDS_SPECIAL;
heap->nr_alloc++;
ret:
#ifdef _MGRM_THREADS
pthread_mutex_unlock (&heap->lock);
#endif
if (block_data)
return block_data + sizeof (DWORD);
return NULL;
return block_data;
}
void BlockDataFree (PBLOCKHEAP heap, void* data)
{
int i;
char* block_data;
unsigned char* block_data = data;
#ifdef _MGRM_THREADS
pthread_mutex_lock (&heap->lock);
#endif
block_data = (char*) data - sizeof (DWORD);
if (*((DWORD*)block_data) == BDS_SPECIAL) {
#if 0
if (block_data < heap->heap ||
block_data > (heap->heap + heap->sz_block * heap->sz_heap)) {
free (block_data);
#else
mg_slice_free (heap->bd_size, block_data);
#endif
heap->nr_alloc--;
}
else if (*((DWORD*)block_data) == BDS_USED) {
*((DWORD*)block_data) = BDS_FREE;
else {
int slot;
slot = (block_data - heap->heap) / heap->sz_block;
__mg_slot_clear_use (heap->usage_bmp, slot);
i = (block_data - (char*)heap->heap)/heap->bd_size;
if (heap->free > i)
heap->free = i;
#if 0
fprintf (stderr, "Heap: %p: Freed: %d, free: %d.\n", heap, i, heap->free);
fprintf (stderr, "Heap: (bd_size: %d, heap_size: %d, heap: %p).\n",
heap->bd_size, heap->heap_size, heap->heap);
#endif
_DBG_PRINTF ("Freed one block in the block heap: %p (%d)\n",
heap, slot);
}
#ifdef _MGRM_THREADS
@@ -165,13 +153,48 @@ void BlockDataFree (PBLOCKHEAP heap, void* data)
void DestroyBlockDataHeap (PBLOCKHEAP heap)
{
#if 0
fprintf (stderr, "Heap: (bd_size: %d, heap_size: %d, heap: %p).\n",
heap->bd_size, heap->heap_size, heap->heap);
int nr_free_slots;
if (heap->nr_alloc > 0) {
_WRN_PRINTF ("There are still not freed extra blocks in the block heap: %p (%zu)\n",
heap, heap->nr_alloc);
}
nr_free_slots = __mg_get_nr_idle_slots (heap->usage_bmp, heap->sz_usage_bmp);
if (nr_free_slots != heap->sz_heap) {
_WRN_PRINTF ("There are still not freed blocks in the block heap: %p (%zu)\n",
heap, heap->sz_heap - nr_free_slots);
#ifdef _DEBUG
{
unsigned char* bitmap = heap->usage_bmp;
int slot = 0;
int i, j;
for (i = 0; i < heap->sz_usage_bmp; i++) {
for (j = 0; j < 8; j++) {
if (!(*bitmap & (0x80 >> j))) {
_WRN_PRINTF ("Still used slot in the block heap: %p (%d)\n",
heap, slot);
}
slot++;
}
bitmap++;
}
}
assert (0);
#endif
}
free (heap->heap);
heap->heap = NULL;
free (heap->usage_bmp);
heap->usage_bmp = NULL;
#ifdef _MGRM_THREADS
pthread_mutex_destroy (&heap->lock);
#endif
free (heap->heap);
}
File diff suppressed because it is too large Load Diff
+69 -16
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2002~2020, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 2002~2021, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
* This program is free software: you can redistribute it and/or modify
@@ -377,16 +377,16 @@ void __mg_composite_dirty_znodes (void)
#endif /* optimized */
static void purge_znodes_private_data_in_layer (const CompositorOps* ops,
CompositorCtxt* ctxt, MG_Layer* layer)
static void purge_all_znodes_private_data (const CompositorOps* ops,
CompositorCtxt* ctxt)
{
ZORDERINFO* zi;
ZORDERNODE* nodes;
int i, next;
MG_Layer* layer;
zi = (ZORDERINFO*)layer->zorder_info;
// travel popup menu znodes
/* travel menu znodes on the topmost layer */
zi = (ZORDERINFO*)mgTopmostLayer->zorder_info;
if (zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) {
@@ -397,25 +397,56 @@ static void purge_znodes_private_data_in_layer (const CompositorOps* ops,
}
}
// travel window znodes
nodes = GET_ZORDERNODE(zi);
next = 0;
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
if (nodes[next].priv_data && ops->purge_win_data) {
ops->purge_win_data (ctxt, layer, next, nodes[next].priv_data);
nodes[next].priv_data = NULL;
/* travel all window znodes in all layers */
layer = mgLayers;
while (layer) {
zi = (ZORDERINFO*)layer->zorder_info;
nodes = GET_ZORDERNODE(zi);
next = 0;
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
if (nodes[next].priv_data && ops->purge_win_data) {
ops->purge_win_data (ctxt, layer, next, nodes[next].priv_data);
nodes[next].priv_data = NULL;
}
}
layer = layer->next;
}
}
static inline void purge_all_znodes_private_data (const CompositorOps* ops,
static void rebuild_all_znodes_private_data (const CompositorOps* ops,
CompositorCtxt* ctxt)
{
ZORDERINFO* zi;
ZORDERNODE* nodes;
int i, next;
MG_Layer* layer;
/* travel menu znodes on the topmost layer */
zi = (ZORDERINFO*)mgTopmostLayer->zorder_info;
if (zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) {
if (nodes[i].flags & ZOF_VISIBLE) {
ops->on_showing_ppp (ctxt, i);
}
}
}
/* travel all window znodes in all layers */
layer = mgLayers;
while (layer) {
purge_znodes_private_data_in_layer (ops, ctxt, layer);
zi = (ZORDERINFO*)layer->zorder_info;
nodes = GET_ZORDERNODE(zi);
next = 0;
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
if (nodes[next].flags & ZOF_VISIBLE) {
ops->on_showing_win (ctxt, layer, next);
}
}
layer = layer->next;
}
}
@@ -458,7 +489,7 @@ const CompositorOps* GUIAPI ServerGetCompositorOps (const char* name)
return NULL;
for (i = 0; i < MAX_NR_COMPOSITORS; i++) {
if (strcmp (compositors [i].name, name) == 0) {
if (compositors [i].name && strcmp (compositors [i].name, name) == 0) {
return compositors [i].ops;
}
}
@@ -539,6 +570,9 @@ const CompositorOps* GUIAPI ServerSelectCompositor (const char* name,
}
curr_ops = ops;
curr_ctxt = ctxt;
/* Since 5.0.3, to rebuild the private data of visible znodes */
rebuild_all_znodes_private_data (curr_ops, curr_ctxt);
curr_ops->refresh (ctxt);
}
@@ -549,5 +583,24 @@ const CompositorOps* GUIAPI ServerSelectCompositor (const char* name,
return NULL;
}
const char* GUIAPI ServerGetCurrentCompositor (
const CompositorOps** ops, CompositorCtxt** ctxt)
{
int i;
const CompositorOps* the_ops;
the_ops = ServerSelectCompositor (NULL, ctxt);
if (ops) {
*ops = the_ops;
}
for (i = 0; i < MAX_NR_COMPOSITORS; i++) {
if (compositors [i].ops == the_ops)
return compositors [i].name;
}
return NULL;
}
#endif /* defined(_MGRM_PROCESSES) && defined(_MGSCHEMA_COMPOSITING) */
+2 -2
View File
@@ -48,7 +48,7 @@ static HCURSOR load_cursor_from_file (const char* filename)
{
FILE* fp;
WORD16 wTemp;
int w, h, xhot, yhot, colornum;
int w=0, h=0, xhot=0, yhot=0, colornum=0;
#if 0
DWORD32 size;
#endif
@@ -152,7 +152,7 @@ static HCURSOR load_cursor_from_mem (const void* area)
const Uint8* p = (Uint8*)area;
WORD16 wTemp;
int w, h, xhot, yhot, colornum;
int w=0, h=0, xhot=0, yhot=0, colornum=0;
#if 0
DWORD32 size;
#endif
+20 -10
View File
@@ -104,7 +104,7 @@ static PMAINWIN dskSetActiveWindow (PMAINWIN pWin)
if (pWin == pOldActive)
return pOldActive;
pOldActive = (PMAINWIN) dskSetActiveZOrderNode (0, pWin?pWin->idx_znode:0);
pOldActive = (PMAINWIN) dskSetActiveZOrderNode (__mg_zorder_info, 0, pWin?pWin->idx_znode:0);
#ifndef _MGRM_PROCESSES /*for MiniGUI-Threads, not for MiniGUI-StandAlone*/
if (pOldActive != (PMAINWIN)HWND_INVALID && __mg_ime_wnd)
@@ -368,6 +368,15 @@ static BOOL dskSetMainWindowAlwaysTop (PMAINWIN pWin, BOOL fSet)
return TRUE;
}
/* Since 5.0.6 */
static inline int dskSetMainWindowGestureFlags (PMAINWIN pWin, DWORD dwFlags)
{
if (dskSetZNodeGestureFlags (0, pWin->idx_znode, dwFlags))
return FALSE;
return TRUE;
}
/* Since 5.0.0 */
static int dskSetWindowMask (HWND pWin, const WINMASKINFO* mask_info)
{
@@ -667,7 +676,7 @@ static LRESULT KeyMessageHandler (UINT message, int scancode, DWORD status)
if (next_node) {
dskMove2Top (0, next_node);
dskSetActiveZOrderNode (0, next_node);
dskSetActiveZOrderNode (__mg_zorder_info, 0, next_node);
}
return 0;
}
@@ -1424,7 +1433,11 @@ static LRESULT WindowMessageHandler(UINT message, PMAINWIN pWin, LPARAM lParam)
/* Since 5.0.0 */
case MSG_SETALWAYSTOP:
return dskSetMainWindowAlwaysTop(pWin, (BOOL)lParam);
return dskSetMainWindowAlwaysTop (pWin, (BOOL)lParam);
/* Since 5.0.6 */
case MSG_SETGESTUREFLAGS:
return dskSetMainWindowGestureFlags (pWin, (DWORD)lParam);
/* Since 5.0.0 */
case MSG_SETWINDOWMASK:
@@ -1855,7 +1868,7 @@ void GUIAPI DesktopUpdateAllWindow(void)
SendMessage(HWND_DESKTOP, MSG_PAINT, 0, 0);
}
static void dskOnTimer (void)
static void dskOnTimeout (void)
{
static DWORD uCounter = 0;
static DWORD blink_counter = 0;
@@ -2137,7 +2150,10 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message,
break;
#endif
/* Since 5.0.6, the desktop handles caret blinking in MSG_TIMEOUT
message, and the interval for this message changes to about 0.05s. */
case MSG_TIMEOUT:
dskOnTimeout ();
// Since 5.0.0: MSG_IDLE messages will be generated by PeekMessage.
// BroadcastMessageInThisThread (MSG_IDLE, wParam, 0);
break;
@@ -2171,12 +2187,6 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message,
dsk_ops->mouse_handler(dt_context, message, wParam, lParam);
break;
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMER
message, and the interval for this MSG_TIMER changes to about 0.05s. */
case MSG_TIMER:
dskOnTimer ();
break;
default:
break;
}
+484 -187
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -113,7 +113,8 @@ BOOL mg_InitDesktop (void)
/*
* Init ZOrderInfo here.
*/
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS);
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS,
TRUE);
if (ret < 0) {
_WRN_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n");
return FALSE;
+2 -1
View File
@@ -112,7 +112,8 @@ BOOL mg_InitDesktop (void)
/*
* Init ZOrderInfo here.
*/
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS);
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS,
TRUE);
if (ret < 0) {
_WRN_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n");
return FALSE;

Some files were not shown because too many files have changed in this diff Show More