void
IRC_Client_GUI_MessageHandler::setModes (const std::string& modes_in,
                                         const std::string& parameter_in)
{
  RPG_TRACE (ACE_TEXT ("IRC_Client_GUI_MessageHandler::setModes"));

  ACE_UNUSED_ARG (parameter_in);

  // sanity check(s)
  ACE_ASSERT (CBData_.GTKState);

  RPG_Net_Protocol_Tools::merge (modes_in,
                                 CBData_.channelModes);

  updateModeButtons ();

  // enable channel modes ?
  // retrieve channel tab mode hbox handle
  ACE_Guard<ACE_Thread_Mutex> aGuard (CBData_.GTKState->lock);

  Common_UI_GTKBuildersIterator_t iterator =
      CBData_.GTKState->builders.find (builderLabel_);
  // sanity check(s)
  ACE_ASSERT (iterator != CBData_.GTKState->builders.end ());

  GtkHBox* hbox_p =
    GTK_HBOX (gtk_builder_get_object ((*iterator).second.second,
                                      ACE_TEXT_ALWAYS_CHAR ("channel_tab_mode_hbox")));
  ACE_ASSERT (hbox_p);
  gtk_widget_set_sensitive (GTK_WIDGET (hbox_p),
                            CBData_.channelModes.test (CHANNELMODE_OPERATOR));
}
Beispiel #2
0
static void _slider_init (GtkDarktableSlider *slider)
{
  slider->is_dragging=FALSE;
  slider->is_sensibility_key_pressed=FALSE;
  slider->entry=gtk_entry_new();

  gtk_widget_add_events (GTK_WIDGET (slider),
                         GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
                         GDK_ENTER_NOTIFY_MASK |  GDK_LEAVE_NOTIFY_MASK |
                         GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK |
                         GDK_POINTER_MOTION_MASK);

  GtkWidget *hbox=gtk_hbox_new(TRUE,0);
  slider->hbox = GTK_HBOX(hbox);

  GtkWidget *alignment = gtk_alignment_new(0.5, 0.5, 1, 1);
  gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 0, DTGTK_SLIDER_BORDER_WIDTH*2, DTGTK_SLIDER_ADJUST_BUTTON_WIDTH+DTGTK_SLIDER_BORDER_WIDTH*2);
  gtk_container_add(GTK_CONTAINER(alignment), slider->entry);
  gtk_box_pack_start(GTK_BOX(hbox),alignment,TRUE,TRUE,0);

  gtk_container_add(GTK_CONTAINER(slider),hbox);

  gtk_entry_set_has_frame (GTK_ENTRY(slider->entry), FALSE);
  gtk_entry_set_alignment (GTK_ENTRY(slider->entry), 1.0);
  g_signal_connect (G_OBJECT (slider->entry), "key-press-event", G_CALLBACK(_slider_entry_key_event), (gpointer)slider);
  dt_gui_key_accel_block_on_focus_connect (slider->entry);
}
Beispiel #3
0
void tabmanagergui_create_label (GuTabPage* tp, gchar* labeltext) {
    static unsigned count = 0;
    GtkRcStyle* rcstyle = NULL;
    GtkWidget* image = NULL;
    GtkHBox* hbox;

    tp->labelbox = gtk_event_box_new ();
    hbox = GTK_HBOX (gtk_hbox_new (FALSE, 0));
    tp->unsavednr = ++count;
    
    gtk_event_box_set_visible_window (GTK_EVENT_BOX (tp->labelbox), FALSE);
    gtk_container_add (GTK_CONTAINER(tp->labelbox), GTK_WIDGET (hbox));
    
    tp->label = GTK_LABEL (gtk_label_new (labeltext));

    gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (tp->label), TRUE, TRUE, 5);
    
    tp->button = GTK_BUTTON (gtk_button_new());
    image = gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
    gtk_button_set_image (tp->button, image);
    g_object_set (tp->button, "relief", GTK_RELIEF_NONE, 
                         "focus-on-click", FALSE, NULL);
    gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (tp->button), FALSE,FALSE,0);
    
    rcstyle = gtk_rc_style_new ();
    rcstyle->xthickness = rcstyle->ythickness = 0;
    gtk_widget_modify_style (GTK_WIDGET (tp->button), rcstyle);
    g_object_unref (rcstyle);

    gtk_widget_show_all (GTK_WIDGET (hbox));
}
Beispiel #4
0
void gui_init(dt_iop_module_t *self)
{
  self->gui_data = g_malloc(sizeof(dt_iop_invert_gui_data_t));
  dt_iop_invert_gui_data_t *g = (dt_iop_invert_gui_data_t *)self->gui_data;
  dt_iop_invert_params_t *p = (dt_iop_invert_params_t *)self->params;

  self->widget = gtk_hbox_new(FALSE, 5);

  GtkWidget *tb;

  g->label = DTGTK_RESET_LABEL(dtgtk_reset_label_new ("", self, &p->color, 3*sizeof(float)));
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->label), TRUE, TRUE, 0);

  g->pickerbuttons = GTK_HBOX(gtk_hbox_new(FALSE, 5));
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->pickerbuttons), TRUE, TRUE, 0);

  g->colorpicker = DTGTK_BUTTON(dtgtk_button_new(dtgtk_cairo_paint_color, CPF_IGNORE_FG_STATE|CPF_STYLE_FLAT|CPF_DO_NOT_USE_BORDER));
  gtk_widget_set_size_request(GTK_WIDGET(g->colorpicker), 75, 24);
  g_signal_connect (G_OBJECT (g->colorpicker), "clicked", G_CALLBACK (colorpicker_callback), self);
  gtk_box_pack_start(GTK_BOX(g->pickerbuttons), GTK_WIDGET(g->colorpicker), TRUE, TRUE, 0);

  tb = dtgtk_togglebutton_new(dtgtk_cairo_paint_colorpicker, CPF_STYLE_FLAT);
  g_object_set(G_OBJECT(tb), "tooltip-text", _("pick color of film material from image"), (char *)NULL);
  gtk_widget_set_size_request(tb, 24, 24);
  g_signal_connect(G_OBJECT(tb), "toggled", G_CALLBACK(request_pick_toggled), self);
  gtk_box_pack_start(GTK_BOX(g->pickerbuttons), tb, TRUE, TRUE, 5);

  g_signal_connect (G_OBJECT(self->widget), "expose-event", G_CALLBACK(expose), self);
}
Beispiel #5
0
PathEntry PathEntry_new()
{
  GtkFrame* frame = GTK_FRAME(gtk_frame_new(NULL));
  gtk_widget_show(GTK_WIDGET(frame));
  gtk_frame_set_shadow_type(frame, GTK_SHADOW_IN);

  // path entry
  GtkHBox* hbox = GTK_HBOX(gtk_hbox_new(FALSE, 0));
  gtk_widget_show(GTK_WIDGET(hbox));

  GtkEntry* entry = GTK_ENTRY(gtk_entry_new());
  gtk_entry_set_has_frame(entry, FALSE);
  gtk_widget_show(GTK_WIDGET(entry));
  gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(entry), TRUE, TRUE, 0);

  // browse button
  GtkButton* button = GTK_BUTTON(gtk_button_new());
  button_set_icon(button, "ellipsis.bmp");
  gtk_widget_show(GTK_WIDGET(button));
  gtk_box_pack_end(GTK_BOX(hbox), GTK_WIDGET(button), FALSE, FALSE, 0);

  gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(hbox));

  return PathEntry(frame, entry, button);
}
Beispiel #6
0
GtkHBox* create_dialog_hbox(int spacing, int border)
{
  GtkHBox* hbox = GTK_HBOX(gtk_hbox_new(FALSE, spacing));
  gtk_widget_show(GTK_WIDGET(hbox));
  gtk_container_set_border_width(GTK_CONTAINER(hbox), border);
  return hbox;
}
Beispiel #7
0
static void
gnc_recurrence_init( GncRecurrence *gr )
{
    GtkVBox *vb;
    GtkHBox *hb;
    GtkWidget *w;
    GtkBuilder *builder;

    recurrenceSet(&gr->recurrence, 1, PERIOD_MONTH, NULL, WEEKEND_ADJ_NONE);

    /* Open up the builder file */
    builder = gtk_builder_new();
    gnc_builder_add_from_file (builder, "gnc-recurrence.glade", "GCB_PeriodType_liststore");
    gnc_builder_add_from_file (builder, "gnc-recurrence.glade", "GSB_Mult_Adj");
    gnc_builder_add_from_file (builder, "gnc-recurrence.glade", "RecurrenceEntryVBox");

    vb = GTK_VBOX(gtk_builder_get_object (builder, "RecurrenceEntryVBox"));
    hb = GTK_HBOX(gtk_builder_get_object (builder, "Startdate_hbox"));
    w = gnc_date_edit_new (gnc_time (NULL), FALSE, FALSE);
    gr->gde_start = w;
    gtk_box_pack_start (GTK_BOX (hb), w, TRUE, TRUE, 0);
    gtk_widget_show (w);

    gtk_widget_set_no_show_all(GTK_WIDGET(gr->gde_start), TRUE);
    gr->gcb_period = GTK_COMBO_BOX(gtk_builder_get_object (builder, "GCB_PeriodType"));
    gr->gsb_mult = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "GSB_Mult"));
    gr->gcb_eom = GTK_CHECK_BUTTON(gtk_builder_get_object (builder, "GCB_EndOfMonth"));
    gr->nth_weekday = GTK_CHECK_BUTTON(gtk_builder_get_object (builder, "GCB_NthWeekday"));
    gtk_widget_set_no_show_all(GTK_WIDGET(gr->gcb_eom), TRUE);
    gtk_widget_set_no_show_all(GTK_WIDGET(gr->nth_weekday), TRUE);

    gtk_container_add( GTK_CONTAINER(&gr->widget), GTK_WIDGET(vb) );

    gnc_recurrence_set(gr, &gr->recurrence);
    something_changed( GTK_WIDGET(gr), gr);

    /* Setup the signals */
    g_signal_connect( G_OBJECT(gr->gde_start), "date_changed",
                      G_CALLBACK(something_changed), gr );
    g_signal_connect( G_OBJECT(gr->gcb_period), "changed",
                      G_CALLBACK(something_changed), gr );
    g_signal_connect( G_OBJECT(gr->gsb_mult), "value-changed",
                      G_CALLBACK(something_changed), gr );
    g_signal_connect( G_OBJECT(gr->gcb_eom), "toggled",
                      G_CALLBACK(something_changed), gr );
    g_signal_connect( G_OBJECT(gr->nth_weekday), "toggled",
                      G_CALLBACK(something_changed), gr );

    gtk_widget_show_all( GTK_WIDGET(&gr->widget) );

    gtk_builder_connect_signals(builder, gr);
    g_object_unref(G_OBJECT(builder));
}
GtkHBox * gw_notebook_managment_get_combo_box_categories ( GtkWindow *w)
{
	GtkHBox *hbox = NULL;


#ifdef GW_DEBUG_GUI_COMPONENT
	g_print ( "*** GW - %s (%d) :: %s()\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
#endif

	if ( w != NULL )
	{
		hbox = GTK_HBOX ( gtk_object_get_data ( GTK_OBJECT ( w), REF_GW_GUI_NOTEBOOK_MANAGMENT_COMBO_BOX_CATEGORY));
	}

	return hbox;
}
Beispiel #9
0
static void
ol_osd_toolbar_init (OlOsdToolbar *toolbar)
{
  OlOsdToolbarPriv *priv = OL_OSD_TOOLBAR_GET_PRIVATE (toolbar);
  gtk_alignment_set (GTK_ALIGNMENT (toolbar), 0.5, 0.5, 0.0, 0.0);
  toolbar->center_box = GTK_HBOX (gtk_hbox_new (FALSE, 0));
  gtk_container_add (GTK_CONTAINER (toolbar), GTK_WIDGET (toolbar->center_box));
  
  toolbar->prev_button = _add_button (toolbar, &btn_spec[BTN_PREV]);
  toolbar->play_button = _add_button (toolbar, &btn_spec[BTN_PLAY]);
  toolbar->pause_button = _add_button (toolbar, &btn_spec[BTN_PAUSE]);
  toolbar->stop_button = _add_button (toolbar, &btn_spec[BTN_STOP]);
  toolbar->next_button = _add_button (toolbar, &btn_spec[BTN_NEXT]);

  priv->player = NULL;
  _update_status (toolbar);
  _update_caps (toolbar);
}
Beispiel #10
0
RadioHBox RadioHBox_new(StringArrayRange names)
{
  GtkHBox* hbox = GTK_HBOX(gtk_hbox_new(TRUE, 4));
  gtk_widget_show(GTK_WIDGET(hbox));

  GSList* group = 0;
  GtkRadioButton* radio = 0;
  for(StringArrayRange::Iterator i = names.begin; i != names.end; ++i)
  {
    radio = GTK_RADIO_BUTTON(gtk_radio_button_new_with_label(group, *i));
    gtk_widget_show(GTK_WIDGET(radio));
    gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(radio), FALSE, FALSE, 0);

    group = gtk_radio_button_get_group(radio);
  }

  return RadioHBox(hbox, radio);
}
Beispiel #11
0
void gui_init     (dt_iop_module_t *self)
{
  self->gui_data = malloc(sizeof(dt_iop_hotpixels_gui_data_t));
  dt_iop_hotpixels_gui_data_t *g = (dt_iop_hotpixels_gui_data_t*)self->gui_data;
  dt_iop_hotpixels_params_t *p = (dt_iop_hotpixels_params_t*)self->params;
  g->pixels_fixed = -1;

  self->widget = gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE);
  g_signal_connect(G_OBJECT(self->widget), "expose-event", G_CALLBACK(expose), self);

  /* threshold */
  g->threshold = dt_bauhaus_slider_new_with_range(self, 0.0, 1.0, 0.005, p->threshold, 4);
  dt_bauhaus_slider_set_format(g->threshold,"%.4f");
  dt_bauhaus_widget_set_label(g->threshold,_("threshold"));
  g_object_set(G_OBJECT(g->threshold), "tooltip-text", _("lower threshold for hot pixel"), NULL);
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->threshold), TRUE, TRUE, 0);
  g_signal_connect(G_OBJECT (g->threshold), "value-changed", G_CALLBACK (threshold_callback), self);

  /* strength */
  g->strength = dt_bauhaus_slider_new_with_range(self, 0.0, 1.0, 0.01, p->strength, 4);
  dt_bauhaus_slider_set_format(g->threshold,"%.4f");
  dt_bauhaus_widget_set_label(g->strength,_("strength"));
  g_object_set(G_OBJECT(g->strength), "tooltip-text", _("strength of hot pixel correction"), NULL);
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->strength), TRUE, TRUE, 0);
  g_signal_connect(G_OBJECT (g->strength), "value-changed", G_CALLBACK (strength_callback), self);

  /* 3 neighbours */
  g->permissive  = GTK_TOGGLE_BUTTON(gtk_check_button_new_with_label(_("detect by 3 neighbours")));
  gtk_toggle_button_set_active(g->permissive, p->permissive);
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->permissive), TRUE, TRUE, 0);
  g_signal_connect(G_OBJECT(g->permissive), "toggled", G_CALLBACK(permissive_callback), self);


  GtkHBox *hbox1 = GTK_HBOX(gtk_hbox_new(FALSE, 0));
  g->markfixed  = GTK_TOGGLE_BUTTON(gtk_check_button_new_with_label(_("mark fixed pixels")));
  gtk_toggle_button_set_active(g->markfixed, p->markfixed);
  gtk_box_pack_start(GTK_BOX(hbox1), GTK_WIDGET(g->markfixed), TRUE, TRUE, 0);
  g_signal_connect(G_OBJECT(g->markfixed), "toggled", G_CALLBACK(markfixed_callback), self);

  g->message = GTK_LABEL(gtk_label_new ("")); // This gets filled in by process
  gtk_box_pack_start(GTK_BOX(hbox1), GTK_WIDGET(g->message), TRUE, TRUE, 0);

  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(hbox1), TRUE, TRUE, 0);
}
static void roccat_single_cpi_selector_init(RoccatSingleCpiSelector *selector) {
	RoccatSingleCpiSelectorPrivate *priv = ROCCAT_SINGLE_CPI_SELECTOR_GET_PRIVATE(selector);
	GtkHBox *hbox;

	selector->priv = priv;

	hbox = GTK_HBOX(gtk_hbox_new(FALSE, 0));
	gtk_container_add(GTK_CONTAINER(selector), GTK_WIDGET(hbox));

	priv->radio = GTK_RADIO_BUTTON(gtk_radio_button_new(NULL));
	gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(priv->radio), FALSE, FALSE, 0);
	g_signal_connect(G_OBJECT(priv->radio), "toggled", G_CALLBACK(click_radio_cb), selector);

	priv->active = GTK_CHECK_BUTTON(gtk_check_button_new());
	gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(priv->active), FALSE, FALSE, 0);
	g_signal_connect(G_OBJECT(priv->active), "toggled", G_CALLBACK(toggle_active_cb), selector);

	priv->scale = GAMINGGEAR_HSCALE(gaminggear_hscale_new_with_range(0, 1, 1));
	gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(priv->scale), TRUE, TRUE, 0);
}
Beispiel #13
0
static void			on_link_button_released (void)
{
	osso_uri_open ("http://www.flickr.com/auth-21684", NULL, NULL);
	return;
}

