Compare commits

..
Author SHA1 Message Date
Vincent Wei 4e6809618a new function: concurrentTask_Do 2021-05-21 17:17:46 +08:00
Vincent Wei 9befaeb68a initial implementation of concurrent tasks 2021-05-21 15:53:18 +08:00
Vincent Wei 87b9facc84 initial implementation of concurrent blitting 2021-05-20 22:14:28 +08:00
Vincent Wei ad49fe0e0e fix warnings for conditional compilation 2021-05-19 13:16:19 +08:00
Vincent Wei ed0521df84 tune constants 2021-05-19 12:00:53 +08:00
Vincent Wei 002a03c087 shrink heap size for fixed string 2021-05-19 11:47:55 +08:00
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
Vincent Wei 18f51a113d add missed map.h file 2020-04-10 14:07:10 +08:00
Vincent Wei 12313a2646 change version of minigui-res to 5.0.0 2020-03-29 17:24:26 +08:00
Vincent Wei 3ce8e5e8af set default exdriver for DRM engine: libhidrmdrivers-0.2.so.0 2020-03-27 16:20:31 +08:00
Vincent Wei a8b54bc301 cleanup 2020-03-26 19:21:52 +08:00
Vincent Wei 7f711b383a cleanup 2020-03-26 19:09:39 +08:00
Vincent Wei bbda500121 cleanup 2020-03-26 18:10:51 +08:00
Vincent Wei deb248c96e Merge branch 'rel-5-0' of gitlab.fmsoft.cn:VincentWei/minigui into rel-5-0 2020-03-26 18:10:12 +08:00
Vincent Wei c8e9b72663 a workaround for client windows are not completely updated because of moving a window 2020-03-26 18:10:05 +08:00
Vincent Wei 0ff551a2da call SyncUpdateDC after calling FocusRect on HDC_SCREEN_SYS 2020-03-26 18:08:41 +08:00
Vincent Wei aef1e366f4 cleanup 2020-03-26 10:32:59 +08:00
Vincent Wei 41d8a80c8e bugfixing: merge global dirty rectagnle before synchronizing update 2020-03-26 10:32:33 +08:00
Vincent Wei cbd2cea0e9 remove _DEBUG 2020-03-25 20:07:09 +08:00
Vincent Wei 0c5f5115e6 fix a memory leak: free the default video surface in GAL_SetVideoModeInfo 2020-03-25 20:03:32 +08:00
Vincent Wei 86da42231c only treat ppp and wpp for topmost layer 2020-03-25 17:54:04 +08:00
Vincent Wei 20974f305a use dirty type to optimize the compositor 2020-03-25 17:31:19 +08:00
Vincent Wei 5a22e67680 bugfixing: bad implementation of generate_dirty_region; generate_dirty_region -> merge_dirty_region 2020-03-25 17:28:31 +08:00
Vincent Wei bae24f0964 tune words 2020-03-25 15:36:40 +08:00
Vincent Wei 2871657b65 fix some typos 2020-03-25 15:24:48 +08:00
Vincent Wei 767a8b088e tune URLs to release notes 2020-03-25 10:56:22 +08:00
Vincent Wei 2f77a0a8c8 Tune words 2020-03-24 22:05:07 +08:00
Vincent Wei 2900f37c23 merge from dev-4-1 for 5.0.0 2020-03-24 20:25:27 +08:00
Vincent Wei a693fa7dc2 optimize __mg_composite_dirty_znodes 2020-03-24 13:00:10 +08:00
Vincent Wei f7cb85401c add version to __ex_compositor_get; tune operations of CompositorOps to optimize it 2020-03-24 12:59:37 +08:00
Vincent Wei 433d5d6cc5 try to optimze cursor refresh (not finished) 2020-03-23 22:08:47 +08:00
Vincent Wei 98b66f158f comment out asynchronous update code 2020-03-23 19:00:14 +08:00
Vincent Wei 4fc71946ca support for asynchronous update 2020-03-23 18:45:13 +08:00
Vincent Wei 59c609dc2d fix a conditional compilation error 2020-03-23 18:22:45 +08:00
Vincent Wei ce6525d8f2 calling MainWindowCleanup for AboutDialogBox 2020-03-22 22:53:25 +08:00
Vincent Wei bbd1776911 only increase refcount for surface create for window and menu created by the server 2020-03-22 22:52:57 +08:00
Vincent Wei f196a67afe call EmptyClipRgn for temp region ergn 2020-03-22 22:52:01 +08:00
Vincent Wei 5f895b2ad9 increase refcount of surface for all memory DC 2020-03-22 20:01:36 +08:00
Vincent Wei e5c31ee766 free real screen surface when double buffering enabled 2020-03-22 20:00:44 +08:00
Vincent Wei 9f244a1093 call drmModeDirtyFB in SyncUpdate 2020-03-22 20:00:24 +08:00
Vincent Wei 43c387d0a0 debug for use refcount for all memory dc 2020-03-22 19:59:23 +08:00
Vincent Wei f662f45e86 no need to free surface explicitly 2020-03-22 19:48:51 +08:00
Vincent Wei 602f3c5748 remove debug printf 2020-03-22 18:24:47 +08:00
Vincent Wei 74f727cb2e fix a bug: must reset olddownkey to zero when got a KEYUP event 2020-03-22 18:05:32 +08:00
Vincent Wei dccc997e75 tune 2020-03-22 17:43:50 +08:00
Vincent Wei 41858de966 fix a bug: pass correct select timeout value 2020-03-22 17:37:43 +08:00
Vincent Wei 86b4d9c9ab fix a bug: always pass cli=0 for dskCalculateDefaultPosition 2020-03-22 17:36:18 +08:00
Vincent Wei 4144065fb8 tune comments 2020-03-22 17:35:54 +08:00
Vincent Wei 7932f5f687 tune 2020-03-21 21:49:05 +08:00
Vincent Wei 0a54e292e9 tune 2020-03-21 21:47:03 +08:00
Vincent Wei d3770381b8 add support for alpha_pixel_blt 2020-03-21 19:16:07 +08:00
Vincent Wei a5f13a023c tune ColorLogicalOp with the values from old DrmColorLogicOp 2020-03-21 19:15:37 +08:00
Vincent Wei 039121892b remove DrmColorLogicOp, use ColorLogicalOp instead; add alpha_pixel_blt operation 2020-03-21 19:15:01 +08:00
Vincent Wei 150f670d2e debug for hardware cursor by using plane 2020-03-21 18:49:20 +08:00
Vincent Wei 7fbd3ef4f3 tune code for authenticate client; remove use of drm_magic 2020-03-21 17:52:21 +08:00
Vincent Wei c03386f438 remove auth_magic 2020-03-21 17:48:57 +08:00
Vincent Wei 058db9ccdf handler authenticate_client for REQID_AUTHCLIENT 2020-03-21 17:48:40 +08:00
Vincent Wei a8c623b0dd remove drm_magic 2020-03-21 17:47:59 +08:00
Vincent Wei 50b7ee5fc2 add REQID_AUTHCLIENT 2020-03-21 17:47:43 +08:00
Vincent Wei 9a95f9b706 increase MAX_SYS_REQID for REQID_AUTHCLIENT 2020-03-21 17:47:08 +08:00
Vincent Wei 4da4e0b1ac tune 2020-03-21 15:41:21 +08:00
Vincent Wei 151400eac0 disable alpha for CT_COLORKEY 2020-03-21 15:39:49 +08:00
Vincent Wei f8bd1a67bc fix a conditional compilation error 2020-03-20 19:54:53 +08:00
Vincent Wei 3f65456f3f do not use dumb surface for shadow screen, use GAL_CreateRGBSurfaceInShm instead 2020-03-20 19:12:55 +08:00
Vincent Wei 8c102fcafd remove use of offset fields in GAL_Surface; initialize pixels_off to 0 2020-03-20 19:12:15 +08:00
Vincent Wei e8150805ff add surface-shm.c 2020-03-20 19:11:18 +08:00
Vincent Wei 88391c47d2 implement GAL_CreateRGBSurfaceInShm 2020-03-20 19:11:00 +08:00
Vincent Wei 8d8f51f660 remove offset field add pixels_off field in GAL_Surface; declare GAL_CreateRGBSurfaceInShm 2020-03-20 19:10:23 +08:00
Vincent Wei d2d10421b6 tune map_buffer 2020-03-19 22:29:10 +08:00
Vincent Wei 0e0c95e0a9 tune map_buffer: add scanout argument 2020-03-19 22:28:55 +08:00
Vincent Wei 61e22faeb9 pixels_size -> map_size 2020-03-19 21:45:08 +08:00
Vincent Wei d81d40f9b7 pixels_size -> map_size 2020-03-19 21:42:33 +08:00
Vincent Wei 66de31895a restore old DrmColorLogicOp 2020-03-19 21:41:38 +08:00
Vincent Wei bfec1da2a6 remove some unused code 2020-03-19 15:28:07 +08:00
Vincent Wei c76adc0602 test code: use memcpy directly for blitting from shadow screen to real screen 2020-03-19 12:09:45 +08:00
Vincent Wei 306dd9602a test code of sendfile 2020-03-18 22:40:01 +08:00
Vincent Wei 85c63e90fa use plane for hardware cursor 2020-03-18 18:06:01 +08:00
Vincent Wei cf537dd421 tune implementation accoring to the changes of DrmDriverOps and DrmSurfaceBuffer 2020-03-18 18:00:51 +08:00
Vincent Wei 334a77adaf tune DrmSurfaceInfo struct 2020-03-18 17:59:30 +08:00
Vincent Wei 6ce6de157b tune DrmSurfaceBuffer struct and DrmDriverOps 2020-03-18 17:58:58 +08:00
Vincent Wei 9eb0a8b40c cleanup debug info 2020-03-17 19:41:46 +08:00
Vincent Wei f1d670502c use plane for hardware cursor (not finished) 2020-03-17 17:32:39 +08:00
Vincent Wei 3269650084 use plane for hardware cursor (not finished) 2020-03-17 17:32:34 +08:00
Vincent Wei 53edb5dcba tune warning info 2020-03-17 17:31:46 +08:00
Vincent Wei 1f46ba258e change version to 4.9.2 2020-03-16 23:16:22 +08:00
Vincent Wei 959407d7ea do not use fd for get_shared_surface for sharedfb schema under PROC runmode 2020-03-16 23:01:28 +08:00
Vincent Wei 3eacf471ac tune 2020-03-16 23:00:35 +08:00
Vincent Wei a2b65ba39f add auth_magic 2020-03-16 23:00:09 +08:00
Vincent Wei 444d9bb1f7 call drmSetMaster and drmAuthMagic for sharedfb schema under PROCS runmode 2020-03-16 22:59:39 +08:00
Vincent Wei b54c186688 add auth magic for DRM engine in shared resource segment 2020-03-16 22:58:58 +08:00
Vincent Wei 19372b2fbb no need to use semaphore to lock the dirty rectangle 2020-03-16 22:58:24 +08:00
Vincent Wei 77c76c53ae tune 2020-03-16 22:57:51 +08:00
Vincent Wei 50ddc8e31c tune 2020-03-16 20:48:30 +08:00
Vincent Wei e67849db69 only mmap software shared surface 2020-03-16 20:45:41 +08:00
Vincent Wei 96a085170b tune error info 2020-03-16 20:44:57 +08:00
Vincent Wei ff6f42e291 debug 2020-03-16 20:44:34 +08:00
Vincent Wei f8ced41de6 add CopyVideoInfoToSharedRes method in GAL engine for PROCS and calling this method to copy the video info to shared resource segment when the process is the server 2020-03-16 17:38:50 +08:00
Vincent Wei 072ac4e166 send XVFB_CMD_QUIT command to pcxvfb process when terminating the IAL engine 2020-03-16 17:34:13 +08:00
Vincent Wei 43b8b8de59 add XVFBCmdEventData to send a command to pcxvfb process 2020-03-16 17:33:44 +08:00
Vincent Wei 5fa10b3d7f check name for shared surface 2020-03-16 14:49:16 +08:00
Vincent Wei fdac75dce0 call munmap only for software shared surface 2020-03-16 14:48:40 +08:00
Vincent Wei 44b8552307 call mg_DestroyFreeQMSGList after terminating desktop 2020-03-16 14:47:42 +08:00
Vincent Wei 6ad5529ee7 tune nr_lines_for_header 2020-03-15 22:17:14 +08:00
Vincent Wei 6b47d74be7 fix compilation errors/warnings 2020-03-15 22:11:16 +08:00
Vincent Wei 32f29cc159 implement UpdateRects and SyncUpdate 2020-03-15 21:28:08 +08:00
Vincent Wei 0d4b076fd5 tune fields of DrmVideoData 2020-03-15 21:27:41 +08:00
Vincent Wei cddfc2ed84 pass offset to __drm_create_surface_from_handle and __drm_create_surface_from_prime_fd 2020-03-15 21:27:14 +08:00
Vincent Wei 41b37abc13 define GAL_SharedSurfaceHeader structure for shadow surface bufffer 2020-03-15 19:17:33 +08:00
Vincent Wei d3e1837244 create dumb buffer from handle, name, and prime fd 2020-03-15 13:03:44 +08:00
Vincent Wei 1bc10fb83e use name when request the shared surface 2020-03-15 11:56:12 +08:00
Vincent Wei 7188627084 use name when request the shared surface 2020-03-15 11:55:43 +08:00
Vincent Wei 615d1e72d3 add real_name and shadow_name for double buffering 2020-03-15 11:55:09 +08:00
Vincent Wei cb8fb1a0c1 get info screen surfaces and create real_screen and shadow_screen for clients 2020-03-15 11:54:33 +08:00
Vincent Wei ed728100c3 more fields in SHAREDSURFINFO for convenience 2020-03-15 11:52:37 +08:00
Vincent Wei 56e24ff4ef check double buffering 2020-03-15 10:51:56 +08:00
Vincent Wei ba3a0030fc Do not init the fields in the shared resource segment for DRM engine; left them for DRM engine 2020-03-15 10:50:59 +08:00
Vincent Wei 2094cda9e5 tune fields in the shared resource segment for DRM engine 2020-03-15 10:50:15 +08:00
Vincent Wei aad307d676 define LEN_EXDRIVER_NAME is same as LEN_SO_NAME 2020-03-15 10:49:32 +08:00
Vincent Wei 3fa8169353 define backward compatible APIs for drmCreateDCFromXXX 2020-03-15 10:49:04 +08:00
Vincent Wei 5cf3418c15 more comments 2020-03-15 10:48:03 +08:00
Vincent Wei 3611804ecc change name of field map_size to size 2020-03-14 22:35:07 +08:00
Vincent Wei c121c87b75 add argument offset to drmCreateDCFromXXX functions 2020-03-14 22:34:29 +08:00
Vincent Wei 47f577b672 change field name 2020-03-14 22:34:03 +08:00
Vincent Wei 7ca92b6350 add some fields in GAL_PrivateVideoData for compisiting schema and double buffering 2020-03-14 22:33:32 +08:00
Vincent Wei e4cc1d4c26 code for sharedfb schema 2020-03-14 22:32:39 +08:00
Vincent Wei 9a076cba39 tune the argument types 2020-03-14 22:31:50 +08:00
Vincent Wei 74178caf8c change field map_size to size in SHAREDSURFINFO 2020-03-14 22:31:27 +08:00
Vincent Wei 4fee49aa43 add argument offset to drmCreateDCFromXXX functions 2020-03-14 22:31:01 +08:00
Vincent Wei fa13587088 restore drm_format field just for convenience 2020-03-14 22:29:50 +08:00
Vincent Wei 2b715208c0 add double_buffering key to drm section 2020-03-14 22:28:47 +08:00
Vincent Wei 1bbd5ea4f1 IS_SHAREDFB_SCHEMA -> IS_SHAREDFB_SCHEMA_PROCS; reflects for the changes of fields name and internal functions 2020-03-14 19:03:57 +08:00
Vincent Wei 4ea138ef19 implement methods for compositing schema and PROCS runmode 2020-03-14 19:01:49 +08:00
Vincent Wei a39c1caa4a tune fields name; add GAL_SharedSurfaceHeader for sharedfb schema 2020-03-14 19:00:17 +08:00
Vincent Wei b1b4ce2a66 remove redundant fields in DrmSurfaceInfo 2020-03-14 18:58:36 +08:00
Vincent Wei 7c92a9334d remove redundant fields in DrmSurfaceBuffer; simplify interfaces of DrmDriverOps 2020-03-14 18:57:42 +08:00
Vincent Wei aaa4ad1cbc tune description words 2020-03-13 15:02:03 +08:00
Vincent Wei 7b93d0878d tune COMMLCD engine for nwe GAL engine: use SyncUpdte method and sem_update semaphore insteadll dumb delaying 50ms 2020-03-13 14:34:42 +08:00
Vincent Wei 1c29f6373e fix a conditional compilation error 2020-03-13 14:33:03 +08:00
Vincent Wei 57bdcd4754 use get_sem_key_for_layers 2020-01-22 17:03:42 +08:00
Vincent Wei b95538a415 use a small static buffer for zero size surface 2020-01-22 17:03:19 +08:00
Vincent Wei fa7c84b2b5 enhance to delete old IPC objects 2020-01-22 17:02:57 +08:00
Vincent Wei bc77048488 make lock_zi_for_xxx/unlock_zi_for_xxx static inline 2020-01-22 17:02:22 +08:00
Vincent Wei 2f21b22a49 make lock_zi_for_xxx/unlock_zi_for_xxx static inline 2020-01-22 17:02:12 +08:00
Vincent Wei ec91986854 add inline functions for get shm/sem key for system/layer 2020-01-22 17:01:42 +08:00
Vincent Wei e7b03037be notes for 4.0.5 2020-01-22 17:01:02 +08:00
Vincent Wei 9ff822c7fd change version to 4.0.5 2020-01-03 14:45:12 +08:00
Vincent Wei 239924c63e BUGFIXING: always initialize csr_bmp fields with explicit assignments 2020-01-03 14:38:28 +08:00
Vincent Wei 2f85645e9d change version to 4.0.4 2020-01-03 14:37:50 +08:00
121 changed files with 10306 additions and 4510 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
+2 -2
View File
@@ -1,5 +1,5 @@
MAJOR_VERSION = 4
MINOR_VERSION = 1
MAJOR_VERSION = 5
MINOR_VERSION = 0
MICRO_VERSION = 0
EXTRAVERSION =
+225 -143
View File
File diff suppressed because it is too large Load Diff
+138 -46
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -1,11 +1,11 @@
Version 4.9.1 (2019/03/11)
Version 5.0.6 (2021/05/20)
This is the second preview version of MiniGUI 5.0.0, an unstable version.
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.4.tar.gz`
- The resource package: `minigui-res-4.0.0.tar.gz`
- GVFB: `gvfb-1.2.5.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+=
##################################################
+6 -1
View File
@@ -172,5 +172,10 @@ tab2space() {
# sed -i 's/\<checkAndGetMainWindowPtrOfMainWin\>/checkAndGetMainWinIfMainWin/g' `grep '\<checkAndGetMainWindowPtrOfMainWin\>' -rl include/ src/`
# sed -i 's/\<checkAndGetMainWindowPtrOfControl\>/checkAndGetMainWinIfWindow/g' `grep '\<checkAndGetMainWindowPtrOfControl\>' -rl include/ src/`
sed -i 's/\<mg_GetMsgQueueForThisThread\>/getMsgQueueForThisThread/g' `grep '\<mg_GetMsgQueueForThisThread\>' -rl include/ src/`
# sed -i 's/\<mg_GetMsgQueueForThisThread\>/getMsgQueueForThisThread/g' `grep '\<mg_GetMsgQueueForThisThread\>' -rl include/ src/`
# sed -i 's/\<IS_SHAREDFB_SCHEMA\>/IS_SHAREDFB_SCHEMA_PROCS/g' `grep '\<IS_SHAREDFB_SCHEMA\>' -rl include/ src/`
sed -i 's/\<REQID_GETWPSURFACE\>/REQID_GETSHAREDSURFACE/g' `grep '\<REQID_GETWPSURFACE\>' -rl include/ src/`
exit 0
+92 -23
View File
File diff suppressed because it is too large Load Diff
+20 -1
View File
@@ -72,9 +72,28 @@ device=/dev/dri/card0
# The default value is 96.
dpi=96
# Whether double buffering is enabled.
# Use `true` or `yes` for enabled, anything else for disabled.
# Note that under compositing schema, double buffering is always enabled.
# Since 5.0.0.
double_buffering=true
# The filename of the shared library for the external driver.
# The equivalent environment variable: MG_GAL_DRM_DRIVER
exdriver=libhidrmdrivers.so.0
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
-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.
+162 -86
View File
File diff suppressed because it is too large Load Diff
+277 -133
View File
File diff suppressed because it is too large Load Diff
+163 -27
View File
File diff suppressed because it is too large Load Diff
+139 -73
View File
File diff suppressed because it is too large Load Diff
+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)
+73 -28
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),
@@ -192,7 +214,7 @@ int GUIAPI ClientRequestEx2 (const REQUEST* request,
&& (__mg_client_id == 0 && request->id != REQID_JOINLAYER)) {
#elif defined(_MGSCHEMA_COMPOSITING)
if (__mg_client_id == 0 && request->id != REQID_JOINLAYER &&
request->id != REQID_GETWPSURFACE) {
request->id != REQID_GETSHAREDSURFACE) {
#else
if (__mg_client_id == 0 && request->id != REQID_JOINLAYER) {
#endif
@@ -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 -1
View File
@@ -735,9 +735,9 @@ get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
pcache->valid_advance = 1;
}
}
done:
#endif
done:
FT_UNLOCK(&ft_lock);
if (px) {
+2 -3
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;
@@ -163,13 +162,13 @@ extern void __mg_ttc_sys_deinit(void);
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache, Glyph32 gv, int *size);
extern void __mg_ttc_refer(HCACHE hCache);
#endif /* _MGFONT_TTF_CACHE */
#ifdef _MGCOMPLEX_SCRIPTS
extern void __mg_init_harzbuff_funcs(void);
extern void __mg_term_harzbuff_funcs(void);
#endif
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
+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",
+5 -4
View File
@@ -2203,14 +2203,15 @@ static int create_memdc_for_menu (TRACKMENUINFO* ptmi)
static void delete_memdc_for_menu (TRACKMENUINFO* ptmi)
{
if (ptmi->dc != HDC_INVALID) {
GAL_Surface *surf = GetSurfaceFromDC (ptmi->dc);
DeleteMemDC (ptmi->dc);
ptmi->dc = HDC_INVALID;
#if 0 /* deprecated code: we always do refcount++ for any memdc */
/* we must free the surface here, or it can not be freed actually
due to the referenced count. */
GAL_Surface *surf = GetSurfaceFromDC (ptmi->dc);
GAL_FreeSurface (surf);
#endif /* deprecated code */
DeleteMemDC (ptmi->dc);
ptmi->dc = HDC_INVALID;
}
}
+29 -14
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);
@@ -4261,7 +4263,7 @@ HWND GUIAPI CreateMainWindowEx2 (PMAINWINCREATE pCreateInfo, LINT id,
{pCreateInfo->lx, pCreateInfo->ty,
pCreateInfo->rx, pCreateInfo->by} };
// we ignore the retval. may fail for client of procs runmode
// we ignore the retval. may fail for client under procs runmode
SendMessage (HWND_DESKTOP, MSG_CALC_POSITION, 0, (LPARAM)&info);
pCreateInfo->lx = info.rc.left;
@@ -5393,6 +5395,7 @@ static BOOL _wndInvalidateRect(HWND hWnd, const RECT* prc, BOOL bEraseBkgnd, int
#endif
}
else {
_WRN_PRINTF ("The invalid region is forzen\n");
return FALSE;
}
@@ -5573,7 +5576,6 @@ HDC GUIAPI BeginPaint (HWND hWnd)
MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), HDC_INVALID);
pWin = MG_GET_WINDOW_PTR (hWnd);
if (pWin->pCaretInfo && pWin->pCaretInfo->fBlink) {
HideCaretEx (hWnd, FALSE);
pWin->pCaretInfo->fBlink = TRUE;
@@ -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"
+27 -18
View File
@@ -64,6 +64,9 @@ extern "C" {
#define SHOW_HIDE_TYPE 5
#define XVFB_CLOSE_TYPE 6
/* Since 5.0.0: command */
#define CMD_TYPE 7
struct PCXVFbKeyData
{
unsigned int unicode;
@@ -74,36 +77,35 @@ struct PCXVFbKeyData
typedef struct _XVFBKEYDATA
{
unsigned short key_code;
unsigned short key_state;
unsigned short key_code;
unsigned short key_state;
} XVFBKEYDATA;
typedef struct _XVFBMOUSEDATA
{
unsigned short x;
unsigned short y;
unsigned int button;
unsigned short x;
unsigned short y;
unsigned int button;
} XVFBMOUSEDATA;
typedef struct _XVFBEVENTDATA
{
int event_type;
union
{
XVFBKEYDATA key;
XVFBMOUSEDATA mouse;
} data;
int event_type;
union {
XVFBKEYDATA key;
XVFBMOUSEDATA mouse;
} data;
} XVFBEVENT;
typedef struct _XVFBCaptionEventData{
int event_type;
int size;
char buff[0];
int event_type;
int size;
char buff[0];
}XVFBCaptionEventData;
typedef struct _XVFBIMEEventData{
int event_type;
int ime_open;
int event_type;
int ime_open;
}XVFBIMEEventData;
typedef struct _XVFBIMEMSGEventData{
@@ -117,6 +119,13 @@ typedef struct _XVFBShowHideEventData{
int show; /* 0 to hide, 1 to show */
}XVFBShowHideEventData;
/* Since 5.0.0: command */
#define XVFB_CMD_QUIT 0
typedef struct _XVFBCmdEventData {
int event_type;
int cmd;
} XVFBCmdEventData;
extern int __mg_pcxvfb_server_sockfd;
extern int __mg_pcxvfb_client_sockfd;
@@ -124,8 +133,8 @@ BOOL ial_InitPCXVFBInput (INPUT* input, const char* mdev, const char* mtype);
void TermPCXVFBInput (void);
MG_EXPORT void GUIAPI VFBOpenIME(int bOpen);
MG_EXPORT void GUIAPI VFBSetIMETextCallback(void (*setIMEText)(void *, const char* text),
void *user_data);
MG_EXPORT void GUIAPI VFBSetIMETextCallback(void (*setIMEText)(void *,
const char* text), void *user_data);
MG_EXPORT void GUIAPI VFBSetCaption(const char* caption);
MG_EXPORT void GUIAPI VFBShowWindow(int show);
+17 -11
View File
@@ -689,21 +689,19 @@ BOOL ial_InitPCXVFBInput (INPUT* input, const char* mdev, const char* mtype)
{
char path[PATH_MAX], *template;
template = getenv("MG_ENV_RECORD_IAL");
if (template)
{
if (template) {
#if 0
snprintf(path, sizeof(path), "%s%ld", template, time(NULL));
snprintf(path, sizeof(path), "%s%ld", template, time(NULL));
#else
snprintf(path, sizeof(path), "%s", template);
snprintf(path, sizeof(path), "%s", template);
#endif
path[sizeof(path)/sizeof(path[0])-1] = 0;
path[sizeof(path)/sizeof(path[0])-1] = 0;
open_rec (path);
record_time_start = getcurtime();
}
open_rec (path);
record_time_start = getcurtime();
}
}
return TRUE;
}
@@ -725,6 +723,14 @@ void TermPCXVFBInput (void)
socket_file[49] = '\0';
if (__mg_pcxvfb_client_sockfd >= 0) {
/* Since 5.0.0: send a quit command to XVFB */
XVFBCmdEventData cmd = { CMD_TYPE, XVFB_CMD_QUIT };
if (mg_writesocket (__mg_pcxvfb_client_sockfd, &cmd, sizeof (cmd)) <
sizeof (cmd)) {
// do nothing
}
close(__mg_pcxvfb_client_sockfd);
__mg_pcxvfb_client_sockfd = -1;
}
@@ -733,7 +739,7 @@ void TermPCXVFBInput (void)
__mg_pcxvfb_server_sockfd = -1;
}
unlink(socket_file);
#if defined(_MGRM_PROCESSES) && !defined(_MGRM_STANDALONE)
#if defined(_MGRM_PROCESSES)
if (mgIsServer) {
remove("/tmp/.pcxvfb_tmp");
}
@@ -741,4 +747,4 @@ void TermPCXVFBInput (void)
#endif /* WIN32 */
}
#endif /* _MGGAL_PCXVFB*/
#endif /* _MGGAL_PCXVFB */
File diff suppressed because it is too large Load Diff
+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 */
+1 -1
View File
@@ -7,4 +7,4 @@ noinst_HEADERS = \
ourhdr.h client.h server.h sharedres.h sockio.h drawsemop.h \
gal.h newgal.h memops.h incoreres.h sysres.h clipboard.h \
glyph.h license.h mgsock.h unicode-ops.h \
linux-tty.h debug.h
linux-tty.h debug.h map.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
+23 -6
View File
@@ -101,8 +101,14 @@
#define REQID_COPYCURSOR 0x001B
/* Since 5.0.0 */
// Get global wallpaper pattern surface
#define REQID_GETWPSURFACE 0x001C
// Get shared surface
#define REQID_GETSHAREDSURFACE 0x001C
// for compositing schema
#define SYSSF_WALLPAPER_PATTER "syssf-wallpaper-pattern"
// for sharedfb schema
#define SYSSF_REAL_SCREEN "syssf-real-screen"
#define SYSSF_SHADOW_SCREEN "syssf-shadow-screen"
// Load cursor from PNG file
#define REQID_LOADCURSOR_PNG 0x001D
// Load cursor from in-memory PNG
@@ -117,7 +123,10 @@
// Calculate the position a main window with WS_EX_AUTOPOSITION
#define REQID_CALCPOSITION 0x0022
#define REQID_SYS_LAST REQID_CALCPOSITION
// Authenticate client
#define REQID_AUTHCLIENT 0x0023
#define REQID_SYS_LAST REQID_AUTHCLIENT
/*
* XXX: To fellows who need to add a new REQID,
@@ -135,8 +144,13 @@ MGUI_COMPILE_TIME_ASSERT(sys_request_id, MAX_SYS_REQID >= REQID_SYS_LAST);
/* Since 5.0.0 */
typedef struct _SharedSurfInfo {
Uint32 flags;
size_t map_size;
uint32_t flags; // the flags of the surface
uint32_t width, height;
uint32_t pitch;
uint32_t name; // when use flink name
uint32_t drm_format; // DRM pixel format
size_t size; // whole size of the surface
off_t offset; // offset of pixel data
} SHAREDSURFINFO;
typedef struct JoinLayerInfo {
@@ -150,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 {
@@ -208,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
+19 -26
View File
@@ -62,28 +62,33 @@
#endif
#if defined(_MGRM_PROCESSES) && defined(_MGSCHEMA_SHAREDFB)
# define IS_SHAREDFB_SCHEMA 1
# define IS_SHAREDFB_SCHEMA_PROCS 1
#else
# define IS_SHAREDFB_SCHEMA 0
# define IS_SHAREDFB_SCHEMA_PROCS 0
#endif
/* the maximal number of the dirty rects */
#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,10 @@ enum {
#define ZNIDX_DESKTOP 0
/* The heap size for mask rectangles */
#define DEF_NR_MASKRECT 1024
#define DEF_NR_MASKRECTS 1024
#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
@@ -150,30 +155,18 @@ enum {
#endif
/* constants for fix string module */
#if defined (__NOUNIX__) || defined (__uClinux__)
#define MAX_LEN_FIXSTR 64
#define NR_HEAP 5
#define LEN_BITMAP (1+2+4+8+16)
#else
#ifdef _MGRM_THREADS
#define MAX_LEN_FIXSTR 2048
#define NR_HEAP 10
#define LEN_BITMAP (1+2+4+8+16+32+64+128+256+512)
#else
#define MAX_LEN_FIXSTR 1024
#define NR_HEAP 9
#define LEN_BITMAP (1+2+4+8+16+32+64+128+256)
#endif
#endif
#define MAX_LEN_FIXSTR 64
#define NR_HEAP 5
#define LEN_BITMAP (1+2+4+8+16)
/* constants for engine name and video mode */
#define LEN_SO_NAME 127 // name length of a shared object (library)
#define LEN_DEVICE_NAME 127
#define LEN_EXDRIVER_NAME 127
#define LEN_EXDRIVER_NAME LEN_SO_NAME
#define LEN_ENGINE_NAME 23
#define LEN_VIDEO_MODE 31
#define LEN_MTYPE_NAME 23
#define LEN_FOURCC_FORMAT 7
#define LEN_SO_NAME 255 // name length of a shared object (library)
/* misc constants and utilities */
+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 */
+1 -1
View File
@@ -162,7 +162,7 @@ dump_message (const MSG* msg, const char* name)
name, msg->message, Message2Str (msg->message),
msg->hwnd, (PVOID)msg->wParam, (PVOID)msg->lParam);
#else
_MG_PRINTF ("Message(%s): %u, Wnd: %p, wP: %p, lP: %p.\n",
_MG_PRINTF ("Message(%s) for %s: %u, Wnd: %p, wP: %p, lP: %p.\n",
#ifdef _MGHAVE_VIRTUAL_WINDOW
msg->pSyncMsg?"SYNC":"NORM",
#else
+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;
}
+171 -49
View File
File diff suppressed because it is too large Load Diff
+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);
+12 -5
View File
@@ -102,10 +102,13 @@ typedef struct tagG_RES {
char video_engine [LEN_ENGINE_NAME + 1];
char video_mode [LEN_VIDEO_MODE + 1];
char video_device [LEN_DEVICE_NAME + 1];
char video_exdriver [LEN_EXDRIVER_NAME + 1];
char video_fourcc [LEN_FOURCC_FORMAT + 1];
int video_dpi, video_hres, video_vres, video_depth;
Uint32 video_rmask, video_gmask, video_bmask, video_amask;
#ifdef _MGGAL_DRM
char video_exdriver [LEN_EXDRIVER_NAME + 1];
Uint32 video_drm_format;
Uint32 video_dbl_buff:1;
#endif
int nr_layers;
int semid_layer;
@@ -168,8 +171,6 @@ typedef G_RES* PG_RES;
#define SHAREDRES_VIDEO_ENGINE (((PG_RES)mgSharedRes)->video_engine)
#define SHAREDRES_VIDEO_MODE (((PG_RES)mgSharedRes)->video_mode)
#define SHAREDRES_VIDEO_DEVICE (((PG_RES)mgSharedRes)->video_device)
#define SHAREDRES_VIDEO_FOURCC (((PG_RES)mgSharedRes)->video_fourcc)
#define SHAREDRES_VIDEO_EXDRIVER (((PG_RES)mgSharedRes)->video_exdriver)
#define SHAREDRES_VIDEO_DPI (((PG_RES)mgSharedRes)->video_dpi)
#define SHAREDRES_VIDEO_HRES (((PG_RES)mgSharedRes)->video_hres)
#define SHAREDRES_VIDEO_VRES (((PG_RES)mgSharedRes)->video_vres)
@@ -179,6 +180,12 @@ typedef G_RES* PG_RES;
#define SHAREDRES_VIDEO_BMASK (((PG_RES)mgSharedRes)->video_bmask)
#define SHAREDRES_VIDEO_AMASK (((PG_RES)mgSharedRes)->video_amask)
#ifdef _MGGAL_DRM
#define SHAREDRES_VIDEO_EXDRIVER (((PG_RES)mgSharedRes)->video_exdriver)
#define SHAREDRES_VIDEO_DRM_FORMAT (((PG_RES)mgSharedRes)->video_drm_format)
#define SHAREDRES_VIDEO_DBL_BUFF (((PG_RES)mgSharedRes)->video_dbl_buff)
#endif
#define SHAREDRES_TIMER_COUNTER (((PG_RES)mgSharedRes)->timer_counter)
#define SHAREDRES_TICK_ON_LOCKSEM (((PG_RES)mgSharedRes)->tick_on_locksem)
#define SHAREDRES_TIMEOUT (((PG_RES)mgSharedRes)->timeout)
@@ -205,7 +212,7 @@ typedef G_RES* PG_RES;
# define SHAREDRES_SEMID_SHARED_SURF (((PG_RES)mgSharedRes)->semid_shared_surf)
#endif
#define SHAREDRES_NR_GLOBALS (((PG_RES)mgSharedRes)->nr_globals)
#define SHAREDRES_NR_GLOBALS (((PG_RES)mgSharedRes)->nr_globals)
#define SHAREDRES_DEF_NR_TOPMOSTS (((PG_RES)mgSharedRes)->def_nr_topmosts)
#define SHAREDRES_DEF_NR_NORMALS (((PG_RES)mgSharedRes)->dev_nr_normals)
+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
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+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
+37 -46
View File
@@ -80,7 +80,6 @@
#include "drawsemop.h"
#include "readbmp.h"
static int oldx = -1, oldy;
static RECT cliprc = {0, 0, 0, 0};
#ifdef _MGHAVE_CURSOR
@@ -903,6 +902,7 @@ HCURSOR GUIAPI GetDefaultCursor (void)
/* The return value indicates whether mouse has moved. */
/* TRUE for moved. */
/* NOTE that only server can call this function. */
/* Since 5.0.0, this function only changes the cursor position */
BOOL kernel_RefreshCursor (int* x, int* y, int* button)
{
int curx, cury;
@@ -912,51 +912,14 @@ BOOL kernel_RefreshCursor (int* x, int* y, int* button)
return FALSE;
IAL_GetMouseXY (x, y);
SHAREDRES_MOUSEX = curx = *x;
SHAREDRES_MOUSEY = cury = *y;
curx = *x;
cury = *y;
if (button)
SHAREDRES_BUTTON = *button = IAL_GetMouseButton ();
if (oldx != curx || oldy != cury) {
#ifdef _MGHAVE_CURSOR
#ifdef _MGSCHEMA_SHAREDFB
LOCK_CURSOR_SEM ();
CSR_CURSORX = curx;
CSR_CURSORY = cury;
if (CSR_SHOW_COUNT >= 0 && CSR_CURRENT) {
if (get_hidecursor_sem_val ()) {
reset_hidecursor_sem ();
}
else {
hidecursor ();
}
showcursor ();
GAL_SyncUpdate (__gal_screen);
}
// GAL_SyncUpdate (__gal_screen);
UNLOCK_CURSOR_SEM ();
#else /* _MGSCHEMA_SHAREDFB */
CSR_CURSORX = curx;
CSR_CURSORY = cury;
if (CSR_SHOW_COUNT >= 0 && CSR_CURRENT) {
if (csr_bmp.bmBits) {
hidecursor ();
showcursor ();
GAL_SyncUpdate (__gal_screen);
}
else {
PCURSOR pcsr = (PCURSOR)CSR_CURRENT;
GAL_MoveCursor (pcsr->surface, curx, cury);
}
}
#endif /* _MGSCHEMA_COMPOSITING */
#endif /* _MGHAVE_CURSOR */
oldx = curx;
oldy = cury;
if (SHAREDRES_MOUSEX != curx || SHAREDRES_MOUSEY != cury) {
SHAREDRES_MOUSEX = curx;
SHAREDRES_MOUSEY = cury;
moved = TRUE;
}
@@ -965,21 +928,49 @@ BOOL kernel_RefreshCursor (int* x, int* y, int* button)
#ifdef _MGHAVE_CURSOR
#ifdef _MGSCHEMA_SHAREDFB
/* show cursor hidden by client GDI function */
/* Change cursor position and show cursor hidden by client GDI function */
void kernel_ReShowCursor (void)
{
#ifdef _MGSCHEMA_SHAREDFB
LOCK_CURSOR_SEM ();
if (CSR_SHOW_COUNT >= 0 && CSR_CURRENT) {
if (get_hidecursor_sem_val ()) {
reset_hidecursor_sem ();
showcursor ();
GAL_SyncUpdate (__gal_screen);
}
else if (CSR_CURSORX != SHAREDRES_MOUSEX ||
CSR_CURSORY != SHAREDRES_MOUSEY) {
CSR_CURSORX = SHAREDRES_MOUSEX;
CSR_CURSORY = SHAREDRES_MOUSEY;
hidecursor ();
showcursor ();
GAL_SyncUpdate (__gal_screen);
}
}
UNLOCK_CURSOR_SEM ();
#else /* _MGSCHEMA_SHAREDFB */
if (CSR_SHOW_COUNT >= 0 && CSR_CURRENT &&
(CSR_CURSORX != SHAREDRES_MOUSEX ||
CSR_CURSORY != SHAREDRES_MOUSEY)) {
CSR_CURSORX = SHAREDRES_MOUSEX;
CSR_CURSORY = SHAREDRES_MOUSEY;
if (csr_bmp.bmBits) {
hidecursor ();
showcursor ();
GAL_SyncUpdate (__gal_screen);
}
else {
PCURSOR pcsr = (PCURSOR)CSR_CURRENT;
GAL_MoveCursor (pcsr->surface, CSR_CURSORX, CSR_CURSORY);
}
}
#endif /* _MGSCHEMA_COMPOSITING */
}
#endif /* defined _MGSCHEMA_SHAREDFB */
/* Always call with "setdef = FALSE" for clients at server side. */
HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL setdef)
+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;
}
+528 -218
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;
+509 -259
View File
File diff suppressed because it is too large Load Diff
+3 -1
View File
@@ -348,7 +348,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
}
timeout_count = __mg_tick_counter + timeout_threshold;
// There was a event occurred.
// There was an event occurred.
if (event & IAL_MOUSEEVENT) {
if (!IAL_UpdateMouse ())
return 0;
@@ -459,6 +459,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
#endif
ke->event = KE_KEYUP;
ke->scancode = i;
olddownkey = 0;
break;
}
}
@@ -765,6 +766,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
if(oldkeystate[i] && !keystate[i]) {
ke->event = KE_KEYUP;
ke->scancode = i;
olddownkey = 0;
break;
}
}
+15 -3
View File
@@ -478,8 +478,12 @@ int InitGUI (int argc, const char* agr[])
/* Since 5.0.0
* Copy the video engine information to the shared resource segement
*/
strncpy (SHAREDRES_VIDEO_ENGINE, engine, LEN_ENGINE_NAME);
strncpy (SHAREDRES_VIDEO_MODE, mode, LEN_VIDEO_MODE);
//strncpy (SHAREDRES_VIDEO_ENGINE, engine, LEN_ENGINE_NAME);
strcpy (SHAREDRES_VIDEO_ENGINE, engine);
//strncpy (SHAREDRES_VIDEO_MODE, mode, LEN_VIDEO_MODE);
strcpy (SHAREDRES_VIDEO_MODE, mode);
#if 0 /* deprecated code */
// these fileds will be initialized by DRM engine.
if (GetMgEtcValue (engine, "device",
SHAREDRES_VIDEO_DEVICE, LEN_DEVICE_NAME) < 0)
*SHAREDRES_VIDEO_DEVICE = 0;
@@ -489,6 +493,7 @@ int InitGUI (int argc, const char* agr[])
if (GetMgEtcValue (engine, "exdriver",
SHAREDRES_VIDEO_EXDRIVER, LEN_EXDRIVER_NAME) < 0)
*SHAREDRES_VIDEO_EXDRIVER = 0;
#endif /* deprecated code */
SHAREDRES_VIDEO_DPI = __gal_screen->dpi;
SHAREDRES_VIDEO_HRES = __gal_screen->w;
@@ -498,6 +503,8 @@ int InitGUI (int argc, const char* agr[])
SHAREDRES_VIDEO_GMASK = __gal_screen->format->Gmask;
SHAREDRES_VIDEO_BMASK = __gal_screen->format->Bmask;
SHAREDRES_VIDEO_AMASK = __gal_screen->format->Amask;
GAL_CopyVideoInfoToSharedRes();
}
else {
_DBG_PRINTF("Engien info from shared resource: %s %s %d\n",
@@ -579,7 +586,6 @@ void TerminateGUI (int rcByGUI)
__mg_join_all_message_threads ();
#endif
mg_DestroyFreeQMSGList ();
mg_TerminateAccel ();
mg_TerminateControlClass ();
@@ -605,6 +611,10 @@ void TerminateGUI (int rcByGUI)
if (_is_server) {
mg_TerminateDesktop ();
#ifdef _MGSCHEMA_COMPOSITING
mg_TerminateCompositor ();
#endif
/* Cleanup UNIX domain socket and other IPC objects. */
server_ServerCleanup ();
}
@@ -613,6 +623,8 @@ void TerminateGUI (int rcByGUI)
}
#endif
mg_DestroyFreeQMSGList ();
#ifdef _MGHAVE_ADV_2DAPI
extern void miFreeArcCache (void);
miFreeArcCache ();
+1 -1
View File
@@ -112,7 +112,7 @@ static void ParseEvent (PLWEVENT lwe)
Msg.message = MSG_TIMEOUT;
Msg.wParam = (WPARAM)lwe->count;
Msg.lParam = 0;
// 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.
// QueueDeskMessage (&Msg);
}
else if (lwe->type == LWETYPE_KEY) {
+7 -2
View File
@@ -140,6 +140,8 @@ static BOOL allocate_more_fd_slots (MSGQUEUE* msg_queue)
msg_queue->fd_slots[i] = NULL;
}
msg_queue->nr_fd_slots += MAX_NR_LISTEN_FD;
return TRUE;
}
return FALSE;
@@ -213,8 +215,11 @@ BOOL GUIAPI RegisterListenFD (int fd, int type, HWND hwnd, void* context)
}
}
if (ok && msg_queue->maxfd < fd) {
msg_queue->maxfd = fd;
if (ok) {
if (msg_queue->maxfd < fd) {
msg_queue->maxfd = fd;
}
return TRUE;
}
}
+1 -1
View File
@@ -15,7 +15,7 @@ libkernel_la_SOURCES = timer.c \
desktop-ths.c desktop-sa.c desktop-procs.c \
cursor.c cursor-procs.c cursor-sa.c \
sharedres.c \
message.c event.c \
message.c event.c listenfd.c \
blockheap.c fixstr.c slotset.c zorder.c
endif
+1 -1
View File
@@ -860,7 +860,7 @@ checkagain:
/* handle desktop timer here */
if (pMsgQueue == __mg_dsk_msg_queue && pMsgQueue->dwState & QS_DESKTIMER) {
pMsg->hwnd = HWND_DESKTOP;
pMsg->message = MSG_TIMER;
pMsg->message = MSG_TIMEOUT;
pMsg->wParam = 0;
pMsg->lParam = 0;
+31 -8
View File
@@ -51,17 +51,40 @@
** Create date: 2005/08/16
*/
int __mg_lookfor_unused_slot (unsigned char* bitmap, int len_bmp, int set)
#include <stdlib.h>
size_t __mg_lookfor_unused_slot (unsigned char* bitmap, size_t len_bmp, int set)
{
int unused = 0;
int i, j;
size_t unused = 0;
size_t i, j;
for (i = 0; i < len_bmp; i++) {
for (j = 0; j < 8; j++) {
if (*bitmap & (0x80 >> j)) {
if (set)
*bitmap &= (~(0x80 >> j));
return unused + j;
if (*bitmap) {
unsigned char half_byte = *bitmap & 0xF0;
unsigned char test_byte = 0x80;
if (half_byte) {
for (j = 0; j < 4; j++) {
if (half_byte & test_byte) {
if (set)
*bitmap ^= test_byte;
return unused + j;
}
test_byte = test_byte >> 1;
}
}
half_byte = *bitmap & 0x0F;
test_byte = 0x08;
for (j = 4; j < 8; j++) {
if (half_byte & test_byte) {
if (set)
*bitmap ^= test_byte;
return unused + j;
}
test_byte = test_byte >> 1;
}
}
+2 -2
View File
@@ -94,7 +94,7 @@ void __mg_update_tick_count (void *data)
__mg_tick_counter = __mg_os_get_time_ticks ();
#endif /* not defined _MGRM_PROCESSES */
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMER
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMEOUT
message, and the interval for the timer of desktop changes to 0.05s. */
if (__mg_tick_counter >
__mg_dsk_msg_queue->last_ticks_desktop + DESKTOP_TIMER_INERTVAL) {
@@ -129,7 +129,7 @@ void __mg_update_tick_count (void *data)
__mg_tick_counter += elapsed_ticks;
#endif /* not defined _MGRM_PROCESSES */
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMER
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMEOUT
message, and the interval for the timer of desktop changes to 0.05s. */
if (__mg_tick_counter >
__mg_dsk_msg_queue->last_ticks_desktop + DESKTOP_TIMER_INERTVAL) {
+7 -132
View File
@@ -100,7 +100,7 @@ inline static key_t get_layer_shm_key (void)
}
#endif /* defined _MGRM_PROCESSES */
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)
{
#ifdef _MGRM_PROCESSES
int size_usage_bmp = SIZE_USAGE_BMP (SHAREDRES_NR_GLOBALS,
@@ -125,8 +125,8 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
nr_normals + /* for the normal windows */
DEF_NR_LAUNCHERS + /* for the launcher ones */
NR_FIXED_ZNODES) + /* for the fixed znodes */
SIZE_MASKRECT_USAGE_BMP +
sizeof (MASKRECT) * DEF_NR_MASKRECT,
with_maskrc_heap ? (SIZE_MASKRECT_USAGE_BMP +
sizeof (MASKRECT) * DEF_NR_MASKRECTS) : 0,
SHM_PARAM | IPC_CREAT | IPC_EXCL);
return zorder_shmid;
@@ -150,7 +150,7 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
DEF_NR_LAUNCHERS + /* for the launcher ones */
NR_FIXED_ZNODES) + /* for the fixed znodes */
SIZE_MASKRECT_USAGE_BMP +
sizeof (MASKRECT) * DEF_NR_MASKRECT);
sizeof (MASKRECT) * DEF_NR_MASKRECTS);
if (!__mg_zorder_info) {
_MG_PRINTF ("KERNEL>ZOrder: calloc zorderinfo failure. \n");
@@ -214,6 +214,8 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
__mg_slot_set_use ((unsigned char*)(__mg_zorder_info + 1), 0);
__mg_slot_set_use ((unsigned char*)(maskrect_usage_bmp), 0);
__mg_def_zorder_info = __mg_zorder_info;
#if 0 /* deprecated code */
/* Since 5.0.0; allocate znodes for other fixed main windows */
{
@@ -270,134 +272,7 @@ void __kernel_free_z_order_info (ZORDERINFO* zi)
#endif
free (zi);
__mg_zorder_info = NULL;
__mg_def_zorder_info = NULL;
#endif
}
#if 0 /* deprecated code */
#if IS_SHAREDFB_SCHEMA
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
{
key_t shm_key;
int zorder_shmid;
if ((shm_key = get_layer_shm_key ()) == -1) {
return -1;
}
zorder_shmid = shmget (shm_key,
sizeof (ZORDERINFO) + SIZE_USAGE_BMP +
sizeof (ZORDERNODE) *
(DEF_NR_POPUPMENUS + /* for the popup menus */
SHAREDRES_NR_GLOBALS + /* for the global windows */
nr_topmosts + /* for the topmost windows */
nr_normals)+ /* for the normal windows */
SIZE_MASKRECT_USAGE_BMP +
sizeof (MASKRECT) * DEF_NR_MASKRECT,
SHM_PARAM | IPC_CREAT | IPC_EXCL);
return zorder_shmid;
}
#else /* not IS_SHAREDFB_SCHEMA */
ZORDERINFO* __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
{
ZORDERINFO* zi;
ZORDERNODE* znodes;
void* maskrect_usage_bmp;
zi = (PZORDERINFO) calloc (1,
sizeof (ZORDERINFO) + SIZE_USAGE_BMP +
sizeof (ZORDERNODE) *
(DEF_NR_POPUPMENUS + /* for the popup menus */
SHAREDRES_NR_GLOBALS + /* for global window: 0 */
nr_topmosts + /* for the topmost windows */
nr_normals)+ /* for the normal windows */
SIZE_MASKRECT_USAGE_BMP +
sizeof (MASKRECT) * DEF_NR_MASKRECT);
if (!zi) {
_WRN_PRINTF ("KERNEL>ZOrder: calloc zorderinfo failure. \n");
return NULL;
}
zi->size_usage_bmp = SIZE_USAGE_BMP;
zi->size_maskrect_usage_bmp = SIZE_MASKRECT_USAGE_BMP;
zi->max_nr_popupmenus = DEF_NR_POPUPMENUS;
zi->max_nr_globals = 0;
zi->max_nr_topmosts = nr_topmosts;
zi->max_nr_normals = nr_normals;
zi->nr_popupmenus = 0;
zi->nr_globals = 0;
zi->nr_topmosts = 0;
zi->nr_normals = 0;
zi->first_global = 0;
zi->first_topmost = 0;
zi->first_normal = 0;
zi->active_win = 0;
zi->cli_trackmenu = -1;
zi->ptmi_in_cli = (HWND)-1;
/* Set zorder node usage map. */
memset (zi + 1, 0xFF, SIZE_USAGE_BMP);
/* Set zorder mask rect usage map. */
maskrect_usage_bmp = GET_MASKRECT_USAGEBMP(zi);
memset (maskrect_usage_bmp, 0xFF,
zi->size_maskrect_usage_bmp);
/* init z-order node for desktop */
znodes = GET_ZORDERNODE(zi);
znodes [0].flags = ZOF_TYPE_DESKTOP | ZOF_VISIBLE;
znodes [0].rc = g_rcScr;
znodes [0].age = 0;
znodes [0].cli = 0;
znodes [0].hwnd = HWND_DESKTOP;
znodes [0].next = 0;
znodes [0].prev = 0;
znodes [0].idx_mask_rect = 0;
__mg_slot_set_use ((unsigned char*)(zi + 1), 0);
__mg_slot_set_use ((unsigned char*)(maskrect_usage_bmp), 0);
#ifdef _MGRM_THREADS
#ifndef __NOUNIX__
pthread_rwlock_init(&zi->rwlock, NULL);
#else
pthread_mutex_init(&zi->rwlock, NULL);
#endif
#endif /* _MGRM_THREADS */
return zi;
}
#endif /* not IS_SHAREDFB_SCHEMA */
void __kernel_free_z_order_info (ZORDERINFO* zi)
{
#if IS_SHAREDFB_SCHEMA
if (shmdt (zi) < 0)
perror ("Detaches shared zorder nodes");
#else /* not IS_SHAREDFB_SCHEMA */
#ifdef _MGRM_THREADS
#ifndef __NOUNIX__
pthread_rwlock_destroy(&zi->rwlock);
#else
pthread_mutex_destroy(&zi->rwlock);
#endif
#endif /* _MGRM_THREADS */
free (zi);
#endif /* not IS_SHAREDFB_SCHEMA */
}
#endif /* deprecated code */
+1 -1
View File
@@ -362,7 +362,7 @@ static void mg_slice_init_nomessage (void)
sys_page_size = system_info.dwPageSize;
}
#else
sys_page_size = sysconf (_SC_PAGESIZE); /* = sysconf (_SC_PAGE_SIZE); = getpagesize(); */
sys_page_size = getpagesize(); /* = sysconf (_SC_PAGE_SIZE); = getpagesize(); */
#endif
mem_assert (sys_page_size >= 2 * LARGEALIGNMENT);
mem_assert ((sys_page_size & (sys_page_size - 1)) == 0);
+1
View File
@@ -13,6 +13,7 @@ MINIGUILIB=libminigui-$(MINIGUI_VER)
# specific defines
COMM_LDADD= \
standalone/libstandalone.$(LIBA) \
libc/liblibc.$(LIBA) \
misc/libmisc.$(LIBA) \
control/libcontrol.$(LIBA) \
+1 -4
View File
@@ -5,15 +5,12 @@ EXTRA_DIST= misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
math.c about.c error.c sockio.c rc4.c rc4.h \
makefile.ng makefile.msvc
LITE_SRCS=error.c sockio.c
if MG_MINIMALGDI
libmisc_la_SOURCES = misc.c math.c rwops.c nposix.c
else
libmisc_la_SOURCES = misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
math.c about.c license.c anon_file.c rbtree.c map.c \
$(LITE_SRCS)
error.c sockio.c
endif
SRC_FILES = $(libmisc_la_SOURCES)
+3 -1
View File
@@ -127,6 +127,8 @@ static LRESULT AboutWinProc (HWND hWnd, UINT message,
DestroyMainWindow (hWnd);
#ifdef _MGRM_THREADS
PostQuitMessage (hWnd);
#else
MainWindowCleanup (hWnd);
#endif
return 0;
}
@@ -226,7 +228,7 @@ HWND GUIAPI OpenAboutDialog (HWND hHosting)
SysPixelColor[IDX_COLOR_darkgray].g,
SysPixelColor[IDX_COLOR_darkgray].b,
0xA0),
CT_ALPHAPIXEL, 0x80);
CT_ALPHAPIXEL, COLOR_BLEND_LEGACY);
if (hMainWnd == HWND_INVALID)
return HWND_INVALID;
+2
View File
@@ -69,6 +69,8 @@
#include <linux/memfd.h>
#include <stdlib.h>
#else
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#endif
+1
View File
@@ -310,6 +310,7 @@ void __mg_splash_draw_framework (void)
SetBrushColor(HDC_SCREEN_SYS, old_brush);
SetTextColor(HDC_SCREEN_SYS, old_text);
SetBkMode(HDC_SCREEN_SYS, BM_OPAQUE);
SyncUpdateDC(HDC_SCREEN_SYS);
}
+4 -7
View File
@@ -4,18 +4,15 @@ INCLUDES = -I$(abs_top_srcdir)/include -I$(abs_top_srcdir)/src/include
noinst_LTLIBRARIES = libmisc.la
EXTRA_DIST= misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
math.c about.c error.c sockio.c listenfd.c rc4.c rc4.h \
makefile.ng makefile.msvc
LITE_SRCS=error.c sockio.c listenfd.c
math.c about.c error.c sockio.c rc4.c rc4.h \
makefile.ng makefile.msvc
ifdef MG_MINIMALGDI
libmisc_la_SOURCES = misc.c math.c rwops.c nposix.c
else
libmisc_la_SOURCES = misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
math.c about.c license.c \
$(LITE_SRCS)
math.c about.c license.c anon_file.c rbtree.c map.c \
error.c sockio.c
endif
SRC_FILES = $(libmisc_la_SOURCES)
+11 -2
View File
@@ -1433,7 +1433,9 @@ char * strtrimall( char *src)
return src;
}
strcpy (src, src + nIndex1);
// VW: use memmove instead of strcpy to avoid overlapping
// strcpy (src, src + nIndex1);
memmove (src, src + nIndex1, nLen - nIndex1 + 1);
nLen = strlen (src);
nIndex1 = nLen - 1;
@@ -1468,11 +1470,18 @@ int __mg_path_joint (char* dst, int dst_size,
if (__mg_is_abs_path(abs_path) && (!__mg_is_abs_path(sub_path))) {
if (dst_size >= strlen(abs_path) + strlen(sub_path)
+ 2/* size of split '/' and terminator '\0' */) {
sprintf(dst, "%s/%s", abs_path, sub_path);
strcpy (dst, abs_path);
strcat (dst, "/");
strcat (dst, sub_path);
//sprintf(dst, "%s/%s", abs_path, sub_path);
return 0;
}
else {
_WRN_PRINTF ("The buffer space for the full path is too short: %d\n", dst_size);
}
}
}
return -1;
}
+3 -1
View File
@@ -414,6 +414,7 @@ unsigned int __mg_os_get_random_seed (void)
unsigned int rt_tick_get(void);
return rt_tick_get();
#elif defined (__FREERTOS__)
return 0; // just return zero for now.
#else
/*other os use time, for example: linux, OSE, etc.*/
return time (NULL);
@@ -451,7 +452,8 @@ void __mg_os_time_delay (int ms)
extern int rt_thread_mdelay(int ms);
rt_thread_mdelay(ms);
#elif defined (__FREERTOS__)
#error "Please implement __mg_os_time_delay for your OS"
extern void vTaskDelay(int xTicksToDelay);
vTaskDelay(ms);
#else
#error "Please implement __mg_os_time_delay for your OS"
#endif
+7 -4
View File
@@ -1,6 +1,6 @@
## Makefile.am for the NEWGAL library
AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include $(PIXMAN_CFLAGS)
noinst_LTLIBRARIES = libnewgal.la
@@ -17,6 +17,9 @@ DRIVERS = @VIDEO_DRIVERS@
# Include the architecture-independent sources
COMMON_SRCS = \
video.c \
newgal.c \
surface.c \
RLEaccel.c \
RLEaccel_c.h \
blit.c \
@@ -29,18 +32,18 @@ COMMON_SRCS = \
leaks.h \
pixels.c \
pixels_c.h \
surface.c \
stretch.c \
stretch_c.h \
sysvideo.h \
video.c \
newgal.c \
videomem-bucket.h \
videomem-bucket.c \
surface-shared.c \
surface-cursor.c \
surface-shm.c \
shadow-screen.h \
shadow-screen.c \
concurrent-tasks.h \
concurrent-tasks.c \
$(NULL_FILE)
libnewgal_la_SOURCES = $(COMMON_SRCS)
+4 -4
View File
@@ -476,7 +476,7 @@ int GAL_RLEBlit(GAL_Surface *src, GAL_Rect *srcrect,
/* Set up the source and destination pointers */
x = dstrect->x;
y = dstrect->y;
dstbuf = (Uint8 *)dst->pixels + dst->offset
dstbuf = (Uint8 *)dst->pixels
+ y * dst->pitch + x * src->format->BytesPerPixel;
srcbuf = (Uint8 *)src->map->sw_data->aux_data;
@@ -730,7 +730,7 @@ int GAL_RLEAlphaBlit(GAL_Surface *src, GAL_Rect *srcrect,
x = dstrect->x;
y = dstrect->y;
dstbuf = (Uint8 *)dst->pixels + dst->offset
dstbuf = (Uint8 *)dst->pixels
+ y * dst->pitch + x * df->BytesPerPixel;
srcbuf = (Uint8 *)src->map->sw_data->aux_data + sizeof(RLEDestFormat);
@@ -1098,7 +1098,7 @@ static int RLEAlphaSurface(GAL_Surface *surface)
int x, y;
int h = surface->h, w = surface->w;
GAL_PixelFormat *sf = surface->format;
Uint32 *src = (Uint32 *)((Uint8 *)surface->pixels + surface->offset);
Uint32 *src = (Uint32 *)((Uint8 *)surface->pixels);
Uint8 *lastline = dst; /* end of last non-blank line */
/* opaque counts are 8 or 16 bits, depending on target depth */
@@ -1283,7 +1283,7 @@ static int RLEColorkeySurface(GAL_Surface *surface)
}
/* Set up the conversion */
srcbuf = (Uint8 *)surface->pixels+surface->offset;
srcbuf = (Uint8 *)surface->pixels;
maxn = bpp == 4 ? 65535 : 255;
dst = rlebuf;
rgbmask = ~surface->format->Amask;
+138 -5
View File
@@ -77,13 +77,13 @@ static int GAL_SoftBlit(GAL_Surface *src, GAL_Rect *srcrect,
GAL_loblit RunBlit;
/* Set up the blit information */
info.s_pixels = (Uint8 *)src->pixels + src->offset +
info.s_pixels = (Uint8 *)src->pixels + src->pixels_off +
(Uint16)srcrect->y*src->pitch +
(Uint16)srcrect->x*src->format->BytesPerPixel;
info.s_width = srcrect->w;
info.s_height = srcrect->h;
info.s_skip=src->pitch-info.s_width*src->format->BytesPerPixel;
info.d_pixels = (Uint8 *)dst->pixels + dst->offset +
info.d_pixels = (Uint8 *)dst->pixels + dst->pixels_off +
(Uint16)dstrect->y*dst->pitch +
(Uint16)dstrect->x*dst->format->BytesPerPixel;
info.d_width = dstrect->w;
@@ -162,6 +162,13 @@ static void GAL_BlitCopyOverlap(GAL_BlitInfo *info)
}
}
#ifdef _MGUSE_PIXMAN
#include <pixman.h>
static int GAL_PixmanBlit (struct GAL_Surface *src, GAL_Rect *srcrect,
struct GAL_Surface *dst, GAL_Rect *dstrect);
#endif
/* Figure out which of many blit routines to set up on a surface */
int GAL_CalculateBlit(GAL_Surface *surface)
{
@@ -255,7 +262,7 @@ int GAL_CalculateBlit(GAL_Surface *surface)
/* Handle overlapping blits on the same surface */
if ( surface == surface->map->dst ) {
surface->map->sw_data->blit = GAL_BlitCopyOverlap;
surface->map->sw_data->blit = GAL_BlitCopyOverlap;
}
} else {
if ( surface->format->BitsPerPixel < 8 ) {
@@ -290,8 +297,7 @@ int GAL_CalculateBlit(GAL_Surface *surface)
if(surface->flags & GAL_RLEACCELOK
&& (surface->flags & GAL_HWACCEL) != GAL_HWACCEL) {
if(surface->map->identity
&& (blit_index == 1
if(surface->map->identity && (blit_index == 1
|| (blit_index == 3 && !surface->format->Amask))) {
if ( GAL_RLESurface(surface) == 0 )
surface->map->sw_blit = GAL_RLEBlit;
@@ -302,8 +308,135 @@ int GAL_CalculateBlit(GAL_Surface *surface)
}
if ( surface->map->sw_blit == NULL ) {
#ifdef _MGUSE_PIXMAN
if (blit_index & 1) {
// have colorkey
surface->map->sw_blit = GAL_SoftBlit;
}
else if (surface->pix_img && surface->map->dst->pix_img &&
surface != surface->map->dst) {
surface->map->sw_blit = GAL_PixmanBlit;
}
else {
surface->map->sw_blit = GAL_SoftBlit;
}
#else
surface->map->sw_blit = GAL_SoftBlit;
#endif
}
return(0);
}
#ifdef _MGUSE_PIXMAN
int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops)
{
if (GAL_CheckPixmanFormats (src, dst)) {
GAL_BlittingContext* ctxt;
src->blit_ctxt = malloc (sizeof (GAL_BlittingContext));
if (src->blit_ctxt == NULL)
return -1;
ctxt = src->blit_ctxt;
if ((src->flags & GAL_SRCALPHA) && src->format->alpha != GAL_ALPHA_OPAQUE) {
memset (&ctxt->alpha_bits, src->format->alpha, sizeof(uint32_t));
ctxt->msk_img = pixman_image_create_bits_no_clear (PIXMAN_a8, 1, 1,
&ctxt->alpha_bits, 4);
if (ctxt->msk_img)
pixman_image_set_repeat (ctxt->msk_img, PIXMAN_REPEAT_NORMAL);
}
else
ctxt->msk_img = NULL;
ops &= COLOR_BLEND_FLAGS_MASK;
if (ops == COLOR_BLEND_LEGACY) {
if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) {
ctxt->op = PIXMAN_OP_OVER;
}
else {
ctxt->op = PIXMAN_OP_SRC;
}
}
else {
ctxt->op = ops;
}
if (ctxt->op > PIXMAN_OP_HSL_LUMINOSITY ||
ctxt->op < PIXMAN_OP_CLEAR) {
ctxt->op = PIXMAN_OP_SRC;
}
}
return 0;
}
int GAL_CleanupBlitting (GAL_Surface *src, GAL_Surface *dst)
{
if (src->blit_ctxt) {
GAL_BlittingContext* ctxt = src->blit_ctxt;
if (ctxt->msk_img)
pixman_image_unref (ctxt->msk_img);
free (src->blit_ctxt);
src->blit_ctxt = NULL;
}
return 0;
}
static int GAL_PixmanBlit (struct GAL_Surface *src, GAL_Rect *srcrect,
struct GAL_Surface *dst, GAL_Rect *dstrect)
{
pixman_image_t *src_img = src->pix_img, *dst_img = dst->pix_img;
pixman_image_t *msk_img;
pixman_op_t op;
if (src->blit_ctxt) {
GAL_BlittingContext* ctxt = src->blit_ctxt;
msk_img = ctxt->msk_img;
op = (pixman_op_t)ctxt->op;
}
else {
msk_img = NULL;
op = PIXMAN_OP_SRC;
}
_DBG_PRINTF ("srcrect: %d, %d, %dx%d; dstrect: %d, %d, %dx%d\n",
srcrect->x, srcrect->y, srcrect->w, srcrect->h,
dstrect->x, dstrect->y, dstrect->w, dstrect->h);
#if 0
pixman_region32_t clip_region;
pixman_region32_init_rect (&clip_region,
dst->clip_rect.x, dst->clip_rect.y, dst->clip_rect.w, dst->clip_rect.h);
pixman_image_set_clip_region32 (dst_img, &clip_region);
#endif
#if 0
// pixman_blt does not work
if (pixman_image_get_format (src_img) == pixman_image_get_format (dst_img) &&
op == PIXMAN_OP_SRC && msk_img == NULL) {
pixman_blt ((uint32_t *)((char*)src->pixels + src->pixels_off),
(uint32_t *)((char*)dst->pixels + dst->pixels_off),
src->pitch, dst->pitch,
GAL_BytesPerPixel (src),
GAL_BytesPerPixel (dst),
srcrect->x, srcrect->y,
dstrect->x, dstrect->y,
srcrect->w, srcrect->h);
}
else
#endif
{
pixman_image_composite32 (op, src_img, msk_img, dst_img,
srcrect->x, srcrect->y,
0, 0,
dstrect->x, dstrect->y,
srcrect->w, srcrect->h);
}
//pixman_region32_fini (&clip_region);
return 0;
}
#endif // _MGUSE_PIXMAN
+2 -2
View File
@@ -77,16 +77,16 @@ struct private_swaccel {
/* Blit mapping definition */
typedef struct GAL_BlitMap {
GAL_Surface *dst;
int identity;
Uint8 *table;
GAL_blit hw_blit;
GAL_blit sw_blit;
struct private_hwaccel *hw_data;
struct private_swaccel *sw_data;
int identity;
/* the version count matches the destination; mismatch indicates
an invalid mapping */
unsigned int format_version;
unsigned int format_version;
} GAL_BlitMap;
-71
View File
@@ -52,28 +52,10 @@
/* Function to check the CPU flags */
#define MMX_CPU 0x800000
#ifdef USE_ASMBLIT
#define CPU_Flags() Hermes_X86_CPU()
#else
#define CPU_Flags() 0L
#endif
/* Functions to blit from N-bit surfaces to other surfaces */
#ifdef USE_ASMBLIT
/* Heheheh, we coerce Hermes into using GAL blit information */
#define X86_ASSEMBLER
#define HermesConverterInterface GAL_BlitInfo
#define HermesClearInterface void
#define STACKCALL
typedef Uint32 int32;
#include "HeadMMX.h"
#include "HeadX86.h"
#else
/* This is now endian dependent */
#if ( GAL_BYTEORDER == GAL_LIL_ENDIAN )
#define HI 1
@@ -428,9 +410,6 @@ static void Blit_RGB888_RGB565(GAL_BlitInfo *info)
#endif /* USE_DUFFS_LOOP */
}
#endif /* USE_ASMBLIT */
/* Special optimized blit for RGB 5-6-5 --> 32-bit RGB surfaces */
#if ( GAL_BYTEORDER == GAL_LIL_ENDIAN )
#define RGB565_32(dst, src, map) (map[src[0]*2] + map[src[1]*2+1])
@@ -1458,14 +1437,6 @@ static const struct blit_table normal_blit_1[] = {
{ 0,0,0, 0, 0,0,0, 0, NULL, NULL },
};
static const struct blit_table normal_blit_2[] = {
#ifdef USE_ASMBLIT
{ 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000007E0,0x0000F800,
0, ConvertX86p16_16BGR565, ConvertX86, NO_ALPHA },
{ 0x0000F800,0x000007E0,0x0000001F, 2, 0x00007C00,0x000003E0,0x0000001F,
0, ConvertX86p16_16RGB555, ConvertX86, NO_ALPHA },
{ 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000003E0,0x00007C00,
0, ConvertX86p16_16BGR555, ConvertX86, NO_ALPHA },
#endif
{ 0x0000F800,0x000007E0,0x0000001F, 4, 0x00FF0000,0x0000FF00,0x000000FF,
0, NULL, Blit_RGB565_ARGB8888, SET_ALPHA },
{ 0x0000F800,0x000007E0,0x0000001F, 4, 0x000000FF,0x0000FF00,0x00FF0000,
@@ -1483,39 +1454,10 @@ static const struct blit_table normal_blit_3[] = {
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
};
static const struct blit_table normal_blit_4[] = {
#ifdef USE_ASMBLIT
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
MMX_CPU, ConvertMMXpII32_16RGB565, ConvertMMX, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
0, ConvertX86p32_16RGB565, ConvertX86, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000007E0,0x0000F800,
MMX_CPU, ConvertMMXpII32_16BGR565, ConvertMMX, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000007E0,0x0000F800,
0, ConvertX86p32_16BGR565, ConvertX86, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
MMX_CPU, ConvertMMXpII32_16RGB555, ConvertMMX, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
0, ConvertX86p32_16RGB555, ConvertX86, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000003E0,0x00007C00,
MMX_CPU, ConvertMMXpII32_16BGR555, ConvertMMX, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000003E0,0x00007C00,
0, ConvertX86p32_16BGR555, ConvertX86, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x00FF0000,0x0000FF00,0x000000FF,
0, ConvertX86p32_24RGB888, ConvertX86, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x000000FF,0x0000FF00,0x00FF0000,
0, ConvertX86p32_24BGR888, ConvertX86, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 4, 0x000000FF,0x0000FF00,0x00FF0000,
0, ConvertX86p32_32BGR888, ConvertX86, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 4, 0xFF000000,0x00FF0000,0x0000FF00,
0, ConvertX86p32_32RGBA888, ConvertX86, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 4, 0x0000FF00,0x00FF0000,0xFF000000,
0, ConvertX86p32_32BGRA888, ConvertX86, NO_ALPHA },
#else
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
0, NULL, Blit_RGB888_RGB565, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
0, NULL, Blit_RGB888_RGB555, NO_ALPHA },
#endif
/* Default for 32-bit RGB source, used if no other blitter matches */
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
};
@@ -1575,12 +1517,7 @@ GAL_loblit GAL_CalculateBlitN(GAL_Surface *surface, int blit_index)
if ( surface->map->table ) {
blitfun = Blit_RGB888_index8_map;
} else {
#ifdef USE_ASMBLIT
sdata->aux_data = ConvertX86p32_8RGB332;
blitfun = ConvertX86;
#else
blitfun = Blit_RGB888_index8;
#endif
}
} else {
blitfun = BlitNto1;
@@ -1611,14 +1548,6 @@ GAL_loblit GAL_CalculateBlitN(GAL_Surface *surface, int blit_index)
}
#ifdef DEBUG_ASM
#ifdef USE_ASMBLIT
if ( blitfun == ConvertMMX )
fprintf(stderr, "Using mmx blit\n");
else
if ( blitfun == ConvertX86 )
fprintf(stderr, "Using asm blit\n");
else
#endif
if ( (blitfun == GAL_BlitNtoN) || (blitfun == GAL_BlitNto1) )
fprintf(stderr, "Using C blit\n");
else
+62 -10
View File
@@ -94,26 +94,70 @@ static void COMMLCD_DeleteDevice(GAL_VideoDevice *device)
static void COMMLCD_UpdateRects_Sync (_THIS, int numrects, GAL_Rect *rects)
{
int i;
RECT bound;
/* sync update */
bound = this->hidden->rc_dirty;
for (i = 0; i < numrects; i++) {
RECT rc;
SetRect (&rc, rects[i].x, rects[i].y,
rects[i].x + rects[i].w, rects[i].y + rects[i].h);
if (!IsRectEmpty (&rc)) {
__mg_commlcd_ops.update (&rc);
if (IsRectEmpty (&bound))
bound = rc;
else
GetBoundRect (&bound, &bound, &rc);
}
if (!IsRectEmpty (&bound)) {
RECT rcScr = GetScreenRect();
if (IntersectRect (&bound, &bound, &rcScr)) {
this->hidden->rc_dirty = bound;
this->hidden->dirty = TRUE;
}
}
}
static BOOL _valid_async_updater = TRUE;
static BOOL COMMLCD_SyncUpdate_Sync (_THIS)
{
if (!IsRectEmpty (&this->hidden->rc_dirty)) {
__mg_commlcd_ops.update (&this->hidden->rc_dirty);
SetRect (&this->hidden->rc_dirty, 0, 0, 0, 0);
this->hidden->dirty = FALSE;
return TRUE;
}
return FALSE;
}
static BOOL COMMLCD_SyncUpdate_Async (_THIS)
{
BOOL rc = FALSE;
pthread_mutex_lock (&this->hidden->update_lock);
if (this->hidden->dirty) {
// signal the update thread to do update
sem_post (&this->hidden->sem_update);
rc = TRUE;
}
pthread_mutex_unlock (&this->hidden->update_lock);
return rc;
}
static void* task_do_update (void* data)
{
_THIS;
this = data;
if (pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL))
return NULL;
do {
sem_wait (&this->hidden->sem_update);
pthread_testcancel ();
pthread_mutex_lock (&this->hidden->update_lock);
if (this->hidden->dirty) {
__mg_commlcd_ops.update (&this->hidden->rc_dirty);
@@ -122,8 +166,11 @@ static void* task_do_update (void* data)
this->hidden->dirty = FALSE;
}
pthread_mutex_unlock (&this->hidden->update_lock);
#if 0 /* since 5.0.0: use semaphore */
__mg_os_time_delay(50); /* 50 ms */
} while (_valid_async_updater);
#endif
} while (1);
return NULL;
}
@@ -186,12 +233,13 @@ static GAL_VideoDevice *COMMLCD_CreateDevice (int devindex)
device->SetColors = COMMLCD_SetColors;
device->VideoQuit = COMMLCD_VideoQuit;
device->AllocHWSurface = COMMLCD_AllocHWSurface;
device->FreeHWSurface = COMMLCD_FreeHWSurface;
device->CheckHWBlit = NULL;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = COMMLCD_FreeHWSurface;
device->UpdateRects = NULL;
device->SyncUpdate = NULL;
device->free = COMMLCD_DeleteDevice;
return device;
@@ -307,11 +355,15 @@ static GAL_Surface *COMMLCD_SetVideoMode(_THIS, GAL_Surface *current,
if (li.update_method == COMMLCD_UPDATE_NONE) {
this->UpdateRects = NULL;
this->SyncUpdate = NULL;
this->hidden->update_th = 0;
}
else if (li.update_method == COMMLCD_UPDATE_ASYNC) {
this->UpdateRects = COMMLCD_UpdateRects_Async;
this->SyncUpdate = COMMLCD_SyncUpdate_Async;
pthread_mutex_init (&this->hidden->update_lock, NULL);
sem_init (&this->hidden->sem_update, 0, 0);
#if 0
pthread_attr_t new_attr;
@@ -324,10 +376,10 @@ static GAL_Surface *COMMLCD_SetVideoMode(_THIS, GAL_Surface *current,
pthread_create (&this->hidden->update_th, NULL,
task_do_update, this);
#endif
pthread_mutex_init (&this->hidden->update_lock, NULL);
}
else {
this->UpdateRects = COMMLCD_UpdateRects_Sync;
this->SyncUpdate = COMMLCD_SyncUpdate_Sync;
this->hidden->update_th = 0;
}
@@ -342,9 +394,9 @@ static void COMMLCD_VideoQuit (_THIS)
}
if (this->hidden->update_th) {
/* quit the update task */
_valid_async_updater = FALSE;
pthread_join(this->hidden->update_th, NULL);
/* send cancel request */
pthread_cancel (this->hidden->update_th);
pthread_join (this->hidden->update_th, NULL);
}
if (__mg_commlcd_ops.release)
+3
View File
@@ -47,6 +47,8 @@
#ifndef _GAL_COMMLCD_H
#define _GAL_COMMLCD_H
#include <semaphore.h>
#include "sysvideo.h"
#include "exstubs.h"
@@ -68,6 +70,7 @@ struct GAL_PrivateVideoData {
RECT rc_dirty;
pthread_t update_th;
pthread_mutex_t update_lock;
sem_t sem_update;
};
struct commlcd_ops {
File diff suppressed because it is too large Load Diff
+72
View File
@@ -0,0 +1,72 @@
///////////////////////////////////////////////////////////////////////////////
//
// 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/>.
*/
/*
** The helpers for concurrent tasks.
**
** Current maintainer: Wei Yongming.
**
** Create date: 2021/05/21
*/
#ifndef _GAL_concurrent_tasks_h
#define _GAL_concurrent_tasks_h
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef void (*CCTaskProc)(void* context, int loop_idx);
int concurrentTasks_Init (void);
int concurrentTasks_Term (void);
int concurrentTasks_SplitRect (GAL_Rect* rcs, const GAL_Rect* rc, int count);
int concurrentTasks_Do (void* context, CCTaskProc proc);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _GAL_concurrent_tasks_h */
+2 -2
View File
@@ -117,7 +117,7 @@ GAL_FunctionTable mgGALFuncTable = {
DFB_SetColors,
DFB_UpdateRects,
DFB_VideoQuit,
#if IS_SHAREDFB_SCHEMA
#if IS_SHAREDFB_SCHEMA_PROCS
DFB_RequestHWSurface,
#endif
DFB_AllocHWSurface,
@@ -167,7 +167,7 @@ static GAL_VideoDevice *DFB_CreateDevice (int devindex)
device->SetColors = DFB_SetColors;
device->VideoQuit = DFB_VideoQuit;
device->UpdateRects = DFB_UpdateRects;
#if IS_SHAREDFB_SCHEMA
#if IS_SHAREDFB_SCHEMA_PROCS
device->RequestHWSurface = DFB_RequestHWSurface;
#endif
device->AllocHWSurface = DFB_AllocHWSurface;
+2696 -1066
View File
File diff suppressed because it is too large Load Diff
+47 -15
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2019, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 2019 ~ 2020, Beijing FMSoft Technologies Co., Ltd.
*
* 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
@@ -50,6 +50,14 @@
#include "sysvideo.h"
#ifndef _MGSCHEMA_COMPOSITING
#include <fcntl.h> /* For O_* constants */
#include <sys/stat.h> /* For mode constants */
#include <semaphore.h>
#define SEM_UPDATE_LOCK "mginit-drm-update"
#endif
/* Hidden "this" pointer for the video functions */
#define _THIS GAL_VideoDevice *this
@@ -58,9 +66,43 @@
typedef struct drm_mode_info DrmModeInfo;
typedef struct GAL_PrivateVideoData {
char dev_name[LEN_DEVICE_NAME + 1];
/* For compositing schema, we force to use double buffering */
#ifdef _MGSCHEMA_COMPOSITING
GAL_Surface *real_screen, *shadow_screen;
DrmSurfaceBuffer *cursor_buff;
uint32_t cursor_plane_id;
/* Used to simulate the hardware cursor when hardware cursor not available. */
GAL_Surface *cursor;
int csr_x, csr_y;
int hot_x, hot_y;
#else /* defined _MGSCHEMA_COMPOSITING */
/* When double buffering supported, the real surface represents the ultimate
* scan-out frame buffer, and the shadow screen represents the rendering
* surface. When double buffering disabled, shadow_screen is NULL. */
GAL_Surface *real_screen, *shadow_screen;
/* the global names of real screen and shadow screen */
uint32_t real_name, shadow_name;
sem_t *update_lock;
#endif /* not defined _MGSCHEMA_COMPOSITING */
#if !IS_SHAREDFB_SCHEMA_PROCS
RECT dirty_rc;
#endif
char* dev_name;
char* ex_driver;
int dev_fd;
/* capabilities */
uint32_t cap_cursor_width;
uint32_t cap_cursor_height;
uint32_t cap_dumb:1;
uint32_t dbl_buff:1;
uint32_t scanout_buff_id;
void* exdrv_handle;
DrmDriverOps* driver_ops;
DrmDriver* driver;
@@ -68,23 +110,13 @@ typedef struct GAL_PrivateVideoData {
DrmModeInfo* mode_list;
GAL_Rect** modes;
int bpp;
uint32_t width;
uint32_t height;
uint32_t pitch;
uint32_t size;
uint32_t scanout_buff_id;
uint8_t* scanout_fb;
DrmModeInfo* saved_info;
drmModeCrtc* saved_crtc;
/* only valid when using DUMB frame buffer */
uint32_t handle;
/* only valid when using DRM driver */
#if 0 /* deprecated code */
uint32_t console_buff_id;
uint8_t* scanout_fb;
#endif /* deprecated code */
} DrmVideoData;
#endif /* _NEWGAL_DRIVIDEO_H */
+19 -7
View File
@@ -59,7 +59,6 @@
#include <linux/version.h>
#include <linux/vt.h>
#include <linux/kd.h>
#include <linux/keyboard.h>
#include "common.h"
#include "minigui.h"
@@ -111,8 +110,10 @@ static BOOL FB_SyncUpdate (_THIS)
if (IsRectEmpty (&this->hidden->dirty_rc))
return FALSE;
if (shadowScreen_BlitToReal (this) == 0)
if (shadowScreen_BlitToReal (this) == 0) {
SetRectEmpty (&this->hidden->dirty_rc);
return TRUE;
}
return FALSE;
}
@@ -152,6 +153,12 @@ static int FB_Available(void)
static void FB_DeleteDevice(GAL_VideoDevice *device)
{
#ifdef _MGSCHEMA_COMPOSITING
if (device->hidden->shadow_screen) {
GAL_FreeSurface (device->hidden->real_screen);
}
#endif /* _MGSCHEMA_COMPOSITING */
free(device->hidden);
free(device);
}
@@ -251,9 +258,11 @@ static int FB_EnterGraphicsMode (_THIS)
_WRN_PRINTF ("Can't open %s: %m\n", tty_dev);
goto fail;
}
if (ioctl (ttyfd, KDSETMODE, KD_GRAPHICS) == -1) {
_WRN_PRINTF ("Error when setting the terminal to graphics mode: %m\n");
_WRN_PRINTF ("Maybe is not a console.\n");
_WRN_PRINTF ("Error when setting the terminal (%s) "
"to graphics mode: %m\n", tty_dev);
_WRN_PRINTF ("It might is not a console.\n");
goto fail;
}
#ifdef _MGRM_PROCESSES
@@ -858,7 +867,8 @@ static void FB_FreeHWSurfaces(_THIS)
surfaces.next = NULL;
}
static void FB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request, REP_HWSURFACE* reply)
static void FB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request,
REP_HWSURFACE* reply)
{
if (request->bucket == NULL) { /* alloc hw surface */
vidmem_bucket *bucket;
@@ -948,9 +958,9 @@ static void FB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request, REP_HWSURF
break;
}
}
if (bucket && bucket->used) {
/* Add the memory back to the total */
_DBG_PRINTF ("Freeing bucket of %d bytes\n", bucket->size);
surfaces_memleft += bucket->size;
/* Can we merge the space with surrounding buckets? */
@@ -1009,12 +1019,14 @@ static int FB_AllocHWSurface (_THIS, GAL_Surface *surface)
surface->pitch = reply.pitch;
surface->pixels = mapped_mem + reply.offset;
surface->hwdata = (struct private_hwdata *)reply.bucket;
return 0;
}
static void FB_FreeHWSurface(_THIS, GAL_Surface *surface)
{
REQ_HWSURFACE request = {surface->w, surface->h, surface->pitch, 0, surface->hwdata};
REQ_HWSURFACE request = {surface->w, surface->h, surface->pitch, 0,
surface->hwdata};
REP_HWSURFACE reply = {0, 0};
request.offset = (char*)surface->pixels - (char*)mapped_mem;
+1 -1
View File
@@ -236,7 +236,7 @@ static GAL_VideoDevice *HI3560A_CreateDevice(int devindex)
device->SetVideoMode = HI3560A_SetVideoMode;
device->SetColors = HI3560A_SetColors;
device->VideoQuit = HI3560A_VideoQuit;
#if IS_SHAREDFB_SCHEMA
#if IS_SHAREDFB_SCHEMA_PROCS
device->RequestHWSurface = HI3560A_RequestHWSurface;
#endif
device->AllocHWSurface = HI3560A_AllocHWSurface;
+1 -1
View File
@@ -1851,7 +1851,7 @@ static GAL_VideoDevice *HI3510_CreateDevice (int devindex)
this->SetVideoMode = HI3510_SetVideoMode;
//this->SetColors = FB_SetColors;
this->VideoQuit = HI3510_VideoQuit;
#if IS_SHAREDFB_SCHEMA
#if IS_SHAREDFB_SCHEMA_PROCS
this->RequestHWSurface = HI3510_RequestHWSurface;
#endif
this->AllocHWSurface = HI3510_AllocHWSurface;
+1 -1
View File
@@ -1843,7 +1843,7 @@ static GAL_VideoDevice *HI3560_CreateDevice (int devindex)
this->ListModes = HI3560_ListModes;
this->SetVideoMode = HI3560_SetVideoMode;
this->VideoQuit = HI3560_VideoQuit;
#if IS_SHAREDFB_SCHEMA
#if IS_SHAREDFB_SCHEMA_PROCS
this->RequestHWSurface = HI3560_RequestHWSurface;
#endif
this->AllocHWSurface = HI3560_AllocHWSurface;
+11 -11
View File
@@ -219,8 +219,10 @@ static GAL_Surface* create_wp_surface(GAL_Surface* screen)
screen->format->BitsPerPixel,
screen->format->Rmask, screen->format->Gmask,
screen->format->Bmask, screen->format->Amask);
_DBG_PRINTF ("GAL_CreateSharedRGBSurface: buf_size: %lu, fd: %d\n",
wp_surf->shared_header->buf_size, wp_surf->shared_header->fd);
_DBG_PRINTF ("GAL_CreateSharedRGBSurface: map size: %lu, fd: %d, RGBAmasks: %x, %x, %x, %x\n",
wp_surf->shared_header->map_size, wp_surf->shared_header->fd,
wp_surf->format->Rmask, wp_surf->format->Gmask,
wp_surf->format->Bmask, wp_surf->format->Amask);
}
else {
goto empty;
@@ -233,17 +235,17 @@ static GAL_Surface* create_wp_surface(GAL_Surface* screen)
int fd = -1;
SHAREDSURFINFO info;
req.id = REQID_GETWPSURFACE;
req.data = &fd;
req.len_data = sizeof(int);
req.id = REQID_GETSHAREDSURFACE;
req.data = SYSSF_WALLPAPER_PATTER;
req.len_data = strlen (SYSSF_WALLPAPER_PATTER) + 1;
if ((ClientRequestEx2 (&req, NULL, 0, -1,
&info, sizeof (SHAREDSURFINFO), &fd) < 0) || (fd < 0))
goto empty;
_DBG_PRINTF ("REQID_GETWPSURFACE: map_size (%lu), flags (0x%x), fd: %d\n",
info.map_size, info.flags, fd);
wp_surf = GAL_AttachSharedRGBSurface (fd, info.map_size,
_DBG_PRINTF ("REQID_GETSHAREDSURFACE: size (%lu), flags (0x%x), fd: %d\n",
info.size, info.flags, fd);
wp_surf = GAL_AttachSharedRGBSurface (fd, info.size,
info.flags, TRUE);
close (fd);
@@ -302,9 +304,7 @@ int mg_InitGAL (char* engine, char* mode)
if (GAL_VideoInit (engine, 0)) {
GAL_VideoQuit ();
_ERR_PRINTF ("NEWGAL: Does not find matched engine: %s.\n", engine);
if (IS_COMPOSITING_SCHEMA) {
_ERR_PRINTF (" Or the specified engine does not support compositing schema.\n");
}
_ERR_PRINTF (" Or failed to initialize the engine.\n");
return ERR_NO_MATCH;
}
+63 -37
View File
@@ -138,17 +138,36 @@ static int shm_init_lock (key_t key)
}
sem.val = 1;
semctl (semid, 0, SETVAL, sem);
return 0;
}
static int shm_lock (int semid) {
static void shm_lock (int semid)
{
struct sembuf sops = {0, -1, SEM_UNDO};
return (semop (semid, &sops, 1));
try_again:
if (semop (semid, &sops, 1) < 0) {
if (errno == EINTR)
goto try_again;
else
_WRN_PRINTF ("NEWGAL>PCXVFB: failed to lock sempahore id: %d; pid (%d): %s\n",
semid, getpid(), strerror (errno));
}
}
static int shm_unlock (int semid) {
static void shm_unlock (int semid)
{
struct sembuf sops = {0, +1, SEM_UNDO};
return (semop (semid, &sops, 1));
try_again:
if (semop (semid, &sops, 1)) {
if (errno == EINTR)
goto try_again;
else
_WRN_PRINTF ("NEWGAL>PCXVFB: failed to unlock sempahore id: %d; pid (%d): %s\n",
semid, getpid(), strerror (errno));
}
}
static int execl_pcxvfb (void)
@@ -224,40 +243,16 @@ static void PCXVFB_DeleteDevice (GAL_VideoDevice *device)
free (device);
}
#if 0 /* deprecated code: call common helpers for shadow screen */
#if 0 // deprecated code
static void PCXVFB_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
{
int i;
RECT bound;
#ifdef WIN32
win_PCXVFbLock ();
#else
shm_lock(semid);
#endif
bound.left = this->hidden->hdr->dirty_rc_l;
bound.top = this->hidden->hdr->dirty_rc_t;
bound.right = this->hidden->hdr->dirty_rc_r;
bound.bottom = this->hidden->hdr->dirty_rc_b;
if (bound.right == -1) bound.right = 0;
if (bound.bottom == -1) bound.bottom = 0;
bound = this->hidden->dirty_rc;
for (i = 0; i < numrects; i++) {
RECT rc;
SetRect (&rc, rects[i].x, rects[i].y,
rects[i].x + rects[i].w, rects[i].y + rects[i].h);
if (IsRectEmpty (&bound))
bound = rc;
else
GetBoundRect (&bound, &bound, &rc);
}
this->hidden->dirty_rc = bound;
shadowScreen_UpdateRects (this, numrects, rects);
#ifdef WIN32
win_PCXVFbUnlock ();
@@ -265,10 +260,12 @@ static void PCXVFB_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
shm_unlock(semid);
#endif
}
#endif /* deprecated code */
#endif // deprecated code
static BOOL PCXVFB_SyncUpdate (_THIS)
{
RECT dirty_rc;
if (IsRectEmpty (&this->hidden->dirty_rc))
return FALSE;
@@ -278,6 +275,16 @@ static BOOL PCXVFB_SyncUpdate (_THIS)
shm_lock(semid);
#endif
dirty_rc.left = this->hidden->hdr->dirty_rc_l;
dirty_rc.top = this->hidden->hdr->dirty_rc_t;
dirty_rc.right = this->hidden->hdr->dirty_rc_r;
dirty_rc.bottom = this->hidden->hdr->dirty_rc_b;
if (dirty_rc.right == -1) dirty_rc.right = 0;
if (dirty_rc.bottom == -1) dirty_rc.bottom = 0;
GetBoundRect (&this->hidden->dirty_rc, &dirty_rc,
&this->hidden->dirty_rc);
shadowScreen_BlitToReal (this);
this->hidden->hdr->dirty_rc_l = this->hidden->dirty_rc.left;
@@ -286,6 +293,8 @@ static BOOL PCXVFB_SyncUpdate (_THIS)
this->hidden->hdr->dirty_rc_b = this->hidden->dirty_rc.bottom;
this->hidden->hdr->dirty = TRUE;
SetRectEmpty (&this->hidden->dirty_rc);
#ifdef WIN32
win_PCXVFbUnlock ();
#else
@@ -325,8 +334,19 @@ static GAL_VideoDevice *PCXVFB_CreateDevice (int devindex)
this->AllocHWSurface = PCXVFB_AllocHWSurface;
this->FreeHWSurface = PCXVFB_FreeHWSurface;
#if IS_COMPOSITING_SCHEMA
if (mgIsServer) {
this->UpdateRects = shadowScreen_UpdateRects;
this->SyncUpdate = PCXVFB_SyncUpdate;
}
else {
this->UpdateRects = NULL;
this->SyncUpdate = NULL;
}
#else
this->UpdateRects = shadowScreen_UpdateRects;
this->SyncUpdate = PCXVFB_SyncUpdate;
#endif
this->CheckHWBlit = NULL;
this->FillHWRect = NULL;
@@ -475,8 +495,6 @@ static int PCXVFB_VideoInit (_THIS, GAL_PixelFormat *vformat)
listen (__mg_pcxvfb_server_sockfd, 3);
//shm_init_lock(getpid());
if ((pid = fork()) < 0) {
_ERR_PRINTF ("NEWGAL>PCXVFB: fork() error.\n");
}
@@ -606,8 +624,8 @@ static int PCXVFB_VideoInit (_THIS, GAL_PixelFormat *vformat)
GAL_SetError ("NEWGAL>PCXVFB: failed to open tmp file\n");
return -1;
}
fwrite (&shmid, sizeof(int), 1, fp);
fwrite (&semid, sizeof(int), 1, fp);
fclose (fp);
#endif /* _MGRM_PROCESSES */
}
@@ -622,11 +640,16 @@ static int PCXVFB_VideoInit (_THIS, GAL_PixelFormat *vformat)
}
if (fread (&shmid, sizeof(int), 1, fp) < 1) {
GAL_SetError ("NEWGAL>PCXVFB: can't read from tmp file\n");
GAL_SetError ("NEWGAL>PCXVFB: can't read shmid from tmp file\n");
fclose (fp);
return -1;
}
if (fread (&semid, sizeof(int), 1, fp) < 1) {
GAL_SetError ("NEWGAL>PCXVFB: can't read semid from tmp file\n");
fclose (fp);
return -1;
}
fclose(fp);
if (shmid != -1) {
@@ -820,11 +843,14 @@ static void PCXVFB_VideoQuit (_THIS)
munmap (this->hidden->shmrgn, size);
close (fd);
remove (mapFile);
semctl (semid, 0, IPC_RMID);
#else // linux
shmdt (this->hidden->shmrgn);
semctl (semid, 0, IPC_RMID);
#endif
#if defined(_MGRM_PROCESSES)
if (mgIsServer)
#endif
semctl (semid, 0, IPC_RMID);
}
#endif /* _MGGAL_PCXVFB*/
+1 -1
View File
@@ -190,7 +190,7 @@ static GAL_VideoDevice *S3C6410_CreateDevice(int devindex)
device->SetVideoMode = S3C6410_SetVideoMode;
device->SetColors = S3C6410_SetColors;
device->VideoQuit = S3C6410_VideoQuit;
#if IS_SHAREDFB_SCHEMA
#if IS_SHAREDFB_SCHEMA_PROCS
device->RequestHWSurface = S3C6410_RequestHWSurface;
#endif
device->AllocHWSurface = S3C6410_AllocHWSurface;
+8
View File
@@ -247,8 +247,12 @@ int shadowScreen_BlitToReal (_THIS)
src_rect.h = RECTH (bound);
dst_rect = src_rect;
GAL_SetupBlitting (this->hidden->shadow_screen,
this->hidden->real_screen, 0);
GAL_BlitSurface (this->hidden->shadow_screen, &src_rect,
this->hidden->real_screen, &dst_rect);
GAL_CleanupBlitting (this->hidden->shadow_screen,
this->hidden->real_screen);
#ifdef _MGSCHEMA_COMPOSITING
if (this->hidden->cursor) {
RECT csr_rc, eff_rc;
@@ -267,8 +271,12 @@ int shadowScreen_BlitToReal (_THIS)
dst_rect.y = eff_rc.top;
dst_rect.w = src_rect.w;
dst_rect.h = src_rect.h;
GAL_SetupBlitting (this->hidden->cursor,
this->hidden->real_screen, 0);
GAL_BlitSurface (this->hidden->cursor, &src_rect,
this->hidden->real_screen, &dst_rect);
GAL_CleanupBlitting (this->hidden->cursor,
this->hidden->real_screen);
}
}
#endif /* _MGSCHEMA_COMPOSITING */

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