| 
									
										
										
										
											2024-03-11 13:05:37 -05:00
										 |  |  | """Functions used to generate source files during build time""" | 
					
						
							| 
									
										
										
										
											2018-03-17 23:23:55 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-29 14:23:08 -05:00
										 |  |  | import methods | 
					
						
							| 
									
										
										
										
											2018-03-17 23:23:55 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-29 14:23:08 -05:00
										 |  |  | def make_splash(target, source, env): | 
					
						
							|  |  |  |     buffer = methods.get_buffer(str(source[0])) | 
					
						
							| 
									
										
										
										
											2018-03-17 23:23:55 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-29 14:23:08 -05:00
										 |  |  |     with methods.generated_wrapper(str(target[0])) as file: | 
					
						
							| 
									
										
										
										
											2021-03-17 22:56:58 +01:00
										 |  |  |         # Use a neutral gray color to better fit various kinds of projects. | 
					
						
							| 
									
										
										
										
											2024-10-29 14:23:08 -05:00
										 |  |  |         file.write(f"""\
 | 
					
						
							|  |  |  | static const Color boot_splash_bg_color = Color(0.14, 0.14, 0.14); | 
					
						
							|  |  |  | inline constexpr const unsigned char boot_splash_png[] = {{ | 
					
						
							|  |  |  | 	{methods.format_buffer(buffer, 1)} | 
					
						
							|  |  |  | }}; | 
					
						
							|  |  |  | """)
 | 
					
						
							| 
									
										
										
										
											2018-03-17 23:23:55 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def make_splash_editor(target, source, env): | 
					
						
							| 
									
										
										
										
											2024-10-29 14:23:08 -05:00
										 |  |  |     buffer = methods.get_buffer(str(source[0])) | 
					
						
							| 
									
										
										
										
											2018-03-17 23:23:55 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-29 14:23:08 -05:00
										 |  |  |     with methods.generated_wrapper(str(target[0])) as file: | 
					
						
							| 
									
										
										
										
											2021-03-17 22:56:58 +01:00
										 |  |  |         # The editor splash background color is taken from the default editor theme's background color. | 
					
						
							|  |  |  |         # This helps achieve a visually "smoother" transition between the splash screen and the editor. | 
					
						
							| 
									
										
										
										
											2024-10-29 14:23:08 -05:00
										 |  |  |         file.write(f"""\
 | 
					
						
							|  |  |  | static const Color boot_splash_editor_bg_color = Color(0.125, 0.145, 0.192); | 
					
						
							|  |  |  | inline constexpr const unsigned char boot_splash_editor_png[] = {{ | 
					
						
							|  |  |  | 	{methods.format_buffer(buffer, 1)} | 
					
						
							|  |  |  | }}; | 
					
						
							|  |  |  | """)
 | 
					
						
							| 
									
										
										
										
											2018-03-17 23:23:55 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def make_app_icon(target, source, env): | 
					
						
							| 
									
										
										
										
											2024-10-29 14:23:08 -05:00
										 |  |  |     buffer = methods.get_buffer(str(source[0])) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     with methods.generated_wrapper(str(target[0])) as file: | 
					
						
							|  |  |  |         # Use a neutral gray color to better fit various kinds of projects. | 
					
						
							|  |  |  |         file.write(f"""\
 | 
					
						
							|  |  |  | inline constexpr const unsigned char app_icon_png[] = {{ | 
					
						
							|  |  |  | 	{methods.format_buffer(buffer, 1)} | 
					
						
							|  |  |  | }}; | 
					
						
							|  |  |  | """)
 |