libgaminggear
Data Structures | Macros | Typedefs | Enumerations | Functions
gaminggear_profile_data.h File Reference

GaminggearProfileData. More...

Data Structures

struct  _GaminggearProfileData
 
struct  _GaminggearProfileDataClass
 

Macros

#define GAMINGGEAR_PROFILE_DATA_TYPE   (gaminggear_profile_data_get_type())
 
#define GAMINGGEAR_PROFILE_DATA(obj)   (G_TYPE_CHECK_INSTANCE_CAST((obj), GAMINGGEAR_PROFILE_DATA_TYPE, GaminggearProfileData))
 
#define IS_GAMINGGEAR_PROFILE_DATA(obj)   (G_TYPE_CHECK_INSTANCE_TYPE((obj), GAMINGGEAR_PROFILE_DATA_TYPE))
 
#define GAMINGGEAR_PROFILE_DATA_CLASS(obj)   (G_TYPE_CHECK_CLASS_CAST((obj), GAMINGGEAR_PROFILE_DATA_TYPE, GaminggearProfileDataClass))
 
#define IS_GAMINGGEAR_PROFILE_DATA_CLASS(obj)   (G_TYPE_CHECK_CLASS_TYPE((obj), GAMINGGEAR_PROFILE_DATA_TYPE))
 
#define GAMINGGEAR_PROFILE_DATA_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), GAMINGGEAR_PROFILE_DATA_TYPE, GaminggearProfileDataClass))
 

Typedefs

typedef struct _GaminggearProfileData GaminggearProfileData
 
typedef struct _GaminggearProfileDataClass GaminggearProfileDataClass
 
typedef struct _GaminggearProfileDataPrivate GaminggearProfileDataPrivate
 

Enumerations

enum  { GAMINGGEAR_PROFILE_DATA_GAMEFILE_NUM = 5, GAMINGGEAR_PROFILE_DATA_GAMEFILE_PROFILE_INVALID = -1 }
 

Functions

GType gaminggear_profile_data_get_type (void)
 
gchar const * gaminggear_profile_data_get_name (GaminggearProfileData *self)
 Get profile name. More...
 
void gaminggear_profile_data_set_name (GaminggearProfileData *self, gchar const *new_name)
 Set profile name. More...
 
gchar const * gaminggear_profile_data_get_gamefile (GaminggearProfileData *self, guint index)
 Get gamefile. More...
 
void gaminggear_profile_data_set_gamefile (GaminggearProfileData *self, guint index, gchar const *new_gamefile)
 Set gamefile. More...
 
gint gaminggear_profile_data_get_hardware_index (GaminggearProfileData *self)
 Get profile index in hardware. More...
 
void gaminggear_profile_data_set_hardware_index (GaminggearProfileData *self, gint new_index)
 Set profile index in hardware. More...
 
gboolean gaminggear_profile_data_store (GaminggearProfileData *self, GaminggearDevice *device, GError **error)
 Save filesystem and hardware data. More...
 
gboolean gaminggear_profile_data_load (GaminggearProfileData *self, gchar const *path, GError **error)
 Load filesystem data. More...
 
gboolean gaminggear_profile_data_remove (GaminggearProfileData *self, GError **error)
 Remove filesystem data. More...
 
gboolean gaminggear_profile_data_read (GaminggearProfileData *self, GaminggearDevice *device, GError **error)
 Read hardware data. More...
 
gboolean gaminggear_profile_data_get_modified (GaminggearProfileData *self)
 Get modified state. More...
 
void gaminggear_profile_data_reset (GaminggearProfileData *self)
 Reset data. More...
 
gboolean gaminggear_profile_data_get_valid (GaminggearProfileData *self)
 Get if instance is valid. More...
 
GaminggearProfileDatagaminggear_profile_data_dup (GaminggearProfileData *other)
 Duplicates profile data. More...
 
gboolean gaminggear_profile_data_equal (GaminggearProfileData *self, GaminggearProfileData *other)
 Checks equality of two profile datas. More...
 
void gaminggear_profile_data_discriminate (GaminggearProfileData *self)
 Makes profile data unique. More...
 

Detailed Description

GaminggearProfileData.

Macro Definition Documentation

◆ GAMINGGEAR_PROFILE_DATA

#define GAMINGGEAR_PROFILE_DATA (   obj)    (G_TYPE_CHECK_INSTANCE_CAST((obj), GAMINGGEAR_PROFILE_DATA_TYPE, GaminggearProfileData))

◆ GAMINGGEAR_PROFILE_DATA_CLASS

#define GAMINGGEAR_PROFILE_DATA_CLASS (   obj)    (G_TYPE_CHECK_CLASS_CAST((obj), GAMINGGEAR_PROFILE_DATA_TYPE, GaminggearProfileDataClass))

◆ GAMINGGEAR_PROFILE_DATA_GET_CLASS

#define GAMINGGEAR_PROFILE_DATA_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), GAMINGGEAR_PROFILE_DATA_TYPE, GaminggearProfileDataClass))

◆ GAMINGGEAR_PROFILE_DATA_TYPE

#define GAMINGGEAR_PROFILE_DATA_TYPE   (gaminggear_profile_data_get_type())

◆ IS_GAMINGGEAR_PROFILE_DATA

#define IS_GAMINGGEAR_PROFILE_DATA (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE((obj), GAMINGGEAR_PROFILE_DATA_TYPE))

◆ IS_GAMINGGEAR_PROFILE_DATA_CLASS

#define IS_GAMINGGEAR_PROFILE_DATA_CLASS (   obj)    (G_TYPE_CHECK_CLASS_TYPE((obj), GAMINGGEAR_PROFILE_DATA_TYPE))

Typedef Documentation

