Ejemplo n.º 1
0
void Plugins::load_mml() {
  XML_Loader_SDL loader;
  loader.CurrentElement = &RootParser;

  for (std::vector<Plugin>::iterator it = m_plugins.begin();
       it != m_plugins.end(); ++it)
  {
    if (it->enabled && !it->hud_lua.size() && !it->solo_lua.size() &&
        !it->theme.size() && it->compatible()) {
      load_mmls(*it, loader);
    }
  }

  if (!environment_preferences->use_hud_lua) {
    const Plugin* hud_lua = find_hud_lua();
    if (hud_lua) {
      load_mmls(*hud_lua, loader);
    }
  }

  const Plugin* theme = find_theme();
  if (theme) {
    load_mmls(*theme, loader);
  }
}
Ejemplo n.º 2
0
int main(int argc, char **argv) {

    init_efl();

    char *theme = find_theme();
    if (!theme)
		fatal("Could not find theme");

    Ecore_Evas *ee = ecore_evas_software_x11_new(NULL, 0,  0, 0, 400, 400);
    if (!ee) {
		fprintf(stderr, "FATAL: Could not get an ee...\n");
		exit(1);
	}
    Ecore_X_Screen_Size sz = get_screen_size(ee);
    ecore_evas_resize(ee, sz.width, sz.height);
    ecore_evas_title_set(ee, "Launcher");
    ecore_evas_borderless_set(ee, 1);
    ecore_evas_fullscreen_set(ee, 1);

    Evas *evas = ecore_evas_get(ee);
    Evas_Object *edje = edje_object_add(evas);
    edje_object_file_set(edje, theme, "main");
    evas_object_move(edje, 0, 0);
    evas_object_resize(edje, sz.width, sz.height);
    evas_object_show(edje);

    ecore_evas_show(ee);
    ecore_main_loop_begin();

	shutdown_efl();

    return 0;

}
Ejemplo n.º 3
0
bool ui_init_edje(ePlayer *player, const char *name) {
	double edje_w = 0, edje_h = 0;

	debug(DEBUG_LEVEL_INFO, "EDJE: Defining Edje \n");

	if (!(player->gui.edje = edje_object_add(player->gui.evas))) {
		debug(DEBUG_LEVEL_CRITICAL, "Cannot create Edje!\n");
		return false;
	}

	evas_object_name_set(player->gui.edje, "main_edje");

	if (!edje_object_file_set(player->gui.edje,
	                          find_theme(player->cfg.theme),
	                          name)) {
		debug(DEBUG_LEVEL_CRITICAL, "Cannot load theme '%s'!\n",
		      player->cfg.theme);
		return false;
	}
	
	evas_object_move(player->gui.edje, 0, 0);
	evas_object_pass_events_set (player->gui.edje, 1);
	evas_object_show(player->gui.edje);

	/* set max size */
	edje_object_size_max_get(player->gui.edje, &edje_w, &edje_h);
	ecore_evas_size_max_set(player->gui.ee, edje_w, edje_h);

	/* set min size */
	edje_object_size_min_get(player->gui.edje, &edje_w, &edje_h);
	ecore_evas_size_min_set(player->gui.ee, edje_w, edje_h);
	
	/* resize to the min size */
	ecore_evas_resize(player->gui.ee, (int) edje_w, (int) edje_h);
	
	setup_playlist(player);
	ui_refresh_volume(player);

	register_callbacks(player);

	return true;
}
Ejemplo n.º 4
0
static void
configure_term_widget (VteTerminal  *vtterm,
                       GVariantDict *options)
{
    /* Pick default settings from the settings... */
    dg_lmem gchar *opt_font = NULL;
    dg_lmem gchar *opt_theme = NULL;
    dg_lmem gchar *opt_fgcolor = NULL;
    dg_lmem gchar *opt_bgcolor = NULL;
    gboolean opt_bold;
    guint opt_scroll;
    DwtSettings *settings = dwt_settings_get_instance ();

    g_object_get (settings,
                  "font", &opt_font,
                  "theme", &opt_theme,
                  "allow-bold", &opt_bold,
                  "scrollback", &opt_scroll,
                  "foreground-color", &opt_fgcolor,
                  "background-color", &opt_bgcolor,
                  NULL);

    /*
     * This ensures that properties are updated for the terminal whenever they
     * change in the configuration files.
     *
     * TODO: For now this is done only for those properties which cannot be
     *       overriden using command line flags.
     */
    static const struct {
        const gchar  *setting_name;
        const gchar  *property_name;
        GBindingFlags bind_flags;
    } property_bind_map[] = {
        { "mouse-autohide", "pointer-autohide", G_BINDING_SYNC_CREATE },
        { "audible-bell",   "audible-bell",     G_BINDING_SYNC_CREATE },
    };
    for (guint i = 0; i < G_N_ELEMENTS (property_bind_map); i++) {
        g_object_bind_property (settings,
                                property_bind_map[i].setting_name,
                                G_OBJECT (vtterm),
                                property_bind_map[i].property_name,
                                property_bind_map[i].bind_flags);
    }

    /* ...and allow command line options to override them. */
    if (options) {
        dg_lmem gchar *cmd_font = NULL;
        g_variant_dict_lookup (options, "font", "s", &cmd_font);
        if (cmd_font) SWAP (gchar*, cmd_font, opt_font);

        dg_lmem gchar *cmd_theme = NULL;
        g_variant_dict_lookup (options, "theme", "s", &cmd_theme);
        if (cmd_theme) SWAP (gchar*, cmd_theme, opt_theme);

        g_variant_dict_lookup (options, "allow-bold", "b", &opt_bold);
        g_variant_dict_lookup (options, "scrollback", "u", &opt_scroll);
    }

    PangoFontDescription *fontd = pango_font_description_from_string (opt_font);
    if (fontd) {
      if (!pango_font_description_get_family (fontd))
        pango_font_description_set_family_static (fontd, "monospace");
      if (!pango_font_description_get_size (fontd))
        pango_font_description_set_size (fontd, 12 * PANGO_SCALE);
      vte_terminal_set_font (vtterm, fontd);
      pango_font_description_free (fontd);
      fontd = NULL;
    }

    const Theme *theme = &themes[1];
    if (opt_theme) {
        theme = find_theme (opt_theme);
        if (!theme) {
            g_printerr ("No such theme '%s', using default (linux)\n", opt_theme);
            theme = &themes[1];
        }
    }

    GdkRGBA fgcolor, bgcolor;
    if (!(opt_fgcolor && gdk_rgba_parse (&fgcolor, opt_fgcolor)))
        fgcolor = theme->fg;
    if (!(opt_bgcolor && gdk_rgba_parse (&bgcolor, opt_bgcolor)))
        bgcolor = theme->bg;

    vte_terminal_set_rewrap_on_resize    (vtterm, TRUE);
    vte_terminal_set_scroll_on_keystroke (vtterm, TRUE);
    vte_terminal_set_audible_bell        (vtterm, FALSE);
    vte_terminal_set_scroll_on_output    (vtterm, FALSE);
    vte_terminal_set_allow_bold          (vtterm, opt_bold);
    vte_terminal_set_scrollback_lines    (vtterm, opt_scroll);
    vte_terminal_set_cursor_blink_mode   (vtterm, VTE_CURSOR_BLINK_OFF);
    vte_terminal_set_cursor_shape        (vtterm, VTE_CURSOR_SHAPE_BLOCK);
    vte_terminal_set_colors              (vtterm,
                                          &fgcolor,
                                          &bgcolor,
                                          theme->colors,
                                          G_N_ELEMENTS (theme->colors));

    const GRegexCompileFlags regex_compile_flags =
        G_REGEX_CASELESS | G_REGEX_OPTIMIZE | G_REGEX_MULTILINE;
    gint match_tag =
        vte_terminal_match_add_gregex (vtterm,
                                       g_regex_new (uri_regexp,
                                                    regex_compile_flags,
                                                    G_REGEX_MATCH_NOTEMPTY,
                                                    NULL),
                                       G_REGEX_MATCH_NOTEMPTY);
    vte_terminal_match_set_cursor_type (vtterm, match_tag, GDK_HAND2);
}