Esempio n. 1
0
static void cleanice_rc_style_class_init (CleanIceRCStyleClass * klass) {
  GtkRcStyleClass * rc_style_class = GTK_RC_STYLE_CLASS (klass);

  parent_class = g_type_class_peek_parent (klass);

  rc_style_class->merge = cleanice_rc_style_merge;
  rc_style_class->create_style = cleanice_rc_style_create_style;

  gtk_rc_parse_string ("style \"cleanice-main-defaults\" {\n"
		       "  GtkCheckButton::indicator-size = 10\n"
		       "  GtkPaned::handle-size = 9\n"
		       "} widget_class \"*\""
		       " style \"cleanice-main-defaults\"");

  gtk_rc_parse_string ("style \"cleanice-scales-defaults\" {\n"
		       "  GtkRange::slider-width = 20\n"
		       "  GtkScale::slider-length = 10\n"
		       "} widget_class \"*Scale*\""
		       " style \"cleanice-scales-defaults\"");

  gtk_rc_parse_string ("style \"cleanice-sbar-defaults\" {\n"
		       "  GtkRange::slider-width = 13\n"
		       "  GtkRange::stepper-size = 13\n"
		       "  GtkScrollbar::min-slider-length = 18\n"
		       "  GtkScrollbar::has_forward_stepper = 1\n"
		       "  GtkScrollbar::has_backward_stepper = 1\n"
		       "  GtkScrollbar::has_secondary_backward_stepper = 1\n"
		       "} widget_class \"*Scrollbar*\""
		       " style \"cleanice-sbar-defaults\"");
}
Esempio n. 2
0
void pApplication::initialize() {
  display = XOpenDisplay(nullptr);

  settings = new Settings;
  settings->load();

  int argc = 1;
  char* argv[] = {new char[8], nullptr};
  strcpy(argv[0], "phoenix");
  char** argvp = argv;
  gtk_init(&argc, &argvp);

  GtkSettings* gtkSettings = gtk_settings_get_default();
//g_object_set(gtkSettings, "gtk-button-images", true, nullptr);

  gtk_rc_parse_string(R"(
    style "phoenix-gtk"
    {
      GtkWindow::resize-grip-width = 0
      GtkWindow::resize-grip-height = 0
      GtkTreeView::vertical-separator = 0
      GtkComboBox::appears-as-list = 1
    }
    class "GtkWindow" style "phoenix-gtk"
    class "GtkTreeView" style "phoenix-gtk"
  # class "GtkComboBox" style "phoenix-gtk"
  )");

  pKeyboard::initialize();
}
Esempio n. 3
0
/**
 * gwy_widgets_type_init:
 *
 * Makes libgwydgets types safe for deserialization and performs other
 * initialization.  You have to call this function before using widgets and
 * objects from libgwydgets.
 *
 * Calls gwy_draw_type_init() first to make sure libgwydraw is initialized.
 *
 * It is safe to call this function more than once, subsequent calls are no-op.
 **/
