当前位置: 首页>>代码示例>>C++>>正文


C++ create_pixbuf函数代码示例

本文整理汇总了C++中create_pixbuf函数的典型用法代码示例。如果您正苦于以下问题:C++ create_pixbuf函数的具体用法?C++ create_pixbuf怎么用?C++ create_pixbuf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了create_pixbuf函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: icon_init

/**
 * For details of what is expected from an icon window and what it
 * should expect.
 *
 * See --
 *    http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.9
 */
G_GNUC_COLD void
icon_init(void)
{
    create_icon();

	gtk_widget_realize(icon);

    /*
     * For some reason, when a window is the icon for another
     * window, none of its subwindows get mapped.  This is not
     * because of GTK, but seems to be either the window manager
     * or X itself that does this.
     *
     * Also note the canvas widget is never unmapped, regardless
     * of whether the icon window is visible or not.
     */
    gtk_widget_map(canvas);
	/* FIXME: This causes a crash with twm when iconizing the main window. */
#if 0
    gdk_window_set_icon(gui_main_window()->window, icon->window, NULL, NULL);
#endif
    icon_just_mapped_fg = icon_visible_fg = icon_close_fg = FALSE;

    /*   load images   */
    con_pixbuf = create_pixbuf("smallserver.xpm");
    up_pixbuf = create_pixbuf("upload.xpm");
    down_pixbuf = create_pixbuf("download.xpm");

	status_icon_init();

	main_gui_add_timer(icon_timer);
}
开发者ID:qgewfg,项目名称:gtk-gnutella,代码行数:39,代码来源:icon.c

示例2: _linphone_status_icon_impl_gtk_init

static void _linphone_status_icon_impl_gtk_init(LinphoneStatusIcon *si) {
    const char *icon_path=linphone_gtk_get_ui_config("icon",LINPHONE_ICON);
    const char *call_icon_path=linphone_gtk_get_ui_config("start_call_icon","call_start.png");
    GdkPixbuf *pbuf=create_pixbuf(icon_path);
    GtkStatusIcon *icon=gtk_status_icon_new_from_pixbuf(pbuf);
    g_signal_connect_swapped(G_OBJECT(icon),"activate", G_CALLBACK(_linphone_status_icon_impl_gtk_on_click_cb), si);
    g_signal_connect(G_OBJECT(icon), "popup-menu", G_CALLBACK(_linphone_status_icon_impl_gtk_popup_menu), si);
    g_object_set_data_full(G_OBJECT(icon),"icon",pbuf, g_object_unref);
    pbuf=create_pixbuf(call_icon_path);
    g_object_set_data_full(G_OBJECT(icon),"call_icon",pbuf, g_object_unref);
    si->data = icon;
}
开发者ID:caizw,项目名称:linphone2,代码行数:12,代码来源:status_icon.c

示例3: display_screenshot_dbox

gint display_screenshot_dbox()
{
	GtkBuilder *builder;
	GError* error = NULL;
	GdkPixbuf *pixbuf;

	builder = gtk_builder_new();
	if (!gtk_builder_add_from_file (builder, tilp_paths_build_builder("screenshot.ui"), &error))
	{
		g_warning (_("Couldn't load builder file: %s\n"), error->message);
		g_error_free (error);
		return 0; // THIS RETURNS !
	}

	gtk_builder_connect_signals(builder, NULL);

	scrn_win = GTK_WIDGET (gtk_builder_get_object (builder, "screenshot_dbox"));
	scrn_img = GTK_WIDGET (gtk_builder_get_object (builder, "pixmap7"));

	pixbuf = create_pixbuf("screendump.png");
	gtk_image_set_from_pixbuf(GTK_IMAGE(scrn_img), pixbuf);
	g_object_unref(pixbuf);

	gtk_widget_show_all(scrn_win);

	return 0;
}
开发者ID:debrouxl,项目名称:strip_tilp_nspire,代码行数:27,代码来源:screenshot.c

示例4: on_about_clicked

