Skip to content
Permalink
Browse files

Avoid deprecated g_type_class_add_private under src

Changed CajaSidePane, CajaSpatialWindow, CajaViewAsAction and CajaXContentBar
  • Loading branch information...
yetist authored and lukefromdc committed Jan 26, 2019
1 parent 7920f97 commit e99050ad48b89cb8e1a5eaafbb9fdf2ffd418485
@@ -40,7 +40,7 @@ typedef struct
GtkWidget *shortcut;
} SidePanel;

struct _CajaSidePaneDetails
struct _CajaSidePanePrivate
{
GtkWidget *notebook;
GtkWidget *menu;
@@ -52,7 +52,7 @@ struct _CajaSidePaneDetails
};

static void caja_side_pane_class_init (CajaSidePaneClass *klass);
static void caja_side_pane_init (GObject *object);
static void caja_side_pane_init (CajaSidePane *side_pane);
static void caja_side_pane_dispose (GObject *object);
static void caja_side_pane_finalize (GObject *object);

@@ -65,7 +65,7 @@ enum

static guint signals[LAST_SIGNAL] = { 0 };

EEL_CLASS_BOILERPLATE (CajaSidePane, caja_side_pane, GTK_TYPE_BOX)
G_DEFINE_TYPE_WITH_PRIVATE (CajaSidePane, caja_side_pane, GTK_TYPE_BOX)

static SidePanel *
panel_for_widget (CajaSidePane *side_pane, GtkWidget *widget)
@@ -160,8 +160,6 @@ caja_side_pane_class_init (CajaSidePaneClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1, GTK_TYPE_WIDGET);

g_type_class_add_private (gobject_class, sizeof (CajaSidePaneDetails));
}

static void
@@ -274,30 +272,27 @@ menu_detach_callback (GtkWidget *widget,
}

static void
caja_side_pane_init (GObject *object)
caja_side_pane_init (CajaSidePane *side_pane)
{
CajaSidePane *side_pane;
GtkWidget *hbox;
GtkWidget *close_button;
GtkWidget *select_button;
GtkWidget *select_hbox;
GtkWidget *arrow;
GtkWidget *image;

side_pane = CAJA_SIDE_PANE (object);

side_pane->details = G_TYPE_INSTANCE_GET_PRIVATE (object, CAJA_TYPE_SIDE_PANE, CajaSidePaneDetails);
side_pane->details = caja_side_pane_get_instance_private (side_pane);

GtkStyleContext *context;

context = gtk_widget_get_style_context (GTK_WIDGET (object));
context = gtk_widget_get_style_context (GTK_WIDGET (side_pane));
gtk_style_context_add_class (context, "caja-side-pane");

hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
side_pane->details->title_hbox = hbox;
gtk_widget_show (hbox);
gtk_orientable_set_orientation (GTK_ORIENTABLE (object), GTK_ORIENTATION_VERTICAL);
gtk_orientable_set_orientation (GTK_ORIENTABLE (side_pane), GTK_ORIENTATION_VERTICAL);
gtk_box_pack_start (GTK_BOX (side_pane), hbox, FALSE, FALSE, 0);

select_button = gtk_toggle_button_new ();
@@ -401,7 +396,7 @@ caja_side_pane_dispose (GObject *object)
side_pane->details->menu = NULL;
}

EEL_CALL_PARENT (G_OBJECT_CLASS, dispose, (object));
G_OBJECT_CLASS (caja_side_pane_parent_class)->dispose (object);
}

static void
@@ -419,7 +414,7 @@ caja_side_pane_finalize (GObject *object)

g_list_free (side_pane->details->panels);

EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
G_OBJECT_CLASS (caja_side_pane_parent_class)->finalize (object);
}

CajaSidePane *
@@ -26,9 +26,7 @@

#include <gtk/gtk.h>

