void reset_aspect()
  {
    int w= _image->get_pixbuf()->get_width();
    int h= _image->get_pixbuf()->get_height();

    _be.set_size(w, h);
  }
Exemple #2
0
void ItemView::drawReminderIcon(const Cairo::RefPtr<Cairo::Context>& cr, const int width, const int height)
{
    cr->save();

    //draw reminder icon
    cr->set_antialias(Cairo::ANTIALIAS_NONE);

    if (data.isReminder())
    {
        Gtk::Image* image = Resources::res->imgReminderIcon;

        if (getColorMode() == COLOR_ALARM)
            image = Resources::res->imgReminderOnIcon;

        const Glib::RefPtr<Gdk::Pixbuf> icon = image->get_pixbuf();

        const int iconLeft = (TIME_WIDTH * 0.5) - (icon->get_width() * 0.5);
        const int iconTop = (height - icon->get_height()) - (PADDING * 3);

        Gdk::Cairo::set_source_pixbuf(cr, icon, iconLeft, iconTop);

        cr->rectangle(iconLeft, iconTop, icon->get_width(), icon->get_height());
        cr->fill();
    }

    cr->restore();
}
 void ArtistsWidget::insertReturn() {
   Gtk::TreeModel::Row row = *(treeModel->append());
   //    row[columns.artist] = "Home";
   row[columns.isArtist] = -1;
   Gtk::Image i;
   //i.set_from_icon_name("gtk-media-pause", Gtk::IconSize::from_name("GTK_ICON_SIZE_BUTTON"));
   i.set("ui/arrowleft.png");
   row[columns.image] = i.get_pixbuf();
 }
ControlItem::ControlItem(Gtk::Widget* icon, double x, double y, double width,
    double height, bool moving, bool overlaps) {
  rect_ = Goocanvas::Rect::create(x, y, width, height);
  if (moving) {
    rect_->set_property("fill_color_rgba", LIGHT_BLUE);
  } else if (overlaps) {
    rect_->set_property("fill_color_rgba", LIGHT_RED);
  } else {
    rect_->set_property("fill_color_rgba", LIGHT_GREEN);
  }

  add_child(rect_);
  Gtk::Image* image = dynamic_cast<Gtk::Image*>(icon);
  Glib::RefPtr<Goocanvas::Image> item = Goocanvas::Image::create(image->get_pixbuf(), x, y);
  add_child(item);
}
  void ArtistsWidget::loadArtistsSongs(std::string artist) {

    selectedArtist = artist;

    // set label of tab
    artistsLabel->set_text(selectedArtist);

    Gtk::TreeModel::Path path;
    Gtk::CellRenderer* cell;
    artistsView->get_cursor(path, cell);
    std::cout << "sel path:" << path.to_string();
    //    cell->;

    // clear treemodel
    m_actualSongs.clear();


    // start searching for artist
    MPD::Client::GetInstance()->StartSearch(1);
    MPD::Client::GetInstance()->AddSearch(MPD_TAG_ARTIST, artist);
    MPD::Client::GetInstance()->CommitSearch(m_actualSongs);

    // sort songs
    std::sort(m_actualSongs.begin(), m_actualSongs.end(), actualSongSortCond);

    artistsView->unset_model();
    treeModel->clear();

    // insert return button
    insertReturn();

    for (int i = 0; i < m_actualSongs.size(); i++) {
      Gtk::TreeModel::Row row = *(treeModel->append());
      row[columns.artist] = m_actualSongs[i]->GetTitle();
      Gtk::Image image;
      image.set("ui/icon_smaller.png");
      row[columns.image] = image.get_pixbuf();
      row[columns.isArtist] = 0;
      row[columns.song] = m_actualSongs[i];
    }


    artistsView->set_model(treeModel);
    //scroll to top
    artistScrolledWindow->get_vadjustment()->set_value(0);

  }
