コード例 #1
0
ファイル: systraybar.c プロジェクト: bbidulock/tint2
void net_message(XClientMessageEvent *e)
{
	if (systray_profile)
		fprintf(stderr, "[%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__);

	Window win;
	unsigned long opcode = e->data.l[1];
	switch (opcode) {
	case SYSTEM_TRAY_REQUEST_DOCK:
		win = e->data.l[2];
		if (win)
			add_icon(win);
		break;

	case SYSTEM_TRAY_BEGIN_MESSAGE:
	case SYSTEM_TRAY_CANCEL_MESSAGE:
		// we don't show baloons messages.
		break;

	default:
		if (opcode == server.atom._NET_SYSTEM_TRAY_MESSAGE_DATA)
			fprintf(stderr, "message from dockapp: %s\n", e->data.b);
		else
			fprintf(stderr, RED "SYSTEM_TRAY : unknown message type" RESET "\n");
		break;
	}
}
コード例 #2
0
ファイル: main.c プロジェクト: kinnalru/x2wintray
void map_notify(XMapEvent ev)
{
#ifndef NO_NATIVE_KDE
	/* Legacy scheme to handle KDE icons */
	if (tray_data.kde_tray_old_mode) {
		struct TrayIcon *ti = icon_list_find_ex(ev.window);
		if (ti == NULL) {
			Window w = kde_tray_find_icon(tray_data.dpy, ev.window);
			if (w != None) {
				LOG_TRACE(("Legacy scheme for KDE icons: detected KDE icon 0x%x. Adding.\n", w));
				add_icon(w, CM_KDE);
				/* TODO: remove some properties to trick ion3 so that it no longer thinks that w is a toplevel. 
				 * Candidates for removal: 
				 * 	- WM_STATE */
			}
		}
	}
#endif
}
コード例 #3
0
ファイル: button.cpp プロジェクト: Arikado/Wii-Homebrew
Button::Button(std::string icon_file, std::string ninfo, SDLKey nshortcut, int x, int y, int mw, int mh)
{
  popup_timer.init(false);

  add_icon(icon_file,mw,mh);

  info = ninfo;

  shortcut = nshortcut;

  rect.x = x;
  rect.y = y;
  rect.w = icon[0]->w;
  rect.h = icon[0]->h;
  tag = -1;
  state = BUTTON_NONE;
  show_info = false;
  game_object = NULL;
}
コード例 #4
0
ファイル: main.c プロジェクト: kinnalru/x2wintray
/* TODO: move to kde_tray.c */
void kde_icons_update()
{
	unsigned long list_len, i;
	Window *kde_tray_icons;
	if (tray_data.kde_tray_old_mode || 
		!x11_get_root_winlist_prop(tray_data.dpy, tray_data.xa_kde_net_system_tray_windows, 
				(unsigned char **) &kde_tray_icons, &list_len)) 
	{
		return;
	}
	for (i = 0; i < list_len; i++) 
		/* If the icon is not None and is non old, try to add it
		 * (if the icon is already there, nothing is gonna happen). */
		if (kde_tray_icons[i] != None && !kde_tray_is_old_icon(kde_tray_icons[i])) 
		{
			LOG_TRACE(("found (possibly unembedded) KDE icon %s (wid 0x%x)\n", 
						x11_get_window_name(tray_data.dpy, kde_tray_icons[i], "<unknown>"),
						kde_tray_icons[i]));
			add_icon(kde_tray_icons[i], CM_KDE);
		}
	XFree(kde_tray_icons);
}
コード例 #5
0
ファイル: gdl-stock.c プロジェクト: wdmchaft/DoonSketch
void
gdl_stock_init (void)
{
	static gboolean initialized = FALSE;
	gint i;

	if (initialized)
		return;

	gdl_stock_factory = gtk_icon_factory_new ();

	for (i = 0; i < G_N_ELEMENTS (gdl_icons); i++) {
		add_icon (gdl_stock_factory,
			  gdl_icons[i].stock_id,
			  gdl_icons[i].icon_data, 
			  gdl_icons[i].data_size);
	}

	gtk_icon_factory_add_default (gdl_stock_factory);

	initialized = TRUE;
}
コード例 #6
0
ファイル: application.c プロジェクト: UIKit0/gnumeric
static void
install_icons (GnmApp *app)
{
	static const char *icons[] = {
		/* Cursors */
		"cursor_cross.xpm",
		"bucket.xpm",
		"font.xpm",
		"sheet_move_marker.xpm",

		/* Patterns */
		"gp_125grey.xpm",
		"gp_25grey.xpm",
		"gp_50grey.xpm",
		"gp_625grey.xpm",
		"gp_75grey.xpm",
		"gp_bricks.xpm",
		"gp_diag.xpm",
		"gp_diag_cross.xpm",
		"gp_foreground_solid.xpm",
		"gp_horiz.xpm",
		"gp_large_circles.xpm",
		"gp_rev_diag.xpm",
		"gp_semi_circle.xpm",
		"gp_small_circle.xpm",
		"gp_solid.xpm",
		"gp_thatch.xpm",
		"gp_thick_diag_cross.xpm",
		"gp_thin_diag.xpm",
		"gp_thin_diag_cross.xpm",
		"gp_thin_horiz.xpm",
		"gp_thin_horiz_cross.xpm",
		"gp_thin_rev_diag.xpm",
		"gp_thin_vert.xpm",
		"gp_vert.xpm",
		"line_pattern_dash_dot.xpm",
		"line_pattern_dash_dot_dot.xpm",
		"line_pattern_dashed.xpm",
		"line_pattern_dotted.xpm",
		"line_pattern_double.xpm",
		"line_pattern_hair.xpm",
		"line_pattern_medium.xpm",
		"line_pattern_medium_dash.xpm",
		"line_pattern_medium_dash_dot.xpm",
		"line_pattern_medium_dash_dot_dot.xpm",
		"line_pattern_slant.xpm",
		"line_pattern_thick.xpm",
		"line_pattern_thin.xpm",

		/* Borders */
		"bottom_border.xpm",
		"diag_border.xpm",
		"inside_border.xpm",
		"inside_horiz_border.xpm",
		"inside_vert_border.xpm",
		"left_border.xpm",
		"no_border.xpm",
		"outline_border.xpm",
		"rev_diag_border.xpm",
		"right_border.xpm",
		"top_border.xpm"
	};
	static struct {
		const char *scalable_filename;
		const char *sized_filename;
		const char *stock_id;
	} const icons2[] = {
		{
			"column_add_24.xpm",
			"column_add_16.xpm",
			"Gnumeric_ColumnAdd"
		},
		{
			"column_delete_24.xpm",
			"column_delete_16.xpm",
			"Gnumeric_ColumnDelete"
		},
		{
			"column_size_24.xpm",
			"column_size_16.xpm",
			"Gnumeric_ColumnSize"
		},
		{
			"column_hide_24.xpm",
			"column_hide_16.xpm",
			"Gnumeric_ColumnHide"
		},
		{
			"column_unhide_24.xpm",
			"column_unhide_16.xpm",
			"Gnumeric_ColumnUnhide"
		},
		{
			"row_add_24.xpm",
			"row_add_16.xpm",
			"Gnumeric_RowAdd"
		},
		{
			"row_delete_24.xpm",
			"row_delete_16.xpm",
			"Gnumeric_RowDelete"
		},
		{
			"row_size_24.xpm",
			"row_size_16.xpm",
			"Gnumeric_RowSize"
		},
		{
			"row_hide_24.xpm",
			"row_hide_16.xpm",
			"Gnumeric_RowHide"
		},
		{
			"row_unhide_24.xpm",
			"row_unhide_16.xpm",
			"Gnumeric_RowUnhide"
		},

		{
			"group_24.xpm",
			"group_16.xpm",
			"Gnumeric_Group"
		},
		{
			"ungroup_24.xpm",
			"ungroup_16.xpm",
			"Gnumeric_Ungroup"
		},
		{
			"show_detail_24.xpm",
			"show_detail_16.xpm",
			"Gnumeric_ShowDetail"
		},
		{
			"hide_detail_24.xpm",
			"hide_detail_16.xpm",
			"Gnumeric_HideDetail"
		},

		{
			"graph_guru_24.xpm",
			"graph_guru_16.xpm",
			"Gnumeric_GraphGuru"
		},
		{
			"insert_component_24.xpm",
			"insert_component_16.xpm",
			"Gnumeric_InsertComponent"
		},
		{
			"insert_shaped_component_24.xpm",
			"insert_shaped_component_16.xpm",
			"Gnumeric_InsertShapedComponent"
		},

		{
			"center_across_selection_24.xpm",
			"center_across_selection_16.xpm",
			"Gnumeric_CenterAcrossSelection"
		},
		{
			"merge_cells_24.xpm",
			"merge_cells_16.xpm",
			"Gnumeric_MergeCells"
		},
		{
			"split_cells_24.xpm",
			"split_cells_16.xpm",
			"Gnumeric_SplitCells"
		},

		{
			"halign-fill_24.png",
			NULL,
			"Gnumeric_HAlignFill"
		},
		{
			"halign-general_24.png",
			NULL,
			"Gnumeric_HAlignGeneral"
		},

		{
			NULL,
			"comment_add_16.xpm",
			"Gnumeric_CommentAdd"
		},
		{
			NULL,
			"comment_delete_16.xpm",
			"Gnumeric_CommentDelete"
		},
		{
			NULL,
			"comment_edit_16.xpm",
			"Gnumeric_CommentEdit"
		},

		{
			"add_decimals.png",
			NULL,
			"Gnumeric_FormatAddPrecision"
		},
		{
			"remove_decimals.png",
			NULL,
			"Gnumeric_FormatRemovePrecision"
		},
		{
			"format_money_24.png",
			NULL,
			"Gnumeric_FormatAsAccounting"
		},
		{
			"format_percent_24.png",
			NULL,
			"Gnumeric_FormatAsPercentage"
		},
		{
			"thousands.xpm",
			NULL,
			"Gnumeric_FormatThousandSeparator"
		},
		{
			"gnm_subscript_24.png",
			"gnm_subscript_16.png",
			"Gnumeric_Subscript"
		},
		{
			"gnm_superscript_24.png",
			"gnm_superscript_16.png",
			"Gnumeric_Superscript"
		},

		{
			"auto-sum.xpm",
			NULL,
			"Gnumeric_AutoSum"
		},
		{
			"equal-sign.xpm",
			NULL,
			"Gnumeric_Equal"
		},
		{
			"formula_guru_24.png",
			"formula_guru_16.png",
			"Gnumeric_FormulaGuru"
		},
		{
			"insert_image_24.png",
			"insert_image_16.png",
			"Gnumeric_InsertImage"
		},
		{
			"bucket.xpm",
			NULL,
			"Gnumeric_Bucket"
		},
		{
			"font.xpm",
			NULL,
			"Gnumeric_Font"
		},
		{
			"expr_entry.png",
			NULL,
			"Gnumeric_ExprEntry"
		},
		{
			"brush-22.png",
			"brush-16.png",
			"Gnumeric_Brush"
		},

		{
			"object_arrow_24.png",
			NULL,
			"Gnumeric_ObjectArrow"
		},
		{
			"object_ellipse_24.png",
			NULL,
			"Gnumeric_ObjectEllipse"
		},
		{
			"object_line_24.png",
			NULL,
			"Gnumeric_ObjectLine"
		},

		{
			"object_rectangle_24.png",
			NULL,
			"Gnumeric_ObjectRectangle"
		},

		{
			"object_frame_24.png",
			NULL,
			"Gnumeric_ObjectFrame"
		},
		{
			"object_label_24.png",
			NULL,
			"Gnumeric_ObjectLabel"
		},
		{
			"object_button_24.png",
			NULL,
			"Gnumeric_ObjectButton"
		},
		{
			"object_checkbox_24.png",
			NULL,
			"Gnumeric_ObjectCheckbox"
		},
		{
			"object_radiobutton_24.png",
			NULL,
			"Gnumeric_ObjectRadioButton"
		},
		{
			"object_scrollbar_24.png",
			NULL,
			"Gnumeric_ObjectScrollbar"
		},
		{
			"object_spinbutton_24.png",
			NULL,
			"Gnumeric_ObjectSpinButton"
		},
		{
			"object_slider_24.png",
			NULL,
			"Gnumeric_ObjectSlider"
		},
		{
			"object_combo_24.png",
			NULL,
			"Gnumeric_ObjectCombo"
		},
		{
			"object_list_24.png",
			NULL,
			"Gnumeric_ObjectList"
		},

		{
			"pivottable_24.png",
			"pivottable_16.png",
			"Gnumeric_PivotTable"
		},
		{
			"protection_yes_24.png",
			NULL,
			"Gnumeric_Protection_Yes"
		},
		{
			"protection_no_24.png",
			NULL,
			"Gnumeric_Protection_No"
		},
		{
			"protection_yes_48.png",
			NULL,
			"Gnumeric_Protection_Yes_Dialog"
		},
		{
			"visible.png",
			NULL,
			"Gnumeric_Visible"
		},

		{
			"link_add_24.png",
			"link_add_16.png",
			"Gnumeric_Link_Add"
		},
		{
			NULL,
			"link_delete_16.png",
			"Gnumeric_Link_Delete"
		},
		{
			NULL,
			"link_edit_16.png",
			"Gnumeric_Link_Edit"
		},
		{
			"link_external_24.png",
			"link_external_16.png",
			"Gnumeric_Link_External"
		},
		{
			"link_internal_24.png",
			"link_internal_16.png",
			"Gnumeric_Link_Internal"
		},
		{
			"link_email_24.png",
			"link_email_16.png",
			"Gnumeric_Link_EMail"
		},
		{
			"link_url_24.png",
			"link_url_16.png",
			"Gnumeric_Link_URL"
		},

		{
			"autofilter_24.png",
			"autofilter_16.png",
			"Gnumeric_AutoFilter"
		},
		{
			"autofilter_delete_24.png",
			"autofilter_delete_16.png",
			"Gnumeric_AutoFilterDelete"
		},

		{
			"border_left.xpm",
			NULL,
			"Gnumeric_BorderLeft"
		},
		{
			"border_none.xpm",
			NULL,
			"Gnumeric_BorderNone"
		},
		{
			"border_right.xpm",
			NULL,
			"Gnumeric_BorderRight"
		},
		{
			"border_all.xpm",
			NULL,
			"Gnumeric_BorderAll"
		},
		{
			"border_outside.xpm",
			NULL,
			"Gnumeric_BorderOutside"
		},
		{
			"border_thick_outside.xpm",
			NULL,
			"Gnumeric_BorderThickOutside"
		},
		{
			"border_bottom.xpm",
			NULL,
			"Gnumeric_BorderBottom"
		},
		{
			"border_double_bottom.xpm",
			NULL,
			"Gnumeric_BorderDoubleBottom"
		},
		{
			"border_thick_bottom.xpm",
			NULL,
			"Gnumeric_BorderThickBottom"
		},
		{
			"border_top_n_bottom.xpm",
			NULL,
			"Gnumeric_BorderTop_n_Bottom"
		},
		{
			"border_top_n_double_bottom.xpm",
			NULL,
			"Gnumeric_BorderTop_n_DoubleBottom"
		},
		{
			"border_top_n_thick_bottom.xpm",
			NULL,
			"Gnumeric_BorderTop_n_ThickBottom"
		},

		{
			"hf_page.png",
			NULL,
			"Gnumeric_Pagesetup_HF_Page"
		},
		{
			"hf_pages.png",
			NULL,
			"Gnumeric_Pagesetup_HF_Pages"
		},
		{
			"hf_time.png",
			NULL,
			"Gnumeric_Pagesetup_HF_Time"
		},
		{
			"hf_date.png",
			NULL,
			"Gnumeric_Pagesetup_HF_Date"
		},
		{
			"hf_sheet.png",
			NULL,
			"Gnumeric_Pagesetup_HF_Sheet"
		},
		{
			"hf_cell.png",
			NULL,
			"Gnumeric_Pagesetup_HF_Cell"
		},
	};

	GtkIconFactory *factory = gtk_icon_factory_new ();
	unsigned int ui;

	for (ui = 0; ui < G_N_ELEMENTS (icons); ui++) {
		const char *filename = icons[ui];
		char *res = g_strconcat ("res:gnm:pixmaps/", filename, NULL);
		char *iconname;
		GdkPixbuf *pixbuf = go_gdk_pixbuf_load_from_file (res);
		int size = gdk_pixbuf_get_width (pixbuf);

		iconname = g_strdup (filename);
		strchr(iconname, '.')[0] = 0;
		gtk_icon_theme_add_builtin_icon (iconname,
						 size,
						 pixbuf);

		g_object_unref (pixbuf);
		g_free (iconname);
		g_free (res);
	}

	for (ui = 0; ui < G_N_ELEMENTS (icons2) ; ui++)
		add_icon (factory,
			  icons2[ui].scalable_filename,
			  icons2[ui].sized_filename,
			  icons2[ui].stock_id);
	gtk_icon_factory_add_default (factory);
	g_object_set_data_full (G_OBJECT (app),
				"icon-factory", factory,
				(GDestroyNotify)gtk_icon_factory_remove_default);
	g_object_unref (factory);
}
コード例 #7
0
ファイル: main.c プロジェクト: kinnalru/x2wintray
void client_message(XClientMessageEvent ev)
{
	int cmode = CM_FDO;
	struct TrayIcon *ti;
#ifdef DEBUG
	/* Print neat message(s) about this event to aid debugging */
	char *msg_type_name;
	msg_type_name = XGetAtomName(tray_data.dpy, ev.message_type);
	if (msg_type_name != NULL) {
		LOG_TRACE(("message \"%s\"\n", msg_type_name));
		XFree(msg_type_name);
	}
	if (ev.message_type == tray_data.xa_wm_protocols) {
		msg_type_name = XGetAtomName(tray_data.dpy, ev.data.l[0]);
		if (msg_type_name != NULL) {
			LOG_TRACE(("WM_PROTOCOLS message type: %s\n", msg_type_name));
			XFree(msg_type_name);
		}
	}
#endif
	/* Graceful exit */
	if (ev.message_type == tray_data.xa_wm_protocols &&
		ev.data.l[0] == tray_data.xa_wm_delete_window && 
		ev.window == tray_data.tray)
	{
		LOG_TRACE(("got WM_DELETE message, will now exit\n"));
		exit(0); // atexit will call cleanup()
	} 
	/* Handle _NET_SYSTEM_TRAY_* messages */
	if (ev.message_type == tray_data.xa_tray_opcode && tray_data.is_active) {
		LOG_TRACE(("this is the _NET_SYSTEM_TRAY_OPCODE(%lu) message\n", ev.data.l[1]));
		switch (ev.data.l[1]) {
			/* This is the starting point of NET SYSTEM TRAY protocol */
			case SYSTEM_TRAY_REQUEST_DOCK:
				LOG_TRACE(("dockin' requested by window 0x%x, serving in a moment\n", ev.data.l[2]));
#ifndef NO_NATIVE_KDE
				if (kde_tray_check_for_icon(tray_data.dpy, ev.data.l[2])) cmode = CM_KDE;
				if (kde_tray_is_old_icon(ev.data.l[2])) kde_tray_old_icons_remove(ev.data.l[2]);
#endif
				add_icon(ev.data.l[2], cmode);
				break;
			/* We ignore these messages, since we do not show
			 * any baloons anyways */
			case SYSTEM_TRAY_BEGIN_MESSAGE:
			case SYSTEM_TRAY_CANCEL_MESSAGE:
				break;
			/* Below are special cases added by this implementation */
			/* STALONETRAY_TRAY_DOCK_CONFIRMED is sent by stalonetray 
			 * to itself. (see embed.c) */
			case STALONE_TRAY_DOCK_CONFIRMED:
				ti = icon_list_find(ev.data.l[2]);
				if (ti != NULL && !ti->is_embedded) {
					ti->is_embedded = True;
					LOG_TRACE(("embedding confirmed for icon 0x%x\n", ti->wid));
#ifdef DEBUG
					dump_tray_status();
#endif
				}
				tray_update_window_props();
				break;
			/* Dump tray status on request */
			case STALONE_TRAY_STATUS_REQUESTED:
				dump_tray_status();
				break;
			/* Find icon and scroll to it if necessary */
			case STALONE_TRAY_REMOTE_CONTROL:
				ti = icon_list_find(ev.window);
				if (ti == NULL) break;
				scrollbars_scroll_to(ti);
#if 0
				/* Quick hack */
				{
					Window icon = ev.window;
					int rc;
					int x = ev.data.l[3], y = ev.data.l[4], depth = 0, idummy, i;
					int btn = ev.data.l[2];
					Window win, root;
					unsigned int udummy, w, h;
					XGetGeometry(tray_data.dpy, icon, &root, 
							&idummy, &idummy, 
							&w, &h, &udummy, &udummy);
					LOG_TRACE(("wid=0x%x w=%d h=%d\n", icon, w, h));
					x = (x == REMOTE_CLICK_POS_DEFAULT) ? w / 2 : x;
					y = (y == REMOTE_CLICK_POS_DEFAULT) ? h / 2 : y;
					/* 3.2. Find subwindow to execute click on */
					win = x11_find_subwindow_at(tray_data.dpy, icon, &x, &y, depth);
					/* 3.3. Send mouse click(s) to target */
					LOG_TRACE(("wid=0x%x btn=%d x=%d y=%d\n", 
								win, btn, x, y));
#define SEND_BTN_EVENT(press, time) do { \
					x11_send_button(tray_data.dpy, /* dispslay */ \
							press, /* event type */ \
							win, /* target window */ \
							root, /* root window */ \
							time, /* time */ \
							btn, /* button */ \
							Button1Mask << (btn - 1), /* state mask */ \
							x, /* x coord (relative) */ \
							y); /* y coord (relative) */ \
				} while (0)
					for (i = 0; i < ev.data.l[0]; i++) {
						SEND_BTN_EVENT(1, x11_get_server_timestamp(tray_data.dpy, tray_data.tray));
						my_usleep(250);
						SEND_BTN_EVENT(0, x11_get_server_timestamp(tray_data.dpy, tray_data.tray));
					}
#undef SEND_BTN_EVENT
				}
#endif
				break;
			default:
				break;
		}
	}
#ifdef DEBUG
	if (ev.message_type == tray_data.xa_tray_opcode && !tray_data.is_active)
		LOG_TRACE(("ignoring _NET_SYSTEM_TRAY_OPCODE(%lu) message because tray is not active\n", tray_data.is_active));
#endif
}
コード例 #8
0
ファイル: ICONS.C プロジェクト: daemqn/Atari_ST_Sources
int add_icon_app(char *name, int save)
	{
	struct _icons_spec_app *tmp_icon=NULL;
	char *mono_mask, *mono_data, *col_mask, *col_data;
	CICONBLK *icon=NULL;

	if(icons_spec_app==NULL)
		tmp_icon = icons_spec_app = calloc(1,sizeof(struct _icons_spec_app));
	else
		{
		tmp_icon = calloc(1,sizeof(struct _icons_spec_app)*(icons_spec_app->no+1L));
		memcpy(tmp_icon, icons_spec_app, sizeof(struct _icons_spec_app) * icons_spec_app->no);
		free(icons_spec_app);
		icons_spec_app = tmp_icon;
		tmp_icon = &icons_spec_app[icons_spec_app->no];
		}

	memset(tmp_icon, 0, sizeof(struct _icons_spec_app));
	tmp_icon->name = calloc(1,strlen(name)+1L);
	memset(tmp_icon->name, 0, strlen(name)+1);
	strcpy(tmp_icon->name, name);
	icons_app.how_many++;

	if(options.stic && stic)
		{
		OBJECT *tmp=NULL;
		int i=(int)strlen(name);
		for(; i>0, name[i]!='\\'; i--)
			;
		tmp = stic->str_icon(&name[++i], STIC_SMALL);
		if(tmp)
			icon = (CICONBLK*)(tmp->ob_spec.ciconblk);
		else
			{
			tmp = stic->str_icon("*.APP", STIC_SMALL|DEFAULT_APP);
			if(tmp)
				icon = (CICONBLK*)(tmp->ob_spec.ciconblk);
			else
				{
				tmp_icon->obj_no = dialog(mini_icons, 1);
				icon = (CICONBLK*)(mini_icons[tmp_icon->obj_no].ob_spec.ciconblk);
				}
			}
		}
	else if(mini_icons!=NULL)
		{
		tmp_icon->obj_no = dialog(mini_icons, 1);
		icon = (CICONBLK*)(mini_icons[tmp_icon->obj_no].ob_spec.ciconblk);
		}
	mono_data = (char*)icon->monoblk.ib_pdata;
	mono_mask = (char*)icon->monoblk.ib_pmask;
	col_data = (char*)icon->mainlist->col_data;
	col_mask = (char*)icon->mainlist->col_mask;

	if(add_icon((void *)icons_spec_app, APP_TRAY, icons_app.how_many, mono_data, mono_mask, col_data, col_mask)==0)
		return(0);
	fix_width();
	move_applications(1);

	_redraw_.type |= RED_ICON_APP;
	_redraw_.x = min0(_redraw_.x, bigbutton[SEPARATOR_1].ob_x);
	_redraw_.y = min0(_redraw_.y, bigbutton->ob_y);
	_redraw_.w = min0(_redraw_.w, bigbutton[SEPARATOR_2].ob_x+10);
	_redraw_.h = min0(_redraw_.h, bigbutton->ob_height);
	SendAV(ap_id, WM_REDRAW, ap_id, RED_ICON, MyTask.whandle, bigbutton[SEPARATOR_1].ob_x, bigbutton->ob_y, bigbutton[SEPARATOR_2].ob_x+10, bigbutton->ob_height);

	if(save==1)
		save_app_icon();

	return(1);
	}
