コード例 #1
0
/**
 * Callback that is called when we hit the "Apply" button of a
 * transaction print config dialog.  It is responsible of setting the
 * fonts.
 *
 * \param operation	GtkPrintOperation responsible of this job.
 * \param widget	Custom widget.  Not used.
 * \param null		Not used.
 *
 * \return NULL
 */
gboolean print_transactions_list_apply ( GtkPrintOperation * operation,
					 GtkWidget * widget,
					 gpointer null )
{
    GtkFontButton * font_button_transactions, * font_button_title;
    GtkWidget *calendar;

    font_button_transactions = g_object_get_data ( G_OBJECT ( operation ), "font_transaction_button" );
    font_button_title = g_object_get_data ( G_OBJECT( operation ), "font_title_button" );
    
    gsb_data_print_config_set_font_transaction ( pango_font_description_from_string (
                        gtk_font_button_get_font_name ( font_button_transactions ) ) );
    gsb_data_print_config_set_font_title ( pango_font_description_from_string (
                        gtk_font_button_get_font_name ( font_button_title ) ) );


    if ( gsb_data_print_config_get_draw_interval_dates () )
    {
        calendar = g_object_get_data ( G_OBJECT(operation), "init_date_entry" );
        draw_initial_date = gsb_calendar_entry_get_date ( calendar );

        calendar = g_object_get_data ( G_OBJECT(operation), "final_date_entry" );
        draw_final_date = gsb_calendar_entry_get_date ( calendar );
    }

    return FALSE;
}
コード例 #2
0
static void
update_theme_from_controls (GthContactSheetThemeDialog *self)
{
	self->priv->theme->display_name = g_strdup (gtk_entry_get_text (GTK_ENTRY (GET_WIDGET ("name_entry"))));

	/* background */

	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (GET_WIDGET ("solid_color_radiobutton")))) {
		self->priv->theme->background_type = GTH_CONTACT_SHEET_BACKGROUND_TYPE_SOLID;
		gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("solid_color_colorpicker")), &self->priv->theme->background_color1);
	}
	else {
		gboolean h_gradient_active = FALSE;
		gboolean v_gradient_active = FALSE;

		h_gradient_active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (GET_WIDGET ("h_gradient_checkbutton")));
		v_gradient_active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (GET_WIDGET ("v_gradient_checkbutton")));

		if (h_gradient_active && v_gradient_active) {
			self->priv->theme->background_type = GTH_CONTACT_SHEET_BACKGROUND_TYPE_FULL;
			gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("h_gradient_1_colorpicker")), &self->priv->theme->background_color1);
			gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("h_gradient_2_colorpicker")), &self->priv->theme->background_color2);
			gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("v_gradient_1_colorpicker")), &self->priv->theme->background_color3);
			gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("v_gradient_2_colorpicker")), &self->priv->theme->background_color4);
		}
		else if (h_gradient_active) {
			self->priv->theme->background_type = GTH_CONTACT_SHEET_BACKGROUND_TYPE_HORIZONTAL;
			gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("h_gradient_1_colorpicker")), &self->priv->theme->background_color1);
			gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("h_gradient_2_colorpicker")), &self->priv->theme->background_color2);
		}
		else if (v_gradient_active) {
			self->priv->theme->background_type = GTH_CONTACT_SHEET_BACKGROUND_TYPE_VERTICAL;
			gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("v_gradient_1_colorpicker")), &self->priv->theme->background_color1);
			gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("v_gradient_2_colorpicker")), &self->priv->theme->background_color2);
		}
	}

	/* frame */

	self->priv->theme->frame_style = gtk_combo_box_get_active (GTK_COMBO_BOX (GET_WIDGET ("frame_style_combobox")));
	gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("frame_colorpicker")), &self->priv->theme->frame_color);

	/* header */

	self->priv->theme->header_font_name = g_strdup (gtk_font_button_get_font_name (GTK_FONT_BUTTON (GET_WIDGET ("header_fontpicker"))));
	gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("header_colorpicker")), &self->priv->theme->header_color);

	/* footer */

	self->priv->theme->footer_font_name = g_strdup (gtk_font_button_get_font_name (GTK_FONT_BUTTON (GET_WIDGET ("footer_fontpicker"))));
	gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("footer_colorpicker")), &self->priv->theme->footer_color);

	/* caption */

	self->priv->theme->caption_font_name = g_strdup (gtk_font_button_get_font_name (GTK_FONT_BUTTON (GET_WIDGET ("caption_fontpicker"))));
	gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("caption_colorpicker")), &self->priv->theme->caption_color);
}
コード例 #3
0
ファイル: vte.c プロジェクト: brettm2013/geany
static void on_term_font_set(GtkFontButton *widget, gpointer user_data)
{
	const gchar *fontbtn = gtk_font_button_get_font_name(widget);

	if (! utils_str_equal(fontbtn, vc->font))
	{
		SETPTR(vc->font, g_strdup(gtk_font_button_get_font_name(widget)));
		vte_apply_user_settings();
	}
}
コード例 #4
0
/* Handler for "font-set" signal on Terminal Font font button. */
static void preferences_dialog_font_set_event(GtkFontButton * widget, LXTerminal * terminal)
{
    g_free(terminal->setting->font_name);
    terminal->setting->font_name = g_strdup(gtk_font_button_get_font_name(widget));
    terminal->setting->geometry_change = TRUE;		/* Force the terminals to resize */
    terminal_settings_apply_to_all(terminal);
}
コード例 #5
0
ファイル: xpad-preferences.c プロジェクト: abhinandh/xpad
static void
change_font_face (GtkFontButton *button, XpadPreferences *pref)
{
	g_signal_handler_block (xpad_settings (), pref->priv->notify_font_handler);
	xpad_settings_set_fontname (xpad_settings (), gtk_font_button_get_font_name (button));
	g_signal_handler_unblock (xpad_settings (), pref->priv->notify_font_handler);
}
コード例 #6
0
ファイル: dialog-preferences.c プロジェクト: phako/ignuit
static void
cb_card_font (GtkFontButton *widget, Dialog *d)
{
    prefs_set_card_font (d->ig->prefs, gtk_font_button_get_font_name (widget));

    dialog_editor_preferences_changed ();
}
コード例 #7
0
ファイル: preferences.c プロジェクト: chimara/Chimara
void
on_font_set(GtkFontButton *button, ChimaraGlk *glk)
{
	const gchar *font_name = gtk_font_button_get_font_name(button);
	PangoFontDescription *font_description = pango_font_description_from_string(font_name);
	g_object_set(current_tag, "font-desc", font_description, NULL);
}
コード例 #8
0
ファイル: lrc_config.c プロジェクト: lovesnow/linnya
gboolean ly_3lrc_config_on_desktop_font_set_cb(GtkWidget *widget, gpointer data)
{
	gchar font[1024]="Sans Regular 25";
	g_strlcpy(font, gtk_font_button_get_font_name(GTK_FONT_BUTTON(widget)), sizeof(font));
	ly_reg_set("3lrc_desktop_font", "%s", font);
	return FALSE;
}		
コード例 #9
0
JNIEXPORT jstring JNICALL
Java_org_gnome_gtk_GtkFontButton_gtk_1font_1button_1get_1font_1name
(
	JNIEnv* env,
	jclass cls,
	jlong _self
)
{
	const gchar* result;
	jstring _result;
	GtkFontButton* self;

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

	// call function
	result = gtk_font_button_get_font_name(self);

	// cleanup parameter self

	// translate return value to JNI type
	_result = (jstring) bindings_java_newString(env, result);

	// and finally
	return _result;
}
コード例 #10
0
ファイル: tblocks.c プロジェクト: Torture/MegaTunix
EXPORT gboolean create_text_block_event(GtkWidget * widget, gpointer data)
{
	GtkWidget *dialog = NULL;
	MtxTextBlock *tblock = NULL;
	GladeXML *xml = NULL;
	gchar * filename = NULL;
	gint result = 0;

	if (!GTK_IS_WIDGET(gauge))
		return FALSE;

	filename = get_file(g_build_filename(GAUGEDESIGNER_GLADE_DIR,"gaugedesigner.glade",NULL),NULL);
	if (filename)
	{
		xml = glade_xml_new(filename, "tblock_dialog", NULL);
		g_free(filename);
	}
	else
	{
		printf("Can't locate primary glade file!!!!\n");
		exit(-1);
	}

	glade_xml_signal_autoconnect(xml);
	dialog = glade_xml_get_widget(xml,"tblock_dialog");
	gtk_color_button_set_color(GTK_COLOR_BUTTON(glade_xml_get_widget(xml,"tblock_day_colorbutton")),&white);
	gtk_color_button_set_color(GTK_COLOR_BUTTON(glade_xml_get_widget(xml,"tblock_nite_colorbutton")),&black);
	if (!GTK_IS_WIDGET(dialog))
	{
		return FALSE;
	}

	result = gtk_dialog_run(GTK_DIALOG(dialog));
	switch (result)
	{
		case GTK_RESPONSE_APPLY:
			tblock = g_new0(MtxTextBlock, 1);
			tblock->font_scale = gtk_spin_button_get_value(GTK_SPIN_BUTTON(glade_xml_get_widget(xml,"tblock_font_scale_spin")));
			tblock->x_pos = gtk_spin_button_get_value(GTK_SPIN_BUTTON(glade_xml_get_widget(xml,"tblock_xpos_spin")));
			tblock->y_pos = gtk_spin_button_get_value(GTK_SPIN_BUTTON(glade_xml_get_widget(xml,"tblock_ypos_spin")));
			tblock->text = gtk_editable_get_chars(GTK_EDITABLE(glade_xml_get_widget(xml,"tblock_text_entry")),0,-1);
			gtk_color_button_get_color(GTK_COLOR_BUTTON(glade_xml_get_widget(xml,"tblock_day_colorbutton")),&tblock->color[MTX_DAY]);
			gtk_color_button_get_color(GTK_COLOR_BUTTON(glade_xml_get_widget(xml,"tblock_nite_colorbutton")),&tblock->color[MTX_NITE]);
			tblock->font = (gchar *)gtk_font_button_get_font_name (GTK_FONT_BUTTON(glade_xml_get_widget(xml,"tblock_fontbutton")));
			tblock->font = g_strchomp(g_strdelimit(tblock->font,"0123456789",' '));
			changed = TRUE;
			mtx_gauge_face_set_text_block_struct(MTX_GAUGE_FACE(gauge),tblock);
			g_free(tblock->text);
			g_free(tblock);
			update_onscreen_tblocks();

			break;
		default:
			break;
	}
	if (GTK_IS_WIDGET(dialog))
		gtk_widget_destroy(dialog);

	return (FALSE);
}
コード例 #11
0
/* Preferences Callback : Change font. */
void preferences_font_cb (GtkWidget *button, gpointer data)
{
	const char *font_str;

	font_str = gtk_font_button_get_font_name (GTK_FONT_BUTTON (button));
	g_settings_set_string (stickynotes->settings, "default-font", font_str);
}
コード例 #12
0
ファイル: preferences.c プロジェクト: iksky/sunpinyin
void
state_changed()
{
    hotkey_t hk;
    REFRESH_KEY_SETTING(trigger);
    settings_set(TRIGGER_KEY, &hk);

    REFRESH_KEY_SETTING(english);
    settings_set(ENG_KEY, &hk);

    varchar colorstr;
    REFRESH_COLOR_SETTING(background_color_btn);
    settings_set(PREEDIT_COLOR, colorstr);

    REFRESH_COLOR_SETTING(font_color_btn);
    settings_set(PREEDIT_FONT_COLOR, colorstr);

    /* font and size information */
    settings_set(PREEDIT_FONT, (void*) gtk_font_button_get_font_name(font_btn));

    /* font color information */
    double scale = gtk_adjustment_get_value(opacity_value);
    settings_set(PREEDIT_OPACITY, &scale);

    int ncandi = gtk_adjustment_get_value(ncandidates);
    settings_set(CANDIDATES_SIZE, &ncandi);
    
    settings_save();

    /* notify all running xsunpinyin with this user */
    char cmd[256];
    snprintf(cmd, 256, "/usr/bin/pkill -10 '^xsunpinyin$' -u %d", getuid());
    system(cmd);
}
コード例 #13
0
ファイル: gtkfontbutton.c プロジェクト: batman52/dingux-code
static void
gtk_font_button_get_property (GObject    *object,
                              guint       param_id,
                              GValue     *value,
                              GParamSpec *pspec)
{
  GtkFontButton *font_button = GTK_FONT_BUTTON (object);
  
  switch (param_id) 
    {
    case PROP_TITLE:
      g_value_set_string (value, gtk_font_button_get_title (font_button));
      break;
    case PROP_FONT_NAME:
      g_value_set_string (value, gtk_font_button_get_font_name (font_button));
      break;
    case PROP_USE_FONT:
      g_value_set_boolean (value, gtk_font_button_get_use_font (font_button));
      break;
    case PROP_USE_SIZE:
      g_value_set_boolean (value, gtk_font_button_get_use_size (font_button));
      break;
    case PROP_SHOW_STYLE:
      g_value_set_boolean (value, gtk_font_button_get_show_style (font_button));
      break;
    case PROP_SHOW_SIZE:
      g_value_set_boolean (value, gtk_font_button_get_show_size (font_button));
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
      break;
    }
} 
コード例 #14
0
/* Preferences Callback : Change font. */
void preferences_font_cb (GtkWidget *button, gpointer data)
{
	const char *font_str;

	font_str = gtk_font_button_get_font_name (GTK_FONT_BUTTON (button));
	gconf_client_set_string(stickynotes->gconf,
			GCONF_PATH "/defaults/font", font_str, NULL);
}
コード例 #15
0
ファイル: totem-preferences.c プロジェクト: Slaaneshi/totem
void
font_set_cb (GtkFontButton * fb, Totem * totem)
{
	const gchar *font;

	font = gtk_font_button_get_font_name (fb);
	g_settings_set_string (totem->settings, "subtitle-font", font);
}
コード例 #16
0
/* Properties Dialog Callback : Font */
void properties_font_cb (GtkWidget *button, StickyNote *note)
{
        const char *font_str;

        font_str = gtk_font_button_get_font_name (GTK_FONT_BUTTON (button));

	stickynote_set_font(note, font_str, TRUE);
}
コード例 #17
0
ファイル: main.c プロジェクト: Cmarone/xlook
G_MODULE_EXPORT void on_fontbutton1_font_set(
	GtkFontButton *widget, 
	gpointer user_data)
{
	fprintf(stderr, "Font set was: %s", gtk_font_button_get_font_name(widget));
	
	GtkWidget *fileInfo= lookup_widget_by_name(ui_globals.main_window, "textview_FileInfo");
	PangoFontDescription *desc= pango_font_description_from_string(gtk_font_button_get_font_name(widget));
fprintf(stderr, "Desc: %p FileInfo: %p\n", desc, fileInfo);
	gtk_widget_modify_font(fileInfo, desc);
//	pango_font_description_free(desc);

	/*
	Retrieves the name of the currently selected font. This name includes style and size information as well. 
	If you want to render something with the font, use this string with pango_font_description_from_string() . 
	*/
}
コード例 #18
0
ファイル: main.c プロジェクト: arievanleyen/xpen
// set font for the 9 buttons
extern "C" G_MODULE_EXPORT void apply_font (GtkObject *object, gpointer user_data) {
    gchar *font 				= (gchar*) gtk_font_button_get_font_name(GTK_FONT_BUTTON(fontbutton));
    PangoFontDescription *pfont = pango_font_description_from_string (font);
    for (int i=0; i< 9; i++)
        gtk_widget_modify_font (GTK_WIDGET(knop[i]), pfont);
	//g_free(font);
	pango_font_description_free(pfont);
}
コード例 #19
0
static void
fontbutton_disabled_set_cb(GtkFontButton *b,Vnkb *vnkb)
{
  if (vnkb->font_disabled)
    g_free(vnkb->font_disabled);
  vnkb->font_disabled = g_strdup(gtk_font_button_get_font_name(b));
  vnkb_update_label(vnkb);
}
コード例 #20
0
ファイル: preferences.c プロジェクト: nicolas-raoul/gjitenkai
G_MODULE_EXPORT void on_fontbutton_results_font_set(GtkFontButton *font_button, 
                                                    worddic *worddic){
  const gchar *font_name= gtk_font_button_get_font_name (font_button);
  PangoFontDescription *font_desc = pango_font_description_from_string(font_name);

  worddic->conf->resultsfont = font_name;

  worddic_conf_save(worddic->settings, worddic->conf);
}
コード例 #21
0
ファイル: termit_preferences.c プロジェクト: moonsdad/termit
static void dlg_set_font(GtkFontButton *widget, gpointer user_data)
{
    if (!user_data) {
        ERROR("user_data is NULL");
        return;
    }
    struct TermitTab* pTab = (struct TermitTab*)user_data;
    termit_tab_set_font(pTab, gtk_font_button_get_font_name(widget));
}
コード例 #22
0
void
font_set_cb (GtkFontButton * fb, Idol * idol)
{
	const gchar *font;

	font = gtk_font_button_get_font_name (fb);
	mateconf_client_set_string (idol->gc, MATECONF_PREFIX"/subtitle_font",
				 font, NULL);
}
コード例 #23
0
static void
mud_window_prefs_font_cb(GtkWidget *widget,
                         MudWindowPrefs *self)
{
    const gchar *fontname = gtk_font_button_get_font_name(GTK_FONT_BUTTON(widget));

    RETURN_IF_CHANGING_PROFILES(self);
    mud_profile_set_font(self->priv->profile, fontname);
}
コード例 #24
0
static void
application_font_changed (GtkWidget *font_button)
{
  const gchar *font;

  font = gtk_font_button_get_font_name (GTK_FONT_BUTTON (font_button));
  g_free (old_font);
  old_font = g_strdup (font);
}
コード例 #25
0
ファイル: print-editor.c プロジェクト: GYGit/gtk
static void
custom_widget_apply (GtkPrintOperation *operation,
		     GtkWidget *widget,
		     PrintData *data)
{
  const char *selected_font;
  selected_font = gtk_font_button_get_font_name  (GTK_FONT_BUTTON (data->font_button));
  g_free (data->font);
  data->font = g_strdup (selected_font);
}
コード例 #26
0
ファイル: main.c プロジェクト: artex2000/fconv
static void font_button_clicked (GtkFontButton *button)
{
	const gchar *font;
	PangoFontDescription *desc;

	font = gtk_font_button_get_font_name (button);
	desc = pango_font_description_from_string (font);

	set_font (desc);
}
コード例 #27
0
ファイル: watermark.c プロジェクト: edgomez/darktable
static void fontsel_callback(GtkWidget *button, gpointer user_data)
{
  dt_iop_module_t *self = (dt_iop_module_t *)user_data;
  if(self->dt->gui->reset) return;
  dt_iop_watermark_params_t *p = (dt_iop_watermark_params_t *)self->params;

  snprintf(p->font, sizeof(p->font), "%s", gtk_font_button_get_font_name(GTK_FONT_BUTTON(button)));
  dt_conf_set_string("plugins/darkroom/watermark/font", p->font);
  dt_dev_add_history_item(darktable.develop, self, TRUE);
}
コード例 #28
0
ファイル: tbo-tool-text.c プロジェクト: GNOME/tbo
gchar *
tbo_tool_text_get_pango_font (TboToolText *self)
{
    if (self->font)
    {
        return (gchar *)gtk_font_button_get_font_name (GTK_FONT_BUTTON (self->font));
    }

    return DEFAULT_PANGO_FONT;
}
コード例 #29
0
ファイル: glade-gtk-button.c プロジェクト: kugel-/glade
/* Use the font-buttons launch dialog to actually set the font-name
 * glade property through the glade-command api.
 */
static void
glade_gtk_font_button_refresh_font_name (GtkFontButton * button,
                                         GladeWidget * gbutton)
{
  GladeProperty *property;

  if ((property = glade_widget_get_property (gbutton, "font-name")) != NULL)
    glade_command_set_property (property,
                                gtk_font_button_get_font_name (button));
}
コード例 #30
0
ファイル: fontpicker.cpp プロジェクト: Bluehorn/wxPython
static void gtk_fontbutton_setfont_callback(GtkFontButton *widget,
                                            wxFontButton *p)
{
    // update the m_selectedFont member of the wxFontButton
    wxASSERT(p);
    p->SetNativeFontInfo(gtk_font_button_get_font_name(widget));

    // fire the colour-changed event
    wxFontPickerEvent event(p, p->GetId(), p->GetSelectedFont());
    p->GetEventHandler()->ProcessEvent(event);
}