static gboolean                 private_init (NFlickWelcomeVBox *self, NFlickWelcomeVBoxPrivate *private)
{
        g_return_val_if_fail (NFLICK_IS_WELCOME_VBOX (self), FALSE);
        g_return_val_if_fail (private != NULL, FALSE);

        gtk_box_set_spacing (GTK_BOX (self), 16);

        /* Create the main upper hbox container */
        GtkHBox *upper_hbox = GTK_HBOX (gtk_hbox_new (FALSE, 16));
        g_return_val_if_fail (upper_hbox != NULL, FALSE);
        gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (upper_hbox));

        /* Flickr logo */
        GtkImage *flickr_logo = GTK_IMAGE (gtk_image_new_from_pixbuf (NFLICK_MODEL_FLICKR_LOGO));
        g_return_val_if_fail (flickr_logo != NULL, FALSE);
        gtk_box_pack_start (GTK_BOX (upper_hbox), GTK_WIDGET (flickr_logo), FALSE, FALSE, 0);

        /* Right vbox */
        GtkVBox *right_vbox = GTK_VBOX (gtk_vbox_new (FALSE, 2));
        g_return_val_if_fail (right_vbox != NULL, FALSE);
        gtk_container_add (GTK_CONTAINER (upper_hbox), GTK_WIDGET (right_vbox));

        /* Introductionary label markup */
        gchar *msg_markup = gettext ("Welcome to NFlick!\n\n" 
Beispiel #14
0
void
app_new(int argc, char *argv[], const char *geometry_string)
{
	GtkWidget *vbox;
	GtkWidget *widget;
	GtkWidget *vpane;
	GtkWidget *separator;
	GtkLabel *filler;
	GtkHBox *labels;
	GtkVBox *status_vbox;
	GtkStatusbar *grip;

	app_window = gnome_app_new(GTT_APP_NAME, GTT_APP_TITLE " " VERSION);
	gtk_window_set_wmclass(GTK_WINDOW(app_window),
	                         GTT_APP_NAME, GTT_APP_PROPER_NAME);

	/* 485 x 272 seems to be a good size to default to */
	gtk_window_set_default_size(GTK_WINDOW(app_window), 485, 272);
	gtk_window_set_resizable (GTK_WINDOW(app_window), TRUE);

	/* build menus */
	menus_create(GNOME_APP(app_window));

	/* build toolbar */
	widget = build_toolbar();
	gtk_widget_show(widget);
	gnome_app_set_toolbar(GNOME_APP(app_window), GTK_TOOLBAR(widget));

	/* container holds status bar, main ctree widget */
	vbox = gtk_vbox_new(FALSE, 0);

	/* build statusbar */

	status_vbox = GTK_VBOX(gtk_vbox_new(FALSE, 0));
	gtk_widget_show(GTK_WIDGET(status_vbox));

	labels = GTK_HBOX(gtk_hbox_new(FALSE, 0));
	gtk_widget_show(GTK_WIDGET(labels));

	status_bar = gtk_hbox_new(FALSE, 0);
	gtk_widget_show(status_bar);
	separator = gtk_hseparator_new();
	gtk_widget_show(separator);
	gtk_box_pack_start(GTK_BOX(status_vbox), separator, FALSE, FALSE, 0);
	gtk_box_pack_start(GTK_BOX(status_vbox), GTK_WIDGET (labels), TRUE, TRUE, 0);
	gtk_box_pack_start(GTK_BOX(status_bar), GTK_WIDGET (status_vbox), TRUE, TRUE, 0);

	grip = GTK_STATUSBAR(gtk_statusbar_new());
	gtk_statusbar_set_has_resize_grip(grip, TRUE);
	gtk_widget_show(GTK_WIDGET(grip));
	gtk_box_pack_start(GTK_BOX(status_bar), GTK_WIDGET(grip), FALSE, FALSE, 0);

	/* put elapsed time into statusbar */
	status_day_time = GTK_LABEL(gtk_label_new(_("00:00")));
	gtk_widget_show(GTK_WIDGET(status_day_time));

	gtk_box_pack_start(GTK_BOX(labels), GTK_WIDGET(status_day_time),
	                     FALSE, TRUE, 0);

	/* put project name into statusbar */
	status_project = GTK_LABEL(gtk_label_new( _("Timer is not running")));
	gtk_widget_show(GTK_WIDGET(status_project));

	gtk_box_pack_start(GTK_BOX(labels), GTK_WIDGET(status_project),
	                     FALSE, TRUE, 10);

	filler = GTK_LABEL(gtk_label_new(""));
	gtk_widget_show(GTK_WIDGET(filler));
	gtk_box_pack_start(GTK_BOX(labels), GTK_WIDGET(filler), TRUE, TRUE, 1);

	/* put timer icon into statusbar */
	status_timer = gtk_image_new_from_stock (GNOME_STOCK_TIMER,
	                                           GTK_ICON_SIZE_MENU);
	gtk_widget_show(status_timer);
	gtk_box_pack_end(GTK_BOX(status_bar), GTK_WIDGET(status_timer),
	                   FALSE, FALSE, 1);

	/* create the main columned tree for showing projects */
	projects_tree = gtt_projects_tree_new ();

	g_signal_connect (projects_tree, "columns-setup-done", G_CALLBACK (projects_tree_columns_setup_done), NULL);

	gtk_tree_view_set_reorderable (GTK_TREE_VIEW (projects_tree), TRUE);

	g_signal_connect (projects_tree, "row-activated", G_CALLBACK (projects_tree_row_activated), NULL);

	/* create the notes area */
	global_na = notes_area_new();
	vpane = notes_area_get_widget (global_na);

	/* Need to reparent, to get rid of glade parent-window hack.
	 * But gtk_widget_reparent (vpane); causes  a "Gtk-CRITICAL"
	 * to occur.  So we need a fancier move.
	 */
	gtk_widget_ref (vpane);
	gtk_container_remove(GTK_CONTAINER(vpane->parent), vpane);
	gtk_box_pack_start(GTK_BOX(vbox), vpane, TRUE, TRUE, 0);
	gtk_widget_unref (vpane);

	gtk_box_pack_end(GTK_BOX(vbox), status_bar, FALSE, FALSE, 2);

	notes_area_add_projects_tree (global_na, projects_tree);

	/* we are done building it, make it visible */
	gtk_widget_show(vbox);
	gnome_app_set_contents(GNOME_APP(app_window), vbox);

	gtt_status_icon_create();
	if (!geometry_string) return;

	if (gtk_window_parse_geometry(GTK_WINDOW(app_window),geometry_string))
	{
		geom_size_override=TRUE;
	}
	else
	{
		gnome_app_error(GNOME_APP(app_window),
			_("Couldn't understand geometry (position and size)\n"
			  " specified on command line"));
	}
}
Beispiel #15
0
void gui_init(struct dt_iop_module_t *self)
{
  self->gui_data = malloc(sizeof(dt_iop_exposure_gui_data_t));
  dt_iop_exposure_gui_data_t *g = (dt_iop_exposure_gui_data_t *)self->gui_data;
  dt_iop_exposure_params_t *p = (dt_iop_exposure_params_t *)self->params;

  /* register hooks with current dev so that  histogram 
     can interact with this module.
   */
  darktable.develop->proxy.exposure.module = self;
  darktable.develop->proxy.exposure.set_white = dt_iop_exposure_set_white;
  darktable.develop->proxy.exposure.get_white = dt_iop_exposure_get_white;
  darktable.develop->proxy.exposure.set_black = dt_iop_exposure_set_black;
  darktable.develop->proxy.exposure.get_black = dt_iop_exposure_get_black;

  self->request_color_pick = 0;

  self->widget = GTK_WIDGET(gtk_hbox_new(FALSE, 0));
  g->vbox2 = GTK_VBOX(gtk_vbox_new(TRUE, DT_GUI_IOP_MODULE_CONTROL_SPACING));
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->vbox2), TRUE, TRUE, 5);

  g->black = DTGTK_SLIDER(dtgtk_slider_new_with_range( DARKTABLE_SLIDER_BAR, -0.1, 0.1, .001, p->black, 3));
  g_object_set(G_OBJECT(g->black), "tooltip-text", _("adjust the black level"), (char *)NULL);
  dtgtk_slider_set_label(g->black,_("black"));

  g->exposure = DTGTK_SLIDER(dtgtk_slider_new_with_range( DARKTABLE_SLIDER_BAR, -9.0, 9.0, .02, p->exposure, 3));
  g_object_set(G_OBJECT(g->exposure), "tooltip-text", _("adjust the exposure correction"), (char *)NULL);
  dtgtk_slider_set_label(g->exposure,_("exposure"));
  dtgtk_slider_set_unit(g->exposure,"EV");

  gtk_box_pack_start(GTK_BOX(g->vbox2), GTK_WIDGET(g->black), TRUE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX(g->vbox2), GTK_WIDGET(g->exposure), TRUE, TRUE, 0);

  g->autoexp  = GTK_CHECK_BUTTON(gtk_check_button_new_with_label(_("auto")));
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->autoexp), FALSE);
  g->autoexpp = DTGTK_SLIDER(dtgtk_slider_new_with_range(DARKTABLE_SLIDER_BAR,0.0, 0.2, .001, 0.01,3));
  g_object_set(G_OBJECT(g->autoexpp), "tooltip-text", _("percentage of bright values clipped out"), (char *)NULL);
  gtk_widget_set_sensitive(GTK_WIDGET(g->autoexpp), FALSE);

  GtkHBox *hbox = GTK_HBOX(gtk_hbox_new(FALSE, 0));
  gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(g->autoexp), TRUE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(g->autoexpp), TRUE, TRUE, 0);

  gtk_box_pack_start(GTK_BOX(g->vbox2), GTK_WIDGET(hbox), TRUE, TRUE, 0);

  darktable.gui->reset = 1;
  self->gui_update(self);
  darktable.gui->reset = 0;

  g_signal_connect (G_OBJECT (g->black), "value-changed",
                    G_CALLBACK (black_callback), self);
  g_signal_connect (G_OBJECT (g->exposure), "value-changed",
                    G_CALLBACK (exposure_callback), self);
  // g_signal_connect (G_OBJECT (g->scale3), "value-changed",
  // G_CALLBACK (gain_callback), self);
  g_signal_connect (G_OBJECT (g->autoexpp), "value-changed",
                    G_CALLBACK (autoexpp_callback), self);
  g_signal_connect (G_OBJECT (g->autoexp), "toggled",
                    G_CALLBACK (autoexp_callback), self);
  g_signal_connect (G_OBJECT(self->widget), "expose-event",
                    G_CALLBACK(expose), self);
}
Beispiel #16
0
static void gui_get_objects(GtkBuilder *builder)
{
	// Window
	gui.window = GTK_WINDOW(gui_get_object(builder,
		"window"));

	// Menus
	gui.menuitem_file = GTK_MENU_ITEM(gui_get_object(builder,
		"menuitem_file"));
	gui.menuitem_save_as = GTK_MENU_ITEM(gui_get_object(builder,
		"menuitem_save_as"));
	gui.menuitem_quit = GTK_MENU_ITEM(gui_get_object(builder,
		"menuitem_quit"));
	gui.menuitem_edit = GTK_MENU_ITEM(gui_get_object(builder,
		"menuitem_edit"));
	gui.menuitem_cut = GTK_MENU_ITEM(gui_get_object(builder,
		"menuitem_cut"));
	gui.menuitem_copy = GTK_MENU_ITEM(gui_get_object(builder,
		"menuitem_copy"));
	gui.menuitem_paste = GTK_MENU_ITEM(gui_get_object(builder,
		"menuitem_paste"));
	gui.menuitem_delete = GTK_MENU_ITEM(gui_get_object(builder,
		"menuitem_delete"));
	gui.menuitem_select_all = GTK_MENU_ITEM(gui_get_object(builder,
		"menuitem_select_all"));
	gui.menuitem_prefs = GTK_MENU_ITEM(gui_get_object(builder,
		"menuitem_prefs"));
	gui.menuitem_about = GTK_MENU_ITEM(gui_get_object(builder,
		"menuitem_about"));
	gui.radiomenuitem_file = GTK_RADIO_MENU_ITEM(gui_get_object(builder,
		"radiomenuitem_file"));
	gui.radiomenuitem_text = GTK_RADIO_MENU_ITEM(gui_get_object(builder,
		"radiomenuitem_text"));
	gui.radiomenuitem_file_list = GTK_RADIO_MENU_ITEM(gui_get_object(builder,
		"radiomenuitem_file_list"));

	// Toolbar
	gui.toolbar = GTK_TOOLBAR(gui_get_object(builder,
		"toolbar"));
	gui.toolbutton_add = GTK_TOOL_BUTTON(gui_get_object(builder,
		"toolbutton_add"));
	gui.toolbutton_remove = GTK_TOOL_BUTTON(gui_get_object(builder,
		"toolbutton_remove"));
	gui.toolbutton_clear = GTK_TOOL_BUTTON(gui_get_object(builder,
		"toolbutton_clear"));

	// Containers
	gui.vbox_single = GTK_VBOX(gui_get_object(builder,
		"vbox_single"));
	gui.vbox_list = GTK_VBOX(gui_get_object(builder,
		"vbox_list"));
	gui.hbox_input = GTK_HBOX(gui_get_object(builder,
		"hbox_input"));
	gui.hbox_output = GTK_HBOX(gui_get_object(builder,
		"hbox_output"));
	gui.vbox_outputlabels = GTK_VBOX(gui_get_object(builder,
		"vbox_outputlabels"));
	gui.vbox_digests_file = GTK_VBOX(gui_get_object(builder,
		"vbox_digests_file"));
	gui.vbox_digests_text = GTK_VBOX(gui_get_object(builder,
		"vbox_digests_text"));

	// Inputs
	gui.entry = GTK_ENTRY(gui_get_object(builder,
		"entry"));
	gui.filechooserbutton = GTK_FILE_CHOOSER_BUTTON(gui_get_object(builder,
		"filechooserbutton"));

	// Labels
	gui.label_text = GTK_LABEL(gui_get_object(builder,
		"label_text"));
	gui.label_file = GTK_LABEL(gui_get_object(builder,
		"label_file"));

	// Tree View
	gui.treeview = GTK_TREE_VIEW(gui_get_object(builder,
		"treeview"));
	gui.treeselection = GTK_TREE_SELECTION(gui_get_object(builder,
		"treeselection"));
	gui.menu_treeview = GTK_MENU(gui_get_object(builder,
		"menu_treeview"));
	gui.menuitem_treeview_add = GTK_MENU_ITEM(gui_get_object(builder,
		"menuitem_treeview_add"));
	gui.menuitem_treeview_remove = GTK_MENU_ITEM(gui_get_object(builder,
		"menuitem_treeview_remove"));
	gui.menuitem_treeview_clear = GTK_MENU_ITEM(gui_get_object(builder,
		"menuitem_treeview_clear"));
	gui.menu_treeview_copy = GTK_MENU(gui_get_object(builder,
		"menu_treeview_copy"));
	gui.menuitem_treeview_copy = GTK_MENU_ITEM(gui_get_object(builder,
		"menuitem_treeview_copy"));
	gui.menuitem_treeview_show_toolbar = GTK_MENU_ITEM(gui_get_object(builder,
		"menuitem_treeview_show_toolbar"));

	// Buttons
	gui.hseparator_buttons = GTK_HSEPARATOR(gui_get_object(builder,
		"hseparator_buttons"));
	gui.button_hash = GTK_BUTTON(gui_get_object(builder,
		"button_hash"));
	gui.button_stop = GTK_BUTTON(gui_get_object(builder,
		"button_stop"));

	// Progress Bar
	gui.progressbar = GTK_PROGRESS_BAR(gui_get_object(builder,
		"progressbar"));

	// Dialog
	gui.dialog = GTK_DIALOG(gui_get_object(builder,
		"dialog"));
	gui.dialog_table = GTK_TABLE(gui_get_object(builder,
		"dialog_table"));
	gui.dialog_combobox = GTK_COMBO_BOX(gui_get_object(builder,
		"dialog_combobox"));
	gui.dialog_button_close = GTK_BUTTON(gui_get_object(builder,
		"dialog_button_close"));
}
Beispiel #17
0
FormatDialog*
format_dialog_new(void)
{
	FormatDialog *dialog;
	dialog = g_new0 (FormatDialog, 1);
	const char* xmlpath = GLADEDIR "/gformat.glade";
        
	dialog->xml = glade_xml_new (xmlpath, "toplevel", NULL);
	
	
        /* Try uninstalled next */
	if (!dialog->xml) {
		xmlpath = "./gformat.glade";
		dialog->xml = glade_xml_new (xmlpath, "toplevel", NULL);
	}

	if (dialog->xml == NULL){
		GtkWidget *f_dialog;
		f_dialog = gtk_message_dialog_new (NULL, 0,
				GTK_MESSAGE_ERROR,
				GTK_BUTTONS_OK,
				"Glade file for the format program is missing.\n"
				"Please check your installation of gnome-utils");
		gtk_dialog_run (GTK_DIALOG (f_dialog));
		gtk_widget_destroy (f_dialog);
		exit (1);
	} 

	/* Grab some widgets */
	dialog->toplevel = glade_xml_get_widget (dialog->xml, "toplevel");
	dialog->volume_combo = GTK_COMBO_BOX(glade_xml_get_widget(dialog->xml, "volume_combo"));
	dialog->show_partitions = GTK_TOGGLE_BUTTON(glade_xml_get_widget(dialog->xml, "show_partitions"));
	dialog->fs_combo = GTK_COMBO_BOX(glade_xml_get_widget(dialog->xml, "fs_combo"));
	dialog->extra_volume_info = GTK_LABEL(glade_xml_get_widget(dialog->xml, "extra_volume_info"));
	dialog->extra_volume_hbox = GTK_HBOX(glade_xml_get_widget(dialog->xml, "extra_volume_hbox"));
	dialog->progress_bar = GTK_PROGRESS_BAR(glade_xml_get_widget(dialog->xml, "progress_bar"));
	dialog->format_button = GTK_BUTTON(glade_xml_get_widget(dialog->xml, "format_button"));
	dialog->cancel_button = GTK_BUTTON(glade_xml_get_widget(dialog->xml, "cancel_button"));
	dialog->luks_subwindow = GTK_BOX(glade_xml_get_widget (dialog->xml, "luks_subwindow"));
	dialog->floppy_subwindow = GTK_BOX(glade_xml_get_widget (dialog->xml, "floppy_subwindow"));
	g_assert(dialog->toplevel != NULL);

	/* Get a HAL context; if we can't, bail */
	dialog->hal_context = libhal_context_alloc();

	glade_xml_signal_autoconnect(dialog->xml);
	g_object_set_data(G_OBJECT(dialog->toplevel), "userdata", dialog);

	/* Set stuff in the dialog up */
	setup_volume_treeview(dialog);	
	setup_filesystem_menu(dialog);

	gtk_widget_show_all (dialog->toplevel);
	update_dialog(dialog);

	/* We do this here so they at least see the window before we die */
	if( !dialog->hal_context ) {
		show_error_dialog(dialog->toplevel, 
				_("Cannot get list of disks"), 
				_("Make sure the HAL daemon is running and configured correctly"));
		return NULL;
	}

	/* Get the HAL version and register the HAL device callbacks */
	get_hal_version(dialog);
	g_debug("Registering callback!");
	libhal_ctx_set_user_data(dialog->hal_context, dialog);
	if (libhal_ctx_set_device_added(dialog->hal_context, on_libhal_device_added_removed) == TRUE)
                printf("libhal_ctx_set_device_added called");
	libhal_ctx_set_device_removed(dialog->hal_context, on_libhal_device_added_removed);
	libhal_ctx_set_device_property_modified(dialog->hal_context, on_libhal_prop_modified);
	libhal_ctx_set_device_new_capability(dialog->hal_context, NULL);
	libhal_ctx_set_device_lost_capability(dialog->hal_context, NULL);
	libhal_ctx_set_device_condition(dialog->hal_context, NULL);

	return dialog;
}
Beispiel #18
0
 HBox::HBox(bool homogenous, int spacing) : HBox(GTK_HBOX(gtk_hbox_new(homogenous, spacing)))
 {}
