monitor-store: Add support for monitor underscanning

Add a <monitor> subelement <underscanning> for configuring
output underscanning.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
Jonas Ådahl 2017-01-17 11:31:29 +08:00
parent 097ca01411
commit e357b4a46a

View File

@ -68,6 +68,7 @@
* <height>1080</height>
* <rate>60.049972534179688</rate>
* </mode>
* <underscanning>yes</underscanning>
* </monitor>
* <presentation>yes</presentation>
* </logicalmonitor>
@ -103,6 +104,7 @@ typedef enum
STATE_MONITOR_MODE_WIDTH,
STATE_MONITOR_MODE_HEIGHT,
STATE_MONITOR_MODE_RATE,
STATE_MONITOR_UNDERSCANNING
} ParserState;
typedef struct
@ -252,6 +254,10 @@ handle_start_element (GMarkupParseContext *context,
parser->state = STATE_MONITOR_MODE;
}
else if (g_str_equal (element_name, "underscanning"))
{
parser->state = STATE_MONITOR_UNDERSCANNING;
}
else
{
g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
@ -332,6 +338,13 @@ handle_start_element (GMarkupParseContext *context,
"Invalid mode sub element '%s'", element_name);
return;
}
case STATE_MONITOR_UNDERSCANNING:
{
g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
"Invalid element '%s' under underscanning", element_name);
return;
}
}
}
@ -566,6 +579,14 @@ handle_end_element (GMarkupParseContext *context,
return;
}
case STATE_MONITOR_UNDERSCANNING:
{
g_assert (g_str_equal (element_name, "underscanning"));
parser->state = STATE_MONITOR;
return;
}
case STATE_MONITOR:
{
MetaLogicalMonitorConfig *logical_monitor_config;
@ -842,6 +863,14 @@ handle_text (GMarkupParseContext *context,
error);
return;
}
case STATE_MONITOR_UNDERSCANNING:
{
read_bool (text, text_len,
&parser->current_monitor_config->is_underscanning,
error);
return;
}
}
}