void
on_about_clicked(GtkButton* button, gpointer user_data) {
  GtkWidget *about;
  const gchar *authors[] = {
    "Sergey Zorin <[email protected]>",
    NULL
  };
  
  /* TRANSLATORS: Replace this string with your names, one name per line. */
  gchar *translators = "Sergey Zorin <[email protected]>\n"
    "Mathias Weinert\n"
    "Hayashi Kentaro";
  GdkPixbuf *about_logo_pixbuf;

  about = gtk_about_dialog_new();
  gtk_widget_set_name(about, "about");
  gtk_window_set_destroy_with_parent(GTK_WINDOW(about), TRUE);
  gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about), VERSION);
  gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(about), _("diff-ext setup"));
  gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(about), _("(c) 2007 Sergey Zorin. All rights reserved."));
  gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(about), _("Copyright (c) 2007, Sergey Zorin\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n   1. Redistributions  of  source  code   must  retain  the  above\n      copyright notice,  this list of conditions and the following\n      disclaimer.\n   2. Redistributions in binary  form  must  reproduce  the  above\n      copyright notice,  this list of conditions and the following\n      disclaimer  in  the  documentation  and/or  other  materials\n      provided with the distribution.\n\nTHIS SOFTWARE  IS  PROVIDED  BY  THE  COPYRIGHT  HOLDERS  AND  CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED  WARRANTIES, INCLUDING,  BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE  ARE  DISCLAIMED.  IN  NO  EVENT  SHALL  THE  COPYRIGHT   OWNER  OR\nCONTRIBUTORS  BE  LIABLE  FOR  ANY DIRECT,  INDIRECT, INCIDENTAL,  SPECIAL,\nEXEMPLARY,  OR  CONSEQUENTIAL  DAMAGES  (INCLUDING,  BUT  NOT  LIMITED  TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\nOR BUSINESS INTERRUPTION)  HOWEVER CAUSED AND ON ANY THEORY  OF  LIABILITY,\nWHETHER IN CONTRACT,  STRICT LIABILITY,  OR  TORT  (INCLUDING NEGLIGENCE OR\nOTHERWISE) ARISING  IN  ANY WAY OUT OF THE USE  OF THIS  SOFTWARE,  EVEN IF\nADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"));
  gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(about), "http://diff-ext.sourceforge.net");
  gtk_about_dialog_set_website_label(GTK_ABOUT_DIALOG(about), _("diff-ext"));
  gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(about), authors);
  gtk_about_dialog_set_translator_credits(GTK_ABOUT_DIALOG(about), translators);
  about_logo_pixbuf = create_pixbuf("de.png");
  gtk_about_dialog_set_logo(GTK_ABOUT_DIALOG(about), about_logo_pixbuf);

  g_object_set_data(G_OBJECT(about), "about", about);
  
  gtk_widget_show(about); 
}
开发者ID:jmenashe,项目名称:diff-ext,代码行数:32,代码来源:callbacks.c

示例5: status_icon_enable

static void
status_icon_enable(void)
{
	GdkPixbuf *icon_pixbuf;

	if (status_icon)
		return;

	/*
	 * Due to lazy binding it's possible that runtime version is older
	 * than the compile-time version. This is the only code which requires
	 * Gtk+ >= 2.10 currently.
	 */
	if (!check_gtk_version(2,10,0))
		return;

	/*
	 * Create an status so that gtk-gnutella can be minimized to a
	 * so-called "system tray" if supported by the window manager.
	 */

	icon_pixbuf = create_pixbuf("icon.16x16.xpm");
	status_icon = gtk_status_icon_new_from_pixbuf(icon_pixbuf);

	gtk_status_icon_set_tooltip(status_icon,
		_("gtk-gnutella: Click to minimize/restore"));
	status_icon_set_visible(TRUE);
	gui_signal_connect(status_icon, "activate",
		on_status_icon_activate, NULL);
	gui_signal_connect(status_icon, "size-changed",
		on_status_icon_size_changed, NULL);
	gui_signal_connect(status_icon, "popup-menu",
		on_status_icon_popup_menu, NULL);
}
开发者ID:qgewfg,项目名称:gtk-gnutella,代码行数:34,代码来源:icon.c

示例6: main

int main (int argc, char *argv[]) {

  GtkWidget *window;

  // init the gtk library:
  gtk_init(&argc, &argv);

  // create a GtkWindow widget
  // NB toplevel windows have titlebar and border, and are managed by window manager
  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title(GTK_WINDOW(window), "Center");
  gtk_window_set_default_size(GTK_WINDOW(window), 230, 150);
  gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);

  // now set the icon
  gtk_window_set_icon(GTK_WINDOW(window), create_pixbuf("robot-icon.png"));

  // show the widget
  gtk_widget_show(window);


  // set window to react to destroy (close window)
  g_signal_connect_swapped(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), NULL);

  
  // enter the gtk main loop (program sits and waits for events)
  gtk_main();

  return 0;
}
开发者ID:nicksexton,项目名称:gui-tools,代码行数:30,代码来源:1_simplewindow_withicon.c