void
gwy_widgets_type_init(void)
{
    static guint types_initialized = FALSE;

    if (types_initialized)
        return;

    gwy_draw_type_init();

    g_type_class_peek(GWY_TYPE_GRAPH_CURVE_MODEL);
    g_type_class_peek(GWY_TYPE_GRAPH_MODEL);
    g_type_class_peek(GWY_TYPE_3D_LABEL);
    g_type_class_peek(GWY_TYPE_3D_SETUP);
    g_type_class_peek(GWY_TYPE_SELECTION_GRAPH_POINT);
    g_type_class_peek(GWY_TYPE_SELECTION_GRAPH_AREA);
    g_type_class_peek(GWY_TYPE_SELECTION_GRAPH_ZOOM);
    g_type_class_peek(GWY_TYPE_SELECTION_GRAPH_LINE);
    g_type_class_peek(GWY_TYPE_SELECTION_GRAPH_1DAREA);
    types_initialized = 1;

    gtk_rc_parse_string
        (/* graph window statusbar */
         "style \"gwyflatstatusbar\" {\n"
         "  GtkStatusbar::shadow_type = 0\n"
         "}\n"
         "widget \"*.gwyflatstatusbar\" style \"gwyflatstatusbar\"\n"
         "\n");
}
Esempio n. 4
0
static void inline_F791_8118 (void)
{
	{
	gtk_rc_parse_string ("style \"default-style\" {\n GtkWindow::resize-grip-height = 0\n GtkWindow::resize-grip-width = 0\n}\n  class \"GtkWidget\" style  \"default-style\" ");
}
	;
}
Esempio n. 5
0
File: gui.c Progetto: MufriA/stoken
static GtkWidget *app_window_common(void)
{
	GtkWidget *window;
	PangoAttrList *attr;

	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_container_set_border_width(GTK_CONTAINER(window), 10);
	gtk_window_set_title(GTK_WINDOW(window), WINDOW_TITLE);

	g_signal_connect(window, "delete-event", G_CALLBACK(delete_event),
			 NULL);

	tokencode_text = gtk_label_new(NULL);
	attr = pango_attr_list_new();
	pango_attr_list_insert(attr, pango_attr_scale_new(PANGO_SCALE_XX_LARGE));
	pango_attr_list_insert(attr, pango_attr_weight_new(PANGO_WEIGHT_BOLD));
	gtk_label_set_attributes(GTK_LABEL(tokencode_text), attr);
	pango_attr_list_unref(attr);

	/* hack to turn off progress bar animation seen on some themes */
	gtk_rc_parse_string("style \"default\" { engine \"\" { }\n"
		"bg[PRELIGHT] = \"#4b6785\" }\n"
		"widget_class \"*.<GtkProgressBar>\" style \"default\"");

	return window;
}
Esempio n. 6
0
static void inline_F791_8119 (void)
{
	{
	gtk_rc_parse_string ("style \"v2-combo-style\" {\n GtkComboBox::appears-as-list = 1\n }\n  widget \"*.v2combobox\" style : highest  \"v2-combo-style\" " );
}
	;
}
Esempio n. 7
0
void
mc_command_update_entry_color (MCData *mc)
{
    GdkColor fg;
    GdkColor bg;
    char *rc_string;

    fg.red   = mc->preferences.cmd_line_color_fg_r;
    fg.green = mc->preferences.cmd_line_color_fg_g;
    fg.blue  = mc->preferences.cmd_line_color_fg_b;

    /* FIXME: wish we had an API for this, see bug #79585 */
    rc_string = g_strdup_printf (
		    "\n"
		    " style \"minicommander-applet-entry-style\"\n"
		    " {\n"
		    "  GtkWidget::cursor-color=\"#%04x%04x%04x\"\n"
		    " }\n"
		    " widget \"*.minicommander-applet-entry\" "
		    "style \"minicommander-applet-entry-style\"\n"
		    "\n",
		    fg.red, fg.green, fg.blue);
    gtk_rc_parse_string (rc_string);
    g_free (rc_string);

    gtk_widget_modify_text (mc->entry, GTK_STATE_NORMAL, &fg);
    gtk_widget_modify_text (mc->entry, GTK_STATE_PRELIGHT, &fg);

    bg.red   = mc->preferences.cmd_line_color_bg_r;
    bg.green = mc->preferences.cmd_line_color_bg_g;
    bg.blue  = mc->preferences.cmd_line_color_bg_b;

    gtk_widget_modify_base (mc->entry, GTK_STATE_NORMAL, &bg);
    gtk_widget_modify_base (mc->entry, GTK_STATE_PRELIGHT, &bg);
}
Esempio n. 8
0
static void inline_F791_8120 (void)
{
	{
	gtk_rc_parse_string ("style \"v2-toolbar-style\" {\n GtkToolbar::shadow-type = none\n }\n  widget \"*.v2toolbar\" style : highest  \"v2-toolbar-style\" " );
}
	;
}
static void
nautilus_notebook_class_init (NautilusNotebookClass *klass)
{
	GObjectClass *object_class = G_OBJECT_CLASS (klass);
	GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
	GtkNotebookClass *notebook_class = GTK_NOTEBOOK_CLASS (klass);

	container_class->remove = nautilus_notebook_remove;

	notebook_class->insert_page = nautilus_notebook_insert_page;
	
	gtk_rc_parse_string ("style \"nautilus-tab-close-button-style\"\n"
			     "{\n"
			       "GtkWidget::focus-padding = 0\n"
			       "GtkWidget::focus-line-width = 0\n"
			       "xthickness = 0\n"
			       "ythickness = 0\n"
			     "}\n"
			     "widget \"*.nautilus-tab-close-button\" style \"nautilus-tab-close-button-style\"");

	signals[TAB_CLOSE_REQUEST] =
		g_signal_new ("tab-close-request",
			      G_OBJECT_CLASS_TYPE (object_class),
			      G_SIGNAL_RUN_LAST,
			      G_STRUCT_OFFSET (NautilusNotebookClass, tab_close_request),
			      NULL, NULL,
			      g_cclosure_marshal_VOID__OBJECT,
			      G_TYPE_NONE,
			      1,
			      NAUTILUS_TYPE_WINDOW_SLOT);
}
Esempio n. 10
0
static void panel_menu_bar_class_init(PanelMenuBarClass* klass)
{
	GObjectClass* gobject_class = (GObjectClass*) klass;
	GtkWidgetClass* widget_class  = (GtkWidgetClass*) klass;

	gobject_class->get_property = panel_menu_bar_get_property;
	gobject_class->set_property = panel_menu_bar_set_property;
	gobject_class->finalize = panel_menu_bar_finalize;

	widget_class->parent_set = panel_menu_bar_parent_set;
	widget_class->size_allocate = panel_menu_bar_size_allocate;

	g_type_class_add_private(klass, sizeof(PanelMenuBarPrivate));

	g_object_class_install_property(gobject_class, PROP_ORIENTATION, g_param_spec_enum("orientation", "Orientation", "The PanelMenuBar orientation", PANEL_TYPE_ORIENTATION, PANEL_ORIENTATION_TOP, G_PARAM_READWRITE));

#if !GTK_CHECK_VERSION (3, 0, 0)
	gtk_rc_parse_string (
		"style \"panel-menubar-style\"\n"
		"{\n"
		"  GtkMenuBar::shadow-type = none\n"
		"  GtkMenuBar::internal-padding = 0\n"
		"}\n"
		"class \"PanelMenuBar\" style \"panel-menubar-style\"");
#endif
}
Esempio n. 11
0
static GtkWidget *
create_combo (const char *name,
	      gboolean is_list)
{
  GtkCellRenderer *cell_renderer;
  GtkWidget *combo;
  char *rc_string;
  
  rc_string = g_strdup_printf ("style \"%s-style\" {\n"
			       "  GtkComboBox::appears-as-list = %d\n"
			       "}\n"
			       "\n"
			       "widget \"*.%s\" style \"%s-style\"",
			       name, is_list, name, name);
  gtk_rc_parse_string (rc_string);
  g_free (rc_string);

  combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (model));
  cell_renderer = gtk_cell_renderer_text_new ();
  gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell_renderer, TRUE);
  gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), cell_renderer,
				  "text", 0, NULL);

  gtk_widget_set_name (combo, name);
  
  return combo;
}
Esempio n. 12
0
void pOS::initialize() {
  display = XOpenDisplay(0);

  settings = new Settings;
  settings->load();

  int argc = 1;
  char *argv[2];
  argv[0] = new char[8];
  argv[1] = 0;
  strcpy(argv[0], "phoenix");
  char **argvp = argv;
  gtk_init(&argc, &argvp);

  gtk_rc_parse_string(R"(
    style "phoenix-gtk"
    {
      GtkWindow::resize-grip-width = 0
      GtkWindow::resize-grip-height = 0
      GtkTreeView::vertical-separator = 0
      GtkComboBox::appears-as-list = 1
    }
    class "GtkWindow" style "phoenix-gtk"
    class "GtkTreeView" style "phoenix-gtk"
  # class "GtkComboBox" style "phoenix-gtk"
  )");

  pKeyboard::initialize();
}
Esempio n. 13
0
static void
panel_style_set(GtkWidget *widget, GtkStyle *s, panel *p)
{
    ENTER;

    gtk_rc_parse_string(transparent_rc);
    if (GTK_WIDGET_REALIZED(widget))
        set_bg(widget, p);
    RET();
}
Esempio n. 14
0
static void parse_puss_theme_option(const Option* option, const gchar* old, gpointer tag) {
#ifdef G_OS_WIN32
	gchar* str;
	if( option->value && option->value[0]!='\0' )
		return;

	str = g_strdup_printf("gtk-theme-name = \"%s\"", option->value);
	gtk_rc_parse_string(str);
	g_free(str);
#endif
}
Esempio n. 15
0
void
search_gui_init(void)
{
	gtk_rc_parse_string(
		"style \"treeview\" { GtkTreeView::allow-rules = 0 }\n"
		"class \"GtkTreeView\" style \"treeview\"\n"
	);
	search_list_tree_view_init();
	search_details_treeview_init();
	search_gui_common_init();
}
Esempio n. 16
0
static void parse_rc_string(char *defs, char *pattern)
{
   static int dynamic_counter = 0;
   GString *str;

   str = g_string_new(NULL);
   g_string_printf(str, "style \"metatheme-dynamic-%d\" { %s } widget_class \"%s\" style \"metatheme-dynamic-%d\"",
                   dynamic_counter, defs, pattern, dynamic_counter);
   ++dynamic_counter;
   gtk_rc_parse_string(str->str);
   g_string_free(str, TRUE);
}
Esempio n. 17
0
void Widget::change_skin(int model)
{
  Glib::ustring rcfile =GX_LV2_STYLE_DIR;
  rcfile +="/gx_lv2-";
  rcfile += to_string(model);
  rcfile += ".rc";
  gtk_rc_parse(rcfile.c_str());
  //gtk_rc_reparse_all_for_settings(gtk_settings_get_default(),true);
  Glib::ustring o = "widget \"*." + plug_name + "\" style:highest \"gx_lv2-" + to_string(model) + "\"";
  gtk_rc_parse_string(o.c_str());
  gtk_rc_reset_styles(gtk_settings_get_default());
}
Esempio n. 18
0
static void
purplerc_make_changes(void)
{
	GString *str = make_gtkrc_string();
	GtkSettings *setting = NULL;

	gtk_rc_parse_string(str->str);
	g_string_free(str, TRUE);

	setting = gtk_settings_get_default();
	gtk_rc_reset_styles(setting);
}
Esempio n. 19
0
/**************************************************************************
  Updates a gui font style.
**************************************************************************/
void gui_update_font(const char *font_name, const char *font_value)
{
  char str[512];

  fc_snprintf(str, sizeof(str),
              "style \"ext-%s\" {\n"
              "  font_name = \"%s\"\n"
              "}\n"
              "\n"
              "widget \"Freeciv*.%s\" style \"ext-%s\"",
              font_name, font_value, font_name, font_name);

  gtk_rc_parse_string(str);
}
Esempio n. 20
0
void Notebook::Initialize()
{
    static bool style_applied = false;
    if(!style_applied) {
        gtk_rc_parse_string(
            "style \"tab-close-button-style\" {                              "
            "      GtkWidget::focus-padding = 0                              "
            "      GtkWidget::focus-line-width = 0                           "
            "      xthickness = 0                                            "
            "      ythickness = 0                                            "
            " }                                                              "
            "  widget \"*.tab-close-button\" style \"tab-close-button-style\""
        );
        style_applied = true;
    }
}
Esempio n. 21
0
static void
anjuta_docman_class_init (AnjutaDocmanClass *klass)
{
	static gboolean initialized;
	GObjectClass *object_class = G_OBJECT_CLASS (klass);

	parent_class = g_type_class_peek_parent (klass);
	object_class->finalize = anjuta_docman_finalize;
	object_class->dispose = anjuta_docman_dispose;

	if (!initialized)
	{
		initialized = TRUE;

		/* Signals */
	docman_signals [DOC_ADDED] =
		g_signal_new ("document-added",
			ANJUTA_TYPE_DOCMAN,
			G_SIGNAL_RUN_LAST,
			G_STRUCT_OFFSET (AnjutaDocmanClass, document_added),
			NULL, NULL,
			g_cclosure_marshal_VOID__OBJECT,
			G_TYPE_NONE,
			1,
			G_TYPE_OBJECT);
	docman_signals [DOC_CHANGED] =
		g_signal_new ("document-changed",
			ANJUTA_TYPE_DOCMAN,
			G_SIGNAL_RUN_LAST,
			G_STRUCT_OFFSET (AnjutaDocmanClass, document_changed),
			NULL, NULL,
			g_cclosure_marshal_VOID__OBJECT,
			G_TYPE_NONE,
			1,
			G_TYPE_OBJECT);

	}

	gtk_rc_parse_string ("style \"anjuta-tab-close-button-style\"\n"
						 "{\n"
						 "GtkWidget::focus-padding = 0\n"
						 "GtkWidget::focus-line-width = 0\n"
						 "xthickness = 0\n"
						 "ythickness = 0\n"
						 "}\n"
						 "widget \"*.anjuta-tab-close-button\" style \"anjuta-tab-close-button-style\"");
}
Esempio n. 22
0
GtkWidget *
uim_toolbar_trayicon_new(void)
{
#if !GTK_CHECK_VERSION(2, 90, 0)
    gtk_rc_parse_string("\n"
                        "   style \"uim-systray-button-style\"\n"
                        "   {\n"
                        "      GtkWidget::focus-line-width=0\n"
                        "      GtkWidget::focus-padding=0\n"
                        "      ythickness=0\n"
                        "   }\n" "\n"
                        "    widget \"*.uim-systray-button\" style \"uim-systray-button-style\"\n"
                        "\n");
#endif

    return toolbar_new(TYPE_ICON);
}
Esempio n. 23
0
static void no_button_padding (GtkWidget *w)
{
    static int style_done;

    gtk_widget_set_name(w, "closer");

    if (!style_done) {
	gtk_rc_parse_string("style \"closer-style\"\n{\n"
			    "  GtkWidget::focus-padding = 0\n"
			    "  GtkWidget::focus-line-width = 0\n"
			    "  xthickness = 0\n"
			    "  ythickness = 0\n"
			    "}\n"
			    "widget \"*.closer\" style \"closer-style\"");
	style_done = 1;
    }
}
Esempio n. 24
0
/* Initialize the TilemDisasmView class */
static void tilem_disasm_view_class_init(TilemDisasmViewClass *klass)
{
	GtkTreeViewClass *tv_class = GTK_TREE_VIEW_CLASS(klass);
	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);

	gtk_rc_parse_string(default_style);

	parent_class = g_type_class_peek_parent(klass);

	widget_class->style_set = &tilem_disasm_view_style_set;
	widget_class->size_request = &tilem_disasm_view_size_request;
	widget_class->size_allocate = &tilem_disasm_view_size_allocate;
	widget_class->button_press_event = &tilem_disasm_view_button_press;
	widget_class->popup_menu = &tilem_disasm_view_popup_menu;
	widget_class->unrealize = &tilem_disasm_view_unrealize;
	tv_class->move_cursor = &tilem_disasm_view_move_cursor;
	tv_class->row_activated = &tilem_disasm_view_row_activated;
}
Esempio n. 25
0
GtkWidget *create_combo_with_history (GList **history)
{
	GtkWidget *combo;
	GList *node;

	combo = gtk_combo_box_text_new_with_entry ();
	//work around gtk silliness -
	//'appears-as-list' is a read-only style property instead of a widget property
	gtk_rc_parse_string (
		"style \"list-style-style\" { GtkComboBox::appears-as-list = 1 } "
		"widget \"*.list-style\" style \"list-style-style\"");
	gtk_widget_set_name (combo, "list-style");

	for (node = *history; node != NULL; node = g_list_next (node))
		gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), node->data);

	gtk_widget_show (combo);
	return combo;
}
Esempio n. 26
0
static inline void force_no_focus_padding (GtkWidget *widget)
{
  gboolean first_time=TRUE;

  if (first_time) {
    gtk_rc_parse_string ("\n"
			 "   style \"charpick-applet-button-style\"\n"
			 "   {\n"
			 "      GtkWidget::focus-line-width=0\n"
			 "      GtkWidget::focus-padding=0\n"
			 "   }\n"
			 "\n"
			 "    widget \"*.charpick-applet-button\" style \"charpick-applet-button-style\"\n"
			 "\n");
    first_time = FALSE;
  }

  gtk_widget_set_name (widget, "charpick-applet-button");
}
Esempio n. 27
0
/* There is no clean way to set the cursor-color, so we are stuck
 * with the following hack: set the name of each widget and parse
 * a gtkrc string.
 */
