diff options
| author | Iain Lane <iain@orangesquash.org.uk> | 2018-09-24 09:29:55 +0100 |
|---|---|---|
| committer | Iain Lane <iain@orangesquash.org.uk> | 2018-09-24 09:29:55 +0100 |
| commit | e152ec7bf4ba252ff9d3eb13eabd417b931dac9a (patch) | |
| tree | c323cf856ee0bb8e44590670dd54c19653a55748 /clients/common/nm-meta-setting-desc.h | |
| parent | ee9c73a923909e23a649407be77e25235d769e25 (diff) | |
Import Upstream version 1.12.2
Diffstat (limited to 'clients/common/nm-meta-setting-desc.h')
| -rw-r--r-- | clients/common/nm-meta-setting-desc.h | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/clients/common/nm-meta-setting-desc.h b/clients/common/nm-meta-setting-desc.h index e61b1fc4..e7ab6e86 100644 --- a/clients/common/nm-meta-setting-desc.h +++ b/clients/common/nm-meta-setting-desc.h @@ -14,7 +14,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright 2010 - 2017 Red Hat, Inc. + * Copyright 2010 - 2018 Red Hat, Inc. */ #ifndef __NM_META_SETTING_DESC_H__ @@ -83,31 +83,54 @@ struct _NMDevice; #define NM_META_TEXT_PROMPT_PROXY_METHOD_CHOICES "(" NM_META_TEXT_WORD_NONE "/" NM_META_TEXT_WORD_AUTO ") [" NM_META_TEXT_WORD_NONE "]" typedef enum { - NM_META_TERM_COLOR_NORMAL = 0, - NM_META_TERM_COLOR_BLACK = 1, - NM_META_TERM_COLOR_RED = 2, - NM_META_TERM_COLOR_GREEN = 3, - NM_META_TERM_COLOR_YELLOW = 4, - NM_META_TERM_COLOR_BLUE = 5, - NM_META_TERM_COLOR_MAGENTA = 6, - NM_META_TERM_COLOR_CYAN = 7, - NM_META_TERM_COLOR_WHITE = 8, -} NMMetaTermColor; - -typedef enum { - NM_META_TERM_FORMAT_NORMAL = 0, - NM_META_TERM_FORMAT_BOLD = 1, - NM_META_TERM_FORMAT_DIM = 2, - NM_META_TERM_FORMAT_UNDERLINE = 3, - NM_META_TERM_FORMAT_BLINK = 4, - NM_META_TERM_FORMAT_REVERSE = 5, - NM_META_TERM_FORMAT_HIDDEN = 6, -} NMMetaTermFormat; + NM_META_COLOR_NONE = 0, + NM_META_COLOR_CONNECTION_ACTIVATED, + NM_META_COLOR_CONNECTION_ACTIVATING, + NM_META_COLOR_CONNECTION_DISCONNECTING, + NM_META_COLOR_CONNECTION_INVISIBLE, + NM_META_COLOR_CONNECTION_UNKNOWN, + NM_META_COLOR_CONNECTIVITY_FULL, + NM_META_COLOR_CONNECTIVITY_LIMITED, + NM_META_COLOR_CONNECTIVITY_NONE, + NM_META_COLOR_CONNECTIVITY_PORTAL, + NM_META_COLOR_CONNECTIVITY_UNKNOWN, + NM_META_COLOR_DEVICE_ACTIVATED, + NM_META_COLOR_DEVICE_ACTIVATING, + NM_META_COLOR_DEVICE_DISCONNECTED, + NM_META_COLOR_DEVICE_FIRMWARE_MISSING, + NM_META_COLOR_DEVICE_PLUGIN_MISSING, + NM_META_COLOR_DEVICE_UNAVAILABLE, + NM_META_COLOR_DEVICE_UNKNOWN, + NM_META_COLOR_MANAGER_RUNNING, + NM_META_COLOR_MANAGER_STARTING, + NM_META_COLOR_MANAGER_STOPPED, + NM_META_COLOR_PERMISSION_AUTH, + NM_META_COLOR_PERMISSION_NO, + NM_META_COLOR_PERMISSION_UNKNOWN, + NM_META_COLOR_PERMISSION_YES, + NM_META_COLOR_PROMPT, + NM_META_COLOR_STATE_ASLEEP, + NM_META_COLOR_STATE_CONNECTED_GLOBAL, + NM_META_COLOR_STATE_CONNECTED_LOCAL, + NM_META_COLOR_STATE_CONNECTED_SITE, + NM_META_COLOR_STATE_CONNECTING, + NM_META_COLOR_STATE_DISCONNECTED, + NM_META_COLOR_STATE_DISCONNECTING, + NM_META_COLOR_STATE_UNKNOWN, + NM_META_COLOR_WIFI_SIGNAL_EXCELLENT, + NM_META_COLOR_WIFI_SIGNAL_FAIR, + NM_META_COLOR_WIFI_SIGNAL_GOOD, + NM_META_COLOR_WIFI_SIGNAL_POOR, + NM_META_COLOR_WIFI_SIGNAL_UNKNOWN, + NM_META_COLOR_DISABLED, + NM_META_COLOR_ENABLED, + _NM_META_COLOR_NUM +} NMMetaColor; typedef enum { NM_META_ACCESSOR_GET_TYPE_PRETTY, NM_META_ACCESSOR_GET_TYPE_PARSABLE, - NM_META_ACCESSOR_GET_TYPE_TERMFORMAT, + NM_META_ACCESSOR_GET_TYPE_COLOR, } NMMetaAccessorGetType; typedef enum { @@ -115,32 +138,6 @@ typedef enum { NM_META_ACCESSOR_SETTING_INIT_TYPE_CLI, } NMMetaAccessorSettingInitType; -static inline void -nm_meta_termformat_unpack (gconstpointer value, NMMetaTermColor *out_color, NMMetaTermFormat *out_format) -{ - /* get_fcn() with NM_META_ACCESSOR_GET_TYPE_TERMFORMAT returns a pointer - * that encodes NMMetaTermColor and NMMetaTermFormat. Unpack it. */ - if (!value) { - /* by default, objects that don't support NM_META_ACCESSOR_GET_TYPE_TERMFORMAT - * return NULL. This allows for an explicit fallback value here... */ - NM_SET_OUT (out_color, NM_META_TERM_COLOR_NORMAL); - NM_SET_OUT (out_format, NM_META_TERM_FORMAT_NORMAL); - } else { - NM_SET_OUT (out_color, GPOINTER_TO_UINT (value) & 0xFF); - NM_SET_OUT (out_format, (GPOINTER_TO_UINT (value) & 0xFF00) >> 8); - } -} - -static inline gconstpointer -nm_meta_termformat_pack (NMMetaTermColor color, NMMetaTermFormat format) -{ - /* get_fcn() with NM_META_ACCESSOR_GET_TYPE_TERMFORMAT returns a pointer - * that encodes NMMetaTermColor and NMMetaTermFormat. Pack it. */ - return GUINT_TO_POINTER (((guint) 0x10000) | (((guint) color) & 0xFFu) | ((((guint) format) & 0xFFu) << 8)); -} - -#define NM_META_TERMFORMAT_DEFAULT() (nm_meta_termformat_pack (NM_META_TERM_COLOR_NORMAL, NM_META_TERM_FORMAT_NORMAL)) - typedef enum { NM_META_ACCESSOR_GET_FLAGS_NONE = 0, NM_META_ACCESSOR_GET_FLAGS_ACCEPT_STRV = (1LL << 0), @@ -181,7 +178,7 @@ typedef struct _NMMetaPropertyTypDataNested NMMetaPropertyTypDataNested; /* this gives some context information for virtual functions. * This command actually violates layering, and should be considered - * a hack. In the future, try to replace it's use. */ + * a hack. In the future, try to replace its use. */ struct _NMMetaOperationContext { NMConnection *connection; }; @@ -199,6 +196,7 @@ struct _NMMetaPropertyType { NMMetaAccessorGetType get_type, NMMetaAccessorGetFlags get_flags, NMMetaAccessorGetOutFlags *out_flags, + gboolean *out_is_default, gpointer *out_to_free); gboolean (*set_fcn) (const NMMetaPropertyInfo *property_info, const NMMetaEnvironment *environment, @@ -241,7 +239,8 @@ struct _NMMetaPropertyTypData { GType (*get_gtype) (void); int min; int max; - const struct _NMUtilsEnumValueInfo *value_infos; + const struct _NMUtilsEnumValueInfo *value_infos_get; /* nicks for get function */ + const struct _NMUtilsEnumValueInfo *value_infos; /* nicks for set function */ void (*pre_set_notify) (const NMMetaPropertyInfo *property_info, const NMMetaEnvironment *environment, gpointer environment_user_data, @@ -362,6 +361,7 @@ struct _NMMetaType { NMMetaAccessorGetType get_type, NMMetaAccessorGetFlags get_flags, NMMetaAccessorGetOutFlags *out_flags, + gboolean *out_is_defalt, gpointer *out_to_free); const char *const*(*complete_fcn) (const NMMetaAbstractInfo *info, const NMMetaEnvironment *environment, |