◆ GaminggearProfileData

◆ GaminggearProfileDataClass

◆ GaminggearProfileDataPrivate

typedef struct _GaminggearProfileDataPrivate GaminggearProfileDataPrivate

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
GAMINGGEAR_PROFILE_DATA_GAMEFILE_NUM 
GAMINGGEAR_PROFILE_DATA_GAMEFILE_PROFILE_INVALID 

Function Documentation

◆ gaminggear_profile_data_discriminate()

void gaminggear_profile_data_discriminate ( GaminggearProfileData self)

Makes profile data unique.

Changes profile data so that a new file is created.

Parameters
selfInstance.
Since
1.0

◆ gaminggear_profile_data_dup()

GaminggearProfileData* gaminggear_profile_data_dup ( GaminggearProfileData other)

Duplicates profile data.

Creates unmodified deep copy of other.

Parameters
otherThe object to duplicate.
Return values
profile_dataNew object.
Since
1.0

◆ gaminggear_profile_data_equal()

gboolean gaminggear_profile_data_equal ( GaminggearProfileData self,
GaminggearProfileData other 
)

Checks equality of two profile datas.

Only checks the data, not where it would be saved.

Parameters
selfOne object.
otherOther object to compare against self.
Return values
boolTRUE if equal, else FALSE.
Since
1.0

◆ gaminggear_profile_data_get_gamefile()

gchar const* gaminggear_profile_data_get_gamefile ( GaminggearProfileData self,
guint  index 
)

Get gamefile.

Pointer is only valid at the moment, make a copy if needed.

Parameters
selfInstance.
indexIndex in range of [0, GAMINGGEAR_PROFILE_DATA_GAMEFILE_NUM[.
Return values
string
Since
1.0

◆ gaminggear_profile_data_get_hardware_index()

gint gaminggear_profile_data_get_hardware_index ( GaminggearProfileData self)

Get profile index in hardware.

Parameters
selfInstance.
Return values
indexof profile in hardware or GAMINGGEAR_PROFILE_DATA_GAMEFILE_PROFILE_INVALID.
Since
1.0

◆ gaminggear_profile_data_get_modified()

gboolean gaminggear_profile_data_get_modified ( GaminggearProfileData self)

Get modified state.

Parameters
selfInstance.
Return values
boolTRUE if data should be saved/written, else FALSE.
Since
1.0

◆ gaminggear_profile_data_get_name()

gchar const* gaminggear_profile_data_get_name ( GaminggearProfileData self)

Get profile name.

Pointer is only valid at the moment, make a copy if needed.

Parameters
selfInstance.
Return values
stringthat should not be freed.
Since
1.0

◆ gaminggear_profile_data_get_type()

GType gaminggear_profile_data_get_type ( void  )

◆ gaminggear_profile_data_get_valid()

gboolean gaminggear_profile_data_get_valid ( GaminggearProfileData self)

Get if instance is valid.

Parameters
selfInstance.
Since
1.0

◆ gaminggear_profile_data_load()

gboolean gaminggear_profile_data_load ( GaminggearProfileData self,
gchar const *  path,
GError **  error 
)

Load filesystem data.

Parameters
selfInstance.
pathFilesystem path of file to load.
errorLocation to return an error.
Return values
boolTRUE if successful, else FALSE.
Since
1.0

◆ gaminggear_profile_data_read()

gboolean gaminggear_profile_data_read ( GaminggearProfileData self,
GaminggearDevice device,
GError **  error 
)

Read hardware data.

Data is only read if device and hardware index are valid.

Parameters
selfInstance.
deviceDevice to read from or NULL.
errorLocation to return an error.
Return values
boolTRUE if successful, else FALSE.
Since
1.0

◆ gaminggear_profile_data_remove()

gboolean gaminggear_profile_data_remove ( GaminggearProfileData self,
GError **  error 
)

Remove filesystem data.

Instance should not be used after calling this function.

Parameters
selfInstance.
errorLocation to return an error.
Return values
boolTRUE if successful, else FALSE.
Since
1.0

◆ gaminggear_profile_data_reset()

void gaminggear_profile_data_reset ( GaminggearProfileData self)

Reset data.

Resets the actual data with the last stored values.

Parameters
selfInstance.
Since
1.0

◆ gaminggear_profile_data_set_gamefile()

void gaminggear_profile_data_set_gamefile ( GaminggearProfileData self,
guint  index,
gchar const *  new_gamefile 
)

Set gamefile.

Parameters
selfInstance.
indexIndex in range of [0, GAMINGGEAR_PROFILE_DATA_GAMEFILE_NUM[.
new_gamefile
Since
1.0

◆ gaminggear_profile_data_set_hardware_index()

void gaminggear_profile_data_set_hardware_index ( GaminggearProfileData self,
gint  new_index 
)

Set profile index in hardware.

Parameters
selfInstance.
new_indexProfile index in hardware or GAMINGGEAR_PROFILE_DATA_GAMEFILE_PROFILE_INVALID.
Since
1.0

◆ gaminggear_profile_data_set_name()

void gaminggear_profile_data_set_name ( GaminggearProfileData self,
gchar const *  new_name 
)

Set profile name.

Parameters
selfInstance.
new_nameNew name.
Since
1.0

◆ gaminggear_profile_data_store()

gboolean gaminggear_profile_data_store ( GaminggearProfileData self,
GaminggearDevice device,
GError **  error 
)

Save filesystem and hardware data.

Filesystem data is either saved to file it has been loaded from or a unique Filename is created. Hardware data is only stored if device and hardware index is valid.

Parameters
selfInstance.
deviceDevice to write to or NULL.
errorLocation to return an error.
Return values
boolTRUE if successful, else FALSE.
Since
1.0