예제 #1
0
static void
mpd_panel_init (MpdPanel *self)
{
  mpl_panel_client_set_size_request (MPL_PANEL_CLIENT (self),
                                     MPD_SHELL_WIDTH,
                                     MPD_SHELL_HEIGHT);
}
예제 #2
0
static void
panel_request_focus (MoblinPanel *panel, gpointer user_data)
{
	MplPanelClient *client = MPL_PANEL_CLIENT (user_data);

	mpl_panel_client_request_focus (client);
}
예제 #3
0
static void
mpl_panel_clutter_actor_allocation_notify_cb (GObject    *gobject,
                                              GParamSpec *pspec,
                                              gpointer    data)
{
  ClutterActor   *actor = CLUTTER_ACTOR (gobject);
  MplPanelClient *panel = MPL_PANEL_CLIENT (data);
  gint            width, height;

  width = (gint) clutter_actor_get_width (actor);
  height = (gint) clutter_actor_get_height (actor);

  mpl_panel_client_set_size_request (panel, width, height);
}
예제 #4
0
static void
bluetooth_status_changed (MoblinPanel *panel, gboolean connecting, gpointer user_data)
{
	MplPanelClient *client = MPL_PANEL_CLIENT (user_data);
	gchar *style = NULL;

	if (connecting) {
		style = g_strdup ("state-connecting");
	} else {
		style = g_strdup ("state-idle");
	}

	mpl_panel_client_request_button_style (client, style);
	g_free (style);
}
예제 #5
0
/**
 * mpl_panel_clutter_setup_events_with_gtk:
 * @panel: #MplPanelClutter
 *
 * Sets up X event handling in panels that use both Clutter and Gtk; for such
 * panel the library needs to be initialized with
 * mpl_panel_clutter_init_with_gtk().
 */
void
mpl_panel_clutter_setup_events_with_gtk (MplPanelClutter *panel)
{
  MplPanelClutterPrivate *priv = MPL_PANEL_CLUTTER (panel)->priv;
  Window xid;

  xid = mpl_panel_client_get_xid (MPL_PANEL_CLIENT (panel));

  if (xid == None)
    {
      priv->needs_gdk_pump = TRUE;
      return;
    }

  mpl_panel_clutter_setup_events_with_gtk_for_xid (xid);

  mpl_panel_clutter_load_base_style ();
}
예제 #6
0
/**
 * mpl_panel_clutter_track_actor_height:
 * @panel: #MplPanelClutter
 * @actor: #ClutterActor
 *
 * Sets up the panel for dynamically matching its height to that of the
 * supplied actor (e.g., the top-level panel widget).
 *
 * Passing NULL for actor on a subsequent call we terminated the height
 * tracking.
 */
void
mpl_panel_clutter_track_actor_height (MplPanelClutter *panel,
                                      ClutterActor    *actor)
{
  MplPanelClutterPrivate *priv = panel->priv;

  if (priv->tracked_actor && priv->height_notify_cb)
    {
      g_signal_handler_disconnect (priv->tracked_actor,
                                   priv->height_notify_cb);

      priv->height_notify_cb = 0;
      priv->tracked_actor = NULL;
    }

  if (actor)
    {
      gint width, height;

      /*
       * Match the current height of the actor
       */
      width = (gint) clutter_actor_get_width (actor);
      height = (gint) clutter_actor_get_height (actor);
      mpl_panel_client_set_size_request (MPL_PANEL_CLIENT (panel), width, height);

      /*
       * Now watch for changes in height.
       */
      priv->tracked_actor = actor;

      priv->height_notify_cb =
        g_signal_connect (actor, "notify::allocation",
                          G_CALLBACK (mpl_panel_clutter_actor_allocation_notify_cb),
                          panel);
    }
}