Exemple #6
0
About::About()
{
	set_transient_for((Gtk::Window&)(*App::main_window));
#ifdef HAVE_GTK_ABOUTDIALOG_SET_PROGRAM_NAME
	set_program_name(PACKAGE_NAME);
#else
	set_name(PACKAGE_NAME);
#endif
	set_version(VERSION);
	set_comments(_("2D vector animation studio"));

	set_url_hook(sigc::mem_fun(*this, &About::on_link_clicked));
	set_website("http://synfig.org/");
	set_website_label(_("Visit the Synfig website"));

	set_copyright(_("Copyright 2001-2013\nRobert B. Quattlebaum Jr.,\nAdrian Bentley and Synfig contributors"));
	Glib::ustring license =
		"This program is free software; you can redistribute it and/or modify "
		"it under the terms of the GNU General Public License as published by "
		"the Free Software Foundation; either version 2 of the License, or "
		"(at your option) any later version.\n\n"

		"This program is distributed in the hope that it will be useful, "
		"but WITHOUT ANY WARRANTY; without even the implied warranty of "
		"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the "
		"GNU General Public License for more details.\n\n"

		"You should have received a copy of the GNU General Public License along "
		"with this program; if not, write to the Free Software Foundation, Inc., "
		"51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or visit: http://www.gnu.org/";
	set_license(license);
#ifdef HAVE_GTK_ABOUTDIALOG_SET_WRAP_LICENSE
	set_wrap_license(true);
#endif

	std::vector<Glib::ustring> authors;
	authors.push_back(_("Original developers:"));
	authors.push_back("");
	authors.push_back("Robert B. Quattlebaum Jr (darco)");
	authors.push_back("Adrian Bentley");
	authors.push_back("");
	authors.push_back(_("Contributors:"));
	authors.push_back("");
	authors.push_back("Adrian Winchell (SnapSilverlight)");
	authors.push_back("Andreas Jochens");
	authors.push_back("Brendon Higgins");
	authors.push_back("Carlos López González (genete)");
	authors.push_back("Carlos A. Sosa Navarro");
	authors.push_back("Chris Moore (dooglus)");
	authors.push_back("Chris Norman (pixelgeek)");
	authors.push_back("Cyril Brulebois (KiBi)");
	authors.push_back("Daniel Fort");
	authors.push_back("Daniel Hornung (rubikcube)");
	authors.push_back("David Roden (Bombe)");
	authors.push_back("Dmitriy Pomerantsev (Atrus)");
	authors.push_back("Douglas Lau");
	authors.push_back("Gerald Young (Yoyobuae)");
	authors.push_back("Gerco Ballintijn");
	authors.push_back("IL'dar AKHmetgaleev (AkhIL)");
	authors.push_back("Ivan Mahonin");
	authors.push_back("Jerome Blanchi (d.j.a.y.)");
	authors.push_back("Konstantin Dmitriev (zelgadis)");
	authors.push_back("Luka Pravica");
	authors.push_back("Nikita Kitaev (nikitakit)");
	authors.push_back("Martin Michlmayr (tbm)");
	authors.push_back("Miguel Gea Milvaques (xerakko)");
	authors.push_back("Paul Wise (pabs)");
	authors.push_back("Ralf Corsepius");
	authors.push_back("Ray Frederikson");
	authors.push_back("Timo Paulssen (timonator)");
	authors.push_back("Yu Chen (jcome)");
	authors.push_back("Yue Shi Lai");
	set_authors(authors);

	std::vector<Glib::ustring> artists;
	artists.push_back("Aurore D (rore)");
	artists.push_back("Bertrand Grégoire (berteh)");
	artists.push_back("Carl-Christian Gehl (Razputin)");
	artists.push_back("Carlos López González (genete)");
	artists.push_back("Chris Norman (pixelgeek)");
	artists.push_back("Daniel Hornung (rubikcube)");
	artists.push_back("David Rylander (rylleman)");
	artists.push_back("Franco Iacomella (Yaco)");
	artists.push_back("Gerald Young (Yoyobuae)");
	artists.push_back("Henrique Lopes Barone");
	artists.push_back("Konstantin Dmitriev (zelgadis)");
	artists.push_back("Madeleine Crubellier (mad0)");
	artists.push_back("Nikolai Mamashev (solkap)");
	artists.push_back("Robert B. Quattlebaum Jr. (darco)");
	artists.push_back("Thimotee Guiet (satrip)");
	artists.push_back("Yu Chen (jcome)");
	set_artists(artists);

	// TRANSLATORS: change this to your name, separate multiple names with \n
	set_translator_credits(_("translator-credits"));

	std::string imagepath;
#ifdef WIN32
	imagepath=App::get_base_path()+ETL_DIRECTORY_SEPARATOR+IMAGE_DIR;
#else
	imagepath=IMAGE_DIR;
#endif
	char* synfig_root=getenv("SYNFIG_ROOT");
	if(synfig_root) {
		imagepath=synfig_root;
		imagepath+=ETL_DIRECTORY_SEPARATOR;
		imagepath+="share";
		imagepath+=ETL_DIRECTORY_SEPARATOR;
		imagepath+="pixmaps";
	}
	imagepath+=ETL_DIRECTORY_SEPARATOR;

	Gtk::Image *Logo = manage(new class Gtk::Image());
	Logo->set(imagepath+"synfig_icon."IMAGE_EXT);
	set_logo(Logo->get_pixbuf());

#ifdef SHOW_EXTRA_INFO

	string extra_info = get_comments() + "\n";

	#ifdef DEVEL_VERSION
		extra_info += strprintf(_("\nDevelopment version:\n%s\n"),DEVEL_VERSION);
	#endif

	extra_info += "\n";

	extra_info += strprintf(_("Built on %s" /* at %s */ "\n"), __DATE__ /* , __TIME__ */ );

	extra_info += "\n";

	extra_info += strprintf(_("Built with:\n"), ETL_VERSION);
	extra_info += strprintf(_("ETL %s\n"), ETL_VERSION);
	extra_info += strprintf(_("Synfig API %s\n"), stringify(SYNFIG_VERSION));
	extra_info += strprintf(_("Synfig library %d\n"), SYNFIG_LIBRARY_VERSION);
	extra_info += strprintf(_("GTK+ %d.%d.%d\n"), GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
	#ifdef __GNUC__
		extra_info += strprintf(_("GNU G++ %d.%d.%d\n"),__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__);
	#endif

	extra_info += "\n";

	extra_info += strprintf(_("Using:\n"), synfig::get_version());
	extra_info += strprintf(_("Synfig %s\n"), synfig::get_version());
	extra_info += strprintf(_("GTK+ %d.%d.%d"),gtk_major_version,gtk_minor_version,gtk_micro_version);

	#ifdef _DEBUG
		extra_info += "\n\nDEBUG BUILD";
	#endif

	set_comments(extra_info);

#endif

	// Hide the dialog when you click close
	signal_response().connect(sigc::mem_fun(*this, &About::close));
}