示例7: create_aboutdialog_gshpvoronoi

GtkWidget*
create_aboutdialog_gshpvoronoi (void)
{
  GtkWidget *aboutdialog_gshpvoronoi;
  const gchar *authors[] = {
    "Steffen Macke <[email protected]>",
    "Maher Abdel Karim <[email protected]>",
    NULL
  };
  /* TRANSLATORS: Replace this string with your names, one name per line. */
  gchar *translators = _("translator-credits");
  GdkPixbuf *aboutdialog_gshpvoronoi_logo_pixbuf;

  aboutdialog_gshpvoronoi = gtk_about_dialog_new ();
  gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (aboutdialog_gshpvoronoi), VERSION);
  gtk_about_dialog_set_name (GTK_ABOUT_DIALOG (aboutdialog_gshpvoronoi), _("gshpvoronoi"));
  gtk_about_dialog_set_copyright (GTK_ABOUT_DIALOG (aboutdialog_gshpvoronoi), _("Copyright (c) 2006 DC Water and Enviroment"));
  gtk_about_dialog_set_comments (GTK_ABOUT_DIALOG (aboutdialog_gshpvoronoi), _("Create Voronoi polygons from point shapfiles.\nGraphical frontend to qvoronoi."));
  gtk_about_dialog_set_license (GTK_ABOUT_DIALOG (aboutdialog_gshpvoronoi), _(" gshpvoronoi - Create Voronoi polygons from point shapefiles Graphical frontend to qvoronoi\n    Copyright (C) 2006  DC Water and Environment\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA"));
  gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (aboutdialog_gshpvoronoi), "http://dcwaterdesign.sourceforge.net");
  gtk_about_dialog_set_website_label (GTK_ABOUT_DIALOG (aboutdialog_gshpvoronoi), _("http://dcwaterdesign.sourceforge.net"));
  gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG (aboutdialog_gshpvoronoi), authors);
  gtk_about_dialog_set_translator_credits (GTK_ABOUT_DIALOG (aboutdialog_gshpvoronoi), translators);
  aboutdialog_gshpvoronoi_logo_pixbuf = create_pixbuf ("dc.png");
  gtk_about_dialog_set_logo (GTK_ABOUT_DIALOG (aboutdialog_gshpvoronoi), aboutdialog_gshpvoronoi_logo_pixbuf);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (aboutdialog_gshpvoronoi, aboutdialog_gshpvoronoi, "aboutdialog_gshpvoronoi");

  return aboutdialog_gshpvoronoi;
}
开发者ID:sdteffen,项目名称:dcwaterdesign,代码行数:31,代码来源:interface.c

示例8: main

int main (int argc, char * argv[])
{
	GtkWidget *tabla;
	GtkWidget *boton[BUTTON];
	char *buttonTitle[BUTTON] = {"Log out", "Suspend", "Reboot" ,"Power off", "Cancel"};
	int i;

	gtk_init (&argc, &argv);

	//Se configura la ventana
	ventana = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_window_set_resizable(GTK_WINDOW(ventana), FALSE);
	gtk_window_set_title(GTK_WINDOW(ventana), "Menú de apagado");
	gtk_window_set_position(GTK_WINDOW(ventana), GTK_WIN_POS_CENTER);
	gtk_window_set_icon(GTK_WINDOW(ventana), create_pixbuf("/home/gorka/shutdown.png"));
	gtk_widget_set_usize(ventana, 900, 75);

	//Crear una tabla para colocar los botones
	tabla = gtk_table_new(ROW, COL, TRUE);
	gtk_table_set_col_spacings(GTK_TABLE(tabla), 3);

	//Crear botones
	for(i = 0; i < BUTTON; i++)
	{
		boton[i] = gtk_button_new_with_label(buttonTitle[i]);
		gtk_table_attach_defaults(GTK_TABLE(tabla), boton[i], i, i+1, 0, 1);
	}


	//Asignar funciones a los botones
	g_signal_connect(G_OBJECT(boton[0]), "clicked", G_CALLBACK(logOut), NULL);
	g_signal_connect(G_OBJECT(boton[1]), "clicked", G_CALLBACK(suspend), NULL);
	g_signal_connect(G_OBJECT(boton[2]), "clicked", G_CALLBACK(reboot), NULL);
	g_signal_connect(G_OBJECT(boton[3]), "clicked", G_CALLBACK(powerOff), NULL);
	g_signal_connect(G_OBJECT(boton[4]), "clicked", G_CALLBACK(gtk_main_quit), NULL);

	gtk_container_add(GTK_CONTAINER(ventana), tabla);

	g_signal_connect_swapped(G_OBJECT(ventana), "destroy", G_CALLBACK(gtk_main_quit), NULL);
	gtk_widget_show_all(ventana);

	gtk_main();

	switch(opcion)
	{
		case 1:
			system("openbox --exit");
			break;
		case 2:
			system("dbus-send --system --print-reply --dest=\"org.freedesktop.UPower\" /org/freedesktop/UPower org.freedesktop.UPower.Suspend");
			break;
		case 3:
			system("dbus-send --system --print-reply --dest=\"org.freedesktop.ConsoleKit\" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart");
			break;
		case 4:
			system("dbus-send --system --print-reply --dest=\"org.freedesktop.ConsoleKit\" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop");
			break;
	}
	return 0;
}
开发者ID:ChaosPattern,项目名称:db-exit,代码行数:60,代码来源:db-exit.c

