#include <gtk/gtk.h>#include "common.h"Include dependency graph for actions.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Defines | |
| #define | FRONTEND "GTK+" |
Functions | |
| void | actionAmbientLight (GtkRadioAction *, GtkRadioAction *, AppData *) |
| void | actionCaptureImage (GtkAction *, AppData *) |
| void | actionCenterSelection (GtkAction *, AppData *) |
| void | actionCopyURL (GtkAction *, AppData *) |
| void | actionEclipseFinder (GtkAction *, AppData *) |
| void | actionFollowSelection (GtkAction *, AppData *) |
| void | actionFullScreen (GtkAction *, AppData *) |
| void | actionGotoObject (GtkAction *, AppData *) |
| void | actionGotoSelection (GtkAction *, AppData *) |
| void | actionHelpAbout (GtkAction *, AppData *) |
| void | actionHelpControls (GtkAction *, AppData *) |
| void | actionHelpOpenGL (GtkAction *, AppData *) |
| void | actionLabelAsteroids (GtkToggleAction *, AppData *) |
| void | actionLabelComets (GtkToggleAction *, AppData *) |
| void | actionLabelConstellations (GtkToggleAction *, AppData *) |
| void | actionLabelGalaxies (GtkToggleAction *, AppData *) |
| void | actionLabelLocations (GtkToggleAction *, AppData *) |
| void | actionLabelMoons (GtkToggleAction *, AppData *) |
| void | actionLabelNebulae (GtkToggleAction *, AppData *) |
| void | actionLabelOpenClusters (GtkToggleAction *, AppData *) |
| void | actionLabelPlanets (GtkToggleAction *, AppData *) |
| void | actionLabelSpacecraft (GtkToggleAction *, AppData *) |
| void | actionLabelStars (GtkToggleAction *, AppData *) |
| void | actionMenuBarVisible (GtkToggleAction *, AppData *) |
| void | actionMultiCycle (GtkAction *, AppData *) |
| void | actionMultiDelete (GtkAction *, AppData *) |
| void | actionMultiShowActive (GtkToggleAction *, AppData *) |
| void | actionMultiShowFrames (GtkToggleAction *, AppData *) |
| void | actionMultiSingle (GtkAction *, AppData *) |
| void | actionMultiSplitH (GtkAction *, AppData *) |
| void | actionMultiSplitV (GtkAction *, AppData *) |
| void | actionMultiSyncTime (GtkToggleAction *, AppData *) |
| void | actionOpenScript (GtkAction *, AppData *) |
| void | actionOpenURL (GtkAction *, AppData *) |
| void | actionOrbitAsteroids (GtkToggleAction *, AppData *) |
| void | actionOrbitComets (GtkToggleAction *, AppData *) |
| void | actionOrbitMoons (GtkToggleAction *, AppData *) |
| void | actionOrbitPlanets (GtkToggleAction *, AppData *) |
| void | actionOrbitSpacecraft (GtkToggleAction *, AppData *) |
| void | actionQuit (GtkAction *, AppData *) |
| void | actionRenderAA (GtkToggleAction *, AppData *) |
| void | actionRenderAtmospheres (GtkToggleAction *, AppData *) |
| void | actionRenderAutoMagnitude (GtkToggleAction *, AppData *) |
| void | actionRenderCelestialGrid (GtkToggleAction *, AppData *) |
| void | actionRenderClouds (GtkToggleAction *, AppData *) |
| void | actionRenderCometTails (GtkToggleAction *, AppData *) |
| void | actionRenderConstellationBoundaries (GtkToggleAction *, AppData *) |
| void | actionRenderConstellations (GtkToggleAction *, AppData *) |
| void | actionRenderEclipseShadows (GtkToggleAction *, AppData *) |
| void | actionRenderGalaxies (GtkToggleAction *, AppData *) |
| void | actionRenderMarkers (GtkToggleAction *, AppData *) |
| void | actionRenderNebulae (GtkToggleAction *, AppData *) |
| void | actionRenderNightLights (GtkToggleAction *, AppData *) |
| void | actionRenderOpenClusters (GtkToggleAction *, AppData *) |
| void | actionRenderOrbits (GtkToggleAction *, AppData *) |
| void | actionRenderPlanets (GtkToggleAction *, AppData *) |
| void | actionRenderRingShadows (GtkToggleAction *, AppData *) |
| void | actionRenderStars (GtkToggleAction *, AppData *) |
| void | actionRunDemo (GtkAction *, AppData *) |
| void | actionSearchObject (GtkAction *, AppData *) |
| void | actionSelectSol (GtkAction *, AppData *) |
| void | actionStarBrowser (GtkAction *, AppData *) |
| void | actionStarsFewer (GtkAction *, AppData *) |
| void | actionStarsMore (GtkAction *, AppData *) |
| void | actionStarStyle (GtkRadioAction *, GtkRadioAction *, AppData *) |
| void | actionSyncSelection (GtkAction *, AppData *) |
| void | actionSystemBrowser (GtkAction *, AppData *) |
| void | actionTimeFaster (GtkAction *, AppData *) |
| void | actionTimeFreeze (GtkAction *, AppData *) |
| void | actionTimeLocal (GtkAction *, AppData *) |
| void | actionTimeReal (GtkAction *, AppData *) |
| void | actionTimeReverse (GtkAction *, AppData *) |
| void | actionTimeSet (GtkAction *, AppData *) |
| void | actionTimeSlower (GtkAction *, AppData *) |
| void | actionTourGuide (GtkAction *, AppData *) |
| void | actionTrackSelection (GtkAction *, AppData *) |
| void | actionVerbosity (GtkRadioAction *, GtkRadioAction *, AppData *) |
| void | actionViewerSize (GtkAction *, AppData *) |
| void | actionViewOptions (GtkAction *, AppData *) |
| void | resyncAmbientActions (AppData *app) |
| void | resyncGalaxyGainActions (AppData *app) |
| void | resyncLabelActions (AppData *app) |
| void | resyncOrbitActions (AppData *app) |
| void | resyncRenderActions (AppData *app) |
| void | resyncStarStyleActions (AppData *app) |
| void | resyncTimeZoneAction (AppData *app) |
| void | resyncVerbosityActions (AppData *app) |
|
|
Definition at line 125 of file actions.h. Referenced by actionHelpAbout(). |
|
||||||||||||||||
|
Definition at line 644 of file actions.cpp. Referenced by createMainMenu(). 00645 {
00646 float value = amLevels[gtk_radio_action_get_current_value(action)];
00647 app->renderer->setAmbientLightLevel(value);
00648
00649 #ifdef GNOME
00650 gconf_client_set_float(app->client, "/apps/celestia/ambientLight", value, NULL);
00651 #endif
00652 }
|
|
||||||||||||
|
Definition at line 139 of file actions.cpp. References captureImage(). Referenced by handleSpecialKey(). 00140 {
00141 GtkWidget* fs = gtk_file_chooser_dialog_new("Save Image to File",
00142 GTK_WINDOW(app->mainWindow),
00143 GTK_FILE_CHOOSER_ACTION_SAVE,
00144 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
00145 GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
00146 NULL);
00147
00148 GtkFileFilter* filter = gtk_file_filter_new();
00149 gtk_file_filter_set_name(filter, "PNG and JPEG Images");
00150 gtk_file_filter_add_pattern(filter, "*.jpeg");
00151 gtk_file_filter_add_pattern(filter, "*.jpg");
00152 gtk_file_filter_add_pattern(filter, "*.png");
00153 gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fs), filter);
00154
00155 #if GTK_CHECK_VERSION(2, 7, 0)
00156 gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(fs), TRUE);
00157 #endif /* GTK_CHECK_VERSION */
00158
00159 gtk_dialog_set_default_response(GTK_DIALOG(fs), GTK_RESPONSE_ACCEPT);
00160 gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(fs), g_get_home_dir());
00161
00162 if (gtk_dialog_run(GTK_DIALOG(fs)) == GTK_RESPONSE_ACCEPT)
00163 {
00164 char* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(fs));
00165 captureImage(filename, app);
00166 g_free(filename);
00167 }
00168
00169 gtk_widget_destroy(fs);
00170 }
|
|
||||||||||||
|
Definition at line 240 of file actions.cpp. Referenced by dialogSolarBrowser(), and dialogStarBrowser(). 00241 {
00242 app->core->charEntered('c');
00243 }
|
|
||||||||||||
|
Definition at line 63 of file actions.cpp. 00064 {
00065 GtkClipboard* cb = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
00066 Url url(app->core);
00067 gtk_clipboard_set_text(cb, url.getAsString().c_str(), -1);
00068 }
|
|
||||||||||||
|
Definition at line 282 of file actions.cpp. References dialogEclipseFinder(). 00283 {
00284 dialogEclipseFinder(app);
00285 }
|
|
||||||||||||
|
Definition at line 252 of file actions.cpp. 00253 {
00254 app->core->charEntered('F');
00255 }
|
|
||||||||||||
|
Definition at line 408 of file actions.cpp. 00409 {
00410 int positionX, positionY;
00411 app->fullScreen = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action));
00412
00413 if (app->fullScreen)
00414 {
00415 /* Save size/position, so original numbers are available for prefs */
00416 g_object_set_data(G_OBJECT(app->mainWindow), "sizeX", GINT_TO_POINTER(app->glArea->allocation.width));
00417 g_object_set_data(G_OBJECT(app->mainWindow), "sizeY", GINT_TO_POINTER(app->glArea->allocation.height));
00418 gtk_window_get_position(GTK_WINDOW(app->mainWindow), &positionX, &positionY);
00419 g_object_set_data(G_OBJECT(app->mainWindow), "positionX", GINT_TO_POINTER(positionX));
00420 g_object_set_data(G_OBJECT(app->mainWindow), "positionY", GINT_TO_POINTER(positionY));
00421
00422 gtk_window_fullscreen(GTK_WINDOW(app->mainWindow));
00423 }
00424 else
00425 gtk_window_unfullscreen(GTK_WINDOW(app->mainWindow));
00426
00427 /* Enable/Disable the Viewer Size action */
00428 gtk_action_set_sensitive(gtk_action_group_get_action(app->agMain, "ViewerSize"), !app->fullScreen);
00429
00430 #ifdef GNOME
00431 gconf_client_set_bool(app->client, "/apps/celestia/fullScreen", app->fullScreen, NULL);
00432 #endif
00433 }
|
|
||||||||||||
|
Definition at line 234 of file actions.cpp. References dialogGotoObject(). 00235 {
00236 dialogGotoObject(app);
00237 }
|
|
||||||||||||
|
Definition at line 246 of file actions.cpp. Referenced by dialogSolarBrowser(), and dialogStarBrowser(). 00247 {
00248 app->core->charEntered('G');
00249 }
|
|
||||||||||||
|
Definition at line 584 of file actions.cpp. References FRONTEND, and readFromFile(). 00585 {
00586 const gchar* authors[] = {
00587 "Active Developers ***\n",
00588 "Grant Hutchison <grantcelestia@xemaps.com>\n"
00589 "\tAstronomical Research\n",
00590 "Da-Woon Jung <dirkpitt2050@gmail.com>\n"
00591 "\tMacOSX Front-End\n",
00592 "Chris Laurel <claurel@shatters.net>\n"
00593 "\tOpenGL Engine, Windows Front-End\n",
00594 "Fridger Schrempp <fridger.schrempp@desy.de>\n"
00595 "\tResearch, Engine, GTK+ 1 Front-End\n",
00596 "Pat Suwalski <pat@suwalski.net>\n"
00597 "\tGTK+ 2 Front-End\n",
00598 "Christophe Teyssier <chris@teyssier.org>\n"
00599 "\tKDE Front-End, Browser Integration\n",
00600 "\nPast Developers ***\n",
00601 "Bob Ippolito <bob@redivi.com>",
00602 "Deon Ramsey <dramsey@sourceforge.net>",
00603 "Clint Weisbrod <cweisbrod@cogeco.ca>",
00604 NULL
00605 };
00606
00607 GdkPixbuf *logo = gdk_pixbuf_new_from_file ("celestia-logo.png", NULL);
00608
00609 gtk_show_about_dialog(GTK_WINDOW(app->mainWindow),
00610 "name", "Celestia",
00611 "version", VERSION,
00612 "copyright", "Copyright \xc2\xa9 2001-2005 Chris Laurel",
00613 "comments", FRONTEND " Front-End",
00614 "website", "http://celestia.sf.net",
00615 "authors", authors,
00616 "license", readFromFile("COPYING"),
00617 "logo", logo,
00618 NULL);
00619 }
|
|
||||||||||||
|
Definition at line 523 of file actions.cpp. References readFromFile(), and textInfoDialog(). 00524 {
00525 char *txt = readFromFile("controls.txt");
00526 textInfoDialog(txt, "Mouse and Keyboard Controls", app);
00527 g_free(txt);
00528 }
|
|
||||||||||||
|
Definition at line 531 of file actions.cpp. References ExtensionSupported(), GL_MAX_TEXTURE_UNITS_ARB, and textInfoDialog(). 00532 {
00533 /* Code grabbed from winmain.cpp */
00534 char* vendor = (char*) glGetString(GL_VENDOR);
00535 char* render = (char*) glGetString(GL_RENDERER);
00536 char* version = (char*) glGetString(GL_VERSION);
00537 char* ext = (char*) glGetString(GL_EXTENSIONS);
00538
00539 string s;
00540 s = "Vendor: ";
00541 if (vendor != NULL)
00542 s += vendor;
00543 s += "\n";
00544
00545 s += "Renderer: ";
00546 if (render != NULL)
00547 s += render;
00548 s += "\n";
00549
00550 s += "Version: ";
00551 if (version != NULL)
00552 s += version;
00553 s += "\n";
00554
00555 char buf[100];
00556 GLint simTextures = 1;
00557 if (ExtensionSupported("GL_ARB_multitexture"))
00558 glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &simTextures);
00559 sprintf(buf, "Max simultaneous textures: %d\n", simTextures);
00560 s += buf;
00561
00562 GLint maxTextureSize = 0;
00563 glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
00564 sprintf(buf, "Max texture size: %d\n\n", maxTextureSize);
00565 s += buf;
00566
00567 s += "Supported Extensions:\n ";
00568 if (ext != NULL)
00569 {
00570 string extString(ext);
00571 unsigned int pos = extString.find(' ', 0);
00572 while (pos != (unsigned int)string::npos)
00573 {
00574 extString.replace(pos, 1, "\n ");
00575 pos = extString.find(' ', pos + 5);
00576 }
00577 s += extString;
00578 }
00579
00580 textInfoDialog(s.c_str(), "Open GL Info", app);
00581 }
|
|
||||||||||||
|
Definition at line 793 of file actions.cpp. References setLabelMode(). 00794 {
00795 setLabelMode(app, Renderer::AsteroidLabels, gtk_toggle_action_get_active(action));
00796 }
|
|
||||||||||||
|
Definition at line 799 of file actions.cpp. References setLabelMode(). 00800 {
00801 setLabelMode(app, Renderer::CometLabels, gtk_toggle_action_get_active(action));
00802 }
|
|
||||||||||||
|
Definition at line 805 of file actions.cpp. References setLabelMode(). 00806 {
00807 setLabelMode(app, Renderer::ConstellationLabels, gtk_toggle_action_get_active(action));
00808 }
|
|
||||||||||||
|
Definition at line 811 of file actions.cpp. References setLabelMode(). 00812 {
00813 setLabelMode(app, Renderer::GalaxyLabels, gtk_toggle_action_get_active(action));
00814 }
|
|
||||||||||||
|
Definition at line 817 of file actions.cpp. References setLabelMode(). 00818 {
00819 setLabelMode(app, Renderer::LocationLabels, gtk_toggle_action_get_active(action));
00820 }
|
|
||||||||||||
|
Definition at line 823 of file actions.cpp. References setLabelMode(). 00824 {
00825 setLabelMode(app, Renderer::MoonLabels, gtk_toggle_action_get_active(action));
00826 }
|
|
||||||||||||
|
Definition at line 829 of file actions.cpp. References setLabelMode(). 00830 {
00831 setLabelMode(app, Renderer::NebulaLabels, gtk_toggle_action_get_active(action));
00832 }
|
|
||||||||||||
|
Definition at line 835 of file actions.cpp. References setLabelMode(). 00836 {
00837 setLabelMode(app, Renderer::OpenClusterLabels, gtk_toggle_action_get_active(action));
00838 }
|
|
||||||||||||
|
Definition at line 841 of file actions.cpp. References setLabelMode(). 00842 {
00843 setLabelMode(app, Renderer::PlanetLabels, gtk_toggle_action_get_active(action));
00844 }
|
|
||||||||||||
|
Definition at line 847 of file actions.cpp. References setLabelMode(). 00848 {
00849 setLabelMode(app, Renderer::SpacecraftLabels, gtk_toggle_action_get_active(action));
00850 }
|
|
||||||||||||
|
Definition at line 853 of file actions.cpp. References setLabelMode(). 00854 {
00855 setLabelMode(app, Renderer::StarLabels, gtk_toggle_action_get_active(action));
00856 }
|
|
||||||||||||
|
Definition at line 462 of file actions.cpp. 00463 {
00464 g_object_set(G_OBJECT(app->mainMenu), "visible", gtk_toggle_action_get_active(action), NULL);
00465 }
|
|
||||||||||||
|
Definition at line 480 of file actions.cpp. 00481 {
00482 /* Pass a Tab character */
00483 app->core->charEntered('\011');
00484 }
|
|
||||||||||||
|
Definition at line 487 of file actions.cpp. 00488 {
00489 app->core->deleteView();
00490 }
|
|
||||||||||||
|
Definition at line 505 of file actions.cpp. 00506 {
00507 app->core->setActiveFrameVisible(gtk_toggle_action_get_active(action));
00508 }
|
|
||||||||||||
|
Definition at line 499 of file actions.cpp. 00500 {
00501 app->core->setFramesVisible(gtk_toggle_action_get_active(action));
00502 }
|
|
||||||||||||
|
Definition at line 493 of file actions.cpp. 00494 {
00495 app->core->singleView();
00496 }
|
|
||||||||||||
|
Definition at line 468 of file actions.cpp. 00469 {
00470 app->core->splitView(View::HorizontalSplit);
00471 }
|
|
||||||||||||
|
Definition at line 474 of file actions.cpp. 00475 {
00476 app->core->splitView(View::VerticalSplit);
00477 }
|
|
||||||||||||
|
Definition at line 511 of file actions.cpp. 00512 {
00513 app->simulation->setSyncTime(gtk_toggle_action_get_active(action));
00514 }
|
|
||||||||||||
|
Definition at line 99 of file actions.cpp. References openScript(). 00100 {
00101 GtkWidget* fs = gtk_file_chooser_dialog_new("Open Script.",
00102 GTK_WINDOW(app->mainWindow),
00103 GTK_FILE_CHOOSER_ACTION_OPEN,
00104 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
00105 GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
00106 NULL);
00107
00108 #if GTK_CHECK_VERSION(2, 7, 0)
00109 gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(fs), TRUE);
00110 #endif /* GTK_CHECK_VERSION */
00111
00112 gtk_dialog_set_default_response(GTK_DIALOG(fs), GTK_RESPONSE_ACCEPT);
00113 gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(fs), g_get_home_dir());
00114
00115 GtkFileFilter* filter = gtk_file_filter_new();
00116 gtk_file_filter_set_name(filter, "Celestia Scripts");
00117
00118 gtk_file_filter_add_pattern(filter, "*.cel");
00119
00120 #ifdef CELX
00121 gtk_file_filter_add_pattern(filter, "*.celx");
00122 gtk_file_filter_add_pattern(filter, "*.clx");
00123 #endif /* CELX */
00124
00125 gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fs), filter);
00126
00127 if (gtk_dialog_run(GTK_DIALOG(fs)) == GTK_RESPONSE_ACCEPT)
00128 {
00129 char* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(fs));
00130 openScript(filename, app);
00131 g_free(filename);
00132 }
00133
00134 gtk_widget_destroy(fs);
00135 }
|
|
||||||||||||
|
Definition at line 72 of file actions.cpp. References CELSPACING. 00073 {
00074 GtkWidget* dialog = gtk_dialog_new_with_buttons("Enter cel:// URL",
00075 GTK_WINDOW(app->mainWindow),
00076 GTK_DIALOG_MODAL,
00077 GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
00078 GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
00079 NULL);
00080
00081 /* Create a new entry box with default text, all selected */
00082 GtkWidget* entry = gtk_entry_new();
00083 gtk_entry_set_width_chars(GTK_ENTRY(entry), 80);
00084 gtk_entry_set_text(GTK_ENTRY(entry), "cel://");
00085 gtk_editable_select_region(GTK_EDITABLE(entry), 0, -1);
00086
00087 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), entry, TRUE, TRUE, CELSPACING);
00088 gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);
00089 gtk_widget_show_all(dialog);
00090
00091 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT)
00092 app->core->goToUrl(gtk_entry_get_text(GTK_ENTRY(entry)));
00093
00094 gtk_widget_destroy(dialog);
00095 }
|
|
||||||||||||
|
Definition at line 763 of file actions.cpp. References setOrbitMask(). 00764 {
00765 setOrbitMask(app, Body::Asteroid, gtk_toggle_action_get_active(action));
00766 }
|
|
||||||||||||
|
Definition at line 769 of file actions.cpp. References setOrbitMask(). 00770 {
00771 setOrbitMask(app, Body::Comet, gtk_toggle_action_get_active(action));
00772 }
|
|
||||||||||||
|
Definition at line 775 of file actions.cpp. References setOrbitMask(). 00776 {
00777 setOrbitMask(app, Body::Moon, gtk_toggle_action_get_active(action));
00778 }
|
|
||||||||||||
|
Definition at line 781 of file actions.cpp. References setOrbitMask(). 00782 {
00783 setOrbitMask(app, Body::Planet, gtk_toggle_action_get_active(action));
00784 }
|
|
||||||||||||
|
Definition at line 787 of file actions.cpp. References setOrbitMask(). 00788 {
00789 setOrbitMask(app, Body::Spacecraft, gtk_toggle_action_get_active(action));
00790 }
|
|
||||||||||||
|
Definition at line 173 of file actions.cpp. References saveSettingsFile(), and saveSettingsGConf(). Referenced by main(). 00174 {
00175 #ifdef GNOME
00176 saveSettingsGConf(app);
00177 #else
00178 saveSettingsFile(app);
00179 #endif /* GNOME */
00180
00181 gtk_main_quit();
00182 }
|
|
||||||||||||
|
Definition at line 655 of file actions.cpp. References setRenderFlag(). 00656 {
00657 setRenderFlag(app, Renderer::ShowSmoothLines, gtk_toggle_action_get_active(action));
00658 }
|
|
||||||||||||
|
Definition at line 661 of file actions.cpp. References setRenderFlag(). 00662 {
00663 setRenderFlag(app, Renderer::ShowAtmospheres, gtk_toggle_action_get_active(action));
00664 }
|
|
||||||||||||
|
Definition at line 667 of file actions.cpp. References setRenderFlag(). 00668 {
00669 setRenderFlag(app, Renderer::ShowAutoMag, gtk_toggle_action_get_active(action));
00670 }
|
|
||||||||||||
|
Definition at line 673 of file actions.cpp. References setRenderFlag(). 00674 {
00675 setRenderFlag(app, Renderer::ShowCelestialSphere, gtk_toggle_action_get_active(action));
00676 }
|
|
||||||||||||
|
Definition at line 679 of file actions.cpp. References setRenderFlag(). 00680 {
00681 setRenderFlag(app, Renderer::ShowCloudMaps, gtk_toggle_action_get_active(action));
00682 }
|
|
||||||||||||
|
Definition at line 685 of file actions.cpp. References setRenderFlag(). 00686 {
00687 setRenderFlag(app, Renderer::ShowCometTails, gtk_toggle_action_get_active(action));
00688 }
|
|
||||||||||||
|
Definition at line 691 of file actions.cpp. References setRenderFlag(). 00692 {
00693 setRenderFlag(app, Renderer::ShowBoundaries, gtk_toggle_action_get_active(action));
00694 }
|
|
||||||||||||
|
Definition at line 697 of file actions.cpp. References setRenderFlag(). 00698 {
00699 setRenderFlag(app, Renderer::ShowDiagrams, gtk_toggle_action_get_active(action));
00700 }
|
|
||||||||||||
|
Definition at line 703 of file actions.cpp. References setRenderFlag(). 00704 {
00705 setRenderFlag(app, Renderer::ShowEclipseShadows, gtk_toggle_action_get_active(action));
00706 }
|
|
||||||||||||
|
Definition at line 709 of file actions.cpp. References setRenderFlag(). 00710 {
00711 setRenderFlag(app, Renderer::ShowGalaxies, gtk_toggle_action_get_active(action));
00712 }
|
|
||||||||||||
|
Definition at line 715 of file actions.cpp. References setRenderFlag(). 00716 {
00717 setRenderFlag(app, Renderer::ShowMarkers, gtk_toggle_action_get_active(action));
00718 }
|
|
||||||||||||
|
Definition at line 721 of file actions.cpp. References setRenderFlag(). 00722 {
00723 setRenderFlag(app, Renderer::ShowNebulae, gtk_toggle_action_get_active(action));
00724 }
|
|
||||||||||||
|
Definition at line 727 of file actions.cpp. References setRenderFlag(). 00728 {
00729 setRenderFlag(app, Renderer::ShowNightMaps, gtk_toggle_action_get_active(action));
00730 }
|
|
||||||||||||
|
Definition at line 733 of file actions.cpp. References setRenderFlag(). 00734 {
00735 setRenderFlag(app, Renderer::ShowOpenClusters, gtk_toggle_action_get_active(action));
00736 }
|
|
||||||||||||
|
Definition at line 739 of file actions.cpp. References setRenderFlag(). 00740 {
00741 setRenderFlag(app, Renderer::ShowOrbits, gtk_toggle_action_get_active(action));
00742 }
|
|
||||||||||||
|
Definition at line 745 of file actions.cpp. References setRenderFlag(). 00746 {
00747 setRenderFlag(app, Renderer::ShowPlanets, gtk_toggle_action_get_active(action));
00748 }
|
|
||||||||||||
|
Definition at line 751 of file actions.cpp. References setRenderFlag(). 00752 {
00753 setRenderFlag(app, Renderer::ShowRingShadows, gtk_toggle_action_get_active(action));
00754 }
|
|
||||||||||||
|
Definition at line 757 of file actions.cpp. References setRenderFlag(). 00758 {
00759 setRenderFlag(app, Renderer::ShowStars, gtk_toggle_action_get_active(action));
00760 }
|
|
||||||||||||
|
Definition at line 517 of file actions.cpp. 00518 {
00519 app->core->charEntered('D');
00520 }
|
|
||||||||||||
|
Definition at line 197 of file actions.cpp. References CELSPACING, and Selection::empty(). 00198 {
00199 GtkWidget* dialog = gtk_dialog_new_with_buttons("Select Object",
00200 GTK_WINDOW(app->mainWindow),
00201 GTK_DIALOG_DESTROY_WITH_PARENT,
00202 GTK_STOCK_OK, GTK_RESPONSE_OK,
00203 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
00204 NULL);
00205
00206 GtkWidget* box = gtk_hbox_new(FALSE, CELSPACING);
00207 gtk_container_set_border_width(GTK_CONTAINER(box), CELSPACING);
00208 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), box, TRUE, TRUE, 0);
00209
00210 GtkWidget* label = gtk_label_new("Object name");
00211 gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 0);
00212
00213 GtkWidget* entry = gtk_entry_new();
00214 gtk_box_pack_start(GTK_BOX(box), entry, TRUE, TRUE, 0);
00215
00216 gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
00217 gtk_widget_show_all(GTK_WIDGET(dialog));
00218
00219 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK)
00220 {
00221 const gchar* name = gtk_entry_get_text(GTK_ENTRY(entry));
00222 if (name != NULL)
00223 {
00224 Selection sel = app->simulation->findObject(name);
00225 if (!sel.empty())
00226 app->simulation->setSelection(sel);
00227 }
00228 }
00229
00230 gtk_widget_destroy(GTK_WIDGET(dialog));
00231 }
|
|
||||||||||||
|
Definition at line 185 of file actions.cpp. 00186 {
00187 app->core->charEntered('H');
00188 }
|
|
||||||||||||
|
Definition at line 276 of file actions.cpp. References dialogStarBrowser(). 00277 {
00278 dialogStarBrowser(app);
00279 }
|
|
||||||||||||
|
Definition at line 452 of file actions.cpp. 00453 {
00454 app->core->charEntered('[');
00455
00456 #ifdef GNOME
00457 gconf_client_set_float(app->client, "/apps/celestia/visualMagnitude", app->simulation->getFaintestVisible(), NULL);
00458 #endif
00459 }
|
|
||||||||||||
|
Definition at line 442 of file actions.cpp. 00443 {
00444 app->core->charEntered(']');
00445
00446 #ifdef GNOME
00447 gconf_client_set_float(app->client, "/apps/celestia/visualMagnitude", app->simulation->getFaintestVisible(), NULL);
00448 #endif
00449 }
|
|
||||||||||||||||
|
Definition at line 633 of file actions.cpp. Referenced by createMainMenu(). 00634 {
00635 int value = gtk_radio_action_get_current_value(action);
00636 app->renderer->setStarStyle((Renderer::StarStyle)value);
00637
00638 #ifdef GNOME
00639 gconf_client_set_int(app->client, "/apps/celestia/starStyle", value, NULL);
00640 #endif
00641 }
|
|
||||||||||||
|
Definition at line 258 of file actions.cpp. 00259 {
00260 app->core->charEntered('Y');
00261 }
|
|
||||||||||||
|
Definition at line 270 of file actions.cpp. References dialogSolarBrowser(). 00271 {
00272 dialogSolarBrowser(app);
00273 }
|
|
||||||||||||
|
Definition at line 288 of file actions.cpp. 00289 {
00290 app->core->charEntered('L');
00291 }
|
|
||||||||||||
|
Definition at line 300 of file actions.cpp. 00301 {
00302 app->core->charEntered(' ');
00303 }
|
|
||||||||||||
|
Definition at line 324 of file actions.cpp. References updateTimeZone(). 00325 {
00326 app->showLocalTime = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action));
00327 updateTimeZone(app, app->showLocalTime);
00328
00329 #ifdef GNOME
00330 gconf_client_set_bool(app->client, "/apps/celestia/showLocalTime", app->showLocalTime, NULL);
00331 #endif /* GNOME */
00332 }
|
|
||||||||||||
|
Definition at line 306 of file actions.cpp. 00307 {
00308 app->core->charEntered('\\');
00309 }
|
|
||||||||||||
|
Definition at line 312 of file actions.cpp. 00313 {
00314 app->core->charEntered('J');
00315 }
|
|
||||||||||||
|
Definition at line 318 of file actions.cpp. References dialogSetTime(). 00319 {
00320 dialogSetTime(app);
00321 }
|
|
||||||||||||
|
Definition at line 294 of file actions.cpp. 00295 {
00296 app->core->charEntered('K');
00297 }
|
|
||||||||||||
|
Definition at line 191 of file actions.cpp. References dialogTourGuide(). 00192 {
00193 dialogTourGuide(app);
00194 }
|
|
||||||||||||
|
Definition at line 264 of file actions.cpp. 00265 {
00266 app->core->charEntered('T');
00267 }
|
|
||||||||||||||||
|
Definition at line 622 of file actions.cpp. Referenced by createMainMenu(). 00623 {
00624 int value = gtk_radio_action_get_current_value(action);
00625 app->core->setHudDetail(value);
00626
00627 #ifdef GNOME
00628 gconf_client_set_int(app->client, "/apps/celestia/verbosity", value, NULL);
00629 #endif
00630 }
|
|
||||||||||||
|
Definition at line 335 of file actions.cpp. References CELSPACING. 00336 {
00337 GtkWidget* dialog;
00338 int newX, currentX, currentY, winX, winY, screenX, i = 1, position = -1;
00339 char res[32];
00340
00341 screenX = gdk_screen_get_width(gdk_screen_get_default());
00342 currentX = app->glArea->allocation.width;
00343 currentY = app->glArea->allocation.height;
00344
00345 dialog = gtk_dialog_new_with_buttons("Set Viewer Size...",
00346 GTK_WINDOW(app->mainWindow),
00347 GTK_DIALOG_DESTROY_WITH_PARENT,
00348 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
00349 GTK_STOCK_OK, GTK_RESPONSE_OK,
00350 NULL);
00351
00352 GtkWidget* vbox = gtk_vbox_new(FALSE, CELSPACING);
00353 gtk_container_set_border_width(GTK_CONTAINER(vbox), CELSPACING);
00354
00355 GtkWidget* label = gtk_label_new("Dimensions for Main Window:");
00356 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0);
00357
00358 GtkWidget* menubox = gtk_combo_box_new_text();
00359 gtk_box_pack_start(GTK_BOX(vbox), menubox, FALSE, FALSE, 0);
00360
00361 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox, TRUE, TRUE, 0);
00362
00363 while (resolutions[i] != -1)
00364 {
00365 if (position == -1 && resolutions[i-1] < currentX && resolutions[i] >= currentX)
00366 {
00367 sprintf(res, "%d x %d (current)", currentX, currentY);
00368 position = i - 1;
00369 }
00370 else if (resolutions[i] < screenX)
00371 {
00372 sprintf(res, "%d x %d", resolutions[i], int(0.75 * resolutions[i]));
00373 i++;
00374 }
00375 else
00376 break;
00377
00378 gtk_combo_box_append_text(GTK_COMBO_BOX(menubox), res);
00379 }
00380
00381 gtk_combo_box_set_active(GTK_COMBO_BOX(menubox), position);
00382
00383 gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
00384 gtk_widget_show_all(dialog);
00385
00386 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK)
00387 {
00388 int active = gtk_combo_box_get_active(GTK_COMBO_BOX(menubox));
00389
00390 if (active > -1 && active != position)
00391 {
00392 /* Adjust for default entry */
00393 if (active > position) active--;
00394
00395 newX = resolutions[active + 1];
00396 gtk_window_get_size(GTK_WINDOW(app->mainWindow), &winX, &winY);
00397
00398 /* Resizing takes into account border, titlebar, and menubar
00399 sizes. Without them only an allocation can be requested */
00400 gtk_window_resize(GTK_WINDOW(app->mainWindow), newX + winX - currentX, int(0.75 * newX) + winY - currentY);
00401 }
00402 }
00403
00404 gtk_widget_destroy(GTK_WIDGET(dialog));
00405 }
|
|
||||||||||||
|
Definition at line 436 of file actions.cpp. References dialogViewOptions(). 00437 {
00438 dialogViewOptions(app);
00439 }
|
|
|
Definition at line 1210 of file actions.cpp. Referenced by initRealize(), and GtkWatcher::notifyChange(). 01211 {
01212 GtkAction* action;
01213
01214 float ambient = app->renderer->getAmbientLightLevel();
01215
01216 /* Try to be smart about being close to the value of a float */
01217 if (ambient > amLevels[0] && ambient < (amLevels[1] / 2.0))
01218 action = gtk_action_group_get_action(app->agAmbient, "AmbientNone");
01219
01220 else if (ambient < amLevels[1] + ((amLevels[2] - amLevels[1]) / 2.0))
01221 action = gtk_action_group_get_action(app->agAmbient, "AmbientLow");
01222
01223 else
01224 action = gtk_action_group_get_action(app->agAmbient, "AmbientMedium");
01225
01226 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), TRUE);
01227
01228 #ifdef GNOME
01229 /* The action callback only occurs when one of the None/Low/Medium barriers
01230 * is surpassed, so an update is forced. */
01231 gconf_client_set_float(app->client, "/apps/celestia/ambientLight", ambient, NULL);
01232 #endif
01233 }
|
|
|
Definition at line 1257 of file actions.cpp. References gain(), and Galaxy::getLightGain(). Referenced by GtkWatcher::notifyChange(). 01258 {
01259 float gain = Galaxy::getLightGain();
01260
01261 #ifdef GNOME
01262 gconf_client_set_float(app->client, "/apps/celestia/galaxyLightGain", gain, NULL);
01263 #endif
01264 }
|
|
|
Definition at line 1056 of file actions.cpp. Referenced by initRealize(), and GtkWatcher::notifyChange(). 01057 {
01058 GtkAction* action;
01059 const char* actionName;
01060
01061 /* Simply for readability */
01062 int f = app->renderer->getLabelMode();
01063
01064 for (int i = Renderer::StarLabels; i <= Renderer::I18nConstellationLabels; i *= 2)
01065 {
01066 switch (i)
01067 {
01068 case Renderer::StarLabels: actionName = "LabelStars"; break;
01069 case Renderer::PlanetLabels: actionName = "LabelPlanets"; break;
01070 case Renderer::MoonLabels: actionName = "LabelMoons"; break;
01071 case Renderer::ConstellationLabels: actionName = "LabelConstellations"; break;
01072 case Renderer::GalaxyLabels: actionName = "LabelGalaxies"; break;
01073 case Renderer::AsteroidLabels: actionName = "LabelAsteroids"; break;
01074 case Renderer::SpacecraftLabels: actionName = "LabelSpacecraft"; break;
01075 case Renderer::LocationLabels: actionName = "LabelLocations"; break;
01076 case Renderer::CometLabels: actionName = "LabelComets"; break;
01077 case Renderer::NebulaLabels: actionName = "LabelNebulae"; break;
01078 case Renderer::OpenClusterLabels: actionName = "LabelOpenClusters"; break;
01079 case Renderer::I18nConstellationLabels: /* Not used yet */
01080 default: actionName = NULL;
01081 }
01082
01083 if (actionName != NULL)
01084 {
01085 /* Get the action */
01086 action = gtk_action_group_get_action(app->agLabel, actionName);
01087
01088 /* The current i anded with the labelMode gives state of flag */
01089 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), (i & f));
01090 }
01091 }
01092 }
|
|
|
Definition at line 1148 of file actions.cpp. Referenced by initRealize(), and GtkWatcher::notifyChange(). 01149 {
01150 GtkAction* action;
01151 const char* actionName;
01152
01153 /* Simply for readability */
01154 int om = app->renderer->getOrbitMask();
01155
01156 for (int i = Body::Planet; i <= Body::Spacecraft; i *= 2)
01157 {
01158 switch (i)
01159 {
01160 case Body::Planet: actionName = "OrbitPlanets"; break;
01161 case Body::Moon: actionName = "OrbitMoons"; break;
01162 case Body::Asteroid: actionName = "OrbitAsteroids"; break;
01163 case Body::Comet: actionName = "OrbitComets"; break;
01164 case Body::Spacecraft: actionName = "OrbitSpacecraft"; break;
01165 default: actionName = NULL;
01166 }
01167
01168 if (actionName != NULL)
01169 {
01170 /* Get the action */
01171 action = gtk_action_group_get_action(app->agOrbit, actionName);
01172
01173 /* The current i anded with the orbitMask gives state of flag */
01174 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), (i & om));
01175 }
01176 }
01177 }
|
|
|
Definition at line 1096 of file actions.cpp. Referenced by initRealize(), and GtkWatcher::notifyChange(). 01097 {
01098 GtkAction* action;
01099 const char* actionName;
01100
01101 /* Simply for readability */
01102 int rf = app->renderer->getRenderFlags();
01103
01104 /* Unlike the other interfaces, which go through each menu item and set
01105 * the corresponding renderFlag, we go the other way and set the menu
01106 * based on the renderFlag. Last one is ShowOpenClusters. */
01107
01108 for (int i = Renderer::ShowStars; i <= Renderer::ShowOpenClusters; i *= 2)
01109 {
01110 switch (i)
01111 {
01112 case Renderer::ShowStars: actionName = "RenderStars"; break;
01113 case Renderer::ShowPlanets: actionName = "RenderPlanets"; break;
01114 case Renderer::ShowGalaxies: actionName = "RenderGalaxies"; break;
01115 case Renderer::ShowDiagrams: actionName = "RenderConstellations"; break;
01116 case Renderer::ShowCloudMaps: actionName = "RenderClouds"; break;
01117 case Renderer::ShowOrbits: actionName = "RenderOrbits"; break;
01118 case Renderer::ShowCelestialSphere: actionName = "RenderCelestialGrid"; break;
01119 case Renderer::ShowNightMaps: actionName = "RenderNightLights"; break;
01120 case Renderer::ShowAtmospheres: actionName = "RenderAtmospheres"; break;
01121 case Renderer::ShowSmoothLines: actionName = "RenderAA"; break;
01122 case Renderer::ShowEclipseShadows: actionName = "RenderEclipseShadows"; break;
01123 case Renderer::ShowStarsAsPoints: actionName = NULL; break; /* Deprecated */
01124 case Renderer::ShowRingShadows: actionName = "RenderRingShadows"; break;
01125 case Renderer::ShowBoundaries: actionName = "RenderConstellationBoundaries"; break;
01126 case Renderer::ShowAutoMag: actionName = "RenderAutoMagnitude"; break;
01127 case Renderer::ShowCometTails: actionName = "RenderCometTails"; break;
01128 case Renderer::ShowMarkers: actionName = "RenderMarkers"; break;
01129 case Renderer::ShowPartialTrajectories: actionName = NULL; break; /* Not useful yet */
01130 case Renderer::ShowNebulae: actionName = "RenderNebulae"; break;
01131 case Renderer::ShowOpenClusters: actionName = "RenderOpenClusters"; break;
01132 default: actionName = NULL;
01133 }
01134
01135 if (actionName != NULL)
01136 {
01137 /* Get the action */
01138 action = gtk_action_group_get_action(app->agRender, actionName);
01139
01140 /* The current i anded with the renderFlags gives state of flag */
01141 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), (i & rf));
01142 }
01143 }
01144 }
|
|
|
Definition at line 1237 of file actions.cpp. Referenced by initRealize(), and GtkWatcher::notifyChange(). 01238 {
01239 GtkAction* action;
01240 const char* actionName;
01241
01242 switch (app->renderer->getStarStyle())
01243 {
01244 case Renderer::FuzzyPointStars: actionName = "StarsFuzzy"; break;
01245 case Renderer::PointStars: actionName = "StarsPoints"; break;
01246 case Renderer::ScaledDiscStars: actionName = "StarsDiscs"; break;
01247 default: return;
01248 }
01249
01250 /* Get the action, set the widget */
01251 action = gtk_action_group_get_action(app->agStarStyle, actionName);
01252 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), TRUE);
01253 }
|
|
|
Definition at line 1201 of file actions.cpp. Referenced by GtkWatcher::notifyChange(). 01202 {
01203 /* Get the action, set the widget */
01204 GtkAction* action = gtk_action_group_get_action(app->agMain, "TimeLocal");
01205 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), app->showLocalTime);
01206 }
|
|
|
Definition at line 1181 of file actions.cpp. Referenced by initRealize(), and GtkWatcher::notifyChange(). 01182 {
01183 GtkAction* action;
01184 const char* actionName;
01185
01186 switch (app->core->getHudDetail())
01187 {
01188 case 0: actionName = "HudNone"; break;
01189 case 1: actionName = "HudTerse"; break;
01190 case 2: actionName = "HudVerbose"; break;
01191 default: return;
01192 }
01193
01194 /* Get the action, set the widget */
01195 action = gtk_action_group_get_action(app->agVerbosity, actionName);
01196 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), TRUE);
01197 }
|
1.4.1