/**
 * add_workspaces:
 * @i3_workspaces: the workspaces plugin
 *
 * Add the workspaces.
 */
static void
add_workspaces(i3WorkspacesPlugin *i3_workspaces)
{
    GSList *wlist = i3wm_get_workspaces(i3_workspaces->i3wm);

    GSList *witem;
    for (witem = wlist; witem != NULL; witem = witem->next)
    {
        i3workspace *workspace = (i3workspace *) witem->data;
        if (workspace)
        {
            GtkWidget * button;
            button = xfce_panel_create_button();
            gtk_button_set_label(GTK_BUTTON(button), workspace->name);

            set_button_label(button, workspace, i3_workspaces->config);

            g_signal_connect(G_OBJECT(button), "clicked",
                    G_CALLBACK(on_workspace_clicked), i3_workspaces);

            /* avoid acceleration key interference */
            gtk_button_set_use_underline(GTK_BUTTON(button), FALSE);
            gtk_box_pack_end(GTK_BOX(i3_workspaces->hvbox), button, FALSE, FALSE, 0);
            gtk_widget_show(button);

            g_hash_table_insert(i3_workspaces->workspace_buttons, workspace, button);
        }
    }
}
/**
 * on_workspace_changed:
 * @workspace: the workspace
 * @data: the workspaces plugin
 *
 * Workspace changed event handler.
 */
static void
on_workspace_changed(i3workspace *workspace, gpointer data)
{
    i3WorkspacesPlugin *i3_workspaces = (i3WorkspacesPlugin *) data;

    GtkWidget *button = (GtkWidget *) g_hash_table_lookup(i3_workspaces->workspace_buttons, workspace);
    set_button_label(button, workspace, i3_workspaces->config);
}
Example #3
0
void update_region_browser(bool grf_too)
{
  int i, len;
  region_state *rs;
  rs = region_report();
  len = rs->len;
  for (i = 0; i < len; i++) 
    {
      regrow *r;
      r = region_row(i);
      set_button_label(r->nm, rs->name[i]);
      set_toggle_button(r->pl, false, false, (void *)r);
      gtk_widget_show(r->rw);
    }
  for (i = len; i < max_regions(ss); i++) 
    if (region_rows[i])
      gtk_widget_hide(region_rows[i]->rw);
  free_region_state(rs);
  if (len == 0) return;
  gtk_widget_show(region_list);
  if (grf_too)
    {
      chan_info *cp;
      unhighlight_region();
      set_current_region(0);
      highlight_region();
      goto_window(region_rows[0]->nm);
      cp = rsp->chans[0];
      if (cp) 
	{
	  cp->sound = rsp;
	  cp->chan = 0;
	  set_sensitive(channel_f(cp), false);
	  set_sensitive(channel_w(cp), (region_chans(region_list_position_to_id(0)) > 1));
	  rsp->hdr = fixup_region_data(cp, 0, 0);
	  make_region_labels(rsp->hdr);
	  region_update_graph(cp);
	}
    }
}
Example #4
0
/* Pause/Resume playback. */
void pause_resume(GtkWidget *widget){
	if(paused){ uFMOD_Resume(); set_button_label(widget, "Pause");  }
	else{       uFMOD_Pause();  set_button_label(widget, "Resume"); }
	paused ^= 1;
}