IRC_Client_GUI_MessageHandler::IRC_Client_GUI_MessageHandler (Common_UI_GTKState* GTKState_in,
                                                              IRC_Client_GUI_Connection* connection_in,
                                                              RPG_Net_Protocol_IIRCControl* controller_in,
                                                              const std::string& id_in,
                                                              const std::string& UIFileDirectory_in,
                                                              GtkNotebook* parent_in)
 : CBData_ ()
 , displayQueue_ ()
 , lock_ ()
 , eventSourceID_ (0)
 , isFirstMemberListMsg_ (true)
 , parent_ (parent_in)
 , view_ (NULL)
{
  RPG_TRACE (ACE_TEXT ("IRC_Client_GUI_MessageHandler::IRC_Client_GUI_MessageHandler"));

  // sanity check(s)
  ACE_ASSERT (GTKState_in);
  ACE_ASSERT(connection_in);
  ACE_ASSERT(controller_in);
  ACE_ASSERT (!id_in.empty ());
  if (!Common_File_Tools::isDirectory (UIFileDirectory_in))
  {
    ACE_DEBUG ((LM_ERROR,
                ACE_TEXT ("invalid argument (was: \"%s\"): not a directory, returning\n"),
                ACE_TEXT (UIFileDirectory_in.c_str ())));
    return;
  } // end IF
  ACE_ASSERT (parent_in);

  // initialize cb data
  CBData_.GTKState = GTKState_in;
  CBData_.connection = connection_in;
  CBData_.id = id_in;
  CBData_.controller = controller_in;
  CBData_.channelModes = 0;

  // create new GtkBuilder
  GtkBuilder* builder_p = gtk_builder_new ();
  if (!builder_p)
  {
    ACE_DEBUG ((LM_CRITICAL,
                ACE_TEXT ("failed to allocate memory: \"%m\", returning\n")));
    return;
  } // end IF
  std::string ui_definition_filename = UIFileDirectory_in;
  ui_definition_filename += ACE_DIRECTORY_SEPARATOR_CHAR_A;
  ui_definition_filename += IRC_CLIENT_GUI_DEF_UI_CHANNEL_TAB_FILE;
  if (!Common_File_Tools::isReadable (ui_definition_filename))
  {
    ACE_DEBUG ((LM_ERROR,
                ACE_TEXT ("invalid UI file (was: \"%s\"): not readable, returning\n"),
                ACE_TEXT (ui_definition_filename.c_str ())));

    // clean up
    g_object_unref (G_OBJECT (builder_p));

    return;
  } // end IF

  // load widget tree
  GError* error = NULL;
  gtk_builder_add_from_file (builder_p,
                             ui_definition_filename.c_str (),
                             &error);
  if (error)
  {
    ACE_DEBUG ((LM_ERROR,
                ACE_TEXT ("failed to gtk_builder_add_from_file(\"%s\"): \"%s\", aborting\n"),
                ACE_TEXT (ui_definition_filename.c_str ()),
                ACE_TEXT (error->message)));

    // clean up
    g_error_free (error);
    g_object_unref (G_OBJECT (builder_p));

    return;
  } // end IF

  // setup auto-scrolling in textview
  view_ =
      GTK_TEXT_VIEW (gtk_builder_get_object (builder_p,
                                             ACE_TEXT_ALWAYS_CHAR ("channel_tab_textview")));
  ACE_ASSERT (view_);
  GtkTextIter iter;
  gtk_text_buffer_get_end_iter (gtk_text_view_get_buffer (view_),
                                &iter);
  gtk_text_buffer_create_mark (gtk_text_view_get_buffer (view_),
                               ACE_TEXT_ALWAYS_CHAR ("scroll"),
                               &iter,
                               TRUE);

  // enable multi-selection in treeview
  GtkTreeView* tree_view_p =
    GTK_TREE_VIEW (gtk_builder_get_object (builder_p,
                                           ACE_TEXT_ALWAYS_CHAR ("channel_tab_treeview")));
  ACE_ASSERT (tree_view_p);
  GtkTreeSelection* tree_selection_p =
    gtk_tree_view_get_selection (tree_view_p);
  ACE_ASSERT (tree_selection_p);
  gtk_tree_selection_set_mode (tree_selection_p,
                               GTK_SELECTION_MULTIPLE);

  // add the invite_channel_members_menu to the "Invite" menu item
  GtkMenu* menu_p =
    GTK_MENU (gtk_builder_get_object (builder_p,
                                      ACE_TEXT_ALWAYS_CHAR ("invite_channel_members_menu")));
  ACE_ASSERT (menu_p);
  GtkMenuItem* menu_item_p =
    GTK_MENU_ITEM (gtk_builder_get_object (builder_p,
                                           ACE_TEXT_ALWAYS_CHAR ("menuitem_invite")));
  ACE_ASSERT (menu_item_p);
  gtk_menu_item_set_submenu (menu_item_p, GTK_WIDGET (menu_p));

  // connect signal(s)
  GtkButton* button_p =
    GTK_BUTTON (gtk_builder_get_object (builder_p,
                                        ACE_TEXT_ALWAYS_CHAR ("channel_tab_label_button")));
  ACE_ASSERT (button_p);
  g_signal_connect (button_p,
                    ACE_TEXT_ALWAYS_CHAR ("clicked"),
                    G_CALLBACK (part_clicked_cb),
                    &CBData_);
  // toggle buttons
  GtkToggleButton* toggle_button_p =
    GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder_p,
                                               ACE_TEXT_ALWAYS_CHAR ("mode_key_toggle_button_p")));
  ACE_ASSERT (toggle_button_p);
  g_signal_connect (toggle_button_p,
                    ACE_TEXT_ALWAYS_CHAR ("toggled"),
                    G_CALLBACK (channel_mode_toggled_cb),
                    &CBData_);
  toggle_button_p =
    GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder_p,
                                               ACE_TEXT_ALWAYS_CHAR ("mode_voice_toggle_button_p")));
  ACE_ASSERT (toggle_button_p);
  g_signal_connect (toggle_button_p,
                    ACE_TEXT_ALWAYS_CHAR ("toggled"),
                    G_CALLBACK (channel_mode_toggled_cb),
                    &CBData_);
  toggle_button_p =
    GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder_p,
                                               ACE_TEXT_ALWAYS_CHAR ("mode_ban_toggle_button_p")));
  ACE_ASSERT (toggle_button_p);
  g_signal_connect (toggle_button_p,
                    ACE_TEXT_ALWAYS_CHAR ("toggled"),
                    G_CALLBACK (channel_mode_toggled_cb),
                    &CBData_);
  toggle_button_p =
    GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder_p,
                                               ACE_TEXT_ALWAYS_CHAR ("mode_userlimit_toggle_button_p")));
  ACE_ASSERT (toggle_button_p);
  g_signal_connect (toggle_button_p,
                    ACE_TEXT_ALWAYS_CHAR ("toggled"),
                    G_CALLBACK (channel_mode_toggled_cb),
                    &CBData_);
  toggle_button_p =
    GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder_p,
                                               ACE_TEXT_ALWAYS_CHAR ("mode_moderated_toggle_button_p")));
  ACE_ASSERT (toggle_button_p);
  g_signal_connect (toggle_button_p,
                    ACE_TEXT_ALWAYS_CHAR ("toggled"),
                    G_CALLBACK (channel_mode_toggled_cb),
                    &CBData_);
  toggle_button_p =
    GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder_p,
                                               ACE_TEXT_ALWAYS_CHAR ("mode_blockforeign_toggle_button_p")));
  ACE_ASSERT (toggle_button_p);
  g_signal_connect (toggle_button_p,
                    ACE_TEXT_ALWAYS_CHAR ("toggled"),
                    G_CALLBACK (channel_mode_toggled_cb),
                    &CBData_);
  toggle_button_p =
    GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder_p,
                                               ACE_TEXT_ALWAYS_CHAR ("mode_restricttopic_toggle_button_p")));
  ACE_ASSERT (toggle_button_p);
  g_signal_connect (toggle_button_p,
                    ACE_TEXT_ALWAYS_CHAR ("toggled"),
                    G_CALLBACK (channel_mode_toggled_cb),
                    &CBData_);
  toggle_button_p =
    GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder_p,
                                               ACE_TEXT_ALWAYS_CHAR ("mode_inviteonly_toggle_button_p")));
  ACE_ASSERT (toggle_button_p);
  g_signal_connect (toggle_button_p,
                    ACE_TEXT_ALWAYS_CHAR ("toggled"),
                    G_CALLBACK (channel_mode_toggled_cb),
                    &CBData_);
  toggle_button_p =
    GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder_p,
                                               ACE_TEXT_ALWAYS_CHAR ("mode_secret_toggle_button_p")));
  ACE_ASSERT (toggle_button_p);
  g_signal_connect (toggle_button_p,
                    ACE_TEXT_ALWAYS_CHAR ("toggled"),
                    G_CALLBACK (channel_mode_toggled_cb),
                    &CBData_);
  toggle_button_p =
    GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder_p,
                                               ACE_TEXT_ALWAYS_CHAR ("mode_private_toggle_button_p")));
  ACE_ASSERT (toggle_button_p);
  g_signal_connect (toggle_button_p,
                    ACE_TEXT_ALWAYS_CHAR ("toggled"),
                    G_CALLBACK (channel_mode_toggled_cb),
                    &CBData_);
  toggle_button_p =
    GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder_p,
                                               ACE_TEXT_ALWAYS_CHAR ("mode_operator_toggle_button_p")));
  ACE_ASSERT (toggle_button_p);
  g_signal_connect (toggle_button_p,
                    ACE_TEXT_ALWAYS_CHAR ("toggled"),
                    G_CALLBACK (channel_mode_toggled_cb),
                    &CBData_);
  // topic label
  GtkEventBox* event_box_p =
    GTK_EVENT_BOX (gtk_builder_get_object (builder_p,
                                           ACE_TEXT_ALWAYS_CHAR ("channel_tab_topic_label_eventbox")));
  ACE_ASSERT (event_box_p);
  g_signal_connect (event_box_p,
                    ACE_TEXT_ALWAYS_CHAR ("button-press-event"),
                    G_CALLBACK (topic_clicked_cb),
                    &CBData_);
  // context menu in treeview
  g_signal_connect (tree_view_p,
                    ACE_TEXT_ALWAYS_CHAR ("button-press-event"),
                    G_CALLBACK (members_clicked_cb),
                    &CBData_);
  // actions in treeview
  GtkAction* action_p =
    GTK_ACTION (gtk_builder_get_object (builder_p,
                                        ACE_TEXT_ALWAYS_CHAR ("action_msg")));
  ACE_ASSERT (action_p);
  g_signal_connect (action_p,
                    ACE_TEXT_ALWAYS_CHAR ("activate"),
                    G_CALLBACK (action_msg_cb),
                    &CBData_);
  action_p =
    GTK_ACTION (gtk_builder_get_object (builder_p,
                                        ACE_TEXT_ALWAYS_CHAR ("action_invite")));
  ACE_ASSERT (action_p);
  g_signal_connect (action_p,
                    ACE_TEXT_ALWAYS_CHAR ("activate"),
                    G_CALLBACK (action_invite_cb),
                    &CBData_);
  action_p =
    GTK_ACTION (gtk_builder_get_object (builder_p,
                                        ACE_TEXT_ALWAYS_CHAR ("action_info")));
  ACE_ASSERT (action_p);
  g_signal_connect (action_p,
                    ACE_TEXT_ALWAYS_CHAR ("activate"),
                    G_CALLBACK (action_info_cb),
                    &CBData_);
  action_p =
    GTK_ACTION (gtk_builder_get_object (builder_p,
                                        ACE_TEXT_ALWAYS_CHAR ("action_kick")));
  ACE_ASSERT (action_p);
  g_signal_connect (action_p,
                    ACE_TEXT_ALWAYS_CHAR ("activate"),
                    G_CALLBACK (action_kick_cb),
                    &CBData_);
  action_p =
    GTK_ACTION (gtk_builder_get_object (builder_p,
                                        ACE_TEXT_ALWAYS_CHAR ("action_ban")));
  ACE_ASSERT (action_p);
  g_signal_connect (action_p,
                    ACE_TEXT_ALWAYS_CHAR ("activate"),
                    G_CALLBACK (action_ban_cb),
                    &CBData_);

  // add new channel page to notebook (== server log)
  // retrieve (dummy) parent window
  GtkWindow* window_p =
    GTK_WINDOW (gtk_builder_get_object (builder_p,
                                        ACE_TEXT_ALWAYS_CHAR ("channel_tab_label_template")));
  ACE_ASSERT (window_p);
  // retrieve channel tab label
  GtkHBox* hbox_p =
    GTK_HBOX (gtk_builder_get_object (builder_p,
                                      ACE_TEXT_ALWAYS_CHAR ("channel_tab_label_hbox")));
  ACE_ASSERT (hbox_p);
  g_object_ref (hbox_p);
  gtk_container_remove (GTK_CONTAINER (window_p),
                        GTK_WIDGET (hbox_p));
  // set tab label
  GtkLabel* label_p =
    GTK_LABEL (gtk_builder_get_object (builder_p,
                                       ACE_TEXT_ALWAYS_CHAR ("channel_tab_label")));
  ACE_ASSERT (label_p);
  std::string page_tab_label_string;
  if (!RPG_Net_Protocol_Tools::isValidIRCChannelName (CBData_.id))
  {
    // --> private conversation window, modify label accordingly
    page_tab_label_string = ACE_TEXT_ALWAYS_CHAR ("[");
    page_tab_label_string += CBData_.id;
    page_tab_label_string += ACE_TEXT_ALWAYS_CHAR("]");

    // hide channel mode tab frame
    GtkFrame* frame_p =
      GTK_FRAME (gtk_builder_get_object (builder_p,
                                         ACE_TEXT_ALWAYS_CHAR ("channel_tab_mode_frame")));
    ACE_ASSERT (frame_p);
    gtk_widget_hide (GTK_WIDGET (frame_p));
    // hide channel tab treeview
    tree_view_p =
      GTK_TREE_VIEW (gtk_builder_get_object (builder_p,
                                             ACE_TEXT_ALWAYS_CHAR ("channel_tab_treeview")));
    ACE_ASSERT (tree_view_p);
    gtk_widget_hide (GTK_WIDGET (tree_view_p));

    // erase "topic" label
    label_p =
      GTK_LABEL (gtk_builder_get_object (builder_p,
                                         ACE_TEXT_ALWAYS_CHAR ("channel_tab_topic_label")));
    ACE_ASSERT (label_p);
    gtk_label_set_text (label_p, NULL);
  } // end IF
  else
    page_tab_label_string = CBData_.id;
  gtk_label_set_text (label_p,
                      page_tab_label_string.c_str ());
  // retrieve (dummy) parent window
  window_p =
    GTK_WINDOW (gtk_builder_get_object (builder_p,
                                        ACE_TEXT_ALWAYS_CHAR ("channel_tab_template")));
  ACE_ASSERT (window_p);
  // retrieve channel tab
  GtkVBox* vbox_p =
    GTK_VBOX (gtk_builder_get_object (builder_p,
                                      ACE_TEXT_ALWAYS_CHAR ("channel_tab_vbox")));
  ACE_ASSERT (vbox_p);
  g_object_ref (vbox_p);
  gtk_container_remove (GTK_CONTAINER (window_p),
                        GTK_WIDGET (vbox_p));
  gint page_num = gtk_notebook_append_page (parent_,
                                            GTK_WIDGET (vbox_p),
                                            GTK_WIDGET (hbox_p));
  if (page_num == -1)
  {
    ACE_DEBUG ((LM_ERROR,
                ACE_TEXT ("failed to gtk_notebook_append_page(%@), returning\n"),
                parent_));

    // clean up
    g_object_unref (hbox_p);
    g_object_unref (vbox_p);
    g_object_unref (G_OBJECT (builder_p));

    return;
  } // end IF
  g_object_unref (hbox_p);

  // allow reordering
  gtk_notebook_set_tab_reorderable (parent_,
                                    GTK_WIDGET (vbox_p),
                                    TRUE);
  g_object_unref (vbox_p);

  // activate new page (iff it's a channel tab !)
  if (RPG_Net_Protocol_Tools::isValidIRCChannelName (CBData_.id))
    gtk_notebook_set_current_page (parent_,
                                   page_num);

  builderLabel_ = connection_in->getLabel ();
  builderLabel_ += ACE_TEXT_ALWAYS_CHAR ("::");
  builderLabel_ += page_tab_label_string;
  // synch access
  {
    ACE_Guard<ACE_Thread_Mutex> aGuard (CBData_.GTKState->lock);

    CBData_.GTKState->builders[builderLabel_] =
        std::make_pair (ui_definition_filename, builder_p);
  } // end lock scope
}
Beispiel #20
0
void gui_init(struct dt_iop_module_t *self)
{
  self->gui_data = malloc(sizeof(dt_iop_exposure_gui_data_t));
  dt_iop_exposure_gui_data_t *g = (dt_iop_exposure_gui_data_t *)self->gui_data;
  dt_iop_exposure_params_t *p = (dt_iop_exposure_params_t *)self->params;

  g->modes = NULL;
  g->deflicker_histogram_sources = NULL;

  g->deflicker_histogram = NULL;

  g->reprocess_on_next_expose = FALSE;

  /* register hooks with current dev so that  histogram
     can interact with this module.
   */
  darktable.develop->proxy.exposure.module = self;
  darktable.develop->proxy.exposure.set_white = dt_iop_exposure_set_white;
  darktable.develop->proxy.exposure.get_white = dt_iop_exposure_get_white;
  darktable.develop->proxy.exposure.set_black = dt_iop_exposure_set_black;
  darktable.develop->proxy.exposure.get_black = dt_iop_exposure_get_black;

  self->request_color_pick = DT_REQUEST_COLORPICK_OFF;

  self->widget = GTK_WIDGET(gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE));

  g->mode = dt_bauhaus_combobox_new(self);
  dt_bauhaus_widget_set_label(g->mode, NULL, _("mode"));

  dt_bauhaus_combobox_add(g->mode, C_("mode", "manual"));
  g->modes = g_list_append(g->modes, GUINT_TO_POINTER(EXPOSURE_MODE_MANUAL));

