libeek: abolish arguments for eek_clutter_keyboard_new() and eek_xkb_layout_new()
This commit is contained in:
		@ -49,9 +49,8 @@ eek_clutter_key_real_set_name (EekElement *self,
 | 
			
		||||
    EEK_ELEMENT_CLASS (eek_clutter_key_parent_class)->
 | 
			
		||||
        set_name (self, name);
 | 
			
		||||
 | 
			
		||||
    g_return_if_fail (priv->actor);
 | 
			
		||||
 | 
			
		||||
    clutter_actor_set_name (CLUTTER_ACTOR(priv->actor), name);
 | 
			
		||||
    if (priv->actor)
 | 
			
		||||
        clutter_actor_set_name (CLUTTER_ACTOR(priv->actor), name);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@ -63,10 +62,10 @@ eek_clutter_key_real_set_bounds (EekElement *self,
 | 
			
		||||
    EEK_ELEMENT_CLASS (eek_clutter_key_parent_class)->
 | 
			
		||||
        set_bounds (self, bounds);
 | 
			
		||||
 | 
			
		||||
    g_return_if_fail (priv->actor);
 | 
			
		||||
 | 
			
		||||
    clutter_actor_set_position (priv->actor, bounds->x, bounds->y);
 | 
			
		||||
    clutter_actor_set_size (priv->actor, bounds->width, bounds->height);
 | 
			
		||||
    if (priv->actor) {
 | 
			
		||||
        clutter_actor_set_position (priv->actor, bounds->x, bounds->y);
 | 
			
		||||
        clutter_actor_set_size (priv->actor, bounds->width, bounds->height);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
 | 
			
		||||
@ -57,9 +57,8 @@ eek_clutter_keyboard_real_set_name (EekElement *self,
 | 
			
		||||
    EEK_ELEMENT_CLASS (eek_clutter_keyboard_parent_class)->
 | 
			
		||||
        set_name (self, name);
 | 
			
		||||
 | 
			
		||||
    g_return_if_fail (priv->actor);
 | 
			
		||||
 | 
			
		||||
    clutter_actor_set_name (priv->actor, name);
 | 
			
		||||
    if (priv->actor)
 | 
			
		||||
        clutter_actor_set_name (priv->actor, name);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@ -71,10 +70,10 @@ eek_clutter_keyboard_real_set_bounds (EekElement *self,
 | 
			
		||||
    EEK_ELEMENT_CLASS (eek_clutter_keyboard_parent_class)->
 | 
			
		||||
        set_bounds (self, bounds);
 | 
			
		||||
 | 
			
		||||
    g_return_if_fail (priv->actor);
 | 
			
		||||
 | 
			
		||||
    clutter_actor_set_position (priv->actor, bounds->x, bounds->y);
 | 
			
		||||
    clutter_actor_set_size (priv->actor, bounds->width, bounds->height);
 | 
			
		||||
    if (priv->actor) {
 | 
			
		||||
        clutter_actor_set_position (priv->actor, bounds->x, bounds->y);
 | 
			
		||||
        clutter_actor_set_size (priv->actor, bounds->width, bounds->height);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@ -176,29 +175,13 @@ eek_clutter_keyboard_init (EekClutterKeyboard *self)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * eek_clutter_keyboard_new:
 | 
			
		||||
 * @width: max width of the area where the keyboard to be drawn
 | 
			
		||||
 * @height: max height of the area where the keyboard to be drawn
 | 
			
		||||
 *
 | 
			
		||||
 * Create a new #EekClutterKeyboard.
 | 
			
		||||
 */
 | 
			
		||||
EekKeyboard*
 | 
			
		||||
eek_clutter_keyboard_new (gfloat width,
 | 
			
		||||
                          gfloat height)
 | 
			
		||||
eek_clutter_keyboard_new (void)
 | 
			
		||||
{
 | 
			
		||||
    EekKeyboard *keyboard;
 | 
			
		||||
    EekBounds bounds;
 | 
			
		||||
 | 
			
		||||
    keyboard = g_object_new (EEK_TYPE_CLUTTER_KEYBOARD, NULL);
 | 
			
		||||
    g_return_val_if_fail (keyboard, NULL);
 | 
			
		||||
 | 
			
		||||
    /* Can't call set_bounds of this class since it needs priv->actor
 | 
			
		||||
       initialized */
 | 
			
		||||
    memset (&bounds, 0, sizeof bounds);
 | 
			
		||||
    bounds.width = width;
 | 
			
		||||
    bounds.height = height;
 | 
			
		||||
    EEK_ELEMENT_CLASS (eek_clutter_keyboard_parent_class)->
 | 
			
		||||
        set_bounds (EEK_ELEMENT(keyboard), &bounds);
 | 
			
		||||
    return keyboard;
 | 
			
		||||
    return g_object_new (EEK_TYPE_CLUTTER_KEYBOARD, NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
 | 
			
		||||
@ -50,8 +50,7 @@ struct _EekClutterKeyboardClass
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
GType         eek_clutter_keyboard_get_type  (void) G_GNUC_CONST;
 | 
			
		||||
EekKeyboard  *eek_clutter_keyboard_new       (gfloat width,
 | 
			
		||||
                                              gfloat height);
 | 
			
		||||
EekKeyboard  *eek_clutter_keyboard_new       (void);
 | 
			
		||||
ClutterActor *eek_clutter_keyboard_get_actor (EekClutterKeyboard *keyboard);
 | 
			
		||||
 | 
			
		||||
G_END_DECLS
 | 
			
		||||
 | 
			
		||||
@ -48,9 +48,8 @@ eek_clutter_section_real_set_name (EekElement  *self,
 | 
			
		||||
    EEK_ELEMENT_CLASS (eek_clutter_section_parent_class)->
 | 
			
		||||
        set_name (self, name);
 | 
			
		||||
 | 
			
		||||
    g_return_if_fail (priv->actor);
 | 
			
		||||
 | 
			
		||||
    clutter_actor_set_name (priv->actor, name);
 | 
			
		||||
    if (priv->actor)
 | 
			
		||||
        clutter_actor_set_name (priv->actor, name);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@ -62,10 +61,10 @@ eek_clutter_section_real_set_bounds (EekElement *self,
 | 
			
		||||
    EEK_ELEMENT_CLASS (eek_clutter_section_parent_class)->
 | 
			
		||||
        set_bounds (self, bounds);
 | 
			
		||||
 | 
			
		||||
    g_return_if_fail (priv->actor);
 | 
			
		||||
 | 
			
		||||
    clutter_actor_set_position (priv->actor, bounds->x, bounds->y);
 | 
			
		||||
    clutter_actor_set_size (priv->actor, bounds->width, bounds->height);
 | 
			
		||||
    if (priv->actor) {
 | 
			
		||||
        clutter_actor_set_position (priv->actor, bounds->x, bounds->y);
 | 
			
		||||
        clutter_actor_set_size (priv->actor, bounds->width, bounds->height);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
 | 
			
		||||
@ -544,32 +544,19 @@ get_names (EekXkbLayout *layout)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * eek_xkb_layout_new:
 | 
			
		||||
 * @keycodes: component name for keycodes
 | 
			
		||||
 * @geometry: component name for geometry
 | 
			
		||||
 * @symbols: component name for symbols
 | 
			
		||||
 *
 | 
			
		||||
 * Create a new #EekXkbLayout.
 | 
			
		||||
 */
 | 
			
		||||
EekLayout *
 | 
			
		||||
eek_xkb_layout_new (const gchar *keycodes,
 | 
			
		||||
                    const gchar *geometry,
 | 
			
		||||
                    const gchar *symbols)
 | 
			
		||||
eek_xkb_layout_new (void)
 | 
			
		||||
{
 | 
			
		||||
    EekXkbLayout *layout;
 | 
			
		||||
    EekXkbLayoutPrivate *priv;
 | 
			
		||||
 | 
			
		||||
    layout = g_object_new (EEK_TYPE_XKB_LAYOUT, NULL);
 | 
			
		||||
    g_return_val_if_fail (layout, NULL);
 | 
			
		||||
    priv = layout->priv;
 | 
			
		||||
    if (keycodes)
 | 
			
		||||
        priv->names.keycodes = g_strdup (keycodes);
 | 
			
		||||
    if (geometry)
 | 
			
		||||
        priv->names.geometry = g_strdup (geometry);
 | 
			
		||||
    if (symbols)
 | 
			
		||||
        priv->names.symbols = g_strdup (symbols);
 | 
			
		||||
 | 
			
		||||
    get_keyboard (layout);
 | 
			
		||||
    if (priv->xkb == NULL) {
 | 
			
		||||
    if (layout->priv->xkb == NULL) {
 | 
			
		||||
        g_object_unref (layout);
 | 
			
		||||
        return NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -52,11 +52,7 @@ struct _EekXkbLayoutClass
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
GType                 eek_xkb_layout_get_type  (void) G_GNUC_CONST;
 | 
			
		||||
 | 
			
		||||
EekLayout            *eek_xkb_layout_new       (const gchar          *keycodes,
 | 
			
		||||
                                                const gchar          *geometry,
 | 
			
		||||
                                                const gchar          *symbols);
 | 
			
		||||
 | 
			
		||||
EekLayout            *eek_xkb_layout_new       (void);
 | 
			
		||||
 | 
			
		||||
gboolean              eek_xkb_layout_set_names (EekXkbLayout         *layout,
 | 
			
		||||
                                                XkbComponentNamesRec *names);
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user