示例9: linphone_gtk_in_call_view_terminate

void linphone_gtk_in_call_view_terminate(LinphoneCall *call, const char *error_msg){
	GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
	GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
	GtkWidget *animation=linphone_gtk_get_widget(callview,"in_call_animation");
	GdkPixbuf *pbuf=create_pixbuf(linphone_gtk_get_ui_config("stop_call_icon","stopcall-red.png"));
	guint taskid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(callview),"taskid"));

	if (error_msg==NULL)
		gtk_label_set_markup(GTK_LABEL(status),_("<b>Call ended.</b>"));
	else{
		char *msg=g_markup_printf_escaped("<span color=\"red\"><b>%s</b></span>",error_msg);
		gtk_label_set_markup(GTK_LABEL(status),msg);
		g_free(msg);
	}
	if (pbuf!=NULL){
		gtk_image_set_from_pixbuf(GTK_IMAGE(animation),pbuf);
		g_object_unref(G_OBJECT(pbuf));
	}
	gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel"));
	linphone_gtk_enable_mute_button(
		GTK_BUTTON(linphone_gtk_get_widget(callview,"incall_mute")),FALSE);
	linphone_gtk_enable_hold_button(call,FALSE,TRUE);
	if (taskid!=0) g_source_remove(taskid);
	g_timeout_add_seconds(2,(GSourceFunc)in_call_view_terminated,call);
}
开发者ID:ApOgEE,项目名称:linphone-sdk,代码行数:25,代码来源:incall_view.c

示例10: splash_screen_start

/* Splash Screen Initialization Function */
void splash_screen_start(void)
{
    GtkWidget *image, *vbox, *ver_lbl;
    GdkColor color;
    GdkPixbuf *pixbuf;
    gchar *version_string;

    // Is Splash Screen started?
    if (splashscreen.enabled == 1)
        return;

    // Make the Splash Screen
     splashscreen.splash = gtk_window_new(GTK_WINDOW_TOPLEVEL);
     gtk_window_set_title(GTK_WINDOW(splashscreen.splash), "GFM Loading...");
     gtk_window_set_position(GTK_WINDOW(splashscreen.splash), GTK_WIN_POS_CENTER_ALWAYS);
     gtk_window_set_decorated(GTK_WINDOW(splashscreen.splash), FALSE);
     gtk_window_set_role(GTK_WINDOW(splashscreen.splash), "splash");
     gtk_window_set_resizable(GTK_WINDOW(splashscreen.splash), FALSE);
     gtk_window_set_default_size(GTK_WINDOW(splashscreen.splash), 150, 110); // 150x110 pixels

     // Set the Colors
     color.red = 65535;
     color.green = 65535;
     color.blue = 65535;
     gtk_widget_modify_bg(splashscreen.splash, GTK_STATE_NORMAL, &color);

     // Create a VBOX
     vbox = gtk_vbox_new(FALSE, 0);
     gtk_container_add(GTK_CONTAINER(splashscreen.splash), vbox);
     gtk_widget_show(vbox);

     // Set the Text Label
     splashscreen.text = gtk_label_new(_("Starting Group File Manager..."));
     gtk_box_pack_end(GTK_BOX(vbox), splashscreen.text, FALSE, FALSE, 0);
     gtk_widget_show(splashscreen.text);

     // Set the Version
     version_string = g_strconcat("Version ", GFM_VERSION, NULL);
     ver_lbl = gtk_label_new(version_string);
     gtk_box_pack_end(GTK_BOX(vbox), ver_lbl, FALSE, FALSE, 0);
     gtk_widget_show(ver_lbl);
     g_free(version_string);

     // Setup the Splash Logo
     pixbuf = create_pixbuf("gfm.xpm");
     image = gtk_image_new_from_pixbuf(pixbuf);
     gtk_box_pack_end(GTK_BOX(vbox), image, FALSE, FALSE, 0);
     g_object_unref(pixbuf);

     // Lets show the Splash Screen now
     gtk_widget_show(image);
     gtk_widget_show(splashscreen.splash);

     // Lets Make sure this works
     GTK_REFRESH(); // Defintion in support.h

     // Ok, done
     splashscreen.enabled = 1;
     return;
}
开发者ID:debrouxl,项目名称:tilp_and_gfm,代码行数:61,代码来源:splashscreen.c