/*
  dt_bauhaus_combobox_add(g->mode, _("automatic"));
  g->modes = g_list_append(g->modes, GUINT_TO_POINTER(EXPOSURE_MODE_DEFLICKER));
*/

  dt_bauhaus_combobox_set_default(g->mode, 0);
  dt_bauhaus_combobox_set(g->mode, g_list_index(g->modes, GUINT_TO_POINTER(p->mode)));

  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->mode), TRUE, TRUE, 0);

  g->black = dt_bauhaus_slider_new_with_range(self, -0.1, 0.1, .001, p->black, 4);
  g_object_set(G_OBJECT(g->black), "tooltip-text", _("adjust the black level"), (char *)NULL);
  dt_bauhaus_slider_set_format(g->black,"%.4f");
  dt_bauhaus_widget_set_label(g->black, NULL, _("black"));
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->black), TRUE, TRUE, 0);

  g->vbox_manual = GTK_WIDGET(gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE));

  g->exposure = dt_bauhaus_slider_new_with_range(self, -3.0, 3.0, .02, p->exposure, 3);
  g_object_set(G_OBJECT(g->exposure), "tooltip-text", _("adjust the exposure correction"), (char *)NULL);
  dt_bauhaus_slider_set_format(g->exposure,"%.2fEV");
  dt_bauhaus_widget_set_label(g->exposure, NULL, _("exposure"));
  dt_bauhaus_slider_enable_soft_boundaries(g->exposure, -18.0, 18.0);
  gtk_box_pack_start(GTK_BOX(g->vbox_manual), GTK_WIDGET(g->exposure), TRUE, TRUE, 0);

  GtkHBox *hbox = GTK_HBOX(gtk_hbox_new(FALSE, 0));

  g->autoexp = GTK_CHECK_BUTTON(gtk_check_button_new_with_label(_("auto")));
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->autoexp), FALSE);
  gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(g->autoexp), FALSE, TRUE, 0);

  g->autoexpp = dt_bauhaus_slider_new_with_range(self, 0.0, 0.2, .001, 0.01,3);
  g_object_set(G_OBJECT(g->autoexpp), "tooltip-text", _("percentage of bright values clipped out"), (char *)NULL);
  gtk_widget_set_sensitive(GTK_WIDGET(g->autoexpp), TRUE);
  gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(g->autoexpp), TRUE, TRUE, 0);

  gtk_box_pack_start(GTK_BOX(g->vbox_manual), GTK_WIDGET(hbox), TRUE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->vbox_manual), TRUE, TRUE, 0);

  g->vbox_deflicker = GTK_WIDGET(gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE));

  g->deflicker_percentile = dt_bauhaus_slider_new_with_range(self, 0, 100, .01, p->deflicker_percentile, 3);
  // FIXME: this needs a better tooltip!
  g_object_set(G_OBJECT(g->deflicker_percentile), "tooltip-text", _("percentile"), (char *)NULL);
  dt_bauhaus_slider_set_format(g->deflicker_percentile,"%.2f%%");
  dt_bauhaus_widget_set_label(g->deflicker_percentile, NULL, _("percentile"));
  gtk_box_pack_start(GTK_BOX(g->vbox_deflicker), GTK_WIDGET(g->deflicker_percentile), TRUE, TRUE, 0);

  g->deflicker_target_level = dt_bauhaus_slider_new_with_range(self, -18.0, 18.0, .01, p->deflicker_target_level, 3);
  g_object_set(G_OBJECT(g->deflicker_target_level), "tooltip-text", _("target level"), (char *)NULL);
  dt_bauhaus_slider_set_format(g->deflicker_target_level,"%.2fEV");
  dt_bauhaus_widget_set_label(g->deflicker_target_level, NULL, _("target level"));
  gtk_box_pack_start(GTK_BOX(g->vbox_deflicker), GTK_WIDGET(g->deflicker_target_level), TRUE, TRUE, 0);

  g->deflicker_histogram_source = dt_bauhaus_combobox_new(self);
  dt_bauhaus_widget_set_label(g->deflicker_histogram_source, NULL, _("histogram of"));

  dt_bauhaus_combobox_add(g->deflicker_histogram_source, _("pre-processed image"));
  g->deflicker_histogram_sources = g_list_append(g->deflicker_histogram_sources, GUINT_TO_POINTER(DEFLICKER_HISTOGRAM_SOURCE_THUMBNAIL));

  dt_bauhaus_combobox_add(g->deflicker_histogram_source, _("source raw data"));
  g->deflicker_histogram_sources = g_list_append(g->deflicker_histogram_sources, GUINT_TO_POINTER(DEFLICKER_HISTOGRAM_SOURCE_SOURCEFILE));

  dt_bauhaus_combobox_set_default(g->deflicker_histogram_source, DEFLICKER_HISTOGRAM_SOURCE_THUMBNAIL);
  dt_bauhaus_combobox_set(g->deflicker_histogram_source, g_list_index(g->modes, GUINT_TO_POINTER(p->deflicker_histogram_source)));
  gtk_box_pack_start(GTK_BOX(g->vbox_deflicker), GTK_WIDGET(g->deflicker_histogram_source), TRUE, TRUE, 0);

  GtkHBox *hbox1 = GTK_HBOX(gtk_hbox_new(FALSE, 0));
  GtkLabel *label = GTK_LABEL(gtk_label_new(_("computed EC: ")));
  gtk_box_pack_start(GTK_BOX(hbox1), GTK_WIDGET(label), FALSE, FALSE, 0);

  g->deflicker_used_EC = GTK_LABEL(gtk_label_new("")); // This gets filled in by process
  g_object_set(GTK_OBJECT(g->deflicker_used_EC), "tooltip-text", _("what exposure correction has actually been used"), (char *)NULL);
  gtk_box_pack_start(GTK_BOX(hbox1), GTK_WIDGET(g->deflicker_used_EC), FALSE, FALSE, 0);
  g->deflicker_computed_exposure = NAN;

  gtk_box_pack_start(GTK_BOX(g->vbox_deflicker), GTK_WIDGET(hbox1), FALSE, FALSE, 0);

  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->vbox_deflicker), TRUE, TRUE, 0);

  g_signal_connect(G_OBJECT(g->mode), "value-changed", G_CALLBACK(mode_callback), self);
  g_signal_connect(G_OBJECT(g->black), "value-changed", G_CALLBACK(black_callback), self);
  g_signal_connect(G_OBJECT(g->exposure), "value-changed", G_CALLBACK(exposure_callback), self);
  g_signal_connect(G_OBJECT(g->autoexpp), "value-changed", G_CALLBACK(autoexpp_callback), self);
  g_signal_connect(G_OBJECT(g->autoexp), "toggled", G_CALLBACK(autoexp_callback), self);
  g_signal_connect(G_OBJECT(g->deflicker_percentile), "value-changed", G_CALLBACK(deflicker_params_callback), self);
  g_signal_connect(G_OBJECT(g->deflicker_target_level), "value-changed", G_CALLBACK(deflicker_params_callback), self);
  g_signal_connect(G_OBJECT(g->deflicker_histogram_source), "value-changed", G_CALLBACK(deflicker_histogram_source_callback), self);
  g_signal_connect(G_OBJECT(self->widget), "expose-event", G_CALLBACK(expose), self);
}
Beispiel #21
0
void gui_init(struct dt_iop_module_t *self)
{
  self->gui_data = malloc(sizeof(dt_iop_exposure_gui_data_t));
  dt_iop_exposure_gui_data_t *g = (dt_iop_exposure_gui_data_t *)self->gui_data;
  dt_iop_exposure_params_t *p = (dt_iop_exposure_params_t *)self->params;

  /* register hooks with current dev so that  histogram
     can interact with this module.
   */
  darktable.develop->proxy.exposure.module = self;
  darktable.develop->proxy.exposure.set_white = dt_iop_exposure_set_white;
  darktable.develop->proxy.exposure.get_white = dt_iop_exposure_get_white;
  darktable.develop->proxy.exposure.set_black = dt_iop_exposure_set_black;
  darktable.develop->proxy.exposure.get_black = dt_iop_exposure_get_black;

  self->request_color_pick = 0;

  self->widget = GTK_WIDGET(gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE));

  g->black = dt_bauhaus_slider_new_with_range(self, -0.1, 0.1, .001, p->black, 4);
  g_object_set(G_OBJECT(g->black), "tooltip-text", _("adjust the black level"), (char *)NULL);
  dt_bauhaus_slider_set_format(g->black,"%.4f");
  dt_bauhaus_widget_set_label(g->black, NULL, _("black"));
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->black), TRUE, TRUE, 0);

  g->exposure = dt_bauhaus_slider_new_with_range(self, -3.0, 3.0, .02, p->exposure, 3);
  g_object_set(G_OBJECT(g->exposure), "tooltip-text", _("adjust the exposure correction"), (char *)NULL);
  dt_bauhaus_slider_set_format(g->exposure,"%.2fEV");
  dt_bauhaus_widget_set_label(g->exposure, NULL, _("exposure"));
  dt_bauhaus_slider_enable_soft_boundaries(g->exposure, -18.0, 18.0);
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->exposure), TRUE, TRUE, 0);

  g->autoexp  = GTK_CHECK_BUTTON(gtk_check_button_new_with_label(_("auto")));
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->autoexp), FALSE);
  g->autoexpp = dt_bauhaus_slider_new_with_range(self, 0.0, 0.2, .001, 0.01,3);
  g_object_set(G_OBJECT(g->autoexpp), "tooltip-text", _("percentage of bright values clipped out"), (char *)NULL);
  gtk_widget_set_sensitive(GTK_WIDGET(g->autoexpp), TRUE);

  GtkHBox *hbox = GTK_HBOX(gtk_hbox_new(FALSE, 0));
  gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(g->autoexp), FALSE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(g->autoexpp), TRUE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(hbox), TRUE, TRUE, 0);

  g->deflicker = GTK_CHECK_BUTTON(gtk_check_button_new_with_label(_("deflicker")));
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->deflicker), p->deflicker);

  g->deflicker_percentile = dt_bauhaus_slider_new_with_range(self, 0, 100, .01, p->deflicker_percentile, 3);
  g_object_set(G_OBJECT(g->deflicker_percentile), "tooltip-text", _("percentile"), (char *)NULL);
  dt_bauhaus_slider_set_format(g->deflicker_percentile,"%.2f%%");
  dt_bauhaus_widget_set_label(g->deflicker_percentile, NULL, _("percentile"));
  gtk_widget_set_sensitive(GTK_WIDGET(g->deflicker_percentile), p->deflicker);

  g->deflicker_level = dt_bauhaus_slider_new_with_range(self, -18.0, 18.0, .01, p->deflicker_level, 3);
  g_object_set(G_OBJECT(g->deflicker_level), "tooltip-text", _("target level"), (char *)NULL);
  dt_bauhaus_slider_set_format(g->deflicker_level,"%.2fEV");
  dt_bauhaus_widget_set_label(g->deflicker_level, NULL, _("target level"));
  gtk_widget_set_sensitive(GTK_WIDGET(g->deflicker_level), p->deflicker);

  GtkVBox *vbox = GTK_VBOX(gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE));
  gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(g->deflicker_percentile), FALSE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(g->deflicker_level), TRUE, TRUE, 0);

  GtkHBox *hbox2 = GTK_HBOX(gtk_hbox_new(FALSE, 0));
  gtk_box_pack_start(GTK_BOX(hbox2), GTK_WIDGET(g->deflicker), FALSE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX(hbox2), GTK_WIDGET(vbox), TRUE, TRUE, 0);

  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(hbox2), TRUE, TRUE, 0);

  darktable.gui->reset = 1;
  self->gui_update(self);
  darktable.gui->reset = 0;

  g_signal_connect (G_OBJECT (g->black), "value-changed",
                    G_CALLBACK (black_callback), self);
  g_signal_connect (G_OBJECT (g->exposure), "value-changed",
                    G_CALLBACK (exposure_callback), self);
  g_signal_connect (G_OBJECT (g->autoexpp), "value-changed",
                    G_CALLBACK (autoexpp_callback), self);
  g_signal_connect (G_OBJECT (g->autoexp), "toggled",
                    G_CALLBACK (autoexp_callback), self);
  g_signal_connect (G_OBJECT (g->deflicker), "toggled",
                    G_CALLBACK (deflicker_callback), self);
  g_signal_connect (G_OBJECT (g->deflicker_percentile), "value-changed",
                    G_CALLBACK (deflicker_params_callback), self);
  g_signal_connect (G_OBJECT (g->deflicker_level), "value-changed",
                    G_CALLBACK (deflicker_params_callback), self);
  g_signal_connect (G_OBJECT(self->widget), "expose-event",
                    G_CALLBACK(expose), self);
}
Beispiel #22
0
static void
debug_logger_create_domain_page(DebugLogger *logger,
                                DomainHandler *handler,
                                const gchar *domain_name)
{
    GtkWidget *tab_label, *scrolled_window, *treeview;
    GtkListStore *list_store;
    GtkTreeViewColumn *column;
    GtkCellRenderer *renderer;
    GtkTreeSelection *selection;
    GtkHBox *hbox;
    GtkImage *image;

    g_return_if_fail(IS_DEBUG_LOGGER(logger));

    tab_label = gtk_label_new(domain_name);
    scrolled_window = gtk_scrolled_window_new(NULL, NULL);

    g_object_set(G_OBJECT(scrolled_window),
            "hscrollbar-policy", GTK_POLICY_AUTOMATIC,
            "vscrollbar-policy", GTK_POLICY_AUTOMATIC,
            NULL);

    list_store = gtk_list_store_new(N_COLUMNS,
            G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
    treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(list_store));
    g_object_unref(list_store);

    g_object_set(G_OBJECT(treeview),
            "rubber-banding", TRUE,
            NULL);

    renderer = gtk_cell_renderer_text_new();
    column = gtk_tree_view_column_new_with_attributes (_("Type"),
            renderer,
            "text", TYPE_COLUMN,
            NULL);
    gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);

    renderer = gtk_cell_renderer_text_new();
    column = gtk_tree_view_column_new_with_attributes (_("Message"),
            renderer,
            "text", MSG_COLUMN,
            "foreground", COLOR_COLUMN,
            NULL);
    gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);

    selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
    gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);

    gtk_container_add(GTK_CONTAINER(scrolled_window), treeview);

    hbox = GTK_HBOX(gtk_hbox_new(FALSE, 0));
    image = GTK_IMAGE(gtk_image_new_from_stock(GTK_STOCK_REMOVE, GTK_ICON_SIZE_MENU));

    gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(image), FALSE, FALSE, 0);
    gtk_box_pack_start(GTK_BOX(hbox), tab_label, TRUE, TRUE, 0);

    gtk_widget_show_all(GTK_WIDGET(hbox));

    gtk_notebook_append_page(logger->priv->notebook, scrolled_window, GTK_WIDGET(hbox));
    gtk_notebook_set_tab_label_packing(logger->priv->notebook, scrolled_window,
            TRUE, TRUE, GTK_PACK_START);

    gtk_widget_show_all(GTK_WIDGET(logger->priv->notebook));

    handler->child = scrolled_window;
    handler->view = GTK_TREE_VIEW(treeview);

    gtk_widget_set_sensitive(logger->priv->toolbar_save, TRUE);
    gtk_widget_set_sensitive(logger->priv->toolbar_copy, TRUE);
    gtk_widget_set_sensitive(logger->priv->toolbar_select, TRUE);
    gtk_widget_set_sensitive(logger->priv->toolbar_clear, TRUE);
}
Beispiel #23
0
void mainwindow_create_tab(void) {
    GtkWidget* tmp_term = build_term();
    GtkVScrollbar *sbar= NULL;
    GtkHBox *tmp_box = GTK_HBOX(gtk_hbox_new(FALSE, 0));

    if (conf_get_scrollbar() == -1)
        gtk_box_pack_start(GTK_BOX(tmp_box), tmp_term, TRUE, TRUE, 0);
    else if (conf_get_scrollbar() == POS_LEFT) {
        sbar = GTK_VSCROLLBAR(gtk_vscrollbar_new(vte_terminal_get_adjustment(
        VTE_TERMINAL(tmp_term))));
        gtk_box_pack_start(GTK_BOX(tmp_box), GTK_WIDGET(sbar), FALSE, FALSE, 0);
        gtk_box_pack_end(GTK_BOX(tmp_box), GTK_WIDGET(tmp_term), TRUE, TRUE, 0);
    } else // (conf_get_scrollbar() == POS_RIGHT)
    {
        sbar = GTK_VSCROLLBAR(gtk_vscrollbar_new(vte_terminal_get_adjustment(
        VTE_TERMINAL(tmp_term))));
        gtk_box_pack_start(GTK_BOX(tmp_box), GTK_WIDGET(tmp_term), TRUE, TRUE, 0);
        gtk_box_pack_end(GTK_BOX(tmp_box), GTK_WIDGET(sbar), FALSE, FALSE, 0);
    }

    char buffer [100];
    sprintf(buffer, "%s %d", conf_get_term_name(), activetab + 1);
    GtkLabel* tmp_label = GTK_LABEL(gtk_label_new(buffer));

    if (conf_get_opacity() < 100) {
        if (screen_is_composited) {
            vte_terminal_set_background_transparent(VTE_TERMINAL(tmp_term), FALSE);
            vte_terminal_set_opacity(VTE_TERMINAL(tmp_term),
            conf_get_opacity()/100 * 0xffff);
        } else {
            vte_terminal_set_background_saturation(VTE_TERMINAL(tmp_term),
                1.0 - conf_get_opacity()/100);
            if (conf_get_bg_image() == NULL)
                vte_terminal_set_background_transparent(VTE_TERMINAL(tmp_term), TRUE);
        }
    }

    if (conf_get_opacity() < 100 && screen_is_composited) {
        vte_terminal_set_background_transparent(VTE_TERMINAL(tmp_term), FALSE);
        vte_terminal_set_opacity(VTE_TERMINAL(tmp_term),
        conf_get_opacity()/100 * 0xffff);
    }
    g_signal_connect(G_OBJECT(tmp_term), "window-title-changed",
            G_CALLBACK(mainwindow_window_title_changed), tmp_label);

    g_array_append_val(tabs, tmp_term);
    tabcount++;

    gtk_widget_show_all(GTK_WIDGET(tmp_box));
    gtk_notebook_append_page(tabbar, GTK_WIDGET(tmp_box), GTK_WIDGET(tmp_label));

    if (conf_get_tab_fill())
        gtk_container_child_set(GTK_CONTAINER(tabbar), GTK_WIDGET(tmp_box),
                "tab-expand", TRUE, "tab-fill", TRUE, NULL);

    if (conf_get_show_tab() == TABS_ONE&& tabcount > 1)
        gtk_notebook_set_show_tabs(tabbar, TRUE);

    activetab = tabcount - 1;
    gtk_notebook_set_current_page(tabbar, activetab);
}
Beispiel #24
0
void gui_init(struct dt_iop_module_t *self)
{
  self->gui_data = malloc(sizeof(dt_iop_colorzones_gui_data_t));
  dt_iop_colorzones_gui_data_t *c = (dt_iop_colorzones_gui_data_t *)self->gui_data;
  dt_iop_colorzones_params_t *p = (dt_iop_colorzones_params_t *)self->params;

//   c->channel = DT_IOP_COLORZONES_C;
  c->channel = dt_conf_get_int("plugins/darkroom/colorzones/gui_channel");
  int ch = (int)c->channel;
  c->minmax_curve = dt_draw_curve_new(0.0, 1.0, CATMULL_ROM);
  (void)dt_draw_curve_add_point(c->minmax_curve, p->equalizer_x[ch][DT_IOP_COLORZONES_BANDS-2]-1.0, p->equalizer_y[ch][DT_IOP_COLORZONES_BANDS-2]);
  for(int k=0; k<DT_IOP_COLORZONES_BANDS; k++) (void)dt_draw_curve_add_point(c->minmax_curve, p->equalizer_x[ch][k], p->equalizer_y[ch][k]);
  (void)dt_draw_curve_add_point(c->minmax_curve, p->equalizer_x[ch][1]+1.0, p->equalizer_y[ch][1]);
  c->mouse_x = c->mouse_y = c->mouse_pick = -1.0;
  c->dragging = 0;
  c->x_move = -1;
  c->mouse_radius = 1.0/DT_IOP_COLORZONES_BANDS;
  self->widget = GTK_WIDGET(gtk_vbox_new(FALSE, DT_GUI_IOP_MODULE_CONTROL_SPACING));

  // select by which dimension
  GtkHBox *hbox = GTK_HBOX(gtk_hbox_new(FALSE, 5));
  GtkWidget *label = gtk_label_new(_("select by"));
  gtk_misc_set_alignment(GTK_MISC(label), 0.0f, 0.5f);
  c->select_by = gtk_combo_box_new_text();
  gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
  gtk_combo_box_append_text(GTK_COMBO_BOX(c->select_by), _("hue"));
  gtk_combo_box_append_text(GTK_COMBO_BOX(c->select_by), _("saturation"));
  gtk_combo_box_append_text(GTK_COMBO_BOX(c->select_by), _("lightness"));
  gtk_box_pack_start(GTK_BOX(hbox), c->select_by, TRUE, TRUE, 0);
  g_signal_connect (G_OBJECT (c->select_by), "changed", G_CALLBACK (select_by_changed), (gpointer)self);

  GtkWidget *tb = dtgtk_togglebutton_new(dtgtk_cairo_paint_colorpicker, CPF_STYLE_FLAT);
  g_object_set(G_OBJECT(tb), "tooltip-text", _("pick gui color from image"), (char *)NULL);
  g_signal_connect(G_OBJECT(tb), "toggled", G_CALLBACK(request_pick_toggled), self);
  gtk_box_pack_start(GTK_BOX(hbox), tb, FALSE, FALSE, 0);

  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(hbox), FALSE, FALSE, 0);

  // tabs
  GtkVBox *vbox = GTK_VBOX(gtk_vbox_new(FALSE, 0));//DT_GUI_IOP_MODULE_CONTROL_SPACING));

  c->channel_tabs = GTK_NOTEBOOK(gtk_notebook_new());

  gtk_notebook_append_page(GTK_NOTEBOOK(c->channel_tabs), GTK_WIDGET(gtk_hbox_new(FALSE,0)), gtk_label_new(_("lightness")));
  gtk_notebook_append_page(GTK_NOTEBOOK(c->channel_tabs), GTK_WIDGET(gtk_hbox_new(FALSE,0)), gtk_label_new(_("saturation")));
  gtk_notebook_append_page(GTK_NOTEBOOK(c->channel_tabs), GTK_WIDGET(gtk_hbox_new(FALSE,0)), gtk_label_new(_("hue")));

  gtk_widget_show_all(GTK_WIDGET(gtk_notebook_get_nth_page(c->channel_tabs, c->channel)));
  gtk_notebook_set_current_page(GTK_NOTEBOOK(c->channel_tabs), c->channel);

  g_object_set(G_OBJECT(c->channel_tabs), "homogeneous", TRUE, (char *)NULL);

  gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(c->channel_tabs), FALSE, FALSE, 0);

  g_signal_connect(G_OBJECT(c->channel_tabs), "switch_page",
                   G_CALLBACK (colorzones_tab_switch), self);

  // the nice graph
  c->area = GTK_DRAWING_AREA(gtk_drawing_area_new());
  gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(c->area), TRUE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(vbox), TRUE, TRUE, 5);
  gtk_drawing_area_size(c->area, 195, 195);

  gtk_widget_add_events(GTK_WIDGET(c->area), GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK);
  g_signal_connect (G_OBJECT (c->area), "expose-event",
                    G_CALLBACK (colorzones_expose), self);
  g_signal_connect (G_OBJECT (c->area), "button-press-event",
                    G_CALLBACK (colorzones_button_press), self);
  g_signal_connect (G_OBJECT (c->area), "button-release-event",
                    G_CALLBACK (colorzones_button_release), self);
  g_signal_connect (G_OBJECT (c->area), "motion-notify-event",
                    G_CALLBACK (colorzones_motion_notify), self);
  g_signal_connect (G_OBJECT (c->area), "leave-notify-event",
                    G_CALLBACK (colorzones_leave_notify), self);
  g_signal_connect (G_OBJECT (c->area), "enter-notify-event",
                    G_CALLBACK (colorzones_enter_notify), self);
  g_signal_connect (G_OBJECT (c->area), "scroll-event",
                    G_CALLBACK (colorzones_scrolled), self);


  c->hsRGB = dt_colorspaces_create_srgb_profile();
  c->hLab  = dt_colorspaces_create_lab_profile();
  c->xform = cmsCreateTransform(c->hLab, TYPE_Lab_DBL, c->hsRGB, TYPE_RGB_DBL,
                                INTENT_PERCEPTUAL, 0);
}