static void
gtk_modify_cursor_color (GtkWidget *textview,
                     GdkColor  *color)
{
        static const char cursor_color_rc[] =
                "style \"svs-cc\"\n"
                "{\n"
                        "GtkSourceView::cursor-color=\"#%04x%04x%04x\"\n"
                "}\n"
                "widget \"*.%s\" style : application \"svs-cc\"\n";

        const gchar *name;
        gchar *rc_temp;

        name = get_widget_name (textview);
        g_return_if_fail (name != NULL);

        if (color != NULL)
        {
                rc_temp = g_strdup_printf (cursor_color_rc,
                                           color->red,
                                           color->green,
                                           color->blue,
                                           name);
        }
        else
        {
                GtkRcStyle *rc_style;

                rc_style = gtk_widget_get_modifier_style (textview);

                rc_temp = g_strdup_printf (cursor_color_rc,
                                           rc_style->text [GTK_STATE_NORMAL].red,
                                           rc_style->text [GTK_STATE_NORMAL].green,
                                           rc_style->text [GTK_STATE_NORMAL].blue,
                                           name);
        }

        gtk_rc_parse_string (rc_temp);
        gtk_widget_reset_rc_styles (textview);

        g_free (rc_temp);
}
Esempio n. 28
0
static void
fix_style (G_GNUC_UNUSED GtkWidget *combo)
{
#ifdef __WIN32__
    static gboolean been_here = FALSE;

    gtk_widget_set_name (combo, "moo-lang-combo");

    if (!been_here)
    {
        been_here = TRUE;
        gtk_rc_parse_string ("style \"moo-lang-combo\"\n"
                             "{\n"
                             "   GtkComboBox::appears-as-list = 0\n"
                             "}\n"
                             "widget \"*.moo-lang-combo\" style \"moo-lang-combo\"\n");
    }
#endif
}
Esempio n. 29
0
static inline void force_no_focus_padding(GtkWidget* widget)
{
#if GTK_CHECK_VERSION (3, 0, 0)
    GtkCssProvider *provider;

    provider = gtk_css_provider_new ();
    gtk_css_provider_load_from_data (provider,
                                     "#na-tray {\n"
                                     " -GtkWidget-focus-line-width: 0px;\n"
                                     " -GtkWidget-focus-padding: 0px; }",
                                     -1, NULL);

    gtk_style_context_add_provider (gtk_widget_get_style_context (widget),
                                    GTK_STYLE_PROVIDER (provider),
                                    GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
    g_object_unref (provider);
#else
    static gboolean first_time = TRUE;

    if (first_time)
    {
        gtk_rc_parse_string ("\n"
                             "   style \"na-tray-style\"\n"
                             "   {\n"
                             "      GtkWidget::focus-line-width=0\n"
                             "      GtkWidget::focus-padding=0\n"
                             "   }\n"
                             "\n"
                             "    widget \"*.PanelAppletNaTray\" style \"na-tray-style\"\n"
                             "\n");

        first_time = FALSE;
    }

    /* El widget antes se llamaba na-tray
     *
     * Issue #27
     */
#endif

    gtk_widget_set_name(widget, "PanelAppletNaTray");
}
Esempio n. 30
0
static inline void
force_no_tree_separators (GtkWidget *widget)
{
	gboolean first_time = TRUE;

	if (first_time) {
		gtk_rc_parse_string ("\n"
				     "	 style \"mdm-userlist-treeview-style\"\n"
				     "	 {\n"
				     "	    GtkTreeView::horizontal-separator=0\n"
				     "	    GtkTreeView::vertical-separator=0\n"
				     "	 }\n"
				     "\n"
				     "	  widget \"*.mdm-userlist-treeview\" style \"mdm-userlist-treeview-style\"\n"
				     "\n");
		first_time = FALSE;
	}

	gtk_widget_set_name (widget, "mdm-userlist-treeview");
}