示例11: sizeof

ADM_tray::ADM_tray(void* parent)
{
	_parent = parent;
	lastIcon = 0;
	int nb = sizeof(animated) / sizeof(char *);

	if (!pixbuf)
	{
		pixbuf = new GdkPixbuf*[nb];

		for (int i = 0; i < nb; i++)
		{
			pixbuf[i] = create_pixbuf(animated[i]);

			if (!pixbuf[i])
			{
				printf("Failed to create <%s>\n", animated[i]);
				ADM_assert(0);
			}
		}
	}

	sys = gtk_status_icon_new_from_pixbuf(pixbuf[0]);

	g_signal_connect(G_OBJECT(sys), "activate", G_CALLBACK(tray_icon_on_click), _parent);
	g_signal_connect(G_OBJECT(sys), "popup-menu", G_CALLBACK(tray_icon_popup_menu), _parent);
	gtk_status_icon_set_tooltip((GtkStatusIcon*)sys, "Avidemux");
	gtk_status_icon_set_visible((GtkStatusIcon*)sys, TRUE);
}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:29,代码来源:ADM_tray_gtk.cpp

示例12: launcher_create_icon

/*
 Creates GtkStatusIcon and tooltip
*/
void
launcher_create_icon (launcher_core_s *launcher_core, char *image, char *text)
{
	launcher_core->icon = (GtkWidget *) gtk_status_icon_new_from_pixbuf (create_pixbuf(image));
	gtk_status_icon_set_tooltip_text(GTK_STATUS_ICON(launcher_core->icon), text);
	gtk_widget_set_has_tooltip(launcher_core->window, TRUE);
}
开发者ID:andypc,项目名称:Launcher-Gadget,代码行数:10,代码来源:launcher_misc.c

示例13: main_playlist_init

void
main_playlist_init (GtkWidget *widget) {
    play16_pixbuf = create_pixbuf ("play_16.png");
    pause16_pixbuf = create_pixbuf ("pause_16.png");
    buffering16_pixbuf = create_pixbuf ("buffering_16.png");

    // make listview widget and bind it to data
    DdbListview *listview = DDB_LISTVIEW(widget);
    main_binding.ref = (void (*) (DdbListviewIter))deadbeef->pl_item_ref;
    main_binding.unref = (void (*) (DdbListviewIter))deadbeef->pl_item_unref;
    ddb_listview_set_binding (listview, &main_binding);
    lock_column_config = 1;
    DB_conf_item_t *col = deadbeef->conf_find ("playlist.column.", NULL);
    if (!col) {
        // create default set of columns
        add_column_helper (listview, "♫", 50, DB_COLUMN_PLAYING, NULL, 0);
        add_column_helper (listview, _("Artist / Album"), 150, -1, "%a - %b", 0);
        add_column_helper (listview, _("Track No"), 50, -1, "%n", 1);
        add_column_helper (listview, _("Title"), 150, -1, "%t", 0);
        add_column_helper (listview, _("Duration"), 50, -1, "%l", 1);
    }
    else {
        while (col) {
            append_column_from_textdef (listview, col->value);
            col = deadbeef->conf_find ("playlist.column.", col);
        }
    }
    lock_column_config = 0;

    // FIXME: filepath should be in properties dialog, while tooltip should be
    // used to show text that doesn't fit in column width
    if (deadbeef->conf_get_int ("listview.showpathtooltip", 0)) {
        GValue value = {0, };
        g_value_init (&value, G_TYPE_BOOLEAN);
        g_value_set_boolean (&value, TRUE);
        DdbListview *pl = DDB_LISTVIEW (widget);
        g_object_set_property (G_OBJECT (pl->list), "has-tooltip", &value);
        g_signal_connect (G_OBJECT (pl->list), "query-tooltip", G_CALLBACK (playlist_tooltip_handler), NULL);
    }
    deadbeef->conf_lock ();
    strncpy (group_by_str, deadbeef->conf_get_str_fast ("playlist.group_by", ""), sizeof (group_by_str));
    deadbeef->conf_unlock ();
    group_by_str[sizeof (group_by_str)-1] = 0;

    gtkui_groups_pinned = deadbeef->conf_get_int ("playlist.pin.groups", 0);
}
开发者ID:jubalh,项目名称:deadbeef,代码行数:46,代码来源:mainplaylist.c

