static void nemo_application_startup (GApplication *app) { NemoApplication *self = NEMO_APPLICATION (app); /* chain up to the GTK+ implementation early, so gtk_init() * is called for us. */ G_APPLICATION_CLASS (nemo_application_parent_class)->startup (app); /* initialize the previewer singleton */ //nemo_previewer_get_singleton (); /* create an undo manager */ self->undo_manager = nemo_undo_manager_new (); /* create DBus manager */ nemo_dbus_manager_start (app); nemo_freedesktop_dbus_start (self); /* initialize preferences and create the global GSettings objects */ nemo_global_preferences_init (); /* register views */ nemo_icon_view_register (); nemo_desktop_icon_view_register (); nemo_list_view_register (); nemo_icon_view_compact_register (); #if ENABLE_EMPTY_VIEW nemo_empty_view_register (); #endif /* register property pages */ nemo_image_properties_page_register (); /* initialize theming */ init_icons_and_styles (); init_gtk_accels (); /* initialize nemo modules */ nemo_module_setup (); /* attach menu-provider module callback */ menu_provider_init_callback (); /* Initialize the UI handler singleton for file operations */ notify_init (GETTEXT_PACKAGE); self->priv->progress_handler = nemo_progress_ui_handler_new (); /* Watch for unmounts so we can close open windows */ /* TODO-gio: This should be using the UNMOUNTED feature of GFileMonitor instead */ self->priv->volume_monitor = g_volume_monitor_get (); g_signal_connect_object (self->priv->volume_monitor, "mount_removed", G_CALLBACK (mount_removed_callback), self, 0); g_signal_connect_object (self->priv->volume_monitor, "mount_added", G_CALLBACK (mount_added_callback), self, 0); /* Check the user's ~/.nemo directories and post warnings * if there are problems. */ check_required_directories (self); init_desktop (self); }
static void nemo_application_startup (GApplication *app) { NemoApplication *self = NEMO_APPLICATION (app); /* chain up to the GTK+ implementation early, so gtk_init() * is called for us. */ G_APPLICATION_CLASS (nemo_application_parent_class)->startup (app); /* initialize the previewer singleton */ //nemo_previewer_get_singleton (); /* create an undo manager */ self->undo_manager = nemo_undo_manager_new (); /* create DBus manager */ self->priv->dbus_manager = nemo_dbus_manager_new (); self->priv->fdb_manager = nemo_freedesktop_dbus_new (); /* initialize preferences and create the global GSettings objects */ nemo_global_preferences_init (); /* register views */ nemo_icon_view_register (); nemo_desktop_icon_view_register (); nemo_list_view_register (); nemo_icon_view_compact_register (); #if ENABLE_EMPTY_VIEW nemo_empty_view_register (); #endif /* register property pages */ nemo_image_properties_page_register (); /* initialize theming */ init_icons_and_styles (); init_gtk_accels (); /* initialize nemo modules */ nemo_module_setup (); /* attach menu-provider module callback */ menu_provider_init_callback (); /* Initialize the UI handler singleton for file operations */ notify_init (GETTEXT_PACKAGE); self->priv->progress_handler = nemo_progress_ui_handler_new (); /* Watch for unmounts so we can close open windows */ /* TODO-gio: This should be using the UNMOUNTED feature of GFileMonitor instead */ self->priv->volume_monitor = g_volume_monitor_get (); g_signal_connect_object (self->priv->volume_monitor, "mount_removed", G_CALLBACK (mount_removed_callback), self, 0); g_signal_connect_object (self->priv->volume_monitor, "mount_added", G_CALLBACK (mount_added_callback), self, 0); g_signal_connect_swapped (nemo_window_state, "changed::" NEMO_WINDOW_STATE_START_WITH_MENU_BAR, G_CALLBACK (menu_state_changed_callback), self); /* Check the user's ~/.nemo directories and post warnings * if there are problems. */ check_required_directories (self); self->priv->cache_problem = FALSE; self->priv->ignore_cache_problem = FALSE; /* silently do a full check of the cache and fix if running as root. * If running as a normal user, do a quick check, and we'll notify the * user later if there's a problem via an infobar */ if (geteuid () == 0) { if (!gnome_desktop_thumbnail_cache_check_permissions (NULL, FALSE)) gnome_desktop_thumbnail_cache_fix_permissions (); } else { if (!gnome_desktop_thumbnail_cache_check_permissions (NULL, TRUE)) self->priv->cache_problem = TRUE; } if (geteuid() != 0) init_desktop (self); }
void main (int argc, char **argv) { int menuopen = 0; int x, y, x1; CEvent cwevent; XEvent xevent; Window choicewin, editorwin, win3d; init_desktop (&desktop); stereo_init (argv[0]); choicewin = Cdrawwindow ("choicewin", CMain, 0, 0, 10, 10, ""); Cgethintpos (&x, &y); x1 = x; Cdrawbutton ("load", choicewin, x, y, AUTO_SIZE, " Load Image "); Cgethintpos (&x, 0); Cdrawbutton ("loadcal", choicewin, x, y, AUTO_SIZE, " Load Calibration File "); Cgethintpos (&x, 0); Cdrawbutton ("showcal", choicewin, x, y, AUTO_SIZE, " Display Calibration Points "); Cgethintpos (0, &y); x = x1; Cdrawbutton ("loadd", choicewin, x, y, AUTO_SIZE, " Load Previous Desktop "); Cgethintpos (&x, 0); Cdrawbutton ("saved", choicewin, x, y, AUTO_SIZE, " Save Previous Desktop "); Cgethintpos (&x, 0); Cdrawbutton ("finish", choicewin, x, y, AUTO_SIZE, " Quit "); Cgethintpos (0, &y); x = x1; Cdrawbutton ("getpnt", choicewin, x, y, AUTO_SIZE, " Triangulate Point "); Cgethintpos (&x, 0); Cdrawbutton ("getsurf", choicewin, x, y, AUTO_SIZE, " Triangulate Multiple Points (Surface) "); Cgethintpos (0, &y); x = x1; Cdrawbutton ("getline", choicewin, x, y, AUTO_SIZE, " Fit Line from Points "); Cgethintpos (&x, 0); Cdrawbutton ("getlineedge", choicewin, x, y, AUTO_SIZE, " Fit Line from two Line Projections "); Cgethintpos (0, &y); x = x1; Cdrawbutton ("getcyl", choicewin, x, y, AUTO_SIZE, " Fit Cylinder from Points "); Cgethintpos (&x, 0); Cdrawbutton ("getcyle", choicewin, x, y, AUTO_SIZE, " Fit Cylinder from four Line Projections "); Cgethintpos (0, &y); x = x1; Cdrawbutton ("getcirc", choicewin, x, y, AUTO_SIZE, " Fit Circle from Points "); Cgethintpos (&x, 0); Cdrawbutton ("getcircedge", choicewin, x, y, AUTO_SIZE, " Fit Circle from Ellipses Projections "); Cgethintpos (0, &y); x = x1; Cdrawbutton ("getellipse", choicewin, x, y, AUTO_SIZE, " Fit Ellipse from Points "); Cgethintpos (&x, 0); Csetsizehintpos ("choicewin"); editorwin = Cdrawwindow ("editorwin", CMain, 200, 100, 640 + 18, \ 450 + 40 + 18 + TEXT_PIX_PER_LINE + 11, ""); Cdraweditor ("editor", editorwin, 6, 6 + 40, 640, 450, "", 0, "/home/terry/stereo-0.2b/tmp/"); CDrawEditMenuButtons ("em", editorwin, Cwidget ("editor")->winid, 10, 10); Caddcallback ("editor", cb_editor); Cdraw3dobject ("3dview", win3d = Cdrawwindow ("3dplanewin", CMain, 150, 150, WIDTH3D + 100, 16 + HEIGHT3D, ""), 6, 6, WIDTH3D, HEIGHT3D, 1, 256); Cdrawbutton ("plshr", win3d, WIDTH3D + 20, 10, 70, 20, "Shrink"); Cdrawbutton ("plenl", win3d, WIDTH3D + 20, 40, 70, 20, "Enlarge"); Cdrawbutton ("newrender", win3d, WIDTH3D + 20, 70, 70, 20, "New render"); Cdrawbutton ("density", win3d, WIDTH3D + 20, 100, 70, 20, "Density"); Cdrawbutton ("flattri", win3d, WIDTH3D + 20, 130, 70, 20, "Flat Triangle"); Cdrawbutton ("savewin", win3d, WIDTH3D + 20, 160, 70, 20, "Save Window"); Caddcallback ("getpnt", cb_getpoint); Caddcallback ("getellipse", cb_getellipse); Caddcallback ("getcircedge", cb_getcircleedge); Caddcallback ("load", cb_newimage); Caddcallback ("3dview", cb_3dplane); Caddcallback ("newrender", cb_newrender); Caddcallback ("getsurf", cb_getsurface); Caddcallback ("getline", cb_getline); Caddcallback ("getcirc", cb_getcircle); Caddcallback ("getcyle", cb_getcylinderedge); Caddcallback ("getcyl", cb_getcylinder); Caddcallback ("getlineedge", cb_getlineedge); Caddcallback ("loadcal", cb_loadcal); Caddcallback ("showcal", cb_showcal); Caddcallback ("saved", cb_save_desktop); Caddcallback ("loadd", cb_load_desktop); Caddcallback ("savewin", cb_save_window); if (argc > 1) if (*argv[1] != '-') do_load_desktop (&desktop, argv[1]); do { CNextEvent (&xevent, &cwevent); if (!strcmp (cwevent.ident, "plshr")) { Cwidget ("3dview")->solid->distance += 2400; Cwidget ("3dview")->solid->y_cam += 2400; Credraw3dobject ("3dview", 0); } if (!strcmp (cwevent.ident, "plenl")) { Cwidget ("3dview")->solid->distance -= 2400; Cwidget ("3dview")->solid->y_cam -= 2400; Credraw3dobject ("3dview", 0); } if (!strcmp (cwevent.ident, "flattri")) { CWidget *w = Cwidget ("3dview"); if (w->solid->option_flags & TDOPTION_FLAT_TRIANGLE) { w->solid->option_flags &= 0xFFFFFFFF - TDOPTION_FLAT_TRIANGLE; } else { w->solid->option_flags |= TDOPTION_FLAT_TRIANGLE; } Credraw3dobject ("3dview", 0); } if (!strcmp (cwevent.ident, "kill")) { menuopen = 0; Cundrawwidget ("win1"); } } while (strcmp (cwevent.ident, "finish")); Cundrawall (); mad_finalize (__FILE__, __LINE__); }