mirror of
				https://github.com/swaywm/sway.git
				synced 2025-10-29 05:40:18 -04:00 
			
		
		
		
	swaybar: add StatusNotifierItem to tray
This commit is contained in:
		
							parent
							
								
									e6cb55e2f8
								
							
						
					
					
						commit
						74655f835a
					
				
					 6 changed files with 283 additions and 6 deletions
				
			
		
							
								
								
									
										38
									
								
								include/swaybar/tray/item.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								include/swaybar/tray/item.h
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,38 @@ | |||
| #ifndef _SWAYBAR_TRAY_ITEM_H | ||||
| #define _SWAYBAR_TRAY_ITEM_H | ||||
| 
 | ||||
| #include <stdbool.h> | ||||
| #include "swaybar/tray/tray.h" | ||||
| #include "list.h" | ||||
| 
 | ||||
| struct swaybar_pixmap { | ||||
| 	int size; | ||||
| 	unsigned char pixels[]; | ||||
| }; | ||||
| 
 | ||||
| struct swaybar_sni { | ||||
| 	// icon properties
 | ||||
| 	struct swaybar_tray *tray; | ||||
| 	cairo_surface_t *icon; | ||||
| 	int min_size; | ||||
| 	int max_size; | ||||
| 
 | ||||
| 	// dbus properties
 | ||||
| 	char *watcher_id; | ||||
| 	char *service; | ||||
| 	char *path; | ||||
| 	char *interface; | ||||
| 
 | ||||
| 	char *status; | ||||
| 	char *icon_name; | ||||
| 	list_t *icon_pixmap; // struct swaybar_pixmap *
 | ||||
| 	char *attention_icon_name; | ||||
| 	list_t *attention_icon_pixmap; // struct swaybar_pixmap *
 | ||||
| 	bool item_is_menu; | ||||
| 	char *menu; | ||||
| }; | ||||
| 
 | ||||
| struct swaybar_sni *create_sni(char *id, struct swaybar_tray *tray); | ||||
| void destroy_sni(struct swaybar_sni *sni); | ||||
| 
 | ||||
| #endif | ||||
|  | @ -24,7 +24,7 @@ struct swaybar_tray { | |||
| 
 | ||||
| 	struct swaybar_host host_xdg; | ||||
| 	struct swaybar_host host_kde; | ||||
| 	list_t *items; // char *
 | ||||
| 	list_t *items; // struct swaybar_sni *
 | ||||
| 	struct swaybar_watcher *watcher_xdg; | ||||
| 	struct swaybar_watcher *watcher_kde; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ian Fan
						Ian Fan