示例14: update_status_icons

/**
 * Updates all status icons for the different volume states like
 * muted, low, medium, high as well as the volume meter. This
 * is triggered either by apply_prefs() in the preferences subsystem,
 * do_alsa_reinit() or tray_icon_resized().
 */
void update_status_icons() {
  int i,icon_width;
  GdkPixbuf* old_icons[4];
  int size = tray_icon_size();
  for(i=0;i<4;i++)
    old_icons[i] = status_icons[i];
  if (g_key_file_has_key(keyFile,"PNMixer","IconTheme",NULL)) {
    status_icons[0] = get_stock_pixbuf("audio-volume-muted",size);
    status_icons[1] = get_stock_pixbuf("audio-volume-low",size);
    status_icons[2] = get_stock_pixbuf("audio-volume-medium",size);
    status_icons[3] = get_stock_pixbuf("audio-volume-high",size);
  } else {
    status_icons[0] = create_pixbuf("pnmixer-muted.png");
    status_icons[1] = create_pixbuf("pnmixer-low.png");
    status_icons[2] = create_pixbuf("pnmixer-medium.png");
    status_icons[3] = create_pixbuf("pnmixer-high.png");
  }
  icon_width = gdk_pixbuf_get_height(status_icons[0]);
  vol_div_factor = ((gdk_pixbuf_get_height(status_icons[0])-10)/100.0);
  vol_meter_width = 1.25*icon_width;
  if (vol_meter_width%4 != 0)
    vol_meter_width -= (vol_meter_width%4);
  if (!vol_meter_row &&  g_key_file_get_boolean(keyFile,"PNMixer","DrawVolMeter",NULL)) {
    int lim = vol_meter_width/4;
    vol_meter_row = g_malloc(vol_meter_width*sizeof(guchar));
    for(i=0;i<lim;i++) {
      vol_meter_row[i*4]   = vol_meter_red;
      vol_meter_row[i*4+1] = vol_meter_green;
      vol_meter_row[i*4+2] = vol_meter_blue;
      vol_meter_row[i*4+3] = 255;
    }
  } else if (vol_meter_row && !g_key_file_get_boolean(keyFile,"PNMixer","DrawVolMeter",NULL)) {
    free(vol_meter_row);
    vol_meter_row = NULL;
    if (icon_copy)
      g_object_unref(icon_copy);
    icon_copy = NULL;
  }
  draw_offset = g_key_file_get_integer(keyFile,"PNMixer","VolMeterPos",NULL);
  if (tray_icon)
    get_mute_state(TRUE);
  for(i = 0;i < 4;i++)
    if(old_icons[i])
      g_object_unref(old_icons[i]);
}
开发者ID:jubalh,项目名称:pnmixer,代码行数:51,代码来源:main.c

示例15: set_window_icon

void set_window_icon(GtkWindow *window)
{
  GdkPixbuf *pixbuf;

  pixbuf = create_pixbuf("testfarm-vu.png");
  if ( pixbuf != NULL ) {
    gtk_window_set_icon(window, pixbuf);
    gdk_pixbuf_unref(pixbuf);
  }
}
开发者ID:testfarm,项目名称:testfarm,代码行数:10,代码来源:window_icon.c


注:本文中的create_pixbuf函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。