#ifdef __cplusplus
extern "C" {
#endif
G_BEGIN_DECLS

#define CAJA_TYPE_SIDE_PANE caja_side_pane_get_type()
#define CAJA_SIDE_PANE(obj) \
@@ -42,12 +40,12 @@ extern "C" {
#define CAJA_SIDE_PANE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), CAJA_TYPE_SIDE_PANE, CajaSidePaneClass))

typedef struct _CajaSidePaneDetails CajaSidePaneDetails;
typedef struct _CajaSidePanePrivate CajaSidePanePrivate;

typedef struct
{
GtkBox parent;
CajaSidePaneDetails *details;
CajaSidePanePrivate *details;
} CajaSidePane;

typedef struct
@@ -75,8 +73,6 @@ extern "C" {
GtkWidget *caja_side_pane_get_current_panel (CajaSidePane *side_pane);
GtkWidget *caja_side_pane_get_title (CajaSidePane *side_pane);

#ifdef __cplusplus
}
#endif
G_END_DECLS

#endif /* CAJA_SIDE_PANE_H */
@@ -69,7 +69,7 @@
#define SPATIAL_ACTION_CLOSE_ALL_FOLDERS "Close All Folders"
#define MENU_PATH_SPATIAL_BOOKMARKS_PLACEHOLDER "/MenuBar/Other Menus/Places/Bookmarks Placeholder"

struct _CajaSpatialWindowDetails
struct _CajaSpatialWindowPrivate
{
GtkActionGroup *spatial_action_group; /* owned by ui_manager */
char *last_geometry;
@@ -88,8 +88,7 @@ static const GtkTargetEntry location_button_drag_types[] =
{ CAJA_ICON_DND_URI_LIST_TYPE, 0, CAJA_ICON_DND_URI_LIST },
};

G_DEFINE_TYPE(CajaSpatialWindow, caja_spatial_window, CAJA_TYPE_WINDOW)
#define parent_class caja_spatial_window_parent_class
G_DEFINE_TYPE_WITH_PRIVATE (CajaSpatialWindow, caja_spatial_window, CAJA_TYPE_WINDOW)

static void caja_spatial_window_save_geometry (CajaSpatialWindow *window,
CajaFile *viewed_file);
@@ -987,9 +986,7 @@ caja_spatial_window_init (CajaSpatialWindow *window)
CajaWindow *win;
CajaWindowPane *pane;

window->details = G_TYPE_INSTANCE_GET_PRIVATE (window,
CAJA_TYPE_SPATIAL_WINDOW,
CajaSpatialWindowDetails);
window->details = caja_spatial_window_get_instance_private (window);

win = CAJA_WINDOW (window);

@@ -1124,6 +1121,4 @@ caja_spatial_window_class_init (CajaSpatialWindowClass *klass)
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Up, GDK_SHIFT_MASK | GDK_MOD1_MASK,
"go_up", 1,
G_TYPE_BOOLEAN, TRUE);

g_type_class_add_private (klass, sizeof(CajaSpatialWindowDetails));
}
@@ -47,13 +47,13 @@
typedef struct _CajaSpatialWindow CajaSpatialWindow;
#endif
typedef struct _CajaSpatialWindowClass CajaSpatialWindowClass;
typedef struct _CajaSpatialWindowDetails CajaSpatialWindowDetails;
typedef struct _CajaSpatialWindowPrivate CajaSpatialWindowPrivate;

struct _CajaSpatialWindow
{
CajaWindow parent_object;

CajaSpatialWindowDetails *details;
CajaSpatialWindowPrivate *details;
};

struct _CajaSpatialWindowClass
@@ -33,20 +33,18 @@
#include <eel/eel-gtk-extensions.h>
#include <libcaja-private/caja-view-factory.h>

G_DEFINE_TYPE (CajaViewAsAction, caja_view_as_action, GTK_TYPE_ACTION)

static void caja_view_as_action_init (CajaViewAsAction *action);
static void caja_view_as_action_class_init (CajaViewAsActionClass *class);

static GObjectClass *parent_class = NULL;

#define CAJA_VIEW_AS_ACTION_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), CAJA_TYPE_VIEW_AS_ACTION, CajaViewAsActionPrivate))

struct CajaViewAsActionPrivate
struct _CajaViewAsActionPrivate
{
CajaNavigationWindow *window;
};

