summaryrefslogtreecommitdiff
path: root/cpufreq/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpufreq/src')
-rw-r--r--cpufreq/src/cpufreq-monitor.c9
-rw-r--r--cpufreq/src/cpufreq-popup.c15
-rw-r--r--cpufreq/src/cpufreq-prefs.c11
-rw-r--r--cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c9
-rw-r--r--cpufreq/src/cpufreq-selector/cpufreq-selector.c9
5 files changed, 14 insertions, 39 deletions
diff --git a/cpufreq/src/cpufreq-monitor.c b/cpufreq/src/cpufreq-monitor.c
index 38ffa0e2..0f5f116d 100644
--- a/cpufreq/src/cpufreq-monitor.c
+++ b/cpufreq/src/cpufreq-monitor.c
@@ -21,9 +21,6 @@
#include "cpufreq-monitor.h"
-#define CPUFREQ_MONITOR_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), CPUFREQ_TYPE_MONITOR, CPUFreqMonitorPrivate))
-
#define CPUFREQ_MONITOR_INTERVAL 1
/* Properties */
@@ -70,12 +67,12 @@ static void cpufreq_monitor_get_property (GObject *object,
static guint signals[N_SIGNALS] = { 0 };
-G_DEFINE_ABSTRACT_TYPE (CPUFreqMonitor, cpufreq_monitor, G_TYPE_OBJECT)
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (CPUFreqMonitor, cpufreq_monitor, G_TYPE_OBJECT)
static void
cpufreq_monitor_init (CPUFreqMonitor *monitor)
{
- monitor->priv = CPUFREQ_MONITOR_GET_PRIVATE (monitor);
+ monitor->priv = cpufreq_monitor_get_instance_private (monitor);
monitor->priv->governor = NULL;
monitor->priv->available_freqs = NULL;
@@ -98,8 +95,6 @@ cpufreq_monitor_class_init (CPUFreqMonitorClass *klass)
klass->get_available_frequencies = NULL;
klass->get_available_governors = NULL;
- g_type_class_add_private (klass, sizeof (CPUFreqMonitorPrivate));
-
/* Porperties */
g_object_class_install_property (object_class,
PROP_CPU,
diff --git a/cpufreq/src/cpufreq-popup.c b/cpufreq/src/cpufreq-popup.c
index 049fe8b2..805cbd4e 100644
--- a/cpufreq/src/cpufreq-popup.c
+++ b/cpufreq/src/cpufreq-popup.c
@@ -33,10 +33,10 @@
struct _CPUFreqPopupPrivate {
GtkUIManager *ui_manager;
GSList *radio_group;
-
+
GtkActionGroup *freqs_group;
GSList *freqs_actions;
-
+
GtkActionGroup *govs_group;
GSList *govs_actions;
@@ -48,14 +48,11 @@ struct _CPUFreqPopupPrivate {
GtkWidget *parent;
};
-#define CPUFREQ_POPUP_GET_PRIVATE(object) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((object), CPUFREQ_TYPE_POPUP, CPUFreqPopupPrivate))
-
static void cpufreq_popup_init (CPUFreqPopup *popup);
static void cpufreq_popup_class_init (CPUFreqPopupClass *klass);
static void cpufreq_popup_finalize (GObject *object);
-G_DEFINE_TYPE (CPUFreqPopup, cpufreq_popup, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (CPUFreqPopup, cpufreq_popup, G_TYPE_OBJECT)
static const gchar *ui_popup =
"<ui>"
@@ -74,7 +71,7 @@ static const gchar *ui_popup =
static void
cpufreq_popup_init (CPUFreqPopup *popup)
{
- popup->priv = CPUFREQ_POPUP_GET_PRIVATE (popup);
+ popup->priv = cpufreq_popup_get_instance_private (popup);
popup->priv->ui_manager = gtk_ui_manager_new ();
popup->priv->radio_group = NULL;
@@ -91,7 +88,7 @@ cpufreq_popup_init (CPUFreqPopup *popup)
gtk_ui_manager_add_ui_from_string (popup->priv->ui_manager,
ui_popup, -1, NULL);
-
+
popup->priv->monitor = NULL;
}
@@ -100,8 +97,6 @@ cpufreq_popup_class_init (CPUFreqPopupClass *klass)
{
GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (g_object_class, sizeof (CPUFreqPopupPrivate));
-
g_object_class->finalize = cpufreq_popup_finalize;
}
diff --git a/cpufreq/src/cpufreq-prefs.c b/cpufreq/src/cpufreq-prefs.c
index 38c28402..8ccaa17f 100644
--- a/cpufreq/src/cpufreq-prefs.c
+++ b/cpufreq/src/cpufreq-prefs.c
@@ -39,7 +39,7 @@ enum {
struct _CPUFreqPrefsPrivate {
GSettings *settings;
-
+
guint cpu;
CPUFreqShowMode show_mode;
CPUFreqShowTextMode show_text_mode;
@@ -54,9 +54,6 @@ struct _CPUFreqPrefsPrivate {
GtkWidget *show_mode_combo;
};
-#define CPUFREQ_PREFS_GET_PRIVATE(object) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((object), CPUFREQ_TYPE_PREFS, CPUFreqPrefsPrivate))
-
static void cpufreq_prefs_init (CPUFreqPrefs *prefs);
static void cpufreq_prefs_class_init (CPUFreqPrefsClass *klass);
static void cpufreq_prefs_finalize (GObject *object);
@@ -73,12 +70,12 @@ static void cpufreq_prefs_get_property (GObject *object,
static void cpufreq_prefs_dialog_update_sensitivity (CPUFreqPrefs *prefs);
-G_DEFINE_TYPE (CPUFreqPrefs, cpufreq_prefs, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (CPUFreqPrefs, cpufreq_prefs, G_TYPE_OBJECT)
static void
cpufreq_prefs_init (CPUFreqPrefs *prefs)
{
- prefs->priv = CPUFREQ_PREFS_GET_PRIVATE (prefs);
+ prefs->priv = cpufreq_prefs_get_instance_private (prefs);
prefs->priv->settings = NULL;
@@ -92,8 +89,6 @@ cpufreq_prefs_class_init (CPUFreqPrefsClass *klass)
g_object_class->set_property = cpufreq_prefs_set_property;
g_object_class->get_property = cpufreq_prefs_get_property;
-
- g_type_class_add_private (g_object_class, sizeof (CPUFreqPrefsPrivate));
/* Properties */
g_object_class_install_property (g_object_class,
diff --git a/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c b/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c
index 990ea702..1cb87660 100644
--- a/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c
+++ b/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c
@@ -26,9 +26,6 @@
#include "cpufreq-selector-sysfs.h"
-#define CPUFREQ_SELECTOR_SYSFS_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), CPUFREQ_TYPE_SELECTOR_SYSFS, CPUFreqSelectorSysfsPrivate))
-
struct _CPUFreqSelectorSysfsPrivate {
GList *available_freqs;
GList *available_govs;
@@ -47,12 +44,12 @@ static gboolean cpufreq_selector_sysfs_set_governor (CPUFreqSelector
#define CPUFREQ_SYSFS_BASE_PATH "/sys/devices/system/cpu/cpu%u/cpufreq/%s"
-G_DEFINE_TYPE (CPUFreqSelectorSysfs, cpufreq_selector_sysfs, CPUFREQ_TYPE_SELECTOR)
+G_DEFINE_TYPE_WITH_PRIVATE (CPUFreqSelectorSysfs, cpufreq_selector_sysfs, CPUFREQ_TYPE_SELECTOR)
static void
cpufreq_selector_sysfs_init (CPUFreqSelectorSysfs *selector)
{
- selector->priv = CPUFREQ_SELECTOR_SYSFS_GET_PRIVATE (selector);
+ selector->priv = cpufreq_selector_sysfs_get_instance_private (selector);
selector->priv->available_freqs = NULL;
selector->priv->available_govs = NULL;
@@ -64,8 +61,6 @@ cpufreq_selector_sysfs_class_init (CPUFreqSelectorSysfsClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
CPUFreqSelectorClass *selector_class = CPUFREQ_SELECTOR_CLASS (klass);
- g_type_class_add_private (klass, sizeof (CPUFreqSelectorSysfsPrivate));
-
selector_class->set_frequency = cpufreq_selector_sysfs_set_frequency;
selector_class->set_governor = cpufreq_selector_sysfs_set_governor;
diff --git a/cpufreq/src/cpufreq-selector/cpufreq-selector.c b/cpufreq/src/cpufreq-selector/cpufreq-selector.c
index 23933c72..7f10c773 100644
--- a/cpufreq/src/cpufreq-selector/cpufreq-selector.c
+++ b/cpufreq/src/cpufreq-selector/cpufreq-selector.c
@@ -22,9 +22,6 @@
#include <glib.h>
#include "cpufreq-selector.h"
-#define CPUFREQ_SELECTOR_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), CPUFREQ_TYPE_SELECTOR, CPUFreqSelectorPrivate))
-
enum {
PROP_0,
PROP_CPU
@@ -46,7 +43,7 @@ static void cpufreq_selector_get_property (GObject *object,
GValue *value,
GParamSpec *spec);
-G_DEFINE_ABSTRACT_TYPE (CPUFreqSelector, cpufreq_selector, G_TYPE_OBJECT)
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (CPUFreqSelector, cpufreq_selector, G_TYPE_OBJECT)
GQuark
cpufreq_selector_error_quark (void)
@@ -64,7 +61,7 @@ static void
cpufreq_selector_init (CPUFreqSelector *selector)
{
- selector->priv = CPUFREQ_SELECTOR_GET_PRIVATE (selector);
+ selector->priv = cpufreq_selector_get_instance_private (selector);
selector->priv->cpu = 0;
}
@@ -74,8 +71,6 @@ cpufreq_selector_class_init (CPUFreqSelectorClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (CPUFreqSelectorPrivate));
-
object_class->set_property = cpufreq_selector_set_property;
object_class->get_property = cpufreq_selector_get_property;