コード例 #9
0
ファイル: ICONS.C プロジェクト: daemqn/Atari_ST_Sources
void load_app_icon(void)
	{
	unsigned long tmp;
	int i, fh, n, len;
	char inf[256]={0};
	char *mono_mask, *mono_data, *col_mask, *col_data;
	CICONBLK *icon=NULL;

	if(	app_icon_mode==1)
		return;
	app_icon_mode = 1;

	strcpy(inf,home);
	strcat(inf,"defaults\\MyTask.ico");
	fh=(int)Fopen(inf,FO_READ);

	if (fh<0L)
		{
		strcpy(inf,home);
		strcat(inf,"MyTask.ico");
		fh=(int)Fopen(inf,FO_READ);
		}

	if (fh>=0L)
		{
		read(fh, &tmp, 4);		n = (int)tmp;
		icons_spec_app = calloc(1,n*sizeof(struct _icons_spec_app));
		memset(icons_spec_app, 0, n*sizeof(struct _icons_spec_app));
		for(i=0; i<n; i++)
			{
			read(fh, &icons_spec_app[i].obj_no, 4);
			read(fh, &tmp, 4);			len = (int)tmp;
			icons_spec_app[i].name = calloc(1,len+1L);
			memset(icons_spec_app[i].name, 0, len+1);
			read(fh, icons_spec_app[i].name, len);
			icons_app.how_many++;

			if(mini_icons!=NULL)
				{
				if(icons_spec_app[i].obj_no<=0)
					{
/*
					OBJECT *tmp=NULL;
					int j=(int)strlen(icons_spec_app[i].name);
					for(; j>0, icons_spec_app[i].name[j]!='\\'; j--)
						;
					if(stic)
						{
						tmp = stic->str_icon(&icons_spec_app[i].name[++j], 2);
						if(tmp)
							icon = (CICONBLK*)(tmp->ob_spec.ciconblk);
						}
					else	*/
						icon = (CICONBLK*)(mini_icons[abs(icons_spec_app[i].obj_no+1)].ob_spec.ciconblk);
					}
				else
					icon = (CICONBLK*)(mini_icons[icons_spec_app[i].obj_no].ob_spec.ciconblk);
				}
			if(stic)				/* Ikonka wzieta ze StIc					*/
				{
				OBJECT *tmp=NULL;
				int j=(int)strlen(icons_spec_app[i].name);
				for(; j>0, icons_spec_app[i].name[j]!='\\'; j--)
					;
				tmp = stic->str_icon(&icons_spec_app[i].name[++j], 2);
				if(tmp)
					icon = (CICONBLK*)(tmp->ob_spec.ciconblk);
				}
			if(icon)				/* Czy mamy jakas ikonke wogole?	*/
				{
				mono_data = (char*)icon->monoblk.ib_pdata;
				mono_mask = (char*)icon->monoblk.ib_pmask;
				col_data = (char*)icon->mainlist->col_data;
				col_mask = (char*)icon->mainlist->col_mask;
				}
			if(icon)
				add_icon((void *)icons_spec_app, APP_TRAY, icons_app.how_many, mono_data, mono_mask, col_data, col_mask);
			}
		if(icon)
			{
			bigbutton->ob_next = -1;
			fix_width();
			move_applications(1);
			icons_spec_app->no = n;
			}
		close(fh);
		}
	}
コード例 #10
0
ファイル: icons.cpp プロジェクト: mtux/sjae
bool icons::load(CoreI *core) {
	core_i = core;
	add_icon("generic", QPixmap(":/icons/Resources/s.png"), "General/default");

	add_icon("dot_blue", QPixmap(":/icons/Resources/c_blue.png"), "General/blue dot");
	add_icon("dot_brown", QPixmap(":/icons/Resources/c_brown.png"), "General/brown dot");
	add_icon("dot_green", QPixmap(":/icons/Resources/c_green.png"), "General/green dot");
	add_icon("dot_lgreen", QPixmap(":/icons/Resources/c_lgreen.png"), "General/light green dot");
	add_icon("dot_grey", QPixmap(":/icons/Resources/c_grey.png"), "General/grey dot");
	add_icon("dot_cyan", QPixmap(":/icons/Resources/c_cyan.png"), "General/cyan dot");
	add_icon("dot_magenta", QPixmap(":/icons/Resources/c_magenta.png"), "General/magenta dot");
	add_icon("dot_red", QPixmap(":/icons/Resources/c_red.png"), "General/red dot");
	add_icon("dot_yellow", QPixmap(":/icons/Resources/c_yellow.png"), "General/yellow dot");
	add_icon("dot_orange", QPixmap(":/icons/Resources/c_orange.png"), "General/orange dot");

	add_icon("message", QPixmap(":/icons/Resources/message.png"), "Messaging/message");
	add_icon("alert", QPixmap(":/icons/Resources/alert.png"), "System/alert");
	add_icon("quit", QApplication::style()->standardIcon(QStyle::SP_TitleBarCloseButton).pixmap(16, 16), "System/quit");
	each_status(gs) {
		add_alias(status_name[gs], def_icon[gs], QString("Status/") + hr_status_name[gs]);
	}
	return true;
}