From 5630cf31f1a352dd263f6c55b5f054121a3da862 Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Wed, 14 Aug 2019 17:09:46 +0000 Subject: [PATCH] section: Remove row --- eek/eek-section.c | 75 ----------------------------------------- eek/eek-section.h | 9 ----- tests/eek-simple-test.c | 1 - 3 files changed, 85 deletions(-) diff --git a/eek/eek-section.c b/eek/eek-section.c index fe430fcf..3671ce47 100644 --- a/eek/eek-section.c +++ b/eek/eek-section.c @@ -42,55 +42,20 @@ enum { PROP_LAST }; -struct _EekRow -{ - gint num_columns; - EekOrientation orientation; -}; - -typedef struct _EekRow EekRow; - typedef struct _EekSectionPrivate { gint angle; - EekRow row; EekModifierType modifiers; } EekSectionPrivate; G_DEFINE_TYPE_WITH_PRIVATE (EekSection, eek_section, EEK_TYPE_CONTAINER) -static gint -eek_section_real_get_n_rows (EekSection *self) -{ -return 1; -} - -static void -eek_section_real_add_row (EekSection *self, - gint num_columns, - EekOrientation orientation) -{ - EekSectionPrivate *priv = (EekSectionPrivate*)eek_section_get_instance_private (self); - priv->row.num_columns = num_columns; - priv->row.orientation = orientation; -/* - row = g_slice_new (EekRow); - row->num_columns = num_columns; - row->orientation = orientation; - priv->rows = g_slist_append (priv->rows, row);*/ -} - static EekKey * eek_section_real_create_key (EekSection *self, const gchar *name, gint keycode, guint oref) { - EekSectionPrivate *priv = (EekSectionPrivate*)eek_section_get_instance_private (self); - - EekRow *row = &priv->row; - row->num_columns++; - EekKey *key = (EekKey*)g_object_new (EEK_TYPE_KEY, "name", name, NULL); @@ -107,11 +72,6 @@ eek_section_real_create_key (EekSection *self, EekKey *eek_section_create_button(EekSection *self, const gchar *name, struct squeek_key *state) { - EekSectionPrivate *priv = (EekSectionPrivate*)eek_section_get_instance_private (self); - - EekRow *row = &priv->row; - row->num_columns++; - EekKey *key = (EekKey*)g_object_new (EEK_TYPE_KEY, "name", name, NULL); @@ -185,8 +145,6 @@ eek_section_class_init (EekSectionClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *pspec; - klass->get_n_rows = eek_section_real_get_n_rows; - klass->add_row = eek_section_real_add_row; klass->create_key = eek_section_real_create_key; /* signals */ @@ -255,39 +213,6 @@ eek_section_get_angle (EekSection *section) return priv->angle; } -/** - * eek_section_get_n_rows: - * @section: an #EekSection - * - * Get the number of rows in @section. - */ -gint -eek_section_get_n_rows (EekSection *section) -{ - g_return_val_if_fail (EEK_IS_SECTION(section), -1); - return EEK_SECTION_GET_CLASS(section)->get_n_rows (section); -} - -/** - * eek_section_add_row: - * @section: an #EekSection - * @num_columns: the number of column in the row - * @orientation: #EekOrientation of the row - * - * Add a row which has @num_columns columns and whose orientation is - * @orientation to @section. - */ -void -eek_section_add_row (EekSection *section, - gint num_columns, - EekOrientation orientation) -{ - g_return_if_fail (EEK_IS_SECTION(section)); - EEK_SECTION_GET_CLASS(section)->add_row (section, - num_columns, - orientation); -} - /** * eek_section_create_key: * @section: an #EekSection diff --git a/eek/eek-section.h b/eek/eek-section.h index fd6ca543..f5ccd07f 100644 --- a/eek/eek-section.h +++ b/eek/eek-section.h @@ -54,11 +54,6 @@ struct _EekSectionClass EekContainerClass parent_class; /*< public >*/ - gint (* get_n_rows) (EekSection *self); - void (* add_row) (EekSection *self, - gint num_columns, - EekOrientation orientation); - EekKey *(* create_key) (EekSection *self, const gchar *name, gint keycode, @@ -75,10 +70,6 @@ void eek_section_set_angle (EekSection *section, gint angle); gint eek_section_get_angle (EekSection *section); -gint eek_section_get_n_rows (EekSection *section); -void eek_section_add_row (EekSection *section, - gint num_columns, - EekOrientation orientation); EekKey *eek_section_create_key (EekSection *section, const gchar *name, guint keycode, guint oref); diff --git a/tests/eek-simple-test.c b/tests/eek-simple-test.c index 3fa4ff32..45fdbe51 100644 --- a/tests/eek-simple-test.c +++ b/tests/eek-simple-test.c @@ -31,7 +31,6 @@ test_create (void) keyboard = g_object_new (EEK_TYPE_KEYBOARD, NULL); section = eek_keyboard_real_create_section (keyboard); g_assert (EEK_IS_SECTION(section)); - eek_section_add_row (section, 2, EEK_ORIENTATION_HORIZONTAL); key0 = eek_section_create_key (section, "key0", 1, 0); g_assert (EEK_IS_KEY(key0)); key1 = eek_section_create_key (section, "key1", 2, 0);