mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	config: prefix enums with LAB_LIBINPUT_DEVICE_
This commit is contained in:
		
							parent
							
								
									a7f8eef163
								
							
						
					
					
						commit
						673c745cff
					
				
					 3 changed files with 13 additions and 15 deletions
				
			
		| 
						 | 
				
			
			@ -8,12 +8,10 @@
 | 
			
		|||
 | 
			
		||||
enum device_type {
 | 
			
		||||
	LAB_LIBINPUT_DEVICE_NONE = 0,
 | 
			
		||||
 | 
			
		||||
	// FIXME: Rename the entries below with a LAB_LIBINPUT_ prefix
 | 
			
		||||
	DEFAULT_DEVICE,
 | 
			
		||||
	TOUCH_DEVICE,
 | 
			
		||||
	TOUCHPAD_DEVICE,
 | 
			
		||||
	NON_TOUCH_DEVICE,
 | 
			
		||||
	LAB_LIBINPUT_DEVICE_DEFAULT,
 | 
			
		||||
	LAB_LIBINPUT_DEVICE_TOUCH,
 | 
			
		||||
	LAB_LIBINPUT_DEVICE_TOUCHPAD,
 | 
			
		||||
	LAB_LIBINPUT_DEVICE_NON_TOUCH,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct libinput_category {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -10,7 +10,7 @@
 | 
			
		|||
static void
 | 
			
		||||
libinput_category_init(struct libinput_category *l)
 | 
			
		||||
{
 | 
			
		||||
	l->type = DEFAULT_DEVICE;
 | 
			
		||||
	l->type = LAB_LIBINPUT_DEVICE_DEFAULT;
 | 
			
		||||
	l->name = NULL;
 | 
			
		||||
	l->pointer_speed = -2;
 | 
			
		||||
	l->natural_scroll = -1;
 | 
			
		||||
| 
						 | 
				
			
			@ -31,16 +31,16 @@ get_device_type(const char *s)
 | 
			
		|||
		return LAB_LIBINPUT_DEVICE_NONE;
 | 
			
		||||
	}
 | 
			
		||||
	if (!strcasecmp(s, "default")) {
 | 
			
		||||
		return DEFAULT_DEVICE;
 | 
			
		||||
		return LAB_LIBINPUT_DEVICE_DEFAULT;
 | 
			
		||||
	}
 | 
			
		||||
	if (!strcasecmp(s, "touch")) {
 | 
			
		||||
		return TOUCH_DEVICE;
 | 
			
		||||
		return LAB_LIBINPUT_DEVICE_TOUCH;
 | 
			
		||||
	}
 | 
			
		||||
	if (!strcasecmp(s, "touchpad")) {
 | 
			
		||||
		return TOUCHPAD_DEVICE;
 | 
			
		||||
		return LAB_LIBINPUT_DEVICE_TOUCHPAD;
 | 
			
		||||
	}
 | 
			
		||||
	if (!strcasecmp(s, "non-touch")) {
 | 
			
		||||
		return NON_TOUCH_DEVICE;
 | 
			
		||||
		return LAB_LIBINPUT_DEVICE_NON_TOUCH;
 | 
			
		||||
	}
 | 
			
		||||
	return LAB_LIBINPUT_DEVICE_NONE;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -64,7 +64,7 @@ libinput_category_get_default(void)
 | 
			
		|||
	 * 'default' profiles were created.
 | 
			
		||||
	 */
 | 
			
		||||
	wl_list_for_each_reverse(l, &rc.libinput_categories, link) {
 | 
			
		||||
		if (l->type == DEFAULT_DEVICE) {
 | 
			
		||||
		if (l->type == LAB_LIBINPUT_DEVICE_DEFAULT) {
 | 
			
		||||
			return l;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -39,7 +39,7 @@ device_type_from_wlr_device(struct wlr_input_device *wlr_input_device)
 | 
			
		|||
	switch (wlr_input_device->type) {
 | 
			
		||||
	case WLR_INPUT_DEVICE_TOUCH:
 | 
			
		||||
	case WLR_INPUT_DEVICE_TABLET_TOOL:
 | 
			
		||||
		return TOUCH_DEVICE;
 | 
			
		||||
		return LAB_LIBINPUT_DEVICE_TOUCH;
 | 
			
		||||
	default:
 | 
			
		||||
		break;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -50,11 +50,11 @@ device_type_from_wlr_device(struct wlr_input_device *wlr_input_device)
 | 
			
		|||
			wlr_libinput_get_device_handle(wlr_input_device);
 | 
			
		||||
 | 
			
		||||
		if (libinput_device_config_tap_get_finger_count(libinput_device) > 0) {
 | 
			
		||||
			return TOUCHPAD_DEVICE;
 | 
			
		||||
			return LAB_LIBINPUT_DEVICE_TOUCHPAD;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return NON_TOUCH_DEVICE;
 | 
			
		||||
	return LAB_LIBINPUT_DEVICE_NON_TOUCH;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue