예제 #1
0
int
icon_editor_init(int *argc, char **argv)
{
  ewl_init(argc, argv);
  editor = calloc(1, sizeof(Icon_Editor));

  _icon_editor_gui_init();
  _icon_editor_gui_update();
  return 1;
}
예제 #2
0
파일: main.c 프로젝트: Limsik/e17
int main(int argc, char ** argv) {
    Ewl_Widget *win = NULL;

    if (!ewl_init(&argc, argv)) {
        printf("Unable to init ewl\n");
        return 1;
    }

    win = ewl_window_new();
    ewl_window_title_set(EWL_WINDOW(win), "EWL Window");
    ewl_window_name_set(EWL_WINDOW(win), "EWL_WINDOW");
    ewl_window_class_set(EWL_WINDOW(win), "EWLWindow");
    ewl_object_size_request(EWL_OBJECT(win), 200, 100);

    ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, destroy_cb, NULL);
    ewl_widget_show(win);

    ewl_main();

    return 0;
}
예제 #3
0
파일: ecrin.c 프로젝트: Limsik/e17
int
ecrin_init (char         *filename,
            Ecrin_Toolkit toolkit)
{
  if (!ecrin_parse_init (filename))
    return 0;

  if (!ecrin_hash_init ())
    return 0;
  
  switch (toolkit)
    {
    case TOOLKIT_EWL:
      if (!ewl_init (NULL, NULL))
        {
          printf ("Could not init ewl. Exiting...\n");
          return 0;
        }
      break;
    default:
      break;
    }
  return 1;
}
예제 #4
0
파일: edvi_ewl_test.c 프로젝트: Limsik/e17
int
main (int argc, char *argv[])
{
  Ecore_List     *str_data = NULL;
  Ewl_Widget     *window;
  Ewl_Widget     *hbox;
  Ewl_Widget     *list;
  Ewl_Model      *model;
  Ewl_View       *view;
  Ewl_Widget     *dvi;
  Ewl_Widget     *sp;
  const Edvi_Document  *document;
  int             page_count;
  int             i;

  if (argc == 1) {
    printf ("Usage: %s dvi_file\n", argv[0]);
    return EXIT_FAILURE;
  }

  printf ("[DVI] version       : %s\n", edvi_version_get ());
  if (!edvi_init (300, "cx", 4,
                  1.0, 1.0,
                  0, 255, 255, 255, 0, 0, 0))
    return EXIT_FAILURE;

  ewl_init (&argc, (char **)argv);
  str_data = ecore_list_new();
  ecore_list_free_cb_set (str_data, free);

  /* We open the dvi file */
  dvi = ewl_dvi_new ();
  if (!ewl_dvi_file_set (EWL_DVI (dvi), argv[1])) {
    printf ("Can not load the document %s\nExiting...", argv[1]);
    ecore_list_destroy (str_data);
    ewl_main_quit();
    return EXIT_FAILURE;
  }

  window = ewl_window_new ();
  ewl_window_title_set (EWL_WINDOW (window), "Ewl Dvi Test Application");
  ewl_callback_append (window, EWL_CALLBACK_DELETE_WINDOW,
                       _quit_cb, str_data);

  hbox = ewl_hbox_new ();
  ewl_box_homogeneous_set (EWL_BOX (hbox), FALSE);
  ewl_container_child_append (EWL_CONTAINER (window), hbox);
  ewl_widget_show (hbox);

  sp = ewl_scrollpane_new ();
  ewl_container_child_append (EWL_CONTAINER (hbox), sp);
  ewl_widget_show (sp);

  document = ewl_dvi_dvi_document_get (EWL_DVI (dvi));
  page_count = edvi_document_page_count_get (document);
  for (i = 0; i < page_count; i++) {
    char row_text[64];
    char *txt;

    snprintf (row_text, 64, "%d", i + 1);
    txt = strdup (row_text);
    ecore_list_append(str_data, txt);
  }

  model = ewl_model_ecore_list_instance();
  view = ewl_label_view_get();

  list = ewl_list_new ();
  ewl_mvc_model_set(EWL_MVC(list), model);
  ewl_mvc_view_set(EWL_MVC(list), view);
  ewl_mvc_data_set(EWL_MVC(list), str_data);
  ewl_callback_append (list,
                       EWL_CALLBACK_VALUE_CHANGED,
                       EWL_CALLBACK_FUNCTION (_change_page_cb),
                       dvi);
  ewl_container_child_append (EWL_CONTAINER (sp), list);
  ewl_widget_show (list);

  ewl_dvi_mag_set (EWL_DVI (dvi), 0.5);
  ewl_container_child_append (EWL_CONTAINER (hbox), dvi);
  ewl_widget_show (dvi);

  ewl_widget_show (window);

  ewl_main ();

  edvi_shutdown ();

  return EXIT_SUCCESS;
}
예제 #5
0
int
eke_gui_ewl_init(int *argc, char ** argv)
{
    if (!ewl_init(argc, argv)) return 0;
    return 1;
}
예제 #6
0
파일: main.c 프로젝트: playya/Enlightenment
/**
 * @param argc: Number of command line arguments supplied.
 * @param argv: Char* array containing the command line arguments supplied.
 * @return: To the system, normally 0.
 * @brief: The first function once enotes is called.
 */
int
main(int argc, char *argv[])
{
	int             note_count;

	/* IPC Check */
	ecore_ipc_init();
	dml("IPC Initiated Successfully", 1);

	/* loading will increment this if there are notes if not we may need to
	 * create a blank one */
	note_count = 0;

	if ((ecore_config_init("enotes")) == ECORE_CONFIG_ERR_FAIL) {
		ecore_ipc_shutdown();
		return (-1);
	}
	ecore_app_args_set(argc, (const char **) argv);

	ecore_config_app_describe("E-Notes - Sticky Notes for Enlightenment\n\
Copyright (c) Thomas Fletcher\n\
Usage: enotes [options]");

	/* Read the Usage and Configurations */
	main_config = mainconfig_new();
	if (read_configuration(main_config) != ECORE_CONFIG_PARSE_CONTINUE) {
		ecore_config_shutdown();
		ecore_ipc_shutdown();
		ecore_shutdown();
		mainconfig_free(main_config);
		return (-1);
	}

	dml("Successfully Read Configurations and Usage", 1);

	process_note_storage_locations();

	if (find_server() != 0) {
		if (remotecmd != NULL)
			send_to_server(remotecmd);
		else
			send_to_server("DEFNOTE");
	} else {
		dml("Server wasn't found.. Creating one", 1);
		/* Setup Server */
		setup_server();

		/* Initialise the E-Libs */
		ecore_init();
		ecore_x_init(NULL);
		ecore_app_args_set(argc, (const char **) argv);
		if (!ecore_evas_init()) {
			mainconfig_free(main_config);
			return -1;
		}
		ewl_init(&argc, argv);
		edje_init();

		dml("Efl Successfully Initiated", 1);

		autoload();
		/* create autosave timer */
		update_autosave();

		if (remotecmd != NULL)
			handle_ipc_message(remotecmd);

		/* Begin the Control Centre */
		if (main_config->controlcentre == 1) {
			setup_cc();
			dml("Control Centre Setup", 1);
		} else {
			dml("No Control Centre - Displaying Notice", 1);
			if (get_note_count() == 0)
				new_note();
		}

		if (main_config->welcome == 1) {
			open_welcome();
		}

		/* Begin the main loop */
		dml("Starting Main Loop", 1);
		ecore_main_loop_begin();

		dml("Main Loop Ended", 1);

		/* Save Controlcentre Settings */
		set_cc_pos();

		autosave();
		if (autosave_timer)
			ecore_timer_del(autosave_timer);

		/* Save and Free the Configuration */
		ecore_config_save();
		dml("Configuration Saved", 1);
		mainconfig_free(main_config);
		dml("Configuration Structure Free'd", 1);

		/* Shutdown the E-Libs */
		edje_shutdown();
		ecore_evas_shutdown();
		ecore_x_shutdown();
		ecore_shutdown();
		dml("Efl Shutdown", 1);
	}

	/* End IPC */
	ecore_ipc_shutdown();
	dml("IPC Shutdown", 1);

	dml("Leaving.", 1);
	return (0);
}
예제 #7
0
int main(int argc, char ** argv)
{
    Eli_App * eap;
    
    eap = NULL;

    /* Initialize NLS */
#ifdef ENABLE_NLS
    setlocale(LC_MESSAGES, "");
    setlocale(LC_MONETARY, "");
    setlocale(LC_CTYPE, "");
    bindtextdomain(PACKAGE, PACKAGE_LOCALE_DIR);
    bind_textdomain_codeset(PACKAGE, "UTF-8");
    textdomain(PACKAGE);
#endif
    /* Initialize Ecore */
    if (!ecore_init()) {
        fprintf(stderr, _("Elitaire Error: Cannot init Ecore\n"));
        return 1;
    }
    if (!ecore_file_init()) {
        fprintf(stderr, _("Elitaire Error: Cannot init Ecore File\n"));
        return 1;
    }
    /* Initialize Edje */
    if (!edje_init()) {
        fprintf(stderr, _("Elitaire Error: Cannot init Edje\n"));
        return 1;
    }
    /* Initialize Ecore_Config */
    if (ecore_config_init("elitaire") != ECORE_CONFIG_ERR_SUCC) {
        fprintf(stderr, _("Elitaire Error: Cannot init Ecore Config\n"));
        return 1;
    }
    /* Initialize Ewl */
    if (!ewl_init(&argc, argv)) {
        fprintf(stderr, _("Elitaire Error: Cannot init Ewl\n"));
        return 1;
    }
    /* Init Highscore and Statistics */
    eli_highscore_init("elitaire");
    eli_statistics_init("elitaire");
    help_reader_init(PACKAGE_DATA_DIR"/doc/");

    /* Init the main app */
    eap = eli_app_new();
    eli_app_init(eap, "edje");
    eli_app_gui_make(eap);

    ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, sig_exit_cb, eap);
    /* ***Main Loop*** */
    ecore_main_loop_begin();

    eli_app_del(eap);
    /* shutdown all */
    help_reader_shutdown();
    eli_statistics_shutdown();
    eli_highscore_shutdown();
    ewl_shutdown();
    //eli_app_gui_del(eap);
    ecore_config_shutdown();
    ecore_file_shutdown();
    edje_shutdown();

    ecore_evas_shutdown();

    ecore_shutdown();
    return 0;
}
예제 #8
0
파일: madpdf.c 프로젝트: quickhand/madpdf
int main ( int argc, char ** argv )
{	

    
    Ewl_Widget *vbox=NULL;
    Ewl_Widget *statbar=NULL;
    char *homedir;
    char *configfile;
    if(argc<2)
        return 1;
    
    if ( !ewl_init ( &argc, argv ) )
    {
        return 1;
    }

    //setlocale(LC_ALL, "");
    //textdomain("elementpdf");
    ewl_theme_theme_set(get_theme_file());
    
    homedir=getenv("HOME");
    configfile=(char *)calloc(strlen(homedir)+21 + 1, sizeof(char));
    strcat(configfile,homedir);
    strcat(configfile,"/.madpdf");
    
    if(!file_exists(configfile))
    {
        mkdir (configfile,S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH);
        
    }
    
    strcat(configfile,"/settings.xml");
    
    
    
    load_settings(configfile);
    
    win = ewl_window_new();
    ewl_window_title_set ( EWL_WINDOW ( win ), "EWL_WINDOW" );
    ewl_window_name_set ( EWL_WINDOW ( win ), "EWL_WINDOW" );
    ewl_window_class_set ( EWL_WINDOW ( win ), "EWLWindow" );
    ewl_object_size_request ( EWL_OBJECT ( win ), 600, 800 );
    ewl_callback_append ( win, EWL_CALLBACK_DELETE_WINDOW, destroy_cb, NULL );
    ewl_callback_append(win, EWL_CALLBACK_KEY_DOWN, cb_key_down, NULL);
    ewl_widget_name_set(win,"mainwindow");
    ewl_widget_show ( win );
 
    vbox=ewl_vbox_new();
    ewl_container_child_append(EWL_CONTAINER(win),vbox);
    ewl_object_fill_policy_set(EWL_OBJECT(vbox), EWL_FLAG_FILL_FILL);
    ewl_widget_show(vbox);
    
    scrollpane=ewl_scrollpane_new();
    ewl_container_child_append(EWL_CONTAINER(vbox),scrollpane);
    ewl_callback_append(scrollpane,EWL_CALLBACK_REVEAL,cb_scrollpane_revealed,NULL);
    ewl_scrollpane_hscrollbar_flag_set(EWL_SCROLLPANE(scrollpane),EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN);
    ewl_scrollpane_vscrollbar_flag_set(EWL_SCROLLPANE(scrollpane),EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN);
    //ewl_object_fill_policy_set(EWL_OBJECT(scrollpane), EWL_FLAG_FILL_FILL);
    //ewl_theme_data_str_set(EWL_WIDGET(scrollpane),"/scrollpane/group","ewl/blank");
    ewl_widget_show(scrollpane);
    
    trimpane=ewl_scrollpane_new();
    ewl_container_child_append(EWL_CONTAINER(scrollpane),trimpane);
    ewl_object_alignment_set(EWL_OBJECT(trimpane),EWL_FLAG_ALIGN_LEFT|EWL_FLAG_ALIGN_TOP);
    ewl_scrollpane_hscrollbar_flag_set(EWL_SCROLLPANE(trimpane),EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN);
    ewl_scrollpane_vscrollbar_flag_set(EWL_SCROLLPANE(trimpane),EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN);
    //ewl_theme_data_str_set(EWL_WIDGET(trimpane),"/scrollpane/group","ewl/blank");
    ewl_widget_show(trimpane);
    
    statbar=ewl_hbox_new();
    ewl_container_child_append(EWL_CONTAINER(vbox),statbar);
    ewl_theme_data_str_set(EWL_WIDGET(statbar),"/hbox/group","ewl/menu/oi_menu");
    ewl_object_fill_policy_set(EWL_OBJECT(statbar),EWL_FLAG_FILL_HFILL|EWL_FLAG_FILL_VSHRINKABLE);
    ewl_widget_show(statbar);
    
    statlabel1=ewl_label_new();   
    //ewl_statusbar_left_append(EWL_STATUSBAR(statbar),statlabel1);
    ewl_container_child_append(EWL_CONTAINER(statbar),statlabel1);
    ewl_theme_data_str_set(EWL_WIDGET(statlabel1),"/label/group","ewl/oi_statbar_label_left");
    ewl_theme_data_str_set(EWL_WIDGET(statlabel1),"/label/textpart","ewl/oi_statbar_label_left/text");
    ewl_object_fill_policy_set(EWL_OBJECT(statlabel1),EWL_FLAG_FILL_HSHRINKABLE);
    ewl_widget_show(statlabel1);
    
    statlabel2=ewl_label_new();   
    //ewl_statusbar_right_append(EWL_STATUSBAR(statbar),statlabel2);
    ewl_container_child_append(EWL_CONTAINER(statbar),statlabel2);
    ewl_theme_data_str_set(EWL_WIDGET(statlabel2),"/label/group","ewl/oi_statbar_label_right");
    ewl_theme_data_str_set(EWL_WIDGET(statlabel2),"/label/textpart","ewl/oi_statbar_label_right/text");
    ewl_object_fill_policy_set(EWL_OBJECT(statlabel2),EWL_FLAG_FILL_HFILL);
    ewl_widget_show(statlabel2);
    
    
    pdfwidget = ewl_pdf_new();
    ewl_pdf_file_set (EWL_PDF (pdfwidget), argv[1]);
    ewl_container_child_append(EWL_CONTAINER(trimpane),pdfwidget);
    ewl_object_alignment_set(EWL_OBJECT(pdfwidget),EWL_FLAG_ALIGN_LEFT|EWL_FLAG_ALIGN_TOP);
    ewl_widget_name_set(pdfwidget,"pdfwidget");
    ewl_callback_append (pdfwidget, EWL_CALLBACK_CONFIGURE, cb_pdfwidget_resized, NULL );
    ewl_widget_show (pdfwidget);
    
    //set up menu
    menu=ewl_context_menu_new();
    
    ewl_callback_append(menu, EWL_CALLBACK_KEY_DOWN, cb_menu_key_down, NULL);
    ewl_theme_data_str_set(EWL_WIDGET(menu),"/menu/group","ewl/menu/oi_menu");
    ewl_context_menu_attach(EWL_CONTEXT_MENU(menu), statbar);
    
    Ewl_Widget *temp=ewl_menu_new();
    ewl_container_child_append(EWL_CONTAINER(menu),temp);
    ewl_widget_name_set(temp,"menuitem1");
    ewl_button_label_set(EWL_BUTTON(temp),"1. Go to page...");
    ewl_widget_show(temp);

    goto_entry=ewl_entry_new();
    ewl_container_child_append(EWL_CONTAINER(temp),goto_entry);
    ewl_object_custom_w_set(EWL_OBJECT(goto_entry),50);
    ewl_callback_append(goto_entry, EWL_CALLBACK_KEY_DOWN, cb_goto_key_down, NULL);
    ewl_widget_show(goto_entry);
    
    
    temp=ewl_menu_item_new();
    ewl_widget_name_set(temp,"menuitem2");
    ewl_container_child_append(EWL_CONTAINER(menu),temp);
    ewl_button_label_set(EWL_BUTTON(temp),"2. Preferences...");
    ewl_widget_show(temp);

        
    
    
    ewl_main();
    save_settings(configfile);
    free(configfile);
    free_settings();
    return 0;
}
예제 #9
0
bool ui_init(ePlayer *player) {
	int zero = 0;
	char buf[PATH_MAX];
	
	debug(DEBUG_LEVEL_INFO, "Starting setup\n");
	
	ecore_init();
	ecore_evas_init();
	edje_init();
	ewl_init(&zero, NULL);

	ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, app_signal_exit,
	                        NULL);

#ifdef HAVE_ECORE_EVAS_GL
	if (!strcasecmp(player->cfg.evas_engine, "gl")) {
		debug(DEBUG_LEVEL_INFO, "Starting EVAS GL X11\n");
		player->gui.ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 0, 0);
	} else
#endif

#ifdef HAVE_ECORE_EVAS_FB
	if (!strcasecmp(player->cfg.evas_engine, "fb")) {
		debug(DEBUG_LEVEL_INFO, "Starting EVAS FB\n");
		player->gui.ee = ecore_evas_fb_new(NULL, 0, 0, 0);
	} else
#endif
	
	{
		debug(DEBUG_LEVEL_INFO, "Starting EVAS X11\n");
		player->gui.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 0, 0);
	}
			
	if (!player->gui.ee) {
		debug(DEBUG_LEVEL_CRITICAL,
		      "Cannot create Ecore Evas (using %s engine)\n",
		      player->cfg.evas_engine);

		return false;
	}
	
	ecore_evas_title_set(player->gui.ee, "ePlayer");
	ecore_evas_name_class_set(player->gui.ee, "ecore_test",
	                          "test_evas");
	ecore_evas_borderless_set(player->gui.ee, 1);
	ecore_evas_shaped_set(player->gui.ee, 1);

	ecore_evas_callback_pre_render_set(player->gui.ee,
	                                   cb_ee_pre_render);
	ecore_evas_callback_post_render_set(player->gui.ee,
	                                    cb_ee_post_render);
	ecore_evas_callback_resize_set(player->gui.ee, cb_ee_resize);

	ecore_evas_show(player->gui.ee);

	player->gui.evas = ecore_evas_get(player->gui.ee);

	snprintf(buf, sizeof(buf), "%s/.e/apps/%s/fonts",
	         getenv("HOME"), PACKAGE);

	evas_font_path_append(player->gui.evas, buf);
	evas_font_path_append(player->gui.evas, DATA_DIR "/fonts");
	evas_font_path_append(player->gui.evas, "/usr/X11R6/lib/X11/fonts");
	evas_font_path_append(player->gui.evas, "/usr/share/fonts");

	if (!ui_init_dragger(player))
		return false;

	return ui_init_edje(player, "eplayer");
}