guint32 time);
static gboolean
+hildon_window_toggle_menu_real (HildonWindow * self,
+ guint button,
+ guint32 time);
+
+static gboolean
hildon_window_escape_timeout (gpointer data);
static GdkFilterReturn
GdkEventExpose * event,
gboolean fullscreen);
+static void
+hildon_window_unset_program_real (HildonWindow *self);
+
enum
{
PROP_0,
/* To the container */
container_class->forall = hildon_window_forall;
+ /* To this class */
+ window_class->unset_program = hildon_window_unset_program_real;
+ window_class->toggle_menu = hildon_window_toggle_menu_real;
+
/* gtkobject stuff*/
GTK_OBJECT_CLASS (window_class)->destroy = hildon_window_destroy;
gtk_widget_style_get (GTK_WIDGET (menu), "horizontal-offset", x,
"vertical-offset", y, NULL);
- *x += window_x;
+ if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+ {
+ *x = GTK_WIDGET (widget)->allocation.width + window_x - GTK_WIDGET (menu)->allocation.width - *x;
+ }
+ else
+ *x += window_x;
+
*y += window_y;
}
gtk_widget_style_get (GTK_WIDGET (menu), "horizontal-offset", x,
"vertical-offset", y, NULL);
- *x = MAX (0, *x);
+ if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+ *x = GTK_WIDGET (widget)->allocation.width - GTK_WIDGET (menu)->allocation.width - *x;
+ else
+ *x = MAX (0, *x);
+
*y = MAX (0, *y);
}
/*
* Unsets the program to which the window belongs. This should only be called
- * by hildon_program_add_window
+ * by hildon_program_remove_window
*/
-void G_GNUC_INTERNAL
-hildon_window_unset_program (HildonWindow *self)
+static void
+hildon_window_unset_program_real (HildonWindow *self)
{
HildonWindowPrivate *priv = HILDON_WINDOW_GET_PRIVATE (self);
priv->program = NULL;
}
+void G_GNUC_INTERNAL
+hildon_window_unset_program (HildonWindow *self)
+{
+ g_return_if_fail (HILDON_IS_WINDOW (self));
+
+ if (HILDON_WINDOW_GET_CLASS (self)->unset_program != NULL)
+ HILDON_WINDOW_GET_CLASS (self)->unset_program (self);
+}
+
/*
* Sets whether or not the program to which this window belongs is
* killable. This is used by the HildonProgram to signify to the
/* FIXME Why is this even needed here? */
}
+static gboolean
+hildon_window_toggle_menu (HildonWindow *self,
+ guint button,
+ guint32 time)
+{
+ g_return_val_if_fail (HILDON_IS_WINDOW (self), FALSE);
+
+ if (HILDON_WINDOW_GET_CLASS (self)->toggle_menu != NULL)
+ {
+ return HILDON_WINDOW_GET_CLASS (self)->toggle_menu (self, button, time);
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
+
/*
* Toggles the display of the HildonWindow menu.
* Returns whether or not something was done (whether or not we had a menu
* to toggle)
*/
static gboolean
-hildon_window_toggle_menu (HildonWindow * self,
+hildon_window_toggle_menu_real (HildonWindow * self,
guint button,
guint32 time)
{