Esempio n. 1
0
void wxCaretBase::SetBlinkTime(int milliseconds)
{
    gs_blinkTime = milliseconds;

#ifdef _WXGTK__
    GtkSettings *settings = gtk_settings_get_default();
    if (millseconds == 0)
    {
        gtk_settings_set_long_property(settings, "gtk-cursor-blink", gtk_false, NULL);
    }
    else
    {
        gtk_settings_set_long_property(settings, "gtk-cursor-blink", gtk_true, NULL);
        gtk_settings_set_long_property(settings, "gtk-cursor-time", milliseconds, NULL);
    }
#endif
}
Esempio n. 2
0
JNIEXPORT void JNICALL
Java_org_gnome_gtk_GtkSettings_gtk_1settings_1set_1long_1property
(
	JNIEnv* env,
	jclass cls,
	jlong _self,
	jstring _name,
	jlong _vLong,
	jstring _origin
)
{
	GtkSettings* self;
	const gchar* name;
	glong vLong;
	const gchar* origin;

	// convert parameter self
	self = (GtkSettings*) _self;

	// convert parameter name
	name = (const gchar*) bindings_java_getString(env, _name);
	if (name == NULL) {
		return; // Java Exception already thrown
	}

	// convert parameter vLong
	vLong = (glong) _vLong;

	// convert parameter origin
	origin = (const gchar*) bindings_java_getString(env, _origin);
	if (origin == NULL) {
		return; // Java Exception already thrown
	}

	// call function
	gtk_settings_set_long_property(self, name, vLong, origin);

	// cleanup parameter self

	// cleanup parameter name
	bindings_java_releaseString(name);

	// cleanup parameter vLong

	// cleanup parameter origin
	bindings_java_releaseString(origin);
}
Esempio n. 3
0
void wxToolTip::SetDelay( long msecs )
{
#if GTK_CHECK_VERSION(2, 12, 0)
    if (GTK_CHECK_VERSION(3,0,0) || gtk_check_version(2,12,0) == NULL)
    {
        GtkSettings* settings = gtk_settings_get_default();
        if (settings)
            gtk_settings_set_long_property(settings, "gtk-tooltip-timeout", msecs, NULL);
    }
    else
#endif
    {
#if !GTK_CHECK_VERSION(3,0,0) && !defined(GTK_DISABLE_DEPRECATED)
        if (!gs_tooltips)
            gs_tooltips = gtk_tooltips_new();

        gtk_tooltips_set_delay( gs_tooltips, (int)msecs );
#endif
    }
}
Esempio n. 4
0
void wxToolTip::Enable( bool flag )
{
#if GTK_CHECK_VERSION(2, 12, 0)
    if (GTK_CHECK_VERSION(3,0,0) || gtk_check_version(2,12,0) == NULL)
    {
        GtkSettings* settings = gtk_settings_get_default();
        if (settings)
            gtk_settings_set_long_property(settings, "gtk-enable-tooltips", flag, NULL);
    }
    else
#endif
    {
#if !GTK_CHECK_VERSION(3,0,0) && !defined(GTK_DISABLE_DEPRECATED)
        if (!gs_tooltips)
            gs_tooltips = gtk_tooltips_new();

        if (flag)
            gtk_tooltips_enable( gs_tooltips );
        else
            gtk_tooltips_disable( gs_tooltips );
#endif
    }
}
Esempio n. 5
0
void init_ui(int *argcp, char ***argvp)
{
	GtkWidget *win;
	GtkWidget *notebook;
	GtkWidget *dive_info;
	GtkWidget *dive_list;
	GtkWidget *equipment;
	GtkWidget *stats;
	GtkWidget *menubar;
	GtkWidget *vbox;
	GdkScreen *screen;
	GtkIconTheme *icon_theme=NULL;
	GtkSettings *settings;

	gtk_init(argcp, argvp);
	settings = gtk_settings_get_default();
	gtk_settings_set_long_property(settings, "gtk_tooltip_timeout", 10, "subsurface setting");

	g_type_init();

	subsurface_open_conf();
	if (subsurface_get_conf("feet", PREF_BOOL))
		output_units.length = FEET;
	if (subsurface_get_conf("psi", PREF_BOOL))
		output_units.pressure = PSI;
	if (subsurface_get_conf("cuft", PREF_BOOL))
		output_units.volume = CUFT;
	if (subsurface_get_conf("fahrenheit", PREF_BOOL))
		output_units.temperature = FAHRENHEIT;
	/* an unset key is FALSE - all these are hidden by default */
	visible_cols.cylinder = PTR_TO_BOOL(subsurface_get_conf("CYLINDER", PREF_BOOL));
	visible_cols.temperature = PTR_TO_BOOL(subsurface_get_conf("TEMPERATURE", PREF_BOOL));
	visible_cols.nitrox = PTR_TO_BOOL(subsurface_get_conf("NITROX", PREF_BOOL));
	visible_cols.otu = PTR_TO_BOOL(subsurface_get_conf("OTU", PREF_BOOL));
	visible_cols.sac = PTR_TO_BOOL(subsurface_get_conf("SAC", PREF_BOOL));

	divelist_font = subsurface_get_conf("divelist_font", PREF_STRING);

	if (!divelist_font)
		divelist_font = DIVELIST_DEFAULT_FONT;

	error_info_bar = NULL;
	win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	g_set_application_name ("subsurface");
	/* Let's check if the subsurface icon has been installed or if
	 * we need to try to load it from the current directory */
	screen = gdk_screen_get_default();
	if (screen)
		icon_theme = gtk_icon_theme_get_for_screen(screen);
	if (icon_theme) {
		if (gtk_icon_theme_has_icon(icon_theme, "subsurface")) {
			need_icon = FALSE;
			gtk_window_set_default_icon_name ("subsurface");
		}
	}
	if (need_icon)
#if defined __linux__ || defined __APPLE__
		gtk_window_set_icon_from_file(GTK_WINDOW(win), "subsurface.svg", NULL);
#elif defined WIN32
		gtk_window_set_icon_from_file(GTK_WINDOW(win), "subsurface.ico", NULL);
#endif
	g_signal_connect(G_OBJECT(win), "delete-event", G_CALLBACK(on_delete), NULL);
	g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(on_destroy), NULL);
	main_window = win;

	vbox = gtk_vbox_new(FALSE, 0);
	gtk_container_add(GTK_CONTAINER(win), vbox);
	main_vbox = vbox;

	menubar = get_menubar_menu(win);
	gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 0);

	vpane = gtk_vpaned_new();
	gtk_box_pack_start(GTK_BOX(vbox), vpane, TRUE, TRUE, 3);

	hpane = gtk_hpaned_new();
	gtk_paned_add1(GTK_PANED(vpane), hpane);

	/* Notebook for dive info vs profile vs .. */
	notebook = gtk_notebook_new();
	gtk_paned_add1(GTK_PANED(hpane), notebook);
	g_signal_connect(notebook, "switch-page", G_CALLBACK(switch_page), NULL);

	/* Create the actual divelist */
	dive_list = dive_list_create();
	gtk_widget_set_name(dive_list, "Dive List");
	gtk_paned_add2(GTK_PANED(vpane), dive_list);

	/* Frame for dive profile */
	dive_profile = dive_profile_widget();
	gtk_widget_set_name(dive_profile, "Dive Profile");
	gtk_paned_add2(GTK_PANED(hpane), dive_profile);

	/* Frame for extended dive info */
	dive_info = extended_dive_info_widget();
	gtk_notebook_append_page(GTK_NOTEBOOK(notebook), dive_info, gtk_label_new("Dive Notes"));

	/* Frame for dive equipment */
	equipment = equipment_widget();
	gtk_notebook_append_page(GTK_NOTEBOOK(notebook), equipment, gtk_label_new("Equipment"));

	/* Frame for dive statistics */
	stats = stats_widget();
	gtk_notebook_append_page(GTK_NOTEBOOK(notebook), stats, gtk_label_new("Info & Stats"));

	gtk_widget_set_app_paintable(win, TRUE);
	gtk_widget_show_all(win);

	return;
}
Esempio n. 6
0
void Widget::set_tooltips() {
    gtk_settings_set_long_property(
        gtk_settings_get_default(), "gtk-enable-tooltips", m_switch.get_active(), "gx_mbcompressor");
}
Esempio n. 7
0
Widget::Widget(Glib::ustring plugname):
plug_name(plugname)
{
  m_fr[0].set_label("BAND 1");
  m_fr[0].add(m_lbox[0]);
  m_fr[1].set_label("BAND 2");
  m_fr[1].add(m_lbox[1]);
  m_fr[2].set_label("BAND 3");
  m_fr[2].add(m_lbox[2]);
  m_fr[3].set_label("BAND 4");
  m_fr[3].add(m_lbox[3]);
  m_fr[4].set_label("BAND 5");
  m_fr[4].add(m_lbox[4]);
  m_fr[5].set_label("BAND PASS");

  // create controllers for port name

  make_controller_box(&m_vbox[1], "RATIO ", 
    "Compression ratio", 1.0, 1e+02, 0.1, RATIO1, false);
  make_controller_box(&m_vbox[2], "RATIO ", 
    "Compression ratio", 1.0, 1e+02, 0.1, RATIO2, false);
  make_controller_box(&m_vbox[3], "RATIO ", 
    "Compression ratio", 1.0, 1e+02, 0.1, RATIO3, false);
  make_controller_box(&m_vbox[4], "RATIO ", 
    "Compression ratio", 1.0, 1e+02, 0.1, RATIO4, false);
  make_controller_box(&m_vbox[5], "RATIO ", 
    "Compression ratio", 1.0, 1e+02, 0.1, RATIO5, false);

  make_controller_box(&m_vbox[1], "ATTACK ", 
    "Time before the compressor starts to kick in", 0.001, 1.0, 0.001, ATTACK1, false);
  make_controller_box(&m_vbox[2], "ATTACK ", 
    "Time before the compressor starts to kick in", 0.001, 1.0, 0.001, ATTACK2, false);
  make_controller_box(&m_vbox[3], "ATTACK ", 
    "Time before the compressor starts to kick in", 0.001, 1.0, 0.001, ATTACK3, false);
  make_controller_box(&m_vbox[4], "ATTACK ", 
    "Time before the compressor starts to kick in", 0.001, 1.0, 0.001, ATTACK4, false);
  make_controller_box(&m_vbox[5], "ATTACK ", 
    "Time before the compressor starts to kick in", 0.001, 1.0, 0.001, ATTACK5, false);

  make_controller_box(&m_vbox[1], "RELEASE ", 
    "Time before the compressor releases the sound", 0.01, 1e+01, 0.01, RELEASE1, false);
  make_controller_box(&m_vbox[2], "RELEASE ", 
    "Time before the compressor releases the sound", 0.01, 1e+01, 0.01, RELEASE2, false);
  make_controller_box(&m_vbox[3], "RELEASE ", 
    "Time before the compressor releases the sound", 0.01, 1e+01, 0.01, RELEASE3, false);
  make_controller_box(&m_vbox[4], "RELEASE ", 
    "Time before the compressor releases the sound", 0.01, 1e+01, 0.01, RELEASE4, false);
  make_controller_box(&m_vbox[5], "RELEASE ", 
    "Time before the compressor releases the sound", 0.01, 1e+01, 0.01, RELEASE5, false);

  make_controller_box(&m_vbox[1], "MAKEUP", 
    "Post amplification and threshold", -5e+01, 5e+01, 0.1, MAKEUP1, false);
  make_controller_box(&m_vbox[2], "MAKEUP", 
    "Post amplification and threshold", -5e+01, 5e+01, 0.1, MAKEUP2, false);
  make_controller_box(&m_vbox[3], "MAKEUP", 
    "Post amplification and threshold", -5e+01, 5e+01, 0.1, MAKEUP3, false);
  make_controller_box(&m_vbox[4], "MAKEUP", 
    "Post amplification and threshold", -5e+01, 5e+01, 0.1, MAKEUP4, false);
  make_controller_box(&m_vbox[5], "MAKEUP", 
    "Post amplification and threshold", -5e+01, 5e+01, 0.1, MAKEUP5, false);

  make_controller_box(&m_vbox[1], "THRESHOLD ", 
    "Threshold correction, an anticlip measure", 0.0, 1e+01, 0.1, MAKEUPTHRESHOLD1, false);
  make_controller_box(&m_vbox[2], "THRESHOLD ", 
    "Threshold correction, an anticlip measure", 0.0, 1e+01, 0.1, MAKEUPTHRESHOLD2, false);
  make_controller_box(&m_vbox[3], "THRESHOLD ", 
    "Threshold correction, an anticlip measure", 0.0, 1e+01, 0.1, MAKEUPTHRESHOLD3, false);
  make_controller_box(&m_vbox[4], "THRESHOLD ", 
    "Threshold correction, an anticlip measure", 0.0, 1e+01, 0.1, MAKEUPTHRESHOLD4, false);
  make_controller_box(&m_vbox[5], "THRESHOLD ", 
    "Threshold correction, an anticlip measure", 0.0, 1e+01, 0.1, MAKEUPTHRESHOLD5, false);

  Glib::ustring modes[] = {"Compress","Bypass","Mute"};  
  static const size_t _size = sizeof(modes) / sizeof(modes[0]);
  make_selector(&m_vbox[1],"Compress or Mute the selected band, or Bypass The Compressor", modes, _size, 1.0, 1.0, MODE1);
  make_selector(&m_vbox[2],"Compress or Mute the selected band, or Bypass The Compressor", modes, _size, 1.0, 1.0, MODE2);
  make_selector(&m_vbox[3],"Compress or Mute the selected band, or Bypass The Compressor", modes, _size, 1.0, 1.0, MODE3);
  make_selector(&m_vbox[4],"Compress or Mute the selected band, or Bypass The Compressor", modes, _size, 1.0, 1.0, MODE4);
  make_selector(&m_vbox[5],"Compress or Mute the selected band, or Bypass The Compressor", modes, _size, 1.0, 1.0, MODE5);


  make_controller_box(&m_vbox[7], "LOW PASS \n  B1><B2", "Crossfrequency between Band1 and Band2",
    2e+01, 2e+04, 1.08 , CROSSOVER_B1_B2, true);
  make_controller_box(&m_vbox[8], "CROSSOVER \n   B2><B3", "Crossfrequency between Band2 and Band3",
    2e+01, 2e+04, 1.08 , CROSSOVER_B2_B3, true);
  make_controller_box(&m_vbox[9], "CROSSOVER \n   B3><B4 ", "Crossfrequency between Band3 and Band4",
    2e+01, 2e+04, 1.08 , CROSSOVER_B3_B4, true);
  make_controller_box(&m_vbox[10], "HIGH PASS \n  B4><B5", "Crossfrequency between Band4 and Band5",
    2e+01, 2e+04, 1.08 , CROSSOVER_B4_B5, true);
  
  // set propertys for the main paintbox holding the skin
  m_paintbox[0].set_border_width(10);
  m_paintbox[0].set_spacing(6);
  m_paintbox[0].set_homogeneous(false);
  m_paintbox[0].set_name(plug_name);
  m_paintbox[0].property_paint_func() = "gxhead_expose";
  add(m_paintbox[0]);

  // set propertys and stack fastmeters
  for (uint32_t i = 0;i<5;i++) {
    fastmeter[i].set_hold_count(12);
    fastmeter[i].set_property("dimen",5);
    fastmeter[i].set_tooltip_text("Output");
    fastmeter[i+5].set_hold_count(12);
    fastmeter[i+5].set_property("dimen",5);
    fastmeter[i+5].set_tooltip_text("Input");
    m_paintbox[i+1].property_paint_func() = "RackBox_expose";
    m_paintbox[i+1].set_name(plug_name);
    m_paintbox[i+1].set_border_width(5);
    m_paintbox[i+1].set_spacing(2);
    m_paintbox[i+1].pack_start(fastmeter[i+5]);
    m_paintbox[i+1].pack_start(fastmeter[i]);
  }
  
  // set a vertical box in the paintbox
  m_vbox[11].set_border_width(14);
  m_vbox[12].set_border_width(14);
  m_hbox[2].set_border_width(4);
  m_paintbox[0].pack_start(m_vbox[0]);
  // box for the controllers
  m_hbox[0].set_spacing(4);
  m_hbox[0].set_border_width(4);
  m_hbox[0].set_homogeneous(false);
  m_vbox[0].pack_start(m_hbox[0]);
  m_fr[5].add(m_hbox[1]);
  m_vbox[0].pack_start(m_fr[5]);
  m_vbox[0].pack_start(m_hbox[2]);
  // put boxed controllers into controller box
  m_hbox[0].pack_start(m_vbox[11], Gtk::PACK_EXPAND_PADDING);
  m_hbox[0].pack_start(m_fr[0]);
  m_lbox[0].pack_start(m_vbox[1]);
  m_lbox[0].pack_start(m_paintbox[1],Gtk::PACK_SHRINK);
  m_hbox[0].pack_start(m_fr[1]);
  m_lbox[1].pack_start(m_vbox[2]);
  m_lbox[1].pack_start(m_paintbox[2],Gtk::PACK_SHRINK);
  m_hbox[0].pack_start(m_fr[2]);
  m_lbox[2].pack_start(m_vbox[3]);
  m_lbox[2].pack_start(m_paintbox[3],Gtk::PACK_SHRINK);
  m_hbox[0].pack_start(m_fr[3]);
  m_lbox[3].pack_start(m_vbox[4]);
  m_lbox[3].pack_start(m_paintbox[4],Gtk::PACK_SHRINK);
  m_hbox[0].pack_start(m_fr[4]);
  m_lbox[4].pack_start(m_vbox[5]);
  m_lbox[4].pack_start(m_paintbox[5],Gtk::PACK_SHRINK);
  m_hbox[0].pack_start(m_vbox[12], Gtk::PACK_EXPAND_PADDING);
  // put boxed controllers into controller box
  m_hbox[1].pack_start(m_vbox[13], Gtk::PACK_EXPAND_PADDING);
  m_hbox[1].pack_start(m_vbox[7]);
  m_hbox[1].pack_start(m_vbox[8]);
  m_hbox[1].pack_start(m_vbox[9]);
  m_hbox[1].pack_start(m_vbox[10]);
  m_hbox[1].pack_start(m_vbox[15]);
  m_hbox[1].pack_start(m_vbox[14], Gtk::PACK_EXPAND_PADDING);
  // default disable tooltips
  gtk_settings_set_long_property(
        gtk_settings_get_default(), "gtk-enable-tooltips", false, "gx_mbcompressor");
  make_switch_box(&m_vbox[15], "Tooltips");
  m_switch.signal_toggled().connect(sigc::mem_fun(
        *this, &Widget::set_tooltips));
  
  set_app_paintable(true);
  show_all();
}