G_DEFINE_TYPE_WITH_PRIVATE (CajaViewAsAction, caja_view_as_action, GTK_TYPE_ACTION)

enum
{
PROP_0,
@@ -276,12 +274,10 @@ caja_view_as_action_class_init (CajaViewAsActionClass *class)
"The navigation window",
G_TYPE_OBJECT,
G_PARAM_READWRITE));

g_type_class_add_private (object_class, sizeof(CajaViewAsActionPrivate));
}

static void
caja_view_as_action_init (CajaViewAsAction *action)
{
action->priv = CAJA_VIEW_AS_ACTION_GET_PRIVATE (action);
action->priv = caja_view_as_action_get_instance_private (action);
}
@@ -37,7 +37,7 @@

typedef struct _CajaViewAsAction CajaViewAsAction;
typedef struct _CajaViewAsActionClass CajaViewAsActionClass;
typedef struct CajaViewAsActionPrivate CajaViewAsActionPrivate;
typedef struct _CajaViewAsActionPrivate CajaViewAsActionPrivate;

struct _CajaViewAsAction
{
@@ -32,9 +32,7 @@
#include <libcaja-private/caja-autorun.h>
#include <libcaja-private/caja-icon-info.h>

#define CAJA_X_CONTENT_BAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CAJA_TYPE_X_CONTENT_BAR, CajaXContentBarPrivate))

struct CajaXContentBarPrivate
struct _CajaXContentBarPrivate
{
GtkWidget *label;
GtkWidget *button;
@@ -50,7 +48,7 @@ enum
PROP_X_CONTENT_TYPE,
};

G_DEFINE_TYPE (CajaXContentBar, caja_x_content_bar, GTK_TYPE_BOX)
G_DEFINE_TYPE_WITH_PRIVATE (CajaXContentBar, caja_x_content_bar, GTK_TYPE_BOX)

void
caja_x_content_bar_set_x_content_type (CajaXContentBar *bar, const char *x_content_type)
@@ -256,8 +254,6 @@ caja_x_content_bar_class_init (CajaXContentBarClass *klass)
object_class->set_property = caja_x_content_bar_set_property;
object_class->finalize = caja_x_content_bar_finalize;

g_type_class_add_private (klass, sizeof (CajaXContentBarPrivate));

g_object_class_install_property (object_class,
PROP_MOUNT,
g_param_spec_object (
@@ -299,7 +295,7 @@ caja_x_content_bar_init (CajaXContentBar *bar)
{
GtkWidget *hbox;

bar->priv = CAJA_X_CONTENT_BAR_GET_PRIVATE (bar);
bar->priv = caja_x_content_bar_get_instance_private (bar);

hbox = GTK_WIDGET (bar);

@@ -28,9 +28,7 @@
#include <gtk/gtk.h>
#include <gio/gio.h>

#ifdef __cplusplus
extern "C" {
#endif
G_BEGIN_DECLS

#define CAJA_TYPE_X_CONTENT_BAR (caja_x_content_bar_get_type ())
#define CAJA_X_CONTENT_BAR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CAJA_TYPE_X_CONTENT_BAR, CajaXContentBar))
@@ -39,7 +37,7 @@ extern "C" {
#define CAJA_IS_X_CONTENT_BAR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CAJA_TYPE_X_CONTENT_BAR))
#define CAJA_X_CONTENT_BAR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CAJA_TYPE_X_CONTENT_BAR, CajaXContentBarClass))

typedef struct CajaXContentBarPrivate CajaXContentBarPrivate;
typedef struct _CajaXContentBarPrivate CajaXContentBarPrivate;

typedef struct
{
@@ -64,8 +62,6 @@ extern "C" {
GMount *mount);
GMount *caja_x_content_bar_get_mount (CajaXContentBar *bar);

#ifdef __cplusplus
}
#endif
G_END_DECLS

#endif /* __CAJA_X_CONTENT_BAR_H */

0 comments on commit e99050a

Please sign in to comment.
You can’t perform that action at this time.